diff --git a/src/applications/differential/parser/__tests__/DifferentialChangesetParserTestCase.php b/src/applications/differential/parser/__tests__/DifferentialChangesetParserTestCase.php index d1f8876103..5003515acf 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 DifferentialHunkLegacy(); + $hunk = new DifferentialHunkModern(); $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 DifferentialHunkLegacy(); + $hunk = new DifferentialHunkModern(); $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 971b356775..9147ea3ad9 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 DifferentialHunkLegacy()) + $hunk = id(new DifferentialHunkModern()) ->setOldOffset($old_offset) ->setOldLen($old_len) ->setNewOffset($new_offset) diff --git a/src/applications/differential/storage/DifferentialChangeset.php b/src/applications/differential/storage/DifferentialChangeset.php index cffe77d83e..743bf172b1 100644 --- a/src/applications/differential/storage/DifferentialChangeset.php +++ b/src/applications/differential/storage/DifferentialChangeset.php @@ -76,11 +76,18 @@ final class DifferentialChangeset extends DifferentialDAO public function delete() { $this->openTransaction(); - $hunks = id(new DifferentialHunkLegacy())->loadAllWhere( + $legacy_hunks = id(new DifferentialHunkLegacy())->loadAllWhere( 'changesetID = %d', $this->getID()); - foreach ($hunks as $hunk) { - $hunk->delete(); + foreach ($legacy_hunks as $legacy_hunk) { + $legacy_hunk->delete(); + } + + $modern_hunks = id(new DifferentialHunkModern())->loadAllWhere( + 'changesetID = %d', + $this->getID()); + foreach ($modern_hunks as $modern_hunk) { + $modern_hunk->delete(); } $this->unsavedHunks = array(); diff --git a/src/applications/differential/storage/DifferentialDiff.php b/src/applications/differential/storage/DifferentialDiff.php index 7fe40ff04e..720a5d2d4f 100644 --- a/src/applications/differential/storage/DifferentialDiff.php +++ b/src/applications/differential/storage/DifferentialDiff.php @@ -132,7 +132,7 @@ final class DifferentialDiff $hunks = $change->getHunks(); if ($hunks) { foreach ($hunks as $hunk) { - $dhunk = new DifferentialHunkLegacy(); + $dhunk = new DifferentialHunkModern(); $dhunk->setOldOffset($hunk->getOldOffset()); $dhunk->setOldLen($hunk->getOldLength()); $dhunk->setNewOffset($hunk->getNewOffset()); diff --git a/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php b/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php index 6e4d499eb8..785f5e7422 100644 --- a/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php +++ b/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php @@ -5,7 +5,7 @@ final class DifferentialHunkTestCase extends ArcanistPhutilTestCase { public function testMakeChanges() { $root = dirname(__FILE__).'/hunk/'; - $hunk = new DifferentialHunkLegacy(); + $hunk = new DifferentialHunkModern(); $hunk->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 DifferentialHunkLegacy(); + $hunk = new DifferentialHunkModern(); $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 c12bdd5e0e..9b1fa004ed 100644 --- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php +++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php @@ -382,8 +382,8 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker // -echo "test"; // -(empty line) - $hunk = id(new DifferentialHunkLegacy())->setChanges($context); - $vs_hunk = id(new DifferentialHunkLegacy())->setChanges($vs_context); + $hunk = id(new DifferentialHunkModern())->setChanges($context); + $vs_hunk = id(new DifferentialHunkModern())->setChanges($vs_context); if ($hunk->makeOldFile() != $vs_hunk->makeOldFile() || $hunk->makeNewFile() != $vs_hunk->makeNewFile()) { return $vs_diff;