]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Patch 'unix:filemode' property as 'svn:executable' in SVN
authorvrana <jakubv@fb.com>
Wed, 26 Sep 2012 17:24:10 +0000 (10:24 -0700)
committervrana <jakubv@fb.com>
Thu, 27 Sep 2012 17:13:17 +0000 (10:13 -0700)
Summary: Patch created on Git contains 'unix:filemode' property which is useless in SVN.

Test Plan: Exported a bundle changing a file to executable in Git, applied it in SVN, verified that the file is executable.

Reviewers: epriestley

Reviewed By: epriestley

CC: ptarjan, aran, Korvin, digoangeline
Differential Revision: https://secure.phabricator.com/D3554

src/workflow/ArcanistPatchWorkflow.php

index 7caab84b54ed76be917f66fe9b35f35a42f28473..4224c23c468dac23d2cf275cdc5e998547ea6b6b 100644 (file)
@@ -632,8 +632,11 @@ EOTEXT
 
       foreach ($propset as $path => $changes) {
         foreach ($changes as $prop => $value) {
-          // TODO: Probably need to handle svn:executable specially here by
-          // doing chmod +x or -x.
+          if ($prop == 'unix:filemode') {
+            // Setting this property also changes the file mode.
+            $prop = 'svn:executable';
+            $value = (octdec($value) & 0111 ? 'on' : null);
+          }
           if ($value === null) {
             passthru(
               csprintf(