Mercurial > hg
annotate tests/test-inherit-mode.t @ 12515:b6a784e39ad4
tests: unify test-convert-bzr-ghosts
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 26 Sep 2010 14:36:49 -0500 |
parents | bb69460e9d2d |
children | 4c4aeaab2339 |
rev | line source |
---|---|
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
1 test that new files created in .hg inherit the permissions from .hg/store |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
2 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
3 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
4 $ "$TESTDIR/hghave" unix-permissions || exit 80 |
6064
c608f67a87c0
add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
5 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
6 $ mkdir dir |
6064
c608f67a87c0
add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
7 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
8 just in case somebody has a strange $TMPDIR |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
9 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
10 $ chmod g-s dir |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
11 $ cd dir |
6064
c608f67a87c0
add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
12 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
13 $ cat >printmodes.py <<EOF |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
14 > import os, sys |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
15 > |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
16 > allnames = [] |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
17 > isdir = {} |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
18 > for root, dirs, files in os.walk(sys.argv[1]): |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
19 > for d in dirs: |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
20 > name = os.path.join(root, d) |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
21 > isdir[name] = 1 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
22 > allnames.append(name) |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
23 > for f in files: |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
24 > name = os.path.join(root, f) |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
25 > allnames.append(name) |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
26 > allnames.sort() |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
27 > for name in allnames: |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
28 > suffix = name in isdir and '/' or '' |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
29 > print '%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix) |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
30 > EOF |
6064
c608f67a87c0
add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
31 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
32 $ cat >mode.py <<EOF |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
33 > import sys |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
34 > import os |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
35 > print '%05o' % os.lstat(sys.argv[1]).st_mode |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
36 > EOF |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
37 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
38 $ umask 077 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
39 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
40 $ hg init repo |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
41 $ cd repo |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
42 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
43 $ chmod 0770 .hg/store |
6064
c608f67a87c0
add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
44 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
45 before commit |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
46 store can be written by the group, other files cannot |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
47 store is setgid |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
48 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
49 $ python ../printmodes.py . |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
50 00700 ./.hg/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
51 00600 ./.hg/00changelog.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
52 00600 ./.hg/requires |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
53 00770 ./.hg/store/ |
6113
8ca25589e960
try to fix test-inherit-mode on HFS+
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6073
diff
changeset
|
54 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
55 $ mkdir dir |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
56 $ touch foo dir/bar |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
57 $ hg ci -qAm 'add files' |
6064
c608f67a87c0
add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
58 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
59 after commit |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
60 working dir files can only be written by the owner |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
61 files created in .hg can be written by the group |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
62 (in particular, store/**, dirstate, branch cache file, undo files) |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
63 new directories are setgid |
6064
c608f67a87c0
add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
64 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
65 $ python ../printmodes.py . |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
66 00700 ./.hg/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
67 00600 ./.hg/00changelog.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
68 00660 ./.hg/dirstate |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
69 00660 ./.hg/last-message.txt |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
70 00600 ./.hg/requires |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
71 00770 ./.hg/store/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
72 00660 ./.hg/store/00changelog.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
73 00660 ./.hg/store/00manifest.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
74 00770 ./.hg/store/data/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
75 00770 ./.hg/store/data/dir/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
76 00660 ./.hg/store/data/dir/bar.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
77 00660 ./.hg/store/data/foo.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
78 00660 ./.hg/store/fncache |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
79 00660 ./.hg/store/undo |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
80 00660 ./.hg/undo.branch |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
81 00660 ./.hg/undo.desc |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
82 00660 ./.hg/undo.dirstate |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
83 00700 ./dir/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
84 00600 ./dir/bar |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
85 00600 ./foo |
6064
c608f67a87c0
add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
86 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
87 $ umask 007 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
88 $ hg init ../push |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
89 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
90 before push |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
91 group can write everything |
6064
c608f67a87c0
add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
92 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
93 $ python ../printmodes.py ../push |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
94 00770 ../push/.hg/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
95 00660 ../push/.hg/00changelog.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
96 00660 ../push/.hg/requires |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
97 00770 ../push/.hg/store/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
98 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
99 $ umask 077 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
100 $ hg -q push ../push |
6064
c608f67a87c0
add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
101 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
102 after push |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
103 group can still write everything |
6113
8ca25589e960
try to fix test-inherit-mode on HFS+
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6073
diff
changeset
|
104 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
105 $ python ../printmodes.py ../push |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
106 00770 ../push/.hg/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
107 00660 ../push/.hg/00changelog.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
108 00660 ../push/.hg/branchheads.cache |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
109 00660 ../push/.hg/requires |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
110 00770 ../push/.hg/store/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
111 00660 ../push/.hg/store/00changelog.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
112 00660 ../push/.hg/store/00manifest.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
113 00770 ../push/.hg/store/data/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
114 00770 ../push/.hg/store/data/dir/ |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
115 00660 ../push/.hg/store/data/dir/bar.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
116 00660 ../push/.hg/store/data/foo.i |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
117 00660 ../push/.hg/store/fncache |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
118 00660 ../push/.hg/store/undo |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
119 00660 ../push/.hg/undo.branch |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
120 00660 ../push/.hg/undo.desc |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
121 00660 ../push/.hg/undo.dirstate |
6113
8ca25589e960
try to fix test-inherit-mode on HFS+
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
6073
diff
changeset
|
122 |
12096
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
123 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
124 Test that we don't lose the setgid bit when we call chmod. |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
125 Not all systems support setgid directories (e.g. HFS+), so |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
126 just check that directories have the same mode. |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
127 |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
128 $ cd .. |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
129 $ hg init setgid |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
130 $ cd setgid |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
131 $ chmod g+rwx .hg/store |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
132 $ chmod g+s .hg/store 2> /dev/null |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
133 $ mkdir dir |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
134 $ touch dir/file |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
135 $ hg ci -qAm 'add dir/file' |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
136 $ storemode=`python ../mode.py .hg/store` |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
137 $ dirmode=`python ../mode.py .hg/store/data/dir` |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
138 $ if [ "$storemode" != "$dirmode" ]; then |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
139 > echo "$storemode != $dirmode" |
bb69460e9d2d
tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
6301
diff
changeset
|
140 $ fi |