Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/hg.py @ 15:6daf7757e92b
Fix network pull of repo files with "%" in their base64 encoding.
author | mpm@selenic.com |
---|---|
date | Wed, 04 May 2005 10:07:10 -0800 |
parents | e76ed1e480ef |
children | 12360c04fa48 |
comparison
equal
deleted
inserted
replaced
14:e0e5c1b9febd | 15:6daf7757e92b |
---|---|
4 # | 4 # |
5 # This software may be used and distributed according to the terms | 5 # This software may be used and distributed according to the terms |
6 # of the GNU General Public License, incorporated herein by reference. | 6 # of the GNU General Public License, incorporated herein by reference. |
7 | 7 |
8 import sys, struct, sha, socket, os, time, base64, re, urllib2, binascii | 8 import sys, struct, sha, socket, os, time, base64, re, urllib2, binascii |
9 import urllib | |
9 from mercurial import byterange | 10 from mercurial import byterange |
10 from mercurial.transaction import * | 11 from mercurial.transaction import * |
11 from mercurial.revlog import * | 12 from mercurial.revlog import * |
12 | 13 |
13 def hex(node): return binascii.hexlify(node) | 14 def hex(node): return binascii.hexlify(node) |
209 | 210 |
210 # used to avoid circular references so destructors work | 211 # used to avoid circular references so destructors work |
211 def opener(base): | 212 def opener(base): |
212 p = base | 213 p = base |
213 def o(path, mode="r"): | 214 def o(path, mode="r"): |
215 if p[:7] == "http://": | |
216 f = os.path.join(p, urllib.quote(path)) | |
217 return httprangereader(f) | |
218 | |
214 f = os.path.join(p, path) | 219 f = os.path.join(p, path) |
215 if p[:7] == "http://": | |
216 return httprangereader(f) | |
217 | 220 |
218 if mode != "r" and os.path.isfile(f): | 221 if mode != "r" and os.path.isfile(f): |
219 s = os.stat(f) | 222 s = os.stat(f) |
220 if s.st_nlink > 1: | 223 if s.st_nlink > 1: |
221 file(f + ".tmp", "w").write(file(f).read()) | 224 file(f + ".tmp", "w").write(file(f).read()) |