Sat, 01 Oct 2016 14:18:58 +0100 annotate: calculate line count correctly
Jun Wu <quark@fb.com> [Sat, 01 Oct 2016 14:18:58 +0100] rev 30040
annotate: calculate line count correctly Before this patch, the "lines" function inside "annotate" returns 1 for empty text (''). This patch makes it 0. Because the function should match mdiff.splitnewlines (used by mdiff.allblocks), or s.splitlines (used at the end of the "annotate" method). Both len(mdiff.splitnewlines('')) and len(''.splitlines(True)) are 0. This issue was discovered while testing fastannotate [1]. I could not find a test case to reveal this issue. However in theory this could reduce memory usage a little bit, and avoids surprises when people are touching this area in the future. [1]: https://bitbucket.org/facebook/hg-experimental/commits/525b3b98e93a
Sun, 02 Oct 2016 05:29:17 +0530 py3: use unicode in is_frozen()
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 02 Oct 2016 05:29:17 +0530] rev 30039
py3: use unicode in is_frozen() imp.is_frozen() doesnot accepts bytes on Python 3. It does accept both bytes and strings on Python 2.
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -2 +2 +10 +30 +100 +300 +1000 +3000 +10000 tip