~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_permissions.py

  • Committer: Robert Collins
  • Date: 2006-02-11 11:58:06 UTC
  • mto: (1534.1.22 integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: robertc@robertcollins.net-20060211115806-732dabc1e35714ed
Give format3 working trees their own last-revision marker.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2005 by Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
 
#
 
3
 
4
4
# This program is free software; you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License as published by
6
6
# the Free Software Foundation; either version 2 of the License, or
7
7
# (at your option) any later version.
8
 
#
 
8
 
9
9
# This program is distributed in the hope that it will be useful,
10
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
12
# GNU General Public License for more details.
13
 
#
 
13
 
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
37
37
 
38
38
from bzrlib.branch import Branch
39
39
from bzrlib.bzrdir import BzrDir
40
 
from bzrlib.lockable_files import LockableFiles, TransportLock
 
40
from bzrlib.lockable_files import LockableFiles
41
41
from bzrlib.tests import TestCaseWithTransport, TestSkipped
42
42
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
43
43
from bzrlib.transport import get_transport
157
157
        try:
158
158
            transport = get_transport(self.get_url())
159
159
            transport.put('my-lock', StringIO(''))
160
 
            lockable = LockableFiles(transport, 'my-lock', TransportLock)
 
160
            lockable = LockableFiles(transport, 'my-lock')
161
161
            self.assertNotEqual(None, lockable._dir_mode)
162
162
            self.assertNotEqual(None, lockable._file_mode)
163
163
 
164
164
            LockableFiles._set_dir_mode = False
165
165
            transport = get_transport('.')
166
 
            lockable = LockableFiles(transport, 'my-lock', TransportLock)
 
166
            lockable = LockableFiles(transport, 'my-lock')
167
167
            self.assertEqual(None, lockable._dir_mode)
168
168
            self.assertNotEqual(None, lockable._file_mode)
169
169
 
170
170
            LockableFiles._set_file_mode = False
171
171
            transport = get_transport('.')
172
 
            lockable = LockableFiles(transport, 'my-lock', TransportLock)
 
172
            lockable = LockableFiles(transport, 'my-lock')
173
173
            self.assertEqual(None, lockable._dir_mode)
174
174
            self.assertEqual(None, lockable._file_mode)
175
175
 
176
176
            LockableFiles._set_dir_mode = True
177
177
            transport = get_transport('.')
178
 
            lockable = LockableFiles(transport, 'my-lock', TransportLock)
 
178
            lockable = LockableFiles(transport, 'my-lock')
179
179
            self.assertNotEqual(None, lockable._dir_mode)
180
180
            self.assertEqual(None, lockable._file_mode)
181
181
 
182
182
            LockableFiles._set_file_mode = True
183
183
            transport = get_transport('.')
184
 
            lockable = LockableFiles(transport, 'my-lock', TransportLock)
 
184
            lockable = LockableFiles(transport, 'my-lock')
185
185
            self.assertNotEqual(None, lockable._dir_mode)
186
186
            self.assertNotEqual(None, lockable._file_mode)
187
187
        finally:
213
213
        check_mode_r(self, 'local/.bzr', 0644, 0755)
214
214
 
215
215
        t = WorkingTree.open('local')
216
 
        b_local = t.branch
 
216
        b = t.branch
217
217
        self.assertEqualMode(0755, b_local.control_files._dir_mode)
218
218
        self.assertEqualMode(0644, b_local.control_files._file_mode)
219
219