# HG changeset patch # User Matt Mackall # Date 2009-05-31 22:54:18 # Node ID 34df078b8b1b85d1031e30d89d904a9b4af65838 # Parent acd69fc201a5bd451fdff9f5eb16cef344b8823f walk: simplify logic for badfn clause - matchfn redundant - call badfn always rather than fwarn - use for/else rather than keep var diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -506,22 +506,16 @@ class dirstate(object): if nf in dmap: results[nf] = None except OSError, inst: - keep = False 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) - elif badfn(ff, inst.strerror): - if nf not in results and not ignore(nf) and matchfn(nf): + else: + if badfn(ff, inst.strerror) and not ignore(nf): results[nf] = None # step 2: visit subdirectories