Commits

Pierre-Yves David committed b98490b

stabilize: handle killed changeset in stabilize.

Comments (0)

Files changed (2)

         obs = orig.parents()[1]
     assert obs.obsolete()
     newer = obsolete.newerversion(repo, obs.node())
+    # search of a parent which is not killed
+    while newer == [()]:
+        ui.debug("stabilize target %s is plain dead,"
+                 " trying to stabilize on it's parent")
+        obs = obs.parents()[0]
+        newer = obsolete.newerversion(repo, obs.node())
     if len(newer) > 1:
         ui.write_err(_("conflict rewriting. can't choose destination\n"))
         return 2
     targets = newer[0]
-    if not targets:
-        ui.write_err(_("does not handle kill parent yet\n"))
-        return 2
+    assert targets
     if len(targets) > 1:
         ui.write_err(_("does not handle splitted parent yet\n"))
         return 2

tests/test-tutorial.t

   $ hg log -r 'unstable()'
   ae45c0c3092a (draft): SPAM SPAM SPAM
 
-# XXX make prune stabilization works
-#  $ hg stabilize --any
-#  merging shopping
-
-  $ hg graft -O ae45c0c3092a
-  grafting revision 17
+  $ hg stabilize --any
+  move:[17] SPAM SPAM SPAM
+  atop:[14] bathroom stuff
   merging shopping
 
   $ hg log -G
-  @  20de1fb1cec5 (draft): SPAM SPAM SPAM
+  @  d6717f710962 (draft): SPAM SPAM SPAM
   |
   o  ffa278c50818 (draft): bathroom stuff
   |