(Flogb): Error at run time if not supported.
[emacs.git] / lib-src / vcdiff
blobff3280206f93923e96015a280aedff72089e16b6
1 #!/bin/sh
3 # Enhanced sccs diff utility for use with vc mode.
4 # This version is more compatible with rcsdiff(1).
6 # $Id: vcdiff,v 1.1 1992/08/04 16:08:22 eric Exp eggert $
9 DIFF="diff"
10 usage="$0: Usage: vcdiff [-q] [-r<sid1>] [-r<sid2>] [diffopts] sccsfile..."
12 echo=
13 sid1=-r sid2=
15 for f
17 case $f in
18 -*)
19 case $f in
20 -q)
21 echo=:;;
22 -r?*)
23 case $sid1 in
24 -r)
25 sid1=$f
28 case $sid2 in
29 ?*) echo "$usage" >&2; exit 2 ;;
30 esac
31 sid2=$f
33 esac
36 options="$options $f"
38 esac
39 shift
42 break
44 esac
45 done
47 case $# in
49 echo "$usage" >&2
50 exit 2
51 esac
54 rev1= rev2= status=0
55 trap 'status=2; exit' 1 2 13 15
56 trap 'rm -f $rev1 $rev2 || status=2; exit $status' 0
58 for f
60 s=2
62 case $f in
63 s.* | */s.*)
65 rev1=/tmp/geta$$
66 get -s -p -k $sid1 "$f" > $rev1 &&
67 case $sid2 in
68 '')
69 workfile=`expr " /$f" : '.*/s.\(.*\)'`
72 rev2=/tmp/getb$$
73 get -s -p -k $sid2 "$f" > $rev2
74 workfile=$rev2
75 esac
76 then
77 $echo $DIFF $options $sid1 $sid2 $workfile >&2
78 $DIFF $options $rev1 $workfile
79 s=$?
83 echo "$0: $f is not an SCCS file" >&2
84 esac
86 if test $status -lt $s
87 then status=$s
89 done