Mercurial > hg-stable
changeset 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 | 3fa92c618624 |
children | 1a6d702e059d |
files | mercurial/revlog.py |
diffstat | 1 files changed, 19 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py Sat May 30 23:42:35 2009 +0200 +++ b/mercurial/revlog.py Sun May 31 00:58:20 2009 +0200 @@ -535,25 +535,25 @@ t = self.revision(self.node(rev)) return len(t) - # alternate implementation, The advantage to this code is it - # will be faster for a single revision. But, the results are not - # cached, so finding the size of every revision will be slower. - """ - if self.cache and self.cache[1] == rev: - return len(self.cache[2]) - - base = self.base(rev) - if self.cache and self.cache[1] >= base and self.cache[1] < rev: - base = self.cache[1] - text = self.cache[2] - else: - text = self.revision(self.node(base)) - - l = len(text) - for x in xrange(base + 1, rev + 1): - l = mdiff.patchedsize(l, self._chunk(x)) - return l - """ + # Alternate implementation. The advantage to this code is it + # will be faster for a single revision. However, the results + # are not cached, so finding the size of every revision will + # be slower. + # + # if self.cache and self.cache[1] == rev: + # return len(self.cache[2]) + # + # base = self.base(rev) + # if self.cache and self.cache[1] >= base and self.cache[1] < rev: + # base = self.cache[1] + # text = self.cache[2] + # else: + # text = self.revision(self.node(base)) + # + # l = len(text) + # for x in xrange(base + 1, rev + 1): + # l = mdiff.patchedsize(l, self._chunk(x)) + # return l def reachable(self, node, stop=None): """return the set of all nodes ancestral to a given node, including