mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 19:32:40 +01:00
47a184e2a5
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
55 lines
1.2 KiB
PHP
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();
|
|
}
|
|
|
|
}
|