Whamcloud - gitweb
b=3031
[fs/lustre-release.git] / build / cvsdiffclient
1 #!/bin/bash
2 # Put this script and cvs-modified-files.pl into your PATH (~bin is good) and 
3 #
4 # export CVSEDITOR=cvsdiffclient
5 #
6 # in your .bashrc and you will get a nice bunch of CVS commit reminders:
7 # <merge/land tag information>
8 # b=<bug_number>
9 # r=<reviewed by>
10 #
11 # Remember to remove the leading "CVS: " part of the comment before saving
12 # your commit comment if you want those entries to be saved.
13
14 [ -f .mergeinfo ] && . ./.mergeinfo
15
16 FILES=`cvs-modified-files.pl $1`
17 TMP=`mktemp /tmp/cvslog-XXXXXXXX`
18 if [ -f $TMP ]; then
19         [ -f .mergeinfo ] && . .mergeinfo
20         [ -z "$PARENT" -a -f lustre/.mergeinfo ] && . lustre/.mergeinfo
21         if [ "$PARENT" ]; then
22                 [ "$OPERATION" ] || OPERATION=Update
23                 [ "$OPERWHERE" ] || OPERWHERE=from
24                 echo "CVS: $OPERATION $child $OPERWHERE $parent ($date)" >> $TMP
25         else
26                 [ -r CVS/Tag ] && TAG=CVS/Tag
27                 [ -z "$TAG" -a -r lustre/CVS/Tag ] && TAG=lustre/CVS/Tag
28                 echo "CVS: Branch: `sed 's/^T//' $TAG`" >> $TMP
29         fi
30         echo "CVS: did you update the ChangeLog for a bug fix?" >> $TMP
31         echo "CVS: did you update the hours spent in Bugzilla?" >> $TMP
32         echo "CVS: b=<bug>" >> $TMP
33         echo "CVS: r=<reviewed_by>" >> $TMP
34
35         cat $1 >> $TMP
36         cp $TMP $1
37         rm $TMP
38 fi
39
40 if [ "${FILES:+have_files}"x = have_filesx ]; then
41   echo Diffing $1 : $FILES
42   cvs diff -wbBup $FILES 2>/dev/null | sed "s/^/CVS: /" >>$1
43 fi
44 #gnuclient $1 || vi $1
45 [ "$EDITOR" ] || EDITOR=vi
46
47 $EDITOR $1