}
/**
- * TODO
- */
- public function isFile($where)
- {
- return true;
- }
-
- /**
* Throw an exception if the revision number isn't valid.
*
* @param mixed $rev The revision number
*
- * @return void
* @throws Horde_Vcs_Exception
*/
public function assertValidRevision($rev)
}
/**
+ * TODO
+ */
+ public function isFile($where)
+ {
+ return true;
+ }
+
+ /**
* Create a range of revisions between two revision numbers.
*
* @param Horde_Vcs_File $file The desired file.
*/
public function annotate($fileob, $rev)
{
- if (!$this->isValidRevision($rev)) {
- return false;
- }
+ $this->assertValidRevision($rev);
$tmpfile = Util::getTempFile('vc', true, $this->getTempPath());
$where = $fileob->queryModulePath();
*/
public function checkout($fullname, $rev)
{
- if (!$rep->isValidRevision($rev)) {
- throw new Horde_Vcs_Exception('Invalid revision number');
- }
+ $rep->assertValidRevision($rev);
if (!($RCS = popen($this->getPath('co') . ' ' . escapeshellarg('-p' . $rev) . ' ' . escapeshellarg($fullname) . " 2>&1", VC_WINDOWS ? 'rb' : 'r'))) {
throw new Horde_Vcs_Exception('Couldn\'t perform checkout of the requested file');
$brs = preg_split('/;\s*/', $br[1]);
foreach ($brs as $brpoint) {
if ($this->rep->isValidRevision($brpoint)) {
- // TODO: Need branchname
$this->branches[] = $brpoint;
}
}
*/
public function strip($val, $amount = 1)
{
- if (!$this->isValidRevision($val)) {
- return false;
- }
+ $this->assertValidRevision($val);
+
$pos = 0;
while ($amount-- > 0 && ($pos = strrpos($val, '.')) !== false) {
$val = substr($val, 0, $pos);
{
return $this->isValidRevision($val)
? (substr_count($val, '.') + 1)
- : false;
+ : 0;
}
/**
*/
public function annotate($fileob, $rev)
{
- if (!$this->isValidRevision($rev)) {
- return false;
- }
+ $this->assertValidRevision($rev);
$command = $this->getCommand() . ' annotate -r ' . escapeshellarg('1:' . $rev) . ' ' . escapeshellarg($fileob->queryFullPath()) . ' 2>&1';
$pipe = popen($command, 'r');
*/
public function checkout($fullname, $rev)
{
- if (!$rep->isValidRevision($rev)) {
- throw new Horde_Vcs_Exception('Invalid revision number');
- }
+ $rep->assertValidRevision($rev);
return ($RCS = popen($this->getCommand() . ' cat -r ' . escapeshellarg($rev) . ' ' . escapeshellarg($fullname) . ' 2>&1', VC_WINDOWS ? 'rb' : 'r'))
? $RCS