[PATCH] cmdutil: avoid recycling variable name "name" in namespaces code
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Thu Apr 14 16:51:08 EDT 2016
Pushed, thanks
On 04/14/2016 01:16 PM, timeless wrote:
>
> Makes sense
>
> On Apr 14, 2016 3:29 PM, "Augie Fackler" <raf at durin42.com
> <mailto:raf at durin42.com>> wrote:
>
> # HG changeset patch
> # User Nathaniel Manista <nathaniel at google.com
> <mailto:nathaniel at google.com>>
> # Date 1460661978 14400
> # Thu Apr 14 15:26:18 2016 -0400
> # Node ID 5887cc01e877d1e486a3bd9ca47fc39e3735a8c0
> # Parent 99a2bdad0fda4fe16830376ad81c1065a5080cb9
> cmdutil: avoid recycling variable name "name" in namespaces code
>
> This just feels like asking for future trouble and confusion.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -1275,10 +1275,10 @@ class changeset_printer(object):
> self.ui.write(_("branch: %s\n") % branch,
> label='log.branch')
>
> - for name, ns in self.repo.names.iteritems():
> + for nsname, ns in self.repo.names.iteritems():
> # branches has special logic already handled above,
> so here we just
> # skip it
> - if name == 'branches':
> + if nsname == 'branches':
> continue
> # we will use the templatename as the color name
> since those two
> # should be the same
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> <mailto:Mercurial-devel at mercurial-scm.org>
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list