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

Merge branch 'master' into redesign-2015

+190 -95
+2
resources/sql/autopatches/20150624.spaces.1.repo.sql
··· 1 + ALTER TABLE {$NAMESPACE}_repository.repository 2 + ADD spacePHID VARBINARY(64);
+1
src/__phutil_library_map__.php
··· 6189 6189 'PhabricatorMarkupInterface', 6190 6190 'PhabricatorDestructibleInterface', 6191 6191 'PhabricatorProjectInterface', 6192 + 'PhabricatorSpacesInterface', 6192 6193 ), 6193 6194 'PhabricatorRepositoryArcanistProject' => array( 6194 6195 'PhabricatorRepositoryDAO',
+4
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 585 585 'a race?')); 586 586 } 587 587 588 + // TODO: This can race with diff updates, particularly those from 589 + // Harbormaster. See discussion in T8650. 588 590 $diff->setRevisionID($object->getID()); 589 591 $diff->save(); 590 592 ··· 593 595 // the old (`null`) container. 594 596 595 597 // TODO: This is a bit iffy, maybe we can find a cleaner approach? 598 + // In particular, this could (rarely) be overwritten by Harbormaster 599 + // workers. 596 600 $table = new HarbormasterBuildable(); 597 601 $conn_w = $table->establishConnection('w'); 598 602 queryfx(
+22 -16
src/applications/diffusion/controller/DiffusionRepositoryCreateController.php
··· 137 137 $type_credential = PhabricatorRepositoryTransaction::TYPE_CREDENTIAL; 138 138 $type_view = PhabricatorTransactions::TYPE_VIEW_POLICY; 139 139 $type_edit = PhabricatorTransactions::TYPE_EDIT_POLICY; 140 + $type_space = PhabricatorTransactions::TYPE_SPACE; 140 141 $type_push = PhabricatorRepositoryTransaction::TYPE_PUSH_POLICY; 141 142 $type_service = PhabricatorRepositoryTransaction::TYPE_SERVICE; 142 143 ··· 225 226 } 226 227 227 228 if ($is_policy) { 229 + $policy_page = $form->getPage('policy'); 230 + 228 231 $xactions[] = id(clone $template) 229 232 ->setTransactionType($type_view) 230 - ->setNewValue( 231 - $form->getPage('policy')->getControl('viewPolicy')->getValue()); 233 + ->setNewValue($policy_page->getControl('viewPolicy')->getValue()); 232 234 233 235 $xactions[] = id(clone $template) 234 236 ->setTransactionType($type_edit) 235 - ->setNewValue( 236 - $form->getPage('policy')->getControl('editPolicy')->getValue()); 237 + ->setNewValue($policy_page->getControl('editPolicy')->getValue()); 237 238 238 239 if ($is_init || $repository->isHosted()) { 239 240 $xactions[] = id(clone $template) 240 241 ->setTransactionType($type_push) 241 - ->setNewValue( 242 - $form->getPage('policy')->getControl('pushPolicy')->getValue()); 242 + ->setNewValue($policy_page->getControl('pushPolicy')->getValue()); 243 243 } 244 + 245 + $xactions[] = id(clone $template) 246 + ->setTransactionType($type_space) 247 + ->setNewValue( 248 + $policy_page->getControl('viewPolicy')->getSpacePHID()); 244 249 } 245 250 246 251 id(new PhabricatorRepositoryEditor()) ··· 261 266 'viewPolicy' => $repository->getViewPolicy(), 262 267 'editPolicy' => $repository->getEditPolicy(), 263 268 'pushPolicy' => $repository->getPushPolicy(), 269 + 'spacePHID' => $repository->getSpacePHID(), 264 270 ); 265 271 } 266 272 $form->readFromObject($dict); ··· 596 602 597 603 $page->addRemarkupInstructions( 598 604 pht( 599 - 'Choose or add the SSH credentials to use to connect to the the '. 605 + 'Choose or add the SSH credentials to use to connect to the '. 600 606 'repository hosted at:'. 601 607 "\n\n". 602 608 " lang=text\n". ··· 729 735 ->setName('pushPolicy'); 730 736 731 737 return id(new PHUIFormPageView()) 732 - ->setPageName(pht('Policies')) 733 - ->setValidateFormPageCallback(array($this, 'validatePolicyPage')) 734 - ->setAdjustFormPageCallback(array($this, 'adjustPolicyPage')) 735 - ->setUser($viewer) 736 - ->addRemarkupInstructions( 737 - pht('Select access policies for this repository.')) 738 - ->addControl($view_policy) 739 - ->addControl($edit_policy) 740 - ->addControl($push_policy); 738 + ->setPageName(pht('Policies')) 739 + ->setValidateFormPageCallback(array($this, 'validatePolicyPage')) 740 + ->setAdjustFormPageCallback(array($this, 'adjustPolicyPage')) 741 + ->setUser($viewer) 742 + ->addRemarkupInstructions( 743 + pht('Select access policies for this repository.')) 744 + ->addControl($view_policy) 745 + ->addControl($edit_policy) 746 + ->addControl($push_policy); 741 747 } 742 748 743 749 public function adjustPolicyPage(PHUIFormPageView $page) {
+9 -1
src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
··· 386 386 $viewer, 387 387 $repository); 388 388 389 + $view_parts = array(); 390 + if (PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer)) { 391 + $space_phid = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID( 392 + $repository); 393 + $view_parts[] = $viewer->renderHandle($space_phid); 394 + } 395 + $view_parts[] = $descriptions[PhabricatorPolicyCapability::CAN_VIEW]; 396 + 389 397 $view->addProperty( 390 398 pht('Visible To'), 391 - $descriptions[PhabricatorPolicyCapability::CAN_VIEW]); 399 + phutil_implode_html(" \xC2\xB7 ", $view_parts)); 392 400 393 401 $view->addProperty( 394 402 pht('Editable By'),
+1 -1
src/applications/diviner/query/DivinerAtomQuery.php
··· 219 219 } 220 220 221 221 // If we found matches in the same documentation book, prefer them 222 - // over other matches. Otherwise, look at all the the matches. 222 + // over other matches. Otherwise, look at all the matches. 223 223 $matches = $xatoms[$xref->getName()][$xref->getType()]; 224 224 if (isset($matches[$atom->getBookPHID()])) { 225 225 $maybe = $matches[$atom->getBookPHID()];
+10 -7
src/applications/feed/worker/FeedPublisherWorker.php
··· 6 6 $story = $this->loadFeedStory(); 7 7 8 8 $uris = PhabricatorEnv::getEnvConfig('feed.http-hooks'); 9 - foreach ($uris as $uri) { 10 - $this->queueTask( 11 - 'FeedPublisherHTTPWorker', 12 - array( 13 - 'key' => $story->getChronologicalKey(), 14 - 'uri' => $uri, 15 - )); 9 + 10 + if ($uris) { 11 + foreach ($uris as $uri) { 12 + $this->queueTask( 13 + 'FeedPublisherHTTPWorker', 14 + array( 15 + 'key' => $story->getChronologicalKey(), 16 + 'uri' => $uri, 17 + )); 18 + } 16 19 } 17 20 18 21 $argv = array(
+1 -1
src/applications/files/storage/PhabricatorFile.php
··· 542 542 // just bail out. 543 543 throw $status; 544 544 } else { 545 - // This is HTTP 2XX, so use the the response body to save the 545 + // This is HTTP 2XX, so use the response body to save the 546 546 // file data. 547 547 $params = $params + array( 548 548 'name' => basename($uri),
+1 -1
src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
··· 161 161 162 162 $second_file = PhabricatorFile::newFromFileData($other_data, $params); 163 163 164 - // Test that the the second file uses different storage handle from 164 + // Test that the second file uses different storage handle from 165 165 // the first file. 166 166 $first_handle = $first_file->getStorageHandle(); 167 167 $second_handle = $second_file->getStorageHandle();
+47 -31
src/applications/harbormaster/engine/HarbormasterBuildEngine.php
··· 406 406 $should_publish = $did_update && 407 407 $new_status != HarbormasterBuildable::STATUS_BUILDING && 408 408 !$buildable->getIsManualBuildable(); 409 - if ($should_publish) { 410 - $object = id(new PhabricatorObjectQuery()) 411 - ->setViewer($viewer) 412 - ->withPHIDs(array($buildable->getBuildablePHID())) 413 - ->executeOne(); 414 409 415 - if ($object instanceof PhabricatorApplicationTransactionInterface) { 416 - $template = $object->getApplicationTransactionTemplate(); 417 - if ($template) { 418 - $template 419 - ->setTransactionType(PhabricatorTransactions::TYPE_BUILDABLE) 420 - ->setMetadataValue( 421 - 'harbormaster:buildablePHID', 422 - $buildable->getPHID()) 423 - ->setOldValue($old_status) 424 - ->setNewValue($new_status); 410 + if (!$should_publish) { 411 + return; 412 + } 425 413 426 - $harbormaster_phid = id(new PhabricatorHarbormasterApplication()) 427 - ->getPHID(); 414 + $object = id(new PhabricatorObjectQuery()) 415 + ->setViewer($viewer) 416 + ->withPHIDs(array($buildable->getBuildablePHID())) 417 + ->executeOne(); 418 + if (!$object) { 419 + return; 420 + } 428 421 429 - $daemon_source = PhabricatorContentSource::newForSource( 430 - PhabricatorContentSource::SOURCE_DAEMON, 431 - array()); 422 + if (!($object instanceof PhabricatorApplicationTransactionInterface)) { 423 + return; 424 + } 432 425 433 - $editor = $object->getApplicationTransactionEditor() 434 - ->setActor($viewer) 435 - ->setActingAsPHID($harbormaster_phid) 436 - ->setContentSource($daemon_source) 437 - ->setContinueOnNoEffect(true) 438 - ->setContinueOnMissingFields(true); 426 + // TODO: Publishing these transactions is causing a race. See T8650. 427 + // We shouldn't be publishing to diffs anyway. 428 + if ($object instanceof DifferentialDiff) { 429 + return; 430 + } 439 431 440 - $editor->applyTransactions( 441 - $object->getApplicationTransactionObject(), 442 - array($template)); 443 - } 444 - } 432 + $template = $object->getApplicationTransactionTemplate(); 433 + if (!$template) { 434 + return; 445 435 } 436 + 437 + $template 438 + ->setTransactionType(PhabricatorTransactions::TYPE_BUILDABLE) 439 + ->setMetadataValue( 440 + 'harbormaster:buildablePHID', 441 + $buildable->getPHID()) 442 + ->setOldValue($old_status) 443 + ->setNewValue($new_status); 444 + 445 + $harbormaster_phid = id(new PhabricatorHarbormasterApplication()) 446 + ->getPHID(); 447 + 448 + $daemon_source = PhabricatorContentSource::newForSource( 449 + PhabricatorContentSource::SOURCE_DAEMON, 450 + array()); 451 + 452 + $editor = $object->getApplicationTransactionEditor() 453 + ->setActor($viewer) 454 + ->setActingAsPHID($harbormaster_phid) 455 + ->setContentSource($daemon_source) 456 + ->setContinueOnNoEffect(true) 457 + ->setContinueOnMissingFields(true); 458 + 459 + $editor->applyTransactions( 460 + $object->getApplicationTransactionObject(), 461 + array($template)); 446 462 } 447 463 448 464 private function releaseAllArtifacts(HarbormasterBuild $build) {
+1 -1
src/applications/harbormaster/storage/build/HarbormasterBuildUnitMessage.php
··· 32 32 'result' => 'string', 33 33 'duration' => 'optional float', 34 34 'path' => 'optional string', 35 - 'coverage' => 'optional string', 35 + 'coverage' => 'optional map<string, wild>', 36 36 ); 37 37 38 38 // We're just going to ignore extra keys for now, to make it easier to
+20
src/applications/metamta/controller/PhabricatorMetaMTAMailViewController.php
··· 49 49 ->setUser($viewer) 50 50 ->setObject($mail); 51 51 52 + $properties->addProperty( 53 + pht('ID'), 54 + $mail->getID()); 55 + 56 + $properties->addProperty( 57 + pht('Status'), 58 + $mail->getStatus()); 59 + 60 + if ($mail->getMessage()) { 61 + $properties->addProperty( 62 + pht('Status Details'), 63 + $mail->getMessage()); 64 + } 65 + 66 + if ($mail->getRelatedPHID()) { 67 + $properties->addProperty( 68 + pht('Related Object'), 69 + $viewer->renderHandle($mail->getRelatedPHID())); 70 + } 71 + 52 72 if ($mail->getActorPHID()) { 53 73 $actor_str = $viewer->renderHandle($mail->getActorPHID()); 54 74 } else {
+7 -8
src/applications/metamta/garbagecollector/MetaMTAMailSentGarbageCollector.php
··· 6 6 public function collectGarbage() { 7 7 $ttl = phutil_units('90 days in seconds'); 8 8 9 - $table = new PhabricatorMetaMTAMail(); 10 - $conn_w = $table->establishConnection('w'); 9 + $mails = id(new PhabricatorMetaMTAMail())->loadAllWhere( 10 + 'dateCreated < %d LIMIT 100', 11 + PhabricatorTime::getNow()); 11 12 12 - queryfx( 13 - $conn_w, 14 - 'DELETE FROM %T WHERE dateCreated < %d LIMIT 100', 15 - $table->getTableName(), 16 - time() - $ttl); 13 + foreach ($mails as $mail) { 14 + $mail->delete(); 15 + } 17 16 18 - return ($conn_w->getAffectedRows() == 100); 17 + return (count($mails) == 100); 19 18 } 20 19 21 20 }
+5 -7
src/applications/metamta/query/PhabricatorMetaMTAMailSearchEngine.php
··· 101 101 102 102 foreach ($mails as $mail) { 103 103 if ($mail->hasSensitiveContent()) { 104 - $header = pht( 105 - 'Mail %d: < content redacted >', 106 - $mail->getID()); 104 + $header = pht('< content redacted >'); 107 105 } else { 108 - $header = pht( 109 - 'Mail %d: %s', 110 - $mail->getID(), 111 - $mail->getSubject()); 106 + $header = $mail->getSubject(); 112 107 } 113 108 114 109 $item = id(new PHUIObjectItemView()) 110 + ->setUser($viewer) 115 111 ->setObject($mail) 112 + ->setEpoch($mail->getDateCreated()) 113 + ->setObjectName('Mail '.$mail->getID()) 116 114 ->setHeader($header) 117 115 ->setHref($this->getURI('detail/'.$mail->getID())); 118 116 $list->addItem($item);
+14
src/applications/metamta/storage/PhabricatorMetaMTAMail.php
··· 1038 1038 } 1039 1039 } 1040 1040 1041 + public function delete() { 1042 + $this->openTransaction(); 1043 + queryfx( 1044 + $this->establishConnection('w'), 1045 + 'DELETE FROM %T WHERE src = %s AND type = %d', 1046 + PhabricatorEdgeConfig::TABLE_NAME_EDGE, 1047 + $this->getPHID(), 1048 + PhabricatorMetaMTAMailHasRecipientEdgeType::EDGECONST); 1049 + $ret = parent::delete(); 1050 + $this->saveTransaction(); 1051 + 1052 + return $ret; 1053 + } 1054 + 1041 1055 1042 1056 /* -( PhabricatorPolicyInterface )----------------------------------------- */ 1043 1057
+1
src/applications/repository/query/PhabricatorRepositorySearchEngine.php
··· 153 153 154 154 $item = id(new PHUIObjectItemView()) 155 155 ->setUser($viewer) 156 + ->setObject($repository) 156 157 ->setHeader($repository->getName()) 157 158 ->setObjectName('r'.$repository->getCallsign()) 158 159 ->setHref($this->getApplicationURI($repository->getCallsign().'/'));
+14 -2
src/applications/repository/storage/PhabricatorRepository.php
··· 11 11 PhabricatorFlaggableInterface, 12 12 PhabricatorMarkupInterface, 13 13 PhabricatorDestructibleInterface, 14 - PhabricatorProjectInterface { 14 + PhabricatorProjectInterface, 15 + PhabricatorSpacesInterface { 15 16 16 17 /** 17 18 * Shortest hash we'll recognize in raw "a829f32" form. ··· 54 55 protected $details = array(); 55 56 protected $credentialPHID; 56 57 protected $almanacServicePHID; 58 + protected $spacePHID; 57 59 58 60 private $commitCount = self::ATTACHABLE; 59 61 private $mostRecentCommit = self::ATTACHABLE; ··· 72 74 $repository = id(new PhabricatorRepository()) 73 75 ->setViewPolicy($view_policy) 74 76 ->setEditPolicy($edit_policy) 75 - ->setPushPolicy($push_policy); 77 + ->setPushPolicy($push_policy) 78 + ->setSpacePHID($actor->getDefaultSpacePHID()); 76 79 77 80 // Put the repository in "Importing" mode until we finish 78 81 // parsing it. ··· 1909 1912 1910 1913 /* -( PhabricatorDestructibleInterface )----------------------------------- */ 1911 1914 1915 + 1912 1916 public function destroyObjectPermanently( 1913 1917 PhabricatorDestructionEngine $engine) { 1914 1918 ··· 1933 1937 } 1934 1938 1935 1939 $this->saveTransaction(); 1940 + } 1941 + 1942 + 1943 + /* -( PhabricatorSpacesInterface )----------------------------------------- */ 1944 + 1945 + 1946 + public function getSpacePHID() { 1947 + return $this->spacePHID; 1936 1948 } 1937 1949 1938 1950 }
+10 -16
src/applications/subscriptions/controller/PhabricatorSubscriptionsListController.php
··· 3 3 final class PhabricatorSubscriptionsListController 4 4 extends PhabricatorController { 5 5 6 - private $phid; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->phid = idx($data, 'phid'); 10 - } 11 - 12 6 public function shouldAllowPublic() { 13 7 return true; 14 8 } 15 9 16 - public function processRequest() { 17 - $request = $this->getRequest(); 18 - 10 + public function handleRequest(AphrontRequest $request) { 19 11 $viewer = $request->getUser(); 20 - $phid = $this->phid; 21 - 22 12 $object = id(new PhabricatorObjectQuery()) 23 13 ->setViewer($viewer) 24 - ->withPHIDs(array($phid)) 14 + ->withPHIDs(array($request->getURIData('phid'))) 25 15 ->executeOne(); 16 + if (!$object) { 17 + return new Aphront404Response(); 18 + } 26 19 27 - if ($object instanceof PhabricatorSubscribableInterface) { 28 - $subscriber_phids = PhabricatorSubscribersQuery::loadSubscribersForPHID( 29 - $phid); 20 + if (!($object instanceof PhabricatorSubscribableInterface)) { 21 + return new Aphront404Response(); 30 22 } 31 23 32 - $handle_phids = $subscriber_phids; 24 + $phid = $object->getPHID(); 25 + 26 + $handle_phids = PhabricatorSubscribersQuery::loadSubscribersForPHID($phid); 33 27 $handle_phids[] = $phid; 34 28 35 29 $handles = id(new PhabricatorHandleQuery())
+1 -1
src/docs/user/configuration/troubleshooting_https.diviner
··· 12 12 13 13 Connection negotiation can fail for several reasons. The major ones are: 14 14 15 - - You have not added the the Certificate Authority as a trusted authority 15 + - You have not added the Certificate Authority as a trusted authority 16 16 (this is the most common problem, and usually the issue for self-signed 17 17 certificates). 18 18 - The SSL certificate is signed for the wrong domain. For example, a
+1 -1
src/docs/user/field/repository_imports.diviner
··· 234 234 phabricator/ $ bin/repository help <command> 235 235 ``` 236 236 237 - In particular, you can use flags with the the `repository reparse` command to 237 + In particular, you can use flags with the `repository reparse` command to 238 238 manually run parse steps in the foreground, including re-running steps and 239 239 running steps out of order. 240 240
+1 -1
src/docs/user/userguide/diffusion_updates.diviner
··· 99 99 as responsive as a hosted repository. 100 100 101 101 If a repository has an update scheduled, the Diffusion > (Choose a 102 - Repository) > Edit Repository interface will show that the the repository is 102 + Repository) > Edit Repository interface will show that the repository is 103 103 prioritized and will be updated soon. 104 104 105 105
+16
src/view/form/control/AphrontFormPolicyControl.php
··· 39 39 return $this; 40 40 } 41 41 42 + public function readValueFromDictionary(array $dictionary) { 43 + // TODO: This is a little hacky but will only get us into trouble if we 44 + // have multiple view policy controls in multiple paged form views on the 45 + // same page, which seems unlikely. 46 + $this->setSpacePHID(idx($dictionary, 'spacePHID')); 47 + 48 + return parent::readValueFromDictionary($dictionary); 49 + } 50 + 51 + public function readValueFromRequest(AphrontRequest $request) { 52 + // See note in readValueFromDictionary(). 53 + $this->setSpacePHID($request->getStr('spacePHID')); 54 + 55 + return parent::readValueFromRequest($request); 56 + } 57 + 42 58 public function setCapability($capability) { 43 59 $this->capability = $capability; 44 60
+1
src/view/phui/calendar/PHUICalendarMonthView.php
··· 104 104 if ($counter <= $max_daily) { 105 105 $list->addEvent($item); 106 106 } 107 + $counter++; 107 108 } 108 109 109 110 $uri = $this->getBrowseURI();