statichttprepo: abort if opener mode is 'r+' or 'rb+'
The old version of the check failed to catch
modifying modes 'r+' and 'rb+'.
--- a/mercurial/statichttprepo.py Fri Mar 04 14:11:15 2011 +0100
+++ b/mercurial/statichttprepo.py Fri Feb 18 01:19:01 2011 +0100
@@ -71,7 +71,7 @@
"""return a function that opens files over http"""
p = base
def o(path, mode="r", atomictemp=None):
- if 'a' in mode or 'w' in mode:
+ if mode not in ('r', 'rb'):
raise IOError('Permission denied')
f = "/".join((p, urllib.quote(path)))
return httprangereader(f, urlopener)