From patchwork Thu Sep 17 20:11:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D9034: mergestate: make clean() only be about creating a clean mergestate From: phabricator X-Patchwork-Id: 47199 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Thu, 17 Sep 2020 20:11:09 +0000 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 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