diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 85a7d8e81..dfdffc7d7 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -617,20 +617,20 @@ class Archiver: self.print_error("Got Ctrl-C / SIGINT.") else: archive.save(comment=args.comment, timestamp=args.timestamp, stats=archive.stats) - args.stats |= args.json - if args.stats: - if args.json: - json_print(basic_json_data(manifest, cache=cache, extra={ - 'archive': archive, - })) - else: - log_multi(DASHES, - str(archive), - DASHES, - STATS_HEADER, - str(archive.stats), - str(cache), - DASHES, logger=logging.getLogger('borg.output.stats')) + args.stats |= args.json + if args.stats: + if args.json: + json_print(basic_json_data(manifest, cache=cache, extra={ + 'archive': archive, + })) + else: + log_multi(DASHES, + str(archive), + DASHES, + STATS_HEADER, + str(archive.stats), + str(cache), + DASHES, logger=logging.getLogger('borg.output.stats')) self.output_filter = args.output_filter self.output_list = args.output_list diff --git a/src/borg/helpers/manifest.py b/src/borg/helpers/manifest.py index a8061aaaa..0703b4123 100644 --- a/src/borg/helpers/manifest.py +++ b/src/borg/helpers/manifest.py @@ -74,7 +74,7 @@ class Archives(abc.MutableMapping): name = safe_encode(name) del self._archives[name] - def list(self, *, glob=None, match_end=r'\Z', sort_by=(), consider_checkpoints=False, first=None, last=None, reverse=False): + def list(self, *, glob=None, match_end=r'\Z', sort_by=(), consider_checkpoints=True, first=None, last=None, reverse=False): """ Return list of ArchiveInfo instances according to the parameters. @@ -82,6 +82,10 @@ class Archives(abc.MutableMapping): Apply *first* and *last* filters, and then possibly *reverse* the list. *sort_by* is a list of sort keys applied in reverse order. + + Note: for better robustness, all filtering / limiting parameters must default to + "not limit / not filter", so a FULL archive list is produced by a simple .list(). + some callers EXPECT to iterate over all archives in a repo for correct operation. """ if isinstance(sort_by, (str, bytes)): raise TypeError('sort_by must be a sequence of str')