Patchwork D4074: changegroup: inline ellipsisdata()

login
register
mail settings
Submitter phabricator
Date Aug. 6, 2018, 6:56 a.m.
Message ID <96abf4de7c63137bab55f9b1cafb315b@localhost.localdomain>
Download mbox | patch
Permalink /patch/33294/
State Not Applicable
Headers show

Comments

phabricator - Aug. 6, 2018, 6:56 a.m.
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

Patch

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