changeset 5594:dcadb8b1d098

evolvecmd: reorder some functions to match order they're called
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 25 Sep 2020 13:12:57 -0700
parents 28dc9ac2958a
children e190a81a3ee8
files hgext3rd/evolve/evolvecmd.py
diffstat 1 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Thu Sep 24 16:54:13 2020 -0700
+++ b/hgext3rd/evolve/evolvecmd.py	Fri Sep 25 13:12:57 2020 -0700
@@ -938,6 +938,27 @@
     _finalizerelocate(repo, orig, dest, nodenew, tr, category, evolvestate)
     return nodenew
 
+def _evolvemerge(repo, orig, dest, pctx, keepbranch):
+    """Used by the evolve function to merge dest on top of pctx.
+    return the same tuple as merge.graft"""
+    if repo[b'.'].rev() != dest.rev():
+        compat._update(repo, dest, branchmerge=False, force=True)
+    if repo._activebookmark:
+        repo.ui.status(_(b"(leaving bookmark %s)\n") % repo._activebookmark)
+    bookmarksmod.deactivate(repo)
+    if keepbranch:
+        repo.dirstate.setbranch(orig.branch())
+    if util.safehasattr(repo, 'currenttopic'):
+        # uurrgs
+        # there no other topic setter yet
+        if not orig.topic() and repo.vfs.exists(b'topic'):
+            repo.vfs.unlink(b'topic')
+        else:
+            with repo.vfs.open(b'topic', b'w') as f:
+                f.write(orig.topic())
+
+    return merge.graft(repo, orig, pctx, [b'destination', b'evolving'], True)
+
 def _relocatecommit(repo, orig, commitmsg):
     if commitmsg is None:
         commitmsg = orig.description()
@@ -977,27 +998,6 @@
             bmchanges.append((book, bmdest))
         repo._bookmarks.applychanges(repo, tr, bmchanges)
 
-def _evolvemerge(repo, orig, dest, pctx, keepbranch):
-    """Used by the evolve function to merge dest on top of pctx.
-    return the same tuple as merge.graft"""
-    if repo[b'.'].rev() != dest.rev():
-        compat._update(repo, dest, branchmerge=False, force=True)
-    if repo._activebookmark:
-        repo.ui.status(_(b"(leaving bookmark %s)\n") % repo._activebookmark)
-    bookmarksmod.deactivate(repo)
-    if keepbranch:
-        repo.dirstate.setbranch(orig.branch())
-    if util.safehasattr(repo, 'currenttopic'):
-        # uurrgs
-        # there no other topic setter yet
-        if not orig.topic() and repo.vfs.exists(b'topic'):
-            repo.vfs.unlink(b'topic')
-        else:
-            with repo.vfs.open(b'topic', b'w') as f:
-                f.write(orig.topic())
-
-    return merge.graft(repo, orig, pctx, [b'destination', b'evolving'], True)
-
 instabilities_map = {
     b'contentdivergent': b"content-divergent",
     b'phasedivergent': b"phase-divergent"