Mercurial > public > mercurial-scm > hg
comparison mercurial/httprepo.py @ 11591:0d9cb3f3b0a1
protocol: unify client changegroup methods
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 14 Jul 2010 17:09:31 -0500 |
parents | e8d22fe2ddab |
children | 26e0782b8380 |
comparison
equal
deleted
inserted
replaced
11590:0b15aee0a306 | 11591:0d9cb3f3b0a1 |
---|---|
139 fp.close() | 139 fp.close() |
140 | 140 |
141 def _abort(self, exception): | 141 def _abort(self, exception): |
142 raise exception | 142 raise exception |
143 | 143 |
144 def changegroup(self, nodes, kind): | 144 def _decompress(self, stream): |
145 n = " ".join(map(hex, nodes)) | 145 return util.chunkbuffer(zgenerator(stream)) |
146 f = self._callstream("changegroup", roots=n) | |
147 return util.chunkbuffer(zgenerator(f)) | |
148 | |
149 def changegroupsubset(self, bases, heads, source): | |
150 self.requirecap('changegroupsubset', _('look up remote changes')) | |
151 baselst = " ".join([hex(n) for n in bases]) | |
152 headlst = " ".join([hex(n) for n in heads]) | |
153 f = self._callstream("changegroupsubset", bases=baselst, heads=headlst) | |
154 return util.chunkbuffer(zgenerator(f)) | |
155 | 146 |
156 def unbundle(self, cg, heads, source): | 147 def unbundle(self, cg, heads, source): |
157 '''Send cg (a readable file-like object representing the | 148 '''Send cg (a readable file-like object representing the |
158 changegroup to push, typically a chunkbuffer object) to the | 149 changegroup to push, typically a chunkbuffer object) to the |
159 remote server as a bundle. Return an integer response code: | 150 remote server as a bundle. Return an integer response code: |