Whamcloud - gitweb
885989743f49c496ee705c68863cf16704a9af59
[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                 [ "$TAG" ] && BRANCH="`sed 's/^T//' $TAG`" || BRANCH="HEAD"
29                 echo "CVS: Branch $BRANCH" >> $TMP
30         fi
31 cat - >> $TMP <<- EOF
32         CVS: did you update the ChangeLog for a bug fix?
33         CVS: did you update the hours spent in Bugzilla?
34         CVS: did you verify/update the HLD/DLD in CVS?
35         CVS: b=<bug>
36         CVS: r=<reviewed_by>
37 EOF
38
39         cat $1 >> $TMP
40         cp $TMP $1
41         rm $TMP
42 fi
43
44 if [ "${FILES:+have_files}"x = have_filesx ]; then
45   echo Diffing $1 : $FILES
46   cvs diff -wbBup $FILES 2>/dev/null | sed "s/^/CVS: /" >>$1
47 fi
48 #gnuclient $1 || vi $1
49 [ "$EDITOR" ] || EDITOR=vi
50
51 $EDITOR $1