From: vrana Date: Fri, 4 May 2012 07:08:42 +0000 (-0700) Subject: Don't ask user to use saved message in `arc diff --verbatim` X-Git-Tag: conduit-4~25 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=299c673b7c279f1843251ac36e89d9257f0e7458;p=arcanist.git 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 --- 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'); - - $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 (!$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); + + 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'); + } } }