Whamcloud - gitweb
Add cvs management scripts to top-level repository.
authoradilger <adilger>
Tue, 28 Dec 2004 17:50:22 +0000 (17:50 +0000)
committeradilger <adilger>
Tue, 28 Dec 2004 17:50:22 +0000 (17:50 +0000)
build/cvs-modified-files.pl [new file with mode: 0755]
build/cvsdiffclient [new file with mode: 0644]
build/cvsrc [new file with mode: 0644]

diff --git a/build/cvs-modified-files.pl b/build/cvs-modified-files.pl
new file mode 100755 (executable)
index 0000000..d13c4d3
--- /dev/null
@@ -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 (file)
index 0000000..ed6b876
--- /dev/null
@@ -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:
+# <merge/land tag information>
+# b=<bug_number>
+# r=<reviewed by>
+#
+# 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=<bug>" >> $TMP
+       echo "CVS: r=<reviewed_by>" >> $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 (file)
index 0000000..665cd8f
--- /dev/null
@@ -0,0 +1,5 @@
+cvs -z3 -q
+diff -u -p
+co -d -P
+update -d -P
+commit