Mercurial > emacs
annotate lib-src/vcdiff @ 5163:220ec2f456e0
Comment change.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 25 Nov 1993 02:37:21 +0000 |
parents | 8e72792f2d18 |
children | 7124a811b67b |
rev | line source |
---|---|
928 | 1 #!/bin/sh |
2 # | |
3 # Enhanced sccs diff utility for use with vc mode. | |
4 # This version is more compatible with rcsdiff(1). | |
5 # | |
4653
8e72792f2d18
Append /usr/ccs/bin and /usr/sccs to PATH.
Paul Eggert <eggert@twinsun.com>
parents:
3933
diff
changeset
|
6 # $Id: vcdiff,v 1.2 1993/06/30 18:54:08 eggert Exp eggert $ |
928 | 7 # |
8 | |
9 DIFF="diff" | |
3933 | 10 usage="$0: Usage: vcdiff [-q] [-r<sid1>] [-r<sid2>] [diffopts] sccsfile..." |
928 | 11 |
4653
8e72792f2d18
Append /usr/ccs/bin and /usr/sccs to PATH.
Paul Eggert <eggert@twinsun.com>
parents:
3933
diff
changeset
|
12 PATH=$PATH:/usr/ccs/bin:/usr/sccs # common SCCS hangouts |
8e72792f2d18
Append /usr/ccs/bin and /usr/sccs to PATH.
Paul Eggert <eggert@twinsun.com>
parents:
3933
diff
changeset
|
13 |
3933 | 14 echo= |
928 | 15 sid1=-r sid2= |
16 | |
17 for f | |
18 do | |
19 case $f in | |
20 -*) | |
21 case $f in | |
3933 | 22 -q) |
23 echo=:;; | |
928 | 24 -r?*) |
25 case $sid1 in | |
26 -r) | |
27 sid1=$f | |
28 ;; | |
29 *) | |
30 case $sid2 in | |
31 ?*) echo "$usage" >&2; exit 2 ;; | |
32 esac | |
33 sid2=$f | |
34 ;; | |
35 esac | |
36 ;; | |
37 *) | |
38 options="$options $f" | |
39 ;; | |
40 esac | |
41 shift | |
42 ;; | |
43 *) | |
44 break | |
45 ;; | |
46 esac | |
47 done | |
48 | |
49 case $# in | |
50 0) | |
51 echo "$usage" >&2 | |
52 exit 2 | |
53 esac | |
54 | |
55 | |
56 rev1= rev2= status=0 | |
57 trap 'status=2; exit' 1 2 13 15 | |
58 trap 'rm -f $rev1 $rev2 || status=2; exit $status' 0 | |
59 | |
60 for f | |
61 do | |
62 s=2 | |
63 | |
64 case $f in | |
65 s.* | */s.*) | |
66 if | |
67 rev1=/tmp/geta$$ | |
68 get -s -p -k $sid1 "$f" > $rev1 && | |
69 case $sid2 in | |
70 '') | |
71 workfile=`expr " /$f" : '.*/s.\(.*\)'` | |
72 ;; | |
73 *) | |
74 rev2=/tmp/getb$$ | |
75 get -s -p -k $sid2 "$f" > $rev2 | |
76 workfile=$rev2 | |
77 esac | |
78 then | |
3933 | 79 $echo $DIFF $options $sid1 $sid2 $workfile >&2 |
928 | 80 $DIFF $options $rev1 $workfile |
81 s=$? | |
82 fi | |
83 ;; | |
84 *) | |
85 echo "$0: $f is not an SCCS file" >&2 | |
86 esac | |
87 | |
88 if test $status -lt $s | |
89 then status=$s | |
90 fi | |
91 done |