tests/test-inhibit.t
changeset 1368 c02cdb97ebfa
parent 1360 5c13945b32fc
child 1443 6c122c975125
--- a/tests/test-inhibit.t	Tue Jun 16 10:08:48 2015 -0700
+++ b/tests/test-inhibit.t	Tue Jun 16 10:19:17 2015 -0700
@@ -721,5 +721,37 @@
   $ hg up 15
   abort: Cannot use inhibit without the direct access extension
   [255]
+  $ echo "directaccess=$(echo $(dirname $TESTDIR))/hgext/directaccess.py" >> $HGRCPATH
+  $ cd ..
 
 
+hg push should not allow directaccess unless forced with --hidden
+We copy the inhibhit repo to inhibit2 and make some changes to push to inhibit
+
+  $ cp -r inhibit inhibit2
+  $ pwd=$(pwd)
+  $ cd inhibit
+  $ mkcommit pk
+  $ hg id
+  003a4735afde tip
+  $ echo "OO" > pk
+  $ hg amend
+  $ hg id
+  71eb4f100663 tip
+
+Hidden commits cannot be pushed without --hidden
+  $ hg push -r 003a4735afde file://$pwd/inhibit2
+  pushing to file://$TESTTMP/inhibit2
+  abort: hidden revision '003a4735afde'!
+  (use --hidden to access hidden revisions)
+  [255]
+
+Visible commits can still be pushed
+  $ hg push -r 71eb4f100663 file://$pwd/inhibit2
+  pushing to file://$TESTTMP/inhibit2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  2 new obsolescence markers