[PATCH 2 of 3] merge: use dirstate.notincluded in _checkunknown

Siddharth Agarwal sid0 at fb.com
Fri Feb 1 16:41:25 CST 2013


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1359674799 28800
# Branch stable
# Node ID 802db8814a53d3e1c0bd4d444e9a70158bd48396
# Parent  9139388e66b4c6295c85989f27357c280a40025d
merge: use dirstate.notincluded in _checkunknown

On a repository with over 150,000 files, this speeds up update by around 0.4
seconds.

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -101,8 +101,8 @@ 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):
+    for f in repo.dirstate.notincluded(mctx):
+        if _checkunknownfile(repo, wctx, mctx, f):
             error = True
             wctx._repo.ui.warn(_("%s: untracked file differs\n") % f)
     if error:


More information about the Mercurial-devel mailing list