comparison mercurial/revlog.py @ 10404:3e7cbe859871

revlog.size: remove alternate implementation (revlogv0 specific) it's only useful for revlogv0 anyway, revlogNG has the uncompressed size in the index.
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 09 Feb 2010 14:02:07 +0100
parents ea52a2d4f42c
children adb6a291bbdb f2ecc5733c89
comparison
equal deleted inserted replaced
10403:b8acd325773e 10404:3e7cbe859871
534 if l >= 0: 534 if l >= 0:
535 return l 535 return l
536 536
537 t = self.revision(self.node(rev)) 537 t = self.revision(self.node(rev))
538 return len(t) 538 return len(t)
539
540 # Alternate implementation. The advantage to this code is it
541 # will be faster for a single revision. However, the results
542 # are not cached, so finding the size of every revision will
543 # be slower.
544 #
545 # if self.cache and self.cache[1] == rev:
546 # return len(self.cache[2])
547 #
548 # base = self.base(rev)
549 # if self.cache and self.cache[1] >= base and self.cache[1] < rev:
550 # base = self.cache[1]
551 # text = self.cache[2]
552 # else:
553 # text = self.revision(self.node(base))
554 #
555 # l = len(text)
556 # for x in xrange(base + 1, rev + 1):
557 # l = mdiff.patchedsize(l, self._chunk(x))
558 # return l
559 539
560 def reachable(self, node, stop=None): 540 def reachable(self, node, stop=None):
561 """return the set of all nodes ancestral to a given node, including 541 """return the set of all nodes ancestral to a given node, including
562 the node itself, stopping when stop is matched""" 542 the node itself, stopping when stop is matched"""
563 reachable = set((node,)) 543 reachable = set((node,))