view hgweb.cgi @ 44569:5483e9c759e4

tests: add test for remotefilelog interactions with hgweb It's not uncommon for hg users to rely on hgweb as a simple GUI and history browser (I do this all the time on Mercurial), but we lack any tests to ensure things keep working. At present, this merely demonstrates the "view contents of a single file" endpoint is broken. I'll fix that in a subsequent change. Differential Revision: https://phab.mercurial-scm.org/D8298
author Augie Fackler <augie@google.com>
date Tue, 17 Mar 2020 17:21:34 -0400
parents 47ef023d0165
children d58a205d0672
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)