##// 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 b' class localrepository(object):'
331 manifestcachesize = self.ui.configint('format', 'manifestcachesize')
331 manifestcachesize = self.ui.configint('format', 'manifestcachesize')
332 if manifestcachesize is not None:
332 if manifestcachesize is not None:
333 self.svfs.options['manifestcachesize'] = manifestcachesize
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 def _writerequirements(self):
338 def _writerequirements(self):
336 reqfile = self.vfs("requires", "w")
339 reqfile = self.vfs("requires", "w")
@@ -556,16 +556,24 b' class manifest(revlog.revlog):'
556 # revs at a time (such as during commit --amend). When rebasing large
556 # revs at a time (such as during commit --amend). When rebasing large
557 # stacks of commits, the number can go up, hence the config knob below.
557 # stacks of commits, the number can go up, hence the config knob below.
558 cachesize = 4
558 cachesize = 4
559 usetreemanifest = False
559 opts = getattr(opener, 'options', None)
560 opts = getattr(opener, 'options', None)
560 if opts is not None:
561 if opts is not None:
561 cachesize = opts.get('manifestcachesize', cachesize)
562 cachesize = opts.get('manifestcachesize', cachesize)
563 usetreemanifest = opts.get('usetreemanifest', usetreemanifest)
562 self._mancache = util.lrucachedict(cachesize)
564 self._mancache = util.lrucachedict(cachesize)
563 revlog.revlog.__init__(self, opener, "00manifest.i")
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 def readdelta(self, node):
573 def readdelta(self, node):
566 r = self.rev(node)
574 r = self.rev(node)
567 d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r))
575 d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r))
568 return manifestdict(d)
576 return self._newmanifest(d)
569
577
570 def readfast(self, node):
578 def readfast(self, node):
571 '''use the faster of readdelta or read'''
579 '''use the faster of readdelta or read'''
@@ -577,12 +585,12 b' class manifest(revlog.revlog):'
577
585
578 def read(self, node):
586 def read(self, node):
579 if node == revlog.nullid:
587 if node == revlog.nullid:
580 return manifestdict() # don't upset local cache
588 return self._newmanifest() # don't upset local cache
581 if node in self._mancache:
589 if node in self._mancache:
582 return self._mancache[node][0]
590 return self._mancache[node][0]
583 text = self.revision(node)
591 text = self.revision(node)
584 arraytext = array.array('c', text)
592 arraytext = array.array('c', text)
585 m = manifestdict(text)
593 m = self._newmanifest(text)
586 self._mancache[node] = (m, arraytext)
594 self._mancache[node] = (m, arraytext)
587 return m
595 return m
588
596
@@ -596,7 +604,7 b' class manifest(revlog.revlog):'
596 return None, None
604 return None, None
597
605
598 def add(self, m, transaction, link, p1, p2, added, removed):
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 # If our first parent is in the manifest cache, we can
608 # If our first parent is in the manifest cache, we can
601 # compute a delta here using properties we know about the
609 # compute a delta here using properties we know about the
602 # manifest up-front, which may save time later for the
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