From patchwork Fri Feb 1 22:41:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,3] merge: use dirstate.notincluded in _checkunknown From: Siddharth Agarwal X-Patchwork-Id: 793 Message-Id: <802db8814a53d3e1c0bd.1359758485@sid0x220> To: mercurial-devel@selenic.com Date: Fri, 01 Feb 2013 14:41:25 -0800 # HG changeset patch # User Siddharth Agarwal # 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: