##// END OF EJS Templates
configitems: register the test 'failpush.reason' config
Boris Feld -
r34764:7c52a650 default
parent child Browse files
Show More
@@ -1,1144 +1,1153 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 > stabilization=createmarkers,exchange
19 19 > bundle2-output-capture=True
20 20 > [ui]
21 21 > ssh="$PYTHON" "$TESTDIR/dummyssh"
22 22 > logtemplate={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 added 8 changesets with 7 changes to 7 files (+3 heads)
51 51 pre-close-tip:02de42196ebe draft
52 52 new changesets cd010b8cd998:02de42196ebe
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 postclose-tip:02de42196ebe draft
68 68 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
69 69 $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c`
70 70 pre-close-tip:02de42196ebe draft
71 71 postclose-tip:02de42196ebe draft
72 72 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
73 73
74 74 clone --pull
75 75
76 76 $ hg -R main phase --public cd010b8cd998
77 77 pre-close-tip:02de42196ebe draft
78 78 postclose-tip:02de42196ebe draft
79 79 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
80 80 $ hg clone main other --pull --rev 9520eea781bc
81 81 adding changesets
82 82 adding manifests
83 83 adding file changes
84 84 added 2 changesets with 2 changes to 2 files
85 85 1 new obsolescence markers
86 86 pre-close-tip:9520eea781bc draft
87 87 new changesets cd010b8cd998:9520eea781bc
88 88 postclose-tip:9520eea781bc draft
89 89 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
90 90 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
91 91 updating to branch default
92 92 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 93 $ hg -R other log -G
94 94 @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
95 95 |
96 96 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
97 97
98 98 $ hg -R other debugobsolete
99 99 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
100 100
101 101 pull
102 102
103 103 $ hg -R main phase --public 9520eea781bc
104 104 pre-close-tip:02de42196ebe draft
105 105 postclose-tip:02de42196ebe draft
106 106 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
107 107 $ hg -R other pull -r 24b6387c8c8c
108 108 pulling from $TESTTMP/main (glob)
109 109 searching for changes
110 110 adding changesets
111 111 adding manifests
112 112 adding file changes
113 113 added 1 changesets with 1 changes to 1 files (+1 heads)
114 114 1 new obsolescence markers
115 115 pre-close-tip:24b6387c8c8c draft
116 116 new changesets 24b6387c8c8c
117 117 postclose-tip:24b6387c8c8c draft
118 118 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
119 119 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
120 120 (run 'hg heads' to see heads, 'hg merge' to merge)
121 121 $ hg -R other log -G
122 122 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
123 123 |
124 124 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
125 125 |/
126 126 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
127 127
128 128 $ hg -R other debugobsolete
129 129 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
130 130 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
131 131
132 132 pull empty (with phase movement)
133 133
134 134 $ hg -R main phase --public 24b6387c8c8c
135 135 pre-close-tip:02de42196ebe draft
136 136 postclose-tip:02de42196ebe draft
137 137 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
138 138 $ hg -R other pull -r 24b6387c8c8c
139 139 pulling from $TESTTMP/main (glob)
140 140 no changes found
141 141 pre-close-tip:24b6387c8c8c public
142 142 postclose-tip:24b6387c8c8c public
143 143 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
144 144 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
145 145 $ hg -R other log -G
146 146 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
147 147 |
148 148 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
149 149 |/
150 150 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
151 151
152 152 $ hg -R other debugobsolete
153 153 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
154 154 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
155 155
156 156 pull empty
157 157
158 158 $ hg -R other pull -r 24b6387c8c8c
159 159 pulling from $TESTTMP/main (glob)
160 160 no changes found
161 161 pre-close-tip:24b6387c8c8c public
162 162 postclose-tip:24b6387c8c8c public
163 163 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
164 164 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
165 165 $ hg -R other log -G
166 166 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
167 167 |
168 168 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
169 169 |/
170 170 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
171 171
172 172 $ hg -R other debugobsolete
173 173 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
174 174 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
175 175
176 176 add extra data to test their exchange during push
177 177
178 178 $ hg -R main bookmark --rev eea13746799a book_eea1
179 179 pre-close-tip:02de42196ebe draft
180 180 postclose-tip:02de42196ebe draft
181 181 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
182 182 $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a`
183 183 pre-close-tip:02de42196ebe draft
184 184 postclose-tip:02de42196ebe draft
185 185 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
186 186 $ hg -R main bookmark --rev 02de42196ebe book_02de
187 187 pre-close-tip:02de42196ebe draft book_02de
188 188 postclose-tip:02de42196ebe draft book_02de
189 189 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
190 190 $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe`
191 191 pre-close-tip:02de42196ebe draft book_02de
192 192 postclose-tip:02de42196ebe draft book_02de
193 193 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
194 194 $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc
195 195 pre-close-tip:02de42196ebe draft book_02de
196 196 postclose-tip:02de42196ebe draft book_02de
197 197 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
198 198 $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16`
199 199 pre-close-tip:02de42196ebe draft book_02de
200 200 postclose-tip:02de42196ebe draft book_02de
201 201 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
202 202 $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd
203 203 pre-close-tip:02de42196ebe draft book_02de
204 204 postclose-tip:02de42196ebe draft book_02de
205 205 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
206 206 $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8`
207 207 pre-close-tip:02de42196ebe draft book_02de
208 208 postclose-tip:02de42196ebe draft book_02de
209 209 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
210 210 $ hg -R main bookmark --rev 32af7686d403 book_32af
211 211 pre-close-tip:02de42196ebe draft book_02de
212 212 postclose-tip:02de42196ebe draft book_02de
213 213 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
214 214 $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403`
215 215 pre-close-tip:02de42196ebe draft book_02de
216 216 postclose-tip:02de42196ebe draft book_02de
217 217 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
218 218
219 219 $ hg -R other bookmark --rev cd010b8cd998 book_eea1
220 220 pre-close-tip:24b6387c8c8c public
221 221 postclose-tip:24b6387c8c8c public
222 222 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
223 223 $ hg -R other bookmark --rev cd010b8cd998 book_02de
224 224 pre-close-tip:24b6387c8c8c public
225 225 postclose-tip:24b6387c8c8c public
226 226 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
227 227 $ hg -R other bookmark --rev cd010b8cd998 book_42cc
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_5fdd
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_32af
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
240 240 $ hg -R main phase --public eea13746799a
241 241 pre-close-tip:02de42196ebe draft book_02de
242 242 postclose-tip:02de42196ebe draft book_02de
243 243 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
244 244
245 245 push
246 246 $ hg -R main push other --rev eea13746799a --bookmark book_eea1
247 247 pushing to other
248 248 searching for changes
249 249 remote: adding changesets
250 250 remote: adding manifests
251 251 remote: adding file changes
252 252 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
253 253 remote: 1 new obsolescence markers
254 254 remote: pre-close-tip:eea13746799a public book_eea1
255 255 remote: pushkey: lock state after "phases"
256 256 remote: lock: free
257 257 remote: wlock: free
258 258 remote: pushkey: lock state after "bookmarks"
259 259 remote: lock: free
260 260 remote: wlock: free
261 261 remote: postclose-tip:eea13746799a public book_eea1
262 262 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
263 263 updating bookmark book_eea1
264 264 pre-close-tip:02de42196ebe draft book_02de
265 265 postclose-tip:02de42196ebe draft book_02de
266 266 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
267 267 file:/*/$TESTTMP/other HG_URL=file:$TESTTMP/other (glob)
268 268 $ hg -R other log -G
269 269 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
270 270 |\
271 271 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
272 272 | |
273 273 @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
274 274 |/
275 275 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A
276 276
277 277 $ hg -R other debugobsolete
278 278 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
279 279 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
280 280 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
281 281
282 282 pull over ssh
283 283
284 284 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de
285 285 pulling from ssh://user@dummy/main
286 286 searching for changes
287 287 adding changesets
288 288 adding manifests
289 289 adding file changes
290 290 added 1 changesets with 1 changes to 1 files (+1 heads)
291 291 1 new obsolescence markers
292 292 updating bookmark book_02de
293 293 pre-close-tip:02de42196ebe draft book_02de
294 294 new changesets 02de42196ebe
295 295 postclose-tip:02de42196ebe draft book_02de
296 296 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
297 297 ssh://user@dummy/main HG_URL=ssh://user@dummy/main
298 298 (run 'hg heads' to see heads, 'hg merge' to merge)
299 299 $ hg -R other debugobsolete
300 300 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
301 301 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
302 302 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
303 303 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
304 304
305 305 pull over http
306 306
307 307 $ hg serve -R main -p $HGPORT -d --pid-file=main.pid -E main-error.log
308 308 $ cat main.pid >> $DAEMON_PIDS
309 309
310 310 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc
311 311 pulling from http://localhost:$HGPORT/
312 312 searching for changes
313 313 adding changesets
314 314 adding manifests
315 315 adding file changes
316 316 added 1 changesets with 1 changes to 1 files (+1 heads)
317 317 1 new obsolescence markers
318 318 updating bookmark book_42cc
319 319 pre-close-tip:42ccdea3bb16 draft book_42cc
320 320 new changesets 42ccdea3bb16
321 321 postclose-tip:42ccdea3bb16 draft book_42cc
322 322 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
323 323 http://localhost:$HGPORT/ HG_URL=http://localhost:$HGPORT/
324 324 (run 'hg heads .' to see heads, 'hg merge' to merge)
325 325 $ cat main-error.log
326 326 $ hg -R other debugobsolete
327 327 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
328 328 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
329 329 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
330 330 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
331 331 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
332 332
333 333 push over ssh
334 334
335 335 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd
336 336 pushing to ssh://user@dummy/other
337 337 searching for changes
338 338 remote: adding changesets
339 339 remote: adding manifests
340 340 remote: adding file changes
341 341 remote: added 1 changesets with 1 changes to 1 files
342 342 remote: 1 new obsolescence markers
343 343 remote: pre-close-tip:5fddd98957c8 draft book_5fdd
344 344 remote: pushkey: lock state after "bookmarks"
345 345 remote: lock: free
346 346 remote: wlock: free
347 347 remote: postclose-tip:5fddd98957c8 draft book_5fdd
348 348 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
349 349 updating bookmark book_5fdd
350 350 pre-close-tip:02de42196ebe draft book_02de
351 351 postclose-tip:02de42196ebe draft book_02de
352 352 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
353 353 ssh://user@dummy/other HG_URL=ssh://user@dummy/other
354 354 $ hg -R other log -G
355 355 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
356 356 |
357 357 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
358 358 |
359 359 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
360 360 | |
361 361 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
362 362 | |/|
363 363 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
364 364 |/ /
365 365 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
366 366 |/
367 367 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A
368 368
369 369 $ hg -R other debugobsolete
370 370 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
371 371 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
372 372 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
373 373 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
374 374 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
375 375 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
376 376
377 377 push over http
378 378
379 379 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
380 380 $ cat other.pid >> $DAEMON_PIDS
381 381
382 382 $ hg -R main phase --public 32af7686d403
383 383 pre-close-tip:02de42196ebe draft book_02de
384 384 postclose-tip:02de42196ebe draft book_02de
385 385 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
386 386 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
387 387 pushing to http://localhost:$HGPORT2/
388 388 searching for changes
389 389 remote: adding changesets
390 390 remote: adding manifests
391 391 remote: adding file changes
392 392 remote: added 1 changesets with 1 changes to 1 files
393 393 remote: 1 new obsolescence markers
394 394 remote: pre-close-tip:32af7686d403 public book_32af
395 395 remote: pushkey: lock state after "phases"
396 396 remote: lock: free
397 397 remote: wlock: free
398 398 remote: pushkey: lock state after "bookmarks"
399 399 remote: lock: free
400 400 remote: wlock: free
401 401 remote: postclose-tip:32af7686d403 public book_32af
402 402 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)
403 403 updating bookmark book_32af
404 404 pre-close-tip:02de42196ebe draft book_02de
405 405 postclose-tip:02de42196ebe draft book_02de
406 406 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
407 407 http://localhost:$HGPORT2/ HG_URL=http://localhost:$HGPORT2/
408 408 $ cat other-error.log
409 409
410 410 Check final content.
411 411
412 412 $ hg -R other log -G
413 413 o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D
414 414 |
415 415 o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
416 416 |
417 417 o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
418 418 |
419 419 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
420 420 | |
421 421 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
422 422 | |/|
423 423 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
424 424 |/ /
425 425 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
426 426 |/
427 427 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
428 428
429 429 $ hg -R other debugobsolete
430 430 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
431 431 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
432 432 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
433 433 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
434 434 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
435 435 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
436 436 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
437 437
438 438 (check that no 'pending' files remain)
439 439
440 440 $ ls -1 other/.hg/bookmarks*
441 441 other/.hg/bookmarks
442 442 $ ls -1 other/.hg/store/phaseroots*
443 443 other/.hg/store/phaseroots
444 444 $ ls -1 other/.hg/store/00changelog.i*
445 445 other/.hg/store/00changelog.i
446 446
447 447 Error Handling
448 448 ==============
449 449
450 450 Check that errors are properly returned to the client during push.
451 451
452 452 Setting up
453 453
454 454 $ cat > failpush.py << EOF
455 455 > """A small extension that makes push fails when using bundle2
456 456 >
457 457 > used to test error handling in bundle2
458 458 > """
459 459 >
460 460 > from mercurial import error
461 461 > from mercurial import bundle2
462 462 > from mercurial import exchange
463 463 > from mercurial import extensions
464 > from mercurial import registrar
465 > cmdtable = {}
466 > command = registrar.command(cmdtable)
467 >
468 > configtable = {}
469 > configitem = registrar.configitem(configtable)
470 > configitem('failpush', 'reason',
471 > default=None,
472 > )
464 473 >
465 474 > def _pushbundle2failpart(pushop, bundler):
466 > reason = pushop.ui.config('failpush', 'reason', None)
475 > reason = pushop.ui.config('failpush', 'reason')
467 476 > part = None
468 477 > if reason == 'abort':
469 478 > bundler.newpart('test:abort')
470 479 > if reason == 'unknown':
471 480 > bundler.newpart('test:unknown')
472 481 > if reason == 'race':
473 482 > # 20 Bytes of crap
474 483 > bundler.newpart('check:heads', data='01234567890123456789')
475 484 >
476 485 > @bundle2.parthandler("test:abort")
477 486 > def handleabort(op, part):
478 487 > raise error.Abort('Abandon ship!', hint="don't panic")
479 488 >
480 489 > def uisetup(ui):
481 490 > exchange.b2partsgenmapping['failpart'] = _pushbundle2failpart
482 491 > exchange.b2partsgenorder.insert(0, 'failpart')
483 492 >
484 493 > EOF
485 494
486 495 $ cd main
487 496 $ hg up tip
488 497 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
489 498 $ echo 'I' > I
490 499 $ hg add I
491 500 $ hg ci -m 'I'
492 501 pre-close-tip:e7ec4e813ba6 draft
493 502 postclose-tip:e7ec4e813ba6 draft
494 503 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
495 504 $ hg id
496 505 e7ec4e813ba6 tip
497 506 $ cd ..
498 507
499 508 $ cat << EOF >> $HGRCPATH
500 509 > [extensions]
501 510 > failpush=$TESTTMP/failpush.py
502 511 > EOF
503 512
504 513 $ killdaemons.py
505 514 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
506 515 $ cat other.pid >> $DAEMON_PIDS
507 516
508 517 Doing the actual push: Abort error
509 518
510 519 $ cat << EOF >> $HGRCPATH
511 520 > [failpush]
512 521 > reason = abort
513 522 > EOF
514 523
515 524 $ hg -R main push other -r e7ec4e813ba6
516 525 pushing to other
517 526 searching for changes
518 527 abort: Abandon ship!
519 528 (don't panic)
520 529 [255]
521 530
522 531 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
523 532 pushing to ssh://user@dummy/other
524 533 searching for changes
525 534 remote: Abandon ship!
526 535 remote: (don't panic)
527 536 abort: push failed on remote
528 537 [255]
529 538
530 539 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
531 540 pushing to http://localhost:$HGPORT2/
532 541 searching for changes
533 542 remote: Abandon ship!
534 543 remote: (don't panic)
535 544 abort: push failed on remote
536 545 [255]
537 546
538 547
539 548 Doing the actual push: unknown mandatory parts
540 549
541 550 $ cat << EOF >> $HGRCPATH
542 551 > [failpush]
543 552 > reason = unknown
544 553 > EOF
545 554
546 555 $ hg -R main push other -r e7ec4e813ba6
547 556 pushing to other
548 557 searching for changes
549 558 abort: missing support for test:unknown
550 559 [255]
551 560
552 561 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
553 562 pushing to ssh://user@dummy/other
554 563 searching for changes
555 564 abort: missing support for test:unknown
556 565 [255]
557 566
558 567 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
559 568 pushing to http://localhost:$HGPORT2/
560 569 searching for changes
561 570 abort: missing support for test:unknown
562 571 [255]
563 572
564 573 Doing the actual push: race
565 574
566 575 $ cat << EOF >> $HGRCPATH
567 576 > [failpush]
568 577 > reason = race
569 578 > EOF
570 579
571 580 $ hg -R main push other -r e7ec4e813ba6
572 581 pushing to other
573 582 searching for changes
574 583 abort: push failed:
575 584 'repository changed while pushing - please try again'
576 585 [255]
577 586
578 587 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
579 588 pushing to ssh://user@dummy/other
580 589 searching for changes
581 590 abort: push failed:
582 591 'repository changed while pushing - please try again'
583 592 [255]
584 593
585 594 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
586 595 pushing to http://localhost:$HGPORT2/
587 596 searching for changes
588 597 abort: push failed:
589 598 'repository changed while pushing - please try again'
590 599 [255]
591 600
592 601 Doing the actual push: hook abort
593 602
594 603 $ cat << EOF >> $HGRCPATH
595 604 > [failpush]
596 605 > reason =
597 606 > [hooks]
598 607 > pretxnclose.failpush = sh -c "echo 'You shall not pass!'; false"
599 608 > txnabort.failpush = sh -c "echo 'Cleaning up the mess...'"
600 609 > EOF
601 610
602 611 $ killdaemons.py
603 612 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
604 613 $ cat other.pid >> $DAEMON_PIDS
605 614
606 615 $ hg -R main push other -r e7ec4e813ba6
607 616 pushing to other
608 617 searching for changes
609 618 remote: adding changesets
610 619 remote: adding manifests
611 620 remote: adding file changes
612 621 remote: added 1 changesets with 1 changes to 1 files
613 622 remote: pre-close-tip:e7ec4e813ba6 draft
614 623 remote: You shall not pass!
615 624 remote: transaction abort!
616 625 remote: Cleaning up the mess...
617 626 remote: rollback completed
618 627 abort: pretxnclose.failpush hook exited with status 1
619 628 [255]
620 629
621 630 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
622 631 pushing to ssh://user@dummy/other
623 632 searching for changes
624 633 remote: adding changesets
625 634 remote: adding manifests
626 635 remote: adding file changes
627 636 remote: added 1 changesets with 1 changes to 1 files
628 637 remote: pre-close-tip:e7ec4e813ba6 draft
629 638 remote: You shall not pass!
630 639 remote: transaction abort!
631 640 remote: Cleaning up the mess...
632 641 remote: rollback completed
633 642 remote: pretxnclose.failpush hook exited with status 1
634 643 abort: push failed on remote
635 644 [255]
636 645
637 646 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
638 647 pushing to http://localhost:$HGPORT2/
639 648 searching for changes
640 649 remote: adding changesets
641 650 remote: adding manifests
642 651 remote: adding file changes
643 652 remote: added 1 changesets with 1 changes to 1 files
644 653 remote: pre-close-tip:e7ec4e813ba6 draft
645 654 remote: You shall not pass!
646 655 remote: transaction abort!
647 656 remote: Cleaning up the mess...
648 657 remote: rollback completed
649 658 remote: pretxnclose.failpush hook exited with status 1
650 659 abort: push failed on remote
651 660 [255]
652 661
653 662 (check that no 'pending' files remain)
654 663
655 664 $ ls -1 other/.hg/bookmarks*
656 665 other/.hg/bookmarks
657 666 $ ls -1 other/.hg/store/phaseroots*
658 667 other/.hg/store/phaseroots
659 668 $ ls -1 other/.hg/store/00changelog.i*
660 669 other/.hg/store/00changelog.i
661 670
662 671 Check error from hook during the unbundling process itself
663 672
664 673 $ cat << EOF >> $HGRCPATH
665 674 > pretxnchangegroup = sh -c "echo 'Fail early!'; false"
666 675 > EOF
667 676 $ killdaemons.py # reload http config
668 677 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
669 678 $ cat other.pid >> $DAEMON_PIDS
670 679
671 680 $ hg -R main push other -r e7ec4e813ba6
672 681 pushing to other
673 682 searching for changes
674 683 remote: adding changesets
675 684 remote: adding manifests
676 685 remote: adding file changes
677 686 remote: added 1 changesets with 1 changes to 1 files
678 687 remote: Fail early!
679 688 remote: transaction abort!
680 689 remote: Cleaning up the mess...
681 690 remote: rollback completed
682 691 abort: pretxnchangegroup hook exited with status 1
683 692 [255]
684 693 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
685 694 pushing to ssh://user@dummy/other
686 695 searching for changes
687 696 remote: adding changesets
688 697 remote: adding manifests
689 698 remote: adding file changes
690 699 remote: added 1 changesets with 1 changes to 1 files
691 700 remote: Fail early!
692 701 remote: transaction abort!
693 702 remote: Cleaning up the mess...
694 703 remote: rollback completed
695 704 remote: pretxnchangegroup hook exited with status 1
696 705 abort: push failed on remote
697 706 [255]
698 707 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
699 708 pushing to http://localhost:$HGPORT2/
700 709 searching for changes
701 710 remote: adding changesets
702 711 remote: adding manifests
703 712 remote: adding file changes
704 713 remote: added 1 changesets with 1 changes to 1 files
705 714 remote: Fail early!
706 715 remote: transaction abort!
707 716 remote: Cleaning up the mess...
708 717 remote: rollback completed
709 718 remote: pretxnchangegroup hook exited with status 1
710 719 abort: push failed on remote
711 720 [255]
712 721
713 722 Check output capture control.
714 723
715 724 (should be still forced for http, disabled for local and ssh)
716 725
717 726 $ cat >> $HGRCPATH << EOF
718 727 > [experimental]
719 728 > bundle2-output-capture=False
720 729 > EOF
721 730
722 731 $ hg -R main push other -r e7ec4e813ba6
723 732 pushing to other
724 733 searching for changes
725 734 adding changesets
726 735 adding manifests
727 736 adding file changes
728 737 added 1 changesets with 1 changes to 1 files
729 738 Fail early!
730 739 transaction abort!
731 740 Cleaning up the mess...
732 741 rollback completed
733 742 abort: pretxnchangegroup hook exited with status 1
734 743 [255]
735 744 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
736 745 pushing to ssh://user@dummy/other
737 746 searching for changes
738 747 remote: adding changesets
739 748 remote: adding manifests
740 749 remote: adding file changes
741 750 remote: added 1 changesets with 1 changes to 1 files
742 751 remote: Fail early!
743 752 remote: transaction abort!
744 753 remote: Cleaning up the mess...
745 754 remote: rollback completed
746 755 remote: pretxnchangegroup hook exited with status 1
747 756 abort: push failed on remote
748 757 [255]
749 758 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
750 759 pushing to http://localhost:$HGPORT2/
751 760 searching for changes
752 761 remote: adding changesets
753 762 remote: adding manifests
754 763 remote: adding file changes
755 764 remote: added 1 changesets with 1 changes to 1 files
756 765 remote: Fail early!
757 766 remote: transaction abort!
758 767 remote: Cleaning up the mess...
759 768 remote: rollback completed
760 769 remote: pretxnchangegroup hook exited with status 1
761 770 abort: push failed on remote
762 771 [255]
763 772
764 773 Check abort from mandatory pushkey
765 774
766 775 $ cat > mandatorypart.py << EOF
767 776 > from mercurial import exchange
768 777 > from mercurial import pushkey
769 778 > from mercurial import node
770 779 > from mercurial import error
771 780 > @exchange.b2partsgenerator('failingpuskey')
772 781 > def addfailingpushey(pushop, bundler):
773 782 > enc = pushkey.encode
774 783 > part = bundler.newpart('pushkey')
775 784 > part.addparam('namespace', enc('phases'))
776 785 > part.addparam('key', enc(pushop.repo['cd010b8cd998'].hex()))
777 786 > part.addparam('old', enc(str(0))) # successful update
778 787 > part.addparam('new', enc(str(0)))
779 788 > def fail(pushop, exc):
780 789 > raise error.Abort('Correct phase push failed (because hooks)')
781 790 > pushop.pkfailcb[part.id] = fail
782 791 > EOF
783 792 $ cat >> $HGRCPATH << EOF
784 793 > [hooks]
785 794 > pretxnchangegroup=
786 795 > pretxnclose.failpush=
787 796 > prepushkey.failpush = sh -c "echo 'do not push the key !'; false"
788 797 > [extensions]
789 798 > mandatorypart=$TESTTMP/mandatorypart.py
790 799 > EOF
791 800 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
792 801 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
793 802 $ cat other.pid >> $DAEMON_PIDS
794 803
795 804 (Failure from a hook)
796 805
797 806 $ hg -R main push other -r e7ec4e813ba6
798 807 pushing to other
799 808 searching for changes
800 809 adding changesets
801 810 adding manifests
802 811 adding file changes
803 812 added 1 changesets with 1 changes to 1 files
804 813 do not push the key !
805 814 pushkey-abort: prepushkey.failpush hook exited with status 1
806 815 transaction abort!
807 816 Cleaning up the mess...
808 817 rollback completed
809 818 abort: Correct phase push failed (because hooks)
810 819 [255]
811 820 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
812 821 pushing to ssh://user@dummy/other
813 822 searching for changes
814 823 remote: adding changesets
815 824 remote: adding manifests
816 825 remote: adding file changes
817 826 remote: added 1 changesets with 1 changes to 1 files
818 827 remote: do not push the key !
819 828 remote: pushkey-abort: prepushkey.failpush hook exited with status 1
820 829 remote: transaction abort!
821 830 remote: Cleaning up the mess...
822 831 remote: rollback completed
823 832 abort: Correct phase push failed (because hooks)
824 833 [255]
825 834 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
826 835 pushing to http://localhost:$HGPORT2/
827 836 searching for changes
828 837 remote: adding changesets
829 838 remote: adding manifests
830 839 remote: adding file changes
831 840 remote: added 1 changesets with 1 changes to 1 files
832 841 remote: do not push the key !
833 842 remote: pushkey-abort: prepushkey.failpush hook exited with status 1
834 843 remote: transaction abort!
835 844 remote: Cleaning up the mess...
836 845 remote: rollback completed
837 846 abort: Correct phase push failed (because hooks)
838 847 [255]
839 848
840 849 (Failure from a the pushkey)
841 850
842 851 $ cat > mandatorypart.py << EOF
843 852 > from mercurial import exchange
844 853 > from mercurial import pushkey
845 854 > from mercurial import node
846 855 > from mercurial import error
847 856 > @exchange.b2partsgenerator('failingpuskey')
848 857 > def addfailingpushey(pushop, bundler):
849 858 > enc = pushkey.encode
850 859 > part = bundler.newpart('pushkey')
851 860 > part.addparam('namespace', enc('phases'))
852 861 > part.addparam('key', enc(pushop.repo['cd010b8cd998'].hex()))
853 862 > part.addparam('old', enc(str(4))) # will fail
854 863 > part.addparam('new', enc(str(3)))
855 864 > def fail(pushop, exc):
856 865 > raise error.Abort('Clown phase push failed')
857 866 > pushop.pkfailcb[part.id] = fail
858 867 > EOF
859 868 $ cat >> $HGRCPATH << EOF
860 869 > [hooks]
861 870 > prepushkey.failpush =
862 871 > EOF
863 872 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
864 873 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
865 874 $ cat other.pid >> $DAEMON_PIDS
866 875
867 876 $ hg -R main push other -r e7ec4e813ba6
868 877 pushing to other
869 878 searching for changes
870 879 adding changesets
871 880 adding manifests
872 881 adding file changes
873 882 added 1 changesets with 1 changes to 1 files
874 883 transaction abort!
875 884 Cleaning up the mess...
876 885 rollback completed
877 886 pushkey: lock state after "phases"
878 887 lock: free
879 888 wlock: free
880 889 abort: Clown phase push failed
881 890 [255]
882 891 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
883 892 pushing to ssh://user@dummy/other
884 893 searching for changes
885 894 remote: adding changesets
886 895 remote: adding manifests
887 896 remote: adding file changes
888 897 remote: added 1 changesets with 1 changes to 1 files
889 898 remote: transaction abort!
890 899 remote: Cleaning up the mess...
891 900 remote: rollback completed
892 901 remote: pushkey: lock state after "phases"
893 902 remote: lock: free
894 903 remote: wlock: free
895 904 abort: Clown phase push failed
896 905 [255]
897 906 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
898 907 pushing to http://localhost:$HGPORT2/
899 908 searching for changes
900 909 remote: adding changesets
901 910 remote: adding manifests
902 911 remote: adding file changes
903 912 remote: added 1 changesets with 1 changes to 1 files
904 913 remote: transaction abort!
905 914 remote: Cleaning up the mess...
906 915 remote: rollback completed
907 916 remote: pushkey: lock state after "phases"
908 917 remote: lock: free
909 918 remote: wlock: free
910 919 abort: Clown phase push failed
911 920 [255]
912 921
913 922 Test lazily acquiring the lock during unbundle
914 923 $ cp $TESTTMP/hgrc.orig $HGRCPATH
915 924 $ cat >> $HGRCPATH <<EOF
916 925 > [ui]
917 926 > ssh="$PYTHON" "$TESTDIR/dummyssh"
918 927 > EOF
919 928
920 929 $ cat >> $TESTTMP/locktester.py <<EOF
921 930 > import os
922 931 > from mercurial import extensions, bundle2, util
923 932 > def checklock(orig, repo, *args, **kwargs):
924 933 > if repo.svfs.lexists("lock"):
925 934 > raise util.Abort("Lock should not be taken")
926 935 > return orig(repo, *args, **kwargs)
927 936 > def extsetup(ui):
928 937 > extensions.wrapfunction(bundle2, 'processbundle', checklock)
929 938 > EOF
930 939
931 940 $ hg init lazylock
932 941 $ cat >> lazylock/.hg/hgrc <<EOF
933 942 > [extensions]
934 943 > locktester=$TESTTMP/locktester.py
935 944 > EOF
936 945
937 946 $ hg clone -q ssh://user@dummy/lazylock lazylockclient
938 947 $ cd lazylockclient
939 948 $ touch a && hg ci -Aqm a
940 949 $ hg push
941 950 pushing to ssh://user@dummy/lazylock
942 951 searching for changes
943 952 remote: Lock should not be taken
944 953 abort: push failed on remote
945 954 [255]
946 955
947 956 $ cat >> ../lazylock/.hg/hgrc <<EOF
948 957 > [experimental]
949 958 > bundle2lazylocking=True
950 959 > EOF
951 960 $ hg push
952 961 pushing to ssh://user@dummy/lazylock
953 962 searching for changes
954 963 remote: adding changesets
955 964 remote: adding manifests
956 965 remote: adding file changes
957 966 remote: added 1 changesets with 1 changes to 1 files
958 967
959 968 $ cd ..
960 969
961 970 Servers can disable bundle1 for clone/pull operations
962 971
963 972 $ killdaemons.py
964 973 $ hg init bundle2onlyserver
965 974 $ cd bundle2onlyserver
966 975 $ cat > .hg/hgrc << EOF
967 976 > [server]
968 977 > bundle1.pull = false
969 978 > EOF
970 979
971 980 $ touch foo
972 981 $ hg -q commit -A -m initial
973 982
974 983 $ hg serve -p $HGPORT -d --pid-file=hg.pid
975 984 $ cat hg.pid >> $DAEMON_PIDS
976 985
977 986 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
978 987 requesting all changes
979 988 abort: remote error:
980 989 incompatible Mercurial client; bundle2 required
981 990 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
982 991 [255]
983 992 $ killdaemons.py
984 993 $ cd ..
985 994
986 995 bundle1 can still pull non-generaldelta repos when generaldelta bundle1 disabled
987 996
988 997 $ hg --config format.usegeneraldelta=false init notgdserver
989 998 $ cd notgdserver
990 999 $ cat > .hg/hgrc << EOF
991 1000 > [server]
992 1001 > bundle1gd.pull = false
993 1002 > EOF
994 1003
995 1004 $ touch foo
996 1005 $ hg -q commit -A -m initial
997 1006 $ hg serve -p $HGPORT -d --pid-file=hg.pid
998 1007 $ cat hg.pid >> $DAEMON_PIDS
999 1008
1000 1009 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-1
1001 1010 requesting all changes
1002 1011 adding changesets
1003 1012 adding manifests
1004 1013 adding file changes
1005 1014 added 1 changesets with 1 changes to 1 files
1006 1015 new changesets 96ee1d7354c4
1007 1016 updating to branch default
1008 1017 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1009 1018
1010 1019 $ killdaemons.py
1011 1020 $ cd ../bundle2onlyserver
1012 1021
1013 1022 bundle1 pull can be disabled for generaldelta repos only
1014 1023
1015 1024 $ cat > .hg/hgrc << EOF
1016 1025 > [server]
1017 1026 > bundle1gd.pull = false
1018 1027 > EOF
1019 1028
1020 1029 $ hg serve -p $HGPORT -d --pid-file=hg.pid
1021 1030 $ cat hg.pid >> $DAEMON_PIDS
1022 1031 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
1023 1032 requesting all changes
1024 1033 abort: remote error:
1025 1034 incompatible Mercurial client; bundle2 required
1026 1035 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1027 1036 [255]
1028 1037
1029 1038 $ killdaemons.py
1030 1039
1031 1040 Verify the global server.bundle1 option works
1032 1041
1033 1042 $ cd ..
1034 1043 $ cat > bundle2onlyserver/.hg/hgrc << EOF
1035 1044 > [server]
1036 1045 > bundle1 = false
1037 1046 > EOF
1038 1047 $ hg serve -R bundle2onlyserver -p $HGPORT -d --pid-file=hg.pid
1039 1048 $ cat hg.pid >> $DAEMON_PIDS
1040 1049 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT not-bundle2
1041 1050 requesting all changes
1042 1051 abort: remote error:
1043 1052 incompatible Mercurial client; bundle2 required
1044 1053 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1045 1054 [255]
1046 1055 $ killdaemons.py
1047 1056
1048 1057 $ hg --config devel.legacy.exchange=bundle1 clone ssh://user@dummy/bundle2onlyserver not-bundle2-ssh
1049 1058 requesting all changes
1050 1059 adding changesets
1051 1060 remote: abort: incompatible Mercurial client; bundle2 required
1052 1061 remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1053 1062 transaction abort!
1054 1063 rollback completed
1055 1064 abort: stream ended unexpectedly (got 0 bytes, expected 4)
1056 1065 [255]
1057 1066
1058 1067 $ cat > bundle2onlyserver/.hg/hgrc << EOF
1059 1068 > [server]
1060 1069 > bundle1gd = false
1061 1070 > EOF
1062 1071 $ hg serve -R bundle2onlyserver -p $HGPORT -d --pid-file=hg.pid
1063 1072 $ cat hg.pid >> $DAEMON_PIDS
1064 1073
1065 1074 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
1066 1075 requesting all changes
1067 1076 abort: remote error:
1068 1077 incompatible Mercurial client; bundle2 required
1069 1078 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1070 1079 [255]
1071 1080
1072 1081 $ killdaemons.py
1073 1082
1074 1083 $ cd notgdserver
1075 1084 $ cat > .hg/hgrc << EOF
1076 1085 > [server]
1077 1086 > bundle1gd = false
1078 1087 > EOF
1079 1088 $ hg serve -p $HGPORT -d --pid-file=hg.pid
1080 1089 $ cat hg.pid >> $DAEMON_PIDS
1081 1090
1082 1091 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-2
1083 1092 requesting all changes
1084 1093 adding changesets
1085 1094 adding manifests
1086 1095 adding file changes
1087 1096 added 1 changesets with 1 changes to 1 files
1088 1097 new changesets 96ee1d7354c4
1089 1098 updating to branch default
1090 1099 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1091 1100
1092 1101 $ killdaemons.py
1093 1102 $ cd ../bundle2onlyserver
1094 1103
1095 1104 Verify bundle1 pushes can be disabled
1096 1105
1097 1106 $ cat > .hg/hgrc << EOF
1098 1107 > [server]
1099 1108 > bundle1.push = false
1100 1109 > [web]
1101 1110 > allow_push = *
1102 1111 > push_ssl = false
1103 1112 > EOF
1104 1113
1105 1114 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E error.log
1106 1115 $ cat hg.pid >> $DAEMON_PIDS
1107 1116 $ cd ..
1108 1117
1109 1118 $ hg clone http://localhost:$HGPORT bundle2-only
1110 1119 requesting all changes
1111 1120 adding changesets
1112 1121 adding manifests
1113 1122 adding file changes
1114 1123 added 1 changesets with 1 changes to 1 files
1115 1124 new changesets 96ee1d7354c4
1116 1125 updating to branch default
1117 1126 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1118 1127 $ cd bundle2-only
1119 1128 $ echo commit > foo
1120 1129 $ hg commit -m commit
1121 1130 $ hg --config devel.legacy.exchange=bundle1 push
1122 1131 pushing to http://localhost:$HGPORT/
1123 1132 searching for changes
1124 1133 abort: remote error:
1125 1134 incompatible Mercurial client; bundle2 required
1126 1135 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1127 1136 [255]
1128 1137
1129 1138 (also check with ssh)
1130 1139
1131 1140 $ hg --config devel.legacy.exchange=bundle1 push ssh://user@dummy/bundle2onlyserver
1132 1141 pushing to ssh://user@dummy/bundle2onlyserver
1133 1142 searching for changes
1134 1143 remote: abort: incompatible Mercurial client; bundle2 required
1135 1144 remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1136 1145 [1]
1137 1146
1138 1147 $ hg push
1139 1148 pushing to http://localhost:$HGPORT/
1140 1149 searching for changes
1141 1150 remote: adding changesets
1142 1151 remote: adding manifests
1143 1152 remote: adding file changes
1144 1153 remote: added 1 changesets with 1 changes to 1 files
General Comments 0
You need to be logged in to leave comments. Login now