Mercurial > public > mercurial-scm > hg
comparison mercurial/mdiff.py @ 31715:6c80f985a13c
diff: slice over bytes to make sure conditions work normally
Both of this are part of generating `hg diff` on python 3.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 26 Mar 2017 20:52:51 +0530 |
parents | a7acda2de4b8 |
children | ca3b4a2b7e54 |
comparison
equal
deleted
inserted
replaced
31714:bbf7a29dcf9b | 31715:6c80f985a13c |
---|---|
227 fn1 = util.pconvert(fn1) | 227 fn1 = util.pconvert(fn1) |
228 fn2 = util.pconvert(fn2) | 228 fn2 = util.pconvert(fn2) |
229 | 229 |
230 def checknonewline(lines): | 230 def checknonewline(lines): |
231 for text in lines: | 231 for text in lines: |
232 if text[-1] != '\n': | 232 if text[-1:] != '\n': |
233 text += "\n\ No newline at end of file\n" | 233 text += "\n\ No newline at end of file\n" |
234 yield text | 234 yield text |
235 | 235 |
236 if not opts.text and (util.binary(a) or util.binary(b)): | 236 if not opts.text and (util.binary(a) or util.binary(b)): |
237 if a and b and len(a) == len(b) and a == b: | 237 if a and b and len(a) == len(b) and a == b: |