3 35dc4510 2019-02-04 stsp # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
5 35dc4510 2019-02-04 stsp # Permission to use, copy, modify, and distribute this software for any
6 35dc4510 2019-02-04 stsp # purpose with or without fee is hereby granted, provided that the above
7 35dc4510 2019-02-04 stsp # copyright notice and this permission notice appear in all copies.
9 35dc4510 2019-02-04 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 35dc4510 2019-02-04 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 35dc4510 2019-02-04 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 35dc4510 2019-02-04 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 35dc4510 2019-02-04 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 35dc4510 2019-02-04 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 35dc4510 2019-02-04 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 35dc4510 2019-02-04 stsp . ./common.sh
19 f6cae3ed 2020-09-13 naddy test_status_basic() {
20 35dc4510 2019-02-04 stsp local testroot=`test_init status_basic`
22 35dc4510 2019-02-04 stsp got checkout $testroot/repo $testroot/wt > /dev/null
24 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
25 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
29 35dc4510 2019-02-04 stsp echo "modified alpha" > $testroot/wt/alpha
30 2ec1f75b 2019-03-26 stsp (cd $testroot/wt && got rm beta >/dev/null)
31 35dc4510 2019-02-04 stsp echo "unversioned file" > $testroot/wt/foo
32 35dc4510 2019-02-04 stsp rm $testroot/wt/epsilon/zeta
33 14e5d4dc 2019-02-05 stsp touch $testroot/wt/beta
34 d00136be 2019-03-26 stsp echo "new file" > $testroot/wt/new
35 d00136be 2019-03-26 stsp (cd $testroot/wt && got add new >/dev/null)
36 40b289d7 2019-09-07 stsp mkdir -m 0000 $testroot/wt/bar
38 35dc4510 2019-02-04 stsp echo 'M alpha' > $testroot/stdout.expected
39 2ec1f75b 2019-03-26 stsp echo 'D beta' >> $testroot/stdout.expected
40 35dc4510 2019-02-04 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
41 35dc4510 2019-02-04 stsp echo '? foo' >> $testroot/stdout.expected
42 d00136be 2019-03-26 stsp echo 'A new' >> $testroot/stdout.expected
44 35dc4510 2019-02-04 stsp (cd $testroot/wt && got status > $testroot/stdout)
46 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
48 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
49 35dc4510 2019-02-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
51 40b289d7 2019-09-07 stsp chmod 700 $testroot/wt/bar
52 40b289d7 2019-09-07 stsp rmdir $testroot/wt/bar
53 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
56 f6cae3ed 2020-09-13 naddy test_status_subdir_no_mods() {
57 f02ba292 2019-02-05 stsp local testroot=`test_init status_subdir_no_mods 1`
59 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Basic/
60 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Basic/Targets/
61 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets/AArch64.cpp
62 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets.cpp
63 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets.h
64 f02ba292 2019-02-05 stsp (cd $testroot/repo && git add .)
65 f02ba292 2019-02-05 stsp git_commit $testroot/repo -m "add subdir with files"
67 f02ba292 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
69 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
70 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
74 f02ba292 2019-02-05 stsp touch $testroot/stdout.expected
76 f02ba292 2019-02-05 stsp # This used to erroneously print:
78 f02ba292 2019-02-05 stsp # ! Basic/Targets.cpp
79 f02ba292 2019-02-05 stsp # ? Basic/Targets.cpp
80 f02ba292 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
82 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
84 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
85 f02ba292 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
87 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
90 f6cae3ed 2020-09-13 naddy test_status_subdir_no_mods2() {
91 f02ba292 2019-02-05 stsp local testroot=`test_init status_subdir_no_mods2 1`
93 f02ba292 2019-02-05 stsp mkdir $testroot/repo/AST
94 f02ba292 2019-02-05 stsp touch $testroot/repo/AST/APValue.cpp
95 f02ba292 2019-02-05 stsp mkdir $testroot/repo/ASTMatchers
96 f02ba292 2019-02-05 stsp touch $testroot/repo/ASTMatchers/ASTMatchFinder.cpp
97 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Frontend
98 f02ba292 2019-02-05 stsp touch $testroot/repo/Frontend/ASTConsumers.cpp
99 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Frontend/Rewrite
100 f02ba292 2019-02-05 stsp touch $testroot/repo/Frontend/Rewrite/CMakeLists.txt
101 f02ba292 2019-02-05 stsp mkdir $testroot/repo/FrontendTool
102 f02ba292 2019-02-05 stsp touch $testroot/repo/FrontendTool/CMakeLists.txt
103 f02ba292 2019-02-05 stsp touch $testroot/repo/FrontendTool/ExecuteCompilerInvocation.cpp
104 f02ba292 2019-02-05 stsp (cd $testroot/repo && git add .)
105 f02ba292 2019-02-05 stsp git_commit $testroot/repo -m "add subdir with files"
107 f02ba292 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
109 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
110 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
114 f02ba292 2019-02-05 stsp touch $testroot/stdout.expected
116 f02ba292 2019-02-05 stsp # This used to erroneously print:
118 f02ba292 2019-02-05 stsp # ! AST/APValue.cpp
119 f02ba292 2019-02-05 stsp # ? AST/APValue.cpp
120 f02ba292 2019-02-05 stsp # ! Frontend/ASTConsumers.cpp
121 f02ba292 2019-02-05 stsp # ! Frontend/Rewrite/CMakeLists.txt
122 f02ba292 2019-02-05 stsp # ? Frontend/ASTConsumers.cpp
123 f02ba292 2019-02-05 stsp # ? Frontend/Rewrite/CMakeLists.txt
124 f02ba292 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
126 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
128 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
129 f02ba292 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
131 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
134 f6cae3ed 2020-09-13 naddy test_status_obstructed() {
135 0dbc2271 2019-02-05 stsp local testroot=`test_init status_obstructed`
137 0dbc2271 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
139 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
140 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
144 0dbc2271 2019-02-05 stsp rm $testroot/wt/epsilon/zeta
145 0dbc2271 2019-02-05 stsp mkdir $testroot/wt/epsilon/zeta
147 0dbc2271 2019-02-05 stsp echo '~ epsilon/zeta' > $testroot/stdout.expected
149 0dbc2271 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
151 a78810f8 2022-03-13 thomas cmp -s $testroot/stdout.expected $testroot/stdout
153 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
154 a78810f8 2022-03-13 thomas diff -u $testroot/stdout.expected $testroot/stdout
155 a78810f8 2022-03-13 thomas test_done "$testroot" "$ret"
159 a78810f8 2022-03-13 thomas (cd $testroot/wt && got status epsilon/zeta > $testroot/stdout)
161 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
163 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
164 0dbc2271 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
166 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
169 f6cae3ed 2020-09-13 naddy test_status_shows_local_mods_after_update() {
170 02c07007 2019-02-10 stsp local testroot=`test_init status_shows_local_mods_after_update 1`
172 02c07007 2019-02-10 stsp echo "1" > $testroot/repo/numbers
173 02c07007 2019-02-10 stsp echo "2" >> $testroot/repo/numbers
174 02c07007 2019-02-10 stsp echo "3" >> $testroot/repo/numbers
175 02c07007 2019-02-10 stsp echo "4" >> $testroot/repo/numbers
176 02c07007 2019-02-10 stsp echo "5" >> $testroot/repo/numbers
177 02c07007 2019-02-10 stsp echo "6" >> $testroot/repo/numbers
178 02c07007 2019-02-10 stsp echo "7" >> $testroot/repo/numbers
179 02c07007 2019-02-10 stsp echo "8" >> $testroot/repo/numbers
180 02c07007 2019-02-10 stsp (cd $testroot/repo && git add numbers)
181 02c07007 2019-02-10 stsp git_commit $testroot/repo -m "added numbers file"
183 02c07007 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
185 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
186 02c07007 2019-02-10 stsp test_done "$testroot" "$ret"
190 c206b220 2021-10-09 thomas sed -i '' -e 's/2/22/' $testroot/repo/numbers
191 02c07007 2019-02-10 stsp git_commit $testroot/repo -m "modified line 2"
193 02c07007 2019-02-10 stsp # modify line 7; both changes should merge cleanly
194 c206b220 2021-10-09 thomas sed -i '' -e 's/7/77/' $testroot/wt/numbers
196 02c07007 2019-02-10 stsp echo "G numbers" > $testroot/stdout.expected
197 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
198 02c07007 2019-02-10 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
199 02c07007 2019-02-10 stsp echo >> $testroot/stdout.expected
201 02c07007 2019-02-10 stsp (cd $testroot/wt && got update > $testroot/stdout)
203 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
205 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
206 02c07007 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
207 02c07007 2019-02-10 stsp test_done "$testroot" "$ret"
211 02c07007 2019-02-10 stsp echo 'M numbers' > $testroot/stdout.expected
213 02c07007 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
215 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
217 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
218 02c07007 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
220 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
223 f6cae3ed 2020-09-13 naddy test_status_unversioned_subdirs() {
224 18831e78 2019-02-10 stsp local testroot=`test_init status_unversioned_subdirs 1`
226 18831e78 2019-02-10 stsp mkdir $testroot/repo/cdfs/
227 18831e78 2019-02-10 stsp touch $testroot/repo/cdfs/Makefile
228 18831e78 2019-02-10 stsp mkdir $testroot/repo/common/
229 18831e78 2019-02-10 stsp touch $testroot/repo/common/Makefile
230 18831e78 2019-02-10 stsp mkdir $testroot/repo/iso/
231 18831e78 2019-02-10 stsp touch $testroot/repo/iso/Makefile
232 18831e78 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
233 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
234 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk/list.local
235 18831e78 2019-02-10 stsp mkdir $testroot/repo/ramdisk_cd/
236 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk_cd/Makefile
237 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk_cd/list.local
238 18831e78 2019-02-10 stsp (cd $testroot/repo && git add .)
239 18831e78 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
241 18831e78 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
243 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
244 18831e78 2019-02-10 stsp test_done "$testroot" "$ret"
248 18831e78 2019-02-10 stsp mkdir $testroot/wt/cdfs/obj
249 18831e78 2019-02-10 stsp mkdir $testroot/wt/ramdisk/obj
250 18831e78 2019-02-10 stsp mkdir $testroot/wt/ramdisk_cd/obj
251 18831e78 2019-02-10 stsp mkdir $testroot/wt/iso/obj
253 18831e78 2019-02-10 stsp echo -n > $testroot/stdout.expected
255 18831e78 2019-02-10 stsp # This used to erroneously print:
257 18831e78 2019-02-10 stsp # ! ramdisk_cd/Makefile
258 18831e78 2019-02-10 stsp # ! ramdisk_cd/list.local
259 18831e78 2019-02-10 stsp # ? ramdisk_cd/Makefile
260 18831e78 2019-02-10 stsp # ? ramdisk_cd/list.local
261 18831e78 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
263 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
265 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
266 18831e78 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
268 18831e78 2019-02-10 stsp test_done "$testroot" "$ret"
271 f6cae3ed 2020-09-13 naddy test_status_symlink() {
272 00bb5ea0 2020-07-23 stsp local testroot=`test_init status_symlink`
274 2c201a36 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
275 2c201a36 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
276 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s alpha alpha.link)
277 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s epsilon epsilon.link)
278 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s nonexistent nonexistent.link)
279 2c201a36 2019-02-10 stsp (cd $testroot/repo && git add .)
280 2c201a36 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
282 2c201a36 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
284 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
285 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
289 2c201a36 2019-02-10 stsp ln -s /usr/obj/distrib/i386/ramdisk $testroot/wt/ramdisk/obj
291 00bb5ea0 2020-07-23 stsp echo "? ramdisk/obj" > $testroot/stdout.expected
293 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && got status > $testroot/stdout)
295 00bb5ea0 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
297 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
298 00bb5ea0 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
299 00bb5ea0 2020-07-23 stsp test_done "$testroot" "$ret"
303 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && ln -sf beta alpha.link)
304 dd6165e4 2021-09-21 thomas.ad (cd $testroot/wt && ln -sfT gamma epsilon.link)
306 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s /etc/passwd passwd.link)
307 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s ../beta epsilon/beta.link)
308 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && got add passwd.link epsilon/beta.link > /dev/null)
310 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && got rm nonexistent.link > /dev/null)
312 d4ae64fa 2020-07-23 stsp echo 'M alpha.link' > $testroot/stdout.expected
313 00bb5ea0 2020-07-23 stsp echo 'A epsilon/beta.link' >> $testroot/stdout.expected
314 d4ae64fa 2020-07-23 stsp echo 'M epsilon.link' >> $testroot/stdout.expected
315 d4ae64fa 2020-07-23 stsp echo 'D nonexistent.link' >> $testroot/stdout.expected
316 00bb5ea0 2020-07-23 stsp echo 'A passwd.link' >> $testroot/stdout.expected
317 00bb5ea0 2020-07-23 stsp echo "? ramdisk/obj" >> $testroot/stdout.expected
319 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got status > $testroot/stdout)
321 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
323 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
324 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
326 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
329 f6cae3ed 2020-09-13 naddy test_status_shows_no_mods_after_complete_merge() {
330 3cbbd752 2019-02-19 stsp local testroot=`test_init status_shows_no_mods_after_complete_merge 1`
332 3cbbd752 2019-02-19 stsp # make this file larger than the usual blob buffer size of 8192
333 3cbbd752 2019-02-19 stsp echo -n > $testroot/repo/numbers
334 3cbbd752 2019-02-19 stsp for i in `jot 16384`; do
335 3cbbd752 2019-02-19 stsp echo "$i" >> $testroot/repo/numbers
338 3cbbd752 2019-02-19 stsp (cd $testroot/repo && git add numbers)
339 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "added numbers file"
341 3cbbd752 2019-02-19 stsp got checkout $testroot/repo $testroot/wt > /dev/null
343 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
344 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
348 c206b220 2021-10-09 thomas sed -i '' -e 's/2/22/' $testroot/repo/numbers
349 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "modified line 2"
352 3cbbd752 2019-02-19 stsp # modify line 2 again; no local changes are left after merge
353 c206b220 2021-10-09 thomas sed -i '' -e 's/2/22/' $testroot/wt/numbers
355 3cbbd752 2019-02-19 stsp echo "G numbers" > $testroot/stdout.expected
356 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
357 3cbbd752 2019-02-19 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
358 3cbbd752 2019-02-19 stsp echo >> $testroot/stdout.expected
360 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got update > $testroot/stdout)
362 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
364 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
365 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
366 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
370 2c201a36 2019-02-10 stsp echo -n > $testroot/stdout.expected
372 2c201a36 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
374 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
376 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
377 2c201a36 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
379 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
382 f6cae3ed 2020-09-13 naddy test_status_shows_conflict() {
383 7154f6ce 2019-03-27 stsp local testroot=`test_init status_shows_conflict 1`
385 7154f6ce 2019-03-27 stsp echo "1" > $testroot/repo/numbers
386 7154f6ce 2019-03-27 stsp echo "2" >> $testroot/repo/numbers
387 7154f6ce 2019-03-27 stsp echo "3" >> $testroot/repo/numbers
388 7154f6ce 2019-03-27 stsp echo "4" >> $testroot/repo/numbers
389 7154f6ce 2019-03-27 stsp echo "5" >> $testroot/repo/numbers
390 7154f6ce 2019-03-27 stsp echo "6" >> $testroot/repo/numbers
391 7154f6ce 2019-03-27 stsp echo "7" >> $testroot/repo/numbers
392 7154f6ce 2019-03-27 stsp echo "8" >> $testroot/repo/numbers
393 7154f6ce 2019-03-27 stsp (cd $testroot/repo && git add numbers)
394 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "added numbers file"
396 7154f6ce 2019-03-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
398 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
399 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
403 c206b220 2021-10-09 thomas sed -i '' -e 's/2/22/' $testroot/repo/numbers
404 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "modified line 2"
406 7154f6ce 2019-03-27 stsp # modify line 2 in a conflicting way
407 c206b220 2021-10-09 thomas sed -i '' -e 's/2/77/' $testroot/wt/numbers
409 7154f6ce 2019-03-27 stsp echo "C numbers" > $testroot/stdout.expected
410 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
411 7154f6ce 2019-03-27 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
412 7154f6ce 2019-03-27 stsp echo >> $testroot/stdout.expected
413 9627c110 2020-04-18 stsp echo "Files with new merge conflicts: 1" >> $testroot/stdout.expected
415 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got update > $testroot/stdout)
417 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
419 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
420 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
421 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
425 7154f6ce 2019-03-27 stsp echo 'C numbers' > $testroot/stdout.expected
427 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got status > $testroot/stdout)
429 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
431 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
432 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
434 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
437 f6cae3ed 2020-09-13 naddy test_status_empty_dir() {
438 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir`
440 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
442 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
443 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
447 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
449 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
451 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
453 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
455 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
456 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
458 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
461 f6cae3ed 2020-09-13 naddy test_status_empty_dir_unversioned_file() {
462 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir_unversioned_file`
464 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
466 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
467 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
471 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
472 c577a9ce 2019-07-27 stsp touch $testroot/wt/epsilon/unversioned
474 c577a9ce 2019-07-27 stsp echo '? epsilon/unversioned' > $testroot/stdout.expected
475 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
477 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
479 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
481 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
482 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
484 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
487 f6cae3ed 2020-09-13 naddy test_status_many_paths() {
488 72ea6654 2019-07-27 stsp local testroot=`test_init status_many_paths`
490 72ea6654 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
492 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
493 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
497 72ea6654 2019-07-27 stsp echo "modified alpha" > $testroot/wt/alpha
498 72ea6654 2019-07-27 stsp (cd $testroot/wt && got rm beta >/dev/null)
499 72ea6654 2019-07-27 stsp echo "unversioned file" > $testroot/wt/foo
500 72ea6654 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
501 72ea6654 2019-07-27 stsp touch $testroot/wt/beta
502 72ea6654 2019-07-27 stsp echo "new file" > $testroot/wt/new
503 72ea6654 2019-07-27 stsp mkdir $testroot/wt/newdir
504 72ea6654 2019-07-27 stsp (cd $testroot/wt && got add new >/dev/null)
506 f1417e9f 2021-10-12 thomas (cd $testroot/wt && got status alpha > $testroot/stdout.expected)
507 f1417e9f 2021-10-12 thomas (cd $testroot/wt && got status beta >> $testroot/stdout.expected)
508 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status epsilon >> $testroot/stdout.expected)
509 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status foo >> $testroot/stdout.expected)
510 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status new >> $testroot/stdout.expected)
511 f1417e9f 2021-10-12 thomas (cd $testroot/wt && got status newdir >> $testroot/stdout.expected)
512 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status . >> $testroot/stdout.expected)
514 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir alpha epsilon foo new beta . \
515 72ea6654 2019-07-27 stsp > $testroot/stdout)
517 6841da00 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
519 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
520 6841da00 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
522 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
525 f6cae3ed 2020-09-13 naddy test_status_cvsignore() {
526 6841da00 2019-08-08 stsp local testroot=`test_init status_cvsignore`
528 6841da00 2019-08-08 stsp got checkout $testroot/repo $testroot/wt > /dev/null
530 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
531 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
535 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foo
536 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foop
537 3143d852 2020-06-25 stsp echo "unversioned file" > $testroot/wt/epsilon/foo
538 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
539 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
540 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
541 3143d852 2020-06-25 stsp mkdir -p $testroot/wt/epsilon/new/
542 3143d852 2020-06-25 stsp echo "unversioned file" > $testroot/wt/epsilon/new/foo
543 3143d852 2020-06-25 stsp echo "**/foo" > $testroot/wt/.cvsignore
544 8528beef 2021-10-15 thomas echo "**/gamma" >> $testroot/wt/.cvsignore
545 6841da00 2019-08-08 stsp echo "bar" > $testroot/wt/epsilon/.cvsignore
546 6841da00 2019-08-08 stsp echo "moo" >> $testroot/wt/epsilon/.cvsignore
548 6841da00 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
549 6841da00 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
550 6841da00 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
551 6841da00 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
552 6841da00 2019-08-08 stsp (cd $testroot/wt && got status > $testroot/stdout)
554 3143d852 2020-06-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
556 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
557 3143d852 2020-06-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
558 3143d852 2020-06-25 stsp test_done "$testroot" "$ret"
562 3143d852 2020-06-25 stsp echo '? epsilon/.cvsignore' > $testroot/stdout.expected
563 3143d852 2020-06-25 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
564 3143d852 2020-06-25 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
566 b80270a7 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
568 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
569 b80270a7 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
570 b80270a7 2019-08-08 stsp test_done "$testroot" "$ret"
574 3143d852 2020-06-25 stsp echo -n '' > $testroot/stdout.expected
575 3143d852 2020-06-25 stsp (cd $testroot/wt && got status epsilon/new > $testroot/stdout)
577 3143d852 2020-06-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
579 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
580 3143d852 2020-06-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
581 3143d852 2020-06-25 stsp test_done "$testroot" "$ret"
585 b80270a7 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
586 b80270a7 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
587 b80270a7 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
588 bd8de430 2019-10-04 stsp echo '? foop' >> $testroot/stdout.expected
589 bd8de430 2019-10-04 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
591 f6343036 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
593 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
594 f6343036 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
595 f6343036 2021-06-22 stsp test_done "$testroot" "$ret"
599 f6343036 2021-06-22 stsp cat > $testroot/stdout.expected <<EOF
600 f6343036 2021-06-22 stsp ? .cvsignore
601 f6343036 2021-06-22 stsp ? epsilon/.cvsignore
602 f6343036 2021-06-22 stsp ? epsilon/bar
603 f6343036 2021-06-22 stsp ? epsilon/boo
604 f6343036 2021-06-22 stsp ? epsilon/foo
605 f6343036 2021-06-22 stsp ? epsilon/moo
606 f6343036 2021-06-22 stsp ? epsilon/new/foo
610 f6343036 2021-06-22 stsp (cd $testroot/wt && got status -I > $testroot/stdout)
612 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
613 f6343036 2021-06-22 stsp echo "got status failed unexpectedly" >&2
614 f6343036 2021-06-22 stsp test_done "$testroot" "1"
618 bd8de430 2019-10-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
620 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
621 bd8de430 2019-10-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
623 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
626 f6cae3ed 2020-09-13 naddy test_status_gitignore() {
627 bd8de430 2019-10-04 stsp local testroot=`test_init status_gitignore`
629 bd8de430 2019-10-04 stsp got checkout $testroot/repo $testroot/wt > /dev/null
631 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
632 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
636 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/foo
637 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/foop
638 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/barp
639 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
640 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
641 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
642 bd8de430 2019-10-04 stsp mkdir -p $testroot/wt/a/b/c/
643 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/a/b/c/foo
644 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/a/b/c/zoo
645 bd8de430 2019-10-04 stsp echo "foo" > $testroot/wt/.gitignore
646 bd8de430 2019-10-04 stsp echo "bar*" >> $testroot/wt/.gitignore
647 bd8de430 2019-10-04 stsp echo "epsilon/**" >> $testroot/wt/.gitignore
648 bd8de430 2019-10-04 stsp echo "a/**/foo" >> $testroot/wt/.gitignore
649 bd8de430 2019-10-04 stsp echo "**/zoo" >> $testroot/wt/.gitignore
651 bd8de430 2019-10-04 stsp echo '? .gitignore' > $testroot/stdout.expected
652 b80270a7 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
653 bd8de430 2019-10-04 stsp (cd $testroot/wt && got status > $testroot/stdout)
655 bd8de430 2019-10-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
657 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
658 bd8de430 2019-10-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
659 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
663 bd8de430 2019-10-04 stsp echo '? .gitignore' > $testroot/stdout.expected
664 bd8de430 2019-10-04 stsp echo '? foop' >> $testroot/stdout.expected
665 b80270a7 2019-08-08 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
667 72ea6654 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
669 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
670 72ea6654 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
671 f6343036 2021-06-22 stsp test_done "$testroot" "$ret"
675 f6343036 2021-06-22 stsp cat > $testroot/stdout.expected <<EOF
676 f6343036 2021-06-22 stsp ? .gitignore
677 f6343036 2021-06-22 stsp ? a/b/c/foo
678 f6343036 2021-06-22 stsp ? a/b/c/zoo
680 f6343036 2021-06-22 stsp ? epsilon/bar
681 f6343036 2021-06-22 stsp ? epsilon/boo
682 f6343036 2021-06-22 stsp ? epsilon/moo
686 f6343036 2021-06-22 stsp (cd $testroot/wt && got status -I > $testroot/stdout)
688 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
689 f6343036 2021-06-22 stsp echo "got status failed unexpectedly" >&2
690 f6343036 2021-06-22 stsp test_done "$testroot" "1"
694 f6343036 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
696 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
697 f6343036 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
699 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
702 f6cae3ed 2020-09-13 naddy test_status_status_code() {
703 081470ac 2020-08-13 stsp local testroot=`test_init status_status_code`
705 081470ac 2020-08-13 stsp got checkout $testroot/repo $testroot/wt > /dev/null
707 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
708 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
712 081470ac 2020-08-13 stsp echo "modified alpha" > $testroot/wt/alpha
713 081470ac 2020-08-13 stsp (cd $testroot/wt && got rm beta >/dev/null)
714 081470ac 2020-08-13 stsp echo "unversioned file" > $testroot/wt/foo
715 081470ac 2020-08-13 stsp rm $testroot/wt/epsilon/zeta
716 081470ac 2020-08-13 stsp touch $testroot/wt/beta
717 081470ac 2020-08-13 stsp echo "new file" > $testroot/wt/new
718 081470ac 2020-08-13 stsp (cd $testroot/wt && got add new >/dev/null)
720 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s xDM \
721 081470ac 2020-08-13 stsp > $testroot/stdout 2> $testroot/stderr)
723 fc414659 2022-04-16 thomas if [ $ret -eq 0 ]; then
724 081470ac 2020-08-13 stsp echo "status succeeded unexpectedly" >&2
725 081470ac 2020-08-13 stsp test_done "$testroot" "1"
729 081470ac 2020-08-13 stsp echo "got: invalid status code 'x'" > $testroot/stderr.expected
730 081470ac 2020-08-13 stsp cmp -s $testroot/stderr.expected $testroot/stderr
732 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
733 081470ac 2020-08-13 stsp diff -u $testroot/stderr.expected $testroot/stderr
734 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
738 081470ac 2020-08-13 stsp echo 'M alpha' > $testroot/stdout.expected
739 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s M > $testroot/stdout)
740 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
742 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
743 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
744 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
748 081470ac 2020-08-13 stsp echo 'D beta' > $testroot/stdout.expected
749 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s D > $testroot/stdout)
750 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
752 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
753 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
754 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
758 081470ac 2020-08-13 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
759 081470ac 2020-08-13 stsp echo '? foo' >> $testroot/stdout.expected
760 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -s !\? > $testroot/stdout)
761 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
763 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
764 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
765 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
769 081470ac 2020-08-13 stsp echo 'A new' > $testroot/stdout.expected
770 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
771 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
773 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
774 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
775 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
779 081470ac 2020-08-13 stsp (cd $testroot/wt && got stage new > $testroot/stdout)
781 081470ac 2020-08-13 stsp echo ' A new' > $testroot/stdout.expected
782 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
783 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
785 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
786 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
787 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
791 081470ac 2020-08-13 stsp echo 'changed file new' > $testroot/wt/new
793 081470ac 2020-08-13 stsp echo 'MA new' > $testroot/stdout.expected
794 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
795 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
797 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
798 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
799 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
803 081470ac 2020-08-13 stsp echo 'M alpha' > $testroot/stdout.expected
804 081470ac 2020-08-13 stsp echo 'MA new' >> $testroot/stdout.expected
805 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s M > $testroot/stdout)
806 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
808 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
809 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
810 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
814 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
817 67c65ed7 2021-09-14 tracey test_status_suppress() {
818 67c65ed7 2021-09-14 tracey local testroot=`test_init status_suppress`
820 67c65ed7 2021-09-14 tracey got checkout $testroot/repo $testroot/wt > /dev/null
822 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
823 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
827 67c65ed7 2021-09-14 tracey echo "modified alpha" > $testroot/wt/alpha
828 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got rm beta >/dev/null)
829 67c65ed7 2021-09-14 tracey echo "unversioned file" > $testroot/wt/foo
830 67c65ed7 2021-09-14 tracey rm $testroot/wt/epsilon/zeta
831 67c65ed7 2021-09-14 tracey touch $testroot/wt/beta
832 67c65ed7 2021-09-14 tracey echo "new file" > $testroot/wt/new
833 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got add new >/dev/null)
835 e3a46353 2021-09-14 stsp (cd $testroot/wt && got status -S A -s M \
836 e3a46353 2021-09-14 stsp > $testroot/stdout 2> $testroot/stderr)
838 fc414659 2022-04-16 thomas if [ $ret -eq 0 ]; then
839 e3a46353 2021-09-14 stsp echo "status succeeded unexpectedly" >&2
840 e3a46353 2021-09-14 stsp test_done "$testroot" "1"
844 e3a46353 2021-09-14 stsp echo "got: -s and -S options are mutually exclusive" \
845 e3a46353 2021-09-14 stsp > $testroot/stderr.expected
846 e3a46353 2021-09-14 stsp cmp -s $testroot/stderr.expected $testroot/stderr
848 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
849 e3a46353 2021-09-14 stsp diff -u $testroot/stderr.expected $testroot/stderr
850 e3a46353 2021-09-14 stsp test_done "$testroot" "$ret"
854 e3a46353 2021-09-14 stsp (cd $testroot/wt && got status -s A -S M \
855 e3a46353 2021-09-14 stsp > $testroot/stdout 2> $testroot/stderr)
857 fc414659 2022-04-16 thomas if [ $ret -eq 0 ]; then
858 e3a46353 2021-09-14 stsp echo "status succeeded unexpectedly" >&2
859 e3a46353 2021-09-14 stsp test_done "$testroot" "1"
863 e3a46353 2021-09-14 stsp echo "got: -S and -s options are mutually exclusive" \
864 e3a46353 2021-09-14 stsp > $testroot/stderr.expected
865 e3a46353 2021-09-14 stsp cmp -s $testroot/stderr.expected $testroot/stderr
867 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
868 e3a46353 2021-09-14 stsp diff -u $testroot/stderr.expected $testroot/stderr
869 e3a46353 2021-09-14 stsp test_done "$testroot" "$ret"
873 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got status -S xDM \
874 67c65ed7 2021-09-14 tracey > $testroot/stdout 2> $testroot/stderr)
876 fc414659 2022-04-16 thomas if [ $ret -eq 0 ]; then
877 67c65ed7 2021-09-14 tracey echo "status succeeded unexpectedly" >&2
878 67c65ed7 2021-09-14 tracey test_done "$testroot" "1"
882 67c65ed7 2021-09-14 tracey echo "got: invalid status code 'x'" > $testroot/stderr.expected
883 67c65ed7 2021-09-14 tracey cmp -s $testroot/stderr.expected $testroot/stderr
885 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
886 67c65ed7 2021-09-14 tracey diff -u $testroot/stderr.expected $testroot/stderr
887 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
891 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
892 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S D\?A! > $testroot/stdout)
893 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
895 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
896 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
897 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
901 67c65ed7 2021-09-14 tracey echo 'D beta' > $testroot/stdout.expected
902 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S M\?A! > $testroot/stdout)
903 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
905 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
906 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
907 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
911 67c65ed7 2021-09-14 tracey echo '! epsilon/zeta' > $testroot/stdout.expected
912 67c65ed7 2021-09-14 tracey echo '? foo' >> $testroot/stdout.expected
913 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got status -S MDA > $testroot/stdout)
914 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
916 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
917 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
918 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
922 67c65ed7 2021-09-14 tracey echo 'A new' > $testroot/stdout.expected
923 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
924 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
926 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
927 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
928 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
932 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got stage new > $testroot/stdout)
934 67c65ed7 2021-09-14 tracey echo ' A new' > $testroot/stdout.expected
935 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
936 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
938 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
939 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
940 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
944 67c65ed7 2021-09-14 tracey echo 'changed file new' > $testroot/wt/new
946 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
947 67c65ed7 2021-09-14 tracey echo 'MA new' >> $testroot/stdout.expected
948 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S D\?! > $testroot/stdout)
949 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
951 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
952 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
953 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
957 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
958 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S AD\?! > $testroot/stdout)
959 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
961 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
962 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
963 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
967 67c65ed7 2021-09-14 tracey rm $testroot/stdout.expected
968 67c65ed7 2021-09-14 tracey touch $testroot/stdout.expected
970 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
971 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
973 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
974 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
975 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
979 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
982 4a26d3f8 2020-10-07 stsp test_status_empty_file() {
983 4a26d3f8 2020-10-07 stsp local testroot=`test_init status_empty_file`
985 4a26d3f8 2020-10-07 stsp got checkout $testroot/repo $testroot/wt > /dev/null
987 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
988 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
992 4a26d3f8 2020-10-07 stsp echo -n "" > $testroot/wt/empty
993 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got add empty >/dev/null)
995 4a26d3f8 2020-10-07 stsp echo 'A empty' > $testroot/stdout.expected
997 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
999 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1001 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
1002 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1003 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1007 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got commit -m "empty file" >/dev/null)
1009 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
1011 4a26d3f8 2020-10-07 stsp echo -n > $testroot/stdout.expected
1012 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1014 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
1015 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1016 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1020 4a26d3f8 2020-10-07 stsp # update the timestamp; this used to make the file show up as:
1022 4a26d3f8 2020-10-07 stsp # which should not happen
1023 4a26d3f8 2020-10-07 stsp touch $testroot/wt/empty
1025 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
1027 4a26d3f8 2020-10-07 stsp echo -n > $testroot/stdout.expected
1028 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1030 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
1031 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1033 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1036 7fb414ae 2020-08-08 stsp test_parseargs "$@"
1037 35dc4510 2019-02-04 stsp run_test test_status_basic
1038 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods
1039 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods2
1040 0dbc2271 2019-02-05 stsp run_test test_status_obstructed
1041 02c07007 2019-02-10 stsp run_test test_status_shows_local_mods_after_update
1042 18831e78 2019-02-10 stsp run_test test_status_unversioned_subdirs
1043 00bb5ea0 2020-07-23 stsp run_test test_status_symlink
1044 3cbbd752 2019-02-19 stsp run_test test_status_shows_no_mods_after_complete_merge
1045 7154f6ce 2019-03-27 stsp run_test test_status_shows_conflict
1046 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir
1047 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir_unversioned_file
1048 72ea6654 2019-07-27 stsp run_test test_status_many_paths
1049 6841da00 2019-08-08 stsp run_test test_status_cvsignore
1050 bd8de430 2019-10-04 stsp run_test test_status_gitignore
1051 081470ac 2020-08-13 stsp run_test test_status_status_code
1052 67c65ed7 2021-09-14 tracey run_test test_status_suppress
1053 4a26d3f8 2020-10-07 stsp run_test test_status_empty_file