Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13962478
D7767.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7767.id.diff
View Options
Index: src/applications/phragment/controller/PhragmentVersionController.php
===================================================================
--- src/applications/phragment/controller/PhragmentVersionController.php
+++ src/applications/phragment/controller/PhragmentVersionController.php
@@ -84,60 +84,12 @@
$crumbs,
$this->renderConfigurationWarningIfRequired(),
$box,
- $this->renderPatchFromPreviousVersion($version, $file),
$this->renderPreviousVersionList($version)),
array(
'title' => pht('View Version'),
'device' => true));
}
- private function renderPatchFromPreviousVersion(
- PhragmentFragmentVersion $version,
- PhabricatorFile $file) {
-
- $request = $this->getRequest();
- $viewer = $request->getUser();
-
- $previous_file = null;
- $previous = id(new PhragmentFragmentVersionQuery())
- ->setViewer($viewer)
- ->withFragmentPHIDs(array($version->getFragmentPHID()))
- ->withSequences(array($version->getSequence() - 1))
- ->executeOne();
- if ($previous !== null) {
- $previous_file = id(new PhabricatorFileQuery())
- ->setViewer($viewer)
- ->withPHIDs(array($previous->getFilePHID()))
- ->executeOne();
- }
-
- $patch = PhragmentPatchUtil::calculatePatch($previous_file, $file);
-
- if ($patch === null) {
- return id(new AphrontErrorView())
- ->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
- ->setTitle(pht("Identical Version"))
- ->appendChild(phutil_tag(
- 'p',
- array(),
- pht("This version is identical to the previous version.")));
- }
-
- if (strlen($patch) > 20480) {
- // Patch is longer than 20480 characters. Trim it and let the user know.
- $patch = substr($patch, 0, 20480)."\n...\n";
- $patch .= pht(
- "This patch is longer than 20480 characters. Use the link ".
- "in the action list to download the full patch.");
- }
-
- return id(new PHUIObjectBoxView())
- ->setHeader(id(new PHUIHeaderView())
- ->setHeader(pht('Differences since previous version')))
- ->appendChild(id(new PhabricatorSourceCodeView())
- ->setLines(phutil_split_lines($patch)));
- }
-
private function renderPreviousVersionList(
PhragmentFragmentVersion $version) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 16 2024, 10:21 AM (5 w, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717107
Default Alt Text
D7767.id.diff (2 KB)
Attached To
Mode
D7767: Remove patch preview from Phragment version controller
Attached
Detach File
Event Timeline
Log In to Comment