equal
deleted
inserted
replaced
300 vfs = vfsmod.vfs(repo.vfs.join(backupdir)) |
300 vfs = vfsmod.vfs(repo.vfs.join(backupdir)) |
301 maxbackups = repo.ui.configint('shelve', 'maxbackups') |
301 maxbackups = repo.ui.configint('shelve', 'maxbackups') |
302 hgfiles = [f for f in vfs.listdir() |
302 hgfiles = [f for f in vfs.listdir() |
303 if f.endswith('.' + patchextension)] |
303 if f.endswith('.' + patchextension)] |
304 hgfiles = sorted([(vfs.stat(f)[stat.ST_MTIME], f) for f in hgfiles]) |
304 hgfiles = sorted([(vfs.stat(f)[stat.ST_MTIME], f) for f in hgfiles]) |
305 if 0 < maxbackups and maxbackups < len(hgfiles): |
305 if maxbackups > 0 and maxbackups < len(hgfiles): |
306 bordermtime = hgfiles[-maxbackups][0] |
306 bordermtime = hgfiles[-maxbackups][0] |
307 else: |
307 else: |
308 bordermtime = None |
308 bordermtime = None |
309 for mtime, f in hgfiles[:len(hgfiles) - maxbackups]: |
309 for mtime, f in hgfiles[:len(hgfiles) - maxbackups]: |
310 if mtime == bordermtime: |
310 if mtime == bordermtime: |