# HG changeset patch # User Alexander Schremmer # Date 1145918620 -7200 # Node ID 27fd8b7a6c51edb6f5a4c7b43b257e1aae75dd62 # Parent c0729a7f6f8aabf00d097ffec91c45136b701da1 Cleaned trailing whitespace in hgweb.py, removed command line shortcut for webdir-conf. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2566,7 +2566,8 @@ def serve(ui, repo, **opts): r = repo.addchangegroup(fin) respond(str(r)) - optlist = "name templates style address port ipv6 accesslog errorlog webdir_conf" + optlist = """name templates style address port + ipv6 accesslog errorlog webdir_conf""" for o in optlist.split(): if opts[o]: ui.setconfig("web", o, opts[o]) @@ -3127,7 +3128,8 @@ table = { ('a', 'address', '', _('address to use')), ('n', 'name', '', _('name to show in web pages (default: working dir)')), - ('D', 'webdir-conf', '', _('name of the webdir config file (serve more than one repo)')), + ('', 'webdir-conf', '', _('name of the webdir config file' + ' (serve more than one repo)')), ('', 'pid-file', '', _('name of file to write process ID to')), ('', 'stdio', None, _('for remote clients')), ('t', 'templates', '', _('web templates to use')), diff --git a/mercurial/hgweb.py b/mercurial/hgweb.py --- a/mercurial/hgweb.py +++ b/mercurial/hgweb.py @@ -891,7 +891,7 @@ class hgweb(object): def create_server(repo): use_threads = True - + def openlog(opt, default): if opt and opt != '-': return open(opt, 'w') @@ -903,7 +903,7 @@ def create_server(repo): webdir_conf = repo.ui.config("web", "webdir_conf") accesslog = openlog(repo.ui.config("web", "accesslog", "-"), sys.stdout) errorlog = openlog(repo.ui.config("web", "errorlog", "-"), sys.stderr) - + if use_threads: try: from threading import activeCount @@ -920,7 +920,7 @@ def create_server(repo): class MercurialHTTPServer(_mixin, BaseHTTPServer.HTTPServer): pass - + class IPv6HTTPServer(MercurialHTTPServer): address_family = getattr(socket, 'AF_INET6', None) @@ -953,7 +953,7 @@ def create_server(repo): def do_hgweb(self): path_info, query = splitURI(self.path) - + env = {} env['GATEWAY_INTERFACE'] = 'CGI/1.1' env['REQUEST_METHOD'] = self.command @@ -991,7 +991,7 @@ def create_server(repo): else: hgwebobj = hgweb(repo.__class__(repo.ui, repo.origroot)) hgwebobj.run(req) - + if use_ipv6: return IPv6HTTPServer((address, port), hgwebhandler)