Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18107651
D11230.id26961.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D11230.id26961.diff
View Options
diff --git a/src/applications/maniphest/storage/ManiphestTransaction.php b/src/applications/maniphest/storage/ManiphestTransaction.php
--- a/src/applications/maniphest/storage/ManiphestTransaction.php
+++ b/src/applications/maniphest/storage/ManiphestTransaction.php
@@ -114,6 +114,12 @@
$phids[] = $phid;
}
break;
+ case self::TYPE_STATUS:
+ $commit_phid = $this->getMetadataValue('commit_phid');
+ if ($commit_phid) {
+ $phids[] = $commit_phid;
+ }
+ break;
}
return $phids;
@@ -121,6 +127,16 @@
public function shouldHide() {
switch ($this->getTransactionType()) {
+ case PhabricatorTransactions::TYPE_EDGE:
+ $commit_phid = $this->getMetadataValue('commit_phid');
+ $edge_type = $this->getMetadataValue('edge:type');
+
+ if ($edge_type == ManiphestTaskHasCommitEdgeType::EDGECONST) {
+ if ($commit_phid) {
+ return true;
+ }
+ }
+ break;
case self::TYPE_DESCRIPTION:
case self::TYPE_PRIORITY:
case self::TYPE_STATUS:
@@ -385,28 +401,62 @@
$old_name = ManiphestTaskStatus::getTaskStatusName($old);
$new_name = ManiphestTaskStatus::getTaskStatusName($new);
+ $commit_phid = $this->getMetadataValue('commit_phid');
+
if ($new_closed && !$old_closed) {
if ($new == ManiphestTaskStatus::getDuplicateStatus()) {
+ if ($commit_phid) {
+ return pht(
+ '%s closed this task as a duplicate by committing %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($commit_phid));
+ } else {
+ return pht(
+ '%s closed this task as a duplicate.',
+ $this->renderHandleLink($author_phid));
+ }
+ } else {
+ if ($commit_phid) {
+ return pht(
+ '%s closed this task as "%s" by committing %s.',
+ $this->renderHandleLink($author_phid),
+ $new_name,
+ $this->renderHandleLink($commit_phid));
+ } else {
+ return pht(
+ '%s closed this task as "%s".',
+ $this->renderHandleLink($author_phid),
+ $new_name);
+ }
+ }
+ } else if (!$new_closed && $old_closed) {
+ if ($commit_phid) {
return pht(
- '%s closed this task as a duplicate.',
- $this->renderHandleLink($author_phid));
+ '%s reopened this task as "%s" by committing %s.',
+ $this->renderHandleLink($author_phid),
+ $new_name,
+ $this->renderHandleLink($commit_phid));
} else {
return pht(
- '%s closed this task as "%s".',
+ '%s reopened this task as "%s".',
$this->renderHandleLink($author_phid),
$new_name);
}
- } else if (!$new_closed && $old_closed) {
- return pht(
- '%s reopened this task as "%s".',
- $this->renderHandleLink($author_phid),
- $new_name);
} else {
- return pht(
- '%s changed the task status from "%s" to "%s".',
- $this->renderHandleLink($author_phid),
- $old_name,
- $new_name);
+ if ($commit_phid) {
+ return pht(
+ '%s changed the task status from "%s" to "%s" by committing %s.',
+ $this->renderHandleLink($author_phid),
+ $old_name,
+ $new_name,
+ $this->renderHandleLink($commit_phid));
+ } else {
+ return pht(
+ '%s changed the task status from "%s" to "%s".',
+ $this->renderHandleLink($author_phid),
+ $old_name,
+ $new_name);
+ }
}
case self::TYPE_UNBLOCK:
diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
--- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
+++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
@@ -495,7 +495,7 @@
$xactions = array();
$edge_type = ManiphestTaskHasCommitEdgeType::EDGECONST;
- $xactions[] = id(new ManiphestTransaction())
+ $edge_xaction = id(new ManiphestTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $edge_type)
->setNewValue(
@@ -510,23 +510,15 @@
if ($task->getStatus() != $status) {
$xactions[] = id(new ManiphestTransaction())
->setTransactionType(ManiphestTransaction::TYPE_STATUS)
+ ->setMetadataValue('commit_phid', $commit->getPHID())
->setNewValue($status);
- $commit_name = $repository->formatCommitName(
- $commit->getCommitIdentifier());
-
- $status_message = pht(
- 'Closed by commit %s.',
- $commit_name);
-
- $xactions[] = id(new ManiphestTransaction())
- ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
- ->attachComment(
- id(new ManiphestTransactionComment())
- ->setContent($status_message));
+ $edge_xaction->setMetadataValue('commit_phid', $commit->getPHID());
}
}
+ $xactions[] = $edge_xaction;
+
$content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_DAEMON,
array());
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 12, 2:04 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
9145576
Default Alt Text
D11230.id26961.diff (5 KB)
Attached To
Mode
D11230: Fixes T6637, "closing by commit" should update task status and specify responsible commit, but drop the artificial comment.
Attached
Detach File
Event Timeline
Log In to Comment