diff 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
line wrap: on
line diff
--- a/tests/test-topic-push.t	Sat Mar 12 18:19:27 2016 +0000
+++ b/tests/test-topic-push.t	Sat Mar 12 18:42:16 2016 +0000
@@ -328,3 +328,63 @@
 
   $ cd ..
 
+Test phase move
+==================================
+
+setup, two repo knowns about two small topic branch
+
+  $ hg init repoA
+  $ hg clone repoA repoB
+  updating to branch default
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat << EOF >> repoA/.hg/hgrc
+  > [phases]
+  > publish=False
+  > EOF
+  $ cat << EOF >> repoB/.hg/hgrc
+  > [phases]
+  > publish=False
+  > EOF
+  $ cd repoA
+  $ echo aaa > base
+  $ hg add base
+  $ hg commit -m 'CBASE'
+  $ echo aaa > aaa
+  $ hg add aaa
+  $ hg topic topicA
+  $ hg commit -m 'CA'
+  $ hg up 'desc(CBASE)'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo aaa > bbb
+  $ hg add bbb
+  $ hg topic topicB
+  $ hg commit -m 'CB'
+  $ cd ..
+  $ hg push -R repoA repoB
+  pushing to repoB
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 3 files (+1 heads)
+  $ hg log -G -R repoA
+  @  2 default topicB draft CB
+  |
+  | o  1 default topicA draft CA
+  |/
+  o  0 default  draft CBASE
+  
+
+We turn different topic to public on each side,
+
+  $ hg -R repoA phase --public topicA
+  $ hg -R repoB phase --public topicB
+
+Pushing should complain because it create to heads on default
+
+  $ hg push -R repoA repoB
+  pushing to repoB
+  searching for changes
+  no changes found
+  abort: push create a new head on branch "default"
+  [255]