From patchwork Tue May 7 21:32:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2, of, 6] dirstate.walk: move dirignore filter out of explicit walk code From: Siddharth Agarwal X-Patchwork-Id: 1583 Message-Id: <924523a3e1fbd533419c.1367962329@dev1091.prn1.facebook.com> To: mercurial-devel@selenic.com Date: Tue, 07 May 2013 14:32:09 -0700 # HG changeset patch # User Siddharth Agarwal # Date 1367945230 25200 # Tue May 07 09:47:10 2013 -0700 # Node ID 924523a3e1fbd533419ce22c8bd036576b1d274d # Parent 869ee5ce0194c7b931d18754ff044f395a249984 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 @@ 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 @@ 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()