~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-21 13:36:51 UTC
  • mfrom: (5243.2.1 readdir_cleanup)
  • Revision ID: pqm@pqm.ubuntu.com-20100521133651-p62dndo2giy5ls21
(lifeless) Some cleanups to the readdir pyrex code for a little efficiency
 and to avoid compile warnings. (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    errors,
29
29
    workingtree,
30
30
    )
31
 
from bzrlib.tests import (
32
 
    TestCaseWithTransport,
 
31
from bzrlib.tests.blackbox import (
 
32
    ExternalBase,
33
33
    )
34
34
from bzrlib.tests import (
 
35
    HardlinkFeature,
35
36
    KnownFailure,
36
37
    )
37
 
from bzrlib.tests.features import (
38
 
    HardlinkFeature,
39
 
    )
40
 
 
41
 
 
42
 
class TestCheckout(TestCaseWithTransport):
 
38
 
 
39
 
 
40
class TestCheckout(ExternalBase):
43
41
 
44
42
    def setUp(self):
45
43
        super(TestCheckout, self).setUp()
71
69
        # from 1.
72
70
        result = bzrdir.BzrDir.open('checkout')
73
71
        self.assertEqual(['1'], result.open_workingtree().get_parent_ids())
74
 
        self.assertPathDoesNotExist('checkout/added_in_2')
 
72
        self.failIfExists('checkout/added_in_2')
75
73
 
76
74
    def test_checkout_light_dash_r(self):
77
75
        out, err = self.run_bzr(['checkout','--lightweight', '-r', '-2',
80
78
        # from 1.
81
79
        result = bzrdir.BzrDir.open('checkout')
82
80
        self.assertEqual(['1'], result.open_workingtree().get_parent_ids())
83
 
        self.assertPathDoesNotExist('checkout/added_in_2')
 
81
        self.failIfExists('checkout/added_in_2')
84
82
 
85
83
    def test_checkout_reconstitutes_working_trees(self):
86
84
        # doing a 'bzr checkout' in the directory of a branch with no tree
126
124
            cmd.append('--lightweight')
127
125
        self.run_bzr('checkout source target')
128
126
        # files with unique content should be moved
129
 
        self.assertPathExists('target/file2.moved')
 
127
        self.failUnlessExists('target/file2.moved')
130
128
        # files with content matching tree should not be moved
131
 
        self.assertPathDoesNotExist('target/file1.moved')
 
129
        self.failIfExists('target/file1.moved')
132
130
 
133
131
    def test_checkout_existing_dir_heavy(self):
134
132
        self._test_checkout_existing_dir(False)
158
156
        self.build_tree(['source/file1'])
159
157
        source.add('file1')
160
158
        source.commit('added file')
161
 
        out, err = self.run_bzr('checkout source target --hardlink')
 
159
        out, err = self.run_bzr(['checkout', 'source', 'target',
 
160
            '--files-from', 'source',
 
161
            '--hardlink'])
162
162
        source_stat = os.stat('source/file1')
163
163
        target_stat = os.stat('target/file1')
164
164
        self.assertEqual(source_stat, target_stat)
165
 
 
166
 
    def test_checkout_hardlink_files_from(self):
167
 
        self.requireFeature(HardlinkFeature)
168
 
        source = self.make_branch_and_tree('source')
169
 
        self.build_tree(['source/file1'])
170
 
        source.add('file1')
171
 
        source.commit('added file')
172
 
        source.bzrdir.sprout('second')
173
 
        out, err = self.run_bzr('checkout source target --hardlink'
174
 
                                ' --files-from second')
175
 
        second_stat = os.stat('second/file1')
176
 
        target_stat = os.stat('target/file1')
177
 
        self.assertEqual(second_stat, target_stat)