[PATCH 4 of 5] bundle2: also capture reply capability on failure

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Jun 8 12:29:18 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1433577027 25200
#      Sat Jun 06 00:50:27 2015 -0700
# Node ID 66fcbd3d716ab3e992b3ef2e6797390c75512ab1
# Parent  5be1b649c5236da4d040f4482dabeaf8c263d690
bundle2: also capture reply capability on failure

When unbundling over the wire is aborted during, we have a mechanism to convey
the error inside a bundle part. As we add support for more error, we need to
know if the client will support them. For this purpose, we duck punch the reply
capabilities of the client on the raised extensions.

This is similar to what is done to salvage the server output on error.

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -345,12 +345,15 @@ def processbundle(repo, unbundler, trans
         # 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
         salvaged = []
+        replycaps = None
         if op.reply is not None:
             salvaged = op.reply.salvageoutput()
+            replycaps = op.reply.capabilities
+        exc._replycaps = replycaps
         exc._bundle2salvagedoutput = salvaged
         raise
     finally:
         repo.ui.debug('bundle2-input-bundle: %i parts total\n' % nbpart)
 


More information about the Mercurial-devel mailing list