Mercurial > evolve
comparison hgext/evolve.py @ 1220:71240f696f26
strip: add the option for wrapping the strip command
Adds an experimental option for wrapping the existing strip command and
replacing its functionality with prune. It currently doesn't handle the --keep
case, but an upcoming patch will address that.
author | Durham Goode <durham@fb.com> |
---|---|
date | Thu, 19 Mar 2015 12:31:51 -0700 |
parents | 658b0d032699 |
children | 524dbc8ffeac |
comparison
equal
deleted
inserted
replaced
1219:658b0d032699 | 1220:71240f696f26 |
---|---|
2094 return result | 2094 return result |
2095 finally: | 2095 finally: |
2096 if lock is not None: | 2096 if lock is not None: |
2097 lock.release() | 2097 lock.release() |
2098 | 2098 |
2099 @eh.wrapcommand('strip', extension='strip', opts=[ | |
2100 ('', 'bundle', None, _("delete the commit entirely and move it to a " | |
2101 "backup bundle")), | |
2102 ]) | |
2103 def stripwrapper(orig, ui, repo, *revs, **kwargs): | |
2104 if (not ui.configbool('experimental', 'prunestrip') or | |
2105 kwargs.get('bundle', False)): | |
2106 return orig(ui, repo, *revs, **kwargs) | |
2107 | |
2108 if kwargs.get('force'): | |
2109 ui.warn(_("warning: --force has no effect during strip with evolve " | |
2110 "enabled\n")) | |
2111 if kwargs.get('no_backup', False): | |
2112 ui.warn(_("warning: --no-backup has no effect during strips with " | |
2113 "evolve enabled\n")) | |
2114 | |
2115 revs = list(revs) + kwargs.pop('rev', []) | |
2116 revs = set(scmutil.revrange(repo, revs)) | |
2117 revs = repo.revs("(%ld)::", revs) | |
2118 kwargs['rev'] = [] | |
2119 kwargs['new'] = [] | |
2120 kwargs['succ'] = [] | |
2121 kwargs['biject'] = False | |
2122 return cmdprune(ui, repo, *revs, **kwargs) | |
2123 | |
2099 @command('^touch', | 2124 @command('^touch', |
2100 [('r', 'rev', [], 'revision to update'), | 2125 [('r', 'rev', [], 'revision to update'), |
2101 ('D', 'duplicate', False, | 2126 ('D', 'duplicate', False, |
2102 'do not mark the new revision as successor of the old one')], | 2127 'do not mark the new revision as successor of the old one')], |
2103 # allow to choose the seed ? | 2128 # allow to choose the seed ? |