676
677
('fileb_created',
677
678
dict(actions='create_file_b', check='file_content_b',
678
679
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')),),
689
682
def do_nothing(self):
701
694
def check_file_content_b(self):
702
695
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')
714
697
def _get_resolve_path_arg(self, wt, action):
715
698
return self._this['path']
757
740
def test_take_this(self):
758
741
self.run_script("""
759
$ bzr rm -q dir --no-backup
742
$ bzr rm -q dir --force
760
743
$ bzr resolve dir
761
2>2 conflicts resolved, 0 remaining
744
2>2 conflict(s) resolved, 0 remaining
762
745
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
765
748
def test_take_other(self):
766
749
self.run_script("""
767
750
$ bzr resolve dir
768
2>2 conflicts resolved, 0 remaining
751
2>2 conflict(s) resolved, 0 remaining
769
752
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
785
768
$ bzr commit -q -m 'Add dir/file2 in branch'
786
769
$ bzr branch -q . -r 1 ../branch
788
$ bzr rm -q dir/file --no-backup
771
$ bzr rm -q dir/file --force
790
773
$ bzr commit -q -m 'Remove dir/file'
791
774
$ bzr merge ../trunk
799
782
def test_keep_them_all(self):
800
783
self.run_script("""
801
784
$ bzr resolve dir
802
2>2 conflicts resolved, 0 remaining
785
2>2 conflict(s) resolved, 0 remaining
803
786
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
806
789
def test_adopt_child(self):
807
790
self.run_script("""
808
791
$ bzr mv -q dir/file2 file2
809
$ bzr rm -q dir --no-backup
792
$ bzr rm -q dir --force
810
793
$ bzr resolve dir
811
2>2 conflicts resolved, 0 remaining
794
2>2 conflict(s) resolved, 0 remaining
812
795
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
815
798
def test_kill_them_all(self):
816
799
self.run_script("""
817
$ bzr rm -q dir --no-backup
800
$ bzr rm -q dir --force
818
801
$ bzr resolve dir
819
2>2 conflicts resolved, 0 remaining
802
2>2 conflict(s) resolved, 0 remaining
820
803
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
845
828
$ echo 'trunk content' >dir/file
847
830
$ bzr commit -m 'Create trunk' -q
848
$ bzr rm -q dir/file --no-backup
849
$ bzr rm -q dir --no-backup
831
$ bzr rm -q dir/file --force
832
$ bzr rm -q dir --force
850
833
$ bzr commit -q -m 'Remove dir/file'
851
834
$ bzr branch -q . -r 1 ../branch
863
846
def test_keep_them_all(self):
864
847
self.run_script("""
865
848
$ bzr resolve dir
866
2>2 conflicts resolved, 0 remaining
849
2>2 conflict(s) resolved, 0 remaining
867
850
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
870
853
def test_adopt_child(self):
871
854
self.run_script("""
872
855
$ bzr mv -q dir/file2 file2
873
$ bzr rm -q dir --no-backup
856
$ bzr rm -q dir --force
874
857
$ bzr resolve dir
875
2>2 conflicts resolved, 0 remaining
858
2>2 conflict(s) resolved, 0 remaining
876
859
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
879
862
def test_kill_them_all(self):
880
863
self.run_script("""
881
$ bzr rm -q dir --no-backup
864
$ bzr rm -q dir --force
882
865
$ bzr resolve dir
883
2>2 conflicts resolved, 0 remaining
866
2>2 conflict(s) resolved, 0 remaining
884
867
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
887
870
def test_resolve_taking_this(self):
888
871
self.run_script("""
889
872
$ bzr resolve --take-this dir
890
2>2 conflicts resolved, 0 remaining
873
2>2 conflict(s) resolved, 0 remaining
891
874
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
896
879
$ bzr resolve --take-other dir
897
880
2>deleted dir/file2
899
2>2 conflicts resolved, 0 remaining
882
2>2 conflict(s) resolved, 0 remaining
900
883
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
988
971
if self._other['xfail']:
989
972
# It's a bit hackish to raise from here relying on being called for
990
973
# both tests but this avoid overriding test_resolve_taking_other
974
raise tests.KnownFailure(
992
975
"ParentLoop doesn't carry enough info to resolve --take-other")
993
976
_assert_conflict = assertParentLoop
1022
1005
def test_take_this(self):
1023
1006
self.run_script("""
1024
$ bzr rm -q foo.new --no-backup
1007
$ bzr rm -q foo.new --force
1025
1008
# FIXME: Isn't it weird that foo is now unkown even if foo.new has been put
1026
1009
# aside ? -- vila 090916
1027
1010
$ bzr add -q foo
1028
1011
$ bzr resolve foo.new
1029
2>1 conflict resolved, 0 remaining
1012
2>1 conflict(s) resolved, 0 remaining
1030
1013
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
1033
1016
def test_take_other(self):
1034
1017
self.run_script("""
1035
$ bzr rm -q foo --no-backup
1018
$ bzr rm -q foo --force
1036
1019
$ bzr mv -q foo.new foo
1037
1020
$ bzr resolve foo
1038
2>1 conflict resolved, 0 remaining
1021
2>1 conflict(s) resolved, 0 remaining
1039
1022
$ 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.
1169
1066
class TestResolveActionOption(tests.TestCase):
1171
1068
def setUp(self):