diff --git a/src/applications/differential/controller/DifferentialDiffViewController.php b/src/applications/differential/controller/DifferentialDiffViewController.php index 9756634a81..28e7c2fc54 100644 --- a/src/applications/differential/controller/DifferentialDiffViewController.php +++ b/src/applications/differential/controller/DifferentialDiffViewController.php @@ -29,6 +29,17 @@ final class DifferentialDiffViewController extends DifferentialController { ->setURI('/D'.$diff->getRevisionID().'?id='.$diff->getID()); } + $diff_phid = $diff->getPHID(); + $buildables = id(new HarbormasterBuildableQuery()) + ->setViewer($viewer) + ->withBuildablePHIDs(array($diff_phid)) + ->withManualBuildables(false) + ->needBuilds(true) + ->needTargets(true) + ->execute(); + $buildables = mpull($buildables, null, 'getBuildablePHID'); + $diff->attachBuildable(idx($buildables, $diff_phid)); + // TODO: implement optgroup support in AphrontFormSelectControl? $select = array(); $select[] = hsprintf('', pht('Create New Revision'));