evolve: add evolvestate as an argument to evolvecmd.relocate()
authorPulkit Goyal <7895pulkit@gmail.com>
Wed, 28 Mar 2018 17:33:54 +0530
changeset 3638 7bc4a72b8a0b
parent 3637 1b9c2720faee
child 3639 95a767b2769e
evolve: add evolvestate as an argument to evolvecmd.relocate() This will help us in passing it to _finalizerelocate() and store the bookmark changes which happend.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Wed Mar 28 17:13:08 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Mar 28 17:33:54 2018 +0530
@@ -168,7 +168,8 @@
         if progresscb:
             progresscb()
         try:
-            newid = relocate(repo, orig, target, pctx, keepbranch, 'orphan')
+            newid = relocate(repo, orig, target, evolvestate, pctx,
+                             keepbranch, 'orphan')
             return (True, newid)
         except MergeFailure:
             ops = {'current': orig.node()}
@@ -236,7 +237,8 @@
         repo.ui.status(
             _('rebasing to destination parent: %s\n') % prec.p1())
         try:
-            tmpid = relocate(repo, bumped, prec.p1(), category='phasedivergent')
+            tmpid = relocate(repo, bumped, prec.p1(), evolvestate,
+                             category='phasedivergent')
             if tmpid is not None:
                 tmpctx = repo[tmpid]
                 compat.createmarkers(repo, [(bumped, (tmpctx,))],
@@ -479,7 +481,8 @@
     ordering.extend(sorted(dependencies))
     return ordering
 
-def relocate(repo, orig, dest, pctx=None, keepbranch=False, category=None):
+def relocate(repo, orig, dest, evolvestate, pctx=None, keepbranch=False,
+             category=None):
     """rewrites the orig rev on dest rev
 
     returns the node of new commit which is formed