From: Marke Hallowell Date: Wed, 2 May 2012 23:48:44 +0000 (-0700) Subject: Updated arc land workflow to use temp file approach for messages to avoid newline... X-Git-Tag: conduit-4~27 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=4645204c11eb7706f39851fb698564dc9237e7fe;p=arcanist.git Updated arc land workflow to use temp file approach for messages to avoid newline escaping issue in windows. Test Plan: Ran arc land locally with both the mutable default option and with the --merge flag to ensure that messages are set properly. Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2372 --- diff --git a/src/workflow/land/ArcanistLandWorkflow.php b/src/workflow/land/ArcanistLandWorkflow.php index a5cf3ed1..07849567 100644 --- a/src/workflow/land/ArcanistLandWorkflow.php +++ b/src/workflow/land/ArcanistLandWorkflow.php @@ -262,8 +262,7 @@ EOTEXT // the right message. chdir($repository_api->getPath()); $err = phutil_passthru( - 'git merge --no-ff -m %s %s', - $message, + 'git merge --no-ff --no-commit %s', $branch); if ($err) { throw new ArcanistUsageException( @@ -276,11 +275,14 @@ EOTEXT $repository_api->execxLocal( 'merge --squash --ff-only %s', $branch); - $repository_api->execxLocal( - 'commit -m %s', - $message); } + $tmp_file = new TempFile(); + Filesystem::writeFile($tmp_file, $message); + $repository_api->execxLocal( + 'commit -F %s', + $tmp_file); + if ($this->getArgument('hold')) { echo phutil_console_format( "Holding change in **%s**: it has NOT been pushed yet.\n", diff --git a/src/workflow/land/__init__.php b/src/workflow/land/__init__.php index 7db219ca..3d29729f 100644 --- a/src/workflow/land/__init__.php +++ b/src/workflow/land/__init__.php @@ -12,6 +12,8 @@ phutil_require_module('arcanist', 'exception/usage/userabort'); phutil_require_module('arcanist', 'workflow/base'); phutil_require_module('phutil', 'console'); +phutil_require_module('phutil', 'filesystem'); +phutil_require_module('phutil', 'filesystem/tempfile'); phutil_require_module('phutil', 'future/exec'); phutil_require_module('phutil', 'utils'); phutil_require_module('phutil', 'xsprintf/csprintf');