1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 16:30:59 +01:00

Minor fixes.

This commit is contained in:
epriestley 2011-03-14 07:43:13 -07:00
parent a3cd33da19
commit 4196bfb3ef
3 changed files with 24 additions and 6 deletions

View file

@ -52,3 +52,5 @@ alter table phabricator_repository.repository_commit add unique key
alter table phabricator_repository.repository_commit add key
(repositoryID, epoch);
alter table phabricator_repository.repository_filesystem
add key (repositoryID, pathID, svnCommit);

View file

@ -59,7 +59,7 @@ final class DiffusionSvnBrowseQuery extends DiffusionBrowseQuery {
$slice_clause);
if (!$index) {
if ($this->path == '/') {
if ($path == '/') {
$this->reason = self::REASON_IS_EMPTY;
} else {
$reasons = queryfx_all(

View file

@ -27,11 +27,27 @@ final class DiffusionSvnFileContentQuery extends DiffusionFileContentQuery {
$remote_uri = $repository->getDetail('remote-uri');
list($corpus) = execx(
'svn --non-interactive cat %s%s@%s',
$remote_uri,
$path,
$commit);
try {
list($corpus) = execx(
'svn --non-interactive cat %s%s@%s',
$remote_uri,
$path,
$commit);
} catch (CommandException $ex) {
$stderr = $ex->getStdErr();
if (preg_match('/path not found$/', trim($stderr))) {
// TODO: Improve user experience for this. One way to end up here
// is to have the parser behind and look at a file which was recently
// nuked; Diffusion will think it still exists and try to grab content
// at HEAD.
throw new Exception(
"Failed to retrieve file content from Subversion. The file may ".
"have been recently deleted, or the Diffusion cache may be out of ".
"date.");
} else {
throw $ex;
}
}
$file_content = new DiffusionFileContent();
$file_content->setCorpus($corpus);