[PATCH 2 of 6] dirstate.walk: move dirignore filter out of explicit walk code

Kevin Bullock kbullock+mercurial at ringworld.org
Thu May 9 14:26:31 CDT 2013


On 7 May 2013, at 4:32 PM, Siddharth Agarwal wrote:

> # HG changeset patch
> # User Siddharth Agarwal <sid0 at fb.com>
> # 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

Seems like this could have some performance implications?

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list