diff mercurial/store.py @ 14092:222c8ec7a274

store: rename the 'opener' argument to 'openertype' The 'opener' argument wasn't, in fact, an actual opener instance, but rather something expected to return an opener. The normal argument, from localrepository, is the scmutil.opener type; hence 'openertype'.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sat, 30 Apr 2011 19:36:48 +0200
parents e24b5e3c2f27
children 9cbff8a39a2a
line wrap: on
line diff
--- a/mercurial/store.py	Sat Apr 30 19:41:25 2011 +0200
+++ b/mercurial/store.py	Sat Apr 30 19:36:48 2011 +0200
@@ -236,10 +236,10 @@
 
 class basicstore(object):
     '''base class for local repository stores'''
-    def __init__(self, path, opener):
+    def __init__(self, path, openertype):
         self.path = path
         self.createmode = _calcmode(path)
-        op = opener(self.path)
+        op = openertype(self.path)
         op.createmode = self.createmode
         self.opener = scmutil.filteropener(op, encodedir)
 
@@ -285,10 +285,10 @@
         pass
 
 class encodedstore(basicstore):
-    def __init__(self, path, opener):
+    def __init__(self, path, openertype):
         self.path = path + '/store'
         self.createmode = _calcmode(self.path)
-        op = opener(self.path)
+        op = openertype(self.path)
         op.createmode = self.createmode
         self.opener = scmutil.filteropener(op, encodefilename)
 
@@ -366,11 +366,11 @@
         return iter(self.entries)
 
 class fncachestore(basicstore):
-    def __init__(self, path, opener, encode):
+    def __init__(self, path, openertype, encode):
         self.encode = encode
         self.path = path + '/store'
         self.createmode = _calcmode(self.path)
-        op = opener(self.path)
+        op = openertype(self.path)
         op.createmode = self.createmode
         fnc = fncache(op)
         self.fncache = fnc
@@ -411,11 +411,11 @@
     def write(self):
         self.fncache.write()
 
-def store(requirements, path, opener):
+def store(requirements, path, openertype):
     if 'store' in requirements:
         if 'fncache' in requirements:
             auxencode = lambda f: _auxencode(f, 'dotencode' in requirements)
             encode = lambda f: _hybridencode(f, auxencode)
-            return fncachestore(path, opener, encode)
-        return encodedstore(path, opener)
-    return basicstore(path, opener)
+            return fncachestore(path, openertype, encode)
+        return encodedstore(path, openertype)
+    return basicstore(path, openertype)