hgext/shelve.py
changeset 40029 e2697acd9381
parent 39889 d9ba836fc234
child 40293 c303d65d2e34
equal deleted inserted replaced
40028:51f10e6d66c7 40029:e2697acd9381
   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: