Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 987:bfe12654764d
hgweb: change startup argument processing
- allow passing a repo object instead of a path
(if we get a string, we construct a repo object)
- hg serve: pass options via repo.ui.setconfig
- add --style option
- get default name from repo.root rather than getcwd()
- remove template argument to hgweb()
- reduce create_server from 8 args to 1
author | mpm@selenic.com |
---|---|
date | Sun, 21 Aug 2005 15:56:14 -0700 |
parents | 4f81068ed8cd |
children | a66e249d77ae |
line wrap: on
line diff
--- a/mercurial/commands.py Sun Aug 21 15:00:02 2005 -0700 +++ b/mercurial/commands.py Sun Aug 21 15:56:14 2005 -0700 @@ -1117,9 +1117,13 @@ r = repo.addchangegroup(fin) respond("") - httpd = hgweb.create_server(repo.root, opts["name"], opts["templates"], - opts["address"], opts["port"], opts["ipv6"], - opts['accesslog'], opts['errorlog']) + optlist = "name templates style address port ipv6 accesslog errorlog" + for o in optlist.split(): + if opts[o]: + ui.setconfig("web", o, opts[o]) + + httpd = hgweb.create_server(repo) + if ui.verbose: addr, port = httpd.socket.getsockname() if addr == '0.0.0.0': @@ -1402,7 +1406,8 @@ ('a', 'address', '', 'interface address'), ('n', 'name', "", 'repository name'), ('', 'stdio', None, 'for remote clients'), - ('t', 'templates', "", 'template map'), + ('t', 'templates', "", 'template directory'), + ('', 'style', "", 'template style'), ('6', 'ipv6', None, 'use IPv6 in addition to IPv4')], "hg serve [OPTION]..."), "^status":