Page MenuHomePhabricator

D14995.id36217.diff
No OneTemporary

D14995.id36217.diff

diff --git a/src/applications/diffusion/conduit/DiffusionQueryCommitsConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionQueryCommitsConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionQueryCommitsConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionQueryCommitsConduitAPIMethod.php
@@ -79,6 +79,7 @@
'repositoryPHID' => $commit->getRepository()->getPHID(),
'identifier' => $commit->getCommitIdentifier(),
'epoch' => $commit->getEpoch(),
+ 'authorEpoch' => $commit_data->getCommitDetail('authorEpoch'),
'uri' => $uri,
'isImporting' => !$commit->isImported(),
'summary' => $commit->getSummary(),
@@ -99,6 +100,7 @@
->withIdentifier($commit->getCommitIdentifier())
->execute();
+ $dict['authorEpoch'] = $lowlevel_commitref->getAuthorEpoch();
$dict['author'] = $lowlevel_commitref->getAuthor();
$dict['authorName'] = $lowlevel_commitref->getAuthorName();
$dict['authorEmail'] = $lowlevel_commitref->getAuthorEmail();
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
@@ -495,6 +495,12 @@
// TODO: In Git, a distinct authorship date is available. When present,
// we should show it here.
+ $author_epoch = $data->getCommitDetail('authorEpoch');
+ if ($author_epoch !== null) {
+ $authored_info->setNote(
+ phabricator_datetime($author_epoch, $viewer));
+ }
+
if ($author_phid) {
$authored_info->setTarget($handles[$author_phid]->renderLink());
} else if (strlen($author_name)) {
diff --git a/src/applications/diffusion/data/DiffusionCommitRef.php b/src/applications/diffusion/data/DiffusionCommitRef.php
--- a/src/applications/diffusion/data/DiffusionCommitRef.php
+++ b/src/applications/diffusion/data/DiffusionCommitRef.php
@@ -3,6 +3,7 @@
final class DiffusionCommitRef extends Phobject {
private $message;
+ private $authorEpoch;
private $authorName;
private $authorEmail;
private $committerName;
@@ -11,6 +12,7 @@
public static function newFromConduitResult(array $result) {
$ref = id(new DiffusionCommitRef())
+ ->setAuthorEpoch(idx($result, 'authorEpoch'))
->setCommitterEmail(idx($result, 'committerEmail'))
->setCommitterName(idx($result, 'committerName'))
->setAuthorEmail(idx($result, 'authorEmail'))
@@ -38,6 +40,15 @@
return $this->hashes;
}
+ public function setAuthorEpoch($author_epoch) {
+ $this->authorEpoch = $author_epoch;
+ return $this;
+ }
+
+ public function getAuthorEpoch() {
+ return $this->authorEpoch;
+ }
+
public function setCommitterEmail($committer_email) {
$this->committerEmail = $committer_email;
return $this;
diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php
--- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php
+++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php
@@ -52,7 +52,7 @@
'UTF-8',
implode(
'%x00',
- array('%e', '%cn', '%ce', '%an', '%ae', '%T', '%s%n%n%b')),
+ array('%e', '%cn', '%ce', '%an', '%ae', '%T', '%at', '%s%n%n%b')),
$this->identifier);
$parts = explode("\0", $info);
@@ -77,13 +77,19 @@
->setHashValue($parts[4]),
);
+ $author_epoch = (int)$parts[5];
+ if (!$author_epoch) {
+ $author_epoch = null;
+ }
+
return id(new DiffusionCommitRef())
->setCommitterName($parts[0])
->setCommitterEmail($parts[1])
->setAuthorName($parts[2])
->setAuthorEmail($parts[3])
->setHashes($hashes)
- ->setMessage($parts[5]);
+ ->setAuthorEpoch($author_epoch)
+ ->setMessage($parts[6]);
}
private function loadMercurialCommitRef() {
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
@@ -58,6 +58,7 @@
->setMaximumBytes(255)
->truncateString((string)$author));
+ $data->setCommitDetail('authorEpoch', $ref->getAuthorEpoch());
$data->setCommitDetail('authorName', $ref->getAuthorName());
$data->setCommitDetail('authorEmail', $ref->getAuthorEmail());

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 16, 10:30 AM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717125
Default Alt Text
D14995.id36217.diff (4 KB)

Event Timeline