##// END OF EJS Templates
Cleaned trailing whitespace in hgweb.py, removed command line shortcut for webdir-conf.
Alexander Schremmer <alex AT alexanderweb DOT de> -
r2124:27fd8b7a default
parent child Browse files
Show More
@@ -2566,7 +2566,8 b' def serve(ui, repo, **opts):'
2566 r = repo.addchangegroup(fin)
2566 r = repo.addchangegroup(fin)
2567 respond(str(r))
2567 respond(str(r))
2568
2568
2569 optlist = "name templates style address port ipv6 accesslog errorlog webdir_conf"
2569 optlist = """name templates style address port
2570 ipv6 accesslog errorlog webdir_conf"""
2570 for o in optlist.split():
2571 for o in optlist.split():
2571 if opts[o]:
2572 if opts[o]:
2572 ui.setconfig("web", o, opts[o])
2573 ui.setconfig("web", o, opts[o])
@@ -3127,7 +3128,8 b' table = {'
3127 ('a', 'address', '', _('address to use')),
3128 ('a', 'address', '', _('address to use')),
3128 ('n', 'name', '',
3129 ('n', 'name', '',
3129 _('name to show in web pages (default: working dir)')),
3130 _('name to show in web pages (default: working dir)')),
3130 ('D', 'webdir-conf', '', _('name of the webdir config file (serve more than one repo)')),
3131 ('', 'webdir-conf', '', _('name of the webdir config file'
3132 ' (serve more than one repo)')),
3131 ('', 'pid-file', '', _('name of file to write process ID to')),
3133 ('', 'pid-file', '', _('name of file to write process ID to')),
3132 ('', 'stdio', None, _('for remote clients')),
3134 ('', 'stdio', None, _('for remote clients')),
3133 ('t', 'templates', '', _('web templates to use')),
3135 ('t', 'templates', '', _('web templates to use')),
@@ -891,7 +891,7 b' class hgweb(object):'
891
891
892 def create_server(repo):
892 def create_server(repo):
893 use_threads = True
893 use_threads = True
894
894
895 def openlog(opt, default):
895 def openlog(opt, default):
896 if opt and opt != '-':
896 if opt and opt != '-':
897 return open(opt, 'w')
897 return open(opt, 'w')
@@ -903,7 +903,7 b' def create_server(repo):'
903 webdir_conf = repo.ui.config("web", "webdir_conf")
903 webdir_conf = repo.ui.config("web", "webdir_conf")
904 accesslog = openlog(repo.ui.config("web", "accesslog", "-"), sys.stdout)
904 accesslog = openlog(repo.ui.config("web", "accesslog", "-"), sys.stdout)
905 errorlog = openlog(repo.ui.config("web", "errorlog", "-"), sys.stderr)
905 errorlog = openlog(repo.ui.config("web", "errorlog", "-"), sys.stderr)
906
906
907 if use_threads:
907 if use_threads:
908 try:
908 try:
909 from threading import activeCount
909 from threading import activeCount
@@ -920,7 +920,7 b' def create_server(repo):'
920
920
921 class MercurialHTTPServer(_mixin, BaseHTTPServer.HTTPServer):
921 class MercurialHTTPServer(_mixin, BaseHTTPServer.HTTPServer):
922 pass
922 pass
923
923
924 class IPv6HTTPServer(MercurialHTTPServer):
924 class IPv6HTTPServer(MercurialHTTPServer):
925 address_family = getattr(socket, 'AF_INET6', None)
925 address_family = getattr(socket, 'AF_INET6', None)
926
926
@@ -953,7 +953,7 b' def create_server(repo):'
953
953
954 def do_hgweb(self):
954 def do_hgweb(self):
955 path_info, query = splitURI(self.path)
955 path_info, query = splitURI(self.path)
956
956
957 env = {}
957 env = {}
958 env['GATEWAY_INTERFACE'] = 'CGI/1.1'
958 env['GATEWAY_INTERFACE'] = 'CGI/1.1'
959 env['REQUEST_METHOD'] = self.command
959 env['REQUEST_METHOD'] = self.command
@@ -991,7 +991,7 b' def create_server(repo):'
991 else:
991 else:
992 hgwebobj = hgweb(repo.__class__(repo.ui, repo.origroot))
992 hgwebobj = hgweb(repo.__class__(repo.ui, repo.origroot))
993 hgwebobj.run(req)
993 hgwebobj.run(req)
994
994
995
995
996 if use_ipv6:
996 if use_ipv6:
997 return IPv6HTTPServer((address, port), hgwebhandler)
997 return IPv6HTTPServer((address, port), hgwebhandler)
General Comments 0
You need to be logged in to leave comments. Login now