185
def test_merge_sort_race(self):
201
self.assertSortAndIterate(graph, 'F',
202
[(0, 'F', 0, (3,), False),
203
(1, 'D', 1, (2,2,1), False),
204
(2, 'C', 1, (2,1,1), True), # XXX: Shouldn't it be merge_depth=2?
205
(3, 'B', 0, (2,), False),
206
(4, 'A', 0, (1,), True),
224
self.assertSortAndIterate(graph, 'F',
225
[(0, 'F', 0, (3,), False),
226
(1, 'D', 1, (2,1,2), False),
227
(2, 'C', 2, (2,2,1), True),
228
(3, 'X', 1, (2,1,1), True),
229
(4, 'B', 0, (2,), False),
230
(5, 'A', 0, (1,), True),
185
233
def test_merge_depth_with_nested_merges(self):
186
234
# the merge depth marker should reflect the depth of the revision
187
235
# in terms of merges out from the mainline
230
278
[(0, 'A', 0, (3,), False),
231
(1, 'B', 1, (1,2,2), False),
232
(2, 'C', 1, (1,2,1), True),
279
(1, 'B', 1, (1,3,2), False),
280
(2, 'C', 1, (1,3,1), True),
233
281
(3, 'D', 0, (2,), False),
234
282
(4, 'E', 1, (1,1,2), False),
235
(5, 'F', 2, (1,1,1,1,1), True),
283
(5, 'F', 2, (1,2,1), True),
236
284
(6, 'G', 1, (1,1,1), True),
237
285
(7, 'H', 0, (1,), True),
290
def test_dotted_revnos_with_simple_merges(self):
295
# D E F 3, 1.1.2, 1.2.1
297
# G H I 4, 1.2.2, 1.3.1
302
self.assertSortAndIterate(
317
[(0, 'L', 0, (6,), False),
318
(1, 'K', 1, (1,3,2), False),
319
(2, 'I', 1, (1,3,1), True),
320
(3, 'J', 0, (5,), False),
321
(4, 'H', 1, (1,2,2), False),
322
(5, 'F', 1, (1,2,1), True),
323
(6, 'G', 0, (4,), False),
324
(7, 'E', 1, (1,1,2), False),
325
(8, 'C', 1, (1,1,1), True),
326
(9, 'D', 0, (3,), False),
327
(10, 'B', 0, (2,), False),
328
(11, 'A', 0, (1,), True),
332
# Adding a shortcut from the first revision should not change any of
333
# the existing numbers
334
self.assertSortAndIterate(
351
[(0, 'N', 0, (7,), False),
352
(1, 'M', 1, (1,4,1), True),
353
(2, 'L', 0, (6,), False),
354
(3, 'K', 1, (1,3,2), False),
355
(4, 'I', 1, (1,3,1), True),
356
(5, 'J', 0, (5,), False),
357
(6, 'H', 1, (1,2,2), False),
358
(7, 'F', 1, (1,2,1), True),
359
(8, 'G', 0, (4,), False),
360
(9, 'E', 1, (1,1,2), False),
361
(10, 'C', 1, (1,1,1), True),
362
(11, 'D', 0, (3,), False),
363
(12, 'B', 0, (2,), False),
364
(13, 'A', 0, (1,), True),
242
369
def test_end_of_merge_not_last_revision_in_branch(self):
243
370
# within a branch only the last revision gets an
244
371
# end of merge marker.
313
440
[(0, 'A', 0, (2,), False),
314
(1, 'B', 1, (1,2,2), False),
315
(2, 'C', 2, (1,2,1,1,1), True),
316
(3, 'D', 1, (1,2,1), True),
441
(1, 'B', 1, (1,3,2), False),
442
(2, 'C', 2, (1,4,1), True),
443
(3, 'D', 1, (1,3,1), True),
317
444
(4, 'E', 1, (1,1,2), False),
318
(5, 'F', 2, (1,1,1,1,1), True),
445
(5, 'F', 2, (1,2,1), True),
319
446
(6, 'G', 1, (1,1,1), True),
320
447
(7, 'H', 0, (1,), True),