Page MenuHomePhabricator

D10399.diff
No OneTemporary

D10399.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
@@ -22,6 +22,7 @@
'names' => 'optional list<string>',
'repositoryPHID' => 'optional phid',
'needMessages' => 'optional bool',
+ 'bypassCache' => 'optional bool',
) + $this->getPagerParamTypes();
}
@@ -31,6 +32,7 @@
protected function execute(ConduitAPIRequest $request) {
$need_messages = $request->getValue('needMessages');
+ $bypass_cache = $request->getValue('bypassCache');
$query = id(new DiffusionCommitQuery())
->setViewer($request->getUser());
@@ -87,8 +89,35 @@
'uri' => $uri,
'isImporting' => !$commit->isImported(),
'summary' => $commit->getSummary(),
+ 'authorName' => '',
+ 'authorEmail' => '',
+ 'committerName' => '',
+ 'committerEmail' => '',
+ 'hashes' => array(),
);
+ if ($bypass_cache) {
+ $lowlevel_commitref = id(new DiffusionLowLevelCommitQuery())
+ ->setRepository($commit->getRepository())
+ ->withIdentifier($commit->getCommitIdentifier())
+ ->execute();
+
+ $dict['authorName'] = $lowlevel_commitref->getAuthorName();
+ $dict['authorEmail'] = $lowlevel_commitref->getAuthorEmail();
+ $dict['committerName'] = $lowlevel_commitref->getCommitterName();
+ $dict['committerEmail'] = $lowlevel_commitref->getCommitterEmail();
+
+ if ($need_messages) {
+ $dict['message'] = $lowlevel_commitref->getMessage();
+ }
+
+ foreach ($lowlevel_commitref->getHashes() as $hash) {
+ $dict['hashes'][] = array(
+ 'type' => $hash->getHashType(),
+ 'value' => $hash->getHashValue());
+ }
+ }
+
if ($need_messages) {
$commit_data = $commit->getCommitData();
if ($commit_data) {

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 13, 3:50 PM (5 d, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6735745
Default Alt Text
D10399.diff (2 KB)

Event Timeline