[PATCH 2 of 6] bundle2: rename unbundle2 test command to statbundle2

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Tue Apr 1 14:35:23 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1395685620 25200
#      Mon Mar 24 11:27:00 2014 -0700
# Node ID aa2c8feacdf701b95c8e6ca88d5a41e6ee26456f
# Parent  831918d356d52dc62a97e4675a7eefef581f6b90
bundle2: rename unbundle2 test command to statbundle2

We will introduce object to actually process the bundle, we need to keep the
simplistic unbundle around for the test.

diff --git a/tests/test-bundle2.t b/tests/test-bundle2.t
--- a/tests/test-bundle2.t
+++ b/tests/test-bundle2.t
@@ -54,13 +54,13 @@ Create an extension to test bundle2 API
   >         file = open(path, 'w')
   > 
   >     for chunk in bundler.getchunks():
   >         file.write(chunk)
   > 
-  > @command('unbundle2', [], '')
-  > def cmdunbundle2(ui, repo):
-  >     """read a bundle2 container from standard input"""
+  > @command('statbundle2', [], '')
+  > def cmdstatbundle2(ui, repo):
+  >     """print statistic on the bundle2 container read from stdin"""
   >     unbundler = bundle2.unbundle20(ui, sys.stdin)
   >     try:
   >         params = unbundler.params
   >     except KeyError, exc:
   >        raise util.Abort('unknown parameters: %s' % exc)
@@ -103,19 +103,19 @@ Test bundling
   $ hg bundle2
   HG20\x00\x00\x00\x00 (no-eol) (esc)
 
 Test unbundling
 
-  $ hg bundle2 | hg unbundle2
+  $ hg bundle2 | hg statbundle2
   options count: 0
   parts count:   0
 
 Test old style bundle are detected and refused
 
   $ hg bundle --all ../bundle.hg
   1 changesets found
-  $ hg unbundle2 < ../bundle.hg
+  $ hg statbundle2 < ../bundle.hg
   abort: unknown bundle version 10
   [255]
 
 Test parameters
 =================
@@ -133,11 +133,11 @@ Test generation simple option
   $ hg bundle2 --param 'caution'
   HG20\x00\x07caution\x00\x00 (no-eol) (esc)
 
 Test unbundling
 
-  $ hg bundle2 --param 'caution' | hg unbundle2
+  $ hg bundle2 --param 'caution' | hg statbundle2
   options count: 1
   - caution
   parts count:   0
 
 Test generation multiple option
@@ -145,11 +145,11 @@ Test generation multiple option
   $ hg bundle2 --param 'caution' --param 'meal'
   HG20\x00\x0ccaution meal\x00\x00 (no-eol) (esc)
 
 Test unbundling
 
-  $ hg bundle2 --param 'caution' --param 'meal' | hg unbundle2
+  $ hg bundle2 --param 'caution' --param 'meal' | hg statbundle2
   options count: 2
   - caution
   - meal
   parts count:   0
 
@@ -161,11 +161,11 @@ Test generation
   $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants'
   HG20\x00\x1ccaution meal=vegan elephants\x00\x00 (no-eol) (esc)
 
 Test unbundling
 
-  $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | hg unbundle2
+  $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | hg statbundle2
   options count: 3
   - caution
   - elephants
   - meal
       vegan
@@ -179,21 +179,21 @@ Test generation
   $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple
   HG20\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
 
 Test unbundling
 
-  $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | hg unbundle2
+  $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | hg statbundle2
   options count: 2
   - e|! 7/
       babar%#==tutu
   - simple
   parts count:   0
 
 Test unknown mandatory option
 ---------------------------------------------------
 
-  $ hg bundle2 --param 'Gravity' | hg unbundle2
+  $ hg bundle2 --param 'Gravity' | hg statbundle2
   abort: unknown parameters: 'Gravity'
   [255]
 
 Test debug output
 ---------------------------------------------------
@@ -211,11 +211,11 @@ file content is ok
   $ cat ../out.hg2
   HG20\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
 
 unbundling debug
 
-  $ hg unbundle2 --debug < ../out.hg2
+  $ hg statbundle2 --debug < ../out.hg2
   start processing of HG20 stream
   reading bundle2 stream parameters
   ignoring unknown parameter 'e|! 7/'
   ignoring unknown parameter 'simple'
   options count: 2
@@ -263,11 +263,11 @@ Test part
   test:empty\x00\x00\x00\x00\x00\x00\x00\x0c	test:song\x00\x00\x00\x00\x00\xb2Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko (esc)
   Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
   Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.\x00\x00\x00\x00\x00'	test:math\x02\x01\x02\x04\x01\x04\x07\x03pi3.14e2.72cookingraw\x00\x00\x00\x0242\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
 
 
-  $ hg unbundle2 < ../parts.hg2
+  $ hg statbundle2 < ../parts.hg2
   options count: 0
   parts count:   4
     :test:empty:
       mandatory: 0
       advisory: 0
@@ -283,11 +283,11 @@ Test part
     :test:math:
       mandatory: 2
       advisory: 1
       payload: 2 bytes
 
-  $ hg unbundle2 --debug < ../parts.hg2
+  $ hg statbundle2 --debug < ../parts.hg2
   start processing of HG20 stream
   reading bundle2 stream parameters
   options count: 0
   start extraction of bundle2 parts
   part header size: 13


More information about the Mercurial-devel mailing list