evolve: preserve the branch of the original changeset when evolving merge stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 02 Jul 2017 18:07:23 +0200
branchstable
changeset 2699 fddaf14783b1
parent 2698 6d48ad81e7b5
child 2700 52d5c5ce27e4
child 2704 a8e22ede5a9a
evolve: preserve the branch of the original changeset when evolving merge
README
hgext3rd/evolve/__init__.py
--- a/README	Sun Jul 02 17:24:56 2017 +0200
+++ b/README	Sun Jul 02 18:07:23 2017 +0200
@@ -138,6 +138,7 @@
 6.4.1 - in progress
 -------------------
 
+ - evolve: fix branch preservation for merge
  - obsfate: improve support for advanced template reformating
  - split: preserve author of the splitted changeset,
 
--- a/hgext3rd/evolve/__init__.py	Sun Jul 02 17:24:56 2017 +0200
+++ b/hgext3rd/evolve/__init__.py	Sun Jul 02 18:07:23 2017 +0200
@@ -1684,9 +1684,11 @@
                    progresscb=None):
     """Stabilize an unstable changeset"""
     pctx = orig.p1()
+    keepbranch = orig.p1().branch() != orig.branch()
     if len(orig.parents()) == 2:
         if not pctx.obsolete():
             pctx = orig.p2()  # second parent is obsolete ?
+            keepbranch = orig.p2().branch() != orig.branch()
         elif orig.p2().obsolete():
             hint = _("Redo the merge (%s) and use `hg prune <old> "
                      "--succ <new>` to obsolete the old one") % orig.hex()[:12]
@@ -1744,7 +1746,6 @@
         repo.ui.note(todo)
         if progresscb:
             progresscb()
-        keepbranch = orig.p1().branch() != orig.branch()
         try:
             relocate(repo, orig, target, pctx, keepbranch)
         except MergeFailure: