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

Rename "stableCommitName" to "stableCommit"

Summary:
Ref T2683. This is closely related to "symbolicCommit", but has an inconsistent "name" on the end.

Also, `diffusion.searchquery` uses this parameter inconsistently.

Test Plan:
- `grep`ed for callsites.
- Ran searches in Git and Mercurial repositories.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T2683

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

+25 -26
+2 -2
src/applications/diffusion/conduit/ConduitAPI_diffusion_readmequery_Method.php
··· 55 55 array( 56 56 'user' => $request->getUser(), 57 57 'repository' => $drequest->getRepository(), 58 - 'commit' => $drequest->getStableCommitName(), 58 + 'commit' => $drequest->getStableCommit(), 59 59 'path' => $readme->getFullPath(), 60 60 )); 61 61 ··· 65 65 $readme_request, 66 66 'diffusion.filecontentquery', 67 67 array( 68 - 'commit' => $drequest->getStableCommitName(), 68 + 'commit' => $drequest->getStableCommit(), 69 69 'path' => $readme->getFullPath(), 70 70 'needsBlame' => false, 71 71 )));
+3 -5
src/applications/diffusion/conduit/ConduitAPI_diffusion_searchquery_Method.php
··· 17 17 protected function defineCustomParamTypes() { 18 18 return array( 19 19 'path' => 'required string', 20 - 'stableCommitName' => 'required string', 20 + 'commit' => 'optional string', 21 21 'grep' => 'required string', 22 22 'limit' => 'optional int', 23 23 'offset' => 'optional int', ··· 46 46 protected function getGitResult(ConduitAPIRequest $request) { 47 47 $drequest = $this->getDiffusionRequest(); 48 48 $path = $drequest->getPath(); 49 - $stable_commit_name = $request->getValue('stableCommitName'); 50 49 $grep = $request->getValue('grep'); 51 50 $repository = $drequest->getRepository(); 52 51 $limit = $request->getValue('limit'); ··· 57 56 // NOTE: --perl-regexp is available only with libpcre compiled in. 58 57 'grep --extended-regexp --null -n --no-color -e %s %s -- %s', 59 58 $grep, 60 - $stable_commit_name, 59 + $drequest->getStableCommit(), 61 60 $path); 62 61 63 62 $binary_pattern = '/Binary file [^:]*:(.+) matches/'; ··· 84 83 protected function getMercurialResult(ConduitAPIRequest $request) { 85 84 $drequest = $this->getDiffusionRequest(); 86 85 $path = $drequest->getPath(); 87 - $stable_commit_name = $request->getValue('stableCommitName'); 88 86 $grep = $request->getValue('grep'); 89 87 $repository = $drequest->getRepository(); 90 88 $limit = $request->getValue('limit'); ··· 93 91 $results = array(); 94 92 $future = $repository->getLocalCommandFuture( 95 93 'grep --rev %s --print0 --line-number %s %s', 96 - hgsprintf('ancestors(%s)', $stable_commit_name), 94 + hgsprintf('ancestors(%s)', $drequest->getStableCommit()), 97 95 $grep, 98 96 $path); 99 97
+1 -1
src/applications/diffusion/controller/DiffusionBrowseController.php
··· 141 141 ->setUser($viewer) 142 142 ->setActionList($actions); 143 143 144 - $stable_commit = $drequest->getStableCommitName(); 144 + $stable_commit = $drequest->getStableCommit(); 145 145 $callsign = $drequest->getRepository()->getCallsign(); 146 146 147 147 $view->addProperty(
+1 -1
src/applications/diffusion/controller/DiffusionBrowseMainController.php
··· 19 19 'diffusion.browsequery', 20 20 array( 21 21 'path' => $drequest->getPath(), 22 - 'commit' => $drequest->getStableCommitName(), 22 + 'commit' => $drequest->getStableCommit(), 23 23 ))); 24 24 $reason = $results->getReasonForEmptyResultSet(); 25 25 $is_file = ($reason == DiffusionBrowseResultSet::REASON_IS_FILE);
+2 -2
src/applications/diffusion/controller/DiffusionBrowseSearchController.php
··· 61 61 'diffusion.searchquery', 62 62 array( 63 63 'grep' => $query_string, 64 - 'stableCommitName' => $drequest->getStableCommitName(), 64 + 'commit' => $drequest->getStableCommit(), 65 65 'path' => $drequest->getPath(), 66 66 'limit' => $limit + 1, 67 67 'offset' => $page, ··· 73 73 'diffusion.querypaths', 74 74 array( 75 75 'pattern' => $query_string, 76 - 'commit' => $drequest->getStableCommitName(), 76 + 'commit' => $drequest->getStableCommit(), 77 77 'path' => $drequest->getPath(), 78 78 'limit' => $limit + 1, 79 79 'offset' => $page,
+1 -1
src/applications/diffusion/controller/DiffusionChangeController.php
··· 139 139 ->setUser($viewer) 140 140 ->setActionList($actions); 141 141 142 - $stable_commit = $drequest->getStableCommitName(); 142 + $stable_commit = $drequest->getStableCommit(); 143 143 $callsign = $drequest->getRepository()->getCallsign(); 144 144 145 145 $view->addProperty(
+1 -1
src/applications/diffusion/controller/DiffusionHistoryController.php
··· 152 152 ->setUser($viewer) 153 153 ->setActionList($actions); 154 154 155 - $stable_commit = $drequest->getStableCommitName(); 155 + $stable_commit = $drequest->getStableCommit(); 156 156 $callsign = $drequest->getRepository()->getCallsign(); 157 157 158 158 $view->addProperty(
+13 -12
src/applications/diffusion/request/DiffusionRequest.php
··· 15 15 protected $callsign; 16 16 protected $path; 17 17 protected $line; 18 - protected $symbolicCommit; 19 18 protected $commit; 20 19 protected $commitType = 'commit'; 21 20 protected $branch; 22 21 protected $lint; 23 22 23 + protected $symbolicCommit; 24 + protected $stableCommit; 25 + 24 26 protected $repository; 25 27 protected $repositoryCommit; 26 28 protected $repositoryCommitData; 27 - protected $stableCommitName; 28 29 protected $arcanistProjects; 29 30 30 31 private $initFromConduit = true; ··· 315 316 * @return string Stable commit name, like a git hash or SVN revision. Not 316 317 * a symbolic commit reference. 317 318 */ 318 - public function getStableCommitName() { 319 - if (!$this->stableCommitName) { 320 - $this->queryStableCommitName(); 319 + public function getStableCommit() { 320 + if (!$this->stableCommit) { 321 + $this->queryStableCommit(); 321 322 } 322 - return $this->stableCommitName; 323 + return $this->stableCommit; 323 324 } 324 325 325 326 final public function getRawCommit() { ··· 347 348 if (empty($params['stable'])) { 348 349 $default_commit = $this->getRawCommit(); 349 350 } else { 350 - $default_commit = $this->getStableCommitName(); 351 + $default_commit = $this->getStableCommit(); 351 352 } 352 353 353 354 $defaults = array( ··· 636 637 return $this->commitType; 637 638 } 638 639 639 - private function queryStableCommitName() { 640 + private function queryStableCommit() { 640 641 if ($this->commit) { 641 - $this->stableCommitName = $this->commit; 642 - return $this->stableCommitName; 642 + $this->stableCommit = $this->commit; 643 + return $this->stableCommit; 643 644 } 644 645 645 646 if ($this->getSupportsBranches()) { ··· 656 657 pht('Ref "%s" is ambiguous or does not exist.', $branch)); 657 658 } 658 659 659 - $this->stableCommitName = idx(head($matches), 'identifier'); 660 - return $this->stableCommitName; 660 + $this->stableCommit = idx(head($matches), 'identifier'); 661 + return $this->stableCommit; 661 662 } 662 663 663 664 protected function getResolvableBranchName($branch) {
+1 -1
src/applications/diffusion/request/DiffusionSvnRequest.php
··· 27 27 return $this->commit; 28 28 } 29 29 30 - return $this->getStableCommitName(); 30 + return $this->getStableCommit(); 31 31 } 32 32 33 33 }