~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_switch.py

  • Committer: Daniel Watkins
  • Date: 2009-02-07 16:28:55 UTC
  • mto: This revision was merged to the branch mainline in revision 4964.
  • Revision ID: daniel@daniel-watkins.co.uk-20090207162855-qup85ii4zpcfzer0
Added whitebox test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
        self.assertContainsRe(str(err),
97
97
            "Pending merges must be committed or reverted before using switch")
98
98
 
 
99
    def test_switch_with_revision(self):
 
100
        """Test switch when a revision is given."""
 
101
        # Create a tree with 2 revisions
 
102
        tree = self._setup_tree()
 
103
        self.build_tree(['branch-1/file-2'])
 
104
        tree.add('file-2')
 
105
        tree.commit('rev2')
 
106
        # Check it out and switch to revision 1
 
107
        checkout = tree.branch.create_checkout('checkout',
 
108
                                               lightweight=self.lightweight)
 
109
        switch.switch(checkout.bzrdir, tree.branch, revision_id="rev1")
 
110
        self.failUnlessExists('checkout/file-1')
 
111
        self.failIfExists('checkout/file-2')
 
112
 
99
113
 
100
114
class TestSwitchHeavyweight(TestSwitch):
101
115