/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_upgrade.py

Merge 2.0 into 2.1 including fixes for #262450, #373898, #498409

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2009 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
27
27
    TestCaseInTempDir,
28
28
    TestCaseWithTransport,
29
29
    TestUIFactory,
 
30
    posix_permissions_feature,
30
31
    )
31
32
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
32
33
from bzrlib.transport import get_transport
154
155
        self.run_bzr('init-repository --format=metaweave repo')
155
156
        self.run_bzr('upgrade --format=knit repo')
156
157
 
 
158
    def test_upgrade_permission_check(self):
 
159
        """'backup.bzr' should retain permissions of .bzr. Bug #262450"""
 
160
        self.requireFeature(posix_permissions_feature)
 
161
        import os, stat
 
162
        old_perms = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
 
163
        backup_dir = 'backup.bzr'
 
164
        self.run_bzr('init --format=1.6')
 
165
        os.chmod('.bzr', old_perms)
 
166
        self.run_bzr('upgrade')
 
167
        new_perms = os.stat(backup_dir).st_mode & 0777
 
168
        self.assertTrue(new_perms == old_perms)
 
169
 
157
170
 
158
171
class SFTPTests(TestCaseWithSFTPServer):
159
172
    """Tests for upgrade over sftp."""