~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevision.py

  • Committer: Robert Collins
  • Date: 2005-10-02 23:17:00 UTC
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20051002231700-811f40dc74d4bc25
fetch should work with ghosts

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    b..3   a..3 merges b..4
43
43
    b..4   a..4
44
44
    b..5   a..5 merges b..5
45
 
    b..6
 
45
    b..6 merges a4
46
46
 
47
47
    so A is missing b6 at the start
48
48
    and B is missing a3, a4, a5
71
71
    fetch(from_branch=br2, to_branch=br1)
72
72
    br1.add_pending_merge(br2.revision_history()[5])
73
73
    commit(br1, "Commit nine", rev_id="a@u-0-5")
74
 
    # disabled - it makes testing fetch too hard,
75
 
    # but can be easily reenabled (without the fetch
76
 
    # when GHOSTS are supported. RBC 20050928
 
74
    # DO NOT FETCH HERE - we WANT a GHOST.
77
75
    #fetch(from_branch=br1, to_branch=br2)
78
 
    #br2.add_pending_merge(br1.revision_history()[4])
79
 
    commit(br2, "Commit ten - no merge", rev_id="b@u-0-6")
80
 
 
81
 
    #fetch(from_branch=br2, to_branch=br1)
 
76
    br2.add_pending_merge(br1.revision_history()[4])
 
77
    commit(br2, "Commit ten - ghost merge", rev_id="b@u-0-6")
82
78
    
83
79
    return br1, br2
84
80
 
248
244
                          revisions_2[4])
249
245
        fetch(from_branch=br2, to_branch=br1)
250
246
        self.assertEqual(common_ancestor(revisions[5], revisions_2[6], sources),
251
 
                          revisions_2[5])
 
247
                          revisions[4]) # revisions_2[5] is equally valid
252
248
        self.assertEqual(common_ancestor(revisions_2[6], revisions[5], sources),
253
249
                          revisions_2[5])
254
250
 
284
280
        self.assertEqual(common_ancestor(revisions[4], revisions_2[5], sources),
285
281
                          revisions_2[4])
286
282
        self.assertEqual(common_ancestor(revisions[5], revisions_2[6], sources),
287
 
                          revisions_2[5])
 
283
                          revisions[4]) # revisions_2[5] is equally valid
288
284
        self.assertEqual(common_ancestor(revisions_2[6], revisions[5], sources),
289
 
                          revisions_2[5])
 
285
                          revisions[4]) # revisions_2[5] is equally valid
290
286
 
291
287
    def test_combined(self):
292
288
        """combined_graph