'ArcanistPyFlakesLinter' => 'lint/linter/ArcanistPyFlakesLinter.php',
'ArcanistPyLintLinter' => 'lint/linter/ArcanistPyLintLinter.php',
'ArcanistRepositoryAPI' => 'repository/api/ArcanistRepositoryAPI.php',
+ 'ArcanistRepositoryAPIMiscTestCase' => 'repository/api/__tests__/ArcanistRepositoryAPIMiscTestCase.php',
'ArcanistRepositoryAPIStateTestCase' => 'repository/api/__tests__/ArcanistRepositoryAPIStateTestCase.php',
'ArcanistRubyLinter' => 'lint/linter/ArcanistRubyLinter.php',
'ArcanistRubyLinterTestCase' => 'lint/linter/__tests__/ArcanistRubyLinterTestCase.php',
'ArcanistPhutilTestTerminatedException' => 'Exception',
'ArcanistPyFlakesLinter' => 'ArcanistLinter',
'ArcanistPyLintLinter' => 'ArcanistLinter',
+ 'ArcanistRepositoryAPIMiscTestCase' => 'ArcanistTestCase',
'ArcanistRepositoryAPIStateTestCase' => 'ArcanistTestCase',
'ArcanistRubyLinter' => 'ArcanistLinter',
'ArcanistRubyLinterTestCase' => 'ArcanistArcanistLinterTestCase',
$this->execxLocal('up');
}
+ public static function escapeFileNamesForSVN(array $files) {
+ // 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.'@';
+ }
+ }
+ return $files;
+ }
+
}
--- /dev/null
+<?php
+
+final class ArcanistRepositoryAPIMiscTestCase extends ArcanistTestCase {
+
+ public function testSVNFileEscapes() {
+ $input = array(
+ '.',
+ 'x',
+ 'x@2x.png',
+ );
+
+ $expect = array(
+ '.',
+ 'x',
+ 'x@2x.png@',
+ );
+
+ $this->assertEqual(
+ $expect,
+ ArcanistSubversionAPI::escapeFileNamesForSVN($input));
+ }
+
+}
$this->promptFileWarning($prefix, $prompt, $do_not_exist);
}
- $files = array();
- foreach ($commit_paths as $file => $ignored) {
- $files[] = $file.'@'; // make SVN accept commits like foo@2x.png
- }
+ $files = array_keys($commit_paths);
+ $files = ArcanistSubversionAPI::escapeFileNamesForSVN($files);
if (empty($files)) {
throw new ArcanistUsageException(