changeset 3635:debd2f974be5

evolve: pass the instability category to relocate() and _finalizerelocate() This patch adds category argument to relocate() and _finalizerelocate() functions to take the type of instability which we are processing so that we perform actions accordingly.
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 28 Mar 2018 13:48:34 +0530
parents a9fed41c6bed
children 92a2d3217de9
files hgext3rd/evolve/evolvecmd.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Wed Mar 28 12:56:35 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Mar 28 13:48:34 2018 +0530
@@ -168,7 +168,7 @@
         if progresscb:
             progresscb()
         try:
-            newid = relocate(repo, orig, target, pctx, keepbranch)
+            newid = relocate(repo, orig, target, pctx, keepbranch, 'orphan')
             return (True, newid)
         except MergeFailure:
             ops = {'current': orig.node()}
@@ -236,7 +236,7 @@
         repo.ui.status(
             _('rebasing to destination parent: %s\n') % prec.p1())
         try:
-            tmpid = relocate(repo, bumped, prec.p1())
+            tmpid = relocate(repo, bumped, prec.p1(), category='phasedivergent')
             if tmpid is not None:
                 tmpctx = repo[tmpid]
                 compat.createmarkers(repo, [(bumped, (tmpctx,))],
@@ -479,7 +479,7 @@
     ordering.extend(sorted(dependencies))
     return ordering
 
-def relocate(repo, orig, dest, pctx=None, keepbranch=False):
+def relocate(repo, orig, dest, pctx=None, keepbranch=False, category=None):
     """rewrites the orig rev on dest rev
 
     returns the node of new commit which is formed
@@ -544,7 +544,7 @@
         exc.__class__ = LocalMergeFailure
         tr.close() # to keep changes in this transaction (e.g. dirstate)
         raise
-    _finalizerelocate(repo, orig, dest, nodenew, tr)
+    _finalizerelocate(repo, orig, dest, nodenew, tr, category)
     return nodenew
 
 def _relocatecommit(repo, orig, commitmsg):
@@ -566,7 +566,7 @@
         repo.ui.restoreconfig(backup)
     return nodenew
 
-def _finalizerelocate(repo, orig, dest, nodenew, tr):
+def _finalizerelocate(repo, orig, dest, nodenew, tr, category):
     destbookmarks = repo.nodebookmarks(dest.node())
     nodesrc = orig.node()
     oldbookmarks = repo.nodebookmarks(nodesrc)