Indefero

Indefero Commit Details


Date:2011-01-24 07:20:33 (13 years 10 months ago)
Author:Loïc 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:116a7e34dbc1cccda23ff251fb83dcbebb1c1f95
Parents: 390c9b50484f526fbcf354bd44fe57a6ff35cd0e
Message:Added the display of the commit parents in the changelog view.

The old commits will not have the parents displayed as already cached in the DB, but the new will get them.
Changes:

File differences

src/IDF/Commit.php
3434
3535
3636
37
3738
3839
3940
......
143144
144145
145146
147
148
149
150
146151
147152
148153
......
158163
159164
160165
166
167
168
169
170
171
172
161173
162174
163175
class IDF_Commit extends Pluf_Model
{
public $_model = __CLASS__;
public $extra = null; /**< Extra data as IDF_Gconf object */
function init()
{
array($project->id, $change->commit));
$r = Pluf::factory('IDF_Commit')->getList(array('filter'=>$sql->gen()));
if ($r->count() > 0) {
$r[0]->extra = new IDF_Gconf();
$r[0]->extra->serialize = true;
$r[0]->extra->setModel($r[0]);
$r[0]->extra->initCache();
return $r[0];
}
if (!isset($change->full_message)) {
$commit->origauthor = $change->author;
$commit->creation_dtime = $change->date;
$commit->create();
$extra = $scm->getExtraProperties($change);
$commit->extra = new IDF_Gconf();
$commit->extra->serialize = true; // As we can store arrays
$commit->extra->setModel($commit);
foreach ($extra as $key => $val) {
$commit->extra->setVal($key, $val);
}
$commit->notify($project->getConf());
return $commit;
}
src/IDF/Gconf.php
3535
3636
3737
38
39
40
41
3842
3943
4044
......
97101
98102
99103
100
104
101105
102106
103107
......
112116
113117
114118
119
115120
116121
117122
118123
119
124
120125
121126
122127
......
127132
128133
129134
130
135
131136
132137
133138
public $dirty = array();
public $f = null;
protected $_mod = null;
/**
* Do we (un)serialize the data when getting/setting them.
*/
public $serialize = false;
function init()
{
$sql = new Pluf_SQL('model_class=%s AND model_id=%s',
array($this->_mod->_model, $this->_mod->id));
foreach ($this->getList(array('filter' => $sql->gen())) as $val) {
$this->datacache[$val->vkey] = $val->vdesc;
$this->datacache[$val->vkey] = ($this->serialize) ? unserialize($val->vdesc) : $val->vdesc;
$this->dirty[$val->vkey] = $val->id;
}
}
and $value == $this->getVal($key)) {
return;
}
$svalue = ($this->serialize) ? serialize($value) : $value;
if (isset($this->dirty[$key])) {
// we get to check if deleted by other process + update
$conf = new IDF_Gconf($this->dirty[$key]);
if ($conf->id == $this->dirty[$key]) {
$conf->vdesc = $value;
$conf->vdesc = $svalue;
$conf->update();
$this->datacache[$key] = $value;
return;
$conf->model_class = $this->_mod->_model;
$conf->model_id = $this->_mod->id;
$conf->vkey = $key;
$conf->vdesc = $value;
$conf->vdesc = $svalue;
$conf->create();
$this->datacache[$key] = $value;
$this->dirty[$key] = $conf->id;
src/IDF/Scm.php
421421
422422
423423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
424439
425440
426441
}
/**
* Given a changelog parsed node, returns extra data.
*
* For example, if the node is a commit object from git, it will a
* stdClass object with the parents array. The extra value could
* then be the parent(s) commit(s).
*
* @param stdClass Commit object/Parse object
* @return array Extra properties
*/
public function getExtraProperties($obj)
{
return array();
}
/**
* Generate a zip archive at a given commit, wrapped in a HTTP response, suitable for pushing to client.
*
* @param string Commit
src/IDF/Scm/Git.php
117117
118118
119119
120
121
122
123
124
125
126
127
120128
121129
122130
}
/**
* Will find the parents if available.
*/
public function getExtraProperties($obj)
{
return (isset($obj->parents)) ? array('parents' => $obj->parents) : array();
}
/**
* @see IDF_Scm::getTags()
**/
public function getTags()
src/IDF/templates/idf/source/changelog.html
1313
1414
1515
16
16
17
18
19
20
21
22
23
24
25
26
27
1728
1829
1930
{aurl 'url', 'IDF_Views_Source::commit', array($project.shortname, $change.scm_id)}
<tr class="log">
<td class="nobrk"><a href="{$url}">{$change.creation_dtime|dateago:"without"}</a></td>
<td>{issuetext $change.summary, $request}{if $change.fullmessage}<br /><br />{issuetext $change.fullmessage, $request, true, false, true, true, true}{/if}</td>
<td>{issuetext $change.summary, $request}{if $change.fullmessage}<br /><br />{issuetext $change.fullmessage, $request, true, false, true, true, true}{/if}
{assign $parents = $change.extra.getVal('parents')}
{if count($parents) > 1}<div class="helptext">
{foreach $parents as $parent}<br />
{trans 'Parent:'}&nbsp;<a href="{url 'IDF_Views_Source::commit', array($project.shortname, $parent)}" title="{trans 'View corresponding commit'}" class="mono">{$parent}</a>
{/foreach}</div>{/if}
</td>
</tr>
<tr class="extra">
<td colspan="2">

Archive Download the corresponding diff file

Page rendered in 0.09717s using 13 queries.