##// END OF EJS Templates
changegroup3: add empty chunk separating directories and files...
Martin von Zweigbergk -
r27753:d4071cc7 default
parent child Browse files
Show More
@@ -329,6 +329,10 b' class bundlerepository(localrepo.localre'
329 # consume the header if it exists
329 # consume the header if it exists
330 self.bundle.manifestheader()
330 self.bundle.manifestheader()
331 m = bundlemanifest(self.svfs, self.bundle, self.changelog.rev)
331 m = bundlemanifest(self.svfs, self.bundle, self.changelog.rev)
332 # XXX: hack to work with changegroup3, but we still don't handle
333 # tree manifests correctly
334 if self.bundle.version == "03":
335 self.bundle.filelogheader()
332 self.filestart = self.bundle.tell()
336 self.filestart = self.bundle.tell()
333 return m
337 return m
334
338
@@ -506,8 +506,8 b' class cg3unpacker(cg2unpacker):'
506 """Unpacker for cg3 streams.
506 """Unpacker for cg3 streams.
507
507
508 cg3 streams add support for exchanging treemanifests and revlog
508 cg3 streams add support for exchanging treemanifests and revlog
509 flags, so the only changes from cg2 are the delta header and
509 flags. It adds the revlog flags to the delta header and an empty chunk
510 version number.
510 separating manifests and files.
511 """
511 """
512 deltaheader = _CHANGEGROUPV3_DELTA_HEADER
512 deltaheader = _CHANGEGROUPV3_DELTA_HEADER
513 deltaheadersize = struct.calcsize(deltaheader)
513 deltaheadersize = struct.calcsize(deltaheader)
@@ -909,6 +909,7 b' class cg3packer(cg2packer):'
909 yield self.fileheader(name)
909 yield self.fileheader(name)
910 for chunk in self.group(nodes, dirlog(name), nodes.get):
910 for chunk in self.group(nodes, dirlog(name), nodes.get):
911 yield chunk
911 yield chunk
912 yield self.close()
912
913
913 def builddeltaheader(self, node, p1n, p2n, basenode, linknode, flags):
914 def builddeltaheader(self, node, p1n, p2n, basenode, linknode, flags):
914 return struct.pack(
915 return struct.pack(
@@ -917,7 +918,7 b' class cg3packer(cg2packer):'
917 _packermap = {'01': (cg1packer, cg1unpacker),
918 _packermap = {'01': (cg1packer, cg1unpacker),
918 # cg2 adds support for exchanging generaldelta
919 # cg2 adds support for exchanging generaldelta
919 '02': (cg2packer, cg2unpacker),
920 '02': (cg2packer, cg2unpacker),
920 # cg3 adds support for exchanging treemanifests
921 # cg3 adds support for exchanging revlog flags and treemanifests
921 '03': (cg3packer, cg3unpacker),
922 '03': (cg3packer, cg3unpacker),
922 }
923 }
923
924
@@ -1054,9 +1055,13 b' def changegroup(repo, basenodes, source)'
1054 def _addchangegroupfiles(repo, source, revmap, trp, pr, needfiles):
1055 def _addchangegroupfiles(repo, source, revmap, trp, pr, needfiles):
1055 revisions = 0
1056 revisions = 0
1056 files = 0
1057 files = 0
1058 submfsdone = False
1057 while True:
1059 while True:
1058 chunkdata = source.filelogheader()
1060 chunkdata = source.filelogheader()
1059 if not chunkdata:
1061 if not chunkdata:
1062 if source.version == "03" and not submfsdone:
1063 submfsdone = True
1064 continue
1060 break
1065 break
1061 f = chunkdata["filename"]
1066 f = chunkdata["filename"]
1062 repo.ui.debug("adding %s revisions\n" % f)
1067 repo.ui.debug("adding %s revisions\n" % f)
General Comments 0
You need to be logged in to leave comments. Login now