[PATCH 2 of 3 V2-rebased] bundle2: also capture reply capability on failure
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Tue Jun 9 17:56:27 UTC 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 c3795ae132413685580d1b2d51abdb46bc134476
# Parent bdd7159ee71ea7d4a706bd48f0cfa008dc5c5b99
bundle2: also capture reply capability on failure
When unbundling over the wire is aborted, 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