[PATCH 4 of 7 F2 series] store: add a version parameter to fncachestore constructor

Adrian Buehlmann adrian at cadifra.com
Sat Oct 6 17:25:01 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1349032928 -7200
# Node ID 827593a8a12bda9a35524bacf052b81d0e794652
# Parent  ba4af872cb26b25ce9bbf2549eb7926ec8083066
store: add a version parameter to fncachestore constructor

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -486,8 +486,8 @@
         return self.opener(self.encode(path), mode, *args, **kw)
 
 class fncachestore(basicstore):
-    def __init__(self, path, vfstype, dotencode):
-        if dotencode:
+    def __init__(self, path, vfstype, version):
+        if version == 1:
             encode = _dothybridencode
         else:
             encode = _plainhybridencode
@@ -538,6 +538,10 @@
 def store(requirements, path, vfstype):
     if 'store' in requirements:
         if 'fncache' in requirements:
-            return fncachestore(path, vfstype, 'dotencode' in requirements)
+            if 'dotencode' in requirements:
+                version = 1
+            else:
+                version = 0
+            return fncachestore(path, vfstype, version)
         return encodedstore(path, vfstype)
     return basicstore(path, vfstype)


More information about the Mercurial-devel mailing list