1#!/usr/local/bin/python3.8 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') 7config = 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# Uncomment to send python tracebacks to the browser if an error occurs: 14# import cgitb; cgitb.enable() 15 16from mercurial import demandimport 17 18demandimport.enable() 19from mercurial.hgweb import hgweb, wsgicgi 20 21application = hgweb(config) 22wsgicgi.launch(application) 23