Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15406943
D20419.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D20419.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D20419: Do not publish/notify about commits which are not reachable from any "Autoclose" ref
Attached
Detach File
Event Timeline
Log In to Comment