##// END OF EJS Templates
tests: convert some hghave unix-permissions to #if
Mads Kiilerich -
r16986:79902f7e default
parent child Browse files
Show More
@@ -1,5 +1,3 b''
1 $ "$TESTDIR/hghave" unix-permissions || exit 80
2
3 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
2 > [extensions]
5 > convert=
3 > convert=
@@ -293,24 +291,27 b''
293 pulling from ../a
291 pulling from ../a
294 searching for changes
292 searching for changes
295 no changes found
293 no changes found
296 $ touch bogusfile
297
294
298 should fail
295 conversion to existing file should fail
299
296
297 $ touch bogusfile
300 $ hg convert a bogusfile
298 $ hg convert a bogusfile
301 initializing destination bogusfile repository
299 initializing destination bogusfile repository
302 abort: cannot create new bundle repository
300 abort: cannot create new bundle repository
303 [255]
301 [255]
302
303 #if unix-permissions
304
305 conversion to dir without permissions should fail
306
304 $ mkdir bogusdir
307 $ mkdir bogusdir
305 $ chmod 000 bogusdir
308 $ chmod 000 bogusdir
306
309
307 should fail
308
309 $ hg convert a bogusdir
310 $ hg convert a bogusdir
310 abort: Permission denied: bogusdir
311 abort: Permission denied: bogusdir
311 [255]
312 [255]
312
313
313 should succeed
314 user permissions should succeed
314
315
315 $ chmod 700 bogusdir
316 $ chmod 700 bogusdir
316 $ hg convert a bogusdir
317 $ hg convert a bogusdir
@@ -324,6 +325,8 b' should succeed'
324 1 d
325 1 d
325 0 e
326 0 e
326
327
328 #endif
329
327 test pre and post conversion actions
330 test pre and post conversion actions
328
331
329 $ echo 'include b' > filemap
332 $ echo 'include b' > filemap
@@ -1,5 +1,3 b''
1 $ "$TESTDIR/hghave" unix-permissions || exit 80
2
3 Test EOL extension
1 Test EOL extension
4
2
5 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
@@ -386,10 +384,13 b' Mixed tests'
386 % hg status
384 % hg status
387 $ rm -r mixed
385 $ rm -r mixed
388
386
387 $ echo '[extensions]' >> $HGRCPATH
388 $ echo 'eol =' >> $HGRCPATH
389
390 #if unix-permissions
391
389 Test issue2569 -- eol extension takes write lock on reading:
392 Test issue2569 -- eol extension takes write lock on reading:
390
393
391 $ echo '[extensions]' >> $HGRCPATH
392 $ echo 'eol =' >> $HGRCPATH
393 $ hg init repo
394 $ hg init repo
394 $ cd repo
395 $ cd repo
395 $ touch .hgeol
396 $ touch .hgeol
@@ -403,6 +404,8 b' Test issue2569 -- eol extension takes wr'
403 $ chmod -R u+w .hg
404 $ chmod -R u+w .hg
404 $ cd ..
405 $ cd ..
405
406
407 #endif
408
406 Test cleverencode: and cleverdecode: aliases for win32text extension
409 Test cleverencode: and cleverdecode: aliases for win32text extension
407
410
408 $ echo '[encode]' >> $HGRCPATH
411 $ echo '[encode]' >> $HGRCPATH
@@ -1,5 +1,3 b''
1 $ "$TESTDIR/hghave" unix-permissions || exit 80
2
3 Create user cache directory
1 Create user cache directory
4
2
5 $ USERCACHE=`pwd`/cache; export USERCACHE
3 $ USERCACHE=`pwd`/cache; export USERCACHE
@@ -72,10 +70,12 b' Update working directory to tip, again.'
72 0 largefiles updated, 0 removed
70 0 largefiles updated, 0 removed
73 $ hg status
71 $ hg status
74 ! large
72 ! large
73 $ cd ..
74
75 #if unix-permissions
75
76
76 Portable way to print file permissions:
77 Portable way to print file permissions:
77
78
78 $ cd ..
79 $ cat > ls-l.py <<EOF
79 $ cat > ls-l.py <<EOF
80 > #!/usr/bin/env python
80 > #!/usr/bin/env python
81 > import sys, os
81 > import sys, os
@@ -121,3 +121,5 b' Test permission of files created by push'
121 640
121 640
122
122
123 $ cd ..
123 $ cd ..
124
125 #endif
@@ -1,4 +1,4 b''
1 $ "$TESTDIR/hghave" unix-permissions serve || exit 80
1 $ "$TESTDIR/hghave" serve || exit 80
2 $ USERCACHE=`pwd`/cache; export USERCACHE
2 $ USERCACHE=`pwd`/cache; export USERCACHE
3 $ mkdir -p ${USERCACHE}
3 $ mkdir -p ${USERCACHE}
4 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
@@ -1018,6 +1018,8 b' Push a largefiles repository to a served'
1018 used all HGPORTs, kill all daemons
1018 used all HGPORTs, kill all daemons
1019 $ "$TESTDIR/killdaemons.py"
1019 $ "$TESTDIR/killdaemons.py"
1020
1020
1021 #if unix-permissions
1022
1021 Clone a local repository owned by another user
1023 Clone a local repository owned by another user
1022 We have to simulate that here by setting $HOME and removing write permissions
1024 We have to simulate that here by setting $HOME and removing write permissions
1023 $ ORIGHOME="$HOME"
1025 $ ORIGHOME="$HOME"
@@ -1051,6 +1053,8 b' We have to simulate that here by setting'
1051 $ chmod -R u+w alice/pubrepo
1053 $ chmod -R u+w alice/pubrepo
1052 $ HOME="$ORIGHOME"
1054 $ HOME="$ORIGHOME"
1053
1055
1056 #endif
1057
1054 #if symlink
1058 #if symlink
1055
1059
1056 Symlink to a large largefile should behave the same as a symlink to a normal file
1060 Symlink to a large largefile should behave the same as a symlink to a normal file
General Comments 0
You need to be logged in to leave comments. Login now