Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 22852:e994b034e91e
obsolete: add a "format.obsstore-version" config option
This option controls what version of the binary format to use when creating a new
obsstore file.
Default is still the old format. No safeguards are currently placed around the
option value, but no clueless users are in danger of harm since it is
undocumented.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 16 Sep 2014 17:52:40 -0700 |
parents | 4a13849ca359 |
children | a337f4b9b99d |
comparison
equal
deleted
inserted
replaced
22851:974389427e5f | 22852:e994b034e91e |
---|---|
398 def _phasecache(self): | 398 def _phasecache(self): |
399 return phases.phasecache(self, self._phasedefaults) | 399 return phases.phasecache(self, self._phasedefaults) |
400 | 400 |
401 @storecache('obsstore') | 401 @storecache('obsstore') |
402 def obsstore(self): | 402 def obsstore(self): |
403 store = obsolete.obsstore(self.sopener) | 403 # read default format for new obsstore. |
404 defaultformat = self.ui.configint('format', 'obsstore-version', None) | |
405 # rely on obsstore class default when possible. | |
406 kwargs = {} | |
407 if defaultformat is not None: | |
408 defaultformat['defaultformat'] = defaultformat | |
409 store = obsolete.obsstore(self.sopener, **kwargs) | |
404 if store and not obsolete._enabled: | 410 if store and not obsolete._enabled: |
405 # message is rare enough to not be translated | 411 # message is rare enough to not be translated |
406 msg = 'obsolete feature not enabled but %i markers found!\n' | 412 msg = 'obsolete feature not enabled but %i markers found!\n' |
407 self.ui.warn(msg % len(list(store))) | 413 self.ui.warn(msg % len(list(store))) |
408 return store | 414 return store |