# HG changeset patch # User Jun Wu # Date 2017-03-29 21:49:14 # Node ID dff03f68ef11b7f30b8aac32e9adcc36ac64c370 # Parent b044c339c06db134382e45284d19ed9a32b9fd1b verify: fix length check According to the document added above, we should check L1 == L2, and the only way to get L1 in all cases is to call "rawsize()", and the only way to get L2 is to call "revision(raw=True)". Therefore the fix. Meanwhile there are still a lot of things about flagprocessor broken in revlog.py. Tests will be added after revlog.py gets fixed. diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -430,7 +430,8 @@ class verifier(object): l = len(fl.read(n)) rp = fl.renamed(n) if l != fl.size(i): - if len(fl.revision(n)) != fl.size(i): + # the "L1 == L2" check + if len(fl.revision(n, raw=True)) != fl.rawsize(i): self.err(lr, _("unpacked size is %s, %s expected") % (l, fl.size(i)), f) except error.CensoredNodeError: