Skip to content

Commit

Permalink
Use binary safe diff in arc diff
Browse files Browse the repository at this point in the history
Summary: Otherwise svn diff fails when the file is binary but the "svn:mime-type = application/x-shellscript" is missing in it.

Test Plan: arc diff succeeded against deleting a binary file which doesn't have svn:mime-type = application/x-shellscript.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2915
  • Loading branch information
Jason Ge committed Jul 3, 2012
1 parent 088091c commit f9415e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions scripts/repository/binary_safe_diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

diff "$@"
if [ "$?" = "2" ]; then
exit 1
fi
5 changes: 4 additions & 1 deletion src/repository/api/ArcanistSubversionAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,12 @@ public function buildDiffFuture($path) {
// itself (such as property changes) and also give us changes to any
// files within the directory (basically, implicit recursion). We don't
// want that, so prevent recursive diffing.
$root = phutil_get_library_root('arcanist');

return new ExecFuture(
'(cd %s; svn diff --depth empty --diff-cmd diff -x -U%d %s)',
'(cd %s; svn diff --depth empty --diff-cmd %s -x -U%d %s)',
$this->getPath(),
$root.'/../scripts/repository/binary_safe_diff.sh',
$this->getDiffLinesOfContext(),
$path);
}
Expand Down

0 comments on commit f9415e3

Please sign in to comment.