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

Remove "bin/repository edit" workflow

Summary:
Ref T10748. In D14250#158181, I accepted this conditional on removing it once Conduit could handle it.

Conduit can now handle it, or at least will be able to as soon as T10748 cuts over.

Test Plan: Grepped for `repository edit`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10748

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

-126
-2
src/__phutil_library_map__.php
··· 3190 3190 'PhabricatorRepositoryManagementCacheWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php', 3191 3191 'PhabricatorRepositoryManagementClusterizeWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementClusterizeWorkflow.php', 3192 3192 'PhabricatorRepositoryManagementDiscoverWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php', 3193 - 'PhabricatorRepositoryManagementEditWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php', 3194 3193 'PhabricatorRepositoryManagementImportingWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php', 3195 3194 'PhabricatorRepositoryManagementListPathsWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementListPathsWorkflow.php', 3196 3195 'PhabricatorRepositoryManagementListWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php', ··· 7867 7866 'PhabricatorRepositoryManagementCacheWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 7868 7867 'PhabricatorRepositoryManagementClusterizeWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 7869 7868 'PhabricatorRepositoryManagementDiscoverWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 7870 - 'PhabricatorRepositoryManagementEditWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 7871 7869 'PhabricatorRepositoryManagementImportingWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 7872 7870 'PhabricatorRepositoryManagementListPathsWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 7873 7871 'PhabricatorRepositoryManagementListWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
-124
src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
··· 1 - <?php 2 - 3 - final class PhabricatorRepositoryManagementEditWorkflow 4 - extends PhabricatorRepositoryManagementWorkflow { 5 - 6 - protected function didConstruct() { 7 - $this 8 - ->setName('edit') 9 - ->setExamples('**edit** --as __username__ __repository__ ...') 10 - ->setSynopsis( 11 - pht( 12 - 'Edit __repository__ (will eventually be deprecated by Conduit).')) 13 - ->setArguments( 14 - array( 15 - array( 16 - 'name' => 'repos', 17 - 'wildcard' => true, 18 - ), 19 - array( 20 - 'name' => 'as', 21 - 'param' => 'user', 22 - 'help' => pht('Edit as user.'), 23 - ), 24 - array( 25 - 'name' => 'serve-http', 26 - 'param' => 'string', 27 - 'help' => pht('Edit the http serving policy.'), 28 - ), 29 - array( 30 - 'name' => 'serve-ssh', 31 - 'param' => 'string', 32 - 'help' => pht('Edit the ssh serving policy.'), 33 - ), 34 - )); 35 - } 36 - 37 - public function execute(PhutilArgumentParser $args) { 38 - $repos = $this->loadRepositories($args, 'repos'); 39 - 40 - if (!$repos) { 41 - throw new PhutilArgumentUsageException( 42 - pht('Specify one or more repositories to edit.')); 43 - } 44 - 45 - $console = PhutilConsole::getConsole(); 46 - 47 - // TODO: It would be nice to just take this action as "Administrator" or 48 - // similar, since that would make it easier to use this script, harder to 49 - // impersonate users, and more clear to viewers what happened. However, 50 - // the omnipotent user doesn't have a PHID right now, can't be loaded, 51 - // doesn't have a handle, etc. Adding all of that is fairly involved, and 52 - // I want to wait for stronger use cases first. 53 - 54 - $username = $args->getArg('as'); 55 - if (!$username) { 56 - throw new PhutilArgumentUsageException( 57 - pht( 58 - 'Specify a user to edit as with %s.', 59 - '--as <username>')); 60 - } 61 - 62 - $actor = id(new PhabricatorPeopleQuery()) 63 - ->setViewer($this->getViewer()) 64 - ->withUsernames(array($username)) 65 - ->executeOne(); 66 - 67 - if (!$actor) { 68 - throw new PhutilArgumentUsageException( 69 - pht("No such user '%s'!", $username)); 70 - } 71 - 72 - foreach ($repos as $repo) { 73 - $console->writeOut( 74 - "%s\n", 75 - pht( 76 - 'Editing "%s"...', 77 - $repo->getDisplayName())); 78 - 79 - $xactions = array(); 80 - 81 - $type_protocol_http = 82 - PhabricatorRepositoryTransaction::TYPE_PROTOCOL_HTTP; 83 - $type_protocol_ssh = PhabricatorRepositoryTransaction::TYPE_PROTOCOL_SSH; 84 - $allowed_serve_modes = array( 85 - PhabricatorRepository::SERVE_OFF, 86 - PhabricatorRepository::SERVE_READONLY, 87 - PhabricatorRepository::SERVE_READWRITE, 88 - ); 89 - 90 - $serve_http = $args->getArg('serve-http'); 91 - if ($serve_http && in_array($serve_http, $allowed_serve_modes)) { 92 - $xactions[] = id(new PhabricatorRepositoryTransaction()) 93 - ->setTransactionType($type_protocol_http) 94 - ->setNewValue($serve_http); 95 - } 96 - $serve_ssh = $args->getArg('serve-ssh'); 97 - if ($serve_ssh && in_array($serve_ssh, $allowed_serve_modes)) { 98 - $xactions[] = id(new PhabricatorRepositoryTransaction()) 99 - ->setTransactionType($type_protocol_ssh) 100 - ->setNewValue($serve_ssh); 101 - } 102 - 103 - 104 - if (!$xactions) { 105 - throw new PhutilArgumentUsageException( 106 - pht('Specify one or more fields to edit!')); 107 - } 108 - 109 - $content_source = $this->newContentSource(); 110 - 111 - $editor = id(new PhabricatorRepositoryEditor()) 112 - ->setActor($actor) 113 - ->setContentSource($content_source) 114 - ->setContinueOnNoEffect(true) 115 - ->setContinueOnMissingFields(true) 116 - ->applyTransactions($repo, $xactions); 117 - } 118 - 119 - $console->writeOut("%s\n", pht('Done.')); 120 - 121 - return 0; 122 - } 123 - 124 - }