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')),),
457
449
# File modified/deleted in dir
458
450
(dict(_base_actions='create_file_in_dir',
459
451
_path='dir/file', _file_id='file-id'),
471
463
def do_modify_file(self):
472
464
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'))]
478
466
def check_file_has_more_content(self):
479
467
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')
484
469
def do_delete_file(self):
485
470
return [('unversion', 'file-id')]
741
726
self.run_script("""
742
727
$ bzr rm -q dir --force
743
728
$ bzr resolve dir
744
2>2 conflicts resolved, 0 remaining
729
2>2 conflict(s) resolved, 0 remaining
745
730
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
748
733
def test_take_other(self):
749
734
self.run_script("""
750
735
$ bzr resolve dir
751
2>2 conflicts resolved, 0 remaining
736
2>2 conflict(s) resolved, 0 remaining
752
737
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
782
767
def test_keep_them_all(self):
783
768
self.run_script("""
784
769
$ bzr resolve dir
785
2>2 conflicts resolved, 0 remaining
770
2>2 conflict(s) resolved, 0 remaining
786
771
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
791
776
$ bzr mv -q dir/file2 file2
792
777
$ bzr rm -q dir --force
793
778
$ bzr resolve dir
794
2>2 conflicts resolved, 0 remaining
779
2>2 conflict(s) resolved, 0 remaining
795
780
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
846
831
def test_keep_them_all(self):
847
832
self.run_script("""
848
833
$ bzr resolve dir
849
2>2 conflicts resolved, 0 remaining
834
2>2 conflict(s) resolved, 0 remaining
850
835
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
855
840
$ bzr mv -q dir/file2 file2
856
841
$ bzr rm -q dir --force
857
842
$ bzr resolve dir
858
2>2 conflicts resolved, 0 remaining
843
2>2 conflict(s) resolved, 0 remaining
859
844
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
863
848
self.run_script("""
864
849
$ bzr rm -q dir --force
865
850
$ bzr resolve dir
866
2>2 conflicts resolved, 0 remaining
851
2>2 conflict(s) resolved, 0 remaining
867
852
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
870
855
def test_resolve_taking_this(self):
871
856
self.run_script("""
872
857
$ bzr resolve --take-this dir
873
2>2 conflicts resolved, 0 remaining
858
2>2 conflict(s) resolved, 0 remaining
874
859
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
879
864
$ bzr resolve --take-other dir
880
865
2>deleted dir/file2
882
2>2 conflicts resolved, 0 remaining
867
2>2 conflict(s) resolved, 0 remaining
883
868
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
971
956
if self._other['xfail']:
972
957
# It's a bit hackish to raise from here relying on being called for
973
958
# both tests but this avoid overriding test_resolve_taking_other
959
raise tests.KnownFailure(
975
960
"ParentLoop doesn't carry enough info to resolve --take-other")
976
961
_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.
1151
1051
class TestResolveActionOption(tests.TestCase):
1153
1053
def setUp(self):