hgweb.cgi
19 lines
| 680 B
| text/plain
|
TextLexer
mpm@selenic.com
|
r202 | #!/usr/bin/env python | ||
mpm@selenic.com
|
r159 | # | ||
Matt Mackall
|
r11000 | # An example hgweb CGI script, edit as necessary | ||
Matt Mackall
|
r26421 | # See also https://mercurial-scm.org/wiki/PublishingRepositories | ||
mpm@selenic.com
|
r159 | |||
Matt Mackall
|
r11000 | # Path to repo or hgweb config to serve (see 'hg help hgweb') | ||
config = "/path/to/repo/or/config" | ||||
Benoit Boissinot
|
r5244 | |||
Matt Mackall
|
r15475 | # Uncomment and adjust if Mercurial is not installed system-wide | ||
# (consult "installed modules" path from 'hg debuginstall'): | ||||
Matt Mackall
|
r11000 | #import sys; sys.path.insert(0, "/path/to/python/lib") | ||
Thomas Arendsen Hein
|
r5197 | |||
Maxim Dounin
|
r6080 | # Uncomment to send python tracebacks to the browser if an error occurs: | ||
Matt Mackall
|
r11000 | #import cgitb; cgitb.enable() | ||
mpm@selenic.com
|
r391 | |||
Matt Mackall
|
r11000 | from mercurial import demandimport; demandimport.enable() | ||
from mercurial.hgweb import hgweb, wsgicgi | ||||
application = hgweb(config) | ||||
Thomas Arendsen Hein
|
r6141 | wsgicgi.launch(application) | ||