##// END OF EJS Templates
stream-requirements: smoother matching in test-ssh-proto-unbundle.t...
marmoute -
r49492:77f8f8ca default
parent child Browse files
Show More
@@ -1,1171 +1,1171 b''
1 persistent-nodemap is not enabled by default. It is not relevant for this test so disable it.
1 persistent-nodemap is not enabled by default. It is not relevant for this test so disable it.
2
2
3 $ cat << EOF >> $HGRCPATH
3 $ cat << EOF >> $HGRCPATH
4 > [format]
4 > [format]
5 > use-persistent-nodemap = no
5 > use-persistent-nodemap = no
6 > EOF
6 > EOF
7
7
8 $ debugwireproto() {
8 $ debugwireproto() {
9 > commands=`cat -`
9 > commands=`cat -`
10 > echo 'testing ssh1'
10 > echo 'testing ssh1'
11 > tip=`hg log -r tip -T '{node}'`
11 > tip=`hg log -r tip -T '{node}'`
12 > echo "${commands}" | hg --verbose debugwireproto --localssh --noreadstderr
12 > echo "${commands}" | hg --verbose debugwireproto --localssh --noreadstderr
13 > if [ -n "$1" ]; then
13 > if [ -n "$1" ]; then
14 > hg --config extensions.strip= strip --no-backup -r "all() - ::${tip}"
14 > hg --config extensions.strip= strip --no-backup -r "all() - ::${tip}"
15 > fi
15 > fi
16 > }
16 > }
17
17
18 Generate some bundle files
18 Generate some bundle files
19
19
20 $ hg init repo
20 $ hg init repo
21 $ cd repo
21 $ cd repo
22 $ echo 0 > foo
22 $ echo 0 > foo
23 $ hg -q commit -A -m initial
23 $ hg -q commit -A -m initial
24 $ hg bundle --all -t none-v1 ../initial.v1.hg
24 $ hg bundle --all -t none-v1 ../initial.v1.hg
25 1 changesets found
25 1 changesets found
26 $ cd ..
26 $ cd ..
27
27
28 Test pushing bundle1 payload to a server with bundle1 disabled
28 Test pushing bundle1 payload to a server with bundle1 disabled
29
29
30 $ hg init no-bundle1
30 $ hg init no-bundle1
31 $ cd no-bundle1
31 $ cd no-bundle1
32 $ cat > .hg/hgrc << EOF
32 $ cat > .hg/hgrc << EOF
33 > [server]
33 > [server]
34 > bundle1 = false
34 > bundle1 = false
35 > EOF
35 > EOF
36
36
37 $ debugwireproto << EOF
37 $ debugwireproto << EOF
38 > command unbundle
38 > command unbundle
39 > # This is "force" in hex.
39 > # This is "force" in hex.
40 > heads 666f726365
40 > heads 666f726365
41 > PUSHFILE ../initial.v1.hg
41 > PUSHFILE ../initial.v1.hg
42 > readavailable
42 > readavailable
43 > EOF
43 > EOF
44 testing ssh1
44 testing ssh1
45 creating ssh peer from handshake results
45 creating ssh peer from handshake results
46 i> write(104) -> 104:
46 i> write(104) -> 104:
47 i> hello\n
47 i> hello\n
48 i> between\n
48 i> between\n
49 i> pairs 81\n
49 i> pairs 81\n
50 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
50 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
51 i> flush() -> None
51 i> flush() -> None
52 o> readline() -> 4:
52 o> readline() -> 4:
53 o> 444\n
53 o> \d+\\n (re)
54 o> readline() -> 444:
54 o> readline\(\) -> \d+: (re)
55 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
55 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
56 o> readline() -> 2:
56 o> readline() -> 2:
57 o> 1\n
57 o> 1\n
58 o> readline() -> 1:
58 o> readline() -> 1:
59 o> \n
59 o> \n
60 sending unbundle command
60 sending unbundle command
61 i> write(9) -> 9:
61 i> write(9) -> 9:
62 i> unbundle\n
62 i> unbundle\n
63 i> write(9) -> 9:
63 i> write(9) -> 9:
64 i> heads 10\n
64 i> heads 10\n
65 i> write(10) -> 10: 666f726365
65 i> write(10) -> 10: 666f726365
66 i> flush() -> None
66 i> flush() -> None
67 o> readline() -> 2:
67 o> readline() -> 2:
68 o> 0\n
68 o> 0\n
69 i> write(4) -> 4:
69 i> write(4) -> 4:
70 i> 426\n
70 i> 426\n
71 i> write(426) -> 426:
71 i> write(426) -> 426:
72 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
72 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
73 i> test\n
73 i> test\n
74 i> 0 0\n
74 i> 0 0\n
75 i> foo\n
75 i> foo\n
76 i> \n
76 i> \n
77 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
77 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
78 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
78 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
79 i> \x00\x00\x00\x00\x00\x00\x00\x00
79 i> \x00\x00\x00\x00\x00\x00\x00\x00
80 i> write(2) -> 2:
80 i> write(2) -> 2:
81 i> 0\n
81 i> 0\n
82 i> flush() -> None
82 i> flush() -> None
83 o> readline() -> 2:
83 o> readline() -> 2:
84 o> 0\n
84 o> 0\n
85 o> readline() -> 2:
85 o> readline() -> 2:
86 o> 1\n
86 o> 1\n
87 o> read(1) -> 1: 0
87 o> read(1) -> 1: 0
88 result: 0
88 result: 0
89 remote output:
89 remote output:
90 e> read(-1) -> 115:
90 e> read(-1) -> 115:
91 e> abort: incompatible Mercurial client; bundle2 required\n
91 e> abort: incompatible Mercurial client; bundle2 required\n
92 e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n
92 e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n
93
93
94 $ cd ..
94 $ cd ..
95
95
96 Create a pretxnchangegroup hook that fails. Give it multiple modes of printing
96 Create a pretxnchangegroup hook that fails. Give it multiple modes of printing
97 output so we can test I/O capture and behavior.
97 output so we can test I/O capture and behavior.
98
98
99 Test pushing to a server that has a pretxnchangegroup Python hook that fails
99 Test pushing to a server that has a pretxnchangegroup Python hook that fails
100
100
101 $ cat > $TESTTMP/failhook << EOF
101 $ cat > $TESTTMP/failhook << EOF
102 > from __future__ import print_function
102 > from __future__ import print_function
103 > import sys
103 > import sys
104 > def hook1line(ui, repo, **kwargs):
104 > def hook1line(ui, repo, **kwargs):
105 > ui.write(b'ui.write 1 line\n')
105 > ui.write(b'ui.write 1 line\n')
106 > ui.flush()
106 > ui.flush()
107 > return 1
107 > return 1
108 > def hook2lines(ui, repo, **kwargs):
108 > def hook2lines(ui, repo, **kwargs):
109 > ui.write(b'ui.write 2 lines 1\n')
109 > ui.write(b'ui.write 2 lines 1\n')
110 > ui.write(b'ui.write 2 lines 2\n')
110 > ui.write(b'ui.write 2 lines 2\n')
111 > ui.flush()
111 > ui.flush()
112 > return 1
112 > return 1
113 > def hook1lineflush(ui, repo, **kwargs):
113 > def hook1lineflush(ui, repo, **kwargs):
114 > ui.write(b'ui.write 1 line flush\n')
114 > ui.write(b'ui.write 1 line flush\n')
115 > ui.flush()
115 > ui.flush()
116 > return 1
116 > return 1
117 > def hookmultiflush(ui, repo, **kwargs):
117 > def hookmultiflush(ui, repo, **kwargs):
118 > ui.write(b'ui.write 1st\n')
118 > ui.write(b'ui.write 1st\n')
119 > ui.flush()
119 > ui.flush()
120 > ui.write(b'ui.write 2nd\n')
120 > ui.write(b'ui.write 2nd\n')
121 > ui.flush()
121 > ui.flush()
122 > return 1
122 > return 1
123 > def hookwriteandwriteerr(ui, repo, **kwargs):
123 > def hookwriteandwriteerr(ui, repo, **kwargs):
124 > ui.write(b'ui.write 1\n')
124 > ui.write(b'ui.write 1\n')
125 > ui.write_err(b'ui.write_err 1\n')
125 > ui.write_err(b'ui.write_err 1\n')
126 > ui.write(b'ui.write 2\n')
126 > ui.write(b'ui.write 2\n')
127 > ui.write_err(b'ui.write_err 2\n')
127 > ui.write_err(b'ui.write_err 2\n')
128 > ui.flush()
128 > ui.flush()
129 > return 1
129 > return 1
130 > def hookprintstdout(ui, repo, **kwargs):
130 > def hookprintstdout(ui, repo, **kwargs):
131 > print('printed line')
131 > print('printed line')
132 > sys.stdout.flush()
132 > sys.stdout.flush()
133 > return 1
133 > return 1
134 > def hookprintandwrite(ui, repo, **kwargs):
134 > def hookprintandwrite(ui, repo, **kwargs):
135 > print('print 1')
135 > print('print 1')
136 > sys.stdout.flush()
136 > sys.stdout.flush()
137 > ui.write(b'ui.write 1\n')
137 > ui.write(b'ui.write 1\n')
138 > ui.flush()
138 > ui.flush()
139 > print('print 2')
139 > print('print 2')
140 > sys.stdout.flush()
140 > sys.stdout.flush()
141 > ui.write(b'ui.write 2\n')
141 > ui.write(b'ui.write 2\n')
142 > ui.flush()
142 > ui.flush()
143 > return 1
143 > return 1
144 > def hookprintstderrandstdout(ui, repo, **kwargs):
144 > def hookprintstderrandstdout(ui, repo, **kwargs):
145 > print('stdout 1')
145 > print('stdout 1')
146 > sys.stdout.flush()
146 > sys.stdout.flush()
147 > print('stderr 1', file=sys.stderr)
147 > print('stderr 1', file=sys.stderr)
148 > sys.stderr.flush()
148 > sys.stderr.flush()
149 > print('stdout 2')
149 > print('stdout 2')
150 > sys.stdout.flush()
150 > sys.stdout.flush()
151 > print('stderr 2', file=sys.stderr)
151 > print('stderr 2', file=sys.stderr)
152 > sys.stderr.flush()
152 > sys.stderr.flush()
153 > return 1
153 > return 1
154 > EOF
154 > EOF
155
155
156 $ hg init failrepo
156 $ hg init failrepo
157 $ cd failrepo
157 $ cd failrepo
158
158
159 ui.write() in hook is redirected to stderr
159 ui.write() in hook is redirected to stderr
160
160
161 $ cat > .hg/hgrc << EOF
161 $ cat > .hg/hgrc << EOF
162 > [hooks]
162 > [hooks]
163 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook1line
163 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook1line
164 > EOF
164 > EOF
165
165
166 $ debugwireproto << EOF
166 $ debugwireproto << EOF
167 > command unbundle
167 > command unbundle
168 > # This is "force" in hex.
168 > # This is "force" in hex.
169 > heads 666f726365
169 > heads 666f726365
170 > PUSHFILE ../initial.v1.hg
170 > PUSHFILE ../initial.v1.hg
171 > readavailable
171 > readavailable
172 > EOF
172 > EOF
173 testing ssh1
173 testing ssh1
174 creating ssh peer from handshake results
174 creating ssh peer from handshake results
175 i> write(104) -> 104:
175 i> write(104) -> 104:
176 i> hello\n
176 i> hello\n
177 i> between\n
177 i> between\n
178 i> pairs 81\n
178 i> pairs 81\n
179 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
179 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
180 i> flush() -> None
180 i> flush() -> None
181 o> readline() -> 4:
181 o> readline() -> 4:
182 o> 444\n
182 o> \d+\\n (re)
183 o> readline() -> 444:
183 o> readline\(\) -> \d+: (re)
184 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
184 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
185 o> readline() -> 2:
185 o> readline() -> 2:
186 o> 1\n
186 o> 1\n
187 o> readline() -> 1:
187 o> readline() -> 1:
188 o> \n
188 o> \n
189 sending unbundle command
189 sending unbundle command
190 i> write(9) -> 9:
190 i> write(9) -> 9:
191 i> unbundle\n
191 i> unbundle\n
192 i> write(9) -> 9:
192 i> write(9) -> 9:
193 i> heads 10\n
193 i> heads 10\n
194 i> write(10) -> 10: 666f726365
194 i> write(10) -> 10: 666f726365
195 i> flush() -> None
195 i> flush() -> None
196 o> readline() -> 2:
196 o> readline() -> 2:
197 o> 0\n
197 o> 0\n
198 i> write(4) -> 4:
198 i> write(4) -> 4:
199 i> 426\n
199 i> 426\n
200 i> write(426) -> 426:
200 i> write(426) -> 426:
201 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
201 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
202 i> test\n
202 i> test\n
203 i> 0 0\n
203 i> 0 0\n
204 i> foo\n
204 i> foo\n
205 i> \n
205 i> \n
206 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
206 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
207 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
207 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
208 i> \x00\x00\x00\x00\x00\x00\x00\x00
208 i> \x00\x00\x00\x00\x00\x00\x00\x00
209 i> write(2) -> 2:
209 i> write(2) -> 2:
210 i> 0\n
210 i> 0\n
211 i> flush() -> None
211 i> flush() -> None
212 o> readline() -> 2:
212 o> readline() -> 2:
213 o> 0\n
213 o> 0\n
214 o> readline() -> 2:
214 o> readline() -> 2:
215 o> 1\n
215 o> 1\n
216 o> read(1) -> 1: 0
216 o> read(1) -> 1: 0
217 result: 0
217 result: 0
218 remote output:
218 remote output:
219 e> read(-1) -> 151:
219 e> read(-1) -> 151:
220 e> adding changesets\n
220 e> adding changesets\n
221 e> adding manifests\n
221 e> adding manifests\n
222 e> adding file changes\n
222 e> adding file changes\n
223 e> ui.write 1 line\n
223 e> ui.write 1 line\n
224 e> transaction abort!\n
224 e> transaction abort!\n
225 e> rollback completed\n
225 e> rollback completed\n
226 e> abort: pretxnchangegroup.fail hook failed\n
226 e> abort: pretxnchangegroup.fail hook failed\n
227
227
228 And a variation that writes multiple lines using ui.write
228 And a variation that writes multiple lines using ui.write
229
229
230 $ cat > .hg/hgrc << EOF
230 $ cat > .hg/hgrc << EOF
231 > [hooks]
231 > [hooks]
232 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook2lines
232 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook2lines
233 > EOF
233 > EOF
234
234
235 $ debugwireproto << EOF
235 $ debugwireproto << EOF
236 > command unbundle
236 > command unbundle
237 > # This is "force" in hex.
237 > # This is "force" in hex.
238 > heads 666f726365
238 > heads 666f726365
239 > PUSHFILE ../initial.v1.hg
239 > PUSHFILE ../initial.v1.hg
240 > readavailable
240 > readavailable
241 > EOF
241 > EOF
242 testing ssh1
242 testing ssh1
243 creating ssh peer from handshake results
243 creating ssh peer from handshake results
244 i> write(104) -> 104:
244 i> write(104) -> 104:
245 i> hello\n
245 i> hello\n
246 i> between\n
246 i> between\n
247 i> pairs 81\n
247 i> pairs 81\n
248 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
248 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
249 i> flush() -> None
249 i> flush() -> None
250 o> readline() -> 4:
250 o> readline\(\) -> \d+: (re)
251 o> 444\n
251 o> \d+\\n (re)
252 o> readline() -> 444:
252 o> readline\(\) -> \d+: (re)
253 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
253 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
254 o> readline() -> 2:
254 o> readline() -> 2:
255 o> 1\n
255 o> 1\n
256 o> readline() -> 1:
256 o> readline() -> 1:
257 o> \n
257 o> \n
258 sending unbundle command
258 sending unbundle command
259 i> write(9) -> 9:
259 i> write(9) -> 9:
260 i> unbundle\n
260 i> unbundle\n
261 i> write(9) -> 9:
261 i> write(9) -> 9:
262 i> heads 10\n
262 i> heads 10\n
263 i> write(10) -> 10: 666f726365
263 i> write(10) -> 10: 666f726365
264 i> flush() -> None
264 i> flush() -> None
265 o> readline() -> 2:
265 o> readline() -> 2:
266 o> 0\n
266 o> 0\n
267 i> write(4) -> 4:
267 i> write(4) -> 4:
268 i> 426\n
268 i> 426\n
269 i> write(426) -> 426:
269 i> write(426) -> 426:
270 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
270 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
271 i> test\n
271 i> test\n
272 i> 0 0\n
272 i> 0 0\n
273 i> foo\n
273 i> foo\n
274 i> \n
274 i> \n
275 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
275 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
276 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
276 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
277 i> \x00\x00\x00\x00\x00\x00\x00\x00
277 i> \x00\x00\x00\x00\x00\x00\x00\x00
278 i> write(2) -> 2:
278 i> write(2) -> 2:
279 i> 0\n
279 i> 0\n
280 i> flush() -> None
280 i> flush() -> None
281 o> readline() -> 2:
281 o> readline() -> 2:
282 o> 0\n
282 o> 0\n
283 o> readline() -> 2:
283 o> readline() -> 2:
284 o> 1\n
284 o> 1\n
285 o> read(1) -> 1: 0
285 o> read(1) -> 1: 0
286 result: 0
286 result: 0
287 remote output:
287 remote output:
288 e> read(-1) -> 173:
288 e> read(-1) -> 173:
289 e> adding changesets\n
289 e> adding changesets\n
290 e> adding manifests\n
290 e> adding manifests\n
291 e> adding file changes\n
291 e> adding file changes\n
292 e> ui.write 2 lines 1\n
292 e> ui.write 2 lines 1\n
293 e> ui.write 2 lines 2\n
293 e> ui.write 2 lines 2\n
294 e> transaction abort!\n
294 e> transaction abort!\n
295 e> rollback completed\n
295 e> rollback completed\n
296 e> abort: pretxnchangegroup.fail hook failed\n
296 e> abort: pretxnchangegroup.fail hook failed\n
297
297
298 And a variation that does a ui.flush() after writing output
298 And a variation that does a ui.flush() after writing output
299
299
300 $ cat > .hg/hgrc << EOF
300 $ cat > .hg/hgrc << EOF
301 > [hooks]
301 > [hooks]
302 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook1lineflush
302 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook1lineflush
303 > EOF
303 > EOF
304
304
305 $ debugwireproto << EOF
305 $ debugwireproto << EOF
306 > command unbundle
306 > command unbundle
307 > # This is "force" in hex.
307 > # This is "force" in hex.
308 > heads 666f726365
308 > heads 666f726365
309 > PUSHFILE ../initial.v1.hg
309 > PUSHFILE ../initial.v1.hg
310 > readavailable
310 > readavailable
311 > EOF
311 > EOF
312 testing ssh1
312 testing ssh1
313 creating ssh peer from handshake results
313 creating ssh peer from handshake results
314 i> write(104) -> 104:
314 i> write(104) -> 104:
315 i> hello\n
315 i> hello\n
316 i> between\n
316 i> between\n
317 i> pairs 81\n
317 i> pairs 81\n
318 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
318 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
319 i> flush() -> None
319 i> flush() -> None
320 o> readline() -> 4:
320 o> readline() -> 4:
321 o> 444\n
321 o> \d+\\n (re)
322 o> readline() -> 444:
322 o> readline\(\) -> \d+: (re)
323 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
323 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
324 o> readline() -> 2:
324 o> readline() -> 2:
325 o> 1\n
325 o> 1\n
326 o> readline() -> 1:
326 o> readline() -> 1:
327 o> \n
327 o> \n
328 sending unbundle command
328 sending unbundle command
329 i> write(9) -> 9:
329 i> write(9) -> 9:
330 i> unbundle\n
330 i> unbundle\n
331 i> write(9) -> 9:
331 i> write(9) -> 9:
332 i> heads 10\n
332 i> heads 10\n
333 i> write(10) -> 10: 666f726365
333 i> write(10) -> 10: 666f726365
334 i> flush() -> None
334 i> flush() -> None
335 o> readline() -> 2:
335 o> readline() -> 2:
336 o> 0\n
336 o> 0\n
337 i> write(4) -> 4:
337 i> write(4) -> 4:
338 i> 426\n
338 i> 426\n
339 i> write(426) -> 426:
339 i> write(426) -> 426:
340 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
340 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
341 i> test\n
341 i> test\n
342 i> 0 0\n
342 i> 0 0\n
343 i> foo\n
343 i> foo\n
344 i> \n
344 i> \n
345 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
345 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
346 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
346 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
347 i> \x00\x00\x00\x00\x00\x00\x00\x00
347 i> \x00\x00\x00\x00\x00\x00\x00\x00
348 i> write(2) -> 2:
348 i> write(2) -> 2:
349 i> 0\n
349 i> 0\n
350 i> flush() -> None
350 i> flush() -> None
351 o> readline() -> 2:
351 o> readline() -> 2:
352 o> 0\n
352 o> 0\n
353 o> readline() -> 2:
353 o> readline() -> 2:
354 o> 1\n
354 o> 1\n
355 o> read(1) -> 1: 0
355 o> read(1) -> 1: 0
356 result: 0
356 result: 0
357 remote output:
357 remote output:
358 e> read(-1) -> 157:
358 e> read(-1) -> 157:
359 e> adding changesets\n
359 e> adding changesets\n
360 e> adding manifests\n
360 e> adding manifests\n
361 e> adding file changes\n
361 e> adding file changes\n
362 e> ui.write 1 line flush\n
362 e> ui.write 1 line flush\n
363 e> transaction abort!\n
363 e> transaction abort!\n
364 e> rollback completed\n
364 e> rollback completed\n
365 e> abort: pretxnchangegroup.fail hook failed\n
365 e> abort: pretxnchangegroup.fail hook failed\n
366
366
367 Multiple writes + flush
367 Multiple writes + flush
368
368
369 $ cat > .hg/hgrc << EOF
369 $ cat > .hg/hgrc << EOF
370 > [hooks]
370 > [hooks]
371 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookmultiflush
371 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookmultiflush
372 > EOF
372 > EOF
373
373
374 $ debugwireproto << EOF
374 $ debugwireproto << EOF
375 > command unbundle
375 > command unbundle
376 > # This is "force" in hex.
376 > # This is "force" in hex.
377 > heads 666f726365
377 > heads 666f726365
378 > PUSHFILE ../initial.v1.hg
378 > PUSHFILE ../initial.v1.hg
379 > readavailable
379 > readavailable
380 > EOF
380 > EOF
381 testing ssh1
381 testing ssh1
382 creating ssh peer from handshake results
382 creating ssh peer from handshake results
383 i> write(104) -> 104:
383 i> write(104) -> 104:
384 i> hello\n
384 i> hello\n
385 i> between\n
385 i> between\n
386 i> pairs 81\n
386 i> pairs 81\n
387 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
387 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
388 i> flush() -> None
388 i> flush() -> None
389 o> readline() -> 4:
389 o> readline() -> 4:
390 o> 444\n
390 o> \d+\\n (re)
391 o> readline() -> 444:
391 o> readline\(\) -> \d+: (re)
392 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
392 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
393 o> readline() -> 2:
393 o> readline() -> 2:
394 o> 1\n
394 o> 1\n
395 o> readline() -> 1:
395 o> readline() -> 1:
396 o> \n
396 o> \n
397 sending unbundle command
397 sending unbundle command
398 i> write(9) -> 9:
398 i> write(9) -> 9:
399 i> unbundle\n
399 i> unbundle\n
400 i> write(9) -> 9:
400 i> write(9) -> 9:
401 i> heads 10\n
401 i> heads 10\n
402 i> write(10) -> 10: 666f726365
402 i> write(10) -> 10: 666f726365
403 i> flush() -> None
403 i> flush() -> None
404 o> readline() -> 2:
404 o> readline() -> 2:
405 o> 0\n
405 o> 0\n
406 i> write(4) -> 4:
406 i> write(4) -> 4:
407 i> 426\n
407 i> 426\n
408 i> write(426) -> 426:
408 i> write(426) -> 426:
409 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
409 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
410 i> test\n
410 i> test\n
411 i> 0 0\n
411 i> 0 0\n
412 i> foo\n
412 i> foo\n
413 i> \n
413 i> \n
414 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
414 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
415 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
415 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
416 i> \x00\x00\x00\x00\x00\x00\x00\x00
416 i> \x00\x00\x00\x00\x00\x00\x00\x00
417 i> write(2) -> 2:
417 i> write(2) -> 2:
418 i> 0\n
418 i> 0\n
419 i> flush() -> None
419 i> flush() -> None
420 o> readline() -> 2:
420 o> readline() -> 2:
421 o> 0\n
421 o> 0\n
422 o> readline() -> 2:
422 o> readline() -> 2:
423 o> 1\n
423 o> 1\n
424 o> read(1) -> 1: 0
424 o> read(1) -> 1: 0
425 result: 0
425 result: 0
426 remote output:
426 remote output:
427 e> read(-1) -> 161:
427 e> read(-1) -> 161:
428 e> adding changesets\n
428 e> adding changesets\n
429 e> adding manifests\n
429 e> adding manifests\n
430 e> adding file changes\n
430 e> adding file changes\n
431 e> ui.write 1st\n
431 e> ui.write 1st\n
432 e> ui.write 2nd\n
432 e> ui.write 2nd\n
433 e> transaction abort!\n
433 e> transaction abort!\n
434 e> rollback completed\n
434 e> rollback completed\n
435 e> abort: pretxnchangegroup.fail hook failed\n
435 e> abort: pretxnchangegroup.fail hook failed\n
436
436
437 ui.write() + ui.write_err() output is captured
437 ui.write() + ui.write_err() output is captured
438
438
439 $ cat > .hg/hgrc << EOF
439 $ cat > .hg/hgrc << EOF
440 > [hooks]
440 > [hooks]
441 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookwriteandwriteerr
441 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookwriteandwriteerr
442 > EOF
442 > EOF
443
443
444 $ debugwireproto << EOF
444 $ debugwireproto << EOF
445 > command unbundle
445 > command unbundle
446 > # This is "force" in hex.
446 > # This is "force" in hex.
447 > heads 666f726365
447 > heads 666f726365
448 > PUSHFILE ../initial.v1.hg
448 > PUSHFILE ../initial.v1.hg
449 > readavailable
449 > readavailable
450 > EOF
450 > EOF
451 testing ssh1
451 testing ssh1
452 creating ssh peer from handshake results
452 creating ssh peer from handshake results
453 i> write(104) -> 104:
453 i> write(104) -> 104:
454 i> hello\n
454 i> hello\n
455 i> between\n
455 i> between\n
456 i> pairs 81\n
456 i> pairs 81\n
457 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
457 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
458 i> flush() -> None
458 i> flush() -> None
459 o> readline() -> 4:
459 o> readline() -> 4:
460 o> 444\n
460 o> \d+\\n (re)
461 o> readline() -> 444:
461 o> readline\(\) -> \d+: (re)
462 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
462 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
463 o> readline() -> 2:
463 o> readline() -> 2:
464 o> 1\n
464 o> 1\n
465 o> readline() -> 1:
465 o> readline() -> 1:
466 o> \n
466 o> \n
467 sending unbundle command
467 sending unbundle command
468 i> write(9) -> 9:
468 i> write(9) -> 9:
469 i> unbundle\n
469 i> unbundle\n
470 i> write(9) -> 9:
470 i> write(9) -> 9:
471 i> heads 10\n
471 i> heads 10\n
472 i> write(10) -> 10: 666f726365
472 i> write(10) -> 10: 666f726365
473 i> flush() -> None
473 i> flush() -> None
474 o> readline() -> 2:
474 o> readline() -> 2:
475 o> 0\n
475 o> 0\n
476 i> write(4) -> 4:
476 i> write(4) -> 4:
477 i> 426\n
477 i> 426\n
478 i> write(426) -> 426:
478 i> write(426) -> 426:
479 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
479 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
480 i> test\n
480 i> test\n
481 i> 0 0\n
481 i> 0 0\n
482 i> foo\n
482 i> foo\n
483 i> \n
483 i> \n
484 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
484 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
485 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
485 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
486 i> \x00\x00\x00\x00\x00\x00\x00\x00
486 i> \x00\x00\x00\x00\x00\x00\x00\x00
487 i> write(2) -> 2:
487 i> write(2) -> 2:
488 i> 0\n
488 i> 0\n
489 i> flush() -> None
489 i> flush() -> None
490 o> readline() -> 2:
490 o> readline() -> 2:
491 o> 0\n
491 o> 0\n
492 o> readline() -> 2:
492 o> readline() -> 2:
493 o> 1\n
493 o> 1\n
494 o> read(1) -> 1: 0
494 o> read(1) -> 1: 0
495 result: 0
495 result: 0
496 remote output:
496 remote output:
497 e> read(-1) -> 187:
497 e> read(-1) -> 187:
498 e> adding changesets\n
498 e> adding changesets\n
499 e> adding manifests\n
499 e> adding manifests\n
500 e> adding file changes\n
500 e> adding file changes\n
501 e> ui.write 1\n
501 e> ui.write 1\n
502 e> ui.write_err 1\n
502 e> ui.write_err 1\n
503 e> ui.write 2\n
503 e> ui.write 2\n
504 e> ui.write_err 2\n
504 e> ui.write_err 2\n
505 e> transaction abort!\n
505 e> transaction abort!\n
506 e> rollback completed\n
506 e> rollback completed\n
507 e> abort: pretxnchangegroup.fail hook failed\n
507 e> abort: pretxnchangegroup.fail hook failed\n
508
508
509
509
510 print() output is captured
510 print() output is captured
511
511
512 $ cat > .hg/hgrc << EOF
512 $ cat > .hg/hgrc << EOF
513 > [hooks]
513 > [hooks]
514 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintstdout
514 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintstdout
515 > EOF
515 > EOF
516
516
517 $ debugwireproto << EOF
517 $ debugwireproto << EOF
518 > command unbundle
518 > command unbundle
519 > # This is "force" in hex.
519 > # This is "force" in hex.
520 > heads 666f726365
520 > heads 666f726365
521 > PUSHFILE ../initial.v1.hg
521 > PUSHFILE ../initial.v1.hg
522 > readavailable
522 > readavailable
523 > EOF
523 > EOF
524 testing ssh1
524 testing ssh1
525 creating ssh peer from handshake results
525 creating ssh peer from handshake results
526 i> write(104) -> 104:
526 i> write(104) -> 104:
527 i> hello\n
527 i> hello\n
528 i> between\n
528 i> between\n
529 i> pairs 81\n
529 i> pairs 81\n
530 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
530 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
531 i> flush() -> None
531 i> flush() -> None
532 o> readline() -> 4:
532 o> readline() -> 4:
533 o> 444\n
533 o> \d+\\n (re)
534 o> readline() -> 444:
534 o> readline\(\) -> \d+: (re)
535 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
535 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
536 o> readline() -> 2:
536 o> readline() -> 2:
537 o> 1\n
537 o> 1\n
538 o> readline() -> 1:
538 o> readline() -> 1:
539 o> \n
539 o> \n
540 sending unbundle command
540 sending unbundle command
541 i> write(9) -> 9:
541 i> write(9) -> 9:
542 i> unbundle\n
542 i> unbundle\n
543 i> write(9) -> 9:
543 i> write(9) -> 9:
544 i> heads 10\n
544 i> heads 10\n
545 i> write(10) -> 10: 666f726365
545 i> write(10) -> 10: 666f726365
546 i> flush() -> None
546 i> flush() -> None
547 o> readline() -> 2:
547 o> readline() -> 2:
548 o> 0\n
548 o> 0\n
549 i> write(4) -> 4:
549 i> write(4) -> 4:
550 i> 426\n
550 i> 426\n
551 i> write(426) -> 426:
551 i> write(426) -> 426:
552 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
552 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
553 i> test\n
553 i> test\n
554 i> 0 0\n
554 i> 0 0\n
555 i> foo\n
555 i> foo\n
556 i> \n
556 i> \n
557 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
557 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
558 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
558 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
559 i> \x00\x00\x00\x00\x00\x00\x00\x00
559 i> \x00\x00\x00\x00\x00\x00\x00\x00
560 i> write(2) -> 2:
560 i> write(2) -> 2:
561 i> 0\n
561 i> 0\n
562 i> flush() -> None
562 i> flush() -> None
563 o> readline() -> 2:
563 o> readline() -> 2:
564 o> 0\n
564 o> 0\n
565 o> readline() -> 2:
565 o> readline() -> 2:
566 o> 1\n
566 o> 1\n
567 o> read(1) -> 1: 0
567 o> read(1) -> 1: 0
568 result: 0
568 result: 0
569 remote output:
569 remote output:
570 e> read(-1) -> 148:
570 e> read(-1) -> 148:
571 e> adding changesets\n
571 e> adding changesets\n
572 e> adding manifests\n
572 e> adding manifests\n
573 e> adding file changes\n
573 e> adding file changes\n
574 e> printed line\n
574 e> printed line\n
575 e> transaction abort!\n
575 e> transaction abort!\n
576 e> rollback completed\n
576 e> rollback completed\n
577 e> abort: pretxnchangegroup.fail hook failed\n
577 e> abort: pretxnchangegroup.fail hook failed\n
578
578
579 Mixed print() and ui.write() are both captured
579 Mixed print() and ui.write() are both captured
580
580
581 $ cat > .hg/hgrc << EOF
581 $ cat > .hg/hgrc << EOF
582 > [hooks]
582 > [hooks]
583 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintandwrite
583 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintandwrite
584 > EOF
584 > EOF
585
585
586 $ debugwireproto << EOF
586 $ debugwireproto << EOF
587 > command unbundle
587 > command unbundle
588 > # This is "force" in hex.
588 > # This is "force" in hex.
589 > heads 666f726365
589 > heads 666f726365
590 > PUSHFILE ../initial.v1.hg
590 > PUSHFILE ../initial.v1.hg
591 > readavailable
591 > readavailable
592 > EOF
592 > EOF
593 testing ssh1
593 testing ssh1
594 creating ssh peer from handshake results
594 creating ssh peer from handshake results
595 i> write(104) -> 104:
595 i> write(104) -> 104:
596 i> hello\n
596 i> hello\n
597 i> between\n
597 i> between\n
598 i> pairs 81\n
598 i> pairs 81\n
599 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
599 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
600 i> flush() -> None
600 i> flush() -> None
601 o> readline() -> 4:
601 o> readline() -> 4:
602 o> 444\n
602 o> \d+\\n (re)
603 o> readline() -> 444:
603 o> readline\(\) -> \d+: (re)
604 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
604 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
605 o> readline() -> 2:
605 o> readline() -> 2:
606 o> 1\n
606 o> 1\n
607 o> readline() -> 1:
607 o> readline() -> 1:
608 o> \n
608 o> \n
609 sending unbundle command
609 sending unbundle command
610 i> write(9) -> 9:
610 i> write(9) -> 9:
611 i> unbundle\n
611 i> unbundle\n
612 i> write(9) -> 9:
612 i> write(9) -> 9:
613 i> heads 10\n
613 i> heads 10\n
614 i> write(10) -> 10: 666f726365
614 i> write(10) -> 10: 666f726365
615 i> flush() -> None
615 i> flush() -> None
616 o> readline() -> 2:
616 o> readline() -> 2:
617 o> 0\n
617 o> 0\n
618 i> write(4) -> 4:
618 i> write(4) -> 4:
619 i> 426\n
619 i> 426\n
620 i> write(426) -> 426:
620 i> write(426) -> 426:
621 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
621 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
622 i> test\n
622 i> test\n
623 i> 0 0\n
623 i> 0 0\n
624 i> foo\n
624 i> foo\n
625 i> \n
625 i> \n
626 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
626 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
627 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
627 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
628 i> \x00\x00\x00\x00\x00\x00\x00\x00
628 i> \x00\x00\x00\x00\x00\x00\x00\x00
629 i> write(2) -> 2:
629 i> write(2) -> 2:
630 i> 0\n
630 i> 0\n
631 i> flush() -> None
631 i> flush() -> None
632 o> readline() -> 2:
632 o> readline() -> 2:
633 o> 0\n
633 o> 0\n
634 o> readline() -> 2:
634 o> readline() -> 2:
635 o> 1\n
635 o> 1\n
636 o> read(1) -> 1: 0
636 o> read(1) -> 1: 0
637 result: 0
637 result: 0
638 remote output:
638 remote output:
639 e> read(-1) -> 173:
639 e> read(-1) -> 173:
640 e> adding changesets\n
640 e> adding changesets\n
641 e> adding manifests\n
641 e> adding manifests\n
642 e> adding file changes\n
642 e> adding file changes\n
643 e> print 1\n
643 e> print 1\n
644 e> ui.write 1\n
644 e> ui.write 1\n
645 e> print 2\n
645 e> print 2\n
646 e> ui.write 2\n
646 e> ui.write 2\n
647 e> transaction abort!\n
647 e> transaction abort!\n
648 e> rollback completed\n
648 e> rollback completed\n
649 e> abort: pretxnchangegroup.fail hook failed\n
649 e> abort: pretxnchangegroup.fail hook failed\n
650
650
651 print() to stdout and stderr both get captured
651 print() to stdout and stderr both get captured
652
652
653 $ cat > .hg/hgrc << EOF
653 $ cat > .hg/hgrc << EOF
654 > [hooks]
654 > [hooks]
655 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintstderrandstdout
655 > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintstderrandstdout
656 > EOF
656 > EOF
657
657
658 $ debugwireproto << EOF
658 $ debugwireproto << EOF
659 > command unbundle
659 > command unbundle
660 > # This is "force" in hex.
660 > # This is "force" in hex.
661 > heads 666f726365
661 > heads 666f726365
662 > PUSHFILE ../initial.v1.hg
662 > PUSHFILE ../initial.v1.hg
663 > readavailable
663 > readavailable
664 > EOF
664 > EOF
665 testing ssh1
665 testing ssh1
666 creating ssh peer from handshake results
666 creating ssh peer from handshake results
667 i> write(104) -> 104:
667 i> write(104) -> 104:
668 i> hello\n
668 i> hello\n
669 i> between\n
669 i> between\n
670 i> pairs 81\n
670 i> pairs 81\n
671 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
671 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
672 i> flush() -> None
672 i> flush() -> None
673 o> readline() -> 4:
673 o> readline() -> 4:
674 o> 444\n
674 o> \d+\\n (re)
675 o> readline() -> 444:
675 o> readline\(\) -> \d+: (re)
676 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
676 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
677 o> readline() -> 2:
677 o> readline() -> 2:
678 o> 1\n
678 o> 1\n
679 o> readline() -> 1:
679 o> readline() -> 1:
680 o> \n
680 o> \n
681 sending unbundle command
681 sending unbundle command
682 i> write(9) -> 9:
682 i> write(9) -> 9:
683 i> unbundle\n
683 i> unbundle\n
684 i> write(9) -> 9:
684 i> write(9) -> 9:
685 i> heads 10\n
685 i> heads 10\n
686 i> write(10) -> 10: 666f726365
686 i> write(10) -> 10: 666f726365
687 i> flush() -> None
687 i> flush() -> None
688 o> readline() -> 2:
688 o> readline() -> 2:
689 o> 0\n
689 o> 0\n
690 i> write(4) -> 4:
690 i> write(4) -> 4:
691 i> 426\n
691 i> 426\n
692 i> write(426) -> 426:
692 i> write(426) -> 426:
693 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
693 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
694 i> test\n
694 i> test\n
695 i> 0 0\n
695 i> 0 0\n
696 i> foo\n
696 i> foo\n
697 i> \n
697 i> \n
698 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
698 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
699 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
699 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
700 i> \x00\x00\x00\x00\x00\x00\x00\x00
700 i> \x00\x00\x00\x00\x00\x00\x00\x00
701 i> write(2) -> 2:
701 i> write(2) -> 2:
702 i> 0\n
702 i> 0\n
703 i> flush() -> None
703 i> flush() -> None
704 o> readline() -> 2:
704 o> readline() -> 2:
705 o> 0\n
705 o> 0\n
706 o> readline() -> 2:
706 o> readline() -> 2:
707 o> 1\n
707 o> 1\n
708 o> read(1) -> 1: 0
708 o> read(1) -> 1: 0
709 result: 0
709 result: 0
710 remote output:
710 remote output:
711 e> read(-1) -> 171:
711 e> read(-1) -> 171:
712 e> adding changesets\n
712 e> adding changesets\n
713 e> adding manifests\n
713 e> adding manifests\n
714 e> adding file changes\n
714 e> adding file changes\n
715 e> stdout 1\n
715 e> stdout 1\n
716 e> stderr 1\n
716 e> stderr 1\n
717 e> stdout 2\n
717 e> stdout 2\n
718 e> stderr 2\n
718 e> stderr 2\n
719 e> transaction abort!\n
719 e> transaction abort!\n
720 e> rollback completed\n
720 e> rollback completed\n
721 e> abort: pretxnchangegroup.fail hook failed\n
721 e> abort: pretxnchangegroup.fail hook failed\n
722
722
723 Shell hook writing to stdout has output captured
723 Shell hook writing to stdout has output captured
724
724
725 $ cat > $TESTTMP/hook.sh << EOF
725 $ cat > $TESTTMP/hook.sh << EOF
726 > echo 'stdout 1'
726 > echo 'stdout 1'
727 > echo 'stdout 2'
727 > echo 'stdout 2'
728 > exit 1
728 > exit 1
729 > EOF
729 > EOF
730
730
731 $ cat > .hg/hgrc << EOF
731 $ cat > .hg/hgrc << EOF
732 > [hooks]
732 > [hooks]
733 > pretxnchangegroup.fail = sh $TESTTMP/hook.sh
733 > pretxnchangegroup.fail = sh $TESTTMP/hook.sh
734 > EOF
734 > EOF
735
735
736 $ debugwireproto << EOF
736 $ debugwireproto << EOF
737 > command unbundle
737 > command unbundle
738 > # This is "force" in hex.
738 > # This is "force" in hex.
739 > heads 666f726365
739 > heads 666f726365
740 > PUSHFILE ../initial.v1.hg
740 > PUSHFILE ../initial.v1.hg
741 > readavailable
741 > readavailable
742 > EOF
742 > EOF
743 testing ssh1
743 testing ssh1
744 creating ssh peer from handshake results
744 creating ssh peer from handshake results
745 i> write(104) -> 104:
745 i> write(104) -> 104:
746 i> hello\n
746 i> hello\n
747 i> between\n
747 i> between\n
748 i> pairs 81\n
748 i> pairs 81\n
749 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
749 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
750 i> flush() -> None
750 i> flush() -> None
751 o> readline() -> 4:
751 o> readline() -> 4:
752 o> 444\n
752 o> \d+\\n (re)
753 o> readline() -> 444:
753 o> readline\(\) -> \d+: (re)
754 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
754 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
755 o> readline() -> 2:
755 o> readline() -> 2:
756 o> 1\n
756 o> 1\n
757 o> readline() -> 1:
757 o> readline() -> 1:
758 o> \n
758 o> \n
759 sending unbundle command
759 sending unbundle command
760 i> write(9) -> 9:
760 i> write(9) -> 9:
761 i> unbundle\n
761 i> unbundle\n
762 i> write(9) -> 9:
762 i> write(9) -> 9:
763 i> heads 10\n
763 i> heads 10\n
764 i> write(10) -> 10: 666f726365
764 i> write(10) -> 10: 666f726365
765 i> flush() -> None
765 i> flush() -> None
766 o> readline() -> 2:
766 o> readline() -> 2:
767 o> 0\n
767 o> 0\n
768 i> write(4) -> 4:
768 i> write(4) -> 4:
769 i> 426\n
769 i> 426\n
770 i> write(426) -> 426:
770 i> write(426) -> 426:
771 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
771 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
772 i> test\n
772 i> test\n
773 i> 0 0\n
773 i> 0 0\n
774 i> foo\n
774 i> foo\n
775 i> \n
775 i> \n
776 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
776 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
777 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
777 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
778 i> \x00\x00\x00\x00\x00\x00\x00\x00
778 i> \x00\x00\x00\x00\x00\x00\x00\x00
779 i> write(2) -> 2:
779 i> write(2) -> 2:
780 i> 0\n
780 i> 0\n
781 i> flush() -> None
781 i> flush() -> None
782 o> readline() -> 2:
782 o> readline() -> 2:
783 o> 0\n
783 o> 0\n
784 o> readline() -> 2:
784 o> readline() -> 2:
785 o> 1\n
785 o> 1\n
786 o> read(1) -> 1: 0
786 o> read(1) -> 1: 0
787 result: 0
787 result: 0
788 remote output:
788 remote output:
789 e> read(-1) -> 167:
789 e> read(-1) -> 167:
790 e> adding changesets\n
790 e> adding changesets\n
791 e> adding manifests\n
791 e> adding manifests\n
792 e> adding file changes\n
792 e> adding file changes\n
793 e> stdout 1\n
793 e> stdout 1\n
794 e> stdout 2\n
794 e> stdout 2\n
795 e> transaction abort!\n
795 e> transaction abort!\n
796 e> rollback completed\n
796 e> rollback completed\n
797 e> abort: pretxnchangegroup.fail hook exited with status 1\n
797 e> abort: pretxnchangegroup.fail hook exited with status 1\n
798 Shell hook writing to stderr has output captured
798 Shell hook writing to stderr has output captured
799
799
800 $ cat > $TESTTMP/hook.sh << EOF
800 $ cat > $TESTTMP/hook.sh << EOF
801 > echo 'stderr 1' 1>&2
801 > echo 'stderr 1' 1>&2
802 > echo 'stderr 2' 1>&2
802 > echo 'stderr 2' 1>&2
803 > exit 1
803 > exit 1
804 > EOF
804 > EOF
805
805
806 $ debugwireproto << EOF
806 $ debugwireproto << EOF
807 > command unbundle
807 > command unbundle
808 > # This is "force" in hex.
808 > # This is "force" in hex.
809 > heads 666f726365
809 > heads 666f726365
810 > PUSHFILE ../initial.v1.hg
810 > PUSHFILE ../initial.v1.hg
811 > readavailable
811 > readavailable
812 > EOF
812 > EOF
813 testing ssh1
813 testing ssh1
814 creating ssh peer from handshake results
814 creating ssh peer from handshake results
815 i> write(104) -> 104:
815 i> write(104) -> 104:
816 i> hello\n
816 i> hello\n
817 i> between\n
817 i> between\n
818 i> pairs 81\n
818 i> pairs 81\n
819 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
819 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
820 i> flush() -> None
820 i> flush() -> None
821 o> readline() -> 4:
821 o> readline() -> 4:
822 o> 444\n
822 o> \d+\\n (re)
823 o> readline() -> 444:
823 o> readline\(\) -> \d+: (re)
824 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
824 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
825 o> readline() -> 2:
825 o> readline() -> 2:
826 o> 1\n
826 o> 1\n
827 o> readline() -> 1:
827 o> readline() -> 1:
828 o> \n
828 o> \n
829 sending unbundle command
829 sending unbundle command
830 i> write(9) -> 9:
830 i> write(9) -> 9:
831 i> unbundle\n
831 i> unbundle\n
832 i> write(9) -> 9:
832 i> write(9) -> 9:
833 i> heads 10\n
833 i> heads 10\n
834 i> write(10) -> 10: 666f726365
834 i> write(10) -> 10: 666f726365
835 i> flush() -> None
835 i> flush() -> None
836 o> readline() -> 2:
836 o> readline() -> 2:
837 o> 0\n
837 o> 0\n
838 i> write(4) -> 4:
838 i> write(4) -> 4:
839 i> 426\n
839 i> 426\n
840 i> write(426) -> 426:
840 i> write(426) -> 426:
841 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
841 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
842 i> test\n
842 i> test\n
843 i> 0 0\n
843 i> 0 0\n
844 i> foo\n
844 i> foo\n
845 i> \n
845 i> \n
846 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
846 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
847 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
847 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
848 i> \x00\x00\x00\x00\x00\x00\x00\x00
848 i> \x00\x00\x00\x00\x00\x00\x00\x00
849 i> write(2) -> 2:
849 i> write(2) -> 2:
850 i> 0\n
850 i> 0\n
851 i> flush() -> None
851 i> flush() -> None
852 o> readline() -> 2:
852 o> readline() -> 2:
853 o> 0\n
853 o> 0\n
854 o> readline() -> 2:
854 o> readline() -> 2:
855 o> 1\n
855 o> 1\n
856 o> read(1) -> 1: 0
856 o> read(1) -> 1: 0
857 result: 0
857 result: 0
858 remote output:
858 remote output:
859 e> read(-1) -> 167:
859 e> read(-1) -> 167:
860 e> adding changesets\n
860 e> adding changesets\n
861 e> adding manifests\n
861 e> adding manifests\n
862 e> adding file changes\n
862 e> adding file changes\n
863 e> stderr 1\n
863 e> stderr 1\n
864 e> stderr 2\n
864 e> stderr 2\n
865 e> transaction abort!\n
865 e> transaction abort!\n
866 e> rollback completed\n
866 e> rollback completed\n
867 e> abort: pretxnchangegroup.fail hook exited with status 1\n
867 e> abort: pretxnchangegroup.fail hook exited with status 1\n
868 Shell hook writing to stdout and stderr has output captured
868 Shell hook writing to stdout and stderr has output captured
869
869
870 $ cat > $TESTTMP/hook.sh << EOF
870 $ cat > $TESTTMP/hook.sh << EOF
871 > echo 'stdout 1'
871 > echo 'stdout 1'
872 > echo 'stderr 1' 1>&2
872 > echo 'stderr 1' 1>&2
873 > echo 'stdout 2'
873 > echo 'stdout 2'
874 > echo 'stderr 2' 1>&2
874 > echo 'stderr 2' 1>&2
875 > exit 1
875 > exit 1
876 > EOF
876 > EOF
877
877
878 $ debugwireproto << EOF
878 $ debugwireproto << EOF
879 > command unbundle
879 > command unbundle
880 > # This is "force" in hex.
880 > # This is "force" in hex.
881 > heads 666f726365
881 > heads 666f726365
882 > PUSHFILE ../initial.v1.hg
882 > PUSHFILE ../initial.v1.hg
883 > readavailable
883 > readavailable
884 > EOF
884 > EOF
885 testing ssh1
885 testing ssh1
886 creating ssh peer from handshake results
886 creating ssh peer from handshake results
887 i> write(104) -> 104:
887 i> write(104) -> 104:
888 i> hello\n
888 i> hello\n
889 i> between\n
889 i> between\n
890 i> pairs 81\n
890 i> pairs 81\n
891 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
891 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
892 i> flush() -> None
892 i> flush() -> None
893 o> readline() -> 4:
893 o> readline() -> 4:
894 o> 444\n
894 o> \d+\\n (re)
895 o> readline() -> 444:
895 o> readline\(\) -> \d+: (re)
896 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
896 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
897 o> readline() -> 2:
897 o> readline() -> 2:
898 o> 1\n
898 o> 1\n
899 o> readline() -> 1:
899 o> readline() -> 1:
900 o> \n
900 o> \n
901 sending unbundle command
901 sending unbundle command
902 i> write(9) -> 9:
902 i> write(9) -> 9:
903 i> unbundle\n
903 i> unbundle\n
904 i> write(9) -> 9:
904 i> write(9) -> 9:
905 i> heads 10\n
905 i> heads 10\n
906 i> write(10) -> 10: 666f726365
906 i> write(10) -> 10: 666f726365
907 i> flush() -> None
907 i> flush() -> None
908 o> readline() -> 2:
908 o> readline() -> 2:
909 o> 0\n
909 o> 0\n
910 i> write(4) -> 4:
910 i> write(4) -> 4:
911 i> 426\n
911 i> 426\n
912 i> write(426) -> 426:
912 i> write(426) -> 426:
913 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
913 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
914 i> test\n
914 i> test\n
915 i> 0 0\n
915 i> 0 0\n
916 i> foo\n
916 i> foo\n
917 i> \n
917 i> \n
918 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
918 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
919 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
919 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
920 i> \x00\x00\x00\x00\x00\x00\x00\x00
920 i> \x00\x00\x00\x00\x00\x00\x00\x00
921 i> write(2) -> 2:
921 i> write(2) -> 2:
922 i> 0\n
922 i> 0\n
923 i> flush() -> None
923 i> flush() -> None
924 o> readline() -> 2:
924 o> readline() -> 2:
925 o> 0\n
925 o> 0\n
926 o> readline() -> 2:
926 o> readline() -> 2:
927 o> 1\n
927 o> 1\n
928 o> read(1) -> 1: 0
928 o> read(1) -> 1: 0
929 result: 0
929 result: 0
930 remote output:
930 remote output:
931 e> read(-1) -> 185:
931 e> read(-1) -> 185:
932 e> adding changesets\n
932 e> adding changesets\n
933 e> adding manifests\n
933 e> adding manifests\n
934 e> adding file changes\n
934 e> adding file changes\n
935 e> stdout 1\n
935 e> stdout 1\n
936 e> stderr 1\n
936 e> stderr 1\n
937 e> stdout 2\n
937 e> stdout 2\n
938 e> stderr 2\n
938 e> stderr 2\n
939 e> transaction abort!\n
939 e> transaction abort!\n
940 e> rollback completed\n
940 e> rollback completed\n
941 e> abort: pretxnchangegroup.fail hook exited with status 1\n
941 e> abort: pretxnchangegroup.fail hook exited with status 1\n
942 Shell and Python hooks writing to stdout and stderr have output captured
942 Shell and Python hooks writing to stdout and stderr have output captured
943
943
944 $ cat > $TESTTMP/hook.sh << EOF
944 $ cat > $TESTTMP/hook.sh << EOF
945 > echo 'shell stdout 1'
945 > echo 'shell stdout 1'
946 > echo 'shell stderr 1' 1>&2
946 > echo 'shell stderr 1' 1>&2
947 > echo 'shell stdout 2'
947 > echo 'shell stdout 2'
948 > echo 'shell stderr 2' 1>&2
948 > echo 'shell stderr 2' 1>&2
949 > exit 0
949 > exit 0
950 > EOF
950 > EOF
951
951
952 $ cat > .hg/hgrc << EOF
952 $ cat > .hg/hgrc << EOF
953 > [hooks]
953 > [hooks]
954 > pretxnchangegroup.a = sh $TESTTMP/hook.sh
954 > pretxnchangegroup.a = sh $TESTTMP/hook.sh
955 > pretxnchangegroup.b = python:$TESTTMP/failhook:hookprintstderrandstdout
955 > pretxnchangegroup.b = python:$TESTTMP/failhook:hookprintstderrandstdout
956 > EOF
956 > EOF
957
957
958 $ debugwireproto << EOF
958 $ debugwireproto << EOF
959 > command unbundle
959 > command unbundle
960 > # This is "force" in hex.
960 > # This is "force" in hex.
961 > heads 666f726365
961 > heads 666f726365
962 > PUSHFILE ../initial.v1.hg
962 > PUSHFILE ../initial.v1.hg
963 > readavailable
963 > readavailable
964 > EOF
964 > EOF
965 testing ssh1
965 testing ssh1
966 creating ssh peer from handshake results
966 creating ssh peer from handshake results
967 i> write(104) -> 104:
967 i> write(104) -> 104:
968 i> hello\n
968 i> hello\n
969 i> between\n
969 i> between\n
970 i> pairs 81\n
970 i> pairs 81\n
971 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
971 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
972 i> flush() -> None
972 i> flush() -> None
973 o> readline() -> 4:
973 o> readline() -> 4:
974 o> 444\n
974 o> \d+\\n (re)
975 o> readline() -> 444:
975 o> readline\(\) -> \d+: (re)
976 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
976 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
977 o> readline() -> 2:
977 o> readline() -> 2:
978 o> 1\n
978 o> 1\n
979 o> readline() -> 1:
979 o> readline() -> 1:
980 o> \n
980 o> \n
981 sending unbundle command
981 sending unbundle command
982 i> write(9) -> 9:
982 i> write(9) -> 9:
983 i> unbundle\n
983 i> unbundle\n
984 i> write(9) -> 9:
984 i> write(9) -> 9:
985 i> heads 10\n
985 i> heads 10\n
986 i> write(10) -> 10: 666f726365
986 i> write(10) -> 10: 666f726365
987 i> flush() -> None
987 i> flush() -> None
988 o> readline() -> 2:
988 o> readline() -> 2:
989 o> 0\n
989 o> 0\n
990 i> write(4) -> 4:
990 i> write(4) -> 4:
991 i> 426\n
991 i> 426\n
992 i> write(426) -> 426:
992 i> write(426) -> 426:
993 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
993 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
994 i> test\n
994 i> test\n
995 i> 0 0\n
995 i> 0 0\n
996 i> foo\n
996 i> foo\n
997 i> \n
997 i> \n
998 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
998 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
999 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
999 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
1000 i> \x00\x00\x00\x00\x00\x00\x00\x00
1000 i> \x00\x00\x00\x00\x00\x00\x00\x00
1001 i> write(2) -> 2:
1001 i> write(2) -> 2:
1002 i> 0\n
1002 i> 0\n
1003 i> flush() -> None
1003 i> flush() -> None
1004 o> readline() -> 2:
1004 o> readline() -> 2:
1005 o> 0\n
1005 o> 0\n
1006 o> readline() -> 2:
1006 o> readline() -> 2:
1007 o> 1\n
1007 o> 1\n
1008 o> read(1) -> 1: 0
1008 o> read(1) -> 1: 0
1009 result: 0
1009 result: 0
1010 remote output:
1010 remote output:
1011 e> read(-1) -> 228:
1011 e> read(-1) -> 228:
1012 e> adding changesets\n
1012 e> adding changesets\n
1013 e> adding manifests\n
1013 e> adding manifests\n
1014 e> adding file changes\n
1014 e> adding file changes\n
1015 e> shell stdout 1\n
1015 e> shell stdout 1\n
1016 e> shell stderr 1\n
1016 e> shell stderr 1\n
1017 e> shell stdout 2\n
1017 e> shell stdout 2\n
1018 e> shell stderr 2\n
1018 e> shell stderr 2\n
1019 e> stdout 1\n
1019 e> stdout 1\n
1020 e> stderr 1\n
1020 e> stderr 1\n
1021 e> stdout 2\n
1021 e> stdout 2\n
1022 e> stderr 2\n
1022 e> stderr 2\n
1023 e> transaction abort!\n
1023 e> transaction abort!\n
1024 e> rollback completed\n
1024 e> rollback completed\n
1025 e> abort: pretxnchangegroup.b hook failed\n
1025 e> abort: pretxnchangegroup.b hook failed\n
1026 $ cd ..
1026 $ cd ..
1027
1027
1028 Pushing a bundle1 with no output
1028 Pushing a bundle1 with no output
1029
1029
1030 $ hg init simplerepo
1030 $ hg init simplerepo
1031 $ cd simplerepo
1031 $ cd simplerepo
1032
1032
1033 $ debugwireproto 1 << EOF
1033 $ debugwireproto 1 << EOF
1034 > command unbundle
1034 > command unbundle
1035 > # This is "force" in hex.
1035 > # This is "force" in hex.
1036 > heads 666f726365
1036 > heads 666f726365
1037 > PUSHFILE ../initial.v1.hg
1037 > PUSHFILE ../initial.v1.hg
1038 > readavailable
1038 > readavailable
1039 > EOF
1039 > EOF
1040 testing ssh1
1040 testing ssh1
1041 creating ssh peer from handshake results
1041 creating ssh peer from handshake results
1042 i> write(104) -> 104:
1042 i> write(104) -> 104:
1043 i> hello\n
1043 i> hello\n
1044 i> between\n
1044 i> between\n
1045 i> pairs 81\n
1045 i> pairs 81\n
1046 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
1046 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
1047 i> flush() -> None
1047 i> flush() -> None
1048 o> readline() -> 4:
1048 o> readline() -> 4:
1049 o> 444\n
1049 o> \d+\\n (re)
1050 o> readline() -> 444:
1050 o> readline\(\) -> \d+: (re)
1051 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
1051 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
1052 o> readline() -> 2:
1052 o> readline() -> 2:
1053 o> 1\n
1053 o> 1\n
1054 o> readline() -> 1:
1054 o> readline() -> 1:
1055 o> \n
1055 o> \n
1056 sending unbundle command
1056 sending unbundle command
1057 i> write(9) -> 9:
1057 i> write(9) -> 9:
1058 i> unbundle\n
1058 i> unbundle\n
1059 i> write(9) -> 9:
1059 i> write(9) -> 9:
1060 i> heads 10\n
1060 i> heads 10\n
1061 i> write(10) -> 10: 666f726365
1061 i> write(10) -> 10: 666f726365
1062 i> flush() -> None
1062 i> flush() -> None
1063 o> readline() -> 2:
1063 o> readline() -> 2:
1064 o> 0\n
1064 o> 0\n
1065 i> write(4) -> 4:
1065 i> write(4) -> 4:
1066 i> 426\n
1066 i> 426\n
1067 i> write(426) -> 426:
1067 i> write(426) -> 426:
1068 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
1068 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
1069 i> test\n
1069 i> test\n
1070 i> 0 0\n
1070 i> 0 0\n
1071 i> foo\n
1071 i> foo\n
1072 i> \n
1072 i> \n
1073 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
1073 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
1074 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
1074 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
1075 i> \x00\x00\x00\x00\x00\x00\x00\x00
1075 i> \x00\x00\x00\x00\x00\x00\x00\x00
1076 i> write(2) -> 2:
1076 i> write(2) -> 2:
1077 i> 0\n
1077 i> 0\n
1078 i> flush() -> None
1078 i> flush() -> None
1079 o> readline() -> 2:
1079 o> readline() -> 2:
1080 o> 0\n
1080 o> 0\n
1081 o> readline() -> 2:
1081 o> readline() -> 2:
1082 o> 1\n
1082 o> 1\n
1083 o> read(1) -> 1: 1
1083 o> read(1) -> 1: 1
1084 result: 1
1084 result: 1
1085 remote output:
1085 remote output:
1086 e> read(-1) -> 100:
1086 e> read(-1) -> 100:
1087 e> adding changesets\n
1087 e> adding changesets\n
1088 e> adding manifests\n
1088 e> adding manifests\n
1089 e> adding file changes\n
1089 e> adding file changes\n
1090 e> added 1 changesets with 1 changes to 1 files\n
1090 e> added 1 changesets with 1 changes to 1 files\n
1091 $ cd ..
1091 $ cd ..
1092
1092
1093 Pushing a bundle1 with ui.write() and ui.write_err()
1093 Pushing a bundle1 with ui.write() and ui.write_err()
1094
1094
1095 $ cat > $TESTTMP/hook << EOF
1095 $ cat > $TESTTMP/hook << EOF
1096 > def hookuiwrite(ui, repo, **kwargs):
1096 > def hookuiwrite(ui, repo, **kwargs):
1097 > ui.write(b'ui.write 1\n')
1097 > ui.write(b'ui.write 1\n')
1098 > ui.write_err(b'ui.write_err 1\n')
1098 > ui.write_err(b'ui.write_err 1\n')
1099 > ui.write(b'ui.write 2\n')
1099 > ui.write(b'ui.write 2\n')
1100 > ui.write_err(b'ui.write_err 2\n')
1100 > ui.write_err(b'ui.write_err 2\n')
1101 > EOF
1101 > EOF
1102
1102
1103 $ hg init uiwriterepo
1103 $ hg init uiwriterepo
1104 $ cd uiwriterepo
1104 $ cd uiwriterepo
1105 $ cat > .hg/hgrc << EOF
1105 $ cat > .hg/hgrc << EOF
1106 > [hooks]
1106 > [hooks]
1107 > pretxnchangegroup.hook = python:$TESTTMP/hook:hookuiwrite
1107 > pretxnchangegroup.hook = python:$TESTTMP/hook:hookuiwrite
1108 > EOF
1108 > EOF
1109
1109
1110 $ debugwireproto 1 << EOF
1110 $ debugwireproto 1 << EOF
1111 > command unbundle
1111 > command unbundle
1112 > # This is "force" in hex.
1112 > # This is "force" in hex.
1113 > heads 666f726365
1113 > heads 666f726365
1114 > PUSHFILE ../initial.v1.hg
1114 > PUSHFILE ../initial.v1.hg
1115 > readavailable
1115 > readavailable
1116 > EOF
1116 > EOF
1117 testing ssh1
1117 testing ssh1
1118 creating ssh peer from handshake results
1118 creating ssh peer from handshake results
1119 i> write(104) -> 104:
1119 i> write(104) -> 104:
1120 i> hello\n
1120 i> hello\n
1121 i> between\n
1121 i> between\n
1122 i> pairs 81\n
1122 i> pairs 81\n
1123 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
1123 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
1124 i> flush() -> None
1124 i> flush() -> None
1125 o> readline() -> 4:
1125 o> readline() -> 4:
1126 o> 444\n
1126 o> \d+\\n (re)
1127 o> readline() -> 444:
1127 o> readline\(\) -> \d+: (re)
1128 o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n
1128 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
1129 o> readline() -> 2:
1129 o> readline() -> 2:
1130 o> 1\n
1130 o> 1\n
1131 o> readline() -> 1:
1131 o> readline() -> 1:
1132 o> \n
1132 o> \n
1133 sending unbundle command
1133 sending unbundle command
1134 i> write(9) -> 9:
1134 i> write(9) -> 9:
1135 i> unbundle\n
1135 i> unbundle\n
1136 i> write(9) -> 9:
1136 i> write(9) -> 9:
1137 i> heads 10\n
1137 i> heads 10\n
1138 i> write(10) -> 10: 666f726365
1138 i> write(10) -> 10: 666f726365
1139 i> flush() -> None
1139 i> flush() -> None
1140 o> readline() -> 2:
1140 o> readline() -> 2:
1141 o> 0\n
1141 o> 0\n
1142 i> write(4) -> 4:
1142 i> write(4) -> 4:
1143 i> 426\n
1143 i> 426\n
1144 i> write(426) -> 426:
1144 i> write(426) -> 426:
1145 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
1145 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
1146 i> test\n
1146 i> test\n
1147 i> 0 0\n
1147 i> 0 0\n
1148 i> foo\n
1148 i> foo\n
1149 i> \n
1149 i> \n
1150 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
1150 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
1151 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
1151 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
1152 i> \x00\x00\x00\x00\x00\x00\x00\x00
1152 i> \x00\x00\x00\x00\x00\x00\x00\x00
1153 i> write(2) -> 2:
1153 i> write(2) -> 2:
1154 i> 0\n
1154 i> 0\n
1155 i> flush() -> None
1155 i> flush() -> None
1156 o> readline() -> 2:
1156 o> readline() -> 2:
1157 o> 0\n
1157 o> 0\n
1158 o> readline() -> 2:
1158 o> readline() -> 2:
1159 o> 1\n
1159 o> 1\n
1160 o> read(1) -> 1: 1
1160 o> read(1) -> 1: 1
1161 result: 1
1161 result: 1
1162 remote output:
1162 remote output:
1163 e> read(-1) -> 152:
1163 e> read(-1) -> 152:
1164 e> adding changesets\n
1164 e> adding changesets\n
1165 e> adding manifests\n
1165 e> adding manifests\n
1166 e> adding file changes\n
1166 e> adding file changes\n
1167 e> ui.write 1\n
1167 e> ui.write 1\n
1168 e> ui.write_err 1\n
1168 e> ui.write_err 1\n
1169 e> ui.write 2\n
1169 e> ui.write 2\n
1170 e> ui.write_err 2\n
1170 e> ui.write_err 2\n
1171 e> added 1 changesets with 1 changes to 1 files\n
1171 e> added 1 changesets with 1 changes to 1 files\n
General Comments 0
You need to be logged in to leave comments. Login now