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