comparison mercurial/changelog.py @ 41202:e7a2cc84dbc0

revlog: always enable generaldelta on version 2 revlogs This commit starts the process of diverging version 2 revlogs from version 1 revlogs. generaldelta is a useful feature and has been enabled by default for ages. I can't think of a good reason why the feature should be disabled. Yes, it is true changelogs today don't have generaldelta enabled. But that's because they don't have delta chains enabled, so generaldelta makes no sense there. This commit makes generaldelta always enabled on version 2 revlogs. As part of this, one-off code in changelog.py mucking with revlog.version had to be made conditional on the revlog version, as we don't want to change revlog feature flags on version 2 revlogs. The fact this code exists is horrible and stems from revlog options being shared by the opener. We probably want a better API here. But that can wait for another patch. Differential Revision: https://phab.mercurial-scm.org/D5561
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 09 Jan 2019 17:41:36 -0800
parents a3095bc47217
children 1421d0487a61
comparison
equal deleted inserted replaced
41201:6439cefaeb64 41202:e7a2cc84dbc0
293 293
294 datafile = '00changelog.d' 294 datafile = '00changelog.d'
295 revlog.revlog.__init__(self, opener, indexfile, datafile=datafile, 295 revlog.revlog.__init__(self, opener, indexfile, datafile=datafile,
296 checkambig=True, mmaplargeindex=True) 296 checkambig=True, mmaplargeindex=True)
297 297
298 if self._initempty: 298 if self._initempty and (self.version & 0xFFFF == revlog.REVLOGV1):
299 # changelogs don't benefit from generaldelta 299 # changelogs don't benefit from generaldelta.
300
300 self.version &= ~revlog.FLAG_GENERALDELTA 301 self.version &= ~revlog.FLAG_GENERALDELTA
301 self._generaldelta = False 302 self._generaldelta = False
302 303
303 # Delta chains for changelogs tend to be very small because entries 304 # Delta chains for changelogs tend to be very small because entries
304 # tend to be small and don't delta well with each. So disable delta 305 # tend to be small and don't delta well with each. So disable delta