Patchwork [1,of,6,main-line-of-works,(22,more,patches,to,go)] ] bundle2: add generic debug output regarding processed bundle

login
register
mail settings
Submitter Pierre-Yves David
Date May 28, 2015, 7:54 p.m.
Message ID <3607f75c806f20979b3d.1432842858@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/9334/
State Accepted
Headers show

Comments

Pierre-Yves David - May 28, 2015, 7:54 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1432710035 25200
#      Wed May 27 00:00:35 2015 -0700
# Node ID 3607f75c806f20979b3daeae9040ba5bd4ca4e9c
# Parent  894b5a04697d5f129ff1b73cd2ca689169b8e497
bundle2: add generic debug output regarding processed bundle

If we are about to hide the detailed debug output, we need some generic debug
message to replace it in a concise way.

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -316,10 +316,20 @@  def processbundle(repo, unbundler, trans
         op = bundleoperation(repo, transactiongetter)
     # todo:
     # - replace this is a init function soon.
     # - exception catching
     unbundler.params
+    if repo.ui.debugflag:
+        msg = ['bundle2-input-bundle:']
+        if unbundler.params:
+            msg.append(' %i params')
+        if op.gettransaction is None:
+            msg.append(' no-transaction')
+        else:
+            msg.append(' with-transaction')
+        msg.append('\n')
+        repo.ui.debug(''.join(msg))
     iterparts = unbundler.iterparts()
     part = None
     try:
         for part in iterparts:
             _processpart(op, part)
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
@@ -548,10 +548,11 @@  Test actual unbundling of test part
 Process the bundle
 
   $ hg unbundle2 --debug --config progress.debug=true < ../parts.hg2
   bundle2-input: start processing of HG20 stream
   bundle2-input: reading bundle2 stream parameters
+  bundle2-input-bundle: with-transaction
   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