hgweb.cgi
author Matt Harbison <matt_harbison@yahoo.com>
Mon, 14 Dec 2020 17:59:10 -0500
changeset 46136 3158522085f0
parent 45830 c102b704edb5
child 50734 d5cd1fd690f3
permissions -rwxr-xr-x
setup: exclude the git extension from py2 builds This can't be built on Windows with the py2 compiler, and while old versions can be installed via pip on Linux, I can't get the tests to run (even with py3.8) using pygit2 0.28.2. Some manually run commands work, and others spew stack traces that don't occur with the current 1.4.0 release using py3. Differential Revision: https://phab.mercurial-scm.org/D9604

#!/usr/bin/env python3
#
# An example hgweb CGI script, edit as necessary
# See also https://mercurial-scm.org/wiki/PublishingRepositories

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = b"/path/to/repo/or/config"

# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
# import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
# import cgitb; cgitb.enable()

from mercurial import demandimport

demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi

application = hgweb(config)
wsgicgi.launch(application)