[PATCH 2 of 6 v2] dirstate: remove extra call to _dirs

Joshua Redstone joshua.redstone at fb.com
Tue Jun 26 14:04:39 CDT 2012


# HG changeset patch
# User Joshua Redstone <joshua.redstone at fb.com>
# Date 1340297503 25200
# Node ID 8ed2a82b1237bd1bffa5e9c7a19d6025e153bc8a
# Parent  2f02917a5f6ea7e6a8fbd55e4c90c3cf1d61fe94
dirstate: remove extra call to _dirs

In preparation for a future patch that will remove calls to _dirs from
_addpath to improve performance, remove a call that looks to be a minor
optimization to save a few iterations through _finddirs.  This shouldn't be
much of a performance penalty because the number of dirs is usually small.

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -321,8 +321,6 @@
                 raise util.Abort(_('directory %r already in dirstate') % f)
             # shadows
             for d in _finddirs(f):
-                if d in self._dirs:
-                    break
                 if d in self._map and self[d] != 'r':
                     raise util.Abort(
                         _('file %r in dirstate clashes with %r') % (d, f))


More information about the Mercurial-devel mailing list