path = BSRegister::Get('repos')->fetchPath($repos); $this->repos = $repos; $this->subpath = $subpath; $this->_fetchRevision($rev); } // ################################################################### /** * Returns an array of properties for this revision at a certain path * * @param string Path * * @return array Array of properties */ public function getPropsForPath($path) { $output = BSRegister::Get('lib')->run('proplist -v -r' . $this->revision . ' ' . BSRegister::Get('lib')->arg($this->path . $path) . '@' . $this->revision); unset($output[0]); $proplist = array(); foreach ($output AS $line) { if (preg_match('#^\s+(.*)\s:(\s(.*))?#', $line, $matches)) { $curprop = $matches[1]; $proplist["$curprop"] = $matches[2] . "\n"; } else { $proplist["$curprop"] .= $line . "\n"; } } return $proplist; } // ################################################################### /** * Gets the revision information (commit message, author, date) for the * revision */ public function getRevisionInfo() { $xml = BSXml::Parse(BSRegister::Get('lib')->run('log --xml -v -r' . $this->revision . ' ' . BSRegister::Get('lib')->arg($this->path) . '@' . $this->revision, true)); $this->message = FormatLogMessage($xml['log']['logentry']['msg']['value']); $this->messasgeClean = $xml['log']['logentry']['msg']['value']; $this->datetime = FormatSvnDate($xml['log']['logentry']['date']['value']); $this->author = $xml['log']['logentry']['author']['value']; $this->files = $xml['log']['logentry']['paths']['path']; BSXml::UnifyNode($this->files); } // ################################################################### /** * Gets the desired XML revision information from the repository * * @param integer Desired revision */ private function _fetchRevision($desired) { $xml = BSXml::Parse(BSRegister::Get('lib')->run('log --limit 1 --xml ' . ($desired > 0 ? '-r' . intval($desired) . ' ' : '') . BSRegister::Get('lib')->arg($this->path . $this->subpath) . ($desired > 0 ? '@' . intval($desired) : ''), true)); $this->revision = intval($xml['log']['logentry']['revision']); } } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>