[PATCH 1 of 2] unionrepo: fill in uncompressed length of revlog entry

Gregory Szorc gregory.szorc at gmail.com
Thu May 31 01:19:39 UTC 2018


On Fri, May 25, 2018 at 7:49 PM, Yuya Nishihara <yuya at tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1527301911 -32400
> #      Sat May 26 11:31:51 2018 +0900
> # Node ID 31143eaaf90624060f7bd894421daafa5226605c
> # Parent  2ce1e9bdc7157948fa799888009cc4c20c113d8c
> unionrepo: fill in uncompressed length of revlog entry
>

Queued, thanks.


>
> It can be either -1 or a valid length, but shouldn't be None. IIUC, we can
> simply trust the length retrieved from the revlog to be overlaid. I don't
> bother thinking whether the compressed length can be copied as well. We'll
> need to fix it later.
>
> diff --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py
> --- a/mercurial/unionrepo.py
> +++ b/mercurial/unionrepo.py
> @@ -49,7 +49,7 @@ class unionrevlog(revlog.revlog):
>          for rev2 in self.revlog2:
>              rev = self.revlog2.index[rev2]
>              # rev numbers - in revlog2, very different from self.rev
> -            _start, _csize, _rsize, base, linkrev, p1rev, p2rev, node =
> rev
> +            _start, _csize, rsize, base, linkrev, p1rev, p2rev, node = rev
>              flags = _start & 0xFFFF
>
>              if linkmapper is None: # link is to same revlog
> @@ -69,7 +69,9 @@ class unionrevlog(revlog.revlog):
>              p1node = self.revlog2.node(p1rev)
>              p2node = self.revlog2.node(p2rev)
>
> -            e = (flags, None, None, base,
> +            # TODO: it's probably wrong to set compressed length to None,
> but
> +            # I have no idea if csize is valid in the base revlog context.
> +            e = (flags, None, rsize, base,
>                   link, self.rev(p1node), self.rev(p2node), node)
>              self.index.insert(-1, e)
>              self.nodemap[node] = n
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20180530/77f955ee/attachment-0002.html>


More information about the Mercurial-devel mailing list