return IDF_Scm::REVISION_VALID;␊ |
}␊ |
␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo),␊ |
escapeshellarg($rev));␊ |
escapeshellarg($rev),␊ |
escapeshellarg($this->repo));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
self::exec('IDF_Scm_Svn::validateRevision', $cmd, $out, $ret);␊ |
␊ |
|
return IDF_Scm::REVISION_INVALID;␊ |
}␊ |
␊ |
␊ |
/**␊ |
* Test a given object hash.␊ |
*␊ |
|
}␊ |
␊ |
// Else, test the path on revision␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($path)),␊ |
escapeshellarg($rev));␊ |
escapeshellarg($rev),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($path)));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
$xmlInfo = self::shell_exec('IDF_Scm_Svn::testHash', $cmd);␊ |
␊ |
|
␊ |
public function getTree($commit, $folder='/', $branch=null)␊ |
{␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --xml --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --xml --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($folder)),␊ |
escapeshellarg($commit));␊ |
escapeshellarg($commit),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($folder)));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
$xml = simplexml_load_string(self::shell_exec('IDF_Scm_Svn::getTree', $cmd));␊ |
$res = array();␊ |
|
return $res;␊ |
}␊ |
␊ |
␊ |
/**␊ |
* Get the commit message of a revision revision.␊ |
*␊ |
|
if (isset($this->cache['commitmess'][$rev])) {␊ |
return $this->cache['commitmess'][$rev];␊ |
}␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml --limit 1 --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml --limit 1 --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo),␊ |
escapeshellarg($rev));␊ |
escapeshellarg($rev),␊ |
escapeshellarg($this->repo));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
try {␊ |
$xml = simplexml_load_string(self::shell_exec('IDF_Scm_Svn::getCommitMessage', $cmd));␊ |
|
if ($rev == null) {␊ |
$rev = 'HEAD';␊ |
}␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($filename)),␊ |
escapeshellarg($rev));␊ |
escapeshellarg($rev),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($filename)));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
$xml = simplexml_load_string(self::shell_exec('IDF_Scm_Svn::getPathInfo', $cmd));␊ |
if (!isset($xml->entry)) {␊ |
|
␊ |
public function getFile($def, $cmd_only=false)␊ |
{␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' cat --no-auth-cache --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' cat --no-auth-cache --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($def->fullpath)),␊ |
escapeshellarg($def->rev));␊ |
escapeshellarg($def->rev),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($def->fullpath)));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
return ($cmd_only) ?␊ |
$cmd : self::shell_exec('IDF_Scm_Svn::getFile', $cmd);␊ |
|
return $this->cache['branches'];␊ |
}␊ |
$res = array();␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --username=%s --password=%s %s@HEAD',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --username=%s --password=%s --revision=HEAD %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo.'/branches'));␊ |
|
}␊ |
}␊ |
ksort($res);␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --username=%s --password=%s %s@HEAD',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --username=%s --password=%s --revision=HEAD %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo.'/trunk'));␊ |
|
return $this->cache['tags'];␊ |
}␊ |
$res = array();␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --username=%s --password=%s %s@HEAD',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --username=%s --password=%s --revision=HEAD %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo.'/tags'));␊ |
|
return array();␊ |
}␊ |
␊ |
␊ |
/**␊ |
* Get commit details.␊ |
*␊ |
|
return false;␊ |
}␊ |
$res = array();␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml --limit 1 -v --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml --limit 1 -v --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo),␊ |
escapeshellarg($commit));␊ |
escapeshellarg($commit),␊ |
escapeshellarg($this->repo));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
$xmlRes = self::shell_exec('IDF_Scm_Svn::getCommit', $cmd);␊ |
$xml = simplexml_load_string($xmlRes);␊ |
|
$branch = 'HEAD';␊ |
}␊ |
$res = array();␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml -v --limit %s --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml -v --limit %s --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($n),␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo),␊ |
escapeshellarg($branch));␊ |
escapeshellarg($branch),␊ |
escapeshellarg($this->repo));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
$xmlRes = self::shell_exec('IDF_Scm_Svn::getChangeLog', $cmd);␊ |
$xml = simplexml_load_string($xmlRes);␊ |
|
return $res;␊ |
}␊ |
␊ |
␊ |
/**␊ |
* Get additionnals properties on path and revision␊ |
*␊ |
|
public function getProperties($rev, $path='')␊ |
{␊ |
$res = array();␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' proplist --no-auth-cache --xml --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' proplist --no-auth-cache --xml --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($path)),␊ |
escapeshellarg($rev));␊ |
escapeshellarg($rev),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($path)));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
$xmlProps = self::shell_exec('IDF_Scm_Svn::getProperties', $cmd);␊ |
$props = simplexml_load_string($xmlProps);␊ |
|
return $res;␊ |
}␊ |
␊ |
␊ |
/**␊ |
* Get a specific additionnal property on path and revision␊ |
*␊ |
|
private function getProperty($property, $rev, $path='')␊ |
{␊ |
$res = array();␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' propget --no-auth-cache --xml %s --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' propget --no-auth-cache --xml %s --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($property),␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($path)),␊ |
escapeshellarg($rev));␊ |
escapeshellarg($rev),␊ |
escapeshellarg($this->repo.'/'.self::smartEncode($path)));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
$xmlProp = self::shell_exec('IDF_Scm_Svn::getProperty', $cmd);␊ |
$prop = simplexml_load_string($xmlProp);␊ |
|
return (string) $prop->target->property;␊ |
}␊ |
␊ |
␊ |
/**␊ |
* Get the number of the last commit in the repository.␊ |
*␊ |
|
public function getLastCommit($rev='HEAD')␊ |
{␊ |
$xmlInfo = '';␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s %s@%s',␊ |
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s --revision=%s %s',␊ |
escapeshellarg($this->username),␊ |
escapeshellarg($this->password),␊ |
escapeshellarg($this->repo),␊ |
escapeshellarg($rev));␊ |
escapeshellarg($rev),␊ |
escapeshellarg($this->repo));␊ |
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;␊ |
$xmlInfo = self::shell_exec('IDF_Scm_Svn::getLastCommit', $cmd);␊ |
␊ |