changeset 8675:fb74e1e69da0

walk: simplify check for missing file
author Matt Mackall <mpm@selenic.com>
date Sun, 31 May 2009 17:54:18 -0500
parents 0941ee76489e
children acd69fc201a5
files mercurial/dirstate.py
diffstat 1 files changed, 10 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Sun May 31 15:20:31 2009 -0400
+++ b/mercurial/dirstate.py	Sun May 31 17:54:18 2009 -0500
@@ -509,17 +509,16 @@
                         results[nf] = None
             except OSError, inst:
                 keep = False
-                prefix = nf + "/"
-                for fn in dmap:
-                    if nf == fn:
-                        if matchfn(nf):
-                            results[nf] = None
-                        keep = True
-                        break
-                    elif fn.startswith(prefix):
-                        dostep3 = True
-                        keep = True
-                        break
+                if nf in dmap: # does it exactly match a file?
+                    results[nf] = None
+                    keep = True
+                else: # does it match a directory?
+                    prefix = nf + "/"
+                    for fn in dmap:
+                        if fn.startswith(prefix):
+                            dostep3 = True
+                            keep = True
+                            break
                 if not keep:
                     if inst.errno != errno.ENOENT:
                         fwarn(ff, inst.strerror)