Wed, 11 Apr 2018 16:10:02 -0400 wireprotoserver: headers are bytes for us internally, use bytes
Augie Fackler <augie@google.com> [Wed, 11 Apr 2018 16:10:02 -0400] rev 37590
wireprotoserver: headers are bytes for us internally, use bytes This re-fixes test-pull-http.t on Python 3. Probably many others as well. Differential Revision: https://phab.mercurial-scm.org/D3249
Wed, 11 Apr 2018 16:09:23 -0400 hgweb: put response headers back into str for Python 3
Augie Fackler <augie@google.com> [Wed, 11 Apr 2018 16:09:23 -0400] rev 37589
hgweb: put response headers back into str for Python 3 This fixes a lot of hanging tests on Python 3, because "Content-Length" was getting sent as "b'Content-Length'" (yes, really) and then clients would expect a close-is-end body instead of counting off a certain number of bytes. Differential Revision: https://phab.mercurial-scm.org/D3248
Wed, 11 Apr 2018 14:57:11 -0400 tests: load showstack in test-pull-http.t so network hangs are easier to find
Augie Fackler <augie@google.com> [Wed, 11 Apr 2018 14:57:11 -0400] rev 37588
tests: load showstack in test-pull-http.t so network hangs are easier to find This also gives us some minimal "it loads" coverage on showstack, which I rather like. showstack doesn't work on Windows per mbarbison, so it's disabled there. I added this in service of debugging a hang introduced on Python 3 by revision a88d68dc3ee8. I'm still not sure what the problem there is, but this at least gives us a little bit of a chance to figure out what's going on. Differential Revision: https://phab.mercurial-scm.org/D3247
Wed, 11 Apr 2018 14:39:49 -0400 keepalive: rewrite readinto() to not use read()
Augie Fackler <augie@google.com> [Wed, 11 Apr 2018 14:39:49 -0400] rev 37587
keepalive: rewrite readinto() to not use read() It turns out http.client on Python 3 sometimes uses readinto() in the implementation of read(). Unfortunately, Python 2 doesn't have a readinto() in httplib's client, so we have to support both codepaths. Subclassing is bad, folks. Differential Revision: https://phab.mercurial-scm.org/D3246
Thu, 12 Apr 2018 17:22:59 +0530 py3: use bytes() instead of str() on util.url()
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 17:22:59 +0530] rev 37586
py3: use bytes() instead of str() on util.url() We internally deal with bytes and anything as string breaks things. Differential Revision: https://phab.mercurial-scm.org/D3285
Thu, 12 Apr 2018 17:21:56 +0530 py3: use stringutil.forcebytestr() to convert error messages to bytes
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 17:21:56 +0530] rev 37585
py3: use stringutil.forcebytestr() to convert error messages to bytes Differential Revision: https://phab.mercurial-scm.org/D3284
Thu, 12 Apr 2018 08:06:39 -0700 py3: suppress the return value of write() in tests/test-subrepo-missing.t
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 08:06:39 -0700] rev 37584
py3: suppress the return value of write() in tests/test-subrepo-missing.t write() on Python 3 returns a value whereas does not return anything on Python 2. So we need to supress the value. Differential Revision: https://phab.mercurial-scm.org/D3283
Thu, 12 Apr 2018 16:52:32 +0530 py3: add b'' prefixes in tests/test-linerange.py
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 16:52:32 +0530] rev 37583
py3: add b'' prefixes in tests/test-linerange.py This makes the test pass on Python 3. # skip-blame because just b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D3282
Thu, 12 Apr 2018 15:23:36 +0530 py3: add b'' prefix to make the regex bytes
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 15:23:36 +0530] rev 37582
py3: add b'' prefix to make the regex bytes # skip-blame because just b'' prefix Differential Revision: https://phab.mercurial-scm.org/D3281
Thu, 12 Apr 2018 15:22:56 +0530 py3: use b'%d' to convert int to bytes instead of str()
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 15:22:56 +0530] rev 37581
py3: use b'%d' to convert int to bytes instead of str() Differential Revision: https://phab.mercurial-scm.org/D3280
Thu, 12 Apr 2018 15:03:15 +0530 py3: use print as a function in test-convert-git.t
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 15:03:15 +0530] rev 37580
py3: use print as a function in test-convert-git.t Differential Revision: https://phab.mercurial-scm.org/D3278
Thu, 12 Apr 2018 14:30:37 +0530 py3: use '%d' for integers instead of '%s'
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 14:30:37 +0530] rev 37579
py3: use '%d' for integers instead of '%s' Differential Revision: https://phab.mercurial-scm.org/D3277
Thu, 12 Apr 2018 14:28:08 +0530 py3: prevent transformer from adding b'' by adding r'' prefix
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 14:28:08 +0530] rev 37578
py3: prevent transformer from adding b'' by adding r'' prefix These are cases where we need to use str, therefore we add r'' prefix. # skip-blame because just r'' prefixes Differential Revision: https://phab.mercurial-scm.org/D3276
Thu, 12 Apr 2018 14:26:31 +0530 py3: use pycompat.{strkwargs|byteskwargs} in infinitepush
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 12 Apr 2018 14:26:31 +0530] rev 37577
py3: use pycompat.{strkwargs|byteskwargs} in infinitepush Differential Revision: https://phab.mercurial-scm.org/D3275
Wed, 11 Apr 2018 22:36:16 +0530 py3: make sure we open file in bytes mode
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 11 Apr 2018 22:36:16 +0530] rev 37576
py3: make sure we open file in bytes mode Differential Revision: https://phab.mercurial-scm.org/D3274
Sat, 07 Apr 2018 01:37:25 +0900 diffhelpers: be more tolerant for stripped empty lines of CRLF ending
Yuya Nishihara <yuya@tcha.org> [Sat, 07 Apr 2018 01:37:25 +0900] rev 37575
diffhelpers: be more tolerant for stripped empty lines of CRLF ending Exchange. It appears to trim lines containing only whitespace as well as converting LF to CRLF.
Mon, 09 Apr 2018 21:08:52 +0900 diffhelpers: make return value of testhunk() more Pythonic
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 21:08:52 +0900] rev 37574
diffhelpers: make return value of testhunk() more Pythonic It's no longer C.
Mon, 09 Apr 2018 21:06:46 +0900 patch: error out if reached to EOF while reading hunk
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 21:06:46 +0900] rev 37573
patch: error out if reached to EOF while reading hunk This was where out-of-bounds read occurred in old C extension.
Mon, 09 Apr 2018 20:55:05 +0900 diffhelpers: remove unused return value from fixnewline() and addlines()
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:55:05 +0900] rev 37572
diffhelpers: remove unused return value from fixnewline() and addlines()
Mon, 09 Apr 2018 20:54:00 +0900 diffhelpers: move out of pure package
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:54:00 +0900] rev 37571
diffhelpers: move out of pure package
Mon, 09 Apr 2018 20:52:54 +0900 diffhelpers: naming and whitespace cleanup
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:52:54 +0900] rev 37570
diffhelpers: naming and whitespace cleanup
Mon, 09 Apr 2018 20:51:23 +0900 diffhelpers: remove C implementation in favor of pure Python version
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:51:23 +0900] rev 37569
diffhelpers: remove C implementation in favor of pure Python version
Mon, 09 Apr 2018 20:49:39 +0900 patch: stop using cext.diffhelpers
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:49:39 +0900] rev 37568
patch: stop using cext.diffhelpers The C implementation has a couple of memory bugs, and lacks error handling which could lead to SEGV. I could fix them one by one (and I mostly finished that), but the performance gain provided by cext.diffhelper is quite low. Besides, diffhelpers.addlines() calls back Python, linereader.readline(), from the innermost loop. $ hg export -R mozilla-central 0:100 > patch $ ls -lh patch -rw-r--r-- 184M patch $ hg init repo && hg -R repo import patch --time --bypass (cext) time: real 34.970 secs (user 32.720+0.000 sys 2.230+0.000) (pure) time: real 35.950 secs (user 33.600+0.000 sys 2.330+0.000) So, let's simply use the pure Python implementation.
Mon, 09 Apr 2018 20:47:43 +0900 diffhelpers: port docstrings from cext to pure
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:47:43 +0900] rev 37567
diffhelpers: port docstrings from cext to pure I'll remove the C implementation.
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -24 +24 +50 +100 +300 +1000 +3000 +10000 tip