Indefero

Indefero Commit Details


Date:2009-11-06 11:06:01 (15 years 1 month 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:ff4f8afde892405ed8f6a71fbfb92aafed527ff2
Parents: 8050463a12f462bd4efebb8cef94bb778c2526ef
Message:Added the support of the tags for Mercurial and Subversion.

Changes:

File differences

src/IDF/Scm/Mercurial.php
279279
280280
281281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
282306
283307
284308
285309
286310
287311
312
313
314
315
316
317
288318
289319
290320
return $res;
}
/**
* Get the tags.
*
* @return array Tags.
*/
public function getTags()
{
if (isset($this->cache['tags'])) {
return $this->cache['tags'];
}
$out = array();
$cmd = sprintf(Pluf::f('hg_path', 'hg').' tags -R %s',
escapeshellarg($this->repo));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
exec($cmd, $out);
$res = array();
foreach ($out as $b) {
preg_match('/(\S+).*\S+:(\S+)/', $b, $match);
$res[$match[1]] = '';
}
$this->cache['tags'] = $res;
return $res;
}
public function inBranches($commit, $path)
{
return (in_array($commit, array_keys($this->getBranches())))
? array($commit) : array();
}
public function inTags($commit, $path)
{
return (in_array($commit, array_keys($this->getTags())))
? array($commit) : array();
}
/**
* Get commit details.
*
src/IDF/Scm/Svn.php
287287
288288
289289
290
290
291291
292292
293293
......
325325
326326
327327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
328358
329359
330360
......
340370
341371
342372
373
374
375
376
377
378
379
380
381
382
343383
344384
345385
}
/**
* Subversion branches are repository based.
* Subversion branches are folder based.
*
* One need to list the folder to know them.
*/
return $res;
}
/**
* Subversion tags are folder based.
*
* One need to list the folder to know them.
*/
public function getTags()
{
if (isset($this->cache['tags'])) {
return $this->cache['tags'];
}
$res = array();
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --username=%s --password=%s %s@HEAD',
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($this->repo.'/tags'));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
exec($cmd, $out, $ret);
if ($ret == 0) {
foreach ($out as $entry) {
if (substr(trim($entry), -1) == '/') {
$tag = substr(trim($entry), 0, -1);
$res[$tag] = 'tags/'.$tag;
}
}
}
ksort($res);
$this->cache['tags'] = $res;
return $res;
}
public function getMainBranch()
{
return 'HEAD';
return array();
}
public function inTags($commit, $path)
{
foreach ($this->getTags() as $tag => $tpath) {
if ($tpath and 0 === strpos($path, $tpath)) {
return array($tag);
}
}
return array();
}
/**
* Get commit details.
src/IDF/templates/idf/source/mercurial/changelog.html
66
77
88
9
10
11
12
13
14
15
16
917
1018
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
{/foreach}
</p>
{if $tags}
<p><strong>{trans 'Tags:'}</strong><br/>
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::changeLog', array($project.shortname, $tag)}
<span class="label{if in_array($tag, $tags_in)} active{/if}"><a href="{$url}" class="label">{$tag}</a></span><br/>
{/foreach}
</p>
{/if}
{/block}
src/IDF/templates/idf/source/mercurial/file.html
2929
3030
3131
32
33
34
35
36
37
38
39
3240
3341
3442
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
{/foreach}
</p>
{if $tags}
<p><strong>{trans 'Tags:'}</strong><br/>
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::tree', array($project.shortname, 'HEAD', $path)}
<span class="label{if in_array($tag, $tags_in)} active{/if}"><a href="{$url}" class="label">{$tag}</a></span><br/>
{/foreach}
</p>
{/if}
{/block}
{block javascript}
src/IDF/templates/idf/source/mercurial/tree.html
1111
1212
1313
14
14
1515
1616
1717
......
5353
5454
5555
56
57
58
59
60
61
5662
5763
<th>{trans 'Message'}</th>
<th>{trans 'Size'}</th>
</tr>
</thead>{if !$tree_in}
</thead>{if !$tree_in and !$tags_in}
{aurl 'url', 'IDF_Views_Source::commit', array($project.shortname, $commit)}
<tfoot>
<tr><th colspan="5">{blocktrans}Source at commit <a class="mono" href="{$url}">{$commit}</a> created {$cobject.date|dateago}.{/blocktrans}<br />
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
{/foreach}
</p>
{if $tags}<p><strong>{trans 'Tags:'}</strong><br />
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $tag)}
<span class="label{if in_array($tag, $tags_in)} active{/if}"><a href="{$url}" class="label">{$tag}</a></span><br />
{/foreach}
</p>{/if}
{/block}
src/IDF/templates/idf/source/svn/file.html
4040
4141
4242
43
4443
4544
4645
<input type="hidden" name="sourcefile" value="{$base}"/>
<input type="submit" name="s" value="{trans 'Go to revision'}" /></p>
</form>
{/block}
{block javascript}
src/IDF/templates/idf/source/svn/tree.html
1212
1313
1414
15
15
1616
1717
1818
......
7575
7676
7777
78
79
80
81
82
83
84
85
7886
7987
<th>{trans 'Message'}</th>
<th>{trans 'Size'}</th>
</tr>
</thead>{if !$tree_in || $props}
</thead>{if (!$tree_in and !$tags_in and $commit != 'HEAD') || $props}
{aurl 'url', 'IDF_Views_Source::commit', array($project.shortname, $commit)}
<tfoot>
{if $props}
<span class="label{if in_array($branch, $tree_in)} active{/if}"><a href="{$url}" class="label">{$branch}</a></span><br />
{/foreach}
</p>
{if $tags}
<p><strong>{trans 'Tags:'}</strong><br/>
{foreach $tags as $tag => $path}
{aurl 'url', 'IDF_Views_Source::tree', array($project.shortname, 'HEAD', $path)}
<span class="label{if in_array($tag, $tags_in)} active{/if}"><a href="{$url}" class="label">{$tag}</a></span><br/>
{/foreach}
</p>
{/if}
{/block}

Archive Download the corresponding diff file

Page rendered in 0.08696s using 13 queries.