comparison 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
comparison
equal deleted inserted replaced
2121:150cdd6c3c90 2122:9383ba6b069a
886 return default 886 return default
887 887
888 address = repo.ui.config("web", "address", "") 888 address = repo.ui.config("web", "address", "")
889 port = int(repo.ui.config("web", "port", 8000)) 889 port = int(repo.ui.config("web", "port", 8000))
890 use_ipv6 = repo.ui.configbool("web", "ipv6") 890 use_ipv6 = repo.ui.configbool("web", "ipv6")
891 webdir_conf = repo.ui.config("web", "webdir_conf")
891 accesslog = openlog(repo.ui.config("web", "accesslog", "-"), sys.stdout) 892 accesslog = openlog(repo.ui.config("web", "accesslog", "-"), sys.stdout)
892 errorlog = openlog(repo.ui.config("web", "errorlog", "-"), sys.stderr) 893 errorlog = openlog(repo.ui.config("web", "errorlog", "-"), sys.stderr)
893 894
894 if use_threads: 895 if use_threads:
895 try: 896 try:
972 accept = accept + line[7:].split(',') 973 accept = accept + line[7:].split(',')
973 env['HTTP_ACCEPT'] = ','.join(accept) 974 env['HTTP_ACCEPT'] = ','.join(accept)
974 975
975 req = hgrequest(self.rfile, self.wfile, env) 976 req = hgrequest(self.rfile, self.wfile, env)
976 self.send_response(200, "Script output follows") 977 self.send_response(200, "Script output follows")
977 hgweb(repo.__class__(repo.ui, repo.origroot)).run(req) 978
979 if webdir_conf:
980 hgwebobj = hgwebdir(hgwebdir_conf)
981 else:
982 hgwebobj = hgweb(repo.__class__(repo.ui, repo.origroot))
983 hgwebobj.run(req)
984
978 985
979 if use_ipv6: 986 if use_ipv6:
980 return IPv6HTTPServer((address, port), hgwebhandler) 987 return IPv6HTTPServer((address, port), hgwebhandler)
981 else: 988 else:
982 return MercurialHTTPServer((address, port), hgwebhandler) 989 return MercurialHTTPServer((address, port), hgwebhandler)