~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revisionnamespaces.py

Basic BzrDir support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.errors import NoCommonAncestor, NoCommits
24
24
from bzrlib.errors import NoSuchRevision
25
25
from bzrlib.revisionspec import RevisionSpec
 
26
from bzrlib.workingtree import WorkingTree
26
27
 
27
28
 
28
29
class TestRevisionNamespaces(TestCaseWithTransport):
69
70
        b2 = wt2.branch
70
71
        self.assertRaises(NoCommits, RevisionSpec('ancestor:.').in_history, b2)
71
72
 
72
 
        d3 = b.bzrdir.sprout('copy')
73
 
        b3 = d3.open_branch()
74
 
        wt3 = d3.open_workingtree()
 
73
        os.mkdir('copy')
 
74
        b3 = b.clone('copy')
 
75
        wt3 = WorkingTree('copy', b3)
75
76
        wt3.commit('Commit four', rev_id='b@r-0-4')
76
77
        self.assertEquals(RevisionSpec('ancestor:.').in_history(b3).rev_id,
77
78
                          'a@r-0-3')
93
94
        branch = wt.branch
94
95
        wt.add(['file'])
95
96
        wt.commit('add file')
96
 
        d2 = branch.bzrdir.sprout('branch2')
 
97
        branch.clone('branch2')
97
98
        print >> open('branch2/file', 'w'), 'new content'
98
 
        branch2 = d2.open_branch()
99
 
        d2.open_workingtree().commit('update file', rev_id='A')
 
99
        branch2 = Branch.open('branch2')
 
100
        WorkingTree('branch2', branch2).commit('update file', rev_id='A')
100
101
        spec = RevisionSpec('branch:./branch2/.bzr/../')
101
102
        rev_info = spec.in_history(branch)
102
103
        self.assertEqual(rev_info, (None, 'A'))