comparison mercurial/httprepo.py @ 11588:8a1f625e971d

protocol: unify stream_out client code
author Matt Mackall <mpm@selenic.com>
date Wed, 14 Jul 2010 16:55:44 -0500
parents a036f6bd1da3
children e8d22fe2ddab
comparison
equal deleted inserted replaced
11587:a036f6bd1da3 11588:8a1f625e971d
138 # if using keepalive, allow connection to be reused 138 # if using keepalive, allow connection to be reused
139 fp.close() 139 fp.close()
140 140
141 def _call(self, cmd, **args): 141 def _call(self, cmd, **args):
142 return self.do_read(cmd, **args) 142 return self.do_read(cmd, **args)
143
144 def _callstream(self, cmd, **args):
145 return self.do_cmd(cmd, **args)
143 146
144 def _abort(self, exception): 147 def _abort(self, exception):
145 raise exception 148 raise exception
146 149
147 def changegroup(self, nodes, kind): 150 def changegroup(self, nodes, kind):
203 raise util.Abort(err.args[1]) 206 raise util.Abort(err.args[1])
204 finally: 207 finally:
205 fp.close() 208 fp.close()
206 os.unlink(tempname) 209 os.unlink(tempname)
207 210
208 def stream_out(self):
209 return self.do_cmd('stream_out')
210
211 class httpsrepository(httprepository): 211 class httpsrepository(httprepository):
212 def __init__(self, ui, path): 212 def __init__(self, ui, path):
213 if not url.has_https: 213 if not url.has_https:
214 raise util.Abort(_('Python support for SSL and HTTPS ' 214 raise util.Abort(_('Python support for SSL and HTTPS '
215 'is not installed')) 215 'is not installed'))