changeset 26308:f2788794183a

obsstore: initialize _all markers without using _addmarkers() The next patch will make _all variable propertycached to avoid costly parsing of obsstore. This means we can't call _addmarkers() to initialize _all. Because all cached markers depend on _all, it isn't necessary to update these caches when _all is initially loaded.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 13 Sep 2015 17:47:18 +0900
parents 428a8747f4ee
children 44918682093f
files mercurial/obsolete.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsolete.py	Wed Sep 23 00:41:07 2015 -0700
+++ b/mercurial/obsolete.py	Sun Sep 13 17:47:18 2015 +0900
@@ -527,7 +527,9 @@
         self._readonly = readonly
         if data:
             self._version, markers = _readmarkers(data)
-            self._addmarkers(markers)
+            markers = list(markers)
+            _checkinvalidmarkers(markers)
+            self._all = markers
 
     def __iter__(self):
         return iter(self._all)