tests: convert some hghave unix-permissions to #if

This commit is contained in:
Mads Kiilerich 2012-06-19 01:43:41 +02:00
parent 8c68acd70f
commit f7215835a1
4 changed files with 28 additions and 16 deletions

View File

@ -1,5 +1,3 @@
$ "$TESTDIR/hghave" unix-permissions || exit 80
$ cat >> $HGRCPATH <<EOF
> [extensions]
> convert=
@ -293,24 +291,27 @@
pulling from ../a
searching for changes
no changes found
conversion to existing file should fail
$ touch bogusfile
should fail
$ hg convert a bogusfile
initializing destination bogusfile repository
abort: cannot create new bundle repository
[255]
#if unix-permissions
conversion to dir without permissions should fail
$ mkdir bogusdir
$ chmod 000 bogusdir
should fail
$ hg convert a bogusdir
abort: Permission denied: bogusdir
[255]
should succeed
user permissions should succeed
$ chmod 700 bogusdir
$ hg convert a bogusdir
@ -324,6 +325,8 @@ should succeed
1 d
0 e
#endif
test pre and post conversion actions
$ echo 'include b' > filemap

View File

@ -1,5 +1,3 @@
$ "$TESTDIR/hghave" unix-permissions || exit 80
Test EOL extension
$ cat >> $HGRCPATH <<EOF
@ -386,10 +384,13 @@ Mixed tests
% hg status
$ rm -r mixed
Test issue2569 -- eol extension takes write lock on reading:
$ echo '[extensions]' >> $HGRCPATH
$ echo 'eol =' >> $HGRCPATH
#if unix-permissions
Test issue2569 -- eol extension takes write lock on reading:
$ hg init repo
$ cd repo
$ touch .hgeol
@ -403,6 +404,8 @@ Test issue2569 -- eol extension takes write lock on reading:
$ chmod -R u+w .hg
$ cd ..
#endif
Test cleverencode: and cleverdecode: aliases for win32text extension
$ echo '[encode]' >> $HGRCPATH

View File

@ -1,5 +1,3 @@
$ "$TESTDIR/hghave" unix-permissions || exit 80
Create user cache directory
$ USERCACHE=`pwd`/cache; export USERCACHE
@ -72,10 +70,12 @@ Update working directory to tip, again.
0 largefiles updated, 0 removed
$ hg status
! large
$ cd ..
#if unix-permissions
Portable way to print file permissions:
$ cd ..
$ cat > ls-l.py <<EOF
> #!/usr/bin/env python
> import sys, os
@ -121,3 +121,5 @@ Test permission of files created by push:
640
$ cd ..
#endif

View File

@ -1,4 +1,4 @@
$ "$TESTDIR/hghave" unix-permissions serve || exit 80
$ "$TESTDIR/hghave" serve || exit 80
$ USERCACHE=`pwd`/cache; export USERCACHE
$ mkdir -p ${USERCACHE}
$ cat >> $HGRCPATH <<EOF
@ -1018,6 +1018,8 @@ Push a largefiles repository to a served empty repository
used all HGPORTs, kill all daemons
$ "$TESTDIR/killdaemons.py"
#if unix-permissions
Clone a local repository owned by another user
We have to simulate that here by setting $HOME and removing write permissions
$ ORIGHOME="$HOME"
@ -1051,6 +1053,8 @@ We have to simulate that here by setting $HOME and removing write permissions
$ chmod -R u+w alice/pubrepo
$ HOME="$ORIGHOME"
#endif
#if symlink
Symlink to a large largefile should behave the same as a symlink to a normal file