comparison mercurial/revlog.py @ 30154:5e72129d75ed

revlog: add instance variable controlling delta chain use This is to support disabling delta chains on the changelog in a subsequent patch.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 24 Sep 2016 12:25:37 -0700
parents 60a66c79125f
children 5e4f16874a9f
comparison
equal deleted inserted replaced
30153:edb49a90723c 30154:5e72129d75ed
294 raise RevlogError(_("index %s unknown flags %#04x for revlogng") 294 raise RevlogError(_("index %s unknown flags %#04x for revlogng")
295 % (self.indexfile, flags >> 16)) 295 % (self.indexfile, flags >> 16))
296 elif fmt > REVLOGNG: 296 elif fmt > REVLOGNG:
297 raise RevlogError(_("index %s unknown format %d") 297 raise RevlogError(_("index %s unknown format %d")
298 % (self.indexfile, fmt)) 298 % (self.indexfile, fmt))
299
300 self._storedeltachains = True
299 301
300 self._io = revlogio() 302 self._io = revlogio()
301 if self.version == REVLOGV0: 303 if self.version == REVLOGV0:
302 self._io = revlogoldio() 304 self._io = revlogoldio()
303 try: 305 try:
1467 cachedelta[1]) 1469 cachedelta[1])
1468 else: 1470 else:
1469 textlen = len(text) 1471 textlen = len(text)
1470 1472
1471 # should we try to build a delta? 1473 # should we try to build a delta?
1472 if prev != nullrev: 1474 if prev != nullrev and self._storedeltachains:
1473 tested = set() 1475 tested = set()
1474 # This condition is true most of the time when processing 1476 # This condition is true most of the time when processing
1475 # changegroup data into a generaldelta repo. The only time it 1477 # changegroup data into a generaldelta repo. The only time it
1476 # isn't true is if this is the first revision in a delta chain 1478 # isn't true is if this is the first revision in a delta chain
1477 # or if ``format.generaldelta=true`` disabled ``lazydeltabase``. 1479 # or if ``format.generaldelta=true`` disabled ``lazydeltabase``.