need help with hgwebdir

Paul Boddie paul.boddie at biotek.uio.no
Tue Nov 2 13:12:55 UTC 2010


John Stean wrote:
> Sorry in advance to all, I posted this question yesterday with no 
> responses, but I've seen some quick replies to other questions since.
>
> Perhaps I posted to the wrong list, or maybe my question was dumb or 
> not enough info provided? Let me know if so, thanks
>
> again, sorry for the repeat post - still struggling to get multiple 
> repos to appear , if anyone can help its of course greatly appreciated.

Sorry! I was going to respond yesterday, but I got distracted by other 
things.

[...]

> I want to publish multiple repositories on a Fedora box.
>
> I have followed the instructions here: 
> http://mercurial.selenic.com/wiki/RHEL4HgWebDirSetup

Did you use the exact URL scheme described there or something slightly 
different? What worries me with these instructions is the use of things 
like ScriptAliasMatch, which is more complicated than ScriptAlias and 
has some pitfalls, along with things like mixing up the repository 
location with the Web publishing directory (albeit the CGI directory). 
This can lead to debugging problems later.

> It all works fine for 1 repository, but cannot get the 2nd or nth to 
> work, tried all different config options.
>
> I have created two repos:
>
> /home/scm/ hg init projecta
> /home/scm/ hg init projectb
>
> in the hgweb.config I have:
>
> [paths]
>
> projecta = /home/scm/projecta
> projectb = /home/scm/projectb
> (i have also tried the /home/scm/* to no avail)

See 
http://mercurial.selenic.com/wiki/PublishingRepositories#Publishing_multiple_repositories 
for some details of the configuration file, although I see that 
wildcards are not described there, so maybe some notes there are also 
required. Nevertheless, your configuration seems reasonable, and you 
shouldn't bother making symbolic links into /var/www/cgi-hg, which is 
what the RHEL4 page suggests.

> url / just lists projecta

Does it list "projecta" in the hgweb user interface or as an Apache 
directory listing?

> url /projecta shows the projecta repo
> url /projectb gives an internal server error
>
> If I reverse the order or projecta and b in the [paths] section, 
> projectb works and projecta throws the error.
>
> Here is the error:
>
>  [error]  Traceback (most recent call last):
>  [error]    File "/var/www/cgi-hg/hgwebdir.cgi", line 67, in <module>
>  [error]
>  [error]  wsgicgi.launch(application)
>  [error]    File 
> "/usr/lib/python2.5/site-packages/mercurial/hgweb/wsgicgi.py", line 
> 69, in launch
>  [error]
>  [error]  for chunk in content:
>  [error]    File "/usr/lib/python2.5/site-packages/mercurial/util.py", 
> line 319, in increasingchunks
>  [error]
>  [error]  for chunk in source:
>  [error]    File 
> "/usr/lib/python2.5/site-packages/mercurial/templater.py", line 148, 
> in expand
>  [error]
>  [error]  item = iters[0].next()
>  [error]    File 
> "/usr/lib/python2.5/site-packages/mercurial/templater.py", line 122, 
> in _process
>  [error]
>  [error]  % (key, format))
>  [error]  SyntaxError
>  [error]  :
>  [error]  Error expanding 'sessionvars%urlparameter'
>  [error]
>  [error]  Premature end of script headers: hgwebdir.cgi

This indicates that the template serving the page doesn't find 
sessionvars, which would suggest that the hgweb repository template is 
being asked to serve up the hgweb repository *list*. Or that's one 
possible explanation.

> I have disabled selinux to no effect.
>
> Can anyone offer a suggestion?

Do you have symbolic links to the repositories in the CGI directory? If 
so, remove them. That will remove one source of confusion about what 
Apache will be attempting to do with your repositories.

Paul

P.S. Don't worry: we'll figure this out eventually; it just takes some 
patience.



More information about the Mercurial mailing list