diff hgwebdir.cgi @ 941:4cf418c2a013

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.
author mpm@selenic.com
date Fri, 19 Aug 2005 16:38:25 -0800
parents
children 8d791bea49d4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hgwebdir.cgi	Fri Aug 19 16:38:25 2005 -0800
@@ -0,0 +1,17 @@
+#!/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()