# HG changeset patch # User Gregory Szorc # Date 1409480564 -7200 # Node ID eb6adf7509540dbbb83e4a2763fb3c0220847236 # Parent 3e483253213ee9c1c27077807ae0e8d6a3bfe3fe run-tests: make --interactive work with --view diff -r 3e483253213e -r eb6adf750954 tests/run-tests.py --- a/tests/run-tests.py Sun Aug 31 11:11:42 2014 +0200 +++ b/tests/run-tests.py Sun Aug 31 12:22:44 2014 +0200 @@ -1201,18 +1201,18 @@ self.stream.write(line) self.stream.flush() - # handle interactive prompt without releasing iolock - if self._options.interactive: - self.stream.write('Accept this change? [n] ') - answer = sys.stdin.readline().strip() - if answer.lower() in ('y', 'yes'): - if test.name.endswith('.t'): - rename(test.errpath, test.path) - else: - rename(test.errpath, '%s.out' % test.path) - accepted = True - if not accepted and not failed: - self.faildata[test.name] = ''.join(lines) + # handle interactive prompt without releasing iolock + if self._options.interactive: + self.stream.write('Accept this change? [n] ') + answer = sys.stdin.readline().strip() + if answer.lower() in ('y', 'yes'): + if test.name.endswith('.t'): + rename(test.errpath, test.path) + else: + rename(test.errpath, '%s.out' % test.path) + accepted = True + if not accepted and not failed: + self.faildata[test.name] = ''.join(lines) iolock.release() return accepted diff -r 3e483253213e -r eb6adf750954 tests/test-run-tests.t --- a/tests/test-run-tests.t Sun Aug 31 11:11:42 2014 +0200 +++ b/tests/test-run-tests.t Sun Aug 31 12:22:44 2014 +0200 @@ -251,6 +251,18 @@ This is a noop statement so that this test is still more bytes than success. +Interactive with custom view + + $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i --view echo + $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err + Accept this change? [n]* (glob) + ERROR: test-failure.t output changed + !. + Failed test-failure.t: output changed + # Ran 2 tests, 0 skipped, 0 warned, 1 failed. + python hash seed: * (glob) + [1] + View the fix $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` --view echo