Mercurial > public > mercurial-scm > evolve
diff hgext/evolve.py @ 636:27c890b4f864 stable
evolve: make evolve smarter
It is not more confused by killed changeset and can also choose to stabilise '.'
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Wed, 02 Jan 2013 12:15:56 +0100 |
parents | 896463193675 |
children | 8e41d5b78dff |
line wrap: on
line diff
--- a/hgext/evolve.py Wed Jan 02 11:52:22 2013 +0100 +++ b/hgext/evolve.py Wed Jan 02 12:15:56 2013 +0100 @@ -1152,22 +1152,27 @@ """ def selfanddescendants(repo, pctx): yield pctx + for prec in repo.set('allprecursors(%d)', pctx): + yield prec for ctx in pctx.descendants(): yield ctx + for prec in repo.set('allprecursors(%d)', ctx): + yield prec # Look for an unstable which can be stabilized as a child of # node. The unstable must be a child of one of node predecessors. for ctx in selfanddescendants(repo, pctx): - unstables = list(repo.set('unstable() and children(allprecursors(%d))', - ctx.rev())) - if unstables: - return unstables[0] + for child in ctx.children(): + if child.unstable(): + return child return None def _solveunstable(ui, repo, orig, dryrun=False): """Stabilize a unstable changeset""" obs = orig.parents()[0] if not obs.obsolete(): + print obs.rev(), orig.parents() + print orig.rev() obs = orig.parents()[1] assert obs.obsolete() newer = successorssets(repo, obs.node())