diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 612eab7685..30ed8e65d7 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -367,8 +367,6 @@ phutil_register_library_map(array( 'DifferentialHostedMercurialLandingStrategy' => 'applications/differential/landing/DifferentialHostedMercurialLandingStrategy.php', 'DifferentialHovercardEventListener' => 'applications/differential/event/DifferentialHovercardEventListener.php', 'DifferentialHunk' => 'applications/differential/storage/DifferentialHunk.php', - 'DifferentialHunkLegacy' => 'applications/differential/storage/DifferentialHunkLegacy.php', - 'DifferentialHunkModern' => 'applications/differential/storage/DifferentialHunkModern.php', 'DifferentialHunkParser' => 'applications/differential/parser/DifferentialHunkParser.php', 'DifferentialHunkParserTestCase' => 'applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php', 'DifferentialHunkQuery' => 'applications/differential/query/DifferentialHunkQuery.php', @@ -382,11 +380,13 @@ phutil_register_library_map(array( 'DifferentialJIRAIssuesField' => 'applications/differential/customfield/DifferentialJIRAIssuesField.php', 'DifferentialLandingActionMenuEventListener' => 'applications/differential/landing/DifferentialLandingActionMenuEventListener.php', 'DifferentialLandingStrategy' => 'applications/differential/landing/DifferentialLandingStrategy.php', + 'DifferentialLegacyHunk' => 'applications/differential/storage/DifferentialLegacyHunk.php', 'DifferentialLintField' => 'applications/differential/customfield/DifferentialLintField.php', 'DifferentialLintStatus' => 'applications/differential/constants/DifferentialLintStatus.php', 'DifferentialLocalCommitsView' => 'applications/differential/view/DifferentialLocalCommitsView.php', 'DifferentialMail' => 'applications/differential/mail/DifferentialMail.php', 'DifferentialManiphestTasksField' => 'applications/differential/customfield/DifferentialManiphestTasksField.php', + 'DifferentialModernHunk' => 'applications/differential/storage/DifferentialModernHunk.php', 'DifferentialParseCacheGarbageCollector' => 'applications/differential/garbagecollector/DifferentialParseCacheGarbageCollector.php', 'DifferentialParseCommitMessageConduitAPIMethod' => 'applications/differential/conduit/DifferentialParseCommitMessageConduitAPIMethod.php', 'DifferentialParseRenderTestCase' => 'applications/differential/__tests__/DifferentialParseRenderTestCase.php', @@ -3462,8 +3462,6 @@ phutil_register_library_map(array( 'DifferentialDAO', 'PhabricatorPolicyInterface', ), - 'DifferentialHunkLegacy' => 'DifferentialHunk', - 'DifferentialHunkModern' => 'DifferentialHunk', 'DifferentialHunkParserTestCase' => 'PhabricatorTestCase', 'DifferentialHunkQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'DifferentialHunkTestCase' => 'ArcanistPhutilTestCase', @@ -3475,10 +3473,12 @@ phutil_register_library_map(array( 'DifferentialInlineCommentView' => 'AphrontView', 'DifferentialJIRAIssuesField' => 'DifferentialStoredCustomField', 'DifferentialLandingActionMenuEventListener' => 'PhabricatorEventListener', + 'DifferentialLegacyHunk' => 'DifferentialHunk', 'DifferentialLintField' => 'DifferentialCustomField', 'DifferentialLocalCommitsView' => 'AphrontView', 'DifferentialMail' => 'PhabricatorMail', 'DifferentialManiphestTasksField' => 'DifferentialCoreCustomField', + 'DifferentialModernHunk' => 'DifferentialHunk', 'DifferentialParseCacheGarbageCollector' => 'PhabricatorGarbageCollector', 'DifferentialParseCommitMessageConduitAPIMethod' => 'DifferentialConduitAPIMethod', 'DifferentialParseRenderTestCase' => 'PhabricatorTestCase', diff --git a/src/applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php b/src/applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php index 2b59f1871d..552376d2e0 100644 --- a/src/applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php +++ b/src/applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php @@ -15,14 +15,14 @@ final class PhabricatorHunksManagementMigrateWorkflow $saw_any_rows = false; $console = PhutilConsole::getConsole(); - $table = new DifferentialHunkLegacy(); + $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 DifferentialHunkModern()) + $new_hunk = id(new DifferentialModernHunk()) ->setChangesetID($hunk->getChangesetID()) ->setOldOffset($hunk->getOldOffset()) ->setOldLen($hunk->getOldLen()) diff --git a/src/applications/differential/parser/__tests__/DifferentialChangesetParserTestCase.php b/src/applications/differential/parser/__tests__/DifferentialChangesetParserTestCase.php index 5003515acf..9ca88db8ce 100644 --- a/src/applications/differential/parser/__tests__/DifferentialChangesetParserTestCase.php +++ b/src/applications/differential/parser/__tests__/DifferentialChangesetParserTestCase.php @@ -3,7 +3,7 @@ final class DifferentialChangesetParserTestCase extends PhabricatorTestCase { public function testDiffChangesets() { - $hunk = new DifferentialHunkModern(); + $hunk = new DifferentialModernHunk(); $hunk->setChanges("+a\n b\n-c"); $hunk->setNewOffset(1); $hunk->setNewLen(2); @@ -20,7 +20,7 @@ final class DifferentialChangesetParserTestCase extends PhabricatorTestCase { ); foreach ($tests as $changes => $expected) { - $hunk = new DifferentialHunkModern(); + $hunk = new DifferentialModernHunk(); $hunk->setChanges($changes); $hunk->setNewOffset(11); $hunk->setNewLen(3); diff --git a/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php b/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php index 111d6ba91f..45c7ac9225 100644 --- a/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php +++ b/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php @@ -14,7 +14,7 @@ final class DifferentialHunkParserTestCase extends PhabricatorTestCase { $new_len, $changes) { - $hunk = id(new DifferentialHunkModern()) + $hunk = id(new DifferentialModernHunk()) ->setOldOffset($old_offset) ->setOldLen($old_len) ->setNewOffset($new_offset) diff --git a/src/applications/differential/query/DifferentialHunkQuery.php b/src/applications/differential/query/DifferentialHunkQuery.php index 68c1ba1100..7fb7ec864b 100644 --- a/src/applications/differential/query/DifferentialHunkQuery.php +++ b/src/applications/differential/query/DifferentialHunkQuery.php @@ -34,7 +34,7 @@ final class DifferentialHunkQuery $all_results = array(); // Load modern hunks. - $table = new DifferentialHunkModern(); + $table = new DifferentialModernHunk(); $conn_r = $table->establishConnection('r'); $modern_data = queryfx_all( @@ -48,7 +48,7 @@ final class DifferentialHunkQuery // Now, load legacy hunks. - $table = new DifferentialHunkLegacy(); + $table = new DifferentialLegacyHunk(); $conn_r = $table->establishConnection('r'); $legacy_data = queryfx_all( diff --git a/src/applications/differential/storage/DifferentialChangeset.php b/src/applications/differential/storage/DifferentialChangeset.php index 8e5c3af6b2..18cafad137 100644 --- a/src/applications/differential/storage/DifferentialChangeset.php +++ b/src/applications/differential/storage/DifferentialChangeset.php @@ -98,14 +98,14 @@ final class DifferentialChangeset extends DifferentialDAO public function delete() { $this->openTransaction(); - $legacy_hunks = id(new DifferentialHunkLegacy())->loadAllWhere( + $legacy_hunks = id(new DifferentialLegacyHunk())->loadAllWhere( 'changesetID = %d', $this->getID()); foreach ($legacy_hunks as $legacy_hunk) { $legacy_hunk->delete(); } - $modern_hunks = id(new DifferentialHunkModern())->loadAllWhere( + $modern_hunks = id(new DifferentialModernHunk())->loadAllWhere( 'changesetID = %d', $this->getID()); foreach ($modern_hunks as $modern_hunk) { diff --git a/src/applications/differential/storage/DifferentialDiff.php b/src/applications/differential/storage/DifferentialDiff.php index db8d3a5afe..9092f365bc 100644 --- a/src/applications/differential/storage/DifferentialDiff.php +++ b/src/applications/differential/storage/DifferentialDiff.php @@ -193,7 +193,7 @@ final class DifferentialDiff $hunks = $change->getHunks(); if ($hunks) { foreach ($hunks as $hunk) { - $dhunk = new DifferentialHunkModern(); + $dhunk = new DifferentialModernHunk(); $dhunk->setOldOffset($hunk->getOldOffset()); $dhunk->setOldLen($hunk->getOldLength()); $dhunk->setNewOffset($hunk->getNewOffset()); diff --git a/src/applications/differential/storage/DifferentialHunkLegacy.php b/src/applications/differential/storage/DifferentialLegacyHunk.php similarity index 92% rename from src/applications/differential/storage/DifferentialHunkLegacy.php rename to src/applications/differential/storage/DifferentialLegacyHunk.php index a56f61e4e8..ae4673e46c 100644 --- a/src/applications/differential/storage/DifferentialHunkLegacy.php +++ b/src/applications/differential/storage/DifferentialLegacyHunk.php @@ -1,6 +1,6 @@ setChanges(Filesystem::readFile($root.'basic.diff')); $hunk->setOldOffset(1); $hunk->setNewOffset(11); @@ -23,7 +23,7 @@ final class DifferentialHunkTestCase extends ArcanistPhutilTestCase { ); $this->assertEqual($added, $hunk->getAddedLines()); - $hunk = new DifferentialHunkModern(); + $hunk = new DifferentialModernHunk(); $hunk->setChanges(Filesystem::readFile($root.'newline.diff')); $hunk->setOldOffset(1); $hunk->setNewOffset(11); diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php index 0ae7fdbca9..38a7f5c26b 100644 --- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php +++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php @@ -402,8 +402,8 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker // -echo "test"; // -(empty line) - $hunk = id(new DifferentialHunkModern())->setChanges($context); - $vs_hunk = id(new DifferentialHunkModern())->setChanges($vs_context); + $hunk = id(new DifferentialModernHunk())->setChanges($context); + $vs_hunk = id(new DifferentialModernHunk())->setChanges($vs_context); if ($hunk->makeOldFile() != $vs_hunk->makeOldFile() || $hunk->makeNewFile() != $vs_hunk->makeNewFile()) { return $vs_diff;