Mercurial > hg-stable
comparison mercurial/wireproto.py @ 12337:6a6149487817
bundle: encapsulate all bundle streams in unbundle class
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 20 Sep 2010 14:32:21 -0500 |
parents | d7fff529d85d |
children | cb9e1d1c34ea |
comparison
equal
deleted
inserted
replaced
12336:9d234f7d8a77 | 12337:6a6149487817 |
---|---|
100 return self._callstream('stream_out') | 100 return self._callstream('stream_out') |
101 | 101 |
102 def changegroup(self, nodes, kind): | 102 def changegroup(self, nodes, kind): |
103 n = encodelist(nodes) | 103 n = encodelist(nodes) |
104 f = self._callstream("changegroup", roots=n) | 104 f = self._callstream("changegroup", roots=n) |
105 return self._decompress(f) | 105 return changegroupmod.unbundle10(self._decompress(f), 'UN') |
106 | 106 |
107 def changegroupsubset(self, bases, heads, kind): | 107 def changegroupsubset(self, bases, heads, kind): |
108 self.requirecap('changegroupsubset', _('look up remote changes')) | 108 self.requirecap('changegroupsubset', _('look up remote changes')) |
109 bases = encodelist(bases) | 109 bases = encodelist(bases) |
110 heads = encodelist(heads) | 110 heads = encodelist(heads) |
111 return self._decompress(self._callstream("changegroupsubset", | 111 f = self._callstream("changegroupsubset", |
112 bases=bases, heads=heads)) | 112 bases=bases, heads=heads) |
113 return changegroupmod.unbundle10(self._decompress(f), 'UN') | |
113 | 114 |
114 def unbundle(self, cg, heads, source): | 115 def unbundle(self, cg, heads, source): |
115 '''Send cg (a readable file-like object representing the | 116 '''Send cg (a readable file-like object representing the |
116 changegroup to push, typically a chunkbuffer object) to the | 117 changegroup to push, typically a chunkbuffer object) to the |
117 remote server as a bundle. Return an integer indicating the | 118 remote server as a bundle. Return an integer indicating the |