tests/test-topic.t
changeset 2718 b6fa7b3e13d4
parent 2717 ed45a5fb4452
child 2731 d39942773163
--- a/tests/test-topic.t	Thu Jul 06 03:56:36 2017 +0530
+++ b/tests/test-topic.t	Thu Jul 06 03:31:11 2017 +0530
@@ -820,3 +820,34 @@
   t2: gamma
   t1: start on fran
   t0^ Add file delta (base)
+
+  $ cd ..
+
+Testing the new config knob to forbid untopiced commit
+======================================================
+
+  $ hg init ponky
+  $ cd ponky
+  $ cat <<EOF >> .hg/hgrc
+  > [phases]
+  > publish=false
+  > EOF
+  $ cat <<EOF >> $HGRCPATH
+  > [experimental]
+  > enforce-topic = yes
+  > EOF
+  $ touch a b c d
+  $ hg add a
+  $ hg ci -m "Added a"
+  abort: no active topic
+  (set a current topic or use '--config experimental.enforce-topic=no' to commit without a topic)
+  [255]
+  $ hg ci -m "added a" --config experimental.enforce-topic=no
+  $ hg log
+  changeset:   0:a154386e50d1
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     added a
+  
+  $ cd ..