[Updated] D11859: filemerge: make `_filemerge()` do both premerge and merge

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


Closed by commit rHG6b1049d71c3e: filemerge: make `_filemerge()` do both premerge and merge (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/D11859?vs=31311&id=31383

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

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

AFFECTED FILES
  hgext/largefiles/overrides.py
  mercurial/filemerge.py
  tests/test-graft.t
  tests/test-merge-criss-cross.t
  tests/test-merge-tools.t
  tests/test-merge7.t
  tests/test-rename-merge2.t
  tests/test-subrepo.t
  tests/test-up-local-change.t

CHANGE DETAILS

diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t
--- a/tests/test-up-local-change.t
+++ b/tests/test-up-local-change.t
@@ -50,8 +50,6 @@
   picked tool 'true' for a (binary False symlink False changedelete False)
   merging a
   my a at c19d34741b0a+ other a at 1e71731e6fbb ancestor a at c19d34741b0a
-  picked tool 'true' for a (binary False symlink False changedelete False)
-  my a at c19d34741b0a+ other a at 1e71731e6fbb ancestor a at c19d34741b0a
   launching merge tool: true *$TESTTMP/r2/a* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -75,8 +73,6 @@
   picked tool 'true' for a (binary False symlink False changedelete False)
   merging a
   my a at 1e71731e6fbb+ other a at c19d34741b0a ancestor a at 1e71731e6fbb
-  picked tool 'true' for a (binary False symlink False changedelete False)
-  my a at 1e71731e6fbb+ other a at c19d34741b0a ancestor a at 1e71731e6fbb
   launching merge tool: true *$TESTTMP/r2/a* * * (glob)
   merge tool returned: 0
   0 files updated, 1 files merged, 1 files removed, 0 files unresolved
@@ -97,8 +93,6 @@
   picked tool 'true' for a (binary False symlink False changedelete False)
   merging a
   my a at c19d34741b0a+ other a at 1e71731e6fbb ancestor a at c19d34741b0a
-  picked tool 'true' for a (binary False symlink False changedelete False)
-  my a at c19d34741b0a+ other a at 1e71731e6fbb ancestor a at c19d34741b0a
   launching merge tool: true *$TESTTMP/r2/a* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -321,8 +321,6 @@
   picked tool ':merge' for t (binary False symlink False changedelete False)
   merging t
   my t at 20a0db6fbf6c+ other t at 7af322bc1198 ancestor t at 6747d179aa9a
-  picked tool ':merge' for t (binary False symlink False changedelete False)
-  my t at 20a0db6fbf6c+ other t at 7af322bc1198 ancestor t at 6747d179aa9a
   warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -97,8 +97,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at e300d1c794ec+ other rev at 4ce40f5aca24 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at e300d1c794ec+ other rev at 4ce40f5aca24 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -136,8 +134,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 86a2aa42fc76+ other rev at f4db7e329e71 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 86a2aa42fc76+ other rev at f4db7e329e71 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -175,8 +171,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at e300d1c794ec+ other rev at bdb19105162a ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at e300d1c794ec+ other rev at bdb19105162a ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -212,8 +206,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 02963e448370+ other rev at f4db7e329e71 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 02963e448370+ other rev at f4db7e329e71 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -244,8 +236,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 94b33a1b7f2d+ other rev at 4ce40f5aca24 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 94b33a1b7f2d+ other rev at 4ce40f5aca24 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -275,8 +265,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 86a2aa42fc76+ other rev at 97c705ade336 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 86a2aa42fc76+ other rev at 97c705ade336 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -309,8 +297,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 94b33a1b7f2d+ other rev at bdb19105162a ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 94b33a1b7f2d+ other rev at bdb19105162a ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 1 files removed, 0 files unresolved
@@ -339,8 +325,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 02963e448370+ other rev at 97c705ade336 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 02963e448370+ other rev at 97c705ade336 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -370,16 +354,12 @@
   picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
   merging b
   my b at 62e7bf090eba+ other b at 49b6d8032493 ancestor a at 924404dff337
-  picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
-  my b at 62e7bf090eba+ other b at 49b6d8032493 ancestor a at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 62e7bf090eba+ other rev at 49b6d8032493 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 62e7bf090eba+ other rev at 49b6d8032493 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -419,8 +399,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 02963e448370+ other rev at fe905ef2c33e ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 02963e448370+ other rev at fe905ef2c33e ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
@@ -449,16 +427,12 @@
   picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
   merging b
   my b at 86a2aa42fc76+ other b at af30c7647fc7 ancestor b at 000000000000
-  picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
-  my b at 86a2aa42fc76+ other b at af30c7647fc7 ancestor b at 000000000000
   launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 86a2aa42fc76+ other rev at af30c7647fc7 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 86a2aa42fc76+ other rev at af30c7647fc7 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -489,16 +463,12 @@
   picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
   merging b
   my b at 59318016310c+ other b at bdb19105162a ancestor b at 000000000000
-  picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
-  my b at 59318016310c+ other b at bdb19105162a ancestor b at 000000000000
   launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 59318016310c+ other rev at bdb19105162a ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 59318016310c+ other rev at bdb19105162a ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 1 files removed, 0 files unresolved
@@ -532,8 +502,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 86a2aa42fc76+ other rev at 8dbce441892a ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 86a2aa42fc76+ other rev at 8dbce441892a ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -564,16 +532,12 @@
   picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
   merging b
   my b at 59318016310c+ other b at bdb19105162a ancestor b at 000000000000
-  picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
-  my b at 59318016310c+ other b at bdb19105162a ancestor b at 000000000000
   launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 59318016310c+ other rev at bdb19105162a ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 59318016310c+ other rev at bdb19105162a ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 1 files removed, 0 files unresolved
@@ -607,8 +571,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 86a2aa42fc76+ other rev at 8dbce441892a ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 86a2aa42fc76+ other rev at 8dbce441892a ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -642,8 +604,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 0b76e65c8289+ other rev at 4ce40f5aca24 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 0b76e65c8289+ other rev at 4ce40f5aca24 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -677,8 +637,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 02963e448370+ other rev at 8dbce441892a ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 02963e448370+ other rev at 8dbce441892a ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -711,8 +669,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 0b76e65c8289+ other rev at bdb19105162a ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 0b76e65c8289+ other rev at bdb19105162a ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -744,16 +700,12 @@
   picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
   merging a and b to b
   my b at e300d1c794ec+ other b at 49b6d8032493 ancestor a at 924404dff337
-  picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
-  my b at e300d1c794ec+ other b at 49b6d8032493 ancestor a at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at e300d1c794ec+ other rev at 49b6d8032493 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at e300d1c794ec+ other rev at 49b6d8032493 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -784,16 +736,12 @@
   picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
   merging b and a to b
   my b at 62e7bf090eba+ other a at f4db7e329e71 ancestor a at 924404dff337
-  picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob)
-  my b at 62e7bf090eba+ other a at f4db7e329e71 ancestor a at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob)
   merge tool returned: 0
    rev: versions differ -> m
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 62e7bf090eba+ other rev at f4db7e329e71 ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 62e7bf090eba+ other rev at f4db7e329e71 ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   0 files updated, 2 files merged, 0 files removed, 0 files unresolved
@@ -835,8 +783,6 @@
   picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
   merging rev
   my rev at 02963e448370+ other rev at 2b958612230f ancestor rev at 924404dff337
-  picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob)
-  my rev at 02963e448370+ other rev at 2b958612230f ancestor rev at 924404dff337
   launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob)
   merge tool returned: 0
   1 files updated, 2 files merged, 0 files removed, 0 files unresolved
diff --git a/tests/test-merge7.t b/tests/test-merge7.t
--- a/tests/test-merge7.t
+++ b/tests/test-merge7.t
@@ -90,8 +90,6 @@
   picked tool ':merge' for test.txt (binary False symlink False changedelete False)
   merging test.txt
   my test.txt at 50c3a7e29886+ other test.txt at 40d11a4173a8 ancestor test.txt at 96b70246a118
-  picked tool ':merge' for test.txt (binary False symlink False changedelete False)
-  my test.txt at 50c3a7e29886+ other test.txt at 40d11a4173a8 ancestor test.txt at 96b70246a118
   warning: conflicts while merging test.txt! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t
--- a/tests/test-merge-tools.t
+++ b/tests/test-merge-tools.t
@@ -578,7 +578,6 @@
   $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
   couldn't find merge tool true (for pattern f)
   merging f
-  couldn't find merge tool true (for pattern f)
   merging f failed!
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
@@ -604,7 +603,6 @@
   $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
   couldn't find merge tool true (for pattern f)
   merging f
-  couldn't find merge tool true (for pattern f)
   merging f failed!
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
@@ -1837,7 +1835,6 @@
   $ hg merge -y -r 2 --config ui.merge=missingbinary
   couldn't find merge tool missingbinary (for pattern f)
   merging f
-  couldn't find merge tool missingbinary (for pattern f)
   revision 1
   space
   revision 0
diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t
--- a/tests/test-merge-criss-cross.t
+++ b/tests/test-merge-criss-cross.t
@@ -97,8 +97,6 @@
   picked tool ':dump' for f2 (binary False symlink False changedelete False)
   merging f2
   my f2 at 3b08d01b0ab5+ other f2 at adfe50279922 ancestor f2 at 0f6b37dbe527
-  picked tool ':dump' for f2 (binary False symlink False changedelete False)
-  my f2 at 3b08d01b0ab5+ other f2 at adfe50279922 ancestor f2 at 0f6b37dbe527
   1 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
   [1]
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -246,8 +246,6 @@
   picked tool ':merge' for e (binary False symlink False changedelete False)
   merging e
   my e at 1905859650ec+ other e at 9c233e8e184d ancestor e at 4c60f11aa304
-  picked tool ':merge' for e (binary False symlink False changedelete False)
-  my e at 1905859650ec+ other e at 9c233e8e184d ancestor e at 4c60f11aa304
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
   abort: unresolved conflicts, can't continue
   (use 'hg resolve' and 'hg graft --continue')
diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -1027,7 +1027,7 @@
                 util.unlink(d)
 
 
-def _filemerge(premerge, repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
+def _filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
     """perform a 3-way merge in the working directory
 
     premerge = whether this is a premerge
@@ -1102,14 +1102,13 @@
         r, deleted = func(repo, mynode, orig, fcd, fco, fca, toolconf, labels)
         return True, r, deleted
 
-    if premerge:
-        if orig != fco.path():
-            ui.status(
-                _(b"merging %s and %s to %s\n")
-                % (uipathfn(orig), uipathfn(fco.path()), fduipath)
-            )
-        else:
-            ui.status(_(b"merging %s\n") % fduipath)
+    if orig != fco.path():
+        ui.status(
+            _(b"merging %s and %s to %s\n")
+            % (uipathfn(orig), uipathfn(fco.path()), fduipath)
+        )
+    else:
+        ui.status(_(b"merging %s\n") % fduipath)
 
     ui.debug(b"my %s other %s ancestor %s\n" % (fcd, fco, fca))
 
@@ -1122,7 +1121,7 @@
             ui.warn(onfailure % fduipath)
         return True, 1, False
 
-    back = _makebackup(repo, ui, wctx, fcd, premerge)
+    back = _makebackup(repo, ui, wctx, fcd, True)
     files = (None, None, None, back)
     r = 1
     try:
@@ -1140,7 +1139,7 @@
                 repo, fcd, fco, fca, labels, tool=tool
             )
 
-        if premerge and mergetype == fullmerge:
+        if mergetype == fullmerge:
             # conflict markers generated by premerge will use 'detailed'
             # settings if either ui.mergemarkers or the tool's mergemarkers
             # setting is 'detailed'. This way tools can have basic labels in
@@ -1160,8 +1159,9 @@
             r = _premerge(
                 repo, fcd, fco, fca, toolconf, files, labels=premergelabels
             )
-            # complete if premerge successful (r is 0)
-            return not r, r, False
+            # we're done if premerge was successful (r is 0)
+            if not r:
+                return not r, r, False
 
         needcheck, r, deleted = func(
             repo,
@@ -1278,14 +1278,7 @@
 
 
 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
-    )
-    if not complete:
-        complete, merge_ret, deleted = _filemerge(
-            False, repo, wctx, mynode, orig, fcd, fco, fca, labels=labels
-        )
-    return complete, merge_ret, deleted
+    return _filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=labels)
 
 
 def loadinternalmerge(ui, extname, registrarobj):
diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -668,12 +668,10 @@
 # largefiles. This will handle identical edits without prompting the user.
 @eh.wrapfunction(filemerge, b'_filemerge')
 def overridefilemerge(
-    origfn, premerge, repo, wctx, mynode, orig, fcd, fco, fca, labels=None
+    origfn, repo, wctx, mynode, orig, fcd, fco, fca, labels=None
 ):
     if not lfutil.isstandin(orig) or fcd.isabsent() or fco.isabsent():
-        return origfn(
-            premerge, repo, wctx, mynode, orig, fcd, fco, fca, labels=labels
-        )
+        return origfn(repo, wctx, mynode, orig, fcd, fco, fca, labels=labels)
 
     ahash = lfutil.readasstandin(fca).lower()
     dhash = lfutil.readasstandin(fcd).lower()



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/6bcd94b0/attachment-0002.html>


More information about the Mercurial-patches mailing list