view hgweb.cgi @ 30729:a4bc8fff67fc

help: apply the section headings from revsets to filesets This has the nice property of visually breaking up the wall of text. It also allows specific smaller sections to be called out. For example, `hg help filesets.predicates` now prints just the predicate section. At the moment, the revset headings are a superset of the fileset headings, so there is consistency in how example, predicate and operator help is called out. The reference to `hg help patterns` was moved to the overview section, so that it isn't stuck in the examples section.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 08 Jan 2017 02:40:36 -0500
parents 4b0fc75f9403
children 47ef023d0165
line wrap: on
line source

#!/usr/bin/env python
#
# 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 = "/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)