Homec4science

Use phutil_split_lines() in Differential

Authored by epriestley <git@epriestley.com> on Oct 20 2012, 15:13.

Description

Use phutil_split_lines() in Differential

Summary:

  • We currently treat "\r" as a newline, but should not because VCSes do not.
  • We get an extra empty line at the end of diffs created after D3442 because we now retain newlines.
  • Historically we've converted tab pre-cache, but do it post-cache instead so we can add prefs about it, as we should handle it better than we do (e.g., let the user set it to a different width, infer width from comments in the file, expand it to actual tab stops, or show it visually in some way).

Test Plan:

  • Verified diffs no longer have an empty line at the end.
  • Created a diff of a "\r" file and verified it displayed somewhat reasonably. All browsers treat "\r" as a real newline so it's not necessarily perfect, but we can clean that up later. Hopefully these files are exceedingly rare.
  • Created a file with tabs and verified it came out reasonably.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1857

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

Details

Committed
epriestley <git@epriestley.com>Oct 20 2012, 15:13
Pushed
aubortJan 31 2017, 17:16
Parents
rPHfd87a88d710e: Fix static variable usage in Lisk
Branches
Unknown
Tags
Unknown
Reverted By
rPH468aeaef0db7: Revert "Use phutil_split_lines() in Differential"

Event Timeline

epriestley <git@epriestley.com> committed rPHf6cb51562efd: Use phutil_split_lines() in Differential (authored by epriestley <git@epriestley.com>).Oct 20 2012, 15:13