view hgweb.cgi @ 32827:d3ab31bf9c0e stable

largefiles: avoid a crash when archiving a subrepo with largefiles disabled This path is also used for extdiff, which is how I crossed paths with it. Without this, an AttributeError occurs looking for 'lfstatus' on localrepository. See also d414c28db84d. The other archive method is for the archival.py override, so it doesn't need to be special cased like this. (It looks like it is only called for the top level repo.) Likewise, the transplant override is also for commands.py. The other overrides set lfstatus before examining it.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 13 Jun 2017 22:24:41 -0400
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)