changeset 24733:c00e4338fa4b

obsolete: experimental flag to get debug about obsmarkers exchange The obsolescence markers exchange is still experimental. We (developer) need more information about what is going on. I'm adding an experimental flag to add display the amount of data exchanged during bundle2 exchanges.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 14 Apr 2015 11:44:04 -0400
parents 8f70b529cb0c
children fb6cb1b82f4f
files mercurial/bundle2.py tests/test-obsolete.t
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Tue Apr 14 14:59:37 2015 -0400
+++ b/mercurial/bundle2.py	Tue Apr 14 11:44:04 2015 -0400
@@ -1217,7 +1217,11 @@
 def handleobsmarker(op, inpart):
     """add a stream of obsmarkers to the repo"""
     tr = op.gettransaction()
-    new = op.repo.obsstore.mergemarkers(tr, inpart.read())
+    markerdata = inpart.read()
+    if op.ui.config('experimental', 'obsmarkers-exchange-debug', False):
+        op.ui.write(('obsmarker-exchange: %i bytes received\n')
+                    % len(markerdata))
+    new = op.repo.obsstore.mergemarkers(tr, markerdata)
     if new:
         op.repo.ui.status(_('%i new obsolescence markers\n') % new)
     op.records.add('obsmarkers', {'new': new})
--- a/tests/test-obsolete.t	Tue Apr 14 14:59:37 2015 -0400
+++ b/tests/test-obsolete.t	Tue Apr 14 11:44:04 2015 -0400
@@ -616,6 +616,15 @@
 
 #if serve
 
+Test the debug output for exchange
+----------------------------------
+
+  $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' --config 'experimental.bundle2-exp=True'
+  pulling from ../tmpb
+  searching for changes
+  no changes found
+  obsmarker-exchange: 346 bytes received
+
 check hgweb does not explode
 ====================================