comparison 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
comparison
equal deleted inserted replaced
986:2810c625ca98 987:bfe12654764d
1115 respond("") 1115 respond("")
1116 1116
1117 r = repo.addchangegroup(fin) 1117 r = repo.addchangegroup(fin)
1118 respond("") 1118 respond("")
1119 1119
1120 httpd = hgweb.create_server(repo.root, opts["name"], opts["templates"], 1120 optlist = "name templates style address port ipv6 accesslog errorlog"
1121 opts["address"], opts["port"], opts["ipv6"], 1121 for o in optlist.split():
1122 opts['accesslog'], opts['errorlog']) 1122 if opts[o]:
1123 ui.setconfig("web", o, opts[o])
1124
1125 httpd = hgweb.create_server(repo)
1126
1123 if ui.verbose: 1127 if ui.verbose:
1124 addr, port = httpd.socket.getsockname() 1128 addr, port = httpd.socket.getsockname()
1125 if addr == '0.0.0.0': 1129 if addr == '0.0.0.0':
1126 addr = socket.gethostname() 1130 addr = socket.gethostname()
1127 else: 1131 else:
1400 ('E', 'errorlog', '', 'error log file'), 1404 ('E', 'errorlog', '', 'error log file'),
1401 ('p', 'port', 0, 'listen port'), 1405 ('p', 'port', 0, 'listen port'),
1402 ('a', 'address', '', 'interface address'), 1406 ('a', 'address', '', 'interface address'),
1403 ('n', 'name', "", 'repository name'), 1407 ('n', 'name', "", 'repository name'),
1404 ('', 'stdio', None, 'for remote clients'), 1408 ('', 'stdio', None, 'for remote clients'),
1405 ('t', 'templates', "", 'template map'), 1409 ('t', 'templates', "", 'template directory'),
1410 ('', 'style', "", 'template style'),
1406 ('6', 'ipv6', None, 'use IPv6 in addition to IPv4')], 1411 ('6', 'ipv6', None, 'use IPv6 in addition to IPv4')],
1407 "hg serve [OPTION]..."), 1412 "hg serve [OPTION]..."),
1408 "^status": 1413 "^status":
1409 (status, 1414 (status,
1410 [('m', 'modified', None, 'show only modified files'), 1415 [('m', 'modified', None, 'show only modified files'),