cvsreport-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cvsreport] now allowing simultaneous *distinct* invocations from a sing


From: Vincent Caron <address@hidden>
Subject: [cvsreport] now allowing simultaneous *distinct* invocations from a single commit filter
Date: Mon, 01 Sep 2003 11:10:12 -0400

Commit from zerodeux 2003-09-01 11:10 EDT
now allowing simultaneous *distinct* invocations from a single commit filter
Module File name Revision
cvsreport BUGS 1.2 >>> 1.3
cvsreport ChangeLog 1.33 >>> 1.34
cvsreport cvsreport 1.31 >>> 1.32
cvsreport cvsreport.1 1.16 >>> 1.17

cvsreport/BUGS   1.2 >>> 1.3
Line 1
  - Doesn't parse properly filenames with spaces
    Blame 'cvs history', the field separator is 'space'. We can fix it when cvsroot
    is local, directly parsing the CVSROOT/hisory file (separator is then '|').
-
- - Can't be called more than once from the same commitinfo file.

cvsreport/ChangeLog   1.33 >>> 1.34
Line 1
+ 2003/09/01 17:11  zerodeux
+ - now allowing simultaneous *distinct* invocations from a single commit filter
+
  2003/09/01 15:31  zerodeux
  - fixed default command (text report to stdout)
 

cvsreport/cvsreport   1.31 >>> 1.32
Line 20
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
  use Getopt::Long qw(:config no_auto_abbrev no_ignore_case bundling);
+ use Digest::MD5 qw(md5_hex);
  use POSIX qw(mktime strftime tzset);
  use Fcntl qw(:flock);
- use Cwd   qw(getcwd);
+ use Cwd qw(getcwd);
  use strict;
 
 
Line 78
  my %vars;
 
  # Internals
- my $tmp_path     = "/tmp";
+ my $ARGS;                  # Will store command line as a simple string
+ my $tmp_path = "/tmp";
  my $globalconfig = "/etc/cvsreport.conf";
- my $single_cset  = 0;      # Optimization, see get_file_info()
+ my $single_cset = 0;       # Optimization, see get_file_info()
  my $cset_time_leap = 121;  # In second, currently >2min because 'cvs history' has minute precision
  my @history = ();
  my @csets = ();
Line 288
      # This is the parent CVS process (the main driver, not the command fork that called us)
      # Note: CVS also gives it to us in $ENV{CVS_PID}. Maybe more portable. Whatever.
      my $cvs_pid = getpgrp(0);
-     my $cvs_lock = "$tmp_path/cvsreport.lock.$cvs_pid";
+
+     # We need a lock wich is specific to our driver ($cvs_pid will do), and can discriminate
+     # simultaneous calls from the same filter invocation (a hash on args will do).
+     my $hash = md5_hex $ARGS;
+     my $cvs_lock = "$tmp_path/cvsreport.lock.$cvs_pid.$hash";
 
      debug "wait_commit_completion():";
-     debug "  ppid: $cvs_pid";
      debug "  lock: $cvs_lock";
 
      # Get lock handle.
Line 1818
      my $help = 0;
      my $version = 0;
 
+     $ARGS = join ' ', @ARGV;  # Save args as a string for possible later use.
      fix_cvs_args();
 
      GetOptions('all|a'       => \$all_users,

cvsreport/cvsreport.1   1.16 >>> 1.17
Line 309
  If no command is given to \fBcvsreport\fP, it automatically issues a \fBfile text -\fP
  command. You can also use scripts to specify a list of commands, using the syntax
  described in \fBCOMMANDS\fP. These commands are collected at start up time and all
- executed when the history has been retrieved. This example will generate the default
- text and HTML reports at once into distinct files :
-
- .nf
-     file text report.txt
-     file html report.html
- .fi
+ executed when the history has been retrieved.
 
 
  .SH FILES
Line 324
  The global configuration file.
  .RE
 
- I /tmp/cvsreport.log
+ .I /tmp/cvsreport.log
  .RS
- The debug output when there is no tty.
+ The debug output when there is no tty (eg. on server side).
  .RE
 
 
Line 337
  .IP CVS_RSH
  Set the access method for an external cvsroot (rsh, ssh), see \fBcvs (1)\fP.
 
+ .IP CVSREPORT_DEBUG
+ When set, equivalent to the \fB--debug\fP option.
+
 
  .SH BUGS
  Working on remote repositories is \fBawfully\fP slow (blame CVS).
- .br
- Can't run simultaneous instances in automatic report mode, but cvsreport
- tries to make this scenario useless anyway (use its versatile configuration
- and command mechanisms).
 
 
  .SH AUTHOR



reply via email to

[Prev in Thread] Current Thread [Next in Thread]