~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2007-08-30 08:11:54 UTC
  • mfrom: (2766 +trunk)
  • mto: (2535.3.55 repo-refactor)
  • mto: This revision was merged to the branch mainline in revision 2772.
  • Revision ID: andrew.bennetts@canonical.com-20070830081154-16hebp2xwr15x2hc
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        # with no diff
104
104
        out, err = self.run_bzr('diff')
105
105
 
 
106
    def _test_checkout_existing_dir(self, lightweight):
 
107
        source = self.make_branch_and_tree('source')
 
108
        self.build_tree_contents([('source/file1', 'content1'),
 
109
                                  ('source/file2', 'content2'),])
 
110
        source.add(['file1', 'file2'])
 
111
        source.commit('added files')
 
112
        self.build_tree_contents([('target/', ''),
 
113
                                  ('target/file1', 'content1'),
 
114
                                  ('target/file2', 'content3'),])
 
115
        cmd = ['checkout', 'source', 'target']
 
116
        if lightweight:
 
117
            cmd.append('--lightweight')
 
118
        self.run_bzr('checkout source target')
 
119
        # files with unique content should be moved
 
120
        self.failUnlessExists('target/file2.moved')
 
121
        # files with content matching tree should not be moved
 
122
        self.failIfExists('target/file1.moved')
 
123
 
 
124
    def test_checkout_existing_dir_heavy(self):
 
125
        self._test_checkout_existing_dir(False)
 
126
 
 
127
    def test_checkout_existing_dir_lightweight(self):
 
128
        self._test_checkout_existing_dir(True)
 
129
 
106
130
    def test_checkout_in_branch_with_r(self):
107
131
        branch = _mod_branch.Branch.open('branch')
108
132
        branch.bzrdir.destroy_workingtree()
112
136
        self.assertEqual('1', tree.last_revision())
113
137
        branch.bzrdir.destroy_workingtree()
114
138
        self.run_bzr('checkout -r 0')
115
 
        self.assertIs(None, tree.last_revision())
 
139
        self.assertEqual('null:', tree.last_revision())