topics/tuto: activate the `enforce-topic` option
authorAurélien Campéas
Thu, 21 Sep 2017 15:09:14 +0200
changeset 2968 946b1baa8c38
parent 2967 c62b3776fec3
child 2969 3d39b8867b29
topics/tuto: activate the `enforce-topic` option This really help users to stick within topics.
tests/test-topic-tutorial.t
--- a/tests/test-topic-tutorial.t	Thu Sep 21 14:05:27 2017 +0200
+++ b/tests/test-topic-tutorial.t	Thu Sep 21 15:09:14 2017 +0200
@@ -684,6 +684,37 @@
   $ hg topic
 
 
+Keep working within topics
+==========================
+
+Making sure all your new local commit are made within a topic will help your
+organise your work. It is possible to ensure this through the Mercurial
+configuration.
+
+For this tutorial, we'll add the config at the repository level:
+
+  $ cat << EOF >> .hg/hgrc
+  > [experimental] >> .hg/hgrc
+  > enforce-topic=yes >> .hg/hgrc
+  > EOF
+
+You can also use `hg config --edit` to update your mercurial configuration.
+
+
+Once enforcement is turned on. New local commit will be denied if no topic is active.
+
+  $ echo sickle >> shopping
+  $ hg commit -m 'Adding sickle'
+  abort: no active topic
+  (set a current topic or use '--config experimental.enforce-topic=no' to commit without a topic)
+  [255]
+
+Ok, let's clean this up and delve into multiple topics.
+
+  $ hg revert .
+  reverting shopping
+
+
 Working with Multiple Topics
 ============================