[PATCH] Fix for Issue1260

Frank Kingswood frank at kingswood-consulting.co.uk
Fri Aug 15 09:53:24 CDT 2008


Adrian Buehlmann wrote:
> # HG changeset patch
> # User Adrian Buehlmann <adrian at cadifra.com>
> # Date 1218803955 -7200
> # Node ID fcb89cadd5530f8d680b8bca9235d5bc9f3f4fd5
> # Parent  438e02b4be73ffd80d4a6cc45b7c9273d6b26604
> Fix for Issue1260
> 
> diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
> --- a/mercurial/statichttprepo.py
> +++ b/mercurial/statichttprepo.py
> @@ -24,7 +24,7 @@
>  
>  def opener(base):
>      """return a function that opens files over http"""
> -    p = base
> +    p = base.replace('\\', '/')
>      def o(path, mode="r"):
>          f = "/".join((p, urllib.quote(path)))
>          return rangereader(f)

This seems the wrong place to handle this. Shouldn't the callers be 
fixed instead, so that statichttprepo gets valid URLs?

If the user of statichttprepo calls os.path.join() with an argument that 
is not an OS path, then *it* is plain wrong, not statichttprepo.

Frank



More information about the Mercurial-devel mailing list