677
676
('fileb_created',
678
677
dict(actions='create_file_b', check='file_content_b',
679
678
path='file', file_id='file-b-id')),),
679
# File created with different file-ids but deleted on one side
680
(dict(_base_actions='create_file_a'),
682
dict(actions='replace_file_a_by_b', check='file_content_b',
683
path='file', file_id='file-b-id')),
685
dict(actions='modify_file_a', check='file_new_content',
686
path='file', file_id='file-a-id')),),
682
689
def do_nothing(self):
694
701
def check_file_content_b(self):
695
702
self.assertFileEqual('file b content\n', 'branch/file')
704
def do_replace_file_a_by_b(self):
705
return [('unversion', 'file-a-id'),
706
('add', ('file', 'file-b-id', 'file', 'file b content\n'))]
708
def do_modify_file_a(self):
709
return [('modify', ('file-a-id', 'new content\n'))]
711
def check_file_new_content(self):
712
self.assertFileEqual('new content\n', 'branch/file')
697
714
def _get_resolve_path_arg(self, wt, action):
698
715
return self._this['path']
741
758
self.run_script("""
742
759
$ bzr rm -q dir --force
743
760
$ bzr resolve dir
744
2>2 conflict(s) resolved, 0 remaining
761
2>2 conflicts resolved, 0 remaining
745
762
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
748
765
def test_take_other(self):
749
766
self.run_script("""
750
767
$ bzr resolve dir
751
2>2 conflict(s) resolved, 0 remaining
768
2>2 conflicts resolved, 0 remaining
752
769
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
782
799
def test_keep_them_all(self):
783
800
self.run_script("""
784
801
$ bzr resolve dir
785
2>2 conflict(s) resolved, 0 remaining
802
2>2 conflicts resolved, 0 remaining
786
803
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
791
808
$ bzr mv -q dir/file2 file2
792
809
$ bzr rm -q dir --force
793
810
$ bzr resolve dir
794
2>2 conflict(s) resolved, 0 remaining
811
2>2 conflicts resolved, 0 remaining
795
812
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
846
863
def test_keep_them_all(self):
847
864
self.run_script("""
848
865
$ bzr resolve dir
849
2>2 conflict(s) resolved, 0 remaining
866
2>2 conflicts resolved, 0 remaining
850
867
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
855
872
$ bzr mv -q dir/file2 file2
856
873
$ bzr rm -q dir --force
857
874
$ bzr resolve dir
858
2>2 conflict(s) resolved, 0 remaining
875
2>2 conflicts resolved, 0 remaining
859
876
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
863
880
self.run_script("""
864
881
$ bzr rm -q dir --force
865
882
$ bzr resolve dir
866
2>2 conflict(s) resolved, 0 remaining
883
2>2 conflicts resolved, 0 remaining
867
884
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
870
887
def test_resolve_taking_this(self):
871
888
self.run_script("""
872
889
$ bzr resolve --take-this dir
873
2>2 conflict(s) resolved, 0 remaining
890
2>2 conflicts resolved, 0 remaining
874
891
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
879
896
$ bzr resolve --take-other dir
880
897
2>deleted dir/file2
882
2>2 conflict(s) resolved, 0 remaining
899
2>2 conflicts resolved, 0 remaining
883
900
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
971
988
if self._other['xfail']:
972
989
# It's a bit hackish to raise from here relying on being called for
973
990
# both tests but this avoid overriding test_resolve_taking_other
974
raise tests.KnownFailure(
975
992
"ParentLoop doesn't carry enough info to resolve --take-other")
976
993
_assert_conflict = assertParentLoop
1084
class TestNoFinalPath(script.TestCaseWithTransportAndScript):
1086
def test_bug_805809(self):
1089
Created a standalone tree (format: 2a)
1094
$ bzr commit -m 'create file on trunk'
1095
2>Committing to: .../trunk/
1097
2>Committed revision 1.
1098
# Create a debian branch based on trunk
1100
$ bzr branch trunk -r 1 debian
1101
2>Branched 1 revision.
1108
$ bzr commit -m 'rename file to dir/file for debian'
1109
2>Committing to: .../debian/
1111
2>renamed file => dir/file
1112
2>Committed revision 2.
1113
# Create an experimental branch with a new root-id
1115
$ bzr init experimental
1116
Created a standalone tree (format: 2a)
1118
# Work around merging into empty branch not being supported
1119
# (http://pad.lv/308562)
1120
$ echo something >not-empty
1123
$ bzr commit -m 'Add some content in experimental'
1124
2>Committing to: .../experimental/
1126
2>Committed revision 1.
1127
# merge debian even without a common ancestor
1128
$ bzr merge ../debian -r0..2
1131
2>All changes applied successfully.
1132
$ bzr commit -m 'merging debian into experimental'
1133
2>Committing to: .../experimental/
1136
2>Committed revision 2.
1137
# Create an ubuntu branch with yet another root-id
1140
Created a standalone tree (format: 2a)
1142
# Work around merging into empty branch not being supported
1143
# (http://pad.lv/308562)
1144
$ echo something >not-empty-ubuntu
1146
adding not-empty-ubuntu
1147
$ bzr commit -m 'Add some content in experimental'
1148
2>Committing to: .../ubuntu/
1149
2>added not-empty-ubuntu
1150
2>Committed revision 1.
1152
$ bzr merge ../debian -r0..2
1155
2>All changes applied successfully.
1156
$ bzr commit -m 'merging debian'
1157
2>Committing to: .../ubuntu/
1160
2>Committed revision 2.
1161
# Now try to merge experimental
1162
$ bzr merge ../experimental
1164
2>Path conflict: dir / dir
1165
2>1 conflicts encountered.
1066
1169
class TestResolveActionOption(tests.TestCase):
1068
1171
def setUp(self):