3 # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 local testroot
=`test_init revert_basic`
22 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
24 if [ "$ret" != "0" ]; then
25 test_done
"$testroot" "$ret"
29 echo "modified epsilon/zeta" > $testroot/wt
/epsilon
/zeta
31 echo 'R epsilon/zeta' > $testroot/stdout.expected
33 (cd $testroot/wt
&& got revert epsilon
/zeta
> $testroot/stdout
)
35 cmp -s $testroot/stdout.expected
$testroot/stdout
37 if [ "$ret" != "0" ]; then
38 diff -u $testroot/stdout.expected
$testroot/stdout
39 test_done
"$testroot" "$ret"
43 echo "zeta" > $testroot/content.expected
44 cat $testroot/wt
/epsilon
/zeta
> $testroot/content
46 cmp -s $testroot/content.expected
$testroot/content
48 if [ "$ret" != "0" ]; then
49 diff -u $testroot/content.expected
$testroot/content
51 test_done
"$testroot" "$ret"
56 local testroot
=`test_init revert_rm`
58 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
60 if [ "$ret" != "0" ]; then
61 test_done
"$testroot" "$ret"
65 (cd $testroot/wt
&& got
rm beta
>/dev
/null
)
67 echo 'R beta' > $testroot/stdout.expected
69 (cd $testroot/wt
&& got revert beta
> $testroot/stdout
)
71 cmp -s $testroot/stdout.expected
$testroot/stdout
73 if [ "$ret" != "0" ]; then
74 diff -u $testroot/stdout.expected
$testroot/stdout
75 test_done
"$testroot" "$ret"
79 echo "beta" > $testroot/content.expected
80 cat $testroot/wt
/beta
> $testroot/content
82 cmp -s $testroot/content.expected
$testroot/content
84 if [ "$ret" != "0" ]; then
85 diff -u $testroot/content.expected
$testroot/content
87 test_done
"$testroot" "$ret"
91 local testroot
=`test_init revert_add`
93 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
95 if [ "$ret" != "0" ]; then
96 test_done
"$testroot" "$ret"
100 echo "new file" > $testroot/wt
/new
101 (cd $testroot/wt
&& got add new
>/dev
/null
)
103 echo 'R new' > $testroot/stdout.expected
105 (cd $testroot/wt
&& got revert new
> $testroot/stdout
)
107 cmp -s $testroot/stdout.expected
$testroot/stdout
109 if [ "$ret" != "0" ]; then
110 diff -u $testroot/stdout.expected
$testroot/stdout
111 test_done
"$testroot" "$ret"
115 echo "new file" > $testroot/content.expected
116 cat $testroot/wt
/new
> $testroot/content
118 cmp -s $testroot/content.expected
$testroot/content
120 if [ "$ret" != "0" ]; then
121 diff -u $testroot/content.expected
$testroot/content
122 test_done
"$testroot" "$ret"
126 echo '? new' > $testroot/stdout.expected
128 (cd $testroot/wt
&& got status
> $testroot/stdout
)
130 cmp -s $testroot/stdout.expected
$testroot/stdout
132 if [ "$ret" != "0" ]; then
133 diff -u $testroot/stdout.expected
$testroot/stdout
135 test_done
"$testroot" "$ret"
138 test_revert_multiple
() {
139 local testroot
=`test_init revert_multiple`
141 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
143 if [ "$ret" != "0" ]; then
144 test_done
"$testroot" "$ret"
148 echo "modified alpha" > $testroot/wt
/alpha
149 echo "modified epsilon/zeta" > $testroot/wt
/epsilon
/zeta
151 echo 'R alpha' > $testroot/stdout.expected
152 echo 'R epsilon/zeta' >> $testroot/stdout.expected
154 (cd $testroot/wt
&& got revert alpha epsilon
/zeta
> $testroot/stdout
)
156 cmp -s $testroot/stdout.expected
$testroot/stdout
158 if [ "$ret" != "0" ]; then
159 diff -u $testroot/stdout.expected
$testroot/stdout
160 test_done
"$testroot" "$ret"
164 echo "alpha" > $testroot/content.expected
165 cat $testroot/wt
/alpha
> $testroot/content
167 cmp -s $testroot/content.expected
$testroot/content
169 if [ "$ret" != "0" ]; then
170 diff -u $testroot/content.expected
$testroot/content
171 test_done
"$testroot" "$ret"
175 echo "zeta" > $testroot/content.expected
176 cat $testroot/wt
/epsilon
/zeta
> $testroot/content
178 cmp -s $testroot/content.expected
$testroot/content
180 if [ "$ret" != "0" ]; then
181 diff -u $testroot/content.expected
$testroot/content
183 test_done
"$testroot" "$ret"
186 test_revert_file_in_new_subdir
() {
187 local testroot
=`test_init revert_file_in_new_subdir`
189 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
191 if [ "$ret" != "0" ]; then
192 test_done
"$testroot" "$ret"
197 mkdir
-p $testroot/wt
/newdir
198 echo new
> $testroot/wt
/newdir
/new
199 (cd $testroot/wt
&& got add newdir
/new
> /dev
/null
)
201 (cd $testroot/wt
&& got revert newdir
/new
> $testroot/stdout
)
203 echo "R newdir/new" > $testroot/stdout.expected
204 cmp -s $testroot/stdout.expected
$testroot/stdout
206 if [ "$ret" != "0" ]; then
207 diff -u $testroot/stdout.expected
$testroot/stdout
208 test_done
"$testroot" "$ret"
212 (cd $testroot/wt
&& got status
> $testroot/stdout
)
214 echo "? newdir/new" > $testroot/stdout.expected
215 cmp -s $testroot/stdout.expected
$testroot/stdout
217 if [ "$ret" != "0" ]; then
218 diff -u $testroot/stdout.expected
$testroot/stdout
220 test_done
"$testroot" "$ret"
224 test_revert_no_arguments
() {
225 local testroot
=`test_init revert_no_arguments`
227 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
229 if [ "$ret" != "0" ]; then
230 test_done
"$testroot" "$ret"
234 echo "modified epsilon/zeta" > $testroot/wt
/epsilon
/zeta
236 (cd $testroot/wt
&& got revert
> $testroot/stdout
2> $testroot/stderr
)
238 if [ "$ret" = "0" ]; then
239 echo "revert command succeeded unexpectedly" >&2
240 test_done
"$testroot" "1"
244 echo -n > $testroot/stdout.expected
245 cmp -s $testroot/stdout.expected
$testroot/stdout
247 if [ "$ret" != "0" ]; then
248 diff -u $testroot/stdout.expected
$testroot/stdout
249 test_done
"$testroot" "$ret"
253 echo "usage: got revert [-p] [-F response-script] [-R] path ..." \
254 > $testroot/stderr.expected
255 cmp -s $testroot/stderr.expected
$testroot/stderr
257 if [ "$ret" != "0" ]; then
258 diff -u $testroot/stderr.expected
$testroot/stderr
260 test_done
"$testroot" "$ret"
263 test_revert_directory
() {
264 local testroot
=`test_init revert_directory`
266 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
268 if [ "$ret" != "0" ]; then
269 test_done
"$testroot" "$ret"
273 echo "modified epsilon/zeta" > $testroot/wt
/epsilon
/zeta
275 (cd $testroot/wt
&& got revert .
> $testroot/stdout
2> $testroot/stderr
)
277 if [ "$ret" = "0" ]; then
278 echo "got revert command succeeded unexpectedly" >&2
279 test_done
"$testroot" "1"
282 echo "got: reverting directories requires -R option" \
283 > $testroot/stderr.expected
284 cmp -s $testroot/stderr.expected
$testroot/stderr
286 if [ "$ret" != "0" ]; then
287 diff -u $testroot/stderr.expected
$testroot/stderr
288 test_done
"$testroot" "$ret"
292 echo -n > $testroot/stdout.expected
293 cmp -s $testroot/stdout.expected
$testroot/stdout
295 if [ "$ret" != "0" ]; then
296 diff -u $testroot/stdout.expected
$testroot/stdout
297 test_done
"$testroot" "$ret"
301 (cd $testroot/wt
&& got revert
-R .
> $testroot/stdout
)
303 echo 'R epsilon/zeta' > $testroot/stdout.expected
304 cmp -s $testroot/stdout.expected
$testroot/stdout
306 if [ "$ret" != "0" ]; then
307 diff -u $testroot/stdout.expected
$testroot/stdout
308 test_done
"$testroot" "$ret"
312 echo "zeta" > $testroot/content.expected
313 cat $testroot/wt
/epsilon
/zeta
> $testroot/content
315 cmp -s $testroot/content.expected
$testroot/content
317 if [ "$ret" != "0" ]; then
318 diff -u $testroot/content.expected
$testroot/content
320 test_done
"$testroot" "$ret"
323 test_revert_directory_unknown
() {
324 local testroot
=`test_init revert_directory_unknown`
326 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
328 if [ "$ret" != "0" ]; then
329 test_done
"$testroot" "$ret"
333 echo "modified alpha" > $testroot/wt
/alpha
334 echo "new untracked file" > $testroot/wt
/epsilon
/new_file
335 echo "modified epsilon/zeta" > $testroot/wt
/epsilon
/zeta
337 (cd $testroot/wt
&& got revert
-R .
> $testroot/stdout
)
339 echo 'R alpha' > $testroot/stdout.expected
340 echo 'R epsilon/zeta' >> $testroot/stdout.expected
341 cmp -s $testroot/stdout.expected
$testroot/stdout
343 if [ "$ret" != "0" ]; then
344 diff -u $testroot/stdout.expected
$testroot/stdout
345 test_done
"$testroot" "$ret"
349 echo "new untracked file" > $testroot/content.expected
350 cat $testroot/wt
/epsilon
/new_file
> $testroot/content
352 cmp -s $testroot/content.expected
$testroot/content
354 if [ "$ret" != "0" ]; then
355 diff -u $testroot/content.expected
$testroot/content
356 test_done
"$testroot" "$ret"
360 echo "zeta" > $testroot/content.expected
361 cat $testroot/wt
/epsilon
/zeta
> $testroot/content
363 cmp -s $testroot/content.expected
$testroot/content
365 if [ "$ret" != "0" ]; then
366 diff -u $testroot/content.expected
$testroot/content
369 test_done
"$testroot" "$ret"
372 test_revert_patch
() {
373 local testroot
=`test_init revert_patch`
375 jot 16 > $testroot/repo
/numbers
376 (cd $testroot/repo
&& git add numbers
)
377 git_commit
$testroot/repo
-m "added numbers file"
378 local commit_id
=`git_show_head $testroot/repo`
380 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
382 if [ "$ret" != "0" ]; then
383 test_done
"$testroot" "$ret"
387 sed -i '' -e 's/^2$/a/' $testroot/wt
/numbers
388 sed -i '' -e 's/^7$/b/' $testroot/wt
/numbers
389 sed -i '' -e 's/^16$/c/' $testroot/wt
/numbers
391 (cd $testroot/wt
&& got
diff > $testroot/numbers.
diff)
393 # don't revert any hunks
394 printf "n\nn\nn\n" > $testroot/patchscript
395 (cd $testroot/wt
&& got revert
-F $testroot/patchscript
-p \
396 numbers
> $testroot/stdout
)
398 if [ "$ret" != "0" ]; then
399 echo "got revert command failed unexpectedly" >&2
400 test_done
"$testroot" "1"
403 cat > $testroot/stdout.expected
<<EOF
404 -----------------------------------------------
412 -----------------------------------------------
413 M numbers (change 1 of 3)
414 revert this change? [y/n/q] n
415 -----------------------------------------------
425 -----------------------------------------------
426 M numbers (change 2 of 3)
427 revert this change? [y/n/q] n
428 -----------------------------------------------
435 -----------------------------------------------
436 M numbers (change 3 of 3)
437 revert this change? [y/n/q] n
439 cmp -s $testroot/stdout.expected
$testroot/stdout
441 if [ "$ret" != "0" ]; then
442 diff -u $testroot/stdout.expected
$testroot/stdout
443 test_done
"$testroot" "$ret"
447 (cd $testroot/wt
&& got status
> $testroot/stdout
)
448 echo "M numbers" > $testroot/stdout.expected
449 cmp -s $testroot/stdout.expected
$testroot/stdout
451 if [ "$ret" != "0" ]; then
452 diff -u $testroot/stdout.expected
$testroot/stdout
453 test_done
"$testroot" "$ret"
457 (cd $testroot/wt
&& got
diff > $testroot/stdout
)
458 cmp -s $testroot/numbers.
diff $testroot/stdout
460 if [ "$ret" != "0" ]; then
461 diff -u $testroot/numbers.
diff $testroot/stdout
462 test_done
"$testroot" "$ret"
467 printf "y\nn\nn\n" > $testroot/patchscript
468 (cd $testroot/wt
&& got revert
-F $testroot/patchscript
-p \
469 numbers
> $testroot/stdout
)
471 if [ "$ret" != "0" ]; then
472 echo "got revert command failed unexpectedly" >&2
473 test_done
"$testroot" "1"
476 cat > $testroot/stdout.expected
<<EOF
477 -----------------------------------------------
485 -----------------------------------------------
486 M numbers (change 1 of 3)
487 revert this change? [y/n/q] y
488 -----------------------------------------------
498 -----------------------------------------------
499 M numbers (change 2 of 3)
500 revert this change? [y/n/q] n
501 -----------------------------------------------
508 -----------------------------------------------
509 M numbers (change 3 of 3)
510 revert this change? [y/n/q] n
512 cmp -s $testroot/stdout.expected
$testroot/stdout
514 if [ "$ret" != "0" ]; then
515 diff -u $testroot/stdout.expected
$testroot/stdout
516 test_done
"$testroot" "$ret"
520 (cd $testroot/wt
&& got status
> $testroot/stdout
)
521 echo "M numbers" > $testroot/stdout.expected
522 cmp -s $testroot/stdout.expected
$testroot/stdout
524 if [ "$ret" != "0" ]; then
525 diff -u $testroot/stdout.expected
$testroot/stdout
526 test_done
"$testroot" "$ret"
530 echo "diff $commit_id $testroot/wt" > $testroot/stdout.expected
531 echo -n 'blob - ' >> $testroot/stdout.expected
532 got tree
-r $testroot/repo
-i -c $commit_id \
533 |
grep 'numbers$' | cut
-d' ' -f 1 \
534 >> $testroot/stdout.expected
535 echo 'file + numbers' >> $testroot/stdout.expected
536 cat >> $testroot/stdout.expected
<<EOF
555 (cd $testroot/wt
&& got
diff > $testroot/stdout
)
556 cmp -s $testroot/stdout.expected
$testroot/stdout
558 if [ "$ret" != "0" ]; then
559 diff -u $testroot/stdout.expected
$testroot/stdout
560 test_done
"$testroot" "$ret"
564 # put first hunk back
565 sed -i '' -e 's/^2$/a/' $testroot/wt
/numbers
568 printf "n\ny\nn\n" > $testroot/patchscript
569 (cd $testroot/wt
&& got revert
-F $testroot/patchscript
-p \
570 numbers
> $testroot/stdout
)
572 cat > $testroot/stdout.expected
<<EOF
573 -----------------------------------------------
581 -----------------------------------------------
582 M numbers (change 1 of 3)
583 revert this change? [y/n/q] n
584 -----------------------------------------------
594 -----------------------------------------------
595 M numbers (change 2 of 3)
596 revert this change? [y/n/q] y
597 -----------------------------------------------
604 -----------------------------------------------
605 M numbers (change 3 of 3)
606 revert this change? [y/n/q] n
608 cmp -s $testroot/stdout.expected
$testroot/stdout
610 if [ "$ret" != "0" ]; then
611 diff -u $testroot/stdout.expected
$testroot/stdout
612 test_done
"$testroot" "$ret"
616 (cd $testroot/wt
&& got status
> $testroot/stdout
)
617 echo "M numbers" > $testroot/stdout.expected
618 cmp -s $testroot/stdout.expected
$testroot/stdout
620 if [ "$ret" != "0" ]; then
621 diff -u $testroot/stdout.expected
$testroot/stdout
622 test_done
"$testroot" "$ret"
626 (cd $testroot/wt
&& got
diff > $testroot/stdout
)
628 echo "diff $commit_id $testroot/wt" > $testroot/stdout.expected
629 echo -n 'blob - ' >> $testroot/stdout.expected
630 got tree
-r $testroot/repo
-i -c $commit_id \
631 |
grep 'numbers$' | cut
-d' ' -f 1 \
632 >> $testroot/stdout.expected
633 echo 'file + numbers' >> $testroot/stdout.expected
634 cat >> $testroot/stdout.expected
<<EOF
651 cmp -s $testroot/stdout.expected
$testroot/stdout
653 if [ "$ret" != "0" ]; then
654 diff -u $testroot/stdout.expected
$testroot/stdout
655 test_done
"$testroot" "$ret"
660 printf "n\ny\n" > $testroot/patchscript
661 (cd $testroot/wt
&& got revert
-F $testroot/patchscript
-p \
662 numbers
> $testroot/stdout
)
663 cat > $testroot/stdout.expected
<<EOF
664 -----------------------------------------------
672 -----------------------------------------------
673 M numbers (change 1 of 2)
674 revert this change? [y/n/q] n
675 -----------------------------------------------
682 -----------------------------------------------
683 M numbers (change 2 of 2)
684 revert this change? [y/n/q] y
686 cmp -s $testroot/stdout.expected
$testroot/stdout
688 if [ "$ret" != "0" ]; then
689 diff -u $testroot/stdout.expected
$testroot/stdout
690 test_done
"$testroot" "$ret"
694 (cd $testroot/wt
&& got
diff > $testroot/stdout
)
696 echo "diff $commit_id $testroot/wt" > $testroot/stdout.expected
697 echo -n 'blob - ' >> $testroot/stdout.expected
698 got tree
-r $testroot/repo
-i -c $commit_id \
699 |
grep 'numbers$' | cut
-d' ' -f 1 \
700 >> $testroot/stdout.expected
701 echo 'file + numbers' >> $testroot/stdout.expected
702 cat >> $testroot/stdout.expected
<<EOF
713 cmp -s $testroot/stdout.expected
$testroot/stdout
715 if [ "$ret" != "0" ]; then
716 diff -u $testroot/stdout.expected
$testroot/stdout
718 test_done
"$testroot" "$ret"
721 test_revert_patch_added
() {
722 local testroot
=`test_init revert_patch_added`
723 local commit_id
=`git_show_head $testroot/repo`
725 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
727 if [ "$ret" != "0" ]; then
728 test_done
"$testroot" "$ret"
732 echo "new" > $testroot/wt
/epsilon
/new
733 (cd $testroot/wt
&& got add epsilon
/new
> /dev
/null
)
735 printf "n\n" > $testroot/patchscript
736 (cd $testroot/wt
&& got revert
-F $testroot/patchscript
-p \
737 epsilon
/new
> $testroot/stdout
)
739 echo "A epsilon/new" > $testroot/stdout.expected
740 echo "revert this addition? [y/n] n" >> $testroot/stdout.expected
741 cmp -s $testroot/stdout.expected
$testroot/stdout
743 if [ "$ret" != "0" ]; then
744 diff -u $testroot/stdout.expected
$testroot/stdout
745 test_done
"$testroot" "$ret"
749 (cd $testroot/wt
&& got status
> $testroot/stdout
)
750 echo "A epsilon/new" > $testroot/stdout.expected
751 cmp -s $testroot/stdout.expected
$testroot/stdout
753 if [ "$ret" != "0" ]; then
754 diff -u $testroot/stdout.expected
$testroot/stdout
755 test_done
"$testroot" "$ret"
759 printf "y\n" > $testroot/patchscript
760 (cd $testroot/wt
&& got revert
-F $testroot/patchscript
-p \
761 epsilon
/new
> $testroot/stdout
)
763 echo "A epsilon/new" > $testroot/stdout.expected
764 echo "revert this addition? [y/n] y" >> $testroot/stdout.expected
765 echo "R epsilon/new" >> $testroot/stdout.expected
766 cmp -s $testroot/stdout.expected
$testroot/stdout
768 if [ "$ret" != "0" ]; then
769 diff -u $testroot/stdout.expected
$testroot/stdout
770 test_done
"$testroot" "$ret"
774 (cd $testroot/wt
&& got status
> $testroot/stdout
)
775 echo "? epsilon/new" > $testroot/stdout.expected
776 cmp -s $testroot/stdout.expected
$testroot/stdout
778 if [ "$ret" != "0" ]; then
779 diff -u $testroot/stdout.expected
$testroot/stdout
781 test_done
"$testroot" "$ret"
784 test_revert_patch_removed
() {
785 local testroot
=`test_init revert_patch_removed`
786 local commit_id
=`git_show_head $testroot/repo`
788 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
790 if [ "$ret" != "0" ]; then
791 test_done
"$testroot" "$ret"
795 (cd $testroot/wt
&& got
rm beta
> /dev
/null
)
797 printf "n\n" > $testroot/patchscript
798 (cd $testroot/wt
&& got revert
-F $testroot/patchscript
-p \
799 beta
> $testroot/stdout
)
800 echo "D beta" > $testroot/stdout.expected
801 echo "revert this deletion? [y/n] n" >> $testroot/stdout.expected
802 cmp -s $testroot/stdout.expected
$testroot/stdout
804 if [ "$ret" != "0" ]; then
805 diff -u $testroot/stdout.expected
$testroot/stdout
806 test_done
"$testroot" "$ret"
810 (cd $testroot/wt
&& got status
> $testroot/stdout
)
811 echo "D beta" > $testroot/stdout.expected
812 cmp -s $testroot/stdout.expected
$testroot/stdout
814 if [ "$ret" != "0" ]; then
815 diff -u $testroot/stdout.expected
$testroot/stdout
816 test_done
"$testroot" "$ret"
820 printf "y\n" > $testroot/patchscript
821 (cd $testroot/wt
&& got revert
-F $testroot/patchscript
-p \
822 beta
> $testroot/stdout
)
824 echo "D beta" > $testroot/stdout.expected
825 echo "revert this deletion? [y/n] y" >> $testroot/stdout.expected
826 echo "R beta" >> $testroot/stdout.expected
827 cmp -s $testroot/stdout.expected
$testroot/stdout
829 if [ "$ret" != "0" ]; then
830 diff -u $testroot/stdout.expected
$testroot/stdout
831 test_done
"$testroot" "$ret"
835 (cd $testroot/wt
&& got status
> $testroot/stdout
)
836 echo -n > $testroot/stdout.expected
837 cmp -s $testroot/stdout.expected
$testroot/stdout
839 if [ "$ret" != "0" ]; then
840 diff -u $testroot/stdout.expected
$testroot/stdout
842 test_done
"$testroot" "$ret"
845 test_revert_patch_one_change
() {
846 local testroot
=`test_init revert_patch_one_change`
848 jot 16 > $testroot/repo
/numbers
849 (cd $testroot/repo
&& git add numbers
)
850 git_commit
$testroot/repo
-m "added numbers file"
851 local commit_id
=`git_show_head $testroot/repo`
853 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
855 if [ "$ret" != "0" ]; then
856 test_done
"$testroot" "$ret"
860 # Ensure file size is changed. Avoids race condition causing test
861 # failures where 'got revert' does not see changes to revert if
862 # timestamps and size in stat info remain unchanged.
863 sed -i '' -e 's/^2$/aa/' $testroot/wt
/numbers
865 # revert change with -p
866 printf "y\n" > $testroot/patchscript
867 (cd $testroot/wt
&& got revert
-F $testroot/patchscript
-p \
868 numbers
> $testroot/stdout
)
870 if [ "$ret" != "0" ]; then
871 echo "got revert command failed unexpectedly" >&2
872 test_done
"$testroot" "1"
875 cat > $testroot/stdout.expected
<<EOF
876 -----------------------------------------------
884 -----------------------------------------------
885 M numbers (change 1 of 1)
886 revert this change? [y/n/q] y
889 if [ "$ret" != "0" ]; then
890 echo "got revert command failed unexpectedly" >&2
891 test_done
"$testroot" "1"
895 cmp -s $testroot/stdout.expected
$testroot/stdout
897 if [ "$ret" != "0" ]; then
898 diff -u $testroot/stdout.expected
$testroot/stdout
899 test_done
"$testroot" "$ret"
903 (cd $testroot/wt
&& got status
> $testroot/stdout
)
904 echo -n > $testroot/stdout.expected
905 cmp -s $testroot/stdout.expected
$testroot/stdout
907 if [ "$ret" != "0" ]; then
908 diff -u $testroot/stdout.expected
$testroot/stdout
909 test_done
"$testroot" "$ret"
913 (cd $testroot/wt
&& got
diff > $testroot/stdout
)
914 echo -n > $testroot/stdout.expected
915 cmp -s $testroot/stdout.expected
$testroot/stdout
917 if [ "$ret" != "0" ]; then
918 diff -u $testroot/stdout.expected
$testroot/stdout
920 test_done
"$testroot" "$ret"
923 test_revert_added_subtree
() {
924 local testroot
=`test_init revert_added_subtree`
926 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
928 if [ "$ret" != "0" ]; then
929 test_done
"$testroot" "$ret"
933 mkdir
-p $testroot/wt
/epsilon
/foo
/bar
/baz
934 mkdir
-p $testroot/wt
/epsilon
/foo
/bar
/bax
935 echo "new file" > $testroot/wt
/epsilon
/foo
/a.o
936 echo "new file" > $testroot/wt
/epsilon
/foo
/a.o
937 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/b.o
938 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/b.d
939 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/baz
/f.o
940 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/baz
/f.d
941 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/baz
/c.o
942 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/baz
/c.d
943 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/bax
/e.o
944 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/bax
/e.d
945 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/bax
/x.o
946 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/bax
/x.d
947 (cd $testroot/wt
&& got add
-R epsilon
>/dev
/null
)
949 echo "R epsilon/foo/a.o" > $testroot/stdout.expected
950 echo "R epsilon/foo/bar/b.d" >> $testroot/stdout.expected
951 echo "R epsilon/foo/bar/b.o" >> $testroot/stdout.expected
952 echo "R epsilon/foo/bar/bax/e.d" >> $testroot/stdout.expected
953 echo "R epsilon/foo/bar/bax/e.o" >> $testroot/stdout.expected
954 echo "R epsilon/foo/bar/bax/x.d" >> $testroot/stdout.expected
955 echo "R epsilon/foo/bar/bax/x.o" >> $testroot/stdout.expected
956 echo "R epsilon/foo/bar/baz/c.d" >> $testroot/stdout.expected
957 echo "R epsilon/foo/bar/baz/c.o" >> $testroot/stdout.expected
958 echo "R epsilon/foo/bar/baz/f.d" >> $testroot/stdout.expected
959 echo "R epsilon/foo/bar/baz/f.o" >> $testroot/stdout.expected
961 (cd $testroot/wt
&& got revert
-R .
> $testroot/stdout
)
963 cmp -s $testroot/stdout.expected
$testroot/stdout
965 if [ "$ret" != "0" ]; then
966 diff -u $testroot/stdout.expected
$testroot/stdout
967 test_done
"$testroot" "$ret"
971 echo "? epsilon/foo/a.o" > $testroot/stdout.expected
972 echo "? epsilon/foo/bar/b.d" >> $testroot/stdout.expected
973 echo "? epsilon/foo/bar/b.o" >> $testroot/stdout.expected
974 echo "? epsilon/foo/bar/bax/e.d" >> $testroot/stdout.expected
975 echo "? epsilon/foo/bar/bax/e.o" >> $testroot/stdout.expected
976 echo "? epsilon/foo/bar/bax/x.d" >> $testroot/stdout.expected
977 echo "? epsilon/foo/bar/bax/x.o" >> $testroot/stdout.expected
978 echo "? epsilon/foo/bar/baz/c.d" >> $testroot/stdout.expected
979 echo "? epsilon/foo/bar/baz/c.o" >> $testroot/stdout.expected
980 echo "? epsilon/foo/bar/baz/f.d" >> $testroot/stdout.expected
981 echo "? epsilon/foo/bar/baz/f.o" >> $testroot/stdout.expected
983 (cd $testroot/wt
&& got status
> $testroot/stdout
)
985 cmp -s $testroot/stdout.expected
$testroot/stdout
987 if [ "$ret" != "0" ]; then
988 diff -u $testroot/stdout.expected
$testroot/stdout
990 test_done
"$testroot" "$ret"
993 test_revert_deleted_subtree
() {
994 local testroot
=`test_init revert_deleted_subtree`
996 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
998 if [ "$ret" != "0" ]; then
999 test_done
"$testroot" "$ret"
1003 mkdir
-p $testroot/wt
/epsilon
/foo
/bar
/baz
1004 mkdir
-p $testroot/wt
/epsilon
/foo
/bar
/bax
1005 echo "new file" > $testroot/wt
/epsilon
/foo
/a.o
1006 echo "new file" > $testroot/wt
/epsilon
/foo
/a.o
1007 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/b.o
1008 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/b.d
1009 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/baz
/f.o
1010 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/baz
/f.d
1011 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/baz
/c.o
1012 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/baz
/c.d
1013 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/bax
/e.o
1014 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/bax
/e.d
1015 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/bax
/x.o
1016 echo "new file" > $testroot/wt
/epsilon
/foo
/bar
/bax
/x.d
1017 (cd $testroot/wt
&& got add
-R epsilon
>/dev
/null
)
1018 (cd $testroot/wt
&& got commit
-m "add subtree" >/dev
/null
)
1020 # now delete and revert the entire subtree
1021 (cd $testroot/wt
&& got
rm -R epsilon
/foo
>/dev
/null
)
1023 echo "R epsilon/foo/a.o" > $testroot/stdout.expected
1024 echo "R epsilon/foo/bar/b.d" >> $testroot/stdout.expected
1025 echo "R epsilon/foo/bar/b.o" >> $testroot/stdout.expected
1026 echo "R epsilon/foo/bar/bax/e.d" >> $testroot/stdout.expected
1027 echo "R epsilon/foo/bar/bax/e.o" >> $testroot/stdout.expected
1028 echo "R epsilon/foo/bar/bax/x.d" >> $testroot/stdout.expected
1029 echo "R epsilon/foo/bar/bax/x.o" >> $testroot/stdout.expected
1030 echo "R epsilon/foo/bar/baz/c.d" >> $testroot/stdout.expected
1031 echo "R epsilon/foo/bar/baz/c.o" >> $testroot/stdout.expected
1032 echo "R epsilon/foo/bar/baz/f.d" >> $testroot/stdout.expected
1033 echo "R epsilon/foo/bar/baz/f.o" >> $testroot/stdout.expected
1035 (cd $testroot/wt
&& got revert
-R .
> $testroot/stdout
)
1037 cmp -s $testroot/stdout.expected
$testroot/stdout
1039 if [ "$ret" != "0" ]; then
1040 diff -u $testroot/stdout.expected
$testroot/stdout
1041 test_done
"$testroot" "$ret"
1045 echo -n > $testroot/stdout.expected
1046 (cd $testroot/wt
&& got status
> $testroot/stdout
)
1048 cmp -s $testroot/stdout.expected
$testroot/stdout
1050 if [ "$ret" != "0" ]; then
1051 diff -u $testroot/stdout.expected
$testroot/stdout
1053 test_done
"$testroot" "$ret"
1056 test_revert_symlink
() {
1057 local testroot
=`test_init revert_symlink`
1059 (cd $testroot/repo
&& ln -s alpha alpha.link
)
1060 (cd $testroot/repo
&& ln -s epsilon epsilon.link
)
1061 (cd $testroot/repo
&& ln -s /etc
/passwd passwd.link
)
1062 (cd $testroot/repo
&& ln -s ..
/beta epsilon
/beta.link
)
1063 (cd $testroot/repo
&& ln -s nonexistent nonexistent.link
)
1064 (cd $testroot/repo
&& ln -sf epsilon
/zeta zeta.link
)
1065 (cd $testroot/repo
&& git add .
)
1066 git_commit
$testroot/repo
-m "add symlinks"
1067 local commit_id1
=`git_show_head $testroot/repo`
1069 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
1071 # symlink to file A now points to file B
1072 (cd $testroot/wt
&& ln -sf gamma
/delta alpha.link
)
1073 # symlink to a directory A now points to file B
1074 (cd $testroot/wt
&& ln -sfT beta epsilon.link
)
1075 # "bad" symlink now contains a different target path
1076 echo "foo" > $testroot/wt
/passwd.link
1077 # relative symlink to directory A now points to relative directory B
1078 (cd $testroot/wt
&& ln -sfT ..
/gamma epsilon
/beta.link
)
1079 # an unversioned symlink
1080 (cd $testroot/wt
&& ln -sf .got
/foo dotgotfoo.link
)
1081 # symlink to file A now points to non-existent file B
1082 (cd $testroot/wt
&& ln -sf nonexistent2 nonexistent.link
)
1084 (cd $testroot/wt
&& got
rm zeta.link
> /dev
/null
)
1086 (cd $testroot/wt
&& ln -sf beta new.link
)
1087 (cd $testroot/wt
&& got add new.link
> /dev
/null
)
1089 (cd $testroot/wt
&& got revert alpha.link epsilon.link \
1090 passwd.link epsilon
/beta.link dotgotfoo.link \
1091 nonexistent.link zeta.link new.link
> $testroot/stdout
)
1093 cat > $testroot/stdout.expected
<<EOF
1102 cmp -s $testroot/stdout.expected
$testroot/stdout
1104 if [ "$ret" != "0" ]; then
1105 diff -u $testroot/stdout.expected
$testroot/stdout
1106 test_done
"$testroot" "$ret"
1110 if ! [ -h $testroot/wt
/alpha.link
]; then
1111 echo "alpha.link is not a symlink"
1112 test_done
"$testroot" "1"
1116 readlink
$testroot/wt
/alpha.link
> $testroot/stdout
1117 echo "alpha" > $testroot/stdout.expected
1118 cmp -s $testroot/stdout.expected
$testroot/stdout
1120 if [ "$ret" != "0" ]; then
1121 diff -u $testroot/stdout.expected
$testroot/stdout
1122 test_done
"$testroot" "$ret"
1126 if ! [ -h $testroot/wt
/epsilon.link
]; then
1127 echo "epsilon.link is not a symlink"
1128 test_done
"$testroot" "1"
1132 readlink
$testroot/wt
/epsilon.link
> $testroot/stdout
1133 echo "epsilon" > $testroot/stdout.expected
1134 cmp -s $testroot/stdout.expected
$testroot/stdout
1136 if [ "$ret" != "0" ]; then
1137 diff -u $testroot/stdout.expected
$testroot/stdout
1138 test_done
"$testroot" "$ret"
1142 if [ -h $testroot/wt
/passwd.link
]; then
1143 echo "passwd.link should not be a symlink" >&2
1144 test_done
"$testroot" "1"
1148 echo -n "/etc/passwd" > $testroot/content.expected
1149 cp $testroot/wt
/passwd.link
$testroot/content
1151 cmp -s $testroot/content.expected
$testroot/content
1153 if [ "$ret" != "0" ]; then
1154 diff -u $testroot/content.expected
$testroot/content
1155 test_done
"$testroot" "$ret"
1159 readlink
$testroot/wt
/epsilon
/beta.link
> $testroot/stdout
1160 echo "../beta" > $testroot/stdout.expected
1161 cmp -s $testroot/stdout.expected
$testroot/stdout
1163 if [ "$ret" != "0" ]; then
1164 diff -u $testroot/stdout.expected
$testroot/stdout
1165 test_done
"$testroot" "$ret"
1169 readlink
$testroot/wt
/nonexistent.link
> $testroot/stdout
1170 echo "nonexistent" > $testroot/stdout.expected
1171 cmp -s $testroot/stdout.expected
$testroot/stdout
1173 if [ "$ret" != "0" ]; then
1174 diff -u $testroot/stdout.expected
$testroot/stdout
1175 test_done
"$testroot" "$ret"
1179 if [ ! -h $testroot/wt
/dotgotfoo.link
]; then
1180 echo "dotgotfoo.link is not a symlink " >&2
1181 test_done
"$testroot" "1"
1184 readlink
$testroot/wt
/dotgotfoo.link
> $testroot/stdout
1185 echo ".got/foo" > $testroot/stdout.expected
1186 cmp -s $testroot/stdout.expected
$testroot/stdout
1188 if [ "$ret" != "0" ]; then
1189 diff -u $testroot/stdout.expected
$testroot/stdout
1190 test_done
"$testroot" "$ret"
1194 if [ ! -h $testroot/wt
/zeta.link
]; then
1195 echo -n "zeta.link is not a symlink" >&2
1196 test_done
"$testroot" "1"
1200 readlink
$testroot/wt
/zeta.link
> $testroot/stdout
1201 echo "epsilon/zeta" > $testroot/stdout.expected
1202 cmp -s $testroot/stdout.expected
$testroot/stdout
1204 if [ "$ret" != "0" ]; then
1205 diff -u $testroot/stdout.expected
$testroot/stdout
1206 test_done
"$testroot" "$ret"
1210 if [ ! -h $testroot/wt
/new.link
]; then
1211 echo -n "new.link is not a symlink" >&2
1212 test_done
"$testroot" "1"
1216 (cd $testroot/wt
&& got status
> $testroot/stdout
)
1217 echo "? dotgotfoo.link" > $testroot/stdout.expected
1218 echo "? new.link" >> $testroot/stdout.expected
1219 cmp -s $testroot/stdout.expected
$testroot/stdout
1221 if [ "$ret" != "0" ]; then
1222 diff -u $testroot/stdout.expected
$testroot/stdout
1225 test_done
"$testroot" "$ret"
1228 test_revert_patch_symlink
() {
1229 local testroot
=`test_init revert_patch_symlink`
1231 (cd $testroot/repo
&& ln -s alpha alpha.link
)
1232 (cd $testroot/repo
&& ln -s epsilon epsilon.link
)
1233 (cd $testroot/repo
&& ln -s /etc
/passwd passwd.link
)
1234 (cd $testroot/repo
&& ln -s ..
/beta epsilon
/beta.link
)
1235 (cd $testroot/repo
&& ln -s nonexistent nonexistent.link
)
1236 (cd $testroot/repo
&& ln -sf epsilon
/zeta zeta.link
)
1237 (cd $testroot/repo
&& ln -sf epsilon
/zeta zeta2.link
)
1238 (cd $testroot/repo
&& git add .
)
1239 git_commit
$testroot/repo
-m "add symlinks"
1240 local commit_id1
=`git_show_head $testroot/repo`
1242 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
1244 # symlink to file A now points to file B
1245 (cd $testroot/wt
&& ln -sf gamma
/delta alpha.link
)
1246 # symlink to a directory A now points to file B
1247 (cd $testroot/wt
&& ln -sfT beta epsilon.link
)
1248 # "bad" symlink now contains a different target path
1249 echo "foo" > $testroot/wt
/passwd.link
1250 # relative symlink to directory A now points to relative directory B
1251 (cd $testroot/wt
&& ln -sfT ..
/gamma epsilon
/beta.link
)
1252 # an unversioned symlink
1253 (cd $testroot/wt
&& ln -sf .got
/foo dotgotfoo.link
)
1254 # symlink to file A now points to non-existent file B
1255 (cd $testroot/wt
&& ln -sf nonexistent2 nonexistent.link
)
1257 (cd $testroot/wt
&& got
rm zeta.link
> /dev
/null
)
1258 (cd $testroot/wt
&& got
rm zeta2.link
> /dev
/null
)
1260 (cd $testroot/wt
&& ln -sf beta new.link
)
1261 (cd $testroot/wt
&& got add new.link
> /dev
/null
)
1262 (cd $testroot/wt
&& ln -sf beta zeta3.link
)
1263 (cd $testroot/wt
&& got add zeta3.link
> /dev
/null
)
1265 printf "y\nn\ny\nn\ny\ny\nn\ny\ny\n" > $testroot/patchscript
1266 (cd $testroot/wt
&& got revert
-F $testroot/patchscript
-p -R . \
1269 if [ "$ret" != "0" ]; then
1270 echo "got revert command failed unexpectedly" >&2
1271 test_done
"$testroot" "1"
1274 cat > $testroot/stdout.expected
<<EOF
1275 -----------------------------------------------
1278 \ No newline at end of file
1280 \ No newline at end of file
1281 -----------------------------------------------
1282 M alpha.link (change 1 of 1)
1283 revert this change? [y/n/q] y
1285 -----------------------------------------------
1288 \ No newline at end of file
1290 \ No newline at end of file
1291 -----------------------------------------------
1292 M epsilon/beta.link (change 1 of 1)
1293 revert this change? [y/n/q] n
1294 -----------------------------------------------
1297 \ No newline at end of file
1299 \ No newline at end of file
1300 -----------------------------------------------
1301 M epsilon.link (change 1 of 1)
1302 revert this change? [y/n/q] y
1305 revert this addition? [y/n] n
1306 -----------------------------------------------
1309 \ No newline at end of file
1311 \ No newline at end of file
1312 -----------------------------------------------
1313 M nonexistent.link (change 1 of 1)
1314 revert this change? [y/n/q] y
1316 -----------------------------------------------
1319 \ No newline at end of file
1321 -----------------------------------------------
1322 M passwd.link (change 1 of 1)
1323 revert this change? [y/n/q] y
1326 revert this deletion? [y/n] n
1328 revert this deletion? [y/n] y
1331 revert this addition? [y/n] y
1334 cmp -s $testroot/stdout.expected
$testroot/stdout
1336 if [ "$ret" != "0" ]; then
1337 diff -u $testroot/stdout.expected
$testroot/stdout
1338 test_done
"$testroot" "$ret"
1342 if ! [ -h $testroot/wt
/alpha.link
]; then
1343 echo "alpha.link is not a symlink"
1344 test_done
"$testroot" "1"
1348 readlink
$testroot/wt
/alpha.link
> $testroot/stdout
1349 echo "alpha" > $testroot/stdout.expected
1350 cmp -s $testroot/stdout.expected
$testroot/stdout
1352 if [ "$ret" != "0" ]; then
1353 diff -u $testroot/stdout.expected
$testroot/stdout
1354 test_done
"$testroot" "$ret"
1358 if ! [ -h $testroot/wt
/epsilon.link
]; then
1359 echo "epsilon.link is not a symlink"
1360 test_done
"$testroot" "1"
1364 readlink
$testroot/wt
/epsilon.link
> $testroot/stdout
1365 echo "epsilon" > $testroot/stdout.expected
1366 cmp -s $testroot/stdout.expected
$testroot/stdout
1368 if [ "$ret" != "0" ]; then
1369 diff -u $testroot/stdout.expected
$testroot/stdout
1370 test_done
"$testroot" "$ret"
1374 if [ -h $testroot/wt
/passwd.link
]; then
1375 echo "passwd.link should not be a symlink" >&2
1376 test_done
"$testroot" "1"
1380 echo -n "/etc/passwd" > $testroot/content.expected
1381 cp $testroot/wt
/passwd.link
$testroot/content
1383 cmp -s $testroot/content.expected
$testroot/content
1385 if [ "$ret" != "0" ]; then
1386 diff -u $testroot/content.expected
$testroot/content
1387 test_done
"$testroot" "$ret"
1391 readlink
$testroot/wt
/epsilon
/beta.link
> $testroot/stdout
1392 echo "../gamma" > $testroot/stdout.expected
1393 cmp -s $testroot/stdout.expected
$testroot/stdout
1395 if [ "$ret" != "0" ]; then
1396 diff -u $testroot/stdout.expected
$testroot/stdout
1397 test_done
"$testroot" "$ret"
1401 readlink
$testroot/wt
/nonexistent.link
> $testroot/stdout
1402 echo "nonexistent" > $testroot/stdout.expected
1403 cmp -s $testroot/stdout.expected
$testroot/stdout
1405 if [ "$ret" != "0" ]; then
1406 diff -u $testroot/stdout.expected
$testroot/stdout
1407 test_done
"$testroot" "$ret"
1411 if [ ! -h $testroot/wt
/dotgotfoo.link
]; then
1412 echo "dotgotfoo.link is not a symlink " >&2
1413 test_done
"$testroot" "1"
1416 readlink
$testroot/wt
/dotgotfoo.link
> $testroot/stdout
1417 echo ".got/foo" > $testroot/stdout.expected
1418 cmp -s $testroot/stdout.expected
$testroot/stdout
1420 if [ "$ret" != "0" ]; then
1421 diff -u $testroot/stdout.expected
$testroot/stdout
1422 test_done
"$testroot" "$ret"
1427 if [ -e $testroot/wt
/zeta.link
]; then
1428 echo -n "zeta.link should not exist on disk" >&2
1429 test_done
"$testroot" "1"
1433 if [ ! -h $testroot/wt
/zeta2.link
]; then
1434 echo -n "zeta2.link is not a symlink" >&2
1435 test_done
"$testroot" "1"
1439 readlink
$testroot/wt
/zeta2.link
> $testroot/stdout
1440 echo "epsilon/zeta" > $testroot/stdout.expected
1441 cmp -s $testroot/stdout.expected
$testroot/stdout
1443 if [ "$ret" != "0" ]; then
1444 diff -u $testroot/stdout.expected
$testroot/stdout
1445 test_done
"$testroot" "$ret"
1449 if [ ! -h $testroot/wt
/zeta3.link
]; then
1450 echo -n "zeta3.link is not a symlink" >&2
1451 test_done
"$testroot" "1"
1455 readlink
$testroot/wt
/zeta3.link
> $testroot/stdout
1456 echo "beta" > $testroot/stdout.expected
1457 cmp -s $testroot/stdout.expected
$testroot/stdout
1459 if [ "$ret" != "0" ]; then
1460 diff -u $testroot/stdout.expected
$testroot/stdout
1461 test_done
"$testroot" "$ret"
1465 if [ ! -h $testroot/wt
/new.link
]; then
1466 echo -n "new.link is not a symlink" >&2
1467 test_done
"$testroot" "1"
1471 (cd $testroot/wt
&& got status
> $testroot/stdout
)
1472 echo "? dotgotfoo.link" > $testroot/stdout.expected
1473 echo "M epsilon/beta.link" >> $testroot/stdout.expected
1474 echo "A new.link" >> $testroot/stdout.expected
1475 echo "D zeta.link" >> $testroot/stdout.expected
1476 echo "? zeta3.link" >> $testroot/stdout.expected
1477 cmp -s $testroot/stdout.expected
$testroot/stdout
1479 if [ "$ret" != "0" ]; then
1480 diff -u $testroot/stdout.expected
$testroot/stdout
1483 test_done
"$testroot" "$ret"
1487 run_test test_revert_basic
1488 run_test test_revert_rm
1489 run_test test_revert_add
1490 run_test test_revert_multiple
1491 run_test test_revert_file_in_new_subdir
1492 run_test test_revert_no_arguments
1493 run_test test_revert_directory
1494 run_test test_revert_directory_unknown
1495 run_test test_revert_patch
1496 run_test test_revert_patch_added
1497 run_test test_revert_patch_removed
1498 run_test test_revert_patch_one_change
1499 run_test test_revert_added_subtree
1500 run_test test_revert_deleted_subtree
1501 run_test test_revert_symlink
1502 run_test test_revert_patch_symlink