hgweb.cgi
22 lines
| 685 B
| text/plain
|
TextLexer
Gregory Szorc
|
r46434 | #!/usr/bin/env python3 | ||
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') | ||
Harald Klimach
|
r45964 | config = b"/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'): | ||||
Gregory Szorc
|
r44089 | # 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: | ||
Gregory Szorc
|
r44089 | # import cgitb; cgitb.enable() | ||
from mercurial import demandimport | ||||
mpm@selenic.com
|
r391 | |||
Gregory Szorc
|
r44089 | demandimport.enable() | ||
Matt Mackall
|
r11000 | from mercurial.hgweb import hgweb, wsgicgi | ||
Gregory Szorc
|
r44089 | |||
Matt Mackall
|
r11000 | application = hgweb(config) | ||
Thomas Arendsen Hein
|
r6141 | wsgicgi.launch(application) | ||