# HG changeset patch # User Augie Fackler # Date 2017-08-22 20:37:06 # Node ID 8a8dd6e4a97a5f36a0c503e072fbbe809c1e9ec4 # Parent 5ed0be4d9df99768d7fff00009fd63b7509f10de contrib: make import-checker agree more with run-tests about heredocpy run-tests.py and import-checker.py take wholly different approaches to .t-tests, and the result was that they had different notions about when a Python heredoc had ended, leading to conflicts. This resolves part of the issue, and the rest I can deal with by tweaking the one offending test file. diff --git a/contrib/import-checker.py b/contrib/import-checker.py --- a/contrib/import-checker.py +++ b/contrib/import-checker.py @@ -693,7 +693,10 @@ def embedded(f, modname, src): else: script.append(l[4:]) continue - if inlinepython and l == b' \n': + # If we have an empty line or a command for sh, we end the + # inline script. + if inlinepython and (l == b' \n' + or l.startswith(b' $ ')): yield b''.join(script), (b"%s[%d]" % (modname, inlinepython)), t, inlinepython script = []