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']
740
757
def test_take_this(self):
741
758
self.run_script("""
742
$ bzr rm -q dir --force
759
$ bzr rm -q dir --no-backup
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'
768
785
$ bzr commit -q -m 'Add dir/file2 in branch'
769
786
$ bzr branch -q . -r 1 ../branch
771
$ bzr rm -q dir/file --force
788
$ bzr rm -q dir/file --no-backup
773
790
$ bzr commit -q -m 'Remove dir/file'
774
791
$ bzr merge ../trunk
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'
789
806
def test_adopt_child(self):
790
807
self.run_script("""
791
808
$ bzr mv -q dir/file2 file2
792
$ bzr rm -q dir --force
809
$ bzr rm -q dir --no-backup
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'
798
815
def test_kill_them_all(self):
799
816
self.run_script("""
800
$ bzr rm -q dir --force
817
$ bzr rm -q dir --no-backup
801
818
$ bzr resolve dir
802
2>2 conflict(s) resolved, 0 remaining
819
2>2 conflicts resolved, 0 remaining
803
820
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
828
845
$ echo 'trunk content' >dir/file
830
847
$ bzr commit -m 'Create trunk' -q
831
$ bzr rm -q dir/file --force
832
$ bzr rm -q dir --force
848
$ bzr rm -q dir/file --no-backup
849
$ bzr rm -q dir --no-backup
833
850
$ bzr commit -q -m 'Remove dir/file'
834
851
$ bzr branch -q . -r 1 ../branch
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'
853
870
def test_adopt_child(self):
854
871
self.run_script("""
855
872
$ bzr mv -q dir/file2 file2
856
$ bzr rm -q dir --force
873
$ bzr rm -q dir --no-backup
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'
862
879
def test_kill_them_all(self):
863
880
self.run_script("""
864
$ bzr rm -q dir --force
881
$ bzr rm -q dir --no-backup
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
1005
1022
def test_take_this(self):
1006
1023
self.run_script("""
1007
$ bzr rm -q foo.new --force
1024
$ bzr rm -q foo.new --no-backup
1008
1025
# FIXME: Isn't it weird that foo is now unkown even if foo.new has been put
1009
1026
# aside ? -- vila 090916
1010
1027
$ bzr add -q foo
1011
1028
$ bzr resolve foo.new
1012
2>1 conflict(s) resolved, 0 remaining
1029
2>1 conflict resolved, 0 remaining
1013
1030
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
1016
1033
def test_take_other(self):
1017
1034
self.run_script("""
1018
$ bzr rm -q foo --force
1035
$ bzr rm -q foo --no-backup
1019
1036
$ bzr mv -q foo.new foo
1020
1037
$ bzr resolve foo
1021
2>1 conflict(s) resolved, 0 remaining
1038
2>1 conflict resolved, 0 remaining
1022
1039
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
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):