I have Jetty web server from which I want to run hgweb.cgi:
ProcessBuilder builder = new ProcessBuilder("/MyPath/hgweb.cgi");
Then I create Process process = builder.start();
and feed Input stream from request to process forming server response. But there's a problem: some kind of python error I can't understand
File "<stdin>", line 1, in <module>
File "mercurial/hgweb/wsgicgi.py", line 76, in launch
content = application(environ, start_response)
File "mercurial/hgweb/hgweb_mod.py", line 168, in __call__
return self.run_wsgi(req)
File "mercurial/hgweb/hgweb_mod.py", line 177, in run_wsgi
req.url = req.env['SCRIPT_NAME']
KeyError: 'SCRIPT_NAME
That doesn't work from command line neither. I tried to add a header (SCRIPT_NAME, "") to formed request for hgweb.cgi but continue see that message.
In every example of using hgweb people use apache / lighttpd / nginx servers to run hgweb.cgi and I can't understand why nodody did what I want to do.
If anybody could help me with configuring hgweb.cgi or told me a proper way to call .cgi script from java I would be really happy!