changeset 1546:d69070c2547a

fix errors found by pychecker
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 14 Nov 2005 16:10:59 +0100
parents b3184bea3eb3
children 487e256ad545
files mercurial/commands.py mercurial/hgweb.py
diffstat 2 files changed, 6 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Nov 14 15:10:10 2005 +0100
+++ b/mercurial/commands.py	Mon Nov 14 16:10:59 2005 +0100
@@ -634,17 +634,18 @@
     %p   root-relative path name of file being printed
     """
     mf = {}
-    if opts['rev']:
-        change = repo.changelog.read(repo.lookup(opts['rev']))
+    rev = opts['rev']
+    if rev:
+        change = repo.changelog.read(repo.lookup(rev))
         mf = repo.manifest.read(change[0])
     for src, abs, rel, exact in walk(repo, (file1,) + pats, opts):
         r = repo.file(abs)
-        if opts['rev']:
+        if rev:
             try:
                 n = mf[abs]
             except (hg.RepoError, KeyError):
                 try:
-                    n = r.lookup(rev) # XXX rev undefined!
+                    n = r.lookup(rev)
                 except KeyError, inst:
                     raise util.Abort(_('cannot find file %s in rev %s'), rel, rev)
         else:
@@ -2470,7 +2471,7 @@
 
     external = []
     for x in u.extensions():
-        def on_exception(Exception, inst): # XXX Exception is a builtin name!?
+        def on_exception(exc, inst):
             u.warn(_("*** failed to import extension %s\n") % x[1])
             u.warn("%s\n" % inst)
             if "--traceback" in sys.argv[1:]:
--- a/mercurial/hgweb.py	Mon Nov 14 15:10:10 2005 +0100
+++ b/mercurial/hgweb.py	Mon Nov 14 16:10:59 2005 +0100
@@ -951,12 +951,6 @@
     else:
         return BaseHTTPServer.HTTPServer((address, port), hgwebhandler)
 
-def server(path, name, templates, address, port, use_ipv6=False,
-           accesslog=sys.stdout, errorlog=sys.stderr):
-    httpd = create_server(path, name, templates, address, port, use_ipv6,
-                          accesslog, errorlog) # XXX wrong param count
-    httpd.serve_forever()
-
 # This is a stopgap
 class hgwebdir:
     def __init__(self, config):