exchange: fix push markers over wire protocol for http peer
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 10 Mar 2014 21:57:41 -0700
changeset 880 7fe06f32d1ad
parent 879 85b3d54516a7
child 881 380aa41a53a5
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.
hgext/evolve.py
--- a/hgext/evolve.py	Mon Mar 10 21:55:41 2014 -0700
+++ b/hgext/evolve.py	Mon Mar 10 21:57:41 2014 -0700
@@ -51,6 +51,7 @@
 from mercurial import error
 from mercurial import exchange
 from mercurial import extensions
+from mercurial import httppeer
 from mercurial import hg
 from mercurial import lock as lockmod
 from mercurial import merge
@@ -2195,6 +2196,18 @@
         self.ui.status(_('remote: '), l)
     return ret
 
+@eh.addattr(httppeer.httppeer, 'evoext_pushobsmarkers_0')
+def httpclient_pushobsmarkers(self, obsfile):
+    """httpprotocol peer method
+    (Cannot simply use _callpush as http is doing some special handling)"""
+    self.requirecap('_evoext_pushobsmarkers_0',
+                    _('push obsolete markers faster'))
+    ret, output = self._call('evoext_pushobsmarkers_0', data=obsfile)
+    for l in output.splitlines(True):
+        if l.strip():
+            self.ui.status(_('remote: '), l)
+    return ret
+
 
 def srv_pushobsmarkers(repo, proto):
     """wireprotocol command"""