677
677
('fileb_created',
678
678
dict(actions='create_file_b', check='file_content_b',
679
679
path='file', file_id='file-b-id')),),
680
# File created with different file-ids but deleted on one side
681
(dict(_base_actions='create_file_a'),
683
dict(actions='replace_file_a_by_b', check='file_content_b',
684
path='file', file_id='file-b-id')),
686
dict(actions='modify_file_a', check='file_new_content',
687
path='file', file_id='file-a-id')),),
682
690
def do_nothing(self):
694
702
def check_file_content_b(self):
695
703
self.assertFileEqual('file b content\n', 'branch/file')
705
def do_replace_file_a_by_b(self):
706
return [('unversion', 'file-a-id'),
707
('add', ('file', 'file-b-id', 'file', 'file b content\n'))]
709
def do_modify_file_a(self):
710
return [('modify', ('file-a-id', 'new content\n'))]
712
def check_file_new_content(self):
713
self.assertFileEqual('new content\n', 'branch/file')
697
715
def _get_resolve_path_arg(self, wt, action):
698
716
return self._this['path']
741
759
self.run_script("""
742
760
$ bzr rm -q dir --force
743
761
$ bzr resolve dir
744
2>2 conflict(s) resolved, 0 remaining
762
2>2 conflicts resolved, 0 remaining
745
763
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
748
766
def test_take_other(self):
749
767
self.run_script("""
750
768
$ bzr resolve dir
751
2>2 conflict(s) resolved, 0 remaining
769
2>2 conflicts resolved, 0 remaining
752
770
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
782
800
def test_keep_them_all(self):
783
801
self.run_script("""
784
802
$ bzr resolve dir
785
2>2 conflict(s) resolved, 0 remaining
803
2>2 conflicts resolved, 0 remaining
786
804
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
791
809
$ bzr mv -q dir/file2 file2
792
810
$ bzr rm -q dir --force
793
811
$ bzr resolve dir
794
2>2 conflict(s) resolved, 0 remaining
812
2>2 conflicts resolved, 0 remaining
795
813
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
846
864
def test_keep_them_all(self):
847
865
self.run_script("""
848
866
$ bzr resolve dir
849
2>2 conflict(s) resolved, 0 remaining
867
2>2 conflicts resolved, 0 remaining
850
868
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
855
873
$ bzr mv -q dir/file2 file2
856
874
$ bzr rm -q dir --force
857
875
$ bzr resolve dir
858
2>2 conflict(s) resolved, 0 remaining
876
2>2 conflicts resolved, 0 remaining
859
877
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
863
881
self.run_script("""
864
882
$ bzr rm -q dir --force
865
883
$ bzr resolve dir
866
2>2 conflict(s) resolved, 0 remaining
884
2>2 conflicts resolved, 0 remaining
867
885
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
870
888
def test_resolve_taking_this(self):
871
889
self.run_script("""
872
890
$ bzr resolve --take-this dir
873
2>2 conflict(s) resolved, 0 remaining
891
2>2 conflicts resolved, 0 remaining
874
892
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
879
897
$ bzr resolve --take-other dir
880
898
2>deleted dir/file2
882
2>2 conflict(s) resolved, 0 remaining
900
2>2 conflicts resolved, 0 remaining
883
901
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
971
989
if self._other['xfail']:
972
990
# It's a bit hackish to raise from here relying on being called for
973
991
# both tests but this avoid overriding test_resolve_taking_other
974
raise tests.KnownFailure(
975
993
"ParentLoop doesn't carry enough info to resolve --take-other")
976
994
_assert_conflict = assertParentLoop
1085
class TestNoFinalPath(script.TestCaseWithTransportAndScript):
1087
def test_bug_805809(self):
1090
Created a standalone tree (format: 2a)
1095
$ bzr commit -m 'create file on trunk'
1096
2>Committing to: .../trunk/
1098
2>Committed revision 1.
1099
# Create a debian branch based on trunk
1101
$ bzr branch trunk -r 1 debian
1102
2>Branched 1 revision.
1109
$ bzr commit -m 'rename file to dir/file for debian'
1110
2>Committing to: .../debian/
1112
2>renamed file => dir/file
1113
2>Committed revision 2.
1114
# Create an experimental branch with a new root-id
1116
$ bzr init experimental
1117
Created a standalone tree (format: 2a)
1119
# Work around merging into empty branch not being supported
1120
# (http://pad.lv/308562)
1121
$ echo something >not-empty
1124
$ bzr commit -m 'Add some content in experimental'
1125
2>Committing to: .../experimental/
1127
2>Committed revision 1.
1128
# merge debian even without a common ancestor
1129
$ bzr merge ../debian -r0..2
1132
2>All changes applied successfully.
1133
$ bzr commit -m 'merging debian into experimental'
1134
2>Committing to: .../experimental/
1137
2>Committed revision 2.
1138
# Create an ubuntu branch with yet another root-id
1141
Created a standalone tree (format: 2a)
1143
# Work around merging into empty branch not being supported
1144
# (http://pad.lv/308562)
1145
$ echo something >not-empty-ubuntu
1147
adding not-empty-ubuntu
1148
$ bzr commit -m 'Add some content in experimental'
1149
2>Committing to: .../ubuntu/
1150
2>added not-empty-ubuntu
1151
2>Committed revision 1.
1153
$ bzr merge ../debian -r0..2
1156
2>All changes applied successfully.
1157
$ bzr commit -m 'merging debian'
1158
2>Committing to: .../ubuntu/
1161
2>Committed revision 2.
1162
# Now try to merge experimental
1163
$ bzr merge ../experimental
1165
2>Path conflict: dir / dir
1166
2>1 conflicts encountered.
1066
1170
class TestResolveActionOption(tests.TestCase):
1068
1172
def setUp(self):