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

Search Symbols by Repository, not Project

Summary:
Fixes T7977.
- Move Indexed Languages and See Symbols From config to Repository
- Make symbol search skip projects

This also makes the default languages to Everything instead of Nothing.

Test Plan:
- Browse files, click symbols.
- Use quick search to find symbols
- Browse revision, click symbols

Reviewers: joshuaspence, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7977

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

authored by

Aviv Eyal and committed by
epriestley
898ce6ba 79e8d9fc

+336 -83
+68
resources/sql/autopatches/20150504.symbolsproject.1.php
··· 1 + <?php 2 + 3 + $table_w = new PhabricatorRepository(); 4 + $conn_w = $table_w->establishConnection('w'); 5 + 6 + // Repository and Project share a database. 7 + $conn_r = $table_w->establishConnection('r'); 8 + $projects_table = 'repository_arcanistproject'; 9 + 10 + $raw_projects_data = queryfx_all($conn_r, 'SELECT * FROM %T', $projects_table); 11 + $raw_projects_data = ipull($raw_projects_data, null, 'id'); 12 + 13 + $repository_ids = ipull($raw_projects_data, 'repositoryID'); 14 + $repositories = id(new PhabricatorRepositoryQuery()) 15 + ->setViewer(PhabricatorUser::getOmnipotentUser()) 16 + ->withIDs($repository_ids) 17 + ->execute(); 18 + 19 + $projects_to_repo_ids_map = ipull($raw_projects_data, 'repositoryID', 'phid'); 20 + $projects_to_repos_map = array(); 21 + foreach ($projects_to_repo_ids_map as $projectPHID => $repositoryID) { 22 + $repo = idx($repositories, $repositoryID); 23 + if ($repo) { 24 + $projects_to_repos_map[$projectPHID] = $repo->getPHID(); 25 + } 26 + } 27 + 28 + foreach ($raw_projects_data as $project_row) { 29 + $repositoryID = idx($project_row, 'repositoryID'); 30 + $repo = idx($repositories, $repositoryID); 31 + 32 + if (!$repo) { 33 + continue; 34 + } 35 + 36 + echo pht( 37 + "Migrating symbols configuration for '%s' project...\n", 38 + idx($project_row, 'name', '???')); 39 + 40 + $symbol_index_projects = $project_row['symbolIndexProjects']; 41 + $symbol_index_projects = phutil_json_decode($symbol_index_projects); 42 + 43 + $sources = $repo->getDetail('symbol-sources', array()); 44 + foreach ($symbol_index_projects as $index_project) { 45 + $sources[] = idx($projects_to_repos_map, $index_project); 46 + } 47 + $sources = array_filter($sources); 48 + $sources = array_unique($sources); 49 + 50 + $repo->setDetail('symbol-sources', $sources); 51 + 52 + $languages = $project_row['symbolIndexLanguages']; 53 + $languages = phutil_json_decode($languages); 54 + 55 + $languages = array_merge( 56 + $repo->getDetail('symbol-languages', array()), 57 + $languages); 58 + $languages = array_unique($languages); 59 + 60 + $repo->setDetail('symbol-languages', $languages); 61 + 62 + queryfx( 63 + $conn_w, 64 + 'UPDATE %T SET details = %s WHERE id = %d', 65 + $table_w->getTableName(), 66 + json_encode($repo->getDetails()), 67 + $repo->getID()); 68 + }
+3
resources/sql/autopatches/20150504.symbolsproject.2.sql
··· 1 + ALTER TABLE {$NAMESPACE}_repository.repository_arcanistproject 2 + DROP COLUMN symbolIndexLanguages, 3 + DROP COLUMN symbolIndexProjects;
+2
src/__phutil_library_map__.php
··· 605 605 'DiffusionRepositoryPath' => 'applications/diffusion/data/DiffusionRepositoryPath.php', 606 606 'DiffusionRepositoryRef' => 'applications/diffusion/data/DiffusionRepositoryRef.php', 607 607 'DiffusionRepositoryRemarkupRule' => 'applications/diffusion/remarkup/DiffusionRepositoryRemarkupRule.php', 608 + 'DiffusionRepositorySymbolsController' => 'applications/diffusion/controller/DiffusionRepositorySymbolsController.php', 608 609 'DiffusionRepositoryTag' => 'applications/diffusion/data/DiffusionRepositoryTag.php', 609 610 'DiffusionRequest' => 'applications/diffusion/request/DiffusionRequest.php', 610 611 'DiffusionResolveRefsConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionResolveRefsConduitAPIMethod.php', ··· 3847 3848 'DiffusionRepositoryNewController' => 'DiffusionController', 3848 3849 'DiffusionRepositoryRef' => 'Phobject', 3849 3850 'DiffusionRepositoryRemarkupRule' => 'PhabricatorObjectRemarkupRule', 3851 + 'DiffusionRepositorySymbolsController' => 'DiffusionRepositoryEditController', 3850 3852 'DiffusionResolveRefsConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod', 3851 3853 'DiffusionResolveUserQuery' => 'Phobject', 3852 3854 'DiffusionSSHWorkflow' => 'PhabricatorSSHWorkflow',
+17 -19
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 260 260 'whitespace', 261 261 DifferentialChangesetParser::WHITESPACE_IGNORE_MOST); 262 262 263 - $arc_project = $target->getArcanistProject(); 264 - if ($arc_project) { 265 - list($symbol_indexes, $project_phids) = $this->buildSymbolIndexes( 266 - $arc_project, 263 + $repository = $revision->getRepository(); 264 + if ($repository) { 265 + list($symbol_indexes, $repository_phids) = $this->buildSymbolIndexes( 266 + $repository, 267 267 $visible_changesets); 268 268 } else { 269 269 $symbol_indexes = array(); 270 - $project_phids = null; 270 + $repository_phids = null; 271 271 } 272 272 273 273 $revision_detail->setActions($actions); ··· 307 307 ), 308 308 $comment_view); 309 309 310 - if ($arc_project) { 310 + if ($repository) { 311 311 Javelin::initBehavior( 312 312 'repository-crossreference', 313 313 array( 314 314 'section' => $wrap_id, 315 - 'projects' => $project_phids, 315 + 'repositories' => $repository_phids, 316 316 )); 317 317 } 318 318 ··· 750 750 } 751 751 752 752 private function buildSymbolIndexes( 753 - PhabricatorRepositoryArcanistProject $arc_project, 753 + PhabricatorRepository $repository, 754 754 array $visible_changesets) { 755 755 assert_instances_of($visible_changesets, 'DifferentialChangeset'); 756 756 757 757 $engine = PhabricatorSyntaxHighlighter::newEngine(); 758 758 759 - $langs = $arc_project->getSymbolIndexLanguages(); 760 - if (!$langs) { 761 - return array(array(), array()); 762 - } 759 + $langs = $repository->getSymbolLanguages(); 760 + $langs = nonempty($langs, array()); 763 761 764 762 $symbol_indexes = array(); 765 763 766 - $project_phids = array_merge( 767 - array($arc_project->getPHID()), 768 - nonempty($arc_project->getSymbolIndexProjects(), array())); 764 + $repository_phids = array_merge( 765 + array($repository->getPHID()), 766 + nonempty($repository->getSymbolSources(), array())); 769 767 770 768 $indexed_langs = array_fill_keys($langs, true); 771 769 foreach ($visible_changesets as $key => $changeset) { 772 770 $lang = $engine->getLanguageFromFilename($changeset->getFilename()); 773 - if (isset($indexed_langs[$lang])) { 771 + if (empty($indexed_langs) || isset($indexed_langs[$lang])) { 774 772 $symbol_indexes[$key] = array( 775 - 'lang' => $lang, 776 - 'projects' => $project_phids, 773 + 'lang' => $lang, 774 + 'repositories' => $repository_phids, 777 775 ); 778 776 } 779 777 } 780 778 781 - return array($symbol_indexes, $project_phids); 779 + return array($symbol_indexes, $repository_phids); 782 780 } 783 781 784 782 private function loadOtherRevisions(
+1
src/applications/diffusion/application/PhabricatorDiffusionApplication.php
··· 100 100 'hosting/' => 'DiffusionRepositoryEditHostingController', 101 101 '(?P<serve>serve)/' => 'DiffusionRepositoryEditHostingController', 102 102 'update/' => 'DiffusionRepositoryEditUpdateController', 103 + 'symbol/' => 'DiffusionRepositorySymbolsController', 103 104 ), 104 105 'pathtree/(?P<dblob>.*)' => 'DiffusionPathTreeController', 105 106 'mirror/' => array(
+7 -19
src/applications/diffusion/controller/DiffusionBrowseFileController.php
··· 266 266 267 267 $id = celerity_generate_unique_node_id(); 268 268 269 - $projects = $drequest->loadArcanistProjects(); 270 - $langs = array(); 271 - foreach ($projects as $project) { 272 - $ls = $project->getSymbolIndexLanguages(); 273 - if (!$ls) { 274 - continue; 275 - } 276 - $dep_projects = $project->getSymbolIndexProjects(); 277 - $dep_projects[] = $project->getPHID(); 278 - foreach ($ls as $lang) { 279 - if (!isset($langs[$lang])) { 280 - $langs[$lang] = array(); 281 - } 282 - $langs[$lang] += $dep_projects + array($project); 283 - } 284 - } 269 + $repo = $drequest->getRepository(); 270 + $symbol_repos = $repo->getSymbolSources(); 271 + $symbol_repos[] = $repo; 285 272 286 273 $lang = last(explode('.', $drequest->getPath())); 287 - 288 - if (isset($langs[$lang])) { 274 + $repo_languages = $repo->getSymbolLanguages(); 275 + $repo_languages = array_fill_keys($repo_languages, true); 276 + if (empty($repo_languages) || isset($repo_languages[$lang])) { 289 277 Javelin::initBehavior( 290 278 'repository-crossreference', 291 279 array( 292 280 'container' => $id, 293 281 'lang' => $lang, 294 - 'projects' => $langs[$lang], 282 + 'repositories' => $symbol_repos, 295 283 )); 296 284 } 297 285
+55
src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
··· 62 62 $encoding_properties = 63 63 $this->buildEncodingProperties($repository, $encoding_actions); 64 64 65 + $symbols_actions = $this->buildSymbolsActions($repository); 66 + $symbols_properties = 67 + $this->buildSymbolsProperties($repository, $symbols_actions); 68 + 65 69 $hosting_properties = $this->buildHostingProperties( 66 70 $repository, 67 71 $this->buildHostingActions($repository)); ··· 156 160 $boxes[] = id(new PHUIObjectBoxView()) 157 161 ->setHeaderText(pht('Text Encoding')) 158 162 ->addPropertyList($encoding_properties); 163 + 164 + $boxes[] = id(new PHUIObjectBoxView()) 165 + ->setHeaderText(pht('Symbols')) 166 + ->addPropertyList($symbols_properties); 159 167 160 168 if ($branches_properties) { 161 169 $boxes[] = id(new PHUIObjectBoxView()) ··· 1185 1193 } 1186 1194 1187 1195 return $mirror_list; 1196 + } 1197 + 1198 + private function buildSymbolsActions(PhabricatorRepository $repository) { 1199 + $viewer = $this->getRequest()->getUser(); 1200 + 1201 + $view = id(new PhabricatorActionListView()) 1202 + ->setObjectURI($this->getRequest()->getRequestURI()) 1203 + ->setUser($viewer); 1204 + 1205 + $edit = id(new PhabricatorActionView()) 1206 + ->setIcon('fa-pencil') 1207 + ->setName(pht('Edit Symbols')) 1208 + ->setHref( 1209 + $this->getRepositoryControllerURI($repository, 'edit/symbol/')); 1210 + $view->addAction($edit); 1211 + 1212 + return $view; 1213 + } 1214 + 1215 + private function buildSymbolsProperties( 1216 + PhabricatorRepository $repository, 1217 + PhabricatorActionListView $actions) { 1218 + 1219 + $viewer = $this->getRequest()->getUser(); 1220 + 1221 + $view = id(new PHUIPropertyListView()) 1222 + ->setUser($viewer) 1223 + ->setActionList($actions); 1224 + 1225 + $languages = $repository->getSymbolLanguages(); 1226 + 1227 + if ($languages) { 1228 + $languages = implode(', ', $languages); 1229 + } else { 1230 + $languages = phutil_tag('em', array(), pht('Any')); 1231 + } 1232 + $view->addProperty(pht('Languages'), $languages); 1233 + 1234 + $sources = $repository->getSymbolSources(); 1235 + if ($sources) { 1236 + $handles = $viewer->loadHandles($sources); 1237 + $sources = $handles->renderList(); 1238 + } else { 1239 + $sources = phutil_tag('em', array(), pht('This Repository Only')); 1240 + } 1241 + $view->addProperty(pht('Use Symbols From'), $sources); 1242 + return $view; 1188 1243 } 1189 1244 1190 1245 private function getEnvConfigLink() {
+123
src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php
··· 1 + <?php 2 + 3 + final class DiffusionRepositorySymbolsController 4 + extends DiffusionRepositoryEditController { 5 + 6 + protected function processDiffusionRequest(AphrontRequest $request) { 7 + $user = $request->getUser(); 8 + $drequest = $this->diffusionRequest; 9 + $repository = $drequest->getRepository(); 10 + 11 + $repository = id(new PhabricatorRepositoryQuery()) 12 + ->setViewer($user) 13 + ->requireCapabilities( 14 + array( 15 + PhabricatorPolicyCapability::CAN_VIEW, 16 + PhabricatorPolicyCapability::CAN_EDIT, 17 + )) 18 + ->withIDs(array($repository->getID())) 19 + ->executeOne(); 20 + 21 + if (!$repository) { 22 + return new Aphront404Response(); 23 + } 24 + 25 + $edit_uri = $this->getRepositoryControllerURI($repository, 'edit/'); 26 + 27 + $v_sources = $repository->getSymbolSources(); 28 + $v_languages = $repository->getSymbolLanguages(); 29 + if ($v_languages) { 30 + $v_languages = implode(', ', $v_languages); 31 + } 32 + $errors = array(); 33 + 34 + if ($request->isFormPost()) { 35 + $v_sources = $request->getArr('sources'); 36 + $v_languages = $request->getStrList('languages'); 37 + $v_languages = array_map('phutil_utf8_strtolower', $v_languages); 38 + 39 + if (!$errors) { 40 + $xactions = array(); 41 + $template = id(new PhabricatorRepositoryTransaction()); 42 + 43 + $type_sources = PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES; 44 + $type_lang = PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE; 45 + 46 + $xactions[] = id(clone $template) 47 + ->setTransactionType($type_sources) 48 + ->setNewValue($v_sources); 49 + 50 + $xactions[] = id(clone $template) 51 + ->setTransactionType($type_lang) 52 + ->setNewValue($v_languages); 53 + 54 + try { 55 + id(new PhabricatorRepositoryEditor()) 56 + ->setContinueOnNoEffect(true) 57 + ->setContentSourceFromRequest($request) 58 + ->setActor($user) 59 + ->applyTransactions($repository, $xactions); 60 + 61 + return id(new AphrontRedirectResponse())->setURI($edit_uri); 62 + } catch (Exception $ex) { 63 + $errors[] = $ex->getMessage(); 64 + } 65 + } 66 + } 67 + 68 + $crumbs = $this->buildApplicationCrumbs(); 69 + $crumbs->addTextCrumb(pht('Edit Symbols')); 70 + 71 + $title = pht('Edit %s', $repository->getName()); 72 + 73 + $form = id(new AphrontFormView()) 74 + ->setUser($user) 75 + ->appendRemarkupInstructions($this->getInstructions()) 76 + ->appendChild( 77 + id(new AphrontFormTextControl()) 78 + ->setName('languages') 79 + ->setLabel(pht('Indexed Languages')) 80 + ->setCaption(pht( 81 + 'File extensions, separate with commas, for example: php, py. '. 82 + 'Leave blank for "any".')) 83 + ->setValue($v_languages)) 84 + 85 + ->appendControl( 86 + id(new AphrontFormTokenizerControl()) 87 + ->setName('sources') 88 + ->setLabel(pht('Uses Symbols From')) 89 + ->setDatasource(new DiffusionRepositoryDatasource()) 90 + ->setValue($v_sources)) 91 + 92 + ->appendChild( 93 + id(new AphrontFormSubmitControl()) 94 + ->setValue(pht('Save')) 95 + ->addCancelButton($edit_uri)); 96 + 97 + $object_box = id(new PHUIObjectBoxView()) 98 + ->setHeaderText($title) 99 + ->setForm($form) 100 + ->setFormErrors($errors); 101 + 102 + return $this->buildApplicationPage( 103 + array( 104 + $crumbs, 105 + $object_box, 106 + ), 107 + array( 108 + 'title' => $title, 109 + )); 110 + } 111 + 112 + private function getInstructions() { 113 + return pht(<<<EOT 114 + Configure Symbols for this repository. 115 + 116 + See [[%s | Symbol Indexes]] for more information on using symbols. 117 + EOT 118 + , 119 + PhabricatorEnv::getDoclink( 120 + 'Diffusion User Guide: Symbol Indexes')); 121 + } 122 + 123 + }
+1 -1
src/applications/diffusion/controller/DiffusionSymbolController.php
··· 128 128 '', 129 129 )); 130 130 $table->setNoDataString( 131 - pht('No matching symbol could be found in any indexed project.')); 131 + pht('No matching symbol could be found in any indexed repository.')); 132 132 133 133 $panel = new PHUIObjectBoxView(); 134 134 $panel->setHeaderText(pht('Similar Symbols'));
+9 -2
src/applications/diffusion/query/DiffusionSymbolQuery.php
··· 146 146 $this->loadPaths($symbols); 147 147 } 148 148 if ($this->needRepositories) { 149 - $this->loadRepositories($symbols); 149 + $symbols = $this->loadRepositories($symbols); 150 150 } 151 151 152 152 } 153 + 153 154 154 155 return $symbols; 155 156 } ··· 249 250 ->execute(); 250 251 $repos = mpull($repos, null, 'getPHID'); 251 252 253 + $visible = array(); 252 254 foreach ($symbols as $symbol) { 253 255 $repository = idx($repos, $symbol->getRepositoryPHID()); 254 - $symbol->attachRepository($repository); 256 + // repository is null mean "user can't view repo", so hide the symbol 257 + if ($repository) { 258 + $symbol->attachRepository($repository); 259 + $visible[] = $symbol; 260 + } 255 261 } 262 + return $visible; 256 263 } 257 264 258 265 }
-34
src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
··· 34 34 asort($repos); 35 35 36 36 if ($request->isFormPost()) { 37 - 38 - $indexed = $request->getStrList('symbolIndexLanguages'); 39 - $indexed = array_map('strtolower', $indexed); 40 - $project->setSymbolIndexLanguages($indexed); 41 - 42 - $project->setSymbolIndexProjects($request->getArr('symbolIndexProjects')); 43 - 44 37 $repo_id = $request->getInt('repository', 0); 45 38 if (isset($repos[$repo_id])) { 46 39 $project->setRepositoryID($repo_id); ··· 51 44 } 52 45 } 53 46 54 - $langs = $project->getSymbolIndexLanguages(); 55 - if ($langs) { 56 - $langs = implode(', ', $langs); 57 - } else { 58 - $langs = null; 59 - } 60 - 61 - if ($project->getSymbolIndexProjects()) { 62 - $uses = $project->getSymbolIndexProjects(); 63 - } else { 64 - $uses = array(); 65 - } 66 - 67 47 $form = id(new AphrontFormView()) 68 48 ->setUser($user) 69 49 ->appendChild( ··· 80 60 ->setOptions($repos) 81 61 ->setName('repository') 82 62 ->setValue($project->getRepositoryID())) 83 - ->appendChild( 84 - id(new AphrontFormTextControl()) 85 - ->setLabel(pht('Indexed Languages')) 86 - ->setName('symbolIndexLanguages') 87 - ->setCaption(pht( 88 - 'Separate with commas, for example: %s', 89 - phutil_tag('tt', array(), 'php, py'))) 90 - ->setValue($langs)) 91 - ->appendControl( 92 - id(new AphrontFormTokenizerControl()) 93 - ->setLabel(pht('Uses Symbols From')) 94 - ->setName('symbolIndexProjects') 95 - ->setDatasource(new DiffusionArcanistProjectDatasource()) 96 - ->setValue($uses)) 97 63 ->appendChild( 98 64 id(new AphrontFormSubmitControl()) 99 65 ->addCancelButton('/repository/')
+16
src/applications/repository/editor/PhabricatorRepositoryEditor.php
··· 41 41 $types[] = PhabricatorRepositoryTransaction::TYPE_DANGEROUS; 42 42 $types[] = PhabricatorRepositoryTransaction::TYPE_CLONE_NAME; 43 43 $types[] = PhabricatorRepositoryTransaction::TYPE_SERVICE; 44 + $types[] = PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE; 45 + $types[] = PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES; 44 46 45 47 $types[] = PhabricatorTransactions::TYPE_EDGE; 46 48 $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; ··· 98 100 return $object->getDetail('clone-name'); 99 101 case PhabricatorRepositoryTransaction::TYPE_SERVICE: 100 102 return $object->getAlmanacServicePHID(); 103 + case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE: 104 + return $object->getSymbolLanguages(); 105 + case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES: 106 + return $object->getSymbolSources(); 101 107 } 102 108 } 103 109 ··· 131 137 case PhabricatorRepositoryTransaction::TYPE_DANGEROUS: 132 138 case PhabricatorRepositoryTransaction::TYPE_CLONE_NAME: 133 139 case PhabricatorRepositoryTransaction::TYPE_SERVICE: 140 + case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE: 141 + case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES: 134 142 return $xaction->getNewValue(); 135 143 case PhabricatorRepositoryTransaction::TYPE_NOTIFY: 136 144 case PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE: ··· 205 213 case PhabricatorRepositoryTransaction::TYPE_SERVICE: 206 214 $object->setAlmanacServicePHID($xaction->getNewValue()); 207 215 return; 216 + case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE: 217 + $object->setDetail('symbol-languages', $xaction->getNewValue()); 218 + return; 219 + case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES: 220 + $object->setDetail('symbol-sources', $xaction->getNewValue()); 221 + return; 208 222 case PhabricatorRepositoryTransaction::TYPE_ENCODING: 209 223 // Make sure the encoding is valid by converting to UTF-8. This tests 210 224 // that the user has mbstring installed, and also that they didn't type ··· 314 328 case PhabricatorRepositoryTransaction::TYPE_DANGEROUS: 315 329 case PhabricatorRepositoryTransaction::TYPE_CLONE_NAME: 316 330 case PhabricatorRepositoryTransaction::TYPE_SERVICE: 331 + case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES: 332 + case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE: 317 333 PhabricatorPolicyFilter::requireCapability( 318 334 $this->requireActor(), 319 335 $object,
+11
src/applications/repository/storage/PhabricatorRepository.php
··· 1778 1778 } 1779 1779 1780 1780 1781 + /* -( Symbols )-------------------------------------------------------------*/ 1782 + 1783 + public function getSymbolSources() { 1784 + return $this->getDetail('symbol-sources'); 1785 + } 1786 + 1787 + public function getSymbolLanguages() { 1788 + return $this->getDetail('symbol-languages'); 1789 + } 1790 + 1791 + 1781 1792 /* -( PhabricatorApplicationTransactionInterface )------------------------- */ 1782 1793 1783 1794
-7
src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
··· 9 9 protected $name; 10 10 protected $repositoryID; 11 11 12 - protected $symbolIndexLanguages = array(); 13 - protected $symbolIndexProjects = array(); 14 - 15 12 private $repository = self::ATTACHABLE; 16 13 17 14 protected function getConfiguration() { 18 15 return array( 19 16 self::CONFIG_AUX_PHID => true, 20 17 self::CONFIG_TIMESTAMPS => false, 21 - self::CONFIG_SERIALIZATION => array( 22 - 'symbolIndexLanguages' => self::SERIALIZATION_JSON, 23 - 'symbolIndexProjects' => self::SERIALIZATION_JSON, 24 - ), 25 18 self::CONFIG_COLUMN_SCHEMA => array( 26 19 'name' => 'text128', 27 20 'repositoryID' => 'id?',
+22
src/applications/repository/storage/PhabricatorRepositoryTransaction.php
··· 25 25 const TYPE_DANGEROUS = 'repo:dangerous'; 26 26 const TYPE_CLONE_NAME = 'repo:clone-name'; 27 27 const TYPE_SERVICE = 'repo:service'; 28 + const TYPE_SYMBOLS_SOURCES = 'repo:symbol-source'; 29 + const TYPE_SYMBOLS_LANGUAGE = 'repo:symbol-language'; 28 30 29 31 // TODO: Clean up these legacy transaction types. 30 32 const TYPE_SSH_LOGIN = 'repo:ssh-login'; ··· 59 61 } 60 62 if ($new) { 61 63 $phids[] = $new; 64 + } 65 + break; 66 + case self::TYPE_SYMBOLS_SOURCES: 67 + if ($old) { 68 + $phids = array_merge($phids, $old); 69 + } 70 + if ($new) { 71 + $phids = array_merge($phids, $new); 62 72 } 63 73 break; 64 74 } ··· 393 403 $this->renderHandleLink($old), 394 404 $this->renderHandleLink($new)); 395 405 } 406 + case self::TYPE_SYMBOLS_SOURCES: 407 + return pht( 408 + '%s changed symbol sources from %s to %s.', 409 + $this->renderHandleLink($author_phid), 410 + empty($old) ? pht('None') : $this->renderHandleList($old), 411 + empty($new) ? pht('None') : $this->renderHandleList($new)); 412 + 413 + case self::TYPE_SYMBOLS_LANGUAGE: 414 + return pht('%s changed indexed languages from %s to %s.', 415 + $this->renderHandleLink($author_phid), 416 + $old ? implode(', ', $old) : pht('Any'), 417 + $new ? implode(', ', $new) : pht('Any')); 396 418 } 397 419 398 420 return parent::getTitle();
+1 -1
webroot/rsrc/js/application/repository/repository-crossreference.js
··· 29 29 var symbol = target.textContent || target.innerText; 30 30 var query = { 31 31 lang : lang, 32 - projects : config.projects.join(','), 32 + repositories : config.repositories.join(','), 33 33 jump : true 34 34 }; 35 35 if (map[target.className]) {