changeset 6824:c3fb7dc51a4b

dirstate.walk: simplify .hg scan bisect logic
author Matt Mackall <mpm@selenic.com>
date Tue, 22 Jul 2008 13:03:16 -0500
parents 12081ea61a34
children 177b3186f78a
files mercurial/dirstate.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Tue Jul 22 13:03:15 2008 -0500
+++ b/mercurial/dirstate.py	Tue Jul 22 13:03:16 2008 -0500
@@ -519,10 +519,9 @@
                     # do not recurse into a repo contained in this
                     # one. use bisect to find .hg directory so speed
                     # is good on big directory.
-                    names = [e[0] for e in entries]
-                    hg = bisect_left(names, '.hg')
-                    if hg < len(names) and names[hg] == '.hg':
-                        if isdir(_join(join(nd, '.hg'))):
+                    hg = bisect_left(entries, ('.hg'))
+                    if hg < len(entries) and entries[hg][0] == '.hg' \
+                            and entries[hg][1] == stat.S_IFDIR:
                             continue
                 for f, kind, st in entries:
                     nf = normalize(pconvert(join(nd, f)))