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

make commit message worker savvier around revision ids

Summary: Fixes T2836

Test Plan: make a diff, get it approved, arc land, verify things okay. ask users on T2836 to try.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Maniphest Tasks: T2836

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

+19 -18
+19 -18
src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
··· 65 65 reset($field_values['reviewedByPHIDs'])); 66 66 } 67 67 68 + $revision_id = idx($field_values, 'revisionID'); 69 + if (!$revision_id) { 70 + $hashes = $this->getCommitHashes( 71 + $repository, 72 + $commit); 73 + if ($hashes) { 74 + $revisions = id(new DifferentialRevisionQuery()) 75 + ->setViewer(PhabricatorUser::getOmnipotentUser()) 76 + ->withCommitHashes($hashes) 77 + ->execute(); 78 + 79 + if (!empty($revisions)) { 80 + $revision = $this->identifyBestRevision($revisions); 81 + $revision_id = $revision->getID(); 82 + } 83 + } 84 + } 85 + 68 86 $data->setCommitDetail( 69 87 'differential.revisionID', 70 - idx($field_values, 'revisionID')); 88 + $revision_id); 71 89 72 90 $committer_phid = $this->lookupUser( 73 91 $commit, ··· 94 112 95 113 $revision = null; 96 114 $should_autoclose = $repository->shouldAutocloseCommit($commit, $data); 97 - $revision_id = $data->getCommitDetail('differential.revisionID'); 98 - if (!$revision_id) { 99 - $hashes = $this->getCommitHashes( 100 - $this->repository, 101 - $this->commit); 102 - if ($hashes) { 103 - $revisions = id(new DifferentialRevisionQuery()) 104 - ->setViewer(PhabricatorUser::getOmnipotentUser()) 105 - ->withCommitHashes($hashes) 106 - ->execute(); 107 - 108 - if (!empty($revisions)) { 109 - $revision = $this->identifyBestRevision($revisions); 110 - $revision_id = $revision->getID(); 111 - } 112 - } 113 - } 114 115 115 116 if ($revision_id) { 116 117 $lock = PhabricatorGlobalLock::newLock(get_class($this).':'.$revision_id);