Patchwork [6,of,7,evolve-ext] _evolvemerge

login
register
mail settings
Submitter Shusen LIU
Date Dec. 7, 2015, 1:46 a.m.
Message ID <a4d5a278c733fb3c8f06.1449452811@dev1221.lla1.facebook.com>
Download mbox | patch
Permalink /patch/11883/
State Rejected, archived
Delegated to: Laurent Charignon
Headers show

Comments

Shusen LIU - Dec. 7, 2015, 1:46 a.m.
# HG changeset patch
# User Shusen LIU <liushusen@fb.com>
# Date 1449451207 28800
#      Sun Dec 06 17:20:07 2015 -0800
# Node ID a4d5a278c733fb3c8f06bc857dc401349f6e9697
# Parent  9f7719e2c063075b0ec9e938ad2bb78fb0415d6c
_evolvemerge

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -942,14 +942,7 @@ 
     tr = repo.transaction('relocate')
     try:
         try:
-            if repo['.'].rev() != dest.rev():
-                merge.update(repo, dest, False, True, False)
-            if bmactive(repo):
-                repo.ui.status(_("(leaving bookmark %s)\n") % bmactive(repo))
-            bmdeactivate(repo)
-            if keepbranch:
-                repo.dirstate.setbranch(orig.branch())
-            r = merge.graft(repo, orig, orig.p1(), ['local', 'graft'])
+            r = _evolvemerge(repo, orig, dest,keepbranch)
             if r[-1]:  #some conflict
                 raise error.Abort(
                         'unresolved merge conflicts (see hg help resolve)')
@@ -3687,3 +3680,14 @@ 
 def _evolvestatewrite(repo, data):
     repo.vfs.write('evolvestate',
                     '|'.join([data['orig'], data['dest'], data['commitmsg']]))
+
+def _evolvemerge(repo, orig, dest, keepbranch):
+    if repo['.'].rev() != dest.rev():
+        merge.update(repo, dest, False, True, False)
+    if bmactive(repo):
+        repo.ui.status(_("(leaving bookmark %s)\n") % bmactive(repo))
+    bmdeactivate(repo)
+    if keepbranch:
+        repo.dirstate.setbranch(orig.branch())
+    r = merge.graft(repo, orig, orig.p1(), ['local', 'graft'])
+    return r