~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revision.py

Merge in InterRepository api to have it available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib.branch import Branch
21
21
from bzrlib.errors import NoSuchRevision
22
22
from bzrlib.commit import commit
23
 
from bzrlib.fetch import fetch
24
23
from bzrlib.revision import (find_present_ancestors, combined_graph,
25
24
                             is_ancestor, MultipleRevisionSources)
26
25
from bzrlib.tests import TestCaseWithTransport
63
62
    tree2.commit("Commit five", rev_id="b@u-0-4")
64
63
    revisions_2 = br2.revision_history()
65
64
    
66
 
    fetch(from_branch=br2, to_branch=br1)
 
65
    br1.fetch(br2)
67
66
    tree1.add_pending_merge(revisions_2[4])
68
67
    self.assertEquals(revisions_2[4], 'b@u-0-4')
69
68
    tree1.commit("Commit six", rev_id="a@u-0-3")
70
69
    tree1.commit("Commit seven", rev_id="a@u-0-4")
71
70
    tree2.commit("Commit eight", rev_id="b@u-0-5")
72
71
    
73
 
    fetch(from_branch=br2, to_branch=br1)
 
72
    br1.fetch(br2)
74
73
    tree1.add_pending_merge(br2.revision_history()[5])
75
74
    tree1.commit("Commit nine", rev_id="a@u-0-5")
76
75
    # DO NOT FETCH HERE - we WANT a GHOST.
77
 
    #fetch(from_branch=br1, to_branch=br2)
 
76
    # br2.fetch(br1)
78
77
    tree2.add_pending_merge(br1.revision_history()[4])
79
78
    tree2.commit("Commit ten - ghost merge", rev_id="b@u-0-6")
80
79
    
151
150
        wt2.commit("Commit twelve", rev_id="b@u-0-8")
152
151
        wt2.commit("Commit thirtteen", rev_id="b@u-0-9")
153
152
 
154
 
        fetch(from_branch=self.br2, to_branch=self.br1)
 
153
        self.br1.fetch(self.br2)
155
154
        wt1.add_pending_merge(self.br2.revision_history()[6])
156
155
        wt1.commit("Commit fourtten", rev_id="a@u-0-6")
157
156
 
158
 
        fetch(from_branch=self.br1, to_branch=self.br2)
 
157
        self.br2.fetch(self.br1)
159
158
        wt2.add_pending_merge(self.br1.revision_history()[6])
160
159
        wt2.commit("Commit fifteen", rev_id="b@u-0-10")
161
160
 
245
244
                          revisions_2[4])
246
245
        self.assertEqual(common_ancestor(revisions[4], revisions_2[5], sources),
247
246
                          revisions_2[4])
248
 
        fetch(from_branch=br2, to_branch=br1)
 
247
        br1.fetch(br2)
249
248
        self.assertEqual(common_ancestor(revisions[5], revisions_2[6], sources),
250
249
                          revisions[4]) # revisions_2[5] is equally valid
251
250
        self.assertEqual(common_ancestor(revisions_2[6], revisions[5], sources),