diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -400,7 +400,13 @@ class localrepository(object): @storecache('obsstore') def obsstore(self): - store = obsolete.obsstore(self.sopener) + # read default format for new obsstore. + defaultformat = self.ui.configint('format', 'obsstore-version', None) + # rely on obsstore class default when possible. + kwargs = {} + if defaultformat is not None: + defaultformat['defaultformat'] = defaultformat + store = obsolete.obsstore(self.sopener, **kwargs) if store and not obsolete._enabled: # message is rare enough to not be translated msg = 'obsolete feature not enabled but %i markers found!\n' diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -450,7 +450,7 @@ class obsstore(object): # parents: (tuple of nodeid) or None, parents of precursors # None is used when no data has been recorded - def __init__(self, sopener): + def __init__(self, sopener, defaultformat=_fm0version): # caches for various obsolescence related cache self.caches = {} self._all = [] @@ -459,7 +459,7 @@ class obsstore(object): self.children = {} self.sopener = sopener data = sopener.tryread('obsstore') - self._version = _fm0version + self._version = defaultformat if data: self._version, markers = _readmarkers(data) self._load(markers)