tests/test-narrow-acl-excludes.t
branchstable
changeset 51308 bf7c24e12fad
parent 49241 6b10151b9621
child 51309 9b44b25dece1
equal deleted inserted replaced
51280:c17cf2d51ff4 51308:bf7c24e12fad
       
     1 Test exclusion-based ACL enforcement
       
     2   $ . "$TESTDIR/narrow-library.sh"
       
     3 
       
     4   $ hg init master
       
     5   $ cd master
       
     6 
       
     7   $ for x in `$TESTDIR/seq.py 3`; do
       
     8   >   echo $x > "f$x"
       
     9   >   hg add "f$x"
       
    10   >   hg commit -m "Add $x"
       
    11   > done
       
    12   $ cat >> .hg/hgrc << EOF
       
    13   > [narrowacl]
       
    14   > default.includes=*
       
    15   > default.excludes=f2 f3
       
    16   > test.excludes=f3
       
    17   > EOF
       
    18   $ hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid
       
    19   $ cat hg.pid >> "$DAEMON_PIDS"
       
    20 
       
    21   $ cd ..
       
    22   $ hg clone http://localhost:$HGPORT1 narrowclone1
       
    23   requesting all changes
       
    24   adding changesets
       
    25   adding manifests
       
    26   adding file changes
       
    27   added 3 changesets with 2 changes to 2 files
       
    28   new changesets * (glob)
       
    29   updating to branch default
       
    30   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    31 
       
    32 The clone directory should only contain f1 and f2
       
    33   $ ls -A -1 narrowclone1 | sort
       
    34   .hg
       
    35   f1
       
    36   f2
       
    37 
       
    38 Requirements should contain narrowhg
       
    39   $ hg debugrequires -R narrowclone1 | grep narrowhg
       
    40   narrowhg-experimental
       
    41 
       
    42 NarrowHG should exclude f3.
       
    43   $ hg -R narrowclone1 tracked
       
    44   I path:.
       
    45   X path:f3
       
    46 
       
    47 Narrow should not be able to widen to include f3
       
    48   $ hg -R narrowclone1 tracked --addinclude f3
       
    49   comparing with http://localhost:$HGPORT1/
       
    50   searching for changes
       
    51   adding changesets
       
    52   adding manifests
       
    53   adding file changes
       
    54   $ ls -A -1 narrowclone1 | sort
       
    55   .hg
       
    56   f1
       
    57   f2
       
    58   $ hg -R narrowclone1 tracked
       
    59   I path:.
       
    60   X path:f3
       
    61 
       
    62 
       
    63 Narrow should not be able to remove the exclusion for f3
       
    64   $ hg -R narrowclone1 tracked --removeexclude f3
       
    65   comparing with http://localhost:$HGPORT1/
       
    66   searching for changes
       
    67   adding changesets
       
    68   adding manifests
       
    69   adding file changes
       
    70   added 0 changesets with 1 changes to 1 files
       
    71   $ ls -A -1 narrowclone1 | sort
       
    72   .hg
       
    73   f1
       
    74   f2
       
    75   f3
       
    76   $ hg -R narrowclone1 tracked
       
    77   I path:.
       
    78 
       
    79 
       
    80 XXX: BUG! This test demonstrates that we are presently
       
    81 able to gain access to f3 by removing the exclusion.