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

Rename `DifferentialHunk` subclasses for consistency

Summary: Ref T5655.

Test Plan: `arc lint`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T5655

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

+20 -20
+4 -4
src/__phutil_library_map__.php
··· 367 367 'DifferentialHostedMercurialLandingStrategy' => 'applications/differential/landing/DifferentialHostedMercurialLandingStrategy.php', 368 368 'DifferentialHovercardEventListener' => 'applications/differential/event/DifferentialHovercardEventListener.php', 369 369 'DifferentialHunk' => 'applications/differential/storage/DifferentialHunk.php', 370 - 'DifferentialHunkLegacy' => 'applications/differential/storage/DifferentialHunkLegacy.php', 371 - 'DifferentialHunkModern' => 'applications/differential/storage/DifferentialHunkModern.php', 372 370 'DifferentialHunkParser' => 'applications/differential/parser/DifferentialHunkParser.php', 373 371 'DifferentialHunkParserTestCase' => 'applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php', 374 372 'DifferentialHunkQuery' => 'applications/differential/query/DifferentialHunkQuery.php', ··· 382 380 'DifferentialJIRAIssuesField' => 'applications/differential/customfield/DifferentialJIRAIssuesField.php', 383 381 'DifferentialLandingActionMenuEventListener' => 'applications/differential/landing/DifferentialLandingActionMenuEventListener.php', 384 382 'DifferentialLandingStrategy' => 'applications/differential/landing/DifferentialLandingStrategy.php', 383 + 'DifferentialLegacyHunk' => 'applications/differential/storage/DifferentialLegacyHunk.php', 385 384 'DifferentialLintField' => 'applications/differential/customfield/DifferentialLintField.php', 386 385 'DifferentialLintStatus' => 'applications/differential/constants/DifferentialLintStatus.php', 387 386 'DifferentialLocalCommitsView' => 'applications/differential/view/DifferentialLocalCommitsView.php', 388 387 'DifferentialMail' => 'applications/differential/mail/DifferentialMail.php', 389 388 'DifferentialManiphestTasksField' => 'applications/differential/customfield/DifferentialManiphestTasksField.php', 389 + 'DifferentialModernHunk' => 'applications/differential/storage/DifferentialModernHunk.php', 390 390 'DifferentialParseCacheGarbageCollector' => 'applications/differential/garbagecollector/DifferentialParseCacheGarbageCollector.php', 391 391 'DifferentialParseCommitMessageConduitAPIMethod' => 'applications/differential/conduit/DifferentialParseCommitMessageConduitAPIMethod.php', 392 392 'DifferentialParseRenderTestCase' => 'applications/differential/__tests__/DifferentialParseRenderTestCase.php', ··· 3462 3462 'DifferentialDAO', 3463 3463 'PhabricatorPolicyInterface', 3464 3464 ), 3465 - 'DifferentialHunkLegacy' => 'DifferentialHunk', 3466 - 'DifferentialHunkModern' => 'DifferentialHunk', 3467 3465 'DifferentialHunkParserTestCase' => 'PhabricatorTestCase', 3468 3466 'DifferentialHunkQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 3469 3467 'DifferentialHunkTestCase' => 'ArcanistPhutilTestCase', ··· 3475 3473 'DifferentialInlineCommentView' => 'AphrontView', 3476 3474 'DifferentialJIRAIssuesField' => 'DifferentialStoredCustomField', 3477 3475 'DifferentialLandingActionMenuEventListener' => 'PhabricatorEventListener', 3476 + 'DifferentialLegacyHunk' => 'DifferentialHunk', 3478 3477 'DifferentialLintField' => 'DifferentialCustomField', 3479 3478 'DifferentialLocalCommitsView' => 'AphrontView', 3480 3479 'DifferentialMail' => 'PhabricatorMail', 3481 3480 'DifferentialManiphestTasksField' => 'DifferentialCoreCustomField', 3481 + 'DifferentialModernHunk' => 'DifferentialHunk', 3482 3482 'DifferentialParseCacheGarbageCollector' => 'PhabricatorGarbageCollector', 3483 3483 'DifferentialParseCommitMessageConduitAPIMethod' => 'DifferentialConduitAPIMethod', 3484 3484 'DifferentialParseRenderTestCase' => 'PhabricatorTestCase',
+2 -2
src/applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php
··· 15 15 $saw_any_rows = false; 16 16 $console = PhutilConsole::getConsole(); 17 17 18 - $table = new DifferentialHunkLegacy(); 18 + $table = new DifferentialLegacyHunk(); 19 19 foreach (new LiskMigrationIterator($table) as $hunk) { 20 20 $saw_any_rows = true; 21 21 22 22 $id = $hunk->getID(); 23 23 $console->writeOut("%s\n", pht('Migrating hunk %d...', $id)); 24 24 25 - $new_hunk = id(new DifferentialHunkModern()) 25 + $new_hunk = id(new DifferentialModernHunk()) 26 26 ->setChangesetID($hunk->getChangesetID()) 27 27 ->setOldOffset($hunk->getOldOffset()) 28 28 ->setOldLen($hunk->getOldLen())
+2 -2
src/applications/differential/parser/__tests__/DifferentialChangesetParserTestCase.php
··· 3 3 final class DifferentialChangesetParserTestCase extends PhabricatorTestCase { 4 4 5 5 public function testDiffChangesets() { 6 - $hunk = new DifferentialHunkModern(); 6 + $hunk = new DifferentialModernHunk(); 7 7 $hunk->setChanges("+a\n b\n-c"); 8 8 $hunk->setNewOffset(1); 9 9 $hunk->setNewLen(2); ··· 20 20 ); 21 21 22 22 foreach ($tests as $changes => $expected) { 23 - $hunk = new DifferentialHunkModern(); 23 + $hunk = new DifferentialModernHunk(); 24 24 $hunk->setChanges($changes); 25 25 $hunk->setNewOffset(11); 26 26 $hunk->setNewLen(3);
+1 -1
src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php
··· 14 14 $new_len, 15 15 $changes) { 16 16 17 - $hunk = id(new DifferentialHunkModern()) 17 + $hunk = id(new DifferentialModernHunk()) 18 18 ->setOldOffset($old_offset) 19 19 ->setOldLen($old_len) 20 20 ->setNewOffset($new_offset)
+2 -2
src/applications/differential/query/DifferentialHunkQuery.php
··· 34 34 $all_results = array(); 35 35 36 36 // Load modern hunks. 37 - $table = new DifferentialHunkModern(); 37 + $table = new DifferentialModernHunk(); 38 38 $conn_r = $table->establishConnection('r'); 39 39 40 40 $modern_data = queryfx_all( ··· 48 48 49 49 50 50 // Now, load legacy hunks. 51 - $table = new DifferentialHunkLegacy(); 51 + $table = new DifferentialLegacyHunk(); 52 52 $conn_r = $table->establishConnection('r'); 53 53 54 54 $legacy_data = queryfx_all(
+2 -2
src/applications/differential/storage/DifferentialChangeset.php
··· 98 98 public function delete() { 99 99 $this->openTransaction(); 100 100 101 - $legacy_hunks = id(new DifferentialHunkLegacy())->loadAllWhere( 101 + $legacy_hunks = id(new DifferentialLegacyHunk())->loadAllWhere( 102 102 'changesetID = %d', 103 103 $this->getID()); 104 104 foreach ($legacy_hunks as $legacy_hunk) { 105 105 $legacy_hunk->delete(); 106 106 } 107 107 108 - $modern_hunks = id(new DifferentialHunkModern())->loadAllWhere( 108 + $modern_hunks = id(new DifferentialModernHunk())->loadAllWhere( 109 109 'changesetID = %d', 110 110 $this->getID()); 111 111 foreach ($modern_hunks as $modern_hunk) {
+1 -1
src/applications/differential/storage/DifferentialDiff.php
··· 193 193 $hunks = $change->getHunks(); 194 194 if ($hunks) { 195 195 foreach ($hunks as $hunk) { 196 - $dhunk = new DifferentialHunkModern(); 196 + $dhunk = new DifferentialModernHunk(); 197 197 $dhunk->setOldOffset($hunk->getOldOffset()); 198 198 $dhunk->setOldLen($hunk->getOldLength()); 199 199 $dhunk->setNewOffset($hunk->getNewOffset());
+1 -1
src/applications/differential/storage/DifferentialHunkLegacy.php src/applications/differential/storage/DifferentialLegacyHunk.php
··· 1 1 <?php 2 2 3 - final class DifferentialHunkLegacy extends DifferentialHunk { 3 + final class DifferentialLegacyHunk extends DifferentialHunk { 4 4 5 5 protected $changes; 6 6
+1 -1
src/applications/differential/storage/DifferentialHunkModern.php src/applications/differential/storage/DifferentialModernHunk.php
··· 1 1 <?php 2 2 3 - final class DifferentialHunkModern extends DifferentialHunk { 3 + final class DifferentialModernHunk extends DifferentialHunk { 4 4 5 5 const DATATYPE_TEXT = 'text'; 6 6 const DATATYPE_FILE = 'file';
+2 -2
src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php
··· 5 5 public function testMakeChanges() { 6 6 $root = dirname(__FILE__).'/hunk/'; 7 7 8 - $hunk = new DifferentialHunkModern(); 8 + $hunk = new DifferentialModernHunk(); 9 9 $hunk->setChanges(Filesystem::readFile($root.'basic.diff')); 10 10 $hunk->setOldOffset(1); 11 11 $hunk->setNewOffset(11); ··· 23 23 ); 24 24 $this->assertEqual($added, $hunk->getAddedLines()); 25 25 26 - $hunk = new DifferentialHunkModern(); 26 + $hunk = new DifferentialModernHunk(); 27 27 $hunk->setChanges(Filesystem::readFile($root.'newline.diff')); 28 28 $hunk->setOldOffset(1); 29 29 $hunk->setNewOffset(11);
+2 -2
src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
··· 402 402 // -echo "test"; 403 403 // -(empty line) 404 404 405 - $hunk = id(new DifferentialHunkModern())->setChanges($context); 406 - $vs_hunk = id(new DifferentialHunkModern())->setChanges($vs_context); 405 + $hunk = id(new DifferentialModernHunk())->setChanges($context); 406 + $vs_hunk = id(new DifferentialModernHunk())->setChanges($vs_context); 407 407 if ($hunk->makeOldFile() != $vs_hunk->makeOldFile() || 408 408 $hunk->makeNewFile() != $vs_hunk->makeNewFile()) { 409 409 return $vs_diff;