Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14055668
D11470.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
11 KB
Referenced Files
None
Subscribers
None
D11470.diff
View Options
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
@@ -367,8 +367,6 @@
'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 @@
'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 @@
'DifferentialDAO',
'PhabricatorPolicyInterface',
),
- 'DifferentialHunkLegacy' => 'DifferentialHunk',
- 'DifferentialHunkModern' => 'DifferentialHunk',
'DifferentialHunkParserTestCase' => 'PhabricatorTestCase',
'DifferentialHunkQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'DifferentialHunkTestCase' => 'ArcanistPhutilTestCase',
@@ -3475,10 +3473,12 @@
'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
--- a/src/applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php
+++ b/src/applications/differential/management/PhabricatorHunksManagementMigrateWorkflow.php
@@ -15,14 +15,14 @@
$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
--- 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 @@
);
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
--- a/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php
+++ b/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php
@@ -14,7 +14,7 @@
$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
--- a/src/applications/differential/query/DifferentialHunkQuery.php
+++ b/src/applications/differential/query/DifferentialHunkQuery.php
@@ -34,7 +34,7 @@
$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 @@
// 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
--- a/src/applications/differential/storage/DifferentialChangeset.php
+++ b/src/applications/differential/storage/DifferentialChangeset.php
@@ -98,14 +98,14 @@
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
--- a/src/applications/differential/storage/DifferentialDiff.php
+++ b/src/applications/differential/storage/DifferentialDiff.php
@@ -193,7 +193,7 @@
$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
rename from src/applications/differential/storage/DifferentialHunkLegacy.php
rename to src/applications/differential/storage/DifferentialLegacyHunk.php
--- a/src/applications/differential/storage/DifferentialHunkLegacy.php
+++ b/src/applications/differential/storage/DifferentialLegacyHunk.php
@@ -1,6 +1,6 @@
<?php
-final class DifferentialHunkLegacy extends DifferentialHunk {
+final class DifferentialLegacyHunk extends DifferentialHunk {
protected $changes;
diff --git a/src/applications/differential/storage/DifferentialHunkModern.php b/src/applications/differential/storage/DifferentialModernHunk.php
rename from src/applications/differential/storage/DifferentialHunkModern.php
rename to src/applications/differential/storage/DifferentialModernHunk.php
--- a/src/applications/differential/storage/DifferentialHunkModern.php
+++ b/src/applications/differential/storage/DifferentialModernHunk.php
@@ -1,6 +1,6 @@
<?php
-final class DifferentialHunkModern extends DifferentialHunk {
+final class DifferentialModernHunk extends DifferentialHunk {
const DATATYPE_TEXT = 'text';
const DATATYPE_FILE = 'file';
diff --git a/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php b/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php
--- a/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php
+++ b/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php
@@ -5,7 +5,7 @@
public function testMakeChanges() {
$root = dirname(__FILE__).'/hunk/';
- $hunk = new DifferentialHunkModern();
+ $hunk = new DifferentialModernHunk();
$hunk->setChanges(Filesystem::readFile($root.'basic.diff'));
$hunk->setOldOffset(1);
$hunk->setNewOffset(11);
@@ -23,7 +23,7 @@
);
$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
--- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
+++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
@@ -402,8 +402,8 @@
// -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;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 2:32 PM (1 d, 4 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6746825
Default Alt Text
D11470.diff (11 KB)
Attached To
Mode
D11470: Rename `DifferentialHunk` subclasses for consistency
Attached
Detach File
Event Timeline
Log In to Comment