Debian Codegraph @

tests/t470

raw
1 # t470 --- rcsmerge -p -kk
2 #
3 # Copyright (C) 2010-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 . $srcdir/common-kn
20 split_std_out_err no
21 $hey echo ' -*- org -*-'
22
23 prep_b_comparison
24 must 'cp `bundled_commav b.d/1612.cou` $w'
25
26 ##
27 # Check "rcsmerge -p -kk".
28 ##
29
30 muck='rcsmerge -p -kk'
31
32 ##
33 # * Check some invalid-input cases. We mix in ‘-z’, ‘-T’ and ‘-V’
34 # for coverage, mostly -- they are no-op here.
35 ##
36
37 $muck -zLT -T $v \
38 && problem 'rcsmerge did not fail for missing base revision number'
39
40 $muck -V3 $w $v \
41 && problem 'rcsmerge did not fail for missing base revision number'
42
43 $muck -V4 r2 $w $v \
44 && problem 'rcsmerge did not fail for bad revision number'
45
46 ##
47 # * Check some valid-input cases.
48 ##
49
50 must '$muck -r $w $v > $actual'
51 expected=$w
52 normalize_b_and_diff "$muck -r $w $v"
53
54 conflicted ()
55 {
56 # $1 -- rev1
57 # $2 -- rev2
58 # $3 -- STEM for fake/b.d/STEM.cou
59 # $4 -- expected output
60 cmd="$muck -r$1 -r$2"
61 echo "$4" | sed '1d;s/^|//;s/|$//' > $expected
62
63 must "cp -f `bundled_commav b.d/$3.cou` $w"
64 $cmd $w $v > $actual
65 test 1 = $? || problem "no conflicts detected: $cmd"
66 normalize_b_and_diff "$cmd"
67 }
68
69 expected=$wd/expected
70
71 conflicted 1.3 1.1.1.5 1612 '
72 |<<<<<<< t470.d/x|
73 |wow, rcs!$Revision: 1.6.1.2 $YES! HMMM THIS SHOULD BE NAMED "ZOW"!|
74 ||
75 |;; $Author: ttn $|
76 |;; $Date: 2010/10/21 22:48:48 $|
77 |;; $Header: /home/ttn/build/GNU/rcs/tests/fake/b,v 1.6.1.2 2010/10/21 22:48:48 ttn Exp $|
78 |;; $Id: b,v 1.6.1.2 2010/10/21 22:48:48 ttn Exp $|
79 |;; $Locker: $|
80 |;; $Name: $|
81 |;; $RCSfile: b,v $|
82 |;; $Revision: 1.6.1.2 $|
83 |;; $Source: /home/ttn/build/GNU/rcs/tests/fake/b,v $|
84 |;; $State: Exp $|
85 |;; $Log: b,v $|
86 |;; Revision 1.6.1.2 2010/10/21 22:48:48 ttn|
87 |;; Add a name.|
88 |;;|
89 |;; Revision 1.6.1.1 2010/05/05 12:18:30 ttn|
90 |;; This should in theory go to 1.6.1.1.|
91 |;;|
92 |;; Revision 1.6 2010/04/12 12:16:58 ttn|
93 |;; Add $Revision with pre and suffix.|
94 |;;|
95 |;; Revision 1.5 2010/03/30 09:46:50 ttn|
96 |;; Add text after Log block.|
97 |;;|
98 |;; Revision 1.4 2010/03/30 09:46:24 zurg|
99 |;; Add "earthlings".|
100 |;;|
101 |;; Revision 1.3 2010/03/30 09:45:42 zurg|
102 |;; Add "greetings".|
103 |;;|
104 |;; Revision 1.2 2010/03/30 09:45:02 ttn|
105 |;; Add empty headers.|
106 |;;|
107 |;; Here is some trailing text|
108 |greetings|
109 |earthlings|
110 |=======|
111 |$Author$|
112 ||
113 |$Date$|
114 ||
115 |$Header$|
116 ||
117 |$Id$|
118 ||
119 |$Locker$|
120 ||
121 |$Log$|
122 |Revision 1.1.1.5 2010/03/18 06:21:03 ttn|
123 |WOW is 1.1.1.5! (+ sorted kw)|
124 ||
125 ||
126 |$Name$|
127 ||
128 |$RCSfile$|
129 ||
130 |$Revision$|
131 ||
132 |$Source$|
133 ||
134 |$State$|
135 ||
136 |>>>>>>> 1.1.1.5|'
137
138 conflicted 1.6.1.1 1.6.1.2 1612 '
139 |<<<<<<< t470.d/x|
140 |wow, rcs!$Revision: 1.6.1.2 $YES! HMMM THIS SHOULD BE NAMED "ZOW"!|
141 |=======|
142 |wow, rcs!$Revision$YES! HMMM THIS SHOULD BE NAMED "ZOW"!|
143 |>>>>>>> 1.6.1.2|
144 ||
145 |<<<<<<< t470.d/x|
146 |;; $Author: ttn $|
147 |;; $Date: 2010/10/21 22:48:48 $|
148 |;; $Header: /home/ttn/build/GNU/rcs/tests/fake/b,v 1.6.1.2 2010/10/21 22:48:48 ttn Exp $|
149 |;; $Id: b,v 1.6.1.2 2010/10/21 22:48:48 ttn Exp $|
150 |;; $Locker: $|
151 |;; $Name: $|
152 |;; $RCSfile: b,v $|
153 |;; $Revision: 1.6.1.2 $|
154 |;; $Source: /home/ttn/build/GNU/rcs/tests/fake/b,v $|
155 |;; $State: Exp $|
156 |;; $Log: b,v $|
157 |;; Revision 1.6.1.2 2010/10/21 22:48:48 ttn|
158 |;; Add a name.|
159 |;;|
160 |=======|
161 |;; $Author$|
162 |;; $Date$|
163 |;; $Header$|
164 |;; $Id$|
165 |;; $Locker$|
166 |;; $Name$|
167 |;; $RCSfile$|
168 |;; $Revision$|
169 |;; $Source$|
170 |;; $State$|
171 |;; $Log$|
172 |;; Revision 1.6.1.2 2010/10/21 22:48:48 ttn|
173 |;; Add a name.|
174 |;;|
175 |>>>>>>> 1.6.1.2|
176 |;; Revision 1.6.1.1 2010/05/05 12:18:30 ttn|
177 |;; This should in theory go to 1.6.1.1.|
178 |;;|
179 |;; Revision 1.6 2010/04/12 12:16:58 ttn|
180 |;; Add $Revision with pre and suffix.|
181 |;;|
182 |;; Revision 1.5 2010/03/30 09:46:50 ttn|
183 |;; Add text after Log block.|
184 |;;|
185 |;; Revision 1.4 2010/03/30 09:46:24 zurg|
186 |;; Add "earthlings".|
187 |;;|
188 |;; Revision 1.3 2010/03/30 09:45:42 zurg|
189 |;; Add "greetings".|
190 |;;|
191 |;; Revision 1.2 2010/03/30 09:45:02 ttn|
192 |;; Add empty headers.|
193 |;;|
194 |;; Here is some trailing text|
195 |greetings|
196 |earthlings|'
197
198 conflicted 1.9 1.1 15 '
199 |<<<<<<< t470.d/x|
200 |;; $Author: ttn $|
201 |;; $Date: 2010/03/30 09:46:50 $|
202 |;; $Header: /home/ttn/build/GNU/rcs/tests/fake/b,v 1.5 2010/03/30 09:46:50 ttn Exp $|
203 |;; $Id: b,v 1.5 2010/03/30 09:46:50 ttn Exp $|
204 |;; $Locker: $|
205 |;; $Name: $|
206 |;; $RCSfile: b,v $|
207 |;; $Revision: 1.5 $|
208 |;; $Source: /home/ttn/build/GNU/rcs/tests/fake/b,v $|
209 |;; $State: Exp $|
210 |;; $Log: b,v $|
211 |;; Revision 1.5 2010/03/30 09:46:50 ttn|
212 |;; Add text after Log block.|
213 |;;|
214 |;; Revision 1.4 2010/03/30 09:46:24 zurg|
215 |;; Add "earthlings".|
216 |;;|
217 |;; Revision 1.3 2010/03/30 09:45:42 zurg|
218 |;; Add "greetings".|
219 |;;|
220 |;; Revision 1.2 2010/03/30 09:45:02 ttn|
221 |;; Add empty headers.|
222 |;;|
223 |;; Here is some trailing text|
224 |greetings|
225 |earthlings|
226 |=======|
227 |>>>>>>> 1.1|'
228
229 exit 0
230
231 # t470 ends here