Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
Show First 20 Lines • Show All 1,049 Lines • ▼ Show 20 Lines | public function shouldPublish() { | ||||
if ($this->getDetail('herald-disabled')) { | if ($this->getDetail('herald-disabled')) { | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
public function shouldPublishCommit(PhabricatorRepositoryCommit $commit) { | |||||
if (!$this->shouldPublish()) { | |||||
return false; | |||||
} | |||||
amckinley: Maybe expand `PhabricatorRepository->shouldPublish()` to add an "Enable notifications, feed… | |||||
Done Inline ActionsIf anyone does want this, I'm planning to add tag(...) / ref(...) rules to "Permanent Refs". Then you could get this behavior ("always publish absolutely everything, no matter what") with ref-regexp(.*) or similar, you'd just have to opt into it and explicitly make more stuff permanent than is defualt. (But AFAIK there are no outstanding requests for this other than PHI1148, which is still a little murky.) epriestley: If anyone does want this, I'm planning to add `tag(...)` / `ref(...)` rules to "Permanent Refs". | |||||
if (!$commit->isPermanentCommit()) { | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
/* -( Autoclose )---------------------------------------------------------- */ | /* -( Autoclose )---------------------------------------------------------- */ | ||||
public function shouldAutocloseRef(DiffusionRepositoryRef $ref) { | public function shouldAutocloseRef(DiffusionRepositoryRef $ref) { | ||||
if (!$ref->isBranch()) { | if (!$ref->isBranch()) { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | switch ($this->getVersionControlSystem()) { | ||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: | case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: | ||||
return null; | return null; | ||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: | case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: | ||||
break; | break; | ||||
default: | default: | ||||
throw new Exception(pht('Unrecognized version control system.')); | throw new Exception(pht('Unrecognized version control system.')); | ||||
} | } | ||||
$closeable_flag = PhabricatorRepositoryCommit::IMPORTED_CLOSEABLE; | if (!$commit->isPermanentCommit()) { | ||||
if (!$commit->isPartiallyImported($closeable_flag)) { | |||||
return self::BECAUSE_NOT_ON_AUTOCLOSE_BRANCH; | return self::BECAUSE_NOT_ON_AUTOCLOSE_BRANCH; | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 1,679 Lines • Show Last 20 Lines |
Maybe expand PhabricatorRepository->shouldPublish() to add an "Enable notifications, feed, and Herald, even for virtual branches" option to the "publish/notify" setting? It's probably not what users want to have a commit that Fixes T4444 actually close the task until their commit lands someone non-virtual, but I could imagine someone wanting to run Herald rules on it or something.