evolve: factor out logic to merge content divergent csets in separate fn
authorPulkit Goyal <7895pulkit@gmail.com>
Thu, 07 Jun 2018 18:13:54 +0530
changeset 3808 e6c0f45d51ed
parent 3807 03ccdc753582
child 3809 f06ff8fee2f6
evolve: factor out logic to merge content divergent csets in separate fn This will help us in reusing the logic if we need to while doing evolve --continue.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Thu Jun 07 20:27:03 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Thu Jun 07 18:13:54 2018 +0530
@@ -449,6 +449,13 @@
                             keepbranch=True)
         other = repo[newother]
 
+    _mergecontentdivergents(repo, progresscb, divergent, other, base,
+                            evolvestate)
+    return _completecontentdivergent(ui, repo, progresscb, divergent, other,
+                                     base, evolvestate)
+
+def _mergecontentdivergents(repo, progresscb, divergent, other, base,
+                            evolvestate):
     if divergent not in repo[None].parents():
         repo.ui.status(_("updating to \"local\" side of the conflict: %s\n") %
                        divergent.hex()[:12])
@@ -474,9 +481,6 @@
         raise error.Abort(_("fix conflicts and run 'hg evolve --continue' or"
                             " use 'hg update -C .' to abort"))
 
-    return _completecontentdivergent(ui, repo, progresscb, divergent, other,
-                                     base, evolvestate)
-
 def _completecontentdivergent(ui, repo, progresscb, divergent, other,
                               base, evolvestate):
     """completes the content-divergence resolution"""