Thread: [Codestriker-commits] CVS update: codestriker/lib/Codestriker/Repository Subversion.pm
Brought to you by:
sits
|
From: <si...@us...> - 2005-06-09 07:22:23
|
Created Codestriker topic at: http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=1593074&action=view User: sits Date: 05/06/09 00:22:05 Modified: . codestriker.conf lib Codestriker.pm lib/Codestriker/Repository Subversion.pm Log: Make the path to the subversion client specified in the configuration file, as for Win32 systes, this won't be in the web-server's path, and we do this for all the other utilities anyway. Index: codestriker.conf =================================================================== RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- codestriker.conf 22 May 2005 11:26:28 -0000 1.72 +++ codestriker.conf 9 Jun 2005 07:22:03 -0000 1.73 @@ -36,6 +36,10 @@ #$cvs = 'c:/Program Files/GNU/WinCvs 1.3/CVSNT/cvs.exe'; $cvs = '/usr/bin/cvs'; +# Location of the svn binary. +#$svn = 'c:/Program Files/SVN/svn.exe'; +$svn = '/usr/bin/svn'; + # Location of the ssh binary. This is only required if a CVS :ext # type repository is used. $ssh = '/usr/local/bin/ssh'; Index: Codestriker.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker.pm,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- Codestriker.pm 7 Jun 2005 22:51:45 -0000 1.75 +++ Codestriker.pm 9 Jun 2005 07:22:04 -0000 1.76 @@ -14,7 +14,7 @@ use Time::Local; # Export codestriker.conf configuration variables. -use vars qw ( $mailhost $use_compression $gzip $cvs $ssh $p4 $vss $bugtracker +use vars qw ( $mailhost $use_compression $gzip $cvs $svn $ssh $p4 $vss $bugtracker @valid_repositories $default_topic_create_mode $default_tabwidth $file_reviewer $db $dbuser $dbpasswd $codestriker_css $NORMAL_MODE $COLOURED_MODE $COLOURED_MONO_MODE $topic_states @@ -27,7 +27,7 @@ ); # Version of Codestriker. -$Codestriker::VERSION = "1.9.0.beta1"; +$Codestriker::VERSION = "1.9.0.beta2"; # Default title to display on each Codestriker screen. $Codestriker::title = "Codestriker $Codestriker::VERSION"; Index: Subversion.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Subversion.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Subversion.pm 22 May 2005 11:26:30 -0000 1.9 +++ Subversion.pm 9 Jun 2005 07:22:05 -0000 1.10 @@ -44,8 +44,8 @@ # Replace any spaces with %20 uri friendly escapes. $filename =~ s/ /%20/g; - my $cmd = "svn cat --non-interactive --no-auth-cache " . $self->{userCmdLine} . - " --revision $revision " . + my $cmd = "\"$Codestriker::svn\" cat --non-interactive --no-auth-cache " . + $self->{userCmdLine} . " --revision $revision " . "\"" . $self->{repository_url} . "/$filename\""; my $write_stdin_fh = new FileHandle; @@ -108,8 +108,8 @@ my $filename = $module_name; $filename =~ s/ /%20/g; - my $cmd = "svn cat --non-interactive --no-auth-cache " . $self->{userCmdLine} . - " --revision HEAD " . + my $cmd = "\"$Codestriker::svn\" cat --non-interactive --no-auth-cache " . + $self->{userCmdLine} . " --revision HEAD " . "\"" . $self->{repository_url} . "/$filename\""; my $write_stdin_fh = new FileHandle; @@ -143,8 +143,8 @@ $read_stdout_fh->close(); $read_stderr_fh->close(); - $cmd = "svn diff --non-interactive --no-auth-cache " . $self->{userCmdLine} . - " -r $start_tag:$end_tag " . + $cmd = "\"$Codestriker::svn\" diff --non-interactive --no-auth-cache " . + $self->{userCmdLine} . " -r $start_tag:$end_tag " . "--old \"$self->{repository_url}\" \"$module_name\""; $write_stdin_fh = new FileHandle; |
|
From: <si...@us...> - 2006-01-07 03:20:22
|
Created Codestriker topic at: http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=1265723&action=view User: sits Date: 06/01/06 19:20:07 Modified: . CHANGELOG lib/Codestriker/Repository Subversion.pm Log: * Fixed problem with Subversion repositories on Win32, where Codestriker was unable to launch the svn program. Fixes bug: [ codestriker-Bugs-1382454 ] Subversion.pm open3 bug on Win32 https://sourceforge.net/tracker/?func=detail&atid=429860&aid=1382454&group_id=41136 Index: CHANGELOG =================================================================== RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v retrieving revision 1.177 retrieving revision 1.178 diff -u -r1.177 -r1.178 --- CHANGELOG 5 Oct 2005 23:23:06 -0000 1.177 +++ CHANGELOG 7 Jan 2006 03:20:06 -0000 1.178 @@ -3,6 +3,9 @@ Version 1.9.2 +* Fixed problem with Subversion repositories on Win32, where + Codestriker was unable to launch the svn program. + * Comments containing '+' characters were changed into ' ' characters when posted via AJAX. Other potentially damaging characters are now escaped. Index: Subversion.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Subversion.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Subversion.pm 9 Jun 2005 07:22:05 -0000 1.10 +++ Subversion.pm 7 Jan 2006 03:20:07 -0000 1.11 @@ -15,13 +15,17 @@ # Constructor, which takes as a parameter the repository url. sub new ($$) { my ($type, $repository_url, $user, $password) = @_; - - my $userCmdLine = ""; + + # Determine if there are additional parameters required for user + # authentication. + my @userCmdLine = (); if (defined($user) && defined($password)) { - $userCmdLine = "--username $user --password $password "; + push @userCmdLine, '--username'; + push @userCmdLine, $user; + push @userCmdLine, '--password'; + push @userCmdLine, $password; } - # Make sure the repo url does not end in a /, the # rest of the module assumes that it does not. $repository_url =~ s/[\\\/]^//; @@ -31,7 +35,7 @@ my $self = {}; $self->{repository_url} = $repository_url; - $self->{userCmdLine} = $userCmdLine; + $self->{userCmdLine} = \@userCmdLine; bless $self, $type; } @@ -44,15 +48,21 @@ # Replace any spaces with %20 uri friendly escapes. $filename =~ s/ /%20/g; - my $cmd = "\"$Codestriker::svn\" cat --non-interactive --no-auth-cache " . - $self->{userCmdLine} . " --revision $revision " . - "\"" . $self->{repository_url} . "/$filename\""; - my $write_stdin_fh = new FileHandle; my $read_stdout_fh = new FileHandle; my $read_stderr_fh = new FileHandle; - - my $pid = open3($write_stdin_fh,$read_stdout_fh,$read_stderr_fh,$cmd); + + my @args = (); + push @args, 'cat'; + push @args, '--non-interactive'; + push @args, '--no-auth-cache'; + push @args, @{ $self->{userCmdLine} }; + push @args, '--revision'; + push @args, $revision; + push @args, $self->{repository_url} . '/' . $filename; + + my $pid = open3($write_stdin_fh, $read_stdout_fh, $read_stderr_fh, + $Codestriker::svn, @args); # Read the data. for (my $i = 1; <$read_stdout_fh>; $i++) { @@ -60,13 +70,12 @@ $$content_array_ref[$i] = $_; } - # Log anything on standard error to apache error log - # along with the cmd that caused the error. - + # Log anything on standard error to apache error log. my $buf; my $first_lines = 1; while (read($read_stderr_fh, $buf, 16384)) { - print STDERR "$cmd\n" if $first_lines; + print STDERR "$Codestriker::svn " . + (join @args, ' ') . "\n" if $first_lines; $first_lines = 0; print STDERR $buf; } @@ -108,15 +117,21 @@ my $filename = $module_name; $filename =~ s/ /%20/g; - my $cmd = "\"$Codestriker::svn\" cat --non-interactive --no-auth-cache " . - $self->{userCmdLine} . " --revision HEAD " . - "\"" . $self->{repository_url} . "/$filename\""; - my $write_stdin_fh = new FileHandle; my $read_stdout_fh = new FileHandle; my $read_stderr_fh = new FileHandle; - my $pid = open3($write_stdin_fh, $read_stdout_fh, $read_stderr_fh, $cmd); + my @args = (); + push @args, 'cat'; + push @args, '--non-interactive'; + push @args, '--no-auth-cache'; + push @args, @{ $self->{userCmdLine} }; + push @args, '--revision'; + push @args, 'HEAD'; + push @args, $self->{repository_url} . '/' . $filename; + + my $pid = open3($write_stdin_fh, $read_stdout_fh, $read_stderr_fh, + $Codestriker::svn, @args); while(<$read_stdout_fh>) {} @@ -143,15 +158,22 @@ $read_stdout_fh->close(); $read_stderr_fh->close(); - $cmd = "\"$Codestriker::svn\" diff --non-interactive --no-auth-cache " . - $self->{userCmdLine} . " -r $start_tag:$end_tag " . - "--old \"$self->{repository_url}\" \"$module_name\""; - $write_stdin_fh = new FileHandle; $read_stdout_fh = new FileHandle; $read_stderr_fh = new FileHandle; - $pid = open3($write_stdin_fh, $read_stdout_fh, $read_stderr_fh, $cmd); + @args = (); + push @args, 'cat'; + 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} . $module_name; + + $pid = open3($write_stdin_fh, $read_stdout_fh, $read_stderr_fh, + $Codestriker::svn, @args); while(<$read_stdout_fh>) { my $line = $_; |
|
From: <si...@us...> - 2006-01-22 22:41:42
|
Created Codestriker topic at: http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=953620&action=view User: sits Date: 06/01/22 14:41:28 Modified: lib/Codestriker/Repository Subversion.pm Log: Changes to make subversion work again Index: Subversion.pm =================================================================== RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Subversion.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Subversion.pm 7 Jan 2006 03:20:07 -0000 1.11 +++ Subversion.pm 22 Jan 2006 22:41:27 -0000 1.12 @@ -163,14 +163,15 @@ $read_stderr_fh = new FileHandle; @args = (); - push @args, 'cat'; + 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, $start_tag . ':' . $end_tag; push @args, '--old'; - push @args, $self->{repository_url} . $module_name; + push @args, $self->{repository_url}; + push @args, $module_name; $pid = open3($write_stdin_fh, $read_stdout_fh, $read_stderr_fh, $Codestriker::svn, @args); |