mercurial/wireproto.py
branchstable
changeset 21186 9f3652e851f8
parent 21184 28d76afa1568
child 21600 5e08f3b65510
child 21615 3cb2da25b171
--- 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))