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