mergestate: make clean() only be about creating a clean mergestate
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 17 Sep 2020 09:23:21 -0700
changeset 45493 2c10876bb320
parent 45492 08c6d6962b2a
child 45494 9ea4b52ac6bb
mergestate: make clean() only be about creating a clean mergestate This is similar to the previous patch, but moves the separation one step further out, to `merge.py`. Differential Revision: https://phab.mercurial-scm.org/D9034
mercurial/merge.py
mercurial/mergestate.py
--- a/mercurial/merge.py	Wed Sep 16 10:09:37 2020 -0700
+++ b/mercurial/merge.py	Thu Sep 17 09:23:21 2020 -0700
@@ -1398,9 +1398,8 @@
     _prefetchfiles(repo, mctx, mresult)
 
     updated, merged, removed = 0, 0, 0
-    ms = mergestatemod.mergestate.clean(
-        repo, wctx.p1().node(), mctx.node(), labels
-    )
+    ms = mergestatemod.mergestate.clean(repo)
+    ms.start(wctx.p1().node(), mctx.node(), labels)
 
     for f, op in pycompat.iteritems(mresult.commitinfo):
         # the other side of filenode was choosen while merging, store this in
--- a/mercurial/mergestate.py	Wed Sep 16 10:09:37 2020 -0700
+++ b/mercurial/mergestate.py	Thu Sep 17 09:23:21 2020 -0700
@@ -177,12 +177,11 @@
     statepathv2 = b'merge/state2'
 
     @staticmethod
-    def clean(repo, node=None, other=None, labels=None):
+    def clean(repo):
         """Initialize a brand new merge state, removing any existing state on
         disk."""
         ms = mergestate(repo)
         ms.reset()
-        ms.start(node, other, labels)
         return ms
 
     @staticmethod