Show More
@@ -1,470 +1,474 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 | $ cat > obs.py << EOF |
|
11 | 11 | > import mercurial.obsolete |
|
12 | 12 | > mercurial.obsolete._enabled = True |
|
13 | 13 | > EOF |
|
14 | 14 | |
|
15 | 15 | $ cat >> $HGRCPATH << EOF |
|
16 | 16 | > [extensions] |
|
17 | 17 | > obsolete=$TESTTMP/obs.py |
|
18 | 18 | > [experimental] |
|
19 | 19 | > bundle2-exp=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 | > [hooks] | |
|
29 | > b2x-transactionclose = sh -c "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" b2x-transactionclose" | |
|
28 | 30 | > EOF |
|
29 | 31 | |
|
30 | 32 | The extension requires a repo (currently unused) |
|
31 | 33 | |
|
32 | 34 | $ hg init main |
|
33 | 35 | $ cd main |
|
34 | 36 | $ touch a |
|
35 | 37 | $ hg add a |
|
36 | 38 | $ hg commit -m 'a' |
|
37 | 39 | |
|
38 | 40 | $ hg unbundle $TESTDIR/bundles/rebase.hg |
|
39 | 41 | adding changesets |
|
40 | 42 | adding manifests |
|
41 | 43 | adding file changes |
|
42 | 44 | added 8 changesets with 7 changes to 7 files (+3 heads) |
|
43 | 45 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
44 | 46 | |
|
45 | 47 | $ cd .. |
|
46 | 48 | |
|
47 | 49 | Real world exchange |
|
48 | 50 | ===================== |
|
49 | 51 | |
|
50 | 52 | Add more obsolescence information |
|
51 | 53 | |
|
52 | 54 | $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc` |
|
53 | 55 | $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c` |
|
54 | 56 | |
|
55 | 57 | clone --pull |
|
56 | 58 | |
|
57 | 59 | $ hg -R main phase --public cd010b8cd998 |
|
58 | 60 | $ hg clone main other --pull --rev 9520eea781bc |
|
59 | 61 | adding changesets |
|
60 | 62 | adding manifests |
|
61 | 63 | adding file changes |
|
62 | 64 | added 2 changesets with 2 changes to 2 files |
|
63 | 65 | 1 new obsolescence markers |
|
64 | 66 | updating to branch default |
|
65 | 67 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
66 | 68 | $ hg -R other log -G |
|
67 | 69 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
68 | 70 | | |
|
69 | 71 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
70 | 72 | |
|
71 | 73 | $ hg -R other debugobsolete |
|
72 | 74 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
73 | 75 | |
|
74 | 76 | pull |
|
75 | 77 | |
|
76 | 78 | $ hg -R main phase --public 9520eea781bc |
|
77 | 79 | $ hg -R other pull -r 24b6387c8c8c |
|
78 | 80 | pulling from $TESTTMP/main (glob) |
|
79 | 81 | searching for changes |
|
80 | 82 | adding changesets |
|
81 | 83 | adding manifests |
|
82 | 84 | adding file changes |
|
83 | 85 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
84 | 86 | 1 new obsolescence markers |
|
85 | 87 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
86 | 88 | $ hg -R other log -G |
|
87 | 89 | o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
88 | 90 | | |
|
89 | 91 | | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
90 | 92 | |/ |
|
91 | 93 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
92 | 94 | |
|
93 | 95 | $ hg -R other debugobsolete |
|
94 | 96 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
95 | 97 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
96 | 98 | |
|
97 | 99 | pull empty (with phase movement) |
|
98 | 100 | |
|
99 | 101 | $ hg -R main phase --public 24b6387c8c8c |
|
100 | 102 | $ hg -R other pull -r 24b6387c8c8c |
|
101 | 103 | pulling from $TESTTMP/main (glob) |
|
102 | 104 | no changes found |
|
103 | 105 | $ hg -R other log -G |
|
104 | 106 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
105 | 107 | | |
|
106 | 108 | | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
107 | 109 | |/ |
|
108 | 110 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
109 | 111 | |
|
110 | 112 | $ hg -R other debugobsolete |
|
111 | 113 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
112 | 114 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
113 | 115 | |
|
114 | 116 | pull empty |
|
115 | 117 | |
|
116 | 118 | $ hg -R other pull -r 24b6387c8c8c |
|
117 | 119 | pulling from $TESTTMP/main (glob) |
|
118 | 120 | no changes found |
|
119 | 121 | $ hg -R other log -G |
|
120 | 122 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
121 | 123 | | |
|
122 | 124 | | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
123 | 125 | |/ |
|
124 | 126 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
125 | 127 | |
|
126 | 128 | $ hg -R other debugobsolete |
|
127 | 129 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
128 | 130 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
129 | 131 | |
|
130 | 132 | add extra data to test their exchange during push |
|
131 | 133 | |
|
132 | 134 | $ hg -R main bookmark --rev eea13746799a book_eea1 |
|
133 | 135 | $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a` |
|
134 | 136 | $ hg -R main bookmark --rev 02de42196ebe book_02de |
|
135 | 137 | $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe` |
|
136 | 138 | $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc |
|
137 | 139 | $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16` |
|
138 | 140 | $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd |
|
139 | 141 | $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8` |
|
140 | 142 | $ hg -R main bookmark --rev 32af7686d403 book_32af |
|
141 | 143 | $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403` |
|
142 | 144 | |
|
143 | 145 | $ hg -R other bookmark --rev cd010b8cd998 book_eea1 |
|
144 | 146 | $ hg -R other bookmark --rev cd010b8cd998 book_02de |
|
145 | 147 | $ hg -R other bookmark --rev cd010b8cd998 book_42cc |
|
146 | 148 | $ hg -R other bookmark --rev cd010b8cd998 book_5fdd |
|
147 | 149 | $ hg -R other bookmark --rev cd010b8cd998 book_32af |
|
148 | 150 | |
|
149 | 151 | $ hg -R main phase --public eea13746799a |
|
150 | 152 | |
|
151 | 153 | push |
|
152 | 154 | $ hg -R main push other --rev eea13746799a --bookmark book_eea1 |
|
153 | 155 | pushing to other |
|
154 | 156 | searching for changes |
|
157 | b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=push HG_URL=push | |
|
155 | 158 | remote: adding changesets |
|
156 | 159 | remote: adding manifests |
|
157 | 160 | remote: adding file changes |
|
158 | 161 | remote: added 1 changesets with 0 changes to 0 files (-1 heads) |
|
159 | 162 | remote: 1 new obsolescence markers |
|
160 | 163 | updating bookmark book_eea1 |
|
161 | 164 | $ hg -R other log -G |
|
162 | 165 | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G |
|
163 | 166 | |\ |
|
164 | 167 | | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
165 | 168 | | | |
|
166 | 169 | @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
167 | 170 | |/ |
|
168 | 171 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A |
|
169 | 172 | |
|
170 | 173 | $ hg -R other debugobsolete |
|
171 | 174 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
172 | 175 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
173 | 176 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
174 | 177 | |
|
175 | 178 | pull over ssh |
|
176 | 179 | |
|
177 | 180 | $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de |
|
178 | 181 | pulling from ssh://user@dummy/main |
|
179 | 182 | searching for changes |
|
180 | 183 | adding changesets |
|
181 | 184 | adding manifests |
|
182 | 185 | adding file changes |
|
183 | 186 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
184 | 187 | 1 new obsolescence markers |
|
185 | 188 | updating bookmark book_02de |
|
186 | 189 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
187 | 190 | $ hg -R other debugobsolete |
|
188 | 191 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
189 | 192 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
190 | 193 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
191 | 194 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
192 | 195 | |
|
193 | 196 | pull over http |
|
194 | 197 | |
|
195 | 198 | $ hg -R main serve -p $HGPORT -d --pid-file=main.pid -E main-error.log |
|
196 | 199 | $ cat main.pid >> $DAEMON_PIDS |
|
197 | 200 | |
|
198 | 201 | $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc |
|
199 | 202 | pulling from http://localhost:$HGPORT/ |
|
200 | 203 | searching for changes |
|
201 | 204 | adding changesets |
|
202 | 205 | adding manifests |
|
203 | 206 | adding file changes |
|
204 | 207 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
205 | 208 | 1 new obsolescence markers |
|
206 | 209 | updating bookmark book_42cc |
|
207 | 210 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
208 | 211 | $ cat main-error.log |
|
209 | 212 | $ hg -R other debugobsolete |
|
210 | 213 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
211 | 214 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
212 | 215 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
213 | 216 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
214 | 217 | 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
215 | 218 | |
|
216 | 219 | push over ssh |
|
217 | 220 | |
|
218 | 221 | $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd |
|
219 | 222 | pushing to ssh://user@dummy/other |
|
220 | 223 | searching for changes |
|
221 | 224 | remote: adding changesets |
|
222 | 225 | remote: adding manifests |
|
223 | 226 | remote: adding file changes |
|
224 | 227 | remote: added 1 changesets with 1 changes to 1 files |
|
225 | 228 | remote: 1 new obsolescence markers |
|
226 | 229 | updating bookmark book_5fdd |
|
230 | remote: b2x-transactionclose hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 | |
|
227 | 231 | $ hg -R other log -G |
|
228 | 232 | o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C |
|
229 | 233 | | |
|
230 | 234 | o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B |
|
231 | 235 | | |
|
232 | 236 | | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H |
|
233 | 237 | | | |
|
234 | 238 | | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G |
|
235 | 239 | | |/| |
|
236 | 240 | | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
237 | 241 | |/ / |
|
238 | 242 | | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
239 | 243 | |/ |
|
240 | 244 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A |
|
241 | 245 | |
|
242 | 246 | $ hg -R other debugobsolete |
|
243 | 247 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
244 | 248 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
245 | 249 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
246 | 250 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
247 | 251 | 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
248 | 252 | 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
249 | 253 | |
|
250 | 254 | push over http |
|
251 | 255 | |
|
252 | 256 | $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log |
|
253 | 257 | $ cat other.pid >> $DAEMON_PIDS |
|
254 | 258 | |
|
255 | 259 | $ hg -R main phase --public 32af7686d403 |
|
256 | 260 | $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af |
|
257 | 261 | pushing to http://localhost:$HGPORT2/ |
|
258 | 262 | searching for changes |
|
259 | 263 | remote: adding changesets |
|
260 | 264 | remote: adding manifests |
|
261 | 265 | remote: adding file changes |
|
262 | 266 | remote: added 1 changesets with 1 changes to 1 files |
|
263 | 267 | remote: 1 new obsolescence markers |
|
264 | 268 | updating bookmark book_32af |
|
265 | 269 | $ cat other-error.log |
|
266 | 270 | |
|
267 | 271 | Check final content. |
|
268 | 272 | |
|
269 | 273 | $ hg -R other log -G |
|
270 | 274 | o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D |
|
271 | 275 | | |
|
272 | 276 | o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C |
|
273 | 277 | | |
|
274 | 278 | o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B |
|
275 | 279 | | |
|
276 | 280 | | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H |
|
277 | 281 | | | |
|
278 | 282 | | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G |
|
279 | 283 | | |/| |
|
280 | 284 | | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F |
|
281 | 285 | |/ / |
|
282 | 286 | | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E |
|
283 | 287 | |/ |
|
284 | 288 | o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A |
|
285 | 289 | |
|
286 | 290 | $ hg -R other debugobsolete |
|
287 | 291 | 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
288 | 292 | 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
289 | 293 | 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
290 | 294 | 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
291 | 295 | 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
292 | 296 | 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
293 | 297 | 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
294 | 298 | |
|
295 | 299 | Error Handling |
|
296 | 300 | ============== |
|
297 | 301 | |
|
298 | 302 | Check that errors are properly returned to the client during push. |
|
299 | 303 | |
|
300 | 304 | Setting up |
|
301 | 305 | |
|
302 | 306 | $ cat > failpush.py << EOF |
|
303 | 307 | > """A small extension that makes push fails when using bundle2 |
|
304 | 308 | > |
|
305 | 309 | > used to test error handling in bundle2 |
|
306 | 310 | > """ |
|
307 | 311 | > |
|
308 | 312 | > from mercurial import util |
|
309 | 313 | > from mercurial import bundle2 |
|
310 | 314 | > from mercurial import exchange |
|
311 | 315 | > from mercurial import extensions |
|
312 | 316 | > |
|
313 | 317 | > def _pushbundle2failpart(pushop, bundler): |
|
314 | 318 | > reason = pushop.ui.config('failpush', 'reason', None) |
|
315 | 319 | > part = None |
|
316 | 320 | > if reason == 'abort': |
|
317 | 321 | > bundler.newpart('test:abort') |
|
318 | 322 | > if reason == 'unknown': |
|
319 | 323 | > bundler.newpart('TEST:UNKNOWN') |
|
320 | 324 | > if reason == 'race': |
|
321 | 325 | > # 20 Bytes of crap |
|
322 | 326 | > bundler.newpart('b2x:check:heads', data='01234567890123456789') |
|
323 | 327 | > |
|
324 | 328 | > @bundle2.parthandler("test:abort") |
|
325 | 329 | > def handleabort(op, part): |
|
326 | 330 | > raise util.Abort('Abandon ship!', hint="don't panic") |
|
327 | 331 | > |
|
328 | 332 | > def uisetup(ui): |
|
329 | 333 | > exchange.b2partsgenmapping['failpart'] = _pushbundle2failpart |
|
330 | 334 | > exchange.b2partsgenorder.insert(0, 'failpart') |
|
331 | 335 | > |
|
332 | 336 | > EOF |
|
333 | 337 | |
|
334 | 338 | $ cd main |
|
335 | 339 | $ hg up tip |
|
336 | 340 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
337 | 341 | $ echo 'I' > I |
|
338 | 342 | $ hg add I |
|
339 | 343 | $ hg ci -m 'I' |
|
340 | 344 | $ hg id |
|
341 | 345 | e7ec4e813ba6 tip |
|
342 | 346 | $ cd .. |
|
343 | 347 | |
|
344 | 348 | $ cat << EOF >> $HGRCPATH |
|
345 | 349 | > [extensions] |
|
346 | 350 | > failpush=$TESTTMP/failpush.py |
|
347 | 351 | > EOF |
|
348 | 352 | |
|
349 | 353 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
350 | 354 | $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log |
|
351 | 355 | $ cat other.pid >> $DAEMON_PIDS |
|
352 | 356 | |
|
353 | 357 | Doing the actual push: Abort error |
|
354 | 358 | |
|
355 | 359 | $ cat << EOF >> $HGRCPATH |
|
356 | 360 | > [failpush] |
|
357 | 361 | > reason = abort |
|
358 | 362 | > EOF |
|
359 | 363 | |
|
360 | 364 | $ hg -R main push other -r e7ec4e813ba6 |
|
361 | 365 | pushing to other |
|
362 | 366 | searching for changes |
|
363 | 367 | abort: Abandon ship! |
|
364 | 368 | (don't panic) |
|
365 | 369 | [255] |
|
366 | 370 | |
|
367 | 371 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
368 | 372 | pushing to ssh://user@dummy/other |
|
369 | 373 | searching for changes |
|
370 | 374 | abort: Abandon ship! |
|
371 | 375 | (don't panic) |
|
372 | 376 | [255] |
|
373 | 377 | |
|
374 | 378 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
375 | 379 | pushing to http://localhost:$HGPORT2/ |
|
376 | 380 | searching for changes |
|
377 | 381 | abort: Abandon ship! |
|
378 | 382 | (don't panic) |
|
379 | 383 | [255] |
|
380 | 384 | |
|
381 | 385 | |
|
382 | 386 | Doing the actual push: unknown mandatory parts |
|
383 | 387 | |
|
384 | 388 | $ cat << EOF >> $HGRCPATH |
|
385 | 389 | > [failpush] |
|
386 | 390 | > reason = unknown |
|
387 | 391 | > EOF |
|
388 | 392 | |
|
389 | 393 | $ hg -R main push other -r e7ec4e813ba6 |
|
390 | 394 | pushing to other |
|
391 | 395 | searching for changes |
|
392 | 396 | abort: missing support for test:unknown |
|
393 | 397 | [255] |
|
394 | 398 | |
|
395 | 399 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
396 | 400 | pushing to ssh://user@dummy/other |
|
397 | 401 | searching for changes |
|
398 | 402 | abort: missing support for test:unknown |
|
399 | 403 | [255] |
|
400 | 404 | |
|
401 | 405 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
402 | 406 | pushing to http://localhost:$HGPORT2/ |
|
403 | 407 | searching for changes |
|
404 | 408 | abort: missing support for test:unknown |
|
405 | 409 | [255] |
|
406 | 410 | |
|
407 | 411 | Doing the actual push: race |
|
408 | 412 | |
|
409 | 413 | $ cat << EOF >> $HGRCPATH |
|
410 | 414 | > [failpush] |
|
411 | 415 | > reason = race |
|
412 | 416 | > EOF |
|
413 | 417 | |
|
414 | 418 | $ hg -R main push other -r e7ec4e813ba6 |
|
415 | 419 | pushing to other |
|
416 | 420 | searching for changes |
|
417 | 421 | abort: push failed: |
|
418 | 422 | 'repository changed while pushing - please try again' |
|
419 | 423 | [255] |
|
420 | 424 | |
|
421 | 425 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
422 | 426 | pushing to ssh://user@dummy/other |
|
423 | 427 | searching for changes |
|
424 | 428 | abort: push failed: |
|
425 | 429 | 'repository changed while pushing - please try again' |
|
426 | 430 | [255] |
|
427 | 431 | |
|
428 | 432 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
429 | 433 | pushing to http://localhost:$HGPORT2/ |
|
430 | 434 | searching for changes |
|
431 | 435 | abort: push failed: |
|
432 | 436 | 'repository changed while pushing - please try again' |
|
433 | 437 | [255] |
|
434 | 438 | |
|
435 | 439 | Doing the actual push: hook abort |
|
436 | 440 | |
|
437 | 441 | $ cat << EOF >> $HGRCPATH |
|
438 | 442 | > [failpush] |
|
439 | 443 | > reason = |
|
440 | 444 | > [hooks] |
|
441 | 445 | > b2x-pretransactionclose.failpush = false |
|
442 | 446 | > EOF |
|
443 | 447 | |
|
444 | 448 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
445 | 449 | $ hg -R other serve -p $HGPORT2 -d --pid-file=other.pid -E other-error.log |
|
446 | 450 | $ cat other.pid >> $DAEMON_PIDS |
|
447 | 451 | |
|
448 | 452 | $ hg -R main push other -r e7ec4e813ba6 |
|
449 | 453 | pushing to other |
|
450 | 454 | searching for changes |
|
451 | 455 | transaction abort! |
|
452 | 456 | rollback completed |
|
453 | 457 | abort: b2x-pretransactionclose.failpush hook exited with status 1 |
|
454 | 458 | [255] |
|
455 | 459 | |
|
456 | 460 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 |
|
457 | 461 | pushing to ssh://user@dummy/other |
|
458 | 462 | searching for changes |
|
459 | 463 | abort: b2x-pretransactionclose.failpush hook exited with status 1 |
|
460 | 464 | remote: transaction abort! |
|
461 | 465 | remote: rollback completed |
|
462 | 466 | [255] |
|
463 | 467 | |
|
464 | 468 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 |
|
465 | 469 | pushing to http://localhost:$HGPORT2/ |
|
466 | 470 | searching for changes |
|
467 | 471 | abort: b2x-pretransactionclose.failpush hook exited with status 1 |
|
468 | 472 | [255] |
|
469 | 473 | |
|
470 | 474 |
General Comments 0
You need to be logged in to leave comments.
Login now