Indefero

Indefero Commit Details


Date:2008-09-12 05:32:27 (16 years 3 months ago)
Author:Nicolas Lassalle
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:b881ad1c8fbbc0c86ab343c99ab660f2cd41840c
Parents: bd1532875847a5d4e5b4c263580b10254c31353b
Message:[PATCH] Restructured the "source views" file hierarchy.

Svn specifics Views are now in a Source subfolder.
Changes:

File differences

src/IDF/Views/Source.php
235235
236236
237237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301238
302239
303240
}
/**
* Display tree of a specific SVN revision
*
*/
public function treeRev($request, $match)
{
$prj = $request->project;
// Redirect to tree base if not svn
if ($request->conf->getVal('scm', 'git') != 'svn') {
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($prj->shortname, $prj->getScmRoot()));
return new Pluf_HTTP_Response_Redirect($url);
}
// Get revision value
if (!isset($request->REQUEST['rev']) or trim($request->REQUEST['rev']) == '') {
$scmRoot = $prj->getScmRoot();
}
else {
$scmRoot = $request->REQUEST['rev'];
}
// Get source if not /
if (isset($request->REQUEST['sourcefile']) and trim($request->REQUEST['sourcefile']) != '') {
$scmRoot .= '/'.$request->REQUEST['sourcefile'];
}
// Redirect
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($prj->shortname, $scmRoot));
return new Pluf_HTTP_Response_Redirect($url);
}
/**
* Display SVN changelog from specific revision
*
*/
public function changelogRev($request, $match)
{
$prj = $request->project;
// Redirect to tree base if not svn
if ($request->conf->getVal('scm', 'git') != 'svn') {
$scmRoot = $prj->getScmRoot();
}
// Get revision value if svn
else {
if (!isset($request->REQUEST['rev']) or trim($request->REQUEST['rev']) == '') {
$scmRoot = $prj->getScmRoot();
}
else {
$scmRoot = $request->REQUEST['rev'];
}
}
// Redirect
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::changeLog',
array($prj->shortname, $scmRoot));
return new Pluf_HTTP_Response_Redirect($url);
}
/**
* Find the mime type of a file.
*
* Use /etc/mime.types to find the type.
src/IDF/Views/Source/Svn.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 CĂ©ondo Ltd and contributors.
#
# InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
Pluf::loadFunction('Pluf_HTTP_URL_urlForView');
/**
* View git repository.
*/
class IDF_Views_Source_Svn
{
/**
* Display tree of a specific SVN revision
*
*/
public function treeRev($request, $match)
{
$prj = $request->project;
// Redirect to tree base if not svn
if ($request->conf->getVal('scm', 'git') != 'svn') {
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($prj->shortname, $prj->getScmRoot()));
return new Pluf_HTTP_Response_Redirect($url);
}
// Get revision value
if (!isset($request->REQUEST['rev']) or trim($request->REQUEST['rev']) == '') {
$scmRoot = $prj->getScmRoot();
}
else {
$scmRoot = $request->REQUEST['rev'];
}
// Get source if not /
if (isset($request->REQUEST['sourcefile']) and trim($request->REQUEST['sourcefile']) != '') {
$scmRoot .= '/'.$request->REQUEST['sourcefile'];
}
// Redirect
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($prj->shortname, $scmRoot));
return new Pluf_HTTP_Response_Redirect($url);
}
/**
* Display SVN changelog from specific revision
*
*/
public function changelogRev($request, $match)
{
$prj = $request->project;
// Redirect to tree base if not svn
if ($request->conf->getVal('scm', 'git') != 'svn') {
$scmRoot = $prj->getScmRoot();
}
// Get revision value if svn
else {
if (!isset($request->REQUEST['rev']) or trim($request->REQUEST['rev']) == '') {
$scmRoot = $prj->getScmRoot();
}
else {
$scmRoot = $request->REQUEST['rev'];
}
}
// Redirect
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::changeLog',
array($prj->shortname, $scmRoot));
return new Pluf_HTTP_Response_Redirect($url);
}
}
src/IDF/conf/views.php
168168
169169
170170
171
171
172172
173173
174174
175175
176176
177
177
178178
179179
180180
$ctl[] = array('regex' => '#^/p/([\-\w]+)/source/treerev/$#',
'base' => $base,
'priority' => 4,
'model' => 'IDF_Views_Source',
'model' => 'IDF_Views_Source_Svn',
'method' => 'treeRev');
$ctl[] = array('regex' => '#^/p/([\-\w]+)/source/changesrev/$#',
'base' => $base,
'priority' => 4,
'model' => 'IDF_Views_Source',
'model' => 'IDF_Views_Source_Svn',
'method' => 'changelogRev');
// ---------- Downloads ------------------------------------
src/IDF/templates/source/changelog.html
3737
3838
3939
40
40
4141
4242
4343
</p>
{/if}
{if $scm == 'svn'}
<form class="star" action="{url 'IDF_Views_Source::changelogRev', array($project.shortname)}" method="get">
<form class="star" action="{url 'IDF_Views_Source_Svn::changelogRev', array($project.shortname)}" method="get">
<p><strong>{trans 'Revision:'}</strong> {$commit}</p>
<p>
<input accesskey="4" type="text" value="{$commit}" name="rev" size="5" />
src/IDF/templates/source/svn/tree.html
6161
6262
6363
64
64
6565
6666
6767
{/block}
{block context}
<form class="star" action="{url 'IDF_Views_Source::treeRev', array($project.shortname)}" method="get">
<form class="star" action="{url 'IDF_Views_Source_Svn::treeRev', array($project.shortname)}" method="get">
<p><strong>{trans 'Revision:'}</strong> {$commit}</p>
<p>
<input accesskey="4" type="text" value="{$commit}" name="rev" size="5" />

Archive Download the corresponding diff file

Page rendered in 0.09582s using 13 queries.