74
74
self.assertEqualMode(mode, b.control_files._dir_mode)
75
75
self.assertEqualMode(mode & ~07111, b.control_files._file_mode)
79
b = self.make_branch('d')
80
self.assertEqualMode(0700, b.bzrdir._get_dir_mode())
81
self.assertEqualMode(0600, b.bzrdir._get_file_mode())
82
self.assertEqualMode(0700, b.control_files._dir_mode)
83
self.assertEqualMode(0600, b.control_files._file_mode)
84
check_mode_r(self, 'd/.bzr', 00600, 00700)
86
def test_new_branch_group_sticky_bit(self):
87
if isinstance(self.branch_format, RemoteBranchFormat):
88
# Remote branch format have no permission logic in them; there's
89
# nothing to test here.
90
raise tests.TestNotApplicable('Remote branches have no'
92
if sys.platform == 'win32':
93
raise tests.TestNotApplicable('chmod has no effect on win32')
94
elif sys.platform == 'darwin':
95
# OS X creates temp dirs with the 'wheel' group, which users are
96
# not likely to be in, and this prevents us from setting the sgid
98
os.chown(self.test_dir, os.getuid(), os.getgid())
99
# also, these are BzrBranch format specific things..
100
t = self.make_branch_and_tree('.')
78
103
os.chmod('b', 02777)
79
104
b = self.make_branch('b')
92
117
self.assertEqualMode(00640, b.control_files._file_mode)
93
118
check_mode_r(self, 'c/.bzr', 00640, 02750)
97
b = self.make_branch('d')
98
self.assertEqualMode(0700, b.bzrdir._get_dir_mode())
99
self.assertEqualMode(0600, b.bzrdir._get_file_mode())
100
self.assertEqualMode(0700, b.control_files._dir_mode)
101
self.assertEqualMode(0600, b.control_files._file_mode)
102
check_mode_r(self, 'd/.bzr', 00600, 00700)
104
120
def test_mode_0(self):
105
121
"""Test when a transport returns null permissions for .bzr"""
106
122
if isinstance(self.branch_format, RemoteBranchFormat):