annotate tests/test-inherit-mode.t @ 22691:d8a08b68f754

revset: add a `__nonzero__` to baseset We are about to add a base class for `baseset` with an abstract `__nonzero__` method. So we need this method to be explicitly defined to avoid issues. The built-in list object apparently does not have a `__nonzero__` and relies on `__len__` for this purpose?
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 01 Oct 2014 15:03:16 -0500
parents 37f46575d9c2
children 7d63398fbfd1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 20185
diff changeset
1 #require unix-permissions
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
2
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 20185
diff changeset
3 test that new files created in .hg inherit the permissions from .hg/store
6064
c608f67a87c0 add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
4
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
5 $ mkdir dir
6064
c608f67a87c0 add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
6
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
7 just in case somebody has a strange $TMPDIR
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
8
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
9 $ chmod g-s dir
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
10 $ cd dir
6064
c608f67a87c0 add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
11
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
12 $ cat >printmodes.py <<EOF
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
13 > import os, sys
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
14 >
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
15 > allnames = []
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
16 > isdir = {}
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
17 > 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
18 > for d in dirs:
12743
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12096
diff changeset
19 > name = os.path.join(root, d)
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12096
diff changeset
20 > isdir[name] = 1
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12096
diff changeset
21 > allnames.append(name)
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
22 > for f in files:
12743
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12096
diff changeset
23 > name = os.path.join(root, f)
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12096
diff changeset
24 > allnames.append(name)
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
25 > allnames.sort()
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
26 > for name in allnames:
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
27 > suffix = name in isdir and '/' or ''
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
28 > 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
29 > EOF
6064
c608f67a87c0 add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
30
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
31 $ cat >mode.py <<EOF
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
32 > import sys
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
33 > import os
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
34 > 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
35 > EOF
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
36
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
37 $ umask 077
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
38
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
39 $ hg init repo
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
40 $ cd repo
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
41
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
42 $ chmod 0770 .hg/store
6064
c608f67a87c0 add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
43
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
44 before commit
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
45 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
46 store is setgid
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
47
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
48 $ python ../printmodes.py .
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
49 00700 ./.hg/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
50 00600 ./.hg/00changelog.i
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
51 00600 ./.hg/requires
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
52 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
53
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
54 $ mkdir dir
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
55 $ touch foo dir/bar
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
56 $ hg ci -qAm 'add files'
6064
c608f67a87c0 add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
57
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
58 after commit
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
59 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
60 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
61 (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
62 new directories are setgid
6064
c608f67a87c0 add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
63
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
64 $ python ../printmodes.py .
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
65 00700 ./.hg/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
66 00600 ./.hg/00changelog.i
15886
a5917346c72e localrepo: update branchcache in a more reliable way
Mads Kiilerich <mads@kiilerich.com>
parents: 15483
diff changeset
67 00770 ./.hg/cache/
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
68 00660 ./.hg/cache/branch2-served
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
69 00660 ./.hg/dirstate
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
70 00660 ./.hg/last-message.txt
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
71 00600 ./.hg/requires
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
72 00770 ./.hg/store/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
73 00660 ./.hg/store/00changelog.i
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
74 00660 ./.hg/store/00manifest.i
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
75 00770 ./.hg/store/data/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
76 00770 ./.hg/store/data/dir/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
77 00660 ./.hg/store/data/dir/bar.i
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
78 00660 ./.hg/store/data/foo.i
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
79 00660 ./.hg/store/fncache
15483
9ae766f2f452 phases: set new commit in 1-phase
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15455
diff changeset
80 00660 ./.hg/store/phaseroots
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
81 00660 ./.hg/store/undo
15455
c6f87bdab2a1 phases: add rollback support
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 14266
diff changeset
82 00660 ./.hg/store/undo.phaseroots
14266
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13272
diff changeset
83 00660 ./.hg/undo.bookmarks
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
84 00660 ./.hg/undo.branch
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
85 00660 ./.hg/undo.desc
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
86 00660 ./.hg/undo.dirstate
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
87 00700 ./dir/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
88 00600 ./dir/bar
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
89 00600 ./foo
6064
c608f67a87c0 add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
90
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
91 $ umask 007
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
92 $ hg init ../push
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
93
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
94 before push
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
95 group can write everything
6064
c608f67a87c0 add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
96
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
97 $ python ../printmodes.py ../push
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
98 00770 ../push/.hg/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
99 00660 ../push/.hg/00changelog.i
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
100 00660 ../push/.hg/requires
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
101 00770 ../push/.hg/store/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
102
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
103 $ umask 077
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
104 $ hg -q push ../push
6064
c608f67a87c0 add test-inherit-mode
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
105
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
106 after push
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
107 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
108
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
109 $ python ../printmodes.py ../push
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
110 00770 ../push/.hg/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
111 00660 ../push/.hg/00changelog.i
13272
5ccdca7df211 move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents: 12743
diff changeset
112 00770 ../push/.hg/cache/
20185
7d4219512823 branchmap: cache open/closed branch head information
Brodie Rao <brodie@sf.io>
parents: 18382
diff changeset
113 00660 ../push/.hg/cache/branch2-base
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
114 00660 ../push/.hg/requires
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
115 00770 ../push/.hg/store/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
116 00660 ../push/.hg/store/00changelog.i
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
117 00660 ../push/.hg/store/00manifest.i
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
118 00770 ../push/.hg/store/data/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
119 00770 ../push/.hg/store/data/dir/
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
120 00660 ../push/.hg/store/data/dir/bar.i
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
121 00660 ../push/.hg/store/data/foo.i
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
122 00660 ../push/.hg/store/fncache
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
123 00660 ../push/.hg/store/undo
15455
c6f87bdab2a1 phases: add rollback support
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 14266
diff changeset
124 00660 ../push/.hg/store/undo.phaseroots
14266
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13272
diff changeset
125 00660 ../push/.hg/undo.bookmarks
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
126 00660 ../push/.hg/undo.branch
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
127 00660 ../push/.hg/undo.desc
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
128 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
129
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
130
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
131 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
132 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
133 just check that directories have the same mode.
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
134
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
135 $ cd ..
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
136 $ hg init setgid
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
137 $ cd setgid
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
138 $ chmod g+rwx .hg/store
16225
7cf8de5a82d8 tests: ignore the return code of chmod in test-inherit-mode
Javi Merino <cibervicho@gmail.com>
parents: 16025
diff changeset
139 $ chmod g+s .hg/store 2> /dev/null || true
12096
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
140 $ mkdir dir
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
141 $ touch dir/file
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
142 $ hg ci -qAm 'add dir/file'
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
143 $ storemode=`python ../mode.py .hg/store`
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
144 $ dirmode=`python ../mode.py .hg/store/data/dir`
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
145 $ if [ "$storemode" != "$dirmode" ]; then
bb69460e9d2d tests: unify test-inherit-mode
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6301
diff changeset
146 > echo "$storemode != $dirmode"
16912
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16225
diff changeset
147 > fi
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16225
diff changeset
148 $ cd ..
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16225
diff changeset
149
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16225
diff changeset
150 $ cd .. # g-s dir