Closed
Bug 1675648
Opened 5 years ago
Closed 4 years ago
moz-phab incorrectly handles commits with CARRIAGE RETURNs and creates unlandable diffs
Categories
(Conduit :: moz-phab, defect, P2)
Conduit
moz-phab
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: Kwan, Assigned: zeid)
References
Details
(Keywords: conduit-triaged)
Attachments
(2 files)
See D95451 (Lando) and the related #conduit:mozilla.org Matrix discussion.
I think it might be because it seems like moz-phab is processing the diffs with python's splitlines(), which includes lone \rs, instead of just doing split("\n"), which seems to be what arcanist does
The result is extra - prefixed lines that shouldn't be.
Attached picture shows what moz-phab diffs read from Phabricator looks like on the left, with the errors on lines 14 and 16, and the correct diff on the right.
| Reporter | ||
Updated•5 years ago
|
Blocks: remove-arc
| Assignee | ||
Updated•4 years ago
|
Assignee: nobody → zeid
| Assignee | ||
Comment 1•4 years ago
|
||
WIP DO NOT LAND
This change improves line separator support on different OSes by:
- Determining linesep character based on current OS (e.g. \n or \r\n)
- Splitting lines that are generated by
hg catonly on linesep instead
of on any whitespace or newline character- This has the side-effect of preventing stray characters such as
carriage returns from triggering a line split
- This has the side-effect of preventing stray characters such as
This change also combines the functionality that is shared between
methods into a new _generate_lines static method.
TODO: add a test specific to _generate_lines.
| Assignee | ||
Updated•4 years ago
|
Keywords: conduit-triaged
Priority: -- → P2
| Assignee | ||
Updated•4 years ago
|
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•