comparison mercurial/httprepo.py @ 14060:aaa9a5989405

bundle: more comments about the different header types, remove useless if
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sat, 30 Apr 2011 14:22:03 +0200
parents d16894e29f91
children 924c82157d46
comparison
equal deleted inserted replaced
14059:c0e29e10b9ef 14060:aaa9a5989405
145 145
146 def _callpush(self, cmd, cg, **args): 146 def _callpush(self, cmd, cg, **args):
147 # have to stream bundle to a temp file because we do not have 147 # have to stream bundle to a temp file because we do not have
148 # http 1.1 chunked transfer. 148 # http 1.1 chunked transfer.
149 149
150 type = ""
151 types = self.capable('unbundle') 150 types = self.capable('unbundle')
152 # servers older than d1b16a746db6 will send 'unbundle' as a
153 # boolean capability
154 try: 151 try:
155 types = types.split(',') 152 types = types.split(',')
156 except AttributeError: 153 except AttributeError:
154 # servers older than d1b16a746db6 will send 'unbundle' as a
155 # boolean capability. They only support headerless/uncompressed
156 # bundles.
157 types = [""] 157 types = [""]
158 if types: 158 for x in types:
159 for x in types: 159 if x in changegroup.bundletypes:
160 if x in changegroup.bundletypes: 160 type = x
161 type = x 161 break
162 break
163 162
164 tempname = changegroup.writebundle(cg, None, type) 163 tempname = changegroup.writebundle(cg, None, type)
165 fp = url.httpsendfile(self.ui, tempname, "rb") 164 fp = url.httpsendfile(self.ui, tempname, "rb")
166 headers = {'Content-Type': 'application/mercurial-0.1'} 165 headers = {'Content-Type': 'application/mercurial-0.1'}
167 166