Indefero

Indefero Commit Details


Date:2008-12-05 04:34:02 (16 years 17 days ago)
Author:Loic d'Anterroches
Branch:dev, 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:a1eeb1251659a565607ab87276e66696c1c056fd
Parents: d6e3b8dca9eafbf2fff8b3daeb1edeb64752be73
Message:Added ticket 80, scm login integration with database login.

Based on the login for Subversion and the email address for git and
Mercurial.
Changes:

File differences

src/IDF/Commit.php
141141
142142
143143
144
144
145145
146146
147
147148
148149
149150
150151
151152
152
153
153154
154155
155156
$sql = new Pluf_SQL('project=%s AND scm_id=%s',
array($project->id, $change->commit));
$r = Pluf::factory('IDF_Commit')->getList(array('filter'=>$sql->gen()));
if ($r->count()) {
if ($r->count() > 0) {
return $r[0];
}
$scm = IDF_Scm::get($project);
$commit = new IDF_Commit();
$commit->project = $project;
$commit->scm_id = $change->commit;
$commit->summary = $change->title;
$commit->fullmessage = $change->full_message;
$commit->author = null;
$commit->author = $scm->findAuthor($change->author);
$commit->origauthor = $change->author;
$commit->creation_dtime = $change->date;
$commit->create();
src/IDF/Scm.php
3030
3131
3232
33
3334
3435
35
36
3637
3738
38
39
40
3941
40
41
42
4243
4344
4445
......
9192
9293
9394
94
95
9596
9697
9798
......
100101
101102
102103
103
104104
105105
/**
* Returns an instance of the correct scm backend object.
*
* @param IDF_Project
* @return Object
*/
public static function get($request=null)
public static function get($project=null)
{
// Get scm type from project conf ; defaults to git
$scm = $request->conf->getVal('scm', 'git');
// We will need to cache the factory
$scm = $project->getConf()->getVal('scm', 'git');
$scms = Pluf::f('allowed_scm');
return call_user_func(array($scms[$scm], 'factory'),
$request->project);
return call_user_func(array($scms[$scm], 'factory'), $project);
}
/**
$cache = Pluf_Cache::factory();
$key = 'IDF_Scm:'.$request->project->shortname.':lastsync';
if (null === ($res=$cache->get($key))) {
$scm = IDF_Scm::get($request);
$scm = IDF_Scm::get($request->project);
foreach ($scm->getBranches() as $branche) {
foreach ($scm->getChangeLog($branche, 25) as $change) {
IDF_Commit::getOrAdd($change, $request->project);
$cache->set($key, true, (int)(Pluf::f('cache_timeout', 300)/2));
}
}
}
src/IDF/Scm/Git.php
3636
3737
3838
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
3959
4060
4161
}
/**
* Given the string describing the author from the log find the
* author in the database.
*
* @param string Author
* @return mixed Pluf_User or null
*/
public function findAuthor($author)
{
// We extract the email.
$match = array();
if (!preg_match('/<(.*)>/', $author, $match)) {
return null;
}
$sql = new Pluf_SQL('email=%s', array($match[1]));
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
return ($users->count() > 0) ? $users[0] : null;
}
/**
* Returns the URL of the git daemon.
*
* @param IDF_Project
src/IDF/Scm/Mercurial.php
3535
3636
3737
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
3857
3958
4059
}
/**
* Given the string describing the author from the log find the
* author in the database.
*
* @param string Author
* @return mixed Pluf_User or null
*/
public function findAuthor($author)
{
// We extract the email.
$match = array();
if (!preg_match('/<(.*)>/', $author, $match)) {
return null;
}
$sql = new Pluf_SQL('email=%s', array($match[1]));
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
return ($users->count() > 0) ? $users[0] : null;
}
/**
* Returns the URL of the git daemon.
*
* @param IDF_Project
src/IDF/Scm/Svn.php
4242
4343
4444
45
46
47
48
49
50
51
52
53
54
55
56
57
58
4559
4660
4761
}
/**
* Given the string describing the author from the log find the
* author in the database.
*
* @param string Author
* @return mixed Pluf_User or null
*/
public function findAuthor($author)
{
$sql = new Pluf_SQL('login=%s', array(trim($author)));
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
return ($users->count() > 0) ? $users[0] : null;
}
/**
* Returns the URL of the subversion repository.
*
* @param IDF_Project
src/IDF/Template/IssueComment.php
3636
3737
3838
39
39
4040
4141
4242
{
$this->project = $request->project;
$this->request = $request;
$this->scm = IDF_Scm::get($request);
$this->scm = IDF_Scm::get($request->project);
if ($wordwrap) $text = wordwrap($text, 69, "\n", true);
if ($esc) $text = Pluf_esc($text);
if ($autolink) {
src/IDF/Views/Review.php
196196
197197
198198
199
199
200200
201201
202202
'user' => $request->user,
'patch' => $patch,));
}
$scm = IDF_Scm::get($request);
$scm = IDF_Scm::get($request->project);
$files = array();
$reviewers = array();
foreach ($diff->files as $filename => $def) {
src/IDF/Views/Source.php
4242
4343
4444
45
45
4646
4747
4848
......
7676
7777
7878
79
79
8080
8181
8282
......
114114
115115
116116
117
117
118118
119119
120120
......
203203
204204
205205
206
206
207207
208208
209209
......
235235
236236
237237
238
238
239239
240240
241241
......
258258
259259
260260
261
261
262262
263263
264264
......
302302
303303
304304
305
305
306306
307307
308308
......
336336
337337
338338
339
339
340340
341341
342342
{
$title = sprintf(__('%1$s %2$s Change Log'), (string) $request->project,
$this->getScmType($request));
$scm = IDF_Scm::get($request);
$scm = IDF_Scm::get($request->project);
$branches = $scm->getBranches();
$commit = $match[2];
if ('commit' != $scm->testHash($commit)) {
{
$title = sprintf(__('%1$s %2$s Source Tree'), (string) $request->project,
$this->getScmType($request));
$scm = IDF_Scm::get($request);
$scm = IDF_Scm::get($request->project);
$commit = $match[2];
$branches = $scm->getBranches();
if ('commit' != $scm->testHash($commit)) {
{
$title = sprintf(__('%1$s %2$s Source Tree'), (string) $request->project,
$this->getScmType($request));
$scm = IDF_Scm::get($request);
$scm = IDF_Scm::get($request->project);
$branches = $scm->getBranches();
$commit = $match[2];
$request_file = $match[3];
public $commit_precond = array('IDF_Precondition::accessSource');
public function commit($request, $match)
{
$scm = IDF_Scm::get($request);
$scm = IDF_Scm::get($request->project);
$commit = $match[2];
$branches = $scm->getBranches();
if ('commit' != $scm->testHash($commit)) {
public $downloadDiff_precond = array('IDF_Precondition::accessSource');
public function downloadDiff($request, $match)
{
$scm = IDF_Scm::get($request);
$scm = IDF_Scm::get($request->project);
$commit = $match[2];
$branches = $scm->getBranches();
if ('commit' != $scm->testHash($commit)) {
{
$title = sprintf(__('%1$s %2$s Source Tree'), (string) $request->project,
$this->getScmType($request));
$scm = IDF_Scm::get($request);
$scm = IDF_Scm::get($request->project);
$branches = $extra['branches'];
$commit = $extra['commit'];
$request_file = $extra['request_file'];
public $getFile_precond = array('IDF_Precondition::accessSource');
public function getFile($request, $match)
{
$scm = IDF_Scm::get($request);
$scm = IDF_Scm::get($request->project);
$branches = $scm->getBranches();
$commit = $match[2];
$request_file = $match[3];
public function download($request, $match)
{
$commit = trim($match[2]);
$scm = IDF_Scm::get($request);
$scm = IDF_Scm::get($request->project);
$branches = $scm->getBranches();
if ('commit' != $scm->testHash($commit)) {
// Redirect to the first branch

Archive Download the corresponding diff file

Page rendered in 0.09790s using 14 queries.