Page MenuHomePhabricator

D8359.diff
No OneTemporary

D8359.diff

Index: src/__phutil_library_map__.php
===================================================================
--- src/__phutil_library_map__.php
+++ 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',
Index: src/applications/differential/customfield/DifferentialArcanistProjectField.php
===================================================================
--- /dev/null
+++ 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();
+ }
+
+}
Index: src/applications/differential/customfield/DifferentialBranchField.php
===================================================================
--- /dev/null
+++ 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

Mime Type
text/plain
Expires
Wed, Dec 25, 8:29 AM (9 h, 14 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6925647
Default Alt Text
D8359.diff (7 KB)

Event Timeline