sapling/hgwebdir.cgi
mpm@selenic.com e827a5700c Add a multi-repository server
This merges a bunch of the ideas for a multi-repository CGI script and
simplifies things a bit.

It uses PATH_INFO so it generally wants paths of the form:

http://host/hg.cgi/virtualpath

This gets mapped via a simple config file to the real path. All info
about the repo is read from the repo's hgrc.
2005-08-19 16:38:25 -08:00

18 lines
405 B
Python

#!/usr/bin/env python
#
# An example CGI script to export multiple hgweb repos, edit as necessary
import cgi, cgitb, os, sys, ConfigParser
cgitb.enable()
# sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
from mercurial import hgweb
# The config file looks like this:
# [paths]
# virtual/path = /real/path
# virtual/path = /real/path
h = hgweb.hgwebdir("hgweb.config")
h.run()