codestriker-commits Mailing List for Codestriker: collaborative code reviewer (Page 2)
Brought to you by:
sits
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(58) |
Dec
(14) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(12) |
Feb
(53) |
Mar
(2) |
Apr
|
May
(36) |
Jun
(59) |
Jul
(69) |
Aug
(47) |
Sep
(54) |
Oct
(45) |
Nov
|
Dec
|
| 2006 |
Jan
(20) |
Feb
(3) |
Mar
|
Apr
(6) |
May
(13) |
Jun
(18) |
Jul
(9) |
Aug
(12) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2007 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
(1) |
May
(2) |
Jun
(7) |
Jul
(7) |
Aug
(6) |
Sep
(5) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2008 |
Jan
(7) |
Feb
(13) |
Mar
(9) |
Apr
|
May
|
Jun
(50) |
Jul
(22) |
Aug
(58) |
Sep
(28) |
Oct
|
Nov
|
Dec
|
|
From: <si...@us...> - 2008-09-02 06:36:17
|
User: sits
Date: 08/09/01 23:36:16
Modified: lib/Codestriker/Http Response.pm
Log:
Minor tweak to get the nice URL case locating the static files.
Index: Response.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Response.pm,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- Response.pm 29 Aug 2008 10:49:02 -0000 1.49
+++ Response.pm 2 Sep 2008 06:36:16 -0000 1.50
@@ -234,7 +234,7 @@
if (defined $Codestriker::cgi_style && $Codestriker::cgi_style) {
$codestriker_css =~ s#/[^/]+?/codestriker\.pl#/codestrikerhtml/codestriker.css#;
} else {
- $codestriker_css = $query->url() . "html/codestriker.css";
+ $codestriker_css = $query->url() . "/html/codestriker.css";
}
}
|
|
From: <si...@us...> - 2008-09-02 06:35:41
|
User: sits
Date: 08/09/01 23:35:39
Modified: lib/Codestriker/TopicListeners BugTracking.pm
Log:
Make sure the view_url is composed correctly.
Index: BugTracking.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/BugTracking.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- BugTracking.pm 10 Aug 2008 12:18:43 -0000 1.9
+++ BugTracking.pm 2 Sep 2008 06:35:39 -0000 1.10
@@ -113,7 +113,7 @@
my $newstate = $topic->{topic_state};
my $query = new CGI;
my $url_builder = Codestriker::Http::UrlBuilder->new($query);
- my $topic_url = $url_builder->view_url(topicid => $topic->{topicid});
+ my $topic_url = $url_builder->view_url(topicid => $topic->{topicid}, projectid => $topic->{project_id});
my $bug_db_connection =
Codestriker::BugDB::BugDBConnectionFactory->getBugDBConnection();
|
|
From: <si...@us...> - 2008-09-02 06:33:59
|
User: sits
Date: 08/09/01 23:33:57
Modified: t/FileParser subversion.t
lib/Codestriker/FileParser SubversionDiff.pm
. CHANGELOG
Added: test/testtopictexts svn-PropDiff9.txt
Log:
* Fixed a bug where Subversion diffs with binary files that contained
property changes were not handled correctly.
Index: svn-PropDiff9.txt
===================================================================
RCS file: svn-PropDiff9.txt
diff -N svn-PropDiff9.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ svn-PropDiff9.txt 2 Sep 2008 06:33:56 -0000 1.1
@@ -0,0 +1,26 @@
+Index: product/lib/javamail/mail.jar
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: product\lib\javamail\mail.jar
+___________________________________________________________________
+Added: svn:mime-type
+ + application/octet-stream
+
+Index: buildCleanup.py
+===================================================================
+--- buildCleanup.py (revision 7)
++++ buildCleanup.py (revision 9)
+@@ -28,11 +28,7 @@
+ # GCOMDirectories = ['/usr/local/apache2/htdocs/docs', '/export/home/buildmaster/cruisecontrol/GCOM']
+ # EPRODirectories = ['/usr/local/apache2/htdocs/docs', '/export/home/buildmaster/cruisecontrol/EPRODATA']
+
+- GCOMDirectories = [ 'testdata/branches/GCOM' ]
+- EPRODirectories = [ 'testdata/branches/EPRODATA' ]
+
+- activeGraingerBuild = database.getActiveBuild("PRD", "gcom")
+- activeEPROBuild = database.getActiveBuild("PRD", "eprodata")
+
+ print activeGraingerBuild.getBranchIdentifier()
+ print activeEPROBuild.getBranchIdentifier()
Index: subversion.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/FileParser/subversion.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- subversion.t 4 Aug 2008 10:33:33 -0000 1.2
+++ subversion.t 2 Sep 2008 06:33:57 -0000 1.3
@@ -2,7 +2,7 @@
use strict;
use Fatal qw / open close /;
-use Test::More tests => 33;
+use Test::More tests => 36;
use Test::Differences;
use lib '../../lib';
@@ -149,6 +149,33 @@
END_DELTA
));
+assert_delta_equals('../../test/testtopictexts/svn-Propdiff9.txt',
+ make_delta(filename => 'product/lib/javamail/mail.jar',
+ old_linenumber => -1,
+ new_linenumber => -1,
+ revision => '1.0',
+ text => '',
+ binary => 1),
+ make_delta(filename => 'buildCleanup.py',
+ old_linenumber => '28',
+ new_linenumber => '28',
+ revision => '7',
+ text => <<'END_DELTA',
+ # GCOMDirectories = ['/usr/local/apache2/htdocs/docs', '/export/home/buildmaster/cruisecontrol/GCOM']
+ # EPRODirectories = ['/usr/local/apache2/htdocs/docs', '/export/home/buildmaster/cruisecontrol/EPRODATA']
+
+- GCOMDirectories = [ 'testdata/branches/GCOM' ]
+- EPRODirectories = [ 'testdata/branches/EPRODATA' ]
+
+- activeGraingerBuild = database.getActiveBuild("PRD", "gcom")
+- activeEPROBuild = database.getActiveBuild("PRD", "eprodata")
+
+ print activeGraingerBuild.getBranchIdentifier()
+ print activeEPROBuild.getBranchIdentifier()
+END_DELTA
+ ));
+
+
assert_delta_equals('../../test/testtopictexts/svn-look-diff1.txt',
make_delta(filename => 't1.txt',
old_linenumber => '0',
Index: SubversionDiff.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/SubversionDiff.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- SubversionDiff.pm 2 Aug 2008 04:47:40 -0000 1.10
+++ SubversionDiff.pm 2 Sep 2008 06:33:57 -0000 1.11
@@ -86,7 +86,7 @@
# removed, and what revision it is based off.
$line = <$fh>;
my $count = 0;
- while (defined $line && $line !~ /^Index|Added|Modified|Deleted/o) {
+ while (defined $line && $line !~ /^Index|Added|Modified|Deleted|Property changes on:/o) {
$line = <$fh>;
$count++;
}
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.264
retrieving revision 1.265
diff -u -r1.264 -r1.265
--- CHANGELOG 31 Aug 2008 12:02:12 -0000 1.264
+++ CHANGELOG 2 Sep 2008 06:33:57 -0000 1.265
@@ -31,6 +31,9 @@
* Help popup text windows on the create topic and search screens
disappear automatically when the cursor is moved off the (?) link.
+
+* Fixed a bug where Subversion diffs with binary files that contained
+ property changes were not handled correctly.
Version 1.9.6
|
|
From: <si...@us...> - 2008-08-31 12:32:05
|
User: sits
Date: 08/08/31 05:32:04
Removed: t/Http url-builder.t
Log:
No longer need this file.
Index: url-builder.t
===================================================================
RCS file: url-builder.t
diff -N url-builder.t
--- url-builder.t 10 Aug 2008 12:18:44 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,228 +0,0 @@
-# Tests to ensure that UrlBuilder produces correct URLs.
-
-use strict;
-use Test::More tests => 40;
-
-use lib '../../lib';
-use Test::MockObject;
-use Codestriker;
-use Codestriker::Http::UrlBuilder;
-
-# Create a CGI mock object for these tests.
-my $mock_query = Test::MockObject->new();
-$mock_query->mock('url',
- sub { 'http://localhost.localdomain/codestriker/codestriker.pl' } );
-
-
-# Test view URL generation.
-my $url_cgi = Codestriker::Http::UrlBuilder->new($mock_query);
-my $url_nice = Codestriker::Http::UrlBuilder->new($mock_query, 0);
-
-is($url_cgi->view_url(topicid => 1234, projectid => 10, filenumber => 2, line => 3, new => 1),
- $mock_query->url() . '?action=view&topic=1234#2|3|1',
- "View URL CGI syntax");
-
-is($url_nice->view_url(topicid => 1234, projectid => 10, filenumber => 2, line => 3, new => 1),
- $mock_query->url() . '/project/10/topic/1234/view/text#2|3|1',
- "View URL nice syntax");
-
-is($url_cgi->view_url(topicid => 1234, projectid => 10, filenumber => 2, line => 3, new => 1, fview => 2),
- $mock_query->url() . '?action=view&topic=1234&fview=2#2|3|1',
- "View URL CGI syntax specific file");
-
-is($url_nice->view_url(topicid => 1234, projectid => 10, filenumber => 2, line => 3, new => 1, fview => 2),
- $mock_query->url() . '/project/10/topic/1234/view/text/filenumber/2#2|3|1',
- "View URL nice syntax specific file");
-
-# Check if parameters are missing.
-eval {
- $url_cgi->view_url(projectid => 10, filenumber => 2, line => 3, new => 1);
- fail("View URL missing topicid parameter");
-};
-if ($@) {
- # Expected.
- pass("View URL missing topicid parameter");
-}
-
-eval {
- $url_cgi->view_url(topicid => 1234, filenumber => 2, line => 3, new => 1);
- fail("View URL missing projectid parameter");
-};
-if ($@) {
- # Expected.
- pass("View URL missing projectid parameter");
-}
-
-# Test download URL generation.
-is($url_cgi->download_url(topicid => 1234, projectid => 10, filenumber => 2, line => 3, new => 1),
- $mock_query->url() . '?action=download&topic=1234',
- "Download URL CGI syntax");
-
-is($url_nice->download_url(topicid => 1234, projectid => 10, filenumber => 2, line => 3, new => 1),
- $mock_query->url() . '/project/10/topic/1234/download/text',
- "Download URL nice syntax");
-
-# Check if parameters are missing.
-eval {
- $url_cgi->download_url(projectid => 10);
- fail("Download URL missing topicid parameter");
-};
-if ($@) {
- # Expected.
- pass("Download URL missing topicid parameter");
-}
-
-eval {
- $url_cgi->download_url(topicid => 1234);
- fail("Download URL missing projectid parameter");
-};
-if ($@) {
- # Expected.
- pass("Download URL missing projectid parameter");
-}
-
-# Test create topic URL generation.
-is($url_cgi->create_topic_url(),
- $mock_query->url() . '?action=create',
- "Create topic URL CGI syntax");
-
-is($url_nice->create_topic_url(),
- $mock_query->url() . '/topics/create',
- "Create topic URL nice syntax");
-
-is($url_cgi->create_topic_url(45),
- $mock_query->url() . '?action=create&obsoletes=45',
- "Create topic with obsolete topics URL CGI syntax");
-
-is($url_nice->create_topic_url(45),
- $mock_query->url() . '/topics/create/obsoletes/45',
- "Create topic with obsolete topics URL nice syntax");
-
-# Test edit comment URL generation.
-is($url_cgi->edit_url(filenumber => 3, line => 55, new => 0, topicid => 1234,
- projectid => 10, context => 3),
- $mock_query->url() . '?action=edit&fn=3&line=55&new=0&topic=1234&context=3',
- "Add comment URL CGI syntax");
-
-is($url_nice->edit_url(filenumber => 3, line => 55, new => 0, topicid => 1234,
- projectid => 10, context => 3),
- $mock_query->url() . '/project/10/topic/1234/comment/3|55|0/add/context/3',
- "Add comment URL nice syntax");
-
-# Test view file URL generation.
-is($url_cgi->view_file_url(filenumber => 3, line => 55, new => 0, topicid => 1234,
- projectid => 10),
- $mock_query->url() . '?action=view_file&fn=3&topic=1234&new=0#3|55|0',
- "View file URL CGI syntax");
-
-is($url_nice->view_file_url(filenumber => 3, line => 55, new => 0, topicid => 1234,
- projectid => 10),
- $mock_query->url() . '/project/10/topic/1234/view/file/filenumber/3#3|55|0',
- "View file URL nice syntax");
-
-# Test search URL generation.
-is($url_cgi->search_url(), $mock_query->url() . '?action=search',
- "Search URL CGI syntax");
-is($url_nice->search_url(), $mock_query->url() . '/topics/search',
- "Search URL nice syntax");
-
-# Test create project URL generation.
-is($url_cgi->create_project_url(), $mock_query->url() . '?action=create_project',
- "Create project URL CGI syntax");
-is($url_nice->create_project_url(), $mock_query->url() . '/admin/projects/create',
- "Create project URL nice syntax");
-
-# Test list project URL generation.
-is($url_cgi->list_projects_url(), $mock_query->url() . '?action=list_projects',
- "List projects URL CGI syntax");
-is($url_nice->list_projects_url(), $mock_query->url() . '/admin/projects/list',
- "List projects URL nice syntax");
-
-# Test edit project URL generation.
-is($url_cgi->edit_project_url(45), $mock_query->url() . '?action=edit_project&projectid=45',
- "List projects URL CGI syntax");
-is($url_nice->edit_project_url(45), $mock_query->url() . '/admin/project/45/edit',
- "List projects URL nice syntax");
-
-# Test view comments URL generation.
-is($url_cgi->view_comments_url(topicid => 1234, projectid => 10),
- $mock_query->url() . '?action=list_comments&topic=1234',
- "View comments URL CGI syntax");
-
-is($url_nice->view_comments_url(topicid => 1234, projectid => 10),
- $mock_query->url() . '/project/10/topic/1234/comments/list',
- "View comments URL nice syntax");
-
-# Test view properties URL generation.
-is($url_cgi->view_topic_properties_url(topicid => 1234, projectid => 10),
- $mock_query->url() . '?action=view_topic_properties&topic=1234',
- "View topic properties URL CGI syntax");
-
-is($url_nice->view_topic_properties_url(topicid => 1234, projectid => 10),
- $mock_query->url() . '/project/10/topic/1234/properties',
- "View topic properties URL nice syntax");
-
-# Test view topic metrics URL generation.
-is($url_cgi->view_topicinfo_url(topicid => 1234, projectid => 10),
- $mock_query->url() . '?action=viewinfo&topic=1234',
- "View topic metrics URL CGI syntax");
-
-is($url_nice->view_topicinfo_url(topicid => 1234, projectid => 10),
- $mock_query->url() . '/project/10/topic/1234/metrics',
- "View topic metrics URL nice syntax");
-
-# Test metric reports URL generation.
-is($url_cgi->metric_report_url(),
- $mock_query->url() . '?action=metrics_report',
- "View metric reports URL CGI syntax");
-is($url_nice->metric_report_url(),
- $mock_query->url() . '/metrics/view',
- "View metric reports URL CGI syntax");
-
-is($url_cgi->metric_report_download_raw_data(),
- $mock_query->url() . '?action=metrics_download',
- "Download metrics report URL cgi syntax");
-is($url_nice->metric_report_download_raw_data(),
- $mock_query->url() . '/metrics/download',
- "Download metrics report URL nice syntax");
-
-# Test list topics URL generation.
-is ($url_cgi->list_topics_url(sauthor => "sits", sreviewer => "engineering",
- sbugid => "10,20", stitle => "Example title",
- scomments => "Critical Error",
- sstate => [0],
- sproject => [10,20]),
- $mock_query->url() . '?action=list_topics&sauthor=sits&sreviewer=engineering' .
- '&sbugid=10%2C20&stitle=Example%20title&scomments=Critical%20Error' .
- '&sstate=0&sproject=10%2C20',
- "List topics URL CGI syntax");
-is ($url_nice->list_topics_url(sauthor => "sits", sreviewer => "engineering",
- sbugid => "10,20", stitle => "Example title",
- scomments => "Critical Error",
- sstate => [0],
- sproject => [10,20]),
- $mock_query->url() . '/topics/list/author/sits/reviewer/engineering' .
- '/bugid/10%2C20/title/Example%20title/comment/Critical%20Error' .
- '/state/0/project/10%2C20',
- "List topics URL nice syntax");
-
-# Test list topics RSS URL generation.
-is ($url_cgi->list_topics_url_rss(sauthor => "sits", sreviewer => "engineering",
- sbugid => "10,20", stitle => "Example title",
- scomments => "Critical Error",
- sstate => [0],
- sproject => [10,20]),
- $mock_query->url() . '?action=list_topics_rss&sauthor=sits&sreviewer=engineering' .
- '&sbugid=10%2C20&stitle=Example%20title&scomments=Critical%20Error' .
- '&sstate=0&sproject=10%2C20',
- "List topics URL CGI syntax");
-is ($url_nice->list_topics_url_rss(sauthor => "sits", sreviewer => "engineering",
- sbugid => "10,20", stitle => "Example title",
- scomments => "Critical Error",
- sstate => [0],
- sproject => [10,20]),
- $mock_query->url() . '/feed/topics/list/author/sits/reviewer/engineering' .
- '/bugid/10%2C20/title/Example%20title/comment/Critical%20Error' .
- '/state/0/project/10%2C20',
- "List topics URL nice syntax");
-
\ No newline at end of file
|
User: sits
Date: 08/08/31 05:30:16
Modified: t/Http/Method update-topic-metrics.t view-topic-text.t
add-topic.t view-topic-properties.t
update-project.t list-topics.t add-comment.t
edit-project.t view-topic-comments.t
update-comment-metrics.t update-topic-states.t
view-topic-metrics.t update-topic-properties.t
view-topic-file.t create-topic.t
download-topic-text.t create-comment.t
lib/Codestriker/Http/Method CreateTopicMethod.pm
UpdateTopicMetricsMethod.pm CreateCommentMethod.pm
UpdateTopicPropertiesMethod.pm
ViewTopicFileMethod.pm
Log:
Updated unit tests to be working again under new URL scheme.
Index: update-topic-metrics.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/update-topic-metrics.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- update-topic-metrics.t 29 Aug 2008 10:49:01 -0000 1.1
+++ update-topic-metrics.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -18,7 +18,7 @@
my $url_nice = Codestriker::Http::Method::UpdateTopicMetricsMethod->new($mock_query, 0);
is($url_cgi->url(topicid => 1234, projectid => 10),
- $mock_query->url() . '?action=submit_edit_topic_metrics&topic=1234',
+ $mock_query->url() . '?action=edit_topic_metrics',
"Update topic metrics URL CGI syntax");
is($url_nice->url(topicid => 1234, projectid => 10),
@@ -28,13 +28,14 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/metrics/update';
+ return '/project/10/topic/1234/metrics/update';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
\ No newline at end of file
Index: view-topic-text.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/view-topic-text.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- view-topic-text.t 27 Aug 2008 08:43:10 -0000 1.2
+++ view-topic-text.t 31 Aug 2008 12:30:05 -0000 1.3
@@ -46,13 +46,12 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
- sub {
- return $mock_query->url() . '/project/10/topic/1234/text#2|3|1';
- });
+ sub { '/project/10/topic/1234/text#2|3|1'; });
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
\ No newline at end of file
Index: add-topic.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/add-topic.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- add-topic.t 11 Aug 2008 22:32:38 -0000 1.1
+++ add-topic.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -28,9 +28,10 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topics/add';
+ return '/project/10/topics/add';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
Index: view-topic-properties.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/view-topic-properties.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- view-topic-properties.t 18 Aug 2008 11:19:59 -0000 1.2
+++ view-topic-properties.t 31 Aug 2008 12:30:05 -0000 1.3
@@ -28,13 +28,14 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/properties/view';
+ return '/project/10/topic/1234/properties/view';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
\ No newline at end of file
Index: update-project.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/update-project.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- update-project.t 27 Aug 2008 08:43:10 -0000 1.1
+++ update-project.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -25,9 +25,10 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/admin/project/45/update';
+ return '/admin/project/45/update';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
Index: list-topics.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/list-topics.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- list-topics.t 10 Aug 2008 12:18:42 -0000 1.1
+++ list-topics.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -60,9 +60,10 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/topics/list/author/sits/reviewer/engineering' .
+ return '/topics/list/author/sits/reviewer/engineering' .
'/bugid/10%2C20/title/Example%20title/comment/Critical%20Error' .
'/state/0/project/10%2C30';
});
Index: add-comment.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/add-comment.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- add-comment.t 18 Aug 2008 11:11:36 -0000 1.2
+++ add-comment.t 31 Aug 2008 12:30:05 -0000 1.3
@@ -30,14 +30,15 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/comment/3|55|0/add';
+ return '/project/10/topic/1234/comment/3|55|0/add';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "projectid nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
is ($mock_http_input->{fn}, "3", "fn nice URL parameter extraction");
is ($mock_http_input->{line}, "55", "line nice URL parameter extraction");
is ($mock_http_input->{new}, "0", "new nice URL parameter extraction");
Index: edit-project.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/edit-project.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- edit-project.t 27 Aug 2008 08:43:10 -0000 1.2
+++ edit-project.t 31 Aug 2008 12:30:05 -0000 1.3
@@ -25,9 +25,10 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/admin/project/45/edit';
+ return '/admin/project/45/edit';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
Index: view-topic-comments.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/view-topic-comments.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- view-topic-comments.t 31 Aug 2008 11:45:02 -0000 1.2
+++ view-topic-comments.t 31 Aug 2008 12:30:05 -0000 1.3
@@ -28,13 +28,14 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/comments/list';
+ return '/project/10/topic/1234/comments/list';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "projectid nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
\ No newline at end of file
Index: update-comment-metrics.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/update-comment-metrics.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- update-comment-metrics.t 31 Aug 2008 11:45:02 -0000 1.1
+++ update-comment-metrics.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -28,13 +28,14 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/comments/update';
+ return '/project/10/topic/1234/comments/update';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
\ No newline at end of file
Index: update-topic-states.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/update-topic-states.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- update-topic-states.t 18 Aug 2008 22:11:06 -0000 1.1
+++ update-topic-states.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -28,9 +28,10 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/update';
+ return '/project/10/topic/update';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
Index: view-topic-metrics.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/view-topic-metrics.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- view-topic-metrics.t 31 Aug 2008 11:45:02 -0000 1.2
+++ view-topic-metrics.t 31 Aug 2008 12:30:05 -0000 1.3
@@ -28,13 +28,14 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/metrics/view';
+ return '/project/10/topic/1234/metrics/view';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
\ No newline at end of file
Index: update-topic-properties.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/update-topic-properties.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- update-topic-properties.t 18 Aug 2008 11:19:59 -0000 1.1
+++ update-topic-properties.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -18,7 +18,7 @@
my $url_nice = Codestriker::Http::Method::UpdateTopicPropertiesMethod->new($mock_query, 0);
is($url_cgi->url(topicid => 1234, projectid => 10),
- $mock_query->url() . '?action=submit_edit_topic_properties&topic=1234',
+ $mock_query->url() . '?action=submit_edit_topic_properties',
"Update topic properties URL CGI syntax");
is($url_nice->url(topicid => 1234, projectid => 10),
@@ -28,13 +28,14 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/properties/update';
+ return '/project/10/topic/1234/properties/update';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
\ No newline at end of file
Index: view-topic-file.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/view-topic-file.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- view-topic-file.t 10 Aug 2008 12:18:42 -0000 1.1
+++ view-topic-file.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -30,14 +30,15 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/file/3#3|55|0';
+ return '/project/10/topic/1234/file/3#3|55|0';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "projectid nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
is ($mock_http_input->{fn}, "3", "fn nice URL parameter extraction");
\ No newline at end of file
Index: create-topic.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/create-topic.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- create-topic.t 10 Aug 2008 12:18:42 -0000 1.1
+++ create-topic.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -36,9 +36,10 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/topics/create/obsoletes/45';
+ return '/topics/create/obsoletes/45';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
Index: download-topic-text.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/download-topic-text.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- download-topic-text.t 26 Aug 2008 22:18:51 -0000 1.1
+++ download-topic-text.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -28,11 +28,12 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/download';
+ return '/project/10/topic/1234/download';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
Index: create-comment.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/create-comment.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- create-comment.t 18 Aug 2008 11:11:36 -0000 1.1
+++ create-comment.t 31 Aug 2008 12:30:05 -0000 1.2
@@ -19,7 +19,7 @@
is($url_cgi->url(filenumber => 3, line => 55, new => 0, topicid => 1234,
projectid => 10, context => 3),
- $mock_query->url() . '?action=edit&fn=3&line=55&new=0&topic=1234&context=3',
+ $mock_query->url() . '?action=edit&topic=1234&fn=3&line=55&new=0&context=3',
"Create comment URL CGI syntax");
is($url_nice->url(filenumber => 3, line => 55, new => 0, topicid => 1234,
@@ -30,14 +30,15 @@
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
+$mock_http_input->mock('extract_cgi_parameters', sub { return undef; });
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/comment/3|55|0/create/context/3';
+ return '/project/10/topic/1234/comment/3|55|0/create/context/3';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
is ($mock_http_input->{projectid}, "10", "projectid nice URL parameter extraction");
-is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{topic}, "1234", "topicid nice URL parameter extraction");
is ($mock_http_input->{fn}, "3", "fn nice URL parameter extraction");
is ($mock_http_input->{line}, "55", "line nice URL parameter extraction");
is ($mock_http_input->{new}, "0", "new nice URL parameter extraction");
Index: CreateTopicMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/CreateTopicMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CreateTopicMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ CreateTopicMethod.pm 31 Aug 2008 12:30:07 -0000 1.3
@@ -32,7 +32,6 @@
my $action = $http_input->{query}->param('action');
my $path_info = $http_input->{query}->path_info();
- print STDERR "Check path: $path_info\n";
if ($self->{cgi_style} && defined $action && $action eq "create") {
$http_input->extract_cgi_parameters();
return 1;
Index: UpdateTopicMetricsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/UpdateTopicMetricsMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- UpdateTopicMetricsMethod.pm 31 Aug 2008 11:45:03 -0000 1.2
+++ UpdateTopicMetricsMethod.pm 31 Aug 2008 12:30:07 -0000 1.3
@@ -20,7 +20,7 @@
my ($self, %args) = @_;
if ($self->{cgi_style}) {
- return $self->{url_prefix} . "?action=edit_topic_metrics&topic=$args{topicid}";
+ return $self->{url_prefix} . "?action=edit_topic_metrics";
} else {
confess "Parameter topicid missing" unless defined $args{topicid};
confess "Parameter projectid missing" unless defined $args{projectid};
@@ -38,7 +38,7 @@
return 1;
} elsif ($path_info =~ m{^/project/\d+/topic/\d+/metrics/update}) {
$self->_extract_nice_parameters($http_input,
- project => 'projectid', topic => 'topicid');
+ project => 'projectid', topic => 'topic');
return 1;
} else {
return 0;
Index: CreateCommentMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/CreateCommentMethod.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CreateCommentMethod.pm 29 Aug 2008 10:48:57 -0000 1.3
+++ CreateCommentMethod.pm 31 Aug 2008 12:30:07 -0000 1.4
@@ -23,7 +23,7 @@
if ($self->{cgi_style}) {
return $self->{url_prefix} . "?action=edit&topic=$args{topicid}" .
- (defined $args{filenumber} && $args{filenumber} ne "" . "&fn=$args{filenumber}&line=$args{line}&new=$args{new}") .
+ (defined $args{filenumber} && $args{filenumber} ne "" ? "&fn=$args{filenumber}&line=$args{line}&new=$args{new}" : "") .
(defined $args{anchor} ? "&a=$args{anchor}" : "") .
(defined $args{context} ? "&context=$args{context}" : "");
} else {
Index: UpdateTopicPropertiesMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/UpdateTopicPropertiesMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- UpdateTopicPropertiesMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ UpdateTopicPropertiesMethod.pm 31 Aug 2008 12:30:07 -0000 1.3
@@ -20,7 +20,7 @@
my ($self, %args) = @_;
if ($self->{cgi_style}) {
- return $self->{url_prefix} . "?action=submit_edit_topic_properties&topic=$args{topicid}";
+ return $self->{url_prefix} . "?action=submit_edit_topic_properties";
} else {
confess "Parameter topicid missing" unless defined $args{topicid};
confess "Parameter projectid missing" unless defined $args{projectid};
@@ -38,7 +38,7 @@
return 1;
} elsif ($path_info =~ m{^/project/\d+/topic/\d+/properties}) {
$self->_extract_nice_parameters($http_input,
- project => 'projectid', topic => 'topicid');
+ project => 'projectid', topic => 'topic');
return 1;
} else {
return 0;
Index: ViewTopicFileMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicFileMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ViewTopicFileMethod.pm 29 Aug 2008 10:48:58 -0000 1.2
+++ ViewTopicFileMethod.pm 31 Aug 2008 12:30:15 -0000 1.3
@@ -43,7 +43,7 @@
return 1;
} elsif ($path_info =~ m{^/project/\d+/topic/\d+/file/\d+}) {
$self->_extract_nice_parameters($http_input,
- project => 'projectid', topic => 'topicid',
+ project => 'projectid', topic => 'topic',
file => 'fn');
return 1;
} else {
|
|
From: <si...@us...> - 2008-08-31 12:02:14
|
User: sits
Date: 08/08/31 05:02:12
Modified: html codestriker.js
template/en/default search.html.tmpl createtopic.html.tmpl
. CHANGELOG
Log:
* Help popup text windows on the create topic and search screens
disappear automatically when the cursor is moved off the (?) link.
Index: codestriker.js
===================================================================
RCS file: /cvsroot/codestriker/codestriker/html/codestriker.js,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- codestriker.js 29 Aug 2008 10:49:00 -0000 1.17
+++ codestriker.js 31 Aug 2008 12:02:12 -0000 1.18
@@ -344,9 +344,7 @@
// window with a close link.
function create_window(text)
{
- var html = '<a href="javascript:hideElt(getElt(\'overDiv\')); void(0);">' +
- 'Close</a><p>' + text;
- overlib(html, STICKY, DRAGGABLE, ALTCUT, CENTERPOPUP);
+ overlib(text, DRAGGABLE, ALTCUT, CENTERPOPUP);
}
// Function for posting to Codestriker using the XMLHttpRequest object.
Index: search.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/search.html.tmpl,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- search.html.tmpl 31 Aug 2008 11:45:04 -0000 1.37
+++ search.html.tmpl 31 Aug 2008 12:02:12 -0000 1.38
@@ -12,6 +12,7 @@
[%# The author input field #%]
<TR>
<TD>Author: <FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
Constrain the search on topic author, which may be wildcarded \
as joe* or joe*company*.')">(?)</a></FONT></TD>
@@ -21,6 +22,7 @@
[%# The reviewer input field #%]
<TR>
<TD>Reviewer: <FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
Constrain the search on topic reviewer, which may be wildcarded \
as paul* or paul*company*.')">(?)</a></FONT></TD>
@@ -30,6 +32,7 @@
[%# The Cc input field #%]
<TR>
<TD>Cc: <FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
Constrain the search on topic CC, which may be wildcarded \
as group* or group*company*.')">(?)</a></FONT></TD>
@@ -40,6 +43,7 @@
[% IF bugdb_enabled != 0 %]
<TR>
<TD>Bug ID: <FONT SIZE="-2"><A HREF="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
Constrain the search on the topic bugid. This field \
cannot be wildcarded.')">(?)</a></FONT>
@@ -51,6 +55,7 @@
[%# The state multi-select #%]
<TR>
<TD>State: <FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
Constrain the search on the topic\'s state. Multiple \
fields can be selected here by holding down the control \
@@ -71,6 +76,7 @@
[%# The project multi-select #%]
<TR>
<TD>Project: <FONT SIZE="-2"><a href="javascript:void(0)"
+onmouseout="return nd();"
onmouseover="return create_window('\
Constrain the search on topic project membership. \
Multiple fields can be selected here by holding down the \
@@ -91,6 +97,7 @@
[%# The contains text input field and checkbox #%]
<TR>
<TD>Contains text: <FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
Constrain the search on text contained in the title, description, \
comment, body and filename topic attributes. Text can be wildcarded.')">(?)</a></FONT></TD>
Index: createtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/createtopic.html.tmpl,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- createtopic.html.tmpl 29 Aug 2008 10:49:00 -0000 1.57
+++ createtopic.html.tmpl 31 Aug 2008 12:02:12 -0000 1.58
@@ -27,6 +27,7 @@
[%# The topic title input field #%]
Topic title:
<FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('The topic title should be a concise but \
informative summary of the code to be reviewed. The title is used in the \
subject of sent emails, and in the topic list screen.');">(?)</a></FONT>
@@ -37,6 +38,7 @@
[%# The topic description input field #%]
Topic description:
<FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
The topic description should contain enough information \
for a reviewer to understand broadly what the code change \
@@ -61,6 +63,7 @@
<TR>
<TD>Topic text upload:
<FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
The uploaded file contains the actual text of the review. \
Typically, the text is the output of a command such as: \
@@ -86,6 +89,7 @@
<TD>
Start tag:
<FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
Rather than uploading the topic text, if the repository \
supports it, the text can be fetched by querying the \
@@ -100,6 +104,7 @@
<INPUT TYPE="text" NAME="start_tag" VALUE="[% start_tag | html_entity %]" SIZE=20 MAXLENGTH=150 />
</TD>
<TD>End tag: <FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
Rather than uploading the topic text, if the repository \
supports it, the text can be fetched by querying the \
@@ -118,6 +123,7 @@
<TD>
Module:
<FONT SIZE="-2"><A HREF="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
This is the path to the file or module relative to the repository \
root that should be inspected. It is ignored if text is uploaded.')">(?)</a></FONT>
@@ -132,6 +138,7 @@
[%# The default_to_head input field #%]
<TD>Default to HEAD:
<FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
Fall back to HEAD revision if a file does not exist on either tag. \
This will allow diffs between a branch and the HEAD revision, without \
@@ -148,6 +155,7 @@
<TR>
<TD>Repository:
<FONT SIZE="-2"><A HREF="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
The SCM system (eg CVS, Subversion, ClearCase) \
which the topic text was prepared against. If \
@@ -175,6 +183,7 @@
<TR>
<TD>Project:
<FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
Topics are associated with a specific project, which can be \
used as filtering criteria in the search screen.')">(?)</a></FONT>
@@ -198,6 +207,7 @@
<TR>
<TD>Bug IDs:
<FONT SIZE="-2"><a href="javascript:void(0)"
+onmouseout="return nd();"
onmouseover="return create_window('\
Indicates what bug identifiers are addressed by this code change. \
These are space or comma separated identifiers, such as: \
@@ -225,6 +235,7 @@
<TR>
<TD>Your email address:
<FONT SIZE="-2"><A HREF="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
This is your email address. All comments made against a topic \
will be sent to this address. The new topic notification email \
@@ -237,6 +248,7 @@
<TR>
<TD>Reviewers:
<FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
This is a comma separated list of email addresses, which are the \
people who need to review this code. When the topic is created, \
@@ -249,6 +261,7 @@
<TR>
<TD>Cc:
<FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseout="return nd();"
onmouseover="return create_window('\
This is a comma separated list of email addresses, which are \
not intended to be reviewers, but typically a mailing list \
@@ -275,7 +288,8 @@
retrieving lists of topics from the search page. \
\
This topic can be superceeded by a new topic, by selecting the \
-state \'obsoleted\'')">(?)</A></FONT>
+state \'obsoleted\'.');"
+onmouseout="return nd();">(?)</A></FONT>
</td>
<td>
[%# Now display the option button for changing the topic state #%]
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.263
retrieving revision 1.264
diff -u -r1.263 -r1.264
--- CHANGELOG 29 Aug 2008 11:48:29 -0000 1.263
+++ CHANGELOG 31 Aug 2008 12:02:12 -0000 1.264
@@ -27,7 +27,10 @@
* Updated install.pl to support a separate Apache virtual host per
Codestriker project as suggested by dm...@us....
- Manual has been updated with the appropriate instructions.
+ Manual has been updated with the appropriate instructions.
+
+* Help popup text windows on the create topic and search screens
+ disappear automatically when the cursor is moved off the (?) link.
Version 1.9.6
|
|
From: <si...@us...> - 2008-08-31 11:45:07
|
User: sits
Date: 08/08/31 04:45:05
Modified: t/Http/Method view-topic-comments.t view-topic-metrics.t
lib/Codestriker/Http Dispatcher.pm UrlBuilder.pm
lib/Codestriker/Http/Method AddProjectMethod.pm
DownloadTopicTextMethod.pm ListProjectsMethod.pm
ViewTopicMetricsMethod.pm
UpdateTopicMetricsMethod.pm SearchTopicsMethod.pm
SubmitSearchTopicsMethod.pm
DownloadMetricsMethod.pm ViewMetricsMethod.pm
CreateProjectMethod.pm ViewTopicCommentsMethod.pm
template/en/default viewtopiccomments.html.tmpl
search.html.tmpl
lib/Codestriker/Action Search.pm ViewTopicComments.pm
Added: t/Http/Method update-comment-metrics.t
lib/Codestriker/Http/Method UpdateCommentMetricsMethod.pm
Log:
A lot of the system now works with the new URL style.
Index: view-topic-comments.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/view-topic-comments.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- view-topic-comments.t 10 Aug 2008 12:18:42 -0000 1.1
+++ view-topic-comments.t 31 Aug 2008 11:45:02 -0000 1.2
@@ -22,7 +22,7 @@
"View comments URL CGI syntax");
is($url_nice->url(topicid => 1234, projectid => 10),
- $mock_query->url() . '/project/10/topic/1234/comments',
+ $mock_query->url() . '/project/10/topic/1234/comments/list',
"View comments URL nice syntax");
# Check that the parameters extracted correctly.
@@ -30,7 +30,7 @@
$mock_http_input->{query} = $mock_query;
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/comments';
+ return $mock_query->url() . '/project/10/topic/1234/comments/list';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
Index: view-topic-metrics.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/view-topic-metrics.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- view-topic-metrics.t 10 Aug 2008 12:18:42 -0000 1.1
+++ view-topic-metrics.t 31 Aug 2008 11:45:02 -0000 1.2
@@ -22,7 +22,7 @@
"View topic metrics URL CGI syntax");
is($url_nice->url(topicid => 1234, projectid => 10),
- $mock_query->url() . '/project/10/topic/1234/metrics',
+ $mock_query->url() . '/project/10/topic/1234/metrics/view',
"View topic metrics URL nice syntax");
# Check that the parameters extracted correctly.
@@ -30,7 +30,7 @@
$mock_http_input->{query} = $mock_query;
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/metrics';
+ return $mock_query->url() . '/project/10/topic/1234/metrics/view';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
Index: update-comment-metrics.t
===================================================================
RCS file: update-comment-metrics.t
diff -N update-comment-metrics.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ update-comment-metrics.t 31 Aug 2008 11:45:02 -0000 1.1
@@ -0,0 +1,40 @@
+# Tests for the UpdateCommentMetrics method.
+
+use strict;
+use Test::More tests => 4;
+
+use lib '../../../lib';
+use Test::MockObject;
+use Codestriker;
+use Codestriker::Http::Method::UpdateCommentMetricsMethod;
+
+# Create a CGI mock object for these tests.
+my $mock_query = Test::MockObject->new();
+$mock_query->mock('url',
+ sub { 'http://localhost.localdomain/codestriker/codestriker.pl' } );
+
+# Create two method objects to test each URL scheme.
+my $url_cgi = Codestriker::Http::Method::UpdateCommentMetricsMethod->new($mock_query, 1);
+my $url_nice = Codestriker::Http::Method::UpdateCommentMetricsMethod->new($mock_query, 0);
+
+is($url_cgi->url(topicid => 1234, projectid => 10),
+ $mock_query->url() . '?action=change_comments_state',
+ "Update comment metrics URL CGI syntax");
+
+is($url_nice->url(topicid => 1234, projectid => 10),
+ $mock_query->url() . '/project/10/topic/1234/comments/update',
+ "Update comment metrics URL nice syntax");
+
+# Check that the parameters extracted correctly.
+my $mock_http_input = Test::MockObject->new();
+$mock_http_input->{query} = $mock_query;
+$mock_query->mock('path_info',
+ sub {
+ return $mock_query->url() . '/project/10/topic/1234/comments/update';
+ });
+$mock_query->mock('param', sub { return undef; });
+$url_nice->extract_parameters($mock_http_input);
+is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
+is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+
+
\ No newline at end of file
Index: Dispatcher.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Dispatcher.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Dispatcher.pm 29 Aug 2008 10:49:02 -0000 1.8
+++ Dispatcher.pm 31 Aug 2008 11:45:03 -0000 1.9
@@ -23,6 +23,7 @@
use Codestriker::Http::Method::DownloadTopicTextMethod;
use Codestriker::Http::Method::UpdateTopicPropertiesMethod;
use Codestriker::Http::Method::UpdateTopicMetricsMethod;
+use Codestriker::Http::Method::UpdateCommentMetricsMethod;
use Codestriker::Http::Method::AddCommentMethod;
use Codestriker::Http::Method::CreateCommentMethod;
use Codestriker::Http::Method::AddTopicMethod;
@@ -50,6 +51,7 @@
Codestriker::Http::Method::CreateTopicMethod->new($query);
my @methods = ();
+ push @methods, Codestriker::Http::Method::SearchTopicsMethod->new($query);
push @methods, Codestriker::Http::Method::ViewTopicTextMethod->new($query);
push @methods, Codestriker::Http::Method::ViewTopicCommentsMethod->new($query);
push @methods, Codestriker::Http::Method::ViewTopicFileMethod->new($query);
@@ -57,6 +59,7 @@
push @methods, Codestriker::Http::Method::ViewTopicPropertiesMethod->new($query);
push @methods, Codestriker::Http::Method::UpdateTopicPropertiesMethod->new($query);
push @methods, Codestriker::Http::Method::UpdateTopicMetricsMethod->new($query);
+ push @methods, Codestriker::Http::Method::UpdateCommentMetricsMethod->new($query);
push @methods, $self->{list_topics_method};
push @methods, Codestriker::Http::Method::CreateCommentMethod->new($query);
push @methods, Codestriker::Http::Method::AddCommentMethod->new($query);
@@ -68,7 +71,6 @@
push @methods, Codestriker::Http::Method::EditProjectMethod->new($query);
push @methods, Codestriker::Http::Method::UpdateProjectMethod->new($query);
push @methods, Codestriker::Http::Method::ListProjectsMethod->new($query);
- push @methods, Codestriker::Http::Method::SearchTopicsMethod->new($query);
push @methods, Codestriker::Http::Method::SubmitSearchTopicsMethod->new($query);
push @methods, Codestriker::Http::Method::StaticResourcesMethod->new($query);
push @methods, Codestriker::Http::Method::ViewMetricsMethod->new($query);
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- UrlBuilder.pm 29 Aug 2008 10:49:02 -0000 1.45
+++ UrlBuilder.pm 31 Aug 2008 11:45:03 -0000 1.46
@@ -7,25 +7,6 @@
# Collection of routines for building codestriker URLs.
-# TODO, handle URL scheme such as:
-# UrlBuilder needs to be smart and know how to handle the old and new scheme.
-# Config variable could disable old scheme, then perhaps way to set security
-# on location.
-
-# Need a populate parameters method to set http_input hash.
-# map new anchor -> a and filenumber -> fn.
-
-# TODO: fix javascript eo method.
-#
-
-# For eahc method, need object to generate_url(%args), and another that takes query object and sets
-# parameters to $http_input. These could be unit tested as well. Object called Action.
-# When processing input, each object could check query, and return false if can't handle it?
-# For CGI case, can always handle it. Could call it Method? Might fit better into REST later.
-# Process method could return associated action object? better than large dispatch method currently
-# present.
-# process -> (%args, %http_input).
-
package Codestriker::Http::UrlBuilder;
use strict;
@@ -52,6 +33,7 @@
use Codestriker::Http::Method::ViewMetricsMethod;
use Codestriker::Http::Method::UpdateTopicPropertiesMethod;
use Codestriker::Http::Method::UpdateTopicMetricsMethod;
+use Codestriker::Http::Method::UpdateCommentMetricsMethod;
# Constructor for this class.
sub new {
@@ -195,7 +177,7 @@
# Create the URL for updating comments.
sub update_comments_url {
my ($self, %args) = @_;
-# return Codestriker::Http::Method::UpdateTopicCommentsMethod->new($self->{query})->url(%args);
+ return Codestriker::Http::Method::UpdateCommentMetricsMethod->new($self->{query})->url(%args);
}
# Create the URL for viewing the topic properties.
Index: AddProjectMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/AddProjectMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AddProjectMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ AddProjectMethod.pm 31 Aug 2008 11:45:03 -0000 1.3
@@ -34,6 +34,7 @@
$http_input->extract_cgi_parameters();
return 1;
} elsif ($path_info =~ m{^/admin/projects/add}) {
+ $self->_extract_nice_parameters($http_input);
return 1;
} else {
return 0;
Index: DownloadTopicTextMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/DownloadTopicTextMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DownloadTopicTextMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ DownloadTopicTextMethod.pm 31 Aug 2008 11:45:03 -0000 1.3
@@ -40,7 +40,7 @@
return 1;
} elsif ($path_info =~ m{^/project/\d+/topic/\d+/download}) {
$self->_extract_nice_parameters($http_input,
- project => 'projectid', topic => 'topicid');
+ project => 'projectid', topic => 'topic');
return 1;
} else {
return 0;
Index: ListProjectsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ListProjectsMethod.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ListProjectsMethod.pm 29 Aug 2008 10:48:57 -0000 1.3
+++ ListProjectsMethod.pm 31 Aug 2008 11:45:03 -0000 1.4
@@ -34,6 +34,7 @@
$http_input->extract_cgi_parameters();
return 1;
} elsif ($path_info =~ m{^/admin/projects/list$}) {
+ $self->_extract_nice_parameters($http_input);
return 1;
} else {
return 0;
Index: ViewTopicMetricsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicMetricsMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ViewTopicMetricsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ ViewTopicMetricsMethod.pm 31 Aug 2008 11:45:03 -0000 1.3
@@ -24,7 +24,7 @@
if ($self->{cgi_style}) {
return $self->{url_prefix} . "?action=viewinfo&topic=$args{topicid}";
} else {
- return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/metrics";
+ return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/metrics/view";
}
}
@@ -36,7 +36,7 @@
if ($self->{cgi_style} && defined $action && $action eq "viewinfo") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^/project/\d+/topic/\d+/metrics}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/metrics/view}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid', topic => 'topic');
return 1;
Index: UpdateTopicMetricsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/UpdateTopicMetricsMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UpdateTopicMetricsMethod.pm 29 Aug 2008 10:48:57 -0000 1.1
+++ UpdateTopicMetricsMethod.pm 31 Aug 2008 11:45:03 -0000 1.2
@@ -36,7 +36,7 @@
if ($self->{cgi_style} && defined $action && $action eq "edit_topic_metrics") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^/project/\d+/topic/\d+/properties}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/metrics/update}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid', topic => 'topicid');
return 1;
Index: SearchTopicsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/SearchTopicsMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SearchTopicsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ SearchTopicsMethod.pm 31 Aug 2008 11:45:03 -0000 1.3
@@ -33,7 +33,8 @@
if ($self->{cgi_style} && defined $action && $action eq "search") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^/topics/search/}) {
+ } elsif ($path_info =~ m{^/topics/search}) {
+ $self->_extract_nice_parameters($http_input);
return 1;
} else {
return 0;
Index: SubmitSearchTopicsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/SubmitSearchTopicsMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SubmitSearchTopicsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ SubmitSearchTopicsMethod.pm 31 Aug 2008 11:45:03 -0000 1.3
@@ -33,7 +33,8 @@
if ($self->{cgi_style} && defined $action && $action eq "submit_search") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^/topics/submitsearch/}) {
+ } elsif ($path_info =~ m{^/topics/submitsearch}) {
+ $self->_extract_nice_parameters($http_input);
return 1;
} else {
return 0;
Index: DownloadMetricsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/DownloadMetricsMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DownloadMetricsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ DownloadMetricsMethod.pm 31 Aug 2008 11:45:03 -0000 1.3
@@ -34,6 +34,7 @@
$http_input->extract_cgi_parameters();
return 1;
} elsif ($path_info =~ m{^/metrics/download$}) {
+ $self->_extract_nice_parameters($http_input);
return 1;
} else {
return 0;
Index: ViewMetricsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewMetricsMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ViewMetricsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ ViewMetricsMethod.pm 31 Aug 2008 11:45:03 -0000 1.3
@@ -34,6 +34,7 @@
$http_input->extract_cgi_parameters();
return 1;
} elsif ($path_info =~ m{^/metrics/view$}) {
+ $self->_extract_nice_parameters($http_input);
return 1;
} else {
return 0;
Index: CreateProjectMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/CreateProjectMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CreateProjectMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ CreateProjectMethod.pm 31 Aug 2008 11:45:03 -0000 1.3
@@ -34,6 +34,7 @@
$http_input->extract_cgi_parameters();
return 1;
} elsif ($path_info =~ m{^/admin/projects/create$}) {
+ $self->_extract_nice_parameters($http_input);
return 1;
} else {
return 0;
Index: ViewTopicCommentsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicCommentsMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ViewTopicCommentsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
+++ ViewTopicCommentsMethod.pm 31 Aug 2008 11:45:03 -0000 1.3
@@ -24,7 +24,7 @@
if ($self->{cgi_style}) {
return $self->{url_prefix} . "?action=list_comments&topic=$args{topicid}";
} else {
- return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/comments";
+ return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/comments/list";
}
}
@@ -36,7 +36,7 @@
if ($self->{cgi_style} && defined $action && $action eq "list_comments") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^/project/\d+/topic/\d+/comments}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/comments/list}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid', topic => 'topic');
return 1;
Index: UpdateCommentMetricsMethod.pm
===================================================================
RCS file: UpdateCommentMetricsMethod.pm
diff -N UpdateCommentMetricsMethod.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ UpdateCommentMetricsMethod.pm 31 Aug 2008 11:45:03 -0000 1.1
@@ -0,0 +1,54 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
+# si...@us...
+#
+# This program is free software; you can redistribute it and modify it under
+# the terms of the GPL.
+
+# Method for updating the metrics associated with comments.
+
+package Codestriker::Http::Method::UpdateCommentMetricsMethod;
+
+use strict;
+use Carp;
+use Codestriker::Http::Method;
+
+@Codestriker::Http::Method::UpdateCommentMetricsMethod::ISA = ("Codestriker::Http::Method");
+
+# Generate a URL for this method.
+sub url() {
+ my ($self, %args) = @_;
+
+ if ($self->{cgi_style}) {
+ return $self->{url_prefix} . "?action=change_comments_state";
+ } else {
+ confess "Parameter topicid missing" unless defined $args{topicid};
+ confess "Parameter projectid missing" unless defined $args{projectid};
+ return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/comments/update";
+ }
+}
+
+sub extract_parameters {
+ my ($self, $http_input) = @_;
+
+ my $action = $http_input->{query}->param('action');
+ my $path_info = $http_input->{query}->path_info();
+ if ($self->{cgi_style} && defined $action && $action eq "change_comments_state") {
+ $http_input->extract_cgi_parameters();
+ return 1;
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/comments/update}) {
+ $self->_extract_nice_parameters($http_input,
+ project => 'projectid', topic => 'topic');
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub execute {
+ my ($self, $http_input, $http_output) = @_;
+
+ Codestriker::Action::SubmitEditCommentsState->process($http_input, $http_output);
+}
+
+1;
Index: viewtopiccomments.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopiccomments.html.tmpl,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- viewtopiccomments.html.tmpl 8 Aug 2008 07:02:08 -0000 1.30
+++ viewtopiccomments.html.tmpl 31 Aug 2008 11:45:04 -0000 1.31
@@ -48,7 +48,7 @@
// -->
</SCRIPT>
-<FORM METHOD="post" ENCTYPE="multipart/form-data" name="form">
+<FORM METHOD="post" ENCTYPE="multipart/form-data" name="form" action="[% action_url %]">
<INPUT TYPE="hidden" NAME="action" VALUE="change_comments_state" />
<INPUT TYPE="hidden" NAME="topic" VALUE="[% topic %]" />
Index: search.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/search.html.tmpl,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- search.html.tmpl 8 Aug 2008 07:02:08 -0000 1.36
+++ search.html.tmpl 31 Aug 2008 11:45:04 -0000 1.37
@@ -3,7 +3,7 @@
[% PROCESS header.html.tmpl version = version displaymenu = 1
closehead = 1 help = "x671.html" subtitle = "Find Topics" %]
-<FORM METHOD="post" ENCTYPE="application/x-www-form-urlencoded">
+<FORM METHOD="post" ENCTYPE="application/x-www-form-urlencoded" ACTION="[% action_url %]">
<INPUT TYPE="hidden" NAME="action" VALUE="submit_search" />
Index: Search.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/Search.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Search.pm 17 Aug 2008 22:25:36 -0000 1.7
+++ Search.pm 31 Aug 2008 11:45:05 -0000 1.8
@@ -74,7 +74,7 @@
}
# Target URL to divert the post to.
- $vars->{'submit_search_url'} = $url_builder->submit_search_url();
+ $vars->{'action_url'} = $url_builder->submit_search_url();
my $template = Codestriker::Http::Template->new("search");
$template->process($vars);
Index: ViewTopicComments.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopicComments.pm,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ViewTopicComments.pm 18 Aug 2008 11:11:29 -0000 1.20
+++ ViewTopicComments.pm 31 Aug 2008 11:45:05 -0000 1.21
@@ -158,7 +158,11 @@
# Store the topic status
$vars->{'default_state'} = $topic->{topic_state};
- $vars->{'topic_states'} = \@Codestriker::topic_states;
+ $vars->{'topic_states'} = \@Codestriker::topic_states;
+
+ # Set the action URL for the form.
+ $vars->{'action_url'} = $url_builder->update_comments_url(topicid => $topicid,
+ projectid => $projectid);
# Send the data to the template for rendering.
my $template = Codestriker::Http::Template->new("viewtopiccomments");
|
|
From: <si...@us...> - 2008-08-30 03:30:44
|
User: sits
Date: 08/08/29 20:30:39
Modified: lib/Codestriker/Action ListTopics.pm
Log:
Get list topics working with nice URLs.
Index: ListTopics.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ListTopics.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- ListTopics.pm 15 Aug 2008 06:30:39 -0000 1.36
+++ ListTopics.pm 30 Aug 2008 03:30:39 -0000 1.37
@@ -292,7 +292,7 @@
my $sbody = $http_input->get('sbody') || 0;
my $sfilename = $http_input->get('sfilename') || 0;
my $projectid = $http_input->get('projectid');
-
+
# If $sproject has been set to -1, then retrieve the value of the projectid
# from the cookie as the project search value. This is done to facilate
# integration with other systems, which jump straight to this URL, and
@@ -301,8 +301,8 @@
$sproject = (defined $projectid) ? $projectid : "";
}
- # Only show open topics if codestriker.pl was run without parameters.
- if (defined($http_input->{query}->param) == 0 || !defined($sstate)) {
+ # Default to show open topics if sstate is not defined.
+ if (!defined($sstate)) {
$sstate = 0;
}
@@ -327,6 +327,7 @@
my $topic_sort_change = $http_input->get('topic_sort_change');
my $topicsort = $http_input->get('topicsort');
+ return () unless defined $topicsort;
my @sort_order = split(/,/,$topicsort); # this is always from the cookie.
if (defined $topic_sort_change && $topic_sort_change ne "") {
|
|
From: <si...@us...> - 2008-08-29 11:48:32
|
User: sits
Date: 08/08/29 04:48:30
Modified: lib/Codestriker/FileParser PerforceDescribe.pm
UnidiffUtils.pm
. CHANGELOG
Added: t/FileParser perforce.t
test/testtopictexts perforce-diff14.txt
Log:
* Fixed an issue where some Perforce describe diffs were not being
parsed correctly as reported by sha...@gm.... This has
now been fixed.
Index: perforce.t
===================================================================
RCS file: perforce.t
diff -N perforce.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ perforce.t 29 Aug 2008 11:48:26 -0000 1.1
@@ -0,0 +1,139 @@
+# Tests to ensure that perforce patches are handled correctly.
+
+use strict;
+use Fatal qw / open close /;
+use Test::More tests => 6;
+use Test::Differences;
+
+use lib '../../lib';
+use Codestriker;
+use Codestriker::FileParser::PerforceDescribe;
+
+# Parse the test perforce describe file.
+my $fh;
+open( $fh, '<', '../../test/testtopictexts/perforce-diff14.txt' );
+my @deltas = Codestriker::FileParser::PerforceDescribe->parse($fh);
+close($fh);
+
+# Set what the expected output should be.
+my @expected;
+push @expected, make_delta(
+ filename => '//depot/autobuild/Build.pm',
+ revision => '12',
+ old_linenumber => '499',
+ new_linenumber => '499',
+ text => <<'END_DELTA',
+
+ if ($state eq "start") {
+ print SENDMAIL "\t\tBuild started for release $rel. Build log could be found at:\n";
+- print SENDMAIL "http://172.20.1.120/build_log/$bldlog\n";
++ print SENDMAIL "http://172.20.1.251/build_log/$bldlog\n";
+ print SENDMAIL "\n You would be notified once build is done.\n";
+ print SENDMAIL "\n\n\nHappy Building... :)";
+ }
+END_DELTA
+);
+
+push @expected, make_delta(
+ filename => '//depot/autobuild/Build.pm',
+ revision => '12',
+ old_linenumber => '507',
+ new_linenumber => '507',
+ text => <<'END_DELTA',
+
+ print SENDMAIL "\t\tBuild for release $rel finished successfully. Here is details:\n";
+ print SENDMAIL "\nImage location: $stage_rel_link\n";
+- print SENDMAIL "Alternate location: http://172.20.1.120/images/$stage_rel_dir\n";
+- print SENDMAIL "Build Log: http://172.20.1.120/build_log/$bldlog\n";
+- print SENDMAIL "Sync Log: http://172.20.1.120/synclog/$synclog\n";
++ print SENDMAIL "Alternate location: http://172.20.1.251/images/$stage_rel_dir\n";
++ print SENDMAIL "Build Log: http://172.20.1.251/build_log/$bldlog\n";
++ print SENDMAIL "Sync Log: http://172.20.1.251/synclog/$synclog\n";
+ }
+ elsif ($state eq "failed") {
+
+END_DELTA
+);
+
+push @expected, make_delta(
+ filename => '//depot/autobuild/Build.pm',
+ revision => '12',
+ old_linenumber => '519',
+ new_linenumber => '519',
+ text => <<'END_DELTA',
+ push (@error_msgs, @error_msg);
+ print SENDMAIL "\n @error_msgs\n";
+ print SENDMAIL "\n\nSee build log for full details: ";
+- print SENDMAIL "Build Log: http://172.20.1.120/build_log/$bldlog\n";
+- print SENDMAIL "Sync Log: http://172.20.1.120/synclog/$synclog\n";
++ print SENDMAIL "Build Log: http://172.20.1.251/build_log/$bldlog\n";
++ print SENDMAIL "Sync Log: http://172.20.1.251/synclog/$synclog\n";
+ print SENDMAIL "\nPlease fix the issue and resubmit the build request.";
+ }
+ close (SENDMAIL);
+END_DELTA
+);
+
+push @expected, make_delta(
+ filename => '//depot/autobuild/buildserver.pl',
+ revision => '3',
+ old_linenumber => '10',
+ new_linenumber => '10',
+ text => <<'END_DELTA',
+ my $syncdir = "/opt/LOG/synclog";
+ my $stage_dir = "/mars/UPLOAD/BUILD/AUTO_BUILD/";
+ my $stage_linkdir = '\\\\mars\\Remote\\UPLOAD\\BUILD\\AUTO_BUILD\\';
++my $db_stage_linkdir = '\\\\\\\\mars\\\\Remote\\\\UPLOAD\\\\BUILD\\\\AUTO_BUILD\\\\';
+ my $image_dir = "/opt/Build/IMAGES/";
+ my $script_dir = "/var/www/cgi-bin/build/BUILD_SCRIPTS/";
+ my $buildlog_dir = "/opt/LOG/BUILD_LOG/";
+END_DELTA
+);
+
+push @expected, make_delta(
+ filename => '//depot/autobuild/buildserver.pl',
+ revision => '3',
+ old_linenumber => '282',
+ new_linenumber => '283',
+ text => <<'END_DELTA',
+ my $alt_stage_dir = $prod_rel[0] . "/" . $rel;
+ my $stage_rel_link = $stage_linkdir . "$prod_rel[0]" . "\\" . "$prod_rel[1]" . "\\" . "$rel";
+ Build->build_status_mail($bld_usr,$rel,$log_name,"pass", $stage_rel_link, $alt_stage_dir);
++
++ my $db_stage_rel_link = $db_stage_linkdir . "$prod_rel[0]" . "\\\\" . "$prod_rel[1]" . "\\\\" . "$rel";
++ my $stage_int_sql = "UPDATE releases SET internal_stage=\'$db_stage_rel_link\'
++ where releases.release=\'$rel\'";
++ Build->run_sql_query($stage_int_sql, ";");
++
+ }
+ }
+ else {
+END_DELTA
+);
+
+# Check that the extracted deltas match what is expected.
+is( @deltas, @expected, "Number of deltas in perforce patch 1" );
+for ( my $index = 0; $index < @deltas; $index++ ) {
+ eq_or_diff( $deltas[$index], $expected[$index],
+ "Delta $index in perforce patch 1" );
+}
+
+# Convenience function for creating a delta object.
+sub make_delta {
+
+ # Set constant properties for all git deltas.
+ my $delta = {};
+ $delta->{binary} = 0;
+ $delta->{repmatch} = 1;
+ $delta->{description} = '';
+
+ # Apply the passed in arguments.
+ my %arg = @_;
+ $delta->{filename} = $arg{filename};
+ $delta->{old_linenumber} = $arg{old_linenumber};
+ $delta->{new_linenumber} = $arg{new_linenumber};
+ $delta->{text} = $arg{text};
+ $delta->{revision} = $arg{revision};
+
+ return $delta;
+}
Index: PerforceDescribe.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/PerforceDescribe.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PerforceDescribe.pm 25 Aug 2007 09:11:07 -0000 1.6
+++ PerforceDescribe.pm 29 Aug 2008 11:48:26 -0000 1.7
@@ -148,6 +148,9 @@
# Skip the next blank line before the next chunk.
$line = <$fh>;
+ while (defined $line && $line =~ /^\s*$/) {
+ $line = <$fh>;
+ }
}
# Finally, add any remaining TOC netries that are unaccounted for.
Index: UnidiffUtils.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/UnidiffUtils.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- UnidiffUtils.pm 2 Aug 2008 04:47:40 -0000 1.7
+++ UnidiffUtils.pm 29 Aug 2008 11:48:27 -0000 1.8
@@ -48,14 +48,10 @@
if ($line !~ /^[\\]/o) {
# Check if the diff block with the trailing context has been
- # read. Note Perforce diffs can contain empty lines.
+ # read.
if ($num_matched_old_lines >= $number_old_lines &&
$num_matched_new_lines >= $number_new_lines) {
- last unless $line =~ /^\s*$/o;
-
- # Consume excessive blank lines.
- $line = <$fh>;
- next;
+ last;
}
else {
if ($line =~ /^\-/o) {
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.262
retrieving revision 1.263
diff -u -r1.262 -r1.263
--- CHANGELOG 27 Aug 2008 09:51:45 -0000 1.262
+++ CHANGELOG 29 Aug 2008 11:48:29 -0000 1.263
@@ -15,6 +15,10 @@
depot did not work if the depot was on a different machine to the
web-server. This has now been fixed.
+* Fixed an issue where some Perforce describe diffs were not being
+ parsed correctly as reported by sha...@gm.... This has
+ now been fixed.
+
* Added a drop-down on the topic create page where the initial topic
state can be set. By default, this is set to "Open", however in
situations where a review has already been performed but needs to
Index: perforce-diff14.txt
===================================================================
RCS file: perforce-diff14.txt
diff -N perforce-diff14.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ perforce-diff14.txt 29 Aug 2008 11:48:29 -0000 1.1
@@ -0,0 +1,75 @@
+
+
+
+
+Change 156 by shambhu@shambhu_build_test on 2008/08/12 20:55:51
+
+ Minor build related fixes, updated IP address, internal_stage location in table "releases" after build done and posted. Update "end" column in releases once a release is released.
+
+Affected files ...
+
+... //depot/autobuild/Build.pm#12 edit
+... //depot/autobuild/buildserver.pl#3 edit
+
+Differences ...
+
+==== //depot/autobuild/Build.pm#12 (text) ====
+
+@@ -499,7 +499,7 @@
+
+ if ($state eq "start") {
+ print SENDMAIL "\t\tBuild started for release $rel. Build log could be found at:\n";
+- print SENDMAIL "http://172.20.1.120/build_log/$bldlog\n";
++ print SENDMAIL "http://172.20.1.251/build_log/$bldlog\n";
+ print SENDMAIL "\n You would be notified once build is done.\n";
+ print SENDMAIL "\n\n\nHappy Building... :)";
+ }
+@@ -507,9 +507,9 @@
+
+ print SENDMAIL "\t\tBuild for release $rel finished successfully. Here is details:\n";
+ print SENDMAIL "\nImage location: $stage_rel_link\n";
+- print SENDMAIL "Alternate location: http://172.20.1.120/images/$stage_rel_dir\n";
+- print SENDMAIL "Build Log: http://172.20.1.120/build_log/$bldlog\n";
+- print SENDMAIL "Sync Log: http://172.20.1.120/synclog/$synclog\n";
++ print SENDMAIL "Alternate location: http://172.20.1.251/images/$stage_rel_dir\n";
++ print SENDMAIL "Build Log: http://172.20.1.251/build_log/$bldlog\n";
++ print SENDMAIL "Sync Log: http://172.20.1.251/synclog/$synclog\n";
+ }
+ elsif ($state eq "failed") {
+
+@@ -519,8 +519,8 @@
+ push (@error_msgs, @error_msg);
+ print SENDMAIL "\n @error_msgs\n";
+ print SENDMAIL "\n\nSee build log for full details: ";
+- print SENDMAIL "Build Log: http://172.20.1.120/build_log/$bldlog\n";
+- print SENDMAIL "Sync Log: http://172.20.1.120/synclog/$synclog\n";
++ print SENDMAIL "Build Log: http://172.20.1.251/build_log/$bldlog\n";
++ print SENDMAIL "Sync Log: http://172.20.1.251/synclog/$synclog\n";
+ print SENDMAIL "\nPlease fix the issue and resubmit the build request.";
+ }
+ close (SENDMAIL);
+
+==== //depot/autobuild/buildserver.pl#3 (xtext) ====
+
+@@ -10,6 +10,7 @@
+ my $syncdir = "/opt/LOG/synclog";
+ my $stage_dir = "/mars/UPLOAD/BUILD/AUTO_BUILD/";
+ my $stage_linkdir = '\\\\mars\\Remote\\UPLOAD\\BUILD\\AUTO_BUILD\\';
++my $db_stage_linkdir = '\\\\\\\\mars\\\\Remote\\\\UPLOAD\\\\BUILD\\\\AUTO_BUILD\\\\';
+ my $image_dir = "/opt/Build/IMAGES/";
+ my $script_dir = "/var/www/cgi-bin/build/BUILD_SCRIPTS/";
+ my $buildlog_dir = "/opt/LOG/BUILD_LOG/";
+@@ -282,6 +283,12 @@
+ my $alt_stage_dir = $prod_rel[0] . "/" . $rel;
+ my $stage_rel_link = $stage_linkdir . "$prod_rel[0]" . "\\" . "$prod_rel[1]" . "\\" . "$rel";
+ Build->build_status_mail($bld_usr,$rel,$log_name,"pass", $stage_rel_link, $alt_stage_dir);
++
++ my $db_stage_rel_link = $db_stage_linkdir . "$prod_rel[0]" . "\\\\" . "$prod_rel[1]" . "\\\\" . "$rel";
++ my $stage_int_sql = "UPDATE releases SET internal_stage=\'$db_stage_rel_link\'
++ where releases.release=\'$rel\'";
++ Build->run_sql_query($stage_int_sql, ";");
++
+ }
+ }
+ else {
+
|
|
From: <si...@us...> - 2008-08-29 10:49:07
|
User: sits
Date: 08/08/29 03:49:04
Modified: lib/Codestriker/Http/Method StaticResourcesMethod.pm
AddProjectMethod.pm UpdateTopicStateMethod.pm
CreateTopicMethod.pm ViewTopicTextMethod.pm
SearchTopicsMethod.pm SubmitSearchTopicsMethod.pm
DownloadMetricsMethod.pm AddCommentMethod.pm
ViewMetricsMethod.pm CreateProjectMethod.pm
ViewTopicPropertiesMethod.pm
ViewTopicCommentsMethod.pm
DownloadTopicTextMethod.pm AddTopicMethod.pm
ListProjectsMethod.pm EditProjectMethod.pm
ViewTopicMetricsMethod.pm CreateCommentMethod.pm
UpdateTopicPropertiesMethod.pm
UpdateProjectMethod.pm ViewTopicFileMethod.pm
ListTopicsMethod.pm
lib/Codestriker/Action SubmitEditTopicMetrics.pm
ViewTopicInfo.pm ViewTopicProperties.pm
CreateTopic.pm EditComment.pm
SubmitEditTopicProperties.pm
template/en/default editcomment.html.tmpl
createtopic.html.tmpl viewtopicinfo.html.tmpl
viewtopicproperties.html.tmpl
html codestriker.js
. codestriker.conf
lib/Codestriker/Http Dispatcher.pm UrlBuilder.pm Method.pm
Response.pm
lib Codestriker.pm
Added: lib/Codestriker/Http/Method UpdateTopicMetricsMethod.pm
t/Http/Method update-topic-metrics.t
Log:
More work on the nice URL - can now add comments.
Index: StaticResourcesMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/StaticResourcesMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StaticResourcesMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ StaticResourcesMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -35,7 +35,7 @@
if ($self->{cgi_style}) {
return $htmlurl;
} else {
- return $self->{url_prefix} . "/static";
+ return $self->{url_prefix} . "/html";
}
}
Index: AddProjectMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/AddProjectMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AddProjectMethod.pm 26 Aug 2008 22:18:51 -0000 1.1
+++ AddProjectMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -33,7 +33,7 @@
if ($self->{cgi_style} && defined $action && $action eq "submit_project") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/admin/projects/add}) {
+ } elsif ($path_info =~ m{^/admin/projects/add}) {
return 1;
} else {
return 0;
Index: UpdateTopicStateMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/UpdateTopicStateMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UpdateTopicStateMethod.pm 18 Aug 2008 22:11:05 -0000 1.1
+++ UpdateTopicStateMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -35,7 +35,7 @@
if ($self->{cgi_style} && defined $action && $action eq "change_topics_state") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/update}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/update}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid');
return 1;
Index: CreateTopicMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/CreateTopicMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CreateTopicMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ CreateTopicMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -32,10 +32,11 @@
my $action = $http_input->{query}->param('action');
my $path_info = $http_input->{query}->path_info();
+ print STDERR "Check path: $path_info\n";
if ($self->{cgi_style} && defined $action && $action eq "create") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/topics/create/}) {
+ } elsif ($path_info =~ m{^/topics/create}) {
$self->_extract_nice_parameters($http_input,
obsoletes => 'obsoletes');
return 1;
Index: ViewTopicTextMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicTextMethod.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ViewTopicTextMethod.pm 20 Aug 2008 00:43:33 -0000 1.3
+++ ViewTopicTextMethod.pm 29 Aug 2008 10:48:57 -0000 1.4
@@ -32,7 +32,7 @@
} else {
confess "Parameter projectid missing" unless defined $args{projectid};
return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/text" .
- (defined $args{fview} ? "/filenumber/$args{filenumber}" : "") .
+ (defined $args{fview} ? "/filenumber/$args{fview}" : "") .
(defined $args{mode} ? "/mode/$args{mode}" : "") .
(defined $args{filenumber} ? "#" . "$args{filenumber}|$args{line}|$args{new}" : "");
}
@@ -46,9 +46,9 @@
if ($self->{cgi_style} && defined $action && $action eq "view") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/text}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/text}) {
$self->_extract_nice_parameters($http_input,
- project => 'projectid', topic => 'topicid',
+ project => 'projectid', topic => 'topic',
filenumber => 'fview', mode => 'mode');
return 1;
} else {
Index: SearchTopicsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/SearchTopicsMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SearchTopicsMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ SearchTopicsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -33,7 +33,7 @@
if ($self->{cgi_style} && defined $action && $action eq "search") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/topics/search/}) {
+ } elsif ($path_info =~ m{^/topics/search/}) {
return 1;
} else {
return 0;
Index: SubmitSearchTopicsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/SubmitSearchTopicsMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SubmitSearchTopicsMethod.pm 15 Aug 2008 06:10:41 -0000 1.1
+++ SubmitSearchTopicsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -33,7 +33,7 @@
if ($self->{cgi_style} && defined $action && $action eq "submit_search") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/topics/submitsearch/}) {
+ } elsif ($path_info =~ m{^/topics/submitsearch/}) {
return 1;
} else {
return 0;
Index: DownloadMetricsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/DownloadMetricsMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DownloadMetricsMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ DownloadMetricsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -33,7 +33,7 @@
if ($self->{cgi_style} && defined $action && $action eq "metrics_download") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/metrics/download$}) {
+ } elsif ($path_info =~ m{^/metrics/download$}) {
return 1;
} else {
return 0;
Index: AddCommentMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/AddCommentMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AddCommentMethod.pm 18 Aug 2008 11:11:29 -0000 1.2
+++ AddCommentMethod.pm 29 Aug 2008 10:48:57 -0000 1.3
@@ -5,7 +5,7 @@
# This program is free software; you can redistribute it and modify it under
# the terms of the GPL.
-# Method for submitting a searching topic form.
+# Method for submitting a new comment.
package Codestriker::Http::Method::AddCommentMethod;
@@ -24,8 +24,8 @@
die "Parameter topicid missing" unless defined $args{topicid};
die "Parameter projectid missing" unless defined $args{projectid};
- return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/comment/" .
- "$args{filenumber}|$args{line}|$args{new}/add";
+ return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/comment" .
+ (defined $args{filenumber} && $args{filenumber} ne "" ? "/$args{filenumber}|$args{line}|$args{new}/add" : "");
}
}
@@ -37,13 +37,13 @@
if ($self->{cgi_style} && defined $action && $action eq "submit_comment") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/comment/(\d+)\|(\d+)\|(\d+)/add}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/comment/(\d+)\|(\d+)\|(\d+)/add}) {
+ $self->_extract_nice_parameters($http_input,
+ project => 'projectid', topic => 'topic',
+ anchor => 'anchor', context => 'context');
$http_input->{fn} = $1;
$http_input->{line} = $2;
$http_input->{new} = $3;
- $self->_extract_nice_parameters($http_input,
- project => 'projectid', topic => 'topicid',
- anchor => 'anchor', context => 'context');
return 1;
} else {
return 0;
Index: ViewMetricsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewMetricsMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ViewMetricsMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ ViewMetricsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -33,7 +33,7 @@
if ($self->{cgi_style} && defined $action && $action eq "metrics_report") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/metrics/view$}) {
+ } elsif ($path_info =~ m{^/metrics/view$}) {
return 1;
} else {
return 0;
Index: CreateProjectMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/CreateProjectMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CreateProjectMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ CreateProjectMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -33,7 +33,7 @@
if ($self->{cgi_style} && defined $action && $action eq "create_project") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/admin/projects/create$}) {
+ } elsif ($path_info =~ m{^/admin/projects/create$}) {
return 1;
} else {
return 0;
Index: ViewTopicPropertiesMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicPropertiesMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ViewTopicPropertiesMethod.pm 18 Aug 2008 11:19:59 -0000 1.2
+++ ViewTopicPropertiesMethod.pm 29 Aug 2008 10:48:57 -0000 1.3
@@ -36,9 +36,9 @@
if ($self->{cgi_style} && defined $action && $action eq "view_topic_properties") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/properties/view}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/properties/view}) {
$self->_extract_nice_parameters($http_input,
- project => 'projectid', topic => 'topicid');
+ project => 'projectid', topic => 'topic');
return 1;
} else {
return 0;
Index: ViewTopicCommentsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicCommentsMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ViewTopicCommentsMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ ViewTopicCommentsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -36,9 +36,9 @@
if ($self->{cgi_style} && defined $action && $action eq "list_comments") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/comments}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/comments}) {
$self->_extract_nice_parameters($http_input,
- project => 'projectid', topic => 'topicid');
+ project => 'projectid', topic => 'topic');
return 1;
} else {
return 0;
Index: DownloadTopicTextMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/DownloadTopicTextMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DownloadTopicTextMethod.pm 26 Aug 2008 22:18:51 -0000 1.1
+++ DownloadTopicTextMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -38,7 +38,7 @@
if ($self->{cgi_style} && defined $action && $action eq "download") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/download}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/download}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid', topic => 'topicid');
return 1;
Index: AddTopicMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/AddTopicMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AddTopicMethod.pm 17 Aug 2008 22:25:37 -0000 1.2
+++ AddTopicMethod.pm 29 Aug 2008 10:48:57 -0000 1.3
@@ -35,7 +35,7 @@
if ($self->{cgi_style} && defined $action && $action eq "submit_new_topic") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topics/add}) {
+ } elsif ($path_info =~ m{^/project/\d+/topics/add}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid');
return 1;
Index: ListProjectsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ListProjectsMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ListProjectsMethod.pm 26 Aug 2008 22:18:51 -0000 1.2
+++ ListProjectsMethod.pm 29 Aug 2008 10:48:57 -0000 1.3
@@ -33,7 +33,7 @@
if ($self->{cgi_style} && defined $action && $action eq "list_projects") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/admin/projects/list$}) {
+ } elsif ($path_info =~ m{^/admin/projects/list$}) {
return 1;
} else {
return 0;
Index: EditProjectMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/EditProjectMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EditProjectMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ EditProjectMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -33,7 +33,7 @@
if ($self->{cgi_style} && defined $action && $action eq "edit_project") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/admin/project/\d+/edit$}) {
+ } elsif ($path_info =~ m{^/admin/project/\d+/edit$}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid');
return 1;
Index: ViewTopicMetricsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicMetricsMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ViewTopicMetricsMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ ViewTopicMetricsMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -36,9 +36,9 @@
if ($self->{cgi_style} && defined $action && $action eq "viewinfo") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/metrics}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/metrics}) {
$self->_extract_nice_parameters($http_input,
- project => 'projectid', topic => 'topicid');
+ project => 'projectid', topic => 'topic');
return 1;
} else {
return 0;
Index: CreateCommentMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/CreateCommentMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CreateCommentMethod.pm 20 Aug 2008 00:43:33 -0000 1.2
+++ CreateCommentMethod.pm 29 Aug 2008 10:48:57 -0000 1.3
@@ -22,14 +22,15 @@
confess "Parameter topicid missing" unless defined $args{topicid};
if ($self->{cgi_style}) {
- return $self->{url_prefix} . "?action=edit&fn=$args{filenumber}&line=$args{line}&new=$args{new}&topic=$args{topicid}" .
+ return $self->{url_prefix} . "?action=edit&topic=$args{topicid}" .
+ (defined $args{filenumber} && $args{filenumber} ne "" . "&fn=$args{filenumber}&line=$args{line}&new=$args{new}") .
(defined $args{anchor} ? "&a=$args{anchor}" : "") .
(defined $args{context} ? "&context=$args{context}" : "");
} else {
confess "Parameter projectid missing" unless defined $args{projectid};
return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/comment/" .
- "$args{filenumber}|$args{line}|$args{new}/create" .
- (defined $args{anchor} ? "/anchor/$args{anchor}" : "") .
+ (defined $args{filenumber} && $args{filenumber} ne "" ? "$args{filenumber}|$args{line}|$args{new}/create" : "") .
+ (defined $args{anchor} && $args{anchor} ne '' ? "/anchor/$args{anchor}" : "") .
(defined $args{context} ? "/context/$args{context}" : "");
}
}
@@ -42,13 +43,13 @@
if ($self->{cgi_style} && defined $action && $action eq "edit") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/comment/(\d+)\|(\d+)\|(\d+)/create}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/comment/(\d+)\|(\d+)\|(\d+)/create}) {
+ $self->_extract_nice_parameters($http_input,
+ project => 'projectid', topic => 'topic',
+ anchor => 'anchor', context => 'context');
$http_input->{fn} = $1;
$http_input->{line} = $2;
$http_input->{new} = $3;
- $self->_extract_nice_parameters($http_input,
- project => 'projectid', topic => 'topicid',
- anchor => 'anchor', context => 'context');
return 1;
} else {
return 0;
Index: UpdateTopicPropertiesMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/UpdateTopicPropertiesMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UpdateTopicPropertiesMethod.pm 18 Aug 2008 11:19:59 -0000 1.1
+++ UpdateTopicPropertiesMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -36,7 +36,7 @@
if ($self->{cgi_style} && defined $action && $action eq "edit_topic_properties") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/properties}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/properties}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid', topic => 'topicid');
return 1;
Index: UpdateProjectMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/UpdateProjectMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UpdateProjectMethod.pm 27 Aug 2008 08:43:10 -0000 1.1
+++ UpdateProjectMethod.pm 29 Aug 2008 10:48:57 -0000 1.2
@@ -33,7 +33,7 @@
if ($self->{cgi_style} && defined $action && $action eq "submit_editproject") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/admin/project/\d+/update$}) {
+ } elsif ($path_info =~ m{^/admin/project/\d+/update$}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid');
return 1;
Index: ViewTopicFileMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicFileMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ViewTopicFileMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ ViewTopicFileMethod.pm 29 Aug 2008 10:48:58 -0000 1.2
@@ -41,7 +41,7 @@
if ($self->{cgi_style} && defined $action && $action eq "view_file") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/file/\d+}) {
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/file/\d+}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid', topic => 'topicid',
file => 'fn');
Index: ListTopicsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ListTopicsMethod.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ListTopicsMethod.pm 15 Aug 2008 06:30:39 -0000 1.3
+++ ListTopicsMethod.pm 29 Aug 2008 10:48:58 -0000 1.4
@@ -66,8 +66,8 @@
($action eq "list_topics" || $action eq "list_topics_rss")) {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/feed/topics/list} ||
- $path_info =~ m{^$self->{url_prefix}/topics/list}) {
+ } elsif ($path_info =~ m{^/feed/topics/list} ||
+ $path_info =~ m{^/topics/list}) {
$self->_extract_nice_parameters($http_input,
author => 'sauthor', reviewer => 'sreviewer',
cc => 'scc', bugid => 'sbugid', text => 'stext',
Index: UpdateTopicMetricsMethod.pm
===================================================================
RCS file: UpdateTopicMetricsMethod.pm
diff -N UpdateTopicMetricsMethod.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ UpdateTopicMetricsMethod.pm 29 Aug 2008 10:48:57 -0000 1.1
@@ -0,0 +1,54 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
+# si...@us...
+#
+# This program is free software; you can redistribute it and modify it under
+# the terms of the GPL.
+
+# Method for updating the topic metrics.
+
+package Codestriker::Http::Method::UpdateTopicMetricsMethod;
+
+use strict;
+use Carp;
+use Codestriker::Http::Method;
+
+@Codestriker::Http::Method::UpdateTopicMetricsMethod::ISA = ("Codestriker::Http::Method");
+
+# Generate a URL for this method.
+sub url() {
+ my ($self, %args) = @_;
+
+ if ($self->{cgi_style}) {
+ return $self->{url_prefix} . "?action=edit_topic_metrics&topic=$args{topicid}";
+ } else {
+ confess "Parameter topicid missing" unless defined $args{topicid};
+ confess "Parameter projectid missing" unless defined $args{projectid};
+ return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/metrics/update";
+ }
+}
+
+sub extract_parameters {
+ my ($self, $http_input) = @_;
+
+ my $action = $http_input->{query}->param('action');
+ my $path_info = $http_input->{query}->path_info();
+ if ($self->{cgi_style} && defined $action && $action eq "edit_topic_metrics") {
+ $http_input->extract_cgi_parameters();
+ return 1;
+ } elsif ($path_info =~ m{^/project/\d+/topic/\d+/properties}) {
+ $self->_extract_nice_parameters($http_input,
+ project => 'projectid', topic => 'topicid');
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub execute {
+ my ($self, $http_input, $http_output) = @_;
+
+ Codestriker::Action::SubmitEditTopicMetrics->process($http_input, $http_output);
+}
+
+1;
Index: SubmitEditTopicMetrics.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitEditTopicMetrics.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SubmitEditTopicMetrics.pm 29 Jun 2004 02:51:41 -0000 1.3
+++ SubmitEditTopicMetrics.pm 29 Aug 2008 10:48:59 -0000 1.4
@@ -5,7 +5,7 @@
# This program is free software; you can redistribute it and modify it under
# the terms of the GPL.
-# Action object for handling the submission of changing the properties of a
+# Action object for handling the submission of changing the metrics of a
# topic.
package Codestriker::Action::SubmitEditTopicMetrics;
Index: ViewTopicInfo.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopicInfo.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ViewTopicInfo.pm 15 Aug 2008 06:10:42 -0000 1.16
+++ ViewTopicInfo.pm 29 Aug 2008 10:48:59 -0000 1.17
@@ -130,6 +130,8 @@
$vars->{'view_comments_url'} = $url_builder->view_comments_url(topicid => $topicid,
projectid => $topic->{project_id});
$vars->{'list_projects_url'} = $url_builder->list_projects_url();
+ $vars->{'action_url'} = $url_builder->update_topicinfo_url(topicid => $topicid,
+ projectid => $topic->{project_id});
# Display the "update" message if the topic state has been changed.
$vars->{'updated'} = $http_input->get('updated');
Index: ViewTopicProperties.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopicProperties.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ViewTopicProperties.pm 15 Aug 2008 06:10:41 -0000 1.19
+++ ViewTopicProperties.pm 29 Aug 2008 10:48:59 -0000 1.20
@@ -60,6 +60,8 @@
# Obtain a new URL builder object.
my $url_builder = Codestriker::Http::UrlBuilder->new($query);
+ $vars->{'action_url'} = $url_builder->update_topic_properties_url(topicid => $topicid,
+ projectid => $topic->{project_id});
Codestriker::Action::ViewTopic::ProcessTopicHeader($vars, $topic,
$url_builder);
Index: CreateTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/CreateTopic.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- CreateTopic.pm 19 Aug 2008 10:50:17 -0000 1.33
+++ CreateTopic.pm 29 Aug 2008 10:48:59 -0000 1.34
@@ -43,7 +43,7 @@
$vars->{'search_url'} = $url_builder->search_url();
# TODO: fix this once create topic is only done within context of a project.
- $vars->{'add_topic_url'} = $url_builder->add_topic_url(projectid => 0);
+ $vars->{'action_url'} = $url_builder->add_topic_url(projectid => 0);
# Retrieve the email, reviewers, cc, repository and projectid from
# the cookie.
Index: EditComment.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/EditComment.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- EditComment.pm 10 Aug 2008 12:18:43 -0000 1.18
+++ EditComment.pm 29 Aug 2008 10:48:59 -0000 1.19
@@ -63,22 +63,25 @@
new => $new, line => $line);
my $view_comments_url = $url_builder->view_comments_url(topicid => $topicid,
projectid => $topic->{project_id});
+ my $add_comment_url = $url_builder->add_comment_url(topicid => $topicid, projectid => $topic->{project_id},
+ filenumber => $fn, new => $new, line => $line);
$vars->{'view_topic_url'} = $view_topic_url;
$vars->{'view_comments_url'} = $view_comments_url;
$vars->{'doc_url'} = $url_builder->doc_url();
-
+ $vars->{'action_url'} = $add_comment_url;
+
# Retrieve the context in question. Allow the user to increase it
# or decrease it appropriately.
my $inc_context = ($context <= 0) ? 1 : $context*2;
my $dec_context = ($context <= 0) ? 0 : int($context/2);
my $inc_context_url =
$url_builder->edit_url(filenumber => $fn, line => $line, new => $new,
- topicid => $topicid, projectid => $topic->{projectid},
+ topicid => $topicid, projectid => $topic->{project_id},
context => $inc_context, anchor => $anchor);
my $dec_context_url =
$url_builder->edit_url(filenumber => $fn, line => $line, new => $new,
- topicid => $topicid, projectid => $topic->{projectid},
+ topicid => $topicid, projectid => $topic->{project_id},
context => $dec_context, anchor => $anchor);
$vars->{'inc_context_url'} = $inc_context_url;
$vars->{'dec_context_url'} = $dec_context_url;
Index: SubmitEditTopicProperties.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitEditTopicProperties.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- SubmitEditTopicProperties.pm 11 Jun 2006 07:54:01 -0000 1.13
+++ SubmitEditTopicProperties.pm 29 Aug 2008 10:48:59 -0000 1.14
@@ -43,6 +43,7 @@
# Retrieve the current state of the topic.
my $topic = Codestriker::Model::Topic->new($topicid);
+ my $url_builder = Codestriker::Http::UrlBuilder->new($query);
my $feedback = "";
my $rc = $Codestriker::OK;
@@ -103,7 +104,6 @@
elsif ($topic_state eq "Obsoleted") {
# Redirect to the create topic screen with this topic being
# the one to obsolete.
- my $url_builder = Codestriker::Http::UrlBuilder->new($query);
my $create_topic_url =
$url_builder->create_topic_url("$topicid,$version");
print $query->redirect(-URI=>$create_topic_url);
@@ -174,8 +174,8 @@
}
} else {
# Go to the view topic properties screen.
- Codestriker::Action::ViewTopicProperties->process($http_input,
- $http_response);
+ Codestriker::Action::ViewTopicProperties->process($http_input,
+ $http_response);
}
}
Index: editcomment.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/editcomment.html.tmpl,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- editcomment.html.tmpl 8 Aug 2008 07:02:08 -0000 1.27
+++ editcomment.html.tmpl 29 Aug 2008 10:48:59 -0000 1.28
@@ -129,7 +129,8 @@
<P>
-<FORM NAME="add_comment" METHOD="POST" onSubmit="return verify();" ENCTYPE="application/x-www-form-urlencoded">
+<FORM NAME="add_comment" METHOD="POST" onSubmit="return verify();" ENCTYPE="application/x-www-form-urlencoded"
+ ACTION="[% action_url %]">
<INPUT TYPE="hidden" NAME="action" VALUE="submit_comment">
<INPUT TYPE="hidden" NAME="line" VALUE="[% line %]">
<INPUT TYPE="hidden" NAME="topic" VALUE="[% topic %]">
Index: createtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/createtopic.html.tmpl,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- createtopic.html.tmpl 19 Aug 2008 10:50:17 -0000 1.56
+++ createtopic.html.tmpl 29 Aug 2008 10:49:00 -0000 1.57
@@ -20,7 +20,7 @@
<p>
[% END %]
-<FORM METHOD="post" ENCTYPE="multipart/form-data" ACCEPT-CHARSET="UTF-8">
+<FORM METHOD="post" ENCTYPE="multipart/form-data" ACCEPT-CHARSET="UTF-8" ACTION="[% action_url %]">
<INPUT TYPE="hidden" NAME="action" VALUE="submit_new_topic" />
<INPUT TYPE="hidden" NAME="obsoletes" VALUE="[% obsoletes %]" />
Index: viewtopicinfo.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopicinfo.html.tmpl,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- viewtopicinfo.html.tmpl 8 Aug 2008 07:02:08 -0000 1.25
+++ viewtopicinfo.html.tmpl 29 Aug 2008 10:49:00 -0000 1.26
@@ -8,7 +8,7 @@
[%# Create a form to allow the topic's metrics to be changed #%]
[% SET metric_input_exists = 0 %]
-<form method="post" enctype="multipart/form-data" name="form" accept-charset="UTF-8">
+<form method="post" enctype="multipart/form-data" name="form" accept-charset="UTF-8" action="[% action_url %]">
<input type="hidden" name="action" value="edit_topic_metrics" />
<input type="hidden" name="topic" value="[% topic %]" />
Index: viewtopicproperties.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopicproperties.html.tmpl,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- viewtopicproperties.html.tmpl 19 Aug 2008 10:50:17 -0000 1.29
+++ viewtopicproperties.html.tmpl 29 Aug 2008 10:49:00 -0000 1.30
@@ -33,7 +33,7 @@
</script>
[%# Create a form to allow the topic's properties to be changed #%]
-<form method="post" name="form" enctype="multipart/form-data" accept-charset="UTF-8">
+<form method="post" name="form" enctype="multipart/form-data" accept-charset="UTF-8" action="[% action_url %]">
<input type="hidden" name="action" value="edit_topic_properties" />
<input type="hidden" name="topic" value="[% topicid %]" />
Index: codestriker.js
===================================================================
RCS file: /cvsroot/codestriker/codestriker/html/codestriker.js,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- codestriker.js 15 Jun 2006 07:12:37 -0000 1.16
+++ codestriker.js 29 Aug 2008 10:49:00 -0000 1.17
@@ -94,9 +94,8 @@
function add_comment_html(file, line, new_value)
{
// Get the location of the codestriker URL.
- var l = top.location;
- var url = l.protocol + '//' + l.host + l.pathname;
-
+ var url = cs_add_comment_url + '/' + file + '|' + line + '|' + new_value + '/add';
+
// Create the hidden error span, and the initial form, with the
// appropriate hidden fields.
var html = '<html><head>' +
@@ -109,7 +108,7 @@
'<form name="add_comment" method="POST" ' +
'action="' + url + '" ' +
'onSubmit="return top.verify(document.add_comment, getElt(\'statusField\'));" ' +
- 'enctype="application/x-www-form-urlencoded">\n' +
+ 'enctype="application/x-www-form-urlencoded" action="' + url + '">\n' +
'<input type="hidden" name="action" value="submit_comment">\n' +
'<input type="hidden" name="line" value="' + line + '">\n' +
'<input type="hidden" name="topic" value="' + cs_topicid + '">\n' +
@@ -265,6 +264,9 @@
// If we reached here, then all metrics have been set. Send the
// request as an XMLHttpRequest, and return false so the browser
// does nothing else.
+ var url = cs_add_comment_url + '/' +
+ comment_form.fn.value + '|' + comment_form.line.value + '|' +
+ comment_form.newval.value + '/add';
var params = 'action=submit_comment';
params += '&line=' + encodeURIComponent(comment_form.line.value);
params += '&topic=' + encodeURIComponent(comment_form.topic.value);
@@ -284,7 +286,7 @@
setStatusText('Submitting comment...');
- postXMLDoc(params);
+ postXMLDoc(url, params);
return false;
}
@@ -348,12 +350,8 @@
}
// Function for posting to Codestriker using the XMLHttpRequest object.
-function postXMLDoc(params)
+function postXMLDoc(url, params)
{
- // Generate the basic Codestriker URL.
- var l = top.location;
- var url = l.protocol + '//' + l.host + l.pathname;
-
// Check for Mozilla/Safari.
if (window.XMLHttpRequest) {
cs_request = new XMLHttpRequest();
Index: codestriker.conf
===================================================================
RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- codestriker.conf 18 Aug 2008 22:11:06 -0000 1.101
+++ codestriker.conf 29 Aug 2008 10:49:01 -0000 1.102
@@ -100,6 +100,10 @@
#$codestriker_css = 'codestriker.css';
#$codestriker_css = 'codestriker-alternative.css';
+# Indicate what style URLs to support. The default is CGI-style URLs. Set
+# this value to 0 for "nicer" URLs.
+$cgi_style = 0;
+
# Valid repositories which may be selected at the create topic screen.
# The order shown here is the order presented in the option list. Most
# deployments will only require a single repository to be specified.
Index: update-topic-metrics.t
===================================================================
RCS file: update-topic-metrics.t
diff -N update-topic-metrics.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ update-topic-metrics.t 29 Aug 2008 10:49:01 -0000 1.1
@@ -0,0 +1,40 @@
+# Tests for the UpdateTopicMetrics method.
+
+use strict;
+use Test::More tests => 4;
+
+use lib '../../../lib';
+use Test::MockObject;
+use Codestriker;
+use Codestriker::Http::Method::UpdateTopicMetricsMethod;
+
+# Create a CGI mock object for these tests.
+my $mock_query = Test::MockObject->new();
+$mock_query->mock('url',
+ sub { 'http://localhost.localdomain/codestriker/codestriker.pl' } );
+
+# Create two method objects to test each URL scheme.
+my $url_cgi = Codestriker::Http::Method::UpdateTopicMetricsMethod->new($mock_query, 1);
+my $url_nice = Codestriker::Http::Method::UpdateTopicMetricsMethod->new($mock_query, 0);
+
+is($url_cgi->url(topicid => 1234, projectid => 10),
+ $mock_query->url() . '?action=submit_edit_topic_metrics&topic=1234',
+ "Update topic metrics URL CGI syntax");
+
+is($url_nice->url(topicid => 1234, projectid => 10),
+ $mock_query->url() . '/project/10/topic/1234/metrics/update',
+ "Update topic metrics URL nice syntax");
+
+# Check that the parameters extracted correctly.
+my $mock_http_input = Test::MockObject->new();
+$mock_http_input->{query} = $mock_query;
+$mock_query->mock('path_info',
+ sub {
+ return $mock_query->url() . '/project/10/topic/1234/metrics/update';
+ });
+$mock_query->mock('param', sub { return undef; });
+$url_nice->extract_parameters($mock_http_input);
+is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
+is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+
+
\ No newline at end of file
Index: Dispatcher.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Dispatcher.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Dispatcher.pm 27 Aug 2008 08:43:10 -0000 1.7
+++ Dispatcher.pm 29 Aug 2008 10:49:02 -0000 1.8
@@ -22,6 +22,7 @@
use Codestriker::Http::Method::ViewTopicPropertiesMethod;
use Codestriker::Http::Method::DownloadTopicTextMethod;
use Codestriker::Http::Method::UpdateTopicPropertiesMethod;
+use Codestriker::Http::Method::UpdateTopicMetricsMethod;
use Codestriker::Http::Method::AddCommentMethod;
use Codestriker::Http::Method::CreateCommentMethod;
use Codestriker::Http::Method::AddTopicMethod;
@@ -55,6 +56,7 @@
push @methods, Codestriker::Http::Method::ViewTopicMetricsMethod->new($query);
push @methods, Codestriker::Http::Method::ViewTopicPropertiesMethod->new($query);
push @methods, Codestriker::Http::Method::UpdateTopicPropertiesMethod->new($query);
+ push @methods, Codestriker::Http::Method::UpdateTopicMetricsMethod->new($query);
push @methods, $self->{list_topics_method};
push @methods, Codestriker::Http::Method::CreateCommentMethod->new($query);
push @methods, Codestriker::Http::Method::AddCommentMethod->new($query);
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- UrlBuilder.pm 26 Aug 2008 22:18:50 -0000 1.44
+++ UrlBuilder.pm 29 Aug 2008 10:49:02 -0000 1.45
@@ -50,15 +50,16 @@
use Codestriker::Http::Method::SubmitSearchTopicsMethod;
use Codestriker::Http::Method::StaticResourcesMethod;
use Codestriker::Http::Method::ViewMetricsMethod;
+use Codestriker::Http::Method::UpdateTopicPropertiesMethod;
+use Codestriker::Http::Method::UpdateTopicMetricsMethod;
# Constructor for this class.
sub new {
- my ($type, $query, $cgi_style) = @_;
+ my ($type, $query) = @_;
my $self = {};
$self->{query} = $query;
- $self->{cgi_style} = 1;
- $self->{cgi_style} = $cgi_style if defined $cgi_style;
+ $self->{cgi_style} = defined $Codestriker::cgi_style ? $Codestriker::cgi_style : 1;
# Determine what prefix is required when using relative URLs.
# Unfortunately, Netcsape 4.x does things differently to everyone
@@ -191,18 +192,42 @@
return Codestriker::Http::Method::ViewTopicCommentsMethod->new($self->{query})->url(%args);
}
+# Create the URL for updating comments.
+sub update_comments_url {
+ my ($self, %args) = @_;
+# return Codestriker::Http::Method::UpdateTopicCommentsMethod->new($self->{query})->url(%args);
+}
+
# Create the URL for viewing the topic properties.
sub view_topic_properties_url {
my ($self, %args) = @_;
return Codestriker::Http::Method::ViewTopicPropertiesMethod->new($self->{query})->url(%args);
}
+# Create the URL for updating the topic properties.
+sub update_topic_properties_url {
+ my ($self, %args) = @_;
+ return Codestriker::Http::Method::UpdateTopicPropertiesMethod->new($self->{query})->url(%args);
+}
+
# Create the URL for viewing the topic metrics.
sub view_topicinfo_url {
my ($self, %args) = @_;
return Codestriker::Http::Method::ViewTopicMetricsMethod->new($self->{query})->url(%args);
}
+# Create the URL for updating the topic metrics.
+sub update_topicinfo_url {
+ my ($self, %args) = @_;
+ return Codestriker::Http::Method::UpdateTopicMetricsMethod->new($self->{query})->url(%args);
+}
+
+# Create the URL for adding new comments.
+sub add_comment_url {
+ my ($self, %args) = @_;
+ return Codestriker::Http::Method::AddCommentMethod->new($self->{query})->url(%args);
+}
+
sub metric_report_url {
my ($self) = @_;
return Codestriker::Http::Method::ViewMetricsMethod->new($self->{query})->url();
Index: Method.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Method.pm 13 Aug 2008 11:30:47 -0000 1.3
+++ Method.pm 29 Aug 2008 10:49:02 -0000 1.4
@@ -19,7 +19,11 @@
my $self = {};
$self->{query} = $query;
- $self->{cgi_style} = defined $cgi_style ? $cgi_style : 1;
+ if (defined $cgi_style) {
+ $self->{cgi_style} = $cgi_style;
+ } else {
+ $self->{cgi_style} = defined $Codestriker::cgi_style ? $Codestriker::cgi_style : 1;
+ }
# Determine what prefix is required when using relative URLs.
# Unfortunately, Netcsape 4.x does things differently to everyone
@@ -58,6 +62,8 @@
# Utility method for extracting the specified parameter from a URL if it exists.
sub _extract_nice_parameters {
my ($self, $http_input, %parameters) = @_;
+
+ $http_input->extract_cgi_parameters();
my $path_info = $http_input->{query}->path_info();
foreach my $nice_parameter (keys %parameters) {
Index: Response.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Response.pm,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- Response.pm 18 Aug 2008 11:11:28 -0000 1.48
+++ Response.pm 29 Aug 2008 10:49:02 -0000 1.49
@@ -12,6 +12,7 @@
use strict;
use Codestriker::Http::Cookie;
+use Codestriker::Http::UrlBuilder;
use HTML::Entities ();
# Constructor for this class. Indicate that the response header hasn't been
@@ -230,7 +231,11 @@
} else {
# Use the default CSS file.
$codestriker_css = $query->url();
- $codestriker_css =~ s#/[^/]+?/codestriker\.pl#/codestrikerhtml/codestriker.css#;
+ if (defined $Codestriker::cgi_style && $Codestriker::cgi_style) {
+ $codestriker_css =~ s#/[^/]+?/codestriker\.pl#/codestrikerhtml/codestriker.css#;
+ } else {
+ $codestriker_css = $query->url() . "html/codestriker.css";
+ }
}
@@ -261,6 +266,7 @@
print " var cs_load_anchor = '$load_anchor';\n";
print " var cs_reload = $reload;\n";
print " var cs_topicid = $topic->{topicid};\n" if defined $topic;
+ print " var cs_projectid = $topic->{project_id};\n" if defined $topic;
print " var cs_email = '$email';\n" if defined $email;
print " var cs_css = '$codestriker_css';\n";
print " var cs_xbdhtml_js = '$xbdhtml_js';\n";
@@ -284,6 +290,13 @@
}
$i++;
}
+
+ # Output the URL to post to for adding comments.
+ if (defined $topic) {
+ my $url_builder = Codestriker::Http::UrlBuilder->new($self->{query});
+ print " var cs_add_comment_url = '" .
+ $url_builder->add_comment_url(topicid => $topic->{topicid}, projectid => $topic->{project_id}) . "';\n";
+ }
# Check that the external javascript files were loaded, and if not
# output an error message. This is usually due to a
Index: Codestriker.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker.pm,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- Codestriker.pm 11 Aug 2008 03:58:11 -0000 1.110
+++ Codestriker.pm 29 Aug 2008 10:49:03 -0000 1.111
@@ -32,7 +32,7 @@
$metric_config $tmpdir @metric_schema $comment_state_metrics
$project_states $rss_enabled
$repository_name_map $repository_url_map
- @valid_repository_names $topic_text_encoding
+ @valid_repository_names $topic_text_encoding $cgi_style
);
# Version of Codestriker.
|
|
From: <si...@us...> - 2008-08-27 09:51:49
|
User: sits
Date: 08/08/27 02:51:45
Modified: doc codestriker.sgml
. CHANGELOG
Log:
* Updated install.pl to support a separate Apache virtual host per
Codestriker project as suggested by dm...@us....
Manual has been updated with the appropriate instructions.
Index: codestriker.sgml
===================================================================
RCS file: /cvsroot/codestriker/codestriker/doc/codestriker.sgml,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- codestriker.sgml 11 Aug 2008 03:58:11 -0000 1.70
+++ codestriker.sgml 27 Aug 2008 09:51:44 -0000 1.71
@@ -1331,6 +1331,41 @@
not enable this mode.
</para>
</sect2>
+
+ <sect2>
+ <title>Virtual Host per Project Configuration</title>
+ <para>
+ It is possible to create a separate virtual host / database per
+ Codestriker project using the following steps:
+ <itemizedlist>
+ <listitem>
+ <para>Copy the distribution files to a common location across configs.
+ For example, <filename>/usr/local/codestriker</filename>.</para>
+ </listitem>
+ <listitem>
+ <para>Create a unique directory for each virtual host configured in Apache.
+ For example, <filename>/usr/local/apache2/htdocs/CONFIG1/codestriker</filename>.</para>
+ </listitem>
+ <listitem>
+ <para>Create a <filename>codestriker.conf</filename> file in the virtual host directory.</para>
+ </listitem>
+ <listitem>
+ <para>Create a <filename>cgi-bin</filename> sub-directory in the virtual host directory.</para>
+ </listitem>
+ <listitem>
+ <para>Create symbolic links from common to config specific directory. For
+ example, <command>ln -s /usr/local/codestriker/* /usr/local/apache2/htdocs/CONFIG1/codestriker</command></para>
+ </listitem>
+ <listitem>
+ <para>Run install script in the virtual host directory. For example, <command>./bin/install.pl</command></para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Updates just require updating the single source install and running <command>./bin/install.pl</command>
+ for each virtual host directory.
+ </para>
+ </sect2>
</sect1>
<sect1 id="IIS-configuration">
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.261
retrieving revision 1.262
diff -u -r1.261 -r1.262
--- CHANGELOG 19 Aug 2008 10:50:15 -0000 1.261
+++ CHANGELOG 27 Aug 2008 09:51:45 -0000 1.262
@@ -19,7 +19,11 @@
state can be set. By default, this is set to "Open", however in
situations where a review has already been performed but needs to
be recorded, or a topic is automatically created from a post-commit
- script from an SCM, sometimes another initial state is desirable.
+ script from an SCM, sometimes another initial state is desirable.
+
+* Updated install.pl to support a separate Apache virtual host per
+ Codestriker project as suggested by dm...@us....
+ Manual has been updated with the appropriate instructions.
Version 1.9.6
|
|
From: <si...@us...> - 2008-08-27 09:19:04
|
User: sits
Date: 08/08/27 02:18:59
Modified: lib/Codestriker/Action SubmitNewTopic.pm
Log:
In the case of a user input error - make sure the topic state dropdown is properly initialised.
Index: SubmitNewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitNewTopic.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- SubmitNewTopic.pm 27 Aug 2008 09:11:36 -0000 1.38
+++ SubmitNewTopic.pm 27 Aug 2008 09:18:59 -0000 1.39
@@ -111,6 +111,7 @@
$error_vars->{'topic_description'} = $topic_description;
$error_vars->{'topic_title'} = $topic_title;
$error_vars->{'bug_ids'} = $bug_ids;
+ $error_vars->{'states'} = \@Codestriker::topic_states;
$error_vars->{'default_repository'} = $repository_name;
$error_vars->{'repositories'} = \@Codestriker::valid_repository_names;
$error_vars->{'start_tag'} = $start_tag;
|
|
From: <si...@us...> - 2008-08-27 09:16:21
|
User: sits
Date: 08/08/27 02:16:20
Modified: bin log_accum.pl
Log:
Updated to also not send the create topic email.
Index: log_accum.pl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/log_accum.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- log_accum.pl 8 Aug 2008 05:41:41 -0000 1.7
+++ log_accum.pl 27 Aug 2008 09:16:20 -0000 1.8
@@ -349,6 +349,7 @@
email => $MAIL_FROM,
reviewers => $CODESTRIKER_REVIEWERS,
cc => $CODESTRIKER_CC,
+ email_event => 0,
topic_text => join("\n", @diff)
});
}
|
|
From: <si...@us...> - 2008-08-27 09:11:38
|
User: sits
Date: 08/08/27 02:11:37
Modified: lib/Codestriker/Http Input.pm
lib/Codestriker/Action SubmitNewTopic.pm
bin commit-email-codestriker.pl CodestrikerClient.pm
lib/Codestriker/TopicListeners Email.pm
Log:
Provided the ability to specify when creating a topic not to send out an email. Used primarily with post-commit scripts, which already send an email out with the Codestriker URL.
Index: Input.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Input.pm,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- Input.pm 19 Aug 2008 10:50:16 -0000 1.49
+++ Input.pm 27 Aug 2008 09:11:36 -0000 1.50
@@ -105,6 +105,7 @@
my @selected_comments = $query->param('selected_comments');
$self->{selected_comments} = \@selected_comments;
$self->{default_to_head} = $query->param('default_to_head');
+ $self->{email_event} = $query->param('email_event');
# Set any missing parameters from the cookie.
my %cookie = Codestriker::Http::Cookie->get($query);
@@ -126,6 +127,7 @@
$self->{format} = "html" if ! defined $self->{format};
$self->{obsoletes} = "" if ! defined $self->{obsoletes};
$self->{default_to_head} = 0 if ! defined $self->{default_to_head};
+ $self->{email_event} = 1 if ! defined $self->{email_event};
my @topic_metrics = $query->param('topic_metric');
$self->{topic_metric} = \@topic_metrics;
Index: SubmitNewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitNewTopic.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- SubmitNewTopic.pm 19 Aug 2008 10:50:17 -0000 1.37
+++ SubmitNewTopic.pm 27 Aug 2008 09:11:36 -0000 1.38
@@ -46,6 +46,7 @@
my $obsoletes = $http_input->get('obsoletes');
my $default_to_head = $http_input->get('default_to_head');
my $topic_state = $http_input->get('topic_state');
+ my $email_event = $http_input->get('email_event');
my $feedback = "";
my $topic_text = "";
@@ -351,6 +352,7 @@
# Tell all of the topic listener classes that a topic has
# just been created.
+ $topic->{email_event} = $email_event;
$feedback = Codestriker::TopicListeners::Manager::topic_create($topic);
# Obtain a URL builder object and determine the URL to the topic.
Index: commit-email-codestriker.pl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/commit-email-codestriker.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- commit-email-codestriker.pl 22 Aug 2008 01:41:31 -0000 1.2
+++ commit-email-codestriker.pl 27 Aug 2008 09:11:36 -0000 1.3
@@ -399,6 +399,7 @@
reviewers => $current_project->{codestriker_reviewers},
cc => $current_project->{codestriker_cc},
topic_state => $current_project->{codestriker_state},
+ email_event => 0,
topic_text => join("\n", @difflines)
});
}
Index: CodestrikerClient.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/CodestrikerClient.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- CodestrikerClient.pm 20 Aug 2008 00:43:34 -0000 1.6
+++ CodestrikerClient.pm 27 Aug 2008 09:11:36 -0000 1.7
@@ -18,6 +18,7 @@
# bug_ids => '1',
# email => 'sits',
# reviewers => 'root',
+# email_event => 0,
# topic_text => "Here is some text\nHere is some\n\nMore and more...\n"});
package CodestrikerClient;
@@ -58,6 +59,7 @@
reviewers => $params->{reviewers},
cc => $params->{cc},
topic_state => $params->{topic_state},
+ email_event => $params->{email_event},
topic_file => [$tempfile_filename]];
my $response =
$ua->request(HTTP::Request::Common::POST($self->{url},
Index: Email.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/Email.pm,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- Email.pm 18 Aug 2008 11:11:36 -0000 1.34
+++ Email.pm 27 Aug 2008 09:11:36 -0000 1.35
@@ -38,6 +38,11 @@
sub topic_create($$) {
my ($self, $topic) = @_;
+ # Check if this action doesn't need to be logged.
+ if (defined $topic->{email_event} && ! $topic->{email_event}) {
+ return '';
+ }
+
# Send an email to the document author and all contributors with the
# relevant information. The person who wrote the comment is indicated
# in the "From" field, and is BCCed the email so they retain a copy.
@@ -101,6 +106,11 @@
sub topic_changed($$$$) {
my ($self, $user_that_made_the_change, $topic_orig, $topic) = @_;
+ # Check if this action doesn't need to be logged.
+ if (defined $topic->{email_event} && $topic->{email_event} == 0) {
+ return '';
+ }
+
# Not all changes in the topic changes needs to be sent out to everybody
# who is working on the topic. The policy of this function is that
# the following changes will cause an email to be sent. Otherwise,
@@ -191,6 +201,11 @@
sub send_topic_changed_email {
my ($self, $user_that_made_the_change, $topic_orig, $topic,@to_list) = @_;
+ # Check if this action doesn't need to be logged.
+ if (defined $topic->{email_event} && $topic->{email_event} == 0) {
+ return '';
+ }
+
my $changes = "";
# Check for author change.
@@ -323,6 +338,11 @@
sub comment_create($$$) {
my ($self, $topic, $comment) = @_;
+ # Check if this action doesn't need to be logged.
+ if (defined $topic->{email_event} && $topic->{email_event} == 0) {
+ return '';
+ }
+
my $query = new CGI;
my $url_builder = Codestriker::Http::UrlBuilder->new($query);
|
|
From: <si...@us...> - 2008-08-27 08:50:49
|
User: sits
Date: 08/08/27 01:43:10
Modified: t/Http/Method view-topic-text.t edit-project.t
lib/Codestriker/Http Dispatcher.pm
Added: t/Http/Method update-project.t
lib/Codestriker/Http/Method UpdateProjectMethod.pm
Log:
Last method that needed implementing - update project.
Index: view-topic-text.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/view-topic-text.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- view-topic-text.t 10 Aug 2008 12:18:42 -0000 1.1
+++ view-topic-text.t 27 Aug 2008 08:43:10 -0000 1.2
@@ -1,7 +1,7 @@
# Tests for the ViewTopicText method.
use strict;
-use Test::More tests => 8;
+use Test::More tests => 7;
use lib '../../../lib';
use Test::MockObject;
@@ -43,15 +43,6 @@
pass("View URL missing topicid parameter");
}
-eval {
- $url_cgi->url(topicid => 1234, filenumber => 2, line => 3, new => 1);
- fail("View URL missing projectid parameter");
-};
-if ($@) {
- # Expected.
- pass("View URL missing projectid parameter");
-}
-
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
$mock_http_input->{query} = $mock_query;
Index: edit-project.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/edit-project.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- edit-project.t 10 Aug 2008 12:18:42 -0000 1.1
+++ edit-project.t 27 Aug 2008 08:43:10 -0000 1.2
@@ -18,9 +18,9 @@
my $url_nice = Codestriker::Http::Method::EditProjectMethod->new($mock_query, 0);
is($url_cgi->url(45), $mock_query->url() . '?action=edit_project&projectid=45',
- "List projects URL CGI syntax");
+ "Edit project URL CGI syntax");
is($url_nice->url(45), $mock_query->url() . '/admin/project/45/edit',
- "List projects URL nice syntax");
+ "Edit project URL nice syntax");
# Check that the parameters extracted correctly.
my $mock_http_input = Test::MockObject->new();
Index: update-project.t
===================================================================
RCS file: update-project.t
diff -N update-project.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ update-project.t 27 Aug 2008 08:43:10 -0000 1.1
@@ -0,0 +1,34 @@
+# Tests for the UpdateProject method.
+
+use strict;
+use Test::More tests => 3;
+
+use lib '../../../lib';
+use Test::MockObject;
+use Codestriker;
+use Codestriker::Http::Method::UpdateProjectMethod;
+
+# Create a CGI mock object for these tests.
+my $mock_query = Test::MockObject->new();
+$mock_query->mock('url',
+ sub { 'http://localhost.localdomain/codestriker/codestriker.pl' } );
+
+# Create two method objects to test each URL scheme.
+my $url_cgi = Codestriker::Http::Method::UpdateProjectMethod->new($mock_query, 1);
+my $url_nice = Codestriker::Http::Method::UpdateProjectMethod->new($mock_query, 0);
+
+is($url_cgi->url(45), $mock_query->url() . '?action=submit_editproject',
+ "Update project URL CGI syntax");
+is($url_nice->url(45), $mock_query->url() . '/admin/project/45/update',
+ "Update project URL nice syntax");
+
+# Check that the parameters extracted correctly.
+my $mock_http_input = Test::MockObject->new();
+$mock_http_input->{query} = $mock_query;
+$mock_query->mock('path_info',
+ sub {
+ return $mock_query->url() . '/admin/project/45/update';
+ });
+$mock_query->mock('param', sub { return undef; });
+$url_nice->extract_parameters($mock_http_input);
+is ($mock_http_input->{projectid}, "45", "projectid nice URL parameter extraction");
Index: Dispatcher.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Dispatcher.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Dispatcher.pm 26 Aug 2008 22:18:50 -0000 1.6
+++ Dispatcher.pm 27 Aug 2008 08:43:10 -0000 1.7
@@ -28,6 +28,7 @@
use Codestriker::Http::Method::CreateProjectMethod;
use Codestriker::Http::Method::DownloadMetricsMethod;
use Codestriker::Http::Method::EditProjectMethod;
+use Codestriker::Http::Method::UpdateProjectMethod;
use Codestriker::Http::Method::ListProjectsMethod;
use Codestriker::Http::Method::SearchTopicsMethod;
use Codestriker::Http::Method::SubmitSearchTopicsMethod;
@@ -63,6 +64,7 @@
push @methods, Codestriker::Http::Method::DownloadTopicTextMethod->new($query);
push @methods, Codestriker::Http::Method::DownloadMetricsMethod->new($query);
push @methods, Codestriker::Http::Method::EditProjectMethod->new($query);
+ push @methods, Codestriker::Http::Method::UpdateProjectMethod->new($query);
push @methods, Codestriker::Http::Method::ListProjectsMethod->new($query);
push @methods, Codestriker::Http::Method::SearchTopicsMethod->new($query);
push @methods, Codestriker::Http::Method::SubmitSearchTopicsMethod->new($query);
Index: UpdateProjectMethod.pm
===================================================================
RCS file: UpdateProjectMethod.pm
diff -N UpdateProjectMethod.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ UpdateProjectMethod.pm 27 Aug 2008 08:43:10 -0000 1.1
@@ -0,0 +1,51 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
+# si...@us...
+#
+# This program is free software; you can redistribute it and modify it under
+# the terms of the GPL.
+
+# Method for updating a project.
+
+package Codestriker::Http::Method::UpdateProjectMethod;
+
+use strict;
+use Codestriker::Http::Method;
+
+@Codestriker::Http::Method::UpdateProjectMethod::ISA = ("Codestriker::Http::Method");
+
+# Generate a URL for this method.
+sub url() {
+ my ($self, $projectid) = @_;
+
+ if ($self->{cgi_style}) {
+ return $self->{url_prefix} . "?action=submit_editproject";
+ } else {
+ return $self->{url_prefix} . "/admin/project/$projectid/update";
+ }
+}
+
+sub extract_parameters {
+ my ($self, $http_input) = @_;
+
+ my $action = $http_input->{query}->param('action');
+ my $path_info = $http_input->{query}->path_info();
+ if ($self->{cgi_style} && defined $action && $action eq "submit_editproject") {
+ $http_input->extract_cgi_parameters();
+ return 1;
+ } elsif ($path_info =~ m{^$self->{url_prefix}/admin/project/\d+/update$}) {
+ $self->_extract_nice_parameters($http_input,
+ project => 'projectid');
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub execute {
+ my ($self, $http_input, $http_output) = @_;
+
+ Codestriker::Action::SubmitEditProject->process($http_input, $http_output);
+}
+
+1;
|
|
From: <si...@us...> - 2008-08-26 22:18:52
|
User: sits
Date: 08/08/26 15:18:51
Modified: lib/Codestriker/Http Dispatcher.pm UrlBuilder.pm
lib/Codestriker/Http/Method ListProjectsMethod.pm
Added: t/Http/Method add-project.t download-topic-text.t
lib/Codestriker/Http/Method DownloadTopicTextMethod.pm
AddProjectMethod.pm
Log:
Added support for downloading topic text and creating a new project under the new URL scheme.
Index: Dispatcher.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Dispatcher.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Dispatcher.pm 18 Aug 2008 22:11:05 -0000 1.5
+++ Dispatcher.pm 26 Aug 2008 22:18:50 -0000 1.6
@@ -20,6 +20,7 @@
use Codestriker::Http::Method::ViewTopicFileMethod;
use Codestriker::Http::Method::ViewTopicMetricsMethod;
use Codestriker::Http::Method::ViewTopicPropertiesMethod;
+use Codestriker::Http::Method::DownloadTopicTextMethod;
use Codestriker::Http::Method::UpdateTopicPropertiesMethod;
use Codestriker::Http::Method::AddCommentMethod;
use Codestriker::Http::Method::CreateCommentMethod;
@@ -33,6 +34,7 @@
use Codestriker::Http::Method::StaticResourcesMethod;
use Codestriker::Http::Method::ViewMetricsMethod;
use Codestriker::Http::Method::UpdateTopicStateMethod;
+use Codestriker::Http::Method::AddProjectMethod;
# Initialise all of the methods that are known to the system.
# TODO: add configuration to the parameter.
@@ -58,6 +60,7 @@
push @methods, Codestriker::Http::Method::AddTopicMethod->new($query);
push @methods, Codestriker::Http::Method::CreateProjectMethod->new($query);
push @methods, $self->{create_topic_method};
+ push @methods, Codestriker::Http::Method::DownloadTopicTextMethod->new($query);
push @methods, Codestriker::Http::Method::DownloadMetricsMethod->new($query);
push @methods, Codestriker::Http::Method::EditProjectMethod->new($query);
push @methods, Codestriker::Http::Method::ListProjectsMethod->new($query);
@@ -66,6 +69,7 @@
push @methods, Codestriker::Http::Method::StaticResourcesMethod->new($query);
push @methods, Codestriker::Http::Method::ViewMetricsMethod->new($query);
push @methods, Codestriker::Http::Method::UpdateTopicStateMethod->new($query);
+ push @methods, Codestriker::Http::Method::AddProjectMethod->new($query);
$self->{methods} = \@methods;
return bless $self, $type;
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- UrlBuilder.pm 18 Aug 2008 11:11:28 -0000 1.43
+++ UrlBuilder.pm 26 Aug 2008 22:18:50 -0000 1.44
@@ -43,6 +43,7 @@
use Codestriker::Http::Method::AddTopicMethod;
use Codestriker::Http::Method::CreateProjectMethod;
use Codestriker::Http::Method::DownloadMetricsMethod;
+use Codestriker::Http::Method::DownloadTopicTextMethod;
use Codestriker::Http::Method::EditProjectMethod;
use Codestriker::Http::Method::ListProjectsMethod;
use Codestriker::Http::Method::SearchTopicsMethod;
@@ -96,17 +97,7 @@
# Create the URL for downloading the topic text.
sub download_url {
my ($self, %args) = @_;
-
- # TODO: handle this as parameter to view topic text.
-
- die "Parameter topicid missing" unless defined $args{topicid};
- die "Parameter projectid missing" unless defined $args{projectid};
-
- if ($self->{cgi_style}) {
- return $self->{url_prefix} . "?action=download&topic=$args{topicid}";
- } else {
- return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/download/text";
- }
+ return Codestriker::Http::Method::DownloadTopicTextMethod->new($self->{query})->url(%args);
}
# Create the URL for creating a topic.
Index: add-project.t
===================================================================
RCS file: add-project.t
diff -N add-project.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ add-project.t 26 Aug 2008 22:18:51 -0000 1.1
@@ -0,0 +1,23 @@
+# Tests for the AddProject method.
+
+use strict;
+use Test::More tests => 2;
+
+use lib '../../../lib';
+use Test::MockObject;
+use Codestriker;
+use Codestriker::Http::Method::AddProjectMethod;
+
+# Create a CGI mock object for these tests.
+my $mock_query = Test::MockObject->new();
+$mock_query->mock('url',
+ sub { 'http://localhost.localdomain/codestriker/codestriker.pl' } );
+
+# Create two method objects to test each URL scheme.
+my $url_cgi = Codestriker::Http::Method::AddProjectMethod->new($mock_query, 1);
+my $url_nice = Codestriker::Http::Method::AddProjectMethod->new($mock_query, 0);
+
+is($url_cgi->url(), $mock_query->url() . '?action=submit_project',
+ "Add project URL CGI syntax");
+is($url_nice->url(), $mock_query->url() . '/admin/projects/add',
+ "Add project URL nice syntax");
Index: download-topic-text.t
===================================================================
RCS file: download-topic-text.t
diff -N download-topic-text.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ download-topic-text.t 26 Aug 2008 22:18:51 -0000 1.1
@@ -0,0 +1,38 @@
+# Tests for the DownloadTopicText method.
+
+use strict;
+use Test::More tests => 4;
+
+use lib '../../../lib';
+use Test::MockObject;
+use Codestriker;
+use Codestriker::Http::Method::DownloadTopicTextMethod;
+
+# Create a CGI mock object for these tests.
+my $mock_query = Test::MockObject->new();
+$mock_query->mock('url',
+ sub { 'http://localhost.localdomain/codestriker/codestriker.pl' } );
+
+# Create two method objects to test each URL scheme.
+my $url_cgi = Codestriker::Http::Method::DownloadTopicTextMethod->new($mock_query, 1);
+my $url_nice = Codestriker::Http::Method::DownloadTopicTextMethod->new($mock_query, 0);
+
+is($url_cgi->url(topicid => 1234, projectid => 10),
+ $mock_query->url() . '?action=download&topic=1234',
+ "Download topic text URL CGI syntax");
+
+is($url_nice->url(topicid => 1234, projectid => 10),
+ $mock_query->url() . '/project/10/topic/1234/download',
+ "Download topic text URL nice syntax");
+
+# Check that the parameters extracted correctly.
+my $mock_http_input = Test::MockObject->new();
+$mock_http_input->{query} = $mock_query;
+$mock_query->mock('path_info',
+ sub {
+ return $mock_query->url() . '/project/10/topic/1234/download';
+ });
+$mock_query->mock('param', sub { return undef; });
+$url_nice->extract_parameters($mock_http_input);
+is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
+is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
Index: ListProjectsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ListProjectsMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ListProjectsMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ ListProjectsMethod.pm 26 Aug 2008 22:18:51 -0000 1.2
@@ -30,7 +30,7 @@
my $action = $http_input->{query}->param('action');
my $path_info = $http_input->{query}->path_info();
- if ($self->{cgi_style} && defined $action && $action eq "list_project") {
+ if ($self->{cgi_style} && defined $action && $action eq "list_projects") {
$http_input->extract_cgi_parameters();
return 1;
} elsif ($path_info =~ m{^$self->{url_prefix}/admin/projects/list$}) {
Index: DownloadTopicTextMethod.pm
===================================================================
RCS file: DownloadTopicTextMethod.pm
diff -N DownloadTopicTextMethod.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ DownloadTopicTextMethod.pm 26 Aug 2008 22:18:51 -0000 1.1
@@ -0,0 +1,56 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
+# si...@us...
+#
+# This program is free software; you can redistribute it and modify it under
+# the terms of the GPL.
+
+# Method for downloading the topic text.
+
+package Codestriker::Http::Method::DownloadTopicTextMethod;
+
+use strict;
+use Carp;
+use Codestriker::Http::Method;
+
+@Codestriker::Http::Method::DownloadTopicTextMethod::ISA =
+ ("Codestriker::Http::Method");
+
+# Generate a URL for this method.
+sub url() {
+ my ($self, %args) = @_;
+
+ confess "Parameter topicid missing" unless defined $args{topicid};
+
+ if ($self->{cgi_style}) {
+ return $self->{url_prefix} . "?action=download&topic=$args{topicid}";
+ } else {
+ confess "Parameter projectid missing" unless defined $args{projectid};
+ return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/download";
+ }
+}
+
+sub extract_parameters {
+ my ($self, $http_input) = @_;
+
+ my $action = $http_input->{query}->param('action');
+ my $path_info = $http_input->{query}->path_info();
+ if ($self->{cgi_style} && defined $action && $action eq "download") {
+ $http_input->extract_cgi_parameters();
+ return 1;
+ } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/download}) {
+ $self->_extract_nice_parameters($http_input,
+ project => 'projectid', topic => 'topicid');
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub execute {
+ my ($self, $http_input, $http_output) = @_;
+
+ Codestriker::Action::DownloadTopic->process($http_input, $http_output);
+}
+
+1;
Index: AddProjectMethod.pm
===================================================================
RCS file: AddProjectMethod.pm
diff -N AddProjectMethod.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ AddProjectMethod.pm 26 Aug 2008 22:18:51 -0000 1.1
@@ -0,0 +1,49 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
+# si...@us...
+#
+# This program is free software; you can redistribute it and modify it under
+# the terms of the GPL.
+
+# Method for adding a new project.
+
+package Codestriker::Http::Method::AddProjectMethod;
+
+use strict;
+use Codestriker::Http::Method;
+
+@Codestriker::Http::Method::AddProjectMethod::ISA = ("Codestriker::Http::Method");
+
+# Generate a URL for this method.
+sub url() {
+ my ($self, %args) = @_;
+
+ if ($self->{cgi_style}) {
+ return $self->{url_prefix} . "?action=submit_project";
+ } else {
+ return $self->{url_prefix} . "/admin/projects/add";
+ }
+}
+
+sub extract_parameters {
+ my ($self, $http_input) = @_;
+
+ my $action = $http_input->{query}->param('action');
+ my $path_info = $http_input->{query}->path_info();
+ if ($self->{cgi_style} && defined $action && $action eq "submit_project") {
+ $http_input->extract_cgi_parameters();
+ return 1;
+ } elsif ($path_info =~ m{^$self->{url_prefix}/admin/projects/add}) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub execute {
+ my ($self, $http_input, $http_output) = @_;
+
+ Codestriker::Action::SubmitNewProject->process($http_input, $http_output);
+}
+
+1;
|
|
From: <si...@us...> - 2008-08-22 01:41:32
|
User: sits
Date: 08/08/21 18:41:32
Modified: bin commit-email-codestriker.pl
Log:
Update so that the initial state of the topic can be set. Setting it to "Committed" seems to be a reasonable use case.
Index: commit-email-codestriker.pl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/commit-email-codestriker.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- commit-email-codestriker.pl 11 Aug 2008 03:44:49 -0000 1.1
+++ commit-email-codestriker.pl 22 Aug 2008 01:41:31 -0000 1.2
@@ -121,6 +121,7 @@
'--codestriker-repository' => 'codestriker_repository',
'--codestriker-reviewers' => 'codestriker_reviewers',
'--codestriker-cc' => 'codestriker_cc',
+ '--codestriker-state' => 'codestriker_state',
'--codestriker-install-dir' => 'codestriker_install_dir');
while (@ARGV)
@@ -372,6 +373,7 @@
{
$topic_title = substr($topic_title, 0, 77) . "...";
}
+ $topic_title =~ s/[\r\n]+$//g;
# Check for any matching Bug id text.
my @bugs = ();
@@ -396,6 +398,7 @@
email => $codestriker_author,
reviewers => $current_project->{codestriker_reviewers},
cc => $current_project->{codestriker_cc},
+ topic_state => $current_project->{codestriker_state},
topic_text => join("\n", @difflines)
});
}
@@ -574,6 +577,7 @@
" --codestriker_repository repository Codestriker repository to use for new topics\n",
" --codestriker_reviewers reviewers Reviewers to be set for new topics\n",
" --codestriker_cc cc Optional cc recipients for new topics\n",
+ " --codestriker_state state Initial state for new topics - defaults to Open\n",
" --codestriker_install_dir path Location of Codestriker installation\n",
"\n",
"This script supports a single repository with multiple projects,\n",
@@ -612,6 +616,7 @@
codestriker_repository => '',
codestriker_reviewers => '',
codestriker_cc => '',
+ codestriker_state => 'Open',
codestriker_install_dir => ''};
}
|
|
From: <si...@us...> - 2008-08-20 00:43:35
|
User: sits
Date: 08/08/19 17:43:34
Modified: lib/Codestriker/Http/Method CreateCommentMethod.pm
ViewTopicTextMethod.pm
lib/Codestriker/Http Template.pm
bin CodestrikerClient.pm
Log:
More minor fixes so that a basic system can work again.
Index: CreateCommentMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/CreateCommentMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CreateCommentMethod.pm 18 Aug 2008 11:11:29 -0000 1.1
+++ CreateCommentMethod.pm 20 Aug 2008 00:43:33 -0000 1.2
@@ -20,13 +20,13 @@
my ($self, %args) = @_;
confess "Parameter topicid missing" unless defined $args{topicid};
- confess "Parameter projectid missing" unless defined $args{projectid};
if ($self->{cgi_style}) {
return $self->{url_prefix} . "?action=edit&fn=$args{filenumber}&line=$args{line}&new=$args{new}&topic=$args{topicid}" .
(defined $args{anchor} ? "&a=$args{anchor}" : "") .
(defined $args{context} ? "&context=$args{context}" : "");
} else {
+ confess "Parameter projectid missing" unless defined $args{projectid};
return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/comment/" .
"$args{filenumber}|$args{line}|$args{new}/create" .
(defined $args{anchor} ? "/anchor/$args{anchor}" : "") .
Index: ViewTopicTextMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicTextMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ViewTopicTextMethod.pm 17 Aug 2008 22:25:37 -0000 1.2
+++ ViewTopicTextMethod.pm 20 Aug 2008 00:43:33 -0000 1.3
@@ -21,7 +21,6 @@
my ($self, %args) = @_;
confess "Parameter topicid missing" unless defined $args{topicid};
- confess "Parameter projectid missing" unless defined $args{projectid};
if ($self->{cgi_style}) {
return $self->{url_prefix} . "?action=view&topic=$args{topicid}" .
@@ -31,6 +30,7 @@
(defined $args{fview} ? "&fview=$args{fview}" : "") .
(defined $args{filenumber} ? "#" . "$args{filenumber}|$args{line}|$args{new}" : "");
} else {
+ confess "Parameter projectid missing" unless defined $args{projectid};
return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/text" .
(defined $args{fview} ? "/filenumber/$args{filenumber}" : "") .
(defined $args{mode} ? "/mode/$args{mode}" : "") .
Index: Template.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Template.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Template.pm 20 Jun 2008 04:27:15 -0000 1.18
+++ Template.pm 20 Aug 2008 00:43:34 -0000 1.19
@@ -122,8 +122,7 @@
# Handle the links and parameters in the main title bar.
$vars->{'list_url'} =
- $url_builder->list_topics_url("", "", "", "", "", "", "",
- "", "", "", [ 0 ], undef);
+ $url_builder->list_topics_url(sstate => [0]);
$vars->{'create_topic_url'} = $url_builder->create_topic_url();
$vars->{'search_url'} = $url_builder->search_url();
$vars->{'doc_url'} = $url_builder->doc_url();
Index: CodestrikerClient.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/CodestrikerClient.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CodestrikerClient.pm 20 Jun 2008 04:29:36 -0000 1.5
+++ CodestrikerClient.pm 20 Aug 2008 00:43:34 -0000 1.6
@@ -57,6 +57,7 @@
email => $params->{email},
reviewers => $params->{reviewers},
cc => $params->{cc},
+ topic_state => $params->{topic_state},
topic_file => [$tempfile_filename]];
my $response =
$ua->request(HTTP::Request::Common::POST($self->{url},
|
|
From: <si...@us...> - 2008-08-19 10:50:20
|
User: sits
Date: 08/08/19 03:50:18
Modified: lib/Codestriker/Model Topic.pm
bin codestriker.pl.base
. CHANGELOG
lib/Codestriker/Http Input.pm
template/en/default viewtopicproperties.html.tmpl
createtopic.html.tmpl
lib/Codestriker/Action SubmitNewTopic.pm CreateTopic.pm
Log:
* Added a drop-down on the topic create page where the initial topic
state can be set. By default, this is set to "Open", however in
situations where a review has already been performed but needs to
be recorded, or a topic is automatically created from a post-commit
script from an SCM, sometimes another initial state is desirable.
Index: Topic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Topic.pm,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- Topic.pm 15 Aug 2008 06:30:38 -0000 1.50
+++ Topic.pm 19 Aug 2008 10:50:14 -0000 1.51
@@ -117,11 +117,21 @@
# Create a new topic with all of the specified properties.
sub create($$$$$$$$$$$$) {
- my ($self, $topicid, $author, $title, $bug_ids, $reviewers, $cc,
+ my ($self, $topicid, $author, $title, $state, $bug_ids, $reviewers, $cc,
$description, $document, $start_tag, $end_tag, $module,
$repository, $projectid, $deltas_ref, $obsoleted_topics) = @_;
my $timestamp = Codestriker->get_timestamp(time);
+
+ # Map the state to its number.
+ my $stateid;
+ for ($stateid = 0; $stateid <= $#Codestriker::topic_states;
+ $stateid++) {
+ last if ($Codestriker::topic_states[$stateid] eq $state);
+ }
+ if ($stateid > $#Codestriker::topic_states) {
+ die "Unable to create topic to invalid state: \"$state\"";
+ }
$self->{topicid} = $topicid;
$self->{author} = $author;
@@ -133,8 +143,8 @@
$self->{document} = $document;
$self->{creation_ts} = $timestamp;
$self->{modified_ts} = $timestamp;
- $self->{topic_state} = 0;
- $self->{topic_state_id} = 0;
+ $self->{topic_state} = $state;
+ $self->{topic_state_id} = $stateid;
$self->{project_id} = $projectid;
$self->{version} = 0;
$self->{start_tag} = $start_tag;
@@ -157,10 +167,9 @@
'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
my $success = defined $insert_topic;
- # Create all of the necessary rows. It is assumed state 0 is the initial
- # state.
+ # Create all of the necessary rows.
$success &&= $insert_topic->execute($topicid, $author, $title,
- $description, $document, 0,
+ $description, $document, $stateid,
$timestamp, $timestamp, 0,
$start_tag, $end_tag, $module,
$repository, $projectid);
Index: codestriker.pl.base
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/codestriker.pl.base,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- codestriker.pl.base 13 Aug 2008 11:30:47 -0000 1.27
+++ codestriker.pl.base 19 Aug 2008 10:50:14 -0000 1.28
@@ -128,7 +128,6 @@
# Process the HTTP input to ensure it is consistent.
my $http_input = Codestriker::Http::Input->new($query, $http_response);
- $http_input->process();
my $dispatcher = Codestriker::Http::Dispatcher->new($query);
$dispatcher->dispatch($http_input, $http_response);
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.260
retrieving revision 1.261
diff -u -r1.260 -r1.261
--- CHANGELOG 13 Aug 2008 05:09:05 -0000 1.260
+++ CHANGELOG 19 Aug 2008 10:50:15 -0000 1.261
@@ -13,7 +13,13 @@
* Creating Perforce topics directly from already committed files in the
depot did not work if the depot was on a different machine to the
- web-server. This has now been fixed.
+ web-server. This has now been fixed.
+
+* Added a drop-down on the topic create page where the initial topic
+ state can be set. By default, this is set to "Open", however in
+ situations where a review has already been performed but needs to
+ be recorded, or a topic is automatically created from a post-commit
+ script from an SCM, sometimes another initial state is desirable.
Version 1.9.6
Index: Input.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Input.pm,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- Input.pm 10 Aug 2008 12:18:44 -0000 1.48
+++ Input.pm 19 Aug 2008 10:50:16 -0000 1.49
@@ -105,16 +105,9 @@
my @selected_comments = $query->param('selected_comments');
$self->{selected_comments} = \@selected_comments;
$self->{default_to_head} = $query->param('default_to_head');
-}
-
-# Process the CGI parameters, and untaint them. If any of them look
-# suspicious, immediately output an error.
-sub process($) {
- my ($self) = @_;
- my $query = $self->{query};
+ # Set any missing parameters from the cookie.
my %cookie = Codestriker::Http::Cookie->get($query);
- $self->extract_cgi_parameters();
# Set things to the empty string rather than undefined.
$self->{cc} = "" if ! defined $self->{cc};
@@ -293,7 +286,7 @@
my %cookie = Codestriker::Http::Cookie->get($self->{query});
if (! defined $self->{$name} || $self->{$name} eq "") {
- $self->{$name} = exists $cookie{$name} ? $cookie{$name} : $default;
+ $self->{$name} = exists $cookie{$name} && $cookie{$name} ne "" ? $cookie{$name} : $default;
}
}
Index: viewtopicproperties.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopicproperties.html.tmpl,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- viewtopicproperties.html.tmpl 8 Aug 2008 07:02:08 -0000 1.28
+++ viewtopicproperties.html.tmpl 19 Aug 2008 10:50:17 -0000 1.29
@@ -195,7 +195,7 @@
<tr class="tt1">
<td>State:
<FONT SIZE="-2"><A HREF="javascript:alert('
-When a topic is created, it is initialised in state \'open\'.\n
+When a topic is created, it is by default in state \'open\'.\n
Once a topic has been reviewed, and the code has been committed,\n
the state should be updated to \'committed\'. If the code\n
in this review is not to be committed, perhaps because a\n
Index: createtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/createtopic.html.tmpl,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- createtopic.html.tmpl 17 Aug 2008 22:25:37 -0000 1.55
+++ createtopic.html.tmpl 19 Aug 2008 10:50:17 -0000 1.56
@@ -20,8 +20,8 @@
<p>
[% END %]
-<FORM METHOD="post" ENCTYPE="multipart/form-data" ACCEPT-CHARSET="UTF-8" action="[% add_topic_url %]">
-<!-- <INPUT TYPE="hidden" NAME="action" VALUE="submit_new_topic" /> -->
+<FORM METHOD="post" ENCTYPE="multipart/form-data" ACCEPT-CHARSET="UTF-8">
+<INPUT TYPE="hidden" NAME="action" VALUE="submit_new_topic" />
<INPUT TYPE="hidden" NAME="obsoletes" VALUE="[% obsoletes %]" />
[%# The topic title input field #%]
@@ -256,6 +256,40 @@
</TD>
<TD COLSPAN="3"><INPUT TYPE="text" NAME="cc" VALUE="[% cc | html_entity %]" SIZE=50 MAXLENGTH=1024 /></TD>
</TR>
+
+<tr>
+ <td>State:
+ <FONT SIZE="-2"><a href="javascript:void(0);"
+onmouseover="return create_window('When a topic is created, it is by default in state \'open\'.\
+Once a topic has been reviewed, and the code has been committed, \
+the state should be updated to \'committed\'. If the code \
+in this review is not to be committed, perhaps because a \
+new review will superceed this one, or because it was rejected, \
+the state should be changed to \'closed\'. \
+\
+If a topic is linked to Bugzilla bugs, each time the topic \
+state is changed, an appropriate comment will be appended to \
+all associated bugs, as a form of tracking. \
+\
+The topic states are also useful as a form of filtering, when \
+retrieving lists of topics from the search page. \
+\
+This topic can be superceeded by a new topic, by selecting the \
+state \'obsoleted\'')">(?)</A></FONT>
+ </td>
+ <td>
+ [%# Now display the option button for changing the topic state #%]
+ <select name="topic_state">
+ [% FOREACH state = states %]
+ [% IF state == 'Open' %]
+ <option selected value="[% state %]">[% state %]</option>
+ [% ELSIF state != 'Deleted' && state != 'Obsoleted' %]
+ <option value="[% state %]">[% state %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </td>
+</tr>
</TABLE>
<P>
Index: SubmitNewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitNewTopic.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- SubmitNewTopic.pm 17 Aug 2008 22:25:36 -0000 1.36
+++ SubmitNewTopic.pm 19 Aug 2008 10:50:17 -0000 1.37
@@ -45,6 +45,7 @@
my $module = $http_input->get('module');
my $obsoletes = $http_input->get('obsoletes');
my $default_to_head = $http_input->get('default_to_head');
+ my $topic_state = $http_input->get('topic_state');
my $feedback = "";
my $topic_text = "";
@@ -66,6 +67,11 @@
}
}
+ # Check if the state is valid.
+ if (! grep /^$topic_state$/, @Codestriker::topic_states) {
+ $http_response->error("Topic state $topic_state unrecognised");
+ }
+
if ($topic_title eq "") {
$feedback .= "No topic title was entered.\n";
}
@@ -325,7 +331,7 @@
# Create the topic in the model.
my $topic = Codestriker::Model::Topic->new($topicid);
- $topic->create($topicid, $email, $topic_title,
+ $topic->create($topicid, $email, $topic_title, $topic_state,
$bug_ids, $reviewers, $cc,
$topic_description, $topic_text,
$start_tag, $end_tag, $module,
@@ -346,7 +352,7 @@
# Tell all of the topic listener classes that a topic has
# just been created.
$feedback = Codestriker::TopicListeners::Manager::topic_create($topic);
-
+
# Obtain a URL builder object and determine the URL to the topic.
my $topic_url = $url_builder->view_url(topicid => $topicid, projectid => $projectid);
Index: CreateTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/CreateTopic.pm,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- CreateTopic.pm 17 Aug 2008 22:25:36 -0000 1.32
+++ CreateTopic.pm 19 Aug 2008 10:50:17 -0000 1.33
@@ -33,6 +33,7 @@
$vars->{'topic_description'} = "";
$vars->{'topic_title'} = $http_input->get('topic_title');
$vars->{'bug_ids'} = $http_input->get('bug_ids');
+ $vars->{'states'} = \@Codestriker::topic_states;
$vars->{'feedback'} = $http_input->get('feedback');
$vars->{'default_to_head'} = "";
|
|
From: <si...@us...> - 2008-08-18 22:11:09
|
User: sits
Date: 08/08/18 15:11:06
Modified: lib/Codestriker/Http Dispatcher.pm
. codestriker.conf
Added: lib/Codestriker/Http/Method UpdateTopicStateMethod.pm
t/Http/Method update-topic-states.t
cgi-bin highlight.css
Log:
Allow topic states to be updated via topic list screen.
Index: Dispatcher.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Dispatcher.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Dispatcher.pm 18 Aug 2008 11:19:58 -0000 1.4
+++ Dispatcher.pm 18 Aug 2008 22:11:05 -0000 1.5
@@ -32,6 +32,7 @@
use Codestriker::Http::Method::SubmitSearchTopicsMethod;
use Codestriker::Http::Method::StaticResourcesMethod;
use Codestriker::Http::Method::ViewMetricsMethod;
+use Codestriker::Http::Method::UpdateTopicStateMethod;
# Initialise all of the methods that are known to the system.
# TODO: add configuration to the parameter.
@@ -64,6 +65,7 @@
push @methods, Codestriker::Http::Method::SubmitSearchTopicsMethod->new($query);
push @methods, Codestriker::Http::Method::StaticResourcesMethod->new($query);
push @methods, Codestriker::Http::Method::ViewMetricsMethod->new($query);
+ push @methods, Codestriker::Http::Method::UpdateTopicStateMethod->new($query);
$self->{methods} = \@methods;
return bless $self, $type;
Index: UpdateTopicStateMethod.pm
===================================================================
RCS file: UpdateTopicStateMethod.pm
diff -N UpdateTopicStateMethod.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ UpdateTopicStateMethod.pm 18 Aug 2008 22:11:05 -0000 1.1
@@ -0,0 +1,53 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
+# si...@us...
+#
+# This program is free software; you can redistribute it and modify it under
+# the terms of the GPL.
+
+# Method for updating topic states.
+
+package Codestriker::Http::Method::UpdateTopicStateMethod;
+
+use strict;
+use Carp;
+use Codestriker::Http::Method;
+
+@Codestriker::Http::Method::UpdateTopicStateMethod::ISA = ("Codestriker::Http::Method");
+
+# Generate a URL for this method.
+sub url() {
+ my ($self, %args) = @_;
+
+ if ($self->{cgi_style}) {
+ return $self->{url_prefix} . "?action=change_topics_state";
+ } else {
+ confess "Parameter projectid missing" unless defined $args{projectid};
+ return $self->{url_prefix} . "/project/$args{projectid}/topic/update";
+ }
+}
+
+sub extract_parameters {
+ my ($self, $http_input) = @_;
+
+ my $action = $http_input->{query}->param('action');
+ my $path_info = $http_input->{query}->path_info();
+ if ($self->{cgi_style} && defined $action && $action eq "change_topics_state") {
+ $http_input->extract_cgi_parameters();
+ return 1;
+ } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/update}) {
+ $self->_extract_nice_parameters($http_input,
+ project => 'projectid');
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub execute {
+ my ($self, $http_input, $http_output) = @_;
+
+ Codestriker::Action::SubmitEditTopicsState->process($http_input, $http_output);
+}
+
+1;
Index: codestriker.conf
===================================================================
RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- codestriker.conf 1 Jul 2008 23:09:10 -0000 1.100
+++ codestriker.conf 18 Aug 2008 22:11:06 -0000 1.101
@@ -36,6 +36,7 @@
# Location of the mailing host. This is used when sending out codestriker
# comments.
$mailhost = 'localhost';
+$mailhost = 'smtp.iinet.com.au';
# Set the user and password parameters if $mailhost requires SMTP
# authentication. If commented out, it is assumed authentication is
@@ -60,8 +61,9 @@
# Location of the svn binary.
#$svn = 'c:/Program Files/SVN/svn.exe';
-#$svn = 'c:/Program Files/svn-win32-1.4.4/bin/svn.exe';
-$svn = '/usr/bin/svn';
+$svn = 'c:/Program Files/svn-win32-1.4.4/bin/svn.exe';
+$svn = 'c:/Program Files/CollabNet Subversion/svn.exe';
+#$svn = '/usr/bin/svn';
# Location of the ssh binary. This is only required if a CVS :ext
# type repository is used.
@@ -536,6 +538,6 @@
# documentations on how to add your own metrics into codestriker. It
# is easy to do, and does not require any coding.
-$metric_config = "none";
+$metric_config = "all";
Index: update-topic-states.t
===================================================================
RCS file: update-topic-states.t
diff -N update-topic-states.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ update-topic-states.t 18 Aug 2008 22:11:06 -0000 1.1
@@ -0,0 +1,39 @@
+# Tests for the UpdateTopicStates method.
+
+use strict;
+use Test::More tests => 3;
+
+use lib '../../../lib';
+use Test::MockObject;
+use Codestriker;
+use Codestriker::Http::Method::UpdateTopicStateMethod;
+
+# Create a CGI mock object for these tests.
+my $mock_query = Test::MockObject->new();
+$mock_query->mock('url',
+ sub { 'http://localhost.localdomain/codestriker/codestriker.pl' } );
+
+# Create two method objects to test each URL scheme.
+my $url_cgi = Codestriker::Http::Method::UpdateTopicStateMethod->new($mock_query, 1);
+my $url_nice = Codestriker::Http::Method::UpdateTopicStateMethod->new($mock_query, 0);
+
+is($url_cgi->url(projectid => 10),
+ $mock_query->url() . '?action=change_topics_state',
+ "Update topic state URL CGI syntax");
+
+is($url_nice->url(projectid => 10),
+ $mock_query->url() . '/project/10/topic/update',
+ "Update topic state URL nice syntax");
+
+# Check that the parameters extracted correctly.
+my $mock_http_input = Test::MockObject->new();
+$mock_http_input->{query} = $mock_query;
+$mock_query->mock('path_info',
+ sub {
+ return $mock_query->url() . '/project/10/topic/update';
+ });
+$mock_query->mock('param', sub { return undef; });
+$url_nice->extract_parameters($mock_http_input);
+is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
+
+
\ No newline at end of file
Index: highlight.css
===================================================================
RCS file: highlight.css
diff -N highlight.css
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ highlight.css 18 Aug 2008 22:11:06 -0000 1.1
@@ -0,0 +1,21 @@
+/* Style definition file generated by highlight 2.6.10, http://www.andre-simon.de/ */
+
+/* Highlighting theme definition: */
+
+body.hl { background-color:#ffffff; }
+pre.hl { color:#000000; background-color:#ffffff; font-size:10pt; font-family:'Courier New';}
+.hl.num { color:#2928ff; }
+.hl.esc { color:#ff00ff; }
+.hl.str { color:#ff0000; }
+.hl.dstr { color:#818100; }
+.hl.slc { color:#838183; font-style:italic; }
+.hl.com { color:#838183; font-style:italic; }
+.hl.dir { color:#008200; }
+.hl.sym { color:#000000; }
+.hl.line { color:#555555; }
+.hl.mark { background-color:#ffffbb;}
+.hl.kwa { color:#000000; font-weight:bold; }
+.hl.kwb { color:#830000; }
+.hl.kwc { color:#000000; font-weight:bold; }
+.hl.kwd { color:#010181; }
+
|
|
From: <si...@us...> - 2008-08-18 11:20:02
|
User: sits
Date: 08/08/18 04:19:59
Modified: lib/Codestriker/Http Dispatcher.pm
lib/Codestriker/Http/Method ViewTopicPropertiesMethod.pm
t/Http/Method view-topic-properties.t
Added: lib/Codestriker/Http/Method UpdateTopicPropertiesMethod.pm
t/Http/Method update-topic-properties.t
Log:
Support updating topic properties.
Index: Dispatcher.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Dispatcher.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Dispatcher.pm 18 Aug 2008 11:11:28 -0000 1.3
+++ Dispatcher.pm 18 Aug 2008 11:19:58 -0000 1.4
@@ -20,6 +20,7 @@
use Codestriker::Http::Method::ViewTopicFileMethod;
use Codestriker::Http::Method::ViewTopicMetricsMethod;
use Codestriker::Http::Method::ViewTopicPropertiesMethod;
+use Codestriker::Http::Method::UpdateTopicPropertiesMethod;
use Codestriker::Http::Method::AddCommentMethod;
use Codestriker::Http::Method::CreateCommentMethod;
use Codestriker::Http::Method::AddTopicMethod;
@@ -49,6 +50,7 @@
push @methods, Codestriker::Http::Method::ViewTopicFileMethod->new($query);
push @methods, Codestriker::Http::Method::ViewTopicMetricsMethod->new($query);
push @methods, Codestriker::Http::Method::ViewTopicPropertiesMethod->new($query);
+ push @methods, Codestriker::Http::Method::UpdateTopicPropertiesMethod->new($query);
push @methods, $self->{list_topics_method};
push @methods, Codestriker::Http::Method::CreateCommentMethod->new($query);
push @methods, Codestriker::Http::Method::AddCommentMethod->new($query);
Index: ViewTopicPropertiesMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicPropertiesMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ViewTopicPropertiesMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ ViewTopicPropertiesMethod.pm 18 Aug 2008 11:19:59 -0000 1.2
@@ -24,7 +24,7 @@
if ($self->{cgi_style}) {
return $self->{url_prefix} . "?action=view_topic_properties&topic=$args{topicid}";
} else {
- return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/properties";
+ return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/properties/view";
}
}
@@ -36,7 +36,7 @@
if ($self->{cgi_style} && defined $action && $action eq "view_topic_properties") {
$http_input->extract_cgi_parameters();
return 1;
- } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/properties}) {
+ } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/properties/view}) {
$self->_extract_nice_parameters($http_input,
project => 'projectid', topic => 'topicid');
return 1;
Index: UpdateTopicPropertiesMethod.pm
===================================================================
RCS file: UpdateTopicPropertiesMethod.pm
diff -N UpdateTopicPropertiesMethod.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ UpdateTopicPropertiesMethod.pm 18 Aug 2008 11:19:59 -0000 1.1
@@ -0,0 +1,54 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
+# si...@us...
+#
+# This program is free software; you can redistribute it and modify it under
+# the terms of the GPL.
+
+# Method for viewing the topic properties.
+
+package Codestriker::Http::Method::UpdateTopicPropertiesMethod;
+
+use strict;
+use Carp;
+use Codestriker::Http::Method;
+
+@Codestriker::Http::Method::UpdateTopicPropertiesMethod::ISA = ("Codestriker::Http::Method");
+
+# Generate a URL for this method.
+sub url() {
+ my ($self, %args) = @_;
+
+ if ($self->{cgi_style}) {
+ return $self->{url_prefix} . "?action=submit_edit_topic_properties&topic=$args{topicid}";
+ } else {
+ confess "Parameter topicid missing" unless defined $args{topicid};
+ confess "Parameter projectid missing" unless defined $args{projectid};
+ return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/properties/update";
+ }
+}
+
+sub extract_parameters {
+ my ($self, $http_input) = @_;
+
+ my $action = $http_input->{query}->param('action');
+ my $path_info = $http_input->{query}->path_info();
+ if ($self->{cgi_style} && defined $action && $action eq "edit_topic_properties") {
+ $http_input->extract_cgi_parameters();
+ return 1;
+ } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/properties}) {
+ $self->_extract_nice_parameters($http_input,
+ project => 'projectid', topic => 'topicid');
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub execute {
+ my ($self, $http_input, $http_output) = @_;
+
+ Codestriker::Action::SubmitEditTopicProperties->process($http_input, $http_output);
+}
+
+1;
Index: view-topic-properties.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/view-topic-properties.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- view-topic-properties.t 10 Aug 2008 12:18:42 -0000 1.1
+++ view-topic-properties.t 18 Aug 2008 11:19:59 -0000 1.2
@@ -22,7 +22,7 @@
"View topic properties URL CGI syntax");
is($url_nice->url(topicid => 1234, projectid => 10),
- $mock_query->url() . '/project/10/topic/1234/properties',
+ $mock_query->url() . '/project/10/topic/1234/properties/view',
"View topic properties URL nice syntax");
# Check that the parameters extracted correctly.
@@ -30,7 +30,7 @@
$mock_http_input->{query} = $mock_query;
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/properties';
+ return $mock_query->url() . '/project/10/topic/1234/properties/view';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
Index: update-topic-properties.t
===================================================================
RCS file: update-topic-properties.t
diff -N update-topic-properties.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ update-topic-properties.t 18 Aug 2008 11:19:59 -0000 1.1
@@ -0,0 +1,40 @@
+# Tests for the UpdateTopicProperties method.
+
+use strict;
+use Test::More tests => 4;
+
+use lib '../../../lib';
+use Test::MockObject;
+use Codestriker;
+use Codestriker::Http::Method::UpdateTopicPropertiesMethod;
+
+# Create a CGI mock object for these tests.
+my $mock_query = Test::MockObject->new();
+$mock_query->mock('url',
+ sub { 'http://localhost.localdomain/codestriker/codestriker.pl' } );
+
+# Create two method objects to test each URL scheme.
+my $url_cgi = Codestriker::Http::Method::UpdateTopicPropertiesMethod->new($mock_query, 1);
+my $url_nice = Codestriker::Http::Method::UpdateTopicPropertiesMethod->new($mock_query, 0);
+
+is($url_cgi->url(topicid => 1234, projectid => 10),
+ $mock_query->url() . '?action=submit_edit_topic_properties&topic=1234',
+ "Update topic properties URL CGI syntax");
+
+is($url_nice->url(topicid => 1234, projectid => 10),
+ $mock_query->url() . '/project/10/topic/1234/properties/update',
+ "Update topic properties URL nice syntax");
+
+# Check that the parameters extracted correctly.
+my $mock_http_input = Test::MockObject->new();
+$mock_http_input->{query} = $mock_query;
+$mock_query->mock('path_info',
+ sub {
+ return $mock_query->url() . '/project/10/topic/1234/properties/update';
+ });
+$mock_query->mock('param', sub { return undef; });
+$url_nice->extract_parameters($mock_http_input);
+is ($mock_http_input->{projectid}, "10", "project nice URL parameter extraction");
+is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+
+
\ No newline at end of file
|
|
From: <si...@us...> - 2008-08-18 11:11:38
|
User: sits
Date: 08/08/18 04:11:36
Modified: lib/Codestriker/Http Dispatcher.pm Response.pm UrlBuilder.pm
lib/Codestriker/Http/Method AddCommentMethod.pm
lib/Codestriker/Model Comment.pm
lib/Codestriker/Action ViewTopicComments.pm
t/Http/Method submit-search-topics.t add-comment.t
lib/Codestriker/TopicListeners Email.pm
Added: lib/Codestriker/Http/Method CreateCommentMethod.pm
t/Http/Method create-comment.t
Log:
Adding comments now works. Have to work on remaining submit actions.
Index: Dispatcher.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Dispatcher.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Dispatcher.pm 15 Aug 2008 06:10:40 -0000 1.2
+++ Dispatcher.pm 18 Aug 2008 11:11:28 -0000 1.3
@@ -21,6 +21,7 @@
use Codestriker::Http::Method::ViewTopicMetricsMethod;
use Codestriker::Http::Method::ViewTopicPropertiesMethod;
use Codestriker::Http::Method::AddCommentMethod;
+use Codestriker::Http::Method::CreateCommentMethod;
use Codestriker::Http::Method::AddTopicMethod;
use Codestriker::Http::Method::CreateProjectMethod;
use Codestriker::Http::Method::DownloadMetricsMethod;
@@ -49,6 +50,7 @@
push @methods, Codestriker::Http::Method::ViewTopicMetricsMethod->new($query);
push @methods, Codestriker::Http::Method::ViewTopicPropertiesMethod->new($query);
push @methods, $self->{list_topics_method};
+ push @methods, Codestriker::Http::Method::CreateCommentMethod->new($query);
push @methods, Codestriker::Http::Method::AddCommentMethod->new($query);
push @methods, Codestriker::Http::Method::AddTopicMethod->new($query);
push @methods, Codestriker::Http::Method::CreateProjectMethod->new($query);
Index: Response.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Response.pm,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- Response.pm 1 Jul 2008 10:06:46 -0000 1.47
+++ Response.pm 18 Aug 2008 11:11:28 -0000 1.48
@@ -75,14 +75,14 @@
# $tabwidth parameters.
my %cookie = ();
- if (!exists $params{email} || $params{email} eq "") {
+ if (! defined $params{email} || $params{email} eq "") {
$email = Codestriker::Http::Cookie->get_property($query, 'email');
}
else {
$email = $params{email};
}
- if (!exists $params{reviewers} || $params{reviewers} eq "") {
+ if (! defined $params{reviewers} || $params{reviewers} eq "") {
$reviewers = Codestriker::Http::Cookie->get_property($query,
'reviewers');
}
@@ -90,14 +90,14 @@
$reviewers = $params{reviewers};
}
- if (!exists $params{cc} || $params{cc} eq "") {
+ if (! defined $params{cc} || $params{cc} eq "") {
$cc = Codestriker::Http::Cookie->get_property($query, 'cc');
}
else {
$cc = $params{cc};
}
- if (!exists $params{tabwidth} || $params{tabwidth} eq "") {
+ if (! defined $params{tabwidth} || $params{tabwidth} eq "") {
$tabwidth = Codestriker::Http::Cookie->get_property($query,
'tabwidth');
}
@@ -105,14 +105,14 @@
$tabwidth = $params{tabwidth};
}
- if (!exists $params{mode} || $params{mode} eq "") {
+ if (! defined $params{mode} || $params{mode} eq "") {
$mode = Codestriker::Http::Cookie->get_property($query, 'mode');
}
else {
$mode = $params{mode};
}
- if (!exists $params{repository} || $params{repository} eq "") {
+ if (! defined $params{repository} || $params{repository} eq "") {
$repository = Codestriker::Http::Cookie->get_property($query,
'repository');
}
@@ -120,7 +120,7 @@
$repository = $params{repository};
}
- if (!exists $params{projectid} || $params{projectid} eq "") {
+ if (! defined $params{projectid} || $params{projectid} eq "") {
$projectid = Codestriker::Http::Cookie->get_property($query,
'projectid');
}
@@ -128,7 +128,7 @@
$projectid = $params{projectid};
}
- if (!exists $params{topicsort} || $params{topicsort} eq "") {
+ if (! defined $params{topicsort} || $params{topicsort} eq "") {
$topicsort = Codestriker::Http::Cookie->get_property($query,
'topicsort');
}
@@ -289,7 +289,7 @@
# output an error message. This is usually due to a
# misconfiguration.
print " if ('function' != typeof window.add_comment_html) {\n";
- print " alert('Oh oh... can\\'t find codestriker.js, please check your apache config.');\n";
+ print " alert('Oh oh... can\\'t find codestriker.js, please check your web-server config.');\n";
print " }\n";
print "</script>\n";
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- UrlBuilder.pm 17 Aug 2008 22:25:36 -0000 1.42
+++ UrlBuilder.pm 18 Aug 2008 11:11:28 -0000 1.43
@@ -124,7 +124,7 @@
# Create the URL for editing a topic.
sub edit_url {
my ($self, %args) = @_;
- return Codestriker::Http::Method::AddCommentMethod->new($self->{query})->url(%args);
+ return Codestriker::Http::Method::CreateCommentMethod->new($self->{query})->url(%args);
}
# Create the URL for viewing a new file.
Index: AddCommentMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/AddCommentMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AddCommentMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ AddCommentMethod.pm 18 Aug 2008 11:11:29 -0000 1.2
@@ -5,7 +5,7 @@
# This program is free software; you can redistribute it and modify it under
# the terms of the GPL.
-# Method for adding a comment to a topic.
+# Method for submitting a searching topic form.
package Codestriker::Http::Method::AddCommentMethod;
@@ -16,20 +16,16 @@
# Generate a URL for this method.
sub url() {
- my ($self, %args) = @_;
+ my ($self, %args) = @_;
- die "Parameter topicid missing" unless defined $args{topicid};
- die "Parameter projectid missing" unless defined $args{projectid};
-
if ($self->{cgi_style}) {
- return $self->{url_prefix} . "?action=edit&fn=$args{filenumber}&line=$args{line}&new=$args{new}&topic=$args{topicid}" .
- (defined $args{anchor} ? "&a=$args{anchor}" : "") .
- (defined $args{context} ? "&context=$args{context}" : "");
+ return $self->{url_prefix} . "?action=submit_comment";
} else {
+ die "Parameter topicid missing" unless defined $args{topicid};
+ die "Parameter projectid missing" unless defined $args{projectid};
+
return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/comment/" .
- "$args{filenumber}|$args{line}|$args{new}/add" .
- (defined $args{anchor} ? "/anchor/$args{anchor}" : "") .
- (defined $args{context} ? "/context/$args{context}" : "");
+ "$args{filenumber}|$args{line}|$args{new}/add";
}
}
@@ -38,7 +34,7 @@
my $action = $http_input->{query}->param('action');
my $path_info = $http_input->{query}->path_info();
- if ($self->{cgi_style} && defined $action && $action eq "edit") {
+ if ($self->{cgi_style} && defined $action && $action eq "submit_comment") {
$http_input->extract_cgi_parameters();
return 1;
} elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/comment/(\d+)\|(\d+)\|(\d+)/add}) {
@@ -57,7 +53,7 @@
sub execute {
my ($self, $http_input, $http_output) = @_;
- Codestriker::Action::EditComment->process($http_input, $http_output);
+ Codestriker::Action::SubmitNewComment->process($http_input, $http_output);
}
1;
Index: CreateCommentMethod.pm
===================================================================
RCS file: CreateCommentMethod.pm
diff -N CreateCommentMethod.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ CreateCommentMethod.pm 18 Aug 2008 11:11:29 -0000 1.1
@@ -0,0 +1,64 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
+# si...@us...
+#
+# This program is free software; you can redistribute it and modify it under
+# the terms of the GPL.
+
+# Method for adding a comment to a topic.
+
+package Codestriker::Http::Method::CreateCommentMethod;
+
+use strict;
+use Carp;
+use Codestriker::Http::Method;
+
+@Codestriker::Http::Method::CreateCommentMethod::ISA = ("Codestriker::Http::Method");
+
+# Generate a URL for this method.
+sub url() {
+ my ($self, %args) = @_;
+
+ confess "Parameter topicid missing" unless defined $args{topicid};
+ confess "Parameter projectid missing" unless defined $args{projectid};
+
+ if ($self->{cgi_style}) {
+ return $self->{url_prefix} . "?action=edit&fn=$args{filenumber}&line=$args{line}&new=$args{new}&topic=$args{topicid}" .
+ (defined $args{anchor} ? "&a=$args{anchor}" : "") .
+ (defined $args{context} ? "&context=$args{context}" : "");
+ } else {
+ return $self->{url_prefix} . "/project/$args{projectid}/topic/$args{topicid}/comment/" .
+ "$args{filenumber}|$args{line}|$args{new}/create" .
+ (defined $args{anchor} ? "/anchor/$args{anchor}" : "") .
+ (defined $args{context} ? "/context/$args{context}" : "");
+ }
+}
+
+sub extract_parameters {
+ my ($self, $http_input) = @_;
+
+ my $action = $http_input->{query}->param('action');
+ my $path_info = $http_input->{query}->path_info();
+ if ($self->{cgi_style} && defined $action && $action eq "edit") {
+ $http_input->extract_cgi_parameters();
+ return 1;
+ } elsif ($path_info =~ m{^$self->{url_prefix}/project/\d+/topic/\d+/comment/(\d+)\|(\d+)\|(\d+)/create}) {
+ $http_input->{fn} = $1;
+ $http_input->{line} = $2;
+ $http_input->{new} = $3;
+ $self->_extract_nice_parameters($http_input,
+ project => 'projectid', topic => 'topicid',
+ anchor => 'anchor', context => 'context');
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub execute {
+ my ($self, $http_input, $http_output) = @_;
+
+ Codestriker::Action::EditComment->process($http_input, $http_output);
+}
+
+1;
Index: Comment.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Comment.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Comment.pm 9 Jun 2006 03:20:02 -0000 1.23
+++ Comment.pm 18 Aug 2008 11:11:29 -0000 1.24
@@ -368,7 +368,8 @@
my $filteredByAuthor =
Codestriker->filter_email($filtered_by_author);
- if ($filteredByAuthor ne "" && $filteredAuthor ne $filteredByAuthor) {
+ if (defined $filteredByAuthor && $filteredByAuthor ne "" &&
+ $filteredAuthor ne $filteredByAuthor) {
# Don't keep this record.
$keep_comment = 0;
}
Index: ViewTopicComments.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopicComments.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ViewTopicComments.pm 10 Aug 2008 12:18:43 -0000 1.19
+++ ViewTopicComments.pm 18 Aug 2008 11:11:29 -0000 1.20
@@ -112,7 +112,8 @@
$last_filenumber = $comment->{filenumber};
}
- if ($show_context ne "" && $show_context > 0 &&
+ if (defined $show_context && $show_context ne "" &&
+ $show_context > 0 &&
$comment->{filenumber} != -1 && $comment->{fileline} != -1) {
my $delta = Codestriker::Model::Delta->get_delta($topicid,
$comment->{filenumber},
Index: submit-search-topics.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/submit-search-topics.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- submit-search-topics.t 15 Aug 2008 06:10:42 -0000 1.1
+++ submit-search-topics.t 18 Aug 2008 11:11:36 -0000 1.2
@@ -6,7 +6,7 @@
use lib '../../../lib';
use Test::MockObject;
use Codestriker;
-use Codestriker::Http::Method::SearchTopicsMethod;
+use Codestriker::Http::Method::SubmitSearchTopicsMethod;
# Create a CGI mock object for these tests.
my $mock_query = Test::MockObject->new();
Index: add-comment.t
===================================================================
RCS file: /cvsroot/codestriker/codestriker/t/Http/Method/add-comment.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- add-comment.t 10 Aug 2008 12:18:42 -0000 1.1
+++ add-comment.t 18 Aug 2008 11:11:36 -0000 1.2
@@ -1,7 +1,7 @@
# Tests for the AddComment method.
use strict;
-use Test::More tests => 8;
+use Test::More tests => 7;
use lib '../../../lib';
use Test::MockObject;
@@ -19,12 +19,12 @@
is($url_cgi->url(filenumber => 3, line => 55, new => 0, topicid => 1234,
projectid => 10, context => 3),
- $mock_query->url() . '?action=edit&fn=3&line=55&new=0&topic=1234&context=3',
+ $mock_query->url() . '?action=submit_comment',
"Add comment URL CGI syntax");
is($url_nice->url(filenumber => 3, line => 55, new => 0, topicid => 1234,
projectid => 10, context => 3),
- $mock_query->url() . '/project/10/topic/1234/comment/3|55|0/add/context/3',
+ $mock_query->url() . '/project/10/topic/1234/comment/3|55|0/add',
"Add comment URL nice syntax");
# Check that the parameters extracted correctly.
@@ -32,7 +32,7 @@
$mock_http_input->{query} = $mock_query;
$mock_query->mock('path_info',
sub {
- return $mock_query->url() . '/project/10/topic/1234/comment/3|55|0/add/context/3';
+ return $mock_query->url() . '/project/10/topic/1234/comment/3|55|0/add';
});
$mock_query->mock('param', sub { return undef; });
$url_nice->extract_parameters($mock_http_input);
@@ -41,6 +41,5 @@
is ($mock_http_input->{fn}, "3", "fn nice URL parameter extraction");
is ($mock_http_input->{line}, "55", "line nice URL parameter extraction");
is ($mock_http_input->{new}, "0", "new nice URL parameter extraction");
-is ($mock_http_input->{context}, "3", "context nice URL parameter extraction");
\ No newline at end of file
Index: create-comment.t
===================================================================
RCS file: create-comment.t
diff -N create-comment.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ create-comment.t 18 Aug 2008 11:11:36 -0000 1.1
@@ -0,0 +1,46 @@
+# Tests for the CreateComment method.
+
+use strict;
+use Test::More tests => 8;
+
+use lib '../../../lib';
+use Test::MockObject;
+use Codestriker;
+use Codestriker::Http::Method::CreateCommentMethod;
+
+# Create a CGI mock object for these tests.
+my $mock_query = Test::MockObject->new();
+$mock_query->mock('url',
+ sub { 'http://localhost.localdomain/codestriker/codestriker.pl' } );
+
+# Create two method objects to test each URL scheme.
+my $url_cgi = Codestriker::Http::Method::CreateCommentMethod->new($mock_query, 1);
+my $url_nice = Codestriker::Http::Method::CreateCommentMethod->new($mock_query, 0);
+
+is($url_cgi->url(filenumber => 3, line => 55, new => 0, topicid => 1234,
+ projectid => 10, context => 3),
+ $mock_query->url() . '?action=edit&fn=3&line=55&new=0&topic=1234&context=3',
+ "Create comment URL CGI syntax");
+
+is($url_nice->url(filenumber => 3, line => 55, new => 0, topicid => 1234,
+ projectid => 10, context => 3),
+ $mock_query->url() . '/project/10/topic/1234/comment/3|55|0/create/context/3',
+ "Create comment URL nice syntax");
+
+# Check that the parameters extracted correctly.
+my $mock_http_input = Test::MockObject->new();
+$mock_http_input->{query} = $mock_query;
+$mock_query->mock('path_info',
+ sub {
+ return $mock_query->url() . '/project/10/topic/1234/comment/3|55|0/create/context/3';
+ });
+$mock_query->mock('param', sub { return undef; });
+$url_nice->extract_parameters($mock_http_input);
+is ($mock_http_input->{projectid}, "10", "projectid nice URL parameter extraction");
+is ($mock_http_input->{topicid}, "1234", "topicid nice URL parameter extraction");
+is ($mock_http_input->{fn}, "3", "fn nice URL parameter extraction");
+is ($mock_http_input->{line}, "55", "line nice URL parameter extraction");
+is ($mock_http_input->{new}, "0", "new nice URL parameter extraction");
+is ($mock_http_input->{context}, "3", "context nice URL parameter extraction");
+
+
\ No newline at end of file
Index: Email.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/Email.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- Email.pm 17 Aug 2008 22:25:37 -0000 1.33
+++ Email.pm 18 Aug 2008 11:11:36 -0000 1.34
@@ -333,7 +333,7 @@
line => $comment->{fileline},
new => $comment->{filenew},
topicid => $topic->{topicid},
- projectid => $topic->{projectid});
+ projectid => $topic->{project_id});
# Retrieve the comment details for this topic.
my @comments = $topic->read_comments();
|
|
From: <si...@us...> - 2008-08-17 22:25:38
|
User: sits
Date: 08/08/17 15:25:37
Modified: lib/Codestriker/Action Search.pm SubmitNewTopic.pm
CreateTopic.pm
lib/Codestriker/Http UrlBuilder.pm
lib/Codestriker/Http/Method AddTopicMethod.pm
ViewTopicTextMethod.pm
template/en/default createtopic.html.tmpl
lib/Codestriker/TopicListeners Email.pm
Log:
More tweaks to get the system going in the new system. Still more work to be done.
Index: Search.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/Search.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Search.pm 19 Jun 2004 23:56:34 -0000 1.6
+++ Search.pm 17 Aug 2008 22:25:36 -0000 1.7
@@ -12,6 +12,7 @@
use strict;
use Codestriker::Model::Project;
use Codestriker::DB::Database;
+use Codestriker::Http::UrlBuilder;
# Create an appropriate form for topic searching.
sub process($$$) {
@@ -71,6 +72,9 @@
$vars->{'enable_body'} = 0;
$vars->{'enable_filename'} = 1;
}
+
+ # Target URL to divert the post to.
+ $vars->{'submit_search_url'} = $url_builder->submit_search_url();
my $template = Codestriker::Http::Template->new("search");
$template->process($vars);
Index: SubmitNewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitNewTopic.pm,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- SubmitNewTopic.pm 10 Aug 2008 12:18:43 -0000 1.35
+++ SubmitNewTopic.pm 17 Aug 2008 22:25:36 -0000 1.36
@@ -348,7 +348,7 @@
$feedback = Codestriker::TopicListeners::Manager::topic_create($topic);
# Obtain a URL builder object and determine the URL to the topic.
- my $topic_url = $url_builder->view_url(topicid => $topicid, projectid => $topic->{project_id});
+ my $topic_url = $url_builder->view_url(topicid => $topicid, projectid => $projectid);
# Indicate to the user that the topic has been created and an email has
# been sent.
Index: CreateTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/CreateTopic.pm,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- CreateTopic.pm 10 Aug 2008 12:18:43 -0000 1.31
+++ CreateTopic.pm 17 Aug 2008 22:25:36 -0000 1.32
@@ -40,6 +40,9 @@
# url.
$vars->{'doc_url'} = $url_builder->doc_url();
$vars->{'search_url'} = $url_builder->search_url();
+
+ # TODO: fix this once create topic is only done within context of a project.
+ $vars->{'add_topic_url'} = $url_builder->add_topic_url(projectid => 0);
# Retrieve the email, reviewers, cc, repository and projectid from
# the cookie.
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- UrlBuilder.pm 15 Aug 2008 06:30:39 -0000 1.41
+++ UrlBuilder.pm 17 Aug 2008 22:25:36 -0000 1.42
@@ -46,6 +46,7 @@
use Codestriker::Http::Method::EditProjectMethod;
use Codestriker::Http::Method::ListProjectsMethod;
use Codestriker::Http::Method::SearchTopicsMethod;
+use Codestriker::Http::Method::SubmitSearchTopicsMethod;
use Codestriker::Http::Method::StaticResourcesMethod;
use Codestriker::Http::Method::ViewMetricsMethod;
@@ -114,6 +115,12 @@
return Codestriker::Http::Method::CreateTopicMethod->new($self->{query})->url($obsoletes);
}
+# Create the URL for adding a topic to a project.
+sub add_topic_url {
+ my ($self, %args) = @_;
+ return Codestriker::Http::Method::AddTopicMethod->new($self->{query})->url(%args);
+}
+
# Create the URL for editing a topic.
sub edit_url {
my ($self, %args) = @_;
@@ -132,6 +139,12 @@
return Codestriker::Http::Method::SearchTopicsMethod->new($self->{query})->url();
}
+# The submit search URL.
+sub submit_search_url {
+ my ($self) = @_;
+ return Codestriker::Http::Method::SubmitSearchTopicsMethod->new($self->{query})->url();
+}
+
# Create the URL for the documentation page.
sub doc_url {
my ($self) = @_;
Index: AddTopicMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/AddTopicMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AddTopicMethod.pm 11 Aug 2008 22:32:39 -0000 1.1
+++ AddTopicMethod.pm 17 Aug 2008 22:25:37 -0000 1.2
@@ -47,7 +47,7 @@
sub execute {
my ($self, $http_input, $http_output) = @_;
- Codestriker::Action::CreateTopic->process($http_input, $http_output);
+ Codestriker::Action::SubmitNewTopic->process($http_input, $http_output);
}
1;
Index: ViewTopicTextMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ViewTopicTextMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ViewTopicTextMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ ViewTopicTextMethod.pm 17 Aug 2008 22:25:37 -0000 1.2
@@ -10,6 +10,7 @@
package Codestriker::Http::Method::ViewTopicTextMethod;
use strict;
+use Carp;
use Codestriker::Http::Method;
@Codestriker::Http::Method::ViewTopicTextMethod::ISA =
@@ -19,8 +20,8 @@
sub url() {
my ($self, %args) = @_;
- die "Parameter topicid missing" unless defined $args{topicid};
- die "Parameter projectid missing" unless defined $args{projectid};
+ confess "Parameter topicid missing" unless defined $args{topicid};
+ confess "Parameter projectid missing" unless defined $args{projectid};
if ($self->{cgi_style}) {
return $self->{url_prefix} . "?action=view&topic=$args{topicid}" .
Index: createtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/createtopic.html.tmpl,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- createtopic.html.tmpl 24 Jun 2008 03:26:50 -0000 1.54
+++ createtopic.html.tmpl 17 Aug 2008 22:25:37 -0000 1.55
@@ -20,8 +20,8 @@
<p>
[% END %]
-<FORM METHOD="post" ENCTYPE="multipart/form-data" ACCEPT-CHARSET="UTF-8">
-<INPUT TYPE="hidden" NAME="action" VALUE="submit_new_topic" />
+<FORM METHOD="post" ENCTYPE="multipart/form-data" ACCEPT-CHARSET="UTF-8" action="[% add_topic_url %]">
+<!-- <INPUT TYPE="hidden" NAME="action" VALUE="submit_new_topic" /> -->
<INPUT TYPE="hidden" NAME="obsoletes" VALUE="[% obsoletes %]" />
[%# The topic title input field #%]
Index: Email.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/Email.pm,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- Email.pm 15 Aug 2008 00:14:07 -0000 1.32
+++ Email.pm 17 Aug 2008 22:25:37 -0000 1.33
@@ -438,7 +438,8 @@
my $query = new CGI;
my $url_builder = Codestriker::Http::UrlBuilder->new($query);
- my $topic_url = $url_builder->view_url(topicid => $topic->{topicid});
+ my $topic_url = $url_builder->view_url(topicid => $topic->{topicid},
+ projectid => $topic->{project_id});
my $subject = "[REVIEW] Topic $event_name \"" . $topic->{title} . "\"";
|
|
From: <si...@us...> - 2008-08-15 06:30:40
|
User: sits
Date: 08/08/14 23:30:39
Modified: lib/Codestriker/Model Topic.pm
lib/Codestriker/Http UrlBuilder.pm
lib/Codestriker/Action ListTopics.pm
lib/Codestriker/Http/Method ListTopicsMethod.pm
Log:
Few more minor changes.
Index: Topic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Topic.pm,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- Topic.pm 22 Feb 2008 00:56:21 -0000 1.49
+++ Topic.pm 15 Aug 2008 06:30:38 -0000 1.50
@@ -754,7 +754,7 @@
# Build up the project condition.
my $project_part = "";
- if ($sproject ne "") {
+ if (defined $sproject && $sproject ne "") {
$project_part = "topic.projectid IN ($sproject)";
}
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- UrlBuilder.pm 15 Aug 2008 06:10:41 -0000 1.40
+++ UrlBuilder.pm 15 Aug 2008 06:30:39 -0000 1.41
@@ -143,7 +143,6 @@
sub list_topics_url {
my ($self, %args) = @_;
- print STDERR "list sauthor is " . $args{sauthor} . "\n";
$args{action} = "list_topics";
return $self->_list_topics_url(%args);
}
@@ -160,8 +159,6 @@
# Create the URL for listing the topics.
sub _list_topics_url {
my ($self, %args) = @_;
- print STDERR "_list sauthor is " . $args{sauthor} . "\n";
-
return Codestriker::Http::Method::ListTopicsMethod->new($self->{query})->url(%args);
}
Index: ListTopics.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ListTopics.pm,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- ListTopics.pm 10 Aug 2008 12:18:43 -0000 1.35
+++ ListTopics.pm 15 Aug 2008 06:30:39 -0000 1.36
@@ -62,7 +62,7 @@
# If only a single project id is being searched over, set that id in the
# cookie.
my @project_ids = ();
- if ($sproject ne "") {
+ if (defined $sproject && $sproject ne "") {
@project_ids = split ',', $sproject;
}
my $projectid_cookie = ($#project_ids == 0) ? $project_ids[0] : "";
@@ -297,7 +297,7 @@
# from the cookie as the project search value. This is done to facilate
# integration with other systems, which jump straight to this URL, and
# set the cookie explicitly.
- if ($sproject eq "-1") {
+ if (defined $sproject && $sproject eq "-1") {
$sproject = (defined $projectid) ? $projectid : "";
}
@@ -329,7 +329,7 @@
my @sort_order = split(/,/,$topicsort); # this is always from the cookie.
- if ($topic_sort_change ne "") {
+ if (defined $topic_sort_change && $topic_sort_change ne "") {
if (scalar(@sort_order) > 0) {
# If the user clicked on the same column twice in a row, reverse
Index: ListTopicsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ListTopicsMethod.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ListTopicsMethod.pm 15 Aug 2008 06:10:41 -0000 1.2
+++ ListTopicsMethod.pm 15 Aug 2008 06:30:39 -0000 1.3
@@ -23,8 +23,6 @@
my $sproject = defined $args{sproject} ? CGI::escape(join ',', @{$args{sproject}}) : "";
my $action = defined $args{rss} && $args{rss} ? "list_topics_rss" : "list_topics";
- print STDERR "sauthor is " . $args{sauthor} . "\n";
-
if ($self->{cgi_style}) {
return $self->{url_prefix} . "?action=$action" .
(defined $args{sauthor} && $args{sauthor} ne "" ? "&sauthor=" . CGI::escape($args{sauthor}) : "") .
|
|
From: <si...@us...> - 2008-08-15 06:10:43
|
User: sits
Date: 08/08/14 23:10:42
Modified: lib/Codestriker/Http Dispatcher.pm UrlBuilder.pm
lib/Codestriker/Http/Method ListTopicsMethod.pm
lib/Codestriker/Action ViewTopicProperties.pm
SubmitSearch.pm ViewTopicInfo.pm
Added: lib/Codestriker/Http/Method SubmitSearchTopicsMethod.pm
t/Http/Method submit-search-topics.t
Log:
More minor changes for the new URL dispatching code.
Index: Dispatcher.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Dispatcher.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Dispatcher.pm 13 Aug 2008 11:30:47 -0000 1.1
+++ Dispatcher.pm 15 Aug 2008 06:10:40 -0000 1.2
@@ -27,6 +27,7 @@
use Codestriker::Http::Method::EditProjectMethod;
use Codestriker::Http::Method::ListProjectsMethod;
use Codestriker::Http::Method::SearchTopicsMethod;
+use Codestriker::Http::Method::SubmitSearchTopicsMethod;
use Codestriker::Http::Method::StaticResourcesMethod;
use Codestriker::Http::Method::ViewMetricsMethod;
@@ -56,6 +57,7 @@
push @methods, Codestriker::Http::Method::EditProjectMethod->new($query);
push @methods, Codestriker::Http::Method::ListProjectsMethod->new($query);
push @methods, Codestriker::Http::Method::SearchTopicsMethod->new($query);
+ push @methods, Codestriker::Http::Method::SubmitSearchTopicsMethod->new($query);
push @methods, Codestriker::Http::Method::StaticResourcesMethod->new($query);
push @methods, Codestriker::Http::Method::ViewMetricsMethod->new($query);
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- UrlBuilder.pm 13 Aug 2008 11:31:12 -0000 1.39
+++ UrlBuilder.pm 15 Aug 2008 06:10:41 -0000 1.40
@@ -83,10 +83,6 @@
}
$self->{htmldir} = $htmlurl;
- # Initialise all of the methods.
- $self->{list_topics_method} =
- Codestriker::Http::Method::ListTopicsMethod->new($self->{query}, $self->{url_prefix}, $self->{cgi_style});
-
return bless $self, $type;
}
@@ -147,6 +143,7 @@
sub list_topics_url {
my ($self, %args) = @_;
+ print STDERR "list sauthor is " . $args{sauthor} . "\n";
$args{action} = "list_topics";
return $self->_list_topics_url(%args);
}
@@ -163,6 +160,8 @@
# Create the URL for listing the topics.
sub _list_topics_url {
my ($self, %args) = @_;
+ print STDERR "_list sauthor is " . $args{sauthor} . "\n";
+
return Codestriker::Http::Method::ListTopicsMethod->new($self->{query})->url(%args);
}
Index: ListTopicsMethod.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/ListTopicsMethod.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ListTopicsMethod.pm 10 Aug 2008 12:18:42 -0000 1.1
+++ ListTopicsMethod.pm 15 Aug 2008 06:10:41 -0000 1.2
@@ -23,6 +23,8 @@
my $sproject = defined $args{sproject} ? CGI::escape(join ',', @{$args{sproject}}) : "";
my $action = defined $args{rss} && $args{rss} ? "list_topics_rss" : "list_topics";
+ print STDERR "sauthor is " . $args{sauthor} . "\n";
+
if ($self->{cgi_style}) {
return $self->{url_prefix} . "?action=$action" .
(defined $args{sauthor} && $args{sauthor} ne "" ? "&sauthor=" . CGI::escape($args{sauthor}) : "") .
Index: SubmitSearchTopicsMethod.pm
===================================================================
RCS file: SubmitSearchTopicsMethod.pm
diff -N SubmitSearchTopicsMethod.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SubmitSearchTopicsMethod.pm 15 Aug 2008 06:10:41 -0000 1.1
@@ -0,0 +1,49 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
+# si...@us...
+#
+# This program is free software; you can redistribute it and modify it under
+# the terms of the GPL.
+
+# Method for submitting a searching topic form.
+
+package Codestriker::Http::Method::SubmitSearchTopicsMethod;
+
+use strict;
+use Codestriker::Http::Method;
+
+@Codestriker::Http::Method::SubmitSearchTopicsMethod::ISA = ("Codestriker::Http::Method");
+
+# Generate a URL for this method.
+sub url() {
+ my ($self) = @_;
+
+ if ($self->{cgi_style}) {
+ return $self->{url_prefix} . "?action=submit_search";
+ } else {
+ return $self->{url_prefix} . "/topics/submitsearch";
+ }
+}
+
+sub extract_parameters {
+ my ($self, $http_input) = @_;
+
+ my $action = $http_input->{query}->param('action');
+ my $path_info = $http_input->{query}->path_info();
+ if ($self->{cgi_style} && defined $action && $action eq "submit_search") {
+ $http_input->extract_cgi_parameters();
+ return 1;
+ } elsif ($path_info =~ m{^$self->{url_prefix}/topics/submitsearch/}) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub execute {
+ my ($self, $http_input, $http_output) = @_;
+
+ Codestriker::Action::SubmitSearch->process($http_input, $http_output);
+}
+
+1;
Index: ViewTopicProperties.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopicProperties.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ViewTopicProperties.pm 10 Aug 2008 12:18:43 -0000 1.18
+++ ViewTopicProperties.pm 15 Aug 2008 06:10:41 -0000 1.19
@@ -70,8 +70,9 @@
$url_builder->view_url(topicid => $topicid, projectid => $topic->{project_id},
mode => $mode);
- $vars->{'view_topicinfo_url'} = $url_builder->view_topicinfo_url($topicid);
- $vars->{'view_comments_url'} = $url_builder->view_comments_url(topicid => $topic->{topicid},
+ $vars->{'view_topicinfo_url'} = $url_builder->view_topicinfo_url(topicid => $topicid,
+ projectid => $topic->{project_id});
+ $vars->{'view_comments_url'} = $url_builder->view_comments_url(topicid => $topicid,
projectid => $topic->{project_id});
$vars->{'list_projects_url'} = $url_builder->list_projects_url();
Index: SubmitSearch.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitSearch.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SubmitSearch.pm 26 Jan 2004 21:17:08 -0000 1.4
+++ SubmitSearch.pm 15 Aug 2008 06:10:42 -0000 1.5
@@ -80,11 +80,13 @@
# Redirect the user to the list topics page.
my $url_builder = Codestriker::Http::UrlBuilder->new($query);
my $redirect_url =
- $url_builder->list_topics_url($sauthor, $sreviewer, $scc, $sbugid,
- $stext, $search_title,
- $search_description, $search_comments,
- $search_body, $search_filename,
- \@stateids, \@projectids);
+ $url_builder->list_topics_url(sauthor => $sauthor, sreviewer => $sreviewer,
+ scc => $scc, sbugid => $sbugid,
+ stext => $stext, stitle => $search_title,
+ sdescription => $search_description,
+ scomments => $search_comments,
+ sbody => $search_body, sfilename => $search_filename,
+ sstate => \@stateids, sproject => \@projectids);
print $query->redirect(-URI=>$redirect_url);
}
Index: ViewTopicInfo.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopicInfo.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ViewTopicInfo.pm 10 Aug 2008 12:18:43 -0000 1.15
+++ ViewTopicInfo.pm 15 Aug 2008 06:10:42 -0000 1.16
@@ -125,8 +125,9 @@
$url_builder->view_url(topicid => $topicid, projectid => $topic->{project_id},
mode => $mode);
- $vars->{'view_topicinfo_url'} = $url_builder->view_topicinfo_url($topicid);
- $vars->{'view_comments_url'} = $url_builder->view_comments_url(topicid => $topic->{topicid},
+ $vars->{'view_topicinfo_url'} = $url_builder->view_topicinfo_url(topicid => $topicid,
+ projectid => $topic->{project_id});
+ $vars->{'view_comments_url'} = $url_builder->view_comments_url(topicid => $topicid,
projectid => $topic->{project_id});
$vars->{'list_projects_url'} = $url_builder->list_projects_url();
Index: submit-search-topics.t
===================================================================
RCS file: submit-search-topics.t
diff -N submit-search-topics.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ submit-search-topics.t 15 Aug 2008 06:10:42 -0000 1.1
@@ -0,0 +1,23 @@
+# Tests for the SubmitSearchTopics method.
+
+use strict;
+use Test::More tests => 2;
+
+use lib '../../../lib';
+use Test::MockObject;
+use Codestriker;
+use Codestriker::Http::Method::SearchTopicsMethod;
+
+# Create a CGI mock object for these tests.
+my $mock_query = Test::MockObject->new();
+$mock_query->mock('url',
+ sub { 'http://localhost.localdomain/codestriker/codestriker.pl' } );
+
+# Create two method objects to test each URL scheme.
+my $url_cgi = Codestriker::Http::Method::SubmitSearchTopicsMethod->new($mock_query, 1);
+my $url_nice = Codestriker::Http::Method::SubmitSearchTopicsMethod->new($mock_query, 0);
+
+is($url_cgi->url(), $mock_query->url() . '?action=submit_search',
+ "Search URL CGI syntax");
+is($url_nice->url(), $mock_query->url() . '/topics/submitsearch',
+ "Search URL nice syntax");
|