Show More
This diff has been collapsed as it changes many lines, (1676 lines changed) Show them Hide them | |||||
@@ -0,0 +1,1676 b'' | |||||
|
1 | $ cat > hgrc-sshv2 << EOF | |||
|
2 | > %include $HGRCPATH | |||
|
3 | > [experimental] | |||
|
4 | > sshpeer.advertise-v2 = true | |||
|
5 | > sshserver.support-v2 = true | |||
|
6 | > EOF | |||
|
7 | ||||
|
8 | $ debugwireproto() { | |||
|
9 | > commands=`cat -` | |||
|
10 | > echo 'testing ssh1' | |||
|
11 | > tip=`hg log -r tip -T '{node}'` | |||
|
12 | > echo "${commands}" | hg --verbose debugwireproto --localssh --noreadstderr | |||
|
13 | > if [ -n "$1" ]; then | |||
|
14 | > hg --config extensions.strip= strip --no-backup -r "all() - ::${tip}" | |||
|
15 | > fi | |||
|
16 | > echo "" | |||
|
17 | > echo 'testing ssh2' | |||
|
18 | > echo "${commands}" | HGRCPATH=$TESTTMP/hgrc-sshv2 hg --verbose debugwireproto --localssh --noreadstderr | |||
|
19 | > if [ -n "$1" ]; then | |||
|
20 | > hg --config extensions.strip= strip --no-backup -r "all() - ::${tip}" | |||
|
21 | > fi | |||
|
22 | > } | |||
|
23 | ||||
|
24 | Generate some bundle files | |||
|
25 | ||||
|
26 | $ hg init repo | |||
|
27 | $ cd repo | |||
|
28 | $ echo 0 > foo | |||
|
29 | $ hg -q commit -A -m initial | |||
|
30 | $ hg bundle --all -t none-v1 ../initial.v1.hg | |||
|
31 | 1 changesets found | |||
|
32 | $ cd .. | |||
|
33 | ||||
|
34 | Test pushing bundle1 payload to a server with bundle1 disabled | |||
|
35 | ||||
|
36 | $ hg init no-bundle1 | |||
|
37 | $ cd no-bundle1 | |||
|
38 | $ cat > .hg/hgrc << EOF | |||
|
39 | > [server] | |||
|
40 | > bundle1 = false | |||
|
41 | > EOF | |||
|
42 | ||||
|
43 | $ debugwireproto << EOF | |||
|
44 | > command unbundle | |||
|
45 | > # This is "force" in hex. | |||
|
46 | > heads 666f726365 | |||
|
47 | > PUSHFILE ../initial.v1.hg | |||
|
48 | > EOF | |||
|
49 | testing ssh1 | |||
|
50 | creating ssh peer from handshake results | |||
|
51 | i> write(104) -> None: | |||
|
52 | i> hello\n | |||
|
53 | i> between\n | |||
|
54 | i> pairs 81\n | |||
|
55 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
56 | i> flush() -> None | |||
|
57 | o> readline() -> 4: | |||
|
58 | o> 384\n | |||
|
59 | o> readline() -> 384: | |||
|
60 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
61 | o> readline() -> 2: | |||
|
62 | o> 1\n | |||
|
63 | o> readline() -> 1: | |||
|
64 | o> \n | |||
|
65 | sending unbundle command | |||
|
66 | i> write(9) -> None: | |||
|
67 | i> unbundle\n | |||
|
68 | i> write(9) -> None: | |||
|
69 | i> heads 10\n | |||
|
70 | i> write(10) -> None: 666f726365 | |||
|
71 | i> flush() -> None | |||
|
72 | o> readline() -> 2: | |||
|
73 | o> 0\n | |||
|
74 | i> write(4) -> None: | |||
|
75 | i> 426\n | |||
|
76 | i> write(426) -> None: | |||
|
77 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
78 | i> test\n | |||
|
79 | i> 0 0\n | |||
|
80 | i> foo\n | |||
|
81 | i> \n | |||
|
82 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
83 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
84 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
85 | i> write(2) -> None: | |||
|
86 | i> 0\n | |||
|
87 | i> flush() -> None | |||
|
88 | o> readline() -> 2: | |||
|
89 | o> 0\n | |||
|
90 | e> read(-1) -> 115: | |||
|
91 | e> abort: incompatible Mercurial client; bundle2 required\n | |||
|
92 | e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n | |||
|
93 | remote: abort: incompatible Mercurial client; bundle2 required | |||
|
94 | remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |||
|
95 | o> read(0) -> 0: | |||
|
96 | o> readline() -> 2: | |||
|
97 | o> 1\n | |||
|
98 | o> read(1) -> 1: 0 | |||
|
99 | result: 0 | |||
|
100 | remote output: | |||
|
101 | ||||
|
102 | testing ssh2 | |||
|
103 | creating ssh peer from handshake results | |||
|
104 | i> write(171) -> None: | |||
|
105 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
106 | i> hello\n | |||
|
107 | i> between\n | |||
|
108 | i> pairs 81\n | |||
|
109 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
110 | i> flush() -> None | |||
|
111 | o> readline() -> 62: | |||
|
112 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
113 | o> readline() -> 4: | |||
|
114 | o> 383\n | |||
|
115 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
116 | o> read(1) -> 1: | |||
|
117 | o> \n | |||
|
118 | sending unbundle command | |||
|
119 | i> write(9) -> None: | |||
|
120 | i> unbundle\n | |||
|
121 | i> write(9) -> None: | |||
|
122 | i> heads 10\n | |||
|
123 | i> write(10) -> None: 666f726365 | |||
|
124 | i> flush() -> None | |||
|
125 | o> readline() -> 2: | |||
|
126 | o> 0\n | |||
|
127 | i> write(4) -> None: | |||
|
128 | i> 426\n | |||
|
129 | i> write(426) -> None: | |||
|
130 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
131 | i> test\n | |||
|
132 | i> 0 0\n | |||
|
133 | i> foo\n | |||
|
134 | i> \n | |||
|
135 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
136 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
137 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
138 | i> write(2) -> None: | |||
|
139 | i> 0\n | |||
|
140 | i> flush() -> None | |||
|
141 | o> readline() -> 2: | |||
|
142 | o> 0\n | |||
|
143 | e> read(-1) -> 115: | |||
|
144 | e> abort: incompatible Mercurial client; bundle2 required\n | |||
|
145 | e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n | |||
|
146 | remote: abort: incompatible Mercurial client; bundle2 required | |||
|
147 | remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |||
|
148 | o> read(0) -> 0: | |||
|
149 | o> readline() -> 2: | |||
|
150 | o> 1\n | |||
|
151 | o> read(1) -> 1: 0 | |||
|
152 | result: 0 | |||
|
153 | remote output: | |||
|
154 | ||||
|
155 | $ cd .. | |||
|
156 | ||||
|
157 | Create a pretxnchangegroup hook that fails. Give it multiple modes of printing | |||
|
158 | output so we can test I/O capture and behavior. | |||
|
159 | ||||
|
160 | Test pushing to a server that has a pretxnchangegroup Python hook that fails | |||
|
161 | ||||
|
162 | $ cat > $TESTTMP/failhook << EOF | |||
|
163 | > from __future__ import print_function | |||
|
164 | > import sys | |||
|
165 | > def hook1line(ui, repo, **kwargs): | |||
|
166 | > ui.write('ui.write 1 line\n') | |||
|
167 | > return 1 | |||
|
168 | > def hook2lines(ui, repo, **kwargs): | |||
|
169 | > ui.write('ui.write 2 lines 1\n') | |||
|
170 | > ui.write('ui.write 2 lines 2\n') | |||
|
171 | > return 1 | |||
|
172 | > def hook1lineflush(ui, repo, **kwargs): | |||
|
173 | > ui.write('ui.write 1 line flush\n') | |||
|
174 | > ui.flush() | |||
|
175 | > return 1 | |||
|
176 | > def hookmultiflush(ui, repo, **kwargs): | |||
|
177 | > ui.write('ui.write 1st\n') | |||
|
178 | > ui.flush() | |||
|
179 | > ui.write('ui.write 2nd\n') | |||
|
180 | > ui.flush() | |||
|
181 | > return 1 | |||
|
182 | > def hookwriteandwriteerr(ui, repo, **kwargs): | |||
|
183 | > ui.write('ui.write 1\n') | |||
|
184 | > ui.write_err('ui.write_err 1\n') | |||
|
185 | > ui.write('ui.write 2\n') | |||
|
186 | > ui.write_err('ui.write_err 2\n') | |||
|
187 | > return 1 | |||
|
188 | > def hookprintstdout(ui, repo, **kwargs): | |||
|
189 | > print('printed line') | |||
|
190 | > return 1 | |||
|
191 | > def hookprintandwrite(ui, repo, **kwargs): | |||
|
192 | > print('print 1') | |||
|
193 | > ui.write('ui.write 1\n') | |||
|
194 | > print('print 2') | |||
|
195 | > ui.write('ui.write 2\n') | |||
|
196 | > return 1 | |||
|
197 | > def hookprintstderrandstdout(ui, repo, **kwargs): | |||
|
198 | > print('stdout 1') | |||
|
199 | > print('stderr 1', file=sys.stderr) | |||
|
200 | > print('stdout 2') | |||
|
201 | > print('stderr 2', file=sys.stderr) | |||
|
202 | > return 1 | |||
|
203 | > EOF | |||
|
204 | ||||
|
205 | $ hg init failrepo | |||
|
206 | $ cd failrepo | |||
|
207 | ||||
|
208 | ui.write() in hook is redirected to stderr | |||
|
209 | ||||
|
210 | $ cat > .hg/hgrc << EOF | |||
|
211 | > [hooks] | |||
|
212 | > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook1line | |||
|
213 | > EOF | |||
|
214 | ||||
|
215 | $ debugwireproto << EOF | |||
|
216 | > command unbundle | |||
|
217 | > # This is "force" in hex. | |||
|
218 | > heads 666f726365 | |||
|
219 | > PUSHFILE ../initial.v1.hg | |||
|
220 | > EOF | |||
|
221 | testing ssh1 | |||
|
222 | creating ssh peer from handshake results | |||
|
223 | i> write(104) -> None: | |||
|
224 | i> hello\n | |||
|
225 | i> between\n | |||
|
226 | i> pairs 81\n | |||
|
227 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
228 | i> flush() -> None | |||
|
229 | o> readline() -> 4: | |||
|
230 | o> 384\n | |||
|
231 | o> readline() -> 384: | |||
|
232 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
233 | o> readline() -> 2: | |||
|
234 | o> 1\n | |||
|
235 | o> readline() -> 1: | |||
|
236 | o> \n | |||
|
237 | sending unbundle command | |||
|
238 | i> write(9) -> None: | |||
|
239 | i> unbundle\n | |||
|
240 | i> write(9) -> None: | |||
|
241 | i> heads 10\n | |||
|
242 | i> write(10) -> None: 666f726365 | |||
|
243 | i> flush() -> None | |||
|
244 | o> readline() -> 2: | |||
|
245 | o> 0\n | |||
|
246 | i> write(4) -> None: | |||
|
247 | i> 426\n | |||
|
248 | i> write(426) -> None: | |||
|
249 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
250 | i> test\n | |||
|
251 | i> 0 0\n | |||
|
252 | i> foo\n | |||
|
253 | i> \n | |||
|
254 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
255 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
256 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
257 | i> write(2) -> None: | |||
|
258 | i> 0\n | |||
|
259 | i> flush() -> None | |||
|
260 | o> readline() -> 2: | |||
|
261 | o> 0\n | |||
|
262 | e> read(-1) -> 196: | |||
|
263 | e> adding changesets\n | |||
|
264 | e> adding manifests\n | |||
|
265 | e> adding file changes\n | |||
|
266 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
267 | e> ui.write 1 line\n | |||
|
268 | e> transaction abort!\n | |||
|
269 | e> rollback completed\n | |||
|
270 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
271 | remote: adding changesets | |||
|
272 | remote: adding manifests | |||
|
273 | remote: adding file changes | |||
|
274 | remote: added 1 changesets with 1 changes to 1 files | |||
|
275 | remote: ui.write 1 line | |||
|
276 | remote: transaction abort! | |||
|
277 | remote: rollback completed | |||
|
278 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
279 | o> read(0) -> 0: | |||
|
280 | o> readline() -> 2: | |||
|
281 | o> 1\n | |||
|
282 | o> read(1) -> 1: 0 | |||
|
283 | result: 0 | |||
|
284 | remote output: | |||
|
285 | ||||
|
286 | testing ssh2 | |||
|
287 | creating ssh peer from handshake results | |||
|
288 | i> write(171) -> None: | |||
|
289 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
290 | i> hello\n | |||
|
291 | i> between\n | |||
|
292 | i> pairs 81\n | |||
|
293 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
294 | i> flush() -> None | |||
|
295 | o> readline() -> 62: | |||
|
296 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
297 | o> readline() -> 4: | |||
|
298 | o> 383\n | |||
|
299 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
300 | o> read(1) -> 1: | |||
|
301 | o> \n | |||
|
302 | sending unbundle command | |||
|
303 | i> write(9) -> None: | |||
|
304 | i> unbundle\n | |||
|
305 | i> write(9) -> None: | |||
|
306 | i> heads 10\n | |||
|
307 | i> write(10) -> None: 666f726365 | |||
|
308 | i> flush() -> None | |||
|
309 | o> readline() -> 2: | |||
|
310 | o> 0\n | |||
|
311 | i> write(4) -> None: | |||
|
312 | i> 426\n | |||
|
313 | i> write(426) -> None: | |||
|
314 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
315 | i> test\n | |||
|
316 | i> 0 0\n | |||
|
317 | i> foo\n | |||
|
318 | i> \n | |||
|
319 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
320 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
321 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
322 | i> write(2) -> None: | |||
|
323 | i> 0\n | |||
|
324 | i> flush() -> None | |||
|
325 | o> readline() -> 2: | |||
|
326 | o> 0\n | |||
|
327 | e> read(-1) -> 196: | |||
|
328 | e> adding changesets\n | |||
|
329 | e> adding manifests\n | |||
|
330 | e> adding file changes\n | |||
|
331 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
332 | e> ui.write 1 line\n | |||
|
333 | e> transaction abort!\n | |||
|
334 | e> rollback completed\n | |||
|
335 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
336 | remote: adding changesets | |||
|
337 | remote: adding manifests | |||
|
338 | remote: adding file changes | |||
|
339 | remote: added 1 changesets with 1 changes to 1 files | |||
|
340 | remote: ui.write 1 line | |||
|
341 | remote: transaction abort! | |||
|
342 | remote: rollback completed | |||
|
343 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
344 | o> read(0) -> 0: | |||
|
345 | o> readline() -> 2: | |||
|
346 | o> 1\n | |||
|
347 | o> read(1) -> 1: 0 | |||
|
348 | result: 0 | |||
|
349 | remote output: | |||
|
350 | ||||
|
351 | And a variation that writes multiple lines using ui.write | |||
|
352 | ||||
|
353 | $ cat > .hg/hgrc << EOF | |||
|
354 | > [hooks] | |||
|
355 | > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook2lines | |||
|
356 | > EOF | |||
|
357 | ||||
|
358 | $ debugwireproto << EOF | |||
|
359 | > command unbundle | |||
|
360 | > # This is "force" in hex. | |||
|
361 | > heads 666f726365 | |||
|
362 | > PUSHFILE ../initial.v1.hg | |||
|
363 | > EOF | |||
|
364 | testing ssh1 | |||
|
365 | creating ssh peer from handshake results | |||
|
366 | i> write(104) -> None: | |||
|
367 | i> hello\n | |||
|
368 | i> between\n | |||
|
369 | i> pairs 81\n | |||
|
370 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
371 | i> flush() -> None | |||
|
372 | o> readline() -> 4: | |||
|
373 | o> 384\n | |||
|
374 | o> readline() -> 384: | |||
|
375 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
376 | o> readline() -> 2: | |||
|
377 | o> 1\n | |||
|
378 | o> readline() -> 1: | |||
|
379 | o> \n | |||
|
380 | sending unbundle command | |||
|
381 | i> write(9) -> None: | |||
|
382 | i> unbundle\n | |||
|
383 | i> write(9) -> None: | |||
|
384 | i> heads 10\n | |||
|
385 | i> write(10) -> None: 666f726365 | |||
|
386 | i> flush() -> None | |||
|
387 | o> readline() -> 2: | |||
|
388 | o> 0\n | |||
|
389 | i> write(4) -> None: | |||
|
390 | i> 426\n | |||
|
391 | i> write(426) -> None: | |||
|
392 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
393 | i> test\n | |||
|
394 | i> 0 0\n | |||
|
395 | i> foo\n | |||
|
396 | i> \n | |||
|
397 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
398 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
399 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
400 | i> write(2) -> None: | |||
|
401 | i> 0\n | |||
|
402 | i> flush() -> None | |||
|
403 | o> readline() -> 2: | |||
|
404 | o> 0\n | |||
|
405 | e> read(-1) -> 218: | |||
|
406 | e> adding changesets\n | |||
|
407 | e> adding manifests\n | |||
|
408 | e> adding file changes\n | |||
|
409 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
410 | e> ui.write 2 lines 1\n | |||
|
411 | e> ui.write 2 lines 2\n | |||
|
412 | e> transaction abort!\n | |||
|
413 | e> rollback completed\n | |||
|
414 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
415 | remote: adding changesets | |||
|
416 | remote: adding manifests | |||
|
417 | remote: adding file changes | |||
|
418 | remote: added 1 changesets with 1 changes to 1 files | |||
|
419 | remote: ui.write 2 lines 1 | |||
|
420 | remote: ui.write 2 lines 2 | |||
|
421 | remote: transaction abort! | |||
|
422 | remote: rollback completed | |||
|
423 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
424 | o> read(0) -> 0: | |||
|
425 | o> readline() -> 2: | |||
|
426 | o> 1\n | |||
|
427 | o> read(1) -> 1: 0 | |||
|
428 | result: 0 | |||
|
429 | remote output: | |||
|
430 | ||||
|
431 | testing ssh2 | |||
|
432 | creating ssh peer from handshake results | |||
|
433 | i> write(171) -> None: | |||
|
434 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
435 | i> hello\n | |||
|
436 | i> between\n | |||
|
437 | i> pairs 81\n | |||
|
438 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
439 | i> flush() -> None | |||
|
440 | o> readline() -> 62: | |||
|
441 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
442 | o> readline() -> 4: | |||
|
443 | o> 383\n | |||
|
444 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
445 | o> read(1) -> 1: | |||
|
446 | o> \n | |||
|
447 | sending unbundle command | |||
|
448 | i> write(9) -> None: | |||
|
449 | i> unbundle\n | |||
|
450 | i> write(9) -> None: | |||
|
451 | i> heads 10\n | |||
|
452 | i> write(10) -> None: 666f726365 | |||
|
453 | i> flush() -> None | |||
|
454 | o> readline() -> 2: | |||
|
455 | o> 0\n | |||
|
456 | i> write(4) -> None: | |||
|
457 | i> 426\n | |||
|
458 | i> write(426) -> None: | |||
|
459 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
460 | i> test\n | |||
|
461 | i> 0 0\n | |||
|
462 | i> foo\n | |||
|
463 | i> \n | |||
|
464 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
465 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
466 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
467 | i> write(2) -> None: | |||
|
468 | i> 0\n | |||
|
469 | i> flush() -> None | |||
|
470 | o> readline() -> 2: | |||
|
471 | o> 0\n | |||
|
472 | e> read(-1) -> 218: | |||
|
473 | e> adding changesets\n | |||
|
474 | e> adding manifests\n | |||
|
475 | e> adding file changes\n | |||
|
476 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
477 | e> ui.write 2 lines 1\n | |||
|
478 | e> ui.write 2 lines 2\n | |||
|
479 | e> transaction abort!\n | |||
|
480 | e> rollback completed\n | |||
|
481 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
482 | remote: adding changesets | |||
|
483 | remote: adding manifests | |||
|
484 | remote: adding file changes | |||
|
485 | remote: added 1 changesets with 1 changes to 1 files | |||
|
486 | remote: ui.write 2 lines 1 | |||
|
487 | remote: ui.write 2 lines 2 | |||
|
488 | remote: transaction abort! | |||
|
489 | remote: rollback completed | |||
|
490 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
491 | o> read(0) -> 0: | |||
|
492 | o> readline() -> 2: | |||
|
493 | o> 1\n | |||
|
494 | o> read(1) -> 1: 0 | |||
|
495 | result: 0 | |||
|
496 | remote output: | |||
|
497 | ||||
|
498 | And a variation that does a ui.flush() after writing output | |||
|
499 | ||||
|
500 | $ cat > .hg/hgrc << EOF | |||
|
501 | > [hooks] | |||
|
502 | > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook1lineflush | |||
|
503 | > EOF | |||
|
504 | ||||
|
505 | $ debugwireproto << EOF | |||
|
506 | > command unbundle | |||
|
507 | > # This is "force" in hex. | |||
|
508 | > heads 666f726365 | |||
|
509 | > PUSHFILE ../initial.v1.hg | |||
|
510 | > EOF | |||
|
511 | testing ssh1 | |||
|
512 | creating ssh peer from handshake results | |||
|
513 | i> write(104) -> None: | |||
|
514 | i> hello\n | |||
|
515 | i> between\n | |||
|
516 | i> pairs 81\n | |||
|
517 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
518 | i> flush() -> None | |||
|
519 | o> readline() -> 4: | |||
|
520 | o> 384\n | |||
|
521 | o> readline() -> 384: | |||
|
522 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
523 | o> readline() -> 2: | |||
|
524 | o> 1\n | |||
|
525 | o> readline() -> 1: | |||
|
526 | o> \n | |||
|
527 | sending unbundle command | |||
|
528 | i> write(9) -> None: | |||
|
529 | i> unbundle\n | |||
|
530 | i> write(9) -> None: | |||
|
531 | i> heads 10\n | |||
|
532 | i> write(10) -> None: 666f726365 | |||
|
533 | i> flush() -> None | |||
|
534 | o> readline() -> 2: | |||
|
535 | o> 0\n | |||
|
536 | i> write(4) -> None: | |||
|
537 | i> 426\n | |||
|
538 | i> write(426) -> None: | |||
|
539 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
540 | i> test\n | |||
|
541 | i> 0 0\n | |||
|
542 | i> foo\n | |||
|
543 | i> \n | |||
|
544 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
545 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
546 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
547 | i> write(2) -> None: | |||
|
548 | i> 0\n | |||
|
549 | i> flush() -> None | |||
|
550 | o> readline() -> 2: | |||
|
551 | o> 0\n | |||
|
552 | e> read(-1) -> 202: | |||
|
553 | e> adding changesets\n | |||
|
554 | e> adding manifests\n | |||
|
555 | e> adding file changes\n | |||
|
556 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
557 | e> ui.write 1 line flush\n | |||
|
558 | e> transaction abort!\n | |||
|
559 | e> rollback completed\n | |||
|
560 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
561 | remote: adding changesets | |||
|
562 | remote: adding manifests | |||
|
563 | remote: adding file changes | |||
|
564 | remote: added 1 changesets with 1 changes to 1 files | |||
|
565 | remote: ui.write 1 line flush | |||
|
566 | remote: transaction abort! | |||
|
567 | remote: rollback completed | |||
|
568 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
569 | o> read(0) -> 0: | |||
|
570 | o> readline() -> 2: | |||
|
571 | o> 1\n | |||
|
572 | o> read(1) -> 1: 0 | |||
|
573 | result: 0 | |||
|
574 | remote output: | |||
|
575 | ||||
|
576 | testing ssh2 | |||
|
577 | creating ssh peer from handshake results | |||
|
578 | i> write(171) -> None: | |||
|
579 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
580 | i> hello\n | |||
|
581 | i> between\n | |||
|
582 | i> pairs 81\n | |||
|
583 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
584 | i> flush() -> None | |||
|
585 | o> readline() -> 62: | |||
|
586 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
587 | o> readline() -> 4: | |||
|
588 | o> 383\n | |||
|
589 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
590 | o> read(1) -> 1: | |||
|
591 | o> \n | |||
|
592 | sending unbundle command | |||
|
593 | i> write(9) -> None: | |||
|
594 | i> unbundle\n | |||
|
595 | i> write(9) -> None: | |||
|
596 | i> heads 10\n | |||
|
597 | i> write(10) -> None: 666f726365 | |||
|
598 | i> flush() -> None | |||
|
599 | o> readline() -> 2: | |||
|
600 | o> 0\n | |||
|
601 | i> write(4) -> None: | |||
|
602 | i> 426\n | |||
|
603 | i> write(426) -> None: | |||
|
604 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
605 | i> test\n | |||
|
606 | i> 0 0\n | |||
|
607 | i> foo\n | |||
|
608 | i> \n | |||
|
609 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
610 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
611 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
612 | i> write(2) -> None: | |||
|
613 | i> 0\n | |||
|
614 | i> flush() -> None | |||
|
615 | o> readline() -> 2: | |||
|
616 | o> 0\n | |||
|
617 | e> read(-1) -> 202: | |||
|
618 | e> adding changesets\n | |||
|
619 | e> adding manifests\n | |||
|
620 | e> adding file changes\n | |||
|
621 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
622 | e> ui.write 1 line flush\n | |||
|
623 | e> transaction abort!\n | |||
|
624 | e> rollback completed\n | |||
|
625 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
626 | remote: adding changesets | |||
|
627 | remote: adding manifests | |||
|
628 | remote: adding file changes | |||
|
629 | remote: added 1 changesets with 1 changes to 1 files | |||
|
630 | remote: ui.write 1 line flush | |||
|
631 | remote: transaction abort! | |||
|
632 | remote: rollback completed | |||
|
633 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
634 | o> read(0) -> 0: | |||
|
635 | o> readline() -> 2: | |||
|
636 | o> 1\n | |||
|
637 | o> read(1) -> 1: 0 | |||
|
638 | result: 0 | |||
|
639 | remote output: | |||
|
640 | ||||
|
641 | Multiple writes + flush | |||
|
642 | ||||
|
643 | $ cat > .hg/hgrc << EOF | |||
|
644 | > [hooks] | |||
|
645 | > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookmultiflush | |||
|
646 | > EOF | |||
|
647 | ||||
|
648 | $ debugwireproto << EOF | |||
|
649 | > command unbundle | |||
|
650 | > # This is "force" in hex. | |||
|
651 | > heads 666f726365 | |||
|
652 | > PUSHFILE ../initial.v1.hg | |||
|
653 | > EOF | |||
|
654 | testing ssh1 | |||
|
655 | creating ssh peer from handshake results | |||
|
656 | i> write(104) -> None: | |||
|
657 | i> hello\n | |||
|
658 | i> between\n | |||
|
659 | i> pairs 81\n | |||
|
660 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
661 | i> flush() -> None | |||
|
662 | o> readline() -> 4: | |||
|
663 | o> 384\n | |||
|
664 | o> readline() -> 384: | |||
|
665 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
666 | o> readline() -> 2: | |||
|
667 | o> 1\n | |||
|
668 | o> readline() -> 1: | |||
|
669 | o> \n | |||
|
670 | sending unbundle command | |||
|
671 | i> write(9) -> None: | |||
|
672 | i> unbundle\n | |||
|
673 | i> write(9) -> None: | |||
|
674 | i> heads 10\n | |||
|
675 | i> write(10) -> None: 666f726365 | |||
|
676 | i> flush() -> None | |||
|
677 | o> readline() -> 2: | |||
|
678 | o> 0\n | |||
|
679 | i> write(4) -> None: | |||
|
680 | i> 426\n | |||
|
681 | i> write(426) -> None: | |||
|
682 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
683 | i> test\n | |||
|
684 | i> 0 0\n | |||
|
685 | i> foo\n | |||
|
686 | i> \n | |||
|
687 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
688 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
689 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
690 | i> write(2) -> None: | |||
|
691 | i> 0\n | |||
|
692 | i> flush() -> None | |||
|
693 | o> readline() -> 2: | |||
|
694 | o> 0\n | |||
|
695 | e> read(-1) -> 206: | |||
|
696 | e> adding changesets\n | |||
|
697 | e> adding manifests\n | |||
|
698 | e> adding file changes\n | |||
|
699 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
700 | e> ui.write 1st\n | |||
|
701 | e> ui.write 2nd\n | |||
|
702 | e> transaction abort!\n | |||
|
703 | e> rollback completed\n | |||
|
704 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
705 | remote: adding changesets | |||
|
706 | remote: adding manifests | |||
|
707 | remote: adding file changes | |||
|
708 | remote: added 1 changesets with 1 changes to 1 files | |||
|
709 | remote: ui.write 1st | |||
|
710 | remote: ui.write 2nd | |||
|
711 | remote: transaction abort! | |||
|
712 | remote: rollback completed | |||
|
713 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
714 | o> read(0) -> 0: | |||
|
715 | o> readline() -> 2: | |||
|
716 | o> 1\n | |||
|
717 | o> read(1) -> 1: 0 | |||
|
718 | result: 0 | |||
|
719 | remote output: | |||
|
720 | ||||
|
721 | testing ssh2 | |||
|
722 | creating ssh peer from handshake results | |||
|
723 | i> write(171) -> None: | |||
|
724 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
725 | i> hello\n | |||
|
726 | i> between\n | |||
|
727 | i> pairs 81\n | |||
|
728 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
729 | i> flush() -> None | |||
|
730 | o> readline() -> 62: | |||
|
731 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
732 | o> readline() -> 4: | |||
|
733 | o> 383\n | |||
|
734 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
735 | o> read(1) -> 1: | |||
|
736 | o> \n | |||
|
737 | sending unbundle command | |||
|
738 | i> write(9) -> None: | |||
|
739 | i> unbundle\n | |||
|
740 | i> write(9) -> None: | |||
|
741 | i> heads 10\n | |||
|
742 | i> write(10) -> None: 666f726365 | |||
|
743 | i> flush() -> None | |||
|
744 | o> readline() -> 2: | |||
|
745 | o> 0\n | |||
|
746 | i> write(4) -> None: | |||
|
747 | i> 426\n | |||
|
748 | i> write(426) -> None: | |||
|
749 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
750 | i> test\n | |||
|
751 | i> 0 0\n | |||
|
752 | i> foo\n | |||
|
753 | i> \n | |||
|
754 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
755 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
756 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
757 | i> write(2) -> None: | |||
|
758 | i> 0\n | |||
|
759 | i> flush() -> None | |||
|
760 | o> readline() -> 2: | |||
|
761 | o> 0\n | |||
|
762 | e> read(-1) -> 206: | |||
|
763 | e> adding changesets\n | |||
|
764 | e> adding manifests\n | |||
|
765 | e> adding file changes\n | |||
|
766 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
767 | e> ui.write 1st\n | |||
|
768 | e> ui.write 2nd\n | |||
|
769 | e> transaction abort!\n | |||
|
770 | e> rollback completed\n | |||
|
771 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
772 | remote: adding changesets | |||
|
773 | remote: adding manifests | |||
|
774 | remote: adding file changes | |||
|
775 | remote: added 1 changesets with 1 changes to 1 files | |||
|
776 | remote: ui.write 1st | |||
|
777 | remote: ui.write 2nd | |||
|
778 | remote: transaction abort! | |||
|
779 | remote: rollback completed | |||
|
780 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
781 | o> read(0) -> 0: | |||
|
782 | o> readline() -> 2: | |||
|
783 | o> 1\n | |||
|
784 | o> read(1) -> 1: 0 | |||
|
785 | result: 0 | |||
|
786 | remote output: | |||
|
787 | ||||
|
788 | ui.write() + ui.write_err() output is captured | |||
|
789 | ||||
|
790 | $ cat > .hg/hgrc << EOF | |||
|
791 | > [hooks] | |||
|
792 | > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookwriteandwriteerr | |||
|
793 | > EOF | |||
|
794 | ||||
|
795 | $ debugwireproto << EOF | |||
|
796 | > command unbundle | |||
|
797 | > # This is "force" in hex. | |||
|
798 | > heads 666f726365 | |||
|
799 | > PUSHFILE ../initial.v1.hg | |||
|
800 | > EOF | |||
|
801 | testing ssh1 | |||
|
802 | creating ssh peer from handshake results | |||
|
803 | i> write(104) -> None: | |||
|
804 | i> hello\n | |||
|
805 | i> between\n | |||
|
806 | i> pairs 81\n | |||
|
807 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
808 | i> flush() -> None | |||
|
809 | o> readline() -> 4: | |||
|
810 | o> 384\n | |||
|
811 | o> readline() -> 384: | |||
|
812 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
813 | o> readline() -> 2: | |||
|
814 | o> 1\n | |||
|
815 | o> readline() -> 1: | |||
|
816 | o> \n | |||
|
817 | sending unbundle command | |||
|
818 | i> write(9) -> None: | |||
|
819 | i> unbundle\n | |||
|
820 | i> write(9) -> None: | |||
|
821 | i> heads 10\n | |||
|
822 | i> write(10) -> None: 666f726365 | |||
|
823 | i> flush() -> None | |||
|
824 | o> readline() -> 2: | |||
|
825 | o> 0\n | |||
|
826 | i> write(4) -> None: | |||
|
827 | i> 426\n | |||
|
828 | i> write(426) -> None: | |||
|
829 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
830 | i> test\n | |||
|
831 | i> 0 0\n | |||
|
832 | i> foo\n | |||
|
833 | i> \n | |||
|
834 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
835 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
836 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
837 | i> write(2) -> None: | |||
|
838 | i> 0\n | |||
|
839 | i> flush() -> None | |||
|
840 | o> readline() -> 2: | |||
|
841 | o> 0\n | |||
|
842 | e> read(-1) -> 232: | |||
|
843 | e> adding changesets\n | |||
|
844 | e> adding manifests\n | |||
|
845 | e> adding file changes\n | |||
|
846 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
847 | e> ui.write 1\n | |||
|
848 | e> ui.write_err 1\n | |||
|
849 | e> ui.write 2\n | |||
|
850 | e> ui.write_err 2\n | |||
|
851 | e> transaction abort!\n | |||
|
852 | e> rollback completed\n | |||
|
853 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
854 | remote: adding changesets | |||
|
855 | remote: adding manifests | |||
|
856 | remote: adding file changes | |||
|
857 | remote: added 1 changesets with 1 changes to 1 files | |||
|
858 | remote: ui.write 1 | |||
|
859 | remote: ui.write_err 1 | |||
|
860 | remote: ui.write 2 | |||
|
861 | remote: ui.write_err 2 | |||
|
862 | remote: transaction abort! | |||
|
863 | remote: rollback completed | |||
|
864 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
865 | o> read(0) -> 0: | |||
|
866 | o> readline() -> 2: | |||
|
867 | o> 1\n | |||
|
868 | o> read(1) -> 1: 0 | |||
|
869 | result: 0 | |||
|
870 | remote output: | |||
|
871 | ||||
|
872 | testing ssh2 | |||
|
873 | creating ssh peer from handshake results | |||
|
874 | i> write(171) -> None: | |||
|
875 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
876 | i> hello\n | |||
|
877 | i> between\n | |||
|
878 | i> pairs 81\n | |||
|
879 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
880 | i> flush() -> None | |||
|
881 | o> readline() -> 62: | |||
|
882 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
883 | o> readline() -> 4: | |||
|
884 | o> 383\n | |||
|
885 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
886 | o> read(1) -> 1: | |||
|
887 | o> \n | |||
|
888 | sending unbundle command | |||
|
889 | i> write(9) -> None: | |||
|
890 | i> unbundle\n | |||
|
891 | i> write(9) -> None: | |||
|
892 | i> heads 10\n | |||
|
893 | i> write(10) -> None: 666f726365 | |||
|
894 | i> flush() -> None | |||
|
895 | o> readline() -> 2: | |||
|
896 | o> 0\n | |||
|
897 | i> write(4) -> None: | |||
|
898 | i> 426\n | |||
|
899 | i> write(426) -> None: | |||
|
900 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
901 | i> test\n | |||
|
902 | i> 0 0\n | |||
|
903 | i> foo\n | |||
|
904 | i> \n | |||
|
905 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
906 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
907 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
908 | i> write(2) -> None: | |||
|
909 | i> 0\n | |||
|
910 | i> flush() -> None | |||
|
911 | o> readline() -> 2: | |||
|
912 | o> 0\n | |||
|
913 | e> read(-1) -> 232: | |||
|
914 | e> adding changesets\n | |||
|
915 | e> adding manifests\n | |||
|
916 | e> adding file changes\n | |||
|
917 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
918 | e> ui.write 1\n | |||
|
919 | e> ui.write_err 1\n | |||
|
920 | e> ui.write 2\n | |||
|
921 | e> ui.write_err 2\n | |||
|
922 | e> transaction abort!\n | |||
|
923 | e> rollback completed\n | |||
|
924 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
925 | remote: adding changesets | |||
|
926 | remote: adding manifests | |||
|
927 | remote: adding file changes | |||
|
928 | remote: added 1 changesets with 1 changes to 1 files | |||
|
929 | remote: ui.write 1 | |||
|
930 | remote: ui.write_err 1 | |||
|
931 | remote: ui.write 2 | |||
|
932 | remote: ui.write_err 2 | |||
|
933 | remote: transaction abort! | |||
|
934 | remote: rollback completed | |||
|
935 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
936 | o> read(0) -> 0: | |||
|
937 | o> readline() -> 2: | |||
|
938 | o> 1\n | |||
|
939 | o> read(1) -> 1: 0 | |||
|
940 | result: 0 | |||
|
941 | remote output: | |||
|
942 | ||||
|
943 | print() output is captured | |||
|
944 | ||||
|
945 | $ cat > .hg/hgrc << EOF | |||
|
946 | > [hooks] | |||
|
947 | > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintstdout | |||
|
948 | > EOF | |||
|
949 | ||||
|
950 | $ debugwireproto << EOF | |||
|
951 | > command unbundle | |||
|
952 | > # This is "force" in hex. | |||
|
953 | > heads 666f726365 | |||
|
954 | > PUSHFILE ../initial.v1.hg | |||
|
955 | > EOF | |||
|
956 | testing ssh1 | |||
|
957 | creating ssh peer from handshake results | |||
|
958 | i> write(104) -> None: | |||
|
959 | i> hello\n | |||
|
960 | i> between\n | |||
|
961 | i> pairs 81\n | |||
|
962 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
963 | i> flush() -> None | |||
|
964 | o> readline() -> 4: | |||
|
965 | o> 384\n | |||
|
966 | o> readline() -> 384: | |||
|
967 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
968 | o> readline() -> 2: | |||
|
969 | o> 1\n | |||
|
970 | o> readline() -> 1: | |||
|
971 | o> \n | |||
|
972 | sending unbundle command | |||
|
973 | i> write(9) -> None: | |||
|
974 | i> unbundle\n | |||
|
975 | i> write(9) -> None: | |||
|
976 | i> heads 10\n | |||
|
977 | i> write(10) -> None: 666f726365 | |||
|
978 | i> flush() -> None | |||
|
979 | o> readline() -> 2: | |||
|
980 | o> 0\n | |||
|
981 | i> write(4) -> None: | |||
|
982 | i> 426\n | |||
|
983 | i> write(426) -> None: | |||
|
984 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
985 | i> test\n | |||
|
986 | i> 0 0\n | |||
|
987 | i> foo\n | |||
|
988 | i> \n | |||
|
989 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
990 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
991 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
992 | i> write(2) -> None: | |||
|
993 | i> 0\n | |||
|
994 | i> flush() -> None | |||
|
995 | o> readline() -> 2: | |||
|
996 | o> 0\n | |||
|
997 | e> read(-1) -> 193: | |||
|
998 | e> adding changesets\n | |||
|
999 | e> adding manifests\n | |||
|
1000 | e> adding file changes\n | |||
|
1001 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
1002 | e> printed line\n | |||
|
1003 | e> transaction abort!\n | |||
|
1004 | e> rollback completed\n | |||
|
1005 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
1006 | remote: adding changesets | |||
|
1007 | remote: adding manifests | |||
|
1008 | remote: adding file changes | |||
|
1009 | remote: added 1 changesets with 1 changes to 1 files | |||
|
1010 | remote: printed line | |||
|
1011 | remote: transaction abort! | |||
|
1012 | remote: rollback completed | |||
|
1013 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
1014 | o> read(0) -> 0: | |||
|
1015 | o> readline() -> 2: | |||
|
1016 | o> 1\n | |||
|
1017 | o> read(1) -> 1: 0 | |||
|
1018 | result: 0 | |||
|
1019 | remote output: | |||
|
1020 | ||||
|
1021 | testing ssh2 | |||
|
1022 | creating ssh peer from handshake results | |||
|
1023 | i> write(171) -> None: | |||
|
1024 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
1025 | i> hello\n | |||
|
1026 | i> between\n | |||
|
1027 | i> pairs 81\n | |||
|
1028 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
1029 | i> flush() -> None | |||
|
1030 | o> readline() -> 62: | |||
|
1031 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
1032 | o> readline() -> 4: | |||
|
1033 | o> 383\n | |||
|
1034 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
1035 | o> read(1) -> 1: | |||
|
1036 | o> \n | |||
|
1037 | sending unbundle command | |||
|
1038 | i> write(9) -> None: | |||
|
1039 | i> unbundle\n | |||
|
1040 | i> write(9) -> None: | |||
|
1041 | i> heads 10\n | |||
|
1042 | i> write(10) -> None: 666f726365 | |||
|
1043 | i> flush() -> None | |||
|
1044 | o> readline() -> 2: | |||
|
1045 | o> 0\n | |||
|
1046 | i> write(4) -> None: | |||
|
1047 | i> 426\n | |||
|
1048 | i> write(426) -> None: | |||
|
1049 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
1050 | i> test\n | |||
|
1051 | i> 0 0\n | |||
|
1052 | i> foo\n | |||
|
1053 | i> \n | |||
|
1054 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
1055 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
1056 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
1057 | i> write(2) -> None: | |||
|
1058 | i> 0\n | |||
|
1059 | i> flush() -> None | |||
|
1060 | o> readline() -> 2: | |||
|
1061 | o> 0\n | |||
|
1062 | e> read(-1) -> 193: | |||
|
1063 | e> adding changesets\n | |||
|
1064 | e> adding manifests\n | |||
|
1065 | e> adding file changes\n | |||
|
1066 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
1067 | e> printed line\n | |||
|
1068 | e> transaction abort!\n | |||
|
1069 | e> rollback completed\n | |||
|
1070 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
1071 | remote: adding changesets | |||
|
1072 | remote: adding manifests | |||
|
1073 | remote: adding file changes | |||
|
1074 | remote: added 1 changesets with 1 changes to 1 files | |||
|
1075 | remote: printed line | |||
|
1076 | remote: transaction abort! | |||
|
1077 | remote: rollback completed | |||
|
1078 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
1079 | o> read(0) -> 0: | |||
|
1080 | o> readline() -> 2: | |||
|
1081 | o> 1\n | |||
|
1082 | o> read(1) -> 1: 0 | |||
|
1083 | result: 0 | |||
|
1084 | remote output: | |||
|
1085 | ||||
|
1086 | Mixed print() and ui.write() are both captured | |||
|
1087 | ||||
|
1088 | $ cat > .hg/hgrc << EOF | |||
|
1089 | > [hooks] | |||
|
1090 | > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintandwrite | |||
|
1091 | > EOF | |||
|
1092 | ||||
|
1093 | $ debugwireproto << EOF | |||
|
1094 | > command unbundle | |||
|
1095 | > # This is "force" in hex. | |||
|
1096 | > heads 666f726365 | |||
|
1097 | > PUSHFILE ../initial.v1.hg | |||
|
1098 | > EOF | |||
|
1099 | testing ssh1 | |||
|
1100 | creating ssh peer from handshake results | |||
|
1101 | i> write(104) -> None: | |||
|
1102 | i> hello\n | |||
|
1103 | i> between\n | |||
|
1104 | i> pairs 81\n | |||
|
1105 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
1106 | i> flush() -> None | |||
|
1107 | o> readline() -> 4: | |||
|
1108 | o> 384\n | |||
|
1109 | o> readline() -> 384: | |||
|
1110 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
1111 | o> readline() -> 2: | |||
|
1112 | o> 1\n | |||
|
1113 | o> readline() -> 1: | |||
|
1114 | o> \n | |||
|
1115 | sending unbundle command | |||
|
1116 | i> write(9) -> None: | |||
|
1117 | i> unbundle\n | |||
|
1118 | i> write(9) -> None: | |||
|
1119 | i> heads 10\n | |||
|
1120 | i> write(10) -> None: 666f726365 | |||
|
1121 | i> flush() -> None | |||
|
1122 | o> readline() -> 2: | |||
|
1123 | o> 0\n | |||
|
1124 | i> write(4) -> None: | |||
|
1125 | i> 426\n | |||
|
1126 | i> write(426) -> None: | |||
|
1127 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
1128 | i> test\n | |||
|
1129 | i> 0 0\n | |||
|
1130 | i> foo\n | |||
|
1131 | i> \n | |||
|
1132 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
1133 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
1134 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
1135 | i> write(2) -> None: | |||
|
1136 | i> 0\n | |||
|
1137 | i> flush() -> None | |||
|
1138 | o> readline() -> 2: | |||
|
1139 | o> 0\n | |||
|
1140 | e> read(-1) -> 218: | |||
|
1141 | e> adding changesets\n | |||
|
1142 | e> adding manifests\n | |||
|
1143 | e> adding file changes\n | |||
|
1144 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
1145 | e> ui.write 1\n | |||
|
1146 | e> ui.write 2\n | |||
|
1147 | e> print 1\n | |||
|
1148 | e> print 2\n | |||
|
1149 | e> transaction abort!\n | |||
|
1150 | e> rollback completed\n | |||
|
1151 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
1152 | remote: adding changesets | |||
|
1153 | remote: adding manifests | |||
|
1154 | remote: adding file changes | |||
|
1155 | remote: added 1 changesets with 1 changes to 1 files | |||
|
1156 | remote: ui.write 1 | |||
|
1157 | remote: ui.write 2 | |||
|
1158 | remote: print 1 | |||
|
1159 | remote: print 2 | |||
|
1160 | remote: transaction abort! | |||
|
1161 | remote: rollback completed | |||
|
1162 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
1163 | o> read(0) -> 0: | |||
|
1164 | o> readline() -> 2: | |||
|
1165 | o> 1\n | |||
|
1166 | o> read(1) -> 1: 0 | |||
|
1167 | result: 0 | |||
|
1168 | remote output: | |||
|
1169 | ||||
|
1170 | testing ssh2 | |||
|
1171 | creating ssh peer from handshake results | |||
|
1172 | i> write(171) -> None: | |||
|
1173 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
1174 | i> hello\n | |||
|
1175 | i> between\n | |||
|
1176 | i> pairs 81\n | |||
|
1177 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
1178 | i> flush() -> None | |||
|
1179 | o> readline() -> 62: | |||
|
1180 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
1181 | o> readline() -> 4: | |||
|
1182 | o> 383\n | |||
|
1183 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
1184 | o> read(1) -> 1: | |||
|
1185 | o> \n | |||
|
1186 | sending unbundle command | |||
|
1187 | i> write(9) -> None: | |||
|
1188 | i> unbundle\n | |||
|
1189 | i> write(9) -> None: | |||
|
1190 | i> heads 10\n | |||
|
1191 | i> write(10) -> None: 666f726365 | |||
|
1192 | i> flush() -> None | |||
|
1193 | o> readline() -> 2: | |||
|
1194 | o> 0\n | |||
|
1195 | i> write(4) -> None: | |||
|
1196 | i> 426\n | |||
|
1197 | i> write(426) -> None: | |||
|
1198 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
1199 | i> test\n | |||
|
1200 | i> 0 0\n | |||
|
1201 | i> foo\n | |||
|
1202 | i> \n | |||
|
1203 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
1204 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
1205 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
1206 | i> write(2) -> None: | |||
|
1207 | i> 0\n | |||
|
1208 | i> flush() -> None | |||
|
1209 | o> readline() -> 2: | |||
|
1210 | o> 0\n | |||
|
1211 | e> read(-1) -> 218: | |||
|
1212 | e> adding changesets\n | |||
|
1213 | e> adding manifests\n | |||
|
1214 | e> adding file changes\n | |||
|
1215 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
1216 | e> ui.write 1\n | |||
|
1217 | e> ui.write 2\n | |||
|
1218 | e> print 1\n | |||
|
1219 | e> print 2\n | |||
|
1220 | e> transaction abort!\n | |||
|
1221 | e> rollback completed\n | |||
|
1222 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
1223 | remote: adding changesets | |||
|
1224 | remote: adding manifests | |||
|
1225 | remote: adding file changes | |||
|
1226 | remote: added 1 changesets with 1 changes to 1 files | |||
|
1227 | remote: ui.write 1 | |||
|
1228 | remote: ui.write 2 | |||
|
1229 | remote: print 1 | |||
|
1230 | remote: print 2 | |||
|
1231 | remote: transaction abort! | |||
|
1232 | remote: rollback completed | |||
|
1233 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
1234 | o> read(0) -> 0: | |||
|
1235 | o> readline() -> 2: | |||
|
1236 | o> 1\n | |||
|
1237 | o> read(1) -> 1: 0 | |||
|
1238 | result: 0 | |||
|
1239 | remote output: | |||
|
1240 | ||||
|
1241 | print() to stdout and stderr both get captured | |||
|
1242 | ||||
|
1243 | $ cat > .hg/hgrc << EOF | |||
|
1244 | > [hooks] | |||
|
1245 | > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintstderrandstdout | |||
|
1246 | > EOF | |||
|
1247 | ||||
|
1248 | $ debugwireproto << EOF | |||
|
1249 | > command unbundle | |||
|
1250 | > # This is "force" in hex. | |||
|
1251 | > heads 666f726365 | |||
|
1252 | > PUSHFILE ../initial.v1.hg | |||
|
1253 | > EOF | |||
|
1254 | testing ssh1 | |||
|
1255 | creating ssh peer from handshake results | |||
|
1256 | i> write(104) -> None: | |||
|
1257 | i> hello\n | |||
|
1258 | i> between\n | |||
|
1259 | i> pairs 81\n | |||
|
1260 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
1261 | i> flush() -> None | |||
|
1262 | o> readline() -> 4: | |||
|
1263 | o> 384\n | |||
|
1264 | o> readline() -> 384: | |||
|
1265 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
1266 | o> readline() -> 2: | |||
|
1267 | o> 1\n | |||
|
1268 | o> readline() -> 1: | |||
|
1269 | o> \n | |||
|
1270 | sending unbundle command | |||
|
1271 | i> write(9) -> None: | |||
|
1272 | i> unbundle\n | |||
|
1273 | i> write(9) -> None: | |||
|
1274 | i> heads 10\n | |||
|
1275 | i> write(10) -> None: 666f726365 | |||
|
1276 | i> flush() -> None | |||
|
1277 | o> readline() -> 2: | |||
|
1278 | o> 0\n | |||
|
1279 | i> write(4) -> None: | |||
|
1280 | i> 426\n | |||
|
1281 | i> write(426) -> None: | |||
|
1282 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
1283 | i> test\n | |||
|
1284 | i> 0 0\n | |||
|
1285 | i> foo\n | |||
|
1286 | i> \n | |||
|
1287 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
1288 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
1289 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
1290 | i> write(2) -> None: | |||
|
1291 | i> 0\n | |||
|
1292 | i> flush() -> None | |||
|
1293 | o> readline() -> 2: | |||
|
1294 | o> 0\n | |||
|
1295 | e> read(-1) -> 216: | |||
|
1296 | e> adding changesets\n | |||
|
1297 | e> adding manifests\n | |||
|
1298 | e> adding file changes\n | |||
|
1299 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
1300 | e> stderr 1\n | |||
|
1301 | e> stderr 2\n | |||
|
1302 | e> stdout 1\n | |||
|
1303 | e> stdout 2\n | |||
|
1304 | e> transaction abort!\n | |||
|
1305 | e> rollback completed\n | |||
|
1306 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
1307 | remote: adding changesets | |||
|
1308 | remote: adding manifests | |||
|
1309 | remote: adding file changes | |||
|
1310 | remote: added 1 changesets with 1 changes to 1 files | |||
|
1311 | remote: stderr 1 | |||
|
1312 | remote: stderr 2 | |||
|
1313 | remote: stdout 1 | |||
|
1314 | remote: stdout 2 | |||
|
1315 | remote: transaction abort! | |||
|
1316 | remote: rollback completed | |||
|
1317 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
1318 | o> read(0) -> 0: | |||
|
1319 | o> readline() -> 2: | |||
|
1320 | o> 1\n | |||
|
1321 | o> read(1) -> 1: 0 | |||
|
1322 | result: 0 | |||
|
1323 | remote output: | |||
|
1324 | ||||
|
1325 | testing ssh2 | |||
|
1326 | creating ssh peer from handshake results | |||
|
1327 | i> write(171) -> None: | |||
|
1328 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
1329 | i> hello\n | |||
|
1330 | i> between\n | |||
|
1331 | i> pairs 81\n | |||
|
1332 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
1333 | i> flush() -> None | |||
|
1334 | o> readline() -> 62: | |||
|
1335 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
1336 | o> readline() -> 4: | |||
|
1337 | o> 383\n | |||
|
1338 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
1339 | o> read(1) -> 1: | |||
|
1340 | o> \n | |||
|
1341 | sending unbundle command | |||
|
1342 | i> write(9) -> None: | |||
|
1343 | i> unbundle\n | |||
|
1344 | i> write(9) -> None: | |||
|
1345 | i> heads 10\n | |||
|
1346 | i> write(10) -> None: 666f726365 | |||
|
1347 | i> flush() -> None | |||
|
1348 | o> readline() -> 2: | |||
|
1349 | o> 0\n | |||
|
1350 | i> write(4) -> None: | |||
|
1351 | i> 426\n | |||
|
1352 | i> write(426) -> None: | |||
|
1353 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
1354 | i> test\n | |||
|
1355 | i> 0 0\n | |||
|
1356 | i> foo\n | |||
|
1357 | i> \n | |||
|
1358 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
1359 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
1360 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
1361 | i> write(2) -> None: | |||
|
1362 | i> 0\n | |||
|
1363 | i> flush() -> None | |||
|
1364 | o> readline() -> 2: | |||
|
1365 | o> 0\n | |||
|
1366 | e> read(-1) -> 216: | |||
|
1367 | e> adding changesets\n | |||
|
1368 | e> adding manifests\n | |||
|
1369 | e> adding file changes\n | |||
|
1370 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
1371 | e> stderr 1\n | |||
|
1372 | e> stderr 2\n | |||
|
1373 | e> stdout 1\n | |||
|
1374 | e> stdout 2\n | |||
|
1375 | e> transaction abort!\n | |||
|
1376 | e> rollback completed\n | |||
|
1377 | e> abort: pretxnchangegroup.fail hook failed\n | |||
|
1378 | remote: adding changesets | |||
|
1379 | remote: adding manifests | |||
|
1380 | remote: adding file changes | |||
|
1381 | remote: added 1 changesets with 1 changes to 1 files | |||
|
1382 | remote: stderr 1 | |||
|
1383 | remote: stderr 2 | |||
|
1384 | remote: stdout 1 | |||
|
1385 | remote: stdout 2 | |||
|
1386 | remote: transaction abort! | |||
|
1387 | remote: rollback completed | |||
|
1388 | remote: abort: pretxnchangegroup.fail hook failed | |||
|
1389 | o> read(0) -> 0: | |||
|
1390 | o> readline() -> 2: | |||
|
1391 | o> 1\n | |||
|
1392 | o> read(1) -> 1: 0 | |||
|
1393 | result: 0 | |||
|
1394 | remote output: | |||
|
1395 | ||||
|
1396 | $ cd .. | |||
|
1397 | ||||
|
1398 | Pushing a bundle1 with no output | |||
|
1399 | ||||
|
1400 | $ hg init simplerepo | |||
|
1401 | $ cd simplerepo | |||
|
1402 | ||||
|
1403 | $ debugwireproto 1 << EOF | |||
|
1404 | > command unbundle | |||
|
1405 | > # This is "force" in hex. | |||
|
1406 | > heads 666f726365 | |||
|
1407 | > PUSHFILE ../initial.v1.hg | |||
|
1408 | > EOF | |||
|
1409 | testing ssh1 | |||
|
1410 | creating ssh peer from handshake results | |||
|
1411 | i> write(104) -> None: | |||
|
1412 | i> hello\n | |||
|
1413 | i> between\n | |||
|
1414 | i> pairs 81\n | |||
|
1415 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
1416 | i> flush() -> None | |||
|
1417 | o> readline() -> 4: | |||
|
1418 | o> 384\n | |||
|
1419 | o> readline() -> 384: | |||
|
1420 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
1421 | o> readline() -> 2: | |||
|
1422 | o> 1\n | |||
|
1423 | o> readline() -> 1: | |||
|
1424 | o> \n | |||
|
1425 | sending unbundle command | |||
|
1426 | i> write(9) -> None: | |||
|
1427 | i> unbundle\n | |||
|
1428 | i> write(9) -> None: | |||
|
1429 | i> heads 10\n | |||
|
1430 | i> write(10) -> None: 666f726365 | |||
|
1431 | i> flush() -> None | |||
|
1432 | o> readline() -> 2: | |||
|
1433 | o> 0\n | |||
|
1434 | i> write(4) -> None: | |||
|
1435 | i> 426\n | |||
|
1436 | i> write(426) -> None: | |||
|
1437 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
1438 | i> test\n | |||
|
1439 | i> 0 0\n | |||
|
1440 | i> foo\n | |||
|
1441 | i> \n | |||
|
1442 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
1443 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
1444 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
1445 | i> write(2) -> None: | |||
|
1446 | i> 0\n | |||
|
1447 | i> flush() -> None | |||
|
1448 | o> readline() -> 2: | |||
|
1449 | o> 0\n | |||
|
1450 | e> read(-1) -> 100: | |||
|
1451 | e> adding changesets\n | |||
|
1452 | e> adding manifests\n | |||
|
1453 | e> adding file changes\n | |||
|
1454 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
1455 | remote: adding changesets | |||
|
1456 | remote: adding manifests | |||
|
1457 | remote: adding file changes | |||
|
1458 | remote: added 1 changesets with 1 changes to 1 files | |||
|
1459 | o> read(0) -> 0: | |||
|
1460 | o> readline() -> 2: | |||
|
1461 | o> 1\n | |||
|
1462 | o> read(1) -> 1: 1 | |||
|
1463 | result: 1 | |||
|
1464 | remote output: | |||
|
1465 | ||||
|
1466 | testing ssh2 | |||
|
1467 | creating ssh peer from handshake results | |||
|
1468 | i> write(171) -> None: | |||
|
1469 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
1470 | i> hello\n | |||
|
1471 | i> between\n | |||
|
1472 | i> pairs 81\n | |||
|
1473 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
1474 | i> flush() -> None | |||
|
1475 | o> readline() -> 62: | |||
|
1476 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
1477 | o> readline() -> 4: | |||
|
1478 | o> 383\n | |||
|
1479 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
1480 | o> read(1) -> 1: | |||
|
1481 | o> \n | |||
|
1482 | sending unbundle command | |||
|
1483 | i> write(9) -> None: | |||
|
1484 | i> unbundle\n | |||
|
1485 | i> write(9) -> None: | |||
|
1486 | i> heads 10\n | |||
|
1487 | i> write(10) -> None: 666f726365 | |||
|
1488 | i> flush() -> None | |||
|
1489 | o> readline() -> 2: | |||
|
1490 | o> 0\n | |||
|
1491 | i> write(4) -> None: | |||
|
1492 | i> 426\n | |||
|
1493 | i> write(426) -> None: | |||
|
1494 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
1495 | i> test\n | |||
|
1496 | i> 0 0\n | |||
|
1497 | i> foo\n | |||
|
1498 | i> \n | |||
|
1499 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
1500 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
1501 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
1502 | i> write(2) -> None: | |||
|
1503 | i> 0\n | |||
|
1504 | i> flush() -> None | |||
|
1505 | o> readline() -> 2: | |||
|
1506 | o> 0\n | |||
|
1507 | e> read(-1) -> 100: | |||
|
1508 | e> adding changesets\n | |||
|
1509 | e> adding manifests\n | |||
|
1510 | e> adding file changes\n | |||
|
1511 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
1512 | remote: adding changesets | |||
|
1513 | remote: adding manifests | |||
|
1514 | remote: adding file changes | |||
|
1515 | remote: added 1 changesets with 1 changes to 1 files | |||
|
1516 | o> read(0) -> 0: | |||
|
1517 | o> readline() -> 2: | |||
|
1518 | o> 1\n | |||
|
1519 | o> read(1) -> 1: 1 | |||
|
1520 | result: 1 | |||
|
1521 | remote output: | |||
|
1522 | ||||
|
1523 | $ cd .. | |||
|
1524 | ||||
|
1525 | Pushing a bundle1 with ui.write() and ui.write_err() | |||
|
1526 | ||||
|
1527 | $ cat > $TESTTMP/hook << EOF | |||
|
1528 | > def hookuiwrite(ui, repo, **kwargs): | |||
|
1529 | > ui.write('ui.write 1\n') | |||
|
1530 | > ui.write_err('ui.write_err 1\n') | |||
|
1531 | > ui.write('ui.write 2\n') | |||
|
1532 | > ui.write_err('ui.write_err 2\n') | |||
|
1533 | > EOF | |||
|
1534 | ||||
|
1535 | $ hg init uiwriterepo | |||
|
1536 | $ cd uiwriterepo | |||
|
1537 | $ cat > .hg/hgrc << EOF | |||
|
1538 | > [hooks] | |||
|
1539 | > pretxnchangegroup.hook = python:$TESTTMP/hook:hookuiwrite | |||
|
1540 | > EOF | |||
|
1541 | ||||
|
1542 | $ debugwireproto 1 << EOF | |||
|
1543 | > command unbundle | |||
|
1544 | > # This is "force" in hex. | |||
|
1545 | > heads 666f726365 | |||
|
1546 | > PUSHFILE ../initial.v1.hg | |||
|
1547 | > EOF | |||
|
1548 | testing ssh1 | |||
|
1549 | creating ssh peer from handshake results | |||
|
1550 | i> write(104) -> None: | |||
|
1551 | i> hello\n | |||
|
1552 | i> between\n | |||
|
1553 | i> pairs 81\n | |||
|
1554 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
1555 | i> flush() -> None | |||
|
1556 | o> readline() -> 4: | |||
|
1557 | o> 384\n | |||
|
1558 | o> readline() -> 384: | |||
|
1559 | o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n | |||
|
1560 | o> readline() -> 2: | |||
|
1561 | o> 1\n | |||
|
1562 | o> readline() -> 1: | |||
|
1563 | o> \n | |||
|
1564 | sending unbundle command | |||
|
1565 | i> write(9) -> None: | |||
|
1566 | i> unbundle\n | |||
|
1567 | i> write(9) -> None: | |||
|
1568 | i> heads 10\n | |||
|
1569 | i> write(10) -> None: 666f726365 | |||
|
1570 | i> flush() -> None | |||
|
1571 | o> readline() -> 2: | |||
|
1572 | o> 0\n | |||
|
1573 | i> write(4) -> None: | |||
|
1574 | i> 426\n | |||
|
1575 | i> write(426) -> None: | |||
|
1576 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
1577 | i> test\n | |||
|
1578 | i> 0 0\n | |||
|
1579 | i> foo\n | |||
|
1580 | i> \n | |||
|
1581 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
1582 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
1583 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
1584 | i> write(2) -> None: | |||
|
1585 | i> 0\n | |||
|
1586 | i> flush() -> None | |||
|
1587 | o> readline() -> 2: | |||
|
1588 | o> 0\n | |||
|
1589 | e> read(-1) -> 152: | |||
|
1590 | e> adding changesets\n | |||
|
1591 | e> adding manifests\n | |||
|
1592 | e> adding file changes\n | |||
|
1593 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
1594 | e> ui.write 1\n | |||
|
1595 | e> ui.write_err 1\n | |||
|
1596 | e> ui.write 2\n | |||
|
1597 | e> ui.write_err 2\n | |||
|
1598 | remote: adding changesets | |||
|
1599 | remote: adding manifests | |||
|
1600 | remote: adding file changes | |||
|
1601 | remote: added 1 changesets with 1 changes to 1 files | |||
|
1602 | remote: ui.write 1 | |||
|
1603 | remote: ui.write_err 1 | |||
|
1604 | remote: ui.write 2 | |||
|
1605 | remote: ui.write_err 2 | |||
|
1606 | o> read(0) -> 0: | |||
|
1607 | o> readline() -> 2: | |||
|
1608 | o> 1\n | |||
|
1609 | o> read(1) -> 1: 1 | |||
|
1610 | result: 1 | |||
|
1611 | remote output: | |||
|
1612 | ||||
|
1613 | testing ssh2 | |||
|
1614 | creating ssh peer from handshake results | |||
|
1615 | i> write(171) -> None: | |||
|
1616 | i> upgrade * proto=exp-ssh-v2-0001\n (glob) | |||
|
1617 | i> hello\n | |||
|
1618 | i> between\n | |||
|
1619 | i> pairs 81\n | |||
|
1620 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 | |||
|
1621 | i> flush() -> None | |||
|
1622 | o> readline() -> 62: | |||
|
1623 | o> upgraded * exp-ssh-v2-0001\n (glob) | |||
|
1624 | o> readline() -> 4: | |||
|
1625 | o> 383\n | |||
|
1626 | o> read(383) -> 383: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN | |||
|
1627 | o> read(1) -> 1: | |||
|
1628 | o> \n | |||
|
1629 | sending unbundle command | |||
|
1630 | i> write(9) -> None: | |||
|
1631 | i> unbundle\n | |||
|
1632 | i> write(9) -> None: | |||
|
1633 | i> heads 10\n | |||
|
1634 | i> write(10) -> None: 666f726365 | |||
|
1635 | i> flush() -> None | |||
|
1636 | o> readline() -> 2: | |||
|
1637 | o> 0\n | |||
|
1638 | i> write(4) -> None: | |||
|
1639 | i> 426\n | |||
|
1640 | i> write(426) -> None: | |||
|
1641 | i> HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n | |||
|
1642 | i> test\n | |||
|
1643 | i> 0 0\n | |||
|
1644 | i> foo\n | |||
|
1645 | i> \n | |||
|
1646 | i> initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n | |||
|
1647 | i> \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n | |||
|
1648 | i> \x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
1649 | i> write(2) -> None: | |||
|
1650 | i> 0\n | |||
|
1651 | i> flush() -> None | |||
|
1652 | o> readline() -> 2: | |||
|
1653 | o> 0\n | |||
|
1654 | e> read(-1) -> 152: | |||
|
1655 | e> adding changesets\n | |||
|
1656 | e> adding manifests\n | |||
|
1657 | e> adding file changes\n | |||
|
1658 | e> added 1 changesets with 1 changes to 1 files\n | |||
|
1659 | e> ui.write 1\n | |||
|
1660 | e> ui.write_err 1\n | |||
|
1661 | e> ui.write 2\n | |||
|
1662 | e> ui.write_err 2\n | |||
|
1663 | remote: adding changesets | |||
|
1664 | remote: adding manifests | |||
|
1665 | remote: adding file changes | |||
|
1666 | remote: added 1 changesets with 1 changes to 1 files | |||
|
1667 | remote: ui.write 1 | |||
|
1668 | remote: ui.write_err 1 | |||
|
1669 | remote: ui.write 2 | |||
|
1670 | remote: ui.write_err 2 | |||
|
1671 | o> read(0) -> 0: | |||
|
1672 | o> readline() -> 2: | |||
|
1673 | o> 1\n | |||
|
1674 | o> read(1) -> 1: 1 | |||
|
1675 | result: 1 | |||
|
1676 | remote output: |
@@ -2568,6 +2568,7 b' def _parsewirelangblocks(fh):' | |||||
2568 | [ |
|
2568 | [ | |
2569 | ('', 'localssh', False, _('start an SSH server for this repo')), |
|
2569 | ('', 'localssh', False, _('start an SSH server for this repo')), | |
2570 | ('', 'peer', '', _('construct a specific version of the peer')), |
|
2570 | ('', 'peer', '', _('construct a specific version of the peer')), | |
|
2571 | ('', 'noreadstderr', False, _('do not read from stderr of the remote')), | |||
2571 | ] + cmdutil.remoteopts, |
|
2572 | ] + cmdutil.remoteopts, | |
2572 | _('[REPO]'), |
|
2573 | _('[REPO]'), | |
2573 | optionalrepo=True) |
|
2574 | optionalrepo=True) | |
@@ -2586,6 +2587,10 b' def debugwireproto(ui, repo, **opts):' | |||||
2586 | ``ssh1``, and ``ssh2``. ``raw`` instances only allow sending raw data |
|
2587 | ``ssh1``, and ``ssh2``. ``raw`` instances only allow sending raw data | |
2587 | payloads and don't support higher-level command actions. |
|
2588 | payloads and don't support higher-level command actions. | |
2588 |
|
2589 | |||
|
2590 | ``--noreadstderr`` can be used to disable automatic reading from stderr | |||
|
2591 | of the peer (for SSH connections only). Disabling automatic reading of | |||
|
2592 | stderr is useful for making output more deterministic. | |||
|
2593 | ||||
2589 | Commands are issued via a mini language which is specified via stdin. |
|
2594 | Commands are issued via a mini language which is specified via stdin. | |
2590 | The language consists of individual actions to perform. An action is |
|
2595 | The language consists of individual actions to perform. An action is | |
2591 | defined by a block. A block is defined as a line with no leading |
|
2596 | defined by a block. A block is defined as a line with no leading | |
@@ -2629,6 +2634,16 b' def debugwireproto(ui, repo, **opts):' | |||||
2629 | Values are interpreted as Python b'' literals. This allows encoding |
|
2634 | Values are interpreted as Python b'' literals. This allows encoding | |
2630 | special byte sequences via backslash escaping. |
|
2635 | special byte sequences via backslash escaping. | |
2631 |
|
2636 | |||
|
2637 | The following arguments have special meaning: | |||
|
2638 | ||||
|
2639 | ``PUSHFILE`` | |||
|
2640 | When defined, the *push* mechanism of the peer will be used instead | |||
|
2641 | of the static request-response mechanism and the content of the | |||
|
2642 | file specified in the value of this argument will be sent as the | |||
|
2643 | command payload. | |||
|
2644 | ||||
|
2645 | This can be used to submit a local bundle file to the remote. | |||
|
2646 | ||||
2632 | batchbegin |
|
2647 | batchbegin | |
2633 | ---------- |
|
2648 | ---------- | |
2634 |
|
2649 | |||
@@ -2712,21 +2727,23 b' def debugwireproto(ui, repo, **opts):' | |||||
2712 | # --localssh also implies the peer connection settings. |
|
2727 | # --localssh also implies the peer connection settings. | |
2713 |
|
2728 | |||
2714 | url = 'ssh://localserver' |
|
2729 | url = 'ssh://localserver' | |
|
2730 | autoreadstderr = not opts['noreadstderr'] | |||
2715 |
|
2731 | |||
2716 | if opts['peer'] == 'ssh1': |
|
2732 | if opts['peer'] == 'ssh1': | |
2717 | ui.write(_('creating ssh peer for wire protocol version 1\n')) |
|
2733 | ui.write(_('creating ssh peer for wire protocol version 1\n')) | |
2718 | peer = sshpeer.sshv1peer(ui, url, proc, stdin, stdout, stderr, |
|
2734 | peer = sshpeer.sshv1peer(ui, url, proc, stdin, stdout, stderr, | |
2719 | None) |
|
2735 | None, autoreadstderr=autoreadstderr) | |
2720 | elif opts['peer'] == 'ssh2': |
|
2736 | elif opts['peer'] == 'ssh2': | |
2721 | ui.write(_('creating ssh peer for wire protocol version 2\n')) |
|
2737 | ui.write(_('creating ssh peer for wire protocol version 2\n')) | |
2722 | peer = sshpeer.sshv2peer(ui, url, proc, stdin, stdout, stderr, |
|
2738 | peer = sshpeer.sshv2peer(ui, url, proc, stdin, stdout, stderr, | |
2723 | None) |
|
2739 | None, autoreadstderr=autoreadstderr) | |
2724 | elif opts['peer'] == 'raw': |
|
2740 | elif opts['peer'] == 'raw': | |
2725 | ui.write(_('using raw connection to peer\n')) |
|
2741 | ui.write(_('using raw connection to peer\n')) | |
2726 | peer = None |
|
2742 | peer = None | |
2727 | else: |
|
2743 | else: | |
2728 | ui.write(_('creating ssh peer from handshake results\n')) |
|
2744 | ui.write(_('creating ssh peer from handshake results\n')) | |
2729 |
peer = sshpeer.makepeer(ui, url, proc, stdin, stdout, stderr |
|
2745 | peer = sshpeer.makepeer(ui, url, proc, stdin, stdout, stderr, | |
|
2746 | autoreadstderr=autoreadstderr) | |||
2730 |
|
2747 | |||
2731 | else: |
|
2748 | else: | |
2732 | raise error.Abort(_('only --localssh is currently supported')) |
|
2749 | raise error.Abort(_('only --localssh is currently supported')) | |
@@ -2769,8 +2786,17 b' def debugwireproto(ui, repo, **opts):' | |||||
2769 | continue |
|
2786 | continue | |
2770 |
|
2787 | |||
2771 | ui.status(_('sending %s command\n') % command) |
|
2788 | ui.status(_('sending %s command\n') % command) | |
2772 | res = peer._call(command, **args) |
|
2789 | ||
2773 | ui.status(_('response: %s\n') % util.escapedata(res)) |
|
2790 | if 'PUSHFILE' in args: | |
|
2791 | with open(args['PUSHFILE'], r'rb') as fh: | |||
|
2792 | del args['PUSHFILE'] | |||
|
2793 | res, output = peer._callpush(command, fh, **args) | |||
|
2794 | ui.status(_('result: %s\n') % util.escapedata(res)) | |||
|
2795 | ui.status(_('remote output: %s\n') % | |||
|
2796 | util.escapedata(output)) | |||
|
2797 | else: | |||
|
2798 | res = peer._call(command, **args) | |||
|
2799 | ui.status(_('response: %s\n') % util.escapedata(res)) | |||
2774 |
|
2800 | |||
2775 | elif action == 'batchbegin': |
|
2801 | elif action == 'batchbegin': | |
2776 | if batchedcommands is not None: |
|
2802 | if batchedcommands is not None: |
@@ -303,7 +303,7 b' Show all commands + options' | |||||
303 | debugupgraderepo: optimize, run |
|
303 | debugupgraderepo: optimize, run | |
304 | debugwalk: include, exclude |
|
304 | debugwalk: include, exclude | |
305 | debugwireargs: three, four, five, ssh, remotecmd, insecure |
|
305 | debugwireargs: three, four, five, ssh, remotecmd, insecure | |
306 | debugwireproto: localssh, peer, ssh, remotecmd, insecure |
|
306 | debugwireproto: localssh, peer, noreadstderr, ssh, remotecmd, insecure | |
307 | files: rev, print0, include, exclude, template, subrepos |
|
307 | files: rev, print0, include, exclude, template, subrepos | |
308 | graft: rev, continue, edit, log, force, currentdate, currentuser, date, user, tool, dry-run |
|
308 | graft: rev, continue, edit, log, force, currentdate, currentuser, date, user, tool, dry-run | |
309 | grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, template, include, exclude |
|
309 | grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, template, include, exclude |
General Comments 0
You need to be logged in to leave comments.
Login now