]> khamidou — GitHub mirrors - arcanist.git/commitdiff
escape files properly in arc commit
authorBob Trahan <bob.trahan@gmail.com>
Wed, 31 Oct 2012 01:26:58 +0000 (18:26 -0700)
committerBob Trahan <bob.trahan@gmail.com>
Wed, 31 Oct 2012 01:26:58 +0000 (18:26 -0700)
Summary: turns out retina has files like image.png and image@2x.png. The latter breaks since '@' is a special command telling svn to "look for image at revision 2x.png" -- nonsensical garbage. If we add it to the end every time this error goes way.

Test Plan: touch 2@2.png; svn add '2@2@'; arc diff; <fill out form, accept commit>; arc commit -- observe commit working

Reviewers: epriestley

Reviewed By: epriestley

CC: mbishopim3, aran, Korvin
Maniphest Tasks: T1999

Differential Revision: https://secure.phabricator.com/D3845

src/workflow/ArcanistCommitWorkflow.php

index 8551b0d0782f1a5fd556f00ebcd952d068ca7bd6..aaceec5c2478581cd8e03d18f980feeb870c73f5 100644 (file)
@@ -261,7 +261,10 @@ EOTEXT
       $this->promptFileWarning($prefix, $prompt, $do_not_exist);
     }
 
-    $files = array_keys($commit_paths);
+    $files = array();
+    foreach ($commit_paths as $file => $ignored) {
+      $files[] = $file.'@'; // make SVN accept commits like foo@2x.png
+    }
 
     if (empty($files)) {
       throw new ArcanistUsageException(