@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 patch preview from Phragment version controller

Summary: Patches can exceed the 30 second time out in most PHP installations. This removes the patch preview from the version controller so that users can still see the information (although they may not be able to download the actual patch).

Test Plan: Viewed a version and saw that the patch didn't appear.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

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

-48
-48
src/applications/phragment/controller/PhragmentVersionController.php
··· 84 84 $crumbs, 85 85 $this->renderConfigurationWarningIfRequired(), 86 86 $box, 87 - $this->renderPatchFromPreviousVersion($version, $file), 88 87 $this->renderPreviousVersionList($version)), 89 88 array( 90 89 'title' => pht('View Version'), 91 90 'device' => true)); 92 - } 93 - 94 - private function renderPatchFromPreviousVersion( 95 - PhragmentFragmentVersion $version, 96 - PhabricatorFile $file) { 97 - 98 - $request = $this->getRequest(); 99 - $viewer = $request->getUser(); 100 - 101 - $previous_file = null; 102 - $previous = id(new PhragmentFragmentVersionQuery()) 103 - ->setViewer($viewer) 104 - ->withFragmentPHIDs(array($version->getFragmentPHID())) 105 - ->withSequences(array($version->getSequence() - 1)) 106 - ->executeOne(); 107 - if ($previous !== null) { 108 - $previous_file = id(new PhabricatorFileQuery()) 109 - ->setViewer($viewer) 110 - ->withPHIDs(array($previous->getFilePHID())) 111 - ->executeOne(); 112 - } 113 - 114 - $patch = PhragmentPatchUtil::calculatePatch($previous_file, $file); 115 - 116 - if ($patch === null) { 117 - return id(new AphrontErrorView()) 118 - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) 119 - ->setTitle(pht("Identical Version")) 120 - ->appendChild(phutil_tag( 121 - 'p', 122 - array(), 123 - pht("This version is identical to the previous version."))); 124 - } 125 - 126 - if (strlen($patch) > 20480) { 127 - // Patch is longer than 20480 characters. Trim it and let the user know. 128 - $patch = substr($patch, 0, 20480)."\n...\n"; 129 - $patch .= pht( 130 - "This patch is longer than 20480 characters. Use the link ". 131 - "in the action list to download the full patch."); 132 - } 133 - 134 - return id(new PHUIObjectBoxView()) 135 - ->setHeader(id(new PHUIHeaderView()) 136 - ->setHeader(pht('Differences since previous version'))) 137 - ->appendChild(id(new PhabricatorSourceCodeView()) 138 - ->setLines(phutil_split_lines($patch))); 139 91 } 140 92 141 93 private function renderPreviousVersionList(