filemerge: inline `_filemerge()` into `filemerge()`
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 03 Dec 2021 22:45:35 -0800
changeset 48432 f45a4a47f6a8
parent 48431 6b1049d71c3e
child 48433 0994125a31e5
filemerge: inline `_filemerge()` into `filemerge()` The caller is now trivial, so the indirection is pointless. Differential Revision: https://phab.mercurial-scm.org/D11860
hgext/largefiles/overrides.py
mercurial/filemerge.py
tests/failfilemerge.py
--- a/hgext/largefiles/overrides.py	Fri Dec 03 21:41:43 2021 -0800
+++ b/hgext/largefiles/overrides.py	Fri Dec 03 22:45:35 2021 -0800
@@ -666,7 +666,7 @@
 
 # Override filemerge to prompt the user about how they wish to merge
 # largefiles. This will handle identical edits without prompting the user.
-@eh.wrapfunction(filemerge, b'_filemerge')
+@eh.wrapfunction(filemerge, b'filemerge')
 def overridefilemerge(
     origfn, repo, wctx, mynode, orig, fcd, fco, fca, labels=None
 ):
--- a/mercurial/filemerge.py	Fri Dec 03 21:41:43 2021 -0800
+++ b/mercurial/filemerge.py	Fri Dec 03 22:45:35 2021 -0800
@@ -1027,7 +1027,7 @@
                 util.unlink(d)
 
 
-def _filemerge(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
@@ -1277,10 +1277,6 @@
     return repo.wjoin(ctx.path())
 
 
-def filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None):
-    return _filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=labels)
-
-
 def loadinternalmerge(ui, extname, registrarobj):
     """Load internal merge tool from specified registrarobj"""
     for name, func in pycompat.iteritems(registrarobj._table):
--- a/tests/failfilemerge.py	Fri Dec 03 21:41:43 2021 -0800
+++ b/tests/failfilemerge.py	Fri Dec 03 22:45:35 2021 -0800
@@ -14,4 +14,4 @@
 
 
 def extsetup(ui):
-    extensions.wrapfunction(filemerge, '_filemerge', failfilemerge)
+    extensions.wrapfunction(filemerge, 'filemerge', failfilemerge)