@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Change bin/storage destroy to be less scary when removing test data

Summary: I've pulled up this code probably three different times to make sure that the big scary warning does, in fact, still get printed even when passing `--unitest-fixtures` to `bin/storage destroy`. Make the warning message less scary if only removing test data.

Test Plan: Ran with and without `--unitest-fixtures` and saw expected warnings. After agreeing to warnings, test data was deleted as expected. Did not test `bin/storage destroy` without `--unittest-fixtures`.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D19535

+25 -13
+25 -13
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDestroyWorkflow.php
··· 24 24 $console = PhutilConsole::getConsole(); 25 25 26 26 if (!$this->isDryRun() && !$this->isForce()) { 27 - $console->writeOut( 28 - phutil_console_wrap( 29 - pht( 30 - 'Are you completely sure you really want to permanently destroy '. 31 - 'all storage for Phabricator data? This operation can not be '. 32 - 'undone and your data will not be recoverable if you proceed.'))); 27 + if ($args->getArg('unittest-fixtures')) { 28 + $console->writeOut( 29 + phutil_console_wrap( 30 + pht( 31 + 'Are you completely sure you really want to destroy all unit '. 32 + 'test fixure data? This operation can not be undone.'))); 33 + if (!phutil_console_confirm(pht('Destroy all unit test data?'))) { 34 + $console->writeOut("%s\n", pht('Cancelled.')); 35 + exit(1); 36 + } 37 + } else { 38 + $console->writeOut( 39 + phutil_console_wrap( 40 + pht( 41 + 'Are you completely sure you really want to permanently destroy '. 42 + 'all storage for Phabricator data? This operation can not be '. 43 + 'undone and your data will not be recoverable if you proceed.'))); 33 44 34 - if (!phutil_console_confirm(pht('Permanently destroy all data?'))) { 35 - $console->writeOut("%s\n", pht('Cancelled.')); 36 - exit(1); 37 - } 45 + if (!phutil_console_confirm(pht('Permanently destroy all data?'))) { 46 + $console->writeOut("%s\n", pht('Cancelled.')); 47 + exit(1); 48 + } 38 49 39 - if (!phutil_console_confirm(pht('Really destroy all data forever?'))) { 40 - $console->writeOut("%s\n", pht('Cancelled.')); 41 - exit(1); 50 + if (!phutil_console_confirm(pht('Really destroy all data forever?'))) { 51 + $console->writeOut("%s\n", pht('Cancelled.')); 52 + exit(1); 53 + } 42 54 } 43 55 } 44 56