~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_permissions.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-11 21:41:24 UTC
  • mto: This revision was merged to the branch mainline in revision 3543.
  • Revision ID: john@arbash-meinel.com-20080711214124-qi09irlj7pd5cuzg
Shortcut the case when one revision is in the ancestry of the other.

At the cost of a heads() check, when one parent supersedes, we don't have to extract
the text for the other. Changes merge time from 3m37s => 3m21s. Using a
CachingParentsProvider would drop the time down to 3m11s.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
# TODO: jam 20051215 Currently the default behavior for 'bzr branch' is just 
30
30
#                    defined by the local umask. This isn't terrible, is it
31
31
#                    the truly desired behavior?
32
 
 
 
32
 
33
33
import os
34
34
import sys
35
35
import stat
38
38
 
39
39
from bzrlib.branch import Branch
40
40
from bzrlib.bzrdir import BzrDir
 
41
from bzrlib.lockable_files import LockableFiles, TransportLock
41
42
from bzrlib.tests import TestCaseWithTransport, TestSkipped
42
43
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
43
44
from bzrlib.transport import get_transport
137
138
        t.commit('new c')
138
139
        check_mode_r(self, '.bzr', 0664, 0775)
139
140
 
140
 
    def test_new_files_group_sticky_bit(self):
141
 
        if sys.platform == 'win32':
142
 
            raise TestSkipped('chmod has no effect on win32')
143
 
        elif sys.platform == 'darwin':
144
 
            # OS X creates temp dirs with the 'wheel' group, which users are
145
 
            # not likely to be in, and this prevents us from setting the sgid
146
 
            # bit
147
 
            os.chown(self.test_dir, os.getuid(), os.getgid())
148
 
 
149
 
        t = self.make_branch_and_tree('.')
150
 
        b = t.branch
151
 
 
152
141
        # Test the group sticky bit
153
142
        # Recursively update the modes of all files
154
143
        chmod_r('.bzr', 0664, 02775)