mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 01:37:20 +00:00
fix reversed archive ordering with --last
This commit is contained in:
parent
c624e715ad
commit
51c1c22c1f
1 changed files with 6 additions and 3 deletions
|
@ -231,10 +231,13 @@ def list(self, sort_by=(), reverse=False, glob=None, first=None, last=None):
|
|||
archives = [x for x in self.values() if regex.match(x.name) is not None]
|
||||
for sortkey in reversed(sort_by):
|
||||
archives.sort(key=attrgetter(sortkey))
|
||||
if reverse or last:
|
||||
if reverse:
|
||||
archives.reverse()
|
||||
n = first or last or len(archives)
|
||||
return archives[:n]
|
||||
if first:
|
||||
archives = archives[:first]
|
||||
elif last:
|
||||
archives = archives[len(archives) - last:]
|
||||
return archives
|
||||
|
||||
def list_considering(self, args):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue