hg clone error... setup help.

Brendan Cully brendan at kublai.com
Thu Jul 3 11:27:37 CDT 2008


Hi Mukesh, fancy seeing you here.

On Tuesday, 01 July 2008 at 17:57, Mukesh Rathor wrote:
> Hi,
>   I've been trying to setup mercurial for our group's use for the last few 
> days, now I've hit a wall.
> 
> Basically, the goal is to setup a hierarchy like:
> 
> /d1/d2/r1.hg
> /d1/d2/r2.hg
> /d3/d4/r9.hg
> 
> I don't want to display all the repos' on first page, but wanna navigate (so 
> first display d1 and d2, then d2 or d4 etc...), hence I decided not to use 
> hgwebdir.cgi, but hgweb.cgi as hgwebdir seemed to not display folders.

It might interest you to know that hgwebdir will let you provide a
partial path, showing only repositories under that path. So if your
hgwebdir root is http://host/hg, then http://host/hg/d1 will show only
the two d2 repos above.

...
> [Tue Jul 01 17:49:58 2008] [error] [client 139.185.48.5] malformed header from 
> script. Bad header=6 changesets found: hgweb.cgi
...
> My hgweb.cgi looks like:
> #!/usr/bin/env python
> 
> import cgitb, os, sys
> cgitb.enable()
> from mercurial import hgweb
> MYURL='/var/www'+os.environ['REQUEST_URI']
> arr=MYURL.split('?')
> MYURL=arr[0]
> os.chdir(MYURL)
> 
> h = hgweb.hgweb("", "")
> h.run()
> 
> 
> I got an error (hgweb is not callable) when I tried to run the newer cgi to 
> test it out:
> application = hgweb("/var/www/muk/OVM/unstable-0609/xen-unstable.hg", "XYZ")
> wsgicgi.launch(application)

Take a closer look at the distributed hgweb.cgi:

from mercurial.hgweb.hgweb_mod import hgweb
import mercurial.hgweb.wsgicgi as wsgicgi

application = hgweb("/path/to/repo", "repository name")
wsgicgi.launch(application)


More information about the Mercurial mailing list