##// END OF EJS Templates
bundle2: add ability to write to a file to the test...
Pierre-Yves David -
r20841:cff562fe default
parent child Browse files
Show More
@@ -17,8 +17,8 b' Create an extension to test bundle2 API'
17 17 >
18 18 > @command('bundle2',
19 19 > [('', 'param', [], 'stream level parameter'),],
20 > '')
21 > def cmdbundle2(ui, repo, **opts):
20 > '[OUTPUTFILE]')
21 > def cmdbundle2(ui, repo, path=None, **opts):
22 22 > """write a bundle2 container on standard ouput"""
23 23 > bundler = bundle2.bundle20()
24 24 > for p in opts['param']:
@@ -28,8 +28,13 b' Create an extension to test bundle2 API'
28 28 > except ValueError, exc:
29 29 > raise util.Abort('%s' % exc)
30 30 >
31 > if path is None:
32 > file = sys.stdout
33 > else:
34 > file = open(path, 'w')
35 >
31 36 > for chunk in bundler.getchunks():
32 > ui.write(chunk)
37 > file.write(chunk)
33 38 >
34 39 > @command('unbundle2', [], '')
35 40 > def cmdunbundle2(ui, repo):
@@ -154,6 +159,17 b' Test unbundling'
154 159 - simple
155 160 parts count: 0
156 161
162 Test debug output
163 ---------------------------------------------------
164 (no debug output yet)
165
166 $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2
167
168 file content is ok
169
170 $ cat ../out.hg2
171 HG20\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
172
157 173 Test buggy input
158 174 ---------------------------------------------------
159 175
General Comments 0
You need to be logged in to leave comments. Login now