Page MenuHomePhabricator

D20418.id48760.diff
No OneTemporary

D20418.id48760.diff

diff --git a/src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php b/src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php
--- a/src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php
+++ b/src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php
@@ -83,49 +83,41 @@
}
public function getTitle() {
- if (!$this->getMetadataValue('isCommitClose')) {
- return pht(
- '%s closed this revision.',
- $this->renderAuthor());
- }
-
$commit_phid = $this->getMetadataValue('commitPHID');
- $committer_phid = $this->getMetadataValue('committerPHID');
- $author_phid = $this->getMetadataValue('authorPHID');
-
- if ($committer_phid) {
- $committer_name = $this->renderHandle($committer_phid);
+ if ($commit_phid) {
+ $commit = id(new DiffusionCommitQuery())
+ ->setViewer($this->getViewer())
+ ->withPHIDs(array($commit_phid))
+ ->needIdentities(true)
+ ->executeOne();
} else {
- $committer_name = $this->getMetadataValue('committerName');
+ $commit = null;
}
- if ($author_phid) {
- $author_name = $this->renderHandle($author_phid);
- } else {
- $author_name = $this->getMetadatavalue('authorName');
+ if (!$commit) {
+ return pht(
+ '%s closed this revision.',
+ $this->renderAuthor());
}
- $same_phid =
- strlen($committer_phid) &&
- strlen($author_phid) &&
- ($committer_phid == $author_phid);
-
- $same_name =
- !strlen($committer_phid) &&
- !strlen($author_phid) &&
- ($committer_name == $author_name);
+ $author_phid = $commit->getAuthorDisplayPHID();
+ $committer_phid = $commit->getCommitterDisplayPHID();
- if ($same_name || $same_phid) {
+ if (!$author_phid) {
+ return pht(
+ 'Closed by commit %s.',
+ $this->renderHandle($commit_phid));
+ } else if (!$committer_phid || ($committer_phid === $author_phid)) {
return pht(
'Closed by commit %s (authored by %s).',
$this->renderHandle($commit_phid),
- $author_name);
+ $this->renderHandle($author_phid));
} else {
return pht(
'Closed by commit %s (authored by %s, committed by %s).',
$this->renderHandle($commit_phid),
- $author_name,
- $committer_name);
+ $this->renderHandle($author_phid),
+ $this->renderHandle($committer_phid));
}
}
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementUnpublishWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementUnpublishWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementUnpublishWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementUnpublishWorkflow.php
@@ -241,15 +241,13 @@
if ($xactions) {
foreach ($xactions as $xaction) {
$metadata = $xaction->getMetadata();
- if (idx($metadata, 'isCommitClose')) {
- if (idx($metadata, 'commitPHID') === $src->getPHID()) {
- echo tsprintf(
- "%s\n",
- pht(
- 'MANUAL Revision "%s" was likely closed improperly by "%s".',
- $dst->getMonogram(),
- $src->getMonogram()));
- }
+ if (idx($metadata, 'commitPHID') === $src->getPHID()) {
+ echo tsprintf(
+ "%s\n",
+ pht(
+ 'MANUAL Revision "%s" was likely closed improperly by "%s".',
+ $dst->getMonogram(),
+ $src->getMonogram()));
}
}
}
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
@@ -244,24 +244,11 @@
$commit_close_xaction = id(new DifferentialTransaction())
->setTransactionType($type_close)
- ->setNewValue(true)
- ->setMetadataValue('isCommitClose', true);
+ ->setNewValue(true);
$commit_close_xaction->setMetadataValue(
'commitPHID',
$commit->getPHID());
- $commit_close_xaction->setMetadataValue(
- 'committerPHID',
- $committer_phid);
- $commit_close_xaction->setMetadataValue(
- 'committerName',
- $data->getCommitDetail('committer'));
- $commit_close_xaction->setMetadataValue(
- 'authorPHID',
- $author_phid);
- $commit_close_xaction->setMetadataValue(
- 'authorName',
- $data->getAuthorName());
if ($low_level_query) {
$commit_close_xaction->setMetadataValue(

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 9:23 AM (4 h, 36 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6774254
Default Alt Text
D20418.id48760.diff (5 KB)

Event Timeline