obsstore: separate marker parsing from obsstore reading
authorJun Wu <quark@fb.com>
Fri, 02 Jun 2017 20:38:01 -0700
changeset 32710 3fad59faba8a
parent 32709 9933410bf763
child 32711 5d8dd6c90af9
obsstore: separate marker parsing from obsstore reading This allows us to get raw obsstore content without parsing any markers. Reading obsstore is much cheaper than parsing markers.
mercurial/obsolete.py
--- a/mercurial/obsolete.py	Fri Jun 02 19:34:56 2017 -0700
+++ b/mercurial/obsolete.py	Fri Jun 02 20:38:01 2017 -0700
@@ -666,8 +666,12 @@
         return self.add(transaction, markers)
 
     @propertycache
+    def _data(self):
+        return self.svfs.tryread('obsstore')
+
+    @propertycache
     def _all(self):
-        data = self.svfs.tryread('obsstore')
+        data = self._data
         if not data:
             return []
         self._version, markers = _readmarkers(data)