# HG changeset patch # User Siddharth Agarwal # Date 2013-05-07 16:47:10 # Node ID 252de7b77cfd41f125faad841ce038348821404b # Parent b184e5041f2f74436099fd70645c3ff31d08d780 dirstate.walk: move dirignore filter out of explicit walk code This is a move towards factoring this code out into a separate function. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -626,8 +626,7 @@ class dirstate(object): results[nf] = None if matchedir: matchedir(nf) - if not dirignore(nf): - wadd(nf) + wadd(nf) elif kind == regkind or kind == lnkkind: results[nf] = st else: @@ -649,6 +648,9 @@ class dirstate(object): else: badfn(ff, inst.strerror) + work = [d for d in work if not dirignore(d)] + wadd = work.append + # step 2: visit subdirectories while work: nd = work.pop()