Mercurial > public > mercurial-scm > hg
diff mercurial/hgweb/server.py @ 5083:f94dbc6c7eaf
Fix hgwebdir after 9858477ed74cce9dc8f4069f9453a1bda0e13ba1 broke it.
author | Eric Hopper <hopper@omnifarious.org> |
---|---|
date | Wed, 08 Aug 2007 22:47:30 +0200 |
parents | 9858477ed74c |
children | 86cd6fd61042 06154aff2b1a |
line wrap: on
line diff
--- a/mercurial/hgweb/server.py Tue Aug 07 15:56:26 2007 +0200 +++ b/mercurial/hgweb/server.py Wed Aug 08 22:47:30 2007 +0200 @@ -172,12 +172,28 @@ return open(opt, 'w') return default - address = repo.ui.config("web", "address", "") - port = int(repo.ui.config("web", "port", 8000)) - use_ipv6 = repo.ui.configbool("web", "ipv6") - webdir_conf = repo.ui.config("web", "webdir_conf") - accesslog = openlog(repo.ui.config("web", "accesslog", "-"), sys.stdout) - errorlog = openlog(repo.ui.config("web", "errorlog", "-"), sys.stderr) + def create_getconfig(section, *uis): # uis are least significant to most + def getconfig(var, default=None): + val = default + for u in uis: + val = u.config(section, var, val) + return val + def getconfigbool(var, default=None): + val = default + for u in uis: + val = u.configbool(section, var, val) + return (getconfig, getconfigbool) + + if repo is None: + getconfig, getconfigbool = create_getconfig("web", ui) + else: + getconfig, getconfigbool = create_getconfig("web", ui, repo.ui) + address = getconfig("address", "") + port = int(getconfig("port", 8000)) + use_ipv6 = getconfigbool("ipv6") + webdir_conf = getconfig("webdir_conf") + accesslog = openlog(getconfig("accesslog", "-"), sys.stdout) + errorlog = openlog(getconfig("errorlog", "-"), sys.stderr) if use_threads: try: