codestriker-commits Mailing List for Codestriker: collaborative code reviewer (Page 24)
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...> - 2004-11-03 22:00:26
|
User: sits Date: 04/11/03 14:00:14 Modified: lib/Codestriker/Repository Vss.pm Log: Test VSS commit Index: Vss.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Vss.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- Vss.pm 3 Nov 2004 21:56:03 -0000 1.15 +++ Vss.pm 3 Nov 2004 22:00:13 -0000 1.16 @@ -14,8 +14,7 @@ use File::Temp qw/ tmpnam tempdir /; use IO::Handle; -# Switch for emitting debug information, which will output what VSS commands -# have executed. +# Switch for emitting debug information. my $_DEBUG = 1; # Constructor, which takes the username and password as parameters. |
|
From: <si...@us...> - 2004-11-03 21:56:16
|
User: sits Date: 04/11/03 13:56:04 Modified: lib/Codestriker/Repository Vss.pm Log: Test VSS commit Index: Vss.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Vss.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Vss.pm 3 Nov 2004 21:49:46 -0000 1.14 +++ Vss.pm 3 Nov 2004 21:56:03 -0000 1.15 @@ -14,7 +14,8 @@ use File::Temp qw/ tmpnam tempdir /; use IO::Handle; -# Switch for emitting debug information. +# Switch for emitting debug information, which will output what VSS commands +# have executed. my $_DEBUG = 1; # Constructor, which takes the username and password as parameters. |
|
From: <si...@us...> - 2004-11-03 21:52:38
|
User: sits
Date: 04/11/03 13:52:31
Modified: bin CodestrikerClient.pm
Log:
Updated so error message displays return string.
Index: CodestrikerClient.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/CodestrikerClient.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CodestrikerClient.pm 3 Nov 2004 20:48:33 -0000 1.2
+++ CodestrikerClient.pm 3 Nov 2004 21:52:30 -0000 1.3
@@ -66,7 +66,7 @@
# Indicate if the operation was successful.
my $response_content = $response->content;
my $rc = $response_content =~ /Topic URL: \<A HREF=\"(.*)\"/i;
- print STDERR "Failed to create topic, response: $content\n" if $rc == 0;
+ print STDERR "Failed to create topic, response: $response_content\n" if $rc == 0;
return $rc ? $1 : undef;
}
|
|
From: David S. <si...@us...> - 2004-11-03 21:52:09
|
Update of /cvsroot/codestriker/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18621 Modified Files: CodestrikerClient.pm loginfo Log Message: Updated codestriker client module. Index: loginfo =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/loginfo,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- loginfo 3 Nov 2004 21:40:49 -0000 1.5 +++ loginfo 3 Nov 2004 21:51:57 -0000 1.6 @@ -25,7 +25,7 @@ # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog -CVSROOT /cvsroot/sitedocs/CVSROOT/cvstools/syncmail -C 5 -u %{sVv} cod...@li... +#CVSROOT /cvsroot/sitedocs/CVSROOT/cvstools/syncmail -C 5 -u %{sVv} cod...@li... #codestriker /cvsroot/sitedocs/CVSROOT/cvstools/syncmail -C 5 -u %{sVv} cod...@li... Index: CodestrikerClient.pm =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/CodestrikerClient.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CodestrikerClient.pm 3 Nov 2004 21:48:53 -0000 1.1 +++ CodestrikerClient.pm 3 Nov 2004 21:51:57 -0000 1.2 @@ -66,7 +66,7 @@ # Indicate if the operation was successful. my $response_content = $response->content; my $rc = $response_content =~ /Topic URL: \<A HREF=\"(.*)\"/i; - print STDERR "Failed to create topic, response: $content\n" if $rc == 0; + print STDERR "Failed to create topic, response: $response_content\n" if $rc == 0; return $rc ? $1 : undef; } |
|
From: <si...@us...> - 2004-11-03 21:49:55
|
User: sits Date: 04/11/03 13:49:47 Modified: lib/Codestriker/Repository Vss.pm Log: Test commit Index: Vss.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Vss.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Vss.pm 3 Nov 2004 21:46:37 -0000 1.13 +++ Vss.pm 3 Nov 2004 21:49:46 -0000 1.14 @@ -14,8 +14,7 @@ use File::Temp qw/ tmpnam tempdir /; use IO::Handle; -# Switch for emitting debug information, which will output what VSS commands -# have executed. +# Switch for emitting debug information. my $_DEBUG = 1; # Constructor, which takes the username and password as parameters. |
|
From: David S. <si...@us...> - 2004-11-03 21:49:39
|
Update of /cvsroot/codestriker/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18026 Modified Files: checkoutlist log_accum.pl Log Message: Update for CodestrikerClient.pm in CVSROOT Index: log_accum.pl =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/log_accum.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- log_accum.pl 3 Nov 2004 00:50:30 -0000 1.1 +++ log_accum.pl 3 Nov 2004 21:49:25 -0000 1.2 @@ -73,7 +73,7 @@ $SUBJECT_PRE = 'CVS update:'; # Codestriker-specific imports. -use lib '/home/groups/c/co/codestriker/bin'; +use lib '/cvsroot/codestriker/CVSROOT'; use CodestrikerClient; # Codestriker specific parameters for topic creation. Index: checkoutlist =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/checkoutlist,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- checkoutlist 3 Nov 2004 21:46:15 -0000 1.4 +++ checkoutlist 3 Nov 2004 21:49:25 -0000 1.5 @@ -14,3 +14,4 @@ avail commit_prep.pl log_accum.pl +CodestrikerClient.pm |
|
From: David S. <si...@us...> - 2004-11-03 21:49:03
|
Update of /cvsroot/codestriker/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17812 Added Files: CodestrikerClient.pm Log Message: Special copy of CodestrikerClient.pm for CVS commits. --- NEW FILE: CodestrikerClient.pm --- ############################################################################### # 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. # Code for interacting with a Codestriker server via HTTP. # # Example usage for creating a new Codestriker topic. # # my $client = CodestrikerClient->new('http://localhost.localdomain/codestriker/codestriker.pl'); # $client->create_topic({ # topic_title => 'Automatic Topic from script', # topic_description => "Automatic Topic Description\nAnd more", # project_name => 'Project2', # repository => ':ext:sits@localhost:/home/sits/cvs', # bug_ids => '1', # email => 'sits', # reviewers => 'root', # topic_text => "Here is some text\nHere is some\n\nMore and more...\n"}); package CodestrikerClient; use strict; use LWP::UserAgent; use HTTP::Request; use HTTP::Request::Common; use File::Temp qw/ tempfile /; use IO::Handle; # Create a new CodestrikerClient object, which records the base URL of the server. sub new { my ($type, $url) = @_; my $self = {}; $self->{url} = $url; return bless $self, $type; } # Create a new topic. sub create_topic { my ($self, $params) = @_; # Create a temporary file containing the topic text. my ($tempfile_fh, $tempfile_filename) = tempfile(); $tempfile_fh->print($params->{topic_text}); $tempfile_fh->flush; # Perform the HTTP Post. my $ua = new LWP::UserAgent; my $content = [ action => 'submit_new_topic', topic_title => $params->{topic_title}, topic_description => $params->{topic_description}, project_name => $params->{project_name}, repository => $params->{repository}, bug_ids => $params->{bug_ids}, email => $params->{email}, reviewers => $params->{reviewers}, cc => $params->{cc}, topic_file => [$tempfile_filename]]; my $response = $ua->request(HTTP::Request::Common::POST($self->{url}, Content_Type => 'form-data', Content => $content)); # Indicate if the operation was successful. my $response_content = $response->content; my $rc = $response_content =~ /Topic URL: \<A HREF=\"(.*)\"/i; print STDERR "Failed to create topic, response: $content\n" if $rc == 0; return $rc ? $1 : undef; } 1; |
|
From: David S. <si...@us...> - 2004-11-03 21:46:26
|
Update of /cvsroot/codestriker/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17258 Modified Files: checkoutlist Log Message: Update scripts in checkoutlist Index: checkoutlist =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/checkoutlist,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- checkoutlist 3 Nov 2004 21:31:04 -0000 1.3 +++ checkoutlist 3 Nov 2004 21:46:15 -0000 1.4 @@ -13,4 +13,4 @@ # comment lines begin with '#' avail commit_prep.pl -log_info.pl +log_accum.pl |
|
From: David S. <si...@us...> - 2004-11-03 21:41:09
|
Update of /cvsroot/codestriker/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16235 Modified Files: loginfo Log Message: Added extra arg Index: loginfo =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/loginfo,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- loginfo 3 Nov 2004 00:59:25 -0000 1.4 +++ loginfo 3 Nov 2004 21:40:49 -0000 1.5 @@ -29,4 +29,4 @@ #codestriker /cvsroot/sitedocs/CVSROOT/cvstools/syncmail -C 5 -u %{sVv} cod...@li... -# codestriker $CVSROOT/CVSROOT/log_accum.pl %s +codestriker $CVSROOT/CVSROOT/log_accum.pl -u $USER %s |
|
From: David S. <si...@us...> - 2004-11-03 21:32:43
|
Update of /cvsroot/codestriker/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14949 Modified Files: commitinfo Log Message: Only run commit_prep.pl for codestriker module Index: commitinfo =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/commitinfo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- commitinfo 3 Nov 2004 00:59:25 -0000 1.3 +++ commitinfo 3 Nov 2004 21:32:19 -0000 1.4 @@ -14,4 +14,4 @@ # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ALL /cvsroot/sitedocs/CVSROOT/cvstools/cvs_acls -# DEFAULT $CVSROOT/CVSROOT/commit_prep.pl -r +codestriker $CVSROOT/CVSROOT/commit_prep.pl -r |
|
From: David S. <si...@us...> - 2004-11-03 21:31:25
|
Update of /cvsroot/codestriker/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14620 Modified Files: checkoutlist Log Message: Added extra scripts Index: checkoutlist =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/checkoutlist,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- checkoutlist 2 Nov 2004 22:39:27 -0000 1.2 +++ checkoutlist 3 Nov 2004 21:31:04 -0000 1.3 @@ -12,3 +12,5 @@ # # comment lines begin with '#' avail +commit_prep.pl +log_info.pl |
|
From: David S. <si...@us...> - 2004-11-03 00:59:36
|
Update of /cvsroot/codestriker/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17927 Modified Files: commitinfo loginfo Log Message: Use the Codestriker post-commit scripts. Index: loginfo =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/loginfo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- loginfo 2 Nov 2004 23:53:39 -0000 1.3 +++ loginfo 3 Nov 2004 00:59:25 -0000 1.4 @@ -24,6 +24,9 @@ #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog + CVSROOT /cvsroot/sitedocs/CVSROOT/cvstools/syncmail -C 5 -u %{sVv} cod...@li... -codestriker /cvsroot/sitedocs/CVSROOT/cvstools/syncmail -C 5 -u %{sVv} cod...@li... +#codestriker /cvsroot/sitedocs/CVSROOT/cvstools/syncmail -C 5 -u %{sVv} cod...@li... + +codestriker $CVSROOT/CVSROOT/log_accum.pl %s Index: commitinfo =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/commitinfo,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- commitinfo 2 Nov 2004 22:40:58 -0000 1.2 +++ commitinfo 3 Nov 2004 00:59:25 -0000 1.3 @@ -14,3 +14,4 @@ # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ALL /cvsroot/sitedocs/CVSROOT/cvstools/cvs_acls +DEFAULT $CVSROOT/CVSROOT/commit_prep.pl -r |
|
From: David S. <si...@us...> - 2004-11-03 00:50:56
|
Update of /cvsroot/codestriker/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16397 Added Files: commit_prep.pl log_accum.pl Log Message: CVS post-commit scripts for Codestriker project. --- NEW FILE: log_accum.pl --- #!/usr/bin/perl # # Perl filter to handle the log messages from the checkin of files in # a directory. This script will group the lists of files by log # message, and mail a single consolidated log message at the end of # the commit. # # This file assumes a pre-commit checking program that leaves the # names of the first and last commit directories in a temporary file. # # Contributed by David Hampton <ha...@ci...> # Roy Fielding removed useless code and added log/mail of new files # Ken Coar added special processing (i.e., no diffs) for binary files # Jon Stevens added a few new features and cleaned up some of the # output # # David Sitsky modified this slightly so that it also creates a new # codestriker topic automatically. ############################################################ # # Setup instructions # ############################################################ # # Create a directory $CVSROOT/commitlogs and allow # the cvs process to write to it. # # Edit the options below. # ############################################################ # # Configurable options # ############################################################ # # Where do you want the RCS ID and delta info? # 0 = none, # 1 = in mail only, # 2 = rcsids in both mail and logs. # $rcsidinfo = 2; ############################################################ # # Constants # ############################################################ $STATE_NONE = 0; $STATE_CHANGED = 1; $STATE_ADDED = 2; $STATE_REMOVED = 3; $STATE_LOG = 4; $TMPDIR = $ENV{'TMPDIR'} || '/tmp'; $FILE_PREFIX = '#cvs.'; $LAST_FILE = "$TMPDIR/${FILE_PREFIX}lastdir"; $CHANGED_FILE = "$TMPDIR/${FILE_PREFIX}files.changed"; $ADDED_FILE = "$TMPDIR/${FILE_PREFIX}files.added"; $REMOVED_FILE = "$TMPDIR/${FILE_PREFIX}files.removed"; $LOG_FILE = "$TMPDIR/${FILE_PREFIX}files.log"; $BRANCH_FILE = "$TMPDIR/${FILE_PREFIX}files.branch"; $SUMMARY_FILE = "$TMPDIR/${FILE_PREFIX}files.summary"; $CVSROOT = $ENV{'CVSROOT'}; $CVSBIN = '/usr/bin'; $PATH = "$PATH:/bin:/usr/bin"; $MAIL_CMD = "| /usr/lib/sendmail -i -t"; $MAIL_TO = 'cod...@li...'; $MAIL_FROM = "$ENV{'USER'}\@users.sourceforge.net"; $SUBJECT_PRE = 'CVS update:'; # Codestriker-specific imports. use lib '/home/groups/c/co/codestriker/bin'; use CodestrikerClient; # Codestriker specific parameters for topic creation. $CODESTRIKER_URL = 'http://codestriker.sf.net/cgi-bin/codestriker.pl'; $CODESTRIKER_PROJECT = 'Codestriker'; $CODESTRIKER_REPOSITORY = '/cvsroot/codestriker'; $CODESTRIKER_REVIEWERS = 'cod...@li...'; $CODESTRIKER_CC = ''; ############################################################ # # Subroutines # ############################################################ sub format_names { local($dir, @files) = @_; local(@lines); $lines[0] = sprintf(" %-08s", $dir); foreach $file (@files) { if (length($lines[$#lines]) + length($file) > 60) { $lines[++$#lines] = sprintf(" %8s", " "); } $lines[$#lines] .= " ".$file; } @lines; } sub cleanup_tmpfiles { local(@files); opendir(DIR, $TMPDIR); push(@files, grep(/^${FILE_PREFIX}.*\.${id}$/, readdir(DIR))); closedir(DIR); foreach (@files) { unlink "$TMPDIR/$_"; } } sub write_logfile { local($filename, @lines) = @_; open(FILE, ">$filename") || die ("Cannot open log file $filename: $!\n"); print(FILE join("\n", @lines), "\n"); close(FILE); } sub append_to_file { local($filename, $dir, @files) = @_; if (@files) { local(@lines) = &format_names($dir, @files); open(FILE, ">>$filename") || die ("Cannot open file $filename: $!\n"); print(FILE join("\n", @lines), "\n"); close(FILE); } } sub write_line { local($filename, $line) = @_; open(FILE, ">$filename") || die("Cannot open file $filename: $!\n"); print(FILE $line, "\n"); close(FILE); } sub append_line { local($filename, $line) = @_; open(FILE, ">>$filename") || die("Cannot open file $filename: $!\n"); print(FILE $line, "\n"); close(FILE); } sub read_line { local($filename) = @_; local($line); open(FILE, "<$filename") || die("Cannot open file $filename: $!\n"); $line = <FILE>; close(FILE); chomp($line); $line; } sub read_file { local($filename, $leader) = @_; local(@text) = (); open(FILE, "<$filename") || return (); while (<FILE>) { chomp; push(@text, sprintf(" %-10s %s", $leader, $_)); $leader = ""; } close(FILE); @text; } sub read_logfile { local($filename, $leader) = @_; local(@text) = (); open(FILE, "<$filename") || die ("Cannot open log file $filename: $!\n"); while (<FILE>) { chomp; push(@text, $leader.$_); } close(FILE); @text; } # # do an 'cvs -Qn status' on each file in the arguments, and extract info. # sub change_summary { local($out, @filenames) = @_; local(@revline); local($file, $rev, $rcsfile, $line); while (@filenames) { $file = shift @filenames; if ("$file" eq "") { next; } open(RCS, "-|") || exec "$CVSBIN/cvs", '-Qn', 'status', $file; $rev = ""; $delta = ""; $rcsfile = ""; while (<RCS>) { if (/^[ \t]*Repository revision/) { chomp; @revline = split(' ', $_); $rev = $revline[2]; $rcsfile = $revline[3]; $rcsfile =~ s,^$CVSROOT/,,; $rcsfile =~ s/,v$//; } } close(RCS); if ($rev ne '' && $rcsfile ne '') { open(RCS, "-|") || exec "$CVSBIN/cvs", '-Qn', 'log', "-r$rev", $file; while (<RCS>) { if (/^date:/) { chomp; $delta = $_; $delta =~ s/^.*;//; $delta =~ s/^[\s]+lines://; } } close(RCS); } $diff = "\n\n"; # # Get the differences between this and the previous revision, # being aware that new files always have revision '1.1' and # new branches always end in '.n.1'. # if ($rev =~ /^(.*)\.([0-9]+)$/) { $prev = $2 - 1; $prev_rev = $1 . '.' . $prev; $prev_rev =~ s/\.[0-9]+\.0$//;# Truncate if first rev on branch open(DIFF, "-|") || exec "$CVSBIN/cvs", '-Qn', 'diff', '-uN', "-r$prev_rev", "-r$rev", $file; while (<DIFF>) { $diff .= $_; } close(DIFF); $diff .= "\n\n"; } &append_line($out, $diff); } } sub build_header { local($header); delete $ENV{'TZ'}; local($sec,$min,$hour,$mday,$mon,$year) = localtime(time); $header = sprintf(" User: %-8s\n Date: %02d/%02d/%02d %02d:%02d:%02d", $cvs_user, $year%100, $mon+1, $mday, $hour, $min, $sec); } # !!! Mailing-list and history file mappings here !!! sub mlist_map { local($path) = @_; if ($path =~ /^([^\/]+)/) { return $1; } else { return 'apache'; } } sub do_changes_file { local($category, @text) = @_; local($changes); $changes = "$CVSROOT/CVSROOT/commitlogs/$category"; if (open(CHANGES, ">>$changes")) { print(CHANGES join("\n", @text), "\n\n"); close(CHANGES); } else { warn "Cannot open $changes: $!\n"; } } sub mail_notification { local(@text) = @_; # print "Mailing the commit message...\n"; open(MAIL, $MAIL_CMD); print MAIL "From: $MAIL_FROM\n"; print MAIL "To: $MAIL_TO\n"; print MAIL "Subject: $SUBJECT_PRE $ARGV[0]\n\n"; print(MAIL join("\n", @text)); close(MAIL); } # Create a Codestriker topic. The topic title will be the # first line of the log message prefixed with "CVS commit: ". # The topic description is the entire log message. # Return the URL of the created topic if successful, otherwise # undef. sub codestriker_create_topic { local($user, $log_ref, $diff_ref) = @_; local(@log) = @{$log_ref}; local(@diff) = @{$diff_ref}; my $topic_title = "CVS commit: " .$log[0]; my $topic_description = join("\n", @log); my $bug_ids = $topic_description; # Truncate the title if necessary. if (length($topic_title) > 57) { $topic_title = substr($topic_title, 0, 57) . "..."; } # Check for any matching Bug id text. my @bugs = (); $bug_ids =~ s/.*[Bb][Uu][Gg]:?(\d+)\b.*/$1 /g; while ($bug_ids =~ /\b[Bb][Uu][Gg]:?\s*(\d+)\b/g) { push @bugs, $1; } my $client = CodestrikerClient->new($CODESTRIKER_URL); return $client->create_topic({ topic_title => $topic_title, topic_description => $topic_description, project_name => $CODESTRIKER_PROJECT, repository => $CODESTRIKER_REPOSITORY, bug_ids => join(", ", @bugs), email => $user, reviewers => $CODESTRIKER_REVIEWERS, cc => $CODESTRIKER_CC, topic_text => join("\n", @diff) }); } ## process the command line arguments sent to this script ## it returns an array of files, %s, sent from the loginfo ## command sub process_argv { local(@argv) = @_; local(@files); local($arg); # print "Processing log script arguments...\n"; while (@argv) { $arg = shift @argv; if ($arg eq '-u') { $cvs_user = shift @argv; } else { ($donefiles) && die "Too many arguments!\n"; $donefiles = 1; $ARGV[0] = $arg; @files = split(' ', $arg); } } return @files; } ############################################################# # # Main Body # ############################################################ # # Setup environment # umask (002); # # Initialize basic variables # $id = getpgrp(); $state = $STATE_NONE; $cvs_user = $ENV{'USER'} || getlogin || (getpwuid($<))[0] || sprintf("uid#%d",$<); @files = process_argv(@ARGV); @path = split('/', $files[0]); $repository = $path[0]; if ($#path == 0) { $dir = "."; } else { $dir = join('/', @path[1..$#path]); } #print("ARGV - ", join(":", @ARGV), "\n"); #print("files - ", join(":", @files), "\n"); #print("path - ", join(":", @path), "\n"); #print("dir - ", $dir, "\n"); #print("id - ", $id, "\n"); # # Map the repository directory to a name for commitlogs. # $mlist = &mlist_map($files[0]); ########################## # Uncomment the following if we ever have per-repository cvs mail # if (defined($mlist)) { # $MAIL_TO = $mlist . '-cvs'; # } # else { undef $MAIL_TO; } ########################## # # Check for a new directory first. This will always appear as a # single item in the argument list, and an empty log message. # if ($ARGV[0] =~ /New directory/) { $header = &build_header; @text = (); push(@text, $header); push(@text, ""); push(@text, " ".$ARGV[0]); &do_changes_file($mlist, @text); &mail_notification(@text) if defined($MAIL_TO); exit 0; } # # Iterate over the body of the message collecting information. # while (<STDIN>) { chomp; # Drop the newline if (/^Revision\/Branch:/) { s,^Revision/Branch:,,; push (@branch_lines, split); next; } # next if (/^[ \t]+Tag:/ && $state != $STATE_LOG); if (/^Modified Files/) { $state = $STATE_CHANGED; next; } if (/^Added Files/) { $state = $STATE_ADDED; next; } if (/^Removed Files/) { $state = $STATE_REMOVED; next; } if (/^Log Message/) { $state = $STATE_LOG; next; } s/[ \t\n]+$//; # delete trailing space push (@changed_files, split) if ($state == $STATE_CHANGED); push (@added_files, split) if ($state == $STATE_ADDED); push (@removed_files, split) if ($state == $STATE_REMOVED); if ($state == $STATE_LOG) { if (/^PR:$/i || /^Reviewed by:$/i || /^Submitted by:$/i || /^Obtained from:$/i) { next; } push (@log_lines, $_); } } # # Strip leading and trailing blank lines from the log message. Also # compress multiple blank lines in the body of the message down to a # single blank line. # (Note, this only does the mail and changes log, not the rcs log). # while ($#log_lines > -1) { last if ($log_lines[0] ne ""); shift(@log_lines); } while ($#log_lines > -1) { last if ($log_lines[$#log_lines] ne ""); pop(@log_lines); } for ($i = $#log_lines; $i > 0; $i--) { if (($log_lines[$i - 1] eq "") && ($log_lines[$i] eq "")) { splice(@log_lines, $i, 1); } } # # Find the log file that matches this log message # for ($i = 0; ; $i++) { last if (! -e "$LOG_FILE.$i.$id"); @text = &read_logfile("$LOG_FILE.$i.$id", ""); last if ($#text == -1); last if (join(" ", @log_lines) eq join(" ", @text)); } # # Spit out the information gathered in this pass. # &write_logfile("$LOG_FILE.$i.$id", @log_lines); &append_to_file("$BRANCH_FILE.$i.$id", $dir, @branch_lines); &append_to_file("$ADDED_FILE.$i.$id", $dir, @added_files); &append_to_file("$CHANGED_FILE.$i.$id", $dir, @changed_files); &append_to_file("$REMOVED_FILE.$i.$id", $dir, @removed_files); if ($rcsidinfo) { &change_summary("$SUMMARY_FILE.$i.$id", (@changed_files, @added_files, @removed_files)); } # # Check whether this is the last directory. If not, quit. # if (-e "$LAST_FILE.$id") { $_ = &read_line("$LAST_FILE.$id"); $tmpfiles = $files[0]; $tmpfiles =~ s,([^a-zA-Z0-9_/]),\\$1,g; if (! grep(/$tmpfiles$/, $_)) { print "More commits to come...\n"; exit 0 } } # # This is it. The commits are all finished. Lump everything together # into a single message, fire a copy off to the mailing list, and drop # it on the end of the Changes file. # $header = &build_header; # # Produce the final compilation of the log messages # @text = (); @diff_text = (); push(@text, $header); push(@text, ""); for ($i = 0; ; $i++) { last if (! -e "$LOG_FILE.$i.$id"); push(@text, &read_file("$BRANCH_FILE.$i.$id", "Branch:")); push(@text, &read_file("$CHANGED_FILE.$i.$id", "Modified:")); push(@text, &read_file("$ADDED_FILE.$i.$id", "Added:")); push(@text, &read_file("$REMOVED_FILE.$i.$id", "Removed:")); push(@text, " Log:"); push(@text, &read_logfile("$LOG_FILE.$i.$id", " ")); if ($rcsidinfo == 2) { if (-e "$SUMMARY_FILE.$i.$id") { push(@text, " "); push(@diff_text, &read_logfile("$SUMMARY_FILE.$i.$id", "")); push(@text, &read_logfile("$SUMMARY_FILE.$i.$id", " ")); } } push(@text, ""); } # # Append the log message to the commitlogs/<module> file # &do_changes_file($mlist, @text); # # Now generate the extra info for the mail message.. # if ($rcsidinfo == 1) { $revhdr = 0; for ($i = 0; ; $i++) { last if (! -e "$SUMMARY_FILE.$i.$id"); if (-e "$SUMMARY_FILE.$i.$id") { if (!$revhdr++) { push(@text, "Revision Changes Path"); } push(@text, &read_logfile("$SUMMARY_FILE.$i.$id", "")); push(@diff_text, &read_logfile("$SUMMARY_FILE.$i.$id", "")); } } if ($revhdr) { push(@text, ""); # consistancy... } } # # Now create the Codestriker topic. # my $topic_url = &codestriker_create_topic($cvs_user, \@log_lines, \@diff_text); # # Mail out the notification. Prepend the topic url if it is defined. # if (defined($MAIL_TO)) { if (defined($topic_url)) { unshift @text, ""; unshift @text, " $topic_url"; unshift @text, " Created Codestriker topic at:"; } &mail_notification(@text) if defined($MAIL_TO); } &cleanup_tmpfiles; exit 0; --- NEW FILE: commit_prep.pl --- #! /usr/bin/perl # -*-Perl-*- # # # Perl filter to handle pre-commit checking of files. This program # records the last directory where commits will be taking place for # use by the log_accum.pl script. For new files, it forces the # existence of a RCS "Id" keyword in the first ten lines of the file. # For existing files, it checks version number in the "Id" line to # prevent losing changes because an old version of a file was copied # into the direcory. # # Possible future enhancements: # # Check for cruft left by unresolved conflicts. Search for # "^<<<<<<<$", "^-------$", and "^>>>>>>>$". # # Look for a copyright and automagically update it to the # current year. [[ bad idea! -- woods ]] # # # Contributed by David Hampton <ha...@ci...> # # Hacked on lots by Greg A. Woods <wo...@we...> # # Configurable options # # Constants (remember to protect strings from RCS keyword substitution) # $LAST_FILE = "/tmp/#cvs.lastdir"; # must match name in log_accum.pl $ENTRIES = "CVS/Entries"; # Patterns to find $Log keywords in files # $LogString1 = "\\\$\\Log: .* \\\$"; $LogString2 = "\\\$\\Log\\\$"; $NoLog = "%s - contains an RCS \$Log keyword. It must not!\n"; # pattern to match an RCS Id keyword line with an existing ID # $IDstring = "\"@\\(#\\)[^:]*:.*\\\$\Id: .*\\\$\""; $NoId = " %s - Does not contain a properly formatted line with the keyword \"Id:\". I.e. no lines match \"" . $IDstring . "\". Please see the template files for an example.\n"; # pattern to match an RCS Id keyword line for a new file (i.e. un-expanded) # $NewId = "\"@(#)[^:]*:.*\\$\Id\\$\""; $NoName = " %s - The ID line should contain only \"@(#)module/path:\$Name\$:\$\Id\$\" for a newly created file.\n"; $BadName = " %s - The file name '%s' in the ID line does not match the actual filename.\n"; $BadVersion = " %s - How dare you!!! You replaced your copy of the file '%s', which was based upon version %s, with an %s version based upon %s. Please move your '%s' out of the way, perform an update to get the current version, and them merge your changes into that file, then try the commit again.\n"; # # Subroutines # sub write_line { local($filename, $line) = @_; open(FILE, ">$filename") || die("Cannot open $filename, stopped"); print(FILE $line, "\n"); close(FILE); } sub check_version { local($i, $id, $rname, $version); local($filename, $cvsversion) = @_; open(FILE, "<$filename") || return(0); @all_lines = (); $idpos = -1; $newidpos = -1; for ($i = 0; <FILE>; $i++) { chop; push(@all_lines, $_); if ($_ =~ /$IDstring/) { $idpos = $i; } if ($_ =~ /$NewId/) { $newidpos = $i; } } if (grep(/$LogString1/, @all_lines) || grep(/$LogString2/, @all_lines)) { print STDERR sprintf($NoLog, $filename); return(1); } if ($debug != 0) { print STDERR sprintf("file = %s, version = %d.\n", $filename, $cvsversion{$filename}); } if ($cvsversion{$filename} == 0) { if ($newidpos != -1 && $all_lines[$newidpos] !~ /$NewId/) { print STDERR sprintf($NoName, $filename); return(1); } return(0); } if ($idpos == -1) { print STDERR sprintf($NoId, $filename); return(1); } $line = $all_lines[$idpos]; $pos = index($line, "Id: "); if ($debug != 0) { print STDERR sprintf("%d in '%s'.\n", $pos, $line); } ($id, $rname, $version) = split(' ', substr($line, $pos)); if ($rname ne "$filename,v") { print STDERR sprintf($BadName, $filename, substr($rname, 0, length($rname)-2)); return(1); } if ($cvsversion{$filename} < $version) { print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename}, "newer", $version, $filename); return(1); } if ($cvsversion{$filename} > $version) { print STDERR sprintf($BadVersion, $filename, $filename, $cvsversion{$filename}, "older", $version, $filename); return(1); } return(0); } # # Main Body # $id = getpgrp(); # You *must* use a shell that does setpgrp()! # Check each file (except dot files) for an RCS "Id" keyword. # $check_id = 0; # Record the directory for later use by the log_accumulate stript. # $record_directory = 0; # parse command line arguments # while (@ARGV) { $arg = shift @ARGV; if ($arg eq '-d') { $debug = 1; print STDERR "Debug turned on...\n"; } elsif ($arg eq '-c') { $check_id = 1; } elsif ($arg eq '-r') { $record_directory = 1; } else { push(@files, $arg); } } $directory = shift @files; if ($debug != 0) { print STDERR "dir - ", $directory, "\n"; print STDERR "files - ", join(":", @files), "\n"; print STDERR "id - ", $id, "\n"; } # Suck in the CVS/Entries file # open(ENTRIES, $ENTRIES) || die("Cannot open $ENTRIES.\n"); while (<ENTRIES>) { local($filename, $version) = split('/', substr($_, 1)); $cvsversion{$filename} = $version; } # Now check each file name passed in, except for dot files. Dot files # are considered to be administrative files by this script. # if ($check_id != 0) { $failed = 0; foreach $arg (@files) { if (index($arg, ".") == 0) { next; } $failed += &check_version($arg); } if ($failed) { print STDERR "\n"; exit(1); } } # Record this directory as the last one checked. This will be used # by the log_accumulate script to determine when it is processing # the final directory of a multi-directory commit. # if ($record_directory != 0) { &write_line("$LAST_FILE.$id", $directory); } exit(0); |
|
From: David S. <si...@us...> - 2004-11-02 23:53:48
|
Update of /cvsroot/codestriker/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4458 Modified Files: loginfo Log Message: Increase context lines to 5, and use unidiffs Index: loginfo =================================================================== RCS file: /cvsroot/codestriker/CVSROOT/loginfo,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** loginfo 2 Nov 2004 22:56:13 -0000 1.2 --- loginfo 2 Nov 2004 23:53:39 -0000 1.3 *************** *** 25,29 **** # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ! CVSROOT /cvsroot/sitedocs/CVSROOT/cvstools/syncmail %{sVv} cod...@li... ! codestriker /cvsroot/sitedocs/CVSROOT/cvstools/syncmail %{sVv} cod...@li... --- 25,29 ---- # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ! CVSROOT /cvsroot/sitedocs/CVSROOT/cvstools/syncmail -C 5 -u %{sVv} cod...@li... ! codestriker /cvsroot/sitedocs/CVSROOT/cvstools/syncmail -C 5 -u %{sVv} cod...@li... |
|
From: David S. <si...@us...> - 2004-11-02 23:30:06
|
Update of /cvsroot/codestriker/codestriker/lib/Codestriker/Repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31489/Codestriker/Repository Modified Files: Vss.pm Log Message: Updated comment - and test for email notification. Index: Vss.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Vss.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Vss.pm 31 Oct 2004 21:26:51 -0000 1.10 --- Vss.pm 2 Nov 2004 23:29:53 -0000 1.11 *************** *** 15,19 **** use IO::Handle; ! # Switch for emitting debug information. my $_DEBUG = 1; --- 15,20 ---- use IO::Handle; ! # Switch for emitting debug information, which will output what VSS commands ! # have executed. my $_DEBUG = 1; |