Debian Codegraph @

tests/t370

raw
1 # t370 --- rlog w/ various (-r, -l, -w, -s, -d) filters
2 #
3 # Copyright (C) 2013-2022 Thien-Thi Nguyen
4 #
5 # This program is free software: you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation, either version 3 of
8 # the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty
12 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 # See the GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 . $srcdir/common
19 split_std_out_err no
20
21 rout=$wd/rlog.out
22 rerr=$wd/rlog.err
23 $hey echo ' rlog:' `which rlog` ' -*- org -*-'
24
25 try ()
26 {
27 count=$1
28 flag=$2
29 yes=$3
30 fv=$4
31
32 $hey echo "* $count $flag '$yes' $fv"
33 cp -f `bundled_commav $fv` $v
34 $hey set -x
35
36 cmd="rlog $flag$yes"
37 # Don't use $cmd here. Instead, spell it out so that
38 # we can use doublequotes to enable ‘yes’ w/ embedded space.
39 must 'rlog "$flag$yes" $v 1>$rout 2>$rerr'
40 silence_means_death $rout "$cmd"
41 noiselessness_rules $rerr "$cmd"
42 sel="`sed '/.*selected revisions: /!d;s///' $rout`"
43 test -z "$sel" && sel=0
44 test $count = "$sel" \
45 || problem "count mismatch: expected $count, got '$sel'"
46 $hey set +x
47 }
48
49 ##
50 # Check ‘rlog -r[REV]’.
51 ##
52
53 try 0 -r '' empty
54 try 1 -r '' b.d/11,v
55 try 1 -r '' b.d/19,v
56 try 9 -r 1.1: b.d/19,v
57 try 4 -r 1.1:.4 b.d/19,v
58 try 9 -r :1.9 b.d/19,v
59 try 9 -r :.9 b.d/19,v
60 try 4 -r .6:.9 b.d/19,v
61 try 1 -r 1. b.d/19,v
62 try 9 -r 1 b.d/19,v
63 try 0 -r 42 b.d/19,v
64
65 ##
66 # Check ‘rlog -l[WHO]’.
67 ##
68
69 try 0 -l ttn empty
70 try 1 -l ttn b.d/11,v
71 try 0 -l zow b.d/11,v
72
73 ##
74 # Check ‘rlog -w[WHO]’.
75 ##
76
77 try 0 -w ttn empty
78 try 9 -w ttn b.d/1112,v
79 try 0 -w zow b.d/1112,v
80 try 18 -w ',zurg,ttn,,zurg' b
81
82 ##
83 # Check ‘rlog -sSTATE’.
84 ##
85
86 try 0 -s Exp empty
87 try 1 -s QQQ b.d/1111,v
88 try 9 -s Exp b.d/1111,v
89 try 0 -s Rel b.d/1111,v
90
91 ##
92 # Check ‘rlog -dDATE’.
93 ##
94
95 try 0 -d 2010-04 empty
96 try 1 -d 2010-04 b.d/19,v
97 try 2 -d '2010-04;2012-04' b.d/19,v
98 try 4 -d '2010-04<2012-04' b.d/19,v
99 try 0 -d '2010-04>2012-04' b.d/19,v
100
101 try 15 -d '<2010-04-18 09:39.04' b.d/1117,v
102 try 16 -d '<2010-04-18 09:39.05' b.d/1117,v
103
104 try 1 -d '1980<' ancient
105 try 0 -d '2000<' ancient
106
107 exit 0
108
109 # t370 ends here