Page MenuHomePhabricator

D10403.id25027.diff
No OneTemporary

D10403.id25027.diff

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
@@ -9,6 +9,25 @@
private $committerEmail;
private $hashes = array();
+ public static function fromConduitResult($result) {
+ $ref = id(new DiffusionCommitRef())
+ ->setCommitterEmail($result['committerEmail'])
+ ->setCommitterName($result['committerName'])
+ ->setAuthorEmail($result['authorEmail'])
+ ->setAuthorName($result['authorName'])
+ ->setMessage($result['message']);
+
+ $hashes = array();
+ foreach ($result['hashes'] as $hash_result) {
+ $hashes[] = id(new DiffusionCommitHash())
+ ->setHashType($hash_result['type'])
+ ->setHashValue($hash_result['value']);
+ }
+
+ $ref->setHashes($hashes);
+ return $ref;
+ }
+
public function setHashes(array $hashes) {
$this->hashes = $hashes;
return $this;
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
@@ -33,10 +33,17 @@
"%s\n",
pht('Examining commit %s...', $name));
- $ref = id(new DiffusionLowLevelCommitQuery())
- ->setRepository($repo)
- ->withIdentifier($commit->getCommitIdentifier())
- ->execute();
+ $conduit_call = id(new ConduitCall(
+ 'diffusion.querycommits',
+ array(
+ 'repositoryPHID' => $repo->getPHID(),
+ 'phids' => array($commit->getPHID()),
+ 'bypassCache' => true,
+ )));
+ $conduit_call->setUser(PhabricatorUser::getOmnipotentUser());
+ $refs_raw = $conduit_call->execute();
+
+ $ref = DiffusionCommitRef::fromConduitResult(head($refs_raw['data']));
$author = $ref->getAuthor();
$console->writeOut(

File Metadata

Mime Type
text/plain
Expires
Sat, Feb 1, 8:11 AM (15 h, 30 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7081247
Default Alt Text
D10403.id25027.diff (2 KB)

Event Timeline