mercurial/bundle2.py
branchstable
changeset 21176 70fcb0a71445
parent 21146 4676135ac555
child 21177 952af771bc17
--- a/mercurial/bundle2.py	Tue Apr 22 10:14:16 2014 -0300
+++ b/mercurial/bundle2.py	Tue Apr 22 11:22:41 2014 -0700
@@ -323,13 +323,19 @@
                                      data=output)
                 op.reply.addpart(outpart)
             part.read()
-    except Exception:
+    except Exception, exc:
         if part is not None:
             # consume the bundle content
             part.read()
         for part in iterparts:
             # consume the bundle content
             part.read()
+        # Small hack to let caller code distinguish exceptions from bundle2
+        # processing fron the ones from bundle1 processing. This is mostly
+        # needed to handle different return codes to unbundle according to the
+        # type of bundle. We should probably clean up or drop this return code
+        # craziness in a future version.
+        exc.duringunbundle2 = True
         raise
     return op