Patchwork [1,of,6] statichttprepo: update profile of __call__ in mock vfs object

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 14, 2014, 6:34 p.m.
Message ID <d35c8e8e2c7f980853fc.1418582060@ssl.google-analytics.com>
Download mbox | patch
Permalink /patch/7087/
State Accepted
Delegated to: Pierre-Yves David
Headers show

Comments

Mads Kiilerich - Dec. 14, 2014, 6:34 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1418581678 -3600
#      Sun Dec 14 19:27:58 2014 +0100
# Node ID d35c8e8e2c7f980853fc4da0f0e251f8ca197d43
# Parent  495bc1b65d25872324a0220354f048b220304bd1
statichttprepo: update profile of __call__ in mock vfs object

New code paths could fail because the old statichttprepo profile couldn't
handle the usual parameters.

Instead, reuse a more generic profile also used in readonlyvfs.

Patch

diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -70,7 +70,7 @@ 
         def __init__(self, base):
             self.base = base
 
-        def __call__(self, path, mode="r", atomictemp=None):
+        def __call__(self, path, mode='r', *args, **kw):
             if mode not in ('r', 'rb'):
                 raise IOError('Permission denied')
             f = "/".join((self.base, urllib.quote(path)))