diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2022,7 +2022,6 @@ 'PhabricatorRepositoryGraphStream' => 'applications/repository/daemon/PhabricatorRepositoryGraphStream.php', 'PhabricatorRepositoryListController' => 'applications/repository/controller/PhabricatorRepositoryListController.php', 'PhabricatorRepositoryManagementCacheWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php', - 'PhabricatorRepositoryManagementDeleteWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementDeleteWorkflow.php', 'PhabricatorRepositoryManagementDiscoverWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php', 'PhabricatorRepositoryManagementEditWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php', 'PhabricatorRepositoryManagementImportingWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php', @@ -4831,6 +4830,7 @@ 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorFlaggableInterface', 3 => 'PhabricatorMarkupInterface', + 4 => 'PhabricatorDestructableInterface', ), 'PhabricatorRepositoryArcanistProject' => array( @@ -4872,7 +4872,6 @@ 'PhabricatorRepositoryGraphStream' => 'Phobject', 'PhabricatorRepositoryListController' => 'PhabricatorRepositoryController', 'PhabricatorRepositoryManagementCacheWorkflow' => 'PhabricatorRepositoryManagementWorkflow', - 'PhabricatorRepositoryManagementDeleteWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 'PhabricatorRepositoryManagementDiscoverWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 'PhabricatorRepositoryManagementEditWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 'PhabricatorRepositoryManagementImportingWorkflow' => 'PhabricatorRepositoryManagementWorkflow', diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php --- a/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php @@ -29,7 +29,7 @@ 'If you really want to delete the repository, run this command from '. 'the command line:'); $command = csprintf( - 'phabricator/ $ ./bin/repository delete %s', + 'phabricator/ $ ./bin/remove destroy %s', $repository->getCallsign()); $text_2 = pht('Repositories touch many objects and as such deletes are '. 'prohibitively expensive to run from the web UI.'); diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementDeleteWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementDeleteWorkflow.php deleted file mode 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementDeleteWorkflow.php +++ /dev/null @@ -1,64 +0,0 @@ -setName('delete') - ->setExamples('**delete** __repository__ ...') - ->setSynopsis('Delete __repository__, named by callsign.') - ->setArguments( - array( - array( - 'name' => 'verbose', - 'help' => 'Show additional debugging information.', - ), - array( - 'name' => 'force', - 'help' => 'Do not prompt for confirmation.', - ), - array( - 'name' => 'repos', - 'wildcard' => true, - ), - )); - } - - public function execute(PhutilArgumentParser $args) { - $repos = $this->loadRepositories($args, 'repos'); - - if (!$repos) { - throw new PhutilArgumentUsageException( - "Specify one or more repositories to delete, by callsign."); - } - - $console = PhutilConsole::getConsole(); - - if (!$args->getArg('force')) { - $console->writeOut("%s\n\n", pht('These repositories will be deleted:')); - - foreach ($repos as $repo) { - $console->writeOut( - " %s %s\n", - 'r'.$repo->getCallsign(), - $repo->getName()); - } - - $prompt = pht('Permanently delete these repositories?'); - if (!$console->confirm($prompt)) { - return 1; - } - } - - foreach ($repos as $repo) { - $console->writeOut("Deleting '%s'...\n", $repo->getCallsign()); - $repo->delete(); - } - - $console->writeOut("Done.\n"); - - return 0; - } - -} diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -7,7 +7,8 @@ implements PhabricatorPolicyInterface, PhabricatorFlaggableInterface, - PhabricatorMarkupInterface { + PhabricatorMarkupInterface, + PhabricatorDestructableInterface { /** * Shortest hash we'll recognize in raw "a829f32" form. @@ -1322,4 +1323,15 @@ return true; } + +/* -( PhabricatorDestructableInterface )----------------------------------- */ + + public function destroyObjectPermanently( + PhabricatorDestructionEngine $engine) { + + $this->openTransaction(); + $this->delete(); + $this->saveTransaction(); + } + }