1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 19:32:40 +01:00
phorge-phorge/src/applications/diffusion/request/DiffusionSvnRequest.php
vrana 47a184e2a5 Display saved lint messages in Diffusion browse file
Test Plan:
Looked at https://secure.phabricator.com/diffusion/ARC/browse/master/src/difference/ArcanistDiffUtils.php.
Saw "Show 16 Lint Messages".
Clicked on it, saw the messages.
Clicked on "Hide Lint Messages".
Went to https://secure.phabricator.com/diffusion/ARC/browse/master/src/difference/ArcanistDiffUtils.php;5be54e.
Saw "Switch Commit to See Lint".
Clicked on it, saw the messages.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3920
2012-11-08 15:39:44 -08:00

55 lines
1.2 KiB
PHP

<?php
/**
* @group diffusion
*/
final class DiffusionSvnRequest extends DiffusionRequest {
protected function getSupportsBranches() {
return false;
}
protected function didInitialize() {
if ($this->path === null) {
$subpath = $this->repository->getDetail('svn-subpath');
if ($subpath) {
$this->path = $subpath;
}
}
}
protected function getArcanistBranch() {
return 'svn';
}
public function getStableCommitName() {
if ($this->commit) {
return $this->commit;
}
if ($this->stableCommitName === null) {
$commit = id(new PhabricatorRepositoryCommit())
->loadOneWhere(
'repositoryID = %d ORDER BY epoch DESC LIMIT 1',
$this->getRepository()->getID());
if ($commit) {
$this->stableCommitName = $commit->getCommitIdentifier();
} else {
// For new repositories, we may not have parsed any commits yet. Call
// the stable commit "1" and avoid fataling.
$this->stableCommitName = 1;
}
}
return $this->stableCommitName;
}
public function getCommit() {
if ($this->commit) {
return $this->commit;
}
return $this->getStableCommitName();
}
}