obsstore: initialize _all markers without using _addmarkers()
authorYuya Nishihara <yuya@tcha.org>
Sun, 13 Sep 2015 17:47:18 +0900
changeset 26308 f2788794183a
parent 26307 428a8747f4ee
child 26309 44918682093f
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.
mercurial/obsolete.py
--- 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)