tests/test-bisect
branchstable
changeset 12795 3cb0559e44d0
parent 12793 469850088fc1
parent 12794 6bf8d48bec8e
child 12796 bc69ba99e34b
equal deleted inserted replaced
12793:469850088fc1 12795:3cb0559e44d0
     1 #!/bin/sh
       
     2 
       
     3 set -e
       
     4 
       
     5 echo % init
       
     6 hg init
       
     7 
       
     8 echo % committing changes
       
     9 count=0
       
    10 echo > a
       
    11 while test $count -lt 32 ; do
       
    12     echo 'a' >> a
       
    13     test $count -eq 0 && hg add
       
    14     hg ci -m "msg $count" -d "$count 0"
       
    15     echo % committed changeset $count
       
    16     count=`expr $count + 1`
       
    17 done
       
    18 
       
    19 echo % log
       
    20 hg log
       
    21 
       
    22 echo % hg up -C
       
    23 hg up -C
       
    24 
       
    25 echo % bisect test
       
    26 hg bisect -r
       
    27 hg bisect -b
       
    28 hg bisect -g 1
       
    29 hg bisect -g
       
    30 echo skip
       
    31 hg bisect -s
       
    32 hg bisect -g
       
    33 hg bisect -g
       
    34 hg bisect -b
       
    35 hg bisect -g
       
    36 
       
    37 echo % bisect reverse test
       
    38 hg bisect -r
       
    39 hg bisect -b null
       
    40 hg bisect -g tip
       
    41 hg bisect -g
       
    42 echo skip
       
    43 hg bisect -s
       
    44 hg bisect -g
       
    45 hg bisect -g
       
    46 hg bisect -b
       
    47 hg bisect -g
       
    48 
       
    49 hg bisect -r
       
    50 hg bisect -g tip
       
    51 hg bisect -b tip || echo error
       
    52 
       
    53 hg bisect -r
       
    54 hg bisect -g null
       
    55 hg bisect -bU tip
       
    56 hg id
       
    57 
       
    58 echo % reproduce AssertionError, issue1228 and issue1182
       
    59 hg bisect -r
       
    60 hg bisect -b 4
       
    61 hg bisect -g 0
       
    62 hg bisect -s
       
    63 hg bisect -s
       
    64 hg bisect -s
       
    65 
       
    66 echo % reproduce non converging bisect, issue1182
       
    67 hg bisect -r
       
    68 hg bisect -g 0
       
    69 hg bisect -b 2
       
    70 hg bisect -s
       
    71 
       
    72 echo % test no action
       
    73 hg bisect -r
       
    74 hg bisect || echo failure
       
    75 
       
    76 echo % reproduce AssertionError, issue1445
       
    77 hg bisect -r
       
    78 hg bisect -b 6
       
    79 hg bisect -g 0
       
    80 hg bisect -s
       
    81 hg bisect -s
       
    82 hg bisect -s
       
    83 hg bisect -s 
       
    84 hg bisect -g
       
    85 
       
    86 set +e
       
    87 
       
    88 echo % test invalid command
       
    89 # assuming that the shell returns 127 if command not found ...
       
    90 hg bisect -r
       
    91 hg bisect --command 'exit 127'
       
    92 
       
    93 echo % test bisecting command
       
    94 cat > script.py <<EOF
       
    95 #!/usr/bin/env python
       
    96 import sys
       
    97 from mercurial import ui, hg
       
    98 repo = hg.repository(ui.ui(), '.')
       
    99 if repo['.'].rev() < 6:
       
   100     sys.exit(1)
       
   101 EOF
       
   102 chmod +x script.py
       
   103 hg bisect -r
       
   104 hg bisect --good tip
       
   105 hg bisect --bad 0
       
   106 hg bisect --command "'`pwd`/script.py' and some parameters"
       
   107 true