hgweb.cgi
author Bryan O'Sullivan <bos@serpentine.com>
Fri, 12 Aug 2005 11:16:58 -0800
changeset 884 087771ebe2e6
parent 391 5f65a108a559
child 2506 d0db3462d568
permissions -rw-r--r--
Fix walk code for files that do not exist anywhere, and unhandled types. Prior to this, a file that did not exist was reported as showing up in the filesystem, as were files of unsupported types (such as fifos). Now, an error message is printed and nothing is returned in such cases. This change also moves the commands.pathto function to the util module, as the walk code needs it to print non-confusing error messages.

#!/usr/bin/env python
#
# An example CGI script to use hgweb, edit as necessary

import cgitb, os, sys
cgitb.enable()

# sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
from mercurial import hgweb

h = hgweb.hgweb("/path/to/repo", "repository name")
h.run()