48
48
so A is missing b6 at the start
49
49
and B is missing a3, a4, a5
52
br1 = Branch.initialize("branch1")
51
tree1 = self.make_branch_and_tree("branch1")
54
commit(br1, "Commit one", rev_id="a@u-0-0")
55
commit(br1, "Commit two", rev_id="a@u-0-1")
56
commit(br1, "Commit three", rev_id="a@u-0-2")
54
tree1.commit("Commit one", rev_id="a@u-0-0")
55
tree1.commit("Commit two", rev_id="a@u-0-1")
56
tree1.commit("Commit three", rev_id="a@u-0-2")
59
br2 = Branch.initialize("branch2")
58
tree2 = self.make_branch_and_tree("branch2")
60
60
br2.update_revisions(br1)
61
commit(br2, "Commit four", rev_id="b@u-0-3")
62
commit(br2, "Commit five", rev_id="b@u-0-4")
61
tree2.commit("Commit four", rev_id="b@u-0-3")
62
tree2.commit("Commit five", rev_id="b@u-0-4")
63
63
revisions_2 = br2.revision_history()
65
65
fetch(from_branch=br2, to_branch=br1)
66
br1.working_tree().add_pending_merge(revisions_2[4])
66
tree1.add_pending_merge(revisions_2[4])
67
67
self.assertEquals(revisions_2[4], 'b@u-0-4')
68
commit(br1, "Commit six", rev_id="a@u-0-3")
69
commit(br1, "Commit seven", rev_id="a@u-0-4")
70
commit(br2, "Commit eight", rev_id="b@u-0-5")
68
tree1.commit("Commit six", rev_id="a@u-0-3")
69
tree1.commit("Commit seven", rev_id="a@u-0-4")
70
tree2.commit("Commit eight", rev_id="b@u-0-5")
72
72
fetch(from_branch=br2, to_branch=br1)
73
br1.working_tree().add_pending_merge(br2.revision_history()[5])
74
commit(br1, "Commit nine", rev_id="a@u-0-5")
73
tree1.add_pending_merge(br2.revision_history()[5])
74
tree1.commit("Commit nine", rev_id="a@u-0-5")
75
75
# DO NOT FETCH HERE - we WANT a GHOST.
76
76
#fetch(from_branch=br1, to_branch=br2)
77
br2.working_tree().add_pending_merge(br1.revision_history()[4])
78
commit(br2, "Commit ten - ghost merge", rev_id="b@u-0-6")
77
tree2.add_pending_merge(br1.revision_history()[4])
78
tree2.commit("Commit ten - ghost merge", rev_id="b@u-0-6")
83
class TestIsAncestor(TestCaseInTempDir):
83
class TestIsAncestor(TestCaseWithTransport):
84
85
def test_recorded_ancestry(self):
85
86
"""Test that commit records all ancestors"""
86
87
br1, br2 = make_branches(self)
137
138
## self.assert_(not is_ancestor(revisions[3], revisions_2[3], br1))
140
class TestIntermediateRevisions(TestCaseInTempDir):
141
class TestIntermediateRevisions(TestCaseWithTransport):
143
144
from bzrlib.commit import commit
144
TestCaseInTempDir.setUp(self)
145
TestCaseWithTransport.setUp(self)
145
146
self.br1, self.br2 = make_branches(self)
147
148
self.br2.working_tree().commit("Commit eleven", rev_id="b@u-0-7")