~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_workingtree.py

  • Committer: Martin Pool
  • Date: 2009-12-22 07:03:38 UTC
  • mto: This revision was merged to the branch mainline in revision 4923.
  • Revision ID: mbp@sourcefrog.net-20091222070338-q3snpjija1sldvpn
Add per_workingtree test you can update to arbitrary revisions

Show diffs side-by-side

added added

removed removed

Lines of Context:
590
590
        self.assertEqual(master_tree.branch.revision_history(),
591
591
            tree.branch.revision_history())
592
592
 
 
593
    def test_update_takes_revision_parameter(self):
 
594
        wt = self.make_branch_and_tree('wt')
 
595
        self.build_tree_contents([('wt/a', 'old content')])
 
596
        wt.add(['a'])
 
597
        rev1 = wt.commit('first master commit')
 
598
        self.build_tree_contents([('wt/a', 'new content')])
 
599
        rev2 = wt.commit('second master commit')
 
600
        # https://bugs.edge.launchpad.net/bzr/+bug/45719/comments/20
 
601
        # when adding 'update -r' we should make sure all wt formats support
 
602
        # it
 
603
        conflicts = wt.update(revision=rev1)
 
604
        self.assertFileEqual('old content', 'wt/a')
 
605
        self.assertEqual([rev1], wt.get_parent_ids())
 
606
 
593
607
    def test_merge_modified_detects_corruption(self):
594
608
        # FIXME: This doesn't really test that it works; also this is not
595
609
        # implementation-independent. mbp 20070226