annotate lib-src/vcdiff @ 4005:da8962f65741

* intervals.c (find_interval): Doc fixes, computation of tree->position rearranged for clarity. * intervals.c (find_interval): Consistently treat POSITION as an actual buffer position, i.e. origin 1. The old code seemed undecided on this point. Treat the end of the buffer as being part of the rightmost interval. (adjust_intervals_for_insertion): Consistently treat POSITION as origin 1. (interval_deletion_adjustment): The exception: FROM should be origin zero here. Consistently treat it as such. Simplify code which shrinks and possibly deletes intervals. (adjust_intervals_for_deletion): Treat start as origin 1; our caller does. (set_point): Use buffer positions throughout, not a mix of buffer posns and origin zero posns. (get_local_map): Remove special case for POSITION at end of buffer; find_interval handles that case correctly. (verify_interval_modification): Remove special case for START at end of buffer. * textprop.c (validate_interval_range): End-of-buffer/string positions no longer need special handling. * intervals.c (make_new_interval): #if 0 this out. Nobody calls it.
author Jim Blandy <jimb@redhat.com>
date Tue, 06 Jul 1993 14:53:54 +0000
parents bfb5dd246441
children 8e72792f2d18
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
928
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1 #!/bin/sh
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
2 #
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
3 # Enhanced sccs diff utility for use with vc mode.
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
4 # This version is more compatible with rcsdiff(1).
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
5 #
3933
bfb5dd246441 Add -q option.
Paul Eggert <eggert@twinsun.com>
parents: 928
diff changeset
6 # $Id: vcdiff,v 1.1 1992/08/04 16:08:22 eric Exp eggert $
928
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
7 #
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
8
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
9 DIFF="diff"
3933
bfb5dd246441 Add -q option.
Paul Eggert <eggert@twinsun.com>
parents: 928
diff changeset
10 usage="$0: Usage: vcdiff [-q] [-r<sid1>] [-r<sid2>] [diffopts] sccsfile..."
928
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
11
3933
bfb5dd246441 Add -q option.
Paul Eggert <eggert@twinsun.com>
parents: 928
diff changeset
12 echo=
928
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
13 sid1=-r sid2=
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
14
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
15 for f
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
16 do
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
17 case $f in
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
18 -*)
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
19 case $f in
3933
bfb5dd246441 Add -q option.
Paul Eggert <eggert@twinsun.com>
parents: 928
diff changeset
20 -q)
bfb5dd246441 Add -q option.
Paul Eggert <eggert@twinsun.com>
parents: 928
diff changeset
21 echo=:;;
928
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
22 -r?*)
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
23 case $sid1 in
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
24 -r)
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
25 sid1=$f
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
26 ;;
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
27 *)
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
28 case $sid2 in
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
29 ?*) echo "$usage" >&2; exit 2 ;;
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
30 esac
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
31 sid2=$f
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
32 ;;
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
33 esac
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
34 ;;
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
35 *)
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
36 options="$options $f"
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
37 ;;
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
38 esac
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
39 shift
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
40 ;;
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
41 *)
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
42 break
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
43 ;;
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
44 esac
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
45 done
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
46
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
47 case $# in
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
48 0)
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
49 echo "$usage" >&2
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
50 exit 2
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
51 esac
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
52
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
53
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
54 rev1= rev2= status=0
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
55 trap 'status=2; exit' 1 2 13 15
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
56 trap 'rm -f $rev1 $rev2 || status=2; exit $status' 0
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
57
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
58 for f
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
59 do
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
60 s=2
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
61
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
62 case $f in
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
63 s.* | */s.*)
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
64 if
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
65 rev1=/tmp/geta$$
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
66 get -s -p -k $sid1 "$f" > $rev1 &&
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
67 case $sid2 in
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
68 '')
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
69 workfile=`expr " /$f" : '.*/s.\(.*\)'`
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
70 ;;
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
71 *)
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
72 rev2=/tmp/getb$$
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
73 get -s -p -k $sid2 "$f" > $rev2
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
74 workfile=$rev2
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
75 esac
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
76 then
3933
bfb5dd246441 Add -q option.
Paul Eggert <eggert@twinsun.com>
parents: 928
diff changeset
77 $echo $DIFF $options $sid1 $sid2 $workfile >&2
928
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
78 $DIFF $options $rev1 $workfile
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
79 s=$?
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
80 fi
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
81 ;;
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
82 *)
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
83 echo "$0: $f is not an SCCS file" >&2
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
84 esac
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
85
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
86 if test $status -lt $s
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
87 then status=$s
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
88 fi
a95dc7876025 entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
89 done