~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevisionnamespaces.py

[merge] much integrated work from robert and john

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
        b = Branch.initialize('.')
36
36
 
37
 
        b.commit('Commit one', rev_id='a@r-0-1', timestamp=time.time() - 60*60*24)
38
 
        b.commit('Commit two', rev_id='a@r-0-2')
39
 
        b.commit('Commit three', rev_id='a@r-0-3')
 
37
        b.working_tree().commit('Commit one', rev_id='a@r-0-1', timestamp=time.time() - 60*60*24)
 
38
        b.working_tree().commit('Commit two', rev_id='a@r-0-2')
 
39
        b.working_tree().commit('Commit three', rev_id='a@r-0-3')
40
40
 
41
41
        self.assertEquals(RevisionSpec(None).in_history(b), (0, None))
42
42
        self.assertEquals(RevisionSpec(1).in_history(b), (1, 'a@r-0-1'))
70
70
 
71
71
        os.mkdir('copy')
72
72
        b3 = copy_branch(b, 'copy')
73
 
        b3.commit('Commit four', rev_id='b@r-0-4')
 
73
        b3.working_tree().commit('Commit four', rev_id='b@r-0-4')
74
74
        self.assertEquals(RevisionSpec('ancestor:.').in_history(b3).rev_id,
75
75
                          'a@r-0-3')
76
76
        merge(['copy', -1], [None, None])
77
 
        b.commit('Commit five', rev_id='a@r-0-4')
 
77
        b.working_tree().commit('Commit five', rev_id='a@r-0-4')
78
78
        self.assertEquals(RevisionSpec('ancestor:copy').in_history(b).rev_id,
79
79
                          'b@r-0-4')
80
80
        self.assertEquals(RevisionSpec('ancestor:.').in_history(b3).rev_id,
85
85
        self.build_tree(['branch1/', 'branch1/file', 'branch2/'])
86
86
        branch = Branch.initialize('branch1')
87
87
        branch.add(['file'])
88
 
        branch.commit('add file')
 
88
        branch.working_tree().commit('add file')
89
89
        copy_branch(branch, 'branch2')
90
90
        print >> open('branch2/file', 'w'), 'new content'
91
91
        branch2 = Branch.open('branch2')
92
 
        branch2.commit('update file', rev_id='A')
 
92
        branch2.working_tree().commit('update file', rev_id='A')
93
93
        spec = RevisionSpec('branch:./branch2/.bzr/../')
94
94
        rev_info = spec.in_history(branch)
95
95
        self.assertEqual(rev_info, (None, 'A'))