[Updated] D11858: filemerge: merge `premerge()` into `filemerge()`

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Dec 8 08:18:08 UTC 2021


Closed by commit rHG921853391276: filemerge: merge `premerge()` into `filemerge()` (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11858?vs=31310&id=31382

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11858/new/

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

AFFECTED FILES
  mercurial/filemerge.py
  mercurial/mergestate.py

CHANGE DETAILS

diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -354,7 +354,7 @@
             self._restore_backup(wctx[dfile], localkey, flags)
         else:
             wctx[dfile].remove(ignoremissing=True)
-        complete, merge_ret, deleted = filemerge.premerge(
+        complete, merge_ret, deleted = filemerge.filemerge(
             self._repo,
             wctx,
             self._local,
@@ -364,17 +364,6 @@
             fca,
             labels=self._labels,
         )
-        if not complete:
-            complete, merge_ret, deleted = filemerge.filemerge(
-                self._repo,
-                wctx,
-                self._local,
-                lfile,
-                fcd,
-                fco,
-                fca,
-                labels=self._labels,
-            )
         if merge_ret is None:
             # If return value of merge is None, then there are no real conflict
             del self._state[dfile]
diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -1277,16 +1277,15 @@
     return repo.wjoin(ctx.path())
 
 
-def premerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
-    return _filemerge(
+def filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
+    complete, merge_ret, deleted = _filemerge(
         True, repo, wctx, mynode, orig, fcd, fco, fca, labels=labels
     )
-
-
-def filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
-    return _filemerge(
-        False, repo, wctx, mynode, orig, fcd, fco, fca, labels=labels
-    )
+    if not complete:
+        complete, merge_ret, deleted = _filemerge(
+            False, repo, wctx, mynode, orig, fcd, fco, fca, labels=labels
+        )
+    return complete, merge_ret, deleted
 
 
 def loadinternalmerge(ui, extname, registrarobj):



To: martinvonz, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211208/b42f3fdc/attachment-0002.html>


More information about the Mercurial-patches mailing list