Show More
@@ -522,7 +522,7 b' class revisiondelta(object):' | |||||
522 | class cgpacker(object): |
|
522 | class cgpacker(object): | |
523 | def __init__(self, repo, filematcher, version, allowreorder, |
|
523 | def __init__(self, repo, filematcher, version, allowreorder, | |
524 | useprevdelta, builddeltaheader, manifestsend, |
|
524 | useprevdelta, builddeltaheader, manifestsend, | |
525 |
|
|
525 | bundlecaps=None, ellipses=False, | |
526 | shallow=False, ellipsisroots=None, fullnodes=None): |
|
526 | shallow=False, ellipsisroots=None, fullnodes=None): | |
527 | """Given a source repo, construct a bundler. |
|
527 | """Given a source repo, construct a bundler. | |
528 |
|
528 | |||
@@ -541,8 +541,6 b' class cgpacker(object):' | |||||
541 |
|
541 | |||
542 | manifestsend is a chunk to send after manifests have been fully emitted. |
|
542 | manifestsend is a chunk to send after manifests have been fully emitted. | |
543 |
|
543 | |||
544 | sendtreemanifests indicates whether tree manifests should be emitted. |
|
|||
545 |
|
||||
546 | ellipses indicates whether ellipsis serving mode is enabled. |
|
544 | ellipses indicates whether ellipsis serving mode is enabled. | |
547 |
|
545 | |||
548 | bundlecaps is optional and can be used to specify the set of |
|
546 | bundlecaps is optional and can be used to specify the set of | |
@@ -564,7 +562,6 b' class cgpacker(object):' | |||||
564 | self._useprevdelta = useprevdelta |
|
562 | self._useprevdelta = useprevdelta | |
565 | self._builddeltaheader = builddeltaheader |
|
563 | self._builddeltaheader = builddeltaheader | |
566 | self._manifestsend = manifestsend |
|
564 | self._manifestsend = manifestsend | |
567 | self._sendtreemanifests = sendtreemanifests |
|
|||
568 | self._ellipses = ellipses |
|
565 | self._ellipses = ellipses | |
569 |
|
566 | |||
570 | # Set of capabilities we can use to build the bundle. |
|
567 | # Set of capabilities we can use to build the bundle. | |
@@ -701,21 +698,14 b' class cgpacker(object):' | |||||
701 | return [n for n in missing if rl(rr(n)) not in commonrevs] |
|
698 | return [n for n in missing if rl(rr(n)) not in commonrevs] | |
702 |
|
699 | |||
703 | def _packmanifests(self, dir, mfnodes, lookuplinknode): |
|
700 | def _packmanifests(self, dir, mfnodes, lookuplinknode): | |
704 |
"""Pack |
|
701 | """Pack manifests into a changegroup stream. | |
705 | assert not dir |
|
|||
706 | for chunk in self.group(mfnodes, self._repo.manifestlog._revlog, |
|
|||
707 | lookuplinknode, units=_('manifests')): |
|
|||
708 | yield chunk |
|
|||
709 |
|
||||
710 | def _packtreemanifests(self, dir, mfnodes, lookuplinknode): |
|
|||
711 | """Version of _packmanifests that operates on directory manifests. |
|
|||
712 |
|
702 | |||
713 | Encodes the directory name in the output so multiple manifests |
|
703 | Encodes the directory name in the output so multiple manifests | |
714 | can be sent. |
|
704 | can be sent. Multiple manifests is not supported by cg1 and cg2. | |
715 | """ |
|
705 | """ | |
716 | assert self.version == b'03' |
|
|||
717 |
|
706 | |||
718 | if dir: |
|
707 | if dir: | |
|
708 | assert self.version == b'03' | |||
719 | yield self._fileheader(dir) |
|
709 | yield self._fileheader(dir) | |
720 |
|
710 | |||
721 | # TODO violates storage abstractions by assuming revlogs. |
|
711 | # TODO violates storage abstractions by assuming revlogs. | |
@@ -902,14 +892,13 b' class cgpacker(object):' | |||||
902 | return clnode |
|
892 | return clnode | |
903 | return lookupmflinknode |
|
893 | return lookupmflinknode | |
904 |
|
894 | |||
905 | fn = (self._packtreemanifests if self._sendtreemanifests |
|
|||
906 | else self._packmanifests) |
|
|||
907 | size = 0 |
|
895 | size = 0 | |
908 | while tmfnodes: |
|
896 | while tmfnodes: | |
909 | dir, nodes = tmfnodes.popitem() |
|
897 | dir, nodes = tmfnodes.popitem() | |
910 | prunednodes = self._prune(dirlog(dir), nodes, commonrevs) |
|
898 | prunednodes = self._prune(dirlog(dir), nodes, commonrevs) | |
911 | if not dir or prunednodes: |
|
899 | if not dir or prunednodes: | |
912 |
for x in fn(dir, prunednodes, |
|
900 | for x in self._packmanifests(dir, prunednodes, | |
|
901 | makelookupmflinknode(dir, nodes)): | |||
913 | size += len(x) |
|
902 | size += len(x) | |
914 | yield x |
|
903 | yield x | |
915 | self._verbosenote(_('%8.i (manifests)\n') % size) |
|
904 | self._verbosenote(_('%8.i (manifests)\n') % size) | |
@@ -1208,7 +1197,6 b' def _makecg1packer(repo, filematcher, bu' | |||||
1208 | allowreorder=None, |
|
1197 | allowreorder=None, | |
1209 | builddeltaheader=builddeltaheader, |
|
1198 | builddeltaheader=builddeltaheader, | |
1210 | manifestsend=b'', |
|
1199 | manifestsend=b'', | |
1211 | sendtreemanifests=False, |
|
|||
1212 | bundlecaps=bundlecaps, |
|
1200 | bundlecaps=bundlecaps, | |
1213 | ellipses=ellipses, |
|
1201 | ellipses=ellipses, | |
1214 | shallow=shallow, |
|
1202 | shallow=shallow, | |
@@ -1228,7 +1216,6 b' def _makecg2packer(repo, filematcher, bu' | |||||
1228 | allowreorder=False, |
|
1216 | allowreorder=False, | |
1229 | builddeltaheader=builddeltaheader, |
|
1217 | builddeltaheader=builddeltaheader, | |
1230 | manifestsend=b'', |
|
1218 | manifestsend=b'', | |
1231 | sendtreemanifests=False, |
|
|||
1232 | bundlecaps=bundlecaps, |
|
1219 | bundlecaps=bundlecaps, | |
1233 | ellipses=ellipses, |
|
1220 | ellipses=ellipses, | |
1234 | shallow=shallow, |
|
1221 | shallow=shallow, | |
@@ -1245,7 +1232,6 b' def _makecg3packer(repo, filematcher, bu' | |||||
1245 | allowreorder=False, |
|
1232 | allowreorder=False, | |
1246 | builddeltaheader=builddeltaheader, |
|
1233 | builddeltaheader=builddeltaheader, | |
1247 | manifestsend=closechunk(), |
|
1234 | manifestsend=closechunk(), | |
1248 | sendtreemanifests=True, |
|
|||
1249 | bundlecaps=bundlecaps, |
|
1235 | bundlecaps=bundlecaps, | |
1250 | ellipses=ellipses, |
|
1236 | ellipses=ellipses, | |
1251 | shallow=shallow, |
|
1237 | shallow=shallow, |
General Comments 0
You need to be logged in to leave comments.
Login now