Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15469594
D11253.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D11253.diff
View Options
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
@@ -3,6 +3,41 @@
abstract class PhabricatorRepositoryCommitMessageParserWorker
extends PhabricatorRepositoryCommitParserWorker {
+ abstract protected function parseCommitWithRef(
+ PhabricatorRepository $repository,
+ PhabricatorRepositoryCommit $commit,
+ DiffusionCommitRef $ref);
+
+ final protected function parseCommit(
+ PhabricatorRepository $repository,
+ PhabricatorRepositoryCommit $commit) {
+
+ $viewer = PhabricatorUser::getOmnipotentUser();
+
+ $refs_raw = DiffusionQuery::callConduitWithDiffusionRequest(
+ $viewer,
+ DiffusionRequest::newFromDictionary(
+ array(
+ 'repository' => $repository,
+ 'user' => $viewer,
+ )),
+ 'diffusion.querycommits',
+ array(
+ 'phids' => array($commit->getPHID()),
+ 'bypassCache' => true,
+ 'needMessages' => true,
+ ));
+
+ if (empty($refs_raw['data'])) {
+ throw new Exception(
+ pht('Unable to retrieve details for commit "%s"!'));
+ }
+
+ $ref = DiffusionCommitRef::newFromConduitResult(head($refs_raw['data']));
+
+ $this->parseCommitWithRef($repository, $commit, $ref);
+ }
+
final protected function updateCommitData(DiffusionCommitRef $ref) {
$commit = $this->commit;
$author = $ref->getAuthor();
diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryGitCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryGitCommitMessageParserWorker.php
--- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryGitCommitMessageParserWorker.php
+++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryGitCommitMessageParserWorker.php
@@ -3,14 +3,10 @@
final class PhabricatorRepositoryGitCommitMessageParserWorker
extends PhabricatorRepositoryCommitMessageParserWorker {
- protected function parseCommit(
+ protected function parseCommitWithRef(
PhabricatorRepository $repository,
- PhabricatorRepositoryCommit $commit) {
-
- $ref = id(new DiffusionLowLevelCommitQuery())
- ->setRepository($repository)
- ->withIdentifier($commit->getCommitIdentifier())
- ->execute();
+ PhabricatorRepositoryCommit $commit,
+ DiffusionCommitRef $ref) {
$this->updateCommitData($ref);
diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryMercurialCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryMercurialCommitMessageParserWorker.php
--- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryMercurialCommitMessageParserWorker.php
+++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryMercurialCommitMessageParserWorker.php
@@ -3,14 +3,10 @@
final class PhabricatorRepositoryMercurialCommitMessageParserWorker
extends PhabricatorRepositoryCommitMessageParserWorker {
- protected function parseCommit(
+ protected function parseCommitWithRef(
PhabricatorRepository $repository,
- PhabricatorRepositoryCommit $commit) {
-
- $ref = id(new DiffusionLowLevelCommitQuery())
- ->setRepository($repository)
- ->withIdentifier($commit->getCommitIdentifier())
- ->execute();
+ PhabricatorRepositoryCommit $commit,
+ DiffusionCommitRef $ref) {
$this->updateCommitData($ref);
diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositorySvnCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositorySvnCommitMessageParserWorker.php
--- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositorySvnCommitMessageParserWorker.php
+++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositorySvnCommitMessageParserWorker.php
@@ -3,14 +3,10 @@
final class PhabricatorRepositorySvnCommitMessageParserWorker
extends PhabricatorRepositoryCommitMessageParserWorker {
- protected function parseCommit(
+ protected function parseCommitWithRef(
PhabricatorRepository $repository,
- PhabricatorRepositoryCommit $commit) {
-
- $ref = id(new DiffusionLowLevelCommitQuery())
- ->setRepository($repository)
- ->withIdentifier($commit->getCommitIdentifier())
- ->execute();
+ PhabricatorRepositoryCommit $commit,
+ DiffusionCommitRef $ref) {
$this->updateCommitData($ref);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 5, 2:56 PM (5 h, 26 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7385376
Default Alt Text
D11253.diff (4 KB)
Attached To
Mode
D11253: Remove direct calls to LowLevelCommitQuery
Attached
Detach File
Event Timeline
Log In to Comment