hgweb.cgi
author Christian Ebert <blacktrash@gmx.net>
Wed, 01 Dec 2010 10:51:49 +0100
branchstable
changeset 13069 6aff4f144ad3
parent 11503 227b9f13db13
child 15475 85cba926cb59
permissions -rwxr-xr-x
keyword: copy: when copied source is a symlink, follow it 1) hg cp symlink copy -> copy is a symlink. 2) cp symlink copy; hg cp -A symlink copy -> copy is a regular file. In the second case we have to follow the symlink to its target to find out whether we have to unexpand keywords in the copy. Add test covering the case where the copied link's target is ignored by keyword but has content which would match the regex for expanded keywords to check whether we indeed leave the destination alone.

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