Mercurial > public > mercurial-scm > hg-stable
diff mercurial/store.py @ 6896:40690d614ce6
store: take opener as an argument
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 13 Aug 2008 20:18:42 -0500 |
parents | dab95717058d |
children | faea0d27e38f |
line wrap: on
line diff
--- a/mercurial/store.py Wed Aug 13 20:18:42 2008 -0500 +++ b/mercurial/store.py Wed Aug 13 20:18:42 2008 -0500 @@ -94,16 +94,16 @@ yield x class directstore(_store): - def __init__(self, path): + def __init__(self, path, opener): _store.__init__(self, path) - self.opener = util.opener(self.path) + self.opener = opener(self.path) self.opener.createmode = self.createmode class encodedstore(_store): - def __init__(self, path): + def __init__(self, path, opener): _store.__init__(self, os.path.join(path, 'store')) self.encodefn = encodefilename - op = util.opener(self.path) + op = opener(self.path) op.createmode = self.createmode self.opener = lambda f, *args, **kw: op(self.encodefn(f), *args, **kw) @@ -125,8 +125,8 @@ else: return encodefilename -def store(requirements, path): +def store(requirements, path, opener): if 'store' not in requirements: - return directstore(path) + return directstore(path, opener) else: - return encodedstore(path) + return encodedstore(path, opener)