equal
deleted
inserted
replaced
112 common=common, bundlecaps=bundlecaps, **kwargs) |
112 common=common, bundlecaps=bundlecaps, **kwargs) |
113 if bundlecaps is not None and 'HG2Y' in bundlecaps: |
113 if bundlecaps is not None and 'HG2Y' in bundlecaps: |
114 # When requesting a bundle2, getbundle returns a stream to make the |
114 # When requesting a bundle2, getbundle returns a stream to make the |
115 # wire level function happier. We need to build a proper object |
115 # wire level function happier. We need to build a proper object |
116 # from it in local peer. |
116 # from it in local peer. |
117 cg = bundle2.unbundle20(self.ui, cg) |
117 cg = bundle2.getunbundler(self.ui, cg) |
118 return cg |
118 return cg |
119 |
119 |
120 # TODO We might want to move the next two calls into legacypeer and add |
120 # TODO We might want to move the next two calls into legacypeer and add |
121 # unbundle instead. |
121 # unbundle instead. |
122 |
122 |
130 if util.safehasattr(ret, 'getchunks'): |
130 if util.safehasattr(ret, 'getchunks'): |
131 # This is a bundle20 object, turn it into an unbundler. |
131 # This is a bundle20 object, turn it into an unbundler. |
132 # This little dance should be dropped eventually when the API |
132 # This little dance should be dropped eventually when the API |
133 # is finally improved. |
133 # is finally improved. |
134 stream = util.chunkbuffer(ret.getchunks()) |
134 stream = util.chunkbuffer(ret.getchunks()) |
135 ret = bundle2.unbundle20(self.ui, stream) |
135 ret = bundle2.getunbundler(self.ui, stream) |
136 return ret |
136 return ret |
137 except error.PushRaced, exc: |
137 except error.PushRaced, exc: |
138 raise error.ResponseError(_('push failed:'), str(exc)) |
138 raise error.ResponseError(_('push failed:'), str(exc)) |
139 |
139 |
140 def lock(self): |
140 def lock(self): |