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