Homec4science

Fix whitespace and unchanged file shields

Authored by epriestley <git@epriestley.com> on Jan 12 2013, 00:27.

Description

Fix whitespace and unchanged file shields

Summary:
Fixes T181. I actually have no idea what the original issue in T181 was, but this fixes several problems:

  • The code for figuring out whitespace-only changes was extremely confusing and probably buggy (the code for figuring out unchanged files was equally confusing but probably less buggy).
  • When rendering a whitespace shield, we did not offer a "Show Changes" link. Instead, show the "Show Changes" link: we can always render the content beneath this link.
  • When clicking "Show Changes", we used the current whitespace mode, which might result in a diff with no changes. Instead, force "show all" whitespace mode.
  • We never offered a "show changes" link for unchanged files. Instead, offer this link if we can service it.
  • When clicking "Show Changes", we pierced the shield but didn't force file content, which would fold the entire file even if it was available. Instead, force the file content.

Test Plan: Generated whitespace-only and no-change diffs. Clicked shield links, or verified no shield link available in no-change-with-no-content. Generated an "@generated" change, verified shield worked correctly.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T181, T2009

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

Details

Committed
epriestley <git@epriestley.com>Jan 12 2013, 00:27
Pushed
aubortJan 31 2017, 17:16
Parents
rPH039a5a6d8618: Simplify hunk parsing
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHdbdb01f85807: Fix whitespace and unchanged file shields (authored by epriestley <git@epriestley.com>).Jan 12 2013, 00:27