500
500
plan._get_matching_blocks('B', 'C')),
501
501
([1, 2, 3], [0, 2]))
503
def test_plan_merge(self):
504
self.setup_plan_merge()
505
plan = self.plan_merge_vf.plan_merge('B', 'C')
508
('unchanged', 'a\n'),
503
517
def test_plan_merge_cherrypick(self):
504
518
self.add_version(('root', 'A'), [], 'abc')
505
519
self.add_version(('root', 'B'), [('root', 'A')], 'abcde')
530
544
('new-a', 'c\n')],
531
545
list(my_plan.plan_merge()))
533
def test_plan_merge(self):
534
self.setup_plan_merge()
535
plan = self.plan_merge_vf.plan_merge('B', 'C')
538
('unchanged', 'a\n'),
547
547
def test_plan_merge_uncommitted_files(self):
548
548
self.setup_plan_merge_uncommitted()
549
549
plan = self.plan_merge_vf.plan_merge('B:', 'C:')
558
558
('new-a', 'g\n')],
561
def test_plan_merge_criss_cross(self):
562
# This is specificly trying to trigger problems when using limited
563
# ancestry and weaves. The ancestry graph looks like:
566
# B \ Introduces a line 'foo'
568
# C D E C & D both have 'foo', E has different changes
572
# F G All of C, D, E are merged into F and G, so they are
573
# all common ancestors.
575
# The specific issue with weaves:
576
# B introduced a text ('foo') that is present in both C and D.
577
# If we do not include B (because it isn't an ancestor of E), then
578
# the A=>C and A=>D look like both sides independently introduce the
579
# text ('foo'). If F does not modify the text, it would still appear
580
# to have deleted on of the versions from C or D. If G then modifies
581
# 'foo', it should appear as superseding the value in F (since it
582
# came from B), rather than conflict because of the resolution during
584
self.add_version(('root', 'A'), [], 'abcdef')
585
self.add_version(('root', 'B'), [('root', 'A')], 'axcdef')
586
self.add_version(('root', 'C'), [('root', 'B')], 'axcdefg')
587
self.add_version(('root', 'D'), [('root', 'B')], 'haxcdef')
588
self.add_version(('root', 'E'), [('root', 'A')], 'abcdyf')
589
self.add_version(('root', 'F'),
590
[('root', 'C'), ('root', 'D'), ('root', 'E')],
591
'haxcdyfg') #Simple combining of all texts
592
self.add_version(('root', 'G'),
593
[('root', 'C'), ('root', 'D'), ('root', 'E')],
594
'hazcdyfg') #combining and supersede 'x'
595
plan = self.plan_merge_vf.plan_merge('F', 'G')
597
('unchanged', 'h\n'),
598
('unchanged', 'a\n'),
601
('unchanged', 'c\n'),
602
('unchanged', 'd\n'),
603
('killed-base', 'e\n'),
604
('unchanged', 'y\n'),
605
('unchanged', 'f\n'),
606
('unchanged', 'g\n')],
561
609
def test_subtract_plans(self):
563
611
('unchanged', 'a\n'),