view hgweb.cgi @ 25426:5f3666da6910 stable

hgwebdir: don't allow the hidden parent of a subrepo to show as a directory Previously, if a subrepo parent had 'web.hidden=True' set, neither the parent nor child had a repository entry. However, the directory entry for the parent would be listed (it wouldn't have the fancy 'web.name' if configured), and that link went to the repo's summary page, effectively making it not hidden. This simply disables the directory processing if a valid repository is present. Whether or not the subrepo should be hidden is debatable, but this leaves that behavior unchanged (i.e. it stays hidden).
author Matt Harbison <mharbison@attotech.com>
date Mon, 01 Jun 2015 18:06:20 -0400
parents 85cba926cb59
children 4b0fc75f9403
line wrap: on
line source

#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# See also http://mercurial.selenic.com/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)