@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Simplify "Repository" field in Differential

Summary: Ref T11114. Keep mail and UI, toss the rest.

Test Plan: Edited/viewed repositories.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11114

Differential Revision: https://secure.phabricator.com/D17087

+2 -101
-101
src/applications/differential/customfield/DifferentialRepositoryField.php
··· 20 20 return $revision->getRepositoryPHID(); 21 21 } 22 22 23 - protected function writeValueToRevision( 24 - DifferentialRevision $revision, 25 - $value) { 26 - $revision->setRepositoryPHID($value); 27 - } 28 - 29 - public function readValueFromRequest(AphrontRequest $request) { 30 - $phids = $request->getArr($this->getFieldKey()); 31 - $first = head($phids); 32 - $this->setValue(nonempty($first, null)); 33 - } 34 - 35 - public function renderEditControl(array $handles) { 36 - if ($this->getValue()) { 37 - $value = array($this->getValue()); 38 - } else { 39 - $value = array(); 40 - } 41 - 42 - return id(new AphrontFormTokenizerControl()) 43 - ->setUser($this->getViewer()) 44 - ->setName($this->getFieldKey()) 45 - ->setDatasource(new DiffusionRepositoryDatasource()) 46 - ->setValue($value) 47 - ->setError($this->getFieldError()) 48 - ->setLabel($this->getFieldName()) 49 - ->setLimit(1); 50 - } 51 - 52 - public function getApplicationTransactionRequiredHandlePHIDs( 53 - PhabricatorApplicationTransaction $xaction) { 54 - 55 - $old = $xaction->getOldValue(); 56 - $new = $xaction->getNewValue(); 57 - 58 - $phids = array(); 59 - if ($old) { 60 - $phids[] = $old; 61 - } 62 - if ($new) { 63 - $phids[] = $new; 64 - } 65 - 66 - return $phids; 67 - } 68 - 69 - public function getApplicationTransactionTitle( 70 - PhabricatorApplicationTransaction $xaction) { 71 - $author_phid = $xaction->getAuthorPHID(); 72 - $old = $xaction->getOldValue(); 73 - $new = $xaction->getNewValue(); 74 - 75 - if ($old && $new) { 76 - return pht( 77 - '%s changed the repository for this revision from %s to %s.', 78 - $xaction->renderHandleLink($author_phid), 79 - $xaction->renderHandleLink($old), 80 - $xaction->renderHandleLink($new)); 81 - } else if ($new) { 82 - return pht( 83 - '%s set the repository for this revision to %s.', 84 - $xaction->renderHandleLink($author_phid), 85 - $xaction->renderHandleLink($new)); 86 - } else { 87 - return pht( 88 - '%s removed %s as the repository for this revision.', 89 - $xaction->renderHandleLink($author_phid), 90 - $xaction->renderHandleLink($old)); 91 - } 92 - } 93 - 94 - public function getApplicationTransactionTitleForFeed( 95 - PhabricatorApplicationTransaction $xaction) { 96 - 97 - $object_phid = $xaction->getObjectPHID(); 98 - $author_phid = $xaction->getAuthorPHID(); 99 - $old = $xaction->getOldValue(); 100 - $new = $xaction->getNewValue(); 101 - 102 - if ($old && $new) { 103 - return pht( 104 - '%s updated the repository for %s from %s to %s.', 105 - $xaction->renderHandleLink($author_phid), 106 - $xaction->renderHandleLink($object_phid), 107 - $xaction->renderHandleLink($old), 108 - $xaction->renderHandleLink($new)); 109 - } else if ($new) { 110 - return pht( 111 - '%s set the repository for %s to %s.', 112 - $xaction->renderHandleLink($author_phid), 113 - $xaction->renderHandleLink($object_phid), 114 - $xaction->renderHandleLink($new)); 115 - } else { 116 - return pht( 117 - '%s removed the repository for %s. (Repository was %s.)', 118 - $xaction->renderHandleLink($author_phid), 119 - $xaction->renderHandleLink($object_phid), 120 - $xaction->renderHandleLink($old)); 121 - } 122 - } 123 - 124 23 public function shouldAppearInPropertyView() { 125 24 return true; 126 25 }
+2
src/applications/differential/storage/DifferentialTransaction.php
··· 37 37 return new DifferentialRevisionTitleTransaction(); 38 38 case 'differential:test-plan': 39 39 return new DifferentialRevisionTestPlanTransaction(); 40 + case 'differential:repository': 41 + return new DifferentialRevisionRepositoryTransaction(); 40 42 } 41 43 } 42 44