2517 def httpclient_pushobsmarkers(self, obsfile): |
2517 def httpclient_pushobsmarkers(self, obsfile): |
2518 """httpprotocol peer method |
2518 """httpprotocol peer method |
2519 (Cannot simply use _callpush as http is doing some special handling)""" |
2519 (Cannot simply use _callpush as http is doing some special handling)""" |
2520 self.requirecap('_evoext_pushobsmarkers_0', |
2520 self.requirecap('_evoext_pushobsmarkers_0', |
2521 _('push obsolete markers faster')) |
2521 _('push obsolete markers faster')) |
2522 ret, output = self._call('evoext_pushobsmarkers_0', data=obsfile) |
2522 try: |
2523 for l in output.splitlines(True): |
2523 r = self._call('evoext_pushobsmarkers_0', data=obsfile) |
2524 if l.strip(): |
2524 vals = r.split('\n', 1) |
2525 self.ui.status(_('remote: '), l) |
2525 if len(vals) < 2: |
2526 return ret |
2526 raise error.ResponseError(_("unexpected response:"), r) |
|
2527 |
|
2528 for l in vals[1].splitlines(True): |
|
2529 if l.strip(): |
|
2530 self.ui.status(_('remote: '), l) |
|
2531 return vals[0] |
|
2532 except socket.error, err: |
|
2533 if err.args[0] in (errno.ECONNRESET, errno.EPIPE): |
|
2534 raise util.Abort(_('push failed: %s') % err.args[1]) |
|
2535 raise util.Abort(err.args[1]) |
2527 |
2536 |
2528 @eh.wrapfunction(localrepo.localrepository, '_restrictcapabilities') |
2537 @eh.wrapfunction(localrepo.localrepository, '_restrictcapabilities') |
2529 def local_pushobsmarker_capabilities(orig, repo, caps): |
2538 def local_pushobsmarker_capabilities(orig, repo, caps): |
2530 caps = orig(repo, caps) |
2539 caps = orig(repo, caps) |
2531 caps.add('_evoext_pushobsmarkers_0') |
2540 caps.add('_evoext_pushobsmarkers_0') |