Summary:
See IRC. This fixes an issue when deleting an SVN file that ends with one of the extensions in the regexp, which may only affect newer versions of SVN.
Possibly we shouldn't have this heuristic, or should move it elsewhere or make it more explicit, but at least stop it from being broken for now.
Test Plan: Ran `arc diff --only` in a working copy with a deleted binary file ending in ".jpg".
Reviewers: btrahan, nh
Reviewed By: nh
CC: aran, mbishopim3
Differential Revision: https://secure.phabricator.com/D6893
// TODO: Move this to configuration?
$matches = null;
if (preg_match('/\.(gif|png|jpe?g|swf|pdf|ico)$/i', $path, $matches)) {
- $mime = $this->getSVNProperty($path, 'svn:mime-type');
+ // Check if the file is deleted first; SVN will complain if we try to
+ // get properties of a deleted file.
if ($status & ArcanistRepositoryAPI::FLAG_DELETED) {
return <<<EODIFF
Index: {$path}
EODIFF;
}
+
+ $mime = $this->getSVNProperty($path, 'svn:mime-type');
if ($mime != 'application/octet-stream') {
execx(
'svn propset svn:mime-type application/octet-stream %s',
$working_copy);
$api->setBaseCommitArgumentRules('arc:this');
+ if ($api instanceof ArcanistSubversionAPI) {
+ // Upgrade the repository so that the test will still pass if the local
+ // `svn` is newer than the `svn` which created the repository.
+ $api->execxLocal('upgrade');
+ }
+
$this->assertCorrectState($test, $api);
}