hgbook

changeset 166:08a4467f4891

Try to get the bisect extension to behave.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon Mar 26 22:59:43 2007 -0700 (2007-03-26)
parents 06d18465df03
children e67251ac336f f8b5b782e150
files en/examples/bisect en/examples/bisect.commits.out en/examples/bisect.help.out en/examples/bisect.init.out en/examples/bisect.search.bad-init.out en/examples/bisect.search.good-init.out en/examples/bisect.search.init.out en/examples/bisect.search.mytest.out en/examples/bisect.search.reset.out en/examples/bisect.search.rest.out en/examples/bisect.search.step1.out en/examples/bisect.search.step2.out en/examples/run-example
line diff
     1.1 --- a/en/examples/bisect	Mon Mar 26 22:45:48 2007 -0700
     1.2 +++ b/en/examples/bisect	Mon Mar 26 22:59:43 2007 -0700
     1.3 @@ -6,8 +6,6 @@
     1.4  # XXX There's some kind of horrible nondeterminism in the execution of
     1.5  # bisect at the moment.  Ugh.
     1.6  
     1.7 -#$ ignore: .*
     1.8 -
     1.9  #$ name: init
    1.10  
    1.11  hg init mybug
    1.12 @@ -40,6 +38,8 @@
    1.13  
    1.14  hg bisect bad
    1.15  
    1.16 +#$ drop_output: yes
    1.17 +
    1.18  #$ name: search.good-init
    1.19  
    1.20  hg bisect good 10
     2.1 --- a/en/examples/bisect.commits.out	Mon Mar 26 22:45:48 2007 -0700
     2.2 +++ b/en/examples/bisect.commits.out	Mon Mar 26 22:59:43 2007 -0700
     2.3 @@ -1,10 +1,10 @@
     2.4 -
     2.5 -
     2.6 -
     2.7 -
     2.8 -
     2.9 -
    2.10 -
    2.11 -
    2.12 -
    2.13 -
    2.14 +$ \textbf{buggy_change=37}
    2.15 +$ \textbf{for (( i = 0; i < 50; i++ )); do}
    2.16 +> \textbf{  if [[ $i = $buggy_change ]]; then}
    2.17 +> \textbf{    echo 'i have a gub' > myfile$i}
    2.18 +> \textbf{    hg commit -q -A -m 'buggy changeset'}
    2.19 +> \textbf{  else}
    2.20 +> \textbf{    echo 'nothing to see here, move along' > myfile$i}
    2.21 +> \textbf{    hg commit -q -A -m 'normal changeset'}
    2.22 +> \textbf{  fi}
    2.23 +> \textbf{done}
     3.1 --- a/en/examples/bisect.help.out	Mon Mar 26 22:45:48 2007 -0700
     3.2 +++ b/en/examples/bisect.help.out	Mon Mar 26 22:59:43 2007 -0700
     3.3 @@ -1,14 +1,14 @@
     3.4 +$ \textbf{hg help bisect}
     3.5 +hg bisect [help|init|reset|next|good|bad]
     3.6  
     3.7 +bisect extension: dichotomic search in the DAG of changesets
     3.8 +for subcommands see "hg bisect help"
     3.9 +$ \textbf{hg bisect help}
    3.10 +list of subcommands for the bisect extension
    3.11  
    3.12 -
    3.13 -
    3.14 -
    3.15 -
    3.16 -
    3.17 -
    3.18 -
    3.19 -
    3.20 -
    3.21 -
    3.22 -
    3.23 -
    3.24 + bad     mark revision as bad and update to the next revision to test
    3.25 + good    mark revision as good and update to the next revision to test
    3.26 + help    show help for a given bisect subcommand or all subcommands
    3.27 + init    start a new bisection
    3.28 + next    find and update to the next revision to test
    3.29 + reset   finish a bisection
     4.1 --- a/en/examples/bisect.init.out	Mon Mar 26 22:45:48 2007 -0700
     4.2 +++ b/en/examples/bisect.init.out	Mon Mar 26 22:59:43 2007 -0700
     4.3 @@ -1,2 +1,2 @@
     4.4 -
     4.5 -
     4.6 +$ \textbf{hg init mybug}
     4.7 +$ \textbf{cd mybug}
     5.1 --- a/en/examples/bisect.search.bad-init.out	Mon Mar 26 22:45:48 2007 -0700
     5.2 +++ b/en/examples/bisect.search.bad-init.out	Mon Mar 26 22:59:43 2007 -0700
     5.3 @@ -1,1 +1,1 @@
     5.4 -
     5.5 +$ \textbf{hg bisect bad}
     6.1 --- a/en/examples/bisect.search.good-init.out	Mon Mar 26 22:45:48 2007 -0700
     6.2 +++ b/en/examples/bisect.search.good-init.out	Mon Mar 26 22:59:43 2007 -0700
     6.3 @@ -1,3 +0,0 @@
     6.4 -
     6.5 -
     6.6 -
     7.1 --- a/en/examples/bisect.search.init.out	Mon Mar 26 22:45:48 2007 -0700
     7.2 +++ b/en/examples/bisect.search.init.out	Mon Mar 26 22:59:43 2007 -0700
     7.3 @@ -1,1 +1,1 @@
     7.4 -
     7.5 +$ \textbf{hg bisect init}
     8.1 --- a/en/examples/bisect.search.mytest.out	Mon Mar 26 22:45:48 2007 -0700
     8.2 +++ b/en/examples/bisect.search.mytest.out	Mon Mar 26 22:59:43 2007 -0700
     8.3 @@ -1,10 +0,0 @@
     8.4 -
     8.5 -
     8.6 -
     8.7 -
     8.8 -
     8.9 -
    8.10 -
    8.11 -
    8.12 -
    8.13 -
     9.1 --- a/en/examples/bisect.search.reset.out	Mon Mar 26 22:45:48 2007 -0700
     9.2 +++ b/en/examples/bisect.search.reset.out	Mon Mar 26 22:59:43 2007 -0700
     9.3 @@ -1,1 +0,0 @@
     9.4 -
    10.1 --- a/en/examples/bisect.search.rest.out	Mon Mar 26 22:45:48 2007 -0700
    10.2 +++ b/en/examples/bisect.search.rest.out	Mon Mar 26 22:59:43 2007 -0700
    10.3 @@ -1,16 +0,0 @@
    10.4 -
    10.5 -
    10.6 -
    10.7 -
    10.8 -
    10.9 -
   10.10 -
   10.11 -
   10.12 -
   10.13 -
   10.14 -
   10.15 -
   10.16 -
   10.17 -
   10.18 -
   10.19 -
    11.1 --- a/en/examples/bisect.search.step1.out	Mon Mar 26 22:45:48 2007 -0700
    11.2 +++ b/en/examples/bisect.search.step1.out	Mon Mar 26 22:59:43 2007 -0700
    11.3 @@ -1,11 +0,0 @@
    11.4 -
    11.5 -
    11.6 -
    11.7 -
    11.8 -
    11.9 -
   11.10 -
   11.11 -
   11.12 -
   11.13 -
   11.14 -
    12.1 --- a/en/examples/bisect.search.step2.out	Mon Mar 26 22:45:48 2007 -0700
    12.2 +++ b/en/examples/bisect.search.step2.out	Mon Mar 26 22:59:43 2007 -0700
    12.3 @@ -1,4 +0,0 @@
    12.4 -
    12.5 -
    12.6 -
    12.7 -
    13.1 --- a/en/examples/run-example	Mon Mar 26 22:45:48 2007 -0700
    13.2 +++ b/en/examples/run-example	Mon Mar 26 22:59:43 2007 -0700
    13.3 @@ -50,7 +50,7 @@
    13.4      shell = '/usr/bin/env bash'
    13.5      ps1 = '__run_example_ps1__ '
    13.6      ps2 = '__run_example_ps2__ '
    13.7 -    pi_re = re.compile(r'#\$\s*(name|ignore):\s*(.*)$')
    13.8 +    pi_re = re.compile(r'#\$\s*(drop_output|name|ignore):\s*(.*)$')
    13.9      
   13.10      timeout = 5
   13.11  
   13.12 @@ -189,6 +189,8 @@
   13.13  
   13.14          err = False
   13.15  
   13.16 +        drop_output = False
   13.17 +
   13.18          try:
   13.19              try:
   13.20                  # eat first prompt string from shell
   13.21 @@ -219,10 +221,12 @@
   13.22                                  ofp = None
   13.23                          elif pi == 'ignore':
   13.24                              ignore.append(rest)
   13.25 +                        elif pi == 'drop_output':
   13.26 +                            drop_output = dict(yes=1,no=0)[rest.lower()]
   13.27                      elif hunk.strip():
   13.28                          # it's something we should execute
   13.29                          newps, output = self.sendreceive(hunk)
   13.30 -                        if not ofp:
   13.31 +                        if not ofp or drop_output:
   13.32                              continue
   13.33                          # first, print the command we ran
   13.34                          if not hunk.startswith('#'):