Show More
@@ -325,19 +325,17 b' class shelvedstate(object):' | |||
|
325 | 325 | def cleanupoldbackups(repo): |
|
326 | 326 | vfs = vfsmod.vfs(repo.vfs.join(backupdir)) |
|
327 | 327 | maxbackups = repo.ui.configint(b'shelve', b'maxbackups') |
|
328 | hgfiles = [f for f in vfs.listdir() if f.endswith(b'.' + patchextension)] | |
|
329 | hgfiles = sorted([(vfs.stat(f)[stat.ST_MTIME], f) for f in hgfiles]) | |
|
328 | hgfiles = listshelves(vfs) | |
|
330 | 329 | if maxbackups > 0 and maxbackups < len(hgfiles): |
|
331 |
bordermtime = hgfiles[- |
|
|
330 | bordermtime = hgfiles[maxbackups - 1][0] | |
|
332 | 331 | else: |
|
333 | 332 | bordermtime = None |
|
334 |
for mtime, |
|
|
333 | for mtime, name in hgfiles[maxbackups:]: | |
|
335 | 334 | if mtime == bordermtime: |
|
336 | 335 | # keep it, because timestamp can't decide exact order of backups |
|
337 | 336 | continue |
|
338 | base = f[: -(1 + len(patchextension))] | |
|
339 | 337 | for ext in shelvefileextensions: |
|
340 |
vfs.tryunlink( |
|
|
338 | vfs.tryunlink(name + b'.' + ext) | |
|
341 | 339 | |
|
342 | 340 | |
|
343 | 341 | def _backupactivebookmark(repo): |
General Comments 0
You need to be logged in to leave comments.
Login now