733
733
# FIXME: While this *creates* UnversionedParent conflicts, this really only
734
734
# tests MissingParent resolution :-/
741
$ bzr commit -m 'Create trunk' -q
741
$ brz commit -m 'Create trunk' -q
742
742
$ echo 'trunk content' >dir/file
743
$ bzr add -q dir/file
744
$ bzr commit -q -m 'Add dir/file in trunk'
745
$ bzr branch -q . -r 1 ../branch
743
$ brz add -q dir/file
744
$ brz commit -q -m 'Add dir/file in trunk'
745
$ brz branch -q . -r 1 ../branch
748
$ bzr commit -q -m 'Remove dir in branch'
748
$ brz commit -q -m 'Remove dir in branch'
752
752
2>Conflict adding files to dir. Created directory.
757
757
def test_take_this(self):
758
758
self.run_script("""
759
$ bzr rm -q dir --no-backup
759
$ brz rm -q dir --no-backup
761
761
2>2 conflicts resolved, 0 remaining
762
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
762
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
765
765
def test_take_other(self):
766
766
self.run_script("""
768
768
2>2 conflicts resolved, 0 remaining
769
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
769
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
773
773
class TestResolveMissingParent(TestResolveConflicts):
780
780
$ echo 'trunk content' >dir/file
782
$ bzr commit -m 'Create trunk' -q
782
$ brz commit -m 'Create trunk' -q
783
783
$ echo 'trunk content' >dir/file2
784
$ bzr add -q dir/file2
785
$ bzr commit -q -m 'Add dir/file2 in branch'
786
$ bzr branch -q . -r 1 ../branch
784
$ brz add -q dir/file2
785
$ brz commit -q -m 'Add dir/file2 in branch'
786
$ brz branch -q . -r 1 ../branch
788
$ bzr rm -q dir/file --no-backup
790
$ bzr commit -q -m 'Remove dir/file'
788
$ brz rm -q dir/file --no-backup
790
$ brz commit -q -m 'Remove dir/file'
794
794
2>Conflict adding files to dir. Created directory.
799
799
def test_keep_them_all(self):
800
800
self.run_script("""
802
802
2>2 conflicts resolved, 0 remaining
803
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
803
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
806
806
def test_adopt_child(self):
807
807
self.run_script("""
808
$ bzr mv -q dir/file2 file2
809
$ bzr rm -q dir --no-backup
808
$ brz mv -q dir/file2 file2
809
$ brz rm -q dir --no-backup
811
811
2>2 conflicts resolved, 0 remaining
812
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
812
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
815
815
def test_kill_them_all(self):
816
816
self.run_script("""
817
$ bzr rm -q dir --no-backup
817
$ brz rm -q dir --no-backup
819
819
2>2 conflicts resolved, 0 remaining
820
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
820
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
823
823
def test_resolve_taking_this(self):
824
824
self.run_script("""
825
$ bzr resolve --take-this dir
825
$ brz resolve --take-this dir
827
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
827
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
830
830
def test_resolve_taking_other(self):
831
831
self.run_script("""
832
$ bzr resolve --take-other dir
832
$ brz resolve --take-other dir
834
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
834
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
838
838
class TestResolveDeletingParent(TestResolveConflicts):
845
845
$ echo 'trunk content' >dir/file
847
$ bzr commit -m 'Create trunk' -q
848
$ bzr rm -q dir/file --no-backup
849
$ bzr rm -q dir --no-backup
850
$ bzr commit -q -m 'Remove dir/file'
851
$ bzr branch -q . -r 1 ../branch
847
$ brz commit -m 'Create trunk' -q
848
$ brz rm -q dir/file --no-backup
849
$ brz rm -q dir --no-backup
850
$ brz commit -q -m 'Remove dir/file'
851
$ brz branch -q . -r 1 ../branch
853
853
$ echo 'branch content' >dir/file2
854
$ bzr add -q dir/file2
855
$ bzr commit -q -m 'Add dir/file2 in branch'
854
$ brz add -q dir/file2
855
$ brz commit -q -m 'Add dir/file2 in branch'
858
858
2>Conflict: can't delete dir because it is not empty. Not deleting.
859
859
2>Conflict because dir is not versioned, but has versioned children. Versioned directory.
863
863
def test_keep_them_all(self):
864
864
self.run_script("""
866
866
2>2 conflicts resolved, 0 remaining
867
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
867
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
870
870
def test_adopt_child(self):
871
871
self.run_script("""
872
$ bzr mv -q dir/file2 file2
873
$ bzr rm -q dir --no-backup
872
$ brz mv -q dir/file2 file2
873
$ brz rm -q dir --no-backup
875
875
2>2 conflicts resolved, 0 remaining
876
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
876
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
879
879
def test_kill_them_all(self):
880
880
self.run_script("""
881
$ bzr rm -q dir --no-backup
881
$ brz rm -q dir --no-backup
883
883
2>2 conflicts resolved, 0 remaining
884
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
884
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
887
887
def test_resolve_taking_this(self):
888
888
self.run_script("""
889
$ bzr resolve --take-this dir
889
$ brz resolve --take-this dir
890
890
2>2 conflicts resolved, 0 remaining
891
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
891
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
894
894
def test_resolve_taking_other(self):
895
895
self.run_script("""
896
$ bzr resolve --take-other dir
896
$ brz resolve --take-other dir
897
897
2>deleted dir/file2
899
899
2>2 conflicts resolved, 0 remaining
900
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
900
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
996
996
class TestResolveNonDirectoryParent(TestResolveConflicts):
1004
$ bzr commit -m 'Create trunk' -q
1004
$ brz commit -m 'Create trunk' -q
1005
1005
$ echo "Boing" >foo/bar
1006
$ bzr add -q foo/bar
1007
$ bzr commit -q -m 'Add foo/bar'
1008
$ bzr branch -q . -r 1 ../branch
1006
$ brz add -q foo/bar
1007
$ brz commit -q -m 'Add foo/bar'
1008
$ brz branch -q . -r 1 ../branch
1011
1011
$ echo "Boo!" >foo
1012
$ bzr commit -q -m 'foo is now a file'
1013
$ bzr merge ../trunk
1012
$ brz commit -q -m 'foo is now a file'
1013
$ brz merge ../trunk
1014
1014
2>+N foo.new/bar
1015
1015
2>RK foo => foo.new/
1016
1016
# FIXME: The message is misleading, foo.new *is* a directory when the message
1022
1022
def test_take_this(self):
1023
1023
self.run_script("""
1024
$ bzr rm -q foo.new --no-backup
1024
$ brz rm -q foo.new --no-backup
1025
1025
# FIXME: Isn't it weird that foo is now unkown even if foo.new has been put
1026
1026
# aside ? -- vila 090916
1028
$ bzr resolve foo.new
1028
$ brz resolve foo.new
1029
1029
2>1 conflict resolved, 0 remaining
1030
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
1030
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
1033
1033
def test_take_other(self):
1034
1034
self.run_script("""
1035
$ bzr rm -q foo --no-backup
1036
$ bzr mv -q foo.new foo
1035
$ brz rm -q foo --no-backup
1036
$ brz mv -q foo.new foo
1038
1038
2>1 conflict resolved, 0 remaining
1039
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
1039
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
1042
1042
def test_resolve_taking_this(self):
1043
1043
self.run_script("""
1044
$ bzr resolve --take-this foo.new
1044
$ brz resolve --take-this foo.new
1046
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
1046
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
1049
1049
def test_resolve_taking_other(self):
1050
1050
self.run_script("""
1051
$ bzr resolve --take-other foo.new
1051
$ brz resolve --take-other foo.new
1053
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
1053
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
1063
1063
self.assertRaises(errors.MalformedTransform,
1064
1064
self.run_script,"""
1070
$ bzr commit -m 'Create trunk' -q
1070
$ brz commit -m 'Create trunk' -q
1072
1072
$ echo "Boo!" >foo
1073
$ bzr commit -m 'foo is now a file' -q
1074
$ bzr branch -q . -r 1 ../branch -q
1073
$ brz commit -m 'foo is now a file' -q
1074
$ brz branch -q . -r 1 ../branch -q
1076
1076
$ echo "Boing" >foo/bar
1077
$ bzr add -q foo/bar -q
1078
$ bzr commit -m 'Add foo/bar' -q
1079
$ bzr merge ../trunk
1080
2>bzr: ERROR: Tree transform is malformed [('unversioned executability', 'new-1')]
1077
$ brz add -q foo/bar -q
1078
$ brz commit -m 'Add foo/bar' -q
1079
$ brz merge ../trunk
1080
2>brz: ERROR: Tree transform is malformed [('unversioned executability', 'new-1')]
1086
1086
def test_bug_805809(self):
1087
1087
self.run_script("""
1089
1089
Created a standalone tree (format: 2a)
1091
1091
$ echo trunk >file
1094
$ bzr commit -m 'create file on trunk'
1094
$ brz commit -m 'create file on trunk'
1095
1095
2>Committing to: .../trunk/
1097
1097
2>Committed revision 1.
1098
1098
# Create a debian branch based on trunk
1100
$ bzr branch trunk -r 1 debian
1100
$ brz branch trunk -r 1 debian
1101
1101
2>Branched 1 revision.
1107
1107
file => dir/file
1108
$ bzr commit -m 'rename file to dir/file for debian'
1108
$ brz commit -m 'rename file to dir/file for debian'
1109
1109
2>Committing to: .../debian/
1111
1111
2>renamed file => dir/file
1112
1112
2>Committed revision 2.
1113
1113
# Create an experimental branch with a new root-id
1115
$ bzr init experimental
1115
$ brz init experimental
1116
1116
Created a standalone tree (format: 2a)
1117
1117
$ cd experimental
1118
1118
# Work around merging into empty branch not being supported
1119
1119
# (http://pad.lv/308562)
1120
1120
$ echo something >not-empty
1122
1122
adding not-empty
1123
$ bzr commit -m 'Add some content in experimental'
1123
$ brz commit -m 'Add some content in experimental'
1124
1124
2>Committing to: .../experimental/
1125
1125
2>added not-empty
1126
1126
2>Committed revision 1.
1127
1127
# merge debian even without a common ancestor
1128
$ bzr merge ../debian -r0..2
1128
$ brz merge ../debian -r0..2
1131
1131
2>All changes applied successfully.
1132
$ bzr commit -m 'merging debian into experimental'
1132
$ brz commit -m 'merging debian into experimental'
1133
1133
2>Committing to: .../experimental/
1135
1135
2>added dir/file
1136
1136
2>Committed revision 2.
1137
1137
# Create an ubuntu branch with yet another root-id
1140
1140
Created a standalone tree (format: 2a)
1142
1142
# Work around merging into empty branch not being supported
1143
1143
# (http://pad.lv/308562)
1144
1144
$ echo something >not-empty-ubuntu
1146
1146
adding not-empty-ubuntu
1147
$ bzr commit -m 'Add some content in experimental'
1147
$ brz commit -m 'Add some content in experimental'
1148
1148
2>Committing to: .../ubuntu/
1149
1149
2>added not-empty-ubuntu
1150
1150
2>Committed revision 1.
1151
1151
# Also merge debian
1152
$ bzr merge ../debian -r0..2
1152
$ brz merge ../debian -r0..2
1155
1155
2>All changes applied successfully.
1156
$ bzr commit -m 'merging debian'
1156
$ brz commit -m 'merging debian'
1157
1157
2>Committing to: .../ubuntu/
1159
1159
2>added dir/file
1160
1160
2>Committed revision 2.
1161
1161
# Now try to merge experimental
1162
$ bzr merge ../experimental
1162
$ brz merge ../experimental
1164
1164
2>Path conflict: dir / dir
1165
1165
2>1 conflicts encountered.