1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-29 18:22:41 +01:00

[svn] Fix removing a binary file without svn:mime-type set

Summary:
If we're removing a binary file that didn't have svn:mime-type set properly,
we can't propset it (because the file doesn't exist locally). Instead, just
return a synthetic diff for the removed file.

Test Plan:
run arc diff in an svn working copy where I ran svn rm on a binary file that
doesn't have svn:mime-type set, and the diff correctly gets uploaded to
phabricator instead of erroring when trying to set properties.

Reviewers: epriestley, wez

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5655
This commit is contained in:
Nick Harper 2013-04-10 15:22:58 -07:00
parent 7c22017562
commit b1fe436cfc

View file

@ -383,6 +383,15 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
$matches = null; $matches = null;
if (preg_match('/\.(gif|png|jpe?g|swf|pdf|ico)$/i', $path, $matches)) { if (preg_match('/\.(gif|png|jpe?g|swf|pdf|ico)$/i', $path, $matches)) {
$mime = $this->getSVNProperty($path, 'svn:mime-type'); $mime = $this->getSVNProperty($path, 'svn:mime-type');
if ($status & ArcanistRepositoryAPI::FLAG_DELETED) {
return <<<EODIFF
Index: {$path}
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
EODIFF;
}
if ($mime != 'application/octet-stream') { if ($mime != 'application/octet-stream') {
execx( execx(
'svn propset svn:mime-type application/octet-stream %s', 'svn propset svn:mime-type application/octet-stream %s',