/*
 *	aegis - project change supervisor
 *	Copyright (C) 1999, 2001, 2002, 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
 *	<http://www.gnu.org/licenses/>.
 */
columns({ width = 1000; });
auto ps;
ps = project[project_name()].state;

auto paras, para_len, para_n;
paras = split(ps.brief_description, "\n");
para_len = count(paras);
if (para_len < 1)
	para_len = 1;
while (para_len >= 2 && paras[para_len - 1] == "")
	para_len = para_len - 1;
for (para_n = 0; para_n < para_len; para_n = para_n + 1)
{
	auto para_begin, para_end;
	para_begin = (para_n == 0 ? "set proj_brief_description \"" : "");
	para_end = (para_n == (para_len - 1) ? "\"" : "");
	auto lines, line_len, line_n;
	lines = wrap(quote_tcl(paras[para_n]), 75);
	line_len = count(lines);
	if (line_len < 1)
		line_len = 1;
	for (line_n = 0; line_n < line_len; line_n = line_n + 1)
	{
		auto line_begin, line_end;
		line_begin = (line_n == 0 ? para_begin : "");
		line_end = (line_n == (line_len - 1) ? para_end : "\\");
		print(line_begin ## lines[line_n] ## line_end);
	}
}

paras = split(ps.description, "\n");
para_len = count(paras);
if (para_len < 1)
	para_len = 1;
while (para_len >= 2 && paras[para_len - 1] == "")
	para_len = para_len - 1;
for (para_n = 0; para_n < para_len; para_n = para_n + 1)
{
	para_begin = (para_n == 0 ? "set proj_description \"" : "");
	para_end = (para_n == (para_len - 1) ? "\"" : "");
	lines = wrap(quote_tcl(paras[para_n]), 75);
	line_len = count(lines);
	if (line_len < 1)
		line_len = 1;
	for (line_n = 0; line_n < line_len; line_n = line_n + 1)
	{
		line_begin = (line_n == 0 ? para_begin : "");
		line_end = (line_n == (line_len - 1) ? (para_end) : "\\");
		print(line_begin ## lines[line_n] ## line_end);
	}
}

ps = ps.branch;
print("set proj_developer_may_review " ## (0 + ps.developer_may_review));
print("set proj_developer_may_integrate " ## (0 + ps.developer_may_integrate));
print("set proj_reviewer_may_integrate " ## (0 + ps.reviewer_may_integrate));
print("set proj_developers_may_create_changes " ##
    (0 + ps.developers_may_create_changes));
print("set proj_umask " ## (0 + ps.umask));
print("set proj_minimum_change_number " ## (0 + ps.minimum_change_number));
print("set proj_reuse_change_numbers " ## (0 + ps.reuse_change_numbers));
print("set proj_minimum_branch_number " ## (0 + ps.minimum_branch_number));
print("set proj_skip_unlucky " ## (0 + ps.skip_unlucky));
print("set proj_compress_database " ## (0 + ps.compress_database));
print("set proj_default_test_required " ## (ps.default_test_exemption ? 0 : 1));
print("set proj_default_test_regression_required " ##
    (ps.default_test_regression_exemption ? 0 : 1));
print("set proj_develop_end_action \"" ## ps.develop_end_action ## "\"");
print("set proj_protect_development_directory " ##
    (0 + ps.protect_development_directory));
