From patchwork Mon Aug 6 06:56:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D4074: changegroup: inline ellipsisdata() From: phabricator X-Patchwork-Id: 33294 Message-Id: <96abf4de7c63137bab55f9b1cafb315b@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Mon, 6 Aug 2018 06:56:48 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHGeb022ce9e505: changegroup: inline ellipsisdata() (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4074?vs=9836&id=9950 REVISION DETAIL https://phab.mercurial-scm.org/D4074 AFFECTED FILES mercurial/changegroup.py CHANGE DETAILS To: indygreg, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -494,20 +494,6 @@ return d return readexactly(self._fh, n) -def ellipsisdata(packer, rev, revlog_, p1, p2, data, linknode): - n = revlog_.node(rev) - p1n, p2n = revlog_.node(p1), revlog_.node(p2) - flags = revlog_.flags(rev) - flags |= revlog.REVIDX_ELLIPSIS - meta = packer.builddeltaheader( - n, p1n, p2n, nullid, linknode, flags) - # TODO: try and actually send deltas for ellipsis data blocks - diffheader = mdiff.trivialdiffheader(len(data)) - l = len(meta) + len(diffheader) + len(data) - return ''.join((chunkheader(l), - meta, - diffheader, - data)) class cg1packer(object): deltaheader = _CHANGEGROUPV1_DELTA_HEADER @@ -1052,10 +1038,21 @@ p2 = nullrev else: p1, p2 = sorted(local(p) for p in linkparents) + n = store.node(rev) - - yield ellipsisdata( - self, rev, store, p1, p2, store.revision(n), linknode) + p1n, p2n = store.node(p1), store.node(p2) + flags = store.flags(rev) + flags |= revlog.REVIDX_ELLIPSIS + meta = self.builddeltaheader( + n, p1n, p2n, nullid, linknode, flags) + # TODO: try and actually send deltas for ellipsis data blocks + data = store.revision(n) + diffheader = mdiff.trivialdiffheader(len(data)) + l = len(meta) + len(diffheader) + len(data) + yield ''.join((chunkheader(l), + meta, + diffheader, + data)) def builddeltaheader(self, node, p1n, p2n, basenode, linknode, flags): # do nothing with basenode, it is implicitly the previous one in HG10