hgweb.cgi
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Tue, 08 Mar 2016 23:04:53 +0900
changeset 28394 dcb4209bd30d
parent 26421 4b0fc75f9403
child 43691 47ef023d0165
permissions -rwxr-xr-x
revset: replace extpredicate by revsetpredicate of registrar This patch consists of changes below (these can't be applied separately). - replace revset.extpredicate by registrar.revsetpredicate in extensions - remove setup() on an instance named as revsetpredicate in uisetup()/extsetup() of each extensions registrar.revsetpredicate doesn't have setup() API. - put new entry for revsetpredicate into extraloaders in dispatch This causes implicit loading predicate functions at loading extension. This loading mechanism requires that an extension has an instance named as revsetpredicate, and this is reason why largefiles/__init__.py is also changed in this patch. Before this patch, test-revset.t tests that all decorated revset predicates are loaded by explicit setup() at once ("all or nothing"). Now, test-revset.t tests that any revset predicate isn't loaded at failure of loading extension, because loading itself is executed by dispatch and it can't be controlled on extension side.

#!/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)