mercurial 2.1.2 compat
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 21 Mar 2012 11:57:03 +0100
changeset 160 24346b78cd99
parent 159 6ff373346dd4
child 161 4e3f25ba5401
mercurial 2.1.2 compat
hgext/obsolete.py
--- a/hgext/obsolete.py	Tue Mar 20 17:53:51 2012 +0100
+++ b/hgext/obsolete.py	Wed Mar 21 11:57:03 2012 +0100
@@ -98,6 +98,14 @@
 from mercurial.node import hex, bin, short, nullid
 from mercurial.lock import release
 
+try:
+    from mercurial.localrepo import storecache
+    storecache('babar') # to trigger import
+except TypeError:
+    def storecache(*args):
+        return scmutil.filecache(*args, instore=True)
+
+
 ### Patch changectx
 #############################
 
@@ -557,7 +565,7 @@
             finally:
                 release(lock, wlock)
 
-        @scmutil.filecache('00changelog.i', True)
+        @storecache('00changelog.i')
         def changelog(self):
             changelog = getattr(super(obsoletingrepo, self), 'changelog')
             old = changelog.__dict__.pop('hiddenrevs', ())