@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.

Fix repository deletion

Summary:
I never actually wrote this controller.

Test Plan:
Deleted a repository via web UI.

Reviewed By: tuomaspelkonen
Reviewers: tuomaspelkonen, jungejason, aran
Commenters: aran
CC: aran, tuomaspelkonen, epriestley
Differential Revision: 231

+81 -1
+2
src/__phutil_library_map__.php
··· 402 402 'PhabricatorRepositoryDAO' => 'applications/repository/storage/base', 403 403 'PhabricatorRepositoryDaemon' => 'applications/repository/daemon/base', 404 404 'PhabricatorRepositoryDefaultCommitMessageDetailParser' => 'applications/repository/parser/default', 405 + 'PhabricatorRepositoryDeleteController' => 'applications/repository/controller/delete', 405 406 'PhabricatorRepositoryEditController' => 'applications/repository/controller/edit', 406 407 'PhabricatorRepositoryGitCommitChangeParserWorker' => 'applications/repository/worker/commitchangeparser/git', 407 408 'PhabricatorRepositoryGitCommitDiscoveryDaemon' => 'applications/repository/daemon/commitdiscovery/git', ··· 804 805 'PhabricatorRepositoryDAO' => 'PhabricatorLiskDAO', 805 806 'PhabricatorRepositoryDaemon' => 'PhabricatorDaemon', 806 807 'PhabricatorRepositoryDefaultCommitMessageDetailParser' => 'PhabricatorRepositoryCommitMessageDetailParser', 808 + 'PhabricatorRepositoryDeleteController' => 'PhabricatorRepositoryController', 807 809 'PhabricatorRepositoryEditController' => 'PhabricatorRepositoryController', 808 810 'PhabricatorRepositoryGitCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker', 809 811 'PhabricatorRepositoryGitCommitDiscoveryDaemon' => 'PhabricatorRepositoryCommitDiscoveryDaemon',
+56
src/applications/repository/controller/delete/PhabricatorRepositoryDeleteController.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2011 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + class PhabricatorRepositoryDeleteController 20 + extends PhabricatorRepositoryController { 21 + 22 + private $id; 23 + 24 + public function willProcessRequest(array $data) { 25 + $this->id = $data['id']; 26 + } 27 + 28 + public function processRequest() { 29 + 30 + $repository = id(new PhabricatorRepository())->load($this->id); 31 + if (!$repository) { 32 + return new Aphront404Response(); 33 + } 34 + 35 + $request = $this->getRequest(); 36 + 37 + if ($request->isDialogFormPost()) { 38 + $repository->delete(); 39 + return id(new AphrontRedirectResponse())->setURI('/repository/'); 40 + } 41 + 42 + $dialog = new AphrontDialogView(); 43 + $dialog 44 + ->setUser($request->getUser()) 45 + ->setTitle('Really delete repository?') 46 + ->appendChild( 47 + '<p>Really delete the "'.phutil_escape_html($repository->getName()). 48 + '" ('.phutil_escape_html($repository->getCallsign()).') repository? '. 49 + 'This operation can not be undone.</p>') 50 + ->setSubmitURI('/repository/delete/'.$this->id.'/') 51 + ->addSubmitButton('Delete Repository') 52 + ->addCancelButton('/repository/'); 53 + 54 + return id(new AphrontDialogResponse())->setDialog($dialog); 55 + } 56 + }
+20
src/applications/repository/controller/delete/__init__.php
··· 1 + <?php 2 + /** 3 + * This file is automatically generated. Lint this module to rebuild it. 4 + * @generated 5 + */ 6 + 7 + 8 + 9 + phutil_require_module('phabricator', 'aphront/response/404'); 10 + phutil_require_module('phabricator', 'aphront/response/dialog'); 11 + phutil_require_module('phabricator', 'aphront/response/redirect'); 12 + phutil_require_module('phabricator', 'applications/repository/controller/base'); 13 + phutil_require_module('phabricator', 'applications/repository/storage/repository'); 14 + phutil_require_module('phabricator', 'view/dialog'); 15 + 16 + phutil_require_module('phutil', 'markup'); 17 + phutil_require_module('phutil', 'utils'); 18 + 19 + 20 + phutil_require_source('PhabricatorRepositoryDeleteController.php');
+2 -1
src/applications/repository/controller/list/PhabricatorRepositoryListController.php
··· 51 51 'href' => '/repository/edit/'.$repo->getID().'/', 52 52 ), 53 53 'Edit'), 54 - phutil_render_tag( 54 + javelin_render_tag( 55 55 'a', 56 56 array( 57 57 'class' => 'button small grey', 58 58 'href' => '/repository/delete/'.$repo->getID().'/', 59 + 'sigil' => 'workflow', 59 60 ), 60 61 'Delete'), 61 62 );
+1
src/applications/repository/controller/list/__init__.php
··· 10 10 phutil_require_module('phabricator', 'applications/repository/controller/base'); 11 11 phutil_require_module('phabricator', 'applications/repository/storage/arcanistproject'); 12 12 phutil_require_module('phabricator', 'applications/repository/storage/repository'); 13 + phutil_require_module('phabricator', 'infrastructure/javelin/markup'); 13 14 phutil_require_module('phabricator', 'view/control/table'); 14 15 phutil_require_module('phabricator', 'view/layout/panel'); 15 16