~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_conflicts.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-10-09 23:16:22 UTC
  • mfrom: (5422.3.9 scripts)
  • Revision ID: pqm@pqm.ubuntu.com-20101009231622-hk7zigkj84reyn2z
(mbp) empty output in shell-like tests is no longer a wildcard (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
625
625
    # tests MissingParent resolution :-/
626
626
    preamble = """
627
627
$ bzr init trunk
 
628
...
628
629
$ cd trunk
629
630
$ mkdir dir
630
 
$ bzr add dir
631
 
$ bzr commit -m 'Create trunk'
632
 
 
 
631
$ bzr add -q dir
 
632
$ bzr commit -m 'Create trunk' -q
633
633
$ echo 'trunk content' >dir/file
634
 
$ bzr add dir/file
635
 
$ bzr commit -m 'Add dir/file in trunk'
636
 
 
637
 
$ bzr branch . -r 1 ../branch
 
634
$ bzr add -q dir/file
 
635
$ bzr commit -q -m 'Add dir/file in trunk'
 
636
$ bzr branch -q . -r 1 ../branch
638
637
$ cd ../branch
639
 
$ bzr rm dir
640
 
$ bzr commit -m 'Remove dir in branch'
641
 
 
 
638
$ bzr rm dir -q
 
639
$ bzr commit -q -m 'Remove dir in branch'
642
640
$ bzr merge ../trunk
643
641
2>+N  dir/
644
642
2>+N  dir/file
649
647
 
650
648
    def test_take_this(self):
651
649
        self.run_script("""
652
 
$ bzr rm dir  --force
 
650
$ bzr rm -q dir  --force
653
651
$ bzr resolve dir
654
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
652
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
655
653
""")
656
654
 
657
655
    def test_take_other(self):
658
656
        self.run_script("""
659
657
$ bzr resolve dir
660
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
658
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
661
659
""")
662
660
 
663
661
 
665
663
 
666
664
    preamble = """
667
665
$ bzr init trunk
 
666
...
668
667
$ cd trunk
669
668
$ mkdir dir
670
669
$ echo 'trunk content' >dir/file
671
 
$ bzr add
672
 
$ bzr commit -m 'Create trunk'
673
 
 
 
670
$ bzr add -q
 
671
$ bzr commit -m 'Create trunk' -q
674
672
$ echo 'trunk content' >dir/file2
675
 
$ bzr add dir/file2
676
 
$ bzr commit -m 'Add dir/file2 in branch'
677
 
 
678
 
$ bzr branch . -r 1 ../branch
 
673
$ bzr add -q dir/file2
 
674
$ bzr commit -q -m 'Add dir/file2 in branch'
 
675
$ bzr branch -q . -r 1 ../branch
679
676
$ cd ../branch
680
 
$ bzr rm dir/file --force
681
 
$ bzr rm dir
682
 
$ bzr commit -m 'Remove dir/file'
683
 
 
 
677
$ bzr rm -q dir/file --force
 
678
$ bzr rm -q dir
 
679
$ bzr commit -q -m 'Remove dir/file'
684
680
$ bzr merge ../trunk
685
681
2>+N  dir/
686
682
2>+N  dir/file2
692
688
    def test_keep_them_all(self):
693
689
        self.run_script("""
694
690
$ bzr resolve dir
695
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
691
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
696
692
""")
697
693
 
698
694
    def test_adopt_child(self):
699
695
        self.run_script("""
700
 
$ bzr mv dir/file2 file2
701
 
$ bzr rm dir --force
 
696
$ bzr mv -q dir/file2 file2
 
697
$ bzr rm -q dir --force
702
698
$ bzr resolve dir
703
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
699
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
704
700
""")
705
701
 
706
702
    def test_kill_them_all(self):
707
703
        self.run_script("""
708
 
$ bzr rm dir --force
 
704
$ bzr rm -q dir --force
709
705
$ bzr resolve dir
710
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
706
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
711
707
""")
712
708
 
713
709
    def test_resolve_taking_this(self):
714
710
        self.run_script("""
715
711
$ bzr resolve --take-this dir
716
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
712
2>...
 
713
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
717
714
""")
718
715
 
719
716
    def test_resolve_taking_other(self):
720
717
        self.run_script("""
721
718
$ bzr resolve --take-other dir
722
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
719
2>...
 
720
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
723
721
""")
724
722
 
725
723
 
727
725
 
728
726
    preamble = """
729
727
$ bzr init trunk
 
728
...
730
729
$ cd trunk
731
730
$ mkdir dir
732
731
$ echo 'trunk content' >dir/file
733
 
$ bzr add
734
 
$ bzr commit -m 'Create trunk'
735
 
 
736
 
$ bzr rm dir/file --force
737
 
$ bzr rm dir --force
738
 
$ bzr commit -m 'Remove dir/file'
739
 
 
740
 
$ bzr branch . -r 1 ../branch
 
732
$ bzr add -q
 
733
$ bzr commit -m 'Create trunk' -q
 
734
$ bzr rm -q dir/file --force
 
735
$ bzr rm -q dir --force
 
736
$ bzr commit -q -m 'Remove dir/file'
 
737
$ bzr branch -q . -r 1 ../branch
741
738
$ cd ../branch
742
739
$ echo 'branch content' >dir/file2
743
 
$ bzr add dir/file2
744
 
$ bzr commit -m 'Add dir/file2 in branch'
745
 
 
 
740
$ bzr add -q dir/file2
 
741
$ bzr commit -q -m 'Add dir/file2 in branch'
746
742
$ bzr merge ../trunk
747
743
2>-D  dir/file
748
744
2>Conflict: can't delete dir because it is not empty.  Not deleting.
753
749
    def test_keep_them_all(self):
754
750
        self.run_script("""
755
751
$ bzr resolve dir
756
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
752
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
757
753
""")
758
754
 
759
755
    def test_adopt_child(self):
760
756
        self.run_script("""
761
 
$ bzr mv dir/file2 file2
762
 
$ bzr rm dir --force
 
757
$ bzr mv -q dir/file2 file2
 
758
$ bzr rm -q dir --force
763
759
$ bzr resolve dir
764
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
760
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
765
761
""")
766
762
 
767
763
    def test_kill_them_all(self):
768
764
        self.run_script("""
769
 
$ bzr rm dir --force
 
765
$ bzr rm -q dir --force
770
766
$ bzr resolve dir
771
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
767
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
772
768
""")
773
769
 
774
770
    def test_resolve_taking_this(self):
775
771
        self.run_script("""
776
772
$ bzr resolve --take-this dir
777
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
773
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
778
774
""")
779
775
 
780
776
    def test_resolve_taking_other(self):
781
777
        self.run_script("""
782
778
$ bzr resolve --take-other dir
783
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
779
2>deleted dir/file2
 
780
2>deleted dir
 
781
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
784
782
""")
785
783
 
786
784
 
882
880
 
883
881
    preamble = """
884
882
$ bzr init trunk
 
883
...
885
884
$ cd trunk
886
885
$ bzr mkdir foo
887
 
$ bzr commit -m 'Create trunk'
 
886
...
 
887
$ bzr commit -m 'Create trunk' -q
888
888
$ echo "Boing" >foo/bar
889
 
$ bzr add foo/bar
890
 
$ bzr commit -m 'Add foo/bar'
891
 
 
892
 
$ bzr branch . -r 1 ../branch
 
889
$ bzr add -q foo/bar
 
890
$ bzr commit -q -m 'Add foo/bar'
 
891
$ bzr branch -q . -r 1 ../branch
893
892
$ cd ../branch
894
893
$ rm -r foo
895
894
$ echo "Boo!" >foo
896
 
$ bzr commit -m 'foo is now a file'
897
 
 
 
895
$ bzr commit -q -m 'foo is now a file'
898
896
$ bzr merge ../trunk
899
897
2>+N  foo.new/bar
900
898
2>RK  foo => foo.new/
906
904
 
907
905
    def test_take_this(self):
908
906
        self.run_script("""
909
 
$ bzr rm foo.new --force
 
907
$ bzr rm -q foo.new --force
910
908
# FIXME: Isn't it weird that foo is now unkown even if foo.new has been put
911
909
# aside ? -- vila 090916
912
 
$ bzr add foo
 
910
$ bzr add -q foo
913
911
$ bzr resolve foo.new
914
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
912
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
915
913
""")
916
914
 
917
915
    def test_take_other(self):
918
916
        self.run_script("""
919
 
$ bzr rm foo --force
920
 
$ bzr mv foo.new foo
 
917
$ bzr rm -q foo --force
 
918
$ bzr mv -q foo.new foo
921
919
$ bzr resolve foo
922
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
920
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
923
921
""")
924
922
 
925
923
    def test_resolve_taking_this(self):
926
924
        self.run_script("""
927
925
$ bzr resolve --take-this foo.new
928
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
926
2>...
 
927
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
929
928
""")
930
929
 
931
930
    def test_resolve_taking_other(self):
932
931
        self.run_script("""
933
932
$ bzr resolve --take-other foo.new
934
 
$ bzr commit --strict -m 'No more conflicts nor unknown files'
 
933
2>...
 
934
$ bzr commit -q --strict -m 'No more conflicts nor unknown files'
935
935
""")
936
936
 
937
937
 
943
943
        # conflict.
944
944
        self.run_script("""
945
945
$ bzr init trunk
 
946
...
946
947
$ cd trunk
947
948
$ bzr mkdir foo
948
 
$ bzr commit -m 'Create trunk'
 
949
...
 
950
$ bzr commit -m 'Create trunk' -q
949
951
$ rm -r foo
950
952
$ echo "Boo!" >foo
951
 
$ bzr commit -m 'foo is now a file'
952
 
 
953
 
$ bzr branch . -r 1 ../branch
 
953
$ bzr commit -m 'foo is now a file' -q
 
954
$ bzr branch -q . -r 1 ../branch -q
954
955
$ cd ../branch
955
956
$ echo "Boing" >foo/bar
956
 
$ bzr add foo/bar
957
 
$ bzr commit -m 'Add foo/bar'
958
 
 
 
957
$ bzr add -q foo/bar -q
 
958
$ bzr commit -m 'Add foo/bar' -q
959
959
$ bzr merge ../trunk
960
960
2>bzr: ERROR: Tree transform is malformed [('unversioned executability', 'new-1')]
961
961
""")