Skip to content

Commit

Permalink
Remove most of the legacy hunk code
Browse files Browse the repository at this point in the history
Summary: Ref T8475. This gets rid of most of the old "legacy hunk" code. I'll nuke the rest (and drop the old table) once we're more sure that we're in the clear.

Test Plan: Browsed Differential.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8475

Differential Revision: https://secure.phabricator.com/D17040
  • Loading branch information
epriestley committed Dec 13, 2016
1 parent c67e87c commit 1e9a462
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 112 deletions.
1 change: 0 additions & 1 deletion bin/hunks

This file was deleted.

21 changes: 0 additions & 21 deletions scripts/setup/manage_hunks.php

This file was deleted.

4 changes: 0 additions & 4 deletions src/__phutil_library_map__.php
Expand Up @@ -2784,8 +2784,6 @@
'PhabricatorHomeQuickCreateController' => 'applications/home/controller/PhabricatorHomeQuickCreateController.php',
'PhabricatorHovercardEngineExtension' => 'applications/search/engineextension/PhabricatorHovercardEngineExtension.php',
'PhabricatorHovercardEngineExtensionModule' => 'applications/search/engineextension/PhabricatorHovercardEngineExtensionModule.php',
'PhabricatorHunksManagementMigrateWorkflow' => 'applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php',
'PhabricatorHunksManagementWorkflow' => 'applications/differential/management/PhabricatorHunksManagementWorkflow.php',
'PhabricatorIDsSearchEngineExtension' => 'applications/search/engineextension/PhabricatorIDsSearchEngineExtension.php',
'PhabricatorIDsSearchField' => 'applications/search/field/PhabricatorIDsSearchField.php',
'PhabricatorIRCProtocolAdapter' => 'infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php',
Expand Down Expand Up @@ -7777,8 +7775,6 @@
'PhabricatorHomeQuickCreateController' => 'PhabricatorHomeController',
'PhabricatorHovercardEngineExtension' => 'Phobject',
'PhabricatorHovercardEngineExtensionModule' => 'PhabricatorConfigModule',
'PhabricatorHunksManagementMigrateWorkflow' => 'PhabricatorHunksManagementWorkflow',
'PhabricatorHunksManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorIDsSearchEngineExtension' => 'PhabricatorSearchEngineExtension',
'PhabricatorIDsSearchField' => 'PhabricatorSearchField',
'PhabricatorIRCProtocolAdapter' => 'PhabricatorProtocolAdapter',
Expand Down

This file was deleted.

This file was deleted.

16 changes: 1 addition & 15 deletions src/applications/differential/query/DifferentialHunkQuery.php
Expand Up @@ -46,23 +46,9 @@ protected function loadPage() {
$this->buildLimitClause($conn_r));
$modern_results = $table->loadAllFromArray($modern_data);


// Now, load legacy hunks.
$table = new DifferentialLegacyHunk();
$conn_r = $table->establishConnection('r');

$legacy_data = queryfx_all(
$conn_r,
'SELECT * FROM %T %Q %Q %Q',
$table->getTableName(),
$this->buildWhereClause($conn_r),
$this->buildOrderClause($conn_r),
$this->buildLimitClause($conn_r));
$legacy_results = $table->loadAllFromArray($legacy_data);

// Strip all the IDs off since they're not unique and nothing should be
// using them.
return array_values(array_merge($legacy_results, $modern_results));
return array_values($modern_results);
}

protected function willFilterPage(array $hunks) {
Expand Down
Expand Up @@ -98,13 +98,6 @@ public function save() {
public function delete() {
$this->openTransaction();

$legacy_hunks = id(new DifferentialLegacyHunk())->loadAllWhere(
'changesetID = %d',
$this->getID());
foreach ($legacy_hunks as $legacy_hunk) {
$legacy_hunk->delete();
}

$modern_hunks = id(new DifferentialModernHunk())->loadAllWhere(
'changesetID = %d',
$this->getID());
Expand Down

0 comments on commit 1e9a462

Please sign in to comment.