mercurial/hgweb.py
changeset 603 bc5d058e65e9
parent 601 8865eb8ade99
child 605 8e82fd763be2
--- a/mercurial/hgweb.py
+++ b/mercurial/hgweb.py
@@ -694,7 +694,7 @@ class hgweb:
         else:
             write(self.t("error"))
 
-def server(path, name, templates, address, port):
+def create_server(path, name, templates, address, port):
 
     import BaseHTTPServer
     import sys, os
@@ -759,5 +759,8 @@ def server(path, name, templates, addres
                 sys.argv, sys.stdin, sys.stdout, sys.stderr = save
 
     hg = hgweb(path, name, templates)
-    httpd = BaseHTTPServer.HTTPServer((address, port), hgwebhandler)
+    return BaseHTTPServer.HTTPServer((address, port), hgwebhandler)
+
+def server(path, name, templates, address, port):
+    httpd = create_server(path, name, templates, address, port)
     httpd.serve_forever()