mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Diffusion / Herald - tweak "Accepted Differential Revision exists" Herald field
Summary: make it use the value of the revision before any post-commit magic has occurred. Fixes T4754 Test Plan: made a herald rule that said "if revision exists, and revision accept does not exists, block push". tried to push a commit that had a revision that wasn't accepted and I was blocked. Reviewers: epriestley Reviewed By: epriestley Subscribers: mbishopim3, epriestley, Korvin Maniphest Tasks: T4754, T4574 Differential Revision: https://secure.phabricator.com/D10393
This commit is contained in:
parent
7ecbc70784
commit
2f4addc671
2 changed files with 9 additions and 1 deletions
|
@ -443,7 +443,10 @@ final class HeraldCommitAdapter extends HeraldAdapter {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($revision->getStatus()) {
|
$status = $data->getCommitDetail(
|
||||||
|
'precommitRevisionStatus',
|
||||||
|
$revision->getStatus());
|
||||||
|
switch ($status) {
|
||||||
case ArcanistDifferentialRevisionStatus::ACCEPTED:
|
case ArcanistDifferentialRevisionStatus::ACCEPTED:
|
||||||
case ArcanistDifferentialRevisionStatus::CLOSED:
|
case ArcanistDifferentialRevisionStatus::CLOSED:
|
||||||
return $revision->getPHID();
|
return $revision->getPHID();
|
||||||
|
|
|
@ -110,6 +110,11 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
|
||||||
$revision = $revision_query->executeOne();
|
$revision = $revision_query->executeOne();
|
||||||
|
|
||||||
if ($revision) {
|
if ($revision) {
|
||||||
|
if (!$data->getCommitDetail('precommitRevisionStatus')) {
|
||||||
|
$data->setCommitDetail(
|
||||||
|
'precommitRevisionStatus',
|
||||||
|
$revision->getStatus());
|
||||||
|
}
|
||||||
$commit_drev = PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV;
|
$commit_drev = PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV;
|
||||||
id(new PhabricatorEdgeEditor())
|
id(new PhabricatorEdgeEditor())
|
||||||
->addEdge($commit->getPHID(), $commit_drev, $revision->getPHID())
|
->addEdge($commit->getPHID(), $commit_drev, $revision->getPHID())
|
||||||
|
|
Loading…
Reference in a new issue