--- a/mercurial/hgweb/server.py Tue Mar 09 21:53:16 2010 -0500
+++ b/mercurial/hgweb/server.py Thu Mar 11 11:21:48 2010 +0100
@@ -233,6 +233,14 @@
class _mixin:
pass
+ if webdir_conf:
+ hgwebobj = hgwebdir(webdir_conf, ui)
+ elif repo is not None:
+ hgwebobj = hgweb(hg.repository(repo.ui, repo.root))
+ else:
+ raise error.RepoError(_("There is no Mercurial repository"
+ " here (.hg not found)"))
+
class MercurialHTTPServer(object, _mixin, BaseHTTPServer.HTTPServer):
# SO_REUSEADDR has broken semantics on windows
@@ -244,16 +252,7 @@
self.accesslog = accesslog
self.errorlog = errorlog
self.daemon_threads = True
- def make_handler():
- if webdir_conf:
- hgwebobj = hgwebdir(webdir_conf, ui)
- elif repo is not None:
- hgwebobj = hgweb(hg.repository(repo.ui, repo.root))
- else:
- raise error.RepoError(_("There is no Mercurial repository"
- " here (.hg not found)"))
- return hgwebobj
- self.application = make_handler()
+ self.application = hgwebobj
if ssl_cert:
try: