[PATCH 2 of 2 V2] verify: fix length check

Yuya Nishihara yuya at tcha.org
Sun Apr 2 03:33:38 EDT 2017


On Thu, 30 Mar 2017 14:51:15 -0700, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1490824154 25200
> #      Wed Mar 29 14:49:14 2017 -0700
> # Node ID 35902a0e3f38c766666a66d0dfbf76ec72091832
> # Parent  17b41390f4912a4c18538d778837bc2cf4a1be92
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r 35902a0e3f38
> verify: fix length check

Looks good. I'll queue it.

> diff --git a/mercurial/verify.py b/mercurial/verify.py
> --- a/mercurial/verify.py
> +++ b/mercurial/verify.py
> @@ -431,5 +431,6 @@ class verifier(object):
>                      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)

Perhaps we can get rid of 'l != fl.size(i)', which just checks API-level
inconsistency. This was introduced at e79a8f36c2a5, which said "check
unpacked size field." And IIUC, rawsize() is the unpacked size field.


More information about the Mercurial-devel mailing list