[PATCH 3 of 3] merge: don't sort the manifest in _checkunknown

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


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1359757817 28800
# Branch stable
# Node ID 3c2df1f308015f3ce8015724b1748c6d419d066e
# Parent  802db8814a53d3e1c0bd4d444e9a70158bd48396
merge: don't sort the manifest in _checkunknown

Iterating over the context returns the files in sorted order. That is
unnecessary here.

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

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -101,7 +101,7 @@ def _checkunknown(repo, wctx, mctx):
     "check for collisions between unknown files and files in mctx"
 
     error = False
-    for f in repo.dirstate.notincluded(mctx):
+    for f in repo.dirstate.notincluded(mctx.manifest()):
         if _checkunknownfile(repo, wctx, mctx, f):
             error = True
             wctx._repo.ui.warn(_("%s: untracked file differs\n") % f)


More information about the Mercurial-devel mailing list