changeset 3859:8c24b6fd5866

fix errors spotted by pychecker
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sun, 10 Dec 2006 19:41:57 +0100
parents 7c12958eba26
children 8e907b86126b
files mercurial/changegroup.py mercurial/commands.py mercurial/statichttprepo.py mercurial/util.py
diffstat 4 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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'])
 
--- 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):
--- 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():