evolve: make evolve smarter
It is not more confused by killed changeset and can also choose to stabilise '.'
--- a/README Wed Jan 02 11:52:22 2013 +0100
+++ b/README Wed Jan 02 12:15:56 2013 +0100
@@ -46,6 +46,10 @@
Changelog
==================
+2.2.0 --
+
+- make evolve smarter at picking next troubled to solved without --any
+
2.1.0 -- 2012-12-03
- qsync fixes
--- 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())
--- a/tests/test-tutorial.t Wed Jan 02 11:52:22 2013 +0100
+++ b/tests/test-tutorial.t Wed Jan 02 12:15:56 2013 +0100
@@ -737,7 +737,7 @@
$ hg log -r 'unstable()'
ae45c0c3092a (draft): SPAM SPAM SPAM
- $ hg evolve --any
+ $ hg evolve
move:[17] SPAM SPAM SPAM
atop:[14] bathroom stuff
merging shopping