1. TortoiseHg
  2. TortoiseHg
  3. thg
  4. Issues
Issue #1502 open

Incorrect line endings inserted in merge rejected patch view

Laurens Holst
created an issue

When I am in the merge rejected patch view, if I copy/paste from the diff area into the file editor, it adds the lines with CRLF line endings. I am running on Windows.

Steps for reproduction:

Import two changesets into MQ that use LF line endings in their files

Unapply the second patch

Alter something in the first patch that conflicts with the second

Re-apply the second patch

Answer yes to the dialog that asks if you want to merge the rejected hunk

Copy/paste a couple of lines from the rejected hunk into the file editor

Mark the hunk as resolved and save

Note that the file now has mixed line endings

Comments (3)

  1. Dominic Mayers

    This seems to be related to the following behaviour. In some cases, when we right click on a revision and execute Export -> Export patch... we obtain a patch with lines ending with CRLF mixed with other lines that end with LF : http://www.lpmt.ca/Mixed.JPG . This occurs with EOL = auto. This kinds of patches cannot be applied in GNU patch - I wish GNU patch would simply ignore any extra CR. If I replace all LF with CRLF, it works. If I remove all CR, it also works. I also discussed this issue in #1895, but it was not the right place.

  2. Log in to comment