Beispiel #1
0
 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, node.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((changegroup.chunkheader(l), meta, diffheader, data))
 def nodechunk(self, revlog, node, prev, linknode):
     prefix = ''
     if prev == nullrev:
         delta = revlog.revision(node)
         prefix = mdiff.trivialdiffheader(len(delta))
     else:
         delta = revlog.revdiff(prev, node)
     p1, p2 = revlog.parents(node)
     meta = self.builddeltaheader(node, p1, p2, prev, linknode)
     meta += prefix
     l = len(meta) + len(delta)
     yield changegroup.chunkheader(l)
     yield meta
     yield delta
Beispiel #3
0
 def nodechunk(self, revlog, node, prev, linknode):
     prefix = ''
     if prev == nullrev:
         delta = revlog.revision(node)
         prefix = mdiff.trivialdiffheader(len(delta))
     else:
         delta = revlog.revdiff(prev, node)
     p1, p2 = revlog.parents(node)
     meta = self.builddeltaheader(node, p1, p2, prev, linknode)
     meta += prefix
     l = len(meta) + len(delta)
     yield changegroup.chunkheader(l)
     yield meta
     yield delta
Beispiel #4
0
 def nodechunk(self, revlog, node, prevnode, linknode):
     prefix = ''
     if prevnode == nullid:
         delta = revlog.revision(node, raw=True)
         prefix = mdiff.trivialdiffheader(len(delta))
     else:
         # Actually uses remotefilelog.revdiff which works on nodes, not revs
         delta = revlog.revdiff(prevnode, node)
     p1, p2 = revlog.parents(node)
     flags = revlog.flags(node)
     meta = self.builddeltaheader(node, p1, p2, prevnode, linknode, flags)
     meta += prefix
     l = len(meta) + len(delta)
     yield changegroup.chunkheader(l)
     yield meta
     yield delta
 def nodechunk(self, revlog, node, prevnode, linknode):
     prefix = ''
     if prevnode == nullid:
         delta = revlog.revision(node, raw=True)
         prefix = mdiff.trivialdiffheader(len(delta))
     else:
         # Actually uses remotefilelog.revdiff which works on nodes, not revs
         delta = revlog.revdiff(prevnode, node)
     p1, p2 = revlog.parents(node)
     flags = revlog.flags(node)
     meta = self.builddeltaheader(node, p1, p2, prevnode, linknode, flags)
     meta += prefix
     l = len(meta) + len(delta)
     yield changegroup.chunkheader(l)
     yield meta
     yield delta
Beispiel #6
0
def chunkify(buffer):
    return chunkheader(len(buffer)) + buffer