codestriker-commits Mailing List for Codestriker: collaborative code reviewer (Page 8)
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-02-23 02:17:22
|
User: sits
Date: 08/02/22 18:17:15
Modified: doc codestriker.sgml
Log:
Commit Rob's documentation changes
Index: codestriker.sgml
===================================================================
RCS file: /cvsroot/codestriker/codestriker/doc/codestriker.sgml,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- codestriker.sgml 7 Jun 2007 04:46:27 -0000 1.66
+++ codestriker.sgml 23 Feb 2008 02:17:15 -0000 1.67
@@ -3,9 +3,9 @@
<book>
<bookinfo>
<title>The Codestriker Guide</title>
- <subtitle>Version 1.9.3</subtitle>
+ <subtitle>Version 1.9.5</subtitle>
<legalnotice>
- <para>Copyright (c) 2001 - 2007</para>
+ <para>Copyright (c) 2001 - 2008</para>
</legalnotice>
<authorgroup>
<author>
@@ -629,16 +629,14 @@
been resolved, Codestriker can add in a link to the code
review topic, which shows the actual code which fixed the
bug (and any important decisions made in the Codestriker
- comments). Currently, there is support for Bugzilla and Flyspray,
- but it is not difficult to add in support for other systems.
+ comments). Currently, there is support for Bugzilla, Flyspray
+ and TestDirector, but it is not difficult to add in support
+ for other systems.
</para>
<para>
- If you don't use Bugzilla (<ulink
- url="http://bugzilla.mozilla.org">http://bugzilla.mozilla.org</ulink>)
- or Flyspray,
- you can skip this section, as by default, there is no
- linking to a bug tracking system. An example configuration
- could be as follows:
+ If you don't use a bugtracker you can skip this section,
+ as by default, there is no linking to a bug tracking system.
+ An example configuration could be as follows:
<programlisting>
# Bug tracking type.
$bug_db = 'bugzilla';
@@ -1059,6 +1057,33 @@
added to the system.
</para>
</sect2>
+ <sect2>
+ <title>Scmbug Integration</title>
+ <para>
+ It is possible for Codestriker to integrate with ScmBug
+ (<ulink url="http://www.mkgnu.net/?q=scmbug">http://www.mkgnu.net/?q=scmbug</ulink>).
+ This allows users to generate a topic based on the changes
+ done under a given bug ID (or list of bug IDs). An example
+ configuration is:
+<programlisting>
+$scmbug_hostname = 'localhost';
+$scmbug_port = 3872;
+$scmbug_lib_dir = 'C:/Program Files/Scmbug/share/scmbug/lib';
+</programlisting>
+ </para>
+ <para>
+ This would match the default settings used by Scmbug on
+ Windows. Where <varname>$scmbug_hostname</varname> and
+ <varname>$scmbug_port</varname> are the host
+ and port of the machine where Scmbug is running. The
+ <varname>$scmbug_lib_dir</varname> points to the lib
+ directory under the Scmbug installation. If Scmbug is
+ running on a separate machine a copy of the Scmbug lib
+ directory needs to be staged on the same machine as
+ codestriker and the <varname>$scmbug_lib_dir</varname>
+ variable made to point at this.
+ </para>
+ </sect2>
</sect1>
<sect1 id="running-install.pl">
@@ -1991,6 +2016,17 @@
which would work on all files located within that path.
</para>
</sect2>
+ <sect2>
+ <title>Creating Topics from Bug IDs</title>
+ <para>
+ If you have Codestriker configured to make use of Scmbug
+ integration it is possible to generate a Topic by entering a
+ list of bug IDs (comma separated). To generate the topic in
+ this way, ensure that the Start Tag, End Tag and Module
+ fields are left blank and that the relevant bug IDs are
+ entered into the Bug IDs field.
+ </para>
+ </sect2>
</sect1>
<sect1>
<title>Reviewing Topics</title>
|
|
From: <si...@us...> - 2008-02-22 01:10:46
|
User: sits
Date: 08/02/21 17:10:44
Modified: lib/Codestriker/Action SubmitEditProject.pm
Log:
Removed old code which prevented project removal
Index: SubmitEditProject.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitEditProject.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SubmitEditProject.pm 30 Sep 2004 22:33:18 -0000 1.6
+++ SubmitEditProject.pm 22 Feb 2008 01:10:43 -0000 1.7
@@ -41,11 +41,6 @@
$http_response->error("Invalid project state: $project_state");
}
- # Check if this action is allowed.
- if ($project_state eq "Deleted") {
- $http_response->error("This function has been disabled");
- }
-
# Check that the appropriate fields have been filled in.
my $id = $http_input->get('projectid');
my $name = $http_input->get('project_name');
|
|
From: <si...@us...> - 2008-02-22 00:56:23
|
User: sits
Date: 08/02/21 16:56:21
Modified: lib/Codestriker/BugDB BugzillaConnection.pm
FlysprayConnection.pm TestDirectorConnection.pm
lib/Codestriker/Model Topic.pm
lib/Codestriker/TopicListeners BugTracking.pm
Log:
Rob's changes for allowing TestDirector records to be removed when a topic review is deleted
Index: BugzillaConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/BugzillaConnection.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- BugzillaConnection.pm 13 Jan 2008 09:15:22 -0000 1.6
+++ BugzillaConnection.pm 22 Feb 2008 00:56:21 -0000 1.7
@@ -45,8 +45,8 @@
# Method for updating the bug with information that a code review has been
# created/closed/committed against this bug.
-sub update_bug($$$$) {
- my ($self, $bugid, $comment, $topic_url) = @_;
+sub update_bug($$$$$) {
+ my ($self, $bugid, $comment, $topic_url, $topic_state) = @_;
# Create the necessary prepared statements.
my $insert_comment =
Index: FlysprayConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/FlysprayConnection.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FlysprayConnection.pm 13 Jan 2008 09:15:22 -0000 1.5
+++ FlysprayConnection.pm 22 Feb 2008 00:56:21 -0000 1.6
@@ -46,8 +46,8 @@
# Method for updating the bug with information that a code review has been
# created/closed/committed against this bug.
-sub update_bug($$$$) {
- my ($self, $bugid, $comment, $topic_url) = @_;
+sub update_bug($$$$$) {
+ my ($self, $bugid, $comment, $topic_url, $topic_state) = @_;
# Create the necessary prepared statements.
my $insert_comment =
Index: TestDirectorConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/TestDirectorConnection.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestDirectorConnection.pm 21 Feb 2008 02:32:09 -0000 1.2
+++ TestDirectorConnection.pm 22 Feb 2008 00:56:21 -0000 1.3
@@ -73,9 +73,9 @@
}
# Method for updating the bug with information that a code review has been
-# created/closed/committed against this bug.
-sub update_bug($$$$) {
- my ($self, $bugid, $comment, $topic_url) = @_;
+# created/closed/committed/deleted against this bug.
+sub update_bug($$$$$) {
+ my ($self, $bugid, $comment, $topic_url, $topic_state) = @_;
# Now get the bug out of Test Director.
my $bug = $self->_retrieve_bug_record($bugid);
@@ -94,10 +94,14 @@
$full_comment .= "</BODY></HTML>\n";
if (defined $bug->Attachments) {
- my $attach = $bug->Attachments->AddItem([$topic_url,
- "TDATT_INTERNET",
- $full_comment]);
- $attach->post();
+ if( $topic_state eq "Deleted" ) {
+ $self->_update_bug_delete( $bug->Attachments, $topic_url );
+ } else {
+ my $attach = $bug->Attachments->AddItem([$topic_url,
+ "TDATT_INTERNET",
+ $full_comment]);
+ $attach->post();
+ }
}
else
{
@@ -106,4 +110,27 @@
}
}
+# Method for updating the bug with information that a code review has been
+# deleted against this bug.
+sub _update_bug_delete($$$) {
+ my ($self, $attachments, $topic_url) = @_;
+
+ if( $attachments ) {
+ my $attachment_list = $attachments->NewList("");
+
+ my $attach_counter = 1;
+ while ( $attach_counter <= $attachment_list->Count ) {
+ my $attachment = $attachment_list->Item($attach_counter);
+
+ if( $attachment->Name eq $topic_url ) {
+ # Remove the attachment for the deleted topic
+ $attachments->RemoveItem($attachment->ID);
+ }
+ $attach_counter++;
+ }
+ $attachments->post();
+ }
+}
+
+
1;
Index: Topic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Topic.pm,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- Topic.pm 7 Mar 2007 01:12:32 -0000 1.48
+++ Topic.pm 22 Feb 2008 00:56:21 -0000 1.49
@@ -1045,6 +1045,9 @@
Codestriker::DB::DBI->release_connection($dbh, $success);
+ # Update the topic state to deleted
+ $self->{topic_state} = "Deleted";
+
# Indicate the success of the operation.
return $success ? $Codestriker::OK : $Codestriker::INVALID_TOPIC;
}
Index: BugTracking.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/BugTracking.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BugTracking.pm 13 Jan 2008 09:15:22 -0000 1.5
+++ BugTracking.pm 22 Feb 2008 00:56:21 -0000 1.6
@@ -124,7 +124,7 @@
"State changed to \"$newstate\" by $user\n";
for (my $i = 0; $i <= $#ids; $i++) {
- $bug_db_connection->update_bug($ids[$i], $text, $topic_url);
+ $bug_db_connection->update_bug($ids[$i], $text, $topic_url, $topic->{topic_state});
}
$bug_db_connection->release_connection();
}
|
|
From: <si...@us...> - 2008-02-22 00:32:11
|
User: sits
Date: 08/02/21 16:32:07
Modified: . codestriker.conf
bin codestriker.pl.base install.pl
lib/Codestriker/Action SubmitNewTopic.pm
lib/Codestriker/Repository ScmBug.pm
Log:
Merged more scmbug-related changes from Rob.
Index: codestriker.conf
===================================================================
RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- codestriker.conf 21 Feb 2008 02:32:09 -0000 1.91
+++ codestriker.conf 22 Feb 2008 00:31:55 -0000 1.92
@@ -404,8 +404,9 @@
# with source control systems such as subversion. The following flag
# enables/disables the ability for a user to create a topic by just
# using a Bug ID.
-#$scmbug_hostname = 'hostname-of-scmbug-daemon';
+#$scmbug_hostname = 'localhost';
#$scmbug_port = 3872;
+#$scmbug_lib_dir = 'C:/Program Files/Scmbug/share/scmbug/lib';
# LXR database. Each repository can be optionally mapped to a
# different LXR deployment. If a repository has an associated LXR
Index: codestriker.pl.base
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/codestriker.pl.base,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- codestriker.pl.base 24 Sep 2007 22:45:16 -0000 1.24
+++ codestriker.pl.base 22 Feb 2008 00:32:00 -0000 1.25
@@ -23,6 +23,7 @@
# effectively "pre-load" all of the Codestriker modules in the system, as the
# modules below load all of their supporting modules. That is why the
# template plugins are "pre-loaded" here.
+[% scmbug_lib %]
[% codestriker_lib %]
use strict;
Index: install.pl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- install.pl 21 Feb 2008 02:32:09 -0000 1.16
+++ install.pl 22 Feb 2008 00:32:05 -0000 1.17
@@ -140,10 +140,11 @@
# Check that the necessary modules are present if ScmBug is used.
if (defined $Codestriker::scmbug_hostname &&
- $Codestriker::scmbug_hostname ne '') {
- push @{$modules}, { name => 'XML::Simple', version => '0' };
- push @{$modules}, { name => 'ScmBug::Connection', version => '0' };
- push @{$modules}, { name => 'ScmBug::Common', version => '0' };
+ defined $Codestriker::scmbug_lib_dir &&
+ $Codestriker::scmbug_hostname ne '' &&
+ $Codestriker::scmbug_lib_dir ne '') {
+ push @INC, $Codestriker::scmbug_lib_dir;
+ push @{$modules}, { name => 'ScmBug::ActivityUtilities', version => '0' };
}
# Check for various character encoding modules that are required.
@@ -1064,6 +1065,12 @@
$template_vars->{hash_ex_line} = '#!' . $perl . ' -wT';
}
+# Check if the Scmbug library location needs to be added
+if (defined $Codestriker::scmbug_lib_dir &&
+ $Codestriker::scmbug_lib_dir ne '') {
+ $template_vars->{scmbug_lib} = 'use lib \'' . $Codestriker::scmbug_lib_dir . '\';';
+}
+
$template_vars->{codestriker_lib} = 'use lib \'' . cwd() . '/../lib\';';
$template_vars->{codestriker_conf} = '\'' . cwd() . '/..\'';
Index: SubmitNewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitNewTopic.pm,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- SubmitNewTopic.pm 21 Feb 2008 02:32:09 -0000 1.31
+++ SubmitNewTopic.pm 22 Feb 2008 00:32:05 -0000 1.32
@@ -56,7 +56,7 @@
# object.
my $retrieve_text_from_rep = 0;
if ((($start_tag ne "" || $end_tag ne "") && $module ne "") ||
- (defined $Codestriker::scmbug_host && $Codestriker::scmbug_host ne '' &&
+ (defined $Codestriker::scmbug_hostname && $Codestriker::scmbug_hostname ne '' &&
$bug_ids ne '')) {
$retrieve_text_from_rep = 1;
Index: ScmBug.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/ScmBug.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ScmBug.pm 21 Feb 2008 02:32:09 -0000 1.1
+++ ScmBug.pm 22 Feb 2008 00:32:07 -0000 1.2
@@ -12,9 +12,7 @@
use strict;
# Optional dependencies for people who don't require ScmBug functionality.
-eval("use XML::Simple");
-eval("use Scmbug::Connection");
-eval("use Scmbug::Common");
+eval("use Scmbug::ActivityUtilities");
# Create a connection to the ScmBug daemon, and maintain a reference to the
# delegate repository.
@@ -23,73 +21,12 @@
my $self = {};
$self->{repository} = $repository;
- $self->{connection} = Scmbug::Connection->new(0);
- $self->{connection}->location($hostname);
- $self->{connection}->port($port);
+ $self->{scmbug} = Scmbug::ActivityUtilities->new($hostname, $port);
bless $self, $type;
}
-#
-# Retrieve affected files in XML format from the ScmBug daemon.
-#
-sub get_affected_files_XML {
- my $self = shift;
- my $bugids = shift;
-
- my $new_activity = Scmbug::Activity->new();
- $new_activity->{name} = $ScmBug::Common::ACTIVITY_GET_AFFECTED_FILES;
- $new_activity->{user} = "codestriker";
-
- # Comma seperated list of bugs
- $new_activity->{bugs} = $bugids;
-
- # Process this tagging activity as well
- my $affected_files = $self->{connection}->process_activity($new_activity);
-
- return $affected_files;
-}
-
-#
-# Convert the XML format to a nice Perl structured format
-# grouping all the files together
-#
-sub convert_from_xml {
- my $self = shift;
- my $affected_files_xml = shift;
-
- my $xml = new XML::Simple (NoAttr=>1);
- my $raw = $xml->XMLin($affected_files_xml);
-
- my @changeList = ();
-
- my $bugid;
- foreach $bugid (keys %{$raw}) {
- my $comment_section;
- foreach $comment_section (keys %{$raw->{$bugid}}) {
- my $file_change;
- foreach $file_change (keys %{$raw->{$bugid}->{$comment_section}}) {
- my $changeset;
- $changeset->{file} = $raw->{$bugid}->{$comment_section}->{$file_change}->{filename};
- $changeset->{new} = $raw->{$bugid}->{$comment_section}->{$file_change}->{new_version};
- $changeset->{old} = $raw->{$bugid}->{$comment_section}->{$file_change}->{old_version};
-
- # Set the old version for new files to 0
- if( "$changeset->{old}" eq "NONE" ) {
- $changeset->{old} = 0;
- }
- if( "$changeset->{new}" eq "NONE" ) {
- $changeset->{new} = 0;
- }
- push @changeList, $changeset;
- }
- }
- }
-
- return \@changeList;
-}
-
# Retrieve the data corresponding to $filename and $revision. Store each line
# into $content_array_ref.
sub retrieve ($$$\$) {
@@ -121,9 +58,7 @@
sub getDiff {
my ($self, $bugids, $stdout_fh, $stderr_fh, $default_to_head) = @_;
- my $affected_files_list =
- $self->convert_from_xml($self->get_affected_files_XML($bugids));
-
+ my $affected_files_list = $self->{scmbug}->get_affected_files( $bugids );
foreach my $changeset ( @{ $affected_files_list } ) {
|
|
From: <si...@us...> - 2008-02-21 02:32:11
|
User: sits
Date: 08/02/20 18:32:10
Modified: . CHANGELOG codestriker.conf
bin install.pl
lib/Codestriker/Action SubmitNewTopic.pm
lib/Codestriker/BugDB TestDirectorConnection.pm
Added: lib/Codestriker/Repository ScmBug.pm
Log:
* Support for creating reviews by just entering the bug IDs, and
retrieving the data from Scmbug.
Submitted by rob...@us....
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.223
retrieving revision 1.224
diff -u -r1.223 -r1.224
--- CHANGELOG 18 Jan 2008 21:20:13 -0000 1.223
+++ CHANGELOG 21 Feb 2008 02:32:09 -0000 1.224
@@ -20,6 +20,10 @@
* Support for TestDirector as a supported bug tracking system.
Submitted by rob...@us....
+* Support for creating reviews by just entering the bug IDs, and
+ retrieving the data from Scmbug.
+ Submitted by rob...@us....
+
* Make sure if an invalid CGI parameter value is specified that its
value is encoded when displaying the generic error page. Reported
by ama...@us....
Index: codestriker.conf
===================================================================
RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- codestriker.conf 13 Jan 2008 09:15:20 -0000 1.90
+++ codestriker.conf 21 Feb 2008 02:32:09 -0000 1.91
@@ -399,6 +399,14 @@
$bugtracker = 'http://localhost.localdomain/bugzilla/show_bug.cgi?id=';
#$bugtracker = '/flyspray_dev/?do=details&id=';
+# Some bug tracking systems store details of the files changed under each bug
+# ID. A generic plugin for bugzilla is scmbug which can be used to link
+# with source control systems such as subversion. The following flag
+# enables/disables the ability for a user to create a topic by just
+# using a Bug ID.
+#$scmbug_hostname = 'hostname-of-scmbug-daemon';
+#$scmbug_port = 3872;
+
# LXR database. Each repository can be optionally mapped to a
# different LXR deployment. If a repository has an associated LXR
# mapping, then create a new entry where the repository string is the
Index: install.pl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- install.pl 13 Jan 2008 09:15:21 -0000 1.15
+++ install.pl 21 Feb 2008 02:32:09 -0000 1.16
@@ -138,6 +138,14 @@
push @{$modules}, { name => 'Win32::OLE', version => '0' };
}
+# Check that the necessary modules are present if ScmBug is used.
+if (defined $Codestriker::scmbug_hostname &&
+ $Codestriker::scmbug_hostname ne '') {
+ push @{$modules}, { name => 'XML::Simple', version => '0' };
+ push @{$modules}, { name => 'ScmBug::Connection', version => '0' };
+ push @{$modules}, { name => 'ScmBug::Common', version => '0' };
+}
+
# Check for various character encoding modules that are required.
if (defined $Codestriker::topic_text_encoding) {
if ($Codestriker::topic_text_encoding =~ /euc\-cn|gb2312|hz|gbk/) {
Index: SubmitNewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/SubmitNewTopic.pm,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- SubmitNewTopic.pm 7 Jun 2006 00:35:02 -0000 1.30
+++ SubmitNewTopic.pm 21 Feb 2008 02:32:09 -0000 1.31
@@ -17,6 +17,7 @@
use Codestriker::Model::Topic;
use Codestriker::Http::Render;
use Codestriker::Repository::RepositoryFactory;
+use Codestriker::Repository::ScmBug;
use Codestriker::FileParser::Parser;
use Codestriker::Model::Project;
use Codestriker::TopicListeners::Manager;
@@ -54,7 +55,9 @@
# Indicate whether the topic text needs to be retrieved by the repository
# object.
my $retrieve_text_from_rep = 0;
- if (($start_tag ne "" || $end_tag ne "") && $module ne "") {
+ if ((($start_tag ne "" || $end_tag ne "") && $module ne "") ||
+ (defined $Codestriker::scmbug_host && $Codestriker::scmbug_host ne '' &&
+ $bug_ids ne '')) {
$retrieve_text_from_rep = 1;
# Check if this action is permitted.
@@ -189,10 +192,22 @@
}
binmode $temp_topic_fh;
binmode $temp_error_fh;
-
- my $rc = $repository->getDiff($start_tag, $end_tag, $module,
- $temp_topic_fh, $temp_error_fh,
- $default_to_head);
+
+ my $rc;
+ if ($start_tag eq '' && $end_tag eq '' && $module eq '') {
+ # Retrieve the diff from ScmBug and the repository object.
+ my $scmbug = Codestriker::Repository::ScmBug->new($Codestriker::scmbug_hostname,
+ $Codestriker::scmbug_port,
+ $repository);
+ $rc = $scmbug->getDiff($bug_ids, $temp_topic_fh, $temp_error_fh,
+ $default_to_head);
+
+ } else {
+ # Retrieve the diff directly from the repository object.
+ $rc = $repository->getDiff($start_tag, $end_tag, $module,
+ $temp_topic_fh, $temp_error_fh,
+ $default_to_head);
+ }
# Make sure the data has been flushed to disk.
$temp_topic_fh->flush;
Index: TestDirectorConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/TestDirectorConnection.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestDirectorConnection.pm 13 Jan 2008 09:15:22 -0000 1.1
+++ TestDirectorConnection.pm 21 Feb 2008 02:32:09 -0000 1.2
@@ -11,7 +11,8 @@
use strict;
-use Win32::OLE;
+# Optional dependency for people who don't use this module.
+eval("use Win32::OLE;");
# Static method for building a database connection.
sub get_connection($) {
Index: ScmBug.pm
===================================================================
RCS file: ScmBug.pm
diff -N ScmBug.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ScmBug.pm 21 Feb 2008 02:32:09 -0000 1.1
@@ -0,0 +1,151 @@
+###############################################################################
+# Codestriker: Copyright (c) 2001,2002,2003 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.
+
+# ScmBug repository access package.
+
+package Codestriker::Repository::ScmBug;
+
+use strict;
+
+# Optional dependencies for people who don't require ScmBug functionality.
+eval("use XML::Simple");
+eval("use Scmbug::Connection");
+eval("use Scmbug::Common");
+
+# Create a connection to the ScmBug daemon, and maintain a reference to the
+# delegate repository.
+sub new {
+ my ($type, $hostname, $port, $repository) = @_;
+
+ my $self = {};
+ $self->{repository} = $repository;
+ $self->{connection} = Scmbug::Connection->new(0);
+ $self->{connection}->location($hostname);
+ $self->{connection}->port($port);
+
+ bless $self, $type;
+}
+
+
+#
+# Retrieve affected files in XML format from the ScmBug daemon.
+#
+sub get_affected_files_XML {
+ my $self = shift;
+ my $bugids = shift;
+
+ my $new_activity = Scmbug::Activity->new();
+ $new_activity->{name} = $ScmBug::Common::ACTIVITY_GET_AFFECTED_FILES;
+ $new_activity->{user} = "codestriker";
+
+ # Comma seperated list of bugs
+ $new_activity->{bugs} = $bugids;
+
+ # Process this tagging activity as well
+ my $affected_files = $self->{connection}->process_activity($new_activity);
+
+ return $affected_files;
+}
+
+#
+# Convert the XML format to a nice Perl structured format
+# grouping all the files together
+#
+sub convert_from_xml {
+ my $self = shift;
+ my $affected_files_xml = shift;
+
+ my $xml = new XML::Simple (NoAttr=>1);
+ my $raw = $xml->XMLin($affected_files_xml);
+
+ my @changeList = ();
+
+ my $bugid;
+ foreach $bugid (keys %{$raw}) {
+ my $comment_section;
+ foreach $comment_section (keys %{$raw->{$bugid}}) {
+ my $file_change;
+ foreach $file_change (keys %{$raw->{$bugid}->{$comment_section}}) {
+ my $changeset;
+ $changeset->{file} = $raw->{$bugid}->{$comment_section}->{$file_change}->{filename};
+ $changeset->{new} = $raw->{$bugid}->{$comment_section}->{$file_change}->{new_version};
+ $changeset->{old} = $raw->{$bugid}->{$comment_section}->{$file_change}->{old_version};
+
+ # Set the old version for new files to 0
+ if( "$changeset->{old}" eq "NONE" ) {
+ $changeset->{old} = 0;
+ }
+ if( "$changeset->{new}" eq "NONE" ) {
+ $changeset->{new} = 0;
+ }
+ push @changeList, $changeset;
+ }
+ }
+ }
+
+ return \@changeList;
+}
+
+# Retrieve the data corresponding to $filename and $revision. Store each line
+# into $content_array_ref.
+sub retrieve ($$$\$) {
+ my ($self, $filename, $revision, $content_array_ref) = @_;
+
+ $self->{repository}->retrieve($filename, $revision, $content_array_ref);
+}
+
+# Retrieve the "root" of this repository.
+sub getRoot ($) {
+ my ($self) = @_;
+ return $self->{repository}->{repository_url};
+}
+
+# Return a URL which views the specified file and revision.
+sub getViewUrl ($$$) {
+ my ($self, $filename, $revision) = @_;
+
+ return $self->{repository}->getViewUrl($filename, $revision);
+}
+
+# Return a string representation of this repository.
+sub toString ($) {
+ my ($self) = @_;
+ return $self->{repository}->toString();
+}
+
+# The getDiff operation, pull out a change set based on the bug IDs.
+sub getDiff {
+ my ($self, $bugids, $stdout_fh, $stderr_fh, $default_to_head) = @_;
+
+ my $affected_files_list =
+ $self->convert_from_xml($self->get_affected_files_XML($bugids));
+
+
+ foreach my $changeset ( @{ $affected_files_list } ) {
+
+ # Don't diff just directory property changes
+ if( $changeset->{file} =~ /\/$/ ) {
+ next;
+ }
+
+ # Call the delgate repository object for retrieving the actual
+ # content.
+ my $old_rev = ($changeset->{old} == 0) ? "" : $changeset->{old};
+ my $new_rev = ($changeset->{new} == 0) ? "" : $changeset->{new};
+ my $ret = $self->{repository}->getDiff($old_rev, $new_rev,
+ $changeset->{file},
+ $stdout_fh,
+ $stderr_fh,
+ $default_to_head);
+ return $ret if $ret != $Codestriker::OK;
+ }
+
+ return $Codestriker::OK;
+}
+
+
+1;
|
|
From: <si...@us...> - 2008-01-18 21:20:19
|
User: sits
Date: 08/01/18 13:20:14
Modified: . CHANGELOG
lib/Codestriker/Http Input.pm
Log:
* Make sure if an invalid CGI parameter value is specified that its
value is encoded when displaying the generic error page. Reported
by ama...@us....
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.222
retrieving revision 1.223
diff -u -r1.222 -r1.223
--- CHANGELOG 13 Jan 2008 09:15:20 -0000 1.222
+++ CHANGELOG 18 Jan 2008 21:20:13 -0000 1.223
@@ -19,6 +19,10 @@
* Support for TestDirector as a supported bug tracking system.
Submitted by rob...@us....
+
+* Make sure if an invalid CGI parameter value is specified that its
+ value is encoded when displaying the generic error page. Reported
+ by ama...@us....
Version 1.9.4
Index: Input.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Input.pm,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- Input.pm 25 Aug 2007 06:23:12 -0000 1.45
+++ Input.pm 18 Jan 2008 21:20:13 -0000 1.46
@@ -304,7 +304,7 @@
$self->{$name} = $1;
} else {
my $error_message = "Input parameter $name has invalid value: " .
- "\"$value\"";
+ HTML::Entities::encode($value);
$self->{http_response}->error($error_message);
}
} else {
|
|
From: <si...@us...> - 2008-01-13 09:15:25
|
User: sits
Date: 08/01/13 01:15:22
Modified: . CHANGELOG INFO.txt codestriker.conf
bin install.pl
lib/Codestriker/BugDB BugDBConnectionFactory.pm
BugzillaConnection.pm FlysprayConnection.pm
lib/Codestriker/TopicListeners BugTracking.pm
Added: lib/Codestriker/BugDB TestDirectorConnection.pm
Log:
* Support for TestDirector as a supported bug tracking system.
Submitted by rob...@us....
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.221
retrieving revision 1.222
diff -u -r1.221 -r1.222
--- CHANGELOG 10 Jan 2008 21:48:34 -0000 1.221
+++ CHANGELOG 13 Jan 2008 09:15:20 -0000 1.222
@@ -16,6 +16,9 @@
* Only require Authen::SASL as a pre-requisite if SMTP authentication
is needed. For some deployments, installing Authen::SASL can be
inconvenient.
+
+* Support for TestDirector as a supported bug tracking system.
+ Submitted by rob...@us....
Version 1.9.4
Index: INFO.txt
===================================================================
RCS file: /cvsroot/codestriker/codestriker/INFO.txt,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- INFO.txt 18 Apr 2006 10:45:39 -0000 1.8
+++ INFO.txt 13 Jan 2008 09:15:20 -0000 1.9
@@ -135,3 +135,6 @@
+----------------+----------------+
1 row in set (0.00 sec)
+Subversion test, retrieve from collab win-tests.py revision 25651.
+
+Also do diff 25651 25653
Index: codestriker.conf
===================================================================
RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- codestriker.conf 12 Jul 2007 23:39:17 -0000 1.89
+++ codestriker.conf 13 Jan 2008 09:15:20 -0000 1.90
@@ -55,14 +55,17 @@
# Location of the cvs binary.
#$cvs = 'c:/Program Files/GNU/WinCvs 1.3/CVSNT/cvs.exe';
+#$cvs = 'c:/Program Files/cvsnt/cvs.exe';
$cvs = '/usr/bin/cvs';
# 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';
# Location of the ssh binary. This is only required if a CVS :ext
# type repository is used.
+#$ssh='c:/Program Files/OpenSSH/bin/ssh.exe';
$ssh = '/usr/local/bin/ssh';
# Location of the p4 (Perforce client) binary. This does not need to be set
@@ -80,7 +83,7 @@
# directory here that exists on the system. For *NIX platforms, there is
# usually no need to do anything here.
#$tmpdir = '/tmp/codestriker';
-#$tmpdir = 'c:/codestriker temp';
+#$tmpdir = 'c:/temp';
# If codestriker is installed differently to that described in the README file
# (for example on the sourceforge servers), it may be necessary to explicitly
@@ -103,6 +106,7 @@
# connect to the repository.
@valid_repositories =
(
+ 'svn://svn.openchange.org/openchange/trunk',
# Example CVSROOT of a CVS repository on the same machine as the
# codestriker server.
'/home/sits/cvs',
@@ -112,6 +116,9 @@
# CVSROOT of the repository.
'http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi /cvsroot',
+ # Codestriker pserver repository.
+ ':pserver:anonymous:@codestriker.cvs.sourceforge.net:/cvsroot/codestriker',
+
# The next example is the syntax used for specifying a Subversion
# repository, which is simply the subversion repository URL
# prefixed # by svn:
@@ -186,6 +193,7 @@
# followed by the view name, followed by the location where the
# view is loaded.
# 'clearcase:dyn:viewname:/vobs'
+ # 'clearcase:dyn:viewname:P:\\viewname'
);
# A mapping of repository URLs to names. In any screen where a
@@ -344,17 +352,22 @@
# can be changed dynamically on the view topic screen.
$default_tabwidth = 8;
-# Bug database to update. Currently, Bugzilla and Flyspray are
-# supported, but it is straight-forward to support other bug
+# Bug database to update. Currently, Bugzilla, Flyspray and TestDirector
+# are supported, but it is straight-forward to support other bug
# databases. To enable Bugzilla, set $bug_db to "bugzilla", and set
-# the following parameters to your setup. To enable Flysprat, set
-# $bug_db to "flyspray", and set the relevant parameters.
-# if the $bug_db is an empty string, all bug-tracking related
-# features will be disabled.
+# the following parameters to your setup. To enable Flyspray, set
+# $bug_db to "flyspray", and set the relevant parameters. To enable
+# TestDirectory, set $bug_db to "testdirector" and set the relevant
+# parameters. If the $bug_db is an empty string, all bug-tracking related
+# features will be disabled. To allow the association of a bug ID
+# with a topic, without any physical connection to a bug database,
+# set the value to "noconnection".
$bug_db = '';
#$bug_db = 'bugzilla';
#$bug_db = 'flyspray';
+#$bug_db = 'testdirector';
+$bug_db = 'noconnection';
# Bugzilla database connection details.
#$bug_db_host = 'localhost';
@@ -370,12 +383,20 @@
#$flyspray_db_dbname = 'flyspray_dev';
#$flyspray_db_user_id = 50;
+# TestDirector connection details
+#$testdirector_url = 'http://emea-testdir:8080/qcbin';
+#$testdirector_user_id = 'robh';
+#$testdirector_password = '';
+#$testdirector_domain = 'DEFAULT';
+#$testdirector_project = 'BPM33';
+#$testdirector_file_list = 'BG_USER_29';
+
# The URL to the bug tracking system. The bug number is appended to the
# end of this string when URLs are generated. This can be left blank if
# there is no need for bug-tracking integration. Below are some example
# URLs for Bugzilla and Flyspray.
$bugtracker = '';
-#$bugtracker = 'http://localhost.localdomain/bugzilla/show_bug.cgi?id=';
+$bugtracker = 'http://localhost.localdomain/bugzilla/show_bug.cgi?id=';
#$bugtracker = '/flyspray_dev/?do=details&id=';
# LXR database. Each repository can be optionally mapped to a
@@ -405,7 +426,7 @@
# (compatible with ASCII) if not set, but this can be over-ridden here.
# List of example encoding names can be retrieved from the following
# URL: http://perldoc.perl.org/Encode/Supported.html.
-#$topic_text_encoding = 'utf8';
+$topic_text_encoding = 'utf8';
#$topic_text_encoding = 'gb2312';
# Each comment thread (or issue) that is created against a specific
Index: install.pl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- install.pl 13 Jan 2008 04:25:33 -0000 1.14
+++ install.pl 13 Jan 2008 09:15:21 -0000 1.15
@@ -131,6 +131,13 @@
push @{$modules}, { name => 'Authen::SASL', version => '0' };
}
+# Check if TestDirector is being used, and if so, ensure the required
+# modules are loaded.
+if (defined $Codestriker::bug_db &&
+ $Codestriker::bug_db eq 'testdirector') {
+ push @{$modules}, { name => 'Win32::OLE', version => '0' };
+}
+
# Check for various character encoding modules that are required.
if (defined $Codestriker::topic_text_encoding) {
if ($Codestriker::topic_text_encoding =~ /euc\-cn|gb2312|hz|gbk/) {
Index: BugDBConnectionFactory.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/BugDBConnectionFactory.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BugDBConnectionFactory.pm 25 Aug 2007 09:11:07 -0000 1.4
+++ BugDBConnectionFactory.pm 13 Jan 2008 09:15:21 -0000 1.5
@@ -13,6 +13,7 @@
use Codestriker::BugDB::BugzillaConnection;
use Codestriker::BugDB::FlysprayConnection;
use Codestriker::BugDB::NoConnection;
+use Codestriker::BugDB::TestDirectorConnection;
# Factory method for retrieving a BugDBConnection object.
sub getBugDBConnection ($) {
@@ -23,6 +24,8 @@
return Codestriker::BugDB::BugzillaConnection->get_connection();
} elsif ($dbtype eq "flyspray") {
return Codestriker::BugDB::FlysprayConnection->get_connection();
+ } elsif ($dbtype eq "testdirector") {
+ return Codestriker::BugDB::TestDirectorConnection->get_connection();
} elsif ($dbtype =~ /^noconnect/) {
return Codestriker::BugDB::NoConnection->get_connection();
} else {
Index: BugzillaConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/BugzillaConnection.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BugzillaConnection.pm 16 Jan 2006 21:22:58 -0000 1.5
+++ BugzillaConnection.pm 13 Jan 2008 09:15:22 -0000 1.6
@@ -46,7 +46,7 @@
# Method for updating the bug with information that a code review has been
# created/closed/committed against this bug.
sub update_bug($$$$) {
- my ($self, $bugid, $comment) = @_;
+ my ($self, $bugid, $comment, $topic_url) = @_;
# Create the necessary prepared statements.
my $insert_comment =
Index: FlysprayConnection.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/FlysprayConnection.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FlysprayConnection.pm 22 Jan 2006 22:47:14 -0000 1.4
+++ FlysprayConnection.pm 13 Jan 2008 09:15:22 -0000 1.5
@@ -47,7 +47,7 @@
# Method for updating the bug with information that a code review has been
# created/closed/committed against this bug.
sub update_bug($$$$) {
- my ($self, $bugid, $comment) = @_;
+ my ($self, $bugid, $comment, $topic_url) = @_;
# Create the necessary prepared statements.
my $insert_comment =
Index: TestDirectorConnection.pm
===================================================================
RCS file: TestDirectorConnection.pm
diff -N TestDirectorConnection.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TestDirectorConnection.pm 13 Jan 2008 09:15:22 -0000 1.1
@@ -0,0 +1,108 @@
+###############################################################################
+# 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.
+
+# TestDirector connection class, for appending comments to a bug report.
+
+package Codestriker::BugDB::TestDirectorConnection;
+
+use strict;
+
+use Win32::OLE;
+
+# Static method for building a database connection.
+sub get_connection($) {
+ my ($type) = @_;
+
+ # Return a connection with Test Director via the TD Object.
+ my $self = {};
+ eval 'use Win32::OLE';
+ die "Unable to load Win32::OLE module: $@\n" if $@;
+ my $conn = Win32::OLE->new('TDapiole80.TDconnection');
+
+ if (!$conn) {
+ die "Cannot start TestDirector object";
+ }
+
+ # Connect to specified server.
+ $conn->InitConnectionEx($Codestriker::testdirector_url);
+
+ # Connect to specified project.
+ $conn->Login($Codestriker::testdirector_user_id,
+ $Codestriker::testdirector_password);
+ $conn->Connect($Codestriker::testdirector_domain,
+ $Codestriker::testdirector_project);
+
+ $self->{dbh} = $conn;
+ bless $self, $type;
+}
+
+# Method for releasing a Test Director connection.
+sub release_connection($) {
+ my ($self) = @_;
+
+ # Close the TD connection.
+ # Disconnect the project and release the server.
+ $self->{dbh}->Disconnect();
+ $self->{dbh}->Logout();
+ $self->{dbh}->ReleaseConnection();
+}
+
+# Retrieve the specified bug record.
+sub _retrieve_bug_record {
+ my ($self, $bugid) = @_;
+
+ if (! defined $self->{dbh}->bugfactory) {
+ die "Unable to retrieve bug factory object";
+ }
+
+ return $self->{dbh}->bugfactory->item($bugid);
+}
+
+# Return true if the specified bugid exists in the bug database,
+# false otherwise.
+sub bugid_exists($$) {
+ my ($self, $bugid) = @_;
+
+ my $bug = $self->_retrieve_bug_record($bugid);
+ return defined $bug;
+}
+
+# Method for updating the bug with information that a code review has been
+# created/closed/committed against this bug.
+sub update_bug($$$$) {
+ my ($self, $bugid, $comment, $topic_url) = @_;
+
+ # Now get the bug out of Test Director.
+ my $bug = $self->_retrieve_bug_record($bugid);
+
+ # Test director stores comments as html so convert the comment to html.
+ my $parsed_comment = $comment;
+ $parsed_comment =~ s/\n/<BR>/g;
+
+ my $full_comment = "";
+ $full_comment .= "\n<HTML><BODY>\n";
+ $full_comment .= "<font color=\"\#000080\">";
+ $full_comment .= "<b>Code Review, ";
+ $full_comment .= localtime;
+ $full_comment .= ":</b></font><BR>";
+ $full_comment .= $parsed_comment;
+ $full_comment .= "</BODY></HTML>\n";
+
+ if (defined $bug->Attachments) {
+ my $attach = $bug->Attachments->AddItem([$topic_url,
+ "TDATT_INTERNET",
+ $full_comment]);
+ $attach->post();
+ }
+ else
+ {
+ $$bug{"BG_DEV_COMMENTS"} .= $full_comment;
+ $bug->post();
+ }
+}
+
+1;
Index: BugTracking.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/BugTracking.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BugTracking.pm 11 Jun 2006 07:54:01 -0000 1.4
+++ BugTracking.pm 13 Jan 2008 09:15:22 -0000 1.5
@@ -70,7 +70,7 @@
"Description:\n" . "$topic->{description}\n";
for (my $i = 0; $i <= $#ids; $i++) {
- $bug_db_connection->update_bug($ids[$i], $text);
+ $bug_db_connection->update_bug($ids[$i], $text, $topic_url);
}
$bug_db_connection->release_connection();
}
@@ -124,7 +124,7 @@
"State changed to \"$newstate\" by $user\n";
for (my $i = 0; $i <= $#ids; $i++) {
- $bug_db_connection->update_bug($ids[$i], $text);
+ $bug_db_connection->update_bug($ids[$i], $text, $topic_url);
}
$bug_db_connection->release_connection();
}
|
|
From: <si...@us...> - 2008-01-13 04:25:35
|
User: sits
Date: 08/01/12 20:25:34
Modified: bin install.pl
lib/Codestriker/DB Database.pm MySQL.pm
Log:
Support larger text sizes under MySQL
Index: install.pl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- install.pl 9 Jan 2008 06:16:05 -0000 1.13
+++ install.pl 13 Jan 2008 04:25:33 -0000 1.14
@@ -675,7 +675,7 @@
$database->add_field('project', 'state', $INT16);
# If we are using MySQL, and we are upgrading from a version of the database
-# which used "text" instead of "mediumtext" for certain fields, update the
+# which used "text" instead of "longtext" for certain fields, update the
# appropriate table columns.
if ($Codestriker::db =~ /^DBI:mysql/i) {
# Check that document field in topic is up-to-date.
Index: Database.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/DB/Database.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Database.pm 7 Aug 2006 02:14:48 -0000 1.10
+++ Database.pm 13 Jan 2008 04:25:34 -0000 1.11
@@ -64,6 +64,9 @@
RaiseError=>$raise_error,
LongReadLen=>10240000});
+ # To see debugging from the DBI driver.
+ # $self->{dbh}->{TraceLevel} = 1;
+
# Return the new connection.
return $self->{dbh};
}
Index: MySQL.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/DB/MySQL.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- MySQL.pm 10 Jun 2006 07:45:30 -0000 1.8
+++ MySQL.pm 13 Jan 2008 04:25:34 -0000 1.9
@@ -18,7 +18,7 @@
# Type mappings.
my $_TYPE = {
- $Codestriker::DB::Column::TYPE->{TEXT} => "mediumtext",
+ $Codestriker::DB::Column::TYPE->{TEXT} => "longtext",
$Codestriker::DB::Column::TYPE->{VARCHAR} => "varchar",
$Codestriker::DB::Column::TYPE->{INT32} => "int",
$Codestriker::DB::Column::TYPE->{INT16} => "smallint",
@@ -56,6 +56,7 @@
$dbh->do("SET NAMES 'utf8'");
$dbh->do("SET character_set_results='utf8'");
}
+ $dbh->do("SET max_allowed_packet=128000000");
return $dbh;
}
|
|
From: <si...@us...> - 2008-01-10 21:48:34
|
User: sits
Date: 08/01/10 13:48:34
Modified: . CHANGELOG
Log:
Updated changelog
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.220
retrieving revision 1.221
diff -u -r1.220 -r1.221
--- CHANGELOG 9 Jan 2008 06:16:05 -0000 1.220
+++ CHANGELOG 10 Jan 2008 21:48:34 -0000 1.221
@@ -7,6 +7,9 @@
and a revision number (for the start or end tag) to create a review
for a specific version of a file in a subversion repository.
+* Fixed database code which was preventing user metrics being updated
+ under SQL Server.
+
* Make sure the email subject field properly encodes underscores and
question marks. Submitted by jo...@us....
|
|
From: <si...@us...> - 2008-01-10 21:47:57
|
User: sits
Date: 08/01/10 13:47:52
Modified: lib/Codestriker/Model MetricStats.pm Metrics.pm
Log:
Fixed database code which was preventing user metrics from working under SQL Server.
Index: MetricStats.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/MetricStats.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- MetricStats.pm 18 Aug 2007 04:14:37 -0000 1.13
+++ MetricStats.pm 10 Jan 2008 21:47:52 -0000 1.14
@@ -134,7 +134,7 @@
my $total_time =
Codestriker::Model::Metrics->calculate_topic_view_time($select_topic);
- Codestriker::DB::DBI->release_connection($dbh);
+ Codestriker::DB::DBI->release_connection($dbh, 1);
$total_time = sprintf("%1.1f",$total_time / (60*60));
Index: Metrics.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Metrics.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Metrics.pm 25 Sep 2007 09:23:49 -0000 1.15
+++ Metrics.pm 10 Jan 2008 21:47:52 -0000 1.16
@@ -716,7 +716,7 @@
my $total_time = $self->calculate_topic_view_time($select_topic);
- Codestriker::DB::DBI->release_connection($dbh);
+ Codestriker::DB::DBI->release_connection($dbh, 1);
if ($total_time == 0) {
$total_time = "";
@@ -838,7 +838,7 @@
push @history_list, \%entry;
}
- Codestriker::DB::DBI->release_connection($dbh);
+ Codestriker::DB::DBI->release_connection($dbh, 1);
$self->{topichistoryrows} = \@history_list;
@@ -914,11 +914,10 @@
# Obtain a database connection.
my $dbh = Codestriker::DB::DBI->get_connection();
- # flush out the user metrics from the topic,
+ # Flush out the user metrics from the topic.
my $delete_alluser_metric =
$dbh->prepare_cached('DELETE FROM topicusermetric ' .
'WHERE topicid = ?');
-
$delete_alluser_metric->execute($self->{topicid});
my $insert_user_metric =
@@ -944,6 +943,7 @@
}
}
+
# Close the connection, and check for any database errors.
Codestriker::DB::DBI->release_connection($dbh, 1);
}
|
|
From: <si...@us...> - 2008-01-09 06:16:07
|
User: sits
Date: 08/01/08 22:16:06
Modified: . CHANGELOG
bin install.pl
lib/Codestriker/TopicListeners Email.pm
Log:
* Only require Authen::SASL as a pre-requisite if SMTP authentication
is needed. For some deployments, installing Authen::SASL can be
inconvenient.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.219
retrieving revision 1.220
diff -u -r1.219 -r1.220
--- CHANGELOG 9 Jan 2008 04:08:52 -0000 1.219
+++ CHANGELOG 9 Jan 2008 06:16:05 -0000 1.220
@@ -9,6 +9,10 @@
* Make sure the email subject field properly encodes underscores and
question marks. Submitted by jo...@us....
+
+* Only require Authen::SASL as a pre-requisite if SMTP authentication
+ is needed. For some deployments, installing Authen::SASL can be
+ inconvenient.
Version 1.9.4
Index: install.pl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- install.pl 10 Aug 2006 23:56:56 -0000 1.12
+++ install.pl 9 Jan 2008 06:16:05 -0000 1.13
@@ -109,11 +109,6 @@
name => 'Encode::Unicode',
version => '0',
optional => 0
- },
- {
- name => 'Authen::SASL',
- version => '0',
- optional => 0
}
];
@@ -126,6 +121,16 @@
push @{$modules}, $database->get_module_dependencies();
};
+# Check if Authen::SASL is required.
+if (defined $Codestriker::mailuser && $Codestriker::mailuser ne "" &&
+ defined $Codestriker::mailpasswd) {
+ # The next statement is a no-op, but it stops perl from issuing
+ # a warning about mailpasswd only being used once. Unlike the
+ # username, the password could be empty.
+ $Codestriker::mailpasswd = $Codestriker::mailpasswd;
+ push @{$modules}, { name => 'Authen::SASL', version => '0' };
+}
+
# Check for various character encoding modules that are required.
if (defined $Codestriker::topic_text_encoding) {
if ($Codestriker::topic_text_encoding =~ /euc\-cn|gb2312|hz|gbk/) {
Index: Email.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/Email.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- Email.pm 9 Jan 2008 04:08:53 -0000 1.24
+++ Email.pm 9 Jan 2008 06:16:05 -0000 1.25
@@ -17,7 +17,6 @@
use MIME::Base64;
use Sys::Hostname;
use Encode qw(encode);
-use Authen::SASL;
use Codestriker::TopicListeners::TopicListener;
@@ -445,7 +444,10 @@
defined $smtp || return "Unable to connect to mail server: $!";
# Perform SMTP authentication if required.
- if (defined $Codestriker::mailuser && defined $Codestriker::mailpasswd) {
+ if (defined $Codestriker::mailuser && $Codestriker::mailuser ne "" &&
+ defined $Codestriker::mailpasswd) {
+ eval 'use Authen::SASL';
+ die "Unable to load Authen::SASL module: $@\n" if $@;
$smtp->auth($Codestriker::mailuser, $Codestriker::mailpasswd);
}
|
|
From: <si...@us...> - 2008-01-09 04:08:54
|
User: sits
Date: 08/01/08 20:08:53
Modified: . CHANGELOG
lib Codestriker.pm
lib/Codestriker/TopicListeners Email.pm
Log:
Make sure the email subject field properly encodes underscores and
question marks. Submitted by jo...@us....
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -r1.218 -r1.219
--- CHANGELOG 24 Oct 2007 10:09:36 -0000 1.218
+++ CHANGELOG 9 Jan 2008 04:08:52 -0000 1.219
@@ -6,6 +6,9 @@
* Allow the ability to specify just a filename (for the module field)
and a revision number (for the start or end tag) to create a review
for a specific version of a file in a subversion repository.
+
+* Make sure the email subject field properly encodes underscores and
+ question marks. Submitted by jo...@us....
Version 1.9.4
Index: Codestriker.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker.pm,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -r1.105 -r1.106
--- Codestriker.pm 2 Oct 2007 04:38:21 -0000 1.105
+++ Codestriker.pm 9 Jan 2008 04:08:52 -0000 1.106
@@ -36,7 +36,7 @@
);
# Version of Codestriker.
-$Codestriker::VERSION = "1.9.4";
+$Codestriker::VERSION = "1.9.5";
# Default title to display on each Codestriker screen.
$Codestriker::title = "Codestriker $Codestriker::VERSION";
Index: Email.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/Email.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Email.pm 30 Nov 2007 20:46:54 -0000 1.23
+++ Email.pm 9 Jan 2008 04:08:53 -0000 1.24
@@ -489,9 +489,13 @@
# Make sure the subject is appropriately encoded to handle UTF-8
# characters.
- $smtp->datasend('Subject: =?UTF-8?Q?' .
- encode_qp(encode("UTF-8", $subject), '') .
- '?=' . "\n");
+ $subject = encode_qp(encode("UTF-8", $subject), "");
+
+ # RFC 2047 fixup that is a documented deviation from quoted-printable
+ $subject =~ s/\?/=3F/g;
+ $subject =~ s/_/=5F/g;
+ $subject =~ s/ /_/g;
+ $smtp->datasend("Subject: =?UTF-8?Q?${subject}?=\n");
# Set the content type to be text/plain with UTF8 encoding, to handle
# unicode characters.
|
|
From: <si...@us...> - 2007-11-30 20:47:27
|
User: sits
Date: 07/11/30 12:46:55
Modified: lib/Codestriker/TopicListeners Email.pm
Log:
Fixed a typo which prevented error messages being shown in some situations.
Index: Email.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/Email.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- Email.pm 29 Jun 2007 06:54:28 -0000 1.22
+++ Email.pm 30 Nov 2007 20:46:54 -0000 1.23
@@ -506,10 +506,10 @@
# characters.
$smtp->datasend(encode_qp(encode("UTF-8", $body)));
$smtp->dataend();
- $smtp->ok() || return "Couldn't send email $!, " . smtp->message();
+ $smtp->ok() || return "Couldn't send email $!, " . $smtp->message();
$smtp->quit();
- $smtp->ok() || return "Couldn't send email $!, " . smtp->message();
+ $smtp->ok() || return "Couldn't send email $!, " . $smtp->message();
return '';
}
|
|
From: <si...@us...> - 2007-10-24 10:09:41
|
User: sits
Date: 07/10/24 03:09:36
Modified: . CHANGELOG
lib/Codestriker/Repository Subversion.pm
Log:
* Allow the ability to specify just a filename (for the module field)
and a revision number (for the start or end tag) to create a review
for a specific version of a file in a subversion repository.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -r1.217 -r1.218
--- CHANGELOG 24 Sep 2007 22:45:16 -0000 1.217
+++ CHANGELOG 24 Oct 2007 10:09:36 -0000 1.218
@@ -1,6 +1,12 @@
*** When upgrading, don't forget to: "cd bin ; ./install.pl" ***
*** Also, it is _highly_ advisable to backup your data before upgrading ***
+Version 1.9.5
+
+* Allow the ability to specify just a filename (for the module field)
+ and a revision number (for the start or end tag) to create a review
+ for a specific version of a file in a subversion repository.
+
Version 1.9.4
* Emit a javascript warning if the external javascript files could
Index: Subversion.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Subversion.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Subversion.pm 12 Jul 2007 09:49:02 -0000 1.18
+++ Subversion.pm 24 Oct 2007 10:09:36 -0000 1.19
@@ -195,43 +195,85 @@
open($read_stdout_fh, '>', \$read_stdout_data);
my @args = ();
- push @args, 'diff';
- push @args, '--non-interactive';
- push @args, '--no-auth-cache';
- push @args, @{ $self->{userCmdLine} };
- push @args, '-r';
- push @args, $start_tag . ':' . $end_tag;
- push @args, '--old';
- push @args, $self->{repository_url};
- push @args, $module_name;
- Codestriker::execute_command($read_stdout_fh, $stderr_fh,
- $Codestriker::svn, @args);
-
- open($read_stdout_fh, '<', \$read_stdout_data);
- while(<$read_stdout_fh>) {
- my $line = $_;
+
+ my $revision;
+ if ($start_tag eq "" && $end_tag ne "") {
+ $revision = $end_tag;
+ } elsif ($start_tag ne "" && $end_tag eq "") {
+ $revision = $start_tag;
+ }
+
+ if (defined $revision) {
+ # Just pull out the actual contents of the file.
+ push @args, 'cat';
+ push @args, '--non-interactive';
+ push @args, '--no-auth-cache';
+ push @args, @{ $self->{userCmdLine} };
+ push @args, '-r';
+ push @args, $revision;
+ push @args, $self->{repository_url} . '/' . $module_name;
+ Codestriker::execute_command($read_stdout_fh, $stderr_fh,
+ $Codestriker::svn, @args);
+
+ open($read_stdout_fh, '<', \$read_stdout_data);
+ my $number_lines = 0;
+ while(<$read_stdout_fh>) {
+ $number_lines++;
+ }
+ Codestriker::execute_command($read_stdout_fh, $stderr_fh,
+ $Codestriker::svn, @args);
+
+ open($read_stdout_fh, '<', \$read_stdout_data);
+
+
+ # Fake the diff header.
+ print $stdout_fh "Index: $module_name\n";
+ print $stdout_fh "===================================================================\n";
+ print $stdout_fh "--- /dev/null\n";
+ print $stdout_fh "+++ $module_name\t(revision $revision)\n";
+ print $stdout_fh "@@ -0,0 +1,$number_lines @@\n";
+ while(<$read_stdout_fh>) {
+ print $stdout_fh "+ $_";
+ }
+ } else {
+ push @args, 'diff';
+ push @args, '--non-interactive';
+ push @args, '--no-auth-cache';
+ push @args, @{ $self->{userCmdLine} };
+ push @args, '-r';
+ push @args, $start_tag . ':' . $end_tag;
+ push @args, '--old';
+ push @args, $self->{repository_url};
+ push @args, $module_name;
+ Codestriker::execute_command($read_stdout_fh, $stderr_fh,
+ $Codestriker::svn, @args);
- # If the user specifies a path (a branch in Subversion), the
- # diff file does not come back with a path rooted from the
- # repository base making it impossible to pull the entire file
- # back out. This code attempts to change the diff file on the
- # fly to ensure that the full path is present. This is a bug
- # against Subversion, so eventually it will be fixed, so this
- # code can't break when the diff command starts returning the
- # full path.
- if ($line =~ /^--- / || $line =~ /^\+\+\+ / ||
- $line =~ /^Index: /) {
- # Check if the bug has been fixed.
- if ($line =~ /^\+\+\+ $module_name/ == 0 &&
- $line =~ /^--- $module_name/ == 0 &&
- $line =~ /^Index: $module_name/ == 0) {
+ open($read_stdout_fh, '<', \$read_stdout_data);
+ while(<$read_stdout_fh>) {
+ my $line = $_;
+
+ # If the user specifies a path (a branch in Subversion), the
+ # diff file does not come back with a path rooted from the
+ # repository base making it impossible to pull the entire file
+ # back out. This code attempts to change the diff file on the
+ # fly to ensure that the full path is present. This is a bug
+ # against Subversion, so eventually it will be fixed, so this
+ # code can't break when the diff command starts returning the
+ # full path.
+ if ($line =~ /^--- / || $line =~ /^\+\+\+ / ||
+ $line =~ /^Index: /) {
+ # Check if the bug has been fixed.
+ if ($line =~ /^\+\+\+ $module_name/ == 0 &&
+ $line =~ /^--- $module_name/ == 0 &&
+ $line =~ /^Index: $module_name/ == 0) {
$line =~ s/^--- /--- $directory\// or
- $line =~ s/^Index: /Index: $directory\// or
- $line =~ s/^\+\+\+ /\+\+\+ $directory\//;
+ $line =~ s/^Index: /Index: $directory\// or
+ $line =~ s/^\+\+\+ /\+\+\+ $directory\//;
+ }
}
- }
- print $stdout_fh $line;
+ print $stdout_fh $line;
+ }
}
return $Codestriker::OK;
|
|
From: <si...@us...> - 2007-10-02 04:38:22
|
User: sits Date: 07/10/01 21:38:21 Modified: lib Codestriker.pm Log: Bump version to 1.9.4 Index: Codestriker.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker.pm,v retrieving revision 1.104 retrieving revision 1.105 diff -u -r1.104 -r1.105 --- Codestriker.pm 24 Sep 2007 22:45:16 -0000 1.104 +++ Codestriker.pm 2 Oct 2007 04:38:21 -0000 1.105 @@ -36,7 +36,7 @@ ); # Version of Codestriker. -$Codestriker::VERSION = "1.9.4-rc2"; +$Codestriker::VERSION = "1.9.4"; # Default title to display on each Codestriker screen. $Codestriker::title = "Codestriker $Codestriker::VERSION"; |
|
From: <si...@us...> - 2007-09-25 09:23:51
|
User: sits Date: 07/09/25 02:23:50 Modified: lib/Codestriker/Model Metrics.pm Log: Fix SQL Server again, which was broken in RC2 due to the incorrect use of the LOWER() function on ntext fields. Index: Metrics.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/Metrics.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Metrics.pm 18 Aug 2007 04:14:37 -0000 1.14 +++ Metrics.pm 25 Sep 2007 09:23:49 -0000 1.15 @@ -807,9 +807,9 @@ 'topichistory.version, ' . 'topichistory.repository, ' . 'project.name, ' . - 'LOWER(topichistory.reviewers), ' . - 'LOWER(topichistory.cc), ' . - 'LOWER(topichistory.modified_by_user) ' . + 'topichistory.reviewers, ' . + 'topichistory.cc, ' . + 'topichistory.modified_by_user ' . 'FROM topichistory, project ' . 'WHERE topichistory.topicid = ? AND ' . 'topichistory.projectid = project.id ' . @@ -830,9 +830,9 @@ version=>$version, repository=>$repository, project=>decode_utf8($project), - reviewers=>$reviewers, - cc=>$cc, - modified_by=>$modified_by + reviewers=>lc($reviewers), + cc=>lc($cc), + modified_by=>lc($modified_by) ); push @history_list, \%entry; |
|
From: <si...@us...> - 2007-09-24 22:45:21
|
User: sits
Date: 07/09/24 15:45:17
Modified: . CHANGELOG
bin codestriker.pl.base
lib Codestriker.pm
lib/Codestriker/Repository ClearCaseDynamic.pm
Log:
* Support for using the ClearCase dynamic view under Windows.
Submitted by Steve Kinsman <ski...@us...>.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -r1.216 -r1.217
--- CHANGELOG 24 Sep 2007 21:25:45 -0000 1.216
+++ CHANGELOG 24 Sep 2007 22:45:16 -0000 1.217
@@ -67,6 +67,9 @@
lines in them. Submitted by Steve Kinsman
<ski...@us...>.
+* Support for using the ClearCase dynamic view under Windows.
+ Submitted by Steve Kinsman <ski...@us...>.
+
Version 1.9.3
* The project list screen now displays for each project, the total
Index: codestriker.pl.base
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/codestriker.pl.base,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- codestriker.pl.base 17 Jul 2006 01:21:35 -0000 1.23
+++ codestriker.pl.base 24 Sep 2007 22:45:16 -0000 1.24
@@ -27,7 +27,6 @@
use strict;
-use Config;
use CGI qw/:standard :html3/;
use CGI::Carp 'fatalsToBrowser';
@@ -72,12 +71,10 @@
# Set the PATH to something sane if we aren't running under windows.
# For a lot of annoying reasons, we can't run Codestriker in
# tainted mode under Win32.
-my $osname = $Config{'osname'};
-my $windows = (defined $osname && $osname eq "MSWin32") ? 1 : 0;
-if ($windows == 0) {
- $ENV{'PATH'} = '/bin:/usr/bin';
-} else {
+if (Codestriker::is_windows()) {
$ENV{'PATH'} = '';
+} else {
+ $ENV{'PATH'} = '/bin:/usr/bin';
}
# Prototypes of subroutines used in this module.
Index: Codestriker.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker.pm,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -r1.103 -r1.104
--- Codestriker.pm 6 Sep 2007 08:02:16 -0000 1.103
+++ Codestriker.pm 24 Sep 2007 22:45:16 -0000 1.104
@@ -11,6 +11,7 @@
use strict;
use Encode;
+use Config;
use Time::Local;
use IPC::Open3;
@@ -336,6 +337,12 @@
}
}
+# Determine if we are running under Windows.
+sub is_windows() {
+ my $osname = $Config{'osname'};
+ return defined $osname && $osname eq "MSWin32";
+}
+
# Returns the current time in a format suitable for a DBI timestamp value.
sub get_timestamp($$) {
my ($type, $time) = @_;
Index: ClearCaseDynamic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/ClearCaseDynamic.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ClearCaseDynamic.pm 3 Jul 2006 05:06:48 -0000 1.3
+++ ClearCaseDynamic.pm 24 Sep 2007 22:45:16 -0000 1.4
@@ -27,9 +27,8 @@
my ($type, $url) = @_;
my $self = {};
- $_ = $url;
- /(.*):(.*)/;
+ $url =~ /([^:]*):(.*)/;
$self->{dynamic_view_name} = $1;
$self->{vobs_dir} = $2;
@@ -41,18 +40,24 @@
sub retrieve ($$$\$)
{
my ($self, $filename, $revision, $content_array_ref) = @_;
+ my $error_msg = '';
+ my $clearcase;
- # Set the current view to the repository's dynamic view name.
- my $clearcase = ClearCase::CtCmd->new();
- (my $status, my $stdout, my $error_msg) =
- $clearcase->exec('setview', $self->{dynamic_view_name});
-
- # Check the result of the setview command.
- if ($status) {
- $error_msg = "Failed to open view: " . $self->{dynamic_view_name} .
- ": $error_msg\n";
- print STDERR "$error_msg\n";
- return $error_msg;
+ # Check if we are running under Windows, which doesn't support
+ # the setview and endview commands.
+ if (! Codestriker::is_windows()) {
+ # Set the current view to the repository's dynamic view name.
+ $clearcase = ClearCase::CtCmd->new();
+ (my $status, my $stdout, $error_msg) =
+ $clearcase->exec('setview', $self->{dynamic_view_name});
+
+ # Check the result of the setview command.
+ if ($status) {
+ $error_msg = "Failed to open view: " . $self->{dynamic_view_name} .
+ ": $error_msg\n";
+ print STDERR "$error_msg\n";
+ return $error_msg;
+ }
}
# Execute the remaining code in an eval block to ensure the endview
@@ -83,12 +88,14 @@
}
# Close the view.
- ($status, $stdout, $error_msg) =
- $clearcase->exec('endview', $self->{dynamic_view_name});
- if ($status) {
- $error_msg = "Failed to close view: " . $self->{dynamic_view_name} .
- ": $error_msg\n";
- print STDERR "$error_msg\n";
+ if (! Codestriker::is_windows()) {
+ (my $status, my $stdout, $error_msg) =
+ $clearcase->exec('endview', $self->{dynamic_view_name});
+ if ($status) {
+ $error_msg = "Failed to close view: " . $self->{dynamic_view_name} .
+ ": $error_msg\n";
+ print STDERR "$error_msg\n";
+ }
}
return $error_msg;
@@ -112,7 +119,8 @@
# Return a string representation of this repository.
sub toString ($) {
my ($self) = @_;
- return "clearcase:dyn:" . $self->{dynamic_view_name} . ":" . $self->{vobs_dir};
+ return "clearcase:dyn:" . $self->{dynamic_view_name} .
+ ":" . $self->{vobs_dir};
}
# Given a start tag, end tag and a module name, store the text into
|
|
From: <si...@us...> - 2007-09-24 21:25:47
|
User: sits
Date: 07/09/24 14:25:46
Modified: . CHANGELOG
lib/Codestriker/FileParser ClearCaseSerialDiff.pm
Log:
* Handle ClearCase diffs which contain "Directories are identical"
lines in them. Submitted by Steve Kinsman
<ski...@us...>.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.215
retrieving revision 1.216
diff -u -r1.215 -r1.216
--- CHANGELOG 25 Aug 2007 09:11:06 -0000 1.215
+++ CHANGELOG 24 Sep 2007 21:25:45 -0000 1.216
@@ -63,6 +63,10 @@
associated bug records. Submitted by Russell Cattelan
<cat...@th...>.
+* Handle ClearCase diffs which contain "Directories are identical"
+ lines in them. Submitted by Steve Kinsman
+ <ski...@us...>.
+
Version 1.9.3
* The project list screen now displays for each project, the total
Index: ClearCaseSerialDiff.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/ClearCaseSerialDiff.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ClearCaseSerialDiff.pm 8 Jun 2004 21:26:39 -0000 1.4
+++ ClearCaseSerialDiff.pm 24 Sep 2007 21:25:45 -0000 1.5
@@ -38,10 +38,12 @@
my $line = <$fh>;
while (defined($line)) {
# Skip any heading or trailing whitespace contained in the review
- # text, in addition to the "Files are identical" lines, which happen
- # due to the way review texts are generated.
+ # text, in addition to the "Files/Directories are identical" lines,
+ # which happen due to the way review texts are generated.
while (defined($line) &&
- ($line =~ /^\s*$/o || $line =~ /^Files are identical$/)) {
+ ($line =~ /^\s*$/o ||
+ $line =~ /^Files are identical$/o ||
+ $line =~ /^Directories are identical$/o)) {
$line = <$fh>;
}
return @result unless defined $line;
@@ -62,7 +64,7 @@
# This is very simple for now, but will need to be more
# sophisticated later.
if (defined $repository_root &&
- $filename =~ /^$repository_root[\/\\](.*)$/) {
+ $filename =~ /^$repository_root[\/\\](.*)$/o) {
$filename = $1;
$repmatch = 1;
} else {
@@ -99,7 +101,7 @@
# This is very simple for now, but will need to be more
# sophisticated later.
if (defined $repository_root &&
- $filename =~ /^$repository_root[\/\\](.*)$/) {
+ $filename =~ /^$repository_root[\/\\](.*)$/o) {
$filename = $1;
}
@@ -119,7 +121,8 @@
$line = <$fh>;
while (defined $line &&
$line !~ /^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*$/o) {
- if ($line !~ /^Files are identical$/o) {
+ if ($line !~ /^Files are identical$/o &&
+ $line !~ /^Directories are identical$/o) {
$text .= "+$line";
}
$line = <$fh>;
|
|
From: <si...@us...> - 2007-09-24 21:15:10
|
User: sits
Date: 07/09/24 14:15:08
Modified: lib/Codestriker/Http Response.pm
Log:
Fixed a whoops found by ski...@us...
Index: Response.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Response.pm,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- Response.pm 22 May 2007 04:07:35 -0000 1.41
+++ Response.pm 24 Sep 2007 21:15:08 -0000 1.42
@@ -474,7 +474,7 @@
"</result></response>\n";
}
else {
- if (! $self->{generated_header}) {
+ if (! $self->{header_generated}) {
print $query->header,
$query->start_html(-title=>'Codestriker error',
-bgcolor=>'white');
|
|
From: <si...@us...> - 2007-09-06 08:02:20
|
User: sits
Date: 07/09/06 01:02:17
Modified: lib Codestriker.pm
lib/Codestriker/Repository Cvs.pm RepositoryFactory.pm
Log:
Initial support for CVS SSPI repository
Index: Codestriker.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker.pm,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -r1.102 -r1.103
--- Codestriker.pm 12 Jul 2007 10:01:59 -0000 1.102
+++ Codestriker.pm 6 Sep 2007 08:02:16 -0000 1.103
@@ -35,7 +35,7 @@
);
# Version of Codestriker.
-$Codestriker::VERSION = "1.9.4";
+$Codestriker::VERSION = "1.9.4-rc2";
# Default title to display on each Codestriker screen.
$Codestriker::title = "Codestriker $Codestriker::VERSION";
Index: Cvs.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Cvs.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Cvs.pm 12 Jul 2007 09:49:02 -0000 1.8
+++ Cvs.pm 6 Sep 2007 08:02:17 -0000 1.9
@@ -55,6 +55,20 @@
bless $self, $type;
}
+# Factory method for creating an SSPI CVS repository object.
+sub build_sspi {
+ my ($type, $username, $password, $hostname, $cvsroot) = @_;
+
+ my $self = {};
+ $self->{optional_args} = "";
+ $self->{username} = $username;
+ $self->{hostname} = $hostname;
+ $self->{cvsroot} = $cvsroot;
+ $self->{url} = ":sspi:${username}:${password}\@${hostname}:${cvsroot}";
+ bless $self, $type;
+}
+
+
# Retrieve the data corresponding to $filename and $revision. Store each line
# into $content_array_ref.
sub retrieve {
Index: RepositoryFactory.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/RepositoryFactory.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- RepositoryFactory.pm 7 Jun 2007 04:46:27 -0000 1.22
+++ RepositoryFactory.pm 6 Sep 2007 08:02:17 -0000 1.23
@@ -48,6 +48,12 @@
# Pserver repository.
return Codestriker::Repository::Cvs->build_ext($1, $2, $3, $4);
+ } elsif ($repository =~ /^\s*:sspi:(.*):(.*)@(.*):([A-z]:[\\\/].*?)\\*\s*(.*)\s*$/i) {
+ # NT SSPI CVS repository. Example:
+ # :sspi:MYNTDOMAIN\jdoe:password@mycvsserver:c:\repository_on_server
+ # :sspi:<host address>:\ANDCVS
+ return Codestriker::Repository::Cvs->build_sspi($1, $2, $3, $4);
+
} elsif ($repository =~ /^\s*(https?:\/\/.*viewcvs\.cgi)\/*\s+(.*?)\/*\s*$/i) {
# View CVS repository.
return Codestriker::Repository::ViewCvs->new($1, $2);
|
|
From: <si...@us...> - 2007-08-27 16:09:06
|
User: sits
Date: 07/08/25 02:11:08
Modified: . CHANGELOG
lib/Codestriker/Action ViewTopicProperties.pm
lib/Codestriker/FileParser PerforceDescribe.pm
lib/Codestriker/BugDB BugDBConnectionFactory.pm
Added: lib/Codestriker/BugDB NoConnection.pm
Log:
* Handle the different text types that may be present in a Perforce diff.
Submitted by Russell Cattelan <cat...@th...>.
* Defined the "noconnection" option for $bug_db in codestriker.conf
so that it is possible to define what bug IDs are associated with
a topic, without updating an actual bug database when the topic
is created/closed. If $bugtracker is defined in codestriker.conf,
then links will be created on the topic properties screen to the
associated bug records. Submitted by Russell Cattelan
<cat...@th...>.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -r1.214 -r1.215
--- CHANGELOG 25 Aug 2007 06:23:12 -0000 1.214
+++ CHANGELOG 25 Aug 2007 09:11:06 -0000 1.215
@@ -52,6 +52,17 @@
locale. See http://marc.info/?l=subversion-users&m=118725115412403&w=3
for more information.
+* Handle the different text types that may be present in a Perforce diff.
+ Submitted by Russell Cattelan <cat...@th...>.
+
+* Defined the "noconnection" option for $bug_db in codestriker.conf
+ so that it is possible to define what bug IDs are associated with
+ a topic, without updating an actual bug database when the topic
+ is created/closed. If $bugtracker is defined in codestriker.conf,
+ then links will be created on the topic properties screen to the
+ associated bug records. Submitted by Russell Cattelan
+ <cat...@th...>.
+
Version 1.9.3
* The project list screen now displays for each project, the total
Index: ViewTopicProperties.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopicProperties.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ViewTopicProperties.pm 15 Jan 2006 21:20:05 -0000 1.13
+++ ViewTopicProperties.pm 25 Aug 2007 09:11:07 -0000 1.14
@@ -85,7 +85,7 @@
$vars->{'bug_ids'} = $topic->{bug_ids};
if (defined $topic->{bug_ids} && $topic->{bug_ids} ne "" &&
defined $Codestriker::bugtracker) {
- my @bug_id_array = split ',', $topic->{bug_ids};
+ my @bug_id_array = split /[\s,]+/, $topic->{bug_ids};
$vars->{'bug_id_array'} = \@bug_id_array;
$vars->{'bugtracker'} = $Codestriker::bugtracker;
}
Index: PerforceDescribe.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/PerforceDescribe.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PerforceDescribe.pm 24 Jul 2005 09:49:48 -0000 1.5
+++ PerforceDescribe.pm 25 Aug 2007 09:11:07 -0000 1.6
@@ -122,7 +122,7 @@
$line = <$fh>;
next unless defined $line;
- if ($filetype eq "text") {
+ if ($filetype =~ /.*text/) {
# Now read the entire diff chunk.
# Note there may be an optional '---' and '+++' lines
# before the chunk.
Index: BugDBConnectionFactory.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/BugDB/BugDBConnectionFactory.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BugDBConnectionFactory.pm 22 May 2005 10:46:32 -0000 1.3
+++ BugDBConnectionFactory.pm 25 Aug 2007 09:11:07 -0000 1.4
@@ -12,6 +12,7 @@
use strict;
use Codestriker::BugDB::BugzillaConnection;
use Codestriker::BugDB::FlysprayConnection;
+use Codestriker::BugDB::NoConnection;
# Factory method for retrieving a BugDBConnection object.
sub getBugDBConnection ($) {
@@ -22,6 +23,8 @@
return Codestriker::BugDB::BugzillaConnection->get_connection();
} elsif ($dbtype eq "flyspray") {
return Codestriker::BugDB::FlysprayConnection->get_connection();
+ } elsif ($dbtype =~ /^noconnect/) {
+ return Codestriker::BugDB::NoConnection->get_connection();
} else {
die "Unsupported bug database type: $dbtype";
}
Index: NoConnection.pm
===================================================================
RCS file: NoConnection.pm
diff -N NoConnection.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NoConnection.pm 25 Aug 2007 09:11:07 -0000 1.1
@@ -0,0 +1,38 @@
+###############################################################################
+# 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.
+
+# Connection class which actually doesn't connect to a real bug database.
+# All methods are no-ops.
+
+package Codestriker::BugDB::NoConnection;
+
+use strict;
+use DBI;
+
+# Static method for building a database connection.
+sub get_connection($) {
+ my ($type) = @_;
+ my $self = {};
+ bless $self, $type;
+}
+
+# Method for releasing a database connection.
+sub release_connection($) {
+}
+
+# Return true if the specified bugid exists in the bug database,
+# false otherwise.
+sub bugid_exists($$) {
+ return 1;
+}
+
+# Method for updating the bug with information that a code review has been
+# created/closed/committed against this bug.
+sub update_bug($$$$) {
+}
+
+1;
|
|
From: <si...@us...> - 2007-08-27 16:01:16
|
User: sits
Date: 07/08/24 23:23:12
Modified: . CHANGELOG
lib/Codestriker/Http Input.pm
Log:
Remove leading and trailing whitespace from emails and other parameters.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -r1.213 -r1.214
--- CHANGELOG 18 Aug 2007 04:54:08 -0000 1.213
+++ CHANGELOG 25 Aug 2007 06:23:12 -0000 1.214
@@ -43,7 +43,8 @@
in non-English locales.
* When calculating metrics, make sure email addresses are handled in
- a case-insensitive manner.
+ a case-insensitive manner. Also remove trailing/leading whitespace
+ from the addresses.
* Handle topic text that starts with the UTF-8 BOM.
Index: Input.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Input.pm,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- Input.pm 21 Jul 2006 06:25:28 -0000 1.44
+++ Input.pm 25 Aug 2007 06:23:12 -0000 1.45
@@ -293,12 +293,13 @@
}
# Untaint the specified property, against the expected regular expression.
+# Remove leading and trailing whitespace.
sub _untaint($$$) {
my ($self, $name, $regexp) = @_;
my $value = $self->{$name};
if (defined $value && $value ne "") {
- if ($value =~ /^(${regexp})$/) {
+ if ($value =~ /^\s*(${regexp})\s*$/) {
# Untaint the value.
$self->{$name} = $1;
} else {
|
|
From: <si...@us...> - 2007-08-18 04:54:12
|
User: sits
Date: 07/08/17 21:54:08
Modified: . CHANGELOG
lib/Codestriker/FileParser SubversionDiff.pm UnidiffUtils.pm
Log:
* Workaround for invalid diff files generated by Subversion in a Chinese
locale. See http://marc.info/?l=subversion-users&m=118725115412403&w=3
for more information.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.212
retrieving revision 1.213
diff -u -r1.212 -r1.213
--- CHANGELOG 18 Aug 2007 04:17:19 -0000 1.212
+++ CHANGELOG 18 Aug 2007 04:54:08 -0000 1.213
@@ -47,6 +47,10 @@
* Handle topic text that starts with the UTF-8 BOM.
+* Workaround for invalid diff files generated by Subversion in a Chinese
+ locale. See http://marc.info/?l=subversion-users&m=118725115412403&w=3
+ for more information.
+
Version 1.9.3
* The project list screen now displays for each project, the total
Index: SubversionDiff.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/SubversionDiff.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- SubversionDiff.pm 28 Jun 2007 07:01:11 -0000 1.7
+++ SubversionDiff.pm 18 Aug 2007 04:54:08 -0000 1.8
@@ -42,7 +42,7 @@
# For SVN diffs, the start of the diff block is the Index line.
# For SVN look diffs, the start of the diff block contains the change type.
# Also check for presence of property set blocks.
- while ($line =~ /^Property changes on: .*$/o) {
+ while ($line =~ /^.*Property changes on: .*$/o) {
$line = <$fh>;
return () unless defined $line &&
$line =~ /^___________________________________________________________________$/o;
@@ -50,12 +50,12 @@
# Keep reading until we either get to an Index: line, a property
# block, an Added/Deleted/Modified lines or the end of file.
while (defined $line &&
- $line !~ /^Index:/o &&
- $line !~ /^Added:/o &&
- $line !~ /^Deleted:/o &&
- $line !~ /^Modified:/o &&
- $line !~ /^Copied:/o &&
- $line !~ /^Property changes on:/o) {
+ $line !~ /^.*Index:/o &&
+ $line !~ /^.*Added:/o &&
+ $line !~ /^.*Deleted:/o &&
+ $line !~ /^.*Modified:/o &&
+ $line !~ /^.*Copied:/o &&
+ $line !~ /^.*Property changes on:/o) {
$line = <$fh>;
}
@@ -66,7 +66,7 @@
}
return () unless
- $line =~ /^(Index|Added|Modified|Copied|Deleted): (.*)$/o;
+ $line =~ /^.*(Index|Added|Modified|Copied|Deleted): (.*)$/o;
$entry_type = $1;
$filename = $2;
$line = <$fh>;
Index: UnidiffUtils.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/UnidiffUtils.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- UnidiffUtils.pm 14 Jul 2005 12:08:10 -0000 1.5
+++ UnidiffUtils.pm 18 Aug 2007 04:54:08 -0000 1.6
@@ -51,7 +51,7 @@
# read. Note Perforce diffs can contain empty lines.
if ($num_matched_old_lines >= $number_old_lines &&
$num_matched_new_lines >= $number_new_lines) {
- last unless $line =~ /^ /o || $line =~ /^$/o;
+ last unless $line =~ /^\s*$/o;
}
else {
if ($line =~ /^\-/o) {
|
|
From: <si...@us...> - 2007-08-18 04:17:26
|
User: sits
Date: 07/08/17 21:17:19
Modified: . CHANGELOG
lib/Codestriker/FileParser Parser.pm
Log:
* Handle topic text that starts with the UTF-8 BOM.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -r1.211 -r1.212
--- CHANGELOG 18 Aug 2007 04:15:46 -0000 1.211
+++ CHANGELOG 18 Aug 2007 04:17:19 -0000 1.212
@@ -45,6 +45,8 @@
* When calculating metrics, make sure email addresses are handled in
a case-insensitive manner.
+* Handle topic text that starts with the UTF-8 BOM.
+
Version 1.9.3
* The project list screen now displays for each project, the total
Index: Parser.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/Parser.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Parser.pm 10 Jun 2006 02:58:34 -0000 1.23
+++ Parser.pm 18 Aug 2007 04:17:19 -0000 1.24
@@ -57,7 +57,13 @@
}
binmode $fh;
+ my $first_line = 1;
while (<$fh>) {
+ if ($first_line) {
+ # Remove the UTF8 BOM if it exists.
+ s/^\xEF\xBB\xBF//o;
+ $first_line = 0;
+ }
my $line = Codestriker::decode_topic_text($_);
$line =~ s/\r\n/\n/go;
print $tmpfh $line;
|
|
From: <si...@us...> - 2007-08-18 04:15:50
|
User: sits
Date: 07/08/17 21:15:46
Modified: . CHANGELOG
Log:
Last commit was for:
* When calculating metrics, make sure email addresses are handled in
a case-insensitive manner.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -r1.210 -r1.211
--- CHANGELOG 3 Jul 2007 11:07:50 -0000 1.210
+++ CHANGELOG 18 Aug 2007 04:15:46 -0000 1.211
@@ -35,6 +35,16 @@
* Handle Subversion files which contain @ in the filename.
+* Codestriker now behaves correctly under mod_perl when retrieving
+ data externally from an SCM system, such as when the Parallel link
+ is clicked, or when a topic is created directly from the SCM.
+
+* Creating Subversion topics directly from the SCM now works correctly
+ in non-English locales.
+
+* When calculating metrics, make sure email addresses are handled in
+ a case-insensitive manner.
+
Version 1.9.3
* The project list screen now displays for each project, the total
|