Patchwork update: remove unnecessary check for unknown files with --check

login
register
mail settings
Submitter Martin von Zweigbergk
Date Nov. 19, 2014, 12:24 a.m.
Message ID <e90eec7072fd8cbead6a.1416356690@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6784/
State Accepted
Commit 1cbc00ff2373d4f6d44ca644c64bb37e391626d9
Headers show

Comments

Martin von Zweigbergk - Nov. 19, 2014, 12:24 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1416356072 28800
#      Tue Nov 18 16:14:32 2014 -0800
# Node ID e90eec7072fd8cbead6a46639ebeb6fd0b0e1e06
# Parent  e63941631a3f61b3323dbcc2545689b1eb34e308
update: remove unnecessary check for unknown files with --check

As far as I and the test suite can tell, the checks in manifestmerge()
already report the errors (whether or not --check is given), so we
don't need to call merge.checkunknown(). Since this is the last call
to the method, also remove the method.
Matt Mackall - Nov. 19, 2014, 3:46 p.m.
On Tue, 2014-11-18 at 16:24 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1416356072 28800
> #      Tue Nov 18 16:14:32 2014 -0800
> # Node ID e90eec7072fd8cbead6a46639ebeb6fd0b0e1e06
> # Parent  e63941631a3f61b3323dbcc2545689b1eb34e308
> update: remove unnecessary check for unknown files with --check

Queued for default, thanks.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6185,7 +6185,6 @@ 
             raise util.Abort(_("uncommitted changes"))
         if rev is None:
             rev = repo[repo[None].branch()].rev()
-        mergemod.checkunknown(repo, repo[None], repo[rev])
 
     repo.ui.setconfig('ui', 'forcemerge', tool, 'update')
 
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -304,18 +304,6 @@ 
         and repo.dirstate.normalize(f) not in repo.dirstate
         and mctx[f].cmp(wctx[f]))
 
-def checkunknown(repo, wctx, mctx):
-    "check for collisions between unknown files and files in mctx"
-
-    error = False
-    for f in mctx:
-        if f not in wctx and _checkunknownfile(repo, wctx, mctx, f):
-            error = True
-            wctx._repo.ui.warn(_("%s: untracked file differs\n") % f)
-    if error:
-        raise util.Abort(_("untracked files in working directory differ "
-                           "from files in requested revision"))
-
 def _forgetremoved(wctx, mctx, branchmerge):
     """
     Forget removed files