Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14836725
D10403.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10403.diff
View Options
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,26 @@
private $committerEmail;
private $hashes = array();
+ public static function newFromConduitResult(array $result) {
+ $ref = id(new DiffusionCommitRef())
+ ->setCommitterEmail(idx($result, 'committerEmail'))
+ ->setCommitterName(idx($result, 'committerName'))
+ ->setAuthorEmail(idx($result, 'authorEmail'))
+ ->setAuthorName(idx($result, 'authorName'))
+ ->setMessage(idx($result, 'message'));
+
+ $hashes = array();
+ foreach (idx($result, 'hashes', array()) as $hash_result) {
+ $hashes[] = id(new DiffusionCommitHash())
+ ->setHashType(idx($hash_result, 'type'))
+ ->setHashValue(idx($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,25 @@
"%s\n",
pht('Examining commit %s...', $name));
- $ref = id(new DiffusionLowLevelCommitQuery())
- ->setRepository($repo)
- ->withIdentifier($commit->getCommitIdentifier())
- ->execute();
+ $refs_raw = DiffusionQuery::callConduitWithDiffusionRequest(
+ $this->getViewer(),
+ DiffusionRequest::newFromDictionary(
+ array(
+ 'repository' => $repo,
+ 'user' => $this->getViewer(),
+ )),
+ 'diffusion.querycommits',
+ array(
+ 'phids' => array($commit->getPHID()),
+ 'bypassCache' => true,
+ ));
+
+ if (empty($refs_raw['data'])) {
+ throw new Exception(
+ pht('Unable to retrieve details for commit "%s"!'));
+ }
+
+ $ref = DiffusionCommitRef::newFromConduitResult(head($refs_raw['data']));
$author = $ref->getAuthor();
$console->writeOut(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 1, 4:17 AM (11 h, 37 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7080747
Default Alt Text
D10403.diff (2 KB)
Attached To
Mode
D10403: Update PhabricatorRepositoryManagementLookupUsersWorkflow to use ConduitCall
Attached
Detach File
Event Timeline
Log In to Comment