diff tests/test-topicmode.t @ 3028:c2d1f49ac7e2

topicmode: add 'random' topic mode That mode will generate a random topic name when the user is about to commit an untopiced changeset.
author Boris Feld <boris.feld@octobus.net>
date Sun, 01 Oct 2017 00:35:28 +0100
parents b220e2f5ebd5
children
line wrap: on
line diff
--- a/tests/test-topicmode.t	Sun Oct 01 09:10:48 2017 +0100
+++ b/tests/test-topicmode.t	Sun Oct 01 00:35:28 2017 +0100
@@ -188,3 +188,33 @@
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     ROOT
   
+Testing the new config knob to use a random topic for untopic commit
+====================================================================
+
+  $ hg init $TESTTMP/test-untopic-random
+  $ cd $TESTTMP/test-untopic-random
+  $ cat <<EOF >> .hg/hgrc
+  > [phases]
+  > publish=false
+  > EOF
+  $ cat <<EOF >> $HGRCPATH
+  > [experimental]
+  > topic-mode = random
+  > 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