diff mercurial/exchange.py @ 24878:e530cde6d115 stable

bundle2: disable ouput capture unless we use http (issue4613 issue4615) The current bundle2 processing was capturing all output. This is nice as it provide better meta data about what output what, but this was changing two things: 1) adding a prefix "remote: " to "other" output during local push (issue4613) 2) local and ssh push does not provide real time output anymore (issue4615) As we are unsure about what form should be used in (1) and how to solve (2) we disable output capture in this two cases. Output capture can be forced using an experimental option.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 28 Apr 2015 17:38:02 -0700
parents df0ce98c882f
children e632a2429982 36111f98f23d
line wrap: on
line diff
--- a/mercurial/exchange.py	Tue Feb 03 15:01:43 2015 -0500
+++ b/mercurial/exchange.py	Tue Apr 28 17:38:02 2015 -0700
@@ -1285,6 +1285,11 @@
     # need a transaction when processing a bundle2 stream
     wlock = lock = tr = None
     recordout = None
+    # quick fix for output mismatch with bundle2 in 3.4
+    captureoutput = repo.ui.configbool('experimental', 'bundle2-output-capture',
+                                       False)
+    if url.startswith('remote:http:') or url.startswith('remote:https:'):
+        captureoutput = True
     try:
         check_heads(repo, heads, 'uploading changes')
         # push can proceed
@@ -1297,19 +1302,20 @@
                 tr.hookargs['source'] = source
                 tr.hookargs['url'] = url
                 tr.hookargs['bundle2'] = '1'
-                op = bundle2.bundleoperation(repo, lambda: tr)
+                op = bundle2.bundleoperation(repo, lambda: tr,
+                                             captureoutput=captureoutput)
                 try:
                     r = bundle2.processbundle(repo, cg, op=op)
                 finally:
                     r = op.reply
-                    if r is not None:
+                    if captureoutput and r is not None:
                         repo.ui.pushbuffer(error=True, subproc=True)
                         def recordout(output):
                             r.newpart('output', data=output, mandatory=False)
                 tr.close()
             except Exception, exc:
                 exc.duringunbundle2 = True
-                if r is not None:
+                if captureoutput and r is not None:
                     parts = exc._bundle2salvagedoutput = r.salvageoutput()
                     def recordout(output):
                         part = bundle2.bundlepart('output', data=output,