Mercurial > hg
diff mercurial/hgweb.py @ 2122:9383ba6b069a
Added hgwebdir support to hg serve.
author | Alexander Schremmer <alex AT alexanderweb DOT de> |
---|---|
date | Sun, 23 Apr 2006 00:31:09 +0200 |
parents | 150cdd6c3c90 |
children | c0729a7f6f8a |
line wrap: on
line diff
--- a/mercurial/hgweb.py Sun Apr 23 00:27:46 2006 +0200 +++ b/mercurial/hgweb.py Sun Apr 23 00:31:09 2006 +0200 @@ -888,6 +888,7 @@ 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) @@ -974,7 +975,13 @@ req = hgrequest(self.rfile, self.wfile, env) self.send_response(200, "Script output follows") - hgweb(repo.__class__(repo.ui, repo.origroot)).run(req) + + if webdir_conf: + hgwebobj = hgwebdir(hgwebdir_conf) + else: + hgwebobj = hgweb(repo.__class__(repo.ui, repo.origroot)) + hgwebobj.run(req) + if use_ipv6: return IPv6HTTPServer((address, port), hgwebhandler)