@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 rendering support for very old Repository transactions

Summary:
Depends on D19827. Ref T13221. Ref T13216. To prepare Repositories for a move to ModularTransactions, throw away some very old transaction rendering code.

This will cause these very old transactions (none of which have been written since at least April 2016) to render "epriestley edited this repository." instead of "epriestley changed the SSH login for this repository from X to Y."

These edits were generally obsoleted by repository URIs, Passphrase credentials, and general modernization.

Test Plan: Grepped for all constants, got no hits.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13221, T13216

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

-117
-7
src/applications/repository/editor/PhabricatorRepositoryEditor.php
··· 22 22 $types[] = PhabricatorRepositoryTransaction::TYPE_DEFAULT_BRANCH; 23 23 $types[] = PhabricatorRepositoryTransaction::TYPE_TRACK_ONLY; 24 24 $types[] = PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE_ONLY; 25 - $types[] = PhabricatorRepositoryTransaction::TYPE_UUID; 26 25 $types[] = PhabricatorRepositoryTransaction::TYPE_SVN_SUBPATH; 27 26 $types[] = PhabricatorRepositoryTransaction::TYPE_NOTIFY; 28 27 $types[] = PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE; ··· 65 64 return array_keys($object->getDetail('branch-filter', array())); 66 65 case PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE_ONLY: 67 66 return array_keys($object->getDetail('close-commits-filter', array())); 68 - case PhabricatorRepositoryTransaction::TYPE_UUID: 69 - return $object->getUUID(); 70 67 case PhabricatorRepositoryTransaction::TYPE_SVN_SUBPATH: 71 68 return $object->getDetail('svn-subpath'); 72 69 case PhabricatorRepositoryTransaction::TYPE_NOTIFY: ··· 108 105 case PhabricatorRepositoryTransaction::TYPE_DEFAULT_BRANCH: 109 106 case PhabricatorRepositoryTransaction::TYPE_TRACK_ONLY: 110 107 case PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE_ONLY: 111 - case PhabricatorRepositoryTransaction::TYPE_UUID: 112 108 case PhabricatorRepositoryTransaction::TYPE_SVN_SUBPATH: 113 109 case PhabricatorRepositoryTransaction::TYPE_VCS: 114 110 case PhabricatorRepositoryTransaction::TYPE_PUSH_POLICY: ··· 170 166 $object->setDetail( 171 167 'close-commits-filter', 172 168 array_fill_keys($xaction->getNewValue(), true)); 173 - break; 174 - case PhabricatorRepositoryTransaction::TYPE_UUID: 175 - $object->setUUID($xaction->getNewValue()); 176 169 break; 177 170 case PhabricatorRepositoryTransaction::TYPE_SVN_SUBPATH: 178 171 $object->setDetail('svn-subpath', $xaction->getNewValue());
-110
src/applications/repository/storage/PhabricatorRepositoryTransaction.php
··· 25 25 const TYPE_AUTOMATION_BLUEPRINTS = 'repo:automation-blueprints'; 26 26 const TYPE_CALLSIGN = 'repo:callsign'; 27 27 28 - // TODO: Clean up these legacy transaction types. 29 - const TYPE_SSH_LOGIN = 'repo:ssh-login'; 30 - const TYPE_SSH_KEY = 'repo:ssh-key'; 31 - const TYPE_SSH_KEYFILE = 'repo:ssh-keyfile'; 32 - const TYPE_HTTP_LOGIN = 'repo:http-login'; 33 - const TYPE_HTTP_PASS = 'repo:http-pass'; 34 - const TYPE_CREDENTIAL = 'repo:credential'; 35 - const TYPE_PROTOCOL_HTTP = 'repo:serve-http'; 36 - const TYPE_PROTOCOL_SSH = 'repo:serve-ssh'; 37 - const TYPE_HOSTING = 'repo:hosting'; 38 - const TYPE_LOCAL_PATH = 'repo:local-path'; 39 - const TYPE_REMOTE_URI = 'repo:remote-uri'; 40 - const TYPE_UUID = 'repo:uuid'; 41 - 42 28 public function getApplicationName() { 43 29 return 'repository'; 44 30 } ··· 86 72 $new = $this->getNewValue(); 87 73 88 74 switch ($this->getTransactionType()) { 89 - case self::TYPE_REMOTE_URI: 90 - case self::TYPE_SSH_LOGIN: 91 - case self::TYPE_SSH_KEY: 92 - case self::TYPE_SSH_KEYFILE: 93 - case self::TYPE_HTTP_LOGIN: 94 - case self::TYPE_HTTP_PASS: 95 - // Hide null vs empty string changes. 96 - return (!strlen($old) && !strlen($new)); 97 - case self::TYPE_LOCAL_PATH: 98 75 case self::TYPE_NAME: 99 76 // Hide these on create, they aren't interesting and we have an 100 77 // explicit "create" transaction. ··· 233 210 implode(', ', $new)); 234 211 } 235 212 break; 236 - case self::TYPE_UUID: 237 - if (!strlen($new)) { 238 - return pht( 239 - '%s removed "%s" as the repository UUID.', 240 - $this->renderHandleLink($author_phid), 241 - $old); 242 - } else if (!strlen($old)) { 243 - return pht( 244 - '%s set the repository UUID to "%s".', 245 - $this->renderHandleLink($author_phid), 246 - $new); 247 - } else { 248 - return pht( 249 - '%s changed the repository UUID from "%s" to "%s".', 250 - $this->renderHandleLink($author_phid), 251 - $old, 252 - $new); 253 - } 254 - break; 255 213 case self::TYPE_SVN_SUBPATH: 256 214 if (!strlen($new)) { 257 215 return pht( ··· 293 251 $this->renderHandleLink($author_phid)); 294 252 } 295 253 break; 296 - case self::TYPE_REMOTE_URI: 297 - if (!strlen($old)) { 298 - return pht( 299 - '%s set the remote URI for this repository to "%s".', 300 - $this->renderHandleLink($author_phid), 301 - $new); 302 - } else if (!strlen($new)) { 303 - return pht( 304 - '%s removed the remote URI for this repository.', 305 - $this->renderHandleLink($author_phid)); 306 - } else { 307 - return pht( 308 - '%s changed the remote URI for this repository from "%s" to "%s".', 309 - $this->renderHandleLink($author_phid), 310 - $old, 311 - $new); 312 - } 313 - break; 314 - case self::TYPE_SSH_LOGIN: 315 - return pht( 316 - '%s updated the SSH login for this repository.', 317 - $this->renderHandleLink($author_phid)); 318 - case self::TYPE_SSH_KEY: 319 - return pht( 320 - '%s updated the SSH key for this repository.', 321 - $this->renderHandleLink($author_phid)); 322 - case self::TYPE_SSH_KEYFILE: 323 - return pht( 324 - '%s updated the SSH keyfile for this repository.', 325 - $this->renderHandleLink($author_phid)); 326 - case self::TYPE_HTTP_LOGIN: 327 - return pht( 328 - '%s updated the HTTP login for this repository.', 329 - $this->renderHandleLink($author_phid)); 330 - case self::TYPE_HTTP_PASS: 331 - return pht( 332 - '%s updated the HTTP password for this repository.', 333 - $this->renderHandleLink($author_phid)); 334 - case self::TYPE_LOCAL_PATH: 335 - return pht( 336 - '%s changed the local path from "%s" to "%s".', 337 - $this->renderHandleLink($author_phid), 338 - $old, 339 - $new); 340 - case self::TYPE_HOSTING: 341 - if ($new) { 342 - return pht( 343 - '%s changed this repository to be hosted on Phabricator.', 344 - $this->renderHandleLink($author_phid)); 345 - } else { 346 - return pht( 347 - '%s changed this repository to track a remote elsewhere.', 348 - $this->renderHandleLink($author_phid)); 349 - } 350 - case self::TYPE_PROTOCOL_HTTP: 351 - return pht( 352 - '%s changed the availability of this repository over HTTP from '. 353 - '"%s" to "%s".', 354 - $this->renderHandleLink($author_phid), 355 - $old, 356 - $new); 357 - case self::TYPE_PROTOCOL_SSH: 358 - return pht( 359 - '%s changed the availability of this repository over SSH from '. 360 - '"%s" to "%s".', 361 - $this->renderHandleLink($author_phid), 362 - $old, 363 - $new); 364 254 case self::TYPE_PUSH_POLICY: 365 255 return pht( 366 256 '%s changed the push policy of this repository from "%s" to "%s".',