--- a/mercurial/wireproto.py Mon Apr 21 20:04:54 2014 -0700
+++ b/mercurial/wireproto.py Mon Apr 21 17:51:58 2014 -0700
@@ -827,4 +827,11 @@
sys.stderr.write("abort: %s\n" % inst)
return pushres(0)
except error.PushRaced, exc:
- return pusherr(str(exc))
+ if getattr(exc, 'duringunbundle2', False):
+ bundler = bundle2.bundle20(repo.ui)
+ part = bundle2.bundlepart('B2X:ERROR:PUSHRACED',
+ [('message', str(exc))])
+ bundler.addpart(part)
+ return streamres(bundler.getchunks())
+ else:
+ return pusherr(str(exc))