Indefero

Indefero Commit Details


Date:2009-05-27 17:30:10 (15 years 6 months ago)
Author:Loic d'Anterroches
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:1c8490be6b13b266b6e8840a349576ca8be61879
Parents: 1243a8f6ad3f94c2c18f7b7a4f6a0e4afc539745
Message:Fixed to get the same method definition as the parent class.

Changes:

File differences

src/IDF/Project.php
375375
376376
377377
378
379378
380379
381380
$conf = $this->getConf();
$scm = $conf->getVal('scm', 'git');
$scms = Pluf::f('allowed_scm');
Pluf::loadClass($scms[$scm]);
return call_user_func(array($scms[$scm], 'getAuthAccessUrl'),
$this, $user);
}
src/IDF/Scm/Svn.php
3333
3434
3535
36
36
3737
3838
3939
4040
4141
42
43
44
42
4543
4644
4745
48
49
5046
5147
5248
......
116112
117113
118114
119
120
121
115
116
117
122118
123119
124120
......
181177
182178
183179
184
180
185181
186182
187183
......
236232
237233
238234
239
235
240236
241237
242238
243239
244
240
245241
246242
247243
248244
249
245
250246
251247
252
248
253249
254250
255251
......
258254
259255
260256
261
257
262258
263259
264260
265261
266262
267263
268
264
269265
270266
271267
......
324320
325321
326322
327
323
328324
329325
330326
331
327
332328
333329
334330
......
389385
390386
391387
392
388
393389
394
390
395391
396
392
397393
398394
399395
......
401397
402398
403399
404
400
405401
406402
407403
*/
class IDF_Scm_Svn extends IDF_Scm
{
public $repo = '';
public $username = '';
public $password = '';
private $assoc = array('dir' => 'tree',
'file' => 'blob');
private $commit=array();
public function __construct($repo, $project=null, $username='', $password='')
public function __construct($repo, $project=null)
{
$this->repo = $repo;
$this->project = $project;
$this->username = $username;
$this->password = $password;
$this->cache['commitmess'] = array();
}
if (false !== ($rep=$conf->getVal('svn_remote_url', false))
&& !empty($rep)) {
// Remote repository
return new IDF_Scm_Svn($rep, $project,
$conf->getVal('svn_username'),
$conf->getVal('svn_password'));
$scm = new IDF_Scm_Svn($rep, $project);
$scm->username = $conf->getVal('svn_username');
$scm->password = $conf->getVal('svn_password');
} else {
$rep = sprintf(Pluf::f('svn_repositories'), $project->shortname);
return new IDF_Scm_Svn($rep, $project);
return 'commit';
}
public function getTree($rev='HEAD', $folder='')
public function getTree($commit, $folder='/', $branch=null)
{
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --xml --username=%s --password=%s %s@%s',
escapeshellarg($this->username),
/**
* FIXME: Need to check the case of an inexisting file.
*/
public function getPathInfo($totest, $rev='HEAD')
public function getPathInfo($file, $rev=null)
{
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --xml --username=%s --password=%s %s@%s',
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($this->repo.'/'.$totest),
escapeshellarg($this->repo.'/'.$file),
escapeshellarg($rev));
$xml = simplexml_load_string(shell_exec($cmd));
$entry = $xml->entry;
$file = array();
$file['fullpath'] = $totest;
$file['fullpath'] = $file;
$file['hash'] = (string) $entry->repository->uuid;
$file['type'] = $this->assoc[(string) $entry['kind']];
$file['file'] = $totest;
$file['file'] = $file;
$file['rev'] = $rev;
$file['author'] = (string) $entry->author;
$file['date'] = gmdate('Y-m-d H:i:s', strtotime((string) $entry->commit->date));
return (object) $file;
}
public function getFile($def)
public function getFile($def, $cmd_only=false)
{
$cmd = sprintf(Pluf::f('svn_path', 'svn').' cat --username=%s --password=%s %s@%s',
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($this->repo.'/'.$def->fullpath),
escapeshellarg($def->rev));
return shell_exec($cmd);
return ($cmd_only) ? $cmd : shell_exec($cmd);
}
/**
/**
* Get commit details.
*
* @param string Commit ('HEAD')
* @param string Commit
* @param bool Get commit diff (false)
* @return array Changes
*/
public function getCommit($rev='HEAD', $getdiff=false)
public function getCommit($commit, $getdiff=false)
{
$res = array();
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --xml --limit 1 -v --username=%s --password=%s %s@%s',
*
* @return array Changes.
*/
public function getChangeLog($rev='HEAD', $n=10)
public function getChangeLog($branch=null, $n=10)
{
if ($rev != 'HEAD' and !preg_match('/^\d+$/', $rev)) {
if ($branch != 'HEAD' and !preg_match('/^\d+$/', $branch)) {
// we accept only revisions or HEAD
$rev = 'HEAD';
$branch = 'HEAD';
}
$res = array();
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --xml -v --limit %s --username=%s --password=%s %s@%s',
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($this->repo),
escapeshellarg($rev));
escapeshellarg($branch));
$xmlRes = shell_exec($cmd);
$xml = simplexml_load_string($xmlRes);
foreach ($xml->logentry as $entry) {

Archive Download the corresponding diff file

Page rendered in 0.17485s using 13 queries.