From patchwork Sun Jun 4 23:59:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [06,of,22] obsstore: separate marker parsing from obsstore reading From: Jun Wu X-Patchwork-Id: 21183 Message-Id: <17ce57b7873f61deefe4.1496620758@x1c> To: Date: Sun, 4 Jun 2017 16:59:18 -0700 # HG changeset patch # User Jun Wu # 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 []