Issue #3889 wontfix

diff UI not working properly for .rst files (BB-4088)

Vinay Sajip
created an issue

If you look at the recent commits on https://bitbucket.org/vinay.sajip/pylauncher/, you'll see that changes to launcher.rst are not correctly shown. It only shows the first few lines of the file, even though there are changes throughout the file.

Example:

https://bitbucket.org/vinay.sajip/pylauncher/changeset/e73603fa89af#chg-Doc/launcher.rst

If you examine the changes in a CLI, you'll see that there are more than show up in the UI.

Comments (6)

  1. Nicolas Venegas

    Hi Vinay

    It seems this is being caused by incorrectly interpretting the diff due to the presence of ^M characters in the file.

    Mercurial reports that only one line changed (a single line which ^M characters embedded that represent newlines):

    % hg diff --change e73603fa89af --include='**/launcher.rst' | diffstat
     launcher.rst |    2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    

    But our parsing of the file and diff is treating the ^M characters as proper newlines, making the diff output misleading.

    I'll work on a fix.

    Regards

    Nicolas

  2. Vinay Sajip reporter

    It looks as if the file was created on a Mac (not by me) - the line endings are all CR. I have now converted it to use CRLF line endings, as the file is mainly for Windows users, but I guess you need to deal with different line-endings anyway.

  3. Brodie Rao staff

    Closing this as won't fix. I agree that it's a little confusing that we handle MacOS-style CR line endings as line endings and Hg doesn't, but I'd say it's friendlier to interpret them.

  4. Log in to comment