Patchwork D9034: mergestate: make clean() only be about creating a clean mergestate

login
register
mail settings
Submitter phabricator
Date Sept. 17, 2020, 8:11 p.m.
Message ID <differential-rev-PHID-DREV-jpqoarfxks5hsegrq42l-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47199/
State Superseded
Headers show

Comments

phabricator - Sept. 17, 2020, 8:11 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is similar to the previous patch, but moves the separation one
  step further out, to `merge.py`.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9034

AFFECTED FILES
  mercurial/merge.py
  mercurial/mergestate.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -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
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -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