# HG changeset patch # User Benoit Boissinot # Date 1131981059 -3600 # Node ID d69070c2547a57b83c6ddc4ea725f5ae152152f8 # Parent b3184bea3eb3f11af2cfb7954921c5cdb9ee0c66 fix errors found by pychecker diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -634,17 +634,18 @@ def cat(ui, repo, file1, *pats, **opts): %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 @@ def dispatch(args): 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:]: diff --git a/mercurial/hgweb.py b/mercurial/hgweb.py --- a/mercurial/hgweb.py +++ b/mercurial/hgweb.py @@ -951,12 +951,6 @@ def create_server(repo): 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):