From 714dd5489be508fef0d17da03c0d34c82d454385 Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 28 Dec 2004 17:50:22 +0000 Subject: [PATCH] Add cvs management scripts to top-level repository. --- build/cvs-modified-files.pl | 47 +++++++++++++++++++++++++++++++++++++++++++++ build/cvsdiffclient | 47 +++++++++++++++++++++++++++++++++++++++++++++ build/cvsrc | 5 +++++ 3 files changed, 99 insertions(+) create mode 100755 build/cvs-modified-files.pl create mode 100644 build/cvsdiffclient create mode 100644 build/cvsrc diff --git a/build/cvs-modified-files.pl b/build/cvs-modified-files.pl new file mode 100755 index 0000000..d13c4d3 --- /dev/null +++ b/build/cvs-modified-files.pl @@ -0,0 +1,47 @@ +#!/usr/bin/env perl + +my $mode = "NONE"; +my @modified, @added, @removed; + +while($line = <>) { + if ($line =~ /Modified Files:/) { + $mode = "MODIFIED"; + next; + } + + if ($line =~ /Added Files:/) { + $mode = "ADDED"; + next; + } + + if ($line =~ /Removed Files:/) { + $mode = "REMOVED"; + next; + } + + if ($mode eq "NONE") { next; } + if ($line =~ /-------/) { next; } + + chop($line); + $line =~ s/^CVS:\s+//; + $line =~ s/\s+$//; + # print "processing $line for $mode\n"; + @files = split(/ /, $line); + # print "new files for $mode: ", join(', ', @files), "\n"; + + if ($mode eq "MODIFIED") { + push(@modified, @files); + } elsif ($mode eq "ADDED") { + push(@added, @files); + } elsif ($mode eq "REMOVED") { + push(@removed, @files); + } else { + die "Unknown mode $mode!"; + } +} + +print join(' ', @modified); +if ($ENV{"SHOW_ALL_FILES"} ne "no") { + print ' ', join(' ', @added), ' ', join(' ', @removed); +} +print "\n"; diff --git a/build/cvsdiffclient b/build/cvsdiffclient new file mode 100644 index 0000000..ed6b876 --- /dev/null +++ b/build/cvsdiffclient @@ -0,0 +1,47 @@ +#!/bin/bash +# Put this script and cvs-modified-files.pl into your PATH (~bin is good) and +# +# export CVSEDITOR=cvsdiffclient +# +# in your .bashrc and you will get a nice bunch of CVS commit reminders: +# +# b= +# r= +# +# Remember to remove the leading "CVS: " part of the comment before saving +# your commit comment if you want those entries to be saved. + +[ -f .mergeinfo ] && . ./.mergeinfo + +FILES=`cvs-modified-files.pl $1` +TMP=`mktemp /tmp/cvslog-XXXXXXXX` +if [ -f $TMP ]; then + [ -f .mergeinfo ] && . .mergeinfo + [ -z "$PARENT" -a -f lustre/.mergeinfo ] && . lustre/.mergeinfo + if [ "$PARENT" ]; then + [ "$OPERATION" ] || OPERATION=Update + [ "$OPERWHERE" ] || OPERWHERE=from + echo "CVS: $OPERATION $child $OPERWHERE $parent ($date)" >> $TMP + else + [ -r CVS/Tag ] && TAG=CVS/Tag + [ -z "$TAG" -a -r lustre/CVS/Tag ] && TAG=lustre/CVS/Tag + echo "CVS: Branch: `sed 's/^T//' $TAG`" >> $TMP + fi + echo "CVS: did you update the ChangeLog for a bug fix?" >> $TMP + echo "CVS: did you update the hours spent in Bugzilla?" >> $TMP + echo "CVS: b=" >> $TMP + echo "CVS: r=" >> $TMP + + cat $1 >> $TMP + cp $TMP $1 + rm $TMP +fi + +if [ "${FILES:+have_files}"x = have_filesx ]; then + echo Diffing $1 : $FILES + cvs diff -wbBup $FILES 2>/dev/null | sed "s/^/CVS: /" >>$1 +fi +#gnuclient $1 || vi $1 +[ "$EDITOR" ] || EDITOR=vi + +$EDITOR $1 diff --git a/build/cvsrc b/build/cvsrc new file mode 100644 index 0000000..665cd8f --- /dev/null +++ b/build/cvsrc @@ -0,0 +1,5 @@ +cvs -z3 -q +diff -u -p +co -d -P +update -d -P +commit -- 1.8.3.1