Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/debugcommands.py @ 41092:a59a74721c76
debugupgraderepo: add a --no-backup mode
The process has been around for a while and is pretty safe now. Having an
automated way to clean up the old data is useful when running many different
conversion to compare delta algorithm.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 21 Dec 2018 13:17:58 +0100 |
parents | 24cb8a6d4c20 |
children | 876494fd967d |
comparison
equal
deleted
inserted
replaced
41091:5608b5a6c323 | 41092:a59a74721c76 |
---|---|
2749 repo.updatecaches(full=True) | 2749 repo.updatecaches(full=True) |
2750 | 2750 |
2751 @command('debugupgraderepo', [ | 2751 @command('debugupgraderepo', [ |
2752 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')), | 2752 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')), |
2753 ('', 'run', False, _('performs an upgrade')), | 2753 ('', 'run', False, _('performs an upgrade')), |
2754 ('', 'backup', True, _('keep the old repository content around')), | |
2754 ]) | 2755 ]) |
2755 def debugupgraderepo(ui, repo, run=False, optimize=None): | 2756 def debugupgraderepo(ui, repo, run=False, optimize=None, backup=True): |
2756 """upgrade a repository to use different features | 2757 """upgrade a repository to use different features |
2757 | 2758 |
2758 If no arguments are specified, the repository is evaluated for upgrade | 2759 If no arguments are specified, the repository is evaluated for upgrade |
2759 and a list of problems and potential optimizations is printed. | 2760 and a list of problems and potential optimizations is printed. |
2760 | 2761 |
2769 repository data is swapped in. This window will be as long as it takes to | 2770 repository data is swapped in. This window will be as long as it takes to |
2770 rename some directories inside the ``.hg`` directory. On most machines, this | 2771 rename some directories inside the ``.hg`` directory. On most machines, this |
2771 should complete almost instantaneously and the chances of a consumer being | 2772 should complete almost instantaneously and the chances of a consumer being |
2772 unable to access the repository should be low. | 2773 unable to access the repository should be low. |
2773 """ | 2774 """ |
2774 return upgrade.upgraderepo(ui, repo, run=run, optimize=optimize) | 2775 return upgrade.upgraderepo(ui, repo, run=run, optimize=optimize, |
2776 backup=backup) | |
2775 | 2777 |
2776 @command('debugwalk', cmdutil.walkopts, _('[OPTION]... [FILE]...'), | 2778 @command('debugwalk', cmdutil.walkopts, _('[OPTION]... [FILE]...'), |
2777 inferrepo=True) | 2779 inferrepo=True) |
2778 def debugwalk(ui, repo, *pats, **opts): | 2780 def debugwalk(ui, repo, *pats, **opts): |
2779 """show how files match on given patterns""" | 2781 """show how files match on given patterns""" |