mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-22 19:49:01 +01:00
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
This commit is contained in:
parent
4d1e5b1b74
commit
299c673b7c
1 changed files with 25 additions and 23 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue