# HG changeset patch # User mpm@selenic.com # Date 1115230030 28800 # Node ID 6daf7757e92b6f85866877c6f136a92fb7af16ce # Parent e0e5c1b9febdda2231454bc7cf1ef09b31f6a734 Fix network pull of repo files with "%" in their base64 encoding. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -6,6 +6,7 @@ # of the GNU General Public License, incorporated herein by reference. import sys, struct, sha, socket, os, time, base64, re, urllib2, binascii +import urllib from mercurial import byterange from mercurial.transaction import * from mercurial.revlog import * @@ -211,9 +212,11 @@ class dircache: def opener(base): p = base def o(path, mode="r"): + if p[:7] == "http://": + f = os.path.join(p, urllib.quote(path)) + return httprangereader(f) + f = os.path.join(p, path) - if p[:7] == "http://": - return httprangereader(f) if mode != "r" and os.path.isfile(f): s = os.stat(f)