tests/test-remotefilelog-permissions.t
changeset 40495 3a333a582d7b
child 40571 95a079ea1e19
equal deleted inserted replaced
40494:9aeb9e2d28a7 40495:3a333a582d7b
       
     1   $ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
       
     2   $ export PYTHONPATH
       
     3 
       
     4   $ . "$TESTDIR/remotefilelog-library.sh"
       
     5 
       
     6   $ hginit master
       
     7   $ cd master
       
     8   $ cat >> .hg/hgrc <<EOF
       
     9   > [remotefilelog]
       
    10   > server=True
       
    11   > EOF
       
    12   $ echo x > x
       
    13   $ hg commit -qAm x
       
    14 
       
    15   $ cd ..
       
    16 
       
    17   $ hgcloneshallow ssh://user@dummy/master shallow -q
       
    18   1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
       
    19 
       
    20   $ cd master
       
    21   $ echo xx > x
       
    22   $ hg commit -qAm x2
       
    23   $ cd ..
       
    24 
       
    25 # Test cache misses with read only permissions on server
       
    26 
       
    27   $ chmod -R a-w master/.hg/remotefilelogcache
       
    28   $ cd shallow
       
    29   $ hg pull -q
       
    30   $ hg update
       
    31   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    32   1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
       
    33   $ cd ..
       
    34 
       
    35   $ chmod -R u+w master/.hg/remotefilelogcache
       
    36 
       
    37 # Test setting up shared cache with the right permissions
       
    38 # (this is hard to test in a cross platform way, so we just make sure nothing
       
    39 # crashes)
       
    40 
       
    41   $ rm -rf $CACHEDIR
       
    42   $ umask 002
       
    43   $ mkdir $CACHEDIR
       
    44   $ hg -q clone --shallow ssh://user@dummy/master shallow2 --config remotefilelog.cachegroup="`id -g -n`"
       
    45   1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
       
    46   $ ls -ld $CACHEDIR/11
       
    47   drwxrws* $TESTTMP/hgcache/11 (glob)