hgweb.fcgi
22 lines
| 668 B
| text/plain
|
TextLexer
/ contrib / hgweb.fcgi
Matt Mackall
|
r11002 | #!/usr/bin/env python | ||
# | ||||
# An example FastCGI script for use with flup, edit as necessary | ||||
# Path to repo or hgweb config to serve (see 'hg help hgweb') | ||||
Harald Klimach
|
r45964 | config = b"/path/to/repo/or/config" | ||
Matt Mackall
|
r11002 | |||
Matt Mackall
|
r15475 | # Uncomment and adjust if Mercurial is not installed system-wide | ||
# (consult "installed modules" path from 'hg debuginstall'): | ||||
Gregory Szorc
|
r44058 | # import sys; sys.path.insert(0, "/path/to/python/lib") | ||
Matt Mackall
|
r11002 | |||
# Uncomment to send python tracebacks to the browser if an error occurs: | ||||
Gregory Szorc
|
r44058 | # import cgitb; cgitb.enable() | ||
Matt Mackall
|
r11002 | |||
Gregory Szorc
|
r44058 | from mercurial import demandimport | ||
demandimport.enable() | ||||
Matt Mackall
|
r11002 | from mercurial.hgweb import hgweb | ||
from flup.server.fcgi import WSGIServer | ||||
Gregory Szorc
|
r44058 | |||
Matt Mackall
|
r11002 | application = hgweb(config) | ||
WSGIServer(application).run() | ||||