comparison tests/test-exchange-multi-source.t @ 46778:066b8d8f75b8

push: allow to specify multiple destinations I end up needing that on a regular basis and it turn out to be very simple to implement. See documentation and test for details. Differential Revision: https://phab.mercurial-scm.org/D10161
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 10 Mar 2021 05:50:20 +0100
parents 685383486d0a
children d4e4ccb75f99
comparison
equal deleted inserted replaced
46777:25850879a215 46778:066b8d8f75b8
69 new changesets 4a2df7238c3b:40faebb2ec45 69 new changesets 4a2df7238c3b:40faebb2ec45
70 70
71 Test simple bare operation 71 Test simple bare operation
72 ========================== 72 ==========================
73 73
74 pull
75 ----
76
74 $ hg clone main-repo test-repo-bare --rev 0 -U 77 $ hg clone main-repo test-repo-bare --rev 0 -U
75 adding changesets 78 adding changesets
76 adding manifests 79 adding manifests
77 adding file changes 80 adding file changes
78 added 1 changesets with 1 changes to 1 files 81 added 1 changesets with 1 changes to 1 files
119 o B 1 122 o B 1
120 | 123 |
121 o A 0 124 o A 0
122 125
123 126
127 push
128 ----
129
130 $ cp -R ./branch-E ./branch-E-push
131 $ cp -R ./branch-G ./branch-G-push
132 $ cp -R ./branch-H ./branch-H-push
133 $ hg push --force -R test-repo-bare ./branch-E-push ./branch-G-push ./branch-H-push
134 pushing to ./branch-E-push
135 searching for changes
136 adding changesets
137 adding manifests
138 adding file changes
139 added 3 changesets with 3 changes to 3 files (+2 heads)
140 pushing to ./branch-G-push
141 searching for changes
142 adding changesets
143 adding manifests
144 adding file changes
145 added 4 changesets with 4 changes to 4 files (+2 heads)
146 pushing to ./branch-H-push
147 searching for changes
148 adding changesets
149 adding manifests
150 adding file changes
151 added 4 changesets with 4 changes to 4 files (+2 heads)
152 $ hg log -R ./branch-E-push -T '{desc} {rev}\n' --rev 'sort(all(), "topo")' -G
153 o H 7
154 |
155 | o E 4
156 | |
157 | o D 3
158 |/
159 o C 2
160 |
161 | o G 6
162 | |
163 | o F 5
164 |/
165 o B 1
166 |
167 o A 0
168
169 $ hg log -R ./branch-G-push -T '{desc} {rev}\n' --rev 'sort(all(), "topo")' -G
170 o H 7
171 |
172 | o E 6
173 | |
174 | o D 5
175 |/
176 o C 4
177 |
178 | o G 3
179 | |
180 | o F 2
181 |/
182 o B 1
183 |
184 o A 0
185
186 $ hg log -R ./branch-H-push -T '{desc} {rev}\n' --rev 'sort(all(), "topo")' -G
187 o G 7
188 |
189 o F 6
190 |
191 | o E 5
192 | |
193 | o D 4
194 | |
195 | | o H 3
196 | |/
197 | o C 2
198 |/
199 o B 1
200 |
201 o A 0
202
203 $ rm -rf ./*-push
204
124 Test operation with a target 205 Test operation with a target
125 ============================ 206 ============================
207
208 pull
209 ----
126 210
127 $ hg clone main-repo test-repo-rev --rev 0 -U 211 $ hg clone main-repo test-repo-rev --rev 0 -U
128 adding changesets 212 adding changesets
129 adding manifests 213 adding manifests
130 adding file changes 214 adding file changes
196 |/ 280 |/
197 o B 1 281 o B 1
198 | 282 |
199 o A 0 283 o A 0
200 284
285
286 push
287 ----
288
289 We only push a specific branch with --rev
290
291 $ cp -R ./branch-E ./branch-E-push
292 $ cp -R ./branch-G ./branch-G-push
293 $ cp -R ./branch-H ./branch-H-push
294 $ hg push --force -R test-repo-bare ./branch-E-push ./branch-G-push ./branch-H-push --rev default
295 pushing to ./branch-E-push
296 searching for changes
297 adding changesets
298 adding manifests
299 adding file changes
300 added 1 changesets with 1 changes to 1 files (+1 heads)
301 pushing to ./branch-G-push
302 searching for changes
303 adding changesets
304 adding manifests
305 adding file changes
306 added 2 changesets with 2 changes to 2 files (+1 heads)
307 pushing to ./branch-H-push
308 searching for changes
309 no changes found
310 $ hg log -R ./branch-E-push -T '{desc} {rev}\n' --rev 'sort(all(), "topo")' -G
311 o H 5
312 |
313 | o E 4
314 | |
315 | o D 3
316 |/
317 o C 2
318 |
319 o B 1
320 |
321 o A 0
322
323 $ hg log -R ./branch-G-push -T '{desc} {rev}\n' --rev 'sort(all(), "topo")' -G
324 o H 5
325 |
326 o C 4
327 |
328 | o G 3
329 | |
330 | o F 2
331 |/
332 o B 1
333 |
334 o A 0
335
336 $ hg log -R ./branch-H-push -T '{desc} {rev}\n' --rev 'sort(all(), "topo")' -G
337 o H 3
338 |
339 o C 2
340 |
341 o B 1
342 |
343 o A 0
344
345 $ rm -rf ./*-push
346
347 Same push, but the first one is a no-op
348
349 $ cp -R ./branch-E ./branch-E-push
350 $ cp -R ./branch-G ./branch-G-push
351 $ cp -R ./branch-H ./branch-H-push
352 $ hg push --force -R test-repo-bare ./branch-G-push ./branch-H-push ./branch-E-push --rev default
353 pushing to ./branch-G-push
354 searching for changes
355 adding changesets
356 adding manifests
357 adding file changes
358 added 2 changesets with 2 changes to 2 files (+1 heads)
359 pushing to ./branch-H-push
360 searching for changes
361 no changes found
362 pushing to ./branch-E-push
363 searching for changes
364 adding changesets
365 adding manifests
366 adding file changes
367 added 1 changesets with 1 changes to 1 files (+1 heads)
368 $ hg log -R ./branch-E-push -T '{desc} {rev}\n' --rev 'sort(all(), "topo")' -G
369 o H 5
370 |
371 | o E 4
372 | |
373 | o D 3
374 |/
375 o C 2
376 |
377 o B 1
378 |
379 o A 0
380
381 $ hg log -R ./branch-G-push -T '{desc} {rev}\n' --rev 'sort(all(), "topo")' -G
382 o H 5
383 |
384 o C 4
385 |
386 | o G 3
387 | |
388 | o F 2
389 |/
390 o B 1
391 |
392 o A 0
393
394 $ hg log -R ./branch-H-push -T '{desc} {rev}\n' --rev 'sort(all(), "topo")' -G
395 o H 3
396 |
397 o C 2
398 |
399 o B 1
400 |
401 o A 0
402
403 $ rm -rf ./*-push
201 404
202 405
203 Test with --update 406 Test with --update
204 ================== 407 ==================
205 408