~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
        revid = b.revision_history()[0]
237
237
        self.log('first revision_id is {%s}' % revid)
238
238
 
239
 
        inv = b.repository.get_inventory(revid)
 
239
        inv = b.repository.get_revision_inventory(revid)
240
240
        self.log('contents of inventory: %r' % inv.entries())
241
241
 
242
242
        self.check_inventory_shape(inv,
423
423
        made_control = self.bzrdir_format.initialize('new')
424
424
        source.branch.repository.clone(made_control)
425
425
        source.branch.clone(made_control)
426
 
        made_tree = self.workingtree_format.initialize(made_control,
427
 
            revision_id='a')
 
426
        made_tree = self.workingtree_format.initialize(made_control, revision_id='a')
428
427
        self.assertEqual(['a'], made_tree.get_parent_ids())
429
428
 
430
429
    def test_update_sets_last_revision(self):
448
447
        # current format
449
448
        self.build_tree(['checkout/', 'tree/file'])
450
449
        checkout = bzrdir.BzrDirMetaFormat1().initialize('checkout')
451
 
        branch.BranchReferenceFormat().initialize(checkout,
452
 
            target_branch=main_branch)
 
450
        branch.BranchReferenceFormat().initialize(checkout, main_branch)
453
451
        old_tree = self.workingtree_format.initialize(checkout)
454
452
        # now commit to 'tree'
455
453
        wt.add('file')
516
514
        # current format
517
515
        self.build_tree(['checkout/', 'tree/file'])
518
516
        checkout = bzrdir.BzrDirMetaFormat1().initialize('checkout')
519
 
        branch.BranchReferenceFormat().initialize(checkout,
520
 
            target_branch=main_branch)
 
517
        branch.BranchReferenceFormat().initialize(checkout, main_branch)
521
518
        old_tree = self.workingtree_format.initialize(checkout)
522
519
        # now commit to 'tree'
523
520
        wt.add('file')
615
612
        rev1 = wt.commit('first master commit')
616
613
        self.build_tree_contents([('wt/a', 'new content')])
617
614
        rev2 = wt.commit('second master commit')
618
 
        # https://bugs.launchpad.net/bzr/+bug/45719/comments/20
 
615
        # https://bugs.edge.launchpad.net/bzr/+bug/45719/comments/20
619
616
        # when adding 'update -r' we should make sure all wt formats support
620
617
        # it
621
618
        conflicts = wt.update(revision=rev1)
1091
1088
        # We should display the relative path
1092
1089
        self.assertEqual('subdir/m\xb5', e.filename)
1093
1090
        self.assertEqual(osutils._fs_enc, e.fs_encoding)
1094
 
 
1095
 
 
1096
 
class TestControlComponent(TestCaseWithWorkingTree):
1097
 
    """WorkingTree implementations adequately implement ControlComponent."""
1098
 
    
1099
 
    def test_urls(self):
1100
 
        wt = self.make_branch_and_tree('wt')
1101
 
        self.assertIsInstance(wt.user_url, str)
1102
 
        self.assertEqual(wt.user_url, wt.user_transport.base)
1103
 
        # for all current bzrdir implementations the user dir must be 
1104
 
        # above the control dir but we might need to relax that?
1105
 
        self.assertEqual(wt.control_url.find(wt.user_url), 0)
1106
 
        self.assertEqual(wt.control_url, wt.control_transport.base)