multirepo web serving question

Jordan Breeding jordan.breeding at
Wed Aug 31 15:49:24 CDT 2005

On Aug 31, 2005, at 12:28 , Bryan O'Sullivan wrote:

> On Wed, 2005-08-31 at 08:00 -0500, Jordan Breeding wrote:
> Good timing.  I just wrote a wiki page on this last night:
>> 1) in this setup how do you get the description and contact
>> information?  do these need to be in .hg/hgrc?
> Yes.
>> is there something
>> special that I am missing on either the hg or the apache side to make
>> the links to the repos actually work?
> Yes, but it's not obvious.  See the bottom of the wiki page - you need
> to get Apache to route every request to that area through the
> hgwebdir.cgi script, so that it will set PATH_INFO properly.
>     <b

I was trying to set mine up in a userdir environment so that <server>/ 
~jordan/hg will show the repos and clicking on them will work.  I  
have failed in my attempt, here is what I have done so far:

The repo is at /Users/jordan/hg_repos/mercurial (only one right now).

Relevant section of the apache config:

<Directory "/Users/jordan/Sites/">
     AllowOverride FileInfo AuthConfig Limit
     Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
     DirectoryIndex hgwebdir.cgi
     AddHandler cgi-script .cgi
     RewriteEngine on
     RewriteRule ^hg(/repos/.*)$ /Users/jordan/Sites/hg/hgwebdir.cgi$1

My hgwebdir.cgi script (at /Users/jordan/Sites/hg/hgwebdir.cgi):

# An example CGI script to export multiple hgweb repos, edit as  

import cgitb, sys

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

# The config file looks like this:
# [paths]
# virtual/path = /real/path
# virtual/path = /real/path

# Alternatively you can pass a list of ('virtual/path', '/real/path')  
# or use a dictionary with entries like 'virtual/path': '/real/path'

repos = {};

repos["repos/mercurial"] = "/Users/jordan/hg_repos/mercurial";

h = hgweb.hgwebdir(repos);

This is the error I get when clicking on the repo in the listing:
Not Found

The requested URL /Users/jordan/Sites/hg/hgwebdir.cgi/repos/mercurial  
was not found on this server.

Any ideas?


More information about the Mercurial mailing list