Page MenuHomePhabricator

D20419.diff
No OneTemporary

D20419.diff

diff --git a/src/applications/audit/editor/PhabricatorAuditEditor.php b/src/applications/audit/editor/PhabricatorAuditEditor.php
--- a/src/applications/audit/editor/PhabricatorAuditEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditEditor.php
@@ -718,7 +718,7 @@
switch ($xaction->getTransactionType()) {
case PhabricatorAuditTransaction::TYPE_COMMIT:
$repository = $object->getRepository();
- if (!$repository->shouldPublish()) {
+ if (!$repository->shouldPublishCommit($object)) {
return false;
}
return true;
@@ -779,7 +779,7 @@
// TODO: They should, and then we should simplify this.
$repository = $object->getRepository($assert_attached = false);
if ($repository != PhabricatorLiskDAO::ATTACHABLE) {
- if (!$repository->shouldPublish()) {
+ if (!$repository->shouldPublishCommit($object)) {
return false;
}
}
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -240,6 +240,19 @@
'reachable from any branch, tag, or ref.');
}
}
+ if (!$commit->isPermanentCommit()) {
+ $nonpermanent_tag = id(new PHUITagView())
+ ->setType(PHUITagView::TYPE_SHADE)
+ ->setName(pht('Not Permanent'))
+ ->setColor(PHUITagView::COLOR_ORANGE);
+
+ $header->addTag($nonpermanent_tag);
+
+ $this->commitErrors[] = pht(
+ 'This commit is not reachable from any permanent branch, tag, '.
+ 'or ref.');
+ }
+
if ($this->getCommitErrors()) {
$error_panel = id(new PHUIInfoView())
diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php
--- a/src/applications/repository/storage/PhabricatorRepository.php
+++ b/src/applications/repository/storage/PhabricatorRepository.php
@@ -1055,6 +1055,18 @@
return true;
}
+ public function shouldPublishCommit(PhabricatorRepositoryCommit $commit) {
+ if (!$this->shouldPublish()) {
+ return false;
+ }
+
+ if (!$commit->isPermanentCommit()) {
+ return false;
+ }
+
+ return true;
+ }
+
/* -( Autoclose )---------------------------------------------------------- */
@@ -1152,8 +1164,7 @@
throw new Exception(pht('Unrecognized version control system.'));
}
- $closeable_flag = PhabricatorRepositoryCommit::IMPORTED_CLOSEABLE;
- if (!$commit->isPartiallyImported($closeable_flag)) {
+ if (!$commit->isPermanentCommit()) {
return self::BECAUSE_NOT_ON_AUTOCLOSE_BRANCH;
}
diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommit.php b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
--- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
@@ -496,6 +496,10 @@
return $this->getAuditStatusObject()->isAudited();
}
+ public function isPermanentCommit() {
+ return (bool)$this->isPartiallyImported(self::IMPORTED_CLOSEABLE);
+ }
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public function getCapabilities() {
diff --git a/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php b/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php
--- a/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php
+++ b/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php
@@ -30,7 +30,7 @@
PhabricatorRepositoryCommit $commit) {
$viewer = PhabricatorUser::getOmnipotentUser();
- if (!$repository->shouldPublish()) {
+ if (!$repository->shouldPublishCommit($commit)) {
return;
}

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 19, 2:54 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7432340
Default Alt Text
D20419.diff (3 KB)

Event Timeline