Indefero

Indefero Commit Details


Date:2009-05-26 14:20: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:88ce10b8e6b5d744e036e1012ead514df53d5994
Parents: 0abb706ded9f0ae4b97b96ac9d43f7df97d7b310
Message:Fixed issue 227, timeline fails on SVN repositories.

Changes:

File differences

src/IDF/Scm.php
343343
344344
345345
346
347
348
349
346
347
350348
351349
352350
$key = 'IDF_Scm:'.$project->shortname.':lastsync';
if (null === ($res=$cache->get($key))) {
$scm = IDF_Scm::get($project);
foreach ($scm->getBranches() as $branche => $path) {
foreach ($scm->getChangeLog($branche, 25) as $change) {
IDF_Commit::getOrAdd($change, $project);
}
foreach ($scm->getChangeLog($scm->getMainBranch(), 25) as $change) {
IDF_Commit::getOrAdd($change, $project);
}
$cache->set($key, true, (int)(Pluf::f('cache_timeout', 300)/2));
}
src/IDF/Scm/Svn.php
260260
261261
262262
263
263264
264265
265266
......
365366
366367
367368
368
369
369370
370371
371372
372373
373374
374375
376
377
378
379
375380
376381
377382
......
381386
382387
383388
384
385
386389
387390
388391
......
393396
394397
395398
396
397399
398400
399401
if (isset($this->cache['branches'])) {
return $this->cache['branches'];
}
$res = array();
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --username=%s --password=%s %s@HEAD',
escapeshellarg($this->username),
escapeshellarg($this->password),
/**
* Get latest changes.
*
* @param string Commit ('HEAD').
* @param string Revision or ('HEAD').
* @param int Number of changes (10).
*
* @return array Changes.
*/
public function getChangeLog($rev='HEAD', $n=10)
{
if ($rev != 'HEAD' and !preg_match('/^\d+$/', $rev)) {
// we accept only revisions or HEAD
$rev = 'HEAD';
}
$res = array();
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --xml -v --limit %s --username=%s --password=%s %s@%s',
escapeshellarg($n),
escapeshellarg($rev));
$xmlRes = shell_exec($cmd);
$xml = simplexml_load_string($xmlRes);
$res = array();
foreach ($xml->logentry as $entry) {
$log = array();
$log['author'] = (string) $entry->author;
$res[] = (object) $log;
}
return $res;
}

Archive Download the corresponding diff file

Page rendered in 0.07726s using 14 queries.