Mon, 08 Oct 2018 10:10:06 +0900 tests: fix style issue of importing hgweb in embedded code fragments
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 08 Oct 2018 10:10:06 +0900] rev 40203
tests: fix style issue of importing hgweb in embedded code fragments Some test scripts are excluded in test-check-module-imports.t, because import-checker.py reports that hgweb and/or hgwebdir of mercurial.hgweb are not imported in recommended style. To fix this issues, this patch make python code fragments embedded in these files import hgweb from mercurial package at first, and refer hgweb and hgwebdir via imported hgweb.
Fri, 12 Oct 2018 18:20:17 +0200 py3: encode str to bytes
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:20:17 +0200] rev 40202
py3: encode str to bytes These fields are str on Python 2 and 3. This module doesn't import any Mercurial modules. So I just did the str -> bytes inline. Differential Revision: https://phab.mercurial-scm.org/D5010
Fri, 12 Oct 2018 19:00:24 +0200 py3: sprinkle statprof.py with utf-8 encoding
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 19:00:24 +0200] rev 40201
py3: sprinkle statprof.py with utf-8 encoding Trying to chase the long tail of unicode badness in this file due to frame / code objects holding str everywhere. Differential Revision: https://phab.mercurial-scm.org/D5016
Fri, 12 Oct 2018 19:17:22 +0200 py3: flush stdout
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 19:17:22 +0200] rev 40200
py3: flush stdout This avoids buffering due to mixed print() and sys.stdout.write() by profiling code. And with this, test-profile.t passes on Python 3 \o/. Honestly, I'd be shocked if there weren't more Python 3 encoding issues lingering in the profiling code. That code isn't super high quality and doesn't seem to have thorough test coverage. Differential Revision: https://phab.mercurial-scm.org/D5018
Fri, 12 Oct 2018 19:07:12 +0200 py3: use raw strings in statprof.py
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 19:07:12 +0200] rev 40199
py3: use raw strings in statprof.py This allows main() and argument parsing to work. Differential Revision: https://phab.mercurial-scm.org/D5017
Fri, 12 Oct 2018 18:51:10 +0200 py3: switch from print(..., file=) to write()
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:51:10 +0200] rev 40198
py3: switch from print(..., file=) to write() Because Python 3's print() doesn't like bytes. Differential Revision: https://phab.mercurial-scm.org/D5015
Fri, 12 Oct 2018 18:40:32 +0200 py3: use %d in a few places
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:40:32 +0200] rev 40197
py3: use %d in a few places Differential Revision: https://phab.mercurial-scm.org/D5014
Fri, 12 Oct 2018 18:37:42 +0200 py3: use raw strings for stack names
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:37:42 +0200] rev 40196
py3: use raw strings for stack names These are used for simple compares. We don't need to normalize to bytes. As part of this, I expanded a set literal so entries are 1 per line. Differential Revision: https://phab.mercurial-scm.org/D5013
Fri, 12 Oct 2018 18:30:40 +0200 py3: use sysbytes for converting code attributes
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:30:40 +0200] rev 40195
py3: use sysbytes for converting code attributes Differential Revision: https://phab.mercurial-scm.org/D5012
Fri, 12 Oct 2018 18:26:10 +0200 py3: use write() instead of print()
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:26:10 +0200] rev 40194
py3: use write() instead of print() Because print() expects str and we want to write bytes. There should be no functional changes as part of this. Differential Revision: https://phab.mercurial-scm.org/D5011
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip