[PATCH 06 of 22] obsstore: separate marker parsing from obsstore reading

Jun Wu quark at fb.com
Sun Jun 4 23:59:18 UTC 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1496461081 25200
#      Fri Jun 02 20:38:01 2017 -0700
# Node ID 17ce57b7873f61deefe4ee34c4b7b9e6a54d489e
# Parent  d9ed7d0a4373b12c92055dd10718cffe96c98224
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 17ce57b7873f
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.

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -667,6 +667,10 @@ class obsstore(object):
 
     @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 []



More information about the Mercurial-devel mailing list