Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 4078:ff08cebcd116
hg serve: call setconfig on the parentui
It makes sense to do this on the "global" ui object, since command line
options should affect the whole process.
This should fix hg serve --style=gitweb inside a repo (part of issue253).
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Tue, 13 Feb 2007 10:00:17 -0200 |
parents | 5d9ede002453 |
children | e6d26e71f049 26314500a5e1 |
comparison
equal
deleted
inserted
replaced
4077:1305ba7dee88 | 4078:ff08cebcd116 |
---|---|
2302 raise hg.RepoError(_("There is no Mercurial repository here" | 2302 raise hg.RepoError(_("There is no Mercurial repository here" |
2303 " (.hg not found)")) | 2303 " (.hg not found)")) |
2304 s = sshserver.sshserver(ui, repo) | 2304 s = sshserver.sshserver(ui, repo) |
2305 s.serve_forever() | 2305 s.serve_forever() |
2306 | 2306 |
2307 parentui = ui.parentui or ui | |
2307 optlist = ("name templates style address port ipv6" | 2308 optlist = ("name templates style address port ipv6" |
2308 " accesslog errorlog webdir_conf") | 2309 " accesslog errorlog webdir_conf") |
2309 for o in optlist.split(): | 2310 for o in optlist.split(): |
2310 if opts[o]: | 2311 if opts[o]: |
2311 ui.setconfig("web", o, str(opts[o])) | 2312 parentui.setconfig("web", o, str(opts[o])) |
2312 | 2313 |
2313 if repo is None and not ui.config("web", "webdir_conf"): | 2314 if repo is None and not ui.config("web", "webdir_conf"): |
2314 raise hg.RepoError(_("There is no Mercurial repository here" | 2315 raise hg.RepoError(_("There is no Mercurial repository here" |
2315 " (.hg not found)")) | 2316 " (.hg not found)")) |
2316 | 2317 |
2322 args[0], args) | 2323 args[0], args) |
2323 os.close(wfd) | 2324 os.close(wfd) |
2324 os.read(rfd, 1) | 2325 os.read(rfd, 1) |
2325 os._exit(0) | 2326 os._exit(0) |
2326 | 2327 |
2327 httpd = hgweb.server.create_server(ui, repo) | 2328 httpd = hgweb.server.create_server(parentui, repo) |
2328 | 2329 |
2329 if ui.verbose: | 2330 if ui.verbose: |
2330 if httpd.port != 80: | 2331 if httpd.port != 80: |
2331 ui.status(_('listening at http://%s:%d/\n') % | 2332 ui.status(_('listening at http://%s:%d/\n') % |
2332 (httpd.addr, httpd.port)) | 2333 (httpd.addr, httpd.port)) |