Indefero

Indefero Commit Details


Date:2011-03-19 18:42:56 (13 years 9 months ago)
Author:Thomas Keller
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, release-1.1, release-1.2, release-1.3
Commit:b7c0b4049133868df071109820ed2d989c5f1c62
Parents: 48257ccfed2b98c396640058a86df14350b4c83e
Message:Add basic source version tracking.

Indefero's version is now noted in src/IDF/version.php;
just before a release is made, the '-dev' is removed and
after the release is made, the version should be increased and
'-dev' should be added back to denote that the development
for the next version started.

The revision identifier is automatically set when an archive
is created and is based on the revision that the archive creator
gave to git-archive(1). If people follow development, we try to
get the current deployed version with git-log(1) and if that
fails as well, the revision is determined to be 'unknown'.
Version and revision are then rendered as HTML meta tags in
the header of each template. (All this is done by the new
{appversion} tag.)
Changes:

File differences

.gitattributes
1
src/IDF/version.php export-subst
src/IDF/Middleware.php
8787
8888
8989
90
9091
9192
9293
'markdown' => 'IDF_Template_Markdown',
'showuser' => 'IDF_Template_ShowUser',
'ashowuser' => 'IDF_Template_AssignShowUser',
'appversion' => 'IDF_Template_AppVersion',
));
$params['modifiers'] = array_merge($params['modifiers'],
array(
src/IDF/Template/AppVersion.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
<?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) 2011 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 ***** */
/**
* AppVersion tag.
*
* Renders two meta tags that include the application's version and revision
*/
class IDF_Template_AppVersion extends Pluf_Template_Tag
{
function start($file = 'IDF/version.php')
{
if (!Pluf::fileExists($file)) {
return;
}
$info = include_once($file);
if (!is_array($info)) {
return;
}
if (array_key_exists('version', $info)) {
echo '<meta name="indefero-version" content="'.$info['version'].'" />'."\n";
}
if (array_key_exists('revision', $info)) {
if (strpos($info['revision'], '$') !== false) {
$info['revision'] = 'unknown';
$cmd = Pluf::f('idf_exec_cmd_prefix', '').
Pluf::f('git_path', 'git').
' log -1 --format=%H';
if (IDF_Scm::exec('IDF_Template_AppVersion::start', $cmd, $output)) {
$info['revision'] = trim(@$output[0]);
}
}
echo '<meta name="indefero-revision" content="'.$info['revision'].'" />'."\n";
}
}
}
src/IDF/templates/idf/base-full.html
3232
3333
3434
35
3536
3637
3738
{block extraheader}{/block}
<title>{block pagetitle}{$page_title|strip_tags}{/block}{if $project} - {$project.shortdesc}{/if}</title>
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
{appversion}
</head>
<body>
<div id="{block docid}doc3{/block}">
src/IDF/templates/idf/base-simple.html
3232
3333
3434
35
3536
3637
3738
{block extraheader}{/block}
<title>{block pagetitle}{$page_title|strip_tags}{/block}</title>
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
{appversion}
</head>
<body>
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
src/IDF/templates/idf/base.html
3232
3333
3434
35
3536
3637
3738
{block extraheader}{/block}
<title>{block pagetitle}{$page_title|strip_tags}{/block}{if $project} - {$project.shortdesc}{/if}</title>
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
{appversion}
</head>
<body>
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
src/IDF/templates/idf/gadmin/base.html
3131
3232
3333
34
3435
3536
3637
{block extraheader}{/block}
<title>{block pagetitle}{$page_title|strip_tags}{/block}</title>
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
{appversion}
</head>
<body>
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
src/IDF/version.php
1
2
3
4
5
<?php
return array(
'version' => '1.1-dev',
'revision' => '$Format:%H$',
);

Archive Download the corresponding diff file

Page rendered in 0.10064s using 13 queries.