Page MenuHomePhabricator

D9293.diff
No OneTemporary

D9293.diff

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 DifferentialHunkLegacy();
+ $hunk = new DifferentialHunkModern();
$hunk->setChanges("+a\n b\n-c");
$hunk->setNewOffset(1);
$hunk->setNewLen(2);
@@ -20,7 +20,7 @@
);
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
--- 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 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
--- a/src/applications/differential/storage/DifferentialChangeset.php
+++ b/src/applications/differential/storage/DifferentialChangeset.php
@@ -76,11 +76,18 @@
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
--- a/src/applications/differential/storage/DifferentialDiff.php
+++ b/src/applications/differential/storage/DifferentialDiff.php
@@ -132,7 +132,7 @@
$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
--- 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 DifferentialHunkLegacy();
+ $hunk = new DifferentialHunkModern();
$hunk->setChanges(Filesystem::readFile($root.'basic.diff'));
$hunk->setOldOffset(1);
$hunk->setNewOffset(11);
@@ -23,7 +23,7 @@
);
$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
--- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
+++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
@@ -382,8 +382,8 @@
// -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;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 11, 3:33 AM (1 w, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6764692
Default Alt Text
D9293.diff (4 KB)

Event Timeline