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

Adrian Buehlmann adrian at cadifra.com
Sun Oct 7 05:54:56 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1349606367 -7200
# Node ID 1d41dc8683e094a5e7440a075fdcdc56186586a1
# Parent  bbd25acee39bf6584caf7b721bc8d833ed9c578b
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