tests/test-bisect.t
branchstable
changeset 17225 a06e2681dd17
parent 16960 be64115b4955
child 18358 93293813d753
equal deleted inserted replaced
17222:98823bd0d697 17225:a06e2681dd17
     1   $ "$TESTDIR/hghave" system-sh || exit 80
       
     2 
       
     3   $ hg init
     1   $ hg init
     4 
     2 
     5 
     3 
     6 committing changes
     4 committing changes
     7 
     5 
   222   $ hg bisect -s "13::16"
   220   $ hg bisect -s "13::16"
   223   $ hg bisect -g "26::tip"
   221   $ hg bisect -g "26::tip"
   224   Testing changeset 12:1941b52820a5 (23 changesets remaining, ~4 tests)
   222   Testing changeset 12:1941b52820a5 (23 changesets remaining, ~4 tests)
   225   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   223   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   226   $ cat .hg/bisect.state
   224   $ cat .hg/bisect.state
       
   225   current 1941b52820a544549596820a8ae006842b0e2c64
   227   skip 9d7d07bc967ca98ad0600c24953fd289ad5fa991
   226   skip 9d7d07bc967ca98ad0600c24953fd289ad5fa991
   228   skip ce8f0998e922c179e80819d5066fbe46e2998784
   227   skip ce8f0998e922c179e80819d5066fbe46e2998784
   229   skip e7fa0811edb063f6319531f0d0a865882138e180
   228   skip e7fa0811edb063f6319531f0d0a865882138e180
   230   skip a2e6ea4973e9196ddd3386493b0c214b41fd97d3
   229   skip a2e6ea4973e9196ddd3386493b0c214b41fd97d3
   231   bad b99c7b9c8e11558adef3fad9af211c58d46f325b
   230   bad b99c7b9c8e11558adef3fad9af211c58d46f325b
   394   changeset:   6:a3d5c6fdf0d3
   393   changeset:   6:a3d5c6fdf0d3
   395   user:        test
   394   user:        test
   396   date:        Thu Jan 01 00:00:06 1970 +0000
   395   date:        Thu Jan 01 00:00:06 1970 +0000
   397   summary:     msg 6
   396   summary:     msg 6
   398   
   397   
       
   398   $ hg log -r "bisect(current)"
       
   399   changeset:   5:7874a09ea728
       
   400   user:        test
       
   401   date:        Thu Jan 01 00:00:05 1970 +0000
       
   402   summary:     msg 5
       
   403   
   399   $ hg log -r "bisect(skip)"
   404   $ hg log -r "bisect(skip)"
   400   changeset:   1:5cd978ea5149
   405   changeset:   1:5cd978ea5149
   401   user:        test
   406   user:        test
   402   date:        Thu Jan 01 00:00:01 1970 +0000
   407   date:        Thu Jan 01 00:00:01 1970 +0000
   403   summary:     msg 1
   408   summary:     msg 1
   452   $ hg bisect -r
   457   $ hg bisect -r
   453   $ hg bisect --good tip
   458   $ hg bisect --good tip
   454   $ hg bisect --bad 0
   459   $ hg bisect --bad 0
   455   Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
   460   Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
   456   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   461   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   457   $ hg bisect --command "'`pwd`/script.py' and some parameters"
   462   $ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters"
   458   Changeset 15:e7fa0811edb0: good
   463   changeset 15:e7fa0811edb0: good
   459   Changeset 7:03750880c6b5: good
   464   changeset 7:03750880c6b5: good
   460   Changeset 3:b53bea5e2fcb: bad
   465   changeset 3:b53bea5e2fcb: bad
   461   Changeset 5:7874a09ea728: bad
   466   changeset 5:7874a09ea728: bad
   462   Changeset 6:a3d5c6fdf0d3: good
   467   changeset 6:a3d5c6fdf0d3: good
   463   The first good revision is:
   468   The first good revision is:
   464   changeset:   6:a3d5c6fdf0d3
   469   changeset:   6:a3d5c6fdf0d3
   465   user:        test
   470   user:        test
   466   date:        Thu Jan 01 00:00:06 1970 +0000
   471   date:        Thu Jan 01 00:00:06 1970 +0000
   467   summary:     msg 6
   472   summary:     msg 6
   468   
   473   
       
   474 
       
   475 
       
   476 test bisecting via a command without updating the working dir, and
       
   477 ensure that the bisect state file is updated before running a test
       
   478 command
       
   479 
       
   480   $ hg update null
       
   481   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   482   $ cat > script.sh <<'EOF'
       
   483   > #!/bin/sh
       
   484   > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
       
   485   > current="`hg log -r \"bisect(current)\" --template {node}`"
       
   486   > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
       
   487   > rev="`hg log -r $HG_NODE --template {rev}`"
       
   488   > test "$rev" -ge 6
       
   489   > EOF
       
   490   $ chmod +x script.sh
       
   491   $ hg bisect -r
       
   492   $ hg bisect --good tip --noupdate
       
   493   $ hg bisect --bad 0 --noupdate
       
   494   Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
       
   495   $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" --noupdate
       
   496   changeset 15:e7fa0811edb0: good
       
   497   changeset 7:03750880c6b5: good
       
   498   changeset 3:b53bea5e2fcb: bad
       
   499   changeset 5:7874a09ea728: bad
       
   500   changeset 6:a3d5c6fdf0d3: good
       
   501   The first good revision is:
       
   502   changeset:   6:a3d5c6fdf0d3
       
   503   user:        test
       
   504   date:        Thu Jan 01 00:00:06 1970 +0000
       
   505   summary:     msg 6
       
   506   
       
   507 
       
   508 ensure that we still don't have a working dir
       
   509 
       
   510   $ hg parents