Mercurial > public > mercurial-scm > hg-stable
diff mercurial/httppeer.py @ 20905:167047ba3cfa
wireproto: drop the _decompress method in favor a new call type
We already have multiple call function for multiple return type. The
`_decompress` function is only used for http and seems like a layer violation.
We drop it in favor of a new call type dedicated to "stream that may be useful to
compress".
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 28 Mar 2014 14:24:13 -0700 |
parents | a07be8953733 |
children | f8a0d82b0463 |
line wrap: on
line diff
--- a/mercurial/httppeer.py Fri Mar 28 12:29:34 2014 -0700 +++ b/mercurial/httppeer.py Fri Mar 28 14:24:13 2014 -0700 @@ -211,10 +211,8 @@ fp.close() os.unlink(tempname) - def _abort(self, exception): - raise exception - - def _decompress(self, stream): + def _callcompressable(self, cmd, **args): + stream = self._callstream(cmd, **args) return util.chunkbuffer(zgenerator(stream)) class httpspeer(httppeer):