/*
* aegis - project change supervisor
* Copyright (C) 1997, 1998, 2000-2003, 2005-2008 Peter Miller
*
* This program 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 3 of the License, or
* (at your option) any later version.
*
* This program 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, see
* .
*/
auto script_name;
script_name = getenv("SCRIPT_NAME");
if (script_name == "")
script_name = "http://localhost/cgi-bin/aegis.cgi";
auto pn, p;
pn = project_name();
p = project[pn];
columns({width = 1000; });
print("Content-Type: text/html");
print("");
print("");
print("
");
print("");
print("");
print("");
print("");
/*
* Netscape 4.x has numerous CSS bugs, two of which need mentioning.
* 1. If a style sheet is not present Netscape says 404 Not found, when
* it should silently ignore it. 2. Style sheets who's media is not
* "screen" will be ignored. Fortunately we can use (2) to get around (1).
*/
print("");
auto stack, depth, n;
depth=0;
stack[depth] = project[pn].state.name;
while ("" != ( n = project[stack[depth]].state.parent_name )) {
stack[++depth] = n;
}
while ( depth >= 0) {
print("");
}
print("");
print("Project " ## quote_html(pn) ## ", File Activity");
print("
");
/*
* get the project state
*/
auto ps, ps_nobr;
ps_nobr = project[project_name()].state;
ps = ps_nobr.branch;
/*
* default to all project files
* if no files named on the command line
*/
auto file;
if (count(arg) == 0)
{
if (change_number_set())
{
for (file in ps.change[change_number()].src)
arg ##= file.file_name;
}
else
{
for (file in ps_nobr.src)
arg ##= file.file_name;
}
}
/*
* check the files in every active change
*/
auto cn, cs, ch;
auto active;
active = {};
for (cn in keys(ps.change))
{
cs = ps.change[cn];
if (cs.state < being_developed || cs.state >= completed)
continue;
for (file in cs.src)
{
if (!(file.file_name in arg))
continue;
if (file.usage == build && file.action == modify)
continue;
if (!(file.file_name in keys(active)))
active[file.file_name] = [];
auto developer, integrator;
developer = "";
integrator = "";
for (ch in cs.history)
{
if (ch.what == develop_begin)
developer = ch.who;
else if (ch.what == integrate_begin)
integrator = ch.who;
else if (ch.what == integrate_begin_undo)
integrator = "";
else if (ch.what == integrate_fail)
integrator = "";
}
active[file.file_name] ##=
{
usage = file.usage;
action = file.action;
edit =
(
file.edit_origin.revision != ""
?
(
file.edit.revision != ""
?
(file.edit_origin.revision ## " -> " ##
file.edit.revision)
:
file.edit_origin.revision
)
:
file.edit.revision
);
who =
(
cs.state == being_developed
?
developer
:
(cs.state == being_integrated ? integrator : "")
);
change = cn;
state = cs.state;
description = cs.brief_description;
};
}
}
/*
* list all of the active files
*/
auto fn, num_active, email, long_name;
num_active = 0;
print("
");
print("
");
for (fn in sort(keys(active)))
{
if (count(active[fn]) < 1)
continue;
print("
");
if (num_active == 1)
print("Listed one active file.");
else if (num_active)
print("Listed " ## num_active ## " active files.");
else
print("There are no active files in this project.");
print("
");
print("
");
print("
");
print("");
print("
");
print("A similar report may be obtained from the command line, with");
print("