diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 66a2e62d5..31b1f59dd 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2616,9 +2616,9 @@ class Archiver: group = filters_group.add_mutually_exclusive_group() group.add_argument('--first', dest='first', metavar='N', default=0, type=int, - help='consider first N archives after other filter args were applied') + help='consider first N archives after other filters were applied') group.add_argument('--last', dest='last', metavar='N', default=0, type=int, - help='consider last N archives after other filter args were applied') + help='consider last N archives after other filters were applied') def get_args(self, argv, cmd): """usually, just returns argv, except if we deal with a ssh forced command for borg serve.""" @@ -2687,10 +2687,6 @@ class Archiver: raise Error('The options --first, --last and --prefix can only be used on repository targets.') archives = manifest.archives.list(prefix=args.prefix) - if not archives: - logger.critical('There are no archives.') - self.exit_code = self.exit_code or EXIT_WARNING - return [] for sortkey in reversed(args.sort_by.split(',')): archives.sort(key=attrgetter(sortkey)) diff --git a/src/borg/helpers.py b/src/borg/helpers.py index 541c832eb..4c6b939cf 100644 --- a/src/borg/helpers.py +++ b/src/borg/helpers.py @@ -143,8 +143,9 @@ class Archives(abc.MutableMapping): del self._archives[name] def list(self, sort_by=None, reverse=False, prefix=''): - """ Inexpensive Archive.list_archives replacement if we just need .name, .id, .ts - Returns list of borg.helpers.ArchiveInfo instances + """ + Inexpensive Archive.list_archives replacement if we just need .name, .id, .ts + Returns list of borg.helpers.ArchiveInfo instances """ archives = [x for x in self.values() if x.name.startswith(prefix)] if sort_by is not None: diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index 68e9e7b72..cb79d6b24 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -1826,7 +1826,6 @@ class ArchiverTestCase(ArchiverTestCaseBase): self.cmd('create', self.repository_location + '::test', 'input') self.cmd('delete', '--first', '1', '--last', '1', self.repository_location, fork=True, exit_code=2) - def test_key_export_keyfile(self): export_file = self.output_path + '/exported' self.cmd('init', self.repository_location, '--encryption', 'keyfile')