Page MenuHomePhabricator

D17040.diff
No OneTemporary

D17040.diff

diff --git a/bin/hunks b/bin/hunks
deleted file mode 120000
--- a/bin/hunks
+++ /dev/null
@@ -1 +0,0 @@
-../scripts/setup/manage_hunks.php
\ No newline at end of file
diff --git a/scripts/setup/manage_hunks.php b/scripts/setup/manage_hunks.php
deleted file mode 100755
--- a/scripts/setup/manage_hunks.php
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-$root = dirname(dirname(dirname(__FILE__)));
-require_once $root.'/scripts/__init_script__.php';
-
-$args = new PhutilArgumentParser($argv);
-$args->setTagline(pht('manage hunks'));
-$args->setSynopsis(<<<EOSYNOPSIS
-**hunks** __command__ [__options__]
- Manage Differential hunk storage.
-
-EOSYNOPSIS
- );
-$args->parseStandardArguments();
-
-$workflows = id(new PhutilClassMapQuery())
- ->setAncestorClass('PhabricatorHunksManagementWorkflow')
- ->execute();
-$workflows[] = new PhutilHelpArgumentWorkflow();
-$args->parseWorkflows($workflows);
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
@@ -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',
@@ -7777,8 +7775,6 @@
'PhabricatorHomeQuickCreateController' => 'PhabricatorHomeController',
'PhabricatorHovercardEngineExtension' => 'Phobject',
'PhabricatorHovercardEngineExtensionModule' => 'PhabricatorConfigModule',
- 'PhabricatorHunksManagementMigrateWorkflow' => 'PhabricatorHunksManagementWorkflow',
- 'PhabricatorHunksManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorIDsSearchEngineExtension' => 'PhabricatorSearchEngineExtension',
'PhabricatorIDsSearchField' => 'PhabricatorSearchField',
'PhabricatorIRCProtocolAdapter' => 'PhabricatorProtocolAdapter',
diff --git a/src/applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php b/src/applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php
deleted file mode 100644
--- a/src/applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-
-final class PhabricatorHunksManagementMigrateWorkflow
- extends PhabricatorHunksManagementWorkflow {
-
- protected function didConstruct() {
- $this
- ->setName('migrate')
- ->setExamples('**migrate**')
- ->setSynopsis(pht('Migrate hunks to modern storage.'))
- ->setArguments(array());
- }
-
- public function execute(PhutilArgumentParser $args) {
- $saw_any_rows = false;
- $console = PhutilConsole::getConsole();
-
- $table = new DifferentialLegacyHunk();
- foreach (new LiskMigrationIterator($table) as $hunk) {
- $saw_any_rows = true;
-
- $id = $hunk->getID();
- $console->writeOut("%s\n", pht('Migrating hunk %d...', $id));
-
- $new_hunk = id(new DifferentialModernHunk())
- ->setChangesetID($hunk->getChangesetID())
- ->setOldOffset($hunk->getOldOffset())
- ->setOldLen($hunk->getOldLen())
- ->setNewOffset($hunk->getNewOffset())
- ->setNewLen($hunk->getNewLen())
- ->setChanges($hunk->getChanges())
- ->setDateCreated($hunk->getDateCreated())
- ->setDateModified($hunk->getDateModified());
-
- $hunk->openTransaction();
- $new_hunk->save();
- $hunk->delete();
- $hunk->saveTransaction();
-
- $old_len = strlen($hunk->getChanges());
- $new_len = strlen($new_hunk->getData());
- if ($old_len) {
- $diff_len = ($old_len - $new_len);
- $console->writeOut(
- "%s\n",
- pht(
- 'Saved %s bytes (%s).',
- new PhutilNumber($diff_len),
- sprintf('%.1f%%', 100 * ($diff_len / $old_len))));
- }
- }
-
- if ($saw_any_rows) {
- $console->writeOut("%s\n", pht('Done.'));
- } else {
- $console->writeOut("%s\n", pht('No rows to migrate.'));
- }
- }
-
-}
diff --git a/src/applications/differential/management/PhabricatorHunksManagementWorkflow.php b/src/applications/differential/management/PhabricatorHunksManagementWorkflow.php
deleted file mode 100644
--- a/src/applications/differential/management/PhabricatorHunksManagementWorkflow.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-
-abstract class PhabricatorHunksManagementWorkflow
- extends PhabricatorManagementWorkflow {}
diff --git a/src/applications/differential/query/DifferentialHunkQuery.php b/src/applications/differential/query/DifferentialHunkQuery.php
--- a/src/applications/differential/query/DifferentialHunkQuery.php
+++ b/src/applications/differential/query/DifferentialHunkQuery.php
@@ -46,23 +46,9 @@
$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) {
diff --git a/src/applications/differential/storage/DifferentialChangeset.php b/src/applications/differential/storage/DifferentialChangeset.php
--- a/src/applications/differential/storage/DifferentialChangeset.php
+++ b/src/applications/differential/storage/DifferentialChangeset.php
@@ -98,13 +98,6 @@
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());

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 26, 8:05 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7314063
Default Alt Text
D17040.diff (6 KB)

Event Timeline