# HG changeset patch # User Benoit Boissinot # Date 1165776117 -3600 # Node ID 8c24b6fd5866455ea5670216f5646168005182ef # Parent 7c12958eba263d92cb2a42f14a7bb6aaddb188aa fix errors spotted by pychecker diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -99,7 +99,7 @@ def writebundle(cg, filename, bundletype if cleanup is not None: os.unlink(cleanup) -def readbundle(fh): +def readbundle(fh, fname): header = fh.read(6) if not header.startswith("HG"): raise util.Abort(_("%s: not a Mercurial bundle file") % fname) diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2474,7 +2474,7 @@ def unbundle(ui, repo, fname, **opts): Apply a compressed changegroup file generated by the bundle command. """ - gen = changegroup.readbundle(urllib.urlopen(fname)) + gen = changegroup.readbundle(urllib.urlopen(fname), fname) modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) return postincoming(ui, repo, modheads, opts['update']) diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py --- a/mercurial/statichttprepo.py +++ b/mercurial/statichttprepo.py @@ -10,7 +10,7 @@ from demandload import * from i18n import gettext as _ demandload(globals(), "changelog filelog httprangereader") -demandload(globals(), "localrepo manifest os urllib urllib2 util") +demandload(globals(), "repo localrepo manifest os urllib urllib2 util") class rangereader(httprangereader.httprangereader): def read(self, size=None): diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -902,7 +902,7 @@ else: The return value of a util.fstat(f) may be passed as the st argument. """ if st is None: - st = fstat(f) + st = fstat(fp) return st.st_uid == os.getuid() def _buildencodefun():