Closed
Bug 1541181
Opened 6 years ago
Closed 6 years ago
`hg import` incorrectly handles files without newlines
Categories
(Conduit Graveyard :: Transplant, defect, P2)
Conduit Graveyard
Transplant
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: glob, Assigned: smacleod)
References
Details
(Keywords: conduit-triaged)
hg import incorrectly handles files without newlines.
steps to reproduce:
- create a file without a trailing newline
- commit to a hg
- delete the file
- generate a diff
- revert deletion
- try to
hg importthe diff to delete the file
the diff will look like
$ hg diff
diff --git a/test-file b/test-file
deleted file mode 100644
--- a/test-file
+++ /dev/null
@@ -1,1 +0,0 @@
-content mybrowser file:chrome/content/
\ No newline at end of file
trying to apply results in
$ hg import patch
applying patch
patching file test-file
Hunk #1 FAILED at 0
1 out of 1 hunks FAILED -- saving rejects to file test-file.rej
abort: patch failed to apply
the bug is in mercurial's parsing of the hunk - it only reads the specified lines of context from the hunk header (one line as per -1,1), and never reads the \ No newline at end of file line to strip the trailing \n. this extra \n prevents the patch from applying.
| Assignee | ||
Comment 2•6 years ago
|
||
I will file this with upstream mercurial.
| Assignee | ||
Comment 3•6 years ago
|
||
Filed upstream as https://bz.mercurial-scm.org/show_bug.cgi?id=6127
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Updated•1 year ago
|
Product: Conduit → Conduit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•