Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG9913fffd744b: py3: make catapult usable from the test runner in py3
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
pulkit |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/debugcommands.py (2 lines) | |||
M | tests/run-tests.py (12 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Rodrigo Damazio Bovendorp | Jun 25 2019, 10:32 PM |
except LookupError as inst: | except LookupError as inst: | ||||
err = stringutil.forcebytestr(inst) | err = stringutil.forcebytestr(inst) | ||||
problems += 1 | problems += 1 | ||||
fm.condwrite(err, 'encodingerror', _(" %s\n" | fm.condwrite(err, 'encodingerror', _(" %s\n" | ||||
" (check that your locale is properly set)\n"), err) | " (check that your locale is properly set)\n"), err) | ||||
# Python | # Python | ||||
fm.write('pythonexe', _("checking Python executable (%s)\n"), | fm.write('pythonexe', _("checking Python executable (%s)\n"), | ||||
pycompat.sysexecutable or "unknown") | pycompat.sysexecutable or _("unknown")) | ||||
fm.write('pythonver', _("checking Python version (%s)\n"), | fm.write('pythonver', _("checking Python version (%s)\n"), | ||||
("%d.%d.%d" % sys.version_info[:3])) | ("%d.%d.%d" % sys.version_info[:3])) | ||||
fm.write('pythonlib', _("checking Python lib (%s)...\n"), | fm.write('pythonlib', _("checking Python lib (%s)...\n"), | ||||
os.path.dirname(pycompat.fsencode(os.__file__))) | os.path.dirname(pycompat.fsencode(os.__file__))) | ||||
security = set(sslutil.supportedprotocols) | security = set(sslutil.supportedprotocols) | ||||
if sslutil.hassni: | if sslutil.hassni: | ||||
security.add('sni') | security.add('sni') |
if self._debug: | if self._debug: | ||||
script.append(b'set -x\n') | script.append(b'set -x\n') | ||||
if self._hgcommand != b'hg': | if self._hgcommand != b'hg': | ||||
script.append(b'alias hg="%s"\n' % self._hgcommand) | script.append(b'alias hg="%s"\n' % self._hgcommand) | ||||
if os.getenv('MSYSTEM'): | if os.getenv('MSYSTEM'): | ||||
script.append(b'alias pwd="pwd -W"\n') | script.append(b'alias pwd="pwd -W"\n') | ||||
if hgcatapult and hgcatapult != os.devnull: | if hgcatapult and hgcatapult != os.devnull: | ||||
if PYTHON3: | |||||
hgcatapult = hgcatapult.encode('utf8') | |||||
cataname = self.name.encode('utf8') | |||||
else: | |||||
cataname = self.name | |||||
# Kludge: use a while loop to keep the pipe from getting | # Kludge: use a while loop to keep the pipe from getting | ||||
# closed by our echo commands. The still-running file gets | # closed by our echo commands. The still-running file gets | ||||
# reaped at the end of the script, which causes the while | # reaped at the end of the script, which causes the while | ||||
# loop to exit and closes the pipe. Sigh. | # loop to exit and closes the pipe. Sigh. | ||||
script.append( | script.append( | ||||
b'rtendtracing() {\n' | b'rtendtracing() {\n' | ||||
b' echo END %(session)s %(name)s >> %(catapult)s\n' | b' echo END %(session)s %(name)s >> %(catapult)s\n' | ||||
b' rm -f "$TESTTMP/.still-running"\n' | b' rm -f "$TESTTMP/.still-running"\n' | ||||
b'}\n' | b'}\n' | ||||
b'trap "rtendtracing" 0\n' | b'trap "rtendtracing" 0\n' | ||||
b'touch "$TESTTMP/.still-running"\n' | b'touch "$TESTTMP/.still-running"\n' | ||||
b'while [ -f "$TESTTMP/.still-running" ]; do sleep 1; done ' | b'while [ -f "$TESTTMP/.still-running" ]; do sleep 1; done ' | ||||
b'> %(catapult)s &\n' | b'> %(catapult)s &\n' | ||||
b'HGCATAPULTSESSION=%(session)s ; export HGCATAPULTSESSION\n' | b'HGCATAPULTSESSION=%(session)s ; export HGCATAPULTSESSION\n' | ||||
b'echo START %(session)s %(name)s >> %(catapult)s\n' | b'echo START %(session)s %(name)s >> %(catapult)s\n' | ||||
% { | % { | ||||
'name': self.name, | b'name': cataname, | ||||
'session': session, | b'session': session, | ||||
'catapult': hgcatapult, | b'catapult': hgcatapult, | ||||
} | } | ||||
) | ) | ||||
if self._case: | if self._case: | ||||
casestr = b'#'.join(self._case) | casestr = b'#'.join(self._case) | ||||
if isinstance(self._case, str): | if isinstance(self._case, str): | ||||
quoted = shellquote(casestr) | quoted = shellquote(casestr) | ||||
else: | else: |