diff tests/test-topic-mode.t @ 3030:581a6b9d2c8c

test: add support for random-all topic mode The 'random' mode no longer generate a random topic for merge.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 01 Oct 2017 11:13:38 +0100
parents 402bfc232ce9
children b400759fd6d2
line wrap: on
line diff
--- a/tests/test-topic-mode.t	Sun Oct 01 10:44:23 2017 +0100
+++ b/tests/test-topic-mode.t	Sun Oct 01 11:13:38 2017 +0100
@@ -218,3 +218,96 @@
   $ hg add B
   $ hg commit -m "Add B" --config devel.randomseed=128
   active topic 'various-dove' grew its first changeset
+
+Test a merge too
+
+  $ hg phase --public -r .
+  active topic 'various-dove' is now empty
+  $ hg up default
+  clearing empty topic "various-dove"
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -G
+  @  changeset:   2:2d2acb6efad5
+  |  tag:         tip
+  |  parent:      0:ec1d2790416d
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     Add B
+  |
+  | o  changeset:   1:d4b548f35972
+  |/   topic:       panoramic-antelope
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     Add A
+  |
+  o  changeset:   0:ec1d2790416d
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     ROOT
+  
+  $ hg merge panoramic-antelope
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'merge'
+Testing the config knob to use a random topic for untopic commit (even for merge)
+=================================================================================
+
+  $ hg init $TESTTMP/test-untopic-random-all
+  $ cd $TESTTMP/test-untopic-random-all
+  $ cat <<EOF >> .hg/hgrc
+  > [phases]
+  > publish=false
+  > EOF
+  $ cat <<EOF >> $HGRCPATH
+  > [experimental]
+  > topic-mode = random-all
+  > EOF
+
+  $ touch ROOT
+  $ hg commit -A -m "ROOT" --config experimental.topic-mode=off
+  adding ROOT
+
+  $ touch A
+  $ hg add A
+  $ hg commit -m "Add A" --config devel.randomseed=42
+  active topic 'panoramic-antelope' grew its first changeset
+
+  $ hg up -r "desc(ROOT)"
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ touch B
+  $ hg add B
+  $ hg commit -m "Add B" --config devel.randomseed=128
+  active topic 'various-dove' grew its first changeset
+
+Test a merge too
+
+  $ hg phase --public -r .
+  active topic 'various-dove' is now empty
+  $ hg up default
+  clearing empty topic "various-dove"
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -G
+  @  changeset:   2:2d2acb6efad5
+  |  tag:         tip
+  |  parent:      0:ec1d2790416d
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     Add B
+  |
+  | o  changeset:   1:d4b548f35972
+  |/   topic:       panoramic-antelope
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     Add A
+  |
+  o  changeset:   0:ec1d2790416d
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     ROOT
+  
+  $ hg merge panoramic-antelope
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'merge'  --config devel.randomseed=1337
+  active topic 'omniscient-locust' grew its first changeset