Mercurial 1.0.1 with IIS 5.1

Matt Mackall mpm at selenic.com
Tue Oct 28 15:22:31 CDT 2008


I assume this is still an issue? What should be done about IIS?

On Mon, 2008-08-18 at 15:49 -0400, darcy parks wrote:
> Hi,
> 
> I've been working to set up Mercurial with IIS 5.1 using a previous
> message to this list [1] as a guide.  That patch seems to be out of
> date though; here's what works for me with Mercurial 1.0.1:
> 
> --- hgwebdir_mod.py.orig        2008-08-18 15:16:19.906250000 -0400
> +++ hgwebdir_mod.py     2008-08-18 15:16:43.109375000 -0400
> @@ -80,6 +80,10 @@
>              try:
> 
>                  virtual = req.env.get("PATH_INFO", "").strip('/')
> +                if virtual == 'hgwebdir.cgi':
> +                    virtual = ''
> +                elif virtual[:12] == 'hgwebdir.cgi':
> +                    virtual = virtual[13:]
>                  tmpl = self.templater(req)
>                  try:
>                      ctype = tmpl('mimetype', encoding=util._encoding)
> @@ -278,6 +282,11 @@
>          def config(section, name, default=None, untrusted=True):
>              return self.parentui.config(section, name, default,
> untrusted)
> 
> +        if (req.env['SERVER_SOFTWARE'].split('/')[0] ==
> 'Microsoft-IIS'):
> +            if req.env['PATH_INFO'] == '/hgwebdir.cgi':
> +                req.env['PATH_INFO'] = '/'
> +            elif req.env['PATH_INFO'][:13] == '/hgwebdir.cgi':
> +                req.env['PATH_INFO'] = req.env['PATH_INFO'][14:]
> 
>          if self._baseurl is not None:
>              req.env['SCRIPT_NAME'] = self._baseurl
> 
> 
> In short, IIS includes the script name ("hgwebdir.cgi") in PATH_INFO
> while Apache doesn't.  Stripping it out in these two places lets me
> use the web interface and push/pull over HTTP.
> 
> darcy parks
> 
> [1]
> http://www.selenic.com/pipermail/mercurial/2007-October/015229.html
> 
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list