/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/test_switch.py

  • Committer: Martin Pool
  • Date: 2010-02-09 19:04:02 UTC
  • mfrom: (5010 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5019.
  • Revision ID: mbp@canonical.com-20100209190402-2xbzrchmb4dfi2j7
Resolve conflicts with trunk

Show diffs side-by-side

added added

removed removed

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