[Updated] [+- ] D12154: filemerge: move check for identical sides out of filemerge()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Feb 11 02:56:15 UTC 2022


martinvonz updated this revision to Diff 32141.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D12154?vs=32106&id=32141

BRANCH
  default

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

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

AFFECTED FILES
  mercurial/filemerge.py
  mercurial/mergestate.py
  tests/test-largefiles-misc.t

CHANGE DETAILS

diff --git a/tests/test-largefiles-misc.t b/tests/test-largefiles-misc.t
--- a/tests/test-largefiles-misc.t
+++ b/tests/test-largefiles-misc.t
@@ -962,7 +962,7 @@
   what do you want to do? l
   getting changed largefiles
   1 largefiles updated, 0 removed
-  0 files updated, 4 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 3 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ cat f-different
   1
diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -421,6 +421,14 @@
             self._restore_backup(wctx[dfile], localkey, flags)
         else:
             wctx[dfile].remove(ignoremissing=True)
+
+        if not fco.cmp(fcd):  # files identical?
+            # If return value of merge is None, then there are no real conflict
+            del self._state[dfile]
+            self._results[dfile] = None, None
+            self._dirty = True
+            return None
+
         merge_ret, deleted = filemerge.filemerge(
             self._repo,
             wctx,
@@ -431,12 +439,6 @@
             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]
-            self._results[dfile] = None, None
-            self._dirty = True
-            return None
 
         if not merge_ret:
             self.mark(dfile, MERGE_RECORD_RESOLVED)
diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -989,10 +989,6 @@
 
     Returns whether the merge is complete, the return value of the merge, and
     a boolean indicating whether the file was deleted from disk."""
-
-    if not fco.cmp(fcd):  # files identical?
-        return None, False
-
     ui = repo.ui
     fd = fcd.path()
     uipathfn = scmutil.getuipathfn(repo)



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


More information about the Mercurial-patches mailing list