dirstate.walk: simplify .hg scan bisect logic
authorMatt Mackall <mpm@selenic.com>
Tue, 22 Jul 2008 13:03:16 -0500
changeset 6824 c3fb7dc51a4b
parent 6823 12081ea61a34
child 6825 177b3186f78a
dirstate.walk: simplify .hg scan bisect logic
mercurial/dirstate.py
--- 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)))