}
public static function escapeFileNamesForSVN(array $files) {
+ foreach ($files as $k => $file) {
+ $files[$k] = self::escapeFileNameForSVN($file);
+ }
+ return $files;
+ }
+
+ public static function escapeFileNameForSVN($file) {
// SVN interprets "x@1" as meaning "file x at revision 1", which is not
// intended for files named "sprite@2x.png" or similar. For files with an
// "@" in their names, escape them by adding "@" at the end, which SVN
// interprets as "at the working copy revision". There is a special case
// where ".@" means "fail with an error" instead of ". at the working copy
// revision", so avoid escaping "." into ".@".
- foreach ($files as $k => $file) {
- if (strpos($file, '@') !== false) {
- $files[$k] = $file.'@';
- }
+
+ if (strpos($file, '@') !== false) {
+ $file = $file.'@';
}
- return $files;
+
+ return $file;
}
}
csprintf(
'(cd %s; svn cp %s %s)',
$repository_api->getPath(),
- $src,
- $dst));
+ ArcanistSubversionAPI::escapeFileNameForSVN($src),
+ ArcanistSubversionAPI::escapeFileNameForSVN($dst)));
}
foreach ($deletes as $delete) {
csprintf(
'(cd %s; svn rm %s)',
$repository_api->getPath(),
- $delete));
+ ArcanistSubversionAPI::escapeFileNameForSVN($delete)));
}
foreach ($symlinks as $symlink) {
csprintf(
'(cd %s; svn add %s)',
$repository_api->getPath(),
- $add));
+ ArcanistSubversionAPI::escapeFileNameForSVN($add)));
}
foreach ($propset as $path => $changes) {
'(cd %s; svn propdel %s %s)',
$repository_api->getPath(),
$prop,
- $path));
+ ArcanistSubversionAPI::escapeFileNameForSVN($path)));
} else {
passthru(
csprintf(
$repository_api->getPath(),
$prop,
$value,
- $path));
+ ArcanistSubversionAPI::escapeFileNameForSVN($path)));
}
}
}