##// END OF EJS Templates
narrow: add test demonstrating bug in acl exclusion enforcement
Arun Kulshreshtha -
r52201:bf7c24e1 stable
parent child Browse files
Show More
@@ -1,4 +1,4 b''
1 Make a narrow clone then archive it
1 Test exclusion-based ACL enforcement
2 $ . "$TESTDIR/narrow-library.sh"
2 $ . "$TESTDIR/narrow-library.sh"
3
3
4 $ hg init master
4 $ hg init master
@@ -11,7 +11,9 b' Make a narrow clone then archive it'
11 > done
11 > done
12 $ cat >> .hg/hgrc << EOF
12 $ cat >> .hg/hgrc << EOF
13 > [narrowacl]
13 > [narrowacl]
14 > default.includes=f1 f2
14 > default.includes=*
15 > default.excludes=f2 f3
16 > test.excludes=f3
15 > EOF
17 > EOF
16 $ hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid
18 $ hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid
17 $ cat hg.pid >> "$DAEMON_PIDS"
19 $ cat hg.pid >> "$DAEMON_PIDS"
@@ -37,43 +39,43 b' Requirements should contain narrowhg'
37 $ hg debugrequires -R narrowclone1 | grep narrowhg
39 $ hg debugrequires -R narrowclone1 | grep narrowhg
38 narrowhg-experimental
40 narrowhg-experimental
39
41
40 NarrowHG should track f1 and f2
42 NarrowHG should exclude f3.
41 $ hg -R narrowclone1 tracked
43 $ hg -R narrowclone1 tracked
42 I path:f1
44 I path:.
43 I path:f2
45 X path:f3
44
46
45 Narrow should not be able to widen to include f3
47 Narrow should not be able to widen to include f3
46 $ hg -R narrowclone1 tracked --addinclude f3
48 $ hg -R narrowclone1 tracked --addinclude f3
47 comparing with http://localhost:$HGPORT1/
49 comparing with http://localhost:$HGPORT1/
48 searching for changes
50 searching for changes
49 abort: The following includes are not accessible for test: ['path:f3']
51 adding changesets
50 [255]
52 adding manifests
53 adding file changes
51 $ ls -A -1 narrowclone1 | sort
54 $ ls -A -1 narrowclone1 | sort
52 .hg
55 .hg
53 f1
56 f1
54 f2
57 f2
55 $ hg -R narrowclone1 tracked
58 $ hg -R narrowclone1 tracked
56 I path:f1
59 I path:.
57 I path:f2
60 X path:f3
58
61
59 Narrow should allow widen to include f2
62
60 $ hg -R narrowclone1 tracked --removeinclude f2 > /dev/null
63 Narrow should not be able to remove the exclusion for f3
61 $ hg -R narrowclone1 tracked
64 $ hg -R narrowclone1 tracked --removeexclude f3
62 I path:f1
63 $ ls -A -1 narrowclone1 | sort
64 .hg
65 f1
66 $ hg -R narrowclone1 tracked --addinclude f2
67 comparing with http://localhost:$HGPORT1/
65 comparing with http://localhost:$HGPORT1/
68 searching for changes
66 searching for changes
69 adding changesets
67 adding changesets
70 adding manifests
68 adding manifests
71 adding file changes
69 adding file changes
72 added 0 changesets with 1 changes to 1 files
70 added 0 changesets with 1 changes to 1 files
73 $ hg -R narrowclone1 tracked
74 I path:f1
75 I path:f2
76 $ ls -A -1 narrowclone1 | sort
71 $ ls -A -1 narrowclone1 | sort
77 .hg
72 .hg
78 f1
73 f1
79 f2
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.
General Comments 0
You need to be logged in to leave comments. Login now