]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Updated arc land workflow to use temp file approach for messages to avoid newline...
authorMarke Hallowell <indiefan@gmail.com>
Wed, 2 May 2012 23:48:44 +0000 (16:48 -0700)
committerepriestley <git@epriestley.com>
Wed, 2 May 2012 23:48:49 +0000 (16:48 -0700)
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

src/workflow/land/ArcanistLandWorkflow.php
src/workflow/land/__init__.php

index a5cf3ed1edfece874a046dff909d370fdea15358..07849567aa11d3e259ff725209e3712bfa7f73f1 100644 (file)
@@ -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",
index 7db219ca618c69707c41d05696aaa9bf226797ea..3d29729f97d54046131e21883430b810c707fba3 100644 (file)
@@ -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');