comparison tests/test-bisect.t @ 16648:1388cc711ea7

bisect: set HG_NODE when runing a command When running a command, set the environment variable HG_NODE to tell the command which changeset is being visited.
author Bryan O'Sullivan <bryano@fb.com>
date Tue, 08 May 2012 15:31:00 -0700
parents 14913fcb30c6
children ee7dd2307031
comparison
equal deleted inserted replaced
16647:14913fcb30c6 16648:1388cc711ea7
471 changeset: 6:a3d5c6fdf0d3 471 changeset: 6:a3d5c6fdf0d3
472 user: test 472 user: test
473 date: Thu Jan 01 00:00:06 1970 +0000 473 date: Thu Jan 01 00:00:06 1970 +0000
474 summary: msg 6 474 summary: msg 6
475 475
476
477
478 test bisecting via a command without updating the working dir, and
479 ensure that the bisect state file is updated before running a test
480 command
481
482 $ hg update null
483 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
484 $ cat > script.sh <<'EOF'
485 > #!/bin/sh
486 > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
487 > current="`hg log -r \"bisect(current)\" --template {node}`"
488 > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
489 > rev="`hg log -r $HG_NODE --template {rev}`"
490 > test "$rev" -ge 6
491 > EOF
492 $ chmod +x script.sh
493 $ hg bisect -r
494 $ hg bisect --good tip --noupdate
495 $ hg bisect --bad 0 --noupdate
496 Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
497 $ hg bisect --command "'`pwd`/script.sh' and some params" --noupdate
498 Changeset 15:e7fa0811edb0: good
499 Changeset 7:03750880c6b5: good
500 Changeset 3:b53bea5e2fcb: bad
501 Changeset 5:7874a09ea728: bad
502 Changeset 6:a3d5c6fdf0d3: good
503 The first good revision is:
504 changeset: 6:a3d5c6fdf0d3
505 user: test
506 date: Thu Jan 01 00:00:06 1970 +0000
507 summary: msg 6
508
509
510 ensure that we still don't have a working dir
511
512 $ hg parents