# HG changeset patch # User Yuya Nishihara # Date 2018-05-26 02:31:51 # Node ID df5f6881cebd6274a64357796cb33d9a18db9db8 # Parent fbe23906406452504b6b29f8439b5929747cc992 unionrepo: fill in uncompressed length of revlog entry 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