Problem with hgwebdir.cgi script!

Paul Boddie paul.boddie at biotek.uio.no
Fri Dec 18 10:13:41 CST 2009


gda wrote:
> Hi all,
> I have a problem with the cgi script hgwebdir.cgi that is getting me crazy!
>
> This is my script:
>
> #!/usr/bin/env python
> #
> # send python tracebacks to the browser if an error occurs:
> import cgitb
> cgitb.enable()
>
> from mercurial.hgweb.hgwebdir_mod import hgwebdir
> from mercurial.hgweb.request import wsgiapplication
> import mercurial.hgweb.wsgicgi as wsgicgi
>
> [collections]
> /home/myuser = /home/myuser
>   

This is a Python program, and although [collections] is actually valid 
Python syntax, the line following it is not. You should put these two 
lines in a separate hgweb.config file, not in the actual hgwebdir.cgi 
program. See this documentation for details:

http://mercurial.selenic.com/wiki/PublishingRepositories#multiple

[...]

> The line 14 of the script hgwebdir.cgi  is:
> /home/myuser = /home/myuser 
> and I cannot see any syntax error!!!
>   

It's a Python syntax error.

> What I'm doing wrong!
>
> I guess this is not an Apache configuration problem because I can use
> without any problems the script hgweb.cgi (http://mypc/~myuser/hgweb.cgi)
>   

Yes, but that's a different program.

> Moreover if I go to the folder containing my repository and I give the
> command
> hg serve --webdir-conf myconf.cnf
>   

And this isn't Apache.

> where myconf.cnf is
>
> [collections]
> /home/myuser=/home/myuser
>
> everything works fine!!
>   

You should put this myconf.cnf file in the same directory as the 
hgwebdir.cgi program, calling it hgweb.config.

Paul


More information about the Mercurial mailing list