comparison hgext/evolve.py @ 880:7fe06f32d1ad

exchange: fix push markers over wire protocol for http peer Http actually interpret the data passed to _callpush expecting them to a bundle. Interpretation of a markers stream as a bundle obviously led to crash.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 10 Mar 2014 21:57:41 -0700
parents 85b3d54516a7
children d2fa1061df16
comparison
equal deleted inserted replaced
879:85b3d54516a7 880:7fe06f32d1ad
49 from mercurial import context 49 from mercurial import context
50 from mercurial import copies 50 from mercurial import copies
51 from mercurial import error 51 from mercurial import error
52 from mercurial import exchange 52 from mercurial import exchange
53 from mercurial import extensions 53 from mercurial import extensions
54 from mercurial import httppeer
54 from mercurial import hg 55 from mercurial import hg
55 from mercurial import lock as lockmod 56 from mercurial import lock as lockmod
56 from mercurial import merge 57 from mercurial import merge
57 from mercurial import node 58 from mercurial import node
58 from mercurial import phases 59 from mercurial import phases
2193 ret, output = self._callpush('evoext_pushobsmarkers_0', obsfile) 2194 ret, output = self._callpush('evoext_pushobsmarkers_0', obsfile)
2194 for l in output.splitlines(True): 2195 for l in output.splitlines(True):
2195 self.ui.status(_('remote: '), l) 2196 self.ui.status(_('remote: '), l)
2196 return ret 2197 return ret
2197 2198
2199 @eh.addattr(httppeer.httppeer, 'evoext_pushobsmarkers_0')
2200 def httpclient_pushobsmarkers(self, obsfile):
2201 """httpprotocol peer method
2202 (Cannot simply use _callpush as http is doing some special handling)"""
2203 self.requirecap('_evoext_pushobsmarkers_0',
2204 _('push obsolete markers faster'))
2205 ret, output = self._call('evoext_pushobsmarkers_0', data=obsfile)
2206 for l in output.splitlines(True):
2207 if l.strip():
2208 self.ui.status(_('remote: '), l)
2209 return ret
2210
2198 2211
2199 def srv_pushobsmarkers(repo, proto): 2212 def srv_pushobsmarkers(repo, proto):
2200 """wireprotocol command""" 2213 """wireprotocol command"""
2201 fp = StringIO() 2214 fp = StringIO()
2202 proto.redirect() 2215 proto.redirect()