cleanup: avoid local vars shadowing imports
This will mute some pyflakes "import ... shadowed by loop variable" warnings.
--- a/mercurial/hgweb/hgweb_mod.py Fri Aug 15 16:20:47 2014 +0200
+++ b/mercurial/hgweb/hgweb_mod.py Fri Aug 15 16:20:47 2014 +0200
@@ -392,5 +392,5 @@
}
def check_perm(self, req, op):
- for hook in permhooks:
- hook(self, req, op)
+ for permhook in permhooks:
+ permhook(self, req, op)
--- a/mercurial/merge.py Fri Aug 15 16:20:47 2014 +0200
+++ b/mercurial/merge.py Fri Aug 15 16:20:47 2014 +0200
@@ -10,7 +10,7 @@
from node import nullid, nullrev, hex, bin
from i18n import _
from mercurial import obsolete
-import error, util, filemerge, copies, subrepo, worker, dicthelpers
+import error as errormod, util, filemerge, copies, subrepo, worker, dicthelpers
import errno, os, shutil
_pack = struct.pack
@@ -1011,7 +1011,7 @@
# but currently we are only checking the branch tips.
try:
node = repo.branchtip(wc.branch())
- except error.RepoLookupError:
+ except errormod.RepoLookupError:
if wc.branch() == "default": # no default branch!
node = repo.lookup("tip") # update to tip
else:
--- a/mercurial/obsolete.py Fri Aug 15 16:20:47 2014 +0200
+++ b/mercurial/obsolete.py Fri Aug 15 16:20:47 2014 +0200
@@ -748,8 +748,8 @@
obs = set()
getrev = repo.changelog.nodemap.get
getphase = repo._phasecache.phase
- for node in repo.obsstore.successors:
- rev = getrev(node)
+ for n in repo.obsstore.successors:
+ rev = getrev(n)
if rev is not None and getphase(repo, rev):
obs.add(rev)
return obs
--- a/mercurial/tagmerge.py Fri Aug 15 16:20:47 2014 +0200
+++ b/mercurial/tagmerge.py Fri Aug 15 16:20:47 2014 +0200
@@ -71,7 +71,7 @@
# - put blocks whose nodes come all from p2 first
# - write the tag blocks in the sorted order
-import tags
+import tags as tagsmod
import util
from node import nullid, hex
from i18n import _
@@ -85,8 +85,8 @@
with each tag. Rhis is done because only the line numbers of the first
parent are useful for merging
'''
- filetags = tags._readtaghist(ui, repo, lines, fn=fn, recode=None,
- calcnodelines=True)[1]
+ filetags = tagsmod._readtaghist(ui, repo, lines, fn=fn, recode=None,
+ calcnodelines=True)[1]
for tagname, taginfo in filetags.items():
if not keeplinenums:
for el in taginfo: