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