20
20
from bzrlib import (
28
from bzrlib.tests import (
34
load_tests = scenarios.load_tests_apply_scenarios
29
from bzrlib.tests import script
32
def load_tests(standard_tests, module, loader):
33
result = loader.suiteClass()
35
sp_tests, remaining_tests = tests.split_suite_by_condition(
36
standard_tests, tests.condition_isinstance((
37
TestParametrizedResolveConflicts,
39
# Each test class defines its own scenarios. This is needed for
40
# TestResolvePathConflictBefore531967 that verifies that the same tests as
41
# TestResolvePathConflict still pass.
42
for test in tests.iter_suite_tests(sp_tests):
43
tests.apply_scenarios(test, test.scenarios(), result)
45
# No parametrization for the remaining tests
46
result.addTests(remaining_tests)
37
51
# TODO: Test commit with some added, and added-but-missing files
65
def vary_by_conflicts():
66
for conflict in example_conflicts:
67
yield (conflict.__class__.__name__, {"conflict": conflict})
70
79
class TestConflicts(tests.TestCaseWithTransport):
81
def test_conflicts(self):
82
"""Conflicts are detected properly"""
83
# Use BzrDirFormat6 so we can fake conflicts
84
tree = self.make_branch_and_tree('.', format=bzrdir.BzrDirFormat6())
85
self.build_tree_contents([('hello', 'hello world4'),
86
('hello.THIS', 'hello world2'),
87
('hello.BASE', 'hello world1'),
88
('hello.OTHER', 'hello world3'),
89
('hello.sploo.BASE', 'yellowworld'),
90
('hello.sploo.OTHER', 'yellowworld2'),
93
self.assertLength(6, list(tree.list_files()))
95
tree_conflicts = tree.conflicts()
96
self.assertLength(2, tree_conflicts)
97
self.assertTrue('hello' in tree_conflicts[0].path)
98
self.assertTrue('hello.sploo' in tree_conflicts[1].path)
99
conflicts.restore('hello')
100
conflicts.restore('hello.sploo')
101
self.assertLength(0, tree.conflicts())
102
self.assertFileEqual('hello world2', 'hello')
103
self.assertFalse(os.path.lexists('hello.sploo'))
104
self.assertRaises(errors.NotConflicted, conflicts.restore, 'hello')
105
self.assertRaises(errors.NotConflicted,
106
conflicts.restore, 'hello.sploo')
72
108
def test_resolve_conflict_dir(self):
73
109
tree = self.make_branch_and_tree('.')
74
110
self.build_tree_contents([('hello', 'hello world4'),
125
161
self.assertEqual(conflicts.ConflictList([]), tree.conflicts())
128
class TestPerConflict(tests.TestCase):
130
scenarios = scenarios.multiply_scenarios(vary_by_conflicts())
132
def test_stringification(self):
133
text = unicode(self.conflict)
134
self.assertContainsString(text, self.conflict.path)
135
self.assertContainsString(text.lower(), "conflict")
136
self.assertContainsString(repr(self.conflict),
137
self.conflict.__class__.__name__)
164
class TestConflictStanzas(tests.TestCase):
139
166
def test_stanza_roundtrip(self):
141
o = conflicts.Conflict.factory(**p.as_stanza().as_dict())
142
self.assertEqual(o, p)
144
self.assertIsInstance(o.path, unicode)
146
if o.file_id is not None:
147
self.assertIsInstance(o.file_id, str)
149
conflict_path = getattr(o, 'conflict_path', None)
150
if conflict_path is not None:
151
self.assertIsInstance(conflict_path, unicode)
153
conflict_file_id = getattr(o, 'conflict_file_id', None)
154
if conflict_file_id is not None:
155
self.assertIsInstance(conflict_file_id, str)
167
# write and read our example stanza.
168
stanza_iter = example_conflicts.to_stanzas()
169
processed = conflicts.ConflictList.from_stanzas(stanza_iter)
170
for o, p in zip(processed, example_conflicts):
171
self.assertEqual(o, p)
173
self.assertIsInstance(o.path, unicode)
175
if o.file_id is not None:
176
self.assertIsInstance(o.file_id, str)
178
conflict_path = getattr(o, 'conflict_path', None)
179
if conflict_path is not None:
180
self.assertIsInstance(conflict_path, unicode)
182
conflict_file_id = getattr(o, 'conflict_file_id', None)
183
if conflict_file_id is not None:
184
self.assertIsInstance(conflict_file_id, str)
157
186
def test_stanzification(self):
158
stanza = self.conflict.as_stanza()
159
if 'file_id' in stanza:
160
# In Stanza form, the file_id has to be unicode.
161
self.assertStartsWith(stanza['file_id'], u'\xeed')
162
self.assertStartsWith(stanza['path'], u'p\xe5th')
163
if 'conflict_path' in stanza:
164
self.assertStartsWith(stanza['conflict_path'], u'p\xe5th')
165
if 'conflict_file_id' in stanza:
166
self.assertStartsWith(stanza['conflict_file_id'], u'\xeed')
169
class TestConflictList(tests.TestCase):
171
def test_stanzas_roundtrip(self):
172
stanzas_iter = example_conflicts.to_stanzas()
173
processed = conflicts.ConflictList.from_stanzas(stanzas_iter)
174
self.assertEqual(example_conflicts, processed)
176
def test_stringification(self):
177
for text, o in zip(example_conflicts.to_strings(), example_conflicts):
178
self.assertEqual(text, unicode(o))
187
for stanza in example_conflicts.to_stanzas():
188
if 'file_id' in stanza:
189
# In Stanza form, the file_id has to be unicode.
190
self.assertStartsWith(stanza['file_id'], u'\xeed')
191
self.assertStartsWith(stanza['path'], u'p\xe5th')
192
if 'conflict_path' in stanza:
193
self.assertStartsWith(stanza['conflict_path'], u'p\xe5th')
194
if 'conflict_file_id' in stanza:
195
self.assertStartsWith(stanza['conflict_file_id'], u'\xeed')
181
198
# FIXME: The shell-like tests should be converted to real whitebox tests... or
275
"""The scenario list for the conflict type defined by the class.
277
Each scenario is of the form:
278
(common, (left_name, left_dict), (right_name, right_dict))
282
* left_name and right_name are the scenario names that will be combined
284
* left_dict and right_dict are the attributes specific to each half of
285
the scenario. They should include at least 'actions' and 'check' and
286
will be available as '_this' and '_other' test instance attributes.
288
Daughters classes are free to add their specific attributes as they see
289
fit in any of the three dicts.
291
This is a class method so that load_tests can find it.
293
'_base_actions' in the common dict, 'actions' and 'check' in the left
294
and right dicts use names that map to methods in the test classes. Some
295
prefixes are added to these names to get the correspong methods (see
296
_get_actions() and _get_check()). The motivation here is to avoid
297
collisions in the class namespace.
298
"""Return the scenario list for the conflict type defined by the class.
300
Each scenario is of the form:
301
(common, (left_name, left_dict), (right_name, right_dict))
305
* left_name and right_name are the scenario names that will be combined
307
* left_dict and right_dict are the attributes specific to each half of
308
the scenario. They should include at least 'actions' and 'check' and
309
will be available as '_this' and '_other' test instance attributes.
311
Daughters classes are free to add their specific attributes as they see
312
fit in any of the three dicts.
314
This is a class method so that load_tests can find it.
316
'_base_actions' in the common dict, 'actions' and 'check' in the left
317
and right dicts use names that map to methods in the test classes. Some
318
prefixes are added to these names to get the correspong methods (see
319
_get_actions() and _get_check()). The motivation here is to avoid
320
collisions in the class namespace.
322
# Only concrete classes return actual scenarios
301
326
super(TestParametrizedResolveConflicts, self).setUp()
366
class TestResolveTextConflicts(TestParametrizedResolveConflicts):
368
_conflict_type = conflicts.TextConflict
370
# Set by the scenarios
371
# path and file-id for the file involved in the conflict
375
scenarios = mirror_scenarios(
377
# File modified on both sides
378
(dict(_base_actions='create_file',
379
_path='file', _file_id='file-id'),
381
dict(actions='modify_file_A', check='file_has_content_A')),
383
dict(actions='modify_file_B', check='file_has_content_B')),),
384
# File modified on both sides in dir
385
(dict(_base_actions='create_file_in_dir',
386
_path='dir/file', _file_id='file-id'),
387
('filed_modified_A_in_dir',
388
dict(actions='modify_file_A',
389
check='file_in_dir_has_content_A')),
391
dict(actions='modify_file_B',
392
check='file_in_dir_has_content_B')),),
395
def do_create_file(self, path='file'):
396
return [('add', (path, 'file-id', 'file', 'trunk content\n'))]
398
def do_modify_file_A(self):
399
return [('modify', ('file-id', 'trunk content\nfeature A\n'))]
401
def do_modify_file_B(self):
402
return [('modify', ('file-id', 'trunk content\nfeature B\n'))]
404
def check_file_has_content_A(self, path='file'):
405
self.assertFileEqual('trunk content\nfeature A\n',
406
osutils.pathjoin('branch', path))
408
def check_file_has_content_B(self, path='file'):
409
self.assertFileEqual('trunk content\nfeature B\n',
410
osutils.pathjoin('branch', path))
412
def do_create_file_in_dir(self):
413
return [('add', ('dir', 'dir-id', 'directory', '')),
414
] + self.do_create_file('dir/file')
416
def check_file_in_dir_has_content_A(self):
417
self.check_file_has_content_A('dir/file')
419
def check_file_in_dir_has_content_B(self):
420
self.check_file_has_content_B('dir/file')
422
def _get_resolve_path_arg(self, wt, action):
425
def assertTextConflict(self, wt, c):
426
self.assertEqual(self._file_id, c.file_id)
427
self.assertEqual(self._path, c.path)
428
_assert_conflict = assertTextConflict
431
391
class TestResolveContentsConflict(TestParametrizedResolveConflicts):
433
_conflict_type = conflicts.ContentsConflict
393
_conflict_type = conflicts.ContentsConflict,
435
# Set by the scenarios
395
# Set by load_tests from scenarios()
436
396
# path and file-id for the file involved in the conflict
440
scenarios = mirror_scenarios(
442
403
# File modified/deleted
443
404
(dict(_base_actions='create_file',
444
405
_path='file', _file_id='file-id'),
446
407
dict(actions='modify_file', check='file_has_more_content')),
448
409
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')),
456
dict(actions='delete_file', check='file_doesnt_exist')),),
457
# File modified/deleted in dir
458
(dict(_base_actions='create_file_in_dir',
459
_path='dir/file', _file_id='file-id'),
460
('file_modified_in_dir',
461
dict(actions='modify_file_in_dir',
462
check='file_in_dir_has_more_content')),
463
('file_deleted_in_dir',
464
dict(actions='delete_file',
465
check='file_in_dir_doesnt_exist')),),
411
return mirror_scenarios(base_scenarios)
468
413
def do_create_file(self):
469
414
return [('add', ('file', 'file-id', 'file', 'trunk content\n'))]
471
416
def do_modify_file(self):
472
417
return [('modify', ('file-id', 'trunk content\nmore content\n'))]
474
def do_modify_and_rename_file(self):
475
return [('modify', ('file-id', 'trunk content\nmore content\n')),
476
('rename', ('file', 'new-file'))]
478
419
def check_file_has_more_content(self):
479
420
self.assertFileEqual('trunk content\nmore content\n', 'branch/file')
481
def check_file_renamed_and_more_content(self):
482
self.assertFileEqual('trunk content\nmore content\n', 'branch/new-file')
484
422
def do_delete_file(self):
485
423
return [('unversion', 'file-id')]
487
425
def check_file_doesnt_exist(self):
488
self.assertPathDoesNotExist('branch/file')
490
def do_create_file_in_dir(self):
491
return [('add', ('dir', 'dir-id', 'directory', '')),
492
('add', ('dir/file', 'file-id', 'file', 'trunk content\n'))]
494
def do_modify_file_in_dir(self):
495
return [('modify', ('file-id', 'trunk content\nmore content\n'))]
497
def check_file_in_dir_has_more_content(self):
498
self.assertFileEqual('trunk content\nmore content\n', 'branch/dir/file')
500
def check_file_in_dir_doesnt_exist(self):
501
self.assertPathDoesNotExist('branch/dir/file')
426
self.failIfExists('branch/file')
503
428
def _get_resolve_path_arg(self, wt, action):
504
429
return self._path
531
457
# PathConflicts deletion handling requires a special
532
458
# hard-coded value
533
459
path='<deleted>', file_id='file-id')),),
534
# File renamed/deleted in dir
535
(dict(_base_actions='create_file_in_dir'),
536
('file_renamed_in_dir',
537
dict(actions='rename_file_in_dir', check='file_in_dir_renamed',
538
path='dir/new-file', file_id='file-id')),
540
dict(actions='delete_file', check='file_in_dir_doesnt_exist',
541
# PathConflicts deletion handling requires a special
543
path='<deleted>', file_id='file-id')),),
544
460
# File renamed/renamed differently
545
461
(dict(_base_actions='create_file'),
579
496
return [('rename', ('file', 'new-file'))]
581
498
def check_file_renamed(self):
582
self.assertPathDoesNotExist('branch/file')
583
self.assertPathExists('branch/new-file')
499
self.failIfExists('branch/file')
500
self.failUnlessExists('branch/new-file')
585
502
def do_rename_file2(self):
586
503
return [('rename', ('file', 'new-file2'))]
588
505
def check_file_renamed2(self):
589
self.assertPathDoesNotExist('branch/file')
590
self.assertPathExists('branch/new-file2')
506
self.failIfExists('branch/file')
507
self.failUnlessExists('branch/new-file2')
592
509
def do_rename_dir(self):
593
510
return [('rename', ('dir', 'new-dir'))]
595
512
def check_dir_renamed(self):
596
self.assertPathDoesNotExist('branch/dir')
597
self.assertPathExists('branch/new-dir')
513
self.failIfExists('branch/dir')
514
self.failUnlessExists('branch/new-dir')
599
516
def do_rename_dir2(self):
600
517
return [('rename', ('dir', 'new-dir2'))]
602
519
def check_dir_renamed2(self):
603
self.assertPathDoesNotExist('branch/dir')
604
self.assertPathExists('branch/new-dir2')
520
self.failIfExists('branch/dir')
521
self.failUnlessExists('branch/new-dir2')
606
523
def do_delete_file(self):
607
524
return [('unversion', 'file-id')]
609
526
def check_file_doesnt_exist(self):
610
self.assertPathDoesNotExist('branch/file')
527
self.failIfExists('branch/file')
612
529
def do_delete_dir(self):
613
530
return [('unversion', 'dir-id')]
615
532
def check_dir_doesnt_exist(self):
616
self.assertPathDoesNotExist('branch/dir')
618
def do_create_file_in_dir(self):
619
return [('add', ('dir', 'dir-id', 'directory', '')),
620
('add', ('dir/file', 'file-id', 'file', 'trunk content\n'))]
622
def do_rename_file_in_dir(self):
623
return [('rename', ('dir/file', 'dir/new-file'))]
625
def check_file_in_dir_renamed(self):
626
self.assertPathDoesNotExist('branch/dir/file')
627
self.assertPathExists('branch/dir/new-file')
629
def check_file_in_dir_doesnt_exist(self):
630
self.assertPathDoesNotExist('branch/dir/file')
533
self.failIfExists('branch/dir')
632
535
def _get_resolve_path_arg(self, wt, action):
633
536
tpath = self._this['path']
782
692
def test_keep_them_all(self):
783
693
self.run_script("""
784
694
$ bzr resolve dir
785
2>2 conflict(s) resolved, 0 remaining
786
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
695
$ bzr commit --strict -m 'No more conflicts nor unknown files'
789
698
def test_adopt_child(self):
790
699
self.run_script("""
791
$ bzr mv -q dir/file2 file2
792
$ bzr rm -q dir --force
700
$ bzr mv dir/file2 file2
793
702
$ bzr resolve dir
794
2>2 conflict(s) resolved, 0 remaining
795
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
703
$ bzr commit --strict -m 'No more conflicts nor unknown files'
798
706
def test_kill_them_all(self):
799
707
self.run_script("""
800
$ bzr rm -q dir --force
801
709
$ bzr resolve dir
802
2>2 conflict(s) resolved, 0 remaining
803
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
710
$ bzr commit --strict -m 'No more conflicts nor unknown files'
806
713
def test_resolve_taking_this(self):
807
714
self.run_script("""
808
715
$ bzr resolve --take-this dir
810
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
716
$ bzr commit --strict -m 'No more conflicts nor unknown files'
813
719
def test_resolve_taking_other(self):
814
720
self.run_script("""
815
721
$ bzr resolve --take-other dir
817
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
722
$ bzr commit --strict -m 'No more conflicts nor unknown files'
828
732
$ echo 'trunk content' >dir/file
830
$ bzr commit -m 'Create trunk' -q
831
$ bzr rm -q dir/file --force
832
$ bzr rm -q dir --force
833
$ bzr commit -q -m 'Remove dir/file'
834
$ bzr branch -q . -r 1 ../branch
734
$ bzr commit -m 'Create trunk'
736
$ bzr rm dir/file --force
738
$ bzr commit -m 'Remove dir/file'
740
$ bzr branch . -r 1 ../branch
836
742
$ echo 'branch content' >dir/file2
837
$ bzr add -q dir/file2
838
$ bzr commit -q -m 'Add dir/file2 in branch'
744
$ bzr commit -m 'Add dir/file2 in branch'
839
746
$ bzr merge ../trunk
841
748
2>Conflict: can't delete dir because it is not empty. Not deleting.
846
753
def test_keep_them_all(self):
847
754
self.run_script("""
848
755
$ bzr resolve dir
849
2>2 conflict(s) resolved, 0 remaining
850
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
756
$ bzr commit --strict -m 'No more conflicts nor unknown files'
853
759
def test_adopt_child(self):
854
760
self.run_script("""
855
$ bzr mv -q dir/file2 file2
856
$ bzr rm -q dir --force
761
$ bzr mv dir/file2 file2
857
763
$ bzr resolve dir
858
2>2 conflict(s) resolved, 0 remaining
859
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
764
$ bzr commit --strict -m 'No more conflicts nor unknown files'
862
767
def test_kill_them_all(self):
863
768
self.run_script("""
864
$ bzr rm -q dir --force
865
770
$ bzr resolve dir
866
2>2 conflict(s) resolved, 0 remaining
867
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
771
$ bzr commit --strict -m 'No more conflicts nor unknown files'
870
774
def test_resolve_taking_this(self):
871
775
self.run_script("""
872
776
$ bzr resolve --take-this dir
873
2>2 conflict(s) resolved, 0 remaining
874
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
777
$ bzr commit --strict -m 'No more conflicts nor unknown files'
877
780
def test_resolve_taking_other(self):
878
781
self.run_script("""
879
782
$ bzr resolve --take-other dir
882
2>2 conflict(s) resolved, 0 remaining
883
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
783
$ bzr commit --strict -m 'No more conflicts nor unknown files'
887
787
class TestResolveParentLoop(TestParametrizedResolveConflicts):
889
_conflict_type = conflicts.ParentLoop
789
_conflict_type = conflicts.ParentLoop,
891
791
_this_args = None
892
792
_other_args = None
894
# Each side dict additionally defines:
895
# - dir_id: the directory being moved
896
# - target_id: The target directory
897
# - xfail: whether the test is expected to fail if the action is
898
# involved as 'other'
899
scenarios = mirror_scenarios(
796
# Each side dict additionally defines:
797
# - dir_id: the directory being moved
798
# - target_id: The target directory
799
# - xfail: whether the test is expected to fail if the action is
800
# involved as 'other'
901
802
# Dirs moved into each other
902
803
(dict(_base_actions='create_dir1_dir2'),
903
804
('dir1_into_dir2',
924
826
return [('rename', ('dir1', 'dir2/dir1'))]
926
828
def check_dir1_moved(self):
927
self.assertPathDoesNotExist('branch/dir1')
928
self.assertPathExists('branch/dir2/dir1')
829
self.failIfExists('branch/dir1')
830
self.failUnlessExists('branch/dir2/dir1')
930
832
def do_move_dir2_into_dir1(self):
931
833
return [('rename', ('dir2', 'dir1/dir2'))]
933
835
def check_dir2_moved(self):
934
self.assertPathDoesNotExist('branch/dir2')
935
self.assertPathExists('branch/dir1/dir2')
836
self.failIfExists('branch/dir2')
837
self.failUnlessExists('branch/dir1/dir2')
937
839
def do_create_dir1_4(self):
938
840
return [('add', ('dir1', 'dir1-id', 'directory', '')),
944
846
return [('rename', ('dir1', 'dir3/dir4/dir1'))]
946
848
def check_dir1_2_moved(self):
947
self.assertPathDoesNotExist('branch/dir1')
948
self.assertPathExists('branch/dir3/dir4/dir1')
949
self.assertPathExists('branch/dir3/dir4/dir1/dir2')
849
self.failIfExists('branch/dir1')
850
self.failUnlessExists('branch/dir3/dir4/dir1')
851
self.failUnlessExists('branch/dir3/dir4/dir1/dir2')
951
853
def do_move_dir3_into_dir2(self):
952
854
return [('rename', ('dir3', 'dir1/dir2/dir3'))]
954
856
def check_dir3_4_moved(self):
955
self.assertPathDoesNotExist('branch/dir3')
956
self.assertPathExists('branch/dir1/dir2/dir3')
957
self.assertPathExists('branch/dir1/dir2/dir3/dir4')
857
self.failIfExists('branch/dir3')
858
self.failUnlessExists('branch/dir1/dir2/dir3')
859
self.failUnlessExists('branch/dir1/dir2/dir3/dir4')
959
861
def _get_resolve_path_arg(self, wt, action):
960
862
# ParentLoop says: moving <conflict_path> into <path>. Cancelled move.
1005
907
def test_take_this(self):
1006
908
self.run_script("""
1007
$ bzr rm -q foo.new --force
909
$ bzr rm foo.new --force
1008
910
# FIXME: Isn't it weird that foo is now unkown even if foo.new has been put
1009
911
# aside ? -- vila 090916
1011
913
$ bzr resolve foo.new
1012
2>1 conflict(s) resolved, 0 remaining
1013
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
914
$ bzr commit --strict -m 'No more conflicts nor unknown files'
1016
917
def test_take_other(self):
1017
918
self.run_script("""
1018
$ bzr rm -q foo --force
1019
$ bzr mv -q foo.new foo
1020
921
$ bzr resolve foo
1021
2>1 conflict(s) resolved, 0 remaining
1022
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
922
$ bzr commit --strict -m 'No more conflicts nor unknown files'
1025
925
def test_resolve_taking_this(self):
1026
926
self.run_script("""
1027
927
$ bzr resolve --take-this foo.new
1029
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
928
$ bzr commit --strict -m 'No more conflicts nor unknown files'
1032
931
def test_resolve_taking_other(self):
1033
932
self.run_script("""
1034
933
$ bzr resolve --take-other foo.new
1036
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
934
$ bzr commit --strict -m 'No more conflicts nor unknown files'
1046
944
self.run_script("""
1047
945
$ bzr init trunk
1052
$ bzr commit -m 'Create trunk' -q
948
$ bzr commit -m 'Create trunk'
1054
950
$ echo "Boo!" >foo
1055
$ bzr commit -m 'foo is now a file' -q
1056
$ bzr branch -q . -r 1 ../branch -q
951
$ bzr commit -m 'foo is now a file'
953
$ bzr branch . -r 1 ../branch
1058
955
$ echo "Boing" >foo/bar
1059
$ bzr add -q foo/bar -q
1060
$ bzr commit -m 'Add foo/bar' -q
957
$ bzr commit -m 'Add foo/bar'
1061
959
$ bzr merge ../trunk
1062
960
2>bzr: ERROR: Tree transform is malformed [('unversioned executability', 'new-1')]
1066
class TestNoFinalPath(script.TestCaseWithTransportAndScript):
1068
def test_bug_805809(self):
1071
Created a standalone tree (format: 2a)
1076
$ bzr commit -m 'create file on trunk'
1077
2>Committing to: .../trunk/
1079
2>Committed revision 1.
1080
# Create a debian branch based on trunk
1082
$ bzr branch trunk -r 1 debian
1083
2>Branched 1 revision(s).
1090
$ bzr commit -m 'rename file to dir/file for debian'
1091
2>Committing to: .../debian/
1093
2>renamed file => dir/file
1094
2>Committed revision 2.
1095
# Create an experimental branch with a new root-id
1097
$ bzr init experimental
1098
Created a standalone tree (format: 2a)
1100
# Work around merging into empty branch not being supported
1101
# (http://pad.lv/308562)
1102
$ echo something >not-empty
1105
$ bzr commit -m 'Add some content in experimental'
1106
2>Committing to: .../experimental/
1108
2>Committed revision 1.
1109
# merge debian even without a common ancestor
1110
$ bzr merge ../debian -r0..2
1113
2>All changes applied successfully.
1114
$ bzr commit -m 'merging debian into experimental'
1115
2>Committing to: .../experimental/
1118
2>Committed revision 2.
1119
# Create an ubuntu branch with yet another root-id
1122
Created a standalone tree (format: 2a)
1124
# Work around merging into empty branch not being supported
1125
# (http://pad.lv/308562)
1126
$ echo something >not-empty-ubuntu
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.
1134
$ bzr merge ../debian -r0..2
1137
2>All changes applied successfully.
1138
$ bzr commit -m 'merging debian'
1139
2>Committing to: .../ubuntu/
1142
2>Committed revision 2.
1143
# Now try to merge experimental
1144
$ bzr merge ../experimental
1146
2>Path conflict: dir / dir
1147
2>1 conflicts encountered.
1151
964
class TestResolveActionOption(tests.TestCase):
1153
966
def setUp(self):