comparison tests/test-topic-push.t @ 1887:68125d026b07

push: hackish handeling of new branch head from phase move The current head checking mechanism is not expecting "head change" from phase movement. Topic allows that, changeset with a topic moving to public can create a new head. We introduce a hack to double check that no head were added at the transaction level to work around this.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 12 Mar 2016 18:42:16 +0000
parents 0504e76bfbd9
children 58cdf061d49a
comparison
equal deleted inserted replaced
1886:0504e76bfbd9 1887:68125d026b07
326 adding file changes 326 adding file changes
327 added 3 changesets with 2 changes to 2 files 327 added 3 changesets with 2 changes to 2 files
328 328
329 $ cd .. 329 $ cd ..
330 330
331 Test phase move
332 ==================================
333
334 setup, two repo knowns about two small topic branch
335
336 $ hg init repoA
337 $ hg clone repoA repoB
338 updating to branch default
339 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
340 $ cat << EOF >> repoA/.hg/hgrc
341 > [phases]
342 > publish=False
343 > EOF
344 $ cat << EOF >> repoB/.hg/hgrc
345 > [phases]
346 > publish=False
347 > EOF
348 $ cd repoA
349 $ echo aaa > base
350 $ hg add base
351 $ hg commit -m 'CBASE'
352 $ echo aaa > aaa
353 $ hg add aaa
354 $ hg topic topicA
355 $ hg commit -m 'CA'
356 $ hg up 'desc(CBASE)'
357 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
358 $ echo aaa > bbb
359 $ hg add bbb
360 $ hg topic topicB
361 $ hg commit -m 'CB'
362 $ cd ..
363 $ hg push -R repoA repoB
364 pushing to repoB
365 searching for changes
366 adding changesets
367 adding manifests
368 adding file changes
369 added 3 changesets with 3 changes to 3 files (+1 heads)
370 $ hg log -G -R repoA
371 @ 2 default topicB draft CB
372 |
373 | o 1 default topicA draft CA
374 |/
375 o 0 default draft CBASE
376
377
378 We turn different topic to public on each side,
379
380 $ hg -R repoA phase --public topicA
381 $ hg -R repoB phase --public topicB
382
383 Pushing should complain because it create to heads on default
384
385 $ hg push -R repoA repoB
386 pushing to repoB
387 searching for changes
388 no changes found
389 abort: push create a new head on branch "default"
390 [255]