Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15392333
D12687.id30458.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
27 KB
Referenced Files
None
Subscribers
None
D12687.id30458.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -11,7 +11,7 @@
'core.pkg.js' => '3331b919',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '0a253fbe',
- 'differential.pkg.js' => '3cfa26f9',
+ 'differential.pkg.js' => 'ac94324c',
'diffusion.pkg.css' => '591664fa',
'diffusion.pkg.js' => '0115b37c',
'maniphest.pkg.css' => '68d4dd3d',
@@ -419,7 +419,7 @@
'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf',
'rsrc/js/application/releeph/releeph-request-state-change.js' => 'a0b57eb8',
'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'de2e896f',
- 'rsrc/js/application/repository/repository-crossreference.js' => 'f9539603',
+ 'rsrc/js/application/repository/repository-crossreference.js' => '3975b470',
'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08',
'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f',
'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6',
@@ -650,7 +650,7 @@
'javelin-behavior-remarkup-preview' => 'f7379f45',
'javelin-behavior-reorder-applications' => '76b9fc3e',
'javelin-behavior-reorder-columns' => 'e1d25dfb',
- 'javelin-behavior-repository-crossreference' => 'f9539603',
+ 'javelin-behavior-repository-crossreference' => '3975b470',
'javelin-behavior-scrollbar' => '834a1173',
'javelin-behavior-search-reorder-queries' => 'e9581f08',
'javelin-behavior-select-on-click' => '4e3e79a6',
@@ -1050,6 +1050,12 @@
'331b1611' => array(
'javelin-install',
),
+ '3975b470' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-uri',
+ ),
'3ab51e2c' => array(
'javelin-behavior',
'javelin-behavior-device',
@@ -2011,12 +2017,6 @@
'javelin-util',
'phabricator-busy',
),
- 'f9539603' => array(
- 'javelin-behavior',
- 'javelin-dom',
- 'javelin-stratcom',
- 'javelin-uri',
- ),
'fa0f4fc2' => array(
'javelin-behavior',
'javelin-dom',
diff --git a/resources/sql/autopatches/20150504.symbolsproject.1.php b/resources/sql/autopatches/20150504.symbolsproject.1.php
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20150504.symbolsproject.1.php
@@ -0,0 +1,45 @@
+<?php
+
+$projects = id(new PhabricatorRepositoryArcanistProjectQuery())
+ ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->needRepositories(true)
+ ->execute();
+
+$projects_to_repos_map = mpull($projects, 'getRepository', 'getPHID');
+$projects_to_repos_map = array_filter($projects_to_repos_map);
+$projects_to_repos_map = mpull($projects_to_repos_map, 'getPHID');
+
+$table = new PhabricatorRepository();
+$conn_w = $table->establishConnection('w');
+
+foreach ($projects as $project) {
+ $repo = $project->getRepository();
+
+ if (!$repo) {
+ continue;
+ }
+
+ echo pht(
+ "Migrating symbols configuration for '%s' project...\n",
+ $project->getName());
+
+ $symbolIndexProjects = $project->getSymbolIndexProjects();
+
+ $sources = array();
+ foreach ($symbolIndexProjects as $indexProject) {
+ $sources[] = idx($projects_to_repos_map, $indexProject);
+ }
+ $sources = array_filter($sources);
+
+ $languages = $project->getSymbolIndexLanguages();
+
+ $repo->setDetail('symbol-sources', $sources);
+ $repo->setDetail('symbol-languages', $languages);
+
+ queryfx(
+ $conn_w,
+ 'UPDATE %T SET details = %s WHERE id = %d',
+ $table->getTableName(),
+ json_encode($repo->getDetails()),
+ $repo->getID());
+}
diff --git a/resources/sql/autopatches/20150504.symbolsproject.2.sql b/resources/sql/autopatches/20150504.symbolsproject.2.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20150504.symbolsproject.2.sql
@@ -0,0 +1,3 @@
+ALTER TABLE {$NAMESPACE}_repository.repository_arcanistproject
+ DROP COLUMN symbolIndexLanguages,
+ DROP COLUMN symbolIndexProjects;
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
@@ -601,6 +601,7 @@
'DiffusionRepositoryPath' => 'applications/diffusion/data/DiffusionRepositoryPath.php',
'DiffusionRepositoryRef' => 'applications/diffusion/data/DiffusionRepositoryRef.php',
'DiffusionRepositoryRemarkupRule' => 'applications/diffusion/remarkup/DiffusionRepositoryRemarkupRule.php',
+ 'DiffusionRepositorySymbolsController' => 'applications/diffusion/controller/DiffusionRepositorySymbolsController.php',
'DiffusionRepositoryTag' => 'applications/diffusion/data/DiffusionRepositoryTag.php',
'DiffusionRequest' => 'applications/diffusion/request/DiffusionRequest.php',
'DiffusionResolveRefsConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionResolveRefsConduitAPIMethod.php',
@@ -3834,6 +3835,7 @@
'DiffusionRepositoryNewController' => 'DiffusionController',
'DiffusionRepositoryRef' => 'Phobject',
'DiffusionRepositoryRemarkupRule' => 'PhabricatorObjectRemarkupRule',
+ 'DiffusionRepositorySymbolsController' => 'DiffusionRepositoryEditController',
'DiffusionResolveRefsConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
'DiffusionResolveUserQuery' => 'Phobject',
'DiffusionSSHWorkflow' => 'PhabricatorSSHWorkflow',
diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php
--- a/src/applications/differential/controller/DifferentialRevisionViewController.php
+++ b/src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -256,14 +256,14 @@
'whitespace',
DifferentialChangesetParser::WHITESPACE_IGNORE_MOST);
- $arc_project = $target->getArcanistProject();
- if ($arc_project) {
- list($symbol_indexes, $project_phids) = $this->buildSymbolIndexes(
- $arc_project,
+ $repository = $revision->getRepository();
+ if ($repository) {
+ list($symbol_indexes, $repository_phids) = $this->buildSymbolIndexes(
+ $repository,
$visible_changesets);
} else {
$symbol_indexes = array();
- $project_phids = null;
+ $repository_phids = null;
}
$revision_detail->setActions($actions);
@@ -303,12 +303,12 @@
),
$comment_view);
- if ($arc_project) {
+ if ($repository) {
Javelin::initBehavior(
'repository-crossreference',
array(
'section' => $wrap_id,
- 'projects' => $project_phids,
+ 'repositories' => $repository_phids,
));
}
@@ -746,35 +746,32 @@
}
private function buildSymbolIndexes(
- PhabricatorRepositoryArcanistProject $arc_project,
+ PhabricatorRepository $repository,
array $visible_changesets) {
assert_instances_of($visible_changesets, 'DifferentialChangeset');
$engine = PhabricatorSyntaxHighlighter::newEngine();
- $langs = $arc_project->getSymbolIndexLanguages();
- if (!$langs) {
- return array(array(), array());
- }
+ $langs = $repository->getSymbolLanguages();
$symbol_indexes = array();
- $project_phids = array_merge(
- array($arc_project->getPHID()),
- nonempty($arc_project->getSymbolIndexProjects(), array()));
+ $repository_phids = array_merge(
+ array($repository->getPHID()),
+ nonempty($repository->getSymbolSources(), array()));
$indexed_langs = array_fill_keys($langs, true);
foreach ($visible_changesets as $key => $changeset) {
$lang = $engine->getLanguageFromFilename($changeset->getFilename());
- if (isset($indexed_langs[$lang])) {
+ if (empty($indexed_langs) || isset($indexed_langs[$lang])) {
$symbol_indexes[$key] = array(
- 'lang' => $lang,
- 'projects' => $project_phids,
+ 'lang' => $lang,
+ 'repositories' => $repository_phids,
);
}
}
- return array($symbol_indexes, $project_phids);
+ return array($symbol_indexes, $repository_phids);
}
private function loadOtherRevisions(
diff --git a/src/applications/diffusion/application/PhabricatorDiffusionApplication.php b/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
--- a/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
+++ b/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
@@ -100,6 +100,7 @@
'hosting/' => 'DiffusionRepositoryEditHostingController',
'(?P<serve>serve)/' => 'DiffusionRepositoryEditHostingController',
'update/' => 'DiffusionRepositoryEditUpdateController',
+ 'symbol/' => 'DiffusionRepositorySymbolsController',
),
'pathtree/(?P<dblob>.*)' => 'DiffusionPathTreeController',
'mirror/' => array(
diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
--- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
@@ -266,32 +266,20 @@
$id = celerity_generate_unique_node_id();
- $projects = $drequest->loadArcanistProjects();
- $langs = array();
- foreach ($projects as $project) {
- $ls = $project->getSymbolIndexLanguages();
- if (!$ls) {
- continue;
- }
- $dep_projects = $project->getSymbolIndexProjects();
- $dep_projects[] = $project->getPHID();
- foreach ($ls as $lang) {
- if (!isset($langs[$lang])) {
- $langs[$lang] = array();
- }
- $langs[$lang] += $dep_projects + array($project);
- }
- }
+ $repo = $drequest->getRepository();
+ $symbol_repos = $repo->getSymbolSources();
+ $symbol_repos[] = $repo;
$lang = last(explode('.', $drequest->getPath()));
-
- if (isset($langs[$lang])) {
+ $repo_languages = $repo->getSymbolLanguages();
+ $repo_languages = array_fill_keys($repo_languages, true);
+ if (empty($repo_languages) || isset($repo_languages[$lang])) {
Javelin::initBehavior(
'repository-crossreference',
array(
'container' => $id,
'lang' => $lang,
- 'projects' => $langs[$lang],
+ 'repositories' => $symbol_repos,
));
}
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
@@ -62,6 +62,10 @@
$encoding_properties =
$this->buildEncodingProperties($repository, $encoding_actions);
+ $symbols_actions = $this->buildSymbolsActions($repository);
+ $symbols_properties =
+ $this->buildSymbolsProperties($repository, $symbols_actions);
+
$hosting_properties = $this->buildHostingProperties(
$repository,
$this->buildHostingActions($repository));
@@ -157,6 +161,10 @@
->setHeaderText(pht('Text Encoding'))
->addPropertyList($encoding_properties);
+ $boxes[] = id(new PHUIObjectBoxView())
+ ->setHeaderText(pht('Symbols'))
+ ->addPropertyList($symbols_properties);
+
if ($branches_properties) {
$boxes[] = id(new PHUIObjectBoxView())
->setHeaderText(pht('Branches'))
@@ -1187,6 +1195,53 @@
return $mirror_list;
}
+ private function buildSymbolsActions(PhabricatorRepository $repository) {
+ $viewer = $this->getRequest()->getUser();
+
+ $view = id(new PhabricatorActionListView())
+ ->setObjectURI($this->getRequest()->getRequestURI())
+ ->setUser($viewer);
+
+ $edit = id(new PhabricatorActionView())
+ ->setIcon('fa-pencil')
+ ->setName(pht('Edit Symbols'))
+ ->setHref(
+ $this->getRepositoryControllerURI($repository, 'edit/symbol/'));
+ $view->addAction($edit);
+
+ return $view;
+ }
+
+ private function buildSymbolsProperties(
+ PhabricatorRepository $repository,
+ PhabricatorActionListView $actions) {
+
+ $viewer = $this->getRequest()->getUser();
+
+ $view = id(new PHUIPropertyListView())
+ ->setUser($viewer)
+ ->setActionList($actions);
+
+ $languages = $repository->getSymbolLanguages();
+
+ if ($languages) {
+ $languages = implode(', ', $languages);
+ } else {
+ $languages = phutil_tag('em', array(), pht('Any'));
+ }
+ $view->addProperty(pht('Languages'), $languages);
+
+ $sources = $repository->getSymbolSources();
+ if ($sources) {
+ $handles = $viewer->loadHandles($sources);
+ $sources = $handles->renderList();
+ } else {
+ $sources = phutil_tag('em', array(), pht('This Repository Only'));
+ }
+ $view->addProperty(pht('Use symbols from'), $sources);
+ return $view;
+ }
+
private function getEnvConfigLink() {
$config_href = '/config/edit/environment.append-paths/';
return phutil_tag(
diff --git a/src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php b/src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php
@@ -0,0 +1,140 @@
+<?php
+
+final class DiffusionRepositorySymbolsController
+ extends DiffusionRepositoryEditController {
+
+ protected function processDiffusionRequest(AphrontRequest $request) {
+ $user = $request->getUser();
+ $drequest = $this->diffusionRequest;
+ $repository = $drequest->getRepository();
+
+ $repository = id(new PhabricatorRepositoryQuery())
+ ->setViewer($user)
+ ->requireCapabilities(
+ array(
+ PhabricatorPolicyCapability::CAN_VIEW,
+ PhabricatorPolicyCapability::CAN_EDIT,
+ ))
+ ->withIDs(array($repository->getID()))
+ ->executeOne();
+
+ if (!$repository) {
+ return new Aphront404Response();
+ }
+
+ $edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
+
+ $v_sources = $repository->getSymbolSources();
+ $v_languages = $repository->getSymbolLanguages();
+ if ($v_languages) {
+ $v_languages = implode(', ', $v_languages);
+ }
+ $errors = array();
+
+ if ($request->isFormPost()) {
+ $v_sources = $request->getArr('sources');
+ $v_languages = $request->getStrList('languages');
+ $v_languages = array_map('strtolower', $v_languages);
+
+ if (!$errors) {
+ $xactions = array();
+ $template = id(new PhabricatorRepositoryTransaction());
+
+ $type_sources = PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES;
+ $type_lang = PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE;
+
+ $xactions[] = id(clone $template)
+ ->setTransactionType($type_sources)
+ ->setNewValue($v_sources);
+
+ $xactions[] = id(clone $template)
+ ->setTransactionType($type_lang)
+ ->setNewValue($v_languages);
+
+ try {
+ id(new PhabricatorRepositoryEditor())
+ ->setContinueOnNoEffect(true)
+ ->setContentSourceFromRequest($request)
+ ->setActor($user)
+ ->applyTransactions($repository, $xactions);
+
+ return id(new AphrontRedirectResponse())->setURI($edit_uri);
+ } catch (Exception $ex) {
+ $errors[] = $ex->getMessage();
+ }
+ }
+ }
+
+ $crumbs = $this->buildApplicationCrumbs();
+ $crumbs->addTextCrumb(pht('Edit Symbols'));
+
+ $title = pht('Edit %s', $repository->getName());
+
+ $form = id(new AphrontFormView())
+ ->setUser($user)
+ ->appendRemarkupInstructions($this->getInstructions())
+ ->appendChild(
+ id(new AphrontFormTextControl())
+ ->setName('languages')
+ ->setLabel(pht('Indexed Languages'))
+ ->setCaption(pht(
+ 'File extensions, separate with commas, for example: php, py. '.
+ 'Leave blank for "any".'))
+ ->setValue($v_languages))
+
+ ->appendControl(
+ id(new AphrontFormTokenizerControl())
+ ->setName('sources')
+ ->setLabel(pht('Uses Symbols From'))
+ ->setDatasource(new DiffusionRepositoryDatasource())
+ ->setValue($v_sources))
+
+ ->appendChild(
+ id(new AphrontFormSubmitControl())
+ ->setValue(pht('Save'))
+ ->addCancelButton($edit_uri));
+
+ $object_box = id(new PHUIObjectBoxView())
+ ->setHeaderText($title)
+ ->setForm($form)
+ ->setFormErrors($errors);
+
+ return $this->buildApplicationPage(
+ array(
+ $crumbs,
+ $object_box,
+ ),
+ array(
+ 'title' => $title,
+ ));
+ }
+
+ private function getInstructions() {
+ return pht(<<<EOT
+Configure Symbols for this repository.
+
+%s
+See [[%s | Symbol Indexes]] for more information on using symbols.
+EOT
+ ,
+ $this->noteAboutHighlights(),
+ PhabricatorEnv::getDoclink(
+ 'Diffusion User Guide: Symbol Indexes'));
+ }
+
+ private function noteAboutHighlights() {
+ if (PhabricatorEnv::getEnvConfig('pygments.enabled')) {
+ return '';
+ }
+ return pht(<<<EOT
+NOTE: Symbols lookup is dependent on Syntax Highlighting, which is performed
+using Pygments for most languages.
+To enable lookup for other
+languages, [[%s | edit pygments.enabled in the configuration]].
+
+EOT
+ ,
+ '/config/edit/syntax-highlighter.engine/');
+ }
+
+}
diff --git a/src/applications/diffusion/controller/DiffusionSymbolController.php b/src/applications/diffusion/controller/DiffusionSymbolController.php
--- a/src/applications/diffusion/controller/DiffusionSymbolController.php
+++ b/src/applications/diffusion/controller/DiffusionSymbolController.php
@@ -128,7 +128,7 @@
'',
));
$table->setNoDataString(
- pht('No matching symbol could be found in any indexed project.'));
+ pht('No matching symbol could be found in any indexed repository.'));
$panel = new PHUIObjectBoxView();
$panel->setHeaderText(pht('Similar Symbols'));
diff --git a/src/applications/diffusion/query/DiffusionSymbolQuery.php b/src/applications/diffusion/query/DiffusionSymbolQuery.php
--- a/src/applications/diffusion/query/DiffusionSymbolQuery.php
+++ b/src/applications/diffusion/query/DiffusionSymbolQuery.php
@@ -146,11 +146,12 @@
$this->loadPaths($symbols);
}
if ($this->needRepositories) {
- $this->loadRepositories($symbols);
+ $symbols = $this->loadRepositories($symbols);
}
}
+
return $symbols;
}
@@ -249,10 +250,16 @@
->execute();
$repos = mpull($repos, null, 'getPHID');
+ $visible = array();
foreach ($symbols as $symbol) {
$repository = idx($repos, $symbol->getRepositoryPHID());
- $symbol->attachRepository($repository);
+ // repository is null mean "user can't view repo", so hide the symbol
+ if ($repository) {
+ $symbol->attachRepository($repository);
+ $visible[] = $symbol;
+ }
}
+ return $visible;
}
}
diff --git a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
--- a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
+++ b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
@@ -51,19 +51,6 @@
}
}
- $langs = $project->getSymbolIndexLanguages();
- if ($langs) {
- $langs = implode(', ', $langs);
- } else {
- $langs = null;
- }
-
- if ($project->getSymbolIndexProjects()) {
- $uses = $project->getSymbolIndexProjects();
- } else {
- $uses = array();
- }
-
$form = id(new AphrontFormView())
->setUser($user)
->appendChild(
@@ -81,20 +68,6 @@
->setName('repository')
->setValue($project->getRepositoryID()))
->appendChild(
- id(new AphrontFormTextControl())
- ->setLabel(pht('Indexed Languages'))
- ->setName('symbolIndexLanguages')
- ->setCaption(pht(
- 'Separate with commas, for example: %s',
- phutil_tag('tt', array(), 'php, py')))
- ->setValue($langs))
- ->appendControl(
- id(new AphrontFormTokenizerControl())
- ->setLabel(pht('Uses Symbols From'))
- ->setName('symbolIndexProjects')
- ->setDatasource(new DiffusionArcanistProjectDatasource())
- ->setValue($uses))
- ->appendChild(
id(new AphrontFormSubmitControl())
->addCancelButton('/repository/')
->setValue('Save'));
diff --git a/src/applications/repository/editor/PhabricatorRepositoryEditor.php b/src/applications/repository/editor/PhabricatorRepositoryEditor.php
--- a/src/applications/repository/editor/PhabricatorRepositoryEditor.php
+++ b/src/applications/repository/editor/PhabricatorRepositoryEditor.php
@@ -41,6 +41,8 @@
$types[] = PhabricatorRepositoryTransaction::TYPE_DANGEROUS;
$types[] = PhabricatorRepositoryTransaction::TYPE_CLONE_NAME;
$types[] = PhabricatorRepositoryTransaction::TYPE_SERVICE;
+ $types[] = PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE;
+ $types[] = PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES;
$types[] = PhabricatorTransactions::TYPE_EDGE;
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
@@ -98,6 +100,10 @@
return $object->getDetail('clone-name');
case PhabricatorRepositoryTransaction::TYPE_SERVICE:
return $object->getAlmanacServicePHID();
+ case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE:
+ return $object->getSymbolLanguages();
+ case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES:
+ return $object->getSymbolSources();
}
}
@@ -131,6 +137,8 @@
case PhabricatorRepositoryTransaction::TYPE_DANGEROUS:
case PhabricatorRepositoryTransaction::TYPE_CLONE_NAME:
case PhabricatorRepositoryTransaction::TYPE_SERVICE:
+ case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE:
+ case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES:
return $xaction->getNewValue();
case PhabricatorRepositoryTransaction::TYPE_NOTIFY:
case PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE:
@@ -205,6 +213,12 @@
case PhabricatorRepositoryTransaction::TYPE_SERVICE:
$object->setAlmanacServicePHID($xaction->getNewValue());
return;
+ case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE:
+ $object->setDetail('symbol-languages', $xaction->getNewValue());
+ return;
+ case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES:
+ $object->setDetail('symbol-sources', $xaction->getNewValue());
+ return;
case PhabricatorRepositoryTransaction::TYPE_ENCODING:
// Make sure the encoding is valid by converting to UTF-8. This tests
// that the user has mbstring installed, and also that they didn't type
@@ -314,6 +328,8 @@
case PhabricatorRepositoryTransaction::TYPE_DANGEROUS:
case PhabricatorRepositoryTransaction::TYPE_CLONE_NAME:
case PhabricatorRepositoryTransaction::TYPE_SERVICE:
+ case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES:
+ case PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE:
PhabricatorPolicyFilter::requireCapability(
$this->requireActor(),
$object,
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
@@ -1196,6 +1196,12 @@
queryfx(
$conn_w,
+ 'DELETE FROM %T WHERE repositoryPHID = %s',
+ id(new PhabricatorRepositorySymbol())->getTableName(),
+ $this->getID());
+
+ queryfx(
+ $conn_w,
'DELETE FROM %T WHERE repositoryID = %d',
self::TABLE_FILESYSTEM,
$this->getID());
@@ -1778,6 +1784,17 @@
}
+/* -( Symbols )-------------------------------------------------------------*/
+
+ public function getSymbolSources() {
+ return $this->getDetail('symbol-sources');
+ }
+
+ public function getSymbolLanguages() {
+ return $this->getDetail('symbol-languages');
+ }
+
+
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
diff --git a/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php b/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
--- a/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
@@ -9,19 +9,12 @@
protected $name;
protected $repositoryID;
- protected $symbolIndexLanguages = array();
- protected $symbolIndexProjects = array();
-
private $repository = self::ATTACHABLE;
protected function getConfiguration() {
return array(
self::CONFIG_AUX_PHID => true,
self::CONFIG_TIMESTAMPS => false,
- self::CONFIG_SERIALIZATION => array(
- 'symbolIndexLanguages' => self::SERIALIZATION_JSON,
- 'symbolIndexProjects' => self::SERIALIZATION_JSON,
- ),
self::CONFIG_COLUMN_SCHEMA => array(
'name' => 'text128',
'repositoryID' => 'id?',
diff --git a/src/applications/repository/storage/PhabricatorRepositoryTransaction.php b/src/applications/repository/storage/PhabricatorRepositoryTransaction.php
--- a/src/applications/repository/storage/PhabricatorRepositoryTransaction.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryTransaction.php
@@ -25,6 +25,8 @@
const TYPE_DANGEROUS = 'repo:dangerous';
const TYPE_CLONE_NAME = 'repo:clone-name';
const TYPE_SERVICE = 'repo:service';
+ const TYPE_SYMBOLS_SOURCES = 'repo:symbol-source';
+ const TYPE_SYMBOLS_LANGUAGE = 'repo:symbol-language';
// TODO: Clean up these legacy transaction types.
const TYPE_SSH_LOGIN = 'repo:ssh-login';
@@ -61,6 +63,14 @@
$phids[] = $new;
}
break;
+ case self::TYPE_SYMBOLS_SOURCES:
+ if ($old) {
+ $phids = array_merge($phids, $old);
+ }
+ if ($new) {
+ $phids = array_merge($phids, $new);
+ }
+ break;
}
return $phids;
@@ -393,6 +403,18 @@
$this->renderHandleLink($old),
$this->renderHandleLink($new));
}
+ case self::TYPE_SYMBOLS_SOURCES:
+ return pht(
+ '%s changed symbol sources from %s to %s',
+ $this->renderHandleLink($author_phid),
+ empty($old) ? 'None' : $this->renderHandleList($old),
+ empty($new) ? 'None' : $this->renderHandleList($new));
+
+ case self::TYPE_SYMBOLS_LANGUAGE:
+ return pht('%s changed indexed languages from %s to %s.',
+ $this->renderHandleLink($author_phid),
+ $old ? implode(', ', $old) : 'Any',
+ $new ? implode(', ', $new) : 'Any');
}
return parent::getTitle();
diff --git a/webroot/rsrc/js/application/repository/repository-crossreference.js b/webroot/rsrc/js/application/repository/repository-crossreference.js
--- a/webroot/rsrc/js/application/repository/repository-crossreference.js
+++ b/webroot/rsrc/js/application/repository/repository-crossreference.js
@@ -29,7 +29,7 @@
var symbol = target.textContent || target.innerText;
var query = {
lang : lang,
- projects : config.projects.join(','),
+ repositories : config.repositories.join(','),
jump : true
};
if (map[target.className]) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 2:35 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704422
Default Alt Text
D12687.id30458.diff (27 KB)
Attached To
Mode
D12687: Search Symbols by Repository, not Project
Attached
Detach File
Event Timeline
Log In to Comment