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.
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.
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.
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:55:05 +0900] rev 37572
diffhelpers: remove unused return value from fixnewline() and addlines()
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:54:00 +0900] rev 37571
diffhelpers: move out of pure package
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:52:54 +0900] rev 37570
diffhelpers: naming and whitespace cleanup
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
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.
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.
Yuya Nishihara <yuya@tcha.org> [Mon, 09 Apr 2018 20:44:41 +0900] rev 37566
py3: get rid of character access from pure.diffhelpers
's' is a result of readline(), so 'c == "\n"' means 's == "\n"'.