Mercurial > hg
comparison mercurial/context.py @ 36510:0a7c59a4c835 stable
annotate: do not poorly split lines at CR (issue5798)
mdiff and lines(text) take only LF as a line separator, but str.splitlines()
breaks our assumption. Use mdiff.splitnewlines() consistently.
It's hard to read \r in tests, so \r is replaced with [CR]. I had to wrap
sed by a shell function to silence check-code warning.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 21 Feb 2018 21:14:05 +0900 |
parents | 2a7e777c9eed |
children | b529e640015d |
comparison
equal
deleted
inserted
replaced
36386:fb39f6a8a864 | 36510:0a7c59a4c835 |
---|---|
1119 needed[p] -= 1 | 1119 needed[p] -= 1 |
1120 | 1120 |
1121 hist[f] = curr | 1121 hist[f] = curr |
1122 del pcache[f] | 1122 del pcache[f] |
1123 | 1123 |
1124 return pycompat.ziplist(hist[base][0], hist[base][1].splitlines(True)) | 1124 lineattrs, text = hist[base] |
1125 return pycompat.ziplist(lineattrs, mdiff.splitnewlines(text)) | |
1125 | 1126 |
1126 def ancestors(self, followfirst=False): | 1127 def ancestors(self, followfirst=False): |
1127 visit = {} | 1128 visit = {} |
1128 c = self | 1129 c = self |
1129 if followfirst: | 1130 if followfirst: |