Pulkit Goyal <7895pulkit@gmail.com> [Fri, 02 Mar 2018 07:13:33 +0530] rev 36653
py3: use pycompat.bytestr() to convert error messages to bytes
Differential Revision: https://phab.mercurial-scm.org/D2535
Augie Fackler <augie@google.com> [Sat, 03 Mar 2018 14:28:51 -0500] rev 36652
url: more bytes/unicodes fussing in url.py around auth handling
Once again, these methods are a little annoying to handle because they
can get unicodes or bytes depending on who's calling. I think we can
probably clean this up a TON once we can run something like pytype and
do typechecking of our Python, but until then this is going to be the
easy way out. This fixes test-http-bundle1.t.
Differential Revision: https://phab.mercurial-scm.org/D2599
Augie Fackler <augie@google.com> [Sat, 03 Mar 2018 14:24:21 -0500] rev 36651
httpconnection: convert url to bytes in readauthforuri
This method is sometimes called by the stdlib, so we just need to
accept both bytes and unicodes here. Awesome.
Differential Revision: https://phab.mercurial-scm.org/D2598
Augie Fackler <augie@google.com> [Sat, 03 Mar 2018 14:44:41 -0500] rev 36650
tests: prevent enormous output spew in test-lfs-largefiles.t
This test currently fails on Python 3, but in a super-slow way. Adding
this `head` invocation costs us nothing, but will prevent failures in
this area from being super expensive.
Differential Revision: https://phab.mercurial-scm.org/D2600
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 12:23:03 -0500] rev 36649
py3: fix formatting of path-auditing errors
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 12:36:05 -0500] rev 36648
py3: make os.curdir a bytes
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 12:34:35 -0500] rev 36647
py3: make os.pardir a bytes
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 14:21:47 -0500] rev 36646
py3: fix slicing of bytes in patch.iterhunks()
Augie Fackler <augie@google.com> [Sat, 03 Mar 2018 09:35:59 -0500] rev 36645
tests: fix various test-check-module-imports.t violations
Somehow these are only caught when running the test under Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2580
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 27 Feb 2018 00:33:46 +0530] rev 36644
pycompat: prevent encoding or decoding values if not required
pycompat.py has functions strurl and bytesurl which decodes and encodes the url
passed on Python 3 respectively. In some cases, strurl gets a url which is
already str and bytesurl gets a url which is already bytes. Let's prevent
encoding or decoding the values again if not required.
Differential Revision: https://phab.mercurial-scm.org/D2472
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 10:39:48 -0500] rev 36643
py3: add some b'' to make test-lock-badness.t happy
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 10:32:06 -0500] rev 36642
py3: fix formatting of lock error message
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 10:02:36 -0500] rev 36641
py3: fix some unicode madness in global exception catcher
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 10:08:13 -0500] rev 36640
py3: pass a system-string filename to sub-classes of IOError
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 09:19:34 -0500] rev 36639
py3: fix some membership tests on linkrev adjustment
Yuya Nishihara <yuya@tcha.org> [Fri, 02 Mar 2018 22:38:09 -0500] rev 36638
py3: make test-basic.t pass on Python 3
Yuya Nishihara <yuya@tcha.org> [Fri, 02 Mar 2018 22:35:20 -0500] rev 36637
py3: silence the final IOError by closing stdout/err slightly early
Fixes the following test failure:
$ hg status >/dev/full
abort: No space left on device
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' ...
OSError: [Errno 28] No space left on device
[120]
Yuya Nishihara <yuya@tcha.org> [Fri, 02 Mar 2018 22:10:36 -0500] rev 36636
py3: conditionalize initialization of stdio flags
Since Python 3 doesn't depend on the stdio of libc, there should be no need
to set O_BINARY flag on Windows.
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 18:25:19 -0500] rev 36635
test-command-template: glob out detailed "invalid escape" message
Python 3 also reports the position where an invalid escape found.
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 08:14:54 -0500] rev 36634
templater: byte-stringify dict/list values before passing to default format
bytestr() is applied only when no custom format string like '%d' is specified.
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 08:07:22 -0500] rev 36633
templater: allow dynamically switching the default dict/list formatting
'%s' doesn't work nicely on Python 3 because many Python types don't implement
__bytes__().
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 03 Mar 2018 21:01:07 +0530] rev 36632
py3: use util.forcevytestr to convert error to bytes
Differential Revision: https://phab.mercurial-scm.org/D2585
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 03 Mar 2018 09:50:07 -0500] rev 36631
util: report integer result from write()
Python 2 sometimes returns None from write() calls. Python 3 doesn't.
This will make test output inconsistent between Python 2 and 3. So
let's paper over the differences by converting None to the length of
the result string.
Differential Revision: https://phab.mercurial-scm.org/D2584
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 03 Mar 2018 09:34:06 -0500] rev 36630
util: log readinto() I/O
Differential Revision: https://phab.mercurial-scm.org/D2583
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 02 Mar 2018 22:47:18 -0500] rev 36629
util: teach escapedata() about bytearray
re.map doesn't seem to know about bytearray (at least in Python 2).
Cast bytearray to a bytes to work around this inconvenience.
Differential Revision: https://phab.mercurial-scm.org/D2582
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 02 Mar 2018 22:59:12 -0500] rev 36628
sshpeer: don't read(0)
read(0) is essentially a no-op. Let's avoid the function call, overhead,
and extra test output by not performing it.
Differential Revision: https://phab.mercurial-scm.org/D2581
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 05:51:34 -0500] rev 36627
py3: unblock C extensions on Python 3
Please make sure to build C extensions before running tests with -l:
$ make local PYTHON=python3
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 07:59:20 -0500] rev 36626
py3: make test-ancestors.py pass on Python 3 with C extensions
# skip-blame just some b prefixes
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 07:24:25 -0500] rev 36625
py3: do not pass a memoryview to bdiff.bdiff()
This doesn't look nice, but I don't know how to make a zero-copy slice of
bytes which is compatible with the buffer protocol.
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 07:00:37 -0500] rev 36624
py3: do not pass a list of iterators to computephasesmapsets()
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 06:57:02 -0500] rev 36623
cext: fix computephasesmapsets() not to return without setting an exception
Spotted by map() of Python 3.
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 06:44:47 -0500] rev 36622
py3: do not pass a float to dict_new_presized()
I really don't like the division operator of Python 3 since I'm not doing
a math.