~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevision.py

  • Committer: Robert Collins
  • Date: 2005-09-29 02:01:49 UTC
  • Revision ID: robertc@robertcollins.net-20050929020149-1ff16722c6a01b2c
reenable remotebranch tests

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 merges a4
 
45
    b..6
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
 
    # DO NOT FETCH HERE - we WANT a GHOST.
 
74
    # disabled - it makes testing fetch too hard,
 
75
    # but can be easily reenabled (without the fetch
 
76
    # when GHOSTS are supported. RBC 20050928
75
77
    #fetch(from_branch=br1, to_branch=br2)
76
 
    br2.add_pending_merge(br1.revision_history()[4])
77
 
    commit(br2, "Commit ten - ghost merge", rev_id="b@u-0-6")
 
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)
78
82
    
79
83
    return br1, br2
80
84
 
136
140
        ## assert not is_ancestor(revisions[3], revisions_2[3], br1)
137
141
 
138
142
 
 
143
 
139
144
class TestIntermediateRevisions(TestCaseInTempDir):
140
145
 
141
146
    def setUp(self):
244
249
                          revisions_2[4])
245
250
        fetch(from_branch=br2, to_branch=br1)
246
251
        self.assertEqual(common_ancestor(revisions[5], revisions_2[6], sources),
247
 
                          revisions[4]) # revisions_2[5] is equally valid
 
252
                          revisions_2[5])
248
253
        self.assertEqual(common_ancestor(revisions_2[6], revisions[5], sources),
249
254
                          revisions_2[5])
250
255
 
255
260
        revisions = br1.revision_history()
256
261
        revisions_2 = br2.revision_history()
257
262
        sources = MultipleRevisionSources(br1, br2)
 
263
 
258
264
        expected_ancestors_list = {revisions[3]:(0, 0), 
259
265
                                   revisions[2]:(1, 1),
260
266
                                   revisions_2[4]:(2, 1), 
267
273
            self.assertEqual(ancestors_list[key], value, 
268
274
                              "key %r, %r != %r" % (key, ancestors_list[key],
269
275
                                                    value))
 
276
 
270
277
        self.assertEqual(common_ancestor(revisions[0], revisions[0], sources),
271
278
                          revisions[0])
272
279
        self.assertEqual(common_ancestor(revisions[1], revisions[2], sources),
280
287
        self.assertEqual(common_ancestor(revisions[4], revisions_2[5], sources),
281
288
                          revisions_2[4])
282
289
        self.assertEqual(common_ancestor(revisions[5], revisions_2[6], sources),
283
 
                          revisions[4]) # revisions_2[5] is equally valid
 
290
                          revisions_2[5])
284
291
        self.assertEqual(common_ancestor(revisions_2[6], revisions[5], sources),
285
 
                          revisions[4]) # revisions_2[5] is equally valid
 
292
                          revisions_2[5])
286
293
 
287
294
    def test_combined(self):
288
295
        """combined_graph