Mercurial > hg
comparison mercurial/exchange.py @ 21182:08c84fd99aac stable
bundle2: catch UnknownPartError during local push
When doing local push, UnknownPartError from the server will be raised directly
to the client. We need to catch them too.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 22 Apr 2014 11:41:34 -0700 |
parents | a92619a2dbd7 |
children | 28d76afa1568 |
comparison
equal
deleted
inserted
replaced
21181:a92619a2dbd7 | 21182:08c84fd99aac |
---|---|
223 # add the changegroup bundle | 223 # add the changegroup bundle |
224 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing) | 224 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing) |
225 cgpart = bundle2.bundlepart('B2X:CHANGEGROUP', data=cg.getchunks()) | 225 cgpart = bundle2.bundlepart('B2X:CHANGEGROUP', data=cg.getchunks()) |
226 bundler.addpart(cgpart) | 226 bundler.addpart(cgpart) |
227 stream = util.chunkbuffer(bundler.getchunks()) | 227 stream = util.chunkbuffer(bundler.getchunks()) |
228 reply = pushop.remote.unbundle(stream, ['force'], 'push') | 228 try: |
229 reply = pushop.remote.unbundle(stream, ['force'], 'push') | |
230 except bundle2.UnknownPartError, exc: | |
231 raise util.Abort('missing support for %s' % exc) | |
229 try: | 232 try: |
230 op = bundle2.processbundle(pushop.repo, reply) | 233 op = bundle2.processbundle(pushop.repo, reply) |
231 except bundle2.UnknownPartError, exc: | 234 except bundle2.UnknownPartError, exc: |
232 raise util.Abort('missing support for %s' % exc) | 235 raise util.Abort('missing support for %s' % exc) |
233 cgreplies = op.records.getreplies(cgpart.id) | 236 cgreplies = op.records.getreplies(cgpart.id) |