195 def openlog(opt, default): |
195 def openlog(opt, default): |
196 if opt and opt != '-': |
196 if opt and opt != '-': |
197 return open(opt, 'w') |
197 return open(opt, 'w') |
198 return default |
198 return default |
199 |
199 |
200 address = ui.config("web", "address", "") |
200 address = repo.ui.config("web", "address", "") |
201 port = int(ui.config("web", "port", 8000)) |
201 port = int(repo.ui.config("web", "port", 8000)) |
202 use_ipv6 = ui.configbool("web", "ipv6") |
202 use_ipv6 = repo.ui.configbool("web", "ipv6") |
203 webdir_conf = ui.config("web", "webdir_conf") |
203 webdir_conf = repo.ui.config("web", "webdir_conf") |
204 ssl_cert = ui.config("web", "certificate") |
204 ssl_cert = repo.ui.config("web", "certificate") |
205 accesslog = openlog(ui.config("web", "accesslog", "-"), sys.stdout) |
205 accesslog = openlog(repo.ui.config("web", "accesslog", "-"), sys.stdout) |
206 errorlog = openlog(ui.config("web", "errorlog", "-"), sys.stderr) |
206 errorlog = openlog(repo.ui.config("web", "errorlog", "-"), sys.stderr) |
207 |
207 |
208 if use_threads: |
208 if use_threads: |
209 try: |
209 try: |
210 from threading import activeCount |
210 from threading import activeCount |
211 except ImportError: |
211 except ImportError: |