| 1 |
#!/usr/bin/env python3 |
| 2 |
# |
| 3 |
# An example hgweb CGI script, edit as necessary |
| 4 |
# See also https://mercurial-scm.org/wiki/PublishingRepositories |
| 5 |
|
| 6 |
# Path to repo or hgweb config to serve (see 'hg help hgweb') |
| 7 |
config = b"/path/to/repo/or/config" |
| 8 |
|
| 9 |
# Uncomment and adjust if Mercurial is not installed system-wide |
| 10 |
# (consult "installed modules" path from 'hg debuginstall'): |
| 11 |
# import sys; sys.path.insert(0, "/path/to/python/lib") |
| 12 |
|
| 13 |
from mercurial import demandimport |
| 14 |
|
| 15 |
demandimport.enable() |
| 16 |
from mercurial.hgweb import hgweb, wsgicgi |
| 17 |
|
| 18 |
application = hgweb(config) |
| 19 |
wsgicgi.launch(application) |