changeset 45504:2c10876bb320

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
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 17 Sep 2020 09:23:21 -0700
parents 08c6d6962b2a
children 9ea4b52ac6bb
files mercurial/merge.py mercurial/mergestate.py
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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