1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-23 08:16:54 +00:00

Correct a theoretical bug in helpers.prune_split

This commit is contained in:
Dan Christensen 2014-02-02 23:44:04 -05:00
parent c45aedf480
commit 13863e64f8

View file

@ -99,8 +99,9 @@ def prune_split(archives, pattern, n, skip=[]):
items.setdefault(key, []) items.setdefault(key, [])
items[key].append(a) items[key].append(a)
for key, values in sorted(items.items(), reverse=True): for key, values in sorted(items.items(), reverse=True):
if n and values[0] not in skip: if n:
values.sort(key=attrgetter('ts'), reverse=True) values.sort(key=attrgetter('ts'), reverse=True)
if values[0] not in skip:
keep.append(values[0]) keep.append(values[0])
n -= 1 n -= 1
return keep return keep