tests/test-topic-flow-publish-bare.t
branchstable
changeset 5266 af9f40236037
parent 4647 228caeb8b7af
child 5282 1bb465fad209
--- a/tests/test-topic-flow-publish-bare.t	Sat Mar 21 15:04:18 2020 +0100
+++ b/tests/test-topic-flow-publish-bare.t	Mon Apr 06 05:05:07 2020 +0200
@@ -321,3 +321,43 @@
   $ hg phase --public -r 10 --config experimental.topic.allow-publish=no
   abort: rejecting publishing of changeset 858be9a8daaf and 1 others
   [255]
+
+Checking the option to prevent automatic publishing
+===================================================
+
+  $ hg up branchA
+  2 files updated, 0 files merged, 5 files removed, 0 files unresolved
+
+Trying to push changeset without topic (would publish them)
+
+  $ mkcommit c_aM0
+  $ hg debugcapabilities $TESTTMP/bare-branch-server | grep topics
+    ext-topics-publish=auto
+    topics
+  $ hg push --config experimental.auto-publish=abort -r .
+  pushing to $TESTTMP/bare-branch-server
+  abort: push would publish 1 changesets
+  (use --publish or adjust 'experimental.auto-publish' config)
+  [255]
+  $ hg push --config experimental.auto-publish=abort -r . --publish
+  pushing to $TESTTMP/bare-branch-server
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+Pushing a changeset with topic (not publishing, no warning)
+
+  $ hg topic test-push-protection
+  marked working directory as topic: test-push-protection
+  $ mkcommit c_aL0
+  active topic 'test-push-protection' grew its first changeset
+  (see 'hg help topics' for more information)
+  $ hg push --config experimental.auto-publish=abort -r .
+  pushing to $TESTTMP/bare-branch-server
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files