prevent endless redirection if a requested branch does not exist, i.e. has no matching revisions

master
Thomas Keller 2010-06-23 00:22:10 +02:00
parent 24762adecc
commit 9a8148079d
1 changed files with 10 additions and 1 deletions

View File

@ -420,7 +420,8 @@ class IDF_Scm_Monotone extends IDF_Scm
/**
* monotone has no concept of a "main" branch, so just return
* the confiured one
* the configured one. Ensure however that we can select revisions
* with it at all.
*
* @see IDF_Scm::getMainBranch()
*/
@ -431,6 +432,14 @@ class IDF_Scm_Monotone extends IDF_Scm
|| empty($branch)) {
$branch = "*";
}
if (count($this->_resolveSelector("h:$branch")) == 0)
{
throw new IDF_Scm_Exception(
"Branch $branch is empty"
);
}
return $branch;
}