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

More Diffusion junk.

+68 -29
+2
resources/sql/patches/013.commitdetail.sql
··· 1 + ALTER TABLE phabricator_repository.repository_commitdata 2 + ADD commitDetails LONGBLOB NOT NULL;
+12 -14
src/applications/diffusion/controller/base/DiffusionController.php
··· 92 92 } 93 93 94 94 public function buildCrumbs(array $spec = array()) { 95 - $drequest = $this->diffusionRequest; 95 + $crumbs = new AphrontCrumbsView(); 96 + $crumb_list = $this->buildCrumbList($spec); 97 + $crumbs->setCrumbs($crumb_list); 98 + return $crumbs; 99 + } 96 100 97 - $crumbs = new AphrontCrumbsView(); 101 + private function buildCrumbList(array $spec = array()) { 102 + $drequest = $this->getDiffusionRequest(); 98 103 99 104 $crumb_list = array(); 100 105 ··· 108 113 'Diffusion'); 109 114 } else { 110 115 $crumb_list[] = 'Diffusion'; 111 - $crumbs->setCrumbs($crumb_list); 112 - return $crumbs; 116 + return $crumb_list; 113 117 } 114 118 115 119 $callsign = $repository->getCallsign(); ··· 124 128 125 129 if (empty($spec['view']) && empty($spec['commit'])) { 126 130 $crumb_list[] = $repository_name; 127 - $crumbs->setCrumbs($crumb_list); 128 - return $crumbs; 131 + return $crumb_list; 129 132 } 130 133 131 134 $crumb_list[] = phutil_render_tag( ··· 138 141 $raw_commit = $drequest->getRawCommit(); 139 142 if (isset($spec['commit'])) { 140 143 $crumb_list[] = "r{$callsign}{$raw_commit}"; 141 - $crumbs->setCrumbs($crumb_list); 142 - return $crumbs; 144 + return $crumb_list; 143 145 } 144 146 145 147 $view = $spec['view']; ··· 167 169 case 'change': 168 170 $view_name = 'Change'; 169 171 $crumb_list[] = phutil_escape_html($path).' ('.$commit_link.')'; 170 - $crumbs->setCrumbs($crumb_list); 171 - return $crumbs; 172 + return $crumb_list; 172 173 } 173 174 174 175 $view_root_uri = "/diffusion/{$callsign}/{$view}/{$branch_uri}"; ··· 231 232 232 233 $crumb_list[] = $last_crumb; 233 234 234 - 235 - $crumbs->setCrumbs($crumb_list); 236 - 237 - return $crumbs; 235 + return $crumb_list; 238 236 } 239 237 240 238 }
-1
src/applications/diffusion/controller/change/DiffusionChangeController.php
··· 47 47 $changeset_view->render(). 48 48 '</div>'; 49 49 50 - 51 50 $nav = $this->buildSideNav('change', true); 52 51 $nav->appendChild($content); 53 52
+22 -1
src/applications/diffusion/controller/commit/DiffusionCommitController.php
··· 109 109 if ($changes) { 110 110 $changesets = DiffusionPathChange::convertToDifferentialChangesets( 111 111 $changes); 112 - foreach ($changesets as $changeset) { 112 + 113 + $vcs = $repository->getVersionControlSystem(); 114 + switch ($vcs) { 115 + case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 116 + $vcs_supports_directory_changes = true; 117 + break; 118 + case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 119 + $vcs_supports_directory_changes = false; 120 + break; 121 + default: 122 + throw new Exception("Unknown VCS."); 123 + } 124 + 125 + foreach ($changesets as $key => $changeset) { 126 + $file_type = $changeset->getFileType(); 127 + if ($file_type == DifferentialChangeType::FILE_DIRECTORY) { 128 + if (!$vcs_supports_directory_changes) { 129 + unset($changesets[$key]); 130 + continue; 131 + } 132 + } 133 + 113 134 $branch = $drequest->getBranchURIComponent( 114 135 $drequest->getBranch()); 115 136 $filename = $changeset->getFilename();
+2
src/applications/diffusion/controller/commit/__init__.php
··· 6 6 7 7 8 8 9 + phutil_require_module('phabricator', 'applications/differential/constants/changetype'); 9 10 phutil_require_module('phabricator', 'applications/differential/parser/markup'); 10 11 phutil_require_module('phabricator', 'applications/differential/view/changesetlistview'); 11 12 phutil_require_module('phabricator', 'applications/diffusion/controller/base'); 12 13 phutil_require_module('phabricator', 'applications/diffusion/data/pathchange'); 13 14 phutil_require_module('phabricator', 'applications/diffusion/query/pathchange/base'); 14 15 phutil_require_module('phabricator', 'applications/diffusion/view/commitchangetable'); 16 + phutil_require_module('phabricator', 'applications/repository/constants/repositorytype'); 15 17 phutil_require_module('phabricator', 'applications/repository/storage/repository'); 16 18 phutil_require_module('phabricator', 'infrastructure/celerity/api'); 17 19 phutil_require_module('phabricator', 'storage/queryfx');
+1 -1
src/applications/diffusion/query/diff/git/DiffusionGitDiffQuery.php
··· 49 49 $changeset = reset($changesets); 50 50 51 51 $id = 52 - $drequest->getBranch().'/'. 52 + $drequest->getBranchURIComponent($drequest->getBranch()). 53 53 $drequest->getPath().';'. 54 54 $drequest->getCommit(); 55 55
+1
src/applications/diffusion/query/diff/svn/__init__.php
··· 10 10 11 11 phutil_require_module('phabricator', 'applications/differential/constants/changetype'); 12 12 phutil_require_module('phabricator', 'applications/differential/storage/diff'); 13 + phutil_require_module('phabricator', 'applications/diffusion/data/pathchange'); 13 14 phutil_require_module('phabricator', 'applications/diffusion/query/diff/base'); 14 15 phutil_require_module('phabricator', 'applications/diffusion/query/pathchange/base'); 15 16
+8 -1
src/applications/diffusion/request/git/DiffusionGitRequest.php
··· 61 61 // sha1s. 62 62 $this->commit = trim($commit); 63 63 64 + /* 65 + 66 + TODO: Unclear if this is actually a good idea or not; it breaks commit views 67 + at the very least. 68 + 64 69 list($contains) = execx( 65 70 '(cd %s && git branch --contains %s)', 66 71 $local_path, ··· 78 83 throw new Exception( 79 84 "Commit does not exist on this branch!"); 80 85 } 86 + */ 87 + 81 88 } 82 89 } 83 90 ··· 89 96 return $this->branch; 90 97 } 91 98 if ($this->repository) { 92 - return $this->repository->getDetail('default-branch', 'master'); 99 + return $this->repository->getDetail('default-branch', 'origin/master'); 93 100 } 94 101 throw new Exception("Unable to determine branch!"); 95 102 }
+12 -11
src/applications/diffusion/view/commitchangetable/DiffusionCommitChangeTableView.php
··· 36 36 $change_verb = DifferentialChangeType::getFullNameForChangeType( 37 37 $change->getChangeType()); 38 38 39 - $suffix = null; 39 + $path = $change->getPath(); 40 40 if ($change->getFileType() == DifferentialChangeType::FILE_DIRECTORY) { 41 - $suffix = '/'; 41 + $path_column = phutil_escape_html($path).'/'; 42 + } else { 43 + $hash = substr(md5($path), 0, 8); 44 + 45 + $path_column = phutil_render_tag( 46 + 'a', 47 + array( 48 + 'href' => '#'.$hash, 49 + ), 50 + phutil_escape_html($path)); 42 51 } 43 - 44 - $path = $change->getPath(); 45 - $hash = substr(sha1($path), 0, 7); 46 52 47 53 $rows[] = array( 48 54 $this->linkHistory($change->getPath()), ··· 51 57 $change->getChangeType(), 52 58 $change->getFileType(), 53 59 $change->getPath()), 54 - phutil_render_tag( 55 - 'a', 56 - array( 57 - 'href' => '#'.$hash, 58 - ), 59 - phutil_escape_html($path).$suffix), 60 + $path_column, 60 61 ); 61 62 } 62 63
+4
src/applications/repository/storage/commitdata/PhabricatorRepositoryCommitData.php
··· 21 21 protected $commitID; 22 22 protected $authorName; 23 23 protected $commitMessage; 24 + protected $commitDetails = array(); 24 25 25 26 public function getConfiguration() { 26 27 return array( 27 28 self::CONFIG_TIMESTAMPS => false, 29 + self::CONFIG_SERIALIZATION => array( 30 + 'commitDetails' => self::SERIALIZATION_JSON, 31 + ), 28 32 ) + parent::getConfiguration(); 29 33 } 30 34
+3
src/applications/repository/worker/base/PhabricatorRepositoryCommitParserWorker.php
··· 20 20 extends PhabricatorWorker { 21 21 22 22 protected $commit; 23 + protected $repository; 23 24 24 25 final public function doWork() { 25 26 $commit_id = $this->getTaskData(); ··· 42 43 if (!$repository) { 43 44 return; 44 45 } 46 + 47 + $this->repository = $repository; 45 48 46 49 return $this->parseCommit($repository, $commit); 47 50 }
+1
webroot/index.php
··· 17 17 */ 18 18 19 19 error_reporting(E_ALL | E_STRICT); 20 + ini_set('memory_limit', -1); 20 21 21 22 $env = getenv('PHABRICATOR_ENV'); // Apache 22 23 if (!$env) {