# HG changeset patch # User Yuya Nishihara # Date 1442134357 -32400 # Node ID 44918682093fa10692b114a3a98e778d33e7f381 # Parent f2788794183aee9abbadb9da4c689700772c6670 obsstore: delay loading markers from obsstore file This will allow us to use cached revisions without parsing obsstore. Because _version isn't determined at __init__, the debugobsconvert command no longer works correctly. I'll fix it by a separate patch for the evolve extension. diff -r f2788794183a -r 44918682093f mercurial/obsolete.py --- a/mercurial/obsolete.py Sun Sep 13 17:47:18 2015 +0900 +++ b/mercurial/obsolete.py Sun Sep 13 17:52:37 2015 +0900 @@ -520,16 +520,9 @@ def __init__(self, svfs, defaultformat=_fm1version, readonly=False): # caches for various obsolescence related cache self.caches = {} - self._all = [] self.svfs = svfs - data = svfs.tryread('obsstore') self._version = defaultformat self._readonly = readonly - if data: - self._version, markers = _readmarkers(data) - markers = list(markers) - _checkinvalidmarkers(markers) - self._all = markers def __iter__(self): return iter(self._all) @@ -617,6 +610,16 @@ return self.add(transaction, markers) @propertycache + def _all(self): + data = self.svfs.tryread('obsstore') + if not data: + return [] + self._version, markers = _readmarkers(data) + markers = list(markers) + _checkinvalidmarkers(markers) + return markers + + @propertycache def successors(self): successors = {} _addsuccessors(successors, self._all)