D8569: merge: get mergestate from context instead of directly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

D8569: merge: get mergestate from context instead of directly

valentin.gatienbaron (Valentin Gatien-Baron)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This causes `hg fix` (and probably others) to use the new in-memory mergestate
  object instead of the on-disk one, which may incidentally correct some
  defects.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1182,9 +1182,8 @@
     _prefetchfiles(repo, mctx, actions)
 
     updated, merged, removed = 0, 0, 0
-    ms = mergestatemod.mergestate.clean(
-        repo, wctx.p1().node(), mctx.node(), labels
-    )
+    ms = wctx.mergestate(clean=True)
+    ms.reset(wctx.p1().node(), mctx.node(), labels)
 
     # add ACTION_GET_OTHER_AND_STORE to mergestate
     for e in actions[mergestatemod.ACTION_GET_OTHER_AND_STORE]:
@@ -1593,7 +1592,7 @@
         if not overwrite:
             if len(pl) > 1:
                 raise error.Abort(_(b"outstanding uncommitted merge"))
-            ms = mergestatemod.mergestate.read(repo)
+            ms = wc.mergestate()
             if ms.unresolvedcount():
                 raise error.Abort(
                     _(b"outstanding merge conflicts"),



To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel