| |
|
Line 161
|
Parallel
|
Line 161
|
Parallel
|
| 161 |
'clearcase:c:\\stuff\\view_name\\vob_name' |
161 |
'clearcase:c:\\stuff\\view_name\\vob_name' |
| 162 |
); |
162 |
); |
| 163 |
|
163 |
|
|
|
164 |
# A mapping of repository URLs to names. In any screen where a |
|
|
165 |
# repository is displayed, if there is a mapping for the repository |
|
|
166 |
# defined here, then the symbolic name will be displayed instead of |
|
|
167 |
# its raw URL. This is useful when the URL contains sensitive |
|
|
168 |
# username/password information, or the symbolic name is more |
|
|
169 |
# meaningful to the end-user. If there is no mapping defined for a |
|
|
170 |
# specific repository, its URL will be displayed. |
|
|
171 |
$repository_name_map = |
|
|
172 |
{ |
|
|
173 |
'/home/sits/cvs' => 'Local CVS', |
|
|
174 |
':pserver:sits:password@cvs.sourceforge.net:/cvsroot' => 'SF CVS' |
|
|
175 |
}; |
|
|
176 |
|
| 164 |
# A mapping of repositories to filename viewers. Examples of such systems |
177 |
# A mapping of repositories to filename viewers. Examples of such systems |
| 165 |
# would be CVSweb and ViewCVS, for local repositories. Mappings are |
178 |
# would be CVSweb and ViewCVS, for local repositories. Mappings are |
| 166 |
# not required for remote CVSweb and ViewCVS repositories, as they are |
179 |
# not required for remote CVSweb and ViewCVS repositories, as they are |
| |
| |
|
Line 7
|
Parallel
|
Line 7
|
Parallel
|
| 7 |
<book> |
7 |
<book> |
| 8 |
<bookinfo> |
8 |
<bookinfo> |
| 9 |
<title>The Codestriker Guide</title> |
9 |
<title>The Codestriker Guide</title> |
| 10 |
<subtitle>Version 1.9.0</subtitle> |
10 |
<subtitle>Version 1.9.2</subtitle> |
| 11 |
<legalnotice> |
11 |
<legalnotice> |
| 12 |
<para>Copyright (c) 2001, 2002, 2003, 2004</para> |
12 |
<para>Copyright (c) 2001 - 2006</para> |
| 13 |
</legalnotice> |
13 |
</legalnotice> |
| 14 |
<authorgroup> |
14 |
<authorgroup> |
| 15 |
<author> |
15 |
<author> |
| |
| |
|
Line 517
|
Parallel
|
Line 517
|
Parallel
|
| 517 |
</programlisting> |
517 |
</programlisting> |
| 518 |
</para> |
518 |
</para> |
| 519 |
<para> |
519 |
<para> |
|
|
520 |
As explained by the comment in the codestriker.conf file, |
|
|
521 |
sometimes there is a benefit for displaying a name instead of |
|
|
522 |
a repository URL in the Codestriker UI. |
|
|
523 |
<programlisting> |
|
|
524 |
# A mapping of repository URLs to names. In any screen where a |
|
|
525 |
# repository is displayed, if there is a mapping for the repository |
|
|
526 |
# defined here, then the symbolic name will be displayed instead of |
|
|
527 |
# its raw URL. This is useful when the URL contains sensitive |
|
|
528 |
# username/password information, or the symbolic name is more |
|
|
529 |
# meaningful to the end-user. If there is no mapping defined for a |
|
|
530 |
# specific repository, its URL will be displayed. |
|
|
531 |
$repository_name_map = |
|
|
532 |
{ |
|
|
533 |
'/home/sits/cvs' => 'Local CVS', |
|
|
534 |
':pserver:sits:password@cvs.sourceforge.net:/cvsroot' => 'SF CVS' |
|
|
535 |
}; |
|
|
536 |
|
|
|
537 |
</programlisting> |
|
|
538 |
</para> |
|
|
539 |
|
|
|
540 |
<para> |
| 520 |
During a review, it is sometimes beneficial to see the |
541 |
During a review, it is sometimes beneficial to see the |
| 521 |
revision history of a file, such as information provided by |
542 |
revision history of a file, such as information provided by |
| 522 |
CVSweb or ViewCVS. You can specify a mapping of repository |
543 |
CVSweb or ViewCVS. You can specify a mapping of repository |
| |
| |
|
Line 23
|
Parallel
|
Line 23
|
Parallel
|
| 23 |
$allow_delete $allow_searchlist $default_file_to_view |
23 |
$allow_delete $allow_searchlist $default_file_to_view |
| 24 |
$allow_projects $antispam_email $VERSION $title $BASEDIR |
24 |
$allow_projects $antispam_email $VERSION $title $BASEDIR |
| 25 |
$metric_config $tmpdir @metric_schema $comment_state_metrics |
25 |
$metric_config $tmpdir @metric_schema $comment_state_metrics |
| 26 |
$project_states $rss_enabled |
26 |
$project_states $rss_enabled $repository_name_map $repository_url_map |
|
|
27 |
@valid_repository_names |
| 27 |
); |
28 |
); |
| 28 |
|
29 |
|
| 29 |
# Version of Codestriker. |
30 |
# Version of Codestriker. |
| |
| |
|
Line 306
|
Parallel
|
Line 307
|
Parallel
|
| 306 |
{ |
307 |
{ |
| 307 |
do "$BASEDIR/codestriker_test.conf"; |
308 |
do "$BASEDIR/codestriker_test.conf"; |
| 308 |
} |
309 |
} |
|
|
310 |
|
|
|
311 |
# Fill in $repository_name_map for those repository entries which don't have |
|
|
312 |
# a mapping, with the same value as the repository value itself. |
|
|
313 |
foreach my $repository (@valid_repositories) { |
|
|
314 |
if (! exists $repository_name_map->{$repository}) { |
|
|
315 |
$repository_name_map->{$repository} = $repository; |
|
|
316 |
} |
|
|
317 |
} |
|
|
318 |
|
|
|
319 |
# Define the equivalent list of valid repository names. |
|
|
320 |
@valid_repository_names = (); |
|
|
321 |
foreach my $repository (@valid_repositories) { |
|
|
322 |
push @valid_repository_names, $repository_name_map->{$repository}; |
|
|
323 |
} |
|
|
324 |
|
|
|
325 |
# Define the reverse mapping now for convenience. |
|
|
326 |
foreach my $key (keys %${repository_name_map}) { |
|
|
327 |
$repository_url_map->{$repository_name_map->{$key}} = $key; |
|
|
328 |
} |
| 309 |
} |
329 |
} |
| 310 |
|
330 |
|
| 311 |
# Returns the current time in a format suitable for a DBI timestamp value. |
331 |
# Returns the current time in a format suitable for a DBI timestamp value. |
| |
| |
|
Line 57
|
Parallel
|
Line 57
|
Parallel
|
| 57 |
# Set the default repository to select. |
57 |
# Set the default repository to select. |
| 58 |
if (! (defined $vars->{'default_repository'}) || |
58 |
if (! (defined $vars->{'default_repository'}) || |
| 59 |
$vars->{'default_repository'} eq "") { |
59 |
$vars->{'default_repository'} eq "") { |
| 60 |
if ($#Codestriker::valid_repositories != -1) { |
60 |
if ($#Codestriker::valid_repository_names != -1) { |
| 61 |
# Choose the first repository as the default selection. |
61 |
# Choose the first repository as the default selection. |
| 62 |
$vars->{'default_repository'} = |
62 |
$vars->{'default_repository'} = |
| 63 |
$Codestriker::valid_repositories[0]; |
63 |
$Codestriker::valid_repository_names[0]; |
| 64 |
} |
64 |
} |
| 65 |
} |
65 |
} |
| 66 |
|
66 |
|
| 67 |
# Indicate the list of valid repositories which can be choosen. |
67 |
# Indicate the list of valid repositories which can be choosen. |
| 68 |
$vars->{'repositories'} = \@Codestriker::valid_repositories; |
68 |
$vars->{'repositories'} = \@Codestriker::valid_repository_names; |
| 69 |
|
69 |
|
| 70 |
# Read the list of projects available to make that choice available |
70 |
# Read the list of projects available to make that choice available |
| 71 |
# when a topic is created. |
71 |
# when a topic is created. |
| |
| |
|
Line 33
|
Parallel
|
Line 33
|
Parallel
|
| 33 |
my $cc = $http_input->get('cc'); |
33 |
my $cc = $http_input->get('cc'); |
| 34 |
my $topic_state = $http_input->get('topic_state'); |
34 |
my $topic_state = $http_input->get('topic_state'); |
| 35 |
my $bug_ids = $http_input->get('bug_ids'); |
35 |
my $bug_ids = $http_input->get('bug_ids'); |
| 36 |
my $repository_url = $http_input->get('repository'); |
36 |
my $repository_name = $http_input->get('repository'); |
| 37 |
my $projectid = $http_input->get('projectid'); |
37 |
my $projectid = $http_input->get('projectid'); |
| 38 |
|
38 |
|
| 39 |
# Check if this action is allowed, and that the state is valid. |
39 |
# Check if this action is allowed, and that the state is valid. |
| |
| |
|
Line 80
|
Parallel
|
Line 80
|
Parallel
|
| 80 |
$cc = $topic->{cc}; |
80 |
$cc = $topic->{cc}; |
| 81 |
} |
81 |
} |
| 82 |
|
82 |
|
|
|
83 |
# Make sure the repository value is correct. |
|
|
84 |
my $repository_url = $Codestriker::repository_url_map->{$repository_name}; |
|
|
85 |
if ($repository_url eq "") { |
|
|
86 |
$feedback .= "Repository name \"$repository_name\" is unknown.\n" . |
|
|
87 |
"Update your codestriker.conf file with this entry.\n"; |
|
|
88 |
} |
|
|
89 |
|
| 83 |
if ($feedback eq "") { |
90 |
if ($feedback eq "") { |
| 84 |
if ($topic_state eq "Deleted") { |
91 |
if ($topic_state eq "Deleted") { |
| 85 |
$rc = $topic->delete(); |
92 |
$rc = $topic->delete(); |
| |
| |
|
Line 36
|
Parallel
|
Line 36
|
Parallel
|
| 36 |
my $topic_file = $http_input->get('fh_filename'); |
36 |
my $topic_file = $http_input->get('fh_filename'); |
| 37 |
my $fh_mime_type = $http_input->get('fh_mime_type'); |
37 |
my $fh_mime_type = $http_input->get('fh_mime_type'); |
| 38 |
my $bug_ids = $http_input->get('bug_ids'); |
38 |
my $bug_ids = $http_input->get('bug_ids'); |
| 39 |
my $repository_url = $http_input->get('repository'); |
39 |
my $repository_name = $http_input->get('repository'); |
| 40 |
my $projectid = $http_input->get('projectid'); |
40 |
my $projectid = $http_input->get('projectid'); |
| 41 |
my $project_name = $http_input->get('project_name'); |
41 |
my $project_name = $http_input->get('project_name'); |
| 42 |
my $start_tag = $http_input->get('start_tag'); |
42 |
my $start_tag = $http_input->get('start_tag'); |
| |
| |
|
Line 85
|
Parallel
|
Line 85
|
Parallel
|
| 85 |
|
85 |
|
| 86 |
$http_response->generate_header(topic_title=>"Create New Topic", |
86 |
$http_response->generate_header(topic_title=>"Create New Topic", |
| 87 |
email=>$email, reviewers=>$reviewers, |
87 |
email=>$email, reviewers=>$reviewers, |
| 88 |
cc=>$cc, repository=>$repository_url, |
88 |
cc=>$cc, repository=>$repository_name, |
| 89 |
projectid=>$projectid, |
89 |
projectid=>$projectid, |
| 90 |
reload=>0, cache=>0); |
90 |
reload=>0, cache=>0); |
| 91 |
|
91 |
|
| |
| |
|
Line 101
|
Parallel
|
Line 101
|
Parallel
|
| 101 |
$error_vars->{'topic_description'} = $topic_description; |
101 |
$error_vars->{'topic_description'} = $topic_description; |
| 102 |
$error_vars->{'topic_title'} = $topic_title; |
102 |
$error_vars->{'topic_title'} = $topic_title; |
| 103 |
$error_vars->{'bug_ids'} = $bug_ids; |
103 |
$error_vars->{'bug_ids'} = $bug_ids; |
| 104 |
$error_vars->{'default_repository'} = $repository_url; |
104 |
$error_vars->{'default_repository'} = $repository_name; |
| 105 |
$error_vars->{'repositories'} = \@Codestriker::valid_repositories; |
105 |
$error_vars->{'repositories'} = \@Codestriker::valid_repositories; |
| 106 |
$error_vars->{'start_tag'} = $start_tag; |
106 |
$error_vars->{'start_tag'} = $start_tag; |
| 107 |
$error_vars->{'end_tag'} = $end_tag; |
107 |
$error_vars->{'end_tag'} = $end_tag; |
| |
| |
|
Line 110
|
Parallel
|
Line 110
|
Parallel
|
| 110 |
$error_vars->{'default_to_head'} = $default_to_head; |
110 |
$error_vars->{'default_to_head'} = $default_to_head; |
| 111 |
|
111 |
|
| 112 |
my $repository = undef; |
112 |
my $repository = undef; |
|
|
113 |
my $repository_url = undef; |
| 113 |
if (scalar(@Codestriker::valid_repositories)) { |
114 |
if (scalar(@Codestriker::valid_repositories)) { |
| 114 |
# Set the repository to the default if it is not entered. |
115 |
# Set the repository to the default if it is not entered. |
| 115 |
if ($repository_url eq "" || scalar(@Codestriker::valid_repositories) == 1) { |
116 |
if ($repository_name eq "" || scalar(@Codestriker::valid_repository_names) == 1) { |
| 116 |
$repository_url = $Codestriker::valid_repositories[0]; |
117 |
$repository_name = $Codestriker::valid_repository_names[0]; |
| 117 |
} |
118 |
} |
| 118 |
|
119 |
|
| 119 |
# Check if the repository argument is in fact a configured |
120 |
# Check if the repository argument is in fact a configured |
| 120 |
# repository. |
121 |
# repository. |
| 121 |
my $configured = 0; |
122 |
$repository_url = $Codestriker::repository_url_map->{$repository_name}; |
| 122 |
foreach my $rep ( @Codestriker::valid_repositories ) { |
|
|
| 123 |
$configured = 1 if $repository_url eq $rep; |
|
|
| 124 |
} |
|
|
| 125 |
|
123 |
|
| 126 |
if ($configured) { |
124 |
if (defined $repository_url) { |
| 127 |
$repository = |
125 |
$repository = |
| 128 |
Codestriker::Repository::RepositoryFactory->get($repository_url); |
126 |
Codestriker::Repository::RepositoryFactory->get($repository_url); |
| 129 |
} |
127 |
} |
| 130 |
|
128 |
|
| 131 |
if (! defined $repository) { |
129 |
if (! defined $repository) { |
| 132 |
$feedback .= |
130 |
$feedback .= |
| 133 |
"The repository value \"$repository_url\" is invalid.\n" . |
131 |
"The repository value set for \"$repository_name\" is invalid.\n" . |
| 134 |
"Please correct this value in your codestriker.conf file, " . |
132 |
"Please correct this value in your codestriker.conf file, " . |
| 135 |
"and try again.\n"; |
133 |
"and try again.\n"; |
| 136 |
} |
134 |
} |
| |
| |
|
Line 195
|
Parallel
|
Line 193
|
Parallel
|
| 195 |
if ($rc == $Codestriker::DIFF_TOO_BIG) { |
193 |
if ($rc == $Codestriker::DIFF_TOO_BIG) { |
| 196 |
$feedback .= "Generated diff file is too big.\n"; |
194 |
$feedback .= "Generated diff file is too big.\n"; |
| 197 |
} elsif ($rc == $Codestriker::UNSUPPORTED_OPERATION) { |
195 |
} elsif ($rc == $Codestriker::UNSUPPORTED_OPERATION) { |
| 198 |
$feedback .= "Repository \"" . $repository->toString() . |
196 |
$feedback .= "Repository \"" . $repository_name . |
| 199 |
"\" does not support tag retrieval, you have to use the text file upload.\n"; |
197 |
"\" does not support tag retrieval, you have to use the text file upload.\n"; |
|
|
198 |
} elsif ($rc != $Codestriker::OK) { |
|
|
199 |
$feedback .= "Unexpected error $rc retrieving diff text.\n"; |
| 200 |
} |
200 |
} |
| 201 |
|
201 |
|
| 202 |
# Seek to the beginning of the temporary file so it can be parsed. |
202 |
# Seek to the beginning of the temporary file so it can be parsed. |
| |