Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14020587
D7420.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D7420.diff
View Options
Index: src/applications/diffusion/controller/DiffusionCommitController.php
===================================================================
--- src/applications/diffusion/controller/DiffusionCommitController.php
+++ src/applications/diffusion/controller/DiffusionCommitController.php
@@ -414,6 +414,8 @@
->withSourcePHIDs(array($commit_phid))
->withEdgeTypes(array(
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK,
+ PhabricatorEdgeConfig::TYPE_COMMIT_RELATED_TO_COMMIT,
+ PhabricatorEdgeConfig::TYPE_COMMIT_RELATED_FROM_COMMIT,
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_PROJECT,
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV,
));
@@ -422,6 +424,10 @@
$task_phids = array_keys(
$edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK]);
+ $commit_related_from_phids = array_keys(
+ $edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_RELATED_FROM_COMMIT]);
+ $commit_related_to_phids = array_keys(
+ $edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_RELATED_TO_COMMIT]);
$proj_phids = array_keys(
$edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_PROJECT]);
$revision_phid = key(
@@ -563,6 +569,24 @@
$props['References'] = $refs;
}
+ if ($commit_related_from_phids) {
+ $commit_list = array();
+ foreach ($commit_related_from_phids as $phid) {
+ $commit_list[] = $handles[$phid]->renderLink();
+ }
+ $commit_list = phutil_implode_html(phutil_tag('br'), $commit_list);
+ $props['Related by Commits'] = $commit_list;
+ }
+
+ if ($commit_related_to_phids) {
+ $commit_list = array();
+ foreach ($commit_related_to_phids as $phid) {
+ $commit_list[] = $handles[$phid]->renderLink();
+ }
+ $commit_list = phutil_implode_html(phutil_tag('br'), $commit_list);
+ $props['Related to Commits'] = $commit_list;
+ }
+
if ($task_phids) {
$task_list = array();
foreach ($task_phids as $phid) {
@@ -957,6 +981,14 @@
->setIcon('download');
$actions->addAction($action);
+ $action = id(new PhabricatorActionView())
+ ->setName(pht('Edit related Revision'))
+ ->setIcon('attach')
+ ->setHref('/search/attach/'.$commit->getPHID().'/CMIT/dependencies/')
+ ->setWorkflow(true)
+ ->setDisabled(!$can_edit);
+ $actions->addAction($action);
+
return $actions;
}
Index: src/applications/search/controller/PhabricatorSearchAttachController.php
===================================================================
--- src/applications/search/controller/PhabricatorSearchAttachController.php
+++ src/applications/search/controller/PhabricatorSearchAttachController.php
@@ -297,6 +297,7 @@
$map = array(
$t_cmit => array(
$t_task => PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK,
+ $t_cmit => PhabricatorEdgeConfig::TYPE_COMMIT_RELATED_TO_COMMIT,
),
$t_task => array(
$t_cmit => PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT,
Index: src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
===================================================================
--- src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
+++ src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
@@ -60,6 +60,9 @@
const TYPE_MOCK_HAS_TASK = 37;
const TYPE_TASK_HAS_MOCK = 38;
+ const TYPE_COMMIT_RELATED_TO_COMMIT = 39;
+ const TYPE_COMMIT_RELATED_FROM_COMMIT = 40;
+
const TYPE_TEST_NO_CYCLE = 9000;
const TYPE_PHOB_HAS_ASANATASK = 80001;
@@ -76,6 +79,11 @@
self::TYPE_TASK_HAS_COMMIT => self::TYPE_COMMIT_HAS_TASK,
self::TYPE_COMMIT_HAS_TASK => self::TYPE_TASK_HAS_COMMIT,
+ self::TYPE_COMMIT_RELATED_TO_COMMIT =>
+ self::TYPE_COMMIT_RELATED_FROM_COMMIT,
+ self::TYPE_COMMIT_RELATED_FROM_COMMIT =>
+ self::TYPE_COMMIT_RELATED_TO_COMMIT,
+
self::TYPE_TASK_DEPENDS_ON_TASK => self::TYPE_TASK_DEPENDED_ON_BY_TASK,
self::TYPE_TASK_DEPENDED_ON_BY_TASK => self::TYPE_TASK_DEPENDS_ON_TASK,
@@ -134,7 +142,7 @@
self::TYPE_REVIEWER_FOR_DREV => self::TYPE_DREV_HAS_REVIEWER,
self::TYPE_PHOB_HAS_JIRAISSUE => self::TYPE_JIRAISSUE_HAS_PHOB,
- self:: TYPE_JIRAISSUE_HAS_PHOB => self::TYPE_PHOB_HAS_JIRAISSUE
+ self::TYPE_JIRAISSUE_HAS_PHOB => self::TYPE_PHOB_HAS_JIRAISSUE
);
return idx($map, $edge_type);
@@ -142,9 +150,10 @@
public static function shouldPreventCycles($edge_type) {
static $map = array(
- self::TYPE_TEST_NO_CYCLE => true,
- self::TYPE_TASK_DEPENDS_ON_TASK => true,
- self::TYPE_DREV_DEPENDS_ON_DREV => true,
+ self::TYPE_TEST_NO_CYCLE => true,
+ self::TYPE_COMMIT_RELATED_TO_COMMIT => true,
+ self::TYPE_TASK_DEPENDS_ON_TASK => true,
+ self::TYPE_DREV_DEPENDS_ON_DREV => true,
);
return isset($map[$edge_type]);
}
@@ -182,6 +191,7 @@
case self::TYPE_TASK_HAS_COMMIT:
case self::TYPE_PROJECT_HAS_COMMIT:
case self::TYPE_DREV_HAS_COMMIT:
+ case self::TYPE_COMMIT_RELATED_TO_COMMIT:
return '%s edited commit(s), added %d: %s; removed %d: %s.';
case self::TYPE_COMMIT_HAS_TASK:
case self::TYPE_TASK_DEPENDS_ON_TASK:
@@ -254,6 +264,7 @@
case self::TYPE_TASK_HAS_COMMIT:
case self::TYPE_PROJECT_HAS_COMMIT:
case self::TYPE_DREV_HAS_COMMIT:
+ case self::TYPE_COMMIT_RELATED_TO_COMMIT:
return '%s added %d commit(s): %s.';
case self::TYPE_TASK_DEPENDS_ON_TASK:
return '%s added %d dependencie(s): %s.';
@@ -323,6 +334,7 @@
case self::TYPE_TASK_HAS_COMMIT:
case self::TYPE_PROJECT_HAS_COMMIT:
case self::TYPE_DREV_HAS_COMMIT:
+ case self::TYPE_COMMIT_RELATED_TO_COMMIT:
return '%s removed %d commit(s): %s.';
case self::TYPE_TASK_DEPENDS_ON_TASK:
return '%s removed %d dependencie(s): %s.';
@@ -392,6 +404,7 @@
case self::TYPE_TASK_HAS_COMMIT:
case self::TYPE_PROJECT_HAS_COMMIT:
case self::TYPE_DREV_HAS_COMMIT:
+ case self::TYPE_COMMIT_RELATED_TO_COMMIT:
return '%s updated commits of %s.';
case self::TYPE_COMMIT_HAS_TASK:
case self::TYPE_TASK_DEPENDS_ON_TASK:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 12:53 AM (1 d, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6746974
Default Alt Text
D7420.diff (6 KB)
Attached To
Mode
D7420: Add relations between commits
Attached
Detach File
Event Timeline
Log In to Comment