Debian Codegraph @

tests/test-narrow-acl.t

raw
1 Make a narrow clone then archive it
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=f1 f2
15 > EOF
16 $ hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid
17 $ cat hg.pid >> "$DAEMON_PIDS"
18
19 $ cd ..
20 $ hg clone http://localhost:$HGPORT1 narrowclone1
21 requesting all changes
22 adding changesets
23 adding manifests
24 adding file changes
25 added 3 changesets with 2 changes to 2 files
26 new changesets * (glob)
27 updating to branch default
28 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
29
30 The clone directory should only contain f1 and f2
31 $ ls -A -1 narrowclone1 | sort
32 .hg
33 f1
34 f2
35
36 Requirements should contain narrowhg
37 $ hg debugrequires -R narrowclone1 | grep narrowhg
38 narrowhg-experimental
39
40 NarrowHG should track f1 and f2
41 $ hg -R narrowclone1 tracked
42 I path:f1
43 I path:f2
44
45 Narrow should not be able to widen to include f3
46 $ hg -R narrowclone1 tracked --addinclude f3
47 comparing with http://localhost:$HGPORT1/
48 searching for changes
49 abort: The following includes are not accessible for test: ['path:f3']
50 [255]
51 $ ls -A -1 narrowclone1 | sort
52 .hg
53 f1
54 f2
55 $ hg -R narrowclone1 tracked
56 I path:f1
57 I path:f2
58
59 Narrow should allow widen to include f2
60 $ hg -R narrowclone1 tracked --removeinclude f2 > /dev/null
61 $ hg -R narrowclone1 tracked
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/
68 searching for changes
69 adding changesets
70 adding manifests
71 adding file changes
72 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
77 .hg
78 f1
79 f2