Show More
@@ -521,6 +521,7 b' class revisiondelta(object):' | |||
|
521 | 521 | |
|
522 | 522 | class cg1packer(object): |
|
523 | 523 | def __init__(self, repo, filematcher, version, builddeltaheader, |
|
524 | manifestsend, | |
|
524 | 525 | bundlecaps=None): |
|
525 | 526 | """Given a source repo, construct a bundler. |
|
526 | 527 | |
@@ -530,6 +531,8 b' class cg1packer(object):' | |||
|
530 | 531 | builddeltaheader is a callable that constructs the header for a group |
|
531 | 532 | delta. |
|
532 | 533 | |
|
534 | manifestsend is a chunk to send after manifests have been fully emitted. | |
|
535 | ||
|
533 | 536 | bundlecaps is optional and can be used to specify the set of |
|
534 | 537 | capabilities which can be used to build the bundle. While bundlecaps is |
|
535 | 538 | unused in core Mercurial, extensions rely on this feature to communicate |
@@ -540,6 +543,7 b' class cg1packer(object):' | |||
|
540 | 543 | |
|
541 | 544 | self.version = version |
|
542 | 545 | self._builddeltaheader = builddeltaheader |
|
546 | self._manifestsend = manifestsend | |
|
543 | 547 | |
|
544 | 548 | # Set of capabilities we can use to build the bundle. |
|
545 | 549 | if bundlecaps is None: |
@@ -661,9 +665,6 b' class cg1packer(object):' | |||
|
661 | 665 | lookuplinknode, units=_('manifests')): |
|
662 | 666 | yield chunk |
|
663 | 667 | |
|
664 | def _manifestsdone(self): | |
|
665 | return '' | |
|
666 | ||
|
667 | 668 | def generate(self, commonrevs, clnodes, fastpathlinkrev, source): |
|
668 | 669 | '''yield a sequence of changegroup chunks (strings)''' |
|
669 | 670 | repo = self._repo |
@@ -854,7 +855,7 b' class cg1packer(object):' | |||
|
854 | 855 | size += len(x) |
|
855 | 856 | yield x |
|
856 | 857 | self._verbosenote(_('%8.i (manifests)\n') % size) |
|
857 |
yield self._manifests |
|
|
858 | yield self._manifestsend | |
|
858 | 859 | |
|
859 | 860 | # The 'source' parameter is useful for extensions |
|
860 | 861 | def generatefiles(self, changedfiles, linknodes, commonrevs, source): |
@@ -1099,9 +1100,9 b' class cg1packer(object):' | |||
|
1099 | 1100 | |
|
1100 | 1101 | class cg2packer(cg1packer): |
|
1101 | 1102 | def __init__(self, repo, filematcher, version, builddeltaheader, |
|
1102 | bundlecaps=None): | |
|
1103 | manifestsend, bundlecaps=None): | |
|
1103 | 1104 | super(cg2packer, self).__init__(repo, filematcher, version, |
|
1104 | builddeltaheader, | |
|
1105 | builddeltaheader, manifestsend, | |
|
1105 | 1106 | bundlecaps=bundlecaps) |
|
1106 | 1107 | |
|
1107 | 1108 | if self._reorder is None: |
@@ -1159,14 +1160,12 b' class cg3packer(cg2packer):' | |||
|
1159 | 1160 | units=_('manifests')): |
|
1160 | 1161 | yield chunk |
|
1161 | 1162 | |
|
1162 | def _manifestsdone(self): | |
|
1163 | return self.close() | |
|
1164 | ||
|
1165 | 1163 | def _makecg1packer(repo, filematcher, bundlecaps): |
|
1166 | 1164 | builddeltaheader = lambda d: _CHANGEGROUPV1_DELTA_HEADER.pack( |
|
1167 | 1165 | d.node, d.p1node, d.p2node, d.linknode) |
|
1168 | 1166 | |
|
1169 | 1167 | return cg1packer(repo, filematcher, b'01', builddeltaheader, |
|
1168 | manifestsend=b'', | |
|
1170 | 1169 | bundlecaps=bundlecaps) |
|
1171 | 1170 | |
|
1172 | 1171 | def _makecg2packer(repo, filematcher, bundlecaps): |
@@ -1174,6 +1173,7 b' def _makecg2packer(repo, filematcher, bu' | |||
|
1174 | 1173 | d.node, d.p1node, d.p2node, d.basenode, d.linknode) |
|
1175 | 1174 | |
|
1176 | 1175 | return cg2packer(repo, filematcher, b'02', builddeltaheader, |
|
1176 | manifestsend=b'', | |
|
1177 | 1177 | bundlecaps=bundlecaps) |
|
1178 | 1178 | |
|
1179 | 1179 | def _makecg3packer(repo, filematcher, bundlecaps): |
@@ -1181,6 +1181,7 b' def _makecg3packer(repo, filematcher, bu' | |||
|
1181 | 1181 | d.node, d.p1node, d.p2node, d.basenode, d.linknode, d.flags) |
|
1182 | 1182 | |
|
1183 | 1183 | return cg3packer(repo, filematcher, b'03', builddeltaheader, |
|
1184 | manifestsend=closechunk(), | |
|
1184 | 1185 | bundlecaps=bundlecaps) |
|
1185 | 1186 | |
|
1186 | 1187 | _packermap = {'01': (_makecg1packer, cg1unpacker), |
General Comments 0
You need to be logged in to leave comments.
Login now