Patchwork [2,of,3,STABLE] _checkunknownfiles: make the f2 argument mandatory

mail settings
Submitter Siddharth Agarwal
Date Dec. 29, 2015, 6:55 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/12392/
State Rejected
Headers show


Siddharth Agarwal - Dec. 29, 2015, 6:55 a.m.
# HG changeset patch
# User Siddharth Agarwal <>
# Date 1451371759 28800
#      Mon Dec 28 22:49:19 2015 -0800
# Branch stable
# Node ID 0562811a731ffdc1d6317d7002e860ba51e8a844
# Parent  5e44604d31266e416de244171ab71df60ff8fd96
# Available At
#              hg pull -r 0562811a731f
_checkunknownfiles: make the f2 argument mandatory

This will make an upcoming bugfix clearer.


diff --git a/hgext/largefiles/ b/hgext/largefiles/
--- a/hgext/largefiles/
+++ b/hgext/largefiles/
@@ -426,7 +426,7 @@  def overridedebugstate(orig, ui, repo, *
 # The overridden function filters the unknown files by removing any
 # largefiles. This makes the merge proceed and we can then handle this
 # case further in the overridden calculateupdates function below.
-def overridecheckunknownfile(origfn, repo, wctx, mctx, f, f2=None):
+def overridecheckunknownfile(origfn, repo, wctx, mctx, f, f2):
     if lfutil.standin(repo.dirstate.normalize(f)) in wctx:
         return False
     return origfn(repo, wctx, mctx, f, f2)
diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -401,9 +401,7 @@  class mergestate(object):
         """rerun merge process for file path `dfile`"""
         return self._resolve(False, dfile, wctx, labels=labels)[1]
-def _checkunknownfile(repo, wctx, mctx, f, f2=None):
-    if f2 is None:
-        f2 = f
+def _checkunknownfile(repo, wctx, mctx, f, f2):
     return (repo.wvfs.isfileorlink(f)
         and repo.wvfs.audit.check(f)
         and repo.dirstate.normalize(f) not in repo.dirstate
@@ -419,7 +417,7 @@  def _checkunknownfiles(repo, wctx, mctx,
     if not force:
         for f, (m, args, msg) in actions.iteritems():
             if m in ('c', 'dc'):
-                if _checkunknownfile(repo, wctx, mctx, f):
+                if _checkunknownfile(repo, wctx, mctx, f, f):
             elif m == 'dg':
                 if _checkunknownfile(repo, wctx, mctx, f, args[0]):
@@ -436,7 +434,7 @@  def _checkunknownfiles(repo, wctx, mctx,
             actions[f] = ('g', args, msg)
         elif m == 'cm':
             fl2, anc = args
-            different = _checkunknownfile(repo, wctx, mctx, f)
+            different = _checkunknownfile(repo, wctx, mctx, f, f)
             if different:
                 actions[f] = ('m', (f, f, None, False, anc),
                               "remote differs from untracked local")