comparison mercurial/revlog.py @ 8658:782a85ee686f

revlog: make triple-quoted string a real comment
author Martin Geisler <mg@lazybytes.net>
date Sun, 31 May 2009 00:58:20 +0200
parents ef393d6ec030
children 0001e49f1c11
comparison
equal deleted inserted replaced
8657:3fa92c618624 8658:782a85ee686f
533 return l 533 return l
534 534
535 t = self.revision(self.node(rev)) 535 t = self.revision(self.node(rev))
536 return len(t) 536 return len(t)
537 537
538 # alternate implementation, The advantage to this code is it 538 # Alternate implementation. The advantage to this code is it
539 # will be faster for a single revision. But, the results are not 539 # will be faster for a single revision. However, the results
540 # cached, so finding the size of every revision will be slower. 540 # are not cached, so finding the size of every revision will
541 """ 541 # be slower.
542 if self.cache and self.cache[1] == rev: 542 #
543 return len(self.cache[2]) 543 # if self.cache and self.cache[1] == rev:
544 544 # return len(self.cache[2])
545 base = self.base(rev) 545 #
546 if self.cache and self.cache[1] >= base and self.cache[1] < rev: 546 # base = self.base(rev)
547 base = self.cache[1] 547 # if self.cache and self.cache[1] >= base and self.cache[1] < rev:
548 text = self.cache[2] 548 # base = self.cache[1]
549 else: 549 # text = self.cache[2]
550 text = self.revision(self.node(base)) 550 # else:
551 551 # text = self.revision(self.node(base))
552 l = len(text) 552 #
553 for x in xrange(base + 1, rev + 1): 553 # l = len(text)
554 l = mdiff.patchedsize(l, self._chunk(x)) 554 # for x in xrange(base + 1, rev + 1):
555 return l 555 # l = mdiff.patchedsize(l, self._chunk(x))
556 """ 556 # return l
557 557
558 def reachable(self, node, stop=None): 558 def reachable(self, node, stop=None):
559 """return the set of all nodes ancestral to a given node, including 559 """return the set of all nodes ancestral to a given node, including
560 the node itself, stopping when stop is matched""" 560 the node itself, stopping when stop is matched"""
561 reachable = set((node,)) 561 reachable = set((node,))