[PATCH] cmdutil: avoid recycling variable name "name" in namespaces code

Augie Fackler raf at durin42.com
Thu Apr 14 19:29:43 UTC 2016


# HG changeset patch
# User Nathaniel Manista <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


More information about the Mercurial-devel mailing list