##// END OF EJS Templates
bundle2: make error testing more modular...
Pierre-Yves David -
r21178:9a813e70 stable
parent child Browse files
Show More
@@ -1,962 +1,971
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 > import sys
11 > import sys
12 > from mercurial import cmdutil
12 > from mercurial import cmdutil
13 > from mercurial import util
13 > from mercurial import util
14 > from mercurial import bundle2
14 > from mercurial import bundle2
15 > from mercurial import scmutil
15 > from mercurial import scmutil
16 > from mercurial import discovery
16 > from mercurial import discovery
17 > from mercurial import changegroup
17 > from mercurial import changegroup
18 > cmdtable = {}
18 > cmdtable = {}
19 > command = cmdutil.command(cmdtable)
19 > command = cmdutil.command(cmdtable)
20 >
20 >
21 > ELEPHANTSSONG = """Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
21 > ELEPHANTSSONG = """Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
22 > Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
22 > Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
23 > Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko."""
23 > Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko."""
24 > assert len(ELEPHANTSSONG) == 178 # future test say 178 bytes, trust it.
24 > assert len(ELEPHANTSSONG) == 178 # future test say 178 bytes, trust it.
25 >
25 >
26 > @bundle2.parthandler('test:song')
26 > @bundle2.parthandler('test:song')
27 > def songhandler(op, part):
27 > def songhandler(op, part):
28 > """handle a "test:song" bundle2 part, printing the lyrics on stdin"""
28 > """handle a "test:song" bundle2 part, printing the lyrics on stdin"""
29 > op.ui.write('The choir starts singing:\n')
29 > op.ui.write('The choir starts singing:\n')
30 > verses = 0
30 > verses = 0
31 > for line in part.read().split('\n'):
31 > for line in part.read().split('\n'):
32 > op.ui.write(' %s\n' % line)
32 > op.ui.write(' %s\n' % line)
33 > verses += 1
33 > verses += 1
34 > op.records.add('song', {'verses': verses})
34 > op.records.add('song', {'verses': verses})
35 >
35 >
36 > @bundle2.parthandler('test:ping')
36 > @bundle2.parthandler('test:ping')
37 > def pinghandler(op, part):
37 > def pinghandler(op, part):
38 > op.ui.write('received ping request (id %i)\n' % part.id)
38 > op.ui.write('received ping request (id %i)\n' % part.id)
39 > if op.reply is not None and 'ping-pong' in op.reply.capabilities:
39 > if op.reply is not None and 'ping-pong' in op.reply.capabilities:
40 > op.ui.write_err('replying to ping request (id %i)\n' % part.id)
40 > op.ui.write_err('replying to ping request (id %i)\n' % part.id)
41 > rpart = bundle2.bundlepart('test:pong',
41 > rpart = bundle2.bundlepart('test:pong',
42 > [('in-reply-to', str(part.id))])
42 > [('in-reply-to', str(part.id))])
43 > op.reply.addpart(rpart)
43 > op.reply.addpart(rpart)
44 >
44 >
45 > @bundle2.parthandler('test:debugreply')
45 > @bundle2.parthandler('test:debugreply')
46 > def debugreply(op, part):
46 > def debugreply(op, part):
47 > """print data about the capacity of the bundle reply"""
47 > """print data about the capacity of the bundle reply"""
48 > if op.reply is None:
48 > if op.reply is None:
49 > op.ui.write('debugreply: no reply\n')
49 > op.ui.write('debugreply: no reply\n')
50 > else:
50 > else:
51 > op.ui.write('debugreply: capabilities:\n')
51 > op.ui.write('debugreply: capabilities:\n')
52 > for cap in sorted(op.reply.capabilities):
52 > for cap in sorted(op.reply.capabilities):
53 > op.ui.write('debugreply: %r\n' % cap)
53 > op.ui.write('debugreply: %r\n' % cap)
54 > for val in op.reply.capabilities[cap]:
54 > for val in op.reply.capabilities[cap]:
55 > op.ui.write('debugreply: %r\n' % val)
55 > op.ui.write('debugreply: %r\n' % val)
56 >
56 >
57 > @command('bundle2',
57 > @command('bundle2',
58 > [('', 'param', [], 'stream level parameter'),
58 > [('', 'param', [], 'stream level parameter'),
59 > ('', 'unknown', False, 'include an unknown mandatory part in the bundle'),
59 > ('', 'unknown', False, 'include an unknown mandatory part in the bundle'),
60 > ('', 'parts', False, 'include some arbitrary parts to the bundle'),
60 > ('', 'parts', False, 'include some arbitrary parts to the bundle'),
61 > ('', 'reply', False, 'produce a reply bundle'),
61 > ('', 'reply', False, 'produce a reply bundle'),
62 > ('r', 'rev', [], 'includes those changeset in the bundle'),],
62 > ('r', 'rev', [], 'includes those changeset in the bundle'),],
63 > '[OUTPUTFILE]')
63 > '[OUTPUTFILE]')
64 > def cmdbundle2(ui, repo, path=None, **opts):
64 > def cmdbundle2(ui, repo, path=None, **opts):
65 > """write a bundle2 container on standard ouput"""
65 > """write a bundle2 container on standard ouput"""
66 > bundler = bundle2.bundle20(ui)
66 > bundler = bundle2.bundle20(ui)
67 > for p in opts['param']:
67 > for p in opts['param']:
68 > p = p.split('=', 1)
68 > p = p.split('=', 1)
69 > try:
69 > try:
70 > bundler.addparam(*p)
70 > bundler.addparam(*p)
71 > except ValueError, exc:
71 > except ValueError, exc:
72 > raise util.Abort('%s' % exc)
72 > raise util.Abort('%s' % exc)
73 >
73 >
74 > if opts['reply']:
74 > if opts['reply']:
75 > capsstring = 'ping-pong\nelephants=babar,celeste\ncity%3D%21=celeste%2Cville'
75 > capsstring = 'ping-pong\nelephants=babar,celeste\ncity%3D%21=celeste%2Cville'
76 > bundler.addpart(bundle2.bundlepart('b2x:replycaps', data=capsstring))
76 > bundler.addpart(bundle2.bundlepart('b2x:replycaps', data=capsstring))
77 >
77 >
78 > revs = opts['rev']
78 > revs = opts['rev']
79 > if 'rev' in opts:
79 > if 'rev' in opts:
80 > revs = scmutil.revrange(repo, opts['rev'])
80 > revs = scmutil.revrange(repo, opts['rev'])
81 > if revs:
81 > if revs:
82 > # very crude version of a changegroup part creation
82 > # very crude version of a changegroup part creation
83 > bundled = repo.revs('%ld::%ld', revs, revs)
83 > bundled = repo.revs('%ld::%ld', revs, revs)
84 > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)]
84 > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)]
85 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
85 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
86 > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
86 > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
87 > cg = changegroup.getlocalbundle(repo, 'test:bundle2', outgoing, None)
87 > cg = changegroup.getlocalbundle(repo, 'test:bundle2', outgoing, None)
88 > part = bundle2.bundlepart('b2x:changegroup', data=cg.getchunks())
88 > part = bundle2.bundlepart('b2x:changegroup', data=cg.getchunks())
89 > bundler.addpart(part)
89 > bundler.addpart(part)
90 >
90 >
91 > if opts['parts']:
91 > if opts['parts']:
92 > part = bundle2.bundlepart('test:empty')
92 > part = bundle2.bundlepart('test:empty')
93 > bundler.addpart(part)
93 > bundler.addpart(part)
94 > # add a second one to make sure we handle multiple parts
94 > # add a second one to make sure we handle multiple parts
95 > part = bundle2.bundlepart('test:empty')
95 > part = bundle2.bundlepart('test:empty')
96 > bundler.addpart(part)
96 > bundler.addpart(part)
97 > part = bundle2.bundlepart('test:song', data=ELEPHANTSSONG)
97 > part = bundle2.bundlepart('test:song', data=ELEPHANTSSONG)
98 > bundler.addpart(part)
98 > bundler.addpart(part)
99 > part = bundle2.bundlepart('test:debugreply')
99 > part = bundle2.bundlepart('test:debugreply')
100 > bundler.addpart(part)
100 > bundler.addpart(part)
101 > part = bundle2.bundlepart('test:math',
101 > part = bundle2.bundlepart('test:math',
102 > [('pi', '3.14'), ('e', '2.72')],
102 > [('pi', '3.14'), ('e', '2.72')],
103 > [('cooking', 'raw')],
103 > [('cooking', 'raw')],
104 > '42')
104 > '42')
105 > bundler.addpart(part)
105 > bundler.addpart(part)
106 > if opts['unknown']:
106 > if opts['unknown']:
107 > part = bundle2.bundlepart('test:UNKNOWN',
107 > part = bundle2.bundlepart('test:UNKNOWN',
108 > data='some random content')
108 > data='some random content')
109 > bundler.addpart(part)
109 > bundler.addpart(part)
110 > if opts['parts']:
110 > if opts['parts']:
111 > part = bundle2.bundlepart('test:ping')
111 > part = bundle2.bundlepart('test:ping')
112 > bundler.addpart(part)
112 > bundler.addpart(part)
113 >
113 >
114 > if path is None:
114 > if path is None:
115 > file = sys.stdout
115 > file = sys.stdout
116 > else:
116 > else:
117 > file = open(path, 'w')
117 > file = open(path, 'w')
118 >
118 >
119 > for chunk in bundler.getchunks():
119 > for chunk in bundler.getchunks():
120 > file.write(chunk)
120 > file.write(chunk)
121 >
121 >
122 > @command('unbundle2', [], '')
122 > @command('unbundle2', [], '')
123 > def cmdunbundle2(ui, repo, replypath=None):
123 > def cmdunbundle2(ui, repo, replypath=None):
124 > """process a bundle2 stream from stdin on the current repo"""
124 > """process a bundle2 stream from stdin on the current repo"""
125 > try:
125 > try:
126 > tr = None
126 > tr = None
127 > lock = repo.lock()
127 > lock = repo.lock()
128 > tr = repo.transaction('processbundle')
128 > tr = repo.transaction('processbundle')
129 > try:
129 > try:
130 > unbundler = bundle2.unbundle20(ui, sys.stdin)
130 > unbundler = bundle2.unbundle20(ui, sys.stdin)
131 > op = bundle2.processbundle(repo, unbundler, lambda: tr)
131 > op = bundle2.processbundle(repo, unbundler, lambda: tr)
132 > tr.close()
132 > tr.close()
133 > except KeyError, exc:
133 > except KeyError, exc:
134 > raise util.Abort('missing support for %s' % exc)
134 > raise util.Abort('missing support for %s' % exc)
135 > finally:
135 > finally:
136 > if tr is not None:
136 > if tr is not None:
137 > tr.release()
137 > tr.release()
138 > lock.release()
138 > lock.release()
139 > remains = sys.stdin.read()
139 > remains = sys.stdin.read()
140 > ui.write('%i unread bytes\n' % len(remains))
140 > ui.write('%i unread bytes\n' % len(remains))
141 > if op.records['song']:
141 > if op.records['song']:
142 > totalverses = sum(r['verses'] for r in op.records['song'])
142 > totalverses = sum(r['verses'] for r in op.records['song'])
143 > ui.write('%i total verses sung\n' % totalverses)
143 > ui.write('%i total verses sung\n' % totalverses)
144 > for rec in op.records['changegroup']:
144 > for rec in op.records['changegroup']:
145 > ui.write('addchangegroup return: %i\n' % rec['return'])
145 > ui.write('addchangegroup return: %i\n' % rec['return'])
146 > if op.reply is not None and replypath is not None:
146 > if op.reply is not None and replypath is not None:
147 > file = open(replypath, 'w')
147 > file = open(replypath, 'w')
148 > for chunk in op.reply.getchunks():
148 > for chunk in op.reply.getchunks():
149 > file.write(chunk)
149 > file.write(chunk)
150 >
150 >
151 > @command('statbundle2', [], '')
151 > @command('statbundle2', [], '')
152 > def cmdstatbundle2(ui, repo):
152 > def cmdstatbundle2(ui, repo):
153 > """print statistic on the bundle2 container read from stdin"""
153 > """print statistic on the bundle2 container read from stdin"""
154 > unbundler = bundle2.unbundle20(ui, sys.stdin)
154 > unbundler = bundle2.unbundle20(ui, sys.stdin)
155 > try:
155 > try:
156 > params = unbundler.params
156 > params = unbundler.params
157 > except KeyError, exc:
157 > except KeyError, exc:
158 > raise util.Abort('unknown parameters: %s' % exc)
158 > raise util.Abort('unknown parameters: %s' % exc)
159 > ui.write('options count: %i\n' % len(params))
159 > ui.write('options count: %i\n' % len(params))
160 > for key in sorted(params):
160 > for key in sorted(params):
161 > ui.write('- %s\n' % key)
161 > ui.write('- %s\n' % key)
162 > value = params[key]
162 > value = params[key]
163 > if value is not None:
163 > if value is not None:
164 > ui.write(' %s\n' % value)
164 > ui.write(' %s\n' % value)
165 > count = 0
165 > count = 0
166 > for p in unbundler.iterparts():
166 > for p in unbundler.iterparts():
167 > count += 1
167 > count += 1
168 > ui.write(' :%s:\n' % p.type)
168 > ui.write(' :%s:\n' % p.type)
169 > ui.write(' mandatory: %i\n' % len(p.mandatoryparams))
169 > ui.write(' mandatory: %i\n' % len(p.mandatoryparams))
170 > ui.write(' advisory: %i\n' % len(p.advisoryparams))
170 > ui.write(' advisory: %i\n' % len(p.advisoryparams))
171 > ui.write(' payload: %i bytes\n' % len(p.read()))
171 > ui.write(' payload: %i bytes\n' % len(p.read()))
172 > ui.write('parts count: %i\n' % count)
172 > ui.write('parts count: %i\n' % count)
173 > EOF
173 > EOF
174 $ cat >> $HGRCPATH << EOF
174 $ cat >> $HGRCPATH << EOF
175 > [extensions]
175 > [extensions]
176 > bundle2=$TESTTMP/bundle2.py
176 > bundle2=$TESTTMP/bundle2.py
177 > [experimental]
177 > [experimental]
178 > bundle2-exp=True
178 > bundle2-exp=True
179 > [ui]
179 > [ui]
180 > ssh=python "$TESTDIR/dummyssh"
180 > ssh=python "$TESTDIR/dummyssh"
181 > [web]
181 > [web]
182 > push_ssl = false
182 > push_ssl = false
183 > allow_push = *
183 > allow_push = *
184 > EOF
184 > EOF
185
185
186 The extension requires a repo (currently unused)
186 The extension requires a repo (currently unused)
187
187
188 $ hg init main
188 $ hg init main
189 $ cd main
189 $ cd main
190 $ touch a
190 $ touch a
191 $ hg add a
191 $ hg add a
192 $ hg commit -m 'a'
192 $ hg commit -m 'a'
193
193
194
194
195 Empty bundle
195 Empty bundle
196 =================
196 =================
197
197
198 - no option
198 - no option
199 - no parts
199 - no parts
200
200
201 Test bundling
201 Test bundling
202
202
203 $ hg bundle2
203 $ hg bundle2
204 HG2X\x00\x00\x00\x00 (no-eol) (esc)
204 HG2X\x00\x00\x00\x00 (no-eol) (esc)
205
205
206 Test unbundling
206 Test unbundling
207
207
208 $ hg bundle2 | hg statbundle2
208 $ hg bundle2 | hg statbundle2
209 options count: 0
209 options count: 0
210 parts count: 0
210 parts count: 0
211
211
212 Test old style bundle are detected and refused
212 Test old style bundle are detected and refused
213
213
214 $ hg bundle --all ../bundle.hg
214 $ hg bundle --all ../bundle.hg
215 1 changesets found
215 1 changesets found
216 $ hg statbundle2 < ../bundle.hg
216 $ hg statbundle2 < ../bundle.hg
217 abort: unknown bundle version 10
217 abort: unknown bundle version 10
218 [255]
218 [255]
219
219
220 Test parameters
220 Test parameters
221 =================
221 =================
222
222
223 - some options
223 - some options
224 - no parts
224 - no parts
225
225
226 advisory parameters, no value
226 advisory parameters, no value
227 -------------------------------
227 -------------------------------
228
228
229 Simplest possible parameters form
229 Simplest possible parameters form
230
230
231 Test generation simple option
231 Test generation simple option
232
232
233 $ hg bundle2 --param 'caution'
233 $ hg bundle2 --param 'caution'
234 HG2X\x00\x07caution\x00\x00 (no-eol) (esc)
234 HG2X\x00\x07caution\x00\x00 (no-eol) (esc)
235
235
236 Test unbundling
236 Test unbundling
237
237
238 $ hg bundle2 --param 'caution' | hg statbundle2
238 $ hg bundle2 --param 'caution' | hg statbundle2
239 options count: 1
239 options count: 1
240 - caution
240 - caution
241 parts count: 0
241 parts count: 0
242
242
243 Test generation multiple option
243 Test generation multiple option
244
244
245 $ hg bundle2 --param 'caution' --param 'meal'
245 $ hg bundle2 --param 'caution' --param 'meal'
246 HG2X\x00\x0ccaution meal\x00\x00 (no-eol) (esc)
246 HG2X\x00\x0ccaution meal\x00\x00 (no-eol) (esc)
247
247
248 Test unbundling
248 Test unbundling
249
249
250 $ hg bundle2 --param 'caution' --param 'meal' | hg statbundle2
250 $ hg bundle2 --param 'caution' --param 'meal' | hg statbundle2
251 options count: 2
251 options count: 2
252 - caution
252 - caution
253 - meal
253 - meal
254 parts count: 0
254 parts count: 0
255
255
256 advisory parameters, with value
256 advisory parameters, with value
257 -------------------------------
257 -------------------------------
258
258
259 Test generation
259 Test generation
260
260
261 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants'
261 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants'
262 HG2X\x00\x1ccaution meal=vegan elephants\x00\x00 (no-eol) (esc)
262 HG2X\x00\x1ccaution meal=vegan elephants\x00\x00 (no-eol) (esc)
263
263
264 Test unbundling
264 Test unbundling
265
265
266 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | hg statbundle2
266 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | hg statbundle2
267 options count: 3
267 options count: 3
268 - caution
268 - caution
269 - elephants
269 - elephants
270 - meal
270 - meal
271 vegan
271 vegan
272 parts count: 0
272 parts count: 0
273
273
274 parameter with special char in value
274 parameter with special char in value
275 ---------------------------------------------------
275 ---------------------------------------------------
276
276
277 Test generation
277 Test generation
278
278
279 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple
279 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple
280 HG2X\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
280 HG2X\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
281
281
282 Test unbundling
282 Test unbundling
283
283
284 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | hg statbundle2
284 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | hg statbundle2
285 options count: 2
285 options count: 2
286 - e|! 7/
286 - e|! 7/
287 babar%#==tutu
287 babar%#==tutu
288 - simple
288 - simple
289 parts count: 0
289 parts count: 0
290
290
291 Test unknown mandatory option
291 Test unknown mandatory option
292 ---------------------------------------------------
292 ---------------------------------------------------
293
293
294 $ hg bundle2 --param 'Gravity' | hg statbundle2
294 $ hg bundle2 --param 'Gravity' | hg statbundle2
295 abort: unknown parameters: 'Gravity'
295 abort: unknown parameters: 'Gravity'
296 [255]
296 [255]
297
297
298 Test debug output
298 Test debug output
299 ---------------------------------------------------
299 ---------------------------------------------------
300
300
301 bundling debug
301 bundling debug
302
302
303 $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2
303 $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2
304 start emission of HG2X stream
304 start emission of HG2X stream
305 bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple
305 bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple
306 start of parts
306 start of parts
307 end of bundle
307 end of bundle
308
308
309 file content is ok
309 file content is ok
310
310
311 $ cat ../out.hg2
311 $ cat ../out.hg2
312 HG2X\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
312 HG2X\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00 (no-eol) (esc)
313
313
314 unbundling debug
314 unbundling debug
315
315
316 $ hg statbundle2 --debug < ../out.hg2
316 $ hg statbundle2 --debug < ../out.hg2
317 start processing of HG2X stream
317 start processing of HG2X stream
318 reading bundle2 stream parameters
318 reading bundle2 stream parameters
319 ignoring unknown parameter 'e|! 7/'
319 ignoring unknown parameter 'e|! 7/'
320 ignoring unknown parameter 'simple'
320 ignoring unknown parameter 'simple'
321 options count: 2
321 options count: 2
322 - e|! 7/
322 - e|! 7/
323 babar%#==tutu
323 babar%#==tutu
324 - simple
324 - simple
325 start extraction of bundle2 parts
325 start extraction of bundle2 parts
326 part header size: 0
326 part header size: 0
327 end of bundle2 stream
327 end of bundle2 stream
328 parts count: 0
328 parts count: 0
329
329
330
330
331 Test buggy input
331 Test buggy input
332 ---------------------------------------------------
332 ---------------------------------------------------
333
333
334 empty parameter name
334 empty parameter name
335
335
336 $ hg bundle2 --param '' --quiet
336 $ hg bundle2 --param '' --quiet
337 abort: empty parameter name
337 abort: empty parameter name
338 [255]
338 [255]
339
339
340 bad parameter name
340 bad parameter name
341
341
342 $ hg bundle2 --param 42babar
342 $ hg bundle2 --param 42babar
343 abort: non letter first character: '42babar'
343 abort: non letter first character: '42babar'
344 [255]
344 [255]
345
345
346
346
347 Test part
347 Test part
348 =================
348 =================
349
349
350 $ hg bundle2 --parts ../parts.hg2 --debug
350 $ hg bundle2 --parts ../parts.hg2 --debug
351 start emission of HG2X stream
351 start emission of HG2X stream
352 bundle parameter:
352 bundle parameter:
353 start of parts
353 start of parts
354 bundle part: "test:empty"
354 bundle part: "test:empty"
355 bundle part: "test:empty"
355 bundle part: "test:empty"
356 bundle part: "test:song"
356 bundle part: "test:song"
357 bundle part: "test:debugreply"
357 bundle part: "test:debugreply"
358 bundle part: "test:math"
358 bundle part: "test:math"
359 bundle part: "test:ping"
359 bundle part: "test:ping"
360 end of bundle
360 end of bundle
361
361
362 $ cat ../parts.hg2
362 $ cat ../parts.hg2
363 HG2X\x00\x00\x00\x11 (esc)
363 HG2X\x00\x00\x00\x11 (esc)
364 test:empty\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
364 test:empty\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
365 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)
365 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)
366 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
366 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
367 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\x10 test:ping\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
367 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\x10 test:ping\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
368
368
369
369
370 $ hg statbundle2 < ../parts.hg2
370 $ hg statbundle2 < ../parts.hg2
371 options count: 0
371 options count: 0
372 :test:empty:
372 :test:empty:
373 mandatory: 0
373 mandatory: 0
374 advisory: 0
374 advisory: 0
375 payload: 0 bytes
375 payload: 0 bytes
376 :test:empty:
376 :test:empty:
377 mandatory: 0
377 mandatory: 0
378 advisory: 0
378 advisory: 0
379 payload: 0 bytes
379 payload: 0 bytes
380 :test:song:
380 :test:song:
381 mandatory: 0
381 mandatory: 0
382 advisory: 0
382 advisory: 0
383 payload: 178 bytes
383 payload: 178 bytes
384 :test:debugreply:
384 :test:debugreply:
385 mandatory: 0
385 mandatory: 0
386 advisory: 0
386 advisory: 0
387 payload: 0 bytes
387 payload: 0 bytes
388 :test:math:
388 :test:math:
389 mandatory: 2
389 mandatory: 2
390 advisory: 1
390 advisory: 1
391 payload: 2 bytes
391 payload: 2 bytes
392 :test:ping:
392 :test:ping:
393 mandatory: 0
393 mandatory: 0
394 advisory: 0
394 advisory: 0
395 payload: 0 bytes
395 payload: 0 bytes
396 parts count: 6
396 parts count: 6
397
397
398 $ hg statbundle2 --debug < ../parts.hg2
398 $ hg statbundle2 --debug < ../parts.hg2
399 start processing of HG2X stream
399 start processing of HG2X stream
400 reading bundle2 stream parameters
400 reading bundle2 stream parameters
401 options count: 0
401 options count: 0
402 start extraction of bundle2 parts
402 start extraction of bundle2 parts
403 part header size: 17
403 part header size: 17
404 part type: "test:empty"
404 part type: "test:empty"
405 part id: "0"
405 part id: "0"
406 part parameters: 0
406 part parameters: 0
407 :test:empty:
407 :test:empty:
408 mandatory: 0
408 mandatory: 0
409 advisory: 0
409 advisory: 0
410 payload chunk size: 0
410 payload chunk size: 0
411 payload: 0 bytes
411 payload: 0 bytes
412 part header size: 17
412 part header size: 17
413 part type: "test:empty"
413 part type: "test:empty"
414 part id: "1"
414 part id: "1"
415 part parameters: 0
415 part parameters: 0
416 :test:empty:
416 :test:empty:
417 mandatory: 0
417 mandatory: 0
418 advisory: 0
418 advisory: 0
419 payload chunk size: 0
419 payload chunk size: 0
420 payload: 0 bytes
420 payload: 0 bytes
421 part header size: 16
421 part header size: 16
422 part type: "test:song"
422 part type: "test:song"
423 part id: "2"
423 part id: "2"
424 part parameters: 0
424 part parameters: 0
425 :test:song:
425 :test:song:
426 mandatory: 0
426 mandatory: 0
427 advisory: 0
427 advisory: 0
428 payload chunk size: 178
428 payload chunk size: 178
429 payload chunk size: 0
429 payload chunk size: 0
430 payload: 178 bytes
430 payload: 178 bytes
431 part header size: 22
431 part header size: 22
432 part type: "test:debugreply"
432 part type: "test:debugreply"
433 part id: "3"
433 part id: "3"
434 part parameters: 0
434 part parameters: 0
435 :test:debugreply:
435 :test:debugreply:
436 mandatory: 0
436 mandatory: 0
437 advisory: 0
437 advisory: 0
438 payload chunk size: 0
438 payload chunk size: 0
439 payload: 0 bytes
439 payload: 0 bytes
440 part header size: 43
440 part header size: 43
441 part type: "test:math"
441 part type: "test:math"
442 part id: "4"
442 part id: "4"
443 part parameters: 3
443 part parameters: 3
444 :test:math:
444 :test:math:
445 mandatory: 2
445 mandatory: 2
446 advisory: 1
446 advisory: 1
447 payload chunk size: 2
447 payload chunk size: 2
448 payload chunk size: 0
448 payload chunk size: 0
449 payload: 2 bytes
449 payload: 2 bytes
450 part header size: 16
450 part header size: 16
451 part type: "test:ping"
451 part type: "test:ping"
452 part id: "5"
452 part id: "5"
453 part parameters: 0
453 part parameters: 0
454 :test:ping:
454 :test:ping:
455 mandatory: 0
455 mandatory: 0
456 advisory: 0
456 advisory: 0
457 payload chunk size: 0
457 payload chunk size: 0
458 payload: 0 bytes
458 payload: 0 bytes
459 part header size: 0
459 part header size: 0
460 end of bundle2 stream
460 end of bundle2 stream
461 parts count: 6
461 parts count: 6
462
462
463 Test actual unbundling of test part
463 Test actual unbundling of test part
464 =======================================
464 =======================================
465
465
466 Process the bundle
466 Process the bundle
467
467
468 $ hg unbundle2 --debug < ../parts.hg2
468 $ hg unbundle2 --debug < ../parts.hg2
469 start processing of HG2X stream
469 start processing of HG2X stream
470 reading bundle2 stream parameters
470 reading bundle2 stream parameters
471 start extraction of bundle2 parts
471 start extraction of bundle2 parts
472 part header size: 17
472 part header size: 17
473 part type: "test:empty"
473 part type: "test:empty"
474 part id: "0"
474 part id: "0"
475 part parameters: 0
475 part parameters: 0
476 ignoring unknown advisory part 'test:empty'
476 ignoring unknown advisory part 'test:empty'
477 payload chunk size: 0
477 payload chunk size: 0
478 part header size: 17
478 part header size: 17
479 part type: "test:empty"
479 part type: "test:empty"
480 part id: "1"
480 part id: "1"
481 part parameters: 0
481 part parameters: 0
482 ignoring unknown advisory part 'test:empty'
482 ignoring unknown advisory part 'test:empty'
483 payload chunk size: 0
483 payload chunk size: 0
484 part header size: 16
484 part header size: 16
485 part type: "test:song"
485 part type: "test:song"
486 part id: "2"
486 part id: "2"
487 part parameters: 0
487 part parameters: 0
488 found a handler for part 'test:song'
488 found a handler for part 'test:song'
489 The choir starts singing:
489 The choir starts singing:
490 payload chunk size: 178
490 payload chunk size: 178
491 payload chunk size: 0
491 payload chunk size: 0
492 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
492 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
493 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
493 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
494 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
494 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
495 part header size: 22
495 part header size: 22
496 part type: "test:debugreply"
496 part type: "test:debugreply"
497 part id: "3"
497 part id: "3"
498 part parameters: 0
498 part parameters: 0
499 found a handler for part 'test:debugreply'
499 found a handler for part 'test:debugreply'
500 debugreply: no reply
500 debugreply: no reply
501 payload chunk size: 0
501 payload chunk size: 0
502 part header size: 43
502 part header size: 43
503 part type: "test:math"
503 part type: "test:math"
504 part id: "4"
504 part id: "4"
505 part parameters: 3
505 part parameters: 3
506 ignoring unknown advisory part 'test:math'
506 ignoring unknown advisory part 'test:math'
507 payload chunk size: 2
507 payload chunk size: 2
508 payload chunk size: 0
508 payload chunk size: 0
509 part header size: 16
509 part header size: 16
510 part type: "test:ping"
510 part type: "test:ping"
511 part id: "5"
511 part id: "5"
512 part parameters: 0
512 part parameters: 0
513 found a handler for part 'test:ping'
513 found a handler for part 'test:ping'
514 received ping request (id 5)
514 received ping request (id 5)
515 payload chunk size: 0
515 payload chunk size: 0
516 part header size: 0
516 part header size: 0
517 end of bundle2 stream
517 end of bundle2 stream
518 0 unread bytes
518 0 unread bytes
519 3 total verses sung
519 3 total verses sung
520
520
521 Unbundle with an unknown mandatory part
521 Unbundle with an unknown mandatory part
522 (should abort)
522 (should abort)
523
523
524 $ hg bundle2 --parts --unknown ../unknown.hg2
524 $ hg bundle2 --parts --unknown ../unknown.hg2
525
525
526 $ hg unbundle2 < ../unknown.hg2
526 $ hg unbundle2 < ../unknown.hg2
527 The choir starts singing:
527 The choir starts singing:
528 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
528 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
529 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
529 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
530 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
530 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
531 debugreply: no reply
531 debugreply: no reply
532 0 unread bytes
532 0 unread bytes
533 abort: missing support for 'test:unknown'
533 abort: missing support for 'test:unknown'
534 [255]
534 [255]
535
535
536 unbundle with a reply
536 unbundle with a reply
537
537
538 $ hg bundle2 --parts --reply ../parts-reply.hg2
538 $ hg bundle2 --parts --reply ../parts-reply.hg2
539 $ hg unbundle2 ../reply.hg2 < ../parts-reply.hg2
539 $ hg unbundle2 ../reply.hg2 < ../parts-reply.hg2
540 0 unread bytes
540 0 unread bytes
541 3 total verses sung
541 3 total verses sung
542
542
543 The reply is a bundle
543 The reply is a bundle
544
544
545 $ cat ../reply.hg2
545 $ cat ../reply.hg2
546 HG2X\x00\x00\x00\x1f (esc)
546 HG2X\x00\x00\x00\x1f (esc)
547 b2x:output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc)
547 b2x:output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc)
548 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
548 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
549 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
549 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
550 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
550 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
551 \x00\x00\x00\x00\x00\x1f (esc)
551 \x00\x00\x00\x00\x00\x1f (esc)
552 b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to4\x00\x00\x00\xc9debugreply: capabilities: (esc)
552 b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to4\x00\x00\x00\xc9debugreply: capabilities: (esc)
553 debugreply: 'city=!'
553 debugreply: 'city=!'
554 debugreply: 'celeste,ville'
554 debugreply: 'celeste,ville'
555 debugreply: 'elephants'
555 debugreply: 'elephants'
556 debugreply: 'babar'
556 debugreply: 'babar'
557 debugreply: 'celeste'
557 debugreply: 'celeste'
558 debugreply: 'ping-pong'
558 debugreply: 'ping-pong'
559 \x00\x00\x00\x00\x00\x1e test:pong\x00\x00\x00\x02\x01\x00\x0b\x01in-reply-to6\x00\x00\x00\x00\x00\x1f (esc)
559 \x00\x00\x00\x00\x00\x1e test:pong\x00\x00\x00\x02\x01\x00\x0b\x01in-reply-to6\x00\x00\x00\x00\x00\x1f (esc)
560 b2x:output\x00\x00\x00\x03\x00\x01\x0b\x01in-reply-to6\x00\x00\x00=received ping request (id 6) (esc)
560 b2x:output\x00\x00\x00\x03\x00\x01\x0b\x01in-reply-to6\x00\x00\x00=received ping request (id 6) (esc)
561 replying to ping request (id 6)
561 replying to ping request (id 6)
562 \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
562 \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
563
563
564 The reply is valid
564 The reply is valid
565
565
566 $ hg statbundle2 < ../reply.hg2
566 $ hg statbundle2 < ../reply.hg2
567 options count: 0
567 options count: 0
568 :b2x:output:
568 :b2x:output:
569 mandatory: 0
569 mandatory: 0
570 advisory: 1
570 advisory: 1
571 payload: 217 bytes
571 payload: 217 bytes
572 :b2x:output:
572 :b2x:output:
573 mandatory: 0
573 mandatory: 0
574 advisory: 1
574 advisory: 1
575 payload: 201 bytes
575 payload: 201 bytes
576 :test:pong:
576 :test:pong:
577 mandatory: 1
577 mandatory: 1
578 advisory: 0
578 advisory: 0
579 payload: 0 bytes
579 payload: 0 bytes
580 :b2x:output:
580 :b2x:output:
581 mandatory: 0
581 mandatory: 0
582 advisory: 1
582 advisory: 1
583 payload: 61 bytes
583 payload: 61 bytes
584 parts count: 4
584 parts count: 4
585
585
586 Unbundle the reply to get the output:
586 Unbundle the reply to get the output:
587
587
588 $ hg unbundle2 < ../reply.hg2
588 $ hg unbundle2 < ../reply.hg2
589 remote: The choir starts singing:
589 remote: The choir starts singing:
590 remote: Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
590 remote: Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
591 remote: Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
591 remote: Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
592 remote: Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
592 remote: Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
593 remote: debugreply: capabilities:
593 remote: debugreply: capabilities:
594 remote: debugreply: 'city=!'
594 remote: debugreply: 'city=!'
595 remote: debugreply: 'celeste,ville'
595 remote: debugreply: 'celeste,ville'
596 remote: debugreply: 'elephants'
596 remote: debugreply: 'elephants'
597 remote: debugreply: 'babar'
597 remote: debugreply: 'babar'
598 remote: debugreply: 'celeste'
598 remote: debugreply: 'celeste'
599 remote: debugreply: 'ping-pong'
599 remote: debugreply: 'ping-pong'
600 remote: received ping request (id 6)
600 remote: received ping request (id 6)
601 remote: replying to ping request (id 6)
601 remote: replying to ping request (id 6)
602 0 unread bytes
602 0 unread bytes
603
603
604 Support for changegroup
604 Support for changegroup
605 ===================================
605 ===================================
606
606
607 $ hg unbundle $TESTDIR/bundles/rebase.hg
607 $ hg unbundle $TESTDIR/bundles/rebase.hg
608 adding changesets
608 adding changesets
609 adding manifests
609 adding manifests
610 adding file changes
610 adding file changes
611 added 8 changesets with 7 changes to 7 files (+3 heads)
611 added 8 changesets with 7 changes to 7 files (+3 heads)
612 (run 'hg heads' to see heads, 'hg merge' to merge)
612 (run 'hg heads' to see heads, 'hg merge' to merge)
613
613
614 $ hg log -G
614 $ hg log -G
615 o changeset: 8:02de42196ebe
615 o changeset: 8:02de42196ebe
616 | tag: tip
616 | tag: tip
617 | parent: 6:24b6387c8c8c
617 | parent: 6:24b6387c8c8c
618 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
618 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
619 | date: Sat Apr 30 15:24:48 2011 +0200
619 | date: Sat Apr 30 15:24:48 2011 +0200
620 | summary: H
620 | summary: H
621 |
621 |
622 | o changeset: 7:eea13746799a
622 | o changeset: 7:eea13746799a
623 |/| parent: 6:24b6387c8c8c
623 |/| parent: 6:24b6387c8c8c
624 | | parent: 5:9520eea781bc
624 | | parent: 5:9520eea781bc
625 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
625 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
626 | | date: Sat Apr 30 15:24:48 2011 +0200
626 | | date: Sat Apr 30 15:24:48 2011 +0200
627 | | summary: G
627 | | summary: G
628 | |
628 | |
629 o | changeset: 6:24b6387c8c8c
629 o | changeset: 6:24b6387c8c8c
630 | | parent: 1:cd010b8cd998
630 | | parent: 1:cd010b8cd998
631 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
631 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
632 | | date: Sat Apr 30 15:24:48 2011 +0200
632 | | date: Sat Apr 30 15:24:48 2011 +0200
633 | | summary: F
633 | | summary: F
634 | |
634 | |
635 | o changeset: 5:9520eea781bc
635 | o changeset: 5:9520eea781bc
636 |/ parent: 1:cd010b8cd998
636 |/ parent: 1:cd010b8cd998
637 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
637 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
638 | date: Sat Apr 30 15:24:48 2011 +0200
638 | date: Sat Apr 30 15:24:48 2011 +0200
639 | summary: E
639 | summary: E
640 |
640 |
641 | o changeset: 4:32af7686d403
641 | o changeset: 4:32af7686d403
642 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
642 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
643 | | date: Sat Apr 30 15:24:48 2011 +0200
643 | | date: Sat Apr 30 15:24:48 2011 +0200
644 | | summary: D
644 | | summary: D
645 | |
645 | |
646 | o changeset: 3:5fddd98957c8
646 | o changeset: 3:5fddd98957c8
647 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
647 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
648 | | date: Sat Apr 30 15:24:48 2011 +0200
648 | | date: Sat Apr 30 15:24:48 2011 +0200
649 | | summary: C
649 | | summary: C
650 | |
650 | |
651 | o changeset: 2:42ccdea3bb16
651 | o changeset: 2:42ccdea3bb16
652 |/ user: Nicolas Dumazet <nicdumz.commits@gmail.com>
652 |/ user: Nicolas Dumazet <nicdumz.commits@gmail.com>
653 | date: Sat Apr 30 15:24:48 2011 +0200
653 | date: Sat Apr 30 15:24:48 2011 +0200
654 | summary: B
654 | summary: B
655 |
655 |
656 o changeset: 1:cd010b8cd998
656 o changeset: 1:cd010b8cd998
657 parent: -1:000000000000
657 parent: -1:000000000000
658 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
658 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
659 date: Sat Apr 30 15:24:48 2011 +0200
659 date: Sat Apr 30 15:24:48 2011 +0200
660 summary: A
660 summary: A
661
661
662 @ changeset: 0:3903775176ed
662 @ changeset: 0:3903775176ed
663 user: test
663 user: test
664 date: Thu Jan 01 00:00:00 1970 +0000
664 date: Thu Jan 01 00:00:00 1970 +0000
665 summary: a
665 summary: a
666
666
667
667
668 $ hg bundle2 --debug --rev '8+7+5+4' ../rev.hg2
668 $ hg bundle2 --debug --rev '8+7+5+4' ../rev.hg2
669 4 changesets found
669 4 changesets found
670 list of changesets:
670 list of changesets:
671 32af7686d403cf45b5d95f2d70cebea587ac806a
671 32af7686d403cf45b5d95f2d70cebea587ac806a
672 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
672 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
673 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
673 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
674 02de42196ebee42ef284b6780a87cdc96e8eaab6
674 02de42196ebee42ef284b6780a87cdc96e8eaab6
675 start emission of HG2X stream
675 start emission of HG2X stream
676 bundle parameter:
676 bundle parameter:
677 start of parts
677 start of parts
678 bundle part: "b2x:changegroup"
678 bundle part: "b2x:changegroup"
679 bundling: 1/4 changesets (25.00%)
679 bundling: 1/4 changesets (25.00%)
680 bundling: 2/4 changesets (50.00%)
680 bundling: 2/4 changesets (50.00%)
681 bundling: 3/4 changesets (75.00%)
681 bundling: 3/4 changesets (75.00%)
682 bundling: 4/4 changesets (100.00%)
682 bundling: 4/4 changesets (100.00%)
683 bundling: 1/4 manifests (25.00%)
683 bundling: 1/4 manifests (25.00%)
684 bundling: 2/4 manifests (50.00%)
684 bundling: 2/4 manifests (50.00%)
685 bundling: 3/4 manifests (75.00%)
685 bundling: 3/4 manifests (75.00%)
686 bundling: 4/4 manifests (100.00%)
686 bundling: 4/4 manifests (100.00%)
687 bundling: D 1/3 files (33.33%)
687 bundling: D 1/3 files (33.33%)
688 bundling: E 2/3 files (66.67%)
688 bundling: E 2/3 files (66.67%)
689 bundling: H 3/3 files (100.00%)
689 bundling: H 3/3 files (100.00%)
690 end of bundle
690 end of bundle
691
691
692 $ cat ../rev.hg2
692 $ cat ../rev.hg2
693 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)
693 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)
694 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc)
694 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc)
695 \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)
695 \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)
696 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02E (esc)
696 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02E (esc)
697 \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)
697 \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)
698 \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)
698 \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)
699 \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)
699 \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)
700 \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)8bee48edc7318541fc0013ee41b089276a8c24bf (esc)
700 \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)8bee48edc7318541fc0013ee41b089276a8c24bf (esc)
701 \x00\x00\x00f\x00\x00\x00f\x00\x00\x00\x02H (esc)
701 \x00\x00\x00f\x00\x00\x00f\x00\x00\x00\x02H (esc)
702 \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)
702 \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)
703 \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)
703 \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)
704 \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)
704 \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)
705 \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)
705 \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)
706 \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)
706 \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)
707 \x00\x00\x00\x00\x00\x00\x00\x05D\x00\x00\x00b\xc3\xf1\xca)$\xc1j\x19\xb0ej\x84\x90\x0ePN[ (esc)
707 \x00\x00\x00\x00\x00\x00\x00\x05D\x00\x00\x00b\xc3\xf1\xca)$\xc1j\x19\xb0ej\x84\x90\x0ePN[ (esc)
708 \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)
708 \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)
709 \x00\x00\x00\x00\x00\x00\x00\x05E\x00\x00\x00b\x9co\xd05 (esc)
709 \x00\x00\x00\x00\x00\x00\x00\x05E\x00\x00\x00b\x9co\xd05 (esc)
710 l\r (no-eol) (esc)
710 l\r (no-eol) (esc)
711 \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)
711 \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)
712 \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)
712 \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)
713 \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02H (esc)
713 \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02H (esc)
714 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
714 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
715
715
716 $ hg unbundle2 < ../rev.hg2
716 $ hg unbundle2 < ../rev.hg2
717 adding changesets
717 adding changesets
718 adding manifests
718 adding manifests
719 adding file changes
719 adding file changes
720 added 0 changesets with 0 changes to 3 files
720 added 0 changesets with 0 changes to 3 files
721 0 unread bytes
721 0 unread bytes
722 addchangegroup return: 1
722 addchangegroup return: 1
723
723
724 with reply
724 with reply
725
725
726 $ hg bundle2 --rev '8+7+5+4' --reply ../rev-rr.hg2
726 $ hg bundle2 --rev '8+7+5+4' --reply ../rev-rr.hg2
727 $ hg unbundle2 ../rev-reply.hg2 < ../rev-rr.hg2
727 $ hg unbundle2 ../rev-reply.hg2 < ../rev-rr.hg2
728 0 unread bytes
728 0 unread bytes
729 addchangegroup return: 1
729 addchangegroup return: 1
730
730
731 $ cat ../rev-reply.hg2
731 $ cat ../rev-reply.hg2
732 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)
732 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)
733 b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to1\x00\x00\x00dadding changesets (esc)
733 b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to1\x00\x00\x00dadding changesets (esc)
734 adding manifests
734 adding manifests
735 adding file changes
735 adding file changes
736 added 0 changesets with 0 changes to 3 files
736 added 0 changesets with 0 changes to 3 files
737 \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
737 \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
738
738
739 Real world exchange
739 Real world exchange
740 =====================
740 =====================
741
741
742
742
743 clone --pull
743 clone --pull
744
744
745 $ cd ..
745 $ cd ..
746 $ hg clone main other --pull --rev 9520eea781bc
746 $ hg clone main other --pull --rev 9520eea781bc
747 adding changesets
747 adding changesets
748 adding manifests
748 adding manifests
749 adding file changes
749 adding file changes
750 added 2 changesets with 2 changes to 2 files
750 added 2 changesets with 2 changes to 2 files
751 updating to branch default
751 updating to branch default
752 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
752 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
753 $ hg -R other log -G
753 $ hg -R other log -G
754 @ changeset: 1:9520eea781bc
754 @ changeset: 1:9520eea781bc
755 | tag: tip
755 | tag: tip
756 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
756 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
757 | date: Sat Apr 30 15:24:48 2011 +0200
757 | date: Sat Apr 30 15:24:48 2011 +0200
758 | summary: E
758 | summary: E
759 |
759 |
760 o changeset: 0:cd010b8cd998
760 o changeset: 0:cd010b8cd998
761 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
761 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
762 date: Sat Apr 30 15:24:48 2011 +0200
762 date: Sat Apr 30 15:24:48 2011 +0200
763 summary: A
763 summary: A
764
764
765
765
766 pull
766 pull
767
767
768 $ hg -R other pull -r 24b6387c8c8c
768 $ hg -R other pull -r 24b6387c8c8c
769 pulling from $TESTTMP/main (glob)
769 pulling from $TESTTMP/main (glob)
770 searching for changes
770 searching for changes
771 adding changesets
771 adding changesets
772 adding manifests
772 adding manifests
773 adding file changes
773 adding file changes
774 added 1 changesets with 1 changes to 1 files (+1 heads)
774 added 1 changesets with 1 changes to 1 files (+1 heads)
775 (run 'hg heads' to see heads, 'hg merge' to merge)
775 (run 'hg heads' to see heads, 'hg merge' to merge)
776
776
777 push
777 push
778
778
779 $ hg -R main push other --rev eea13746799a
779 $ hg -R main push other --rev eea13746799a
780 pushing to other
780 pushing to other
781 searching for changes
781 searching for changes
782 remote: adding changesets
782 remote: adding changesets
783 remote: adding manifests
783 remote: adding manifests
784 remote: adding file changes
784 remote: adding file changes
785 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
785 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
786
786
787 pull over ssh
787 pull over ssh
788
788
789 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --traceback
789 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --traceback
790 pulling from ssh://user@dummy/main
790 pulling from ssh://user@dummy/main
791 searching for changes
791 searching for changes
792 adding changesets
792 adding changesets
793 adding manifests
793 adding manifests
794 adding file changes
794 adding file changes
795 added 1 changesets with 1 changes to 1 files (+1 heads)
795 added 1 changesets with 1 changes to 1 files (+1 heads)
796 (run 'hg heads' to see heads, 'hg merge' to merge)
796 (run 'hg heads' to see heads, 'hg merge' to merge)
797
797
798 pull over http
798 pull over http
799
799
800 $ hg -R main serve -p $HGPORT -d --pid-file=main.pid -E main-error.log
800 $ hg -R main serve -p $HGPORT -d --pid-file=main.pid -E main-error.log
801 $ cat main.pid >> $DAEMON_PIDS
801 $ cat main.pid >> $DAEMON_PIDS
802
802
803 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16
803 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16
804 pulling from http://localhost:$HGPORT/
804 pulling from http://localhost:$HGPORT/
805 searching for changes
805 searching for changes
806 adding changesets
806 adding changesets
807 adding manifests
807 adding manifests
808 adding file changes
808 adding file changes
809 added 1 changesets with 1 changes to 1 files (+1 heads)
809 added 1 changesets with 1 changes to 1 files (+1 heads)
810 (run 'hg heads .' to see heads, 'hg merge' to merge)
810 (run 'hg heads .' to see heads, 'hg merge' to merge)
811 $ cat main-error.log
811 $ cat main-error.log
812
812
813 push over ssh
813 push over ssh
814
814
815 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8
815 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8
816 pushing to ssh://user@dummy/other
816 pushing to ssh://user@dummy/other
817 searching for changes
817 searching for changes
818 remote: adding changesets
818 remote: adding changesets
819 remote: adding manifests
819 remote: adding manifests
820 remote: adding file changes
820 remote: adding file changes
821 remote: added 1 changesets with 1 changes to 1 files
821 remote: added 1 changesets with 1 changes to 1 files
822
822
823 push over http
823 push over http
824
824
825 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
825 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
826 $ cat other.pid >> $DAEMON_PIDS
826 $ cat other.pid >> $DAEMON_PIDS
827
827
828 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403
828 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403
829 pushing to http://localhost:$HGPORT2/
829 pushing to http://localhost:$HGPORT2/
830 searching for changes
830 searching for changes
831 remote: adding changesets
831 remote: adding changesets
832 remote: adding manifests
832 remote: adding manifests
833 remote: adding file changes
833 remote: adding file changes
834 remote: added 1 changesets with 1 changes to 1 files
834 remote: added 1 changesets with 1 changes to 1 files
835 $ cat other-error.log
835 $ cat other-error.log
836
836
837 Check final content.
837 Check final content.
838
838
839 $ hg -R other log -G
839 $ hg -R other log -G
840 o changeset: 7:32af7686d403
840 o changeset: 7:32af7686d403
841 | tag: tip
841 | tag: tip
842 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
842 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
843 | date: Sat Apr 30 15:24:48 2011 +0200
843 | date: Sat Apr 30 15:24:48 2011 +0200
844 | summary: D
844 | summary: D
845 |
845 |
846 o changeset: 6:5fddd98957c8
846 o changeset: 6:5fddd98957c8
847 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
847 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
848 | date: Sat Apr 30 15:24:48 2011 +0200
848 | date: Sat Apr 30 15:24:48 2011 +0200
849 | summary: C
849 | summary: C
850 |
850 |
851 o changeset: 5:42ccdea3bb16
851 o changeset: 5:42ccdea3bb16
852 | parent: 0:cd010b8cd998
852 | parent: 0:cd010b8cd998
853 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
853 | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
854 | date: Sat Apr 30 15:24:48 2011 +0200
854 | date: Sat Apr 30 15:24:48 2011 +0200
855 | summary: B
855 | summary: B
856 |
856 |
857 | o changeset: 4:02de42196ebe
857 | o changeset: 4:02de42196ebe
858 | | parent: 2:24b6387c8c8c
858 | | parent: 2:24b6387c8c8c
859 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
859 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
860 | | date: Sat Apr 30 15:24:48 2011 +0200
860 | | date: Sat Apr 30 15:24:48 2011 +0200
861 | | summary: H
861 | | summary: H
862 | |
862 | |
863 | | o changeset: 3:eea13746799a
863 | | o changeset: 3:eea13746799a
864 | |/| parent: 2:24b6387c8c8c
864 | |/| parent: 2:24b6387c8c8c
865 | | | parent: 1:9520eea781bc
865 | | | parent: 1:9520eea781bc
866 | | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
866 | | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
867 | | | date: Sat Apr 30 15:24:48 2011 +0200
867 | | | date: Sat Apr 30 15:24:48 2011 +0200
868 | | | summary: G
868 | | | summary: G
869 | | |
869 | | |
870 | o | changeset: 2:24b6387c8c8c
870 | o | changeset: 2:24b6387c8c8c
871 |/ / parent: 0:cd010b8cd998
871 |/ / parent: 0:cd010b8cd998
872 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
872 | | user: Nicolas Dumazet <nicdumz.commits@gmail.com>
873 | | date: Sat Apr 30 15:24:48 2011 +0200
873 | | date: Sat Apr 30 15:24:48 2011 +0200
874 | | summary: F
874 | | summary: F
875 | |
875 | |
876 | @ changeset: 1:9520eea781bc
876 | @ changeset: 1:9520eea781bc
877 |/ user: Nicolas Dumazet <nicdumz.commits@gmail.com>
877 |/ user: Nicolas Dumazet <nicdumz.commits@gmail.com>
878 | date: Sat Apr 30 15:24:48 2011 +0200
878 | date: Sat Apr 30 15:24:48 2011 +0200
879 | summary: E
879 | summary: E
880 |
880 |
881 o changeset: 0:cd010b8cd998
881 o changeset: 0:cd010b8cd998
882 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
882 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
883 date: Sat Apr 30 15:24:48 2011 +0200
883 date: Sat Apr 30 15:24:48 2011 +0200
884 summary: A
884 summary: A
885
885
886
886
887 Error Handling
887 Error Handling
888 ==============
888 ==============
889
889
890 Check that errors are properly returned to the client during push.
890 Check that errors are properly returned to the client during push.
891
891
892 Setting up
892 Setting up
893
893
894 $ cat > failpush.py << EOF
894 $ cat > failpush.py << EOF
895 > """A small extension that makes push fails when using bundle2
895 > """A small extension that makes push fails when using bundle2
896 >
896 >
897 > used to test error handling in bundle2
897 > used to test error handling in bundle2
898 > """
898 > """
899 >
899 >
900 > from mercurial import util
900 > from mercurial import util
901 > from mercurial import bundle2
901 > from mercurial import bundle2
902 > from mercurial import exchange
902 > from mercurial import exchange
903 > from mercurial import extensions
903 > from mercurial import extensions
904 >
904 >
905 > def _pushbundle2failpart(orig, pushop, bundler):
905 > def _pushbundle2failpart(orig, pushop, bundler):
906 > extradata = orig(pushop, bundler)
906 > extradata = orig(pushop, bundler)
907 > part = bundle2.bundlepart('test:abort')
907 > reason = pushop.ui.config('failpush', 'reason', None)
908 > bundler.addpart(part)
908 > part = None
909 > if reason == 'abort':
910 > part = bundle2.bundlepart('test:abort')
911 > if part is not None:
912 > bundler.addpart(part)
909 > return extradata
913 > return extradata
910 >
914 >
911 > @bundle2.parthandler("test:abort")
915 > @bundle2.parthandler("test:abort")
912 > def handleabort(op, part):
916 > def handleabort(op, part):
913 > raise util.Abort('Abandon ship!', hint="don't panic")
917 > raise util.Abort('Abandon ship!', hint="don't panic")
914 >
918 >
915 > def uisetup(ui):
919 > def uisetup(ui):
916 > extensions.wrapfunction(exchange, '_pushbundle2extraparts', _pushbundle2failpart)
920 > extensions.wrapfunction(exchange, '_pushbundle2extraparts', _pushbundle2failpart)
917 >
921 >
918 > EOF
922 > EOF
919
923
920 $ cd main
924 $ cd main
921 $ hg up tip
925 $ hg up tip
922 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
926 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
923 $ echo 'I' > I
927 $ echo 'I' > I
924 $ hg add I
928 $ hg add I
925 $ hg ci -m 'I'
929 $ hg ci -m 'I'
926 $ hg id
930 $ hg id
927 e7ec4e813ba6 tip
931 e7ec4e813ba6 tip
928 $ cd ..
932 $ cd ..
929
933
930 $ cat << EOF >> $HGRCPATH
934 $ cat << EOF >> $HGRCPATH
931 > [extensions]
935 > [extensions]
932 > failpush=$TESTTMP/failpush.py
936 > failpush=$TESTTMP/failpush.py
933 > EOF
937 > EOF
934
938
935 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
939 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
936 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
940 $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
937 $ cat other.pid >> $DAEMON_PIDS
941 $ cat other.pid >> $DAEMON_PIDS
938
942
939 Doing the actual push: Abort error
943 Doing the actual push: Abort error
940
944
945 $ cat << EOF >> $HGRCPATH
946 > [failpush]
947 > reason = abort
948 > EOF
949
941 $ hg -R main push other -r e7ec4e813ba6
950 $ hg -R main push other -r e7ec4e813ba6
942 pushing to other
951 pushing to other
943 searching for changes
952 searching for changes
944 abort: Abandon ship!
953 abort: Abandon ship!
945 (don't panic)
954 (don't panic)
946 [255]
955 [255]
947
956
948 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
957 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
949 pushing to ssh://user@dummy/other
958 pushing to ssh://user@dummy/other
950 searching for changes
959 searching for changes
951 abort: Abandon ship!
960 abort: Abandon ship!
952 (don't panic)
961 (don't panic)
953 [255]
962 [255]
954
963
955 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
964 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
956 pushing to http://localhost:$HGPORT2/
965 pushing to http://localhost:$HGPORT2/
957 searching for changes
966 searching for changes
958 abort: Abandon ship!
967 abort: Abandon ship!
959 (don't panic)
968 (don't panic)
960 [255]
969 [255]
961
970
962
971
General Comments 0
You need to be logged in to leave comments. Login now