diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -318,6 +318,10 @@ def processbundle(repo, unbundler, trans # type of bundle. We should probably clean up or drop this return code # craziness in a future version. exc.duringunbundle2 = True + salvaged = [] + if op.reply is not None: + salvaged = op.reply.salvageoutput() + exc._bundle2salvagedoutput = salvaged raise return op diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1288,6 +1288,7 @@ def unbundle(repo, cg, heads, source, ur 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 @@ def unbundle(repo, cg, heads, source, ur tr.close() except Exception, exc: exc.duringunbundle2 = True + if r is not None: + exc._bundle2salvagedoutput = r.salvageoutput() raise else: lock = repo.lock()