From owner-freebsd-cvsweb@FreeBSD.ORG Thu Jan 20 15:16:36 2005 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E42516A4D4 for ; Thu, 20 Jan 2005 15:16:36 +0000 (GMT) Received: from uk4-3.ukhost4u.com (uk4-3.ukhost4u.com [83.142.24.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5121A43D1F for ; Thu, 20 Jan 2005 15:16:35 +0000 (GMT) (envelope-from chris@thebrown.net) Received: from [62.49.11.3] (helo=mail.thebrown.net) by uk4-3.ukhost4u.com with esmtpa (Exim 4.43) id 1Cre2x-0005Bo-KZ for freebsd-cvsweb@freebsd.org; Thu, 20 Jan 2005 15:16:31 +0000 Date: Thu, 20 Jan 2005 15:17:19 -0000 To: freebsd-cvsweb@freebsd.org From: "Chris Brown" Content-Type: multipart/mixed; boundary=----------GcJSO5lZsUx7DsSCl52kkW MIME-Version: 1.0 Message-ID: User-Agent: Opera M2/7.53 (Win32, build 3850) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - uk4-3.ukhost4u.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - thebrown.net X-Source: X-Source-Args: X-Source-Dir: Subject: Command line too long! X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS Web maintenance mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2005 15:16:36 -0000 ------------GcJSO5lZsUx7DsSCl52kkW Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Hi, For a while now cvsweb has incorrectly displayed a particuar module in my CVS repository - quite a few of the files are missing from the log lists but can be accessed if the url to the file is typed directly into my browser, e.g., http://www/cgi-bin/cvsweb/cvsweb.cgi/opt/parmip.c. A Google search found other people with this symptom but I couldn't find any fix. I have now realised that my module contains so many files (~570) that the command line to run rlog is longer than it (or the shell maybe) can handle. To get around this I wrote a patch to version 3.0.4 of cvsweb.cgi so it calls rlog incrementally with a configurable number of files at a time (at the moment set to 150). I hope this is useful to someone. Chris Brown ------------GcJSO5lZsUx7DsSCl52kkW Content-Disposition: attachment; filename=diff-cvsweb-inc_rlog.diff Content-Type: application/octet-stream; name=diff-cvsweb-inc_rlog.diff Content-Transfer-Encoding: 8bit --- cvsweb.cgi 2005-01-20 12:53:08.000000000 +0000 +++ cvsweb-inc_rlog.cgi 2005-01-20 14:28:12.000000000 +0000 @@ -202,6 +202,7 @@ sub startproc(@); sub runproc(@); sub checkout_to_temp($$$); +sub get_rlog_incremental($$@); ##### Start of Configuration Area ######## @@ -2452,29 +2453,13 @@ # If there are no files, we're done. return @unreadable unless @files; - my @cmd = ($CMD{rlog}); - # Can't use -r as '-' is allowed in tagnames, - # but misinterpreted by rlog. - push(@cmd, '-r') unless defined($tag); - - my $fh = do { local (*FH); }; - if (!open($fh, '-|')) { # Child - open(STDERR, '>', devnull()) unless $DEBUG; # Ignore rlog's complaints. - openOutputFilter(); - if ($file_list_len && $file_list_len > 1) { - while (scalar(@files) > $file_list_len) { # Process files in chunks. - system(@cmd, splice(@files, 0, $file_list_len)) == 0 or exit -1; - } - } - exec(@cmd, @files) or exit -1; - } - undef @cmd; + my @rlog_lines = get_rlog_incremental (100, $tag, @files); my $state = 'start'; my ($date, $branchpoint, $branch, $log, @filetags); my ($rev, $revision, $revwanted, $filename, $head, $author, $keywordsubst); - while (<$fh>) { + for (@rlog_lines) { if ($state eq "start") { #Next file. Initialize file variables @@ -2609,15 +2594,6 @@ } } - my $linesread = $. || 0; - close($fh); - - if ($linesread == 0) { - fatal('500 Internal Error', - 'Failed to spawn GNU rlog on "%s".

Did you set the @command_path in your configuration file correctly? (Currently: "%s")', - htmlquote(join(', ', @files)), join(':', @command_path)); - } - return @unreadable; } @@ -4377,6 +4353,51 @@ return ($exitcode, $errormsg); } + +sub get_rlog_incremental($$@) +{ + my $files_at_once = shift; + my $tag = shift; + my @all_files = @_; + my @rlog_lines; + + my @cmd = ($CMD{rlog}); + # Can't use -r as '-' is allowed in tagnames, + # but misinterpreted by rlog. + push(@cmd, '-r') unless defined($tag); + + while( my @files = splice (@all_files, 0, $files_at_once)) { + + my $fh = do { local (*FH); }; + if (!open($fh, '-|')) { # Child + open(STDERR, '>', devnull()) unless $DEBUG; # Ignore rlog's complaints. + openOutputFilter(); + if ($file_list_len && $file_list_len > 1) { + while (scalar(@files) > $file_list_len) { # Process files in chunks. + system(@cmd, splice(@files, 0, $file_list_len)) == 0 or exit -1; + } + } + exec(@cmd, @files) or exit -1; + } + + push @rlog_lines, <$fh>; + + my $linesread = $. || 0; + close($fh); + + if ($linesread == 0) { + fatal('500 Internal Error', + 'Failed to spawn GNU rlog on "%s".

Did you set the @command_path in your configuration file correctly? (Currently: "%s")', + htmlquote(join(', ', @files)), join(':', @command_path)); + } + } + + return @rlog_lines; +} + + + + # # Check out a file to a temporary file. # ------------GcJSO5lZsUx7DsSCl52kkW--