##// END OF EJS Templates
adding "prefix" option to "hg serve" (command line and [web] section)...
Michele Cella -
r5835:bd34f0ac default
parent child Browse files
Show More
@@ -2393,7 +2393,7 b' def serve(ui, repo, **opts):'
2393 2393 s.serve_forever()
2394 2394
2395 2395 parentui = ui.parentui or ui
2396 optlist = ("name templates style address port ipv6"
2396 optlist = ("name templates style address port prefix ipv6"
2397 2397 " accesslog errorlog webdir_conf certificate")
2398 2398 for o in optlist.split():
2399 2399 if opts[o]:
@@ -3024,6 +3024,7 b' table = {'
3024 3024 ('E', 'errorlog', '', _('name of error log file to write to')),
3025 3025 ('p', 'port', 0, _('port to use (default: 8000)')),
3026 3026 ('a', 'address', '', _('address to use')),
3027 ('', 'prefix', '', _('prefix path to serve from (default: server root)')),
3027 3028 ('n', 'name', '',
3028 3029 _('name to show in web pages (default: working dir)')),
3029 3030 ('', 'webdir-conf', '', _('name of the webdir config file'
@@ -76,7 +76,7 b' class _hgwebhandler(object, BaseHTTPServ'
76 76 self.do_POST()
77 77
78 78 def do_hgweb(self):
79 path_info, query = _splitURI(self.path)
79 path, query = _splitURI(self.path)
80 80
81 81 env = {}
82 82 env['GATEWAY_INTERFACE'] = 'CGI/1.1'
@@ -84,8 +84,8 b' class _hgwebhandler(object, BaseHTTPServ'
84 84 env['SERVER_NAME'] = self.server.server_name
85 85 env['SERVER_PORT'] = str(self.server.server_port)
86 86 env['REQUEST_URI'] = self.path
87 env['SCRIPT_NAME'] = ''
88 env['PATH_INFO'] = path_info
87 env['SCRIPT_NAME'] = self.server.prefix
88 env['PATH_INFO'] = path[len(self.server.prefix):]
89 89 env['REMOTE_HOST'] = self.client_address[0]
90 90 env['REMOTE_ADDR'] = self.client_address[0]
91 91 if query:
@@ -206,6 +206,7 b' def create_server(ui, repo):'
206 206 myui = repo.ui
207 207 address = myui.config("web", "address", "")
208 208 port = int(myui.config("web", "port", 8000))
209 prefix = myui.config("web", "prefix", "").rstrip("/")
209 210 use_ipv6 = myui.configbool("web", "ipv6")
210 211 webdir_conf = myui.config("web", "webdir_conf")
211 212 ssl_cert = myui.config("web", "certificate")
@@ -254,6 +255,7 b' def create_server(ui, repo):'
254 255 addr = socket.gethostname()
255 256
256 257 self.addr, self.port = addr, port
258 self.prefix = prefix
257 259
258 260 if ssl_cert:
259 261 try:
@@ -129,6 +129,7 b' rawcommit'
129 129 --noninteractive
130 130 --pid-file
131 131 --port
132 --prefix
132 133 --profile
133 134 --quiet
134 135 --repository
General Comments 0
You need to be logged in to leave comments. Login now