Show More
@@ -1,887 +1,1048 b'' | |||||
1 | This test is dedicated to test the bundle2 container format |
|
1 | This test is dedicated to test the bundle2 container format | |
2 |
|
2 | |||
3 | It test multiple existing parts to test different feature of the container. You |
|
3 | It test multiple existing parts to test different feature of the container. You | |
4 | probably do not need to touch this test unless you change the binary encoding |
|
4 | probably do not need to touch this test unless you change the binary encoding | |
5 | of the bundle2 format itself. |
|
5 | of the bundle2 format itself. | |
6 |
|
6 | |||
7 | Create an extension to test bundle2 API |
|
7 | Create an extension to test bundle2 API | |
8 |
|
8 | |||
9 | $ cat > bundle2.py << EOF |
|
9 | $ cat > bundle2.py << EOF | |
10 | > """A small extension to test bundle2 implementation |
|
10 | > """A small extension to test bundle2 implementation | |
11 | > |
|
11 | > | |
12 | > Current bundle2 implementation is far too limited to be used in any core |
|
12 | > Current bundle2 implementation is far too limited to be used in any core | |
13 | > code. We still need to be able to test it while it grow up. |
|
13 | > code. We still need to be able to test it while it grow up. | |
14 | > """ |
|
14 | > """ | |
15 | > |
|
15 | > | |
16 | > import sys, os |
|
16 | > import sys, os | |
17 | > from mercurial import cmdutil |
|
17 | > from mercurial import cmdutil | |
18 | > from mercurial import util |
|
18 | > from mercurial import util | |
19 | > from mercurial import bundle2 |
|
19 | > from mercurial import bundle2 | |
20 | > from mercurial import scmutil |
|
20 | > from mercurial import scmutil | |
21 | > from mercurial import discovery |
|
21 | > from mercurial import discovery | |
22 | > from mercurial import changegroup |
|
22 | > from mercurial import changegroup | |
23 | > from mercurial import error |
|
23 | > from mercurial import error | |
24 | > from mercurial import obsolete |
|
24 | > from mercurial import obsolete | |
25 | > |
|
25 | > | |
26 | > |
|
26 | > | |
27 | > try: |
|
27 | > try: | |
28 | > import msvcrt |
|
28 | > import msvcrt | |
29 | > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) |
|
29 | > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) | |
30 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
30 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |
31 | > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) |
|
31 | > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) | |
32 | > except ImportError: |
|
32 | > except ImportError: | |
33 | > pass |
|
33 | > pass | |
34 | > |
|
34 | > | |
35 | > cmdtable = {} |
|
35 | > cmdtable = {} | |
36 | > command = cmdutil.command(cmdtable) |
|
36 | > command = cmdutil.command(cmdtable) | |
37 | > |
|
37 | > | |
38 | > ELEPHANTSSONG = """Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko |
|
38 | > ELEPHANTSSONG = """Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko | |
39 | > Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko |
|
39 | > Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko | |
40 | > Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.""" |
|
40 | > Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.""" | |
41 | > assert len(ELEPHANTSSONG) == 178 # future test say 178 bytes, trust it. |
|
41 | > assert len(ELEPHANTSSONG) == 178 # future test say 178 bytes, trust it. | |
42 | > |
|
42 | > | |
43 | > @bundle2.parthandler('test:song') |
|
43 | > @bundle2.parthandler('test:song') | |
44 | > def songhandler(op, part): |
|
44 | > def songhandler(op, part): | |
45 | > """handle a "test:song" bundle2 part, printing the lyrics on stdin""" |
|
45 | > """handle a "test:song" bundle2 part, printing the lyrics on stdin""" | |
46 | > op.ui.write('The choir starts singing:\n') |
|
46 | > op.ui.write('The choir starts singing:\n') | |
47 | > verses = 0 |
|
47 | > verses = 0 | |
48 | > for line in part.read().split('\n'): |
|
48 | > for line in part.read().split('\n'): | |
49 | > op.ui.write(' %s\n' % line) |
|
49 | > op.ui.write(' %s\n' % line) | |
50 | > verses += 1 |
|
50 | > verses += 1 | |
51 | > op.records.add('song', {'verses': verses}) |
|
51 | > op.records.add('song', {'verses': verses}) | |
52 | > |
|
52 | > | |
53 | > @bundle2.parthandler('test:ping') |
|
53 | > @bundle2.parthandler('test:ping') | |
54 | > def pinghandler(op, part): |
|
54 | > def pinghandler(op, part): | |
55 | > op.ui.write('received ping request (id %i)\n' % part.id) |
|
55 | > op.ui.write('received ping request (id %i)\n' % part.id) | |
56 | > if op.reply is not None and 'ping-pong' in op.reply.capabilities: |
|
56 | > if op.reply is not None and 'ping-pong' in op.reply.capabilities: | |
57 | > op.ui.write_err('replying to ping request (id %i)\n' % part.id) |
|
57 | > op.ui.write_err('replying to ping request (id %i)\n' % part.id) | |
58 | > op.reply.newpart('test:pong', [('in-reply-to', str(part.id))], |
|
58 | > op.reply.newpart('test:pong', [('in-reply-to', str(part.id))], | |
59 | > mandatory=False) |
|
59 | > mandatory=False) | |
60 | > |
|
60 | > | |
61 | > @bundle2.parthandler('test:debugreply') |
|
61 | > @bundle2.parthandler('test:debugreply') | |
62 | > def debugreply(op, part): |
|
62 | > def debugreply(op, part): | |
63 | > """print data about the capacity of the bundle reply""" |
|
63 | > """print data about the capacity of the bundle reply""" | |
64 | > if op.reply is None: |
|
64 | > if op.reply is None: | |
65 | > op.ui.write('debugreply: no reply\n') |
|
65 | > op.ui.write('debugreply: no reply\n') | |
66 | > else: |
|
66 | > else: | |
67 | > op.ui.write('debugreply: capabilities:\n') |
|
67 | > op.ui.write('debugreply: capabilities:\n') | |
68 | > for cap in sorted(op.reply.capabilities): |
|
68 | > for cap in sorted(op.reply.capabilities): | |
69 | > op.ui.write('debugreply: %r\n' % cap) |
|
69 | > op.ui.write('debugreply: %r\n' % cap) | |
70 | > for val in op.reply.capabilities[cap]: |
|
70 | > for val in op.reply.capabilities[cap]: | |
71 | > op.ui.write('debugreply: %r\n' % val) |
|
71 | > op.ui.write('debugreply: %r\n' % val) | |
72 | > |
|
72 | > | |
73 | > @command('bundle2', |
|
73 | > @command('bundle2', | |
74 | > [('', 'param', [], 'stream level parameter'), |
|
74 | > [('', 'param', [], 'stream level parameter'), | |
75 | > ('', 'unknown', False, 'include an unknown mandatory part in the bundle'), |
|
75 | > ('', 'unknown', False, 'include an unknown mandatory part in the bundle'), | |
76 | > ('', 'unknownparams', False, 'include an unknown part parameters in the bundle'), |
|
76 | > ('', 'unknownparams', False, 'include an unknown part parameters in the bundle'), | |
77 | > ('', 'parts', False, 'include some arbitrary parts to the bundle'), |
|
77 | > ('', 'parts', False, 'include some arbitrary parts to the bundle'), | |
78 | > ('', 'reply', False, 'produce a reply bundle'), |
|
78 | > ('', 'reply', False, 'produce a reply bundle'), | |
79 | > ('', 'pushrace', False, 'includes a check:head part with unknown nodes'), |
|
79 | > ('', 'pushrace', False, 'includes a check:head part with unknown nodes'), | |
80 | > ('', 'genraise', False, 'includes a part that raise an exception during generation'), |
|
80 | > ('', 'genraise', False, 'includes a part that raise an exception during generation'), | |
81 | > ('', 'timeout', False, 'emulate a timeout during bundle generation'), |
|
81 | > ('', 'timeout', False, 'emulate a timeout during bundle generation'), | |
82 | > ('r', 'rev', [], 'includes those changeset in the bundle'),], |
|
82 | > ('r', 'rev', [], 'includes those changeset in the bundle'),], | |
83 | > '[OUTPUTFILE]') |
|
83 | > '[OUTPUTFILE]') | |
84 | > def cmdbundle2(ui, repo, path=None, **opts): |
|
84 | > def cmdbundle2(ui, repo, path=None, **opts): | |
85 | > """write a bundle2 container on standard output""" |
|
85 | > """write a bundle2 container on standard output""" | |
86 | > bundler = bundle2.bundle20(ui) |
|
86 | > bundler = bundle2.bundle20(ui) | |
87 | > for p in opts['param']: |
|
87 | > for p in opts['param']: | |
88 | > p = p.split('=', 1) |
|
88 | > p = p.split('=', 1) | |
89 | > try: |
|
89 | > try: | |
90 | > bundler.addparam(*p) |
|
90 | > bundler.addparam(*p) | |
91 | > except ValueError, exc: |
|
91 | > except ValueError, exc: | |
92 | > raise util.Abort('%s' % exc) |
|
92 | > raise util.Abort('%s' % exc) | |
93 | > |
|
93 | > | |
94 | > if opts['reply']: |
|
94 | > if opts['reply']: | |
95 | > capsstring = 'ping-pong\nelephants=babar,celeste\ncity%3D%21=celeste%2Cville' |
|
95 | > capsstring = 'ping-pong\nelephants=babar,celeste\ncity%3D%21=celeste%2Cville' | |
96 | > bundler.newpart('replycaps', data=capsstring) |
|
96 | > bundler.newpart('replycaps', data=capsstring) | |
97 | > |
|
97 | > | |
98 | > if opts['pushrace']: |
|
98 | > if opts['pushrace']: | |
99 | > # also serve to test the assignement of data outside of init |
|
99 | > # also serve to test the assignement of data outside of init | |
100 | > part = bundler.newpart('check:heads') |
|
100 | > part = bundler.newpart('check:heads') | |
101 | > part.data = '01234567890123456789' |
|
101 | > part.data = '01234567890123456789' | |
102 | > |
|
102 | > | |
103 | > revs = opts['rev'] |
|
103 | > revs = opts['rev'] | |
104 | > if 'rev' in opts: |
|
104 | > if 'rev' in opts: | |
105 | > revs = scmutil.revrange(repo, opts['rev']) |
|
105 | > revs = scmutil.revrange(repo, opts['rev']) | |
106 | > if revs: |
|
106 | > if revs: | |
107 | > # very crude version of a changegroup part creation |
|
107 | > # very crude version of a changegroup part creation | |
108 | > bundled = repo.revs('%ld::%ld', revs, revs) |
|
108 | > bundled = repo.revs('%ld::%ld', revs, revs) | |
109 | > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)] |
|
109 | > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)] | |
110 | > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)] |
|
110 | > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)] | |
111 | > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing) |
|
111 | > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing) | |
112 | > cg = changegroup.getlocalchangegroup(repo, 'test:bundle2', outgoing, None) |
|
112 | > cg = changegroup.getlocalchangegroup(repo, 'test:bundle2', outgoing, None) | |
113 | > bundler.newpart('changegroup', data=cg.getchunks(), |
|
113 | > bundler.newpart('changegroup', data=cg.getchunks(), | |
114 | > mandatory=False) |
|
114 | > mandatory=False) | |
115 | > |
|
115 | > | |
116 | > if opts['parts']: |
|
116 | > if opts['parts']: | |
117 | > bundler.newpart('test:empty', mandatory=False) |
|
117 | > bundler.newpart('test:empty', mandatory=False) | |
118 | > # add a second one to make sure we handle multiple parts |
|
118 | > # add a second one to make sure we handle multiple parts | |
119 | > bundler.newpart('test:empty', mandatory=False) |
|
119 | > bundler.newpart('test:empty', mandatory=False) | |
120 | > bundler.newpart('test:song', data=ELEPHANTSSONG, mandatory=False) |
|
120 | > bundler.newpart('test:song', data=ELEPHANTSSONG, mandatory=False) | |
121 | > bundler.newpart('test:debugreply', mandatory=False) |
|
121 | > bundler.newpart('test:debugreply', mandatory=False) | |
122 | > mathpart = bundler.newpart('test:math') |
|
122 | > mathpart = bundler.newpart('test:math') | |
123 | > mathpart.addparam('pi', '3.14') |
|
123 | > mathpart.addparam('pi', '3.14') | |
124 | > mathpart.addparam('e', '2.72') |
|
124 | > mathpart.addparam('e', '2.72') | |
125 | > mathpart.addparam('cooking', 'raw', mandatory=False) |
|
125 | > mathpart.addparam('cooking', 'raw', mandatory=False) | |
126 | > mathpart.data = '42' |
|
126 | > mathpart.data = '42' | |
127 | > mathpart.mandatory = False |
|
127 | > mathpart.mandatory = False | |
128 | > # advisory known part with unknown mandatory param |
|
128 | > # advisory known part with unknown mandatory param | |
129 | > bundler.newpart('test:song', [('randomparam','')], mandatory=False) |
|
129 | > bundler.newpart('test:song', [('randomparam','')], mandatory=False) | |
130 | > if opts['unknown']: |
|
130 | > if opts['unknown']: | |
131 | > bundler.newpart('test:unknown', data='some random content') |
|
131 | > bundler.newpart('test:unknown', data='some random content') | |
132 | > if opts['unknownparams']: |
|
132 | > if opts['unknownparams']: | |
133 | > bundler.newpart('test:song', [('randomparams', '')]) |
|
133 | > bundler.newpart('test:song', [('randomparams', '')]) | |
134 | > if opts['parts']: |
|
134 | > if opts['parts']: | |
135 | > bundler.newpart('test:ping', mandatory=False) |
|
135 | > bundler.newpart('test:ping', mandatory=False) | |
136 | > if opts['genraise']: |
|
136 | > if opts['genraise']: | |
137 | > def genraise(): |
|
137 | > def genraise(): | |
138 | > yield 'first line\n' |
|
138 | > yield 'first line\n' | |
139 | > raise RuntimeError('Someone set up us the bomb!') |
|
139 | > raise RuntimeError('Someone set up us the bomb!') | |
140 | > bundler.newpart('output', data=genraise(), mandatory=False) |
|
140 | > bundler.newpart('output', data=genraise(), mandatory=False) | |
141 | > |
|
141 | > | |
142 | > if path is None: |
|
142 | > if path is None: | |
143 | > file = sys.stdout |
|
143 | > file = sys.stdout | |
144 | > else: |
|
144 | > else: | |
145 | > file = open(path, 'wb') |
|
145 | > file = open(path, 'wb') | |
146 | > |
|
146 | > | |
147 | > if opts['timeout']: |
|
147 | > if opts['timeout']: | |
148 | > bundler.newpart('test:song', data=ELEPHANTSSONG, mandatory=False) |
|
148 | > bundler.newpart('test:song', data=ELEPHANTSSONG, mandatory=False) | |
149 | > for idx, junk in enumerate(bundler.getchunks()): |
|
149 | > for idx, junk in enumerate(bundler.getchunks()): | |
150 | > ui.write('%d chunk\n' % idx) |
|
150 | > ui.write('%d chunk\n' % idx) | |
151 | > if idx > 4: |
|
151 | > if idx > 4: | |
152 | > # This throws a GeneratorExit inside the generator, which |
|
152 | > # This throws a GeneratorExit inside the generator, which | |
153 | > # can cause problems if the exception-recovery code is |
|
153 | > # can cause problems if the exception-recovery code is | |
154 | > # too zealous. It's important for this test that the break |
|
154 | > # too zealous. It's important for this test that the break | |
155 | > # occur while we're in the middle of a part. |
|
155 | > # occur while we're in the middle of a part. | |
156 | > break |
|
156 | > break | |
157 | > ui.write('fake timeout complete.\n') |
|
157 | > ui.write('fake timeout complete.\n') | |
158 | > return |
|
158 | > return | |
159 | > try: |
|
159 | > try: | |
160 | > for chunk in bundler.getchunks(): |
|
160 | > for chunk in bundler.getchunks(): | |
161 | > file.write(chunk) |
|
161 | > file.write(chunk) | |
162 | > except RuntimeError, exc: |
|
162 | > except RuntimeError, exc: | |
163 | > raise util.Abort(exc) |
|
163 | > raise util.Abort(exc) | |
164 | > |
|
164 | > | |
165 | > @command('unbundle2', [], '') |
|
165 | > @command('unbundle2', [], '') | |
166 | > def cmdunbundle2(ui, repo, replypath=None): |
|
166 | > def cmdunbundle2(ui, repo, replypath=None): | |
167 | > """process a bundle2 stream from stdin on the current repo""" |
|
167 | > """process a bundle2 stream from stdin on the current repo""" | |
168 | > try: |
|
168 | > try: | |
169 | > tr = None |
|
169 | > tr = None | |
170 | > lock = repo.lock() |
|
170 | > lock = repo.lock() | |
171 | > tr = repo.transaction('processbundle') |
|
171 | > tr = repo.transaction('processbundle') | |
172 | > try: |
|
172 | > try: | |
173 | > unbundler = bundle2.getunbundler(ui, sys.stdin) |
|
173 | > unbundler = bundle2.getunbundler(ui, sys.stdin) | |
174 | > op = bundle2.processbundle(repo, unbundler, lambda: tr) |
|
174 | > op = bundle2.processbundle(repo, unbundler, lambda: tr) | |
175 | > tr.close() |
|
175 | > tr.close() | |
176 | > except error.BundleValueError, exc: |
|
176 | > except error.BundleValueError, exc: | |
177 | > raise util.Abort('missing support for %s' % exc) |
|
177 | > raise util.Abort('missing support for %s' % exc) | |
178 | > except error.PushRaced, exc: |
|
178 | > except error.PushRaced, exc: | |
179 | > raise util.Abort('push race: %s' % exc) |
|
179 | > raise util.Abort('push race: %s' % exc) | |
180 | > finally: |
|
180 | > finally: | |
181 | > if tr is not None: |
|
181 | > if tr is not None: | |
182 | > tr.release() |
|
182 | > tr.release() | |
183 | > lock.release() |
|
183 | > lock.release() | |
184 | > remains = sys.stdin.read() |
|
184 | > remains = sys.stdin.read() | |
185 | > ui.write('%i unread bytes\n' % len(remains)) |
|
185 | > ui.write('%i unread bytes\n' % len(remains)) | |
186 | > if op.records['song']: |
|
186 | > if op.records['song']: | |
187 | > totalverses = sum(r['verses'] for r in op.records['song']) |
|
187 | > totalverses = sum(r['verses'] for r in op.records['song']) | |
188 | > ui.write('%i total verses sung\n' % totalverses) |
|
188 | > ui.write('%i total verses sung\n' % totalverses) | |
189 | > for rec in op.records['changegroup']: |
|
189 | > for rec in op.records['changegroup']: | |
190 | > ui.write('addchangegroup return: %i\n' % rec['return']) |
|
190 | > ui.write('addchangegroup return: %i\n' % rec['return']) | |
191 | > if op.reply is not None and replypath is not None: |
|
191 | > if op.reply is not None and replypath is not None: | |
192 | > file = open(replypath, 'wb') |
|
192 | > file = open(replypath, 'wb') | |
193 | > for chunk in op.reply.getchunks(): |
|
193 | > for chunk in op.reply.getchunks(): | |
194 | > file.write(chunk) |
|
194 | > file.write(chunk) | |
195 | > |
|
195 | > | |
196 | > @command('statbundle2', [], '') |
|
196 | > @command('statbundle2', [], '') | |
197 | > def cmdstatbundle2(ui, repo): |
|
197 | > def cmdstatbundle2(ui, repo): | |
198 | > """print statistic on the bundle2 container read from stdin""" |
|
198 | > """print statistic on the bundle2 container read from stdin""" | |
199 | > unbundler = bundle2.getunbundler(ui, sys.stdin) |
|
199 | > unbundler = bundle2.getunbundler(ui, sys.stdin) | |
200 | > try: |
|
200 | > try: | |
201 | > params = unbundler.params |
|
201 | > params = unbundler.params | |
202 | > except error.BundleValueError, exc: |
|
202 | > except error.BundleValueError, exc: | |
203 | > raise util.Abort('unknown parameters: %s' % exc) |
|
203 | > raise util.Abort('unknown parameters: %s' % exc) | |
204 | > ui.write('options count: %i\n' % len(params)) |
|
204 | > ui.write('options count: %i\n' % len(params)) | |
205 | > for key in sorted(params): |
|
205 | > for key in sorted(params): | |
206 | > ui.write('- %s\n' % key) |
|
206 | > ui.write('- %s\n' % key) | |
207 | > value = params[key] |
|
207 | > value = params[key] | |
208 | > if value is not None: |
|
208 | > if value is not None: | |
209 | > ui.write(' %s\n' % value) |
|
209 | > ui.write(' %s\n' % value) | |
210 | > count = 0 |
|
210 | > count = 0 | |
211 | > for p in unbundler.iterparts(): |
|
211 | > for p in unbundler.iterparts(): | |
212 | > count += 1 |
|
212 | > count += 1 | |
213 | > ui.write(' :%s:\n' % p.type) |
|
213 | > ui.write(' :%s:\n' % p.type) | |
214 | > ui.write(' mandatory: %i\n' % len(p.mandatoryparams)) |
|
214 | > ui.write(' mandatory: %i\n' % len(p.mandatoryparams)) | |
215 | > ui.write(' advisory: %i\n' % len(p.advisoryparams)) |
|
215 | > ui.write(' advisory: %i\n' % len(p.advisoryparams)) | |
216 | > ui.write(' payload: %i bytes\n' % len(p.read())) |
|
216 | > ui.write(' payload: %i bytes\n' % len(p.read())) | |
217 | > ui.write('parts count: %i\n' % count) |
|
217 | > ui.write('parts count: %i\n' % count) | |
218 | > EOF |
|
218 | > EOF | |
219 | $ cat >> $HGRCPATH << EOF |
|
219 | $ cat >> $HGRCPATH << EOF | |
220 | > [extensions] |
|
220 | > [extensions] | |
221 | > bundle2=$TESTTMP/bundle2.py |
|
221 | > bundle2=$TESTTMP/bundle2.py | |
222 | > [experimental] |
|
222 | > [experimental] | |
223 | > bundle2-exp=True |
|
223 | > bundle2-exp=True | |
224 | > evolution=createmarkers |
|
224 | > evolution=createmarkers | |
225 | > [ui] |
|
225 | > [ui] | |
226 | > ssh=python "$TESTDIR/dummyssh" |
|
226 | > ssh=python "$TESTDIR/dummyssh" | |
227 | > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline} |
|
227 | > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline} | |
228 | > [web] |
|
228 | > [web] | |
229 | > push_ssl = false |
|
229 | > push_ssl = false | |
230 | > allow_push = * |
|
230 | > allow_push = * | |
231 | > [phases] |
|
231 | > [phases] | |
232 | > publish=False |
|
232 | > publish=False | |
233 | > EOF |
|
233 | > EOF | |
234 |
|
234 | |||
235 | The extension requires a repo (currently unused) |
|
235 | The extension requires a repo (currently unused) | |
236 |
|
236 | |||
237 | $ hg init main |
|
237 | $ hg init main | |
238 | $ cd main |
|
238 | $ cd main | |
239 | $ touch a |
|
239 | $ touch a | |
240 | $ hg add a |
|
240 | $ hg add a | |
241 | $ hg commit -m 'a' |
|
241 | $ hg commit -m 'a' | |
242 |
|
242 | |||
243 |
|
243 | |||
244 | Empty bundle |
|
244 | Empty bundle | |
245 | ================= |
|
245 | ================= | |
246 |
|
246 | |||
247 | - no option |
|
247 | - no option | |
248 | - no parts |
|
248 | - no parts | |
249 |
|
249 | |||
250 | Test bundling |
|
250 | Test bundling | |
251 |
|
251 | |||
252 | $ hg bundle2 |
|
252 | $ hg bundle2 | f --hexdump | |
253 | HG20\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc) |
|
253 | ||
|
254 | 0000: 48 47 32 30 00 00 00 00 00 00 00 00 |HG20........| | |||
254 |
|
255 | |||
255 | Test timeouts during bundling |
|
256 | Test timeouts during bundling | |
256 | $ hg bundle2 --timeout --debug --config devel.bundle2.debug=yes |
|
257 | $ hg bundle2 --timeout --debug --config devel.bundle2.debug=yes | |
257 | bundle2-output-bundle: "HG20", 1 parts total |
|
258 | bundle2-output-bundle: "HG20", 1 parts total | |
258 | bundle2-output: start emission of HG20 stream |
|
259 | bundle2-output: start emission of HG20 stream | |
259 | 0 chunk |
|
260 | 0 chunk | |
260 | bundle2-output: bundle parameter: |
|
261 | bundle2-output: bundle parameter: | |
261 | 1 chunk |
|
262 | 1 chunk | |
262 | bundle2-output: start of parts |
|
263 | bundle2-output: start of parts | |
263 | bundle2-output: bundle part: "test:song" |
|
264 | bundle2-output: bundle part: "test:song" | |
264 | bundle2-output-part: "test:song" (advisory) 178 bytes payload |
|
265 | bundle2-output-part: "test:song" (advisory) 178 bytes payload | |
265 | bundle2-output: part 0: "test:song" |
|
266 | bundle2-output: part 0: "test:song" | |
266 | bundle2-output: header chunk size: 16 |
|
267 | bundle2-output: header chunk size: 16 | |
267 | 2 chunk |
|
268 | 2 chunk | |
268 | 3 chunk |
|
269 | 3 chunk | |
269 | bundle2-output: payload chunk size: 178 |
|
270 | bundle2-output: payload chunk size: 178 | |
270 | 4 chunk |
|
271 | 4 chunk | |
271 | 5 chunk |
|
272 | 5 chunk | |
272 | bundle2-generatorexit |
|
273 | bundle2-generatorexit | |
273 | fake timeout complete. |
|
274 | fake timeout complete. | |
274 |
|
275 | |||
275 | Test unbundling |
|
276 | Test unbundling | |
276 |
|
277 | |||
277 | $ hg bundle2 | hg statbundle2 |
|
278 | $ hg bundle2 | hg statbundle2 | |
278 | options count: 0 |
|
279 | options count: 0 | |
279 | parts count: 0 |
|
280 | parts count: 0 | |
280 |
|
281 | |||
281 | Test old style bundle are detected and refused |
|
282 | Test old style bundle are detected and refused | |
282 |
|
283 | |||
283 | $ hg bundle --all ../bundle.hg |
|
284 | $ hg bundle --all ../bundle.hg | |
284 | 1 changesets found |
|
285 | 1 changesets found | |
285 | $ hg statbundle2 < ../bundle.hg |
|
286 | $ hg statbundle2 < ../bundle.hg | |
286 | abort: unknown bundle version 10 |
|
287 | abort: unknown bundle version 10 | |
287 | [255] |
|
288 | [255] | |
288 |
|
289 | |||
289 | Test parameters |
|
290 | Test parameters | |
290 | ================= |
|
291 | ================= | |
291 |
|
292 | |||
292 | - some options |
|
293 | - some options | |
293 | - no parts |
|
294 | - no parts | |
294 |
|
295 | |||
295 | advisory parameters, no value |
|
296 | advisory parameters, no value | |
296 | ------------------------------- |
|
297 | ------------------------------- | |
297 |
|
298 | |||
298 | Simplest possible parameters form |
|
299 | Simplest possible parameters form | |
299 |
|
300 | |||
300 | Test generation simple option |
|
301 | Test generation simple option | |
301 |
|
302 | |||
302 | $ hg bundle2 --param 'caution' |
|
303 | $ hg bundle2 --param 'caution' | f --hexdump | |
303 | HG20\x00\x00\x00\x07caution\x00\x00\x00\x00 (no-eol) (esc) |
|
304 | ||
|
305 | 0000: 48 47 32 30 00 00 00 07 63 61 75 74 69 6f 6e 00 |HG20....caution.| | |||
|
306 | 0010: 00 00 00 |...| | |||
304 |
|
307 | |||
305 | Test unbundling |
|
308 | Test unbundling | |
306 |
|
309 | |||
307 | $ hg bundle2 --param 'caution' | hg statbundle2 |
|
310 | $ hg bundle2 --param 'caution' | hg statbundle2 | |
308 | options count: 1 |
|
311 | options count: 1 | |
309 | - caution |
|
312 | - caution | |
310 | parts count: 0 |
|
313 | parts count: 0 | |
311 |
|
314 | |||
312 | Test generation multiple option |
|
315 | Test generation multiple option | |
313 |
|
316 | |||
314 | $ hg bundle2 --param 'caution' --param 'meal' |
|
317 | $ hg bundle2 --param 'caution' --param 'meal' | f --hexdump | |
315 | HG20\x00\x00\x00\x0ccaution meal\x00\x00\x00\x00 (no-eol) (esc) |
|
318 | ||
|
319 | 0000: 48 47 32 30 00 00 00 0c 63 61 75 74 69 6f 6e 20 |HG20....caution | | |||
|
320 | 0010: 6d 65 61 6c 00 00 00 00 |meal....| | |||
316 |
|
321 | |||
317 | Test unbundling |
|
322 | Test unbundling | |
318 |
|
323 | |||
319 | $ hg bundle2 --param 'caution' --param 'meal' | hg statbundle2 |
|
324 | $ hg bundle2 --param 'caution' --param 'meal' | hg statbundle2 | |
320 | options count: 2 |
|
325 | options count: 2 | |
321 | - caution |
|
326 | - caution | |
322 | - meal |
|
327 | - meal | |
323 | parts count: 0 |
|
328 | parts count: 0 | |
324 |
|
329 | |||
325 | advisory parameters, with value |
|
330 | advisory parameters, with value | |
326 | ------------------------------- |
|
331 | ------------------------------- | |
327 |
|
332 | |||
328 | Test generation |
|
333 | Test generation | |
329 |
|
334 | |||
330 | $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' |
|
335 | $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | f --hexdump | |
331 | HG20\x00\x00\x00\x1ccaution meal=vegan elephants\x00\x00\x00\x00 (no-eol) (esc) |
|
336 | ||
|
337 | 0000: 48 47 32 30 00 00 00 1c 63 61 75 74 69 6f 6e 20 |HG20....caution | | |||
|
338 | 0010: 6d 65 61 6c 3d 76 65 67 61 6e 20 65 6c 65 70 68 |meal=vegan eleph| | |||
|
339 | 0020: 61 6e 74 73 00 00 00 00 |ants....| | |||
332 |
|
340 | |||
333 | Test unbundling |
|
341 | Test unbundling | |
334 |
|
342 | |||
335 | $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | hg statbundle2 |
|
343 | $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | hg statbundle2 | |
336 | options count: 3 |
|
344 | options count: 3 | |
337 | - caution |
|
345 | - caution | |
338 | - elephants |
|
346 | - elephants | |
339 | - meal |
|
347 | - meal | |
340 | vegan |
|
348 | vegan | |
341 | parts count: 0 |
|
349 | parts count: 0 | |
342 |
|
350 | |||
343 | parameter with special char in value |
|
351 | parameter with special char in value | |
344 | --------------------------------------------------- |
|
352 | --------------------------------------------------- | |
345 |
|
353 | |||
346 | Test generation |
|
354 | Test generation | |
347 |
|
355 | |||
348 | $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple |
|
356 | $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | f --hexdump | |
349 | HG20\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc) |
|
357 | ||
|
358 | 0000: 48 47 32 30 00 00 00 29 65 25 37 43 25 32 31 25 |HG20...)e%7C%21%| | |||
|
359 | 0010: 32 30 37 2f 3d 62 61 62 61 72 25 32 35 25 32 33 |207/=babar%25%23| | |||
|
360 | 0020: 25 33 44 25 33 44 74 75 74 75 20 73 69 6d 70 6c |%3D%3Dtutu simpl| | |||
|
361 | 0030: 65 00 00 00 00 |e....| | |||
350 |
|
362 | |||
351 | Test unbundling |
|
363 | Test unbundling | |
352 |
|
364 | |||
353 | $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | hg statbundle2 |
|
365 | $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | hg statbundle2 | |
354 | options count: 2 |
|
366 | options count: 2 | |
355 | - e|! 7/ |
|
367 | - e|! 7/ | |
356 | babar%#==tutu |
|
368 | babar%#==tutu | |
357 | - simple |
|
369 | - simple | |
358 | parts count: 0 |
|
370 | parts count: 0 | |
359 |
|
371 | |||
360 | Test unknown mandatory option |
|
372 | Test unknown mandatory option | |
361 | --------------------------------------------------- |
|
373 | --------------------------------------------------- | |
362 |
|
374 | |||
363 | $ hg bundle2 --param 'Gravity' | hg statbundle2 |
|
375 | $ hg bundle2 --param 'Gravity' | hg statbundle2 | |
364 | abort: unknown parameters: Stream Parameter - Gravity |
|
376 | abort: unknown parameters: Stream Parameter - Gravity | |
365 | [255] |
|
377 | [255] | |
366 |
|
378 | |||
367 | Test debug output |
|
379 | Test debug output | |
368 | --------------------------------------------------- |
|
380 | --------------------------------------------------- | |
369 |
|
381 | |||
370 | bundling debug |
|
382 | bundling debug | |
371 |
|
383 | |||
372 | $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2 --config progress.debug=true --config devel.bundle2.debug=true |
|
384 | $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2 --config progress.debug=true --config devel.bundle2.debug=true | |
373 | bundle2-output-bundle: "HG20", (2 params) 0 parts total |
|
385 | bundle2-output-bundle: "HG20", (2 params) 0 parts total | |
374 | bundle2-output: start emission of HG20 stream |
|
386 | bundle2-output: start emission of HG20 stream | |
375 | bundle2-output: bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple |
|
387 | bundle2-output: bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple | |
376 | bundle2-output: start of parts |
|
388 | bundle2-output: start of parts | |
377 | bundle2-output: end of bundle |
|
389 | bundle2-output: end of bundle | |
378 |
|
390 | |||
379 | file content is ok |
|
391 | file content is ok | |
380 |
|
392 | |||
381 |
$ |
|
393 | $ f --hexdump ../out.hg2 | |
382 | HG20\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc) |
|
394 | ../out.hg2: | |
|
395 | 0000: 48 47 32 30 00 00 00 29 65 25 37 43 25 32 31 25 |HG20...)e%7C%21%| | |||
|
396 | 0010: 32 30 37 2f 3d 62 61 62 61 72 25 32 35 25 32 33 |207/=babar%25%23| | |||
|
397 | 0020: 25 33 44 25 33 44 74 75 74 75 20 73 69 6d 70 6c |%3D%3Dtutu simpl| | |||
|
398 | 0030: 65 00 00 00 00 |e....| | |||
383 |
|
399 | |||
384 | unbundling debug |
|
400 | unbundling debug | |
385 |
|
401 | |||
386 | $ hg statbundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true < ../out.hg2 |
|
402 | $ hg statbundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true < ../out.hg2 | |
387 | bundle2-input: start processing of HG20 stream |
|
403 | bundle2-input: start processing of HG20 stream | |
388 | bundle2-input: reading bundle2 stream parameters |
|
404 | bundle2-input: reading bundle2 stream parameters | |
389 | bundle2-input: ignoring unknown parameter 'e|! 7/' |
|
405 | bundle2-input: ignoring unknown parameter 'e|! 7/' | |
390 | bundle2-input: ignoring unknown parameter 'simple' |
|
406 | bundle2-input: ignoring unknown parameter 'simple' | |
391 | options count: 2 |
|
407 | options count: 2 | |
392 | - e|! 7/ |
|
408 | - e|! 7/ | |
393 | babar%#==tutu |
|
409 | babar%#==tutu | |
394 | - simple |
|
410 | - simple | |
395 | bundle2-input: start extraction of bundle2 parts |
|
411 | bundle2-input: start extraction of bundle2 parts | |
396 | bundle2-input: part header size: 0 |
|
412 | bundle2-input: part header size: 0 | |
397 | bundle2-input: end of bundle2 stream |
|
413 | bundle2-input: end of bundle2 stream | |
398 | parts count: 0 |
|
414 | parts count: 0 | |
399 |
|
415 | |||
400 |
|
416 | |||
401 | Test buggy input |
|
417 | Test buggy input | |
402 | --------------------------------------------------- |
|
418 | --------------------------------------------------- | |
403 |
|
419 | |||
404 | empty parameter name |
|
420 | empty parameter name | |
405 |
|
421 | |||
406 | $ hg bundle2 --param '' --quiet |
|
422 | $ hg bundle2 --param '' --quiet | |
407 | abort: empty parameter name |
|
423 | abort: empty parameter name | |
408 | [255] |
|
424 | [255] | |
409 |
|
425 | |||
410 | bad parameter name |
|
426 | bad parameter name | |
411 |
|
427 | |||
412 | $ hg bundle2 --param 42babar |
|
428 | $ hg bundle2 --param 42babar | |
413 | abort: non letter first character: '42babar' |
|
429 | abort: non letter first character: '42babar' | |
414 | [255] |
|
430 | [255] | |
415 |
|
431 | |||
416 |
|
432 | |||
417 | Test part |
|
433 | Test part | |
418 | ================= |
|
434 | ================= | |
419 |
|
435 | |||
420 | $ hg bundle2 --parts ../parts.hg2 --debug --config progress.debug=true --config devel.bundle2.debug=true |
|
436 | $ hg bundle2 --parts ../parts.hg2 --debug --config progress.debug=true --config devel.bundle2.debug=true | |
421 | bundle2-output-bundle: "HG20", 7 parts total |
|
437 | bundle2-output-bundle: "HG20", 7 parts total | |
422 | bundle2-output: start emission of HG20 stream |
|
438 | bundle2-output: start emission of HG20 stream | |
423 | bundle2-output: bundle parameter: |
|
439 | bundle2-output: bundle parameter: | |
424 | bundle2-output: start of parts |
|
440 | bundle2-output: start of parts | |
425 | bundle2-output: bundle part: "test:empty" |
|
441 | bundle2-output: bundle part: "test:empty" | |
426 | bundle2-output-part: "test:empty" (advisory) empty payload |
|
442 | bundle2-output-part: "test:empty" (advisory) empty payload | |
427 | bundle2-output: part 0: "test:empty" |
|
443 | bundle2-output: part 0: "test:empty" | |
428 | bundle2-output: header chunk size: 17 |
|
444 | bundle2-output: header chunk size: 17 | |
429 | bundle2-output: closing payload chunk |
|
445 | bundle2-output: closing payload chunk | |
430 | bundle2-output: bundle part: "test:empty" |
|
446 | bundle2-output: bundle part: "test:empty" | |
431 | bundle2-output-part: "test:empty" (advisory) empty payload |
|
447 | bundle2-output-part: "test:empty" (advisory) empty payload | |
432 | bundle2-output: part 1: "test:empty" |
|
448 | bundle2-output: part 1: "test:empty" | |
433 | bundle2-output: header chunk size: 17 |
|
449 | bundle2-output: header chunk size: 17 | |
434 | bundle2-output: closing payload chunk |
|
450 | bundle2-output: closing payload chunk | |
435 | bundle2-output: bundle part: "test:song" |
|
451 | bundle2-output: bundle part: "test:song" | |
436 | bundle2-output-part: "test:song" (advisory) 178 bytes payload |
|
452 | bundle2-output-part: "test:song" (advisory) 178 bytes payload | |
437 | bundle2-output: part 2: "test:song" |
|
453 | bundle2-output: part 2: "test:song" | |
438 | bundle2-output: header chunk size: 16 |
|
454 | bundle2-output: header chunk size: 16 | |
439 | bundle2-output: payload chunk size: 178 |
|
455 | bundle2-output: payload chunk size: 178 | |
440 | bundle2-output: closing payload chunk |
|
456 | bundle2-output: closing payload chunk | |
441 | bundle2-output: bundle part: "test:debugreply" |
|
457 | bundle2-output: bundle part: "test:debugreply" | |
442 | bundle2-output-part: "test:debugreply" (advisory) empty payload |
|
458 | bundle2-output-part: "test:debugreply" (advisory) empty payload | |
443 | bundle2-output: part 3: "test:debugreply" |
|
459 | bundle2-output: part 3: "test:debugreply" | |
444 | bundle2-output: header chunk size: 22 |
|
460 | bundle2-output: header chunk size: 22 | |
445 | bundle2-output: closing payload chunk |
|
461 | bundle2-output: closing payload chunk | |
446 | bundle2-output: bundle part: "test:math" |
|
462 | bundle2-output: bundle part: "test:math" | |
447 | bundle2-output-part: "test:math" (advisory) (params: 2 mandatory 2 advisory) 2 bytes payload |
|
463 | bundle2-output-part: "test:math" (advisory) (params: 2 mandatory 2 advisory) 2 bytes payload | |
448 | bundle2-output: part 4: "test:math" |
|
464 | bundle2-output: part 4: "test:math" | |
449 | bundle2-output: header chunk size: 43 |
|
465 | bundle2-output: header chunk size: 43 | |
450 | bundle2-output: payload chunk size: 2 |
|
466 | bundle2-output: payload chunk size: 2 | |
451 | bundle2-output: closing payload chunk |
|
467 | bundle2-output: closing payload chunk | |
452 | bundle2-output: bundle part: "test:song" |
|
468 | bundle2-output: bundle part: "test:song" | |
453 | bundle2-output-part: "test:song" (advisory) (params: 1 mandatory) empty payload |
|
469 | bundle2-output-part: "test:song" (advisory) (params: 1 mandatory) empty payload | |
454 | bundle2-output: part 5: "test:song" |
|
470 | bundle2-output: part 5: "test:song" | |
455 | bundle2-output: header chunk size: 29 |
|
471 | bundle2-output: header chunk size: 29 | |
456 | bundle2-output: closing payload chunk |
|
472 | bundle2-output: closing payload chunk | |
457 | bundle2-output: bundle part: "test:ping" |
|
473 | bundle2-output: bundle part: "test:ping" | |
458 | bundle2-output-part: "test:ping" (advisory) empty payload |
|
474 | bundle2-output-part: "test:ping" (advisory) empty payload | |
459 | bundle2-output: part 6: "test:ping" |
|
475 | bundle2-output: part 6: "test:ping" | |
460 | bundle2-output: header chunk size: 16 |
|
476 | bundle2-output: header chunk size: 16 | |
461 | bundle2-output: closing payload chunk |
|
477 | bundle2-output: closing payload chunk | |
462 | bundle2-output: end of bundle |
|
478 | bundle2-output: end of bundle | |
463 |
|
479 | |||
464 |
$ |
|
480 | $ f --hexdump ../parts.hg2 | |
465 | HG20\x00\x00\x00\x00\x00\x00\x00\x11 (esc) |
|
481 | ../parts.hg2: | |
466 | test:empty\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11 (esc) |
|
482 | 0000: 48 47 32 30 00 00 00 00 00 00 00 11 0a 74 65 73 |HG20.........tes| | |
467 | test:empty\x00\x00\x00\x01\x00\x00\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) |
|
483 | 0010: 74 3a 65 6d 70 74 79 00 00 00 00 00 00 00 00 00 |t:empty.........| | |
468 | Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko |
|
484 | 0020: 00 00 00 00 11 0a 74 65 73 74 3a 65 6d 70 74 79 |......test:empty| | |
469 | Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.\x00\x00\x00\x00\x00\x00\x00\x16\x0ftest:debugreply\x00\x00\x00\x03\x00\x00\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\x00\x00\x1d test:song\x00\x00\x00\x05\x01\x00\x0b\x00randomparam\x00\x00\x00\x00\x00\x00\x00\x10 test:ping\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc) |
|
485 | 0030: 00 00 00 01 00 00 00 00 00 00 00 00 00 10 09 74 |...............t| | |
|
486 | 0040: 65 73 74 3a 73 6f 6e 67 00 00 00 02 00 00 00 00 |est:song........| | |||
|
487 | 0050: 00 b2 50 61 74 61 6c 69 20 44 69 72 61 70 61 74 |..Patali Dirapat| | |||
|
488 | 0060: 61 2c 20 43 72 6f 6d 64 61 20 43 72 6f 6d 64 61 |a, Cromda Cromda| | |||
|
489 | 0070: 20 52 69 70 61 6c 6f 2c 20 50 61 74 61 20 50 61 | Ripalo, Pata Pa| | |||
|
490 | 0080: 74 61 2c 20 4b 6f 20 4b 6f 20 4b 6f 0a 42 6f 6b |ta, Ko Ko Ko.Bok| | |||
|
491 | 0090: 6f 72 6f 20 44 69 70 6f 75 6c 69 74 6f 2c 20 52 |oro Dipoulito, R| | |||
|
492 | 00a0: 6f 6e 64 69 20 52 6f 6e 64 69 20 50 65 70 69 6e |ondi Rondi Pepin| | |||
|
493 | 00b0: 6f 2c 20 50 61 74 61 20 50 61 74 61 2c 20 4b 6f |o, Pata Pata, Ko| | |||
|
494 | 00c0: 20 4b 6f 20 4b 6f 0a 45 6d 61 6e 61 20 4b 61 72 | Ko Ko.Emana Kar| | |||
|
495 | 00d0: 61 73 73 6f 6c 69 2c 20 4c 6f 75 63 72 61 20 4c |assoli, Loucra L| | |||
|
496 | 00e0: 6f 75 63 72 61 20 50 6f 6e 70 6f 6e 74 6f 2c 20 |oucra Ponponto, | | |||
|
497 | 00f0: 50 61 74 61 20 50 61 74 61 2c 20 4b 6f 20 4b 6f |Pata Pata, Ko Ko| | |||
|
498 | 0100: 20 4b 6f 2e 00 00 00 00 00 00 00 16 0f 74 65 73 | Ko..........tes| | |||
|
499 | 0110: 74 3a 64 65 62 75 67 72 65 70 6c 79 00 00 00 03 |t:debugreply....| | |||
|
500 | 0120: 00 00 00 00 00 00 00 00 00 2b 09 74 65 73 74 3a |.........+.test:| | |||
|
501 | 0130: 6d 61 74 68 00 00 00 04 02 01 02 04 01 04 07 03 |math............| | |||
|
502 | 0140: 70 69 33 2e 31 34 65 32 2e 37 32 63 6f 6f 6b 69 |pi3.14e2.72cooki| | |||
|
503 | 0150: 6e 67 72 61 77 00 00 00 02 34 32 00 00 00 00 00 |ngraw....42.....| | |||
|
504 | 0160: 00 00 1d 09 74 65 73 74 3a 73 6f 6e 67 00 00 00 |....test:song...| | |||
|
505 | 0170: 05 01 00 0b 00 72 61 6e 64 6f 6d 70 61 72 61 6d |.....randomparam| | |||
|
506 | 0180: 00 00 00 00 00 00 00 10 09 74 65 73 74 3a 70 69 |.........test:pi| | |||
|
507 | 0190: 6e 67 00 00 00 06 00 00 00 00 00 00 00 00 00 00 |ng..............| | |||
470 |
|
508 | |||
471 |
|
509 | |||
472 | $ hg statbundle2 < ../parts.hg2 |
|
510 | $ hg statbundle2 < ../parts.hg2 | |
473 | options count: 0 |
|
511 | options count: 0 | |
474 | :test:empty: |
|
512 | :test:empty: | |
475 | mandatory: 0 |
|
513 | mandatory: 0 | |
476 | advisory: 0 |
|
514 | advisory: 0 | |
477 | payload: 0 bytes |
|
515 | payload: 0 bytes | |
478 | :test:empty: |
|
516 | :test:empty: | |
479 | mandatory: 0 |
|
517 | mandatory: 0 | |
480 | advisory: 0 |
|
518 | advisory: 0 | |
481 | payload: 0 bytes |
|
519 | payload: 0 bytes | |
482 | :test:song: |
|
520 | :test:song: | |
483 | mandatory: 0 |
|
521 | mandatory: 0 | |
484 | advisory: 0 |
|
522 | advisory: 0 | |
485 | payload: 178 bytes |
|
523 | payload: 178 bytes | |
486 | :test:debugreply: |
|
524 | :test:debugreply: | |
487 | mandatory: 0 |
|
525 | mandatory: 0 | |
488 | advisory: 0 |
|
526 | advisory: 0 | |
489 | payload: 0 bytes |
|
527 | payload: 0 bytes | |
490 | :test:math: |
|
528 | :test:math: | |
491 | mandatory: 2 |
|
529 | mandatory: 2 | |
492 | advisory: 1 |
|
530 | advisory: 1 | |
493 | payload: 2 bytes |
|
531 | payload: 2 bytes | |
494 | :test:song: |
|
532 | :test:song: | |
495 | mandatory: 1 |
|
533 | mandatory: 1 | |
496 | advisory: 0 |
|
534 | advisory: 0 | |
497 | payload: 0 bytes |
|
535 | payload: 0 bytes | |
498 | :test:ping: |
|
536 | :test:ping: | |
499 | mandatory: 0 |
|
537 | mandatory: 0 | |
500 | advisory: 0 |
|
538 | advisory: 0 | |
501 | payload: 0 bytes |
|
539 | payload: 0 bytes | |
502 | parts count: 7 |
|
540 | parts count: 7 | |
503 |
|
541 | |||
504 | $ hg statbundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true < ../parts.hg2 |
|
542 | $ hg statbundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true < ../parts.hg2 | |
505 | bundle2-input: start processing of HG20 stream |
|
543 | bundle2-input: start processing of HG20 stream | |
506 | bundle2-input: reading bundle2 stream parameters |
|
544 | bundle2-input: reading bundle2 stream parameters | |
507 | options count: 0 |
|
545 | options count: 0 | |
508 | bundle2-input: start extraction of bundle2 parts |
|
546 | bundle2-input: start extraction of bundle2 parts | |
509 | bundle2-input: part header size: 17 |
|
547 | bundle2-input: part header size: 17 | |
510 | bundle2-input: part type: "test:empty" |
|
548 | bundle2-input: part type: "test:empty" | |
511 | bundle2-input: part id: "0" |
|
549 | bundle2-input: part id: "0" | |
512 | bundle2-input: part parameters: 0 |
|
550 | bundle2-input: part parameters: 0 | |
513 | :test:empty: |
|
551 | :test:empty: | |
514 | mandatory: 0 |
|
552 | mandatory: 0 | |
515 | advisory: 0 |
|
553 | advisory: 0 | |
516 | bundle2-input: payload chunk size: 0 |
|
554 | bundle2-input: payload chunk size: 0 | |
517 | payload: 0 bytes |
|
555 | payload: 0 bytes | |
518 | bundle2-input: part header size: 17 |
|
556 | bundle2-input: part header size: 17 | |
519 | bundle2-input: part type: "test:empty" |
|
557 | bundle2-input: part type: "test:empty" | |
520 | bundle2-input: part id: "1" |
|
558 | bundle2-input: part id: "1" | |
521 | bundle2-input: part parameters: 0 |
|
559 | bundle2-input: part parameters: 0 | |
522 | :test:empty: |
|
560 | :test:empty: | |
523 | mandatory: 0 |
|
561 | mandatory: 0 | |
524 | advisory: 0 |
|
562 | advisory: 0 | |
525 | bundle2-input: payload chunk size: 0 |
|
563 | bundle2-input: payload chunk size: 0 | |
526 | payload: 0 bytes |
|
564 | payload: 0 bytes | |
527 | bundle2-input: part header size: 16 |
|
565 | bundle2-input: part header size: 16 | |
528 | bundle2-input: part type: "test:song" |
|
566 | bundle2-input: part type: "test:song" | |
529 | bundle2-input: part id: "2" |
|
567 | bundle2-input: part id: "2" | |
530 | bundle2-input: part parameters: 0 |
|
568 | bundle2-input: part parameters: 0 | |
531 | :test:song: |
|
569 | :test:song: | |
532 | mandatory: 0 |
|
570 | mandatory: 0 | |
533 | advisory: 0 |
|
571 | advisory: 0 | |
534 | bundle2-input: payload chunk size: 178 |
|
572 | bundle2-input: payload chunk size: 178 | |
535 | bundle2-input: payload chunk size: 0 |
|
573 | bundle2-input: payload chunk size: 0 | |
536 | bundle2-input-part: total payload size 178 |
|
574 | bundle2-input-part: total payload size 178 | |
537 | payload: 178 bytes |
|
575 | payload: 178 bytes | |
538 | bundle2-input: part header size: 22 |
|
576 | bundle2-input: part header size: 22 | |
539 | bundle2-input: part type: "test:debugreply" |
|
577 | bundle2-input: part type: "test:debugreply" | |
540 | bundle2-input: part id: "3" |
|
578 | bundle2-input: part id: "3" | |
541 | bundle2-input: part parameters: 0 |
|
579 | bundle2-input: part parameters: 0 | |
542 | :test:debugreply: |
|
580 | :test:debugreply: | |
543 | mandatory: 0 |
|
581 | mandatory: 0 | |
544 | advisory: 0 |
|
582 | advisory: 0 | |
545 | bundle2-input: payload chunk size: 0 |
|
583 | bundle2-input: payload chunk size: 0 | |
546 | payload: 0 bytes |
|
584 | payload: 0 bytes | |
547 | bundle2-input: part header size: 43 |
|
585 | bundle2-input: part header size: 43 | |
548 | bundle2-input: part type: "test:math" |
|
586 | bundle2-input: part type: "test:math" | |
549 | bundle2-input: part id: "4" |
|
587 | bundle2-input: part id: "4" | |
550 | bundle2-input: part parameters: 3 |
|
588 | bundle2-input: part parameters: 3 | |
551 | :test:math: |
|
589 | :test:math: | |
552 | mandatory: 2 |
|
590 | mandatory: 2 | |
553 | advisory: 1 |
|
591 | advisory: 1 | |
554 | bundle2-input: payload chunk size: 2 |
|
592 | bundle2-input: payload chunk size: 2 | |
555 | bundle2-input: payload chunk size: 0 |
|
593 | bundle2-input: payload chunk size: 0 | |
556 | bundle2-input-part: total payload size 2 |
|
594 | bundle2-input-part: total payload size 2 | |
557 | payload: 2 bytes |
|
595 | payload: 2 bytes | |
558 | bundle2-input: part header size: 29 |
|
596 | bundle2-input: part header size: 29 | |
559 | bundle2-input: part type: "test:song" |
|
597 | bundle2-input: part type: "test:song" | |
560 | bundle2-input: part id: "5" |
|
598 | bundle2-input: part id: "5" | |
561 | bundle2-input: part parameters: 1 |
|
599 | bundle2-input: part parameters: 1 | |
562 | :test:song: |
|
600 | :test:song: | |
563 | mandatory: 1 |
|
601 | mandatory: 1 | |
564 | advisory: 0 |
|
602 | advisory: 0 | |
565 | bundle2-input: payload chunk size: 0 |
|
603 | bundle2-input: payload chunk size: 0 | |
566 | payload: 0 bytes |
|
604 | payload: 0 bytes | |
567 | bundle2-input: part header size: 16 |
|
605 | bundle2-input: part header size: 16 | |
568 | bundle2-input: part type: "test:ping" |
|
606 | bundle2-input: part type: "test:ping" | |
569 | bundle2-input: part id: "6" |
|
607 | bundle2-input: part id: "6" | |
570 | bundle2-input: part parameters: 0 |
|
608 | bundle2-input: part parameters: 0 | |
571 | :test:ping: |
|
609 | :test:ping: | |
572 | mandatory: 0 |
|
610 | mandatory: 0 | |
573 | advisory: 0 |
|
611 | advisory: 0 | |
574 | bundle2-input: payload chunk size: 0 |
|
612 | bundle2-input: payload chunk size: 0 | |
575 | payload: 0 bytes |
|
613 | payload: 0 bytes | |
576 | bundle2-input: part header size: 0 |
|
614 | bundle2-input: part header size: 0 | |
577 | bundle2-input: end of bundle2 stream |
|
615 | bundle2-input: end of bundle2 stream | |
578 | parts count: 7 |
|
616 | parts count: 7 | |
579 |
|
617 | |||
580 | Test actual unbundling of test part |
|
618 | Test actual unbundling of test part | |
581 | ======================================= |
|
619 | ======================================= | |
582 |
|
620 | |||
583 | Process the bundle |
|
621 | Process the bundle | |
584 |
|
622 | |||
585 | $ hg unbundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true < ../parts.hg2 |
|
623 | $ hg unbundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true < ../parts.hg2 | |
586 | bundle2-input: start processing of HG20 stream |
|
624 | bundle2-input: start processing of HG20 stream | |
587 | bundle2-input: reading bundle2 stream parameters |
|
625 | bundle2-input: reading bundle2 stream parameters | |
588 | bundle2-input-bundle: with-transaction |
|
626 | bundle2-input-bundle: with-transaction | |
589 | bundle2-input: start extraction of bundle2 parts |
|
627 | bundle2-input: start extraction of bundle2 parts | |
590 | bundle2-input: part header size: 17 |
|
628 | bundle2-input: part header size: 17 | |
591 | bundle2-input: part type: "test:empty" |
|
629 | bundle2-input: part type: "test:empty" | |
592 | bundle2-input: part id: "0" |
|
630 | bundle2-input: part id: "0" | |
593 | bundle2-input: part parameters: 0 |
|
631 | bundle2-input: part parameters: 0 | |
594 | bundle2-input: ignoring unsupported advisory part test:empty |
|
632 | bundle2-input: ignoring unsupported advisory part test:empty | |
595 | bundle2-input-part: "test:empty" (advisory) unsupported-type |
|
633 | bundle2-input-part: "test:empty" (advisory) unsupported-type | |
596 | bundle2-input: payload chunk size: 0 |
|
634 | bundle2-input: payload chunk size: 0 | |
597 | bundle2-input: part header size: 17 |
|
635 | bundle2-input: part header size: 17 | |
598 | bundle2-input: part type: "test:empty" |
|
636 | bundle2-input: part type: "test:empty" | |
599 | bundle2-input: part id: "1" |
|
637 | bundle2-input: part id: "1" | |
600 | bundle2-input: part parameters: 0 |
|
638 | bundle2-input: part parameters: 0 | |
601 | bundle2-input: ignoring unsupported advisory part test:empty |
|
639 | bundle2-input: ignoring unsupported advisory part test:empty | |
602 | bundle2-input-part: "test:empty" (advisory) unsupported-type |
|
640 | bundle2-input-part: "test:empty" (advisory) unsupported-type | |
603 | bundle2-input: payload chunk size: 0 |
|
641 | bundle2-input: payload chunk size: 0 | |
604 | bundle2-input: part header size: 16 |
|
642 | bundle2-input: part header size: 16 | |
605 | bundle2-input: part type: "test:song" |
|
643 | bundle2-input: part type: "test:song" | |
606 | bundle2-input: part id: "2" |
|
644 | bundle2-input: part id: "2" | |
607 | bundle2-input: part parameters: 0 |
|
645 | bundle2-input: part parameters: 0 | |
608 | bundle2-input: found a handler for part 'test:song' |
|
646 | bundle2-input: found a handler for part 'test:song' | |
609 | bundle2-input-part: "test:song" (advisory) supported |
|
647 | bundle2-input-part: "test:song" (advisory) supported | |
610 | The choir starts singing: |
|
648 | The choir starts singing: | |
611 | bundle2-input: payload chunk size: 178 |
|
649 | bundle2-input: payload chunk size: 178 | |
612 | bundle2-input: payload chunk size: 0 |
|
650 | bundle2-input: payload chunk size: 0 | |
613 | bundle2-input-part: total payload size 178 |
|
651 | bundle2-input-part: total payload size 178 | |
614 | Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko |
|
652 | Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko | |
615 | Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko |
|
653 | Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko | |
616 | Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko. |
|
654 | Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko. | |
617 | bundle2-input: part header size: 22 |
|
655 | bundle2-input: part header size: 22 | |
618 | bundle2-input: part type: "test:debugreply" |
|
656 | bundle2-input: part type: "test:debugreply" | |
619 | bundle2-input: part id: "3" |
|
657 | bundle2-input: part id: "3" | |
620 | bundle2-input: part parameters: 0 |
|
658 | bundle2-input: part parameters: 0 | |
621 | bundle2-input: found a handler for part 'test:debugreply' |
|
659 | bundle2-input: found a handler for part 'test:debugreply' | |
622 | bundle2-input-part: "test:debugreply" (advisory) supported |
|
660 | bundle2-input-part: "test:debugreply" (advisory) supported | |
623 | debugreply: no reply |
|
661 | debugreply: no reply | |
624 | bundle2-input: payload chunk size: 0 |
|
662 | bundle2-input: payload chunk size: 0 | |
625 | bundle2-input: part header size: 43 |
|
663 | bundle2-input: part header size: 43 | |
626 | bundle2-input: part type: "test:math" |
|
664 | bundle2-input: part type: "test:math" | |
627 | bundle2-input: part id: "4" |
|
665 | bundle2-input: part id: "4" | |
628 | bundle2-input: part parameters: 3 |
|
666 | bundle2-input: part parameters: 3 | |
629 | bundle2-input: ignoring unsupported advisory part test:math |
|
667 | bundle2-input: ignoring unsupported advisory part test:math | |
630 | bundle2-input-part: "test:math" (advisory) (params: 2 mandatory 2 advisory) unsupported-type |
|
668 | bundle2-input-part: "test:math" (advisory) (params: 2 mandatory 2 advisory) unsupported-type | |
631 | bundle2-input: payload chunk size: 2 |
|
669 | bundle2-input: payload chunk size: 2 | |
632 | bundle2-input: payload chunk size: 0 |
|
670 | bundle2-input: payload chunk size: 0 | |
633 | bundle2-input-part: total payload size 2 |
|
671 | bundle2-input-part: total payload size 2 | |
634 | bundle2-input: part header size: 29 |
|
672 | bundle2-input: part header size: 29 | |
635 | bundle2-input: part type: "test:song" |
|
673 | bundle2-input: part type: "test:song" | |
636 | bundle2-input: part id: "5" |
|
674 | bundle2-input: part id: "5" | |
637 | bundle2-input: part parameters: 1 |
|
675 | bundle2-input: part parameters: 1 | |
638 | bundle2-input: found a handler for part 'test:song' |
|
676 | bundle2-input: found a handler for part 'test:song' | |
639 | bundle2-input: ignoring unsupported advisory part test:song - randomparam |
|
677 | bundle2-input: ignoring unsupported advisory part test:song - randomparam | |
640 | bundle2-input-part: "test:song" (advisory) (params: 1 mandatory) unsupported-params (['randomparam']) |
|
678 | bundle2-input-part: "test:song" (advisory) (params: 1 mandatory) unsupported-params (['randomparam']) | |
641 | bundle2-input: payload chunk size: 0 |
|
679 | bundle2-input: payload chunk size: 0 | |
642 | bundle2-input: part header size: 16 |
|
680 | bundle2-input: part header size: 16 | |
643 | bundle2-input: part type: "test:ping" |
|
681 | bundle2-input: part type: "test:ping" | |
644 | bundle2-input: part id: "6" |
|
682 | bundle2-input: part id: "6" | |
645 | bundle2-input: part parameters: 0 |
|
683 | bundle2-input: part parameters: 0 | |
646 | bundle2-input: found a handler for part 'test:ping' |
|
684 | bundle2-input: found a handler for part 'test:ping' | |
647 | bundle2-input-part: "test:ping" (advisory) supported |
|
685 | bundle2-input-part: "test:ping" (advisory) supported | |
648 | received ping request (id 6) |
|
686 | received ping request (id 6) | |
649 | bundle2-input: payload chunk size: 0 |
|
687 | bundle2-input: payload chunk size: 0 | |
650 | bundle2-input: part header size: 0 |
|
688 | bundle2-input: part header size: 0 | |
651 | bundle2-input: end of bundle2 stream |
|
689 | bundle2-input: end of bundle2 stream | |
652 | bundle2-input-bundle: 6 parts total |
|
690 | bundle2-input-bundle: 6 parts total | |
653 | 0 unread bytes |
|
691 | 0 unread bytes | |
654 | 3 total verses sung |
|
692 | 3 total verses sung | |
655 |
|
693 | |||
656 | Unbundle with an unknown mandatory part |
|
694 | Unbundle with an unknown mandatory part | |
657 | (should abort) |
|
695 | (should abort) | |
658 |
|
696 | |||
659 | $ hg bundle2 --parts --unknown ../unknown.hg2 |
|
697 | $ hg bundle2 --parts --unknown ../unknown.hg2 | |
660 |
|
698 | |||
661 | $ hg unbundle2 < ../unknown.hg2 |
|
699 | $ hg unbundle2 < ../unknown.hg2 | |
662 | The choir starts singing: |
|
700 | The choir starts singing: | |
663 | Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko |
|
701 | Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko | |
664 | Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko |
|
702 | Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko | |
665 | Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko. |
|
703 | Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko. | |
666 | debugreply: no reply |
|
704 | debugreply: no reply | |
667 | 0 unread bytes |
|
705 | 0 unread bytes | |
668 | abort: missing support for test:unknown |
|
706 | abort: missing support for test:unknown | |
669 | [255] |
|
707 | [255] | |
670 |
|
708 | |||
671 | Unbundle with an unknown mandatory part parameters |
|
709 | Unbundle with an unknown mandatory part parameters | |
672 | (should abort) |
|
710 | (should abort) | |
673 |
|
711 | |||
674 | $ hg bundle2 --unknownparams ../unknown.hg2 |
|
712 | $ hg bundle2 --unknownparams ../unknown.hg2 | |
675 |
|
713 | |||
676 | $ hg unbundle2 < ../unknown.hg2 |
|
714 | $ hg unbundle2 < ../unknown.hg2 | |
677 | 0 unread bytes |
|
715 | 0 unread bytes | |
678 | abort: missing support for test:song - randomparams |
|
716 | abort: missing support for test:song - randomparams | |
679 | [255] |
|
717 | [255] | |
680 |
|
718 | |||
681 | unbundle with a reply |
|
719 | unbundle with a reply | |
682 |
|
720 | |||
683 | $ hg bundle2 --parts --reply ../parts-reply.hg2 |
|
721 | $ hg bundle2 --parts --reply ../parts-reply.hg2 | |
684 | $ hg unbundle2 ../reply.hg2 < ../parts-reply.hg2 |
|
722 | $ hg unbundle2 ../reply.hg2 < ../parts-reply.hg2 | |
685 | 0 unread bytes |
|
723 | 0 unread bytes | |
686 | 3 total verses sung |
|
724 | 3 total verses sung | |
687 |
|
725 | |||
688 | The reply is a bundle |
|
726 | The reply is a bundle | |
689 |
|
727 | |||
690 |
$ |
|
728 | $ f --hexdump ../reply.hg2 | |
691 | HG20\x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc) |
|
729 | ../reply.hg2: | |
692 | Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko |
|
730 | 0000: 48 47 32 30 00 00 00 00 00 00 00 1b 06 6f 75 74 |HG20.........out| | |
693 | Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko |
|
731 | 0010: 70 75 74 00 00 00 00 00 01 0b 01 69 6e 2d 72 65 |put........in-re| | |
694 | Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko. |
|
732 | 0020: 70 6c 79 2d 74 6f 33 00 00 00 d9 54 68 65 20 63 |ply-to3....The c| | |
695 | \x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to4\x00\x00\x00\xc9debugreply: capabilities: (esc) |
|
733 | 0030: 68 6f 69 72 20 73 74 61 72 74 73 20 73 69 6e 67 |hoir starts sing| | |
696 | debugreply: 'city=!' |
|
734 | 0040: 69 6e 67 3a 0a 20 20 20 20 50 61 74 61 6c 69 20 |ing:. Patali | | |
697 | debugreply: 'celeste,ville' |
|
735 | 0050: 44 69 72 61 70 61 74 61 2c 20 43 72 6f 6d 64 61 |Dirapata, Cromda| | |
698 | debugreply: 'elephants' |
|
736 | 0060: 20 43 72 6f 6d 64 61 20 52 69 70 61 6c 6f 2c 20 | Cromda Ripalo, | | |
699 | debugreply: 'babar' |
|
737 | 0070: 50 61 74 61 20 50 61 74 61 2c 20 4b 6f 20 4b 6f |Pata Pata, Ko Ko| | |
700 | debugreply: 'celeste' |
|
738 | 0080: 20 4b 6f 0a 20 20 20 20 42 6f 6b 6f 72 6f 20 44 | Ko. Bokoro D| | |
701 | debugreply: 'ping-pong' |
|
739 | 0090: 69 70 6f 75 6c 69 74 6f 2c 20 52 6f 6e 64 69 20 |ipoulito, Rondi | | |
702 | \x00\x00\x00\x00\x00\x00\x00\x1e test:pong\x00\x00\x00\x02\x01\x00\x0b\x01in-reply-to7\x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x03\x00\x01\x0b\x01in-reply-to7\x00\x00\x00=received ping request (id 7) (esc) |
|
740 | 00a0: 52 6f 6e 64 69 20 50 65 70 69 6e 6f 2c 20 50 61 |Rondi Pepino, Pa| | |
703 | replying to ping request (id 7) |
|
741 | 00b0: 74 61 20 50 61 74 61 2c 20 4b 6f 20 4b 6f 20 4b |ta Pata, Ko Ko K| | |
704 | \x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc) |
|
742 | 00c0: 6f 0a 20 20 20 20 45 6d 61 6e 61 20 4b 61 72 61 |o. Emana Kara| | |
|
743 | 00d0: 73 73 6f 6c 69 2c 20 4c 6f 75 63 72 61 20 4c 6f |ssoli, Loucra Lo| | |||
|
744 | 00e0: 75 63 72 61 20 50 6f 6e 70 6f 6e 74 6f 2c 20 50 |ucra Ponponto, P| | |||
|
745 | 00f0: 61 74 61 20 50 61 74 61 2c 20 4b 6f 20 4b 6f 20 |ata Pata, Ko Ko | | |||
|
746 | 0100: 4b 6f 2e 0a 00 00 00 00 00 00 00 1b 06 6f 75 74 |Ko...........out| | |||
|
747 | 0110: 70 75 74 00 00 00 01 00 01 0b 01 69 6e 2d 72 65 |put........in-re| | |||
|
748 | 0120: 70 6c 79 2d 74 6f 34 00 00 00 c9 64 65 62 75 67 |ply-to4....debug| | |||
|
749 | 0130: 72 65 70 6c 79 3a 20 63 61 70 61 62 69 6c 69 74 |reply: capabilit| | |||
|
750 | 0140: 69 65 73 3a 0a 64 65 62 75 67 72 65 70 6c 79 3a |ies:.debugreply:| | |||
|
751 | 0150: 20 20 20 20 20 27 63 69 74 79 3d 21 27 0a 64 65 | 'city=!'.de| | |||
|
752 | 0160: 62 75 67 72 65 70 6c 79 3a 20 20 20 20 20 20 20 |bugreply: | | |||
|
753 | 0170: 20 20 27 63 65 6c 65 73 74 65 2c 76 69 6c 6c 65 | 'celeste,ville| | |||
|
754 | 0180: 27 0a 64 65 62 75 67 72 65 70 6c 79 3a 20 20 20 |'.debugreply: | | |||
|
755 | 0190: 20 20 27 65 6c 65 70 68 61 6e 74 73 27 0a 64 65 | 'elephants'.de| | |||
|
756 | 01a0: 62 75 67 72 65 70 6c 79 3a 20 20 20 20 20 20 20 |bugreply: | | |||
|
757 | 01b0: 20 20 27 62 61 62 61 72 27 0a 64 65 62 75 67 72 | 'babar'.debugr| | |||
|
758 | 01c0: 65 70 6c 79 3a 20 20 20 20 20 20 20 20 20 27 63 |eply: 'c| | |||
|
759 | 01d0: 65 6c 65 73 74 65 27 0a 64 65 62 75 67 72 65 70 |eleste'.debugrep| | |||
|
760 | 01e0: 6c 79 3a 20 20 20 20 20 27 70 69 6e 67 2d 70 6f |ly: 'ping-po| | |||
|
761 | 01f0: 6e 67 27 0a 00 00 00 00 00 00 00 1e 09 74 65 73 |ng'..........tes| | |||
|
762 | 0200: 74 3a 70 6f 6e 67 00 00 00 02 01 00 0b 01 69 6e |t:pong........in| | |||
|
763 | 0210: 2d 72 65 70 6c 79 2d 74 6f 37 00 00 00 00 00 00 |-reply-to7......| | |||
|
764 | 0220: 00 1b 06 6f 75 74 70 75 74 00 00 00 03 00 01 0b |...output.......| | |||
|
765 | 0230: 01 69 6e 2d 72 65 70 6c 79 2d 74 6f 37 00 00 00 |.in-reply-to7...| | |||
|
766 | 0240: 3d 72 65 63 65 69 76 65 64 20 70 69 6e 67 20 72 |=received ping r| | |||
|
767 | 0250: 65 71 75 65 73 74 20 28 69 64 20 37 29 0a 72 65 |equest (id 7).re| | |||
|
768 | 0260: 70 6c 79 69 6e 67 20 74 6f 20 70 69 6e 67 20 72 |plying to ping r| | |||
|
769 | 0270: 65 71 75 65 73 74 20 28 69 64 20 37 29 0a 00 00 |equest (id 7)...| | |||
|
770 | 0280: 00 00 00 00 00 00 |......| | |||
705 |
|
771 | |||
706 | The reply is valid |
|
772 | The reply is valid | |
707 |
|
773 | |||
708 | $ hg statbundle2 < ../reply.hg2 |
|
774 | $ hg statbundle2 < ../reply.hg2 | |
709 | options count: 0 |
|
775 | options count: 0 | |
710 | :output: |
|
776 | :output: | |
711 | mandatory: 0 |
|
777 | mandatory: 0 | |
712 | advisory: 1 |
|
778 | advisory: 1 | |
713 | payload: 217 bytes |
|
779 | payload: 217 bytes | |
714 | :output: |
|
780 | :output: | |
715 | mandatory: 0 |
|
781 | mandatory: 0 | |
716 | advisory: 1 |
|
782 | advisory: 1 | |
717 | payload: 201 bytes |
|
783 | payload: 201 bytes | |
718 | :test:pong: |
|
784 | :test:pong: | |
719 | mandatory: 1 |
|
785 | mandatory: 1 | |
720 | advisory: 0 |
|
786 | advisory: 0 | |
721 | payload: 0 bytes |
|
787 | payload: 0 bytes | |
722 | :output: |
|
788 | :output: | |
723 | mandatory: 0 |
|
789 | mandatory: 0 | |
724 | advisory: 1 |
|
790 | advisory: 1 | |
725 | payload: 61 bytes |
|
791 | payload: 61 bytes | |
726 | parts count: 4 |
|
792 | parts count: 4 | |
727 |
|
793 | |||
728 | Unbundle the reply to get the output: |
|
794 | Unbundle the reply to get the output: | |
729 |
|
795 | |||
730 | $ hg unbundle2 < ../reply.hg2 |
|
796 | $ hg unbundle2 < ../reply.hg2 | |
731 | remote: The choir starts singing: |
|
797 | remote: The choir starts singing: | |
732 | remote: Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko |
|
798 | remote: Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko | |
733 | remote: Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko |
|
799 | remote: Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko | |
734 | remote: Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko. |
|
800 | remote: Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko. | |
735 | remote: debugreply: capabilities: |
|
801 | remote: debugreply: capabilities: | |
736 | remote: debugreply: 'city=!' |
|
802 | remote: debugreply: 'city=!' | |
737 | remote: debugreply: 'celeste,ville' |
|
803 | remote: debugreply: 'celeste,ville' | |
738 | remote: debugreply: 'elephants' |
|
804 | remote: debugreply: 'elephants' | |
739 | remote: debugreply: 'babar' |
|
805 | remote: debugreply: 'babar' | |
740 | remote: debugreply: 'celeste' |
|
806 | remote: debugreply: 'celeste' | |
741 | remote: debugreply: 'ping-pong' |
|
807 | remote: debugreply: 'ping-pong' | |
742 | remote: received ping request (id 7) |
|
808 | remote: received ping request (id 7) | |
743 | remote: replying to ping request (id 7) |
|
809 | remote: replying to ping request (id 7) | |
744 | 0 unread bytes |
|
810 | 0 unread bytes | |
745 |
|
811 | |||
746 | Test push race detection |
|
812 | Test push race detection | |
747 |
|
813 | |||
748 | $ hg bundle2 --pushrace ../part-race.hg2 |
|
814 | $ hg bundle2 --pushrace ../part-race.hg2 | |
749 |
|
815 | |||
750 | $ hg unbundle2 < ../part-race.hg2 |
|
816 | $ hg unbundle2 < ../part-race.hg2 | |
751 | 0 unread bytes |
|
817 | 0 unread bytes | |
752 | abort: push race: repository changed while pushing - please try again |
|
818 | abort: push race: repository changed while pushing - please try again | |
753 | [255] |
|
819 | [255] | |
754 |
|
820 | |||
755 | Support for changegroup |
|
821 | Support for changegroup | |
756 | =================================== |
|
822 | =================================== | |
757 |
|
823 | |||
758 | $ hg unbundle $TESTDIR/bundles/rebase.hg |
|
824 | $ hg unbundle $TESTDIR/bundles/rebase.hg | |
759 | adding changesets |
|
825 | adding changesets | |
760 | adding manifests |
|
826 | adding manifests | |
761 | adding file changes |
|
827 | adding file changes | |
762 | added 8 changesets with 7 changes to 7 files (+3 heads) |
|
828 | added 8 changesets with 7 changes to 7 files (+3 heads) | |
763 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
829 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
764 |
|
830 | |||
765 | $ hg log -G |
|
831 | $ hg log -G | |
766 | o 8:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> H |
|
832 | o 8:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> H | |
767 | | |
|
833 | | | |
768 | | o 7:eea13746799a draft Nicolas Dumazet <nicdumz.commits@gmail.com> G |
|
834 | | o 7:eea13746799a draft Nicolas Dumazet <nicdumz.commits@gmail.com> G | |
769 | |/| |
|
835 | |/| | |
770 | o | 6:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
836 | o | 6:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F | |
771 | | | |
|
837 | | | | |
772 | | o 5:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
838 | | o 5:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E | |
773 | |/ |
|
839 | |/ | |
774 | | o 4:32af7686d403 draft Nicolas Dumazet <nicdumz.commits@gmail.com> D |
|
840 | | o 4:32af7686d403 draft Nicolas Dumazet <nicdumz.commits@gmail.com> D | |
775 | | | |
|
841 | | | | |
776 | | o 3:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> C |
|
842 | | o 3:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> C | |
777 | | | |
|
843 | | | | |
778 | | o 2:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> B |
|
844 | | o 2:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> B | |
779 | |/ |
|
845 | |/ | |
780 | o 1:cd010b8cd998 draft Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
846 | o 1:cd010b8cd998 draft Nicolas Dumazet <nicdumz.commits@gmail.com> A | |
781 |
|
847 | |||
782 | @ 0:3903775176ed draft test a |
|
848 | @ 0:3903775176ed draft test a | |
783 |
|
849 | |||
784 |
|
850 | |||
785 | $ hg bundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true --rev '8+7+5+4' ../rev.hg2 |
|
851 | $ hg bundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true --rev '8+7+5+4' ../rev.hg2 | |
786 | 4 changesets found |
|
852 | 4 changesets found | |
787 | list of changesets: |
|
853 | list of changesets: | |
788 | 32af7686d403cf45b5d95f2d70cebea587ac806a |
|
854 | 32af7686d403cf45b5d95f2d70cebea587ac806a | |
789 | 9520eea781bcca16c1e15acc0ba14335a0e8e5ba |
|
855 | 9520eea781bcca16c1e15acc0ba14335a0e8e5ba | |
790 | eea13746799a9e0bfd88f29d3c2e9dc9389f524f |
|
856 | eea13746799a9e0bfd88f29d3c2e9dc9389f524f | |
791 | 02de42196ebee42ef284b6780a87cdc96e8eaab6 |
|
857 | 02de42196ebee42ef284b6780a87cdc96e8eaab6 | |
792 | bundle2-output-bundle: "HG20", 1 parts total |
|
858 | bundle2-output-bundle: "HG20", 1 parts total | |
793 | bundle2-output: start emission of HG20 stream |
|
859 | bundle2-output: start emission of HG20 stream | |
794 | bundle2-output: bundle parameter: |
|
860 | bundle2-output: bundle parameter: | |
795 | bundle2-output: start of parts |
|
861 | bundle2-output: start of parts | |
796 | bundle2-output: bundle part: "changegroup" |
|
862 | bundle2-output: bundle part: "changegroup" | |
797 | bundle2-output-part: "changegroup" (advisory) streamed payload |
|
863 | bundle2-output-part: "changegroup" (advisory) streamed payload | |
798 | bundle2-output: part 0: "changegroup" |
|
864 | bundle2-output: part 0: "changegroup" | |
799 | bundle2-output: header chunk size: 18 |
|
865 | bundle2-output: header chunk size: 18 | |
800 | bundling: 1/4 changesets (25.00%) |
|
866 | bundling: 1/4 changesets (25.00%) | |
801 | bundling: 2/4 changesets (50.00%) |
|
867 | bundling: 2/4 changesets (50.00%) | |
802 | bundling: 3/4 changesets (75.00%) |
|
868 | bundling: 3/4 changesets (75.00%) | |
803 | bundling: 4/4 changesets (100.00%) |
|
869 | bundling: 4/4 changesets (100.00%) | |
804 | bundling: 1/4 manifests (25.00%) |
|
870 | bundling: 1/4 manifests (25.00%) | |
805 | bundling: 2/4 manifests (50.00%) |
|
871 | bundling: 2/4 manifests (50.00%) | |
806 | bundling: 3/4 manifests (75.00%) |
|
872 | bundling: 3/4 manifests (75.00%) | |
807 | bundling: 4/4 manifests (100.00%) |
|
873 | bundling: 4/4 manifests (100.00%) | |
808 | bundling: D 1/3 files (33.33%) |
|
874 | bundling: D 1/3 files (33.33%) | |
809 | bundling: E 2/3 files (66.67%) |
|
875 | bundling: E 2/3 files (66.67%) | |
810 | bundling: H 3/3 files (100.00%) |
|
876 | bundling: H 3/3 files (100.00%) | |
811 | bundle2-output: payload chunk size: 1555 |
|
877 | bundle2-output: payload chunk size: 1555 | |
812 | bundle2-output: closing payload chunk |
|
878 | bundle2-output: closing payload chunk | |
813 | bundle2-output: end of bundle |
|
879 | bundle2-output: end of bundle | |
814 |
|
880 | |||
815 |
$ |
|
881 | $ f --hexdump ../rev.hg2 | |
816 | HG20\x00\x00\x00\x00\x00\x00\x00\x12\x0bchangegroup\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) |
|
882 | ../rev.hg2: | |
817 | \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc) |
|
883 | 0000: 48 47 32 30 00 00 00 00 00 00 00 12 0b 63 68 61 |HG20.........cha| | |
818 | \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) |
|
884 | 0010: 6e 67 65 67 72 6f 75 70 00 00 00 00 00 00 00 00 |ngegroup........| | |
819 | \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02E (esc) |
|
885 | 0020: 06 13 00 00 00 a4 32 af 76 86 d4 03 cf 45 b5 d9 |......2.v....E..| | |
820 | \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) |
|
886 | 0030: 5f 2d 70 ce be a5 87 ac 80 6a 5f dd d9 89 57 c8 |_-p......j_...W.| | |
821 | \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) |
|
887 | 0040: a5 4a 4d 43 6d fe 1d a9 d8 7f 21 a1 b9 7b 00 00 |.JMCm.....!..{..| | |
822 | \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) |
|
888 | 0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |
823 | \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)8bee48edc7318541fc0013ee41b089276a8c24bf (esc) |
|
889 | 0060: 00 00 32 af 76 86 d4 03 cf 45 b5 d9 5f 2d 70 ce |..2.v....E.._-p.| | |
824 | \x00\x00\x00f\x00\x00\x00f\x00\x00\x00\x02H (esc) |
|
890 | 0070: be a5 87 ac 80 6a 00 00 00 00 00 00 00 29 00 00 |.....j.......)..| | |
825 | \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) |
|
891 | 0080: 00 29 36 65 31 66 34 63 34 37 65 63 62 35 33 33 |.)6e1f4c47ecb533| | |
826 | \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) |
|
892 | 0090: 66 66 64 30 63 38 65 35 32 63 64 63 38 38 61 66 |ffd0c8e52cdc88af| | |
827 | \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) |
|
893 | 00a0: 62 36 63 64 33 39 65 32 30 63 0a 00 00 00 66 00 |b6cd39e20c....f.| | |
828 | \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) |
|
894 | 00b0: 00 00 68 00 00 00 02 44 0a 00 00 00 69 00 00 00 |..h....D....i...| | |
829 | \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) |
|
895 | 00c0: 6a 00 00 00 01 44 00 00 00 a4 95 20 ee a7 81 bc |j....D..... ....| | |
830 | \x00\x00\x00\x00\x00\x00\x00\x05D\x00\x00\x00b\xc3\xf1\xca)$\xc1j\x19\xb0ej\x84\x90\x0ePN[ (esc) |
|
896 | 00d0: ca 16 c1 e1 5a cc 0b a1 43 35 a0 e8 e5 ba cd 01 |....Z...C5......| | |
831 | \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) |
|
897 | 00e0: 0b 8c d9 98 f3 98 1a 5a 81 15 f9 4f 8d a4 ab 50 |.......Z...O...P| | |
832 | \x00\x00\x00\x00\x00\x00\x00\x05E\x00\x00\x00b\x9co\xd05 (esc) |
|
898 | 00f0: 60 89 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |`...............| | |
833 | l\r (no-eol) (esc) |
|
899 | 0100: 00 00 00 00 00 00 95 20 ee a7 81 bc ca 16 c1 e1 |....... ........| | |
834 | \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) |
|
900 | 0110: 5a cc 0b a1 43 35 a0 e8 e5 ba 00 00 00 00 00 00 |Z...C5..........| | |
835 | \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) |
|
901 | 0120: 00 29 00 00 00 29 34 64 65 63 65 39 63 38 32 36 |.)...)4dece9c826| | |
836 | \x87\xcd\xc9n\x8e\xaa\xb6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02H (esc) |
|
902 | 0130: 66 36 39 34 39 30 35 30 37 62 39 38 63 36 33 38 |f69490507b98c638| | |
837 | \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc) |
|
903 | 0140: 33 61 33 30 30 39 62 32 39 35 38 33 37 64 0a 00 |3a3009b295837d..| | |
|
904 | 0150: 00 00 66 00 00 00 68 00 00 00 02 45 0a 00 00 00 |..f...h....E....| | |||
|
905 | 0160: 69 00 00 00 6a 00 00 00 01 45 00 00 00 a2 ee a1 |i...j....E......| | |||
|
906 | 0170: 37 46 79 9a 9e 0b fd 88 f2 9d 3c 2e 9d c9 38 9f |7Fy.......<...8.| | |||
|
907 | 0180: 52 4f 24 b6 38 7c 8c 8c ae 37 17 88 80 f3 fa 95 |RO$.8|...7......| | |||
|
908 | 0190: de d3 cb 1c f7 85 95 20 ee a7 81 bc ca 16 c1 e1 |....... ........| | |||
|
909 | 01a0: 5a cc 0b a1 43 35 a0 e8 e5 ba ee a1 37 46 79 9a |Z...C5......7Fy.| | |||
|
910 | 01b0: 9e 0b fd 88 f2 9d 3c 2e 9d c9 38 9f 52 4f 00 00 |......<...8.RO..| | |||
|
911 | 01c0: 00 00 00 00 00 29 00 00 00 29 33 36 35 62 39 33 |.....)...)365b93| | |||
|
912 | 01d0: 64 35 37 66 64 66 34 38 31 34 65 32 62 35 39 31 |d57fdf4814e2b591| | |||
|
913 | 01e0: 31 64 36 62 61 63 66 66 32 62 31 32 30 31 34 34 |1d6bacff2b120144| | |||
|
914 | 01f0: 34 31 0a 00 00 00 66 00 00 00 68 00 00 00 00 00 |41....f...h.....| | |||
|
915 | 0200: 00 00 69 00 00 00 6a 00 00 00 01 47 00 00 00 a4 |..i...j....G....| | |||
|
916 | 0210: 02 de 42 19 6e be e4 2e f2 84 b6 78 0a 87 cd c9 |..B.n......x....| | |||
|
917 | 0220: 6e 8e aa b6 24 b6 38 7c 8c 8c ae 37 17 88 80 f3 |n...$.8|...7....| | |||
|
918 | 0230: fa 95 de d3 cb 1c f7 85 00 00 00 00 00 00 00 00 |................| | |||
|
919 | 0240: 00 00 00 00 00 00 00 00 00 00 00 00 02 de 42 19 |..............B.| | |||
|
920 | 0250: 6e be e4 2e f2 84 b6 78 0a 87 cd c9 6e 8e aa b6 |n......x....n...| | |||
|
921 | 0260: 00 00 00 00 00 00 00 29 00 00 00 29 38 62 65 65 |.......)...)8bee| | |||
|
922 | 0270: 34 38 65 64 63 37 33 31 38 35 34 31 66 63 30 30 |48edc7318541fc00| | |||
|
923 | 0280: 31 33 65 65 34 31 62 30 38 39 32 37 36 61 38 63 |13ee41b089276a8c| | |||
|
924 | 0290: 32 34 62 66 0a 00 00 00 66 00 00 00 66 00 00 00 |24bf....f...f...| | |||
|
925 | 02a0: 02 48 0a 00 00 00 67 00 00 00 68 00 00 00 01 48 |.H....g...h....H| | |||
|
926 | 02b0: 00 00 00 00 00 00 00 8b 6e 1f 4c 47 ec b5 33 ff |........n.LG..3.| | |||
|
927 | 02c0: d0 c8 e5 2c dc 88 af b6 cd 39 e2 0c 66 a5 a0 18 |...,.....9..f...| | |||
|
928 | 02d0: 17 fd f5 23 9c 27 38 02 b5 b7 61 8d 05 1c 89 e4 |...#.'8...a.....| | |||
|
929 | 02e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |||
|
930 | 02f0: 00 00 00 00 32 af 76 86 d4 03 cf 45 b5 d9 5f 2d |....2.v....E.._-| | |||
|
931 | 0300: 70 ce be a5 87 ac 80 6a 00 00 00 81 00 00 00 81 |p......j........| | |||
|
932 | 0310: 00 00 00 2b 44 00 63 33 66 31 63 61 32 39 32 34 |...+D.c3f1ca2924| | |||
|
933 | 0320: 63 31 36 61 31 39 62 30 36 35 36 61 38 34 39 30 |c16a19b0656a8490| | |||
|
934 | 0330: 30 65 35 30 34 65 35 62 30 61 65 63 32 64 0a 00 |0e504e5b0aec2d..| | |||
|
935 | 0340: 00 00 8b 4d ec e9 c8 26 f6 94 90 50 7b 98 c6 38 |...M...&...P{..8| | |||
|
936 | 0350: 3a 30 09 b2 95 83 7d 00 7d 8c 9d 88 84 13 25 f5 |:0....}.}.....%.| | |||
|
937 | 0360: c6 b0 63 71 b3 5b 4e 8a 2b 1a 83 00 00 00 00 00 |..cq.[N.+.......| | |||
|
938 | 0370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 95 |................| | |||
|
939 | 0380: 20 ee a7 81 bc ca 16 c1 e1 5a cc 0b a1 43 35 a0 | ........Z...C5.| | |||
|
940 | 0390: e8 e5 ba 00 00 00 2b 00 00 00 ac 00 00 00 2b 45 |......+.......+E| | |||
|
941 | 03a0: 00 39 63 36 66 64 30 33 35 30 61 36 63 30 64 30 |.9c6fd0350a6c0d0| | |||
|
942 | 03b0: 63 34 39 64 34 61 39 63 35 30 31 37 63 66 30 37 |c49d4a9c5017cf07| | |||
|
943 | 03c0: 30 34 33 66 35 34 65 35 38 0a 00 00 00 8b 36 5b |043f54e58.....6[| | |||
|
944 | 03d0: 93 d5 7f df 48 14 e2 b5 91 1d 6b ac ff 2b 12 01 |....H.....k..+..| | |||
|
945 | 03e0: 44 41 28 a5 84 c6 5e f1 21 f8 9e b6 6a b7 d0 bc |DA(...^.!...j...| | |||
|
946 | 03f0: 15 3d 80 99 e7 ce 4d ec e9 c8 26 f6 94 90 50 7b |.=....M...&...P{| | |||
|
947 | 0400: 98 c6 38 3a 30 09 b2 95 83 7d ee a1 37 46 79 9a |..8:0....}..7Fy.| | |||
|
948 | 0410: 9e 0b fd 88 f2 9d 3c 2e 9d c9 38 9f 52 4f 00 00 |......<...8.RO..| | |||
|
949 | 0420: 00 56 00 00 00 56 00 00 00 2b 46 00 32 32 62 66 |.V...V...+F.22bf| | |||
|
950 | 0430: 63 66 64 36 32 61 32 31 61 33 32 38 37 65 64 62 |cfd62a21a3287edb| | |||
|
951 | 0440: 64 34 64 36 35 36 32 31 38 64 30 66 35 32 35 65 |d4d656218d0f525e| | |||
|
952 | 0450: 64 37 36 61 0a 00 00 00 97 8b ee 48 ed c7 31 85 |d76a.......H..1.| | |||
|
953 | 0460: 41 fc 00 13 ee 41 b0 89 27 6a 8c 24 bf 28 a5 84 |A....A..'j.$.(..| | |||
|
954 | 0470: c6 5e f1 21 f8 9e b6 6a b7 d0 bc 15 3d 80 99 e7 |.^.!...j....=...| | |||
|
955 | 0480: ce 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |||
|
956 | 0490: 00 00 00 00 00 02 de 42 19 6e be e4 2e f2 84 b6 |.......B.n......| | |||
|
957 | 04a0: 78 0a 87 cd c9 6e 8e aa b6 00 00 00 2b 00 00 00 |x....n......+...| | |||
|
958 | 04b0: 56 00 00 00 00 00 00 00 81 00 00 00 81 00 00 00 |V...............| | |||
|
959 | 04c0: 2b 48 00 38 35 30 30 31 38 39 65 37 34 61 39 65 |+H.8500189e74a9e| | |||
|
960 | 04d0: 30 34 37 35 65 38 32 32 30 39 33 62 63 37 64 62 |0475e822093bc7db| | |||
|
961 | 04e0: 30 64 36 33 31 61 65 62 30 62 34 0a 00 00 00 00 |0d631aeb0b4.....| | |||
|
962 | 04f0: 00 00 00 05 44 00 00 00 62 c3 f1 ca 29 24 c1 6a |....D...b...)$.j| | |||
|
963 | 0500: 19 b0 65 6a 84 90 0e 50 4e 5b 0a ec 2d 00 00 00 |..ej...PN[..-...| | |||
|
964 | 0510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |||
|
965 | 0520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |||
|
966 | 0530: 00 00 00 00 00 32 af 76 86 d4 03 cf 45 b5 d9 5f |.....2.v....E.._| | |||
|
967 | 0540: 2d 70 ce be a5 87 ac 80 6a 00 00 00 00 00 00 00 |-p......j.......| | |||
|
968 | 0550: 00 00 00 00 02 44 0a 00 00 00 00 00 00 00 05 45 |.....D.........E| | |||
|
969 | 0560: 00 00 00 62 9c 6f d0 35 0a 6c 0d 0c 49 d4 a9 c5 |...b.o.5.l..I...| | |||
|
970 | 0570: 01 7c f0 70 43 f5 4e 58 00 00 00 00 00 00 00 00 |.|.pC.NX........| | |||
|
971 | 0580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |||
|
972 | 0590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |||
|
973 | 05a0: 95 20 ee a7 81 bc ca 16 c1 e1 5a cc 0b a1 43 35 |. ........Z...C5| | |||
|
974 | 05b0: a0 e8 e5 ba 00 00 00 00 00 00 00 00 00 00 00 02 |................| | |||
|
975 | 05c0: 45 0a 00 00 00 00 00 00 00 05 48 00 00 00 62 85 |E.........H...b.| | |||
|
976 | 05d0: 00 18 9e 74 a9 e0 47 5e 82 20 93 bc 7d b0 d6 31 |...t..G^. ..}..1| | |||
|
977 | 05e0: ae b0 b4 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |||
|
978 | 05f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | |||
|
979 | 0600: 00 00 00 00 00 00 00 00 00 00 00 02 de 42 19 6e |.............B.n| | |||
|
980 | 0610: be e4 2e f2 84 b6 78 0a 87 cd c9 6e 8e aa b6 00 |......x....n....| | |||
|
981 | 0620: 00 00 00 00 00 00 00 00 00 00 02 48 0a 00 00 00 |...........H....| | |||
|
982 | 0630: 00 00 00 00 00 00 00 00 00 00 00 00 00 |.............| | |||
838 |
|
983 | |||
839 | $ hg debugbundle ../rev.hg2 |
|
984 | $ hg debugbundle ../rev.hg2 | |
840 | Stream params: {} |
|
985 | Stream params: {} | |
841 | changegroup -- '{}' |
|
986 | changegroup -- '{}' | |
842 | 32af7686d403cf45b5d95f2d70cebea587ac806a |
|
987 | 32af7686d403cf45b5d95f2d70cebea587ac806a | |
843 | 9520eea781bcca16c1e15acc0ba14335a0e8e5ba |
|
988 | 9520eea781bcca16c1e15acc0ba14335a0e8e5ba | |
844 | eea13746799a9e0bfd88f29d3c2e9dc9389f524f |
|
989 | eea13746799a9e0bfd88f29d3c2e9dc9389f524f | |
845 | 02de42196ebee42ef284b6780a87cdc96e8eaab6 |
|
990 | 02de42196ebee42ef284b6780a87cdc96e8eaab6 | |
846 | $ hg unbundle ../rev.hg2 |
|
991 | $ hg unbundle ../rev.hg2 | |
847 | adding changesets |
|
992 | adding changesets | |
848 | adding manifests |
|
993 | adding manifests | |
849 | adding file changes |
|
994 | adding file changes | |
850 | added 0 changesets with 0 changes to 3 files |
|
995 | added 0 changesets with 0 changes to 3 files | |
851 |
|
996 | |||
852 | with reply |
|
997 | with reply | |
853 |
|
998 | |||
854 | $ hg bundle2 --rev '8+7+5+4' --reply ../rev-rr.hg2 |
|
999 | $ hg bundle2 --rev '8+7+5+4' --reply ../rev-rr.hg2 | |
855 | $ hg unbundle2 ../rev-reply.hg2 < ../rev-rr.hg2 |
|
1000 | $ hg unbundle2 ../rev-reply.hg2 < ../rev-rr.hg2 | |
856 | 0 unread bytes |
|
1001 | 0 unread bytes | |
857 | addchangegroup return: 1 |
|
1002 | addchangegroup return: 1 | |
858 |
|
1003 | |||
859 |
$ |
|
1004 | $ f --hexdump ../rev-reply.hg2 | |
860 | HG20\x00\x00\x00\x00\x00\x00\x00/\x11reply:changegroup\x00\x00\x00\x00\x00\x02\x0b\x01\x06\x01in-reply-to1return1\x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to1\x00\x00\x00dadding changesets (esc) |
|
1005 | ../rev-reply.hg2: | |
861 | adding manifests |
|
1006 | 0000: 48 47 32 30 00 00 00 00 00 00 00 2f 11 72 65 70 |HG20......./.rep| | |
862 | adding file changes |
|
1007 | 0010: 6c 79 3a 63 68 61 6e 67 65 67 72 6f 75 70 00 00 |ly:changegroup..| | |
863 | added 0 changesets with 0 changes to 3 files |
|
1008 | 0020: 00 00 00 02 0b 01 06 01 69 6e 2d 72 65 70 6c 79 |........in-reply| | |
864 | \x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc) |
|
1009 | 0030: 2d 74 6f 31 72 65 74 75 72 6e 31 00 00 00 00 00 |-to1return1.....| | |
|
1010 | 0040: 00 00 1b 06 6f 75 74 70 75 74 00 00 00 01 00 01 |....output......| | |||
|
1011 | 0050: 0b 01 69 6e 2d 72 65 70 6c 79 2d 74 6f 31 00 00 |..in-reply-to1..| | |||
|
1012 | 0060: 00 64 61 64 64 69 6e 67 20 63 68 61 6e 67 65 73 |.dadding changes| | |||
|
1013 | 0070: 65 74 73 0a 61 64 64 69 6e 67 20 6d 61 6e 69 66 |ets.adding manif| | |||
|
1014 | 0080: 65 73 74 73 0a 61 64 64 69 6e 67 20 66 69 6c 65 |ests.adding file| | |||
|
1015 | 0090: 20 63 68 61 6e 67 65 73 0a 61 64 64 65 64 20 30 | changes.added 0| | |||
|
1016 | 00a0: 20 63 68 61 6e 67 65 73 65 74 73 20 77 69 74 68 | changesets with| | |||
|
1017 | 00b0: 20 30 20 63 68 61 6e 67 65 73 20 74 6f 20 33 20 | 0 changes to 3 | | |||
|
1018 | 00c0: 66 69 6c 65 73 0a 00 00 00 00 00 00 00 00 |files.........| | |||
865 |
|
1019 | |||
866 | Check handling of exception during generation. |
|
1020 | Check handling of exception during generation. | |
867 | ---------------------------------------------- |
|
1021 | ---------------------------------------------- | |
868 |
|
1022 | |||
869 | $ hg bundle2 --genraise > ../genfailed.hg2 |
|
1023 | $ hg bundle2 --genraise > ../genfailed.hg2 | |
870 | abort: Someone set up us the bomb! |
|
1024 | abort: Someone set up us the bomb! | |
871 | [255] |
|
1025 | [255] | |
872 |
|
1026 | |||
873 | Should still be a valid bundle |
|
1027 | Should still be a valid bundle | |
874 |
|
1028 | |||
875 |
$ |
|
1029 | $ f --hexdump ../genfailed.hg2 | |
876 | HG20\x00\x00\x00\x00\x00\x00\x00\r (no-eol) (esc) |
|
1030 | ../genfailed.hg2: | |
877 | \x06output\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00H\x0berror:abort\x00\x00\x00\x00\x01\x00\x07-messageunexpected error: Someone set up us the bomb!\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc) |
|
1031 | 0000: 48 47 32 30 00 00 00 00 00 00 00 0d 06 6f 75 74 |HG20.........out| | |
|
1032 | 0010: 70 75 74 00 00 00 00 00 00 ff ff ff ff 00 00 00 |put.............| | |||
|
1033 | 0020: 48 0b 65 72 72 6f 72 3a 61 62 6f 72 74 00 00 00 |H.error:abort...| | |||
|
1034 | 0030: 00 01 00 07 2d 6d 65 73 73 61 67 65 75 6e 65 78 |....-messageunex| | |||
|
1035 | 0040: 70 65 63 74 65 64 20 65 72 72 6f 72 3a 20 53 6f |pected error: So| | |||
|
1036 | 0050: 6d 65 6f 6e 65 20 73 65 74 20 75 70 20 75 73 20 |meone set up us | | |||
|
1037 | 0060: 74 68 65 20 62 6f 6d 62 21 00 00 00 00 00 00 00 |the bomb!.......| | |||
|
1038 | 0070: 00 |.| | |||
878 |
|
1039 | |||
879 | And its handling on the other size raise a clean exception |
|
1040 | And its handling on the other size raise a clean exception | |
880 |
|
1041 | |||
881 | $ cat ../genfailed.hg2 | hg unbundle2 |
|
1042 | $ cat ../genfailed.hg2 | hg unbundle2 | |
882 | 0 unread bytes |
|
1043 | 0 unread bytes | |
883 | abort: unexpected error: Someone set up us the bomb! |
|
1044 | abort: unexpected error: Someone set up us the bomb! | |
884 | [255] |
|
1045 | [255] | |
885 |
|
1046 | |||
886 |
|
1047 | |||
887 | $ cd .. |
|
1048 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now