head	1.3;
access;
symbols
	TIGRIS_1_1_0RC2:1.3
	TIGRIS_1_1_0RC1:1.3
	TIGRIS_1_1:1.3.0.14
	TIGRIS_1_0_8:1.3
	TIGRIS_1_0_8RC3:1.3
	TIGRIS_1_0_8RC2:1.3
	TIGRIS_1_0_8RC1:1.3
	TIGRIS_1_0_7:1.3
	TIGRIS_1_0_7RC3:1.3
	TIGRIS_1_0_7RC2:1.3
	TIGRIS_1_0_7RC1:1.3
	TIGRIS_1_0_6:1.3
	TIGRIS_1_0_6RC5:1.3
	TIGRIS_1_0_6RC4:1.3
	TIGRIS_1_0_6RC3:1.3
	TIGRIS_1_0_6RC2:1.3
	TIGRIS_1_0_6RC1:1.3
	TIGRIS_1_0_5:1.3
	TIGRIS_1_0_5RC6:1.3
	TIGRIS_1_0_5RC5:1.3
	TIGRIS_1_0_5RC4:1.3
	TIGRIS_1_0_5RC3:1.3
	TIGRIS_1_0_5RC2:1.3
	TIGRIS_1_0_5RC1:1.3
	TIGRIS_1_0_4:1.3
	TIGRIS_1_0_3:1.3
	TIGRIS_1_0_2:1.3
	TIGRIS_1_0_1:1.3
	TIGRIS_1_0:1.3.0.16
	TIGRIS_1_0_0:1.3
	TIGRIS_1_0_0_RC1:1.3.0.12
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.3
	TIGRIS_0_9_2_3:1.3
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.3
	TIGRIS_0_9_2_1:1.3
	TIGRIS_0_9_2:1.3.0.10
	TIGRIS_0_9_0:1.3.0.8
	TIGRIS_0_8_4:1.3.0.6
	TIGRIS_NOV_12_2000:1.3
	OLDHELM:1.3.0.4
	TIGRIS_NOV_11_2000:1.3
	TIGRIS_SEP_13_2000:1.3.0.2
	TIGRIS_BASELINE:1.3;
locks; strict;
comment	@# @;


1.3
date	2000.07.29.00.30.32;	author kfogel;	state Exp;
branches;
next	1.2;

1.2
date	2000.07.29.00.20.39;	author kfogel;	state Exp;
branches;
next	1.1;

1.1
date	2000.02.02.05.39.56;	author jrobbins;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2001.02.21.00.31.47;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Put in comments explaining how commit_prep and log_accum interact, and
how log_accum interacts with past and future invocations of itself.
@
text
@#!/usr/bin/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.
#
# IMPORTANT: this script interacts with log_accum, they have to agree
# on the tmpfile name to use.  See $LAST_FILE below.
#
# Contributed by David Hampton <hampton@@cisco.com>
# Stripped to minimum by Roy Fielding
#
############################################################
$TMPDIR        = $ENV{'TMPDIR'} || '/tmp';
$FILE_PREFIX   = '#cvs.';

# If see a "-u $USER" argument, then destructively remove it from the
# argument list, so $ARGV[0] will be the repository dir again, as it
# used to be before we added the -u flag.
if ($ARGV[0] eq '-u') {
  shift @@ARGV;
  $CVS_USERNAME = shift (@@ARGV);
}

# This needs to match the corresponding var in log_accum.pl, including
# the appending of the pgrp and username suffixes (see uses of this
# var farther down).
$LAST_FILE = "$TMPDIR/${FILE_PREFIX}lastdir";

sub write_line {
    local($filename, $line) = @@_;

    open(FILE, ">$filename") || die("Cannot open $filename: $!\n");
    print(FILE $line, "\n");
    close(FILE);
}

#
# 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.
#
$id = getpgrp();

&write_line("$LAST_FILE.$id.$CVS_USERNAME", $ARGV[0]);

exit(0);
@


1.2
log
@Fixes for:
   http://www.netbeans.org/bugs-cgi/show_bug.cgi?id=7052
   http://www.netbeans.org/bugs-cgi/show_bug.cgi?id=6931

commitinfo now passes "-u $USER" to commit_prep.

commit_prep and log_accum now agree to append the committer's
cvs-username onto their tmp files, so overlapping commits by different
people don't get mixed up.
@
text
@d7 3
d25 3
a27 3
# IMPORTANT: use this in a way that matches the usage of the
# same-named var in log_accum.pl, including the appending of the pgrp
# and username suffixes that happens later on.
@


1.1
log
@iniital checkin
@
text
@d14 12
a25 1
$LAST_FILE     = "$TMPDIR/${FILE_PREFIX}lastdir"; # MUST match log_accum.pl
d42 1
a42 1
&write_line("$LAST_FILE.$id", $ARGV[0]);
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@a6 3
# IMPORTANT: this script interacts with log_accum, they have to agree
# on the tmpfile name to use.  See $LAST_FILE below.
#
d14 1
a14 12
# If see a "-u $USER" argument, then destructively remove it from the
# argument list, so $ARGV[0] will be the repository dir again, as it
# used to be before we added the -u flag.
if ($ARGV[0] eq '-u') {
  shift @@ARGV;
  $CVS_USERNAME = shift (@@ARGV);
}

# This needs to match the corresponding var in log_accum.pl, including
# the appending of the pgrp and username suffixes (see uses of this
# var farther down).
$LAST_FILE = "$TMPDIR/${FILE_PREFIX}lastdir";
d31 1
a31 1
&write_line("$LAST_FILE.$id.$CVS_USERNAME", $ARGV[0]);
@


