Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 28904:80be5dbe6e74
cmdutil: avoid recycling variable name "name" in namespaces code
This just feels like asking for future trouble and confusion.
author | Nathaniel Manista <nathaniel@google.com> |
---|---|
date | Thu, 14 Apr 2016 15:26:18 -0400 |
parents | ac30adb260ea |
children | f97a0bcfd7a1 |
comparison
equal
deleted
inserted
replaced
28903:e1dd0de26557 | 28904:80be5dbe6e74 |
---|---|
1273 if branch != 'default': | 1273 if branch != 'default': |
1274 # i18n: column positioning for "hg log" | 1274 # i18n: column positioning for "hg log" |
1275 self.ui.write(_("branch: %s\n") % branch, | 1275 self.ui.write(_("branch: %s\n") % branch, |
1276 label='log.branch') | 1276 label='log.branch') |
1277 | 1277 |
1278 for name, ns in self.repo.names.iteritems(): | 1278 for nsname, ns in self.repo.names.iteritems(): |
1279 # branches has special logic already handled above, so here we just | 1279 # branches has special logic already handled above, so here we just |
1280 # skip it | 1280 # skip it |
1281 if name == 'branches': | 1281 if nsname == 'branches': |
1282 continue | 1282 continue |
1283 # we will use the templatename as the color name since those two | 1283 # we will use the templatename as the color name since those two |
1284 # should be the same | 1284 # should be the same |
1285 for name in ns.names(self.repo, changenode): | 1285 for name in ns.names(self.repo, changenode): |
1286 self.ui.write(ns.logfmt % name, | 1286 self.ui.write(ns.logfmt % name, |