@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.

Remove DifferentialComment

Summary: Ref T2222. Remove this; no more callsites.

Test Plan: `grep`

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

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

+16 -385
+12 -20
resources/celerity/map.php
··· 11 11 'core.pkg.js' => 'b7bdab05', 12 12 'darkconsole.pkg.js' => 'ca8671ce', 13 13 'differential.pkg.css' => 'd1b3a605', 14 - 'differential.pkg.js' => 'e0d3b0da', 14 + 'differential.pkg.js' => '11a5b750', 15 15 'diffusion.pkg.css' => '3783278d', 16 16 'diffusion.pkg.js' => '5b4010f4', 17 17 'javelin.pkg.js' => '5b0f988e', ··· 357 357 'rsrc/js/application/conpherence/behavior-widget-pane.js' => 'd8ef8659', 358 358 'rsrc/js/application/countdown/timer.js' => '889c96f3', 359 359 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'f2441746', 360 - 'rsrc/js/application/differential/behavior-accept-with-errors.js' => 'e12c760a', 361 360 'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => '533a187b', 362 361 'rsrc/js/application/differential/behavior-comment-jump.js' => '71755c79', 363 362 'rsrc/js/application/differential/behavior-comment-preview.js' => '127f2018', ··· 546 545 'javelin-behavior-countdown-timer' => '889c96f3', 547 546 'javelin-behavior-dark-console' => 'e9fdb5e5', 548 547 'javelin-behavior-device' => '03d6ed07', 549 - 'javelin-behavior-differential-accept-with-errors' => 'e12c760a', 550 548 'javelin-behavior-differential-add-reviewers-and-ccs' => '533a187b', 551 549 'javelin-behavior-differential-comment-jump' => '71755c79', 552 550 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', ··· 1817 1815 1 => 'javelin-util', 1818 1816 2 => 'javelin-request', 1819 1817 ), 1820 - 'e12c760a' => 1821 - array( 1822 - 0 => 'javelin-behavior', 1823 - 1 => 'javelin-dom', 1824 - ), 1825 1818 'e1ff79b1' => 1826 1819 array( 1827 1820 0 => 'javelin-behavior', ··· 2140 2133 4 => 'javelin-behavior-differential-populate', 2141 2134 5 => 'javelin-behavior-differential-show-more', 2142 2135 6 => 'javelin-behavior-differential-diff-radios', 2143 - 7 => 'javelin-behavior-differential-accept-with-errors', 2144 - 8 => 'javelin-behavior-differential-comment-jump', 2145 - 9 => 'javelin-behavior-differential-add-reviewers-and-ccs', 2146 - 10 => 'javelin-behavior-differential-keyboard-navigation', 2147 - 11 => 'javelin-behavior-aphront-drag-and-drop-textarea', 2148 - 12 => 'javelin-behavior-phabricator-object-selector', 2149 - 13 => 'javelin-behavior-repository-crossreference', 2150 - 14 => 'javelin-behavior-load-blame', 2151 - 15 => 'differential-inline-comment-editor', 2152 - 16 => 'javelin-behavior-differential-dropdown-menus', 2153 - 17 => 'javelin-behavior-differential-toggle-files', 2154 - 18 => 'javelin-behavior-differential-user-select', 2136 + 7 => 'javelin-behavior-differential-comment-jump', 2137 + 8 => 'javelin-behavior-differential-add-reviewers-and-ccs', 2138 + 9 => 'javelin-behavior-differential-keyboard-navigation', 2139 + 10 => 'javelin-behavior-aphront-drag-and-drop-textarea', 2140 + 11 => 'javelin-behavior-phabricator-object-selector', 2141 + 12 => 'javelin-behavior-repository-crossreference', 2142 + 13 => 'javelin-behavior-load-blame', 2143 + 14 => 'differential-inline-comment-editor', 2144 + 15 => 'javelin-behavior-differential-dropdown-menus', 2145 + 16 => 'javelin-behavior-differential-toggle-files', 2146 + 17 => 'javelin-behavior-differential-user-select', 2155 2147 ), 2156 2148 'diffusion.pkg.css' => 2157 2149 array(
+4 -4
resources/sql/autopatches/20140212.dx.1.armageddon.php
··· 42 42 $metadata = array(); 43 43 } 44 44 45 - $key_cc = DifferentialComment::METADATA_ADDED_CCS; 46 - $key_add_rev = DifferentialComment::METADATA_ADDED_REVIEWERS; 47 - $key_rem_rev = DifferentialComment::METADATA_REMOVED_REVIEWERS; 48 - $key_diff_id = DifferentialComment::METADATA_DIFF_ID; 45 + $key_cc = 'added-ccs'; 46 + $key_add_rev = 'added-reviewers'; 47 + $key_rem_rev = 'removed-reviewers'; 48 + $key_diff_id = 'diff-id'; 49 49 50 50 $xactions = array(); 51 51
-2
src/__phutil_library_map__.php
··· 343 343 'DifferentialChangesetTwoUpRenderer' => 'applications/differential/render/DifferentialChangesetTwoUpRenderer.php', 344 344 'DifferentialChangesetTwoUpTestRenderer' => 'applications/differential/render/DifferentialChangesetTwoUpTestRenderer.php', 345 345 'DifferentialChangesetViewController' => 'applications/differential/controller/DifferentialChangesetViewController.php', 346 - 'DifferentialComment' => 'applications/differential/storage/DifferentialComment.php', 347 346 'DifferentialCommentPreviewController' => 'applications/differential/controller/DifferentialCommentPreviewController.php', 348 347 'DifferentialCommentSaveController' => 'applications/differential/controller/DifferentialCommentSaveController.php', 349 348 'DifferentialCommitMessageParser' => 'applications/differential/parser/DifferentialCommitMessageParser.php', ··· 2864 2863 'DifferentialChangesetTwoUpRenderer' => 'DifferentialChangesetHTMLRenderer', 2865 2864 'DifferentialChangesetTwoUpTestRenderer' => 'DifferentialChangesetTestRenderer', 2866 2865 'DifferentialChangesetViewController' => 'DifferentialController', 2867 - 'DifferentialComment' => 'PhabricatorMarkupInterface', 2868 2866 'DifferentialCommentPreviewController' => 'DifferentialController', 2869 2867 'DifferentialCommentSaveController' => 'DifferentialController', 2870 2868 'DifferentialCommitMessageParserTestCase' => 'PhabricatorTestCase',
-359
src/applications/differential/storage/DifferentialComment.php
··· 1 - <?php 2 - 3 - /** 4 - * Temporary proxy shell around ApplicationTransactions. 5 - */ 6 - final class DifferentialComment 7 - implements PhabricatorMarkupInterface { 8 - 9 - const METADATA_ADDED_REVIEWERS = 'added-reviewers'; 10 - const METADATA_REMOVED_REVIEWERS = 'removed-reviewers'; 11 - const METADATA_ADDED_CCS = 'added-ccs'; 12 - const METADATA_DIFF_ID = 'diff-id'; 13 - 14 - const MARKUP_FIELD_BODY = 'markup:body'; 15 - 16 - private $arbitraryDiffForFacebook; 17 - private $proxyComment; 18 - private $proxy; 19 - 20 - public function __construct() { 21 - $this->proxy = new DifferentialTransaction(); 22 - } 23 - 24 - public function __clone() { 25 - $this->proxy = clone $this->proxy; 26 - if ($this->proxyComment) { 27 - $this->proxyComment = clone $this->proxyComment; 28 - } 29 - } 30 - 31 - public static function newFromModernTransaction( 32 - DifferentialTransaction $xaction) { 33 - 34 - $obj = new DifferentialComment(); 35 - $obj->proxy = $xaction; 36 - 37 - if ($xaction->hasComment()) { 38 - $obj->proxyComment = $xaction->getComment(); 39 - } 40 - 41 - return $obj; 42 - } 43 - 44 - public function getPHID() { 45 - return $this->proxy->getPHID(); 46 - } 47 - 48 - public function getContent() { 49 - return $this->getProxyComment()->getContent(); 50 - } 51 - 52 - public function setContent($content) { 53 - $this->getProxyComment()->setContent($content); 54 - return $this; 55 - } 56 - 57 - public function getAuthorPHID() { 58 - return $this->proxy->getAuthorPHID(); 59 - } 60 - 61 - public function setAuthorPHID($author_phid) { 62 - $this->proxy->setAuthorPHID($author_phid); 63 - return $this; 64 - } 65 - 66 - public function setContentSource($content_source) { 67 - $this->proxy->setContentSource($content_source); 68 - $this->proxyComment->setContentSource($content_source); 69 - return $this; 70 - } 71 - 72 - public function setAction($action) { 73 - $meta = array(); 74 - switch ($action) { 75 - case DifferentialAction::ACTION_COMMENT: 76 - $type = PhabricatorTransactions::TYPE_COMMENT; 77 - $old = null; 78 - $new = null; 79 - break; 80 - case DifferentialAction::ACTION_ADDREVIEWERS: 81 - $type = PhabricatorTransactions::TYPE_EDGE; 82 - $old = array(); 83 - $new = array(); 84 - $meta = array( 85 - 'edge:type' => PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER, 86 - ); 87 - break; 88 - case DifferentialAction::ACTION_ADDCCS: 89 - $type = PhabricatorTransactions::TYPE_SUBSCRIBERS; 90 - $old = array(); 91 - $new = array(); 92 - break; 93 - case DifferentialAction::ACTION_UPDATE: 94 - $type = DifferentialTransaction::TYPE_UPDATE; 95 - $old = null; 96 - $new = null; 97 - break; 98 - case DifferentialTransaction::TYPE_INLINE: 99 - $type = $action; 100 - $old = null; 101 - $new = null; 102 - break; 103 - default: 104 - $type = DifferentialTransaction::TYPE_ACTION; 105 - $old = null; 106 - $new = $action; 107 - break; 108 - } 109 - 110 - $xaction = $this->proxy; 111 - 112 - $xaction 113 - ->setTransactionType($type) 114 - ->setOldValue($old) 115 - ->setNewValue($new); 116 - 117 - if ($meta) { 118 - foreach ($meta as $key => $value) { 119 - $xaction->setMetadataValue($key, $value); 120 - } 121 - } 122 - 123 - return $this; 124 - } 125 - 126 - public function getAction() { 127 - switch ($this->proxy->getTransactionType()) { 128 - case PhabricatorTransactions::TYPE_SUBSCRIBERS: 129 - return DifferentialAction::ACTION_ADDCCS; 130 - case DifferentialTransaction::TYPE_UPDATE: 131 - return DifferentialAction::ACTION_UPDATE; 132 - case PhabricatorTransactions::TYPE_EDGE: 133 - return DifferentialAction::ACTION_ADDREVIEWERS; 134 - case PhabricatorTransactions::TYPE_COMMENT: 135 - return DifferentialAction::ACTION_COMMENT; 136 - case DifferentialTransaction::TYPE_INLINE: 137 - return DifferentialTransaction::TYPE_INLINE; 138 - default: 139 - return $this->proxy->getNewValue(); 140 - } 141 - } 142 - 143 - public function setMetadata(array $metadata) { 144 - if (!$this->proxy->getTransactionType()) { 145 - throw new Exception(pht('Call setAction() before setMetadata()!')); 146 - } 147 - 148 - $key_cc = self::METADATA_ADDED_CCS; 149 - $key_add_rev = self::METADATA_ADDED_REVIEWERS; 150 - $key_rem_rev = self::METADATA_REMOVED_REVIEWERS; 151 - $key_diff_id = self::METADATA_DIFF_ID; 152 - 153 - switch ($this->proxy->getTransactionType()) { 154 - case DifferentialTransaction::TYPE_UPDATE: 155 - $id = idx($metadata, $key_diff_id); 156 - $this->proxy->setNewValue($id); 157 - break; 158 - case PhabricatorTransactions::TYPE_EDGE: 159 - $rem = idx($metadata, $key_rem_rev, array()); 160 - $old = array(); 161 - foreach ($rem as $phid) { 162 - $old[$phid] = array( 163 - 'src' => $this->proxy->getObjectPHID(), 164 - 'type' => PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER, 165 - 'dst' => $phid, 166 - ); 167 - } 168 - $this->proxy->setOldValue($old); 169 - 170 - $add = idx($metadata, $key_add_rev, array()); 171 - $new = array(); 172 - foreach ($add as $phid) { 173 - $new[$phid] = array( 174 - 'src' => $this->proxy->getObjectPHID(), 175 - 'type' => PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER, 176 - 'dst' => $phid, 177 - ); 178 - } 179 - $this->proxy->setNewValue($new); 180 - break; 181 - case PhabricatorTransactions::TYPE_SUBSCRIBERS: 182 - $phids = idx($metadata, $key_cc, array()); 183 - $new = array(); 184 - foreach ($phids as $phid) { 185 - $new[$phid] = $phid; 186 - } 187 - $this->proxy->setNewValue($new); 188 - break; 189 - default: 190 - break; 191 - } 192 - 193 - return $this; 194 - } 195 - 196 - public function getMetadata() { 197 - if (!$this->proxy->getTransactionType()) { 198 - throw new Exception(pht('Call setAction() before getMetadata()!')); 199 - } 200 - 201 - $key_cc = self::METADATA_ADDED_CCS; 202 - $key_add_rev = self::METADATA_ADDED_REVIEWERS; 203 - $key_rem_rev = self::METADATA_REMOVED_REVIEWERS; 204 - $key_diff_id = self::METADATA_DIFF_ID; 205 - 206 - $type = $this->proxy->getTransactionType(); 207 - 208 - switch ($type) { 209 - case PhabricatorTransactions::TYPE_SUBSCRIBERS: 210 - $value = $this->proxy->getNewValue(); 211 - if (!$value) { 212 - $value = array(); 213 - } 214 - return array( 215 - $key_cc => $value, 216 - ); 217 - case DifferentialTransaction::TYPE_UPDATE: 218 - return array( 219 - $key_diff_id => $this->proxy->getNewValue(), 220 - ); 221 - case PhabricatorTransactions::TYPE_EDGE: 222 - case PhabricatorTransactions::TYPE_SUBSCRIBERS: 223 - $old = $this->proxy->getOldValue(); 224 - if (!$old) { 225 - $old = array(); 226 - } 227 - $new = $this->proxy->getNewValue(); 228 - if (!$new) { 229 - $new = array(); 230 - } 231 - 232 - $rem = array_diff_key($old, $new); 233 - $add = array_diff_key($new, $old); 234 - 235 - if ($type == PhabricatorTransactions::TYPE_EDGE) { 236 - return array( 237 - $key_add_rev => array_keys($add), 238 - $key_rem_rev => array_keys($rem), 239 - ); 240 - } else { 241 - return array( 242 - $key_cc => array_keys($add), 243 - ); 244 - } 245 - default: 246 - return array(); 247 - } 248 - } 249 - 250 - public function getContentSource() { 251 - return $this->proxy->getContentSource(); 252 - } 253 - 254 - private function getProxyComment() { 255 - if (!$this->proxyComment) { 256 - $this->proxyComment = new DifferentialTransactionComment(); 257 - } 258 - return $this->proxyComment; 259 - } 260 - 261 - public function setProxyComment(DifferentialTransactionComment $proxy) { 262 - $this->proxyComment = $proxy; 263 - $this->proxy->attachComment($proxy); 264 - return $this; 265 - } 266 - 267 - public function setRevision(DifferentialRevision $revision) { 268 - $this->getProxyComment()->setRevisionPHID($revision->getPHID()); 269 - $this->proxy->setObjectPHID($revision->getPHID()); 270 - return $this; 271 - } 272 - 273 - public function giveFacebookSomeArbitraryDiff(DifferentialDiff $diff) { 274 - $this->arbitraryDiffForFacebook = $diff; 275 - return $this; 276 - } 277 - 278 - public function getRequiredHandlePHIDs() { 279 - switch ($this->proxy->getTransactionType()) { 280 - case PhabricatorTransactions::TYPE_SUBSCRIBERS: 281 - case PhabricatorTransactions::TYPE_EDGE: 282 - return array_merge( 283 - array_keys($this->proxy->getOldValue()), 284 - array_keys($this->proxy->getNewValue())); 285 - } 286 - 287 - return array(); 288 - } 289 - 290 - public function getMarkupFieldKey($field) { 291 - return 'DC:'.$this->getPHID(); 292 - } 293 - 294 - public function newMarkupEngine($field) { 295 - return PhabricatorMarkupEngine::newDifferentialMarkupEngine( 296 - array( 297 - 'differential.diff' => $this->arbitraryDiffForFacebook, 298 - )); 299 - } 300 - 301 - public function getMarkupText($field) { 302 - return $this->getContent(); 303 - } 304 - 305 - public function didMarkupText($field, $output, PhutilMarkupEngine $engine) { 306 - return $output; 307 - } 308 - 309 - public function shouldUseMarkupCache($field) { 310 - return (bool)$this->getPHID(); 311 - } 312 - 313 - public function getDateCreated() { 314 - return $this->proxy->getDateCreated(); 315 - } 316 - 317 - public function getRevisionPHID() { 318 - return $this->proxy->getObjectPHID(); 319 - } 320 - 321 - public function save() { 322 - $this->proxy->openTransaction(); 323 - $this->proxy 324 - ->setViewPolicy('public') 325 - ->setEditPolicy($this->getAuthorPHID()) 326 - ->save(); 327 - 328 - if ($this->getContent() !== null || 329 - $this->getProxyComment()->getChangesetID()) { 330 - 331 - $this->getProxyComment() 332 - ->setAuthorPHID($this->getAuthorPHID()) 333 - ->setViewPolicy('public') 334 - ->setEditPolicy($this->getAuthorPHID()) 335 - ->setCommentVersion(1) 336 - ->setTransactionPHID($this->proxy->getPHID()) 337 - ->save(); 338 - 339 - $this->proxy 340 - ->setCommentVersion(1) 341 - ->setCommentPHID($this->getProxyComment()->getPHID()) 342 - ->save(); 343 - } 344 - 345 - $this->proxy->saveTransaction(); 346 - 347 - return $this; 348 - } 349 - 350 - public function delete() { 351 - $this->proxy->delete(); 352 - return $this; 353 - } 354 - 355 - public function getProxyTransaction() { 356 - return $this->proxy; 357 - } 358 - 359 - }