changeset 2699:fddaf14783b1 stable

evolve: preserve the branch of the original changeset when evolving merge
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 02 Jul 2017 18:07:23 +0200
parents 6d48ad81e7b5
children 52d5c5ce27e4 a8e22ede5a9a
files README hgext3rd/evolve/__init__.py
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: