Page MenuHomePhabricator

D14923.id36059.diff
No OneTemporary

D14923.id36059.diff

diff --git a/src/applications/repository/phid/PhabricatorRepositoryRepositoryPHIDType.php b/src/applications/repository/phid/PhabricatorRepositoryRepositoryPHIDType.php
--- a/src/applications/repository/phid/PhabricatorRepositoryRepositoryPHIDType.php
+++ b/src/applications/repository/phid/PhabricatorRepositoryRepositoryPHIDType.php
@@ -40,10 +40,11 @@
$monogram = $repository->getMonogram();
$callsign = $repository->getCallsign();
$name = $repository->getName();
+ $uri = $repository->getURI();
$handle->setName($monogram);
$handle->setFullName("{$monogram} {$name}");
- $handle->setURI("/diffusion/{$callsign}/");
+ $handle->setURI($uri);
}
}
diff --git a/src/applications/repository/query/PhabricatorRepositorySearchEngine.php b/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
--- a/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
+++ b/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
@@ -155,15 +155,15 @@
->setUser($viewer)
->setObject($repository)
->setHeader($repository->getName())
- ->setObjectName('r'.$repository->getCallsign())
- ->setHref($this->getApplicationURI($repository->getCallsign().'/'));
+ ->setObjectName($repository->getMonogram())
+ ->setHref($repository->getURI());
$commit = $repository->getMostRecentCommit();
if ($commit) {
$commit_link = DiffusionView::linkCommit(
- $repository,
- $commit->getCommitIdentifier(),
- $commit->getSummary());
+ $repository,
+ $commit->getCommitIdentifier(),
+ $commit->getSummary());
$item->setSubhead($commit_link);
$item->setEpoch($commit->getEpoch());
}
diff --git a/src/applications/repository/search/DiffusionCommitFulltextEngine.php b/src/applications/repository/search/DiffusionCommitFulltextEngine.php
--- a/src/applications/repository/search/DiffusionCommitFulltextEngine.php
+++ b/src/applications/repository/search/DiffusionCommitFulltextEngine.php
@@ -20,8 +20,10 @@
$commit_message = $commit_data->getCommitMessage();
$author_phid = $commit_data->getCommitDetail('authorPHID');
- $title = 'r'.$repository->getCallsign().$commit->getCommitIdentifier().
- ' '.$commit_data->getSummary();
+ $monogram = $commit->getMonogram();
+ $summary = $commit_data->getSummary();
+
+ $title = "{$monogram} {$summary}";
$document
->setDocumentCreated($date_created)
diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommit.php b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
--- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
@@ -203,10 +203,7 @@
}
public function getURI() {
- $repository = $this->getRepository();
- $callsign = $repository->getCallsign();
- $commit_identifier = $this->getCommitIdentifier();
- return '/r'.$callsign.$commit_identifier;
+ return '/'.$this->getMonogram();
}
/**
@@ -251,6 +248,14 @@
return $this->setAuditStatus($status);
}
+ public function getMonogram() {
+ $repository = $this->getRepository();
+ $callsign = $repository->getCallsign();
+ $identifier = $this->getCommitIdentifier();
+
+ return "r{$callsign}{$identifier}";
+ }
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php b/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php
--- a/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php
+++ b/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php
@@ -17,30 +17,26 @@
pht('No "%s" in task data.', 'commitID'));
}
- $commit = id(new PhabricatorRepositoryCommit())->load($commit_id);
-
+ $commit = id(new DiffusionCommitQuery())
+ ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->withIDs(array($commit_id))
+ ->executeOne();
if (!$commit) {
throw new PhabricatorWorkerPermanentFailureException(
pht('Commit "%s" does not exist.', $commit_id));
}
- return $this->commit = $commit;
+ $this->commit = $commit;
+
+ return $commit;
}
final protected function doWork() {
- if (!$this->loadCommit()) {
- return;
- }
-
- $repository = id(new PhabricatorRepositoryQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
- ->withIDs(array($this->commit->getRepositoryID()))
- ->executeOne();
- if (!$repository) {
- return;
- }
+ $commit = $this->loadCommit();
+ $repository = $commit->getRepository();
$this->repository = $repository;
+
$this->parseCommit($repository, $this->commit);
}
@@ -52,14 +48,14 @@
PhabricatorRepository $repository,
PhabricatorRepositoryCommit $commit);
- protected function isBadCommit($full_commit_name) {
+ protected function isBadCommit(PhabricatorRepositoryCommit $commit) {
$repository = new PhabricatorRepository();
$bad_commit = queryfx_one(
$repository->establishConnection('w'),
'SELECT * FROM %T WHERE fullCommitName = %s',
PhabricatorRepository::TABLE_BADCOMMIT,
- $full_commit_name);
+ $commit->getMonogram());
return (bool)$bad_commit;
}
diff --git a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
--- a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
+++ b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
@@ -17,12 +17,8 @@
PhabricatorRepository $repository,
PhabricatorRepositoryCommit $commit) {
- $identifier = $commit->getCommitIdentifier();
- $callsign = $repository->getCallsign();
- $full_name = 'r'.$callsign.$identifier;
-
- $this->log("%s\n", pht('Parsing %s...', $full_name));
- if ($this->isBadCommit($full_name)) {
+ $this->log("%s\n", pht('Parsing "%s"...', $commit->getMonogram()));
+ if ($this->isBadCommit($commit)) {
$this->log(pht('This commit is marked bad!'));
return;
}
diff --git a/src/applications/search/engine/PhabricatorJumpNavHandler.php b/src/applications/search/engine/PhabricatorJumpNavHandler.php
--- a/src/applications/search/engine/PhabricatorJumpNavHandler.php
+++ b/src/applications/search/engine/PhabricatorJumpNavHandler.php
@@ -57,7 +57,7 @@
->execute();
if (count($repositories) == 1) {
// Just one match, jump to repository.
- $uri = '/diffusion/'.head($repositories)->getCallsign().'/';
+ $uri = head($repositories)->getURI();
} else {
// More than one match, jump to search.
$uri = urisprintf('/diffusion/?order=name&name=%s', $name);

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 9, 10:01 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6727266
Default Alt Text
D14923.id36059.diff (7 KB)

Event Timeline