# HG changeset patch # User Dirkjan Ochtman # Date 1220461437 -7200 # Node ID 6c4a08270222569ba906f4f1c7860783eec19225 # Parent 029a54423a96d82e301df8f389b69ce01d064ac0# Parent 5ce625983208ee09ef583e7b23389de6032ae1d5 merge with crew-stable diff -r 029a54423a96 -r 6c4a08270222 mercurial/commands.py --- a/mercurial/commands.py Wed Sep 03 15:46:46 2008 +0200 +++ b/mercurial/commands.py Wed Sep 03 19:03:57 2008 +0200 @@ -288,9 +288,6 @@ reset = True elif extra or good + bad + skip + reset > 1: raise util.Abort(_('incompatible arguments')) - elif not (good or bad or skip or reset): - ui.status(_('(no action selected)\n')) - return if reset: p = repo.join("bisect.state") @@ -329,7 +326,12 @@ del wlock if not state['good'] or not state['bad']: - return + if (good or bad or skip or reset): + return + if not state['good']: + raise util.Abort(_('cannot bisect (no known good revisions)')) + else: + raise util.Abort(_('cannot bisect (no known bad revisions)')) # actually bisect nodes, changesets, good = hbisect.bisect(repo.changelog, state) diff -r 029a54423a96 -r 6c4a08270222 tests/run-tests.py --- a/tests/run-tests.py Wed Sep 03 15:46:46 2008 +0200 +++ b/tests/run-tests.py Wed Sep 03 19:03:57 2008 +0200 @@ -202,6 +202,8 @@ os.environ["PYTHONPATH"] = pythonpath use_correct_python() + global hgpkg + hgpkg = _hgpath() if coverage: vlog("# Installing coverage wrapper") @@ -456,6 +458,16 @@ PYTHONDIR = os.path.join(INST, "lib", "python") COVERAGE_FILE = os.path.join(TESTDIR, ".coverage") +def _hgpath(): + cmd = '%s -c "import mercurial; print mercurial.__path__[0]"' + hgpath = os.popen(cmd % python) + path = hgpath.read().strip() + hgpath.close() + return path + +expecthg = os.path.join(HGTMP, 'install', 'lib', 'python', 'mercurial') +hgpkg = None + def run_children(tests): if not options.with_hg: install_hg() @@ -512,6 +524,9 @@ print "Skipped %s: %s" % (s[0], s[1]) for s in fails: print "Failed %s: %s" % (s[0], s[1]) + + if hgpkg != expecthg: + print '# Tested unexpected mercurial: %s' % hgpkg print "# Ran %d tests, %d skipped, %d failed." % ( tested, skipped, failed) sys.exit(failures != 0) @@ -525,6 +540,9 @@ if not options.with_hg: install_hg() + if hgpkg != expecthg: + print '# Testing unexpected mercurial: %s' % hgpkg + if options.timeout > 0: try: signal.signal(signal.SIGALRM, alarmed) @@ -585,6 +603,8 @@ print "Skipped %s: %s" % s for s in fails: print "Failed %s: %s" % s + if hgpkg != expecthg: + print '# Tested unexpected mercurial: %s' % hgpkg print "# Ran %d tests, %d skipped, %d failed." % ( tested, skipped, failed) diff -r 029a54423a96 -r 6c4a08270222 tests/test-bisect --- a/tests/test-bisect Wed Sep 03 15:46:46 2008 +0200 +++ b/tests/test-bisect Wed Sep 03 19:03:57 2008 +0200 @@ -55,10 +55,7 @@ hg bisect -bU tip hg id -echo % test no action message -hg bisect - -# reproduce AssertionError (issue1228 and issue1182) +echo % reproduce AssertionError, issue1228 and issue1182 hg bisect -r hg bisect -b 4 hg bisect -g 0 @@ -66,8 +63,12 @@ hg bisect -s hg bisect -s -# reproduce non converging bisect (issue1182) +echo % reproduce non converging bisect, issue1182 hg bisect -r hg bisect -g 0 hg bisect -b 2 hg bisect -s + +echo % test no action +hg bisect -r +hg bisect diff -r 029a54423a96 -r 6c4a08270222 tests/test-bisect.out --- a/tests/test-bisect.out Wed Sep 03 15:46:46 2008 +0200 +++ b/tests/test-bisect.out Wed Sep 03 19:03:57 2008 +0200 @@ -241,8 +241,7 @@ error Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests) 5cd978ea5149 -% test no action message -(no action selected) +% reproduce AssertionError, issue1228 and issue1182 Testing changeset 2:db07c04beaca (4 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests) @@ -270,6 +269,7 @@ date: Thu Jan 01 00:00:04 1970 +0000 summary: msg 4 +% reproduce non converging bisect, issue1182 Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Due to skipped revisions, the first bad revision could be any of: @@ -283,3 +283,5 @@ date: Thu Jan 01 00:00:02 1970 +0000 summary: msg 2 +% test no action +abort: cannot bisect (no known good revisions)