Viewing .cgi files in hgwebdir.cgi

Patrick Mézard pmezard at gmail.com
Thu Apr 15 06:56:36 CDT 2010


Le 15/04/10 12:16, Ulrich Kautz a écrit :
> Hello all
> 
> i'm totally new to mercurial but already like it a lot. However, i have a small problem with hgwebdir.cgi (as well as hg serve) and viewing .cgi-files in the repository browser.
> Each time i try to view any file named "something.cgi" it takes me back to the repository overview.
> 
> I came across this posting in the mailing list:
> http://www.selenic.com/pipermail/mercurial/2009-March/024852.html
> 
> There does not seem to be any solution, but some trial-and-error lead me to the "wsgicgi.py". After commenting out two lines, everything seems to work fine. Reading the current mercurial 1.5.1 source code, it seems that those lines has been removed (but there are a lot of other changes as well), so i'm not sure wheter this will break anything else - maybe some mercurial developer could check on this ?
> 
> Here is the changed part (the two commented lines..):
> 
> ---
> 
> def launch(application):
>     util.set_binary(sys.stdin)
>     util.set_binary(sys.stdout)
> 
>     environ = dict(os.environ.iteritems())
>     environ.setdefault('PATH_INFO', '')
> #    if '.cgi' in environ['PATH_INFO']:
> #        environ['PATH_INFO'] = environ['PATH_INFO'].split('.cgi', 1)[1]
> 
>     environ['wsgi.input'] = sys.stdin
>     environ['wsgi.errors'] = sys.stderr
>     environ['wsgi.version'] = (1, 0)
>     environ['wsgi.multithread'] = False
>     environ['wsgi.multiprocess'] = True
>     environ['wsgi.run_once'] = True
> 
> ---
> 
> I am using mercurial 1.3.1-1 and python 2.6.4 from current ubuntu 9.10 stable (stick to the distri..).

This was http://mercurial.selenic.com/bts/issue1580

And was fixed in 1.4.2.

--
Patrick Mézard


More information about the Mercurial mailing list