446
446
dict(actions='modify_file', check='file_has_more_content')),
448
448
dict(actions='delete_file', check='file_doesnt_exist')),),
449
# File renamed-modified/deleted
450
(dict(_base_actions='create_file',
451
_path='new-file', _file_id='file-id'),
452
('file_renamed_and_modified',
453
dict(actions='modify_and_rename_file',
454
check='file_renamed_and_more_content')),
456
dict(actions='delete_file', check='file_doesnt_exist')),),
449
457
# File modified/deleted in dir
450
458
(dict(_base_actions='create_file_in_dir',
451
459
_path='dir/file', _file_id='file-id'),
463
471
def do_modify_file(self):
464
472
return [('modify', ('file-id', 'trunk content\nmore content\n'))]
474
def do_modify_and_rename_file(self):
475
return [('modify', ('file-id', 'trunk content\nmore content\n')),
476
('rename', ('file', 'new-file'))]
466
478
def check_file_has_more_content(self):
467
479
self.assertFileEqual('trunk content\nmore content\n', 'branch/file')
481
def check_file_renamed_and_more_content(self):
482
self.assertFileEqual('trunk content\nmore content\n', 'branch/new-file')
469
484
def do_delete_file(self):
470
485
return [('unversion', 'file-id')]
726
741
self.run_script("""
727
742
$ bzr rm -q dir --force
728
743
$ bzr resolve dir
729
2>2 conflict(s) resolved, 0 remaining
744
2>2 conflicts resolved, 0 remaining
730
745
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
733
748
def test_take_other(self):
734
749
self.run_script("""
735
750
$ bzr resolve dir
736
2>2 conflict(s) resolved, 0 remaining
751
2>2 conflicts resolved, 0 remaining
737
752
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
767
782
def test_keep_them_all(self):
768
783
self.run_script("""
769
784
$ bzr resolve dir
770
2>2 conflict(s) resolved, 0 remaining
785
2>2 conflicts resolved, 0 remaining
771
786
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
776
791
$ bzr mv -q dir/file2 file2
777
792
$ bzr rm -q dir --force
778
793
$ bzr resolve dir
779
2>2 conflict(s) resolved, 0 remaining
794
2>2 conflicts resolved, 0 remaining
780
795
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
831
846
def test_keep_them_all(self):
832
847
self.run_script("""
833
848
$ bzr resolve dir
834
2>2 conflict(s) resolved, 0 remaining
849
2>2 conflicts resolved, 0 remaining
835
850
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
840
855
$ bzr mv -q dir/file2 file2
841
856
$ bzr rm -q dir --force
842
857
$ bzr resolve dir
843
2>2 conflict(s) resolved, 0 remaining
858
2>2 conflicts resolved, 0 remaining
844
859
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
848
863
self.run_script("""
849
864
$ bzr rm -q dir --force
850
865
$ bzr resolve dir
851
2>2 conflict(s) resolved, 0 remaining
866
2>2 conflicts resolved, 0 remaining
852
867
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
855
870
def test_resolve_taking_this(self):
856
871
self.run_script("""
857
872
$ bzr resolve --take-this dir
858
2>2 conflict(s) resolved, 0 remaining
873
2>2 conflicts resolved, 0 remaining
859
874
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
864
879
$ bzr resolve --take-other dir
865
880
2>deleted dir/file2
867
2>2 conflict(s) resolved, 0 remaining
882
2>2 conflicts resolved, 0 remaining
868
883
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
956
971
if self._other['xfail']:
957
972
# It's a bit hackish to raise from here relying on being called for
958
973
# both tests but this avoid overriding test_resolve_taking_other
959
raise tests.KnownFailure(
960
975
"ParentLoop doesn't carry enough info to resolve --take-other")
961
976
_assert_conflict = assertParentLoop
1066
class TestNoFinalPath(script.TestCaseWithTransportAndScript):
1068
def test_bug_805809(self):
1071
Created a standalone tree (format: 2a)
1076
$ bzr commit -m 'create file on trunk'
1077
2>Committing to: .../trunk/
1079
2>Committed revision 1.
1080
# Create a debian branch based on trunk
1082
$ bzr branch trunk -r 1 debian
1083
2>Branched 1 revision.
1090
$ bzr commit -m 'rename file to dir/file for debian'
1091
2>Committing to: .../debian/
1093
2>renamed file => dir/file
1094
2>Committed revision 2.
1095
# Create an experimental branch with a new root-id
1097
$ bzr init experimental
1098
Created a standalone tree (format: 2a)
1100
# Work around merging into empty branch not being supported
1101
# (http://pad.lv/308562)
1102
$ echo something >not-empty
1105
$ bzr commit -m 'Add some content in experimental'
1106
2>Committing to: .../experimental/
1108
2>Committed revision 1.
1109
# merge debian even without a common ancestor
1110
$ bzr merge ../debian -r0..2
1113
2>All changes applied successfully.
1114
$ bzr commit -m 'merging debian into experimental'
1115
2>Committing to: .../experimental/
1118
2>Committed revision 2.
1119
# Create an ubuntu branch with yet another root-id
1122
Created a standalone tree (format: 2a)
1124
# Work around merging into empty branch not being supported
1125
# (http://pad.lv/308562)
1126
$ echo something >not-empty-ubuntu
1128
adding not-empty-ubuntu
1129
$ bzr commit -m 'Add some content in experimental'
1130
2>Committing to: .../ubuntu/
1131
2>added not-empty-ubuntu
1132
2>Committed revision 1.
1134
$ bzr merge ../debian -r0..2
1137
2>All changes applied successfully.
1138
$ bzr commit -m 'merging debian'
1139
2>Committing to: .../ubuntu/
1142
2>Committed revision 2.
1143
# Now try to merge experimental
1144
$ bzr merge ../experimental
1146
2>Path conflict: dir / dir
1147
2>1 conflicts encountered.
1051
1151
class TestResolveActionOption(tests.TestCase):
1053
1153
def setUp(self):