/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_conflicts.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
import os
19
19
 
20
 
from .. import (
 
20
from bzrlib import (
21
21
    conflicts,
22
22
    errors,
23
23
    option,
24
24
    osutils,
25
25
    tests,
26
26
    )
27
 
from . import (
 
27
from bzrlib.tests import (
28
28
    script,
29
29
    scenarios,
30
30
    )
70
70
 
71
71
    def test_resolve_conflict_dir(self):
72
72
        tree = self.make_branch_and_tree('.')
73
 
        self.build_tree_contents([('hello', b'hello world4'),
74
 
                                  ('hello.THIS', b'hello world2'),
75
 
                                  ('hello.BASE', b'hello world1'),
 
73
        self.build_tree_contents([('hello', 'hello world4'),
 
74
                                  ('hello.THIS', 'hello world2'),
 
75
                                  ('hello.BASE', 'hello world1'),
76
76
                                  ])
77
77
        os.mkdir('hello.OTHER')
78
78
        tree.add('hello', 'q')
302
302
        builder.start_series()
303
303
 
304
304
        # Create an empty trunk
305
 
        builder.build_snapshot(None, [
306
 
                ('add', ('', 'root-id', 'directory', ''))],
307
 
                revision_id='start')
 
305
        builder.build_snapshot('start', None, [
 
306
                ('add', ('', 'root-id', 'directory', ''))])
308
307
        # Add a minimal base content
309
308
        base_actions = self._get_actions(self._base_actions)()
310
 
        builder.build_snapshot(['start'], base_actions, revision_id='base')
 
309
        builder.build_snapshot('base', ['start'], base_actions)
311
310
        # Modify the base content in branch
312
311
        actions_other = self._get_actions(self._other['actions'])()
313
 
        builder.build_snapshot(['base'], actions_other, revision_id='other')
 
312
        builder.build_snapshot('other', ['base'], actions_other)
314
313
        # Modify the base content in trunk
315
314
        actions_this = self._get_actions(self._this['actions'])()
316
 
        builder.build_snapshot(['base'], actions_this, revision_id='this')
 
315
        builder.build_snapshot('this', ['base'], actions_this)
317
316
        # builder.get_branch() tip is now 'this'
318
317
 
319
318
        builder.finish_series()
327
326
 
328
327
    def _merge_other_into_this(self):
329
328
        b = self.builder.get_branch()
330
 
        wt = b.controldir.sprout('branch').open_workingtree()
 
329
        wt = b.bzrdir.sprout('branch').open_workingtree()
331
330
        wt.merge_from_branch(b, 'other')
332
331
        return wt
333
332
 
385
384
            (dict(_base_actions='create_file_in_dir',
386
385
                  _path='dir/file', _file_id='file-id'),
387
386
             ('filed_modified_A_in_dir',
388
 
              dict(actions='modify_file_A_in_dir',
 
387
              dict(actions='modify_file_A',
389
388
                   check='file_in_dir_has_content_A')),
390
389
             ('file_modified_B',
391
 
              dict(actions='modify_file_B_in_dir',
 
390
              dict(actions='modify_file_B',
392
391
                   check='file_in_dir_has_content_B')),),
393
392
            ])
394
393
 
396
395
        return [('add', (path, 'file-id', 'file', 'trunk content\n'))]
397
396
 
398
397
    def do_modify_file_A(self):
399
 
        return [('modify', ('file', 'trunk content\nfeature A\n'))]
 
398
        return [('modify', ('file-id', 'trunk content\nfeature A\n'))]
400
399
 
401
400
    def do_modify_file_B(self):
402
 
        return [('modify', ('file', 'trunk content\nfeature B\n'))]
403
 
 
404
 
    def do_modify_file_A_in_dir(self):
405
 
        return [('modify', ('dir/file', 'trunk content\nfeature A\n'))]
406
 
 
407
 
    def do_modify_file_B_in_dir(self):
408
 
        return [('modify', ('dir/file', 'trunk content\nfeature B\n'))]
 
401
        return [('modify', ('file-id', 'trunk content\nfeature B\n'))]
409
402
 
410
403
    def check_file_has_content_A(self, path='file'):
411
404
        self.assertFileEqual('trunk content\nfeature A\n',
467
460
              dict(actions='modify_file_in_dir',
468
461
                   check='file_in_dir_has_more_content')),
469
462
             ('file_deleted_in_dir',
470
 
              dict(actions='delete_file_in_dir',
 
463
              dict(actions='delete_file',
471
464
                   check='file_in_dir_doesnt_exist')),),
472
465
            ])
473
466
 
475
468
        return [('add', ('file', 'file-id', 'file', 'trunk content\n'))]
476
469
 
477
470
    def do_modify_file(self):
478
 
        return [('modify', ('file', 'trunk content\nmore content\n'))]
 
471
        return [('modify', ('file-id', 'trunk content\nmore content\n'))]
479
472
 
480
473
    def do_modify_and_rename_file(self):
481
 
        return [('modify', ('new-file', 'trunk content\nmore content\n')),
 
474
        return [('modify', ('file-id', 'trunk content\nmore content\n')),
482
475
                ('rename', ('file', 'new-file'))]
483
476
 
484
477
    def check_file_has_more_content(self):
488
481
        self.assertFileEqual('trunk content\nmore content\n', 'branch/new-file')
489
482
 
490
483
    def do_delete_file(self):
491
 
        return [('unversion', 'file')]
492
 
 
493
 
    def do_delete_file_in_dir(self):
494
 
        return [('unversion', 'dir/file')]
 
484
        return [('unversion', 'file-id')]
495
485
 
496
486
    def check_file_doesnt_exist(self):
497
487
        self.assertPathDoesNotExist('branch/file')
501
491
                ('add', ('dir/file', 'file-id', 'file', 'trunk content\n'))]
502
492
 
503
493
    def do_modify_file_in_dir(self):
504
 
        return [('modify', ('dir/file', 'trunk content\nmore content\n'))]
 
494
        return [('modify', ('file-id', 'trunk content\nmore content\n'))]
505
495
 
506
496
    def check_file_in_dir_has_more_content(self):
507
497
        self.assertFileEqual('trunk content\nmore content\n', 'branch/dir/file')
546
536
              dict(actions='rename_file_in_dir', check='file_in_dir_renamed',
547
537
                   path='dir/new-file', file_id='file-id')),
548
538
             ('file_deleted',
549
 
              dict(actions='delete_file_in_dir', check='file_in_dir_doesnt_exist',
 
539
              dict(actions='delete_file', check='file_in_dir_doesnt_exist',
550
540
                   # PathConflicts deletion handling requires a special
551
541
                   # hard-coded value
552
542
                   path='<deleted>', file_id='file-id')),),
613
603
        self.assertPathExists('branch/new-dir2')
614
604
 
615
605
    def do_delete_file(self):
616
 
        return [('unversion', 'file')]
617
 
 
618
 
    def do_delete_file_in_dir(self):
619
 
        return [('unversion', 'dir/file')]
 
606
        return [('unversion', 'file-id')]
620
607
 
621
608
    def check_file_doesnt_exist(self):
622
609
        self.assertPathDoesNotExist('branch/file')
623
610
 
624
611
    def do_delete_dir(self):
625
 
        return [('unversion', 'dir')]
 
612
        return [('unversion', 'dir-id')]
626
613
 
627
614
    def check_dir_doesnt_exist(self):
628
615
        self.assertPathDoesNotExist('branch/dir')
715
702
        self.assertFileEqual('file b content\n', 'branch/file')
716
703
 
717
704
    def do_replace_file_a_by_b(self):
718
 
        return [('unversion', 'file'),
 
705
        return [('unversion', 'file-a-id'),
719
706
                ('add', ('file', 'file-b-id', 'file', 'file b content\n'))]
720
707
 
721
708
    def do_modify_file_a(self):
722
 
        return [('modify', ('file', 'new content\n'))]
 
709
        return [('modify', ('file-a-id', 'new content\n'))]
723
710
 
724
711
    def check_file_new_content(self):
725
712
        self.assertFileEqual('new content\n', 'branch/file')
746
733
    # FIXME: While this *creates* UnversionedParent conflicts, this really only
747
734
    # tests MissingParent resolution :-/
748
735
    preamble = """
749
 
$ brz init trunk
 
736
$ bzr init trunk
750
737
...
751
738
$ cd trunk
752
739
$ mkdir dir
753
 
$ brz add -q dir
754
 
$ brz commit -m 'Create trunk' -q
 
740
$ bzr add -q dir
 
741
$ bzr commit -m 'Create trunk' -q
755
742
$ echo 'trunk content' >dir/file
756
 
$ brz add -q dir/file
757
 
$ brz commit -q -m 'Add dir/file in trunk'
758
 
$ brz branch -q . -r 1 ../branch
 
743
$ bzr add -q dir/file
 
744
$ bzr commit -q -m 'Add dir/file in trunk'
 
745
$ bzr branch -q . -r 1 ../branch
759
746
$ cd ../branch
760
 
$ brz rm dir -q
761
 
$ brz commit -q -m 'Remove dir in branch'
762
 
$ brz merge ../trunk
 
747
$ bzr rm dir -q
 
748
$ bzr commit -q -m 'Remove dir in branch'
 
749
$ bzr merge ../trunk
763
750
2>+N  dir/
764
751
2>+N  dir/file
765
752
2>Conflict adding files to dir.  Created directory.
769
756
 
770
757
    def test_take_this(self):
771
758
        self.run_script("""
772
 
$ brz rm -q dir --no-backup
773
 
$ brz resolve dir
 
759
$ bzr rm -q dir --no-backup
 
760
$ bzr resolve dir
774
761
2>2 conflicts resolved, 0 remaining
775
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
762
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
776
763
""")
777
764
 
778
765
    def test_take_other(self):
779
766
        self.run_script("""
780
 
$ brz resolve dir
 
767
$ bzr resolve dir
781
768
2>2 conflicts resolved, 0 remaining
782
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
769
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
783
770
""")
784
771
 
785
772
 
786
773
class TestResolveMissingParent(TestResolveConflicts):
787
774
 
788
775
    preamble = """
789
 
$ brz init trunk
 
776
$ bzr init trunk
790
777
...
791
778
$ cd trunk
792
779
$ mkdir dir
793
780
$ echo 'trunk content' >dir/file
794
 
$ brz add -q
795
 
$ brz commit -m 'Create trunk' -q
 
781
$ bzr add -q
 
782
$ bzr commit -m 'Create trunk' -q
796
783
$ echo 'trunk content' >dir/file2
797
 
$ brz add -q dir/file2
798
 
$ brz commit -q -m 'Add dir/file2 in branch'
799
 
$ brz branch -q . -r 1 ../branch
 
784
$ bzr add -q dir/file2
 
785
$ bzr commit -q -m 'Add dir/file2 in branch'
 
786
$ bzr branch -q . -r 1 ../branch
800
787
$ cd ../branch
801
 
$ brz rm -q dir/file --no-backup
802
 
$ brz rm -q dir
803
 
$ brz commit -q -m 'Remove dir/file'
804
 
$ brz merge ../trunk
 
788
$ bzr rm -q dir/file --no-backup
 
789
$ bzr rm -q dir
 
790
$ bzr commit -q -m 'Remove dir/file'
 
791
$ bzr merge ../trunk
805
792
2>+N  dir/
806
793
2>+N  dir/file2
807
794
2>Conflict adding files to dir.  Created directory.
811
798
 
812
799
    def test_keep_them_all(self):
813
800
        self.run_script("""
814
 
$ brz resolve dir
 
801
$ bzr resolve dir
815
802
2>2 conflicts resolved, 0 remaining
816
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
803
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
817
804
""")
818
805
 
819
806
    def test_adopt_child(self):
820
807
        self.run_script("""
821
 
$ brz mv -q dir/file2 file2
822
 
$ brz rm -q dir --no-backup
823
 
$ brz resolve dir
 
808
$ bzr mv -q dir/file2 file2
 
809
$ bzr rm -q dir --no-backup
 
810
$ bzr resolve dir
824
811
2>2 conflicts resolved, 0 remaining
825
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
812
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
826
813
""")
827
814
 
828
815
    def test_kill_them_all(self):
829
816
        self.run_script("""
830
 
$ brz rm -q dir --no-backup
831
 
$ brz resolve dir
 
817
$ bzr rm -q dir --no-backup
 
818
$ bzr resolve dir
832
819
2>2 conflicts resolved, 0 remaining
833
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
820
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
834
821
""")
835
822
 
836
823
    def test_resolve_taking_this(self):
837
824
        self.run_script("""
838
 
$ brz resolve --take-this dir
 
825
$ bzr resolve --take-this dir
839
826
2>...
840
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
827
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
841
828
""")
842
829
 
843
830
    def test_resolve_taking_other(self):
844
831
        self.run_script("""
845
 
$ brz resolve --take-other dir
 
832
$ bzr resolve --take-other dir
846
833
2>...
847
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
834
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
848
835
""")
849
836
 
850
837
 
851
838
class TestResolveDeletingParent(TestResolveConflicts):
852
839
 
853
840
    preamble = """
854
 
$ brz init trunk
 
841
$ bzr init trunk
855
842
...
856
843
$ cd trunk
857
844
$ mkdir dir
858
845
$ echo 'trunk content' >dir/file
859
 
$ brz add -q
860
 
$ brz commit -m 'Create trunk' -q
861
 
$ brz rm -q dir/file --no-backup
862
 
$ brz rm -q dir --no-backup
863
 
$ brz commit -q -m 'Remove dir/file'
864
 
$ brz branch -q . -r 1 ../branch
 
846
$ bzr add -q
 
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
865
852
$ cd ../branch
866
853
$ echo 'branch content' >dir/file2
867
 
$ brz add -q dir/file2
868
 
$ brz commit -q -m 'Add dir/file2 in branch'
869
 
$ brz merge ../trunk
 
854
$ bzr add -q dir/file2
 
855
$ bzr commit -q -m 'Add dir/file2 in branch'
 
856
$ bzr merge ../trunk
870
857
2>-D  dir/file
871
858
2>Conflict: can't delete dir because it is not empty.  Not deleting.
872
859
2>Conflict because dir is not versioned, but has versioned children.  Versioned directory.
875
862
 
876
863
    def test_keep_them_all(self):
877
864
        self.run_script("""
878
 
$ brz resolve dir
 
865
$ bzr resolve dir
879
866
2>2 conflicts resolved, 0 remaining
880
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
867
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
881
868
""")
882
869
 
883
870
    def test_adopt_child(self):
884
871
        self.run_script("""
885
 
$ brz mv -q dir/file2 file2
886
 
$ brz rm -q dir --no-backup
887
 
$ brz resolve dir
 
872
$ bzr mv -q dir/file2 file2
 
873
$ bzr rm -q dir --no-backup
 
874
$ bzr resolve dir
888
875
2>2 conflicts resolved, 0 remaining
889
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
876
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
890
877
""")
891
878
 
892
879
    def test_kill_them_all(self):
893
880
        self.run_script("""
894
 
$ brz rm -q dir --no-backup
895
 
$ brz resolve dir
 
881
$ bzr rm -q dir --no-backup
 
882
$ bzr resolve dir
896
883
2>2 conflicts resolved, 0 remaining
897
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
884
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
898
885
""")
899
886
 
900
887
    def test_resolve_taking_this(self):
901
888
        self.run_script("""
902
 
$ brz resolve --take-this dir
 
889
$ bzr resolve --take-this dir
903
890
2>2 conflicts resolved, 0 remaining
904
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
891
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
905
892
""")
906
893
 
907
894
    def test_resolve_taking_other(self):
908
895
        self.run_script("""
909
 
$ brz resolve --take-other dir
 
896
$ bzr resolve --take-other dir
910
897
2>deleted dir/file2
911
898
2>deleted dir
912
899
2>2 conflicts resolved, 0 remaining
913
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
900
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
914
901
""")
915
902
 
916
903
 
1009
996
class TestResolveNonDirectoryParent(TestResolveConflicts):
1010
997
 
1011
998
    preamble = """
1012
 
$ brz init trunk
 
999
$ bzr init trunk
1013
1000
...
1014
1001
$ cd trunk
1015
 
$ brz mkdir foo
 
1002
$ bzr mkdir foo
1016
1003
...
1017
 
$ brz commit -m 'Create trunk' -q
 
1004
$ bzr commit -m 'Create trunk' -q
1018
1005
$ echo "Boing" >foo/bar
1019
 
$ brz add -q foo/bar
1020
 
$ brz commit -q -m 'Add foo/bar'
1021
 
$ brz branch -q . -r 1 ../branch
 
1006
$ bzr add -q foo/bar
 
1007
$ bzr commit -q -m 'Add foo/bar'
 
1008
$ bzr branch -q . -r 1 ../branch
1022
1009
$ cd ../branch
1023
1010
$ rm -r foo
1024
1011
$ echo "Boo!" >foo
1025
 
$ brz commit -q -m 'foo is now a file'
1026
 
$ brz merge ../trunk
 
1012
$ bzr commit -q -m 'foo is now a file'
 
1013
$ bzr merge ../trunk
1027
1014
2>+N  foo.new/bar
1028
1015
2>RK  foo => foo.new/
1029
1016
# FIXME: The message is misleading, foo.new *is* a directory when the message
1034
1021
 
1035
1022
    def test_take_this(self):
1036
1023
        self.run_script("""
1037
 
$ brz rm -q foo.new --no-backup
 
1024
$ bzr rm -q foo.new --no-backup
1038
1025
# FIXME: Isn't it weird that foo is now unkown even if foo.new has been put
1039
1026
# aside ? -- vila 090916
1040
 
$ brz add -q foo
1041
 
$ brz resolve foo.new
 
1027
$ bzr add -q foo
 
1028
$ bzr resolve foo.new
1042
1029
2>1 conflict resolved, 0 remaining
1043
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
1030
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
1044
1031
""")
1045
1032
 
1046
1033
    def test_take_other(self):
1047
1034
        self.run_script("""
1048
 
$ brz rm -q foo --no-backup
1049
 
$ brz mv -q foo.new foo
1050
 
$ brz resolve foo
 
1035
$ bzr rm -q foo --no-backup
 
1036
$ bzr mv -q foo.new foo
 
1037
$ bzr resolve foo
1051
1038
2>1 conflict resolved, 0 remaining
1052
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
1039
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
1053
1040
""")
1054
1041
 
1055
1042
    def test_resolve_taking_this(self):
1056
1043
        self.run_script("""
1057
 
$ brz resolve --take-this foo.new
 
1044
$ bzr resolve --take-this foo.new
1058
1045
2>...
1059
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
1046
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
1060
1047
""")
1061
1048
 
1062
1049
    def test_resolve_taking_other(self):
1063
1050
        self.run_script("""
1064
 
$ brz resolve --take-other foo.new
 
1051
$ bzr resolve --take-other foo.new
1065
1052
2>...
1066
 
$ brz commit -q --strict -m 'No more conflicts nor unknown files'
 
1053
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
1067
1054
""")
1068
1055
 
1069
1056
 
1074
1061
        # trunk switched. As such it should certainly produce the same
1075
1062
        # conflict.
1076
1063
        self.assertRaises(errors.MalformedTransform,
1077
 
                          self.run_script, """
1078
 
$ brz init trunk
 
1064
                          self.run_script,"""
 
1065
$ bzr init trunk
1079
1066
...
1080
1067
$ cd trunk
1081
 
$ brz mkdir foo
 
1068
$ bzr mkdir foo
1082
1069
...
1083
 
$ brz commit -m 'Create trunk' -q
 
1070
$ bzr commit -m 'Create trunk' -q
1084
1071
$ rm -r foo
1085
1072
$ echo "Boo!" >foo
1086
 
$ brz commit -m 'foo is now a file' -q
1087
 
$ brz branch -q . -r 1 ../branch -q
 
1073
$ bzr commit -m 'foo is now a file' -q
 
1074
$ bzr branch -q . -r 1 ../branch -q
1088
1075
$ cd ../branch
1089
1076
$ echo "Boing" >foo/bar
1090
 
$ brz add -q foo/bar -q
1091
 
$ brz commit -m 'Add foo/bar' -q
1092
 
$ brz merge ../trunk
1093
 
2>brz: ERROR: Tree transform is malformed [('unversioned executability', 'new-1')]
 
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')]
1094
1081
""")
1095
1082
 
1096
1083
 
1098
1085
 
1099
1086
    def test_bug_805809(self):
1100
1087
        self.run_script("""
1101
 
$ brz init trunk
 
1088
$ bzr init trunk
1102
1089
Created a standalone tree (format: 2a)
1103
1090
$ cd trunk
1104
1091
$ echo trunk >file
1105
 
$ brz add
 
1092
$ bzr add
1106
1093
adding file
1107
 
$ brz commit -m 'create file on trunk'
 
1094
$ bzr commit -m 'create file on trunk'
1108
1095
2>Committing to: .../trunk/
1109
1096
2>added file
1110
1097
2>Committed revision 1.
1111
1098
# Create a debian branch based on trunk
1112
1099
$ cd ..
1113
 
$ brz branch trunk -r 1 debian
 
1100
$ bzr branch trunk -r 1 debian
1114
1101
2>Branched 1 revision.
1115
1102
$ cd debian
1116
1103
$ mkdir dir
1117
 
$ brz add
 
1104
$ bzr add
1118
1105
adding dir
1119
 
$ brz mv file dir
 
1106
$ bzr mv file dir
1120
1107
file => dir/file
1121
 
$ brz commit -m 'rename file to dir/file for debian'
 
1108
$ bzr commit -m 'rename file to dir/file for debian'
1122
1109
2>Committing to: .../debian/
1123
1110
2>added dir
1124
1111
2>renamed file => dir/file
1125
1112
2>Committed revision 2.
1126
1113
# Create an experimental branch with a new root-id
1127
1114
$ cd ..
1128
 
$ brz init experimental
 
1115
$ bzr init experimental
1129
1116
Created a standalone tree (format: 2a)
1130
1117
$ cd experimental
1131
1118
# Work around merging into empty branch not being supported
1132
1119
# (http://pad.lv/308562)
1133
1120
$ echo something >not-empty
1134
 
$ brz add
 
1121
$ bzr add
1135
1122
adding not-empty
1136
 
$ brz commit -m 'Add some content in experimental'
 
1123
$ bzr commit -m 'Add some content in experimental'
1137
1124
2>Committing to: .../experimental/
1138
1125
2>added not-empty
1139
1126
2>Committed revision 1.
1140
1127
# merge debian even without a common ancestor
1141
 
$ brz merge ../debian -r0..2
 
1128
$ bzr merge ../debian -r0..2
1142
1129
2>+N  dir/
1143
1130
2>+N  dir/file
1144
1131
2>All changes applied successfully.
1145
 
$ brz commit -m 'merging debian into experimental'
 
1132
$ bzr commit -m 'merging debian into experimental'
1146
1133
2>Committing to: .../experimental/
1147
1134
2>added dir
1148
1135
2>added dir/file
1149
1136
2>Committed revision 2.
1150
1137
# Create an ubuntu branch with yet another root-id
1151
1138
$ cd ..
1152
 
$ brz init ubuntu
 
1139
$ bzr init ubuntu
1153
1140
Created a standalone tree (format: 2a)
1154
1141
$ cd ubuntu
1155
1142
# Work around merging into empty branch not being supported
1156
1143
# (http://pad.lv/308562)
1157
1144
$ echo something >not-empty-ubuntu
1158
 
$ brz add
 
1145
$ bzr add
1159
1146
adding not-empty-ubuntu
1160
 
$ brz commit -m 'Add some content in experimental'
 
1147
$ bzr commit -m 'Add some content in experimental'
1161
1148
2>Committing to: .../ubuntu/
1162
1149
2>added not-empty-ubuntu
1163
1150
2>Committed revision 1.
1164
1151
# Also merge debian
1165
 
$ brz merge ../debian -r0..2
 
1152
$ bzr merge ../debian -r0..2
1166
1153
2>+N  dir/
1167
1154
2>+N  dir/file
1168
1155
2>All changes applied successfully.
1169
 
$ brz commit -m 'merging debian'
 
1156
$ bzr commit -m 'merging debian'
1170
1157
2>Committing to: .../ubuntu/
1171
1158
2>added dir
1172
1159
2>added dir/file
1173
1160
2>Committed revision 2.
1174
1161
# Now try to merge experimental
1175
 
$ brz merge ../experimental
 
1162
$ bzr merge ../experimental
1176
1163
2>+N  not-empty
1177
1164
2>Path conflict: dir / dir
1178
1165
2>1 conflicts encountered.
1191
1178
        return self.parser.parse_args(args)
1192
1179
 
1193
1180
    def test_unknown_action(self):
1194
 
        self.assertRaises(option.BadOptionValue,
 
1181
        self.assertRaises(errors.BadOptionValue,
1195
1182
                          self.parse, ['--action', 'take-me-to-the-moon'])
1196
1183
 
1197
1184
    def test_done(self):