##// END OF EJS Templates
serve: respect settings from .hg/hgrc...
Alexis S. L. Carvalho -
r4835:9858477e default
parent child Browse files
Show More
@@ -2457,6 +2457,8 b' def serve(ui, repo, **opts):'
2457 for o in optlist.split():
2457 for o in optlist.split():
2458 if opts[o]:
2458 if opts[o]:
2459 parentui.setconfig("web", o, str(opts[o]))
2459 parentui.setconfig("web", o, str(opts[o]))
2460 if repo.ui != parentui:
2461 repo.ui.setconfig("web", o, str(opts[o]))
2460
2462
2461 if repo is None and not ui.config("web", "webdir_conf"):
2463 if repo is None and not ui.config("web", "webdir_conf"):
2462 raise hg.RepoError(_("There is no Mercurial repository here"
2464 raise hg.RepoError(_("There is no Mercurial repository here"
@@ -172,12 +172,12 b' def create_server(ui, repo):'
172 return open(opt, 'w')
172 return open(opt, 'w')
173 return default
173 return default
174
174
175 address = ui.config("web", "address", "")
175 address = repo.ui.config("web", "address", "")
176 port = int(ui.config("web", "port", 8000))
176 port = int(repo.ui.config("web", "port", 8000))
177 use_ipv6 = ui.configbool("web", "ipv6")
177 use_ipv6 = repo.ui.configbool("web", "ipv6")
178 webdir_conf = ui.config("web", "webdir_conf")
178 webdir_conf = repo.ui.config("web", "webdir_conf")
179 accesslog = openlog(ui.config("web", "accesslog", "-"), sys.stdout)
179 accesslog = openlog(repo.ui.config("web", "accesslog", "-"), sys.stdout)
180 errorlog = openlog(ui.config("web", "errorlog", "-"), sys.stderr)
180 errorlog = openlog(repo.ui.config("web", "errorlog", "-"), sys.stderr)
181
181
182 if use_threads:
182 if use_threads:
183 try:
183 try:
@@ -3,9 +3,15 b''
3 hg init test
3 hg init test
4 cd test
4 cd test
5
5
6 echo '[web]' > .hg/hgrc
7 echo 'accesslog = access.log' >> .hg/hgrc
8
6 echo % Without -v
9 echo % Without -v
7 hg serve -a localhost -p 20063 -d --pid-file=hg.pid
10 hg serve -a localhost -p 20063 -d --pid-file=hg.pid
8 cat hg.pid >> "$DAEMON_PIDS"
11 cat hg.pid >> "$DAEMON_PIDS"
12 if [ -f access.log ]; then
13 echo 'access log created - .hg/hgrc respected'
14 fi
9
15
10 echo % With -v
16 echo % With -v
11 hg serve -a localhost -p 20064 -d --pid-file=hg.pid -v
17 hg serve -a localhost -p 20064 -d --pid-file=hg.pid -v
@@ -1,3 +1,4 b''
1 % Without -v
1 % Without -v
2 access log created - .hg/hgrc respected
2 % With -v
3 % With -v
3 listening at http://localhost:20064/
4 listening at http://localhost:20064/
General Comments 0
You need to be logged in to leave comments. Login now