From 299c673b7c279f1843251ac36e89d9257f0e7458 Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 4 May 2012 00:08:42 -0700 Subject: [PATCH] Don't ask user to use saved message in `arc diff --verbatim` Test Plan: Cancel `arc diff`. Verify that the message is created. Run `arc diff --verbatim` and see no reuse message question. Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2390 --- src/workflow/diff/ArcanistDiffWorkflow.php | 48 +++++++++++----------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/workflow/diff/ArcanistDiffWorkflow.php b/src/workflow/diff/ArcanistDiffWorkflow.php index c3f38e5f..283bdab7 100644 --- a/src/workflow/diff/ArcanistDiffWorkflow.php +++ b/src/workflow/diff/ArcanistDiffWorkflow.php @@ -1290,33 +1290,35 @@ EOTEXT $template = null; - $saved = $this->readScratchFile('create-message'); - if ($saved) { - $where = $this->getReadableScratchFilePath('create-message'); + if (!$this->getArgument('verbatim')) { + $saved = $this->readScratchFile('create-message'); + if ($saved) { + $where = $this->getReadableScratchFilePath('create-message'); - $preview = explode("\n", $saved); - $preview = array_shift($preview); - $preview = trim($preview); - $preview = phutil_utf8_shorten($preview, 64); + $preview = explode("\n", $saved); + $preview = array_shift($preview); + $preview = trim($preview); + $preview = phutil_utf8_shorten($preview, 64); - if ($preview) { - $preview = "Message begins:\n\n {$preview}\n\n"; - } else { - $preview = null; - } + if ($preview) { + $preview = "Message begins:\n\n {$preview}\n\n"; + } else { + $preview = null; + } - echo - "You have a saved revision message in '{$where}'.\n". - "{$preview}". - "You can use this message, or discard it."; + echo + "You have a saved revision message in '{$where}'.\n". + "{$preview}". + "You can use this message, or discard it."; - $use = phutil_console_confirm( - "Do you want to use this message?", - $default_no = false); - if ($use) { - $template = $saved; - } else { - $this->removeScratchFile('create-message'); + $use = phutil_console_confirm( + "Do you want to use this message?", + $default_no = false); + if ($use) { + $template = $saved; + } else { + $this->removeScratchFile('create-message'); + } } }