changeset 31801:d22f29abeb42

revlog: use raw revision for rawsize When writing the revlog-ng index, the third field is len(rawtext). See revlog._addrevision: textlen = len(rawtext) .... e = (offset_type(offset, flags), l, textlen, base, link, p1r, p2r, node) self.index.insert(-1, e) Therefore, revlog.index[rev][2] returned by revlog.rawsize should be len(rawtext), where "rawtext" is revlog.revision(raw=True). Unfortunately it's hard to add a test for this code path because "if l >= 0" catches most cases.
author Jun Wu <quark@fb.com>
date Sun, 02 Apr 2017 18:57:03 -0700
parents c63cb2d10d6d
children ac9a5e89113a
files mercurial/revlog.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Sat May 14 20:51:57 2016 +0900
+++ b/mercurial/revlog.py	Sun Apr 02 18:57:03 2017 -0700
@@ -444,7 +444,7 @@
         if l >= 0:
             return l
 
-        t = self.revision(rev)
+        t = self.revision(rev, raw=True)
         return len(t)
     size = rawsize