hgweb.cgi
18 lines
| 623 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 | ||
Martin Geisler
|
r11503 | # See also http://mercurial.selenic.com/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
|
r11000 | # Uncomment and adjust if Mercurial is not installed system-wide: | ||
#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) | ||