tests/test-obsolete-push.t
branchmercurial-3.8
changeset 2320 979a8ea17e1e
parent 2111 ec04eb4d2c6e
parent 2286 a4c5744a7b93
child 2534 b3dac812fb2a
--- a/tests/test-obsolete-push.t	Thu Apr 20 12:50:22 2017 +0200
+++ b/tests/test-obsolete-push.t	Wed May 03 13:52:19 2017 +0200
@@ -44,3 +44,50 @@
   comparing with ../clone
   searching for changes
   0:1994f17a630e@default(obsolete/draft) A
+  $ cd ..
+
+Test options to prevent implicite publishing of changesets
+----------------------------------------------------------
+
+
+  $ hg clone source strict-publish-client --pull
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  1 new obsolescence markers
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd strict-publish-client
+  $ echo c > c
+  $ hg ci -qAm C c
+
+abort behavior
+
+  $ cat >> .hg/hgrc <<eof
+  > [experimental]
+  > auto-publish = abort
+  > eof
+  $ hg push -r .
+  pushing to $TESTTMP/source
+  abort: push would publish 1 changesets
+  (behavior controlled by 'experimental.auto-publish' config)
+  [255]
+  $ hg push
+  pushing to $TESTTMP/source
+  abort: push would publish 1 changesets
+  (behavior controlled by 'experimental.auto-publish' config)
+  [255]
+
+warning behavior
+
+  $ echo 'auto-publish = warn' >> .hg/hgrc
+  $ hg push
+  pushing to $TESTTMP/source
+  1 changesets about to be published
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 0 changesets with 0 changes to 1 files