From a6221ea166cf06e4633a69efe9b83f630425e924 Mon Sep 17 00:00:00 2001 From: vrana Date: Wed, 26 Sep 2012 10:24:10 -0700 Subject: [PATCH] Patch 'unix:filemode' property as 'svn:executable' in SVN 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php index 7caab84b..4224c23c 100644 --- a/src/workflow/ArcanistPatchWorkflow.php +++ b/src/workflow/ArcanistPatchWorkflow.php @@ -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( -- 2.43.0