1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00

Don't raise a policy exception if a user can't see the parent revision of a new diff

Summary: Ref T603. We currently bomb out here, but should just continue forward. I'm fairly certain we don't even use this for anything anymore (it has been replaced by "depends on") but need to check that.

Test Plan: Created a new revision with `arc diff`.

Reviewers: ljalonen, btrahan, #blessed_reviewers, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7255
This commit is contained in:
epriestley 2013-10-07 12:51:04 -07:00
parent c6f9316a77
commit 2abbd51868

View file

@ -59,11 +59,15 @@ final class ConduitAPI_differential_creatediff_Method extends ConduitAPIMethod {
$parent_id = $request->getValue('parentRevisionID');
if ($parent_id) {
// NOTE: If the viewer can't see the parent revision, just don't set
// a parent revision ID. This isn't used for anything meaningful.
// TODO: Can we delete this entirely?
$parent_rev = id(new DifferentialRevisionQuery())
->setViewer($request->getUser())
->withIDs(array($parent_id))
->executeOne();
->execute();
if ($parent_rev) {
$parent_rev = head($parent_rev);
if ($parent_rev->getStatus() !=
ArcanistDifferentialRevisionStatus::CLOSED) {
$diff->setParentRevisionID($parent_id);