mirror of
https://github.com/facebook/sapling.git
synced 2025-01-06 04:43:19 +03:00
tests: convert some hghave unix-permissions to #if
This commit is contained in:
parent
8c68acd70f
commit
f7215835a1
@ -1,5 +1,3 @@
|
|||||||
$ "$TESTDIR/hghave" unix-permissions || exit 80
|
|
||||||
|
|
||||||
$ cat >> $HGRCPATH <<EOF
|
$ cat >> $HGRCPATH <<EOF
|
||||||
> [extensions]
|
> [extensions]
|
||||||
> convert=
|
> convert=
|
||||||
@ -293,24 +291,27 @@
|
|||||||
pulling from ../a
|
pulling from ../a
|
||||||
searching for changes
|
searching for changes
|
||||||
no changes found
|
no changes found
|
||||||
|
|
||||||
|
conversion to existing file should fail
|
||||||
|
|
||||||
$ touch bogusfile
|
$ touch bogusfile
|
||||||
|
|
||||||
should fail
|
|
||||||
|
|
||||||
$ hg convert a bogusfile
|
$ hg convert a bogusfile
|
||||||
initializing destination bogusfile repository
|
initializing destination bogusfile repository
|
||||||
abort: cannot create new bundle repository
|
abort: cannot create new bundle repository
|
||||||
[255]
|
[255]
|
||||||
|
|
||||||
|
#if unix-permissions
|
||||||
|
|
||||||
|
conversion to dir without permissions should fail
|
||||||
|
|
||||||
$ mkdir bogusdir
|
$ mkdir bogusdir
|
||||||
$ chmod 000 bogusdir
|
$ chmod 000 bogusdir
|
||||||
|
|
||||||
should fail
|
|
||||||
|
|
||||||
$ hg convert a bogusdir
|
$ hg convert a bogusdir
|
||||||
abort: Permission denied: bogusdir
|
abort: Permission denied: bogusdir
|
||||||
[255]
|
[255]
|
||||||
|
|
||||||
should succeed
|
user permissions should succeed
|
||||||
|
|
||||||
$ chmod 700 bogusdir
|
$ chmod 700 bogusdir
|
||||||
$ hg convert a bogusdir
|
$ hg convert a bogusdir
|
||||||
@ -324,6 +325,8 @@ should succeed
|
|||||||
1 d
|
1 d
|
||||||
0 e
|
0 e
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
test pre and post conversion actions
|
test pre and post conversion actions
|
||||||
|
|
||||||
$ echo 'include b' > filemap
|
$ echo 'include b' > filemap
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
$ "$TESTDIR/hghave" unix-permissions || exit 80
|
|
||||||
|
|
||||||
Test EOL extension
|
Test EOL extension
|
||||||
|
|
||||||
$ cat >> $HGRCPATH <<EOF
|
$ cat >> $HGRCPATH <<EOF
|
||||||
@ -386,10 +384,13 @@ Mixed tests
|
|||||||
% hg status
|
% hg status
|
||||||
$ rm -r mixed
|
$ rm -r mixed
|
||||||
|
|
||||||
Test issue2569 -- eol extension takes write lock on reading:
|
|
||||||
|
|
||||||
$ echo '[extensions]' >> $HGRCPATH
|
$ echo '[extensions]' >> $HGRCPATH
|
||||||
$ echo 'eol =' >> $HGRCPATH
|
$ echo 'eol =' >> $HGRCPATH
|
||||||
|
|
||||||
|
#if unix-permissions
|
||||||
|
|
||||||
|
Test issue2569 -- eol extension takes write lock on reading:
|
||||||
|
|
||||||
$ hg init repo
|
$ hg init repo
|
||||||
$ cd repo
|
$ cd repo
|
||||||
$ touch .hgeol
|
$ touch .hgeol
|
||||||
@ -403,6 +404,8 @@ Test issue2569 -- eol extension takes write lock on reading:
|
|||||||
$ chmod -R u+w .hg
|
$ chmod -R u+w .hg
|
||||||
$ cd ..
|
$ cd ..
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
Test cleverencode: and cleverdecode: aliases for win32text extension
|
Test cleverencode: and cleverdecode: aliases for win32text extension
|
||||||
|
|
||||||
$ echo '[encode]' >> $HGRCPATH
|
$ echo '[encode]' >> $HGRCPATH
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
$ "$TESTDIR/hghave" unix-permissions || exit 80
|
|
||||||
|
|
||||||
Create user cache directory
|
Create user cache directory
|
||||||
|
|
||||||
$ USERCACHE=`pwd`/cache; export USERCACHE
|
$ USERCACHE=`pwd`/cache; export USERCACHE
|
||||||
@ -72,10 +70,12 @@ Update working directory to tip, again.
|
|||||||
0 largefiles updated, 0 removed
|
0 largefiles updated, 0 removed
|
||||||
$ hg status
|
$ hg status
|
||||||
! large
|
! large
|
||||||
|
$ cd ..
|
||||||
|
|
||||||
|
#if unix-permissions
|
||||||
|
|
||||||
Portable way to print file permissions:
|
Portable way to print file permissions:
|
||||||
|
|
||||||
$ cd ..
|
|
||||||
$ cat > ls-l.py <<EOF
|
$ cat > ls-l.py <<EOF
|
||||||
> #!/usr/bin/env python
|
> #!/usr/bin/env python
|
||||||
> import sys, os
|
> import sys, os
|
||||||
@ -121,3 +121,5 @@ Test permission of files created by push:
|
|||||||
640
|
640
|
||||||
|
|
||||||
$ cd ..
|
$ cd ..
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
$ "$TESTDIR/hghave" unix-permissions serve || exit 80
|
$ "$TESTDIR/hghave" serve || exit 80
|
||||||
$ USERCACHE=`pwd`/cache; export USERCACHE
|
$ USERCACHE=`pwd`/cache; export USERCACHE
|
||||||
$ mkdir -p ${USERCACHE}
|
$ mkdir -p ${USERCACHE}
|
||||||
$ cat >> $HGRCPATH <<EOF
|
$ cat >> $HGRCPATH <<EOF
|
||||||
@ -1018,6 +1018,8 @@ Push a largefiles repository to a served empty repository
|
|||||||
used all HGPORTs, kill all daemons
|
used all HGPORTs, kill all daemons
|
||||||
$ "$TESTDIR/killdaemons.py"
|
$ "$TESTDIR/killdaemons.py"
|
||||||
|
|
||||||
|
#if unix-permissions
|
||||||
|
|
||||||
Clone a local repository owned by another user
|
Clone a local repository owned by another user
|
||||||
We have to simulate that here by setting $HOME and removing write permissions
|
We have to simulate that here by setting $HOME and removing write permissions
|
||||||
$ ORIGHOME="$HOME"
|
$ 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
|
$ chmod -R u+w alice/pubrepo
|
||||||
$ HOME="$ORIGHOME"
|
$ HOME="$ORIGHOME"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#if symlink
|
#if symlink
|
||||||
|
|
||||||
Symlink to a large largefile should behave the same as a symlink to a normal file
|
Symlink to a large largefile should behave the same as a symlink to a normal file
|
||||||
|
Loading…
Reference in New Issue
Block a user