You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2018/01/25 15:13:20 UTC

mesos git commit: Displayed all needed commands in apply-reviews script dry-run mode.

Repository: mesos
Updated Branches:
  refs/heads/master 69c918a72 -> 2b3423894


Displayed all needed commands in apply-reviews script dry-run mode.

This patch adds a shell command to create a file containing the commit
message for dry-run mode. To minimize platform differences we use
`printf` instead of `echo`. We output the message on a single line
for compactness.

Review: https://reviews.apache.org/r/65189/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2b342389
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2b342389
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2b342389

Branch: refs/heads/master
Commit: 2b3423894af57cb3319aa46e515ab25c552b6695
Parents: 69c918a
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Thu Jan 25 16:07:50 2018 +0100
Committer: Benjamin Bannier <bb...@apache.org>
Committed: Thu Jan 25 16:07:50 2018 +0100

----------------------------------------------------------------------
 support/apply-reviews.py | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2b342389/support/apply-reviews.py
----------------------------------------------------------------------
diff --git a/support/apply-reviews.py b/support/apply-reviews.py
index 30b6479..9fc1579 100755
--- a/support/apply-reviews.py
+++ b/support/apply-reviews.py
@@ -26,6 +26,7 @@ import atexit
 import json
 import linecache
 import os
+import pipes
 import platform
 import re
 import ssl
@@ -268,6 +269,13 @@ def commit_patch(options):
         lambda: os.path.exists(message_file) and os.remove(message_file))
 
     with open(message_file, 'w') as message:
+        # Add a shell command creating the message file for dry-run mode.
+        if options["dry_run"]:
+            shell(
+                "printf {msg} > {file}".format(
+                    msg=pipes.quote(data['message']).replace('\n', '\\n'),
+                    file=message_file),
+                True)
         message.write(data['message'])
 
     cmd = u'git commit' \