comparison mercurial/changegroup.py @ 5906:0136d7f58982

allow the creation of bundles with empty changelog/manifest chunks
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 19 Jan 2008 18:01:16 -0200
parents 61462e7d62ed
children c050548307a4
comparison
equal deleted inserted replaced
5905:3afbd82a6c82 5906:0136d7f58982
78 78
79 # parse the changegroup data, otherwise we will block 79 # parse the changegroup data, otherwise we will block
80 # in case of sshrepo because we don't know the end of the stream 80 # in case of sshrepo because we don't know the end of the stream
81 81
82 # an empty chunkiter is the end of the changegroup 82 # an empty chunkiter is the end of the changegroup
83 # a changegroup has at least 2 chunkiters (changelog and manifest).
84 # after that, an empty chunkiter is the end of the changegroup
83 empty = False 85 empty = False
84 while not empty: 86 count = 0
87 while not empty or count <= 2:
85 empty = True 88 empty = True
89 count += 1
86 for chunk in chunkiter(cg): 90 for chunk in chunkiter(cg):
87 empty = False 91 empty = False
88 fh.write(z.compress(chunkheader(len(chunk)))) 92 fh.write(z.compress(chunkheader(len(chunk))))
89 pos = 0 93 pos = 0
90 while pos < len(chunk): 94 while pos < len(chunk):