Summary:
When using curses during interactive revert, we now properly handle the transition to or from having no newline at the end of file. We do this by peeking ahead one line and trimming the apparent newline if the next line is "No newline at end of file".
This is motivated by upstream https://phab.mercurial-scm.org/D8762, but that test didn't exercise the bug for me, and the code change didn't work properly when reverting back to the no-newline case.
Reviewed By: quark-zju
Differential Revision: D33541600
fbshipit-source-id: 6e605fe2f6017baad0aa8232313a209f68fc871c