Homec4science

Stop treating "\r" as a newline

Authored by epriestley <git@epriestley.com> on Oct 20 2012, 14:43.

Description

Stop treating "\r" as a newline

Summary:
None of Git, Mercurial or SVN treat "\r" on its own as a newline under Unix/OS X or Windows. If you diff a file with \r newlines, you get a 1-line change. Do the same thing they do.

(Arguably we could split this into two functions like phutil_split_lines() and phutil_split_vcs_lines() or something, but I'm happy to call "\r" on its own a non-newline.)

Test Plan: Unit tests.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1857

Differential Revision: https://secure.phabricator.com/D3757

Details

Committed
epriestley <git@epriestley.com>Oct 20 2012, 14:43
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUb4c3f0417411: Use class name and code in aggregate exception
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU4e6dd9cc54d5: Stop treating "\r" as a newline (authored by epriestley <git@epriestley.com>).Oct 20 2012, 14:43