head	1.1;
access;
symbols
	TIGRIS_1_1_0RC2:1.1
	TIGRIS_1_1_0RC1:1.1
	TIGRIS_1_1:1.1.0.14
	TIGRIS_1_0_8:1.1
	TIGRIS_1_0_8RC3:1.1
	TIGRIS_1_0_8RC2:1.1
	TIGRIS_1_0_8RC1:1.1
	TIGRIS_1_0_7:1.1
	TIGRIS_1_0_7RC3:1.1
	TIGRIS_1_0_7RC2:1.1
	TIGRIS_1_0_7RC1:1.1
	TIGRIS_1_0_6:1.1
	TIGRIS_1_0_6RC5:1.1
	TIGRIS_1_0_6RC4:1.1
	TIGRIS_1_0_6RC3:1.1
	TIGRIS_1_0_6RC2:1.1
	TIGRIS_1_0_6RC1:1.1
	TIGRIS_1_0_5:1.1
	TIGRIS_1_0_5RC6:1.1
	TIGRIS_1_0_5RC5:1.1
	TIGRIS_1_0_5RC4:1.1
	TIGRIS_1_0_5RC3:1.1
	TIGRIS_1_0_5RC2:1.1
	TIGRIS_1_0_5RC1:1.1
	TIGRIS_1_0_4:1.1
	TIGRIS_1_0_3:1.1
	TIGRIS_1_0_2:1.1
	TIGRIS_1_0_1:1.1
	TIGRIS_1_0:1.1.0.16
	TIGRIS_1_0_0:1.1
	TIGRIS_1_0_0_RC1:1.1.0.12
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.1
	TIGRIS_0_9_2_3:1.1
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.1
	TIGRIS_0_9_2_1:1.1
	TIGRIS_0_9_2:1.1.0.10
	TIGRIS_0_9_0:1.1.0.8
	TIGRIS_0_8_4:1.1.0.6
	TIGRIS_NOV_12_2000:1.1
	OLDHELM:1.1.0.4
	TIGRIS_NOV_11_2000:1.1
	TIGRIS_SEP_13_2000:1.1.0.2
	TIGRIS_BASELINE:1.1;
locks; strict;
comment	@# @;


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.1
log
@iniital checkin
@
text
@#!/usr/bin/perl
# 
# This crude hack is to sanitise the results of what the user may have
# "done" while editing the commit log message.. :-)   Peter Wemm.
#
# To use this, make it executable, and set your editinfo DEFAULT line:
# DEFAULT   /path/to/this/program
#

# same rules as CVS
$editor="/usr/bin/vi";
if (defined $ENV{'EDITOR'}) {		# $EDITOR overrides default
	$editor = $ENV{'EDITOR'};
}
if (defined $ENV{'CVSEDITOR'}) {	# $CVSEDITOR overrises $EDITOR
	$editor = $ENV{'CVSEDITOR'};
}

if (!@@ARGV) {
	die "Usage: cvsedit filename\n";
}
$filename = $ARGV[0];
$tmpfile = $filename . "tmp";

system("$editor $filename");

open(IN, "< $filename") ||
	die "cvsedit: Cannot open for reading: $filename: $!\n";

open(OUT, "> $tmpfile") ||
	die "cvsedit: Cannot open for writing: $tmpfile: $!\n";

# In-place edit the result of the user's edit on the file.
$blank = 0;	# true if the last line was blank
$first = 0;	# true if we have seen the first real text
while(<IN>) {

	# Dont let CVS: lines upset things, but maintain them in case
	# the editor is re-entered.  NO CHANGES!!
	if (/^CVS:/) {
		print OUT;
		next;
	}

	chop;		# strip trailing newline
	s/[\s]+$//;	# strip trailing whitespace

	# collapse multiple blank lines, and trailing blank lines.
	if (/^$/) {
		# Blank line. Remember in case more text follows.
		$blank = 1;
		next;
	} else {
		# Delete if they only have whitespace after them.
		if (/^Reviewed by:$/i ||
		    /^Submitted by:$/i ||
		    /^Obtained from:$/i ||
		    /^CC:$/i) {
			next;
		}
		if ($blank && $first) {
			# Previous line(s) was blank, this isn't. Close the
			# collapsed section.
			print OUT "\n";
		}
		$blank = 0;	# record non-blank
		$first = 1;	# record first line
		print OUT "$_\n";
	}
}
close(IN);
close(OUT);

unlink($filename . "~");	# Nuke likely editor backups..
unlink($filename . ".bak");	# Nuke likely editor backups..

# Check to see if any differences.
$different = system("cmp -s $tmpfile $filename");

# Make a clean exit if there are no changes, or there is no 'text'
# - for example, a user quit the editor without saving.
# preserve stat() info if appropriate.
if (!$different || !$first) {
	unlink($tmpfile);
	exit(0);
}

rename("$tmpfile", "$filename") ||
	die("cvsedit: Could not rename $tmpfile to $filename: $!");

exit(0);
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@@

