mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
e827a5700c
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.
18 lines
405 B
Python
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()
|