Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15284984
D11020.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D11020.diff
View Options
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
@@ -159,6 +159,20 @@
assert_instances_of($changes, 'ArcanistDiffChange');
$diff = self::initializeNewDiff($actor);
+ return self::buildChangesetsFromRawChanges($diff, $changes);
+ }
+
+ public static function newEphemeralFromRawChanges(array $changes) {
+ assert_instances_of($changes, 'ArcanistDiffChange');
+
+ $diff = id(new DifferentialDiff())->makeEphemeral();
+ return self::buildChangesetsFromRawChanges($diff, $changes);
+ }
+
+ private static function buildChangesetsFromRawChanges(
+ DifferentialDiff $diff,
+ array $changes) {
+
// There may not be any changes; initialize the changesets list so that
// we don't throw later when accessing it.
$diff->attachChangesets(array());
diff --git a/src/applications/diffusion/controller/DiffusionChangeController.php b/src/applications/diffusion/controller/DiffusionChangeController.php
--- a/src/applications/diffusion/controller/DiffusionChangeController.php
+++ b/src/applications/diffusion/controller/DiffusionChangeController.php
@@ -22,8 +22,7 @@
$drequest->updateSymbolicCommit($data['effectiveCommit']);
$raw_changes = ArcanistDiffChange::newFromConduit($data['changes']);
- $diff = DifferentialDiff::newFromRawChanges(
- $viewer,
+ $diff = DifferentialDiff::newEphemeralFromRawChanges(
$raw_changes);
$changesets = $diff->getChangesets();
$changeset = reset($changesets);
diff --git a/src/applications/diffusion/controller/DiffusionDiffController.php b/src/applications/diffusion/controller/DiffusionDiffController.php
--- a/src/applications/diffusion/controller/DiffusionDiffController.php
+++ b/src/applications/diffusion/controller/DiffusionDiffController.php
@@ -54,8 +54,7 @@
));
$drequest->updateSymbolicCommit($data['effectiveCommit']);
$raw_changes = ArcanistDiffChange::newFromConduit($data['changes']);
- $diff = DifferentialDiff::newFromRawChanges(
- $user,
+ $diff = DifferentialDiff::newEphemeralFromRawChanges(
$raw_changes);
$changesets = $diff->getChangesets();
$changeset = reset($changesets);
diff --git a/src/applications/diffusion/data/DiffusionPathChange.php b/src/applications/diffusion/data/DiffusionPathChange.php
--- a/src/applications/diffusion/data/DiffusionPathChange.php
+++ b/src/applications/diffusion/data/DiffusionPathChange.php
@@ -147,7 +147,8 @@
array $changes) {
assert_instances_of($changes, 'DiffusionPathChange');
$arcanist_changes = self::convertToArcanistChanges($changes);
- $diff = DifferentialDiff::newFromRawChanges($user, $arcanist_changes);
+ $diff = DifferentialDiff::newEphemeralFromRawChanges(
+ $arcanist_changes);
return $diff->getChangesets();
}
diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
--- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
+++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
@@ -1115,8 +1115,7 @@
$parser = new ArcanistDiffParser();
$changes = $parser->parseDiff($raw_diff);
- $diff = DifferentialDiff::newFromRawChanges(
- $this->getViewer(),
+ $diff = DifferentialDiff::newEphemeralFromRawChanges(
$changes);
return $diff->getChangesets();
}
diff --git a/src/applications/herald/adapter/HeraldCommitAdapter.php b/src/applications/herald/adapter/HeraldCommitAdapter.php
--- a/src/applications/herald/adapter/HeraldCommitAdapter.php
+++ b/src/applications/herald/adapter/HeraldCommitAdapter.php
@@ -346,8 +346,7 @@
$parser = new ArcanistDiffParser();
$changes = $parser->parseDiff($raw);
- $diff = DifferentialDiff::newFromRawChanges(
- PhabricatorUser::getOmnipotentUser(),
+ $diff = DifferentialDiff::newEphemeralFromRawChanges(
$changes);
return $diff;
}
diff --git a/src/infrastructure/diff/PhabricatorDifferenceEngine.php b/src/infrastructure/diff/PhabricatorDifferenceEngine.php
--- a/src/infrastructure/diff/PhabricatorDifferenceEngine.php
+++ b/src/infrastructure/diff/PhabricatorDifferenceEngine.php
@@ -163,8 +163,7 @@
$diff = $this->generateRawDiffFromFileContent($old, $new);
$changes = id(new ArcanistDiffParser())->parseDiff($diff);
- $diff = DifferentialDiff::newFromRawChanges(
- PhabricatorUser::getOmnipotentUser(),
+ $diff = DifferentialDiff::newEphemeralFromRawChanges(
$changes);
return head($diff->getChangesets());
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 5, 11:10 AM (6 d, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225286
Default Alt Text
D11020.diff (4 KB)
Attached To
Mode
D11020: Differential - tighten up access of Differential data from other applications
Attached
Detach File
Event Timeline
Log In to Comment