##// END OF EJS Templates
treemanifest: add configuration for using treemanifest type...
Martin von Zweigbergk -
r24402:c2287f20 default
parent child Browse files
Show More
@@ -331,6 +331,9 class localrepository(object):
331 331 manifestcachesize = self.ui.configint('format', 'manifestcachesize')
332 332 if manifestcachesize is not None:
333 333 self.svfs.options['manifestcachesize'] = manifestcachesize
334 usetreemanifest = self.ui.configbool('experimental', 'treemanifest')
335 if usetreemanifest is not None:
336 self.svfs.options['usetreemanifest'] = usetreemanifest
334 337
335 338 def _writerequirements(self):
336 339 reqfile = self.vfs("requires", "w")
@@ -556,16 +556,24 class manifest(revlog.revlog):
556 556 # revs at a time (such as during commit --amend). When rebasing large
557 557 # stacks of commits, the number can go up, hence the config knob below.
558 558 cachesize = 4
559 usetreemanifest = False
559 560 opts = getattr(opener, 'options', None)
560 561 if opts is not None:
561 562 cachesize = opts.get('manifestcachesize', cachesize)
563 usetreemanifest = opts.get('usetreemanifest', usetreemanifest)
562 564 self._mancache = util.lrucachedict(cachesize)
563 565 revlog.revlog.__init__(self, opener, "00manifest.i")
566 self._usetreemanifest = usetreemanifest
567
568 def _newmanifest(self, data=''):
569 if self._usetreemanifest:
570 return treemanifest(data)
571 return manifestdict(data)
564 572
565 573 def readdelta(self, node):
566 574 r = self.rev(node)
567 575 d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r))
568 return manifestdict(d)
576 return self._newmanifest(d)
569 577
570 578 def readfast(self, node):
571 579 '''use the faster of readdelta or read'''
@@ -577,12 +585,12 class manifest(revlog.revlog):
577 585
578 586 def read(self, node):
579 587 if node == revlog.nullid:
580 return manifestdict() # don't upset local cache
588 return self._newmanifest() # don't upset local cache
581 589 if node in self._mancache:
582 590 return self._mancache[node][0]
583 591 text = self.revision(node)
584 592 arraytext = array.array('c', text)
585 m = manifestdict(text)
593 m = self._newmanifest(text)
586 594 self._mancache[node] = (m, arraytext)
587 595 return m
588 596
@@ -596,7 +604,7 class manifest(revlog.revlog):
596 604 return None, None
597 605
598 606 def add(self, m, transaction, link, p1, p2, added, removed):
599 if p1 in self._mancache:
607 if p1 in self._mancache and not self._usetreemanifest:
600 608 # If our first parent is in the manifest cache, we can
601 609 # compute a delta here using properties we know about the
602 610 # manifest up-front, which may save time later for the
General Comments 0
You need to be logged in to leave comments. Login now