Show More
@@ -63,6 +63,13 b' command = registrar.command(cmdtable)' | |||||
63 | # leave the attribute unspecified. |
|
63 | # leave the attribute unspecified. | |
64 | testedwith = 'ships-with-hg-core' |
|
64 | testedwith = 'ships-with-hg-core' | |
65 |
|
65 | |||
|
66 | configtable = {} | |||
|
67 | configitem = registrar.configitem(configtable) | |||
|
68 | ||||
|
69 | configitem('shelve', 'maxbackups', | |||
|
70 | default=10, | |||
|
71 | ) | |||
|
72 | ||||
66 | backupdir = 'shelve-backup' |
|
73 | backupdir = 'shelve-backup' | |
67 | shelvedir = 'shelved' |
|
74 | shelvedir = 'shelved' | |
68 | shelvefileextensions = ['hg', 'patch', 'oshelve'] |
|
75 | shelvefileextensions = ['hg', 'patch', 'oshelve'] | |
@@ -271,7 +278,7 b' class shelvedstate(object):' | |||||
271 |
|
278 | |||
272 | def cleanupoldbackups(repo): |
|
279 | def cleanupoldbackups(repo): | |
273 | vfs = vfsmod.vfs(repo.vfs.join(backupdir)) |
|
280 | vfs = vfsmod.vfs(repo.vfs.join(backupdir)) | |
274 |
maxbackups = repo.ui.configint('shelve', 'maxbackups' |
|
281 | maxbackups = repo.ui.configint('shelve', 'maxbackups') | |
275 | hgfiles = [f for f in vfs.listdir() |
|
282 | hgfiles = [f for f in vfs.listdir() | |
276 | if f.endswith('.' + patchextension)] |
|
283 | if f.endswith('.' + patchextension)] | |
277 | hgfiles = sorted([(vfs.stat(f).st_mtime, f) for f in hgfiles]) |
|
284 | hgfiles = sorted([(vfs.stat(f).st_mtime, f) for f in hgfiles]) |
General Comments 0
You need to be logged in to leave comments.
Login now