mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Display dependent revisions in revision detail
Summary: I have a chain of revisions sometimes. I want to see also revisions depending on me. Test Plan: Displayed revision in the middle of chain. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3399
This commit is contained in:
parent
3aa54782a7
commit
c52d66e5ba
4 changed files with 59 additions and 2 deletions
|
@ -238,6 +238,7 @@ phutil_register_library_map(array(
|
||||||
'DifferentialDateModifiedFieldSpecification' => 'applications/differential/field/specification/DifferentialDateModifiedFieldSpecification.php',
|
'DifferentialDateModifiedFieldSpecification' => 'applications/differential/field/specification/DifferentialDateModifiedFieldSpecification.php',
|
||||||
'DifferentialDefaultFieldSelector' => 'applications/differential/field/selector/DifferentialDefaultFieldSelector.php',
|
'DifferentialDefaultFieldSelector' => 'applications/differential/field/selector/DifferentialDefaultFieldSelector.php',
|
||||||
'DifferentialDependenciesFieldSpecification' => 'applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php',
|
'DifferentialDependenciesFieldSpecification' => 'applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php',
|
||||||
|
'DifferentialDependsOnFieldSpecification' => 'applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php',
|
||||||
'DifferentialDiff' => 'applications/differential/storage/DifferentialDiff.php',
|
'DifferentialDiff' => 'applications/differential/storage/DifferentialDiff.php',
|
||||||
'DifferentialDiffContentMail' => 'applications/differential/mail/DifferentialDiffContentMail.php',
|
'DifferentialDiffContentMail' => 'applications/differential/mail/DifferentialDiffContentMail.php',
|
||||||
'DifferentialDiffCreateController' => 'applications/differential/controller/DifferentialDiffCreateController.php',
|
'DifferentialDiffCreateController' => 'applications/differential/controller/DifferentialDiffCreateController.php',
|
||||||
|
@ -1420,6 +1421,7 @@ phutil_register_library_map(array(
|
||||||
'DifferentialDateModifiedFieldSpecification' => 'DifferentialFieldSpecification',
|
'DifferentialDateModifiedFieldSpecification' => 'DifferentialFieldSpecification',
|
||||||
'DifferentialDefaultFieldSelector' => 'DifferentialFieldSelector',
|
'DifferentialDefaultFieldSelector' => 'DifferentialFieldSelector',
|
||||||
'DifferentialDependenciesFieldSpecification' => 'DifferentialFieldSpecification',
|
'DifferentialDependenciesFieldSpecification' => 'DifferentialFieldSpecification',
|
||||||
|
'DifferentialDependsOnFieldSpecification' => 'DifferentialFieldSpecification',
|
||||||
'DifferentialDiff' => 'DifferentialDAO',
|
'DifferentialDiff' => 'DifferentialDAO',
|
||||||
'DifferentialDiffContentMail' => 'DifferentialMail',
|
'DifferentialDiffContentMail' => 'DifferentialMail',
|
||||||
'DifferentialDiffCreateController' => 'DifferentialController',
|
'DifferentialDiffCreateController' => 'DifferentialController',
|
||||||
|
|
|
@ -32,6 +32,7 @@ final class DifferentialDefaultFieldSelector
|
||||||
new DifferentialLintFieldSpecification(),
|
new DifferentialLintFieldSpecification(),
|
||||||
new DifferentialUnitFieldSpecification(),
|
new DifferentialUnitFieldSpecification(),
|
||||||
new DifferentialCommitsFieldSpecification(),
|
new DifferentialCommitsFieldSpecification(),
|
||||||
|
new DifferentialDependsOnFieldSpecification(),
|
||||||
new DifferentialDependenciesFieldSpecification(),
|
new DifferentialDependenciesFieldSpecification(),
|
||||||
new DifferentialManiphestTasksFieldSpecification(),
|
new DifferentialManiphestTasksFieldSpecification(),
|
||||||
new DifferentialHostFieldSpecification(),
|
new DifferentialHostFieldSpecification(),
|
||||||
|
|
|
@ -28,7 +28,7 @@ final class DifferentialDependenciesFieldSpecification
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderLabelForRevisionView() {
|
public function renderLabelForRevisionView() {
|
||||||
return 'Depends On:';
|
return 'Dependents:';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForRevisionView() {
|
public function renderValueForRevisionView() {
|
||||||
|
@ -48,7 +48,7 @@ final class DifferentialDependenciesFieldSpecification
|
||||||
private function getDependentRevisionPHIDs() {
|
private function getDependentRevisionPHIDs() {
|
||||||
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
||||||
$this->getRevision()->getPHID(),
|
$this->getRevision()->getPHID(),
|
||||||
PhabricatorEdgeConfig::TYPE_DREV_DEPENDS_ON_DREV);
|
PhabricatorEdgeConfig::TYPE_DREV_DEPENDED_ON_BY_DREV);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2012 Facebook, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
final class DifferentialDependsOnFieldSpecification
|
||||||
|
extends DifferentialFieldSpecification {
|
||||||
|
|
||||||
|
public function shouldAppearOnRevisionView() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredHandlePHIDsForRevisionView() {
|
||||||
|
return $this->getDependentRevisionPHIDs();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function renderLabelForRevisionView() {
|
||||||
|
return 'Depends On:';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function renderValueForRevisionView() {
|
||||||
|
$revision_phids = $this->getDependentRevisionPHIDs();
|
||||||
|
if (!$revision_phids) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$links = array();
|
||||||
|
foreach ($revision_phids as $revision_phids) {
|
||||||
|
$links[] = $this->getHandle($revision_phids)->renderLink();
|
||||||
|
}
|
||||||
|
|
||||||
|
return implode('<br />', $links);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getDependentRevisionPHIDs() {
|
||||||
|
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
||||||
|
$this->getRevision()->getPHID(),
|
||||||
|
PhabricatorEdgeConfig::TYPE_DREV_DEPENDS_ON_DREV);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue