~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_conflicts.py

Move all features to bzrlib.tests.features in 2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
446
446
              dict(actions='modify_file', check='file_has_more_content')),
447
447
             ('file_deleted',
448
448
              dict(actions='delete_file', check='file_doesnt_exist')),),
 
449
            # File renamed-modified/deleted
 
450
            (dict(_base_actions='create_file',
 
451
                  _path='new-file', _file_id='file-id'),
 
452
             ('file_renamed_and_modified',
 
453
              dict(actions='modify_and_rename_file',
 
454
                   check='file_renamed_and_more_content')),
 
455
             ('file_deleted',
 
456
              dict(actions='delete_file', check='file_doesnt_exist')),),
449
457
            # File modified/deleted in dir
450
458
            (dict(_base_actions='create_file_in_dir',
451
459
                  _path='dir/file', _file_id='file-id'),
463
471
    def do_modify_file(self):
464
472
        return [('modify', ('file-id', 'trunk content\nmore content\n'))]
465
473
 
 
474
    def do_modify_and_rename_file(self):
 
475
        return [('modify', ('file-id', 'trunk content\nmore content\n')),
 
476
                ('rename', ('file', 'new-file'))]
 
477
 
466
478
    def check_file_has_more_content(self):
467
479
        self.assertFileEqual('trunk content\nmore content\n', 'branch/file')
468
480
 
 
481
    def check_file_renamed_and_more_content(self):
 
482
        self.assertFileEqual('trunk content\nmore content\n', 'branch/new-file')
 
483
 
469
484
    def do_delete_file(self):
470
485
        return [('unversion', 'file-id')]
471
486
 
1048
1063
""")
1049
1064
 
1050
1065
 
 
1066
class TestNoFinalPath(script.TestCaseWithTransportAndScript):
 
1067
 
 
1068
    def test_bug_805809(self):
 
1069
        self.run_script("""
 
1070
$ bzr init trunk
 
1071
Created a standalone tree (format: 2a)
 
1072
$ cd trunk
 
1073
$ echo trunk >file
 
1074
$ bzr add
 
1075
adding file
 
1076
$ bzr commit -m 'create file on trunk'
 
1077
2>Committing to: .../trunk/
 
1078
2>added file
 
1079
2>Committed revision 1.
 
1080
# Create a debian branch based on trunk
 
1081
$ cd ..
 
1082
$ bzr branch trunk -r 1 debian
 
1083
2>Branched 1 revision(s).
 
1084
$ cd debian
 
1085
$ mkdir dir
 
1086
$ bzr add
 
1087
adding dir
 
1088
$ bzr mv file dir
 
1089
file => dir/file
 
1090
$ bzr commit -m 'rename file to dir/file for debian'
 
1091
2>Committing to: .../debian/
 
1092
2>added dir
 
1093
2>renamed file => dir/file
 
1094
2>Committed revision 2.
 
1095
# Create an experimental branch with a new root-id
 
1096
$ cd ..
 
1097
$ bzr init experimental
 
1098
Created a standalone tree (format: 2a)
 
1099
$ cd experimental
 
1100
# Work around merging into empty branch not being supported
 
1101
# (http://pad.lv/308562)
 
1102
$ echo something >not-empty
 
1103
$ bzr add
 
1104
adding not-empty
 
1105
$ bzr commit -m 'Add some content in experimental'
 
1106
2>Committing to: .../experimental/
 
1107
2>added not-empty
 
1108
2>Committed revision 1.
 
1109
# merge debian even without a common ancestor
 
1110
$ bzr merge ../debian -r0..2
 
1111
2>+N  dir/
 
1112
2>+N  dir/file
 
1113
2>All changes applied successfully.
 
1114
$ bzr commit -m 'merging debian into experimental'
 
1115
2>Committing to: .../experimental/
 
1116
2>added dir
 
1117
2>added dir/file
 
1118
2>Committed revision 2.
 
1119
# Create an ubuntu branch with yet another root-id
 
1120
$ cd ..
 
1121
$ bzr init ubuntu
 
1122
Created a standalone tree (format: 2a)
 
1123
$ cd ubuntu
 
1124
# Work around merging into empty branch not being supported
 
1125
# (http://pad.lv/308562)
 
1126
$ echo something >not-empty-ubuntu
 
1127
$ bzr add
 
1128
adding not-empty-ubuntu
 
1129
$ bzr commit -m 'Add some content in experimental'
 
1130
2>Committing to: .../ubuntu/
 
1131
2>added not-empty-ubuntu
 
1132
2>Committed revision 1.
 
1133
# Also merge debian
 
1134
$ bzr merge ../debian -r0..2
 
1135
2>+N  dir/
 
1136
2>+N  dir/file
 
1137
2>All changes applied successfully.
 
1138
$ bzr commit -m 'merging debian'
 
1139
2>Committing to: .../ubuntu/
 
1140
2>added dir
 
1141
2>added dir/file
 
1142
2>Committed revision 2.
 
1143
# Now try to merge experimental
 
1144
$ bzr merge ../experimental
 
1145
2>+N  not-empty
 
1146
2>Path conflict: dir / dir
 
1147
2>1 conflicts encountered.
 
1148
""")
 
1149
 
 
1150
 
1051
1151
class TestResolveActionOption(tests.TestCase):
1052
1152
 
1053
1153
    def setUp(self):