##// END OF EJS Templates
bundle2: use a smarter template for test...
Pierre-Yves David -
r21647:1a6909f4 default
parent child Browse files
Show More
@@ -1,1121 +1,1051 b''
1
1
2 Create an extension to test bundle2 API
2 Create an extension to test bundle2 API
3
3
4 $ cat > bundle2.py << EOF
4 $ cat > bundle2.py << EOF
5 > """A small extension to test bundle2 implementation
5 > """A small extension to test bundle2 implementation
6 >
6 >
7 > Current bundle2 implementation is far too limited to be used in any core
7 > Current bundle2 implementation is far too limited to be used in any core
8 > code. We still need to be able to test it while it grow up.
8 > code. We still need to be able to test it while it grow up.
9 > """
9 > """
10 >
10 >
11 > try:
11 > try:
12 > import msvcrt
12 > import msvcrt
13 > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
13 > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
14 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
14 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
15 > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
15 > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
16 > except ImportError:
16 > except ImportError:
17 > pass
17 > pass
18 >
18 >
19 > import sys
19 > import sys
20 > from mercurial import cmdutil
20 > from mercurial import cmdutil
21 > from mercurial import util
21 > from mercurial import util
22 > from mercurial import bundle2
22 > from mercurial import bundle2
23 > from mercurial import scmutil
23 > from mercurial import scmutil
24 > from mercurial import discovery
24 > from mercurial import discovery
25 > from mercurial import changegroup
25 > from mercurial import changegroup
26 > from mercurial import error
26 > from mercurial import error
27 > cmdtable = {}
27 > cmdtable = {}
28 > command = cmdutil.command(cmdtable)
28 > command = cmdutil.command(cmdtable)
29 >
29 >
30 > ELEPHANTSSONG = """Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
30 > ELEPHANTSSONG = """Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
31 > Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
31 > Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
32 > Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko."""
32 > Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko."""
33 > assert len(ELEPHANTSSONG) == 178 # future test say 178 bytes, trust it.
33 > assert len(ELEPHANTSSONG) == 178 # future test say 178 bytes, trust it.
34 >
34 >
35 > @bundle2.parthandler('test:song')
35 > @bundle2.parthandler('test:song')
36 > def songhandler(op, part):
36 > def songhandler(op, part):
37 > """handle a "test:song" bundle2 part, printing the lyrics on stdin"""
37 > """handle a "test:song" bundle2 part, printing the lyrics on stdin"""
38 > op.ui.write('The choir starts singing:\n')
38 > op.ui.write('The choir starts singing:\n')
39 > verses = 0
39 > verses = 0
40 > for line in part.read().split('\n'):
40 > for line in part.read().split('\n'):
41 > op.ui.write(' %s\n' % line)
41 > op.ui.write(' %s\n' % line)
42 > verses += 1
42 > verses += 1
43 > op.records.add('song', {'verses': verses})
43 > op.records.add('song', {'verses': verses})
44 >
44 >
45 > @bundle2.parthandler('test:ping')
45 > @bundle2.parthandler('test:ping')
46 > def pinghandler(op, part):
46 > def pinghandler(op, part):
47 > op.ui.write('received ping request (id %i)\n' % part.id)
47 > op.ui.write('received ping request (id %i)\n' % part.id)
48 > if op.reply is not None and 'ping-pong' in op.reply.capabilities:
48 > if op.reply is not None and 'ping-pong' in op.reply.capabilities:
49 > op.ui.write_err('replying to ping request (id %i)\n' % part.id)
49 > op.ui.write_err('replying to ping request (id %i)\n' % part.id)
50 > op.reply.newpart('test:pong', [('in-reply-to', str(part.id))])
50 > op.reply.newpart('test:pong', [('in-reply-to', str(part.id))])
51 >
51 >
52 > @bundle2.parthandler('test:debugreply')
52 > @bundle2.parthandler('test:debugreply')
53 > def debugreply(op, part):
53 > def debugreply(op, part):
54 > """print data about the capacity of the bundle reply"""
54 > """print data about the capacity of the bundle reply"""
55 > if op.reply is None:
55 > if op.reply is None:
56 > op.ui.write('debugreply: no reply\n')
56 > op.ui.write('debugreply: no reply\n')
57 > else:
57 > else:
58 > op.ui.write('debugreply: capabilities:\n')
58 > op.ui.write('debugreply: capabilities:\n')
59 > for cap in sorted(op.reply.capabilities):
59 > for cap in sorted(op.reply.capabilities):
60 > op.ui.write('debugreply: %r\n' % cap)
60 > op.ui.write('debugreply: %r\n' % cap)
61 > for val in op.reply.capabilities[cap]:
61 > for val in op.reply.capabilities[cap]:
62 > op.ui.write('debugreply: %r\n' % val)
62 > op.ui.write('debugreply: %r\n' % val)
63 >
63 >
64 > @command('bundle2',
64 > @command('bundle2',
65 > [('', 'param', [], 'stream level parameter'),
65 > [('', 'param', [], 'stream level parameter'),
66 > ('', 'unknown', False, 'include an unknown mandatory part in the bundle'),
66 > ('', 'unknown', False, 'include an unknown mandatory part in the bundle'),
67 > ('', 'unknownparams', False, 'include an unknown part parameters in the bundle'),
67 > ('', 'unknownparams', False, 'include an unknown part parameters in the bundle'),
68 > ('', 'parts', False, 'include some arbitrary parts to the bundle'),
68 > ('', 'parts', False, 'include some arbitrary parts to the bundle'),
69 > ('', 'reply', False, 'produce a reply bundle'),
69 > ('', 'reply', False, 'produce a reply bundle'),
70 > ('', 'pushrace', False, 'includes a check:head part with unknown nodes'),
70 > ('', 'pushrace', False, 'includes a check:head part with unknown nodes'),
71 > ('r', 'rev', [], 'includes those changeset in the bundle'),],
71 > ('r', 'rev', [], 'includes those changeset in the bundle'),],
72 > '[OUTPUTFILE]')
72 > '[OUTPUTFILE]')
73 > def cmdbundle2(ui, repo, path=None, **opts):
73 > def cmdbundle2(ui, repo, path=None, **opts):
74 > """write a bundle2 container on standard ouput"""
74 > """write a bundle2 container on standard ouput"""
75 > bundler = bundle2.bundle20(ui)
75 > bundler = bundle2.bundle20(ui)
76 > for p in opts['param']:
76 > for p in opts['param']:
77 > p = p.split('=', 1)
77 > p = p.split('=', 1)
78 > try:
78 > try:
79 > bundler.addparam(*p)
79 > bundler.addparam(*p)
80 > except ValueError, exc:
80 > except ValueError, exc:
81 > raise util.Abort('%s' % exc)
81 > raise util.Abort('%s' % exc)
82 >
82 >
83 > if opts['reply']:
83 > if opts['reply']:
84 > capsstring = 'ping-pong\nelephants=babar,celeste\ncity%3D%21=celeste%2Cville'
84 > capsstring = 'ping-pong\nelephants=babar,celeste\ncity%3D%21=celeste%2Cville'
85 > bundler.newpart('b2x:replycaps', data=capsstring)
85 > bundler.newpart('b2x:replycaps', data=capsstring)
86 >
86 >
87 > if opts['pushrace']:
87 > if opts['pushrace']:
88 > # also serve to test the assignement of data outside of init
88 > # also serve to test the assignement of data outside of init
89 > part = bundler.newpart('b2x:check:heads')
89 > part = bundler.newpart('b2x:check:heads')
90 > part.data = '01234567890123456789'
90 > part.data = '01234567890123456789'
91 >
91 >
92 > revs = opts['rev']
92 > revs = opts['rev']
93 > if 'rev' in opts:
93 > if 'rev' in opts:
94 > revs = scmutil.revrange(repo, opts['rev'])
94 > revs = scmutil.revrange(repo, opts['rev'])
95 > if revs:
95 > if revs:
96 > # very crude version of a changegroup part creation
96 > # very crude version of a changegroup part creation
97 > bundled = repo.revs('%ld::%ld', revs, revs)
97 > bundled = repo.revs('%ld::%ld', revs, revs)
98 > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)]
98 > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)]
99 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
99 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
100 > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
100 > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
101 > cg = changegroup.getlocalbundle(repo, 'test:bundle2', outgoing, None)
101 > cg = changegroup.getlocalbundle(repo, 'test:bundle2', outgoing, None)
102 > bundler.newpart('b2x:changegroup', data=cg.getchunks())
102 > bundler.newpart('b2x:changegroup', data=cg.getchunks())
103 >
103 >
104 > if opts['parts']:
104 > if opts['parts']:
105 > bundler.newpart('test:empty')
105 > bundler.newpart('test:empty')
106 > # add a second one to make sure we handle multiple parts
106 > # add a second one to make sure we handle multiple parts
107 > bundler.newpart('test:empty')
107 > bundler.newpart('test:empty')
108 > bundler.newpart('test:song', data=ELEPHANTSSONG)
108 > bundler.newpart('test:song', data=ELEPHANTSSONG)
109 > bundler.newpart('test:debugreply')
109 > bundler.newpart('test:debugreply')
110 > mathpart = bundler.newpart('test:math')
110 > mathpart = bundler.newpart('test:math')
111 > mathpart.addparam('pi', '3.14')
111 > mathpart.addparam('pi', '3.14')
112 > mathpart.addparam('e', '2.72')
112 > mathpart.addparam('e', '2.72')
113 > mathpart.addparam('cooking', 'raw', mandatory=False)
113 > mathpart.addparam('cooking', 'raw', mandatory=False)
114 > mathpart.data = '42'
114 > mathpart.data = '42'
115 > # advisory known part with unknown mandatory param
115 > # advisory known part with unknown mandatory param
116 > bundler.newpart('test:song', [('randomparam','')])
116 > bundler.newpart('test:song', [('randomparam','')])
117 > if opts['unknown']:
117 > if opts['unknown']:
118 > bundler.newpart('test:UNKNOWN', data='some random content')
118 > bundler.newpart('test:UNKNOWN', data='some random content')
119 > if opts['unknownparams']:
119 > if opts['unknownparams']:
120 > bundler.newpart('test:SONG', [('randomparams', '')])
120 > bundler.newpart('test:SONG', [('randomparams', '')])
121 > if opts['parts']:
121 > if opts['parts']:
122 > bundler.newpart('test:ping')
122 > bundler.newpart('test:ping')
123 >
123 >
124 > if path is None:
124 > if path is None:
125 > file = sys.stdout
125 > file = sys.stdout
126 > else:
126 > else:
127 > file = open(path, 'w')
127 > file = open(path, 'w')
128 >
128 >
129 > for chunk in bundler.getchunks():
129 > for chunk in bundler.getchunks():
130 > file.write(chunk)
130 > file.write(chunk)
131 >
131 >
132 > @command('unbundle2', [], '')
132 > @command('unbundle2', [], '')
133 > def cmdunbundle2(ui, repo, replypath=None):
133 > def cmdunbundle2(ui, repo, replypath=None):
134 > """process a bundle2 stream from stdin on the current repo"""
134 > """process a bundle2 stream from stdin on the current repo"""
135 > try:
135 > try:
136 > tr = None
136 > tr = None
137 > lock = repo.lock()
137 > lock = repo.lock()
138 > tr = repo.transaction('processbundle')
138 > tr = repo.transaction('processbundle')
139 > try:
139 > try:
140 > unbundler = bundle2.unbundle20(ui, sys.stdin)
140 > unbundler = bundle2.unbundle20(ui, sys.stdin)
141 > op = bundle2.processbundle(repo, unbundler, lambda: tr)
141 > op = bundle2.processbundle(repo, unbundler, lambda: tr)
142 > tr.close()
142 > tr.close()
143 > except error.BundleValueError, exc:
143 > except error.BundleValueError, exc:
144 > raise util.Abort('missing support for %s' % exc)
144 > raise util.Abort('missing support for %s' % exc)
145 > except error.PushRaced, exc:
145 > except error.PushRaced, exc:
146 > raise util.Abort('push race: %s' % exc)
146 > raise util.Abort('push race: %s' % exc)
147 > finally:
147 > finally:
148 > if tr is not None:
148 > if tr is not None:
149 > tr.release()
149 > tr.release()
150 > lock.release()
150 > lock.release()
151 > remains = sys.stdin.read()
151 > remains = sys.stdin.read()
152 > ui.write('%i unread bytes\n' % len(remains))
152 > ui.write('%i unread bytes\n' % len(remains))
153 > if op.records['song']:
153 > if op.records['song']:
154 > totalverses = sum(r['verses'] for r in op.records['song'])
154 > totalverses = sum(r['verses'] for r in op.records['song'])
155 > ui.write('%i total verses sung\n' % totalverses)
155 > ui.write('%i total verses sung\n' % totalverses)
156 > for rec in op.records['changegroup']:
156 > for rec in op.records['changegroup']:
157 > ui.write('addchangegroup return: %i\n' % rec['return'])
157 > ui.write('addchangegroup return: %i\n' % rec['return'])
158 > if op.reply is not None and replypath is not None:
158 > if op.reply is not None and replypath is not None:
159 > file = open(replypath, 'w')
159 > file = open(replypath, 'w')
160 > for chunk in op.reply.getchunks():
160 > for chunk in op.reply.getchunks():
161 > file.write(chunk)
161 > file.write(chunk)
162 >
162 >
163 > @command('statbundle2', [], '')
163 > @command('statbundle2', [], '')
164 > def cmdstatbundle2(ui, repo):
164 > def cmdstatbundle2(ui, repo):
165 > """print statistic on the bundle2 container read from stdin"""
165 > """print statistic on the bundle2 container read from stdin"""
166 > unbundler = bundle2.unbundle20(ui, sys.stdin)
166 > unbundler = bundle2.unbundle20(ui, sys.stdin)
167 > try:
167 > try:
168 > params = unbundler.params
168 > params = unbundler.params
169 > except error.BundleValueError, exc:
169 > except error.BundleValueError, exc:
170 > raise util.Abort('unknown parameters: %s' % exc)
170 > raise util.Abort('unknown parameters: %s' % exc)
171 > ui.write('options count: %i\n' % len(params))
171 > ui.write('options count: %i\n' % len(params))
172 > for key in sorted(params):
172 > for key in sorted(params):
173 > ui.write('- %s\n' % key)
173 > ui.write('- %s\n' % key)
174 > value = params[key]
174 > value = params[key]
175 > if value is not None:
175 > if value is not None:
176 > ui.write(' %s\n' % value)
176 > ui.write(' %s\n' % value)
177 > count = 0
177 > count = 0
178 > for p in unbundler.iterparts():
178 > for p in unbundler.iterparts():
179 > count += 1
179 > count += 1
180 > ui.write(' :%s:\n' % p.type)
180 > ui.write(' :%s:\n' % p.type)
181 > ui.write(' mandatory: %i\n' % len(p.mandatoryparams))
181 > ui.write(' mandatory: %i\n' % len(p.mandatoryparams))
182 > ui.write(' advisory: %i\n' % len(p.advisoryparams))
182 > ui.write(' advisory: %i\n' % len(p.advisoryparams))
183 > ui.write(' payload: %i bytes\n' % len(p.read()))
183 > ui.write(' payload: %i bytes\n' % len(p.read()))
184 > ui.write('parts count: %i\n' % count)
184 > ui.write('parts count: %i\n' % count)
185 > EOF
185 > EOF
186 $ cat >> $HGRCPATH << EOF
186 $ cat >> $HGRCPATH << EOF
187 > [extensions]
187 > [extensions]
188 > bundle2=$TESTTMP/bundle2.py
188 > bundle2=$TESTTMP/bundle2.py
189 > [experimental]
189 > [experimental]
190 > bundle2-exp=True
190 > bundle2-exp=True
191 > [ui]
191 > [ui]
192 > ssh=python "$TESTDIR/dummyssh"
192 > ssh=python "$TESTDIR/dummyssh"
193 > logtemplate={rev}:{node|short} {phase} {author} {desc|firstline}
193 > [web]
194 > [web]
194 > push_ssl = false
195 > push_ssl = false
195 > allow_push = *
196 > allow_push = *
196 > EOF
197 > EOF
197
198
198 The extension requires a repo (currently unused)
199 The extension requires a repo (currently unused)
199
200
200 $ hg init main
201 $ hg init main
201 $ cd main
202 $ cd main
202 $ touch a
203 $ touch a
203 $ hg add a
204 $ hg add a
204 $ hg commit -m 'a'
205 $ hg commit -m 'a'
205
206
206
207
207 Empty bundle
208 Empty bundle
208 =================
209 =================
209
210
210 - no option
211 - no option
211 - no parts
212 - no parts
212
213
213 Test bundling
214 Test bundling
214
215
215 $ hg bundle2
216 $ hg bundle2
216 HG2X\x00\x00\x00\x00 (no-eol) (esc)
217 HG2X\x00\x00\x00\x00 (no-eol) (esc)
217
218
218 Test unbundling
219 Test unbundling
219
220
220 $ hg bundle2 | hg statbundle2
221 $ hg bundle2 | hg statbundle2
221 options count: 0
222 options count: 0
222 parts count: 0
223 parts count: 0
223
224
224 Test old style bundle are detected and refused
225 Test old style bundle are detected and refused
225
226
226 $ hg bundle --all ../bundle.hg
227 $ hg bundle --all ../bundle.hg
227 1 changesets found
228 1 changesets found
228 $ hg statbundle2 < ../bundle.hg
229 $ hg statbundle2 < ../bundle.hg
229 abort: unknown bundle version 10
230 abort: unknown bundle version 10
230 [255]
231 [255]
231
232
232 Test parameters
233 Test parameters
233 =================
234 =================
234
235
235 - some options
236 - some options
236 - no parts
237 - no parts
237
238
238 advisory parameters, no value
239 advisory parameters, no value
239 -------------------------------
240 -------------------------------
240
241
241 Simplest possible parameters form
242 Simplest possible parameters form
242
243
243 Test generation simple option
244 Test generation simple option
244
245
245 $ hg bundle2 --param 'caution'
246 $ hg bundle2 --param 'caution'
246 HG2X\x00\x07caution\x00\x00 (no-eol) (esc)
247 HG2X\x00\x07caution\x00\x00 (no-eol) (esc)
247
248
248 Test unbundling
249 Test unbundling
249
250
250 $ hg bundle2 --param 'caution' | hg statbundle2
251 $ hg bundle2 --param 'caution' | hg statbundle2
251 options count: 1
252 options count: 1
252 - caution
253 - caution
253 parts count: 0
254 parts count: 0
254
255
255 Test generation multiple option
256 Test generation multiple option
256
257
257 $ hg bundle2 --param 'caution' --param 'meal'
258 $ hg bundle2 --param 'caution' --param 'meal'
258 HG2X\x00\x0ccaution meal\x00\x00 (no-eol) (esc)
259 HG2X\x00\x0ccaution meal\x00\x00 (no-eol) (esc)
259
260
260 Test unbundling
261 Test unbundling
261
262
262 $ hg bundle2 --param 'caution' --param 'meal' | hg statbundle2
263 $ hg bundle2 --param 'caution' --param 'meal' | hg statbundle2
263 options count: 2
264 options count: 2
264 - caution
265 - caution
265 - meal
266 - meal
266 parts count: 0
267 parts count: 0
267
268
268 advisory parameters, with value
269 advisory parameters, with value
269 -------------------------------
270 -------------------------------
270
271
271 Test generation
272 Test generation
272
273
273 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants'
274 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants'
274 HG2X\x00\x1ccaution meal=vegan elephants\x00\x00 (no-eol) (esc)
275 HG2X\x00\x1ccaution meal=vegan elephants\x00\x00 (no-eol) (esc)
275
276
276 Test unbundling
277 Test unbundling
277
278
278 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | hg statbundle2
279 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | hg statbundle2
279 options count: 3
280 options count: 3
280 - caution
281 - caution
281 - elephants
282 - elephants
282 - meal
283 - meal
283 vegan
284 vegan
284 parts count: 0
285 parts count: 0
285
286
286 parameter with special char in value
287 parameter with special char in value
287 ---------------------------------------------------
288 ---------------------------------------------------
288
289
289 Test generation
290 Test generation
290
291
291 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple
292 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple
292 HG2X\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
293 HG2X\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
293
294
294 Test unbundling
295 Test unbundling
295
296
296 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | hg statbundle2
297 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | hg statbundle2
297 options count: 2
298 options count: 2
298 - e|! 7/
299 - e|! 7/
299 babar%#==tutu
300 babar%#==tutu
300 - simple
301 - simple
301 parts count: 0
302 parts count: 0
302
303
303 Test unknown mandatory option
304 Test unknown mandatory option
304 ---------------------------------------------------
305 ---------------------------------------------------
305
306
306 $ hg bundle2 --param 'Gravity' | hg statbundle2
307 $ hg bundle2 --param 'Gravity' | hg statbundle2
307 abort: unknown parameters: Stream Parameter - Gravity
308 abort: unknown parameters: Stream Parameter - Gravity
308 [255]
309 [255]
309
310
310 Test debug output
311 Test debug output
311 ---------------------------------------------------
312 ---------------------------------------------------
312
313
313 bundling debug
314 bundling debug
314
315
315 $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2
316 $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2
316 start emission of HG2X stream
317 start emission of HG2X stream
317 bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple
318 bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple
318 start of parts
319 start of parts
319 end of bundle
320 end of bundle
320
321
321 file content is ok
322 file content is ok
322
323
323 $ cat ../out.hg2
324 $ cat ../out.hg2
324 HG2X\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
325 HG2X\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
325
326
326 unbundling debug
327 unbundling debug
327
328
328 $ hg statbundle2 --debug < ../out.hg2
329 $ hg statbundle2 --debug < ../out.hg2
329 start processing of HG2X stream
330 start processing of HG2X stream
330 reading bundle2 stream parameters
331 reading bundle2 stream parameters
331 ignoring unknown parameter 'e|! 7/'
332 ignoring unknown parameter 'e|! 7/'
332 ignoring unknown parameter 'simple'
333 ignoring unknown parameter 'simple'
333 options count: 2
334 options count: 2
334 - e|! 7/
335 - e|! 7/
335 babar%#==tutu
336 babar%#==tutu
336 - simple
337 - simple
337 start extraction of bundle2 parts
338 start extraction of bundle2 parts
338 part header size: 0
339 part header size: 0
339 end of bundle2 stream
340 end of bundle2 stream
340 parts count: 0
341 parts count: 0
341
342
342
343
343 Test buggy input
344 Test buggy input
344 ---------------------------------------------------
345 ---------------------------------------------------
345
346
346 empty parameter name
347 empty parameter name
347
348
348 $ hg bundle2 --param '' --quiet
349 $ hg bundle2 --param '' --quiet
349 abort: empty parameter name
350 abort: empty parameter name
350 [255]
351 [255]
351
352
352 bad parameter name
353 bad parameter name
353
354
354 $ hg bundle2 --param 42babar
355 $ hg bundle2 --param 42babar
355 abort: non letter first character: '42babar'
356 abort: non letter first character: '42babar'
356 [255]
357 [255]
357
358
358
359
359 Test part
360 Test part
360 =================
361 =================
361
362
362 $ hg bundle2 --parts ../parts.hg2 --debug
363 $ hg bundle2 --parts ../parts.hg2 --debug
363 start emission of HG2X stream
364 start emission of HG2X stream
364 bundle parameter:
365 bundle parameter:
365 start of parts
366 start of parts
366 bundle part: "test:empty"
367 bundle part: "test:empty"
367 bundle part: "test:empty"
368 bundle part: "test:empty"
368 bundle part: "test:song"
369 bundle part: "test:song"
369 bundle part: "test:debugreply"
370 bundle part: "test:debugreply"
370 bundle part: "test:math"
371 bundle part: "test:math"
371 bundle part: "test:song"
372 bundle part: "test:song"
372 bundle part: "test:ping"
373 bundle part: "test:ping"
373 end of bundle
374 end of bundle
374
375
375 $ cat ../parts.hg2
376 $ cat ../parts.hg2
376 HG2X\x00\x00\x00\x11 (esc)
377 HG2X\x00\x00\x00\x11 (esc)
377 test:empty\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
378 test:empty\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
378 test:empty\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x10 test:song\x00\x00\x00\x02\x00\x00\x00\x00\x00\xb2Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko (esc)
379 test:empty\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x10 test:song\x00\x00\x00\x02\x00\x00\x00\x00\x00\xb2Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko (esc)
379 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
380 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
380 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.\x00\x00\x00\x00\x00\x16\x0ftest:debugreply\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00+ test:math\x00\x00\x00\x04\x02\x01\x02\x04\x01\x04\x07\x03pi3.14e2.72cookingraw\x00\x00\x00\x0242\x00\x00\x00\x00\x00\x1d test:song\x00\x00\x00\x05\x01\x00\x0b\x00randomparam\x00\x00\x00\x00\x00\x10 test:ping\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
381 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.\x00\x00\x00\x00\x00\x16\x0ftest:debugreply\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00+ test:math\x00\x00\x00\x04\x02\x01\x02\x04\x01\x04\x07\x03pi3.14e2.72cookingraw\x00\x00\x00\x0242\x00\x00\x00\x00\x00\x1d test:song\x00\x00\x00\x05\x01\x00\x0b\x00randomparam\x00\x00\x00\x00\x00\x10 test:ping\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
381
382
382
383
383 $ hg statbundle2 < ../parts.hg2
384 $ hg statbundle2 < ../parts.hg2
384 options count: 0
385 options count: 0
385 :test:empty:
386 :test:empty:
386 mandatory: 0
387 mandatory: 0
387 advisory: 0
388 advisory: 0
388 payload: 0 bytes
389 payload: 0 bytes
389 :test:empty:
390 :test:empty:
390 mandatory: 0
391 mandatory: 0
391 advisory: 0
392 advisory: 0
392 payload: 0 bytes
393 payload: 0 bytes
393 :test:song:
394 :test:song:
394 mandatory: 0
395 mandatory: 0
395 advisory: 0
396 advisory: 0
396 payload: 178 bytes
397 payload: 178 bytes
397 :test:debugreply:
398 :test:debugreply:
398 mandatory: 0
399 mandatory: 0
399 advisory: 0
400 advisory: 0
400 payload: 0 bytes
401 payload: 0 bytes
401 :test:math:
402 :test:math:
402 mandatory: 2
403 mandatory: 2
403 advisory: 1
404 advisory: 1
404 payload: 2 bytes
405 payload: 2 bytes
405 :test:song:
406 :test:song:
406 mandatory: 1
407 mandatory: 1
407 advisory: 0
408 advisory: 0
408 payload: 0 bytes
409 payload: 0 bytes
409 :test:ping:
410 :test:ping:
410 mandatory: 0
411 mandatory: 0
411 advisory: 0
412 advisory: 0
412 payload: 0 bytes
413 payload: 0 bytes
413 parts count: 7
414 parts count: 7
414
415
415 $ hg statbundle2 --debug < ../parts.hg2
416 $ hg statbundle2 --debug < ../parts.hg2
416 start processing of HG2X stream
417 start processing of HG2X stream
417 reading bundle2 stream parameters
418 reading bundle2 stream parameters
418 options count: 0
419 options count: 0
419 start extraction of bundle2 parts
420 start extraction of bundle2 parts
420 part header size: 17
421 part header size: 17
421 part type: "test:empty"
422 part type: "test:empty"
422 part id: "0"
423 part id: "0"
423 part parameters: 0
424 part parameters: 0
424 :test:empty:
425 :test:empty:
425 mandatory: 0
426 mandatory: 0
426 advisory: 0
427 advisory: 0
427 payload chunk size: 0
428 payload chunk size: 0
428 payload: 0 bytes
429 payload: 0 bytes
429 part header size: 17
430 part header size: 17
430 part type: "test:empty"
431 part type: "test:empty"
431 part id: "1"
432 part id: "1"
432 part parameters: 0
433 part parameters: 0
433 :test:empty:
434 :test:empty:
434 mandatory: 0
435 mandatory: 0
435 advisory: 0
436 advisory: 0
436 payload chunk size: 0
437 payload chunk size: 0
437 payload: 0 bytes
438 payload: 0 bytes
438 part header size: 16
439 part header size: 16
439 part type: "test:song"
440 part type: "test:song"
440 part id: "2"
441 part id: "2"
441 part parameters: 0
442 part parameters: 0
442 :test:song:
443 :test:song:
443 mandatory: 0
444 mandatory: 0
444 advisory: 0
445 advisory: 0
445 payload chunk size: 178
446 payload chunk size: 178
446 payload chunk size: 0
447 payload chunk size: 0
447 payload: 178 bytes
448 payload: 178 bytes
448 part header size: 22
449 part header size: 22
449 part type: "test:debugreply"
450 part type: "test:debugreply"
450 part id: "3"
451 part id: "3"
451 part parameters: 0
452 part parameters: 0
452 :test:debugreply:
453 :test:debugreply:
453 mandatory: 0
454 mandatory: 0
454 advisory: 0
455 advisory: 0
455 payload chunk size: 0
456 payload chunk size: 0
456 payload: 0 bytes
457 payload: 0 bytes
457 part header size: 43
458 part header size: 43
458 part type: "test:math"
459 part type: "test:math"
459 part id: "4"
460 part id: "4"
460 part parameters: 3
461 part parameters: 3
461 :test:math:
462 :test:math:
462 mandatory: 2
463 mandatory: 2
463 advisory: 1
464 advisory: 1
464 payload chunk size: 2
465 payload chunk size: 2
465 payload chunk size: 0
466 payload chunk size: 0
466 payload: 2 bytes
467 payload: 2 bytes
467 part header size: 29
468 part header size: 29
468 part type: "test:song"
469 part type: "test:song"
469 part id: "5"
470 part id: "5"
470 part parameters: 1
471 part parameters: 1
471 :test:song:
472 :test:song:
472 mandatory: 1
473 mandatory: 1
473 advisory: 0
474 advisory: 0
474 payload chunk size: 0
475 payload chunk size: 0
475 payload: 0 bytes
476 payload: 0 bytes
476 part header size: 16
477 part header size: 16
477 part type: "test:ping"
478 part type: "test:ping"
478 part id: "6"
479 part id: "6"
479 part parameters: 0
480 part parameters: 0
480 :test:ping:
481 :test:ping:
481 mandatory: 0
482 mandatory: 0
482 advisory: 0
483 advisory: 0
483 payload chunk size: 0
484 payload chunk size: 0
484 payload: 0 bytes
485 payload: 0 bytes
485 part header size: 0
486 part header size: 0
486 end of bundle2 stream
487 end of bundle2 stream
487 parts count: 7
488 parts count: 7
488
489
489 Test actual unbundling of test part
490 Test actual unbundling of test part
490 =======================================
491 =======================================
491
492
492 Process the bundle
493 Process the bundle
493
494
494 $ hg unbundle2 --debug < ../parts.hg2
495 $ hg unbundle2 --debug < ../parts.hg2
495 start processing of HG2X stream
496 start processing of HG2X stream
496 reading bundle2 stream parameters
497 reading bundle2 stream parameters
497 start extraction of bundle2 parts
498 start extraction of bundle2 parts
498 part header size: 17
499 part header size: 17
499 part type: "test:empty"
500 part type: "test:empty"
500 part id: "0"
501 part id: "0"
501 part parameters: 0
502 part parameters: 0
502 ignoring unsupported advisory part test:empty
503 ignoring unsupported advisory part test:empty
503 payload chunk size: 0
504 payload chunk size: 0
504 part header size: 17
505 part header size: 17
505 part type: "test:empty"
506 part type: "test:empty"
506 part id: "1"
507 part id: "1"
507 part parameters: 0
508 part parameters: 0
508 ignoring unsupported advisory part test:empty
509 ignoring unsupported advisory part test:empty
509 payload chunk size: 0
510 payload chunk size: 0
510 part header size: 16
511 part header size: 16
511 part type: "test:song"
512 part type: "test:song"
512 part id: "2"
513 part id: "2"
513 part parameters: 0
514 part parameters: 0
514 found a handler for part 'test:song'
515 found a handler for part 'test:song'
515 The choir starts singing:
516 The choir starts singing:
516 payload chunk size: 178
517 payload chunk size: 178
517 payload chunk size: 0
518 payload chunk size: 0
518 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
519 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
519 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
520 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
520 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
521 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
521 part header size: 22
522 part header size: 22
522 part type: "test:debugreply"
523 part type: "test:debugreply"
523 part id: "3"
524 part id: "3"
524 part parameters: 0
525 part parameters: 0
525 found a handler for part 'test:debugreply'
526 found a handler for part 'test:debugreply'
526 debugreply: no reply
527 debugreply: no reply
527 payload chunk size: 0
528 payload chunk size: 0
528 part header size: 43
529 part header size: 43
529 part type: "test:math"
530 part type: "test:math"
530 part id: "4"
531 part id: "4"
531 part parameters: 3
532 part parameters: 3
532 ignoring unsupported advisory part test:math
533 ignoring unsupported advisory part test:math
533 payload chunk size: 2
534 payload chunk size: 2
534 payload chunk size: 0
535 payload chunk size: 0
535 part header size: 29
536 part header size: 29
536 part type: "test:song"
537 part type: "test:song"
537 part id: "5"
538 part id: "5"
538 part parameters: 1
539 part parameters: 1
539 found a handler for part 'test:song'
540 found a handler for part 'test:song'
540 ignoring unsupported advisory part test:song - randomparam
541 ignoring unsupported advisory part test:song - randomparam
541 payload chunk size: 0
542 payload chunk size: 0
542 part header size: 16
543 part header size: 16
543 part type: "test:ping"
544 part type: "test:ping"
544 part id: "6"
545 part id: "6"
545 part parameters: 0
546 part parameters: 0
546 found a handler for part 'test:ping'
547 found a handler for part 'test:ping'
547 received ping request (id 6)
548 received ping request (id 6)
548 payload chunk size: 0
549 payload chunk size: 0
549 part header size: 0
550 part header size: 0
550 end of bundle2 stream
551 end of bundle2 stream
551 0 unread bytes
552 0 unread bytes
552 3 total verses sung
553 3 total verses sung
553
554
554 Unbundle with an unknown mandatory part
555 Unbundle with an unknown mandatory part
555 (should abort)
556 (should abort)
556
557
557 $ hg bundle2 --parts --unknown ../unknown.hg2
558 $ hg bundle2 --parts --unknown ../unknown.hg2
558
559
559 $ hg unbundle2 < ../unknown.hg2
560 $ hg unbundle2 < ../unknown.hg2
560 The choir starts singing:
561 The choir starts singing:
561 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
562 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
562 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
563 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
563 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
564 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
564 debugreply: no reply
565 debugreply: no reply
565 0 unread bytes
566 0 unread bytes
566 abort: missing support for test:unknown
567 abort: missing support for test:unknown
567 [255]
568 [255]
568
569
569 Unbundle with an unknown mandatory part parameters
570 Unbundle with an unknown mandatory part parameters
570 (should abort)
571 (should abort)
571
572
572 $ hg bundle2 --unknownparams ../unknown.hg2
573 $ hg bundle2 --unknownparams ../unknown.hg2
573
574
574 $ hg unbundle2 < ../unknown.hg2
575 $ hg unbundle2 < ../unknown.hg2
575 0 unread bytes
576 0 unread bytes
576 abort: missing support for test:song - randomparams
577 abort: missing support for test:song - randomparams
577 [255]
578 [255]
578
579
579 unbundle with a reply
580 unbundle with a reply
580
581
581 $ hg bundle2 --parts --reply ../parts-reply.hg2
582 $ hg bundle2 --parts --reply ../parts-reply.hg2
582 $ hg unbundle2 ../reply.hg2 < ../parts-reply.hg2
583 $ hg unbundle2 ../reply.hg2 < ../parts-reply.hg2
583 0 unread bytes
584 0 unread bytes
584 3 total verses sung
585 3 total verses sung
585
586
586 The reply is a bundle
587 The reply is a bundle
587
588
588 $ cat ../reply.hg2
589 $ cat ../reply.hg2
589 HG2X\x00\x00\x00\x1f (esc)
590 HG2X\x00\x00\x00\x1f (esc)
590 b2x:output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc)
591 b2x:output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc)
591 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
592 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
592 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
593 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
593 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
594 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
594 \x00\x00\x00\x00\x00\x1f (esc)
595 \x00\x00\x00\x00\x00\x1f (esc)
595 b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to4\x00\x00\x00\xc9debugreply: capabilities: (esc)
596 b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to4\x00\x00\x00\xc9debugreply: capabilities: (esc)
596 debugreply: 'city=!'
597 debugreply: 'city=!'
597 debugreply: 'celeste,ville'
598 debugreply: 'celeste,ville'
598 debugreply: 'elephants'
599 debugreply: 'elephants'
599 debugreply: 'babar'
600 debugreply: 'babar'
600 debugreply: 'celeste'
601 debugreply: 'celeste'
601 debugreply: 'ping-pong'
602 debugreply: 'ping-pong'
602 \x00\x00\x00\x00\x00\x1e test:pong\x00\x00\x00\x02\x01\x00\x0b\x01in-reply-to7\x00\x00\x00\x00\x00\x1f (esc)
603 \x00\x00\x00\x00\x00\x1e test:pong\x00\x00\x00\x02\x01\x00\x0b\x01in-reply-to7\x00\x00\x00\x00\x00\x1f (esc)
603 b2x:output\x00\x00\x00\x03\x00\x01\x0b\x01in-reply-to7\x00\x00\x00=received ping request (id 7) (esc)
604 b2x:output\x00\x00\x00\x03\x00\x01\x0b\x01in-reply-to7\x00\x00\x00=received ping request (id 7) (esc)
604 replying to ping request (id 7)
605 replying to ping request (id 7)
605 \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
606 \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
606
607
607 The reply is valid
608 The reply is valid
608
609
609 $ hg statbundle2 < ../reply.hg2
610 $ hg statbundle2 < ../reply.hg2
610 options count: 0
611 options count: 0
611 :b2x:output:
612 :b2x:output:
612 mandatory: 0
613 mandatory: 0
613 advisory: 1
614 advisory: 1
614 payload: 217 bytes
615 payload: 217 bytes
615 :b2x:output:
616 :b2x:output:
616 mandatory: 0
617 mandatory: 0
617 advisory: 1
618 advisory: 1
618 payload: 201 bytes
619 payload: 201 bytes
619 :test:pong:
620 :test:pong:
620 mandatory: 1
621 mandatory: 1
621 advisory: 0
622 advisory: 0
622 payload: 0 bytes
623 payload: 0 bytes
623 :b2x:output:
624 :b2x:output:
624 mandatory: 0
625 mandatory: 0
625 advisory: 1
626 advisory: 1
626 payload: 61 bytes
627 payload: 61 bytes
627 parts count: 4
628 parts count: 4
628
629
629 Unbundle the reply to get the output:
630 Unbundle the reply to get the output:
630
631
631 $ hg unbundle2 < ../reply.hg2
632 $ hg unbundle2 < ../reply.hg2
632 remote: The choir starts singing:
633 remote: The choir starts singing:
633 remote: Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
634 remote: Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
634 remote: Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
635 remote: Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
635 remote: Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
636 remote: Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
636 remote: debugreply: capabilities:
637 remote: debugreply: capabilities:
637 remote: debugreply: 'city=!'
638 remote: debugreply: 'city=!'
638 remote: debugreply: 'celeste,ville'
639 remote: debugreply: 'celeste,ville'
639 remote: debugreply: 'elephants'
640 remote: debugreply: 'elephants'
640 remote: debugreply: 'babar'
641 remote: debugreply: 'babar'
641 remote: debugreply: 'celeste'
642 remote: debugreply: 'celeste'
642 remote: debugreply: 'ping-pong'
643 remote: debugreply: 'ping-pong'
643 remote: received ping request (id 7)
644 remote: received ping request (id 7)
644 remote: replying to ping request (id 7)
645 remote: replying to ping request (id 7)
645 0 unread bytes
646 0 unread bytes
646
647
647 Test push race detection
648 Test push race detection
648
649
649 $ hg bundle2 --pushrace ../part-race.hg2
650 $ hg bundle2 --pushrace ../part-race.hg2
650
651
651 $ hg unbundle2 < ../part-race.hg2
652 $ hg unbundle2 < ../part-race.hg2
652 0 unread bytes
653 0 unread bytes
653 abort: push race: repository changed while pushing - please try again
654 abort: push race: repository changed while pushing - please try again
654 [255]
655 [255]
655
656
656 Support for changegroup
657 Support for changegroup
657 ===================================
658 ===================================
658
659
659 $ hg unbundle $TESTDIR/bundles/rebase.hg
660 $ hg unbundle $TESTDIR/bundles/rebase.hg
660 adding changesets
661 adding changesets
661 adding manifests
662 adding manifests
662 adding file changes
663 adding file changes
663 added 8 changesets with 7 changes to 7 files (+3 heads)
664 added 8 changesets with 7 changes to 7 files (+3 heads)
664 (run 'hg heads' to see heads, 'hg merge' to merge)
665 (run 'hg heads' to see heads, 'hg merge' to merge)
665
666
666 $ hg log -G
667 $ hg log -G
667 o changeset: 8:02de42196ebe
668 o 8:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> H
668 | tag: tip
669 | parent: 6:24b6387c8c8c
670 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
671 | date: Sat Apr 30 15:24:48 2011 +0200
672 | summary: H
673 |
674 | o changeset: 7:eea13746799a
675 |/| parent: 6:24b6387c8c8c
676 | | parent: 5:9520eea781bc
677 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
678 | | date: Sat Apr 30 15:24:48 2011 +0200
679 | | summary: G
680 | |
681 o | changeset: 6:24b6387c8c8c
682 | | parent: 1:cd010b8cd998
683 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
684 | | date: Sat Apr 30 15:24:48 2011 +0200
685 | | summary: F
686 | |
687 | o changeset: 5:9520eea781bc
688 |/ parent: 1:cd010b8cd998
689 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
690 | date: Sat Apr 30 15:24:48 2011 +0200
691 | summary: E
692 |
669 |
693 | o changeset: 4:32af7686d403
670 | o 7:eea13746799a draft Nicolas Dumazet <nicdumz.commits@gmail.com> G
694 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
671 |/|
695 | | date: Sat Apr 30 15:24:48 2011 +0200
672 o | 6:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
696 | | summary: D
697 | |
673 | |
698 | o changeset: 3:5fddd98957c8
674 | o 5:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
699 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
675 |/
700 | | date: Sat Apr 30 15:24:48 2011 +0200
676 | o 4:32af7686d403 draft Nicolas Dumazet <nicdumz.commits@gmail.com> D
701 | | summary: C
702 | |
677 | |
703 | o changeset: 2:42ccdea3bb16
678 | o 3:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> C
704 |/ user: Nicolas Dumazet <nicdumz.commits@gmail.com>
679 | |
705 | date: Sat Apr 30 15:24:48 2011 +0200
680 | o 2:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> B
706 | summary: B
681 |/
707 |
682 o 1:cd010b8cd998 draft Nicolas Dumazet <nicdumz.commits@gmail.com> A
708 o changeset: 1:cd010b8cd998
709 parent: -1:000000000000
710 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
711 date: Sat Apr 30 15:24:48 2011 +0200
712 summary: A
713
683
714 @ changeset: 0:3903775176ed
684 @ 0:3903775176ed draft test a
715 user: test
716 date: Thu Jan 01 00:00:00 1970 +0000
717 summary: a
718
685
719
686
720 $ hg bundle2 --debug --rev '8+7+5+4' ../rev.hg2
687 $ hg bundle2 --debug --rev '8+7+5+4' ../rev.hg2
721 4 changesets found
688 4 changesets found
722 list of changesets:
689 list of changesets:
723 32af7686d403cf45b5d95f2d70cebea587ac806a
690 32af7686d403cf45b5d95f2d70cebea587ac806a
724 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
691 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
725 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
692 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
726 02de42196ebee42ef284b6780a87cdc96e8eaab6
693 02de42196ebee42ef284b6780a87cdc96e8eaab6
727 start emission of HG2X stream
694 start emission of HG2X stream
728 bundle parameter:
695 bundle parameter:
729 start of parts
696 start of parts
730 bundle part: "b2x:changegroup"
697 bundle part: "b2x:changegroup"
731 bundling: 1/4 changesets (25.00%)
698 bundling: 1/4 changesets (25.00%)
732 bundling: 2/4 changesets (50.00%)
699 bundling: 2/4 changesets (50.00%)
733 bundling: 3/4 changesets (75.00%)
700 bundling: 3/4 changesets (75.00%)
734 bundling: 4/4 changesets (100.00%)
701 bundling: 4/4 changesets (100.00%)
735 bundling: 1/4 manifests (25.00%)
702 bundling: 1/4 manifests (25.00%)
736 bundling: 2/4 manifests (50.00%)
703 bundling: 2/4 manifests (50.00%)
737 bundling: 3/4 manifests (75.00%)
704 bundling: 3/4 manifests (75.00%)
738 bundling: 4/4 manifests (100.00%)
705 bundling: 4/4 manifests (100.00%)
739 bundling: D 1/3 files (33.33%)
706 bundling: D 1/3 files (33.33%)
740 bundling: E 2/3 files (66.67%)
707 bundling: E 2/3 files (66.67%)
741 bundling: H 3/3 files (100.00%)
708 bundling: H 3/3 files (100.00%)
742 end of bundle
709 end of bundle
743
710
744 $ cat ../rev.hg2
711 $ cat ../rev.hg2
745 HG2X\x00\x00\x00\x16\x0fb2x:changegroup\x00\x00\x00\x00\x00\x00\x00\x00\x06\x13\x00\x00\x00\xa42\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j_\xdd\xd9\x89W\xc8\xa5JMCm\xfe\x1d\xa9\xd8\x7f!\xa1\xb9{\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c (esc)
712 HG2X\x00\x00\x00\x16\x0fb2x:changegroup\x00\x00\x00\x00\x00\x00\x00\x00\x06\x13\x00\x00\x00\xa42\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j_\xdd\xd9\x89W\xc8\xa5JMCm\xfe\x1d\xa9\xd8\x7f!\xa1\xb9{\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c (esc)
746 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc)
713 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc)
747 \x00\x00\x00i\x00\x00\x00j\x00\x00\x00\x01D\x00\x00\x00\xa4\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\xcd\x01\x0b\x8c\xd9\x98\xf3\x98\x1aZ\x81\x15\xf9O\x8d\xa4\xabP`\x89\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)4dece9c826f69490507b98c6383a3009b295837d (esc)
714 \x00\x00\x00i\x00\x00\x00j\x00\x00\x00\x01D\x00\x00\x00\xa4\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\xcd\x01\x0b\x8c\xd9\x98\xf3\x98\x1aZ\x81\x15\xf9O\x8d\xa4\xabP`\x89\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)4dece9c826f69490507b98c6383a3009b295837d (esc)
748 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02E (esc)
715 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02E (esc)
749 \x00\x00\x00i\x00\x00\x00j\x00\x00\x00\x01E\x00\x00\x00\xa2\xee\xa17Fy\x9a\x9e\x0b\xfd\x88\xf2\x9d<.\x9d\xc98\x9fRO$\xb68|\x8c\x8c\xae7\x17\x88\x80\xf3\xfa\x95\xde\xd3\xcb\x1c\xf7\x85\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\xee\xa17Fy\x9a\x9e\x0b\xfd\x88\xf2\x9d<.\x9d\xc98\x9fRO\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)365b93d57fdf4814e2b5911d6bacff2b12014441 (esc)
716 \x00\x00\x00i\x00\x00\x00j\x00\x00\x00\x01E\x00\x00\x00\xa2\xee\xa17Fy\x9a\x9e\x0b\xfd\x88\xf2\x9d<.\x9d\xc98\x9fRO$\xb68|\x8c\x8c\xae7\x17\x88\x80\xf3\xfa\x95\xde\xd3\xcb\x1c\xf7\x85\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\xee\xa17Fy\x9a\x9e\x0b\xfd\x88\xf2\x9d<.\x9d\xc98\x9fRO\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)365b93d57fdf4814e2b5911d6bacff2b12014441 (esc)
750 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x00\x00\x00\x00i\x00\x00\x00j\x00\x00\x00\x01G\x00\x00\x00\xa4\x02\xdeB\x19n\xbe\xe4.\xf2\x84\xb6x (esc)
717 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x00\x00\x00\x00i\x00\x00\x00j\x00\x00\x00\x01G\x00\x00\x00\xa4\x02\xdeB\x19n\xbe\xe4.\xf2\x84\xb6x (esc)
751 \x87\xcd\xc9n\x8e\xaa\xb6$\xb68|\x8c\x8c\xae7\x17\x88\x80\xf3\xfa\x95\xde\xd3\xcb\x1c\xf7\x85\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xdeB\x19n\xbe\xe4.\xf2\x84\xb6x (esc)
718 \x87\xcd\xc9n\x8e\xaa\xb6$\xb68|\x8c\x8c\xae7\x17\x88\x80\xf3\xfa\x95\xde\xd3\xcb\x1c\xf7\x85\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xdeB\x19n\xbe\xe4.\xf2\x84\xb6x (esc)
752 \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)8bee48edc7318541fc0013ee41b089276a8c24bf (esc)
719 \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)8bee48edc7318541fc0013ee41b089276a8c24bf (esc)
753 \x00\x00\x00f\x00\x00\x00f\x00\x00\x00\x02H (esc)
720 \x00\x00\x00f\x00\x00\x00f\x00\x00\x00\x02H (esc)
754 \x00\x00\x00g\x00\x00\x00h\x00\x00\x00\x01H\x00\x00\x00\x00\x00\x00\x00\x8bn\x1fLG\xec\xb53\xff\xd0\xc8\xe5,\xdc\x88\xaf\xb6\xcd9\xe2\x0cf\xa5\xa0\x18\x17\xfd\xf5#\x9c'8\x02\xb5\xb7a\x8d\x05\x1c\x89\xe4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j\x00\x00\x00\x81\x00\x00\x00\x81\x00\x00\x00+D\x00c3f1ca2924c16a19b0656a84900e504e5b0aec2d (esc)
721 \x00\x00\x00g\x00\x00\x00h\x00\x00\x00\x01H\x00\x00\x00\x00\x00\x00\x00\x8bn\x1fLG\xec\xb53\xff\xd0\xc8\xe5,\xdc\x88\xaf\xb6\xcd9\xe2\x0cf\xa5\xa0\x18\x17\xfd\xf5#\x9c'8\x02\xb5\xb7a\x8d\x05\x1c\x89\xe4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j\x00\x00\x00\x81\x00\x00\x00\x81\x00\x00\x00+D\x00c3f1ca2924c16a19b0656a84900e504e5b0aec2d (esc)
755 \x00\x00\x00\x8bM\xec\xe9\xc8&\xf6\x94\x90P{\x98\xc68:0 \xb2\x95\x83}\x00}\x8c\x9d\x88\x84\x13%\xf5\xc6\xb0cq\xb3[N\x8a+\x1a\x83\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\x00\x00\x00+\x00\x00\x00\xac\x00\x00\x00+E\x009c6fd0350a6c0d0c49d4a9c5017cf07043f54e58 (esc)
722 \x00\x00\x00\x8bM\xec\xe9\xc8&\xf6\x94\x90P{\x98\xc68:0 \xb2\x95\x83}\x00}\x8c\x9d\x88\x84\x13%\xf5\xc6\xb0cq\xb3[N\x8a+\x1a\x83\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\x00\x00\x00+\x00\x00\x00\xac\x00\x00\x00+E\x009c6fd0350a6c0d0c49d4a9c5017cf07043f54e58 (esc)
756 \x00\x00\x00\x8b6[\x93\xd5\x7f\xdfH\x14\xe2\xb5\x91\x1dk\xac\xff+\x12\x01DA(\xa5\x84\xc6^\xf1!\xf8\x9e\xb6j\xb7\xd0\xbc\x15=\x80\x99\xe7\xceM\xec\xe9\xc8&\xf6\x94\x90P{\x98\xc68:0 \xb2\x95\x83}\xee\xa17Fy\x9a\x9e\x0b\xfd\x88\xf2\x9d<.\x9d\xc98\x9fRO\x00\x00\x00V\x00\x00\x00V\x00\x00\x00+F\x0022bfcfd62a21a3287edbd4d656218d0f525ed76a (esc)
723 \x00\x00\x00\x8b6[\x93\xd5\x7f\xdfH\x14\xe2\xb5\x91\x1dk\xac\xff+\x12\x01DA(\xa5\x84\xc6^\xf1!\xf8\x9e\xb6j\xb7\xd0\xbc\x15=\x80\x99\xe7\xceM\xec\xe9\xc8&\xf6\x94\x90P{\x98\xc68:0 \xb2\x95\x83}\xee\xa17Fy\x9a\x9e\x0b\xfd\x88\xf2\x9d<.\x9d\xc98\x9fRO\x00\x00\x00V\x00\x00\x00V\x00\x00\x00+F\x0022bfcfd62a21a3287edbd4d656218d0f525ed76a (esc)
757 \x00\x00\x00\x97\x8b\xeeH\xed\xc71\x85A\xfc\x00\x13\xeeA\xb0\x89'j\x8c$\xbf(\xa5\x84\xc6^\xf1!\xf8\x9e\xb6j\xb7\xd0\xbc\x15=\x80\x99\xe7\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xdeB\x19n\xbe\xe4.\xf2\x84\xb6x (esc)
724 \x00\x00\x00\x97\x8b\xeeH\xed\xc71\x85A\xfc\x00\x13\xeeA\xb0\x89'j\x8c$\xbf(\xa5\x84\xc6^\xf1!\xf8\x9e\xb6j\xb7\xd0\xbc\x15=\x80\x99\xe7\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xdeB\x19n\xbe\xe4.\xf2\x84\xb6x (esc)
758 \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00+\x00\x00\x00V\x00\x00\x00\x00\x00\x00\x00\x81\x00\x00\x00\x81\x00\x00\x00+H\x008500189e74a9e0475e822093bc7db0d631aeb0b4 (esc)
725 \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00+\x00\x00\x00V\x00\x00\x00\x00\x00\x00\x00\x81\x00\x00\x00\x81\x00\x00\x00+H\x008500189e74a9e0475e822093bc7db0d631aeb0b4 (esc)
759 \x00\x00\x00\x00\x00\x00\x00\x05D\x00\x00\x00b\xc3\xf1\xca)$\xc1j\x19\xb0ej\x84\x90\x0ePN[ (esc)
726 \x00\x00\x00\x00\x00\x00\x00\x05D\x00\x00\x00b\xc3\xf1\xca)$\xc1j\x19\xb0ej\x84\x90\x0ePN[ (esc)
760 \xec-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02D (esc)
727 \xec-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02D (esc)
761 \x00\x00\x00\x00\x00\x00\x00\x05E\x00\x00\x00b\x9co\xd05 (esc)
728 \x00\x00\x00\x00\x00\x00\x00\x05E\x00\x00\x00b\x9co\xd05 (esc)
762 l\r (no-eol) (esc)
729 l\r (no-eol) (esc)
763 \x0cI\xd4\xa9\xc5\x01|\xf0pC\xf5NX\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02E (esc)
730 \x0cI\xd4\xa9\xc5\x01|\xf0pC\xf5NX\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02E (esc)
764 \x00\x00\x00\x00\x00\x00\x00\x05H\x00\x00\x00b\x85\x00\x18\x9et\xa9\xe0G^\x82 \x93\xbc}\xb0\xd61\xae\xb0\xb4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xdeB\x19n\xbe\xe4.\xf2\x84\xb6x (esc)
731 \x00\x00\x00\x00\x00\x00\x00\x05H\x00\x00\x00b\x85\x00\x18\x9et\xa9\xe0G^\x82 \x93\xbc}\xb0\xd61\xae\xb0\xb4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xdeB\x19n\xbe\xe4.\xf2\x84\xb6x (esc)
765 \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02H (esc)
732 \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02H (esc)
766 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
733 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
767
734
768 $ hg unbundle2 < ../rev.hg2
735 $ hg unbundle2 < ../rev.hg2
769 adding changesets
736 adding changesets
770 adding manifests
737 adding manifests
771 adding file changes
738 adding file changes
772 added 0 changesets with 0 changes to 3 files
739 added 0 changesets with 0 changes to 3 files
773 0 unread bytes
740 0 unread bytes
774 addchangegroup return: 1
741 addchangegroup return: 1
775
742
776 with reply
743 with reply
777
744
778 $ hg bundle2 --rev '8+7+5+4' --reply ../rev-rr.hg2
745 $ hg bundle2 --rev '8+7+5+4' --reply ../rev-rr.hg2
779 $ hg unbundle2 ../rev-reply.hg2 < ../rev-rr.hg2
746 $ hg unbundle2 ../rev-reply.hg2 < ../rev-rr.hg2
780 0 unread bytes
747 0 unread bytes
781 addchangegroup return: 1
748 addchangegroup return: 1
782
749
783 $ cat ../rev-reply.hg2
750 $ cat ../rev-reply.hg2
784 HG2X\x00\x00\x003\x15b2x:reply:changegroup\x00\x00\x00\x00\x00\x02\x0b\x01\x06\x01in-reply-to1return1\x00\x00\x00\x00\x00\x1f (esc)
751 HG2X\x00\x00\x003\x15b2x:reply:changegroup\x00\x00\x00\x00\x00\x02\x0b\x01\x06\x01in-reply-to1return1\x00\x00\x00\x00\x00\x1f (esc)
785 b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to1\x00\x00\x00dadding changesets (esc)
752 b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to1\x00\x00\x00dadding changesets (esc)
786 adding manifests
753 adding manifests
787 adding file changes
754 adding file changes
788 added 0 changesets with 0 changes to 3 files
755 added 0 changesets with 0 changes to 3 files
789 \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
756 \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
790
757
791 Real world exchange
758 Real world exchange
792 =====================
759 =====================
793
760
794
761
795 clone --pull
762 clone --pull
796
763
797 $ cd ..
764 $ cd ..
798 $ hg clone main other --pull --rev 9520eea781bc
765 $ hg clone main other --pull --rev 9520eea781bc
799 adding changesets
766 adding changesets
800 adding manifests
767 adding manifests
801 adding file changes
768 adding file changes
802 added 2 changesets with 2 changes to 2 files
769 added 2 changesets with 2 changes to 2 files
803 updating to branch default
770 updating to branch default
804 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
771 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
805 $ hg -R other log -G
772 $ hg -R other log -G
806 @ changeset: 1:9520eea781bc
773 @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
807 | tag: tip
808 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
809 | date: Sat Apr 30 15:24:48 2011 +0200
810 | summary: E
811 |
774 |
812 o changeset: 0:cd010b8cd998
775 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
813 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
814 date: Sat Apr 30 15:24:48 2011 +0200
815 summary: A
816
776
817
777
818 pull
778 pull
819
779
820 $ hg -R other pull -r 24b6387c8c8c
780 $ hg -R other pull -r 24b6387c8c8c
821 pulling from $TESTTMP/main (glob)
781 pulling from $TESTTMP/main (glob)
822 searching for changes
782 searching for changes
823 adding changesets
783 adding changesets
824 adding manifests
784 adding manifests
825 adding file changes
785 adding file changes
826 added 1 changesets with 1 changes to 1 files (+1 heads)
786 added 1 changesets with 1 changes to 1 files (+1 heads)
827 (run 'hg heads' to see heads, 'hg merge' to merge)
787 (run 'hg heads' to see heads, 'hg merge' to merge)
828
788
829 pull empty
789 pull empty
830
790
831 $ hg -R other pull -r 24b6387c8c8c
791 $ hg -R other pull -r 24b6387c8c8c
832 pulling from $TESTTMP/main (glob)
792 pulling from $TESTTMP/main (glob)
833 no changes found
793 no changes found
834
794
835 push
795 push
836
796
837 $ hg -R main push other --rev eea13746799a
797 $ hg -R main push other --rev eea13746799a
838 pushing to other
798 pushing to other
839 searching for changes
799 searching for changes
840 remote: adding changesets
800 remote: adding changesets
841 remote: adding manifests
801 remote: adding manifests
842 remote: adding file changes
802 remote: adding file changes
843 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
803 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
844
804
845 pull over ssh
805 pull over ssh
846
806
847 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --traceback
807 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --traceback
848 pulling from ssh://user@dummy/main
808 pulling from ssh://user@dummy/main
849 searching for changes
809 searching for changes
850 adding changesets
810 adding changesets
851 adding manifests
811 adding manifests
852 adding file changes
812 adding file changes
853 added 1 changesets with 1 changes to 1 files (+1 heads)
813 added 1 changesets with 1 changes to 1 files (+1 heads)
854 (run 'hg heads' to see heads, 'hg merge' to merge)
814 (run 'hg heads' to see heads, 'hg merge' to merge)
855
815
856 pull over http
816 pull over http
857
817
858 $ hg -R main serve -p $HGPORT -d --pid-file=main.pid -E main-error.log
818 $ hg -R main serve -p $HGPORT -d --pid-file=main.pid -E main-error.log
859 $ cat main.pid >> $DAEMON_PIDS
819 $ cat main.pid >> $DAEMON_PIDS
860
820
861 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16
821 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16
862 pulling from http://localhost:$HGPORT/
822 pulling from http://localhost:$HGPORT/
863 searching for changes
823 searching for changes
864 adding changesets
824 adding changesets
865 adding manifests
825 adding manifests
866 adding file changes
826 adding file changes
867 added 1 changesets with 1 changes to 1 files (+1 heads)
827 added 1 changesets with 1 changes to 1 files (+1 heads)
868 (run 'hg heads .' to see heads, 'hg merge' to merge)
828 (run 'hg heads .' to see heads, 'hg merge' to merge)
869 $ cat main-error.log
829 $ cat main-error.log
870
830
871 push over ssh
831 push over ssh
872
832
873 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8
833 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8
874 pushing to ssh://user@dummy/other
834 pushing to ssh://user@dummy/other
875 searching for changes
835 searching for changes
876 remote: adding changesets
836 remote: adding changesets
877 remote: adding manifests
837 remote: adding manifests
878 remote: adding file changes
838 remote: adding file changes
879 remote: added 1 changesets with 1 changes to 1 files
839 remote: added 1 changesets with 1 changes to 1 files
880
840
881 push over http
841 push over http
882
842
883 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
843 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
884 $ cat other.pid >> $DAEMON_PIDS
844 $ cat other.pid >> $DAEMON_PIDS
885
845
886 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403
846 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403
887 pushing to http://localhost:$HGPORT2/
847 pushing to http://localhost:$HGPORT2/
888 searching for changes
848 searching for changes
889 remote: adding changesets
849 remote: adding changesets
890 remote: adding manifests
850 remote: adding manifests
891 remote: adding file changes
851 remote: adding file changes
892 remote: added 1 changesets with 1 changes to 1 files
852 remote: added 1 changesets with 1 changes to 1 files
893 $ cat other-error.log
853 $ cat other-error.log
894
854
895 Check final content.
855 Check final content.
896
856
897 $ hg -R other log -G
857 $ hg -R other log -G
898 o changeset: 7:32af7686d403
858 o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> D
899 | tag: tip
900 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
901 | date: Sat Apr 30 15:24:48 2011 +0200
902 | summary: D
903 |
859 |
904 o changeset: 6:5fddd98957c8
860 o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> C
905 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
906 | date: Sat Apr 30 15:24:48 2011 +0200
907 | summary: C
908 |
861 |
909 o changeset: 5:42ccdea3bb16
862 o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> B
910 | parent: 0:cd010b8cd998
911 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
912 | date: Sat Apr 30 15:24:48 2011 +0200
913 | summary: B
914 |
863 |
915 | o changeset: 4:02de42196ebe
864 | o 4:02de42196ebe public Nicolas Dumazet <nicdumz.commits@gmail.com> H
916 | | parent: 2:24b6387c8c8c
917 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
918 | | date: Sat Apr 30 15:24:48 2011 +0200
919 | | summary: H
920 | |
865 | |
921 | | o changeset: 3:eea13746799a
866 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> G
922 | |/| parent: 2:24b6387c8c8c
867 | |/|
923 | | | parent: 1:9520eea781bc
868 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
924 | | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
869 |/ /
925 | | | date: Sat Apr 30 15:24:48 2011 +0200
870 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
926 | | | summary: G
871 |/
927 | | |
872 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
928 | o | changeset: 2:24b6387c8c8c
929 |/ / parent: 0:cd010b8cd998
930 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
931 | | date: Sat Apr 30 15:24:48 2011 +0200
932 | | summary: F
933 | |
934 | @ changeset: 1:9520eea781bc
935 |/ user: Nicolas Dumazet <nicdumz.commits@gmail.com>
936 | date: Sat Apr 30 15:24:48 2011 +0200
937 | summary: E
938 |
939 o changeset: 0:cd010b8cd998
940 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
941 date: Sat Apr 30 15:24:48 2011 +0200
942 summary: A
943
873
944
874
945 Error Handling
875 Error Handling
946 ==============
876 ==============
947
877
948 Check that errors are properly returned to the client during push.
878 Check that errors are properly returned to the client during push.
949
879
950 Setting up
880 Setting up
951
881
952 $ cat > failpush.py << EOF
882 $ cat > failpush.py << EOF
953 > """A small extension that makes push fails when using bundle2
883 > """A small extension that makes push fails when using bundle2
954 >
884 >
955 > used to test error handling in bundle2
885 > used to test error handling in bundle2
956 > """
886 > """
957 >
887 >
958 > from mercurial import util
888 > from mercurial import util
959 > from mercurial import bundle2
889 > from mercurial import bundle2
960 > from mercurial import exchange
890 > from mercurial import exchange
961 > from mercurial import extensions
891 > from mercurial import extensions
962 >
892 >
963 > def _pushbundle2failpart(orig, pushop, bundler):
893 > def _pushbundle2failpart(orig, pushop, bundler):
964 > extradata = orig(pushop, bundler)
894 > extradata = orig(pushop, bundler)
965 > reason = pushop.ui.config('failpush', 'reason', None)
895 > reason = pushop.ui.config('failpush', 'reason', None)
966 > part = None
896 > part = None
967 > if reason == 'abort':
897 > if reason == 'abort':
968 > bundler.newpart('test:abort')
898 > bundler.newpart('test:abort')
969 > if reason == 'unknown':
899 > if reason == 'unknown':
970 > bundler.newpart('TEST:UNKNOWN')
900 > bundler.newpart('TEST:UNKNOWN')
971 > if reason == 'race':
901 > if reason == 'race':
972 > # 20 Bytes of crap
902 > # 20 Bytes of crap
973 > bundler.newpart('b2x:check:heads', data='01234567890123456789')
903 > bundler.newpart('b2x:check:heads', data='01234567890123456789')
974 > return extradata
904 > return extradata
975 >
905 >
976 > @bundle2.parthandler("test:abort")
906 > @bundle2.parthandler("test:abort")
977 > def handleabort(op, part):
907 > def handleabort(op, part):
978 > raise util.Abort('Abandon ship!', hint="don't panic")
908 > raise util.Abort('Abandon ship!', hint="don't panic")
979 >
909 >
980 > def uisetup(ui):
910 > def uisetup(ui):
981 > extensions.wrapfunction(exchange, '_pushbundle2extraparts', _pushbundle2failpart)
911 > extensions.wrapfunction(exchange, '_pushbundle2extraparts', _pushbundle2failpart)
982 >
912 >
983 > EOF
913 > EOF
984
914
985 $ cd main
915 $ cd main
986 $ hg up tip
916 $ hg up tip
987 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
917 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
988 $ echo 'I' > I
918 $ echo 'I' > I
989 $ hg add I
919 $ hg add I
990 $ hg ci -m 'I'
920 $ hg ci -m 'I'
991 $ hg id
921 $ hg id
992 e7ec4e813ba6 tip
922 e7ec4e813ba6 tip
993 $ cd ..
923 $ cd ..
994
924
995 $ cat << EOF >> $HGRCPATH
925 $ cat << EOF >> $HGRCPATH
996 > [extensions]
926 > [extensions]
997 > failpush=$TESTTMP/failpush.py
927 > failpush=$TESTTMP/failpush.py
998 > EOF
928 > EOF
999
929
1000 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
930 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1001 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
931 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
1002 $ cat other.pid >> $DAEMON_PIDS
932 $ cat other.pid >> $DAEMON_PIDS
1003
933
1004 Doing the actual push: Abort error
934 Doing the actual push: Abort error
1005
935
1006 $ cat << EOF >> $HGRCPATH
936 $ cat << EOF >> $HGRCPATH
1007 > [failpush]
937 > [failpush]
1008 > reason = abort
938 > reason = abort
1009 > EOF
939 > EOF
1010
940
1011 $ hg -R main push other -r e7ec4e813ba6
941 $ hg -R main push other -r e7ec4e813ba6
1012 pushing to other
942 pushing to other
1013 searching for changes
943 searching for changes
1014 abort: Abandon ship!
944 abort: Abandon ship!
1015 (don't panic)
945 (don't panic)
1016 [255]
946 [255]
1017
947
1018 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
948 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
1019 pushing to ssh://user@dummy/other
949 pushing to ssh://user@dummy/other
1020 searching for changes
950 searching for changes
1021 abort: Abandon ship!
951 abort: Abandon ship!
1022 (don't panic)
952 (don't panic)
1023 [255]
953 [255]
1024
954
1025 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
955 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
1026 pushing to http://localhost:$HGPORT2/
956 pushing to http://localhost:$HGPORT2/
1027 searching for changes
957 searching for changes
1028 abort: Abandon ship!
958 abort: Abandon ship!
1029 (don't panic)
959 (don't panic)
1030 [255]
960 [255]
1031
961
1032
962
1033 Doing the actual push: unknown mandatory parts
963 Doing the actual push: unknown mandatory parts
1034
964
1035 $ cat << EOF >> $HGRCPATH
965 $ cat << EOF >> $HGRCPATH
1036 > [failpush]
966 > [failpush]
1037 > reason = unknown
967 > reason = unknown
1038 > EOF
968 > EOF
1039
969
1040 $ hg -R main push other -r e7ec4e813ba6
970 $ hg -R main push other -r e7ec4e813ba6
1041 pushing to other
971 pushing to other
1042 searching for changes
972 searching for changes
1043 abort: missing support for test:unknown
973 abort: missing support for test:unknown
1044 [255]
974 [255]
1045
975
1046 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
976 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
1047 pushing to ssh://user@dummy/other
977 pushing to ssh://user@dummy/other
1048 searching for changes
978 searching for changes
1049 abort: missing support for test:unknown
979 abort: missing support for test:unknown
1050 [255]
980 [255]
1051
981
1052 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
982 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
1053 pushing to http://localhost:$HGPORT2/
983 pushing to http://localhost:$HGPORT2/
1054 searching for changes
984 searching for changes
1055 abort: missing support for test:unknown
985 abort: missing support for test:unknown
1056 [255]
986 [255]
1057
987
1058 Doing the actual push: race
988 Doing the actual push: race
1059
989
1060 $ cat << EOF >> $HGRCPATH
990 $ cat << EOF >> $HGRCPATH
1061 > [failpush]
991 > [failpush]
1062 > reason = race
992 > reason = race
1063 > EOF
993 > EOF
1064
994
1065 $ hg -R main push other -r e7ec4e813ba6
995 $ hg -R main push other -r e7ec4e813ba6
1066 pushing to other
996 pushing to other
1067 searching for changes
997 searching for changes
1068 abort: push failed:
998 abort: push failed:
1069 'repository changed while pushing - please try again'
999 'repository changed while pushing - please try again'
1070 [255]
1000 [255]
1071
1001
1072 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
1002 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
1073 pushing to ssh://user@dummy/other
1003 pushing to ssh://user@dummy/other
1074 searching for changes
1004 searching for changes
1075 abort: push failed:
1005 abort: push failed:
1076 'repository changed while pushing - please try again'
1006 'repository changed while pushing - please try again'
1077 [255]
1007 [255]
1078
1008
1079 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
1009 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
1080 pushing to http://localhost:$HGPORT2/
1010 pushing to http://localhost:$HGPORT2/
1081 searching for changes
1011 searching for changes
1082 abort: push failed:
1012 abort: push failed:
1083 'repository changed while pushing - please try again'
1013 'repository changed while pushing - please try again'
1084 [255]
1014 [255]
1085
1015
1086 Doing the actual push: hook abort
1016 Doing the actual push: hook abort
1087
1017
1088 $ cat << EOF >> $HGRCPATH
1018 $ cat << EOF >> $HGRCPATH
1089 > [failpush]
1019 > [failpush]
1090 > reason =
1020 > reason =
1091 > [hooks]
1021 > [hooks]
1092 > b2x-pretransactionclose.failpush = false
1022 > b2x-pretransactionclose.failpush = false
1093 > EOF
1023 > EOF
1094
1024
1095 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1025 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1096 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
1026 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
1097 $ cat other.pid >> $DAEMON_PIDS
1027 $ cat other.pid >> $DAEMON_PIDS
1098
1028
1099 $ hg -R main push other -r e7ec4e813ba6
1029 $ hg -R main push other -r e7ec4e813ba6
1100 pushing to other
1030 pushing to other
1101 searching for changes
1031 searching for changes
1102 transaction abort!
1032 transaction abort!
1103 rollback completed
1033 rollback completed
1104 abort: b2x-pretransactionclose.failpush hook exited with status 1
1034 abort: b2x-pretransactionclose.failpush hook exited with status 1
1105 [255]
1035 [255]
1106
1036
1107 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
1037 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
1108 pushing to ssh://user@dummy/other
1038 pushing to ssh://user@dummy/other
1109 searching for changes
1039 searching for changes
1110 abort: b2x-pretransactionclose.failpush hook exited with status 1
1040 abort: b2x-pretransactionclose.failpush hook exited with status 1
1111 remote: transaction abort!
1041 remote: transaction abort!
1112 remote: rollback completed
1042 remote: rollback completed
1113 [255]
1043 [255]
1114
1044
1115 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
1045 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
1116 pushing to http://localhost:$HGPORT2/
1046 pushing to http://localhost:$HGPORT2/
1117 searching for changes
1047 searching for changes
1118 abort: b2x-pretransactionclose.failpush hook exited with status 1
1048 abort: b2x-pretransactionclose.failpush hook exited with status 1
1119 [255]
1049 [255]
1120
1050
1121
1051
General Comments 0
You need to be logged in to leave comments. Login now