Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15413382
D8359.id19872.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D8359.id19872.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -324,6 +324,7 @@
'DifferentialAffectedPath' => 'applications/differential/storage/DifferentialAffectedPath.php',
'DifferentialApplyPatchField' => 'applications/differential/customfield/DifferentialApplyPatchField.php',
'DifferentialApplyPatchFieldSpecification' => 'applications/differential/field/specification/DifferentialApplyPatchFieldSpecification.php',
+ 'DifferentialArcanistProjectField' => 'applications/differential/customfield/DifferentialArcanistProjectField.php',
'DifferentialArcanistProjectFieldSpecification' => 'applications/differential/field/specification/DifferentialArcanistProjectFieldSpecification.php',
'DifferentialAsanaRepresentationField' => 'applications/differential/customfield/DifferentialAsanaRepresentationField.php',
'DifferentialAsanaRepresentationFieldSpecification' => 'applications/differential/field/specification/DifferentialAsanaRepresentationFieldSpecification.php',
@@ -333,6 +334,7 @@
'DifferentialAuxiliaryField' => 'applications/differential/storage/DifferentialAuxiliaryField.php',
'DifferentialBlameRevisionField' => 'applications/differential/customfield/DifferentialBlameRevisionField.php',
'DifferentialBlameRevisionFieldSpecification' => 'applications/differential/field/specification/DifferentialBlameRevisionFieldSpecification.php',
+ 'DifferentialBranchField' => 'applications/differential/customfield/DifferentialBranchField.php',
'DifferentialBranchFieldSpecification' => 'applications/differential/field/specification/DifferentialBranchFieldSpecification.php',
'DifferentialCCWelcomeMail' => 'applications/differential/mail/DifferentialCCWelcomeMail.php',
'DifferentialCCsFieldSpecification' => 'applications/differential/field/specification/DifferentialCCsFieldSpecification.php',
@@ -462,6 +464,7 @@
'DifferentialReviewersView' => 'applications/differential/view/DifferentialReviewersView.php',
'DifferentialRevision' => 'applications/differential/storage/DifferentialRevision.php',
'DifferentialRevisionControlSystem' => 'applications/differential/constants/DifferentialRevisionControlSystem.php',
+ 'DifferentialRevisionDetailRenderer' => 'applications/differential/controller/DifferentialRevisionDetailRenderer.php',
'DifferentialRevisionDetailView' => 'applications/differential/view/DifferentialRevisionDetailView.php',
'DifferentialRevisionEditController' => 'applications/differential/controller/DifferentialRevisionEditController.php',
'DifferentialRevisionEditControllerPro' => 'applications/differential/controller/DifferentialRevisionEditControllerPro.php',
@@ -2504,6 +2507,7 @@
'ReleephDiffChurnFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php',
'ReleephDiffMessageFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffMessageFieldSpecification.php',
'ReleephDiffSizeFieldSpecification' => 'applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php',
+ 'ReleephDifferentialRevisionDetailRenderer' => 'applications/releeph/differential/ReleephDifferentialRevisionDetailRenderer.php',
'ReleephFieldParseException' => 'applications/releeph/field/exception/ReleephFieldParseException.php',
'ReleephFieldSelector' => 'applications/releeph/field/selector/ReleephFieldSelector.php',
'ReleephFieldSpecification' => 'applications/releeph/field/specification/ReleephFieldSpecification.php',
@@ -2890,6 +2894,7 @@
'DifferentialAffectedPath' => 'DifferentialDAO',
'DifferentialApplyPatchField' => 'DifferentialCustomField',
'DifferentialApplyPatchFieldSpecification' => 'DifferentialFieldSpecification',
+ 'DifferentialArcanistProjectField' => 'DifferentialCustomField',
'DifferentialArcanistProjectFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialAsanaRepresentationField' => 'DifferentialCustomField',
'DifferentialAsanaRepresentationFieldSpecification' => 'DifferentialFieldSpecification',
@@ -2898,6 +2903,7 @@
'DifferentialAuthorFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialBlameRevisionField' => 'DifferentialStoredCustomField',
'DifferentialBlameRevisionFieldSpecification' => 'DifferentialFieldSpecification',
+ 'DifferentialBranchField' => 'DifferentialCustomField',
'DifferentialBranchFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialCCWelcomeMail' => 'DifferentialReviewRequestMail',
'DifferentialCCsFieldSpecification' => 'DifferentialFieldSpecification',
diff --git a/src/applications/differential/customfield/DifferentialArcanistProjectField.php b/src/applications/differential/customfield/DifferentialArcanistProjectField.php
new file mode 100644
--- /dev/null
+++ b/src/applications/differential/customfield/DifferentialArcanistProjectField.php
@@ -0,0 +1,42 @@
+<?php
+
+final class DifferentialArcanistProjectField
+ extends DifferentialCustomField {
+
+ public function getFieldKey() {
+ return 'differential:arcanist-project';
+ }
+
+ public function getFieldName() {
+ return pht('Arcanist Project');
+ }
+
+ public function getFieldDescription() {
+ return pht('Shows arcanist project name.');
+ }
+
+ public function shouldAppearInPropertyView() {
+ return true;
+ }
+
+ public function renderPropertyViewLabel() {
+ return $this->getFieldName();
+ }
+
+ public function getRequiredHandlePHIDsForPropertyView() {
+ $phid = $this->getArcanistProjectPHID();
+ if ($phid) {
+ return array($phid);
+ }
+ return array();
+ }
+
+ public function renderPropertyViewValue(array $handles) {
+ return $this->renderHandleList($handles);
+ }
+
+ private function getArcanistProjectPHID() {
+ return $this->getObject()->getActiveDiff()->getArcanistProjectPHID();
+ }
+
+}
diff --git a/src/applications/differential/customfield/DifferentialBranchField.php b/src/applications/differential/customfield/DifferentialBranchField.php
new file mode 100644
--- /dev/null
+++ b/src/applications/differential/customfield/DifferentialBranchField.php
@@ -0,0 +1,45 @@
+<?php
+
+final class DifferentialBranchField
+ extends DifferentialCustomField {
+
+ public function getFieldKey() {
+ return 'differential:branch';
+ }
+
+ public function getFieldName() {
+ return pht('Branch');
+ }
+
+ public function getFieldDescription() {
+ return pht('Shows the branch a diff came from.');
+ }
+
+ public function shouldAppearInPropertyView() {
+ return true;
+ }
+
+ public function renderPropertyViewLabel() {
+ return $this->getFieldName();
+ }
+
+ public function renderPropertyViewValue(array $handles) {
+ return $this->getBranchDescription($this->getObject()->getActiveDiff());
+ }
+
+ private function getBranchDescription(DifferentialDiff $diff) {
+ $branch = $diff->getBranch();
+ $bookmark = $diff->getBookmark();
+
+ if (strlen($branch) && strlen($bookmark)) {
+ return pht('%s (bookmark) on %s (branch)', $bookmark, $branch);
+ } else if (strlen($bookmark)) {
+ return pht('%s (bookmark)', $bookmark);
+ } else if (strlen($branch)) {
+ return $branch;
+ } else {
+ return null;
+ }
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 20 2025, 6:22 PM (5 w, 8 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7712743
Default Alt Text
D8359.id19872.diff (7 KB)
Attached To
Mode
D8359: Add Branch and Arcanist Project CustomFields
Attached
Detach File
Event Timeline
Log In to Comment