changeset 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 4345274adc4b
files mercurial/exchange.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/exchange.py	Mon Apr 21 19:43:01 2014 -0700
+++ b/mercurial/exchange.py	Tue Apr 22 11:41:34 2014 -0700
@@ -225,7 +225,10 @@
     cgpart = bundle2.bundlepart('B2X:CHANGEGROUP', data=cg.getchunks())
     bundler.addpart(cgpart)
     stream = util.chunkbuffer(bundler.getchunks())
-    reply = pushop.remote.unbundle(stream, ['force'], 'push')
+    try:
+        reply = pushop.remote.unbundle(stream, ['force'], 'push')
+    except bundle2.UnknownPartError, exc:
+        raise util.Abort('missing support for %s' % exc)
     try:
         op = bundle2.processbundle(pushop.repo, reply)
     except bundle2.UnknownPartError, exc: