[PATCH 1 of 5] context.walk: call util.all() a generator, not a list

Martin von Zweigbergk martinvonz at google.com
Wed Mar 18 17:16:01 CDT 2015


On Wed, Mar 18, 2015 at 1:27 PM Martin von Zweigbergk <martinvonz at google.com>
wrote:

> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1426695986 25200
> #      Wed Mar 18 09:26:26 2015 -0700
> # Node ID 2ecdb84c187ea3044f61fec65ceaeb1193a72582
> # Parent  b7f936f47f2b104a60840bae571e009742126afc
> context.walk: call util.all() a generator, not a list
>

Missing a "with" before "a generator". Sorry.


>
> The file set can be large, so avoid going through the entire file set
> when a file happens not to be in the context.
>
> diff -r b7f936f47f2b -r 2ecdb84c187e mercurial/context.py
> --- a/mercurial/context.py      Sun Mar 15 21:52:35 2015 -0400
> +++ b/mercurial/context.py      Wed Mar 18 09:26:26 2015 -0700
> @@ -594,7 +594,7 @@
>
>          # avoid the entire walk if we're only looking for specific files
>          if fset and not match.anypats():
> -            if util.all([fn in self for fn in fset]):
> +            if util.all(fn in self for fn in fset):
>                  for fn in sorted(fset):
>                      if match(fn):
>                          yield fn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150318/595e208a/attachment.html>


More information about the Mercurial-devel mailing list