mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
configitems: register the 'shelve.maxbackups' config
This commit is contained in:
parent
db25c9b563
commit
d1938932c9
@ -63,6 +63,13 @@ command = registrar.command(cmdtable)
|
||||
# leave the attribute unspecified.
|
||||
testedwith = 'ships-with-hg-core'
|
||||
|
||||
configtable = {}
|
||||
configitem = registrar.configitem(configtable)
|
||||
|
||||
configitem('shelve', 'maxbackups',
|
||||
default=10,
|
||||
)
|
||||
|
||||
backupdir = 'shelve-backup'
|
||||
shelvedir = 'shelved'
|
||||
shelvefileextensions = ['hg', 'patch', 'oshelve']
|
||||
@ -271,7 +278,7 @@ class shelvedstate(object):
|
||||
|
||||
def cleanupoldbackups(repo):
|
||||
vfs = vfsmod.vfs(repo.vfs.join(backupdir))
|
||||
maxbackups = repo.ui.configint('shelve', 'maxbackups', 10)
|
||||
maxbackups = repo.ui.configint('shelve', 'maxbackups')
|
||||
hgfiles = [f for f in vfs.listdir()
|
||||
if f.endswith('.' + patchextension)]
|
||||
hgfiles = sorted([(vfs.stat(f).st_mtime, f) for f in hgfiles])
|
||||
|
Loading…
Reference in New Issue
Block a user