diff mercurial/exchange.py @ 24795:f9aa4cb8f2dd

bundle2: store the salvaged output on the exception object The re-handling of output is happening in some 'unbundle' callers. We have to transmit the output information to this place so we stick it on the exception. This is the third step in our quest for preserving the server output on error (issue4594). We want to be able to copy the output part from the aborted reply into the exception bundle.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 16 Apr 2015 03:17:01 -0400
parents 5dc5cd7abbf5
children b705e5ab3b07
line wrap: on
line diff
--- a/mercurial/exchange.py	Thu Apr 16 03:16:04 2015 -0400
+++ b/mercurial/exchange.py	Thu Apr 16 03:17:01 2015 -0400
@@ -1288,6 +1288,7 @@
         check_heads(repo, heads, 'uploading changes')
         # push can proceed
         if util.safehasattr(cg, 'params'):
+            r = None
             try:
                 wlock = repo.wlock()
                 lock = repo.lock()
@@ -1299,6 +1300,8 @@
                 tr.close()
             except Exception, exc:
                 exc.duringunbundle2 = True
+                if r is not None:
+                    exc._bundle2salvagedoutput = r.salvageoutput()
                 raise
         else:
             lock = repo.lock()