##// END OF EJS Templates
changegroup: cg3 has two empty groups *after* manifests...
Martin von Zweigbergk -
r27920:da5f2336 stable
parent child Browse files
Show More
@@ -189,6 +189,8 b' class cg1unpacker(object):'
189 deltaheader = _CHANGEGROUPV1_DELTA_HEADER
189 deltaheader = _CHANGEGROUPV1_DELTA_HEADER
190 deltaheadersize = struct.calcsize(deltaheader)
190 deltaheadersize = struct.calcsize(deltaheader)
191 version = '01'
191 version = '01'
192 _grouplistcount = 1 # One list of files after the manifests
193
192 def __init__(self, fh, alg):
194 def __init__(self, fh, alg):
193 if alg == 'UN':
195 if alg == 'UN':
194 alg = None # get more modern without breaking too much
196 alg = None # get more modern without breaking too much
@@ -270,15 +272,19 b' class cg1unpacker(object):'
270 """
272 """
271 # an empty chunkgroup is the end of the changegroup
273 # an empty chunkgroup is the end of the changegroup
272 # a changegroup has at least 2 chunkgroups (changelog and manifest).
274 # a changegroup has at least 2 chunkgroups (changelog and manifest).
273 # after that, an empty chunkgroup is the end of the changegroup
275 # after that, changegroup versions 1 and 2 have a series of groups
274 empty = False
276 # with one group per file. changegroup 3 has a series of directory
277 # manifests before the files.
275 count = 0
278 count = 0
276 while not empty or count <= 2:
279 emptycount = 0
280 while emptycount < self._grouplistcount:
277 empty = True
281 empty = True
278 count += 1
282 count += 1
279 while True:
283 while True:
280 chunk = getchunk(self)
284 chunk = getchunk(self)
281 if not chunk:
285 if not chunk:
286 if empty and count > 2:
287 emptycount += 1
282 break
288 break
283 empty = False
289 empty = False
284 yield chunkheader(len(chunk))
290 yield chunkheader(len(chunk))
@@ -515,6 +521,7 b' class cg3unpacker(cg2unpacker):'
515 deltaheader = _CHANGEGROUPV3_DELTA_HEADER
521 deltaheader = _CHANGEGROUPV3_DELTA_HEADER
516 deltaheadersize = struct.calcsize(deltaheader)
522 deltaheadersize = struct.calcsize(deltaheader)
517 version = '03'
523 version = '03'
524 _grouplistcount = 2 # One list of manifests and one list of files
518
525
519 def _deltaheader(self, headertuple, prevnode):
526 def _deltaheader(self, headertuple, prevnode):
520 node, p1, p2, deltabase, cs, flags = headertuple
527 node, p1, p2, deltabase, cs, flags = headertuple
General Comments 0
You need to be logged in to leave comments. Login now