##// END OF EJS Templates
tests: remove non-python3 line matching and tests block...
marmoute -
r50446:976648e2 default
parent child Browse files
Show More
@@ -1,1138 +1,1136 b''
1 1 Test exchange of common information using bundle2
2 2
3 3
4 4 $ getmainid() {
5 5 > hg -R main log --template '{node}\n' --rev "$1"
6 6 > }
7 7
8 8 enable obsolescence
9 9
10 10 $ cp $HGRCPATH $TESTTMP/hgrc.orig
11 11 $ cat > $TESTTMP/bundle2-pushkey-hook.sh << EOF
12 12 > echo pushkey: lock state after \"\$HG_NAMESPACE\"
13 13 > hg debuglock
14 14 > EOF
15 15
16 16 $ cat >> $HGRCPATH << EOF
17 17 > [experimental]
18 18 > evolution.createmarkers=True
19 19 > evolution.exchange=True
20 20 > bundle2-output-capture=True
21 21 > [command-templates]
22 22 > log={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
23 23 > [web]
24 24 > push_ssl = false
25 25 > allow_push = *
26 26 > [phases]
27 27 > publish=False
28 28 > [hooks]
29 29 > pretxnclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n"
30 30 > txnclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n"
31 31 > txnclose.env = sh -c "HG_LOCAL= printenv.py txnclose"
32 32 > pushkey= sh "$TESTTMP/bundle2-pushkey-hook.sh"
33 33 > EOF
34 34
35 35 The extension requires a repo (currently unused)
36 36
37 37 $ hg init main
38 38 $ cd main
39 39 $ touch a
40 40 $ hg add a
41 41 $ hg commit -m 'a'
42 42 pre-close-tip:3903775176ed draft
43 43 postclose-tip:3903775176ed draft
44 44 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
45 45
46 46 $ hg unbundle $TESTDIR/bundles/rebase.hg
47 47 adding changesets
48 48 adding manifests
49 49 adding file changes
50 50 pre-close-tip:02de42196ebe draft
51 51 added 8 changesets with 7 changes to 7 files (+3 heads)
52 52 new changesets cd010b8cd998:02de42196ebe (8 drafts)
53 53 postclose-tip:02de42196ebe draft
54 54 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=unbundle HG_TXNID=TXN:$ID$ HG_TXNNAME=unbundle
55 55 bundle:*/tests/bundles/rebase.hg HG_URL=bundle:*/tests/bundles/rebase.hg (glob)
56 56 (run 'hg heads' to see heads, 'hg merge' to merge)
57 57
58 58 $ cd ..
59 59
60 60 Real world exchange
61 61 =====================
62 62
63 63 Add more obsolescence information
64 64
65 65 $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc`
66 66 pre-close-tip:02de42196ebe draft
67 67 1 new obsolescence markers
68 68 postclose-tip:02de42196ebe draft
69 69 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
70 70 $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c`
71 71 pre-close-tip:02de42196ebe draft
72 72 1 new obsolescence markers
73 73 postclose-tip:02de42196ebe draft
74 74 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
75 75
76 76 clone --pull
77 77
78 78 $ hg -R main phase --public cd010b8cd998
79 79 pre-close-tip:02de42196ebe draft
80 80 postclose-tip:02de42196ebe draft
81 81 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
82 82 $ hg clone main other --pull --rev 9520eea781bc
83 83 adding changesets
84 84 adding manifests
85 85 adding file changes
86 86 pre-close-tip:9520eea781bc draft
87 87 added 2 changesets with 2 changes to 2 files
88 88 1 new obsolescence markers
89 89 new changesets cd010b8cd998:9520eea781bc (1 drafts)
90 90 postclose-tip:9520eea781bc draft
91 91 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=9520eea781bcca16c1e15acc0ba14335a0e8e5ba HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
92 92 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
93 93 updating to branch default
94 94 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 95 $ hg -R other log -G
96 96 @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
97 97 |
98 98 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
99 99
100 100 $ hg -R other debugobsolete
101 101 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
102 102
103 103 pull
104 104
105 105 $ hg -R main phase --public 9520eea781bc
106 106 pre-close-tip:02de42196ebe draft
107 107 postclose-tip:02de42196ebe draft
108 108 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
109 109 $ hg -R other pull -r 24b6387c8c8c
110 110 pulling from $TESTTMP/main
111 111 searching for changes
112 112 adding changesets
113 113 adding manifests
114 114 adding file changes
115 115 pre-close-tip:24b6387c8c8c draft
116 116 added 1 changesets with 1 changes to 1 files (+1 heads)
117 117 1 new obsolescence markers
118 118 new changesets 24b6387c8c8c (1 drafts)
119 119 postclose-tip:24b6387c8c8c draft
120 120 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_NODE_LAST=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
121 121 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
122 122 (run 'hg heads' to see heads, 'hg merge' to merge)
123 123 $ hg -R other log -G
124 124 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
125 125 |
126 126 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
127 127 |/
128 128 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
129 129
130 130 $ hg -R other debugobsolete
131 131 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
132 132 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
133 133
134 134 pull empty (with phase movement)
135 135
136 136 $ hg -R main phase --public 24b6387c8c8c
137 137 pre-close-tip:02de42196ebe draft
138 138 postclose-tip:02de42196ebe draft
139 139 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
140 140 $ hg -R other pull -r 24b6387c8c8c
141 141 pulling from $TESTTMP/main
142 142 no changes found
143 143 pre-close-tip:24b6387c8c8c public
144 144 1 local changesets published
145 145 postclose-tip:24b6387c8c8c public
146 146 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
147 147 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
148 148 $ hg -R other log -G
149 149 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
150 150 |
151 151 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
152 152 |/
153 153 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
154 154
155 155 $ hg -R other debugobsolete
156 156 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
157 157 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
158 158
159 159 pull empty
160 160
161 161 $ hg -R other pull -r 24b6387c8c8c
162 162 pulling from $TESTTMP/main
163 163 no changes found
164 164 pre-close-tip:24b6387c8c8c public
165 165 postclose-tip:24b6387c8c8c public
166 166 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
167 167 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
168 168 $ hg -R other log -G
169 169 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
170 170 |
171 171 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
172 172 |/
173 173 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
174 174
175 175 $ hg -R other debugobsolete
176 176 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
177 177 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
178 178
179 179 add extra data to test their exchange during push
180 180
181 181 $ hg -R main bookmark --rev eea13746799a book_eea1
182 182 pre-close-tip:02de42196ebe draft
183 183 postclose-tip:02de42196ebe draft
184 184 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
185 185 $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a`
186 186 pre-close-tip:02de42196ebe draft
187 187 1 new obsolescence markers
188 188 postclose-tip:02de42196ebe draft
189 189 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
190 190 $ hg -R main bookmark --rev 02de42196ebe book_02de
191 191 pre-close-tip:02de42196ebe draft book_02de
192 192 postclose-tip:02de42196ebe draft book_02de
193 193 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
194 194 $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe`
195 195 pre-close-tip:02de42196ebe draft book_02de
196 196 1 new obsolescence markers
197 197 postclose-tip:02de42196ebe draft book_02de
198 198 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
199 199 $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc
200 200 pre-close-tip:02de42196ebe draft book_02de
201 201 postclose-tip:02de42196ebe draft book_02de
202 202 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
203 203 $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16`
204 204 pre-close-tip:02de42196ebe draft book_02de
205 205 1 new obsolescence markers
206 206 postclose-tip:02de42196ebe draft book_02de
207 207 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
208 208 $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd
209 209 pre-close-tip:02de42196ebe draft book_02de
210 210 postclose-tip:02de42196ebe draft book_02de
211 211 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
212 212 $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8`
213 213 pre-close-tip:02de42196ebe draft book_02de
214 214 1 new obsolescence markers
215 215 postclose-tip:02de42196ebe draft book_02de
216 216 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
217 217 $ hg -R main bookmark --rev 32af7686d403 book_32af
218 218 pre-close-tip:02de42196ebe draft book_02de
219 219 postclose-tip:02de42196ebe draft book_02de
220 220 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
221 221 $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403`
222 222 pre-close-tip:02de42196ebe draft book_02de
223 223 1 new obsolescence markers
224 224 postclose-tip:02de42196ebe draft book_02de
225 225 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
226 226
227 227 $ hg -R other bookmark --rev cd010b8cd998 book_eea1
228 228 pre-close-tip:24b6387c8c8c public
229 229 postclose-tip:24b6387c8c8c public
230 230 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
231 231 $ hg -R other bookmark --rev cd010b8cd998 book_02de
232 232 pre-close-tip:24b6387c8c8c public
233 233 postclose-tip:24b6387c8c8c public
234 234 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
235 235 $ hg -R other bookmark --rev cd010b8cd998 book_42cc
236 236 pre-close-tip:24b6387c8c8c public
237 237 postclose-tip:24b6387c8c8c public
238 238 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
239 239 $ hg -R other bookmark --rev cd010b8cd998 book_5fdd
240 240 pre-close-tip:24b6387c8c8c public
241 241 postclose-tip:24b6387c8c8c public
242 242 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
243 243 $ hg -R other bookmark --rev cd010b8cd998 book_32af
244 244 pre-close-tip:24b6387c8c8c public
245 245 postclose-tip:24b6387c8c8c public
246 246 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
247 247
248 248 $ hg -R main phase --public eea13746799a
249 249 pre-close-tip:02de42196ebe draft book_02de
250 250 postclose-tip:02de42196ebe draft book_02de
251 251 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
252 252
253 253 push
254 254 $ hg -R main push other --rev eea13746799a --bookmark book_eea1
255 255 pushing to other
256 256 searching for changes
257 257 remote: adding changesets
258 258 remote: adding manifests
259 259 remote: adding file changes
260 260 remote: pre-close-tip:eea13746799a public book_eea1
261 261 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
262 262 remote: 1 new obsolescence markers
263 263 remote: pushkey: lock state after "bookmarks"
264 264 remote: lock: free
265 265 remote: wlock: free
266 266 remote: postclose-tip:eea13746799a public book_eea1
267 267 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_NODE_LAST=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/other
268 268 updating bookmark book_eea1
269 269 pre-close-tip:02de42196ebe draft book_02de
270 270 postclose-tip:02de42196ebe draft book_02de
271 271 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
272 272 file:/*/$TESTTMP/other HG_URL=file:$TESTTMP/other (glob)
273 273 $ hg -R other log -G
274 274 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
275 275 |\
276 276 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
277 277 | |
278 278 @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
279 279 |/
280 280 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A
281 281
282 282 $ hg -R other debugobsolete
283 283 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
284 284 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
285 285 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
286 286
287 287 pull over ssh
288 288
289 289 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de
290 290 pulling from ssh://user@dummy/main
291 291 searching for changes
292 292 adding changesets
293 293 adding manifests
294 294 adding file changes
295 295 updating bookmark book_02de
296 296 pre-close-tip:02de42196ebe draft book_02de
297 297 added 1 changesets with 1 changes to 1 files (+1 heads)
298 298 1 new obsolescence markers
299 299 new changesets 02de42196ebe (1 drafts)
300 300 postclose-tip:02de42196ebe draft book_02de
301 301 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
302 302 ssh://user@dummy/main HG_URL=ssh://user@dummy/main
303 303 (run 'hg heads' to see heads, 'hg merge' to merge)
304 304 $ hg -R other debugobsolete
305 305 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
306 306 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
307 307 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
308 308 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
309 309
310 310 pull over http
311 311
312 312 $ hg serve -R main -p $HGPORT -d --pid-file=main.pid -E main-error.log
313 313 $ cat main.pid >> $DAEMON_PIDS
314 314
315 315 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc
316 316 pulling from http://localhost:$HGPORT/
317 317 searching for changes
318 318 adding changesets
319 319 adding manifests
320 320 adding file changes
321 321 updating bookmark book_42cc
322 322 pre-close-tip:42ccdea3bb16 draft book_42cc
323 323 added 1 changesets with 1 changes to 1 files (+1 heads)
324 324 1 new obsolescence markers
325 325 new changesets 42ccdea3bb16 (1 drafts)
326 326 postclose-tip:42ccdea3bb16 draft book_42cc
327 327 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_NODE_LAST=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
328 328 http://localhost:$HGPORT/ HG_URL=http://localhost:$HGPORT/
329 329 (run 'hg heads .' to see heads, 'hg merge' to merge)
330 330 $ cat main-error.log
331 331 $ hg -R other debugobsolete
332 332 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
333 333 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
334 334 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
335 335 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
336 336 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
337 337
338 338 push over ssh
339 339
340 340 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd
341 341 pushing to ssh://user@dummy/other
342 342 searching for changes
343 343 remote: adding changesets
344 344 remote: adding manifests
345 345 remote: adding file changes
346 346 remote: pre-close-tip:5fddd98957c8 draft book_5fdd
347 347 remote: added 1 changesets with 1 changes to 1 files
348 348 remote: 1 new obsolescence markers
349 349 remote: pushkey: lock state after "bookmarks"
350 350 remote: lock: free
351 351 remote: wlock: free
352 352 remote: postclose-tip:5fddd98957c8 draft book_5fdd
353 353 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_NODE_LAST=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:ssh:$LOCALIP
354 354 updating bookmark book_5fdd
355 355 pre-close-tip:02de42196ebe draft book_02de
356 356 postclose-tip:02de42196ebe draft book_02de
357 357 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
358 358 ssh://user@dummy/other HG_URL=ssh://user@dummy/other
359 359 $ hg -R other log -G
360 360 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
361 361 |
362 362 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
363 363 |
364 364 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
365 365 | |
366 366 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
367 367 | |/|
368 368 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
369 369 |/ /
370 370 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
371 371 |/
372 372 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A
373 373
374 374 $ hg -R other debugobsolete
375 375 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
376 376 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
377 377 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
378 378 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
379 379 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
380 380 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
381 381
382 382 push over http
383 383
384 384 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
385 385 $ cat other.pid >> $DAEMON_PIDS
386 386
387 387 $ hg -R main phase --public 32af7686d403
388 388 pre-close-tip:02de42196ebe draft book_02de
389 389 postclose-tip:02de42196ebe draft book_02de
390 390 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
391 391 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
392 392 pushing to http://localhost:$HGPORT2/
393 393 searching for changes
394 394 remote: adding changesets
395 395 remote: adding manifests
396 396 remote: adding file changes
397 397 remote: pre-close-tip:32af7686d403 public book_32af
398 398 remote: added 1 changesets with 1 changes to 1 files
399 399 remote: 1 new obsolescence markers
400 400 remote: pushkey: lock state after "bookmarks"
401 401 remote: lock: free
402 402 remote: wlock: free
403 403 remote: postclose-tip:32af7686d403 public book_32af
404 404 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=32af7686d403cf45b5d95f2d70cebea587ac806a HG_NODE_LAST=32af7686d403cf45b5d95f2d70cebea587ac806a HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:http:$LOCALIP: (glob)
405 405 updating bookmark book_32af
406 406 pre-close-tip:02de42196ebe draft book_02de
407 407 postclose-tip:02de42196ebe draft book_02de
408 408 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
409 409 http://localhost:$HGPORT2/ HG_URL=http://localhost:$HGPORT2/
410 410 $ cat other-error.log
411 411
412 412 Check final content.
413 413
414 414 $ hg -R other log -G
415 415 o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D
416 416 |
417 417 o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
418 418 |
419 419 o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
420 420 |
421 421 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
422 422 | |
423 423 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
424 424 | |/|
425 425 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
426 426 |/ /
427 427 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
428 428 |/
429 429 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
430 430
431 431 $ hg -R other debugobsolete
432 432 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
433 433 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
434 434 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
435 435 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
436 436 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
437 437 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
438 438 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
439 439
440 440 (check that no 'pending' files remain)
441 441
442 442 $ ls -1 other/.hg/bookmarks*
443 443 other/.hg/bookmarks
444 444 $ ls -1 other/.hg/store/phaseroots*
445 445 other/.hg/store/phaseroots
446 446 $ ls -1 other/.hg/store/00changelog.i*
447 447 other/.hg/store/00changelog.i
448 448
449 449 Error Handling
450 450 ==============
451 451
452 452 Check that errors are properly returned to the client during push.
453 453
454 454 Setting up
455 455
456 456 $ cat > failpush.py << EOF
457 457 > """A small extension that makes push fails when using bundle2
458 458 >
459 459 > used to test error handling in bundle2
460 460 > """
461 461 >
462 462 > from mercurial import error
463 463 > from mercurial import bundle2
464 464 > from mercurial import exchange
465 465 > from mercurial import extensions
466 466 > from mercurial import registrar
467 467 > cmdtable = {}
468 468 > command = registrar.command(cmdtable)
469 469 >
470 470 > configtable = {}
471 471 > configitem = registrar.configitem(configtable)
472 472 > configitem(b'failpush', b'reason',
473 473 > default=None,
474 474 > )
475 475 >
476 476 > def _pushbundle2failpart(pushop, bundler):
477 477 > reason = pushop.ui.config(b'failpush', b'reason')
478 478 > part = None
479 479 > if reason == b'abort':
480 480 > bundler.newpart(b'test:abort')
481 481 > if reason == b'unknown':
482 482 > bundler.newpart(b'test:unknown')
483 483 > if reason == b'race':
484 484 > # 20 Bytes of crap
485 485 > bundler.newpart(b'check:heads', data=b'01234567890123456789')
486 486 >
487 487 > @bundle2.parthandler(b"test:abort")
488 488 > def handleabort(op, part):
489 489 > raise error.Abort(b'Abandon ship!', hint=b"don't panic")
490 490 >
491 491 > def uisetup(ui):
492 492 > exchange.b2partsgenmapping[b'failpart'] = _pushbundle2failpart
493 493 > exchange.b2partsgenorder.insert(0, b'failpart')
494 494 >
495 495 > EOF
496 496
497 497 $ cd main
498 498 $ hg up tip
499 499 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
500 500 $ echo 'I' > I
501 501 $ hg add I
502 502 $ hg ci -m 'I'
503 503 pre-close-tip:e7ec4e813ba6 draft
504 504 postclose-tip:e7ec4e813ba6 draft
505 505 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
506 506 $ hg id
507 507 e7ec4e813ba6 tip
508 508 $ cd ..
509 509
510 510 $ cat << EOF >> $HGRCPATH
511 511 > [extensions]
512 512 > failpush=$TESTTMP/failpush.py
513 513 > EOF
514 514
515 515 $ killdaemons.py
516 516 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
517 517 $ cat other.pid >> $DAEMON_PIDS
518 518
519 519 Doing the actual push: Abort error
520 520
521 521 $ cat << EOF >> $HGRCPATH
522 522 > [failpush]
523 523 > reason = abort
524 524 > EOF
525 525
526 526 $ hg -R main push other -r e7ec4e813ba6
527 527 pushing to other
528 528 searching for changes
529 529 abort: Abandon ship!
530 530 (don't panic)
531 531 [255]
532 532
533 533 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
534 534 pushing to ssh://user@dummy/other
535 535 searching for changes
536 536 remote: Abandon ship!
537 537 remote: (don't panic)
538 538 abort: push failed on remote
539 539 [100]
540 540
541 541 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
542 542 pushing to http://localhost:$HGPORT2/
543 543 searching for changes
544 544 remote: Abandon ship!
545 545 remote: (don't panic)
546 546 abort: push failed on remote
547 547 [100]
548 548
549 549
550 550 Doing the actual push: unknown mandatory parts
551 551
552 552 $ cat << EOF >> $HGRCPATH
553 553 > [failpush]
554 554 > reason = unknown
555 555 > EOF
556 556
557 557 $ hg -R main push other -r e7ec4e813ba6
558 558 pushing to other
559 559 searching for changes
560 560 abort: missing support for test:unknown
561 561 [100]
562 562
563 563 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
564 564 pushing to ssh://user@dummy/other
565 565 searching for changes
566 566 abort: missing support for test:unknown
567 567 [100]
568 568
569 569 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
570 570 pushing to http://localhost:$HGPORT2/
571 571 searching for changes
572 572 abort: missing support for test:unknown
573 573 [100]
574 574
575 575 Doing the actual push: race
576 576
577 577 $ cat << EOF >> $HGRCPATH
578 578 > [failpush]
579 579 > reason = race
580 580 > EOF
581 581
582 582 $ hg -R main push other -r e7ec4e813ba6
583 583 pushing to other
584 584 searching for changes
585 585 abort: push failed:
586 586 'remote repository changed while pushing - please try again'
587 587 [255]
588 588
589 589 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
590 590 pushing to ssh://user@dummy/other
591 591 searching for changes
592 592 abort: push failed:
593 593 'remote repository changed while pushing - please try again'
594 594 [255]
595 595
596 596 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
597 597 pushing to http://localhost:$HGPORT2/
598 598 searching for changes
599 599 abort: push failed:
600 600 'remote repository changed while pushing - please try again'
601 601 [255]
602 602
603 603 Doing the actual push: hook abort
604 604
605 605 $ cat << EOF >> $HGRCPATH
606 606 > [failpush]
607 607 > reason =
608 608 > [hooks]
609 609 > pretxnclose.failpush = sh -c "echo 'You shall not pass!'; false"
610 610 > txnabort.failpush = sh -c "echo 'Cleaning up the mess...'"
611 611 > EOF
612 612
613 613 $ killdaemons.py
614 614 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
615 615 $ cat other.pid >> $DAEMON_PIDS
616 616
617 617 $ hg -R main push other -r e7ec4e813ba6
618 618 pushing to other
619 619 searching for changes
620 620 remote: adding changesets
621 621 remote: adding manifests
622 622 remote: adding file changes
623 623 remote: pre-close-tip:e7ec4e813ba6 draft
624 624 remote: You shall not pass!
625 625 remote: transaction abort!
626 626 remote: Cleaning up the mess...
627 627 remote: rollback completed
628 628 abort: pretxnclose.failpush hook exited with status 1
629 629 [40]
630 630
631 631 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
632 632 pushing to ssh://user@dummy/other
633 633 searching for changes
634 634 remote: adding changesets
635 635 remote: adding manifests
636 636 remote: adding file changes
637 637 remote: pre-close-tip:e7ec4e813ba6 draft
638 638 remote: You shall not pass!
639 639 remote: transaction abort!
640 640 remote: Cleaning up the mess...
641 641 remote: rollback completed
642 642 remote: pretxnclose.failpush hook exited with status 1
643 643 abort: push failed on remote
644 644 [100]
645 645
646 646 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
647 647 pushing to http://localhost:$HGPORT2/
648 648 searching for changes
649 649 remote: adding changesets
650 650 remote: adding manifests
651 651 remote: adding file changes
652 652 remote: pre-close-tip:e7ec4e813ba6 draft
653 653 remote: You shall not pass!
654 654 remote: transaction abort!
655 655 remote: Cleaning up the mess...
656 656 remote: rollback completed
657 657 remote: pretxnclose.failpush hook exited with status 1
658 658 abort: push failed on remote
659 659 [100]
660 660
661 661 (check that no 'pending' files remain)
662 662
663 663 $ ls -1 other/.hg/bookmarks*
664 664 other/.hg/bookmarks
665 665 $ ls -1 other/.hg/store/phaseroots*
666 666 other/.hg/store/phaseroots
667 667 $ ls -1 other/.hg/store/00changelog.i*
668 668 other/.hg/store/00changelog.i
669 669
670 670 Check error from hook during the unbundling process itself
671 671
672 672 $ cat << EOF >> $HGRCPATH
673 673 > pretxnchangegroup = sh -c "echo 'Fail early!'; false"
674 674 > EOF
675 675 $ killdaemons.py # reload http config
676 676 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
677 677 $ cat other.pid >> $DAEMON_PIDS
678 678
679 679 $ hg -R main push other -r e7ec4e813ba6
680 680 pushing to other
681 681 searching for changes
682 682 remote: adding changesets
683 683 remote: adding manifests
684 684 remote: adding file changes
685 685 remote: Fail early!
686 686 remote: transaction abort!
687 687 remote: Cleaning up the mess...
688 688 remote: rollback completed
689 689 abort: pretxnchangegroup hook exited with status 1
690 690 [40]
691 691 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
692 692 pushing to ssh://user@dummy/other
693 693 searching for changes
694 694 remote: adding changesets
695 695 remote: adding manifests
696 696 remote: adding file changes
697 697 remote: Fail early!
698 698 remote: transaction abort!
699 699 remote: Cleaning up the mess...
700 700 remote: rollback completed
701 701 remote: pretxnchangegroup hook exited with status 1
702 702 abort: push failed on remote
703 703 [100]
704 704 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
705 705 pushing to http://localhost:$HGPORT2/
706 706 searching for changes
707 707 remote: adding changesets
708 708 remote: adding manifests
709 709 remote: adding file changes
710 710 remote: Fail early!
711 711 remote: transaction abort!
712 712 remote: Cleaning up the mess...
713 713 remote: rollback completed
714 714 remote: pretxnchangegroup hook exited with status 1
715 715 abort: push failed on remote
716 716 [100]
717 717
718 718 Check output capture control.
719 719
720 720 (should be still forced for http, disabled for local and ssh)
721 721
722 722 $ cat >> $HGRCPATH << EOF
723 723 > [experimental]
724 724 > bundle2-output-capture=False
725 725 > EOF
726 726
727 727 $ hg -R main push other -r e7ec4e813ba6
728 728 pushing to other
729 729 searching for changes
730 730 adding changesets
731 731 adding manifests
732 732 adding file changes
733 733 Fail early!
734 734 transaction abort!
735 735 Cleaning up the mess...
736 736 rollback completed
737 737 abort: pretxnchangegroup hook exited with status 1
738 738 [40]
739 739 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
740 740 pushing to ssh://user@dummy/other
741 741 searching for changes
742 remote: Fail early! (no-py3 chg !)
743 742 remote: adding changesets
744 743 remote: adding manifests
745 744 remote: adding file changes
746 745 remote: Fail early! (py3 !)
747 remote: Fail early! (no-py3 no-chg !)
748 746 remote: transaction abort!
749 747 remote: Cleaning up the mess...
750 748 remote: rollback completed
751 749 remote: pretxnchangegroup hook exited with status 1
752 750 abort: push failed on remote
753 751 [100]
754 752 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
755 753 pushing to http://localhost:$HGPORT2/
756 754 searching for changes
757 755 remote: adding changesets
758 756 remote: adding manifests
759 757 remote: adding file changes
760 758 remote: Fail early!
761 759 remote: transaction abort!
762 760 remote: Cleaning up the mess...
763 761 remote: rollback completed
764 762 remote: pretxnchangegroup hook exited with status 1
765 763 abort: push failed on remote
766 764 [100]
767 765
768 766 Check abort from mandatory pushkey
769 767
770 768 $ cat > mandatorypart.py << EOF
771 769 > from mercurial import exchange
772 770 > from mercurial import pushkey
773 771 > from mercurial import node
774 772 > from mercurial import error
775 773 > @exchange.b2partsgenerator(b'failingpuskey')
776 774 > def addfailingpushey(pushop, bundler):
777 775 > enc = pushkey.encode
778 776 > part = bundler.newpart(b'pushkey')
779 777 > part.addparam(b'namespace', enc(b'phases'))
780 778 > part.addparam(b'key', enc(b'cd010b8cd998f3981a5a8115f94f8da4ab506089'))
781 779 > part.addparam(b'old', enc(b'0')) # successful update
782 780 > part.addparam(b'new', enc(b'0'))
783 781 > def fail(pushop, exc):
784 782 > raise error.Abort(b'Correct phase push failed (because hooks)')
785 783 > pushop.pkfailcb[part.id] = fail
786 784 > EOF
787 785 $ cat >> $HGRCPATH << EOF
788 786 > [hooks]
789 787 > pretxnchangegroup=
790 788 > pretxnclose.failpush=
791 789 > prepushkey.failpush = sh -c "echo 'do not push the key !'; false"
792 790 > [extensions]
793 791 > mandatorypart=$TESTTMP/mandatorypart.py
794 792 > EOF
795 793 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
796 794 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
797 795 $ cat other.pid >> $DAEMON_PIDS
798 796
799 797 (Failure from a hook)
800 798
801 799 $ hg -R main push other -r e7ec4e813ba6
802 800 pushing to other
803 801 searching for changes
804 802 adding changesets
805 803 adding manifests
806 804 adding file changes
807 805 do not push the key !
808 806 pushkey-abort: prepushkey.failpush hook exited with status 1
809 807 transaction abort!
810 808 Cleaning up the mess...
811 809 rollback completed
812 810 abort: Correct phase push failed (because hooks)
813 811 [255]
814 812 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
815 813 pushing to ssh://user@dummy/other
816 814 searching for changes
817 815 remote: adding changesets
818 816 remote: adding manifests
819 817 remote: adding file changes
820 818 remote: do not push the key !
821 819 remote: pushkey-abort: prepushkey.failpush hook exited with status 1
822 820 remote: transaction abort!
823 821 remote: Cleaning up the mess...
824 822 remote: rollback completed
825 823 abort: Correct phase push failed (because hooks)
826 824 [255]
827 825 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
828 826 pushing to http://localhost:$HGPORT2/
829 827 searching for changes
830 828 remote: adding changesets
831 829 remote: adding manifests
832 830 remote: adding file changes
833 831 remote: do not push the key !
834 832 remote: pushkey-abort: prepushkey.failpush hook exited with status 1
835 833 remote: transaction abort!
836 834 remote: Cleaning up the mess...
837 835 remote: rollback completed
838 836 abort: Correct phase push failed (because hooks)
839 837 [255]
840 838
841 839 (Failure from a the pushkey)
842 840
843 841 $ cat > mandatorypart.py << EOF
844 842 > from mercurial import exchange
845 843 > from mercurial import pushkey
846 844 > from mercurial import node
847 845 > from mercurial import error
848 846 > @exchange.b2partsgenerator(b'failingpuskey')
849 847 > def addfailingpushey(pushop, bundler):
850 848 > enc = pushkey.encode
851 849 > part = bundler.newpart(b'pushkey')
852 850 > part.addparam(b'namespace', enc(b'phases'))
853 851 > part.addparam(b'key', enc(b'cd010b8cd998f3981a5a8115f94f8da4ab506089'))
854 852 > part.addparam(b'old', enc(b'4')) # will fail
855 853 > part.addparam(b'new', enc(b'3'))
856 854 > def fail(pushop, exc):
857 855 > raise error.Abort(b'Clown phase push failed')
858 856 > pushop.pkfailcb[part.id] = fail
859 857 > EOF
860 858 $ cat >> $HGRCPATH << EOF
861 859 > [hooks]
862 860 > prepushkey.failpush =
863 861 > EOF
864 862 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
865 863 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
866 864 $ cat other.pid >> $DAEMON_PIDS
867 865
868 866 $ hg -R main push other -r e7ec4e813ba6
869 867 pushing to other
870 868 searching for changes
871 869 adding changesets
872 870 adding manifests
873 871 adding file changes
874 872 transaction abort!
875 873 Cleaning up the mess...
876 874 rollback completed
877 875 pushkey: lock state after "phases"
878 876 lock: free
879 877 wlock: free
880 878 abort: Clown phase push failed
881 879 [255]
882 880 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
883 881 pushing to ssh://user@dummy/other
884 882 searching for changes
885 883 remote: adding changesets
886 884 remote: adding manifests
887 885 remote: adding file changes
888 886 remote: transaction abort!
889 887 remote: Cleaning up the mess...
890 888 remote: rollback completed
891 889 remote: pushkey: lock state after "phases"
892 890 remote: lock: free
893 891 remote: wlock: free
894 892 abort: Clown phase push failed
895 893 [255]
896 894 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
897 895 pushing to http://localhost:$HGPORT2/
898 896 searching for changes
899 897 remote: adding changesets
900 898 remote: adding manifests
901 899 remote: adding file changes
902 900 remote: transaction abort!
903 901 remote: Cleaning up the mess...
904 902 remote: rollback completed
905 903 remote: pushkey: lock state after "phases"
906 904 remote: lock: free
907 905 remote: wlock: free
908 906 abort: Clown phase push failed
909 907 [255]
910 908
911 909 Test lazily acquiring the lock during unbundle
912 910 $ cp $TESTTMP/hgrc.orig $HGRCPATH
913 911
914 912 $ cat >> $TESTTMP/locktester.py <<EOF
915 913 > import os
916 914 > from mercurial import bundle2, error, extensions
917 915 > def checklock(orig, repo, *args, **kwargs):
918 916 > if repo.svfs.lexists(b"lock"):
919 917 > raise error.Abort(b"Lock should not be taken")
920 918 > return orig(repo, *args, **kwargs)
921 919 > def extsetup(ui):
922 920 > extensions.wrapfunction(bundle2, b'processbundle', checklock)
923 921 > EOF
924 922
925 923 $ hg init lazylock
926 924 $ cat >> lazylock/.hg/hgrc <<EOF
927 925 > [extensions]
928 926 > locktester=$TESTTMP/locktester.py
929 927 > EOF
930 928
931 929 $ hg clone -q ssh://user@dummy/lazylock lazylockclient
932 930 $ cd lazylockclient
933 931 $ touch a && hg ci -Aqm a
934 932 $ hg push
935 933 pushing to ssh://user@dummy/lazylock
936 934 searching for changes
937 935 remote: Lock should not be taken
938 936 abort: push failed on remote
939 937 [100]
940 938
941 939 $ cat >> ../lazylock/.hg/hgrc <<EOF
942 940 > [experimental]
943 941 > bundle2lazylocking=True
944 942 > EOF
945 943 $ hg push
946 944 pushing to ssh://user@dummy/lazylock
947 945 searching for changes
948 946 remote: adding changesets
949 947 remote: adding manifests
950 948 remote: adding file changes
951 949 remote: added 1 changesets with 1 changes to 1 files
952 950
953 951 $ cd ..
954 952
955 953 Servers can disable bundle1 for clone/pull operations
956 954
957 955 $ killdaemons.py
958 956 $ hg init bundle2onlyserver
959 957 $ cd bundle2onlyserver
960 958 $ cat > .hg/hgrc << EOF
961 959 > [server]
962 960 > bundle1.pull = false
963 961 > EOF
964 962
965 963 $ touch foo
966 964 $ hg -q commit -A -m initial
967 965
968 966 $ hg serve -p $HGPORT -d --pid-file=hg.pid
969 967 $ cat hg.pid >> $DAEMON_PIDS
970 968
971 969 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
972 970 requesting all changes
973 971 abort: remote error:
974 972 incompatible Mercurial client; bundle2 required
975 973 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
976 974 [100]
977 975 $ killdaemons.py
978 976 $ cd ..
979 977
980 978 bundle1 can still pull non-generaldelta repos when generaldelta bundle1 disabled
981 979
982 980 $ hg --config format.usegeneraldelta=false init notgdserver
983 981 $ cd notgdserver
984 982 $ cat > .hg/hgrc << EOF
985 983 > [server]
986 984 > bundle1gd.pull = false
987 985 > EOF
988 986
989 987 $ touch foo
990 988 $ hg -q commit -A -m initial
991 989 $ hg serve -p $HGPORT -d --pid-file=hg.pid
992 990 $ cat hg.pid >> $DAEMON_PIDS
993 991
994 992 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-1
995 993 requesting all changes
996 994 adding changesets
997 995 adding manifests
998 996 adding file changes
999 997 added 1 changesets with 1 changes to 1 files
1000 998 new changesets 96ee1d7354c4
1001 999 updating to branch default
1002 1000 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1003 1001
1004 1002 $ killdaemons.py
1005 1003 $ cd ../bundle2onlyserver
1006 1004
1007 1005 bundle1 pull can be disabled for generaldelta repos only
1008 1006
1009 1007 $ cat > .hg/hgrc << EOF
1010 1008 > [server]
1011 1009 > bundle1gd.pull = false
1012 1010 > EOF
1013 1011
1014 1012 $ hg serve -p $HGPORT -d --pid-file=hg.pid
1015 1013 $ cat hg.pid >> $DAEMON_PIDS
1016 1014 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
1017 1015 requesting all changes
1018 1016 abort: remote error:
1019 1017 incompatible Mercurial client; bundle2 required
1020 1018 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1021 1019 [100]
1022 1020
1023 1021 $ killdaemons.py
1024 1022
1025 1023 Verify the global server.bundle1 option works
1026 1024
1027 1025 $ cd ..
1028 1026 $ cat > bundle2onlyserver/.hg/hgrc << EOF
1029 1027 > [server]
1030 1028 > bundle1 = false
1031 1029 > EOF
1032 1030 $ hg serve -R bundle2onlyserver -p $HGPORT -d --pid-file=hg.pid
1033 1031 $ cat hg.pid >> $DAEMON_PIDS
1034 1032 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT not-bundle2
1035 1033 requesting all changes
1036 1034 abort: remote error:
1037 1035 incompatible Mercurial client; bundle2 required
1038 1036 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1039 1037 [100]
1040 1038 $ killdaemons.py
1041 1039
1042 1040 $ hg --config devel.legacy.exchange=bundle1 clone ssh://user@dummy/bundle2onlyserver not-bundle2-ssh
1043 1041 requesting all changes
1044 1042 adding changesets
1045 1043 remote: abort: incompatible Mercurial client; bundle2 required
1046 1044 remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1047 1045 transaction abort!
1048 1046 rollback completed
1049 1047 abort: stream ended unexpectedly (got 0 bytes, expected 4)
1050 1048 [255]
1051 1049
1052 1050 $ cat > bundle2onlyserver/.hg/hgrc << EOF
1053 1051 > [server]
1054 1052 > bundle1gd = false
1055 1053 > EOF
1056 1054 $ hg serve -R bundle2onlyserver -p $HGPORT -d --pid-file=hg.pid
1057 1055 $ cat hg.pid >> $DAEMON_PIDS
1058 1056
1059 1057 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
1060 1058 requesting all changes
1061 1059 abort: remote error:
1062 1060 incompatible Mercurial client; bundle2 required
1063 1061 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1064 1062 [100]
1065 1063
1066 1064 $ killdaemons.py
1067 1065
1068 1066 $ cd notgdserver
1069 1067 $ cat > .hg/hgrc << EOF
1070 1068 > [server]
1071 1069 > bundle1gd = false
1072 1070 > EOF
1073 1071 $ hg serve -p $HGPORT -d --pid-file=hg.pid
1074 1072 $ cat hg.pid >> $DAEMON_PIDS
1075 1073
1076 1074 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-2
1077 1075 requesting all changes
1078 1076 adding changesets
1079 1077 adding manifests
1080 1078 adding file changes
1081 1079 added 1 changesets with 1 changes to 1 files
1082 1080 new changesets 96ee1d7354c4
1083 1081 updating to branch default
1084 1082 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1085 1083
1086 1084 $ killdaemons.py
1087 1085 $ cd ../bundle2onlyserver
1088 1086
1089 1087 Verify bundle1 pushes can be disabled
1090 1088
1091 1089 $ cat > .hg/hgrc << EOF
1092 1090 > [server]
1093 1091 > bundle1.push = false
1094 1092 > [web]
1095 1093 > allow_push = *
1096 1094 > push_ssl = false
1097 1095 > EOF
1098 1096
1099 1097 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E error.log
1100 1098 $ cat hg.pid >> $DAEMON_PIDS
1101 1099 $ cd ..
1102 1100
1103 1101 $ hg clone http://localhost:$HGPORT bundle2-only
1104 1102 requesting all changes
1105 1103 adding changesets
1106 1104 adding manifests
1107 1105 adding file changes
1108 1106 added 1 changesets with 1 changes to 1 files
1109 1107 new changesets 96ee1d7354c4
1110 1108 updating to branch default
1111 1109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1112 1110 $ cd bundle2-only
1113 1111 $ echo commit > foo
1114 1112 $ hg commit -m commit
1115 1113 $ hg --config devel.legacy.exchange=bundle1 push
1116 1114 pushing to http://localhost:$HGPORT/
1117 1115 searching for changes
1118 1116 abort: remote error:
1119 1117 incompatible Mercurial client; bundle2 required
1120 1118 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1121 1119 [100]
1122 1120
1123 1121 (also check with ssh)
1124 1122
1125 1123 $ hg --config devel.legacy.exchange=bundle1 push ssh://user@dummy/bundle2onlyserver
1126 1124 pushing to ssh://user@dummy/bundle2onlyserver
1127 1125 searching for changes
1128 1126 remote: abort: incompatible Mercurial client; bundle2 required
1129 1127 remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1130 1128 [1]
1131 1129
1132 1130 $ hg push
1133 1131 pushing to http://localhost:$HGPORT/
1134 1132 searching for changes
1135 1133 remote: adding changesets
1136 1134 remote: adding manifests
1137 1135 remote: adding file changes
1138 1136 remote: added 1 changesets with 1 changes to 1 files
@@ -1,274 +1,235 b''
1 1 hg debuginstall
2 2 $ hg debuginstall
3 3 checking encoding (ascii)...
4 4 checking Python executable (*) (glob)
5 5 checking Python implementation (*) (glob)
6 6 checking Python version (3.*) (glob) (py3 !)
7 7 checking Python lib (.*[Ll]ib.*)... (re) (no-pyoxidizer !)
8 8 checking Python lib (.*pyoxidizer.*)... (re) (pyoxidizer !)
9 9 checking Python security support (*) (glob)
10 10 TLS 1.2 not supported by Python install; network connections lack modern security (?)
11 11 SNI not supported by Python install; may have connectivity issues with some servers (?)
12 12 checking Rust extensions \((installed|missing)\) (re)
13 13 checking Mercurial version (*) (glob)
14 14 checking Mercurial custom build (*) (glob)
15 15 checking module policy (*) (glob)
16 16 checking installed modules (*mercurial)... (glob)
17 17 checking registered compression engines (*zlib*) (glob)
18 18 checking available compression engines (*zlib*) (glob)
19 19 checking available compression engines for wire protocol (*zlib*) (glob)
20 20 checking "re2" regexp engine \((available|missing)\) (re)
21 21 checking templates (*mercurial?templates)... (glob) (no-pyoxidizer !)
22 22 checking templates (*app?templates)... (glob) (pyoxidizer !)
23 23 checking default template (*mercurial?templates?map-cmdline.default) (glob) (no-pyoxidizer !)
24 24 checking default template (*app?templates?map-cmdline.default) (glob) (pyoxidizer !)
25 25 checking commit editor... (*) (glob)
26 26 checking username (test)
27 27 no problems detected
28 28
29 29 hg debuginstall JSON
30 30 $ hg debuginstall -Tjson | sed 's|\\\\|\\|g'
31 31 [
32 32 {
33 33 "compengines": ["bz2", "bz2truncated", "none", "zlib"*], (glob)
34 34 "compenginesavail": ["bz2", "bz2truncated", "none", "zlib"*], (glob)
35 35 "compenginesserver": [*"zlib"*], (glob)
36 36 "defaulttemplate": "*mercurial?templates?map-cmdline.default", (glob) (no-pyoxidizer !)
37 37 "defaulttemplate": "*app?templates?map-cmdline.default", (glob) (pyoxidizer !)
38 38 "defaulttemplateerror": null,
39 39 "defaulttemplatenotfound": "default",
40 40 "editor": "*", (glob)
41 41 "editornotfound": false,
42 42 "encoding": "ascii",
43 43 "encodingerror": null,
44 44 "extensionserror": null, (no-pure !)
45 45 "hgmodulepolicy": "*", (glob)
46 46 "hgmodules": "*mercurial", (glob)
47 47 "hgver": "*", (glob)
48 48 "hgverextra": "*", (glob)
49 49 "problems": 0,
50 50 "pythonexe": "*", (glob)
51 51 "pythonimplementation": "*", (glob)
52 52 "pythonlib": "*", (glob)
53 53 "pythonsecurity": [*], (glob)
54 54 "pythonver": "*.*.*", (glob)
55 55 "re2": (true|false), (re)
56 56 "templatedirs": "*mercurial?templates", (glob) (no-pyoxidizer !)
57 57 "templatedirs": "*app?templates", (glob) (pyoxidizer !)
58 58 "username": "test",
59 59 "usernameerror": null,
60 60 "vinotfound": false
61 61 }
62 62 ]
63 63
64 64 hg debuginstall with no username
65 65 $ HGUSER= hg debuginstall
66 66 checking encoding (ascii)...
67 67 checking Python executable (*) (glob)
68 68 checking Python implementation (*) (glob)
69 69 checking Python version (3.*) (glob) (py3 !)
70 70 checking Python lib (.*[Ll]ib.*)... (re) (no-pyoxidizer !)
71 71 checking Python lib (.*pyoxidizer.*)... (re) (pyoxidizer !)
72 72 checking Python security support (*) (glob)
73 73 TLS 1.2 not supported by Python install; network connections lack modern security (?)
74 74 SNI not supported by Python install; may have connectivity issues with some servers (?)
75 75 checking Rust extensions \((installed|missing)\) (re)
76 76 checking Mercurial version (*) (glob)
77 77 checking Mercurial custom build (*) (glob)
78 78 checking module policy (*) (glob)
79 79 checking installed modules (*mercurial)... (glob)
80 80 checking registered compression engines (*zlib*) (glob)
81 81 checking available compression engines (*zlib*) (glob)
82 82 checking available compression engines for wire protocol (*zlib*) (glob)
83 83 checking "re2" regexp engine \((available|missing)\) (re)
84 84 checking templates (*mercurial?templates)... (glob) (no-pyoxidizer !)
85 85 checking templates (*app?templates)... (glob) (pyoxidizer !)
86 86 checking default template (*mercurial?templates?map-cmdline.default) (glob) (no-pyoxidizer !)
87 87 checking default template (*app?templates?map-cmdline.default) (glob) (pyoxidizer !)
88 88 checking commit editor... (*) (glob)
89 89 checking username...
90 90 no username supplied
91 91 (specify a username in your configuration file)
92 92 1 problems detected, please check your install!
93 93 [1]
94 94
95 95 hg debuginstall with invalid encoding
96 96 $ HGENCODING=invalidenc hg debuginstall | grep encoding
97 97 checking encoding (invalidenc)...
98 98 unknown encoding: invalidenc
99 99
100 100 exception message in JSON
101 101
102 102 $ HGENCODING=invalidenc HGUSER= hg debuginstall -Tjson | grep error
103 103 "defaulttemplateerror": null,
104 104 "encodingerror": "unknown encoding: invalidenc",
105 105 "extensionserror": null, (no-pure !)
106 106 "usernameerror": "no username supplied",
107 107
108 108 path variables are expanded (~ is the same as $TESTTMP)
109 109 $ mkdir tools
110 110 $ touch tools/testeditor.exe
111 111 #if execbit
112 112 $ chmod 755 tools/testeditor.exe
113 113 #endif
114 114 $ HGEDITOR="~/tools/testeditor.exe" hg debuginstall
115 115 checking encoding (ascii)...
116 116 checking Python executable (*) (glob)
117 117 checking Python implementation (*) (glob)
118 118 checking Python version (3.*) (glob) (py3 !)
119 119 checking Python lib (.*[Ll]ib.*)... (re) (no-pyoxidizer !)
120 120 checking Python lib (.*pyoxidizer.*)... (re) (pyoxidizer !)
121 121 checking Python security support (*) (glob)
122 122 TLS 1.2 not supported by Python install; network connections lack modern security (?)
123 123 SNI not supported by Python install; may have connectivity issues with some servers (?)
124 124 checking Rust extensions \((installed|missing)\) (re)
125 125 checking Mercurial version (*) (glob)
126 126 checking Mercurial custom build (*) (glob)
127 127 checking module policy (*) (glob)
128 128 checking installed modules (*mercurial)... (glob)
129 129 checking registered compression engines (*zlib*) (glob)
130 130 checking available compression engines (*zlib*) (glob)
131 131 checking available compression engines for wire protocol (*zlib*) (glob)
132 132 checking "re2" regexp engine \((available|missing)\) (re)
133 133 checking templates (*mercurial?templates)... (glob) (no-pyoxidizer !)
134 134 checking templates (*app?templates)... (glob) (pyoxidizer !)
135 135 checking default template (*mercurial?templates?map-cmdline.default) (glob) (no-pyoxidizer !)
136 136 checking default template (*app?templates?map-cmdline.default) (glob) (pyoxidizer !)
137 137 checking commit editor... ($TESTTMP/tools/testeditor.exe)
138 138 checking username (test)
139 139 no problems detected
140 140
141 141 print out the binary post-shlexsplit in the error message when commit editor is
142 142 not found (this is intentionally using backslashes to mimic a windows usecase).
143 143 $ HGEDITOR="c:\foo\bar\baz.exe -y -z" hg debuginstall
144 144 checking encoding (ascii)...
145 145 checking Python executable (*) (glob)
146 146 checking Python implementation (*) (glob)
147 147 checking Python version (3.*) (glob) (py3 !)
148 148 checking Python lib (.*[Ll]ib.*)... (re) (no-pyoxidizer !)
149 149 checking Python lib (.*pyoxidizer.*)... (re) (pyoxidizer !)
150 150 checking Python security support (*) (glob)
151 151 TLS 1.2 not supported by Python install; network connections lack modern security (?)
152 152 SNI not supported by Python install; may have connectivity issues with some servers (?)
153 153 checking Rust extensions \((installed|missing)\) (re)
154 154 checking Mercurial version (*) (glob)
155 155 checking Mercurial custom build (*) (glob)
156 156 checking module policy (*) (glob)
157 157 checking installed modules (*mercurial)... (glob)
158 158 checking registered compression engines (*zlib*) (glob)
159 159 checking available compression engines (*zlib*) (glob)
160 160 checking available compression engines for wire protocol (*zlib*) (glob)
161 161 checking "re2" regexp engine \((available|missing)\) (re)
162 162 checking templates (*mercurial?templates)... (glob) (no-pyoxidizer !)
163 163 checking templates (*app?templates)... (glob) (pyoxidizer !)
164 164 checking default template (*mercurial?templates?map-cmdline.default) (glob) (no-pyoxidizer !)
165 165 checking default template (*app?templates?map-cmdline.default) (glob) (pyoxidizer !)
166 166 checking commit editor... (c:\foo\bar\baz.exe) (windows !)
167 167 Can't find editor 'c:\foo\bar\baz.exe' in PATH (windows !)
168 168 checking commit editor... (c:foobarbaz.exe) (no-windows !)
169 169 Can't find editor 'c:foobarbaz.exe' in PATH (no-windows !)
170 170 (specify a commit editor in your configuration file)
171 171 checking username (test)
172 172 1 problems detected, please check your install!
173 173 [1]
174 174
175 175 debuginstall extension support
176 176 $ hg debuginstall --config extensions.fsmonitor= --config fsmonitor.watchman_exe=false | grep atchman
177 177 fsmonitor checking for watchman binary... (false)
178 178 watchman binary missing or broken: warning: Watchman unavailable: watchman exited with code 1
179 179 Verify the json works too:
180 180 $ hg debuginstall --config extensions.fsmonitor= --config fsmonitor.watchman_exe=false -Tjson | grep atchman
181 181 "fsmonitor-watchman": "false",
182 182 "fsmonitor-watchman-error": "warning: Watchman unavailable: watchman exited with code 1",
183 183
184 184 Verify that Mercurial is installable with pip. Note that this MUST be
185 185 the last test in this file, because we do some nasty things to the
186 186 shell environment in order to make the virtualenv work reliably.
187 187
188 188 On Python 3, we use the venv module, which is part of the standard library.
189 189 But some Linux distros strip out this module's functionality involving pip,
190 190 so we have to look for the ensurepip module, which these distros strip out
191 191 completely.
192 192 On Python 2, we use the 3rd party virtualenv module, if available.
193 193
194 194 $ cd $TESTTMP
195 195 $ unset PYTHONPATH
196 196
197 197 #if py3 ensurepip network-io no-pyoxidizer
198 198 $ "$PYTHON" -m venv installenv >> pip.log
199 199
200 200 Hack: Debian does something a bit different in ensurepip.bootstrap. This makes
201 201 it so that pip thinks the 'wheel' wheel is installed so it can build wheels;
202 202 when it goes to try, however, it shells out to run `python3 -u <setup.py>`,
203 203 that *doesn't* get the 'wheel' wheel, and it fails with an invalid command
204 204 'bdist_wheel'. To fix this, we just delete the wheel from where Debian put it in
205 205 our virtual env. Then pip doesn't think it's installed and doesn't try to build.
206 206 $ rm installenv/share/python-wheels/wheel-*.whl >/dev/null 2>&1 || true
207 207
208 208 Note: we use this weird path to run pip and hg to avoid platform differences,
209 209 since it's bin on most platforms but Scripts on Windows.
210 210 $ ./installenv/*/pip install $TESTDIR/.. >> pip.log
211 211 Failed building wheel for mercurial (?)
212 212 WARNING: You are using pip version *; however, version * is available. (glob) (?)
213 213 You should consider upgrading via the '$TESTTMP/installenv/bin/python* -m pip install --upgrade pip' command. (glob) (?)
214 214 $ ./installenv/*/hg debuginstall || cat pip.log
215 215 checking encoding (ascii)...
216 216 checking Python executable (*) (glob)
217 217 checking Python implementation (*) (glob)
218 218 checking Python version (3.*) (glob)
219 219 checking Python lib (*)... (glob)
220 220 checking Python security support (*) (glob)
221 221 checking Rust extensions \((installed|missing)\) (re)
222 222 checking Mercurial version (*) (glob)
223 223 checking Mercurial custom build (*) (glob)
224 224 checking module policy (*) (glob)
225 225 checking installed modules (*/mercurial)... (glob)
226 226 checking registered compression engines (*) (glob)
227 227 checking available compression engines (*) (glob)
228 228 checking available compression engines for wire protocol (*) (glob)
229 229 checking "re2" regexp engine \((available|missing)\) (re)
230 230 checking templates ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob)
231 231 checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob)
232 232 checking commit editor... (*) (glob)
233 233 checking username (test)
234 234 no problems detected
235 235 #endif
236
237 #if virtualenv no-py3 network-io no-pyoxidizer
238
239 Note: --no-site-packages is the default for all versions enabled by hghave
240
241 $ "$PYTHON" -m virtualenv installenv >> pip.log
242 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. (?)
243 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support (?)
244
245 Note: we use this weird path to run pip and hg to avoid platform differences,
246 since it's bin on most platforms but Scripts on Windows.
247 $ ./installenv/*/pip install $TESTDIR/.. >> pip.log
248 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. (?)
249 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support (?)
250 DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. (?)
251 $ ./installenv/*/hg debuginstall || cat pip.log
252 checking encoding (ascii)...
253 checking Python executable (*) (glob)
254 checking Python implementation (*) (glob)
255 checking Python version (2.*) (glob)
256 checking Python lib (*)... (glob)
257 checking Python security support (*) (glob)
258 TLS 1.2 not supported by Python install; network connections lack modern security (?)
259 SNI not supported by Python install; may have connectivity issues with some servers (?)
260 checking Rust extensions \((installed|missing)\) (re)
261 checking Mercurial version (*) (glob)
262 checking Mercurial custom build (*) (glob)
263 checking module policy (*) (glob)
264 checking installed modules (*/mercurial)... (glob)
265 checking registered compression engines (*) (glob)
266 checking available compression engines (*) (glob)
267 checking available compression engines for wire protocol (*) (glob)
268 checking "re2" regexp engine \((available|missing)\) (re)
269 checking templates ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob)
270 checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob)
271 checking commit editor... (*) (glob)
272 checking username (test)
273 no problems detected
274 #endif
@@ -1,600 +1,596 b''
1 1 This test is a duplicate of 'test-http.t' feel free to factor out
2 2 parts that are not bundle1/bundle2 specific.
3 3
4 4 $ cat << EOF >> $HGRCPATH
5 5 > [devel]
6 6 > # This test is dedicated to interaction through old bundle
7 7 > legacy.exchange = bundle1
8 8 > EOF
9 9
10 10
11 11 This test tries to exercise the ssh functionality with a dummy script
12 12
13 13 creating 'remote' repo
14 14
15 15 $ hg init remote
16 16 $ cd remote
17 17 $ echo this > foo
18 18 $ echo this > fooO
19 19 $ hg ci -A -m "init" foo fooO
20 20
21 21 insert a closed branch (issue4428)
22 22
23 23 $ hg up null
24 24 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
25 25 $ hg branch closed
26 26 marked working directory as branch closed
27 27 (branches are permanent and global, did you want a bookmark?)
28 28 $ hg ci -mc0
29 29 $ hg ci --close-branch -mc1
30 30 $ hg up -q default
31 31
32 32 configure for serving
33 33
34 34 $ cat <<EOF > .hg/hgrc
35 35 > [server]
36 36 > uncompressed = True
37 37 >
38 38 > [hooks]
39 39 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
40 40 > EOF
41 41 $ cd $TESTTMP
42 42
43 43 repo not found error
44 44
45 45 $ hg clone ssh://user@dummy/nonexistent local
46 46 remote: abort: repository nonexistent not found
47 47 abort: no suitable response from remote hg
48 48 [255]
49 49
50 50 non-existent absolute path
51 51
52 52 #if no-msys
53 53 $ hg clone ssh://user@dummy//`pwd`/nonexistent local
54 54 remote: abort: repository /$TESTTMP/nonexistent not found
55 55 abort: no suitable response from remote hg
56 56 [255]
57 57 #endif
58 58
59 59 clone remote via stream
60 60
61 61 #if no-reposimplestore
62 62
63 63 $ hg clone --stream ssh://user@dummy/remote local-stream
64 64 streaming all changes
65 65 4 files to transfer, 602 bytes of data (no-zstd !)
66 66 transferred 602 bytes in * seconds (*) (glob) (no-zstd !)
67 67 4 files to transfer, 621 bytes of data (zstd !)
68 68 transferred 621 bytes in * seconds (* */sec) (glob) (zstd !)
69 69 searching for changes
70 70 no changes found
71 71 updating to branch default
72 72 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 73 $ cd local-stream
74 74 $ hg verify
75 75 checking changesets
76 76 checking manifests
77 77 crosschecking files in changesets and manifests
78 78 checking files
79 79 checked 3 changesets with 2 changes to 2 files
80 80 $ hg branches
81 81 default 0:1160648e36ce
82 82 $ cd $TESTTMP
83 83
84 84 clone bookmarks via stream
85 85
86 86 $ hg -R local-stream book mybook
87 87 $ hg clone --stream ssh://user@dummy/local-stream stream2
88 88 streaming all changes
89 89 4 files to transfer, 602 bytes of data (no-zstd !)
90 90 transferred 602 bytes in * seconds (*) (glob) (no-zstd !)
91 91 4 files to transfer, 621 bytes of data (zstd !)
92 92 transferred 621 bytes in * seconds (* */sec) (glob) (zstd !)
93 93 searching for changes
94 94 no changes found
95 95 updating to branch default
96 96 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 97 $ cd stream2
98 98 $ hg book
99 99 mybook 0:1160648e36ce
100 100 $ cd $TESTTMP
101 101 $ rm -rf local-stream stream2
102 102
103 103 #endif
104 104
105 105 clone remote via pull
106 106
107 107 $ hg clone ssh://user@dummy/remote local
108 108 requesting all changes
109 109 adding changesets
110 110 adding manifests
111 111 adding file changes
112 112 added 3 changesets with 2 changes to 2 files
113 113 new changesets 1160648e36ce:ad076bfb429d
114 114 updating to branch default
115 115 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 116
117 117 verify
118 118
119 119 $ cd local
120 120 $ hg verify
121 121 checking changesets
122 122 checking manifests
123 123 crosschecking files in changesets and manifests
124 124 checking files
125 125 checked 3 changesets with 2 changes to 2 files
126 126 $ cat >> .hg/hgrc <<EOF
127 127 > [hooks]
128 128 > changegroup = sh -c "printenv.py --line changegroup-in-local 0 ../dummylog"
129 129 > EOF
130 130
131 131 empty default pull
132 132
133 133 $ hg paths
134 134 default = ssh://user@dummy/remote
135 135 $ hg pull
136 136 pulling from ssh://user@dummy/remote
137 137 searching for changes
138 138 no changes found
139 139
140 140 pull from wrong ssh URL
141 141
142 142 $ hg pull ssh://user@dummy/doesnotexist
143 143 pulling from ssh://user@dummy/doesnotexist
144 144 remote: abort: repository doesnotexist not found
145 145 abort: no suitable response from remote hg
146 146 [255]
147 147
148 148 local change
149 149
150 150 $ echo bleah > foo
151 151 $ hg ci -m "add"
152 152
153 153 updating rc
154 154
155 155 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
156 156
157 157 find outgoing
158 158
159 159 $ hg out ssh://user@dummy/remote
160 160 comparing with ssh://user@dummy/remote
161 161 searching for changes
162 162 changeset: 3:a28a9d1a809c
163 163 tag: tip
164 164 parent: 0:1160648e36ce
165 165 user: test
166 166 date: Thu Jan 01 00:00:00 1970 +0000
167 167 summary: add
168 168
169 169
170 170 find incoming on the remote side
171 171
172 172 $ hg incoming -R ../remote ssh://user@dummy/local
173 173 comparing with ssh://user@dummy/local
174 174 searching for changes
175 175 changeset: 3:a28a9d1a809c
176 176 tag: tip
177 177 parent: 0:1160648e36ce
178 178 user: test
179 179 date: Thu Jan 01 00:00:00 1970 +0000
180 180 summary: add
181 181
182 182
183 183 find incoming on the remote side (using absolute path)
184 184
185 185 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
186 186 comparing with ssh://user@dummy/$TESTTMP/local
187 187 searching for changes
188 188 changeset: 3:a28a9d1a809c
189 189 tag: tip
190 190 parent: 0:1160648e36ce
191 191 user: test
192 192 date: Thu Jan 01 00:00:00 1970 +0000
193 193 summary: add
194 194
195 195
196 196 push
197 197
198 198 $ hg push
199 199 pushing to ssh://user@dummy/remote
200 200 searching for changes
201 201 remote: adding changesets
202 202 remote: adding manifests
203 203 remote: adding file changes
204 204 remote: added 1 changesets with 1 changes to 1 files
205 205 $ cd $TESTTMP/remote
206 206
207 207 check remote tip
208 208
209 209 $ hg tip
210 210 changeset: 3:a28a9d1a809c
211 211 tag: tip
212 212 parent: 0:1160648e36ce
213 213 user: test
214 214 date: Thu Jan 01 00:00:00 1970 +0000
215 215 summary: add
216 216
217 217 $ hg verify
218 218 checking changesets
219 219 checking manifests
220 220 crosschecking files in changesets and manifests
221 221 checking files
222 222 checked 4 changesets with 3 changes to 2 files
223 223 $ hg cat -r tip foo
224 224 bleah
225 225 $ echo z > z
226 226 $ hg ci -A -m z z
227 227 created new head
228 228
229 229 test pushkeys and bookmarks
230 230
231 231 $ cd $TESTTMP/local
232 232 $ hg debugpushkey ssh://user@dummy/remote namespaces
233 233 bookmarks
234 234 namespaces
235 235 phases
236 236 $ hg book foo -r 0
237 237 $ hg out -B
238 238 comparing with ssh://user@dummy/remote
239 239 searching for changed bookmarks
240 240 foo 1160648e36ce
241 241 $ hg push -B foo
242 242 pushing to ssh://user@dummy/remote
243 243 searching for changes
244 244 no changes found
245 245 exporting bookmark foo
246 246 [1]
247 247 $ hg debugpushkey ssh://user@dummy/remote bookmarks
248 248 foo 1160648e36cec0054048a7edc4110c6f84fde594
249 249 $ hg book -f foo
250 250 $ hg push --traceback
251 251 pushing to ssh://user@dummy/remote
252 252 searching for changes
253 253 no changes found
254 254 updating bookmark foo
255 255 [1]
256 256 $ hg book -d foo
257 257 $ hg in -B
258 258 comparing with ssh://user@dummy/remote
259 259 searching for changed bookmarks
260 260 foo a28a9d1a809c
261 261 $ hg book -f -r 0 foo
262 262 $ hg pull -B foo
263 263 pulling from ssh://user@dummy/remote
264 264 no changes found
265 265 updating bookmark foo
266 266 $ hg book -d foo
267 267 $ hg push -B foo
268 268 pushing to ssh://user@dummy/remote
269 269 searching for changes
270 270 no changes found
271 271 deleting remote bookmark foo
272 272 [1]
273 273
274 274 a bad, evil hook that prints to stdout
275 275
276 276 $ cat <<EOF > $TESTTMP/badhook
277 277 > import sys
278 278 > sys.stdout.write("KABOOM\n")
279 279 > EOF
280 280
281 281 $ echo '[hooks]' >> ../remote/.hg/hgrc
282 282 $ echo "changegroup.stdout = \"$PYTHON\" $TESTTMP/badhook" >> ../remote/.hg/hgrc
283 283 $ echo r > r
284 284 $ hg ci -A -m z r
285 285
286 286 push should succeed even though it has an unexpected response
287 287
288 288 $ hg push
289 289 pushing to ssh://user@dummy/remote
290 290 searching for changes
291 291 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
292 292 remote: adding changesets
293 293 remote: adding manifests
294 294 remote: adding file changes
295 295 remote: added 1 changesets with 1 changes to 1 files (py3 !)
296 remote: added 1 changesets with 1 changes to 1 files (no-py3 no-chg !)
297 296 remote: KABOOM
298 remote: added 1 changesets with 1 changes to 1 files (no-py3 chg !)
299 297 $ hg -R ../remote heads
300 298 changeset: 5:1383141674ec
301 299 tag: tip
302 300 parent: 3:a28a9d1a809c
303 301 user: test
304 302 date: Thu Jan 01 00:00:00 1970 +0000
305 303 summary: z
306 304
307 305 changeset: 4:6c0482d977a3
308 306 parent: 0:1160648e36ce
309 307 user: test
310 308 date: Thu Jan 01 00:00:00 1970 +0000
311 309 summary: z
312 310
313 311
314 312 clone bookmarks
315 313
316 314 $ hg -R ../remote bookmark test
317 315 $ hg -R ../remote bookmarks
318 316 * test 4:6c0482d977a3
319 317 $ hg clone ssh://user@dummy/remote local-bookmarks
320 318 requesting all changes
321 319 adding changesets
322 320 adding manifests
323 321 adding file changes
324 322 added 6 changesets with 5 changes to 4 files (+1 heads)
325 323 new changesets 1160648e36ce:1383141674ec
326 324 updating to branch default
327 325 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
328 326 $ hg -R local-bookmarks bookmarks
329 327 test 4:6c0482d977a3
330 328
331 329 passwords in ssh urls are not supported
332 330 (we use a glob here because different Python versions give different
333 331 results here)
334 332
335 333 $ hg push ssh://user:erroneouspwd@dummy/remote
336 334 pushing to ssh://user:*@dummy/remote (glob)
337 335 abort: password in URL not supported
338 336 [255]
339 337
340 338 $ cd $TESTTMP
341 339
342 340 hide outer repo
343 341 $ hg init
344 342
345 343 Test remote paths with spaces (issue2983):
346 344
347 345 $ hg init "ssh://user@dummy/a repo"
348 346 $ touch "$TESTTMP/a repo/test"
349 347 $ hg -R 'a repo' commit -A -m "test"
350 348 adding test
351 349 $ hg -R 'a repo' tag tag
352 350 $ hg id "ssh://user@dummy/a repo"
353 351 73649e48688a
354 352
355 353 $ hg id "ssh://user@dummy/a repo#noNoNO"
356 354 abort: unknown revision 'noNoNO'
357 355 [255]
358 356
359 357 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
360 358
361 359 $ hg clone "ssh://user@dummy/a repo"
362 360 destination directory: a repo
363 361 abort: destination 'a repo' is not empty
364 362 [10]
365 363
366 364 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
367 365 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
368 366 parameters:
369 367
370 368 $ cat > ssh.sh << EOF
371 369 > userhost="\$1"
372 370 > SSH_ORIGINAL_COMMAND="\$2"
373 371 > export SSH_ORIGINAL_COMMAND
374 372 > PYTHONPATH="$PYTHONPATH"
375 373 > export PYTHONPATH
376 374 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
377 375 > EOF
378 376
379 377 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
380 378 73649e48688a
381 379
382 380 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
383 381 remote: Illegal repository "$TESTTMP/a'repo"
384 382 abort: no suitable response from remote hg
385 383 [255]
386 384
387 385 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
388 386 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
389 387 abort: no suitable response from remote hg
390 388 [255]
391 389
392 390 $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
393 391 Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation
394 392 [255]
395 393
396 394 Test hg-ssh in read-only mode:
397 395
398 396 $ cat > ssh.sh << EOF
399 397 > userhost="\$1"
400 398 > SSH_ORIGINAL_COMMAND="\$2"
401 399 > export SSH_ORIGINAL_COMMAND
402 400 > PYTHONPATH="$PYTHONPATH"
403 401 > export PYTHONPATH
404 402 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
405 403 > EOF
406 404
407 405 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
408 406 requesting all changes
409 407 adding changesets
410 408 adding manifests
411 409 adding file changes
412 410 added 6 changesets with 5 changes to 4 files (+1 heads)
413 411 new changesets 1160648e36ce:1383141674ec
414 412 updating to branch default
415 413 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
416 414
417 415 $ cd read-only-local
418 416 $ echo "baz" > bar
419 417 $ hg ci -A -m "unpushable commit" bar
420 418 $ hg push --ssh "sh ../ssh.sh"
421 419 pushing to ssh://user@dummy/*/remote (glob)
422 420 searching for changes
423 421 remote: Permission denied
424 422 remote: abort: pretxnopen.hg-ssh hook failed
425 423 remote: Permission denied
426 424 remote: pushkey-abort: prepushkey.hg-ssh hook failed
427 425 updating 6c0482d977a3 to public failed!
428 426 [1]
429 427
430 428 $ cd $TESTTMP
431 429
432 430 stderr from remote commands should be printed before stdout from local code (issue4336)
433 431
434 432 $ hg clone remote stderr-ordering
435 433 updating to branch default
436 434 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
437 435 $ cd stderr-ordering
438 436 $ cat >> localwrite.py << EOF
439 437 > from mercurial import exchange, extensions
440 438 >
441 439 > def wrappedpush(orig, repo, *args, **kwargs):
442 440 > res = orig(repo, *args, **kwargs)
443 441 > repo.ui.write(b'local stdout\n')
444 442 > return res
445 443 >
446 444 > def extsetup(ui):
447 445 > extensions.wrapfunction(exchange, b'push', wrappedpush)
448 446 > EOF
449 447
450 448 $ cat >> .hg/hgrc << EOF
451 449 > [paths]
452 450 > default-push = ssh://user@dummy/remote
453 451 > [extensions]
454 452 > localwrite = localwrite.py
455 453 > EOF
456 454
457 455 $ echo localwrite > foo
458 456 $ hg commit -m 'testing localwrite'
459 457 $ hg push
460 458 pushing to ssh://user@dummy/remote
461 459 searching for changes
462 460 remote: adding changesets
463 461 remote: adding manifests
464 462 remote: adding file changes
465 463 remote: added 1 changesets with 1 changes to 1 files (py3 !)
466 remote: added 1 changesets with 1 changes to 1 files (no-py3 no-chg !)
467 464 remote: KABOOM
468 remote: added 1 changesets with 1 changes to 1 files (no-py3 chg !)
469 465 local stdout
470 466
471 467 debug output
472 468
473 469 $ hg pull --debug ssh://user@dummy/remote
474 470 pulling from ssh://user@dummy/remote
475 471 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
476 472 sending hello command
477 473 sending between command
478 474 remote: \d+ (re)
479 475 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
480 476 remote: 1
481 477 sending protocaps command
482 478 preparing listkeys for "bookmarks"
483 479 sending listkeys command
484 480 received listkey for "bookmarks": 45 bytes
485 481 query 1; heads
486 482 sending batch command
487 483 searching for changes
488 484 all remote heads known locally
489 485 no changes found
490 486 preparing listkeys for "phases"
491 487 sending listkeys command
492 488 received listkey for "phases": 15 bytes
493 489 checking for updated bookmarks
494 490
495 491 $ cd $TESTTMP
496 492
497 493 $ cat dummylog
498 494 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
499 495 Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio (no-msys !)
500 496 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
501 497 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !)
502 498 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
503 499 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
504 500 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
505 501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
506 502 Got arguments 1:user@dummy 2:hg -R local serve --stdio
507 503 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
508 504 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
509 505 changegroup-in-remote hook: HG_HOOKNAME=changegroup
510 506 HG_HOOKTYPE=changegroup
511 507 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
512 508 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
513 509 HG_SOURCE=serve
514 510 HG_TXNID=TXN:$ID$
515 511 HG_TXNNAME=serve
516 512 remote:ssh:$LOCALIP
517 513 HG_URL=remote:ssh:$LOCALIP
518 514
519 515 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
520 516 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
521 517 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
522 518 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
523 519 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
524 520 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
525 521 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
526 522 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
527 523 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
528 524 changegroup-in-remote hook: HG_HOOKNAME=changegroup
529 525 HG_HOOKTYPE=changegroup
530 526 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
531 527 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
532 528 HG_SOURCE=serve
533 529 HG_TXNID=TXN:$ID$
534 530 HG_TXNNAME=serve
535 531 remote:ssh:$LOCALIP
536 532 HG_URL=remote:ssh:$LOCALIP
537 533
538 534 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
539 535 Got arguments 1:user@dummy 2:hg init 'a repo'
540 536 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
541 537 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
542 538 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
543 539 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
544 540 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
545 541 changegroup-in-remote hook: HG_HOOKNAME=changegroup
546 542 HG_HOOKTYPE=changegroup
547 543 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
548 544 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
549 545 HG_SOURCE=serve
550 546 HG_TXNID=TXN:$ID$
551 547 HG_TXNNAME=serve
552 548 remote:ssh:$LOCALIP
553 549 HG_URL=remote:ssh:$LOCALIP
554 550
555 551 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
556 552
557 553 remote hook failure is attributed to remote
558 554
559 555 $ cat > $TESTTMP/failhook << EOF
560 556 > def hook(ui, repo, **kwargs):
561 557 > ui.write(b'hook failure!\n')
562 558 > ui.flush()
563 559 > return 1
564 560 > EOF
565 561
566 562 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
567 563
568 564 $ hg -q clone ssh://user@dummy/remote hookout
569 565 $ cd hookout
570 566 $ touch hookfailure
571 567 $ hg -q commit -A -m 'remote hook failure'
572 568 $ hg push
573 569 pushing to ssh://user@dummy/remote
574 570 searching for changes
575 571 remote: adding changesets
576 572 remote: adding manifests
577 573 remote: adding file changes
578 574 remote: hook failure!
579 575 remote: transaction abort!
580 576 remote: rollback completed
581 577 remote: abort: pretxnchangegroup.fail hook failed
582 578 [1]
583 579
584 580 abort during pull is properly reported as such
585 581
586 582 $ echo morefoo >> ../remote/foo
587 583 $ hg -R ../remote commit --message "more foo to be pulled"
588 584 $ cat >> ../remote/.hg/hgrc << EOF
589 585 > [extensions]
590 586 > crash = ${TESTDIR}/crashgetbundler.py
591 587 > EOF
592 588 $ hg pull
593 589 pulling from ssh://user@dummy/remote
594 590 searching for changes
595 591 adding changesets
596 592 remote: abort: this is an exercise
597 593 transaction abort!
598 594 rollback completed
599 595 abort: stream ended unexpectedly (got 0 bytes, expected 4)
600 596 [255]
@@ -1,718 +1,714 b''
1 1 This test tries to exercise the ssh functionality with a dummy script
2 2
3 3 creating 'remote' repo
4 4
5 5 $ hg init remote
6 6 $ cd remote
7 7 $ echo this > foo
8 8 $ echo this > fooO
9 9 $ hg ci -A -m "init" foo fooO
10 10
11 11 insert a closed branch (issue4428)
12 12
13 13 $ hg up null
14 14 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
15 15 $ hg branch closed
16 16 marked working directory as branch closed
17 17 (branches are permanent and global, did you want a bookmark?)
18 18 $ hg ci -mc0
19 19 $ hg ci --close-branch -mc1
20 20 $ hg up -q default
21 21
22 22 configure for serving
23 23
24 24 $ cat <<EOF > .hg/hgrc
25 25 > [server]
26 26 > uncompressed = True
27 27 >
28 28 > [hooks]
29 29 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
30 30 > EOF
31 31 $ cd $TESTTMP
32 32
33 33 repo not found error
34 34
35 35 $ hg clone ssh://user@dummy/nonexistent local
36 36 remote: abort: repository nonexistent not found
37 37 abort: no suitable response from remote hg
38 38 [255]
39 39 $ hg clone -q ssh://user@dummy/nonexistent local
40 40 remote: abort: repository nonexistent not found
41 41 abort: no suitable response from remote hg
42 42 [255]
43 43
44 44 non-existent absolute path
45 45
46 46 $ hg clone ssh://user@dummy/`pwd`/nonexistent local
47 47 remote: abort: repository $TESTTMP/nonexistent not found
48 48 abort: no suitable response from remote hg
49 49 [255]
50 50
51 51 clone remote via stream
52 52
53 53 #if no-reposimplestore
54 54
55 55 $ hg clone --stream ssh://user@dummy/remote local-stream
56 56 streaming all changes
57 57 8 files to transfer, 827 bytes of data (no-zstd !)
58 58 transferred 827 bytes in * seconds (*) (glob) (no-zstd !)
59 59 8 files to transfer, 846 bytes of data (zstd !)
60 60 transferred * bytes in * seconds (* */sec) (glob) (zstd !)
61 61 updating to branch default
62 62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 63 $ cd local-stream
64 64 $ hg verify
65 65 checking changesets
66 66 checking manifests
67 67 crosschecking files in changesets and manifests
68 68 checking files
69 69 checked 3 changesets with 2 changes to 2 files
70 70 $ hg branches
71 71 default 0:1160648e36ce
72 72 $ cd $TESTTMP
73 73
74 74 clone bookmarks via stream
75 75
76 76 $ hg -R local-stream book mybook
77 77 $ hg clone --stream ssh://user@dummy/local-stream stream2
78 78 streaming all changes
79 79 15 files to transfer, * of data (glob)
80 80 transferred * in * seconds (*) (glob)
81 81 updating to branch default
82 82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 83 $ cd stream2
84 84 $ hg book
85 85 mybook 0:1160648e36ce
86 86 $ cd $TESTTMP
87 87 $ rm -rf local-stream stream2
88 88
89 89 #endif
90 90
91 91 clone remote via pull
92 92
93 93 $ hg clone ssh://user@dummy/remote local
94 94 requesting all changes
95 95 adding changesets
96 96 adding manifests
97 97 adding file changes
98 98 added 3 changesets with 2 changes to 2 files
99 99 new changesets 1160648e36ce:ad076bfb429d
100 100 updating to branch default
101 101 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 102
103 103 verify
104 104
105 105 $ cd local
106 106 $ hg verify
107 107 checking changesets
108 108 checking manifests
109 109 crosschecking files in changesets and manifests
110 110 checking files
111 111 checked 3 changesets with 2 changes to 2 files
112 112 $ cat >> .hg/hgrc <<EOF
113 113 > [hooks]
114 114 > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog"
115 115 > EOF
116 116
117 117 empty default pull
118 118
119 119 $ hg paths
120 120 default = ssh://user@dummy/remote
121 121 $ hg pull
122 122 pulling from ssh://user@dummy/remote
123 123 searching for changes
124 124 no changes found
125 125
126 126 pull from wrong ssh URL
127 127
128 128 $ hg pull ssh://user@dummy/doesnotexist
129 129 pulling from ssh://user@dummy/doesnotexist
130 130 remote: abort: repository doesnotexist not found
131 131 abort: no suitable response from remote hg
132 132 [255]
133 133
134 134 local change
135 135
136 136 $ echo bleah > foo
137 137 $ hg ci -m "add"
138 138
139 139 updating rc
140 140
141 141 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
142 142
143 143 find outgoing
144 144
145 145 $ hg out ssh://user@dummy/remote
146 146 comparing with ssh://user@dummy/remote
147 147 searching for changes
148 148 changeset: 3:a28a9d1a809c
149 149 tag: tip
150 150 parent: 0:1160648e36ce
151 151 user: test
152 152 date: Thu Jan 01 00:00:00 1970 +0000
153 153 summary: add
154 154
155 155
156 156 find incoming on the remote side
157 157
158 158 $ hg incoming -R ../remote ssh://user@dummy/local
159 159 comparing with ssh://user@dummy/local
160 160 searching for changes
161 161 changeset: 3:a28a9d1a809c
162 162 tag: tip
163 163 parent: 0:1160648e36ce
164 164 user: test
165 165 date: Thu Jan 01 00:00:00 1970 +0000
166 166 summary: add
167 167
168 168
169 169 find incoming on the remote side (using absolute path)
170 170
171 171 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
172 172 comparing with ssh://user@dummy/$TESTTMP/local
173 173 searching for changes
174 174 changeset: 3:a28a9d1a809c
175 175 tag: tip
176 176 parent: 0:1160648e36ce
177 177 user: test
178 178 date: Thu Jan 01 00:00:00 1970 +0000
179 179 summary: add
180 180
181 181
182 182 push
183 183
184 184 $ hg push
185 185 pushing to ssh://user@dummy/remote
186 186 searching for changes
187 187 remote: adding changesets
188 188 remote: adding manifests
189 189 remote: adding file changes
190 190 remote: added 1 changesets with 1 changes to 1 files
191 191 $ cd $TESTTMP/remote
192 192
193 193 check remote tip
194 194
195 195 $ hg tip
196 196 changeset: 3:a28a9d1a809c
197 197 tag: tip
198 198 parent: 0:1160648e36ce
199 199 user: test
200 200 date: Thu Jan 01 00:00:00 1970 +0000
201 201 summary: add
202 202
203 203 $ hg verify
204 204 checking changesets
205 205 checking manifests
206 206 crosschecking files in changesets and manifests
207 207 checking files
208 208 checked 4 changesets with 3 changes to 2 files
209 209 $ hg cat -r tip foo
210 210 bleah
211 211 $ echo z > z
212 212 $ hg ci -A -m z z
213 213 created new head
214 214
215 215 test pushkeys and bookmarks
216 216
217 217 $ cd $TESTTMP/local
218 218 $ hg debugpushkey ssh://user@dummy/remote namespaces
219 219 bookmarks
220 220 namespaces
221 221 phases
222 222 $ hg book foo -r 0
223 223 $ hg out -B --config paths.default=bogus://invalid --config paths.default:pushurl=`hg paths default`
224 224 comparing with ssh://user@dummy/remote
225 225 searching for changed bookmarks
226 226 foo 1160648e36ce
227 227 $ hg push -B foo
228 228 pushing to ssh://user@dummy/remote
229 229 searching for changes
230 230 no changes found
231 231 exporting bookmark foo
232 232 [1]
233 233 $ hg debugpushkey ssh://user@dummy/remote bookmarks
234 234 foo 1160648e36cec0054048a7edc4110c6f84fde594
235 235 $ hg book -f foo
236 236 $ hg push --traceback
237 237 pushing to ssh://user@dummy/remote
238 238 searching for changes
239 239 no changes found
240 240 updating bookmark foo
241 241 [1]
242 242 $ hg book -d foo
243 243 $ hg in -B
244 244 comparing with ssh://user@dummy/remote
245 245 searching for changed bookmarks
246 246 foo a28a9d1a809c
247 247 $ hg book -f -r 0 foo
248 248 $ hg pull -B foo
249 249 pulling from ssh://user@dummy/remote
250 250 no changes found
251 251 updating bookmark foo
252 252 $ hg book -d foo
253 253 $ hg push -B foo
254 254 pushing to ssh://user@dummy/remote
255 255 searching for changes
256 256 no changes found
257 257 deleting remote bookmark foo
258 258 [1]
259 259
260 260 a bad, evil hook that prints to stdout
261 261
262 262 $ cat <<EOF > $TESTTMP/badhook
263 263 > import sys
264 264 > sys.stdout.write("KABOOM\n")
265 265 > sys.stdout.flush()
266 266 > EOF
267 267
268 268 $ cat <<EOF > $TESTTMP/badpyhook.py
269 269 > import sys
270 270 > def hook(ui, repo, hooktype, **kwargs):
271 271 > sys.stdout.write("KABOOM IN PROCESS\n")
272 272 > sys.stdout.flush()
273 273 > EOF
274 274
275 275 $ cat <<EOF >> ../remote/.hg/hgrc
276 276 > [hooks]
277 277 > changegroup.stdout = "$PYTHON" $TESTTMP/badhook
278 278 > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook
279 279 > EOF
280 280 $ echo r > r
281 281 $ hg ci -A -m z r
282 282
283 283 push should succeed even though it has an unexpected response
284 284
285 285 $ hg push
286 286 pushing to ssh://user@dummy/remote
287 287 searching for changes
288 288 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
289 289 remote: adding changesets
290 290 remote: adding manifests
291 291 remote: adding file changes
292 292 remote: added 1 changesets with 1 changes to 1 files (py3 !)
293 remote: added 1 changesets with 1 changes to 1 files (no-py3 no-chg !)
294 293 remote: KABOOM
295 294 remote: KABOOM IN PROCESS
296 remote: added 1 changesets with 1 changes to 1 files (no-py3 chg !)
297 295 $ hg -R ../remote heads
298 296 changeset: 5:1383141674ec
299 297 tag: tip
300 298 parent: 3:a28a9d1a809c
301 299 user: test
302 300 date: Thu Jan 01 00:00:00 1970 +0000
303 301 summary: z
304 302
305 303 changeset: 4:6c0482d977a3
306 304 parent: 0:1160648e36ce
307 305 user: test
308 306 date: Thu Jan 01 00:00:00 1970 +0000
309 307 summary: z
310 308
311 309
312 310 #if chg
313 311
314 312 try again with remote chg, which should succeed as well
315 313
316 314 $ hg rollback -R ../remote
317 315 repository tip rolled back to revision 4 (undo serve)
318 316
319 317 $ hg push --config ui.remotecmd=chg
320 318 pushing to ssh://user@dummy/remote
321 319 searching for changes
322 320 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
323 321 remote: adding changesets
324 322 remote: adding manifests
325 323 remote: adding file changes
326 324 remote: added 1 changesets with 1 changes to 1 files (py3 !)
327 325 remote: KABOOM
328 326 remote: KABOOM IN PROCESS
329 327
330 328 #endif
331 329
332 330 clone bookmarks
333 331
334 332 $ hg -R ../remote bookmark test
335 333 $ hg -R ../remote bookmarks
336 334 * test 4:6c0482d977a3
337 335 $ hg clone ssh://user@dummy/remote local-bookmarks
338 336 requesting all changes
339 337 adding changesets
340 338 adding manifests
341 339 adding file changes
342 340 added 6 changesets with 5 changes to 4 files (+1 heads)
343 341 new changesets 1160648e36ce:1383141674ec
344 342 updating to branch default
345 343 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
346 344 $ hg -R local-bookmarks bookmarks
347 345 test 4:6c0482d977a3
348 346
349 347 passwords in ssh urls are not supported
350 348 (we use a glob here because different Python versions give different
351 349 results here)
352 350
353 351 $ hg push ssh://user:erroneouspwd@dummy/remote
354 352 pushing to ssh://user:*@dummy/remote (glob)
355 353 abort: password in URL not supported
356 354 [255]
357 355
358 356 $ cd $TESTTMP
359 357
360 358 hide outer repo
361 359 $ hg init
362 360
363 361 Test remote paths with spaces (issue2983):
364 362
365 363 $ hg init "ssh://user@dummy/a repo"
366 364 $ touch "$TESTTMP/a repo/test"
367 365 $ hg -R 'a repo' commit -A -m "test"
368 366 adding test
369 367 $ hg -R 'a repo' tag tag
370 368 $ hg id "ssh://user@dummy/a repo"
371 369 73649e48688a
372 370
373 371 $ hg id "ssh://user@dummy/a repo#noNoNO"
374 372 abort: unknown revision 'noNoNO'
375 373 [255]
376 374
377 375 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
378 376
379 377 $ hg clone "ssh://user@dummy/a repo"
380 378 destination directory: a repo
381 379 abort: destination 'a repo' is not empty
382 380 [10]
383 381
384 382 #if no-rhg
385 383 Make sure hg is really paranoid in serve --stdio mode. It used to be
386 384 possible to get a debugger REPL by specifying a repo named --debugger.
387 385 $ hg -R --debugger serve --stdio
388 386 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio']
389 387 [255]
390 388 $ hg -R --config=ui.debugger=yes serve --stdio
391 389 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio']
392 390 [255]
393 391 Abbreviations of 'serve' also don't work, to avoid shenanigans.
394 392 $ hg -R narf serv --stdio
395 393 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
396 394 [255]
397 395 #else
398 396 rhg aborts early on -R without a repository at that path
399 397 $ hg -R --debugger serve --stdio
400 398 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio'] (missing-correct-output !)
401 399 abort: repository --debugger not found (known-bad-output !)
402 400 [255]
403 401 $ hg -R --config=ui.debugger=yes serve --stdio
404 402 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio'] (missing-correct-output !)
405 403 abort: repository --config=ui.debugger=yes not found (known-bad-output !)
406 404 [255]
407 405 $ hg -R narf serv --stdio
408 406 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio'] (missing-correct-output !)
409 407 abort: repository narf not found (known-bad-output !)
410 408 [255]
411 409 If the repo does exist, rhg finds an unsupported command and falls back to Python
412 410 which still does the right thing
413 411 $ hg init narf
414 412 $ hg -R narf serv --stdio
415 413 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
416 414 [255]
417 415 #endif
418 416
419 417 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
420 418 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
421 419 parameters:
422 420
423 421 $ cat > ssh.sh << EOF
424 422 > userhost="\$1"
425 423 > SSH_ORIGINAL_COMMAND="\$2"
426 424 > export SSH_ORIGINAL_COMMAND
427 425 > PYTHONPATH="$PYTHONPATH"
428 426 > export PYTHONPATH
429 427 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
430 428 > EOF
431 429
432 430 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
433 431 73649e48688a
434 432
435 433 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
436 434 remote: Illegal repository "$TESTTMP/a'repo"
437 435 abort: no suitable response from remote hg
438 436 [255]
439 437
440 438 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
441 439 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
442 440 abort: no suitable response from remote hg
443 441 [255]
444 442
445 443 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
446 444 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
447 445 [255]
448 446
449 447 Test hg-ssh in read-only mode:
450 448
451 449 $ cat > ssh.sh << EOF
452 450 > userhost="\$1"
453 451 > SSH_ORIGINAL_COMMAND="\$2"
454 452 > export SSH_ORIGINAL_COMMAND
455 453 > PYTHONPATH="$PYTHONPATH"
456 454 > export PYTHONPATH
457 455 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
458 456 > EOF
459 457
460 458 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
461 459 requesting all changes
462 460 adding changesets
463 461 adding manifests
464 462 adding file changes
465 463 added 6 changesets with 5 changes to 4 files (+1 heads)
466 464 new changesets 1160648e36ce:1383141674ec
467 465 updating to branch default
468 466 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
469 467
470 468 $ cd read-only-local
471 469 $ echo "baz" > bar
472 470 $ hg ci -A -m "unpushable commit" bar
473 471 $ hg push --ssh "sh ../ssh.sh"
474 472 pushing to ssh://user@dummy/*/remote (glob)
475 473 searching for changes
476 474 remote: Permission denied
477 475 remote: pretxnopen.hg-ssh hook failed
478 476 abort: push failed on remote
479 477 [100]
480 478
481 479 $ cd $TESTTMP
482 480
483 481 stderr from remote commands should be printed before stdout from local code (issue4336)
484 482
485 483 $ hg clone remote stderr-ordering
486 484 updating to branch default
487 485 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 486 $ cd stderr-ordering
489 487 $ cat >> localwrite.py << EOF
490 488 > from mercurial import exchange, extensions
491 489 >
492 490 > def wrappedpush(orig, repo, *args, **kwargs):
493 491 > res = orig(repo, *args, **kwargs)
494 492 > repo.ui.write(b'local stdout\n')
495 493 > repo.ui.flush()
496 494 > return res
497 495 >
498 496 > def extsetup(ui):
499 497 > extensions.wrapfunction(exchange, b'push', wrappedpush)
500 498 > EOF
501 499
502 500 $ cat >> .hg/hgrc << EOF
503 501 > [paths]
504 502 > default-push = ssh://user@dummy/remote
505 503 > [extensions]
506 504 > localwrite = localwrite.py
507 505 > EOF
508 506
509 507 $ echo localwrite > foo
510 508 $ hg commit -m 'testing localwrite'
511 509 $ hg push
512 510 pushing to ssh://user@dummy/remote
513 511 searching for changes
514 512 remote: adding changesets
515 513 remote: adding manifests
516 514 remote: adding file changes
517 515 remote: added 1 changesets with 1 changes to 1 files (py3 !)
518 remote: added 1 changesets with 1 changes to 1 files (no-py3 no-chg !)
519 516 remote: KABOOM
520 517 remote: KABOOM IN PROCESS
521 remote: added 1 changesets with 1 changes to 1 files (no-py3 chg !)
522 518 local stdout
523 519
524 520 debug output
525 521
526 522 $ hg pull --debug ssh://user@dummy/remote --config devel.debug.peer-request=yes
527 523 pulling from ssh://user@dummy/remote
528 524 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
529 525 devel-peer-request: hello+between
530 526 devel-peer-request: pairs: 81 bytes
531 527 sending hello command
532 528 sending between command
533 529 remote: \d+ (re)
534 530 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
535 531 remote: 1
536 532 devel-peer-request: protocaps
537 533 devel-peer-request: caps: * bytes (glob)
538 534 sending protocaps command
539 535 query 1; heads
540 536 devel-peer-request: batched-content
541 537 devel-peer-request: - heads (0 arguments)
542 538 devel-peer-request: - known (1 arguments)
543 539 devel-peer-request: batch
544 540 devel-peer-request: cmds: 141 bytes
545 541 sending batch command
546 542 searching for changes
547 543 all remote heads known locally
548 544 no changes found
549 545 devel-peer-request: getbundle
550 546 devel-peer-request: bookmarks: 1 bytes
551 547 devel-peer-request: bundlecaps: 270 bytes
552 548 devel-peer-request: cg: 1 bytes
553 549 devel-peer-request: common: 122 bytes
554 550 devel-peer-request: heads: 122 bytes
555 551 devel-peer-request: listkeys: 9 bytes
556 552 devel-peer-request: phases: 1 bytes
557 553 sending getbundle command
558 554 bundle2-input-bundle: with-transaction
559 555 bundle2-input-part: "bookmarks" supported
560 556 bundle2-input-part: total payload size 26
561 557 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
562 558 bundle2-input-part: total payload size 45
563 559 bundle2-input-part: "phase-heads" supported
564 560 bundle2-input-part: total payload size 72
565 561 bundle2-input-bundle: 3 parts total
566 562 checking for updated bookmarks
567 563
568 564 $ cd $TESTTMP
569 565
570 566 $ cat dummylog
571 567 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
572 568 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
573 569 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
574 570 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
575 571 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !)
576 572 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
577 573 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
578 574 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
579 575 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
580 576 Got arguments 1:user@dummy 2:hg -R local serve --stdio
581 577 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
582 578 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
583 579 changegroup-in-remote hook: HG_BUNDLE2=1
584 580 HG_HOOKNAME=changegroup
585 581 HG_HOOKTYPE=changegroup
586 582 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
587 583 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
588 584 HG_SOURCE=serve
589 585 HG_TXNID=TXN:$ID$
590 586 HG_TXNNAME=serve
591 587 HG_URL=remote:ssh:$LOCALIP
592 588
593 589 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
594 590 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
595 591 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
596 592 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
597 593 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
598 594 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
599 595 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
600 596 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
601 597 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
602 598 changegroup-in-remote hook: HG_BUNDLE2=1
603 599 HG_HOOKNAME=changegroup
604 600 HG_HOOKTYPE=changegroup
605 601 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
606 602 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
607 603 HG_SOURCE=serve
608 604 HG_TXNID=TXN:$ID$
609 605 HG_TXNNAME=serve
610 606 HG_URL=remote:ssh:$LOCALIP
611 607
612 608 Got arguments 1:user@dummy 2:chg -R remote serve --stdio (chg !)
613 609 changegroup-in-remote hook: HG_BUNDLE2=1 (chg !)
614 610 HG_HOOKNAME=changegroup (chg !)
615 611 HG_HOOKTYPE=changegroup (chg !)
616 612 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
617 613 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
618 614 HG_SOURCE=serve (chg !)
619 615 HG_TXNID=TXN:$ID$ (chg !)
620 616 HG_TXNNAME=serve (chg !)
621 617 HG_URL=remote:ssh:$LOCALIP (chg !)
622 618 (chg !)
623 619 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
624 620 Got arguments 1:user@dummy 2:hg init 'a repo'
625 621 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
626 622 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
627 623 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
628 624 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
629 625 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
630 626 changegroup-in-remote hook: HG_BUNDLE2=1
631 627 HG_HOOKNAME=changegroup
632 628 HG_HOOKTYPE=changegroup
633 629 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
634 630 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
635 631 HG_SOURCE=serve
636 632 HG_TXNID=TXN:$ID$
637 633 HG_TXNNAME=serve
638 634 HG_URL=remote:ssh:$LOCALIP
639 635
640 636 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
641 637
642 638
643 639 remote hook failure is attributed to remote
644 640
645 641 $ cat > $TESTTMP/failhook << EOF
646 642 > def hook(ui, repo, **kwargs):
647 643 > ui.write(b'hook failure!\n')
648 644 > ui.flush()
649 645 > return 1
650 646 > EOF
651 647
652 648 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
653 649
654 650 $ hg -q clone ssh://user@dummy/remote hookout
655 651 $ cd hookout
656 652 $ touch hookfailure
657 653 $ hg -q commit -A -m 'remote hook failure'
658 654 $ hg push
659 655 pushing to ssh://user@dummy/remote
660 656 searching for changes
661 657 remote: adding changesets
662 658 remote: adding manifests
663 659 remote: adding file changes
664 660 remote: hook failure!
665 661 remote: transaction abort!
666 662 remote: rollback completed
667 663 remote: pretxnchangegroup.fail hook failed
668 664 abort: push failed on remote
669 665 [100]
670 666
671 667 abort during pull is properly reported as such
672 668
673 669 $ echo morefoo >> ../remote/foo
674 670 $ hg -R ../remote commit --message "more foo to be pulled"
675 671 $ cat >> ../remote/.hg/hgrc << EOF
676 672 > [extensions]
677 673 > crash = ${TESTDIR}/crashgetbundler.py
678 674 > EOF
679 675 $ hg pull
680 676 pulling from ssh://user@dummy/remote
681 677 searching for changes
682 678 remote: abort: this is an exercise
683 679 abort: pull failed on remote
684 680 [100]
685 681
686 682 abort with no error hint when there is a ssh problem when pulling
687 683
688 684 $ hg pull ssh://brokenrepository
689 685 pulling from ssh://brokenrepository/
690 686 abort: no suitable response from remote hg
691 687 [255]
692 688
693 689 abort with configured error hint when there is a ssh problem when pulling
694 690
695 691 $ hg pull ssh://brokenrepository \
696 692 > --config ui.ssherrorhint="Please see http://company/internalwiki/ssh.html"
697 693 pulling from ssh://brokenrepository/
698 694 abort: no suitable response from remote hg
699 695 (Please see http://company/internalwiki/ssh.html)
700 696 [255]
701 697
702 698 test that custom environment is passed down to ssh executable
703 699 $ cat >>dumpenv <<EOF
704 700 > #! /bin/sh
705 701 > echo \$VAR >&2
706 702 > EOF
707 703 $ chmod +x dumpenv
708 704 $ hg pull ssh://something --config ui.ssh="sh dumpenv"
709 705 pulling from ssh://something/
710 706 remote:
711 707 abort: no suitable response from remote hg
712 708 [255]
713 709 $ hg pull ssh://something --config ui.ssh="sh dumpenv" --config sshenv.VAR=17
714 710 pulling from ssh://something/
715 711 remote: 17
716 712 abort: no suitable response from remote hg
717 713 [255]
718 714
General Comments 0
You need to be logged in to leave comments. Login now