tests/test-bisect.t
branchstable
changeset 49621 55c6ebd11cb9
parent 48876 42d2b31cee0b
equal deleted inserted replaced
49620:8cd39c20445e 49621:55c6ebd11cb9
     1   $ hg init
     1   $ hg init repo
     2 
     2   $ cd repo
     3 
     3 
     4 committing changes
     4 committing changes
     5 
     5 
     6   $ count=0
     6   $ count=0
     7   $ echo > a
     7   $ echo > a
   458   [255]
   458   [255]
   459 
   459 
   460 
   460 
   461 test bisecting command
   461 test bisecting command
   462 
   462 
   463   $ cat > script.py <<EOF
   463   $ cat > "$TESTTMP/script.py" <<EOF
   464   > #!$PYTHON
   464   > #!$PYTHON
   465   > import sys
   465   > import sys
   466   > from mercurial import hg, ui as uimod
   466   > from mercurial import hg, ui as uimod
   467   > repo = hg.repository(uimod.ui.load(), b'.')
   467   > repo = hg.repository(uimod.ui.load(), b'.')
   468   > if repo[b'.'].rev() < 6:
   468   > if repo[b'.'].rev() < 6:
   469   >     sys.exit(1)
   469   >     sys.exit(1)
   470   > EOF
   470   > EOF
   471   $ chmod +x script.py
   471   $ chmod +x "$TESTTMP/script.py"
   472   $ hg bisect -r
   472   $ hg bisect -r
   473   $ hg up -qr tip
   473   $ hg up -qr tip
   474   $ hg bisect --command "\"$PYTHON\" \"$TESTTMP/script.py\" and some parameters"
   474   $ hg bisect --command "\"$PYTHON\" \"$TESTTMP/script.py\" and some parameters"
   475   changeset 31:58c80a7c8a40 tip "msg 31": good
   475   changeset 31:58c80a7c8a40 tip "msg 31": good
   476   abort: cannot bisect (no known bad revisions)
   476   abort: cannot bisect (no known bad revisions)
   495 ensure that the bisect state file is updated before running a test
   495 ensure that the bisect state file is updated before running a test
   496 command
   496 command
   497 
   497 
   498   $ hg update null
   498   $ hg update null
   499   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   499   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   500   $ cat > script.sh <<'EOF'
   500   $ cat > "$TESTTMP/script.sh" <<'EOF'
   501   > #!/bin/sh
   501   > #!/bin/sh
   502   > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
   502   > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
   503   > current="`hg log -r \"bisect(current)\" --template {node}`"
   503   > current="`hg log -r \"bisect(current)\" --template {node}`"
   504   > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
   504   > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
   505   > rev="`hg log -r $HG_NODE --template {rev}`"
   505   > rev="`hg log -r $HG_NODE --template {rev}`"
   506   > test "$rev" -ge 6
   506   > test "$rev" -ge 6
   507   > EOF
   507   > EOF
   508   $ chmod +x script.sh
   508   $ chmod +x "$TESTTMP/script.sh"
   509   $ hg bisect -r
   509   $ hg bisect -r
   510   $ hg bisect --good tip --noupdate
   510   $ hg bisect --good tip --noupdate
   511   $ hg bisect --bad 0 --noupdate
   511   $ hg bisect --bad 0 --noupdate
   512   Testing changeset 15:e7fa0811edb0 "msg 15" (31 changesets remaining, ~4 tests)
   512   Testing changeset 15:e7fa0811edb0 "msg 15" (31 changesets remaining, ~4 tests)
   513   $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" --noupdate
   513   $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" --noupdate
   528   $ hg parents
   528   $ hg parents
   529 
   529 
   530 
   530 
   531 test the same case, this time with updating
   531 test the same case, this time with updating
   532 
   532 
   533   $ cat > script.sh <<'EOF'
   533   $ cat > "$TESTTMP/script.sh" <<'EOF'
   534   > #!/bin/sh
   534   > #!/bin/sh
   535   > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
   535   > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
   536   > current="`hg log -r \"bisect(current)\" --template {node}`"
   536   > current="`hg log -r \"bisect(current)\" --template {node}`"
   537   > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
   537   > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
   538   > rev="`hg log -r . --template {rev}`"
   538   > rev="`hg log -r . --template {rev}`"
   539   > test "$rev" -ge 6
   539   > test "$rev" -ge 6
   540   > EOF
   540   > EOF
   541   $ chmod +x script.sh
   541   $ chmod +x "$TESTTMP/script.sh"
   542   $ hg bisect -r
   542   $ hg bisect -r
   543   $ hg up -qr tip
   543   $ hg up -qr tip
   544   $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params"
   544   $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params"
   545   changeset 31:58c80a7c8a40 tip "msg 31": good
   545   changeset 31:58c80a7c8a40 tip "msg 31": good
   546   abort: cannot bisect (no known bad revisions)
   546   abort: cannot bisect (no known bad revisions)