]> khamidou — GitHub mirrors - arcanist.git/commit
Don't choke on blame of files with whitespace-only trailing lines
authorepriestley <git@epriestley.com>
Mon, 27 Jan 2014 19:03:08 +0000 (11:03 -0800)
committerepriestley <git@epriestley.com>
Mon, 27 Jan 2014 19:03:08 +0000 (11:03 -0800)
commit1daa719acecbc44b76eadae0f446ca40253be0cc
tree2179acac97e3881cf7f787d9b28fecffdc4ad6f8
parentb1d3948d77874721226240f1479b57658b50a78a
Don't choke on blame of files with whitespace-only trailing lines

Summary:
Fixes T4349. Two issues:

  - As discussed in T4349, we would trim the entire output and then require spaces when matching. This choked incorrectly if the last line of a file contained only whitespace. Use `phutil_split_lines()` instead, and regexp things more reasonably.
  - We were capturing the line text, not the commit, as "revision". This isn't actually used elsewhere, but was obviously wrong. Make this consistent with Git/SVN.

Test Plan: Rigged a call up and saw reasonable output after the patch, on a working copy which threw before the patch.

Reviewers: durham, btrahan

Reviewed By: durham

CC: aran
Maniphest Tasks: T4349

Differential Revision: https://secure.phabricator.com/D8078
src/repository/api/ArcanistMercurialAPI.php