diff hgext/evolve.py @ 1157:5951969400ce stable

evolve: fix selection of changeset to evolve from the middle of a stack (issue4434) The evolve algorithm picked a bad changesets to evolve (unstable changeset with no obsolete parent (but unstable parent). And then get confused assuming that is the first parent was not obsolete, the second should be. This changeset fixed the issue by preventing selection of direct descendant of [.] when evolving.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 11 Nov 2014 12:38:49 +0000
parents 4241a5162de7
children 04bd66779a1f e29a813f6af5
line wrap: on
line diff
--- a/hgext/evolve.py	Tue Nov 11 11:28:01 2014 +0000
+++ b/hgext/evolve.py	Tue Nov 11 12:38:49 2014 +0000
@@ -1191,7 +1191,6 @@
                     displayer.show(ctx)
 
                 if dryrunopt:
-                    print 'hg update %s' % ctx.rev()
                     return 0
                 else:
                     res = hg.update(repo, ctx.rev())
@@ -1303,9 +1302,12 @@
 
     # Look for an unstable which can be stabilized as a child of
     # node. The unstable must be a child of one of node predecessors.
+    directdesc = set([pctx.rev()])
     for ctx in selfanddescendants(repo, pctx):
         for child in ctx.children():
-            if child.unstable():
+            if ctx.rev() in directdesc and not child.obsolete():
+                directdesc.add(child.rev())
+            elif child.unstable():
                 return child
     return None
 
@@ -1314,9 +1316,7 @@
     """Stabilize a unstable changeset"""
     obs = orig.parents()[0]
     if not obs.obsolete():
-        print obs.rev(), orig.parents()
-        print orig.rev()
-        obs = orig.parents()[1]
+        obs = orig.parents()[1] # second parent is obsolete ?
     assert obs.obsolete()
     newer = obsolete.successorssets(repo, obs.node())
     # search of a parent which is not killed