170 def openlog(opt, default): |
170 def openlog(opt, default): |
171 if opt and opt != '-': |
171 if opt and opt != '-': |
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: |
184 from threading import activeCount |
184 from threading import activeCount |
185 except ImportError: |
185 except ImportError: |