Mercurial > public > mercurial-scm > evolve
diff hgext/evolve.py @ 145:928f217c1701
stabilize: stabilize my topological branch only
if not stated otherwize.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Thu, 08 Mar 2012 14:35:57 +0100 |
parents | c2f7a8530e51 |
children | e80a6c8ad452 |
line wrap: on
line diff
--- a/hgext/evolve.py Thu Mar 08 14:15:53 2012 +0100 +++ b/hgext/evolve.py Thu Mar 08 14:35:57 2012 +0100 @@ -163,16 +163,34 @@ @command('^stabilize', [ - ('n', 'dry-run', False, 'Do nothing but printing what should be done') + ('n', 'dry-run', False, 'Do nothing but printing what should be done'), + ('-A', 'any', False, 'Stabilize unstable change on any topological branch'), ], '') def stabilize(ui, repo, **opts): - """move changeset out of they unstable state""" + """move changeset out of they unstable state + + By default only works on changeset that will be rebase on ancestors of the + current working directory parent (included)""" + obsolete = extensions.find('obsolete') - unstable = list(repo.set('unstable()')) + + if opts['any']: + rvstargets = 'unstable()' + else: + rvstargets = 'unstable() and ((suspended() and obsancestors(::.))::)' + + unstable = list(repo.set(rvstargets)) if not unstable: - ui.write_err(_('no unstable changeset\n')) - return 1 + unstable = opts['any'] and () or list(repo.set('unstable()')) + if unstable: + ui.write_err(_('nothing to stabilize here\n')) + ui.status(_('(%i unstable changesets, do you want --any ?)\n') + % len(unstable)) + return 2 + else: + ui.write_err(_('no unstable changeset\n')) + return 1 node = unstable[0] obs = node.parents()[0] if not obs.obsolete():