# HG changeset patch # User Matt Mackall # Date 1279144544 18000 # Node ID 8a1f625e971d86449d03f1bc63b7d5b777760f2f # Parent a036f6bd1da3a06938a59d40758e8d264f527fc4 protocol: unify stream_out client code diff -r a036f6bd1da3 -r 8a1f625e971d mercurial/httprepo.py --- a/mercurial/httprepo.py Wed Jul 14 16:35:51 2010 -0500 +++ b/mercurial/httprepo.py Wed Jul 14 16:55:44 2010 -0500 @@ -141,6 +141,9 @@ def _call(self, cmd, **args): return self.do_read(cmd, **args) + def _callstream(self, cmd, **args): + return self.do_cmd(cmd, **args) + def _abort(self, exception): raise exception @@ -205,9 +208,6 @@ fp.close() os.unlink(tempname) - def stream_out(self): - return self.do_cmd('stream_out') - class httpsrepository(httprepository): def __init__(self, ui, path): if not url.has_https: diff -r a036f6bd1da3 -r 8a1f625e971d mercurial/sshrepo.py --- a/mercurial/sshrepo.py Wed Jul 14 16:35:51 2010 -0500 +++ b/mercurial/sshrepo.py Wed Jul 14 16:55:44 2010 -0500 @@ -136,6 +136,9 @@ self.do_cmd(cmd, **args) return self._recv() + def _callstream(self, cmd, **args): + return self.do_cmd(cmd, **args) + def _recv(self): l = self.pipei.readline() self.readerr() @@ -224,7 +227,4 @@ except: self.abort(error.ResponseError(_("unexpected response:"), r)) - def stream_out(self): - return self.do_cmd('stream_out') - instance = sshrepository diff -r a036f6bd1da3 -r 8a1f625e971d mercurial/wireproto.py --- a/mercurial/wireproto.py Wed Jul 14 16:35:51 2010 -0500 +++ b/mercurial/wireproto.py Wed Jul 14 16:55:44 2010 -0500 @@ -88,6 +88,9 @@ r[k.decode('string-escape')] = v.decode('string-escape') return r + def stream_out(self): + return self._callstream('stream_out') + # server side def dispatch(repo, proto, command):