From patchwork Tue Aug 6 09:25:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Bug, 6183] New: hg import fails to ignore '\ ' line due to Windows line endings From: mercurial-bugs@mercurial-scm.org X-Patchwork-Id: 41176 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Tue, 06 Aug 2019 09:25:48 +0000 https://bz.mercurial-scm.org/show_bug.cgi?id=6183 Bug ID: 6183 Summary: hg import fails to ignore '\ ' line due to Windows line endings Product: Mercurial Version: unspecified Hardware: PC OS: Windows Status: UNCONFIRMED Severity: feature Priority: wish Component: Mercurial Assignee: bugzilla@mercurial-scm.org Reporter: jbvernee@xs4all.nl CC: mercurial-devel@mercurial-scm.org A patch file like the following: ``` ``` (encoding being UTF-8) fails to apply when having Windows line endings (CRLF), giving the following error: applying diff.patch abort: bad hunk #1 @@ -2,1 +2,1 @@ (2 1 1 1) But applies correctly when using unix line endings (LF). This happens when running `hg import diff.patch` in a Windows native shell, using hg.exe bundled with TortoiseHG (version 5.0.2). It seems that the `\ ` line fails to be ignored by: [https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/patch.py#l1325] when there are Windows line endings? diff -r c4b6f80981fd README.md --- a/README.md Tue Aug 06 14:37:03 2019 +0200 +++ b/README.md Tue Aug 06 14:49:23 2019 +0200 @@ -2,1 +2,1 @@ -Second Line \ No newline at end of file +Second Line