tests/test-bisect2
changeset 11860 56c7c3209e1a
parent 11859 f48178034569
child 11861 41d481ddd976
equal deleted inserted replaced
11859:f48178034569 11860:56c7c3209e1a
     1 #!/bin/sh
       
     2 
       
     3 # The tests in test-bisect are done on a linear history.
       
     4 # Here the following repository history is used for testing:
       
     5 #
       
     6 #                     17
       
     7 #                      |
       
     8 #               18    16 
       
     9 #                 \  /
       
    10 #                  15
       
    11 #                 /  \
       
    12 #                /    \
       
    13 #              10     13
       
    14 #              / \     |
       
    15 #             /   \    |  14
       
    16 #        7   6     9  12 /
       
    17 #         \ / \    |   |/
       
    18 #          4   \   |  11
       
    19 #           \   \  |  /
       
    20 #            3   5 | /
       
    21 #             \ /  |/ 
       
    22 #              2   8
       
    23 #               \ /
       
    24 #                1
       
    25 #                |
       
    26 #                0
       
    27 
       
    28 set -e
       
    29 
       
    30 echo % init
       
    31 hg init
       
    32 
       
    33 echo % committing changes
       
    34 echo > a
       
    35 echo '0' >> a
       
    36 hg add a
       
    37 hg ci -m "0" -d "0 0"
       
    38 echo '1' >> a
       
    39 hg ci -m "1" -d "1 0"
       
    40 echo '2' >> a
       
    41 hg ci -m "2" -d "2 0"
       
    42 echo '3' >> a
       
    43 hg ci -m "3" -d "3 0"
       
    44 echo '4' >> a
       
    45 hg ci -m "4" -d "4 0"
       
    46 # create branch
       
    47 hg up -r 2
       
    48 echo '5' >> b
       
    49 hg add b
       
    50 hg ci -m "5" -d "5 0"
       
    51 
       
    52 # merge
       
    53 hg merge
       
    54 hg ci -m "merge 4,5" -d "6 0"
       
    55 
       
    56 # create branch
       
    57 hg up -r 4
       
    58 echo '7' > c
       
    59 hg add c
       
    60 hg ci -m "7" -d "7 0"
       
    61 
       
    62 # create branch
       
    63 hg up -r 1
       
    64 echo '8' > d
       
    65 hg add d
       
    66 hg ci -m "8" -d "8 0"
       
    67 echo '9' >> d
       
    68 hg ci -m "9" -d "9 0"
       
    69 
       
    70 # merge
       
    71 hg merge -r 6
       
    72 hg ci -m "merge 6,9" -d "10 0"
       
    73 
       
    74 # create branch
       
    75 hg up -r 8
       
    76 echo '11' > e
       
    77 hg add e
       
    78 hg ci -m "11" -d "11 0"
       
    79 echo '12' >> e
       
    80 hg ci -m "12" -d "12 0"
       
    81 echo '13' >> e
       
    82 hg ci -m "13" -d "13 0"
       
    83 
       
    84 # create branch
       
    85 hg up -r 11
       
    86 echo '14' > f
       
    87 hg add f
       
    88 hg ci -m "14" -d "14 0"
       
    89 
       
    90 # merge
       
    91 hg up -r 13 -C
       
    92 hg merge -r 10
       
    93 hg ci -m "merge 10,13" -d "15 0"
       
    94 echo '16' >> e
       
    95 hg ci -m "16" -d "16 0"
       
    96 echo '17' >> e
       
    97 hg ci -m "17" -d "17 0"
       
    98 
       
    99 # create branch
       
   100 hg up -r 15
       
   101 echo '18' >> e
       
   102 hg ci -m "18" -d "18 0"
       
   103 
       
   104 
       
   105 echo % log
       
   106 hg log
       
   107 
       
   108 echo % hg up -C
       
   109 hg up -C
       
   110 
       
   111 echo % complex bisect test 1  # first bad rev is 9
       
   112 hg bisect -r
       
   113 hg bisect -g 0
       
   114 hg bisect -b 17   # -> update to rev 6
       
   115 hg bisect -g      # -> update to rev 13
       
   116 hg bisect -s      # -> update to rev 10
       
   117 hg bisect -b      # -> update to rev 8
       
   118 hg bisect -g      # -> update to rev 9
       
   119 hg bisect -b
       
   120 
       
   121 echo % complex bisect test 2  # first good rev is 13
       
   122 hg bisect -r
       
   123 hg bisect -g 18
       
   124 hg bisect -b 1    # -> update to rev 6
       
   125 hg bisect -s      # -> update to rev 10
       
   126 hg bisect -b      # -> update to rev 12
       
   127 hg bisect -b      # -> update to rev 13
       
   128 hg bisect -g
       
   129 
       
   130 echo % complex bisect test 3  
       
   131 # first bad rev is 15 
       
   132 # 10,9,13 are skipped an might be the first bad revisions as well
       
   133 hg bisect -r
       
   134 hg bisect -g 1
       
   135 hg bisect -b 16   # -> update to rev 6
       
   136 hg bisect -g      # -> update to rev 13
       
   137 hg bisect -s      # -> update to rev 10
       
   138 hg bisect -s      # -> update to rev 12
       
   139 hg bisect -g      # -> update to rev 9
       
   140 hg bisect -s      # -> update to rev 15
       
   141 hg bisect -b
       
   142 
       
   143 echo % complex bisect test 4
       
   144 # first good revision is 17
       
   145 # 15,16 are skipped an might be the first good revisions as well
       
   146 hg bisect -r
       
   147 hg bisect -g 17
       
   148 hg bisect -b 8    # -> update to rev 10
       
   149 hg bisect -b      # -> update to rev 13
       
   150 hg bisect -b      # -> update to rev 15
       
   151 hg bisect -s      # -> update to rev 16
       
   152 hg bisect -s
       
   153