Patchwork [2,of,7,main-line-of-works,(28,more,patches,to,go)] ] bundle2: prefix all unbundling debug message with 'bundle2-input:'

login
register
mail settings
Submitter Pierre-Yves David
Date May 28, 2015, 4:53 p.m.
Message ID <c25edb87d38eb9a99e52.1432831993@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/9325/
State Accepted
Headers show

Comments

Pierre-Yves David - May 28, 2015, 4:53 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1432698021 25200
#      Tue May 26 20:40:21 2015 -0700
# Node ID c25edb87d38eb9a99e526ab9af0a550358c54cd6
# Parent  7672b85918fe945b6517afc83c38449d36e83df5
bundle2: prefix all unbundling debug message with 'bundle2-input:'

This make the origin of the message more explicit.

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -177,11 +177,11 @@  def outdebug(ui, message):
     """debug regarding output stream (bundling)"""
     ui.debug('bundle2-output: %s\n' % message)
 
 def indebug(ui, message):
     """debug on input stream (unbundling)"""
-    ui.debug(message)
+    ui.debug('bundle2-input: %s' % message)
 
 def validateparttype(parttype):
     """raise ValueError if a parttype contains invalid character"""
     if _parttypeforbidden.search(parttype):
         raise ValueError(parttype)
diff --git a/tests/test-bundle2-format.t b/tests/test-bundle2-format.t
--- a/tests/test-bundle2-format.t
+++ b/tests/test-bundle2-format.t
@@ -348,21 +348,21 @@  file content is ok
   HG20\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc)
 
 unbundling debug
 
   $ hg statbundle2 --debug --config progress.debug=true < ../out.hg2
-  start processing of HG20 stream
-  reading bundle2 stream parameters
-  ignoring unknown parameter 'e|! 7/'
-  ignoring unknown parameter 'simple'
+  bundle2-input: start processing of HG20 stream
+  bundle2-input: reading bundle2 stream parameters
+  bundle2-input: ignoring unknown parameter 'e|! 7/'
+  bundle2-input: ignoring unknown parameter 'simple'
   options count: 2
   - e|! 7/
       babar%#==tutu
   - simple
-  start extraction of bundle2 parts
-  part header size: 0
-  end of bundle2 stream
+  bundle2-input: start extraction of bundle2 parts
+  bundle2-input: part header size: 0
+  bundle2-input: end of bundle2 stream
   parts count:   0
 
 
 Test buggy input
 ---------------------------------------------------
@@ -435,145 +435,145 @@  Test part
       advisory: 0
       payload: 0 bytes
   parts count:   7
 
   $ hg statbundle2 --debug --config progress.debug=true < ../parts.hg2
-  start processing of HG20 stream
-  reading bundle2 stream parameters
+  bundle2-input: start processing of HG20 stream
+  bundle2-input: reading bundle2 stream parameters
   options count: 0
-  start extraction of bundle2 parts
-  part header size: 17
-  part type: "test:empty"
-  part id: "0"
-  part parameters: 0
+  bundle2-input: start extraction of bundle2 parts
+  bundle2-input: part header size: 17
+  bundle2-input: part type: "test:empty"
+  bundle2-input: part id: "0"
+  bundle2-input: part parameters: 0
     :test:empty:
       mandatory: 0
       advisory: 0
-  payload chunk size: 0
+  bundle2-input: payload chunk size: 0
       payload: 0 bytes
-  part header size: 17
-  part type: "test:empty"
-  part id: "1"
-  part parameters: 0
+  bundle2-input: part header size: 17
+  bundle2-input: part type: "test:empty"
+  bundle2-input: part id: "1"
+  bundle2-input: part parameters: 0
     :test:empty:
       mandatory: 0
       advisory: 0
-  payload chunk size: 0
+  bundle2-input: payload chunk size: 0
       payload: 0 bytes
-  part header size: 16
-  part type: "test:song"
-  part id: "2"
-  part parameters: 0
+  bundle2-input: part header size: 16
+  bundle2-input: part type: "test:song"
+  bundle2-input: part id: "2"
+  bundle2-input: part parameters: 0
     :test:song:
       mandatory: 0
       advisory: 0
-  payload chunk size: 178
-  payload chunk size: 0
+  bundle2-input: payload chunk size: 178
+  bundle2-input: payload chunk size: 0
       payload: 178 bytes
-  part header size: 22
-  part type: "test:debugreply"
-  part id: "3"
-  part parameters: 0
+  bundle2-input: part header size: 22
+  bundle2-input: part type: "test:debugreply"
+  bundle2-input: part id: "3"
+  bundle2-input: part parameters: 0
     :test:debugreply:
       mandatory: 0
       advisory: 0
-  payload chunk size: 0
+  bundle2-input: payload chunk size: 0
       payload: 0 bytes
-  part header size: 43
-  part type: "test:math"
-  part id: "4"
-  part parameters: 3
+  bundle2-input: part header size: 43
+  bundle2-input: part type: "test:math"
+  bundle2-input: part id: "4"
+  bundle2-input: part parameters: 3
     :test:math:
       mandatory: 2
       advisory: 1
-  payload chunk size: 2
-  payload chunk size: 0
+  bundle2-input: payload chunk size: 2
+  bundle2-input: payload chunk size: 0
       payload: 2 bytes
-  part header size: 29
-  part type: "test:song"
-  part id: "5"
-  part parameters: 1
+  bundle2-input: part header size: 29
+  bundle2-input: part type: "test:song"
+  bundle2-input: part id: "5"
+  bundle2-input: part parameters: 1
     :test:song:
       mandatory: 1
       advisory: 0
-  payload chunk size: 0
+  bundle2-input: payload chunk size: 0
       payload: 0 bytes
-  part header size: 16
-  part type: "test:ping"
-  part id: "6"
-  part parameters: 0
+  bundle2-input: part header size: 16
+  bundle2-input: part type: "test:ping"
+  bundle2-input: part id: "6"
+  bundle2-input: part parameters: 0
     :test:ping:
       mandatory: 0
       advisory: 0
-  payload chunk size: 0
+  bundle2-input: payload chunk size: 0
       payload: 0 bytes
-  part header size: 0
-  end of bundle2 stream
+  bundle2-input: part header size: 0
+  bundle2-input: end of bundle2 stream
   parts count:   7
 
 Test actual unbundling of test part
 =======================================
 
 Process the bundle
 
   $ hg unbundle2 --debug --config progress.debug=true < ../parts.hg2
-  start processing of HG20 stream
-  reading bundle2 stream parameters
-  start extraction of bundle2 parts
-  part header size: 17
-  part type: "test:empty"
-  part id: "0"
-  part parameters: 0
-  ignoring unsupported advisory part test:empty
-  payload chunk size: 0
-  part header size: 17
-  part type: "test:empty"
-  part id: "1"
-  part parameters: 0
-  ignoring unsupported advisory part test:empty
-  payload chunk size: 0
-  part header size: 16
-  part type: "test:song"
-  part id: "2"
-  part parameters: 0
-  found a handler for part 'test:song'
+  bundle2-input: start processing of HG20 stream
+  bundle2-input: reading bundle2 stream parameters
+  bundle2-input: start extraction of bundle2 parts
+  bundle2-input: part header size: 17
+  bundle2-input: part type: "test:empty"
+  bundle2-input: part id: "0"
+  bundle2-input: part parameters: 0
+  bundle2-input: ignoring unsupported advisory part test:empty
+  bundle2-input: payload chunk size: 0
+  bundle2-input: part header size: 17
+  bundle2-input: part type: "test:empty"
+  bundle2-input: part id: "1"
+  bundle2-input: part parameters: 0
+  bundle2-input: ignoring unsupported advisory part test:empty
+  bundle2-input: payload chunk size: 0
+  bundle2-input: part header size: 16
+  bundle2-input: part type: "test:song"
+  bundle2-input: part id: "2"
+  bundle2-input: part parameters: 0
+  bundle2-input: found a handler for part 'test:song'
   The choir starts singing:
-  payload chunk size: 178
-  payload chunk size: 0
+  bundle2-input: payload chunk size: 178
+  bundle2-input: payload chunk size: 0
       Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
       Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
       Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
-  part header size: 22
-  part type: "test:debugreply"
-  part id: "3"
-  part parameters: 0
-  found a handler for part 'test:debugreply'
+  bundle2-input: part header size: 22
+  bundle2-input: part type: "test:debugreply"
+  bundle2-input: part id: "3"
+  bundle2-input: part parameters: 0
+  bundle2-input: found a handler for part 'test:debugreply'
   debugreply: no reply
-  payload chunk size: 0
-  part header size: 43
-  part type: "test:math"
-  part id: "4"
-  part parameters: 3
-  ignoring unsupported advisory part test:math
-  payload chunk size: 2
-  payload chunk size: 0
-  part header size: 29
-  part type: "test:song"
-  part id: "5"
-  part parameters: 1
-  found a handler for part 'test:song'
-  ignoring unsupported advisory part test:song - randomparam
-  payload chunk size: 0
-  part header size: 16
-  part type: "test:ping"
-  part id: "6"
-  part parameters: 0
-  found a handler for part 'test:ping'
+  bundle2-input: payload chunk size: 0
+  bundle2-input: part header size: 43
+  bundle2-input: part type: "test:math"
+  bundle2-input: part id: "4"
+  bundle2-input: part parameters: 3
+  bundle2-input: ignoring unsupported advisory part test:math
+  bundle2-input: payload chunk size: 2
+  bundle2-input: payload chunk size: 0
+  bundle2-input: part header size: 29
+  bundle2-input: part type: "test:song"
+  bundle2-input: part id: "5"
+  bundle2-input: part parameters: 1
+  bundle2-input: found a handler for part 'test:song'
+  bundle2-input: ignoring unsupported advisory part test:song - randomparam
+  bundle2-input: payload chunk size: 0
+  bundle2-input: part header size: 16
+  bundle2-input: part type: "test:ping"
+  bundle2-input: part id: "6"
+  bundle2-input: part parameters: 0
+  bundle2-input: found a handler for part 'test:ping'
   received ping request (id 6)
-  payload chunk size: 0
-  part header size: 0
-  end of bundle2 stream
+  bundle2-input: payload chunk size: 0
+  bundle2-input: part header size: 0
+  bundle2-input: end of bundle2 stream
   0 unread bytes
   3 total verses sung
 
 Unbundle with an unknown mandatory part
 (should abort)