3 # sanity.sh -- a growing testsuite for cvs.
5 # The copyright notice said: "Copyright (C) 1992, 1993 Cygnus Support"
6 # I'm not adding new copyright notices for new years as our recent
7 # practice has been to include copying terms without copyright notices.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # Original Author: K. Richard Pixley
21 # usage: sanity.sh [-r] @var{cvs-to-test} @var{tests-to-run}
22 # -r means to test remote instead of local cvs.
23 # @var{tests-to-run} are the names of the tests to run; if omitted run all
26 # See TODO list at end of file.
28 # You can't run CVS as root; print a nice error message here instead
29 # of somewhere later, after making a mess.
30 # Commented out because:
31 # (1) whoami is not portable. If memory serves the POSIX way is "id -un".
32 # ("logname" or "who am i" are similar but different--they have more to
33 # do with who logged in on your tty than your uid).
34 # (2) This definition of "root" doesn't quite match CVS's (which is based
35 # on uid 0, not username "root").
38 # echo "sanity.sh: test suite does not work correctly when run as root" >&2
43 # required to make this script work properly.
46 # The default value of /tmp/cvs-sanity for TESTDIR is dubious,
47 # because it loses if two people/scripts try to run the tests
48 # at the same time. Some possible solutions:
49 # 1. Use /tmp/cvs-test$$. One disadvantage is that the old
50 # cvs-test* directories would pile up, because they wouldn't
51 # necessarily get removed.
52 # 2. Have everyone/everything running the testsuite set
53 # TESTDIR to some appropriate directory.
54 # 3. Have the default value of TESTDIR be some variation of
55 # `pwd`/cvs-sanity. The biggest problem here is that we have
56 # been fairly careful to test that CVS prints in messages the
57 # actual pathnames that we pass to it, rather than a different
58 # pathname for the same directory, as may come out of `pwd`.
59 # So this would be lost if everything was `pwd`-based. I suppose
60 # if we wanted to get baroque we could start making symlinks
61 # to ensure the two are different.
62 TESTDIR=${TESTDIR:-/tmp/cvs-sanity}
67 echo 'This test should produce no other output than this line, and a final "OK".'
69 if test x"$1" = x"-r"; then
72 # If we're going to do remote testing, make sure 'rsh' works first.
74 if test "x`${CVS_RSH-rsh} $host -n 'echo hi'`" != "xhi"; then
75 echo "ERROR: cannot test remote CVS, because \`rsh $host' fails." >&2
82 # The --keep option will eventually cause all the tests to leave around the
83 # contents of the /tmp directory; right now only some implement it. Not
84 # useful if you are running more than one test.
85 # FIXME: need some real option parsing so this doesn't depend on the order
86 # in which they are specified.
87 if test x"$1" = x"--keep"; then
94 # Use full path for CVS executable, so that CVS_SERVER gets set properly
107 # Regexp to match what CVS will call itself in output that it prints.
108 # FIXME: we don't properly quote this--if the name contains . we'll
109 # just spuriously match a few things; if the name contains other regexp
110 # special characters we are probably in big trouble.
111 PROG=`basename ${testcvs}`
113 # Regexp to match an author name. I'm not really sure what characters
114 # should be here. a-zA-Z obviously. People complained when 0-9 were
115 # not allowed in usernames. Other than that I'm not sure.
116 username="[-a-zA-Z0-9][-a-zA-Z0-9]*"
118 # Regexp to match the name of a temporary file (from cvs_temp_name).
119 # This appears in certain diff output.
120 tempname="[-a-zA-Z0-9/.%_]*"
122 # On cygwin32, we may not have /bin/sh.
123 if [ -r /bin/sh ]; then
126 TESTSHELL=`type -p sh 2>/dev/null`
127 if [ ! -r "$TESTSHELL" ]; then
132 # FIXME: try things (what things? checkins?) without -m.
134 # Some of these tests are written to expect -Q. But testing with
135 # -Q is kind of bogus, it is not the way users actually use CVS (usually).
136 # So new tests probably should invoke ${testcvs} directly, rather than ${CVS}.
137 # and then they've obviously got to do something with the output....
141 LOGFILE=`pwd`/check.log
143 # Save the previous log in case the person running the tests decides
144 # they want to look at it. The extension ".plog" is chosen for consistency
146 if test -f check.log; then
147 mv check.log check.plog
150 GEXPRLOCS="`echo $PATH | sed 's/:/ /g'` /usr/local/bin /usr/contrib/bin /usr/gnu/bin /local/bin /local/gnu/bin /gun/bin"
154 # Cause NextStep 3.3 users to lose in a more graceful fashion.
157 def' >/dev/null; then
160 for path in $GEXPRLOCS ; do
161 if test -x $path/gexpr ; then
162 if test "X`$path/gexpr --version`" != "X--version" ; then
167 if test -x $path/expr ; then
168 if test "X`$path/expr --version`" != "X--version" ; then
174 if test -z "$EXPR" ; then
175 echo 'Running these tests requires an "expr" program that can handle'
176 echo 'multi-line patterns. Make sure that such an expr (GNU, or many but'
177 echo 'not all vendor-supplied versions) is in your path.'
182 # Warn SunOS, SysVr3.2, etc., users that they may be partially losing
183 # if we can't find a GNU expr to ease their troubles...
187 for path in $GEXPRLOCS ; do
188 if test -x $path/gexpr ; then
189 if test "X`$path/gexpr --version`" != "X--version" ; then
194 if test -x $path/expr ; then
195 if test "X`$path/expr --version`" != "X--version" ; then
201 if test -z "$EXPR" ; then
202 echo 'Warning: you are using a version of expr which does not correctly'
203 echo 'match multi-line patterns. Some tests may spuriously pass.'
204 echo 'You may wish to make sure GNU expr is in your path.'
211 # That we should have to do this is total bogosity, but GNU expr
212 # version 1.9.4-1.12 uses the emacs definition of "$" instead of the unix
213 # (e.g. SunOS 4.1.3 expr) one. Rumor has it this will be fixed in the
214 # next release of GNU expr after 1.12 (but we still have to cater to the old
215 # ones for some time because they are in many linux distributions).
218 def' : 'abc$' >/dev/null; then
222 # Work around another GNU expr (version 1.10-1.12) bug/incompatibility.
223 # "." doesn't appear to match a newline (it does with SunOS 4.1.3 expr).
224 # Note that the workaround is not a complete equivalent of .* because
225 # the first parenthesized expression in the regexp must match something
226 # in order for expr to return a successful exit status.
227 # Rumor has it this will be fixed in the
228 # next release of GNU expr after 1.12 (but we still have to cater to the old
229 # ones for some time because they are in many linux distributions).
232 def' : "a${DOTSTAR}f" >/dev/null; then
239 # Work around yet another GNU expr (version 1.10) bug/incompatibility.
240 # "+" is a special character, yet for unix expr (e.g. SunOS 4.1.3)
241 # it is not. I doubt that POSIX allows us to use \+ and assume it means
242 # (non-special) +, so here is another workaround
243 # Rumor has it this will be fixed in the
244 # next release of GNU expr after 1.12 (but we still have to cater to the old
245 # ones for some time because they are in many linux distributions).
247 if $EXPR 'a +b' : "a ${PLUS}b" >/dev/null; then
255 if $EXPR 'a?b' : "a${QUESTION}b" >/dev/null; then
263 echo "PASS: $1" >>${LOGFILE}
268 echo "FAIL: $1" | tee -a ${LOGFILE}
269 # This way the tester can go and see what remnants were left
273 # See dotest and dotest_fail for explanation (this is the parts
274 # of the implementation common to the two).
277 # expr can't distinguish between "zero characters matched" and "no match",
278 # so special-case it.
279 if test -z "$3"; then
280 if test -s ${TESTDIR}/dotest.tmp; then
281 echo "** expected: " >>${LOGFILE}
282 echo "$3" >>${LOGFILE}
283 echo "$3" > ${TESTDIR}/dotest.exp
284 rm -f ${TESTDIR}/dotest.ex2
285 echo "** got: " >>${LOGFILE}
286 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
292 if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : \
293 "$3"${ENDANCHOR} >/dev/null; then
294 # See below about writing this to the logfile.
295 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
298 if test x"$4" != x; then
299 if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : \
300 "$4"${ENDANCHOR} >/dev/null; then
301 # Why, I hear you ask, do we write this to the logfile
302 # even when the test passes? The reason is that the test
303 # may give us the regexp which we were supposed to match,
304 # but sometimes it may be useful to look at the exact
305 # text which was output. For example, suppose one wants
306 # to grep for a particular warning, and make _sure_ that
307 # CVS never hits it (even in cases where the tests might
308 # match it with .*). Or suppose one wants to see the exact
309 # date format output in a certain case (where the test will
310 # surely use a somewhat non-specific pattern).
311 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
314 echo "** expected: " >>${LOGFILE}
315 echo "$3" >>${LOGFILE}
316 echo "$3" > ${TESTDIR}/dotest.ex1
317 echo "** or: " >>${LOGFILE}
318 echo "$4" >>${LOGFILE}
319 echo "$4" > ${TESTDIR}/dotest.ex2
320 echo "** got: " >>${LOGFILE}
321 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
325 echo "** expected: " >>${LOGFILE}
326 echo "$3" >>${LOGFILE}
327 echo "$3" > ${TESTDIR}/dotest.exp
328 echo "** got: " >>${LOGFILE}
329 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
338 if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : \
339 "`cat ${TESTDIR}/dotest.exp`" >/dev/null; then
345 # WARNING: this won't work with REs that match newlines....
347 dotest_line_by_line ()
350 while [ $line -le `wc -l ${TESTDIR}/dotest.tmp` ] ; do
351 echo "$line matched \c" >>$LOGFILE
352 if $EXPR "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" : \
353 "`sed -n ${line}p ${TESTDIR}/dotest.exp`" >/dev/null; then
356 echo "**** expected line: " >>${LOGFILE}
357 sed -n ${line}p ${TESTDIR}/dotest.exp >>${LOGFILE}
358 echo "**** got line: " >>${LOGFILE}
359 sed -n ${line}p ${TESTDIR}/dotest.tmp >>${LOGFILE}
363 line=`expr $line + 1`
369 # If you are having trouble telling which line of a multi-line
370 # expression is not being matched, replace calls to dotest_internal()
371 # with calls to this function:
373 dotest_internal_debug ()
375 if test -z "$3"; then
376 if test -s ${TESTDIR}/dotest.tmp; then
377 echo "** expected: " >>${LOGFILE}
378 echo "$3" >>${LOGFILE}
379 echo "$3" > ${TESTDIR}/dotest.exp
380 rm -f ${TESTDIR}/dotest.ex2
381 echo "** got: " >>${LOGFILE}
382 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
388 echo "$3" > ${TESTDIR}/dotest.exp
389 if dotest_line_by_line "$1" "$2"; then
392 if test x"$4" != x; then
393 mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex1
394 echo "$4" > ${TESTDIR}/dotest.exp
395 if dotest_line_by_line "$1" "$2"; then
398 mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex2
399 echo "** expected: " >>${LOGFILE}
400 echo "$3" >>${LOGFILE}
401 echo "** or: " >>${LOGFILE}
402 echo "$4" >>${LOGFILE}
403 echo "** got: " >>${LOGFILE}
404 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
408 echo "** expected: " >>${LOGFILE}
409 echo "$3" >>${LOGFILE}
410 echo "** got: " >>${LOGFILE}
411 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
419 # dotest TESTNAME COMMAND OUTPUT [OUTPUT2]
420 # TESTNAME is the name used in the log to identify the test.
421 # COMMAND is the command to run; for the test to pass, it exits with
423 # OUTPUT is a regexp which is compared against the output (stdout and
424 # stderr combined) from the test. It is anchored to the start and end
425 # of the output, so should start or end with ".*" if that is what is desired.
426 # Trailing newlines are stripped from the command's actual output before
427 # matching against OUTPUT.
428 # If OUTPUT2 is specified and the output matches it, then it is also
429 # a pass (partial workaround for the fact that some versions of expr
433 rm -f ${TESTDIR}/dotest.ex? 2>&1
434 if $2 >${TESTDIR}/dotest.tmp 2>&1; then
438 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
439 echo "exit status was $status" >>${LOGFILE}
445 # Like dotest except only 2 args and result must exactly match stdin
448 rm -f ${TESTDIR}/dotest.ex? 2>&1
449 if $2 >${TESTDIR}/dotest.tmp 2>&1; then
453 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
454 echo "exit status was $status" >>${LOGFILE}
457 cat >${TESTDIR}/dotest.exp
458 if cmp ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.tmp >/dev/null 2>&1; then
461 echo "** expected: " >>${LOGFILE}
462 cat ${TESTDIR}/dotest.exp >>${LOGFILE}
463 echo "** got: " >>${LOGFILE}
464 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
469 # Like dotest except exitstatus should be nonzero.
472 rm -f ${TESTDIR}/dotest.ex? 2>&1
473 if $2 >${TESTDIR}/dotest.tmp 2>&1; then
475 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
476 echo "exit status was $status" >>${LOGFILE}
484 # Like dotest except second argument is the required exitstatus.
487 $3 >${TESTDIR}/dotest.tmp 2>&1
489 if test "$status" = "$2"; then
492 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
493 echo "exit status was $status; expected $2" >>${LOGFILE}
496 dotest_internal "$1" "$3" "$4" "$5"
499 # Like dotest except output is sorted.
502 rm -f ${TESTDIR}/dotest.ex? 2>&1
503 if $2 >${TESTDIR}/dotest.tmp1 2>&1; then
507 cat ${TESTDIR}/dotest.tmp1 >>${LOGFILE}
508 echo "exit status was $status" >>${LOGFILE}
511 sort < ${TESTDIR}/dotest.tmp1 > ${TESTDIR}/dotest.tmp
515 # clean any old remnants
519 # This will show up in cvs history output where it prints the working
520 # directory. It should *not* appear in any cvs output referring to the
521 # repository; cvs should use the name of the repository as specified.
523 # Note that using pwd here rather than /bin/pwd will make it even less
524 # likely that we test whether CVS is distinguishing between TMPPWD
525 # and TESTDIR. However, there is no guarantee that will test it anyway.
526 # If we really care, we should do something along the lines of:
527 # cd /tmp/cvs-sanity # In reality, overridable with environment variable?
529 # ln -s realdir testdir
530 # TESTDIR=/tmp/cvs-sanity/testdir
531 # TMPPWD=/tmp/cvs-sanity/realdir
534 # Avoid picking up any stray .cvsrc, etc., from the user running the tests
536 HOME=${TESTDIR}/home; export HOME
538 # Make sure this variable is not defined to anything that would
539 # change the format of rcs dates. Otherwise people using e.g.,
540 # RCSINIT=-zLT get lots of spurious failures.
541 RCSINIT=; export RCSINIT
543 # Remaining arguments are the names of tests to run.
545 # The testsuite is broken up into (hopefully manageably-sized)
546 # independently runnable tests, so that one can quickly get a result
547 # from a cvs or testsuite change, and to facilitate understanding the
550 if test x"$*" = x; then
551 tests="basica basicb basicc basic1 deep basic2"
552 tests="${tests} rdiff death death2 branches"
553 tests="${tests} rcslib multibranch import importb join join2 join3"
554 tests="${tests} new newb conflicts conflicts2 conflicts3"
555 tests="${tests} modules modules2 modules3 mflag editor errmsg1 errmsg2"
556 tests="${tests} devcom devcom2 devcom3 watch4"
557 tests="${tests} ignore binfiles binfiles2 mcopy binwrap binwrap2"
558 tests="${tests} binwrap3 mwrap info config"
559 tests="${tests} serverpatch log log2 ann crerepos rcs big modes stamps"
560 tests="${tests} sticky keyword keywordlog"
561 tests="${tests} toplevel head tagdate multibranch2"
562 tests="${tests} admin reserved"
563 tests="${tests} cvsadm diffmerge1 diffmerge2"
568 # a simple function to compare directory contents
571 # Side Effects: ISDIFF := true|false
581 find . -print | fgrep -v /CVS | sort > /tmp/dc$$d1
583 # go back where we were to avoid symlink hell...
586 find . -print | fgrep -v /CVS | sort > /tmp/dc$$d2
588 if diff /tmp/dc$$d1 /tmp/dc$$d2 >/dev/null 2>&1
598 if test -f $DIR_1/"$a" ; then
599 cmp -s $DIR_1/"$a" $DIR_2/"$a"
600 if test $? -ne 0 ; then
608 # Set up CVSROOT (the crerepos tests will test operating without CVSROOT set).
609 CVSROOT_DIRNAME=${TESTDIR}/cvsroot
610 CVSROOT=${CVSROOT_DIRNAME} ; export CVSROOT
611 if test "x$remote" = xyes; then
612 # Use rsh so we can test it without having to muck with inetd
613 # or anything like that. Also needed to get CVS_SERVER to
615 CVSROOT=:ext:`hostname`:${CVSROOT_DIRNAME} ; export CVSROOT
616 CVS_SERVER=${testcvs}; export CVS_SERVER
619 dotest 1 "${testcvs} init" ''
622 for what in $tests; do
625 # Similar in spirit to some of the basic1, and basic2
626 # tests, but hopefully a lot faster. Also tests operating on
627 # files two directories down *without* operating on the parent dirs.
629 # Tests basica-0a and basica-0b provide the equivalent of the:
630 # mkdir ${CVSROOT_DIRNAME}/first-dir
631 # used by many of the tests. It is "more official" in the sense
632 # that is does everything through CVS; the reason most of the
633 # tests don't use it is mostly historical.
635 dotest basica-0a "${testcvs} -q co -l ." ''
637 dotest basica-0b "${testcvs} add first-dir" \
638 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
642 dotest basica-1 "${testcvs} -q co first-dir" ''
645 # Test a few operations, to ensure they gracefully do
646 # nothing in an empty directory.
647 dotest basica-1a0 "${testcvs} -q update" ''
648 dotest basica-1a1 "${testcvs} -q diff -c" ''
649 dotest basica-1a2 "${testcvs} -q status" ''
652 # Remote CVS gives the "cannot open CVS/Entries" error, which is
653 # clearly a bug, but not a simple one to fix.
654 dotest basica-1a10 "${testcvs} -n add sdir" \
655 "Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository" \
656 "${PROG} add: cannot open CVS/Entries for reading: No such file or directory
657 Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
658 dotest_fail basica-1a11 \
659 "test -d ${CVSROOT_DIRNAME}/first-dir/sdir" ''
660 dotest basica-2 "${testcvs} add sdir" \
661 "Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
664 dotest basica-3 "${testcvs} add ssdir" \
665 "Directory ${TESTDIR}/cvsroot/first-dir/sdir/ssdir added to the repository"
669 # Trying to commit it without a "cvs add" should be an error.
670 # The "use `cvs add' to create an entry" message is the one
671 # that I consider to be more correct, but local cvs prints the
672 # "nothing known" message and noone has gotten around to fixing it.
673 dotest_fail basica-notadded "${testcvs} -q ci ssfile" \
674 "${PROG} [a-z]*: use .${PROG} add. to create an entry for ssfile
675 ${PROG}"' \[[a-z]* aborted\]: correct above errors first!' \
676 "${PROG}"' [a-z]*: nothing known about `ssfile'\''
677 '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
679 dotest basica-4 "${testcvs} add ssfile" \
680 "${PROG}"' [a-z]*: scheduling file `ssfile'\'' for addition
681 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
682 dotest_fail basica-4a "${testcvs} tag tag0 ssfile" \
683 "${PROG} [a-z]*: nothing known about ssfile
684 ${PROG} "'\[[a-z]* aborted\]: correct the above errors first!'
686 dotest basica-5 "${testcvs} -q ci -m add-it" \
687 "RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
689 Checking in sdir/ssdir/ssfile;
690 ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
691 initial revision: 1\.1
693 dotest_fail basica-5a \
694 "${testcvs} -q tag BASE sdir/ssdir/ssfile" \
695 "${PROG} [a-z]*: Attempt to add reserved tag name BASE
696 ${PROG} \[[a-z]* aborted\]: failed to set tag BASE to revision 1\.1 in ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v"
697 dotest basica-5b "${testcvs} -q tag NOT_RESERVED" \
698 'T sdir/ssdir/ssfile'
700 dotest basica-6 "${testcvs} -q update" ''
701 echo "ssfile line 2" >>sdir/ssdir/ssfile
702 dotest_status basica-6.2 1 "${testcvs} -q diff -c" \
703 "Index: sdir/ssdir/ssfile
704 ===================================================================
705 RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
706 retrieving revision 1\.1
707 diff -c -r1\.1 ssfile
708 \*\*\* ssfile [0-9/]* [0-9:]* 1\.1
709 --- ssfile [0-9/]* [0-9:]*
710 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
714 ${PLUS} ssfile line 2"
715 dotest_status basica-6.3 1 "${testcvs} -q diff -c -rBASE" \
716 "Index: sdir/ssdir/ssfile
717 ===================================================================
718 RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
719 retrieving revision 1\.1
720 diff -c -r1\.1 ssfile
721 \*\*\* ssfile [0-9/]* [0-9:]* 1\.1
722 --- ssfile [0-9/]* [0-9:]*
723 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
727 ${PLUS} ssfile line 2"
728 dotest basica-7 "${testcvs} -q ci -m modify-it" \
729 "Checking in sdir/ssdir/ssfile;
730 ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
731 new revision: 1\.2; previous revision: 1\.1
733 dotest_fail basica-nonexist "${testcvs} -q ci nonexist" \
734 "${PROG}"' [a-z]*: nothing known about `nonexist'\''
735 '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
736 dotest basica-8 "${testcvs} -q update" ''
738 # Test the -f option to ci
740 dotest basica-8a0 "${testcvs} -q ci -m not-modified ssfile" ''
741 dotest basica-8a "${testcvs} -q ci -f -m force-it" \
743 ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
744 new revision: 1\.3; previous revision: 1\.2
746 dotest basica-8a1 "${testcvs} -q ci -m bump-it -r 2.0" \
748 ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
749 new revision: 2\.0; previous revision: 1\.3
751 # -f should not be necessary, but it should be harmless.
752 # Also test the "-r 3" (rather than "-r 3.0") usage.
753 dotest basica-8a2 "${testcvs} -q ci -m bump-it -f -r 3" \
755 ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
756 new revision: 3\.1; previous revision: 2\.0
759 dotest basica-8b "${testcvs} -q diff -r1.2 -r1.3" \
760 "Index: sdir/ssdir/ssfile
761 ===================================================================
762 RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
763 retrieving revision 1\.2
764 retrieving revision 1\.3
767 # The .* here will normally be "No such file or directory",
768 # but if memory serves some systems (AIX?) have a different message.
769 : dotest_fail basica-9 \
770 "${testcvs} -q -d ${TESTDIR}/nonexist update" \
771 "${PROG}: cannot access cvs root ${TESTDIR}/nonexist: .*"
772 dotest_fail basica-9 \
773 "${testcvs} -q -d ${TESTDIR}/nonexist update" \
774 "${PROG} \[[a-z]* aborted\]: ${TESTDIR}/nonexist/CVSROOT: .*"
776 dotest basica-10 "${testcvs} annotate" \
777 'Annotations for sdir/ssdir/ssfile
778 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
779 1\.1 .'"${username}"' *[0-9a-zA-Z-]*.: ssfile
780 1\.2 .'"${username}"' *[0-9a-zA-Z-]*.: ssfile line 2'
782 # As long as we have a file with a few revisions, test
783 # a few "cvs admin -o" invocations.
785 dotest_fail basica-o1 "${testcvs} admin -o 1.2::1.2" \
786 "${PROG} [a-z]*: while processing more than one file:
787 ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
788 dotest basica-o2 "${testcvs} admin -o 1.2::1.2 ssfile" \
789 "RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
791 dotest basica-o2a "${testcvs} admin -o 1.1::NOT_RESERVED ssfile" \
792 "RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
794 dotest_fail basica-o2b "${testcvs} admin -o 1.1::NOT_EXIST ssfile" \
795 "RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
796 ${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v: Revision NOT_EXIST doesn't exist.
797 ${PROG} [a-z]*: cannot modify RCS file for .ssfile."
798 dotest basica-o3 "${testcvs} admin -o 1.2::1.3 ssfile" \
799 "RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
801 dotest basica-o4 "${testcvs} admin -o 3.1:: ssfile" \
802 "RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
804 dotest basica-o5 "${testcvs} admin -o ::1.1 ssfile" \
805 "RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
807 dotest basica-o5a "${testcvs} -n admin -o 1.2::3.1 ssfile" \
808 "RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
809 deleting revision 2\.0
810 deleting revision 1\.3
812 dotest basica-o6 "${testcvs} admin -o 1.2::3.1 ssfile" \
813 "RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
814 deleting revision 2\.0
815 deleting revision 1\.3
817 dotest basica-o7 "${testcvs} log -N ssfile" "
818 RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
824 keyword substitution: kv
825 total revisions: 3; selected revisions: 3
827 ----------------------------
829 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
831 ----------------------------
833 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
835 ----------------------------
837 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
839 ============================================================================="
840 dotest basica-o8 "${testcvs} -q update -p -r 1.1 ssfile" "ssfile"
845 rm -rf ${CVSROOT_DIRNAME}/first-dir
850 # More basic tests, including non-branch tags and co -d.
852 dotest basicb-0a "${testcvs} -q co -l ." ''
854 dotest basicb-0b "${testcvs} add topfile" \
855 "${PROG} [a-z]*: scheduling file .topfile. for addition
856 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
857 dotest basicb-0c "${testcvs} -q ci -m add-it topfile" \
858 "RCS file: ${TESTDIR}/cvsroot/topfile,v
861 ${TESTDIR}/cvsroot/topfile,v <-- topfile
862 initial revision: 1\.1
867 dotest basicb-0d "${testcvs} -q co -l ." "U topfile"
868 # Now test the ability to run checkout on an existing working
869 # directory without having it lose its mind. I don't know
870 # whether this is tested elsewhere in sanity.sh. A more elaborate
871 # test might also have modified files, make sure it works if
872 # the modules file was modified to add new directories to the
874 dotest basicb-0d0 "${testcvs} -q co -l ." ""
876 dotest basicb-0e "${testcvs} add first-dir" \
877 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
881 : mkdir ${CVSROOT_DIRNAME}/first-dir
882 dotest basicb-1 "${testcvs} -q co first-dir" ''
883 dotest basicb-1a "test -d CVS" ''
885 # In 1b and 1c, the first string matches if we're using absolute
886 # paths, while the second matches if RELATIVE_REPOS is defined
887 # (we're using relative paths).
889 dotest basicb-1b "cat CVS/Repository" \
890 "${TESTDIR}/cvsroot/\." \
892 dotest basicb-1c "cat first-dir/CVS/Repository" \
893 "${TESTDIR}/cvsroot/first-dir" \
897 # Note that the name Emptydir is chosen to test that CVS just
898 # treats it like any other directory name. It should be
899 # special only when it is directly in $CVSROOT/CVSROOT.
901 dotest basicb-2 "${testcvs} add Emptydir sdir2" \
902 "Directory ${TESTDIR}/cvsroot/first-dir/Emptydir added to the repository
903 Directory ${TESTDIR}/cvsroot/first-dir/sdir2 added to the repository"
905 echo sfile1 starts >sfile1
906 dotest basicb-2a10 "${testcvs} -n add sfile1" \
907 "${PROG} [a-z]*: scheduling file .sfile1. for addition
908 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
909 dotest basicb-2a11 "${testcvs} status sfile1" \
910 "${PROG} [a-z]*: use .${PROG} add. to create an entry for sfile1
911 ===================================================================
912 File: sfile1 Status: Unknown
914 Working revision: No entry for sfile1
915 Repository revision: No revision control file"
916 dotest basicb-3 "${testcvs} add sfile1" \
917 "${PROG} [a-z]*: scheduling file .sfile1. for addition
918 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
919 dotest basicb-3a1 "${testcvs} status sfile1" \
920 "===================================================================
921 File: sfile1 Status: Locally Added
923 Working revision: New file!
924 Repository revision: No revision control file
927 Sticky Options: (none)"
930 echo sfile2 starts >sfile2
931 dotest basicb-4 "${testcvs} add sfile2" \
932 "${PROG} [a-z]*: scheduling file .sfile2. for addition
933 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
934 dotest basicb-4a "${testcvs} -q ci CVS" \
935 "${PROG} [a-z]*: warning: directory CVS specified in argument
936 ${PROG} [a-z]*: but CVS uses CVS for its own purposes; skipping CVS directory"
938 dotest basicb-5 "${testcvs} -q ci -m add" \
939 "RCS file: ${TESTDIR}/cvsroot/first-dir/Emptydir/sfile1,v
941 Checking in Emptydir/sfile1;
942 ${TESTDIR}/cvsroot/first-dir/Emptydir/sfile1,v <-- sfile1
943 initial revision: 1\.1
945 RCS file: ${TESTDIR}/cvsroot/first-dir/sdir2/sfile2,v
947 Checking in sdir2/sfile2;
948 ${TESTDIR}/cvsroot/first-dir/sdir2/sfile2,v <-- sfile2
949 initial revision: 1\.1
951 echo sfile1 develops >Emptydir/sfile1
952 dotest basicb-6 "${testcvs} -q ci -m modify" \
953 "Checking in Emptydir/sfile1;
954 ${TESTDIR}/cvsroot/first-dir/Emptydir/sfile1,v <-- sfile1
955 new revision: 1\.2; previous revision: 1\.1
957 dotest basicb-7 "${testcvs} -q tag release-1" 'T Emptydir/sfile1
959 echo not in time for release-1 >sdir2/sfile2
960 dotest basicb-8 "${testcvs} -q ci -m modify-2" \
961 "Checking in sdir2/sfile2;
962 ${TESTDIR}/cvsroot/first-dir/sdir2/sfile2,v <-- sfile2
963 new revision: 1\.2; previous revision: 1\.1
965 # See if CVS can correctly notice when an invalid numeric
966 # revision is specified.
967 # Commented out until we get around to fixing CVS
968 : dotest basicb-8a0 "${testcvs} diff -r 1.5 -r 1.7 sfile2" 'error msg'
971 # Test that we recurse into the correct directory when checking
972 # for existing files, even if co -d is in use.
973 touch first-dir/extra
974 dotest basicb-cod-1 "${testcvs} -q co -d first-dir1 first-dir" \
975 'U first-dir1/Emptydir/sfile1
976 U first-dir1/sdir2/sfile2'
981 # FIXME? basicb-9 used to check things out like this:
982 # U newdir/Emptydir/sfile1
983 # U newdir/sdir2/sfile2
984 # but that's difficult to do. The whole "shorten" thing
985 # is pretty bogus, because it will break on things
986 # like "cvs co foo/bar baz/quux". Unless there's some
987 # pretty detailed expansion and analysis of the command-line
988 # arguments, we shouldn't do "shorten" stuff at all.
991 "${testcvs} -q co -d newdir -r release-1 first-dir/Emptydir first-dir/sdir2" \
992 'U newdir/first-dir/Emptydir/sfile1
993 U newdir/first-dir/sdir2/sfile2'
994 dotest basicb-9a "test -d CVS" ''
996 # In 9b through 9f, the first string matches if we're using
997 # absolute paths, while the second matches if RELATIVE_REPOS
998 # is defined (we're using relative paths).
1000 dotest basicb-9b "cat CVS/Repository" \
1001 "${TESTDIR}/cvsroot/\." \
1003 dotest basicb-9c "cat newdir/CVS/Repository" \
1004 "${TESTDIR}/cvsroot/\." \
1006 dotest basicb-9d "cat newdir/first-dir/CVS/Repository" \
1007 "${TESTDIR}/cvsroot/first-dir" \
1009 dotest basicb-9e "cat newdir/first-dir/Emptydir/CVS/Repository" \
1010 "${TESTDIR}/cvsroot/first-dir/Emptydir" \
1011 "first-dir/Emptydir"
1012 dotest basicb-9f "cat newdir/first-dir/sdir2/CVS/Repository" \
1013 "${TESTDIR}/cvsroot/first-dir/sdir2" \
1016 dotest basicb-10 "cat newdir/first-dir/Emptydir/sfile1 newdir/first-dir/sdir2/sfile2" \
1022 # Hmm, this might be a case for CVSNULLREPOS, but CVS doesn't
1023 # seem to deal with it...
1025 dotest basicb-11 "${testcvs} -q co -d sub1/sub2 first-dir" \
1026 "U sub1/sub2/Emptydir/sfile1
1027 U sub1/sub2/sdir2/sfile2"
1029 dotest basicb-12 "${testcvs} -q update" ''
1031 dotest basicb-13 "${testcvs} add xx" fixme
1034 # to test: sub1/sub2/sub3
1035 fi # end of tests commented out.
1037 # Create a second directory.
1040 dotest basicb-14 "${testcvs} -q co -l ." 'U topfile'
1042 dotest basicb-15 "${testcvs} add second-dir" \
1043 "Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
1046 dotest basicb-16 "${testcvs} add aa" \
1047 "${PROG} [a-z]*: scheduling file .aa. for addition
1048 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
1049 dotest basicb-17 "${testcvs} -q ci -m add" \
1050 "RCS file: ${TESTDIR}/cvsroot/second-dir/aa,v
1053 ${TESTDIR}/cvsroot/second-dir/aa,v <-- aa
1054 initial revision: 1\.1
1059 # Let's see if we can add something to Emptydir.
1060 dotest basicb-18 "${testcvs} -q co -d t2/t3 first-dir second-dir" \
1061 "U t2/t3/first-dir/Emptydir/sfile1
1062 U t2/t3/first-dir/sdir2/sfile2
1063 U t2/t3/second-dir/aa"
1066 # The fact that CVS lets us add a file here is a CVS bug, right?
1067 # I can just make this an error message (on the add and/or the
1068 # commit) without getting flamed, right?
1071 dotest basicb-19 "${testcvs} add emptyfile" \
1072 "${PROG} [a-z]*: scheduling file .emptyfile. for addition
1073 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
1074 dotest basicb-20 "${testcvs} -q ci -m add" \
1075 "RCS file: ${TESTDIR}/cvsroot/CVSROOT/Emptydir/emptyfile,v
1077 Checking in emptyfile;
1078 ${TESTDIR}/cvsroot/CVSROOT/Emptydir/emptyfile,v <-- emptyfile
1079 initial revision: 1\.1
1085 # Note that -H is an illegal option.
1086 # I suspect that the choice between "illegal" and "invalid"
1087 # depends on the user's environment variables, the phase
1088 # of the moon (weirdness with optind), and who knows what else.
1089 # I've been seeing "illegal"...
1090 dotest_fail basicb-21 "${testcvs} -q admin -H" \
1091 "admin: illegal option -- H
1092 ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information" \
1093 "admin: invalid option -- H
1094 ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information"
1098 # OK, while we have an Emptydir around, test a few obscure
1101 dotest basicb-edir-1 "${testcvs} -q co -l CVSROOT" \
1102 "U CVSROOT${DOTSTAR}"
1104 dotest_fail basicb-edir-2 "test -d Emptydir" ''
1105 # This tests the code in find_dirs which skips Emptydir.
1106 dotest basicb-edir-3 "${testcvs} -q -n update -d -P" ''
1110 if test "$keep" = yes; then
1111 echo Keeping ${TESTDIR} and exiting due to --keep
1115 rm -rf ${CVSROOT_DIRNAME}/first-dir
1116 rm -rf ${CVSROOT_DIRNAME}/second-dir
1117 rm -rf ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
1118 rm -f ${CVSROOT_DIRNAME}/topfile,v
1122 # More tests of basic/miscellaneous functionality.
1124 dotest_fail basicc-1 "${testcvs} diff" \
1125 "${PROG} [a-z]*: in directory \.:
1126 ${PROG} \[[a-z]* aborted\]: there is no version here; run .${PROG} checkout. first"
1127 dotest basicc-2 "${testcvs} -q co -l ." ''
1128 mkdir first-dir second-dir
1129 dotest basicc-3 "${testcvs} add first-dir second-dir" \
1130 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository
1131 Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
1132 # Old versions of CVS often didn't create this top-level CVS
1133 # directory in the first place. I think that maybe the only
1134 # way to get avoid it currently is to let CVS create it, and
1135 # then blow it away. But that is perfectly legal; people who
1136 # are used to the old behavior especially may be interested.
1138 dotest basicc-4 "echo *" "first-dir second-dir"
1139 dotest basicc-5 "${testcvs} update" \
1140 "${PROG} [a-z]*: Updating first-dir
1141 ${PROG} [a-z]*: Updating second-dir" \
1142 "${PROG} [a-z]*: Updating \.
1143 ${PROG} [a-z]*: Updating first-dir
1144 ${PROG} [a-z]*: Updating second-dir"
1148 rm -rf ${CVSROOT_DIRNAME}/first-dir
1152 # first dive - add a files, first singly, then in a group.
1153 mkdir ${CVSROOT_DIRNAME}/first-dir
1155 # check out an empty directory
1156 dotest basic1-1 "${testcvs} -q co first-dir" ''
1164 dotest basic1-14-add-add "${testcvs} add file2 file3 file4 file5" \
1165 "${PROG} [a-z]*: scheduling file \`file2' for addition
1166 ${PROG} [a-z]*: scheduling file \`file3' for addition
1167 ${PROG} [a-z]*: scheduling file \`file4' for addition
1168 ${PROG} [a-z]*: scheduling file \`file5' for addition
1169 ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
1170 dotest basic1-15-add-add \
1171 "${testcvs} -q update file2 file3 file4 file5" \
1176 dotest basic1-16-add-add "${testcvs} -q update" \
1181 dotest basic1-17-add-add "${testcvs} -q status" \
1182 "===================================================================
1183 File: file2 Status: Locally Added
1185 Working revision: New file!
1186 Repository revision: No revision control file
1189 Sticky Options: (none)
1191 ===================================================================
1192 File: file3 Status: Locally Added
1194 Working revision: New file!
1195 Repository revision: No revision control file
1198 Sticky Options: (none)
1200 ===================================================================
1201 File: file4 Status: Locally Added
1203 Working revision: New file!
1204 Repository revision: No revision control file
1207 Sticky Options: (none)
1209 ===================================================================
1210 File: file5 Status: Locally Added
1212 Working revision: New file!
1213 Repository revision: No revision control file
1216 Sticky Options: (none)"
1217 dotest basic1-18-add-add "${testcvs} -q log" \
1218 "${PROG} [a-z]*: file2 has been added, but not committed
1219 ${PROG} [a-z]*: file3 has been added, but not committed
1220 ${PROG} [a-z]*: file4 has been added, but not committed
1221 ${PROG} [a-z]*: file5 has been added, but not committed"
1223 dotest basic1-21-add-add "${testcvs} -q update" \
1228 # FIXCVS? Shouldn't this read first-dir/file2 instead of file2?
1229 dotest basic1-22-add-add "${testcvs} log first-dir" \
1230 "${PROG} [a-z]*: Logging first-dir
1231 ${PROG} [a-z]*: file2 has been added, but not committed
1232 ${PROG} [a-z]*: file3 has been added, but not committed
1233 ${PROG} [a-z]*: file4 has been added, but not committed
1234 ${PROG} [a-z]*: file5 has been added, but not committed"
1235 dotest basic1-23-add-add "${testcvs} status first-dir" \
1236 "${PROG} [a-z]*: Examining first-dir
1237 ===================================================================
1238 File: file2 Status: Locally Added
1240 Working revision: New file!
1241 Repository revision: No revision control file
1244 Sticky Options: (none)
1246 ===================================================================
1247 File: file3 Status: Locally Added
1249 Working revision: New file!
1250 Repository revision: No revision control file
1253 Sticky Options: (none)
1255 ===================================================================
1256 File: file4 Status: Locally Added
1258 Working revision: New file!
1259 Repository revision: No revision control file
1262 Sticky Options: (none)
1264 ===================================================================
1265 File: file5 Status: Locally Added
1267 Working revision: New file!
1268 Repository revision: No revision control file
1271 Sticky Options: (none)"
1272 dotest basic1-24-add-add "${testcvs} update first-dir" \
1273 "${PROG} [a-z]*: Updating first-dir
1278 dotest basic1-27-add-add "${testcvs} co first-dir" \
1279 "${PROG} [a-z]*: Updating first-dir
1285 dotest basic1-14-add-ci \
1286 "${testcvs} commit -m test file2 file3 file4 file5" \
1287 "RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
1290 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
1291 initial revision: 1\.1
1293 RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
1296 ${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
1297 initial revision: 1\.1
1299 RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
1302 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
1303 initial revision: 1\.1
1305 RCS file: ${TESTDIR}/cvsroot/first-dir/file5,v
1308 ${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
1309 initial revision: 1\.1
1311 dotest basic1-15-add-ci \
1312 "${testcvs} -q update file2 file3 file4 file5" ''
1313 dotest basic1-16-add-ci "${testcvs} -q update" ''
1314 dotest basic1-17-add-ci "${testcvs} -q status" \
1315 "===================================================================
1316 File: file2 Status: Up-to-date
1318 Working revision: 1\.1.*
1319 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file2,v
1322 Sticky Options: (none)
1324 ===================================================================
1325 File: file3 Status: Up-to-date
1327 Working revision: 1\.1.*
1328 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file3,v
1331 Sticky Options: (none)
1333 ===================================================================
1334 File: file4 Status: Up-to-date
1336 Working revision: 1\.1.*
1337 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file4,v
1340 Sticky Options: (none)
1342 ===================================================================
1343 File: file5 Status: Up-to-date
1345 Working revision: 1\.1.*
1346 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file5,v
1349 Sticky Options: (none)"
1350 # The "log" tests and friends probably already test the output
1351 # from log quite adequately.
1352 # Note: using dotest fails here. It seems to be related
1353 # to the output being sufficiently large (Red Hat 4.1).
1354 # dotest basic1-18-add-ci "${testcvs} log" "${DOTSTAR}"
1355 if ${testcvs} -q log >>${LOGFILE}; then
1356 pass basic1-18-add-ci
1358 pass basic1-18-add-ci
1361 dotest basic1-21-add-ci "${testcvs} -q update" ''
1362 # See test basic1-18-add-ci for explanation of non-use of dotest.
1363 if ${testcvs} -q log first-dir >>${LOGFILE}; then
1364 pass basic1-22-add-ci
1366 pass basic1-22-add-ci
1368 # At least for the moment I am going to consider 17-add-ci
1369 # an adequate test of the output here.
1370 # See test basic1-18-add-ci for explanation of non-use of dotest.
1371 if ${testcvs} -q status first-dir >>${LOGFILE}; then
1372 pass basic1-23-add-ci
1374 pass basic1-23-add-ci
1376 dotest basic1-24-add-ci "${testcvs} -q update first-dir" ''
1377 dotest basic1-27-add-ci "${testcvs} -q co first-dir" ''
1380 rm file2 file3 file4 file5
1381 dotest basic1-14-rm-rm "${testcvs} rm file2 file3 file4 file5" \
1382 "${PROG} [a-z]*: scheduling .file2. for removal
1383 ${PROG} [a-z]*: scheduling .file3. for removal
1384 ${PROG} [a-z]*: scheduling .file4. for removal
1385 ${PROG} [a-z]*: scheduling .file5. for removal
1386 ${PROG} [a-z]*: use .${PROG} commit. to remove these files permanently"
1387 # 15-rm-rm was commented out. Why?
1388 dotest basic1-15-rm-rm \
1389 "${testcvs} -q update file2 file3 file4 file5" \
1394 dotest basic1-16-rm-rm "${testcvs} -q update" \
1399 dotest basic1-17-rm-rm "${testcvs} -q status" \
1400 "===================================================================
1401 File: no file file2 Status: Locally Removed
1403 Working revision: -1\.1.*
1404 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file2,v
1407 Sticky Options: (none)
1409 ===================================================================
1410 File: no file file3 Status: Locally Removed
1412 Working revision: -1\.1.*
1413 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file3,v
1416 Sticky Options: (none)
1418 ===================================================================
1419 File: no file file4 Status: Locally Removed
1421 Working revision: -1\.1.*
1422 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file4,v
1425 Sticky Options: (none)
1427 ===================================================================
1428 File: no file file5 Status: Locally Removed
1430 Working revision: -1\.1.*
1431 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file5,v
1434 Sticky Options: (none)"
1435 # Would be nice to test that real logs appear (with dead state
1436 # and all), either here or someplace like log2 tests.
1437 if ${testcvs} -q log >>${LOGFILE}; then
1438 pass basic1-18-rm-rm
1440 fail basic1-18-rm-rm
1443 dotest basic1-21-rm-rm "${testcvs} -q update" \
1448 if ${testcvs} -q log first-dir >>${LOGFILE}; then
1449 pass basic1-22-rm-rm
1451 fail basic1-22-rm-rm
1453 if ${testcvs} -q status first-dir >>${LOGFILE}; then
1454 pass basic1-23-rm-rm
1456 fail basic1-23-rm-rm
1458 dotest basic1-24-rm-rm "${testcvs} -q update first-dir" \
1463 dotest basic1-27-rm-rm "${testcvs} -q co first-dir" \
1469 dotest basic1-14-rm-ci "${testcvs} -q commit -m test" \
1471 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
1472 new revision: delete; previous revision: 1\.1
1475 ${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
1476 new revision: delete; previous revision: 1\.1
1479 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
1480 new revision: delete; previous revision: 1\.1
1483 ${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
1484 new revision: delete; previous revision: 1\.1
1486 dotest basic1-15-rm-ci \
1487 "${testcvs} -q update file2 file3 file4 file5" ''
1488 dotest basic1-16-rm-ci "${testcvs} -q update" ''
1489 dotest basic1-17-rm-ci "${testcvs} -q status" ''
1490 # Would be nice to test that real logs appear (with dead state
1491 # and all), either here or someplace like log2 tests.
1492 if ${testcvs} -q log >>${LOGFILE}; then
1493 pass basic1-18-rm-ci
1495 fail basic1-18-rm-ci
1498 dotest basic1-21-rm-ci "${testcvs} -q update" ''
1499 if ${testcvs} -q log first-dir >>${LOGFILE}; then
1500 pass basic1-22-rm-ci
1502 fail basic1-22-rm-ci
1504 if ${testcvs} -q status first-dir >>${LOGFILE}; then
1505 pass basic1-23-rm-ci
1507 fail basic1-23-rm-ci
1509 dotest basic1-24-rm-ci "${testcvs} -q update first-dir" ''
1510 dotest basic1-27-rm-ci "${testcvs} -q co first-dir" ''
1512 # All the files are removed, so nothing gets tagged.
1513 dotest basic1-28 "${testcvs} -q tag first-dive" ''
1517 if test "$keep" = yes; then
1518 echo Keeping ${TESTDIR} and exiting due to --keep
1523 rm -rf ${CVSROOT_DIRNAME}/first-dir
1527 # Test the ability to operate on directories nested rather deeply.
1528 mkdir ${CVSROOT_DIRNAME}/first-dir
1529 dotest deep-1 "${testcvs} -q co first-dir" ''
1531 for i in dir1 dir2 dir3 dir4 dir5 dir6 dir7 dir8; do
1533 dotest deep-2-$i "${testcvs} add $i" \
1534 "Directory ${TESTDIR}/cvsroot/first-dir/dir1[/dir0-9]* added to the repository"
1537 dotest deep-3-$i "${testcvs} add file1" \
1538 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
1539 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
1541 cd ../../../../../../../../..
1542 dotest_lit deep-4 "${testcvs} -q ci -m add-them first-dir" <<HERE
1543 RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/file1,v
1545 Checking in first-dir/dir1/file1;
1546 ${TESTDIR}/cvsroot/first-dir/dir1/file1,v <-- file1
1547 initial revision: 1.1
1549 RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/file1,v
1551 Checking in first-dir/dir1/dir2/file1;
1552 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/file1,v <-- file1
1553 initial revision: 1.1
1555 RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/file1,v
1557 Checking in first-dir/dir1/dir2/dir3/file1;
1558 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/file1,v <-- file1
1559 initial revision: 1.1
1561 RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/file1,v
1563 Checking in first-dir/dir1/dir2/dir3/dir4/file1;
1564 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/file1,v <-- file1
1565 initial revision: 1.1
1567 RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v
1569 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/file1;
1570 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
1571 initial revision: 1.1
1573 RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v
1575 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1;
1576 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
1577 initial revision: 1.1
1579 RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v
1581 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1;
1582 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
1583 initial revision: 1.1
1585 RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v
1587 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1;
1588 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
1589 initial revision: 1.1
1593 cd first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
1595 dotest deep-4a0 "${testcvs} rm file1" \
1596 "${PROG} [a-z]*: scheduling .file1. for removal
1597 ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
1598 dotest deep-4a1 "${testcvs} -q ci -m rm-it" "Removing file1;
1599 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
1600 new revision: delete; previous revision: 1\.1
1603 dotest deep-4a2 "${testcvs} -q update -P dir6/dir7" ''
1604 # Should be using "test -e" if that is portable enough.
1605 dotest_fail deep-4a3 "test -d dir6/dir7/dir8" ''
1607 # Test that if we remove the working directory, CVS does not
1608 # recreate it. (I realize that this behavior is what the
1609 # users expect, but in the longer run we might want to
1610 # re-think it. The corresponding behavior for a file is that
1611 # CVS *will* recreate it, and we might want to make it so
1612 # that "cvs release -d" is the way to delete the directory
1613 # and have it stay gone -kingdon, Oct1996).
1615 dotest deep-4b0a "${testcvs} -q diff" ''
1616 dotest deep-4b0b "${testcvs} -q ci" ''
1617 dotest deep-4b1 "${testcvs} -q update" ''
1618 dotest deep-4b2 "${testcvs} -q update -d -P" \
1622 # Test what happens if one uses -P when there are files removed
1623 # but not committed.
1625 dotest deep-rm1 "${testcvs} rm -f file1" \
1626 "${PROG} [a-z]*: scheduling .file1. for removal
1627 ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
1629 dotest deep-rm2 "${testcvs} -q update -d -P" 'R dir7/file1'
1630 dotest deep-rm3 "test -d dir7" ''
1631 dotest deep-rm4 "${testcvs} -q ci -m rm-it" "Removing dir7/file1;
1632 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
1633 new revision: delete; previous revision: 1\.1
1635 dotest deep-rm5 "${testcvs} -q update -d -P" ''
1636 dotest_fail deep-rm6 "test -d dir7" ''
1640 dotest deep-rm7 "${testcvs} rm -f -R dir5" \
1641 "${PROG} [a-z]*: Removing dir5
1642 ${PROG} [a-z]*: scheduling .dir5/file1. for removal
1643 ${PROG} [a-z]*: Removing dir5/dir6
1644 ${PROG} [a-z]*: scheduling .dir5/dir6/file1. for removal
1645 ${PROG} [a-z]*: use .${PROG} commit. to remove these files permanently"
1646 dotest deep-rm8 "${testcvs} -q ci -m rm-it" \
1647 "Removing dir5/file1;
1648 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
1649 new revision: delete; previous revision: 1\.1
1651 Removing dir5/dir6/file1;
1652 ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
1653 new revision: delete; previous revision: 1\.1
1655 dotest deep-rm9 "${testcvs} -q update -d -P" ''
1656 dotest_fail deep-rm10 "test -d dir5"
1660 if echo "yes" | ${testcvs} release -d first-dir >>${LOGFILE}; then
1665 rm -rf ${CVSROOT_DIRNAME}/first-dir
1669 # Test rtag, import, history, various miscellaneous operations
1671 # NOTE: this section has reached the size and
1672 # complexity where it is getting to be a good idea to
1673 # add new tests to a new section rather than
1674 # continuing to piggyback them onto the tests here.
1676 # First empty the history file
1677 rm ${CVSROOT_DIRNAME}/CVSROOT/history
1678 touch ${CVSROOT_DIRNAME}/CVSROOT/history
1680 ### XXX maybe should use 'cvs imprt -b1 -m new-module first-dir F F1' in an
1681 ### empty directory to do this instead of hacking directly into $CVSROOT
1682 mkdir ${CVSROOT_DIRNAME}/first-dir
1683 dotest basic2-1 "${testcvs} -q co first-dir" ''
1684 for i in first-dir dir1 dir2 ; do
1685 if test ! -d $i ; then
1687 if ${CVS} add $i >> ${LOGFILE}; then
1696 for j in file6 file7; do
1700 if ${CVS} add file6 file7 2>> ${LOGFILE}; then
1707 if ${CVS} update first-dir ; then
1713 # fixme: doesn't work right for added files.
1714 if ${CVS} log first-dir >> ${LOGFILE}; then
1720 if ${CVS} status first-dir >> ${LOGFILE}; then
1726 # XXX why is this commented out???
1727 # if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
1733 if ${CVS} ci -m "second dive" first-dir >> ${LOGFILE} 2>&1; then
1739 if ${CVS} tag second-dive first-dir ; then
1745 # third dive - in bunch o' directories, add bunch o' files,
1746 # delete some, change some.
1748 for i in first-dir dir1 dir2 ; do
1757 if ${CVS} rm file7 2>> ${LOGFILE}; then
1763 # and add a new file
1766 if ${CVS} add file14 2>> ${LOGFILE}; then
1773 if ${CVS} update first-dir ; then
1779 # FIXME: doesn't work right for added files
1780 if ${CVS} log first-dir >> ${LOGFILE}; then
1786 if ${CVS} status first-dir >> ${LOGFILE}; then
1792 # XXX why is this commented out?
1793 # if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
1799 if ${CVS} ci -m "third dive" first-dir >>${LOGFILE} 2>&1; then
1804 dotest 43.5 "${testcvs} -q update first-dir" ''
1806 if ${CVS} tag third-dive first-dir ; then
1812 if echo "yes" | ${CVS} release -d first-dir ; then
1819 if test -d first-dir ; then
1825 # now try some rtags
1828 if ${CVS} rtag rtagged-by-head first-dir ; then
1835 if ${CVS} rtag -r rtagged-by-head rtagged-by-tag first-dir ; then
1842 if ${CVS} rtag -r1.1 rtagged-by-revision first-dir ; then
1849 if ${CVS} rdiff -r1.1 -rrtagged-by-head first-dir >> ${LOGFILE} || test $? = 1 ; then
1855 # now export by rtagged-by-head and rtagged-by-tag and compare.
1856 if ${CVS} export -r rtagged-by-head first-dir ; then
1863 if ${CVS} export -r rtagged-by-tag first-dir ; then
1869 directory_cmp 1dir first-dir
1876 rm -r 1dir first-dir
1878 # checkout by revision vs export by rtagged-by-revision and compare.
1879 if ${CVS} export -rrtagged-by-revision -d export-dir first-dir ; then
1885 if ${CVS} co -r1.1 first-dir ; then
1891 # directory copies are done in an oblique way in order to avoid a bug in sun's tmp filesystem.
1892 mkdir first-dir.cpy ; (cd first-dir ; tar cf - . | (cd ../first-dir.cpy ; tar xf -))
1894 directory_cmp first-dir export-dir
1902 # interrupt, while we've got a clean 1.1 here, let's import it
1903 # into a couple of other modules.
1905 dotest 56 "${testcvs} import -m first-import second-dir first-immigration immigration1 immigration1_0" \
1906 "N second-dir/file14
1909 ${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/dir1
1910 N second-dir/dir1/file14
1911 N second-dir/dir1/file6
1912 N second-dir/dir1/file7
1913 ${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/dir1/dir2
1914 N second-dir/dir1/dir2/file14
1915 N second-dir/dir1/dir2/file6
1916 N second-dir/dir1/dir2/file7
1918 No conflicts created by this import"
1921 if ${CVS} export -r HEAD second-dir ; then
1927 directory_cmp first-dir second-dir
1937 rm -r export-dir first-dir
1939 (cd first-dir.cpy ; tar cf - . | (cd ../first-dir ; tar xf -))
1941 # update the top, cancelling sticky tags, retag, update other copy, compare.
1943 if ${CVS} update -A -l *file* 2>> ${LOGFILE}; then
1949 # If we don't delete the tag first, cvs won't retag it.
1950 # This would appear to be a feature.
1951 if ${CVS} tag -l -d rtagged-by-revision ; then
1956 if ${CVS} tag -l rtagged-by-revision ; then
1964 mv first-dir.cpy first-dir
1967 dotest 61 "${testcvs} -q diff -u" ''
1969 if ${CVS} update ; then
1977 #### FIXME: is this expected to work??? Need to investigate
1978 #### and fix or remove the test.
1979 # directory_cmp 1dir first-dir
1986 rm -r 1dir first-dir
1988 # Test the cvs history command.
1990 # The reason that there are two patterns rather than using
1991 # \(${TESTDIR}\|<remote>\) is that we are trying to
1992 # make this portable. Perhaps at some point we should
1993 # ditch that notion and require GNU expr (or dejagnu or....)
1994 # since it seems to be so painful.
1996 # why are there two lines at the end of the local output
1997 # which don't exist in the remote output? would seem to be
1999 dotest basic2-64 "${testcvs} his -x TOFWUCGMAR -a" \
2000 "O [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= ${TMPPWD}/\*
2001 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == ${TMPPWD}
2002 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == ${TMPPWD}
2003 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == ${TMPPWD}
2004 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == ${TMPPWD}
2005 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == ${TMPPWD}
2006 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == ${TMPPWD}
2007 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == ${TMPPWD}
2008 M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TMPPWD}
2009 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == ${TMPPWD}
2010 M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == ${TMPPWD}
2011 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == ${TMPPWD}
2012 M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == ${TMPPWD}
2013 F [0-9/]* [0-9:]* ${PLUS}0000 ${username} =first-dir= ${TMPPWD}/\*
2014 T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
2015 T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
2016 T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
2017 O [0-9/]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= ${TMPPWD}/\*
2018 U [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TMPPWD}/first-dir
2019 U [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TMPPWD}/first-dir" \
2020 "O [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= <remote>/\*
2021 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == <remote>
2022 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == <remote>
2023 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == <remote>
2024 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == <remote>
2025 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == <remote>
2026 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == <remote>
2027 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == <remote>
2028 M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
2029 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == <remote>
2030 M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == <remote>
2031 A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == <remote>
2032 M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == <remote>
2033 F [0-9/]* [0-9:]* ${PLUS}0000 ${username} =first-dir= <remote>/\*
2034 T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
2035 T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
2036 T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
2037 O [0-9/]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= <remote>/\*"
2039 rm -rf ${CVSROOT_DIRNAME}/first-dir
2040 rm -rf ${CVSROOT_DIRNAME}/second-dir
2045 # XXX for now this is just the most essential test...
2051 echo '$''Name$' >> foo
2053 echo '$''Name$' >> bar
2054 dotest_sort rdiff-1 \
2055 "${testcvs} import -I ! -m test-import-with-keyword trdiff TRDIFF T1" \
2060 No conflicts created by this import'
2062 "${testcvs} co -ko trdiff" \
2063 "${PROG} [a-z]*: Updating trdiff
2067 echo something >> foo
2069 "${testcvs} ci -m added-something foo" \
2071 ${TESTDIR}/cvsroot/trdiff/foo,v <-- foo
2072 new revision: 1\.2; previous revision: 1\.1
2074 echo '#ident "@(#)trdiff:$''Name$:$''Id$"' > new
2075 echo "new file" >> new
2077 "${testcvs} add -m new-file-description new" \
2078 "${PROG} [a-z]*: scheduling file \`new' for addition
2079 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
2081 "${testcvs} commit -m added-new-file new" \
2082 "RCS file: ${TESTDIR}/cvsroot/trdiff/new,v
2085 ${TESTDIR}/cvsroot/trdiff/new,v <-- new
2086 initial revision: 1\.1
2089 "${testcvs} tag local-v0" \
2090 "${PROG} [a-z]*: Tagging .
2095 "${testcvs} status -v foo" \
2096 "===================================================================
2097 File: foo Status: Up-to-date
2099 Working revision: 1\.2.*
2100 Repository revision: 1\.2 ${TESTDIR}/cvsroot/trdiff/foo,v
2106 local-v0 (revision: 1\.2)
2107 T1 (revision: 1\.1\.1\.1)
2108 TRDIFF (branch: 1\.1\.1)"
2114 "${testcvs} rdiff -r T1 -r local-v0 trdiff" \
2115 "${PROG}"' [a-z]*: Diffing trdiff
2117 diff -c trdiff/foo:1\.1\.1\.1 trdiff/foo:1\.2
2118 \*\*\* trdiff/foo:1\.1\.1\.1 .*
2120 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2122 ! \$''Id: foo,v 1\.1\.1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$
2125 ! \$''Id: foo,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
2126 ! \$''Name: local-v0 \$
2129 diff -c /dev/null trdiff/new:1\.1
2132 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2135 '"${PLUS}"' #ident "@(#)trdiff:\$''Name: local-v0 \$:\$''Id: new,v 1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$"
2136 '"${PLUS}"' new file'
2138 # FIXME: will this work here?
2139 # if test "$keep" = yes; then
2140 # echo Keeping ${TESTDIR} and exiting due to --keep
2146 rm -rf ${CVSROOT_DIRNAME}/trdiff
2150 # next dive. test death support.
2152 # NOTE: this section has reached the size and
2153 # complexity where it is getting to be a good idea to
2154 # add new death support tests to a new section rather
2155 # than continuing to piggyback them onto the tests here.
2157 mkdir ${CVSROOT_DIRNAME}/first-dir
2158 if ${CVS} co first-dir ; then
2166 # Create a directory with only dead files, to make sure CVS
2167 # doesn't get confused by it.
2169 dotest 65a0 "${testcvs} add subdir" \
2170 "Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository"
2172 echo file in subdir >sfile
2173 dotest 65a1 "${testcvs} add sfile" \
2174 "${PROG}"' [a-z]*: scheduling file `sfile'\'' for addition
2175 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
2176 dotest 65a2 "${testcvs} -q ci -m add-it" \
2177 "RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/sfile,v
2180 ${TESTDIR}/cvsroot/first-dir/subdir/sfile,v <-- sfile
2181 initial revision: 1\.1
2184 dotest 65a3 "${testcvs} rm sfile" \
2185 "${PROG}"' [a-z]*: scheduling `sfile'\'' for removal
2186 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to remove this file permanently'
2187 dotest 65a4 "${testcvs} -q ci -m remove-it" \
2189 ${TESTDIR}/cvsroot/first-dir/subdir/sfile,v <-- sfile
2190 new revision: delete; previous revision: 1\.1
2193 dotest 65a5 "${testcvs} -q update -P" ''
2194 dotest_fail 65a6 "test -d subdir" ''
2198 if ${CVS} add file1 2>> ${LOGFILE}; then
2205 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
2213 if ${CVS} rm file1 2>> ${LOGFILE}; then
2220 if ${CVS} ci -m test >>${LOGFILE} ; then
2226 dotest_fail 69a0 "test -f file1" ''
2227 # get the old contents of file1 back
2228 if ${testcvs} update -p -r 1.1 file1 >file1 2>>${LOGFILE}; then
2233 dotest 69a2 "cat file1" ''
2235 # create second file
2237 if ${CVS} add file1 file2 2>> ${LOGFILE}; then
2244 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
2251 if ${CVS} log file1 >> ${LOGFILE}; then
2257 # file4 will be dead at the time of branching and stay dead.
2259 dotest death-file4-add "${testcvs} add file4" \
2260 "${PROG}"' [a-z]*: scheduling file `file4'\'' for addition
2261 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
2262 dotest death-file4-ciadd "${testcvs} -q ci -m add file4" \
2263 "RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
2266 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
2267 initial revision: 1\.1
2270 dotest death-file4-rm "${testcvs} remove file4" \
2271 "${PROG}"' [a-z]*: scheduling `file4'\'' for removal
2272 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to remove this file permanently'
2273 dotest death-file4-cirm "${testcvs} -q ci -m remove file4" \
2275 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
2276 new revision: delete; previous revision: 1\.1
2279 # Tag the branchpoint.
2280 dotest death-72a "${testcvs} -q tag bp_branch1" 'T file1
2284 if ${CVS} tag -b branch1 ; then
2290 # and move to the branch.
2291 if ${CVS} update -r branch1 ; then
2297 dotest_fail death-file4-3 "test -f file4" ''
2299 # add a file in the branch
2300 echo line1 from branch1 >> file3
2301 if ${CVS} add file3 2>> ${LOGFILE}; then
2308 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
2315 "${testcvs} -q rdiff -r bp_branch1 -r branch1 first-dir" \
2316 "Index: first-dir/file3
2317 diff -c /dev/null first-dir/file3:1\.1\.2\.1
2319 --- first-dir/file3 .*
2320 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2323 ${PLUS} line1 from branch1"
2325 "${testcvs} -q rdiff -r branch1 -r bp_branch1 first-dir" \
2326 'Index: first-dir/file3
2327 diff -c first-dir/file3:1\.1\.2\.1 first-dir/file3:removed
2328 \*\*\* first-dir/file3:1\.1\.2\.1 .*
2329 --- first-dir/file3 .*
2330 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2332 - line1 from branch1
2337 if ${CVS} rm file3 2>> ${LOGFILE}; then
2344 if ${CVS} ci -m test >>${LOGFILE} ; then
2351 echo line1 from branch1 >> file3
2352 if ${CVS} add file3 2>> ${LOGFILE}; then
2359 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
2365 # change the first file
2366 echo line2 from branch1 >> file1
2369 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
2377 if ${CVS} rm file2 2>> ${LOGFILE}; then
2384 if ${CVS} ci -m test >>${LOGFILE}; then
2390 # back to the trunk.
2391 if ${CVS} update -A 2>> ${LOGFILE}; then
2397 dotest_fail death-file4-4 "test -f file4" ''
2399 if test -f file3 ; then
2406 dotest 86 "${testcvs} -q update -j branch1" \
2407 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
2408 retrieving revision 1\.3
2409 retrieving revision 1\.3\.2\.1
2410 Merging differences between 1\.3 and 1\.3\.2\.1 into file1
2411 ${PROG} [a-z]*: scheduling file2 for removal
2414 dotest_fail death-file4-5 "test -f file4" ''
2416 if test -f file3 ; then
2422 # Make sure that we joined the correct change to file1
2423 if echo line2 from branch1 | cmp - file1 >/dev/null; then
2430 if ${CVS} update ; then
2437 dotest 89 "${testcvs} -q ci -m test" \
2439 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
2440 new revision: 1\.4; previous revision: 1\.3
2443 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
2444 new revision: delete; previous revision: 1\.1
2447 ${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
2448 new revision: 1\.2; previous revision: 1\.1
2453 dotest 89a "${testcvs} -q co first-dir" 'U first-dir/file1
2459 # remove first file.
2461 if ${CVS} rm file1 2>> ${LOGFILE}; then
2468 if ${CVS} ci -m test >>${LOGFILE}; then
2474 if test -f file1 ; then
2480 # typo; try to get to the branch and fail
2481 dotest_fail 92.1a "${testcvs} update -r brnach1" \
2482 "${PROG}"' \[[a-z]* aborted\]: no such tag brnach1'
2483 # Make sure we are still on the trunk
2484 if test -f file1 ; then
2489 if test -f file3 ; then
2496 if ${CVS} update -r branch1 2>> ${LOGFILE}; then
2502 dotest_fail death-file4-6 "test -f file4" ''
2504 if test -f file1 ; then
2511 dotest 95 "${testcvs} -q update -j HEAD" \
2512 "${PROG}"' [a-z]*: file file1 has been modified, but has been removed in revision HEAD
2513 '"${PROG}"' [a-z]*: file file3 exists, but has been added in revision HEAD'
2515 dotest_fail death-file4-7 "test -f file4" ''
2517 # file2 should not have been recreated. It was
2518 # deleted on the branch, and has not been modified on
2519 # the trunk. That means that there have been no
2520 # changes between the greatest common ancestor (the
2521 # trunk version) and HEAD.
2522 dotest_fail death-file2-1 "test -f file2" ''
2524 cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
2528 # More tests of death support.
2529 mkdir ${CVSROOT_DIRNAME}/first-dir
2530 dotest death2-1 "${testcvs} -q co first-dir" ''
2534 # Add a file on the trunk.
2535 echo "first revision" > file1
2536 dotest death2-2 "${testcvs} add file1" \
2537 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
2538 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
2540 dotest death2-3 "${testcvs} -q commit -m add" \
2541 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
2544 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
2545 initial revision: 1\.1
2548 # Make a branch and a non-branch tag.
2549 dotest death2-4 "${testcvs} -q tag -b branch" 'T file1'
2550 dotest death2-5 "${testcvs} -q tag tag" 'T file1'
2552 # Switch over to the branch.
2553 dotest death2-6 "${testcvs} -q update -r branch" ''
2555 # Delete the file on the branch.
2557 dotest death2-7 "${testcvs} rm file1" \
2558 "${PROG} [a-z]*: scheduling .file1. for removal
2559 ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
2561 # Test diff of the removed file before it is committed.
2562 dotest_fail death2-diff-1 "${testcvs} -q diff file1" \
2563 "${PROG} [a-z]*: file1 was removed, no comparison available"
2565 # If the DIFF that CVS is using (options.h) is Sun diff, this
2566 # test is said to fail (I think the /dev/null is the part
2567 # that differs), along with a number of the other similar tests.
2568 dotest_fail death2-diff-2 "${testcvs} -q diff -N -c file1" \
2570 ===================================================================
2573 \*\*\* ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
2574 --- /dev/null[ ][ ]*[a-zA-Z0-9: ]*
2575 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2580 dotest death2-8 "${testcvs} -q ci -m removed" \
2582 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
2583 new revision: delete; previous revision: 1\.1\.2
2586 # Test diff of a dead file.
2587 dotest_fail death2-diff-3 \
2588 "${testcvs} -q diff -r1.1 -rbranch -c file1" \
2589 "${PROG} [a-z]*: file1 was removed, no comparison available"
2591 dotest_fail death2-diff-4 \
2592 "${testcvs} -q diff -r1.1 -rbranch -N -c file1" \
2594 ===================================================================
2597 \*\*\* ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
2598 --- /dev/null[ ][ ]*[a-zA-Z0-9: ]*
2599 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2604 dotest_fail death2-diff-5 "${testcvs} -q diff -rtag -c ." \
2605 "${PROG} [a-z]*: file1 no longer exists, no comparison available"
2607 dotest_fail death2-diff-6 "${testcvs} -q diff -rtag -N -c ." \
2609 ===================================================================
2612 \*\*\* ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
2613 --- /dev/null[ ][ ]*[a-zA-Z0-9: ]*
2614 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2619 # Test rdiff of a dead file.
2620 dotest death2-rdiff-1 \
2621 "${testcvs} -q rtag -rbranch rdiff-tag first-dir" ''
2623 dotest death2-rdiff-2 "${testcvs} -q rdiff -rtag -rbranch first-dir" \
2624 "Index: first-dir/file1
2625 diff -c first-dir/file1:1\.1 first-dir/file1:removed
2626 \*\*\* first-dir/file1:1\.1[ ][ ]*[a-zA-Z0-9: ]*
2627 --- first-dir/file1[ ][ ]*[a-zA-Z0-9: ]*
2628 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2633 # Readd the file to the branch.
2634 echo "second revision" > file1
2635 dotest death2-9 "${testcvs} add file1" \
2636 "${PROG}"' [a-z]*: file `file1'\'' will be added on branch `branch'\'' from version 1\.1\.2\.1
2637 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
2639 # Test diff of the added file before it is committed.
2640 dotest_fail death2-diff-7 "${testcvs} -q diff file1" \
2641 "${PROG} [a-z]*: file1 is a new entry, no comparison available"
2643 dotest_fail death2-diff-8 "${testcvs} -q diff -N -c file1" \
2645 ===================================================================
2648 \*\*\* /dev/null[ ][ ]*[a-zA-Z0-9: ]*
2649 --- ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
2650 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2653 ${PLUS} second revision"
2655 dotest death2-10 "${testcvs} -q commit -m add" \
2657 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
2658 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
2661 # Back to the trunk.
2662 dotest death2-11 "${testcvs} -q update -A" 'U file1' 'P file1'
2664 # Add another file on the trunk.
2665 echo "first revision" > file2
2666 dotest death2-12 "${testcvs} add file2" \
2667 "${PROG}"' [a-z]*: scheduling file `file2'\'' for addition
2668 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
2669 dotest death2-13 "${testcvs} -q commit -m add" \
2670 "RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
2673 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
2674 initial revision: 1\.1
2677 # Back to the branch.
2678 # The ``no longer in the repository'' message doesn't really
2679 # look right to me, but that's what CVS currently prints for
2681 dotest death2-14 "${testcvs} -q update -r branch" \
2683 ${PROG} [a-z]*: file2 is no longer in the repository" \
2685 ${PROG} [a-z]*: file2 is no longer in the repository"
2687 # Add a file on the branch with the same name.
2688 echo "branch revision" > file2
2689 dotest death2-15 "${testcvs} add file2" \
2690 "${PROG}"' [a-z]*: scheduling file `file2'\'' for addition on branch `branch'\''
2691 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
2692 dotest death2-16 "${testcvs} -q commit -m add" \
2694 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
2695 new revision: 1\.1\.2\.1; previous revision: 1\.1
2698 # Add a new file on the branch.
2699 echo "first revision" > file3
2700 dotest death2-17 "${testcvs} add file3" \
2701 "${PROG}"' [a-z]*: scheduling file `file3'\'' for addition on branch `branch'\''
2702 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
2703 dotest death2-18 "${testcvs} -q commit -m add" \
2704 "RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file3,v
2707 ${TESTDIR}/cvsroot/first-dir/Attic/file3,v <-- file3
2708 new revision: 1\.1\.2\.1; previous revision: 1\.1
2711 # Test diff of a nonexistent tag
2712 dotest_fail death2-diff-9 "${testcvs} -q diff -rtag -c file3" \
2713 "${PROG} [a-z]*: tag tag is not in file file3"
2715 dotest_fail death2-diff-10 "${testcvs} -q diff -rtag -N -c file3" \
2717 ===================================================================
2720 \*\*\* /dev/null[ ][ ]*[a-zA-Z0-9: ]*
2721 --- ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
2722 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2725 ${PLUS} first revision"
2727 dotest_fail death2-diff-11 "${testcvs} -q diff -rtag -c ." \
2729 ===================================================================
2730 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
2731 retrieving revision 1\.1
2732 retrieving revision 1\.1\.2\.2
2733 diff -c -r1\.1 -r1\.1\.2\.2
2734 \*\*\* file1[ ][ ]*[a-zA-Z0-9:./ ]*
2735 --- file1[ ][ ]*[a-zA-Z0-9:./ ]*
2736 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2741 ${PROG} [a-z]*: tag tag is not in file file2
2742 ${PROG} [a-z]*: tag tag is not in file file3"
2744 dotest_fail death2-diff-12 "${testcvs} -q diff -rtag -c -N ." \
2746 ===================================================================
2747 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
2748 retrieving revision 1\.1
2749 retrieving revision 1\.1\.2\.2
2750 diff -c -r1\.1 -r1\.1\.2\.2
2751 \*\*\* file1[ ][ ]*[a-zA-Z0-9:./ ]*
2752 --- file1[ ][ ]*[a-zA-Z0-9:./ ]*
2753 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2759 ===================================================================
2762 \*\*\* /dev/null[ ][ ]*[a-zA-Z0-9: ]*
2763 --- ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
2764 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2767 ${PLUS} branch revision
2769 ===================================================================
2772 \*\*\* /dev/null[ ][ ]*[a-zA-Z0-9: ]*
2773 --- ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
2774 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2777 ${PLUS} first revision"
2779 # Switch to the nonbranch tag.
2780 dotest death2-19 "${testcvs} -q update -r tag" \
2782 ${PROG} [a-z]*: file2 is no longer in the repository
2783 ${PROG} [a-z]*: file3 is no longer in the repository" \
2785 ${PROG} [a-z]*: file2 is no longer in the repository
2786 ${PROG} [a-z]*: file3 is no longer in the repository"
2788 dotest_fail death2-20 "test -f file2"
2790 # Make sure diff only reports appropriate files.
2791 dotest_fail death2-diff-13 "${testcvs} -q diff -r rdiff-tag" \
2792 "${PROG} [a-z]*: file1 is a new entry, no comparison available"
2794 dotest_fail death2-diff-14 "${testcvs} -q diff -r rdiff-tag -c -N" \
2796 ===================================================================
2799 \*\*\* /dev/null[ ][ ]*[a-zA-Z0-9: ]*
2800 --- ${tempname}[ ][ ]*[a-zA-Z0-9: ]*
2801 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2804 ${PLUS} first revision"
2806 cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
2810 # More branch tests, including branches off of branches
2811 mkdir ${CVSROOT_DIRNAME}/first-dir
2812 dotest branches-1 "${testcvs} -q co first-dir" ''
2814 echo 1:ancest >file1
2815 echo 2:ancest >file2
2816 echo 3:ancest >file3
2817 echo 4:trunk-1 >file4
2818 dotest branches-2 "${testcvs} add file1 file2 file3 file4" \
2819 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
2820 '"${PROG}"' [a-z]*: scheduling file `file2'\'' for addition
2821 '"${PROG}"' [a-z]*: scheduling file `file3'\'' for addition
2822 '"${PROG}"' [a-z]*: scheduling file `file4'\'' for addition
2823 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add these files permanently'
2824 dotest branches-2a "${testcvs} -n -q ci -m dont-commit" ""
2825 dotest_lit branches-3 "${testcvs} -q ci -m add-it" <<HERE
2826 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
2829 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
2830 initial revision: 1.1
2832 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
2835 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
2836 initial revision: 1.1
2838 RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
2841 ${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
2842 initial revision: 1.1
2844 RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
2847 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
2848 initial revision: 1.1
2851 echo 4:trunk-2 >file4
2852 dotest branches-3.2 "${testcvs} -q ci -m trunk-before-branch" \
2854 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
2855 new revision: 1\.2; previous revision: 1\.1
2857 # The "cvs log file4" in test branches-14.3 will test that we
2858 # didn't really add the tag.
2859 dotest branches-3.3 "${testcvs} -qn tag dont-tag" \
2864 dotest branches-4 "${testcvs} tag -b br1" "${PROG}"' [a-z]*: Tagging \.
2869 dotest branches-5 "${testcvs} update -r br1" \
2870 "${PROG}"' [a-z]*: Updating \.'
2874 dotest branches-6 "${testcvs} -q ci -m modify" \
2876 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
2877 new revision: 1\.1\.2\.1; previous revision: 1\.1
2880 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
2881 new revision: 1\.1\.2\.1; previous revision: 1\.1
2884 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
2885 new revision: 1\.2\.2\.1; previous revision: 1\.2
2887 dotest branches-7 "${testcvs} -q tag -b brbr" 'T file1
2891 dotest branches-8 "${testcvs} -q update -r brbr" ''
2894 dotest branches-9 "${testcvs} -q ci -m modify" \
2896 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
2897 new revision: 1\.1\.2\.1\.2\.1; previous revision: 1\.1\.2\.1
2900 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
2901 new revision: 1\.2\.2\.1\.2\.1; previous revision: 1\.2\.2\.1
2903 dotest branches-10 "cat file1 file2 file3 file4" '1:brbr
2907 dotest branches-11 "${testcvs} -q update -r br1" \
2910 dotest branches-12 "cat file1 file2 file3 file4" '1:br1
2915 dotest branches-12.2 "${testcvs} -q ci -m change-on-br1" \
2917 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
2918 new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
2920 dotest branches-13 "${testcvs} -q update -A" '[UP] file1
2923 dotest branches-14 "cat file1 file2 file3 file4" '1:ancest
2927 echo 4:trunk-3 >file4
2928 dotest branches-14.2 \
2929 "${testcvs} -q ci -m trunk-change-after-branch" \
2931 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
2932 new revision: 1\.3; previous revision: 1\.2
2934 dotest branches-14.3 "${testcvs} log file4" \
2936 RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
2943 brbr: 1\.2\.2\.1\.0\.2
2945 keyword substitution: kv
2946 total revisions: 6; selected revisions: 6
2948 ----------------------------
2950 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
2951 trunk-change-after-branch
2952 ----------------------------
2954 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
2957 ----------------------------
2959 date: [0-9/: ]*; author: ${username}; state: Exp;
2961 ----------------------------
2963 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
2965 ----------------------------
2967 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
2968 branches: 1\.2\.2\.1\.2;
2970 ----------------------------
2971 revision 1\.2\.2\.1\.2\.1
2972 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
2974 ============================================================================="
2975 dotest_status branches-14.4 1 \
2976 "${testcvs} diff -c -r 1.1 -r 1.3 file4" \
2978 ===================================================================
2979 RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
2980 retrieving revision 1\.1
2981 retrieving revision 1\.3
2982 diff -c -r1\.1 -r1\.3
2983 \*\*\* file4 [0-9/]* [0-9:]* 1\.1
2984 --- file4 [0-9/]* [0-9:]* 1\.3
2985 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2990 dotest_status branches-14.5 1 \
2991 "${testcvs} diff -c -r 1.1 -r 1.2.2.1 file4" \
2993 ===================================================================
2994 RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
2995 retrieving revision 1\.1
2996 retrieving revision 1\.2\.2\.1
2997 diff -c -r1\.1 -r1\.2\.2\.1
2998 \*\*\* file4 [0-9/]* [0-9:]* 1\.1
2999 --- file4 [0-9/]* [0-9:]* 1\.2\.2\.1
3000 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3005 dotest branches-15 \
3006 "${testcvs} update -j 1.1.2.1 -j 1.1.2.1.2.1 file1" \
3007 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
3008 retrieving revision 1\.1\.2\.1
3009 retrieving revision 1\.1\.2\.1\.2\.1
3010 Merging differences between 1\.1\.2\.1 and 1\.1\.2\.1\.2\.1 into file1
3011 rcsmerge: warning: conflicts during merge"
3012 dotest branches-16 "cat file1" '<<<<<<< file1
3016 [>]>>>>>> 1\.1\.2\.1\.2\.1'
3018 dotest branches-o1 "${testcvs} -q admin -o ::brbr" \
3019 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
3021 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
3023 RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
3025 RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
3029 if test "$keep" = yes; then
3030 echo Keeping ${TESTDIR} and exiting due to --keep
3034 rm -rf ${CVSROOT_DIRNAME}/first-dir
3039 # Test librarification of RCS.
3040 # First: test whether `cvs diff' handles $Name expansion
3041 # correctly. We diff two revisions with their symbolic tags;
3042 # neither tag should be expanded in the output. Also diff
3043 # one revision with the working copy.
3045 mkdir ${CVSROOT_DIRNAME}/first-dir
3046 dotest rcsdiff-1 "${testcvs} -q co first-dir" ''
3048 echo "I am the first foo, and my name is $""Name$." > foo.c
3049 dotest rcsdiff-2 "${testcvs} add -m new-file foo.c" \
3050 "${PROG} [a-z]*: scheduling file .foo\.c. for addition
3051 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
3052 dotest rcsdiff-3 "${testcvs} commit -m rev1 foo.c" \
3053 "RCS file: ${TESTDIR}/cvsroot/first-dir/foo\.c,v
3056 ${TESTDIR}/cvsroot/first-dir/foo.c,v <-- foo\.c
3057 initial revision: 1\.1
3059 dotest rcsdiff-4 "${testcvs} tag first foo.c" "T foo\.c"
3060 dotest rcsdiff-5 "${testcvs} update -p -r first foo.c" \
3061 "===================================================================
3063 RCS: ${TESTDIR}/cvsroot/first-dir/foo\.c,v
3065 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3066 I am the first foo, and my name is \$""Name: first \$\."
3068 echo "I am the second foo, and my name is $""Name$." > foo.c
3069 dotest rcsdiff-6 "${testcvs} commit -m rev2 foo.c" \
3070 "Checking in foo\.c;
3071 ${TESTDIR}/cvsroot/first-dir/foo\.c,v <-- foo\.c
3072 new revision: 1\.2; previous revision: 1\.1
3074 dotest rcsdiff-7 "${testcvs} tag second foo.c" "T foo\.c"
3075 dotest rcsdiff-8 "${testcvs} update -p -r second foo.c" \
3076 "===================================================================
3078 RCS: ${TESTDIR}/cvsroot/first-dir/foo\.c,v
3080 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3081 I am the second foo, and my name is \$""Name: second \$\."
3083 dotest_fail rcsdiff-9 "${testcvs} diff -r first -r second" \
3084 "${PROG} [a-z]*: Diffing \.
3086 ===================================================================
3087 RCS file: ${TESTDIR}/cvsroot/first-dir/foo\.c,v
3088 retrieving revision 1\.1
3089 retrieving revision 1\.2
3092 < I am the first foo, and my name is \$""Name: \$\.
3094 > I am the second foo, and my name is \$""Name: \$\."
3096 echo "I am the once and future foo, and my name is $""Name$." > foo.c
3097 dotest_fail rcsdiff-10 "${testcvs} diff -r first" \
3098 "${PROG} [a-z]*: Diffing \.
3100 ===================================================================
3101 RCS file: ${TESTDIR}/cvsroot/first-dir/foo\.c,v
3102 retrieving revision 1\.1
3105 < I am the first foo, and my name is \$""Name: \$\.
3107 > I am the once and future foo, and my name is \$""Name\$\."
3109 # Test handling of libdiff options. diff gets quite enough
3110 # of a workout elsewhere in sanity.sh, so we assume that it's
3111 # mostly working properly if it passes all the other tests.
3112 # The main one we want to try is regex handling, since we are
3113 # using CVS's regex matcher and not diff's.
3116 test_regex (whiz, bang)
3125 dotest rcslib-diffrgx-1 "${testcvs} -q add -m '' rgx.c" \
3126 "${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
3127 dotest rcslib-diffrgx-2 "${testcvs} -q ci -m '' rgx.c" \
3128 "RCS file: ${TESTDIR}/cvsroot/first-dir/rgx\.c,v
3131 ${TESTDIR}/cvsroot/first-dir/rgx\.c,v <-- rgx\.c
3132 initial revision: 1\.1
3135 test_regex (whiz, bang)
3143 # Use dotest_fail because exit status from `cvs diff' must be 1.
3144 dotest_fail rcslib-diffrgx-3 "${testcvs} diff -c -F.*( rgx.c" \
3146 ===================================================================
3147 RCS file: ${TESTDIR}/cvsroot/first-dir/rgx\.c,v
3148 retrieving revision 1\.1
3149 diff -c -F\.\*( -r1\.1 rgx\.c
3150 \*\*\* rgx\.c [0-9/]* [0-9:]* 1\.1
3151 --- rgx\.c [0-9/]* [0-9:]*
3152 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* test_regex (whiz, bang)
3166 # Tests of rcsmerge/diff3. Merge operations get a good general
3167 # workout elsewhere; we want to make sure that options are still
3168 # handled properly. Try merging two branches with -kv, to test
3169 # both -j and -k switches.
3173 rm -rf ${CVSROOT_DIRNAME}/first-dir
3177 dotest rcslib-merge-1 "${testcvs} -q co -l ." ""
3179 dotest rcslib-merge-2 "${testcvs} -q add first-dir" \
3180 "Directory ${TESTDIR}/cvsroot.*/first-dir added to the repository"
3183 dotest rcslib-merge-3 "${testcvs} -q co first-dir" ""
3186 echo '$''Revision$' > file1
3189 dotest rcslib-merge-4 "${testcvs} -q add file1" \
3190 "${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
3191 dotest rcslib-merge-5 "${testcvs} -q commit -m '' file1" \
3192 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
3195 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
3196 initial revision: 1\.1
3198 sed -e 's/2/two/' file1 > f; mv f file1
3199 dotest rcslib-merge-6 "${testcvs} -q commit -m '' file1" \
3201 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
3202 new revision: 1\.2; previous revision: 1\.1
3204 dotest rcslib-merge-7 "${testcvs} -q tag -b -r 1.1 patch1" "T file1"
3205 dotest rcslib-merge-8 "${testcvs} -q update -r patch1" "[UP] file1"
3206 dotest rcslib-merge-9 "${testcvs} -q status" \
3207 "===================================================================
3208 File: file1 Status: Up-to-date
3210 Working revision: 1\.1.*
3211 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
3212 Sticky Tag: patch1 (branch: 1\.1\.2)
3214 Sticky Options: (none)"
3215 dotest rcslib-merge-10 "cat file1" \
3216 '$''Revision: 1\.1 $
3219 sed -e 's/3/three/' file1 > f; mv f file1
3220 dotest rcslib-merge-11 "${testcvs} -q commit -m '' file1" \
3222 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
3223 new revision: 1\.1\.2\.1; previous revision: 1\.1
3225 dotest rcslib-merge-12 "${testcvs} -q update -kv -j1.2" \
3227 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
3228 retrieving revision 1\.1
3229 retrieving revision 1\.2
3230 Merging differences between 1\.1 and 1\.2 into file1
3231 rcsmerge: warning: conflicts during merge"
3232 dotest rcslib-merge-13 "cat file1" \
3245 if test "$keep" = yes; then
3246 echo Keeping ${TESTDIR} and exiting due to --keep
3250 rm -rf ${CVSROOT_DIRNAME}/first-dir
3255 # Test the ability to have several branchpoints coming off the
3257 mkdir ${CVSROOT_DIRNAME}/first-dir
3258 dotest multibranch-1 "${testcvs} -q co first-dir" ''
3260 echo 1:trunk-1 >file1
3261 dotest multibranch-2 "${testcvs} add file1" \
3262 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
3263 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
3264 dotest_lit multibranch-3 "${testcvs} -q ci -m add-it" <<HERE
3265 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
3268 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
3269 initial revision: 1.1
3272 dotest multibranch-4 "${testcvs} tag -b br1" \
3273 "${PROG} [a-z]*: Tagging \.
3275 dotest multibranch-5 "${testcvs} tag -b br2" \
3276 "${PROG} [a-z]*: Tagging \.
3278 dotest multibranch-6 "${testcvs} -q update -r br1" ''
3280 dotest multibranch-7 "${testcvs} -q ci -m modify-on-br1" \
3282 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
3283 new revision: 1\.1\.2\.1; previous revision: 1\.1
3285 dotest multibranch-8 "${testcvs} -q update -r br2" '[UP] file1'
3286 echo br2 adds a line >>file1
3287 dotest multibranch-9 "${testcvs} -q ci -m modify-on-br2" \
3289 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
3290 new revision: 1\.1\.4\.1; previous revision: 1\.1
3292 dotest multibranch-10 "${testcvs} -q update -r br1" '[UP] file1'
3293 dotest multibranch-11 "cat file1" 'on-br1'
3294 dotest multibranch-12 "${testcvs} -q update -r br2" '[UP] file1'
3295 dotest multibranch-13 "cat file1" '1:trunk-1
3298 dotest multibranch-14 "${testcvs} log file1" \
3300 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
3309 keyword substitution: kv
3310 total revisions: 3; selected revisions: 3
3312 ----------------------------
3314 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3315 branches: 1\.1\.2; 1\.1\.4;
3317 ----------------------------
3319 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
3321 ----------------------------
3323 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
3325 ============================================================================="
3328 if test "$keep" = yes; then
3329 echo Keeping ${TESTDIR} and exiting due to --keep
3333 rm -rf ${CVSROOT_DIRNAME}/first-dir
3337 import) # test death after import
3338 # Tests of "cvs import":
3340 # rdiff -- imports with keywords
3341 # import -- more tests of imports with keywords
3342 # importb -- -b option.
3344 # mflag -- various -m messages
3345 # ignore -- import and cvsignore
3346 # binwrap -- import and -k wrappers
3347 # info -- imports which are rejected by verifymsg
3348 # head -- intended to test vendor branches and HEAD,
3349 # although it doesn't really do it yet.
3352 mkdir import-dir ; cd import-dir
3354 for i in 1 2 3 4 ; do
3355 echo imported file"$i" > imported-f"$i"
3358 # This directory should be on the default ignore list,
3359 # so it shouldn't get imported.
3361 echo ignore.me >RCS/ignore.me
3363 echo 'import should not expand $''Id$' >>imported-f2
3364 cp imported-f2 ../imported-f2-orig.tmp
3366 if ${CVS} import -m first-import first-dir vendor-branch junk-1_0 ; then
3372 if cmp ../imported-f2-orig.tmp imported-f2; then
3380 if ${CVS} co first-dir ; then
3387 for i in 1 2 3 4 ; do
3388 if test -f imported-f"$i" ; then
3394 if test -d RCS; then
3402 if ${CVS} rm imported-f1 2>> ${LOGFILE}; then
3409 echo local-change >> imported-f2
3412 if ${CVS} ci -m local-changes >> ${LOGFILE} 2>&1; then
3419 if ${CVS} log imported-f1 | grep '1.1.1.2 (dead)' ; then
3425 # update into the vendor branch.
3426 if ${CVS} update -rvendor-branch ; then
3432 # remove file4 on the vendor branch
3435 if ${CVS} rm imported-f4 2>> ${LOGFILE}; then
3442 if ${CVS} ci -m vendor-removed imported-f4 >>${LOGFILE}; then
3448 # update to main line
3449 if ${CVS} update -A 2>> ${LOGFILE}; then
3455 # second import - file4 deliberately unchanged
3458 echo rev 2 of file $i >> imported-f"$i"
3460 cp imported-f2 ../imported-f2-orig.tmp
3462 if ${CVS} import -m second-import first-dir vendor-branch junk-2_0 ; then
3467 if cmp ../imported-f2-orig.tmp imported-f2; then
3475 if ${CVS} co first-dir ; then
3483 if test -f imported-f1 ; then
3490 if test -f imported-f"$i" ; then
3497 # check vendor branch for file4
3498 if ${CVS} update -rvendor-branch ; then
3504 if test -f imported-f4 ; then
3510 # update to main line
3511 if ${CVS} update -A 2>> ${LOGFILE}; then
3520 "${testcvs} -q co -jjunk-1_0 -jjunk-2_0 first-dir" \
3521 "${PROG} [a-z]*: file first-dir/imported-f1 is present in revision junk-2_0
3522 RCS file: ${TESTDIR}/cvsroot/first-dir/imported-f2,v
3523 retrieving revision 1\.1\.1\.1
3524 retrieving revision 1\.1\.1\.2
3525 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into imported-f2
3526 rcsmerge: warning: conflicts during merge"
3530 if test -f imported-f1 ; then
3537 if test -f imported-f"$i" ; then
3544 dotest import-116 'cat imported-f2' \
3546 [<]<<<<<< imported-f2
3547 import should not expand \$''Id: imported-f2,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
3550 import should not expand \$''Id: imported-f2,v 1\.1\.1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
3552 [>]>>>>>> 1\.1\.1\.2'
3556 rm -rf ${CVSROOT_DIRNAME}/first-dir
3561 # More cvs import tests, especially -b option.
3563 # OK, first we get some sources from the NetMunger project, and
3564 # import them into the 1.1.1 vendor branch.
3567 echo 'OpenMunger sources' >file1
3568 echo 'OpenMunger sources' >file2
3570 "${testcvs} import -m add first-dir openmunger openmunger-1_0" \
3574 No conflicts created by this import"
3578 # Now we put the sources we get from FreeMunger into 1.1.3
3581 echo 'FreeMunger sources' >file1
3582 echo 'FreeMunger sources' >file2
3583 # Not completely sure how the conflict detection is supposed to
3584 # be working here (haven't really thought about it).
3586 "${testcvs} import -m add -b 1.1.3 first-dir freemunger freemunger-1_0" \
3590 2 conflicts created by this import.
3591 Use the following command to help the merge:
3593 ${PROG} checkout -jfreemunger:yesterday -jfreemunger first-dir"
3597 # Now a test of main branch import (into second-dir, not first-dir).
3600 echo 'my own stuff' >mine1.c
3601 echo 'my own stuff' >mine2.c
3602 dotest_fail importb-3 \
3603 "${testcvs} import -m add -b 1 second-dir dummy really_dumb_y" \
3604 "${PROG} \[[a-z]* aborted\]: Only branches with two dots are supported: 1"
3605 : when we implement main-branch import, should be \
3606 "N second-dir/mine1\.c
3607 N second-dir/mine2\.c
3609 No conflicts created by this import"
3615 # when we implement main branch import, will want to
3616 # add "second-dir" here.
3617 dotest importb-4 "${testcvs} -q co first-dir" \
3621 dotest importb-5 "${testcvs} -q log file1" "
3622 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
3629 freemunger-1_0: 1\.1\.3\.1
3631 openmunger-1_0: 1\.1\.1\.1
3633 keyword substitution: kv
3634 total revisions: 3; selected revisions: 3
3636 ----------------------------
3638 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3639 branches: 1\.1\.1; 1\.1\.3;
3641 ----------------------------
3643 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
3645 ----------------------------
3647 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
3649 ============================================================================="
3653 rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
3657 # Test doing joins which involve adding and removing files.
3658 # Variety of scenarios (see list below), in the context of:
3659 # * merge changes from T1 to T2 into the main line
3660 # * merge changes from branch 'branch' into the main line
3661 # * merge changes from branch 'branch' into branch 'br2'.
3662 # See also binfile2, which does similar things with binary files.
3663 # See also join2, which tests joining (and update -A) on only
3664 # a single file, rather than a directory.
3665 # See also join3, which tests some cases involving the greatest
3666 # common ancestor. Here is a list of tests according to branch
3669 # --->bp---->trunk too many to mention
3673 # --->bp---->trunk multibranch
3676 # --->bp1----->bp2---->trunk join3
3679 # --->bp1----->trunk
3680 # \----bp2---->branch branches
3681 # \------>branch-of-branch
3683 # We check merging changes from T1 to T2 into the main line.
3684 # Here are the interesting cases I can think of:
3685 # 1) File added between T1 and T2, not on main line.
3686 # File should be marked for addition.
3687 # 2) File added between T1 and T2, also added on main line.
3689 # 3) File removed between T1 and T2, unchanged on main line.
3690 # File should be marked for removal.
3691 # 4) File removed between T1 and T2, modified on main line.
3692 # If mod checked in, file should be marked for removal.
3693 # If mod still in working directory, conflict.
3694 # 5) File removed between T1 and T2, was never on main line.
3695 # Nothing should happen.
3696 # 6) File removed between T1 and T2, also removed on main line.
3697 # Nothing should happen.
3698 # 7) File added on main line, not added between T1 and T2.
3699 # Nothing should happen.
3700 # 8) File removed on main line, not modified between T1 and T2.
3701 # Nothing should happen.
3703 # We also check merging changes from a branch into the main
3704 # line. Here are the interesting cases:
3705 # 1) File added on branch, not on main line.
3706 # File should be marked for addition.
3707 # 2) File added on branch, also added on main line.
3709 # 3) File removed on branch, unchanged on main line.
3710 # File should be marked for removal.
3711 # 4) File removed on branch, modified on main line.
3713 # 5) File removed on branch, was never on main line.
3714 # Nothing should happen.
3715 # 6) File removed on branch, also removed on main line.
3716 # Nothing should happen.
3717 # 7) File added on main line, not added on branch.
3718 # Nothing should happen.
3719 # 8) File removed on main line, not modified on branch.
3720 # Nothing should happen.
3722 # In the tests below, fileN represents case N in the above
3725 mkdir ${CVSROOT_DIRNAME}/first-dir
3728 dotest join-1 "${testcvs} -q co first-dir" ''
3733 echo 'first revision of file3' > file3
3734 echo 'first revision of file4' > file4
3735 echo 'first revision of file6' > file6
3736 echo 'first revision of file8' > file8
3737 dotest join-2 "${testcvs} add file3 file4 file6 file8" \
3738 "${PROG}"' [a-z]*: scheduling file `file3'\'' for addition
3739 '"${PROG}"' [a-z]*: scheduling file `file4'\'' for addition
3740 '"${PROG}"' [a-z]*: scheduling file `file6'\'' for addition
3741 '"${PROG}"' [a-z]*: scheduling file `file8'\'' for addition
3742 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add these files permanently'
3744 dotest join-3 "${testcvs} -q commit -m add" \
3745 "RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
3748 ${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
3749 initial revision: 1\.1
3751 RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
3754 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
3755 initial revision: 1\.1
3757 RCS file: ${TESTDIR}/cvsroot/first-dir/file6,v
3760 ${TESTDIR}/cvsroot/first-dir/file6,v <-- file6
3761 initial revision: 1\.1
3763 RCS file: ${TESTDIR}/cvsroot/first-dir/file8,v
3766 ${TESTDIR}/cvsroot/first-dir/file8,v <-- file8
3767 initial revision: 1\.1
3771 dotest join-4 "${testcvs} -q tag -b branch ." \
3777 # Add file2 and file7, modify file4, and remove file6 and file8.
3778 echo 'first revision of file2' > file2
3779 echo 'second revision of file4' > file4
3780 echo 'first revision of file7' > file7
3782 dotest join-5 "${testcvs} add file2 file7" \
3783 "${PROG}"' [a-z]*: scheduling file `file2'\'' for addition
3784 '"${PROG}"' [a-z]*: scheduling file `file7'\'' for addition
3785 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add these files permanently'
3786 dotest join-6 "${testcvs} rm file6 file8" \
3787 "${PROG}"' [a-z]*: scheduling `file6'\'' for removal
3788 '"${PROG}"' [a-z]*: scheduling `file8'\'' for removal
3789 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to remove these files permanently'
3790 dotest join-7 "${testcvs} -q ci -mx ." \
3791 "RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
3794 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
3795 initial revision: 1\.1
3798 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
3799 new revision: 1\.2; previous revision: 1\.1
3802 ${TESTDIR}/cvsroot/first-dir/file6,v <-- file6
3803 new revision: delete; previous revision: 1\.1
3805 RCS file: ${TESTDIR}/cvsroot/first-dir/file7,v
3808 ${TESTDIR}/cvsroot/first-dir/file7,v <-- file7
3809 initial revision: 1\.1
3812 ${TESTDIR}/cvsroot/first-dir/file8,v <-- file8
3813 new revision: delete; previous revision: 1\.1
3816 # Check out the branch.
3820 dotest join-8 "${testcvs} -q co -r branch first-dir" \
3828 # Modify the files on the branch, so that T1 is not an
3829 # ancestor of the main line, and add file5
3830 echo 'first branch revision of file3' > file3
3831 echo 'first branch revision of file4' > file4
3832 echo 'first branch revision of file6' > file6
3833 echo 'first branch revision of file5' > file5
3834 dotest join-9 "${testcvs} add file5" \
3835 "${PROG}"' [a-z]*: scheduling file `file5'\'' for addition on branch `branch'\''
3836 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
3837 dotest join-10 "${testcvs} -q ci -mx ." \
3839 ${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
3840 new revision: 1\.1\.2\.1; previous revision: 1\.1
3843 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
3844 new revision: 1\.1\.2\.1; previous revision: 1\.1
3846 RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file5,v
3849 ${TESTDIR}/cvsroot/first-dir/Attic/file5,v <-- file5
3850 new revision: 1\.1\.2\.1; previous revision: 1\.1
3853 ${TESTDIR}/cvsroot/first-dir/Attic/file6,v <-- file6
3854 new revision: 1\.1\.2\.1; previous revision: 1\.1
3857 # Tag the current revisions on the branch.
3858 dotest join-11 "${testcvs} -q tag T1 ." \
3865 # Add file1 and file2, and remove the other files.
3866 echo 'first branch revision of file1' > file1
3867 echo 'first branch revision of file2' > file2
3868 rm file3 file4 file5 file6
3869 dotest join-12 "${testcvs} add file1 file2" \
3870 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition on branch `branch'\''
3871 '"${PROG}"' [a-z]*: scheduling file `file2'\'' for addition on branch `branch'\''
3872 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add these files permanently'
3873 dotest join-13 "${testcvs} rm file3 file4 file5 file6" \
3874 "${PROG}"' [a-z]*: scheduling `file3'\'' for removal
3875 '"${PROG}"' [a-z]*: scheduling `file4'\'' for removal
3876 '"${PROG}"' [a-z]*: scheduling `file5'\'' for removal
3877 '"${PROG}"' [a-z]*: scheduling `file6'\'' for removal
3878 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to remove these files permanently'
3879 dotest join-14 "${testcvs} -q ci -mx ." \
3880 "RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file1,v
3883 ${TESTDIR}/cvsroot/first-dir/Attic/file1,v <-- file1
3884 new revision: 1\.1\.2\.1; previous revision: 1\.1
3887 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
3888 new revision: 1\.1\.2\.1; previous revision: 1\.1
3891 ${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
3892 new revision: delete; previous revision: 1\.1\.2\.1
3895 ${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
3896 new revision: delete; previous revision: 1\.1\.2\.1
3899 ${TESTDIR}/cvsroot/first-dir/Attic/file5,v <-- file5
3900 new revision: delete; previous revision: 1\.1\.2\.1
3903 ${TESTDIR}/cvsroot/first-dir/Attic/file6,v <-- file6
3904 new revision: delete; previous revision: 1\.1\.2\.1
3907 # Tag the current revisions on the branch.
3908 dotest join-15 "${testcvs} -q tag T2 ." \
3913 # Do a checkout with a merge.
3917 dotest join-16 "${testcvs} -q co -jT1 -jT2 first-dir" \
3920 '"${PROG}"' [a-z]*: file first-dir/file2 exists, but has been added in revision T2
3922 '"${PROG}"' [a-z]*: scheduling first-dir/file3 for removal
3924 '"${PROG}"' [a-z]*: scheduling first-dir/file4 for removal
3927 # Verify that the right changes have been scheduled.
3929 dotest join-17 "${testcvs} -q update" \
3934 # Modify file4 locally, and do an update with a merge.
3935 cd ../../1/first-dir
3936 echo 'third revision of file4' > file4
3937 dotest join-18 "${testcvs} -q update -jT1 -jT2 ." \
3939 '"${PROG}"' [a-z]*: file file2 exists, but has been added in revision T2
3940 '"${PROG}"' [a-z]*: scheduling file3 for removal
3942 '"${PROG}"' [a-z]*: file file4 is locally modified, but has been removed in revision T2'
3944 # Verify that the right changes have been scheduled.
3945 dotest join-19 "${testcvs} -q update" \
3950 # Do a checkout with a merge from a single revision.
3952 # FIXME: CVS currently gets this wrong. file2 has been
3953 # added on both the branch and the main line, and so should
3954 # be regarded as a conflict. However, given the way that
3955 # CVS sets up the RCS file, there is no way to distinguish
3956 # this case from the case of file2 having existed before the
3957 # branch was made. This could be fixed by reserving
3958 # a revision somewhere, perhaps 1.1, as an always dead
3959 # revision which can be used as the source for files added
3963 dotest join-20 "${testcvs} -q co -jbranch first-dir" \
3966 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
3967 retrieving revision 1\.1
3968 retrieving revision 1\.1\.2\.1
3969 Merging differences between 1\.1 and 1\.1\.2\.1 into file2
3971 ${PROG} [a-z]*: scheduling first-dir/file3 for removal
3973 ${PROG} [a-z]*: file first-dir/file4 has been modified, but has been removed in revision branch
3976 # Verify that the right changes have been scheduled.
3977 # The M file2 line is a bug; see above join-20.
3979 dotest join-21 "${testcvs} -q update" \
3984 # Checkout the main line again.
3987 dotest join-22 "${testcvs} -q co first-dir" \
3993 # Modify file4 locally, and do an update with a merge from a
3995 # The file2 handling is a bug; see above join-20.
3997 echo 'third revision of file4' > file4
3998 dotest join-23 "${testcvs} -q update -jbranch ." \
4000 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
4001 retrieving revision 1\.1
4002 retrieving revision 1\.1\.2\.1
4003 Merging differences between 1\.1 and 1\.1\.2\.1 into file2
4004 ${PROG} [a-z]*: scheduling file3 for removal
4006 ${PROG} [a-z]*: file file4 is locally modified, but has been removed in revision branch"
4008 # Verify that the right changes have been scheduled.
4009 # The M file2 line is a bug; see above join-20
4010 dotest join-24 "${testcvs} -q update" \
4018 # Checkout the main line again and make a new branch which we
4021 dotest join-25 "${testcvs} -q co first-dir" \
4027 dotest join-26 "${testcvs} -q tag -b br2" \
4032 dotest join-27 "${testcvs} -q update -r br2" ""
4033 # The handling of file8 here looks fishy to me. I don't see
4034 # why it should be different from the case where we merge to
4035 # the trunk (e.g. join-23).
4036 dotest join-28 "${testcvs} -q update -j branch" \
4038 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
4039 retrieving revision 1.1
4040 retrieving revision 1.1.2.1
4041 Merging differences between 1.1 and 1.1.2.1 into file2
4042 ${PROG} [a-z]*: scheduling file3 for removal
4043 ${PROG} [a-z]*: file file4 has been modified, but has been removed in revision branch
4045 # Verify that the right changes have been scheduled.
4046 dotest join-29 "${testcvs} -q update" \
4055 rm -rf ${CVSROOT_DIRNAME}/first-dir
4059 # More joining tests.
4061 # First the usual setup; create a directory first-dir, a file
4062 # first-dir/file1, and a branch br1.
4064 dotest join2-1 "${testcvs} -q co -l ." ''
4066 dotest join2-2 "${testcvs} add first-dir" \
4067 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
4069 echo 'initial contents of file1' >file1
4070 dotest join2-3 "${testcvs} add file1" \
4071 "${PROG} [a-z]*: scheduling file .file1. for addition
4072 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
4073 dotest join2-4 "${testcvs} -q ci -m add" \
4074 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
4077 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
4078 initial revision: 1\.1
4080 dotest join2-5 "${testcvs} -q tag -b br1" "T file1"
4081 dotest join2-6 "${testcvs} -q update -r br1" ""
4082 echo 'modify on branch' >>file1
4084 dotest join2-6a "${testcvs} add bradd" \
4085 "${PROG} [a-z]*: scheduling file .bradd. for addition on branch .br1.
4086 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
4087 dotest join2-7 "${testcvs} -q ci -m modify" \
4088 "RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/bradd,v
4091 ${TESTDIR}/cvsroot/first-dir/Attic/bradd,v <-- bradd
4092 new revision: 1\.1\.2\.1; previous revision: 1\.1
4095 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
4096 new revision: 1\.1\.2\.1; previous revision: 1\.1
4099 # Here is the unusual/pathological part. We switch back to
4100 # the trunk *for file1 only*, not for the whole directory.
4101 dotest join2-8 "${testcvs} -q update -A file1" '[UP] file1'
4102 dotest join2-9 "${testcvs} -q status file1" \
4103 "===================================================================
4104 File: file1 Status: Up-to-date
4106 Working revision: 1\.1.*
4107 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
4110 Sticky Options: (none)"
4111 dotest join2-10 "cat CVS/Tag" "Tbr1"
4113 dotest join2-11 "${testcvs} -q update -j br1 file1" \
4114 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
4115 retrieving revision 1\.1
4116 retrieving revision 1\.1\.2\.1
4117 Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
4118 dotest join2-12 "cat file1" "initial contents of file1
4120 # We should have no sticky tag on file1
4121 dotest join2-13 "${testcvs} -q status file1" \
4122 "===================================================================
4123 File: file1 Status: Locally Modified
4125 Working revision: 1\.1.*
4126 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file1,v
4129 Sticky Options: (none)"
4130 dotest join2-14 "cat CVS/Tag" "Tbr1"
4131 # And the checkin should go to the trunk
4132 dotest join2-15 "${testcvs} -q ci -m modify file1" \
4134 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
4135 new revision: 1\.2; previous revision: 1\.1
4138 # OK, the above is all well and good and has worked for some
4139 # time. Now try the case where the file had been added on
4141 dotest join2-16 "${testcvs} -q update -r br1" "[UP] file1"
4142 # The workaround is to update the whole directory.
4143 # The non-circumvented version won't work. The reason is that
4144 # update removes the entry from CVS/Entries, so of course we get
4145 # the tag from CVS/Tag and not Entries. I suppose maybe
4146 # we could invent some new format in Entries which would handle
4147 # this, but doing so, and handling it properly throughout
4148 # CVS, would be a lot of work and I'm not sure this case justifies
4150 dotest join2-17-circumvent "${testcvs} -q update -A" \
4151 "${PROG} [a-z]*: warning: bradd is not (any longer) pertinent
4153 : dotest join2-17 "${testcvs} -q update -A bradd" \
4154 "${PROG} [a-z]*: warning: bradd is not (any longer) pertinent"
4155 dotest join2-18 "${testcvs} -q update -j br1 bradd" "U bradd"
4156 dotest join2-19 "${testcvs} -q status bradd" \
4157 "===================================================================
4158 File: bradd Status: Locally Added
4160 Working revision: New file!
4161 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/Attic/bradd,v
4164 Sticky Options: (none)"
4165 dotest join2-20 "${testcvs} -q ci -m modify bradd" \
4167 ${TESTDIR}/cvsroot/first-dir/bradd,v <-- bradd
4168 new revision: 1\.2; previous revision: 1\.1
4173 rm -rf ${CVSROOT_DIRNAME}/first-dir
4177 # See "join" for a list of other joining/branching tests.
4178 # First the usual setup; create a directory first-dir, a file
4179 # first-dir/file1, and a branch br1.
4181 dotest join3-1 "${testcvs} -q co -l ." ''
4183 dotest join3-2 "${testcvs} add first-dir" \
4184 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
4186 echo 'initial contents of file1' >file1
4187 dotest join3-3 "${testcvs} add file1" \
4188 "${PROG} [a-z]*: scheduling file .file1. for addition
4189 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
4190 dotest join3-4 "${testcvs} -q ci -m add" \
4191 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
4194 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
4195 initial revision: 1\.1
4197 dotest join3-5 "${testcvs} -q tag -b br1" "T file1"
4198 dotest join3-6 "${testcvs} -q update -r br1" ""
4199 echo 'br1:line1' >>file1
4200 dotest join3-7 "${testcvs} -q ci -m modify" \
4202 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
4203 new revision: 1\.1\.2\.1; previous revision: 1\.1
4206 # Now back to the trunk for:
4207 # another revision and another branch for file1.
4208 # add file2, which will exist on trunk and br2 but not br1.
4209 dotest join3-8 "${testcvs} -q update -A" "[UP] file1"
4210 echo 'trunk:line1' > file2
4211 dotest join3-8a "${testcvs} add file2" \
4212 "${PROG} [a-z]*: scheduling file .file2. for addition
4213 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
4214 echo 'trunk:line1' >>file1
4215 dotest join3-9 "${testcvs} -q ci -m modify" \
4217 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
4218 new revision: 1\.2; previous revision: 1\.1
4220 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
4223 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
4224 initial revision: 1\.1
4226 dotest join3-10 "${testcvs} -q tag -b br2" "T file1
4229 # Before we actually have any revision on br2, let's try a join
4230 dotest join3-11 "${testcvs} -q update -r br1" "[UP] file1
4231 ${PROG} [a-z]*: file2 is no longer in the repository"
4232 dotest join3-12 "${testcvs} -q update -j br2" \
4233 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
4234 retrieving revision 1\.1
4235 retrieving revision 1\.2
4236 Merging differences between 1\.1 and 1\.2 into file1
4237 rcsmerge: warning: conflicts during merge
4239 dotest join3-13 "cat file1" \
4240 "initial contents of file1
4248 # OK, we'll try the same thing with a revision on br2.
4249 dotest join3-14 "${testcvs} -q update -r br2 file1" \
4250 "${PROG} [a-z]*: warning: file1 was lost
4252 echo 'br2:line1' >>file1
4253 dotest join3-15 "${testcvs} -q ci -m modify file1" \
4255 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
4256 new revision: 1\.2\.2\.1; previous revision: 1\.2
4259 # OK, now we can join br2 to br1
4260 dotest join3-16 "${testcvs} -q update -r br1 file1" "[UP] file1"
4261 # It may seem odd, to merge a higher branch into a lower
4262 # branch, but in fact CVS defines the ancestor as 1.1
4263 # and so it merges both the 1.1->1.2 and 1.2->1.2.2.1 changes.
4264 # This seems like a reasonably plausible behavior.
4265 dotest join3-17 "${testcvs} -q update -j br2 file1" \
4266 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
4267 retrieving revision 1\.1
4268 retrieving revision 1\.2\.2\.1
4269 Merging differences between 1\.1 and 1\.2\.2\.1 into file1
4270 rcsmerge: warning: conflicts during merge"
4271 dotest join3-18 "cat file1" \
4272 "initial contents of file1
4278 [>]>>>>>> 1\.2\.2\.1"
4282 rm -rf ${CVSROOT_DIRNAME}/first-dir
4285 new) # look for stray "no longer pertinent" messages.
4286 mkdir ${CVSROOT_DIRNAME}/first-dir
4288 if ${CVS} co first-dir ; then
4297 if ${CVS} add a 2>>${LOGFILE}; then
4303 if ${CVS} ci -m added >>${LOGFILE} 2>&1; then
4311 if ${CVS} rm a 2>>${LOGFILE}; then
4317 if ${CVS} ci -m removed >>${LOGFILE} ; then
4323 if ${CVS} update -A 2>&1 | grep longer ; then
4329 if ${CVS} update -rHEAD 2>&1 | grep longer ; then
4337 rm -rf ${CVSROOT_DIRNAME}/first-dir
4341 # Test removing a file on a branch and then checking it out.
4343 # We call this "newb" only because it, like the "new" tests,
4344 # has something to do with "no longer pertinent" messages.
4345 # Not necessarily the most brilliant nomenclature.
4348 mkdir ${CVSROOT_DIRNAME}/first-dir
4349 dotest newb-123a "${testcvs} -q co first-dir" ''
4352 dotest newb-123b "${testcvs} add a" \
4353 "${PROG} [a-z]*: scheduling file .a. for addition
4354 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
4355 dotest newb-123c "${testcvs} -q ci -m added" \
4356 "RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
4359 ${TESTDIR}/cvsroot/first-dir/a,v <-- a
4360 initial revision: 1\.1
4364 dotest newb-123d "${testcvs} -q tag -b branch" "T a"
4366 # Check out the branch.
4371 dotest newb-123e "${testcvs} -q co -r branch first-dir" \
4374 # Remove 'a' on another copy of the branch.
4378 dotest newb-123f "${testcvs} -q co -r branch first-dir" \
4382 dotest newb-123g "${testcvs} rm a" \
4383 "${PROG} [a-z]*: scheduling .a. for removal
4384 ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
4385 dotest newb-123h "${testcvs} -q ci -m removed" \
4387 ${TESTDIR}/cvsroot/first-dir/a,v <-- a
4388 new revision: delete; previous revision: 1\.1\.2
4391 # Check out the file on the branch. This should report
4392 # that the file is not pertinent, but it should not
4393 # say anything else.
4396 dotest newb-123i "${testcvs} -q co -r branch first-dir/a" \
4397 "${PROG} [a-z]*: warning: first-dir/a is not (any longer) pertinent"
4399 # Update the other copy, and make sure that a is removed.
4401 # "Needs Patch" is a rather strange output here. Something like
4402 # "Removed in Repository" would make more sense.
4403 # The "Need Checkout" output is what CVS does if configured
4405 dotest newb-123j0 "${testcvs} status a" \
4406 "===================================================================
4407 File: a Status: Needs Patch
4409 Working revision: 1\.1.*
4410 Repository revision: 1\.1\.2\.1 ${TESTDIR}/cvsroot/first-dir/a,v
4411 Sticky Tag: branch (branch: 1\.1\.2)
4413 Sticky Options: (none)" \
4414 "===================================================================
4415 File: a Status: Needs Checkout
4417 Working revision: 1\.1.*
4418 Repository revision: 1\.1\.2\.1 ${TESTDIR}/cvsroot/first-dir/a,v
4419 Sticky Tag: branch (branch: 1\.1\.2)
4421 Sticky Options: (none)"
4422 dotest newb-123j "${testcvs} -q update" \
4423 "${PROG} [a-z]*: warning: a is not (any longer) pertinent"
4433 rm -rf ${CVSROOT_DIRNAME}/first-dir
4437 mkdir ${CVSROOT_DIRNAME}/first-dir
4442 dotest conflicts-124 "${testcvs} -q co first-dir" ''
4447 dotest conflicts-125 "${testcvs} add a" \
4448 "${PROG} [a-z]*: scheduling file .a. for addition
4449 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
4450 dotest conflicts-126 "${testcvs} -q ci -m added" \
4451 "RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
4454 ${TESTDIR}/cvsroot/first-dir/a,v <-- a
4455 initial revision: 1\.1
4462 # The need for TMPPWD here is a (minor) CVS bug; the
4463 # output should use the name of the repository as specified.
4464 dotest conflicts-126.5 "${testcvs} co -p first-dir" \
4465 "${PROG} [a-z]*: Updating first-dir
4466 ===================================================================
4467 Checking out first-dir/a
4468 RCS: ${TMPPWD}/cvsroot/first-dir/a,v
4470 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
4471 if ${CVS} co first-dir ; then
4483 cd ../../1/first-dir
4486 dotest conflicts-127b "${testcvs} add dir1" \
4487 "Directory ${TESTDIR}/cvsroot/first-dir/dir1 added to the repository"
4488 dotest conflicts-128 "${testcvs} -q ci -m changed" \
4490 ${TESTDIR}/cvsroot/first-dir/a,v <-- a
4491 new revision: 1\.2; previous revision: 1\.1
4495 # Similar to conflicts-126.5, but now the file has nonempty
4499 # The need for TMPPWD here is a (minor) CVS bug; the
4500 # output should use the name of the repository as specified.
4501 dotest conflicts-128.5 "${testcvs} co -p -l first-dir" \
4502 "${PROG} [a-z]*: Updating first-dir
4503 ===================================================================
4504 Checking out first-dir/a
4505 RCS: ${TMPPWD}/cvsroot/first-dir/a,v
4507 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4512 # Now go over the to the other working directory and
4513 # start testing conflicts
4515 echo add a conflicting line >>a
4516 dotest_fail conflicts-129 "${testcvs} -q ci -m changed" \
4517 "${PROG}"' [a-z]*: Up-to-date check failed for `a'\''
4518 '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
4521 dotest conflicts-status-0 "${testcvs} status a" \
4522 "===================================================================
4523 File: a Status: Needs Merge
4525 Working revision: 1\.1.*
4526 Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/a,v
4529 Sticky Options: (none)"
4530 dotest conflicts-130 "${testcvs} -q update" \
4531 "RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
4532 retrieving revision 1\.1
4533 retrieving revision 1\.2
4534 Merging differences between 1\.1 and 1\.2 into a
4535 rcsmerge: warning: conflicts during merge
4536 ${PROG} [a-z]*: conflicts found in a
4542 RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
4543 retrieving revision 1\.1
4544 retrieving revision 1\.2
4545 Merging differences between 1\.1 and 1\.2 into a
4546 rcsmerge: warning: conflicts during merge
4547 ${PROG} [a-z]*: conflicts found in a
4551 dotest conflicts-status-1 "${testcvs} status a" \
4552 "===================================================================
4553 File: a Status: File had conflicts on merge
4555 Working revision: 1\.2.*
4556 Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/a,v
4559 Sticky Options: (none)"
4560 dotest_fail conflicts-131 "${testcvs} -q ci -m try" \
4561 "${PROG} [a-z]*: file .a. had a conflict and has not been modified
4562 ${PROG} \[[a-z]* aborted\]: correct above errors first!"
4564 echo lame attempt at resolving it >>a
4565 # Try to check in the file with the conflict markers in it.
4566 dotest conflicts-status-2 "${testcvs} status a" \
4567 "===================================================================
4568 File: a Status: File had conflicts on merge
4570 Working revision: 1\.2.*
4571 Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/a,v
4574 Sticky Options: (none)"
4575 dotest conflicts-132 "${testcvs} -q ci -m try" \
4576 "${PROG} [a-z]*: warning: file .a. seems to still contain conflict indicators
4578 ${TESTDIR}/cvsroot/first-dir/a,v <-- a
4579 new revision: 1\.3; previous revision: 1\.2
4582 # OK, the user saw the warning (good user), and now
4583 # resolves it for real.
4584 echo resolve conflict >a
4585 dotest conflicts-status-3 "${testcvs} status a" \
4586 "===================================================================
4587 File: a Status: Locally Modified
4589 Working revision: 1\.3.*
4590 Repository revision: 1\.3 ${TESTDIR}/cvsroot/first-dir/a,v
4593 Sticky Options: (none)"
4594 dotest conflicts-133 "${testcvs} -q ci -m resolved" \
4596 ${TESTDIR}/cvsroot/first-dir/a,v <-- a
4597 new revision: 1\.4; previous revision: 1\.3
4599 dotest conflicts-status-4 "${testcvs} status a" \
4600 "===================================================================
4601 File: a Status: Up-to-date
4603 Working revision: 1\.4.*
4604 Repository revision: 1\.4 ${TESTDIR}/cvsroot/first-dir/a,v
4607 Sticky Options: (none)"
4609 # Now test that we can add a file in one working directory
4610 # and have an update in another get it.
4611 cd ../../1/first-dir
4613 if ${testcvs} add abc >>${LOGFILE} 2>&1; then
4618 if ${testcvs} ci -m 'add abc' abc >>${LOGFILE} 2>&1; then
4624 mkdir first-dir/dir1 first-dir/sdir
4625 dotest conflicts-136 "${testcvs} -q update first-dir" \
4627 '"${QUESTION}"' first-dir/dir1
4628 '"${QUESTION}"' first-dir/sdir' \
4629 ''"${QUESTION}"' first-dir/dir1
4630 '"${QUESTION}"' first-dir/sdir
4632 dotest conflicts-137 'test -f first-dir/abc' ''
4633 rmdir first-dir/dir1 first-dir/sdir
4635 # Now test something similar, but in which the parent directory
4636 # (not the directory in question) has the Entries.Static flag
4640 if ${testcvs} add subdir >>${LOGFILE}; then
4648 if ${testcvs} -q co first-dir/abc first-dir/subdir \
4654 cd ../1/first-dir/subdir
4656 if ${testcvs} add sss >>${LOGFILE} 2>&1; then
4661 if ${testcvs} ci -m adding sss >>${LOGFILE} 2>&1; then
4666 cd ../../../3/first-dir
4667 if ${testcvs} -q update >>${LOGFILE}; then
4672 if test -f subdir/sss; then
4678 rm -r 1 2 3 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
4682 # More conflicts tests; separate from conflicts to keep each
4683 # test a manageable size.
4684 mkdir ${CVSROOT_DIRNAME}/first-dir
4689 dotest conflicts2-142a1 "${testcvs} -q co first-dir" ''
4694 dotest conflicts2-142a2 "${testcvs} add a abc" \
4695 "${PROG} [a-z]*: scheduling file .a. for addition
4696 ${PROG} [a-z]*: scheduling file .abc. for addition
4697 ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
4698 dotest conflicts2-142a3 "${testcvs} -q ci -m added" \
4699 "RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
4702 ${TESTDIR}/cvsroot/first-dir/a,v <-- a
4703 initial revision: 1\.1
4705 RCS file: ${TESTDIR}/cvsroot/first-dir/abc,v
4708 ${TESTDIR}/cvsroot/first-dir/abc,v <-- abc
4709 initial revision: 1\.1
4716 dotest conflicts2-142a4 "${testcvs} -q co first-dir" 'U first-dir/a
4720 # Now test that if one person modifies and commits a
4721 # file and a second person removes it, it is a
4725 dotest conflicts2-142b2 "${testcvs} -q ci -m modify-a" \
4727 ${TESTDIR}/cvsroot/first-dir/a,v <-- a
4728 new revision: 1\.2; previous revision: 1\.1
4730 cd ../../2/first-dir
4732 dotest conflicts2-142b3 "${testcvs} rm a" \
4733 "${PROG} [a-z]*: scheduling .a. for removal
4734 ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
4735 dotest_fail conflicts2-142b4 "${testcvs} -q update" \
4736 "${PROG} [a-z]*: conflict: removed a was modified by second party
4738 # Resolve the conflict by deciding not to remove the file
4740 dotest conflicts2-142b5 "${testcvs} add a" "U a
4741 ${PROG} [a-z]*: a, version 1\.1, resurrected"
4742 dotest conflicts2-142b6 "${testcvs} -q update" ''
4745 # Now test that if one person removes a file and
4746 # commits it, and a second person removes it, is it
4750 dotest conflicts2-142c0 "${testcvs} rm abc" \
4751 "${PROG} [a-z]*: scheduling .abc. for removal
4752 ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
4753 dotest conflicts2-142c1 "${testcvs} -q ci -m remove-abc" \
4755 ${TESTDIR}/cvsroot/first-dir/abc,v <-- abc
4756 new revision: delete; previous revision: 1\.1
4758 cd ../../2/first-dir
4760 dotest conflicts2-142c2 "${testcvs} rm abc" \
4761 "${PROG} [a-z]*: scheduling .abc. for removal
4762 ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
4763 dotest conflicts2-142c3 "${testcvs} update" \
4764 "${PROG} [a-z]*: Updating \."
4767 # conflicts2-142d*: test that if one party adds a file, and another
4768 # party has a file of the same name, cvs notices
4771 echo 'contents unchanged' >same.c
4772 dotest conflicts2-142d0 "${testcvs} add aa.c same.c" \
4773 "${PROG} [a-z]*: scheduling file .aa\.c. for addition
4774 ${PROG} [a-z]*: scheduling file .same\.c. for addition
4775 ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
4776 dotest conflicts2-142d1 "${testcvs} -q ci -m added" \
4777 "RCS file: ${TESTDIR}/cvsroot/first-dir/aa\.c,v
4780 ${TESTDIR}/cvsroot/first-dir/aa\.c,v <-- aa\.c
4781 initial revision: 1\.1
4783 RCS file: ${TESTDIR}/cvsroot/first-dir/same\.c,v
4785 Checking in same\.c;
4786 ${TESTDIR}/cvsroot/first-dir/same\.c,v <-- same\.c
4787 initial revision: 1\.1
4789 cd ../../2/first-dir
4790 echo "don't you dare obliterate this text" >aa.c
4791 echo 'contents unchanged' >same.c
4792 # Note the discrepancy between local and remote in the handling
4794 # of suspect that the local CVS behavior is the more useful one
4795 # although I do sort of wonder whether we should make people run
4796 # cvs add just to get them in that habit (also, trying to implement
4797 # the local CVS behavior for remote without the cvs add seems
4798 # pretty difficult).
4799 if test "$remote" = yes; then
4800 dotest_fail conflicts2-142d2 "${testcvs} -q update" \
4803 ${PROG} update: move away \./aa\.c; it is in the way
4805 ${PROG} update: move away \./same\.c; it is in the way
4808 dotest_fail conflicts2-142d2 "${testcvs} -q update" \
4809 "${PROG} [a-z]*: move away aa\.c; it is in the way
4813 dotest conflicts2-142d3 "${testcvs} -q status aa.c" \
4814 "${PROG} [a-z]*: move away aa\.c; it is in the way
4815 ===================================================================
4816 File: aa\.c Status: Unresolved Conflict
4818 Working revision: No entry for aa\.c
4819 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/aa\.c,v"
4821 # Could also be testing the case in which the cvs add happened
4822 # before the commit by the other user.
4823 # This message seems somewhat bogus. I mean, parallel development
4824 # means that we get to work in parallel if we choose, right? And
4825 # then at commit time it would be a conflict.
4826 dotest_fail conflicts2-142d4 "${testcvs} -q add aa.c" \
4827 "${PROG} [a-z]*: aa.c added independently by second party"
4829 # The user might want to see just what the conflict is.
4830 # Don't bother, diff seems to kind of lose its mind, with or
4831 # without -N. This is a CVS bug(s).
4832 #dotest conflicts2-142d5 "${testcvs} -q diff -r HEAD -N aa.c" fixme
4834 # Now: "how can the user resolve this conflict", I hear you cry.
4835 # Well, one way is to forget about the file in the working
4837 # Since it didn't let us do the add in conflicts2-142d4, there
4838 # is no need to run cvs rm here.
4839 #dotest conflicts2-142d6 "${testcvs} -q rm -f aa.c" fixme
4840 dotest conflicts2-142d6 "rm aa.c" ''
4841 dotest conflicts2-142d7 "${testcvs} -q update aa.c" "U aa\.c"
4842 dotest conflicts2-142d8 "cat aa.c" ''
4844 # The other way is to use the version from the working directory
4845 # instead of the version from the repository. Unfortunately,
4846 # there doesn't seem to be any particularly clear way to do
4851 rm -r 1 2 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
4855 # More tests of conflicts and/or multiple working directories
4859 dotest conflicts3-1 "${testcvs} -q co -l ." ''
4861 dotest conflicts3-2 "${testcvs} add first-dir" \
4862 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
4865 dotest conflicts3-3 "${testcvs} -q co -l first-dir" ''
4868 dotest conflicts3-4 "${testcvs} add file1 file2" \
4869 "${PROG} [a-z]*: scheduling file .file1. for addition
4870 ${PROG} [a-z]*: scheduling file .file2. for addition
4871 ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
4872 dotest conflicts3-5 "${testcvs} -q ci -m add-them" \
4873 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
4876 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
4877 initial revision: 1\.1
4879 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
4882 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
4883 initial revision: 1\.1
4885 cd ../../2/first-dir
4886 # Check that -n doesn't make CVS lose its mind as it creates
4887 # (or rather, doesn't) a new file.
4888 dotest conflicts3-6 "${testcvs} -nq update" \
4891 dotest_fail conflicts3-7 "test -f file1" ''
4892 dotest conflicts3-8 "${testcvs} -q update" \
4895 dotest conflicts3-9 "test -f file2" ''
4897 # OK, now remove two files at once
4898 dotest conflicts3-10 "${testcvs} rm -f file1 file2" \
4899 "${PROG} [a-z]*: scheduling .file1. for removal
4900 ${PROG} [a-z]*: scheduling .file2. for removal
4901 ${PROG} [a-z]*: use .${PROG} commit. to remove these files permanently"
4902 dotest conflicts3-11 "${testcvs} -q ci -m remove-them" \
4904 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
4905 new revision: delete; previous revision: 1\.1
4908 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
4909 new revision: delete; previous revision: 1\.1
4911 cd ../../1/first-dir
4912 dotest conflicts3-12 "${testcvs} -n -q update" \
4913 "${PROG} [a-z]*: warning: file1 is not (any longer) pertinent
4914 ${PROG} [a-z]*: warning: file2 is not (any longer) pertinent"
4915 dotest conflicts3-13 "${testcvs} -q update" \
4916 "${PROG} [a-z]*: warning: file1 is not (any longer) pertinent
4917 ${PROG} [a-z]*: warning: file2 is not (any longer) pertinent"
4919 # OK, now add a directory to both working directories
4920 # and see that CVS doesn't lose its mind.
4922 dotest conficts3-14 "${testcvs} add sdir" \
4923 "Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
4924 cd ../../2/first-dir
4926 # Create a CVS directory without the proper administrative
4927 # files in it. This can happen for example if you hit ^C
4928 # in the middle of a checkout.
4931 # OK, in the local case CVS sees that the directory exists
4932 # in the repository and recurses into it. In the remote case
4933 # CVS can't see the repository and has no way of knowing
4934 # that sdir is even a directory (stat'ing everything would be
4935 # too slow). The remote behavior makes more sense to me (but
4936 # would this affect other cases?).
4937 if test "$remote" = yes; then
4938 dotest conflicts3-15 "${testcvs} -q update" \
4941 dotest conflicts3-15 "${testcvs} -q update" \
4943 ${PROG} [a-z]*: ignoring sdir (CVS/Repository missing)"
4944 touch sdir/CVS/Repository
4945 dotest conflicts3-16 "${testcvs} -q update" \
4947 ${PROG} [a-z]*: ignoring sdir (CVS/Entries missing)"
4951 # OK, now the same thing, but the directory doesn't exist
4952 # in the repository.
4955 dotest conflicts3-17 "${testcvs} -q update" "${QUESTION} newdir"
4956 echo "D/newdir////" >> CVS/Entries
4957 dotest conflicts3-18 "${testcvs} -q update" \
4958 "${PROG} [a-z]*: ignoring newdir (CVS/Repository missing)"
4959 touch newdir/CVS/Repository
4960 dotest conflicts3-19 "${testcvs} -q update" \
4961 "${PROG} [a-z]*: ignoring newdir (CVS/Entries missing)"
4967 rm -rf ${CVSROOT_DIRNAME}/first-dir
4971 # Tests of various ways to define and use modules.
4973 ############################################################
4974 # These tests are to make sure that administrative files get
4975 # rebuilt, regardless of how and where files are checked
4977 ############################################################
4978 # Check out the whole repository
4980 dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/checkoutlist
4981 U CVSROOT/commitinfo
4983 U CVSROOT/cvswrappers
4990 U CVSROOT/verifymsg'
4991 echo "# made a change" >>CVSROOT/modules
4992 dotest modules-1d "${testcvs} -q ci -m add-modules" \
4993 "Checking in CVSROOT/modules;
4994 ${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
4995 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
4997 ${PROG} [a-z]*: Rebuilding administrative file database"
5001 ############################################################
5004 dotest modules-2 "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist
5005 U CVSROOT/commitinfo
5007 U CVSROOT/cvswrappers
5014 U CVSROOT/verifymsg'
5015 echo "# made a change" >>CVSROOT/modules
5016 dotest modules-2d "${testcvs} -q ci -m add-modules" \
5017 "Checking in CVSROOT/modules;
5018 ${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
5019 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
5021 ${PROG} [a-z]*: Rebuilding administrative file database"
5025 ############################################################
5026 # Check out CVSROOT in some other directory
5027 mkdir ${CVSROOT_DIRNAME}/somedir
5029 dotest modules-3 "${testcvs} -q co somedir" ''
5031 dotest modules-3d "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist
5032 U CVSROOT/commitinfo
5034 U CVSROOT/cvswrappers
5041 U CVSROOT/verifymsg'
5042 echo "# made a change" >>CVSROOT/modules
5043 dotest modules-3g "${testcvs} -q ci -m add-modules" \
5044 "Checking in CVSROOT/modules;
5045 ${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
5046 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
5048 ${PROG} [a-z]*: Rebuilding administrative file database"
5051 rm -rf ${CVSROOT_DIRNAME}/somedir
5052 ############################################################
5054 ############################################################
5057 mkdir ${CVSROOT_DIRNAME}/first-dir
5062 if ${testcvs} -q co first-dir; then
5070 ${testcvs} add subdir >>${LOGFILE}
5074 ${testcvs} add ssdir >>${LOGFILE}
5078 if ${testcvs} add a b 2>>${LOGFILE} ; then
5084 if ${testcvs} ci -m added >>${LOGFILE} 2>&1; then
5091 if ${testcvs} -q co CVSROOT >>${LOGFILE}; then
5097 # Here we test that CVS can deal with CVSROOT (whose repository
5098 # is at top level) in the same directory as subdir (whose repository
5099 # is a subdirectory of first-dir). TODO: Might want to check that
5100 # files can actually get updated in this state.
5101 if ${testcvs} -q update; then
5107 echo realmodule first-dir/subdir a >CVSROOT/modules
5108 echo dirmodule first-dir/subdir >>CVSROOT/modules
5109 echo namedmodule -d nameddir first-dir/subdir >>CVSROOT/modules
5110 echo aliasmodule -a first-dir/subdir/a >>CVSROOT/modules
5111 echo aliasnested -a first-dir/subdir/ssdir >>CVSROOT/modules
5112 echo topfiles -a first-dir/file1 first-dir/file2 >>CVSROOT/modules
5113 echo world -a . >>CVSROOT/modules
5114 echo statusmod -s Mungeable >>CVSROOT/modules
5116 # Options must come before arguments. It is possible this should
5117 # be relaxed at some point (though the result would be bizarre for
5118 # -a); for now test the current behavior.
5119 echo bogusalias first-dir/subdir/a -a >>CVSROOT/modules
5120 if ${testcvs} ci -m 'add modules' CVSROOT/modules \
5121 >>${LOGFILE} 2>&1; then
5127 # The "statusmod" module contains an error; trying to use it
5128 # will produce "modules file missing directory" I think.
5129 # However, that shouldn't affect the ability of "cvs co -c" or
5130 # "cvs co -s" to do something reasonable with it.
5131 dotest 148a0 "${testcvs} co -c" 'aliasmodule -a first-dir/subdir/a
5132 aliasnested -a first-dir/subdir/ssdir
5133 bogusalias first-dir/subdir/a -a
5134 dirmodule first-dir/subdir
5135 namedmodule -d nameddir first-dir/subdir
5136 realmodule first-dir/subdir a
5137 statusmod -s Mungeable
5138 topfiles -a first-dir/file1 first-dir/file2
5140 # There is code in modules.c:save_d which explicitly skips
5141 # modules defined with -a, which is why aliasmodule is not
5143 dotest 148a1 "${testcvs} co -s" \
5144 'statusmod Mungeable
5145 bogusalias NONE first-dir/subdir/a -a
5146 dirmodule NONE first-dir/subdir
5147 namedmodule NONE first-dir/subdir
5148 realmodule NONE first-dir/subdir a'
5150 # Test that real modules check out to realmodule/a, not subdir/a.
5151 if ${testcvs} co realmodule >>${LOGFILE}; then
5156 if test -d realmodule && test -f realmodule/a; then
5161 if test -f realmodule/b; then
5166 if ${testcvs} -q co realmodule; then
5171 if echo "yes" | ${testcvs} release -d realmodule >>${LOGFILE} ; then
5177 dotest_fail 149b1 "${testcvs} co realmodule/a" \
5178 "${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
5179 "${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory
5180 '"${PROG}"' \[[a-z]* aborted\]: cannot expand modules'
5182 # Now test the ability to check out a single file from a directory
5183 if ${testcvs} co dirmodule/a >>${LOGFILE}; then
5188 if test -d dirmodule && test -f dirmodule/a; then
5193 if test -f dirmodule/b; then
5198 if echo "yes" | ${testcvs} release -d dirmodule >>${LOGFILE} ; then
5203 # Now test the ability to correctly reject a non-existent filename.
5204 # For maximum studliness we would check that an error message is
5206 if ${testcvs} co dirmodule/nonexist >>${LOGFILE} 2>&1; then
5207 # We accept a zero exit status because it is what CVS does
5208 # (Dec 95). Probably the exit status should be nonzero,
5214 # We tolerate the creation of the dirmodule directory, since that
5215 # is what CVS does, not because we view that as preferable to not
5217 if test -f dirmodule/a || test -f dirmodule/b; then
5224 # Now test that a module using -d checks out to the specified
5226 dotest 150h1 "${testcvs} -q co namedmodule" 'U nameddir/a
5228 if test -f nameddir/a && test -f nameddir/b; then
5233 echo add line >>nameddir/a
5234 dotest 150h3 "${testcvs} -q co namedmodule" 'M nameddir/a'
5236 dotest 150h4 "${testcvs} -q co namedmodule" 'U nameddir/a'
5237 if echo "yes" | ${testcvs} release -d nameddir >>${LOGFILE} ; then
5243 # Now test that alias modules check out to subdir/a, not
5245 if ${testcvs} co aliasmodule >>${LOGFILE}; then
5250 if test -d aliasmodule; then
5255 echo abc >>first-dir/subdir/a
5256 if (${testcvs} -q co aliasmodule | tee test153.tmp) \
5262 echo 'M first-dir/subdir/a' >ans153.tmp
5263 if cmp test153.tmp ans153.tmp; then
5274 dotest modules-155a0 "${testcvs} co aliasnested" \
5275 "${PROG} [a-z]*: Updating first-dir/subdir/ssdir"
5276 dotest modules-155a1 "test -d first-dir" ''
5277 dotest modules-155a2 "test -d first-dir/subdir" ''
5278 dotest modules-155a3 "test -d first-dir/subdir/ssdir" ''
5279 # Test that nothing extraneous got created.
5280 dotest modules-155a4 "ls" "first-dir" \
5286 # Test checking out everything.
5289 dotest modules-155b "${testcvs} -q co world" \
5290 "U CVSROOT/${DOTSTAR}
5291 U first-dir/subdir/a
5292 U first-dir/subdir/b"
5296 # Test checking out a module which lists at least two
5297 # specific files twice. At one time, this failed over
5301 dotest modules-155c1 "${testcvs} -q co first-dir" \
5302 "U first-dir/subdir/a
5303 U first-dir/subdir/b"
5306 echo 'first revision' > file1
5307 echo 'first revision' > file2
5308 dotest modules-155c2 "${testcvs} add file1 file2" \
5309 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
5310 '"${PROG}"' [a-z]*: scheduling file `file2'\'' for addition
5311 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add these files permanently'
5312 dotest modules-155c3 "${testcvs} -q ci -m add-it" \
5313 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
5316 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
5317 initial revision: 1\.1
5319 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
5322 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
5323 initial revision: 1\.1
5328 dotest modules-155c4 "${testcvs} -q co topfiles" \
5331 dotest modules-155c5 "${testcvs} -q co topfiles" ""
5333 # Make sure the right thing happens if we remove a file.
5335 dotest modules-155c6 "${testcvs} -q rm -f file1" \
5336 "${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
5337 dotest modules-155c7 "${testcvs} -q ci -m remove-it" \
5339 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
5340 new revision: delete; previous revision: 1\.1
5344 dotest modules-155c8 "${testcvs} -q co topfiles" \
5345 "${PROG} [a-z]*: warning: first-dir/file1 is not (any longer) pertinent
5351 rm -rf ${CVSROOT_DIRNAME}/first-dir
5355 # More tests of modules, in particular the & feature.
5357 dotest modules2-setup-1 "${testcvs} -q co -l ." ''
5358 mkdir first-dir second-dir third-dir
5359 dotest modules2-setup-2 \
5360 "${testcvs} add first-dir second-dir third-dir" \
5361 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository
5362 Directory ${TESTDIR}/cvsroot/second-dir added to the repository
5363 Directory ${TESTDIR}/cvsroot/third-dir added to the repository"
5366 dotest modules2-setup-3 "${testcvs} add file3" \
5367 "${PROG} [a-z]*: scheduling file .file3. for addition
5368 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
5369 dotest modules2-setup-4 "${testcvs} -q ci -m add file3" \
5370 "RCS file: ${TESTDIR}/cvsroot/third-dir/file3,v
5373 ${TESTDIR}/cvsroot/third-dir/file3,v <-- file3
5374 initial revision: 1\.1
5382 dotest modules2-1 "${testcvs} -q co CVSROOT/modules" \
5385 echo 'ampermodule &first-dir &second-dir' > modules
5386 echo 'combmodule third-dir file3 &first-dir' >> modules
5387 # Depending on whether the user also ran the modules test
5388 # we will be checking in revision 1.2 or 1.3.
5389 dotest modules2-2 "${testcvs} -q ci -m add-modules" \
5390 "Checking in modules;
5391 ${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
5392 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
5394 ${PROG} [a-z]*: Rebuilding administrative file database"
5398 dotest modules2-3 "${testcvs} -q co ampermodule" ''
5399 dotest modules2-4 "test -d ampermodule/first-dir" ''
5400 dotest modules2-5 "test -d ampermodule/second-dir" ''
5402 # Test ability of cvs release to handle multiple arguments
5404 if ${testcvs} release -d first-dir second-dir <<EOF >>${LOGFILE}
5413 dotest_fail modules2-7 "test -d first-dir" ''
5414 dotest_fail modules2-8 "test -d second-dir" ''
5418 # Now we create another directory named first-dir and make
5419 # sure that CVS doesn't get them mixed up.
5421 # Note that this message should say "Updating ampermodule/first-dir"
5422 # I suspect. This is a long-standing behavior/bug....
5423 dotest modules2-9 "${testcvs} co ampermodule" \
5424 "${PROG} [a-z]*: Updating first-dir
5425 ${PROG} [a-z]*: Updating second-dir"
5426 touch ampermodule/first-dir/amper1
5427 dotest modules2-10 "${testcvs} add ampermodule/first-dir/amper1" \
5428 "${PROG} [a-z]*: scheduling file .ampermodule/first-dir/amper1. for addition
5429 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
5431 # As with the "Updating xxx" message, the "U first-dir/amper1"
5432 # message (instead of "U ampermodule/first-dir/amper1") is
5434 dotest modules2-12 "${testcvs} co ampermodule" \
5435 "${PROG} [a-z]*: Updating first-dir
5437 ${PROG} [a-z]*: Updating second-dir"
5439 if test "$remote" = no; then
5440 dotest modules2-13 "${testcvs} -q ci -m add-it ampermodule" \
5441 "RCS file: ${TESTDIR}/cvsroot/first-dir/amper1,v
5443 Checking in ampermodule/first-dir/amper1;
5444 ${TESTDIR}/cvsroot/first-dir/amper1,v <-- amper1
5445 initial revision: 1\.1
5448 # Trying this as above led to a "protocol error" message.
5449 # Work around this bug.
5451 dotest modules2-13 "${testcvs} -q ci -m add-it" \
5452 "RCS file: ${TESTDIR}/cvsroot/first-dir/amper1,v
5454 Checking in first-dir/amper1;
5455 ${TESTDIR}/cvsroot/first-dir/amper1,v <-- amper1
5456 initial revision: 1\.1
5461 # Now test the "combmodule" module (combining regular modules
5462 # and ampersand modules in the same module definition).
5466 dotest modules2-14 "${testcvs} co combmodule" \
5468 ${PROG} [a-z]*: Updating first-dir
5470 dotest modules2-15 "test -f combmodule/file3" ""
5471 dotest modules2-16 "test -f combmodule/first-dir/amper1" ""
5474 # Might be possible to have a more graceful error message,
5475 # but at least for now there is no way to tell CVS that
5476 # some files/subdirectories come from one repository directory,
5477 # and others from another.
5478 if test "$remote" = no; then
5479 dotest_fail modules2-17 "${testcvs} update -d" \
5480 "${PROG} [a-z]*: Updating \.
5481 ${PROG} [a-z]*: Updating first-dir
5482 ${PROG} \[[a-z]* aborted\]: cannot open directory ${TESTDIR}/cvsroot/third-dir/first-dir: No such file or directory"
5483 # Clean up the droppings left by the previous command.
5484 # This should definitely not be necessary (I think).
5487 # This seems like a pretty sensible behavior to me, in the
5488 # sense that first-dir doesn't "really" exist within
5489 # third-dir, so CVS just acts as if there is nothing there
5491 dotest modules2-17 "${testcvs} update -d" \
5492 "${PROG} server: Updating \."
5496 dotest modules2-18 "${testcvs} -q co combmodule" \
5497 "U first-dir/amper1"
5498 dotest modules2-19 "test -f combmodule/first-dir/amper1" ""
5502 # Test that CVS gives an error if one combines -a with
5504 # Probably would be better to break this out into a separate
5505 # test. Although it is short, it shares no files/state with
5506 # the rest of the modules2 tests.
5508 dotest modules2-a0.5 "${testcvs} -q co CVSROOT/modules" \
5511 echo 'aliasopt -a -d onedir first-dir' >modules
5512 dotest modules2-a0 "${testcvs} -q ci -m add-modules" \
5513 "Checking in modules;
5514 ${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
5515 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
5517 ${PROG} [a-z]*: Rebuilding administrative file database"
5519 dotest_fail modules2-a1 "${testcvs} -q co aliasopt" \
5520 "${PROG} [a-z]*: -a cannot be specified in the modules file along with other options" \
5521 "${PROG} [a-z]*: -a cannot be specified in the modules file along with other options
5522 ${PROG} \[[a-z]* aborted\]: cannot expand modules"
5528 rm -rf ${CVSROOT_DIRNAME}/first-dir
5529 rm -rf ${CVSROOT_DIRNAME}/second-dir
5530 rm -rf ${CVSROOT_DIRNAME}/third-dir
5534 # More tests of modules, in particular what happens if several
5535 # modules point to the same file.
5537 # First just set up a directory first-dir and a file file1 in it.
5540 dotest modules3-0 "${testcvs} -q co -l ." ''
5542 dotest modules3-1 "${testcvs} add first-dir" \
5543 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
5547 dotest modules3-2 "${testcvs} add file1" \
5548 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
5549 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
5550 dotest modules3-3 "${testcvs} -q ci -m add-it" \
5551 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
5554 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
5555 initial revision: 1\.1
5559 dotest modules3-4 "${testcvs} -q update -d CVSROOT" \
5560 "U CVSROOT${DOTSTAR}"
5563 mod1 -a first-dir/file1
5564 bigmod -a mod1 first-dir/file1
5565 namednest -d src/sub/dir first-dir
5566 nestdeeper -d src/sub1/sub2/sub3/dir first-dir
5567 nestshallow -d src/dir second-dir/suba/subb
5568 path/in/modules &mod1
5569 another/path/test -d another/path/test first-dir
5571 dotest modules3-5 "${testcvs} -q ci -m add-modules" \
5572 "Checking in modules;
5573 ${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
5574 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
5576 ${PROG} [a-z]*: Rebuilding administrative file database"
5579 dotest modules3-6 "${testcvs} -q co bigmod" ''
5581 dotest modules3-7 "${testcvs} -q co bigmod" 'U first-dir/file1'
5588 # This fails to work remote (it doesn't notice the directories,
5589 # I suppose because they contain no files). Bummer, especially
5590 # considering this is a documented technique and everything.
5591 dotest modules3-7a \
5592 "${testcvs} import -m add-dirs second-dir tag1 tag2" \
5593 "${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/suba
5594 ${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/suba/subb
5596 No conflicts created by this import" "
5597 No conflicts created by this import"
5600 dotest modules3-7b "${testcvs} co second-dir" \
5601 "${PROG} [a-z]*: Updating second-dir
5602 ${PROG} [a-z]*: Updating second-dir/suba
5603 ${PROG} [a-z]*: Updating second-dir/suba/subb" \
5604 "${PROG} server: Updating second-dir"
5606 if test "x$remote" = xyes; then
5609 dotest modules3-7-workaround1 "${testcvs} add suba" \
5610 "Directory ${TESTDIR}/cvsroot/second-dir/suba added to the repository"
5613 dotest modules3-7-workaround2 "${testcvs} add subb" \
5614 "Directory ${TESTDIR}/cvsroot/second-dir/suba/subb added to the repository"
5618 cd second-dir/suba/subb
5620 dotest modules3-7c "${testcvs} add fileb" \
5621 "${PROG} [a-z]*: scheduling file .fileb. for addition
5622 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
5623 dotest modules3-7d "${testcvs} -q ci -m add-it" \
5624 "RCS file: ${TESTDIR}/cvsroot/second-dir/suba/subb/fileb,v
5627 ${TESTDIR}/cvsroot/second-dir/suba/subb/fileb,v <-- fileb
5628 initial revision: 1\.1
5635 dotest modules3-8 "${testcvs} -q co namednest" \
5636 'U src/sub/dir/file1'
5637 dotest modules3-9 "test -f src/sub/dir/file1" ''
5641 # Try the same thing, but with the directories nested even
5642 # deeper (deeply enough so they are nested more deeply than
5643 # the number of directories from / to ${TESTDIR}).
5646 dotest modules3-10 "${testcvs} -q co nestdeeper" \
5647 'U src/sub1/sub2/sub3/dir/file1'
5648 dotest modules3-11 "test -f src/sub1/sub2/sub3/dir/file1" ''
5650 # While we are doing things like twisted uses of '/' (e.g.
5651 # modules3-12), try this one.
5652 if test "x$remote" = xyes; then
5653 dotest_fail modules3-11b \
5654 "${testcvs} -q update ${TESTDIR}/1/src/sub1/sub2/sub3/dir/file1" \
5655 "${PROG} .server aborted.: absolute pathname .${TESTDIR}/1/src/sub1/sub2/sub3/dir/file1. illegal for server"
5656 fi # end of remote-only tests
5661 # This one is almost too twisted for words. The pathname output
5662 # in the message from "co" doesn't include the "path/in/modules",
5663 # but those directories do get created (with no CVSADM except
5664 # in "modules" which has a CVSNULLREPOS).
5665 # I'm not sure anyone is relying on this nonsense or whether we
5666 # need to keep doing it, but it is what CVS currently does...
5667 # Skip it for remote; the remote code has the good sense to
5668 # not deal with it (on the minus side it gives
5669 # "internal error: repository string too short." (CVS 1.9) or
5670 # "warning: server is not creating directories one at a time" (now)
5671 # instead of a real error).
5672 # I'm tempted to just make it a fatal error to have '/' in a
5673 # module name. But see comments at modules3-16.
5674 if test "x$remote" = xno; then
5676 dotest modules3-12 "${testcvs} -q co path/in/modules" \
5678 dotest modules3-13 "test -f path/in/modules/first-dir/file1" ''
5681 # Now here is where it gets seriously bogus.
5683 dotest modules3-14 \
5684 "${testcvs} -q rtag tag1 path/in/modules" ''
5685 # CVS creates this even though rtag should *never* affect
5686 # the directory current when it is called!
5687 dotest modules3-15 "test -d path/in/modules" ''
5688 # Just for trivia's sake, rdiff is not similarly vulnerable
5689 # because it passes 0 for run_module_prog to do_module.
5691 fi # end of tests skipped for remote
5693 # Some people seem to want this to work. I still suspect there
5694 # are dark corners in slashes in module names. This probably wants
5695 # more thought before we start hacking on CVS (one way or the other)
5696 # or documenting this.
5698 dotest modules3-16 "${testcvs} -q co another/path/test" \
5699 "U another/path/test/file1"
5700 dotest modules3-17 "cat another/path/test/file1" 'file1'
5703 rm -rf ${CVSROOT_DIRNAME}/first-dir
5704 rm -rf ${CVSROOT_DIRNAME}/second-dir
5708 for message in '' ' ' '
5711 mkdir a-dir; cd a-dir
5712 # Test handling of -m during import
5714 if ${testcvs} import -m "$message" a-dir A A1 >>${LOGFILE} 2>&1;then
5719 # Must import twice since the first time uses inline code that
5722 if ${testcvs} import -m "$message" a-dir A A2 >>${LOGFILE} 2>&1;then
5727 # Test handling of -m during ci
5729 if ${testcvs} co a-dir >>${LOGFILE} 2>&1; then
5736 if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
5741 # Test handling of -m during rm/ci
5743 if ${testcvs} rm test >>${LOGFILE} 2>&1; then
5748 if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
5756 rm -rf ${CVSROOT_DIRNAME}/a-dir
5761 # More tests of log messages, in this case the ability to
5762 # run an external editor.
5764 # * also test $EDITOR, $CVSEDITOR, &c.
5765 # * test what happens if up-to-date check fails.
5767 # Our "editor" puts "x" at the start of each line, so we
5768 # can see the "CVS:" lines.
5769 cat >${TESTDIR}/editme <<EOF
5772 sed <\$1 -e 's/^/x&/g' >${TESTDIR}/edit.new
5773 mv ${TESTDIR}/edit.new \$1
5776 chmod +x ${TESTDIR}/editme
5779 dotest editor-1 "${testcvs} -q co -l ." ''
5781 dotest editor-2 "${testcvs} add first-dir" \
5782 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
5785 dotest editor-3 "${testcvs} add file1 file2" \
5786 "${PROG} [a-z]*: scheduling file .file1. for addition
5787 ${PROG} [a-z]*: scheduling file .file2. for addition
5788 ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
5789 dotest editor-4 "${testcvs} -e ${TESTDIR}/editme -q ci" \
5790 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
5793 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
5794 initial revision: 1\.1
5796 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
5799 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
5800 initial revision: 1\.1
5802 dotest editor-5 "${testcvs} -q tag -b br" "T file1
5804 dotest editor-6 "${testcvs} -q update -r br" ''
5806 dotest editor-7 "${testcvs} -e ${TESTDIR}/editme -q ci" \
5808 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
5809 new revision: 1\.1\.2\.1; previous revision: 1\.1
5811 # OK, now we want to make sure "ci -r" puts in the branch
5812 # where appropriate. Note that we can check in on the branch
5813 # without being on the branch, because there is not a revision
5814 # already on the branch. If there were a revision on the branch,
5815 # CVS would correctly give an up-to-date check failed.
5816 dotest editor-8 "${testcvs} -q update -A" "U file1"
5817 echo add a line >>file2
5818 dotest editor-9 "${testcvs} -q -e ${TESTDIR}/editme ci -rbr file2" \
5820 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
5821 new revision: 1\.1\.2\.1; previous revision: 1\.1
5824 dotest editor-log-file1 "${testcvs} log -N file1" "
5825 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
5831 keyword substitution: kv
5832 total revisions: 2; selected revisions: 2
5834 ----------------------------
5836 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
5839 xCVS: ----------------------------------------------------------------------
5840 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
5842 xCVS: Committing in .
5846 xCVS: ----------------------------------------------------------------------
5847 ----------------------------
5849 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
5851 xCVS: ----------------------------------------------------------------------
5852 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
5854 xCVS: Committing in .
5856 xCVS: Modified Files:
5859 xCVS: ----------------------------------------------------------------------
5860 ============================================================================="
5862 # The only difference between the two expect strings is the
5863 # presence or absence of "Committing in ." for 1.1.2.1.
5864 dotest editor-log-file2 "${testcvs} log -N file2" "
5865 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
5871 keyword substitution: kv
5872 total revisions: 2; selected revisions: 2
5874 ----------------------------
5876 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
5879 xCVS: ----------------------------------------------------------------------
5880 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
5882 xCVS: Committing in .
5886 xCVS: ----------------------------------------------------------------------
5887 ----------------------------
5889 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
5891 xCVS: ----------------------------------------------------------------------
5892 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
5894 xCVS: Modified Files:
5897 xCVS: ----------------------------------------------------------------------
5898 =============================================================================" "
5899 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
5905 keyword substitution: kv
5906 total revisions: 2; selected revisions: 2
5908 ----------------------------
5910 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
5913 xCVS: ----------------------------------------------------------------------
5914 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
5916 xCVS: Committing in .
5920 xCVS: ----------------------------------------------------------------------
5921 ----------------------------
5923 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
5925 xCVS: ----------------------------------------------------------------------
5926 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
5928 xCVS: Committing in .
5930 xCVS: Modified Files:
5933 xCVS: ----------------------------------------------------------------------
5934 ============================================================================="
5937 rm ${TESTDIR}/editme
5938 rm -rf ${CVSROOT_DIRNAME}/first-dir
5942 mkdir ${CVSROOT_DIRNAME}/1dir
5945 if ${testcvs} -q co 1dir; then
5952 if ${testcvs} add foo 2>>${LOGFILE}; then
5957 if ${testcvs} ci -m added >>${LOGFILE} 2>&1; then
5965 if ${testcvs} -q co 1dir >>${LOGFILE}; then
5973 if ${testcvs} rm foo >>${LOGFILE} 2>&1; then
5978 if ${testcvs} ci -m removed >>${LOGFILE} 2>&1; then
5985 # FIXME: should be using dotest.
5986 ${testcvs} -q update 2>../tst167.err
5987 cat ../tst167.err >>${LOGFILE}
5988 cat <<EOF >../tst167.ans
5989 ${PROG} server: warning: foo is not (any longer) pertinent
5990 ${PROG} update: unable to remove ./foo: Permission denied
5992 if cmp ../tst167.ans ../tst167.err >/dev/null ||
5993 ( echo "${PROG} [update aborted]: cannot rename file foo to CVS/,,foo: Permission denied" | cmp - ../tst167.err >/dev/null )
6004 rm -rf ${CVSROOT_DIRNAME}/1dir
6008 # More tests of various miscellaneous error handling,
6009 # and cvs add behavior in general.
6010 # See also test basicb-4a, concerning "cvs ci CVS".
6011 # Too many tests to mention test the simple cases of
6012 # adding files and directories.
6013 # Test basicb-2a10 tests cvs -n add.
6015 # First the usual setup; create a directory first-dir.
6017 dotest errmsg2-1 "${testcvs} -q co -l ." ''
6019 dotest errmsg2-2 "${testcvs} add first-dir" \
6020 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
6022 dotest_fail errmsg2-3 "${testcvs} add CVS" \
6023 "${PROG} [a-z]*: cannot add special file .CVS.; skipping"
6025 # For the most part add returns a failure exitstatus if
6026 # there are any errors, even if the remaining files are
6027 # processed without incident. The "cannot add
6028 # special file" message fits this pattern, at
6030 dotest_fail errmsg2-4 "${testcvs} add CVS file1" \
6031 "${PROG} [a-z]*: cannot add special file .CVS.; skipping
6032 ${PROG} [a-z]*: scheduling file .file1. for addition
6033 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
6034 # I'm not sure these tests completely convey the various strange
6035 # behaviors that CVS had before it specially checked for "." and
6036 # "..". Suffice it to say that these are unlikely to work right
6037 # without a special case.
6038 dotest_fail errmsg2-5 "${testcvs} add ." \
6039 "${PROG} [a-z]*: cannot add special file .\..; skipping"
6040 dotest_fail errmsg2-6 "${testcvs} add .." \
6041 "${PROG} [a-z]*: cannot add special file .\.\..; skipping"
6042 # Make sure that none of the error messages left droppings
6043 # which interfere with normal operation.
6044 dotest errmsg2-7 "${testcvs} -q ci -m add-file1" \
6045 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
6048 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
6049 initial revision: 1\.1
6053 dotest errmsg2-8 "${testcvs} add first-dir/sdir" \
6054 "Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
6060 dotest errmsg2-10 "${testcvs} add file10 sdir10" \
6061 "${PROG} [a-z]*: scheduling file .file10. for addition
6062 Directory ${TESTDIR}/cvsroot/first-dir/sdir10 added to the repository
6063 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
6064 dotest errmsg2-11 "${testcvs} -q ci -m add-file10" \
6065 "RCS file: ${TESTDIR}/cvsroot/first-dir/file10,v
6068 ${TESTDIR}/cvsroot/first-dir/file10,v <-- file10
6069 initial revision: 1\.1
6071 # Try to see that there are no droppings left by
6072 # any of the previous tests.
6073 dotest errmsg2-12 "${testcvs} -q update" ""
6075 # Now test adding files with '/' in the name, both one level
6076 # down and more than one level down.
6078 mkdir first-dir/sdir10/ssdir
6079 dotest errmsg2-13 "${testcvs} add first-dir/sdir10/ssdir" \
6080 "Directory ${TESTDIR}/cvsroot/first-dir/sdir10/ssdir added to the repository"
6082 touch first-dir/sdir10/ssdir/ssfile
6084 "${testcvs} add first-dir/sdir10/ssdir/ssfile" \
6085 "${PROG} [a-z]*: scheduling file .first-dir/sdir10/ssdir/ssfile. for addition
6086 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
6087 touch first-dir/file15
6088 dotest errmsg2-15 "${testcvs} add first-dir/file15" \
6089 "${PROG} [a-z]*: scheduling file .first-dir/file15. for addition
6090 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
6092 # Now the case where we try to give it a directory which is not
6093 # under CVS control.
6095 touch bogus-dir/file16
6096 # The first message, from local CVS, is nice. The second one
6097 # is not nice; would be good to fix remote CVS to give a clearer
6098 # message (e.g. the one from local CVS). But at least it is an
6100 dotest_fail errmsg2-16 "${testcvs} add bogus-dir/file16" \
6101 "${PROG} [a-z]*: in directory bogus-dir:
6102 ${PROG} \[[a-z]* aborted\]: there is no version here; do .${PROG} checkout. first" \
6103 "${PROG} [a-z]*: cannot open CVS/Entries for reading: No such file or directory
6104 ${PROG} \[add aborted\]: no repository"
6107 # One error condition we don't test for is trying to add a file
6108 # or directory which already is there.
6110 dotest errmsg2-17 "${testcvs} -q ci -m checkin" \
6111 "RCS file: ${TESTDIR}/cvsroot/first-dir/file15,v
6113 Checking in first-dir/file15;
6114 ${TESTDIR}/cvsroot/first-dir/file15,v <-- file15
6115 initial revision: 1\.1
6117 RCS file: ${TESTDIR}/cvsroot/first-dir/sdir10/ssdir/ssfile,v
6119 Checking in first-dir/sdir10/ssdir/ssfile;
6120 ${TESTDIR}/cvsroot/first-dir/sdir10/ssdir/ssfile,v <-- ssfile
6121 initial revision: 1\.1
6126 rm -rf ${TESTDIR}/cvsroot/first-dir
6130 mkdir ${CVSROOT_DIRNAME}/first-dir
6133 if ${testcvs} -q co first-dir >>${LOGFILE} ; then
6141 if ${testcvs} add abb 2>>${LOGFILE}; then
6146 if ${testcvs} ci -m added >>${LOGFILE} 2>&1; then
6151 dotest_fail 171a0 "${testcvs} watch" "Usage${DOTSTAR}"
6152 if ${testcvs} watch on; then
6158 if ${testcvs} add abc 2>>${LOGFILE}; then
6163 if ${testcvs} ci -m added >>${LOGFILE} 2>&1; then
6173 if ${testcvs} -q co first-dir >>${LOGFILE}; then
6179 if test -w abb; then
6184 if test -w abc; then
6190 if ${testcvs} editors >../ans178.tmp; then
6195 cat ../ans178.tmp >>${LOGFILE}
6196 if test -s ../ans178.tmp; then
6202 if ${testcvs} edit abb; then
6208 if ${testcvs} editors >../ans180.tmp; then
6213 cat ../ans180.tmp >>${LOGFILE}
6214 if test -s ../ans180.tmp; then
6221 if ${testcvs} ci -m modify abb >>${LOGFILE} 2>&1; then
6226 # Unedit of a file not being edited should be a noop.
6227 dotest 182.5 "${testcvs} unedit abb" ''
6229 if ${testcvs} editors >../ans183.tmp; then
6234 cat ../ans183.tmp >>${LOGFILE}
6235 if test -s ../ans183.tmp; then
6241 if test -w abb; then
6247 if ${testcvs} edit abc; then
6252 # Unedit of an unmodified file.
6253 if ${testcvs} unedit abc; then
6258 if ${testcvs} edit abc; then
6263 echo changedabc >abc
6264 # Try to unedit a modified file; cvs should ask for confirmation
6265 if (echo no | ${testcvs} unedit abc) >>${LOGFILE}; then
6270 if echo changedabc | cmp - abc; then
6275 # OK, now confirm the unedit
6276 if (echo yes | ${testcvs} unedit abc) >>${LOGFILE}; then
6281 if echo abc | cmp - abc; then
6287 dotest devcom-a0 "${testcvs} watchers" ''
6289 # FIXME: This probably should be an error message instead
6290 # of silently succeeding and printing nothing.
6291 dotest devcom-a-nonexist "${testcvs} watchers nonexist" ''
6293 dotest devcom-a1 "${testcvs} watch add" ''
6294 dotest devcom-a2 "${testcvs} watchers" \
6295 "abb ${username} edit unedit commit
6296 abc ${username} edit unedit commit"
6297 dotest devcom-a3 "${testcvs} watch remove -a unedit abb" ''
6298 dotest devcom-a4 "${testcvs} watchers abb" \
6299 "abb ${username} edit commit"
6301 # Check tagging and checking out while we have a CVS
6302 # directory in the repository.
6303 dotest devcom-t0 "${testcvs} -q tag tag" \
6310 # Test commented out because the bug it tests for is not fixed
6312 # cvs watchers: cannot open CVS/Entries for reading: No such file or directory
6313 # cvs: ../../work/ccvs/src/fileattr.c:75: fileattr_read: Assertion `fileattr_stored_repos != ((void *)0)' failed.
6314 : dotest devcom-t-nonexist "${testcvs} watchers nonexist" fixme
6316 dotest devcom-t1 "${testcvs} -q co -rtag first-dir/abb" \
6319 # Since first-dir/abb is readonly, use -f.
6322 # Test checking out the directory rather than the file.
6325 dotest devcom-t2 "${testcvs} -q co -rtag first-dir" \
6329 # Since the files are readonly, use -f.
6332 # Now do it again, after removing the val-tags file created
6333 # by devcom-t1 to force CVS to search the repository
6334 # containing CVS directories.
6335 rm ${CVSROOT_DIRNAME}/CVSROOT/val-tags
6338 dotest devcom-t3 "${testcvs} -q co -rtag first-dir" \
6342 # Since the files are readonly, use -f.
6345 # Now remove all the file attributes
6347 dotest devcom-b0 "${testcvs} watch off" ''
6348 dotest devcom-b1 "${testcvs} watch remove" ''
6349 # Test that CVS 1.6 and earlier can handle the repository.
6350 dotest_fail devcom-b2 "test -d ${CVSROOT_DIRNAME}/first-dir/CVS"
6352 # Now test watching just some, not all, files.
6353 dotest devcom-some0 "${testcvs} watch on abc" ''
6357 dotest devcom-some1 "${testcvs} -q co first-dir" 'U first-dir/abb
6359 dotest devcom-some2 "test -w first-dir/abb" ''
6360 dotest_fail devcom-some3 "test -w first-dir/abc" ''
6363 if test "$keep" = yes; then
6364 echo Keeping ${TESTDIR} and exiting due to --keep
6368 # Use -f because of the readonly files.
6370 rm -rf ${CVSROOT_DIRNAME}/first-dir
6374 # More watch tests, most notably setting watches on
6375 # files in various different states.
6376 mkdir ${CVSROOT_DIRNAME}/first-dir
6379 dotest devcom2-1 "${testcvs} -q co first-dir" ''
6382 # This should probably be an error; setting a watch on a totally
6383 # unknown file is more likely to be a typo than intentional.
6384 # But that isn't the currently implemented behavior.
6385 dotest devcom2-2 "${testcvs} watch on w1" ''
6388 dotest devcom2-3 "${testcvs} add w1 w2 w3 nw1" "${DOTSTAR}"
6389 # Letting the user set the watch here probably can be considered
6390 # a feature--although it leads to a few potentially strange
6391 # consequences like one user can set the watch and another actually
6393 dotest devcom2-4 "${testcvs} watch on w2" ''
6394 dotest devcom2-5 "${testcvs} -q ci -m add-them" "${DOTSTAR}"
6396 # Note that this test differs in a subtle way from devcom-some0;
6397 # in devcom-some0 the watch is creating a new fileattr file, and
6398 # here we are modifying an existing one.
6399 dotest devcom2-6 "${testcvs} watch on w3" ''
6401 # Now test that all the watches got set on the correct files
6402 # FIXME: CVS should have a way to report whether watches are
6403 # set, I think. The "check it out and see if it read-only" is
6404 # sort of OK, but is complicated by CVSREAD and doesn't help
6405 # if the file is added and not yet committed or some such.
6406 # Probably "cvs status" should report "watch: on" if watch is on
6407 # (and nothing if watch is off, so existing behavior is preserved).
6411 dotest devcom2-7 "${testcvs} -q co first-dir" 'U first-dir/nw1
6415 dotest devcom2-8 "test -w first-dir/nw1" ''
6416 dotest_fail devcom2-9 "test -w first-dir/w1" ''
6417 dotest_fail devcom2-10 "test -w first-dir/w2" ''
6418 dotest_fail devcom2-11 "test -w first-dir/w3" ''
6421 # OK, now we want to try files in various states with cvs edit.
6422 dotest devcom2-12 "${testcvs} edit w4" \
6423 "${PROG} edit: no such file w4; ignored"
6424 # Try the same thing with a per-directory watch set.
6425 dotest devcom2-13 "${testcvs} watch on" ''
6426 dotest devcom2-14 "${testcvs} edit w5" \
6427 "${PROG} edit: no such file w5; ignored"
6428 dotest devcom2-15 "${testcvs} editors" ''
6429 dotest devcom2-16 "${testcvs} editors w4" ''
6430 # Make sure there are no droppings lying around
6431 dotest devcom2-17 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
6441 # Use -f because of the readonly files.
6443 rm -rf ${CVSROOT_DIRNAME}/first-dir
6447 # More watch tests, most notably handling of features designed
6448 # for future expansion.
6449 mkdir ${CVSROOT_DIRNAME}/first-dir
6452 dotest devcom3-1 "${testcvs} -q co first-dir" ''
6456 dotest devcom3-2 "${testcvs} add w1 w2" "${DOTSTAR}"
6457 dotest devcom3-3 "${testcvs} watch on w1 w2" ''
6458 dotest devcom3-4 "${testcvs} -q ci -m add-them" "${DOTSTAR}"
6460 # OK, since we are about to delve into CVS's internals, make
6461 # sure that we seem to be correct about how they work.
6462 dotest devcom3-5 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
6465 # Now write a few more lines, just as if we were a newer version
6466 # of CVS implementing some new feature.
6467 cat <<EOF >>${CVSROOT_DIRNAME}/first-dir/CVS/fileattr
6471 # Now get CVS to write to the fileattr file....
6472 dotest devcom3-6 "${testcvs} watch off w1" ''
6473 # ...and make sure that it hasn't clobbered our new lines.
6474 # Note that writing these lines in another order would be OK
6476 dotest devcom3-7 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
6481 # See what CVS does when a file name is duplicated. The
6482 # behavior of all versions of CVS since file attributes were
6483 # implemented is that it nukes the duplications. This seems
6484 # reasonable enough, although it means it isn't clear how
6485 # useful duplicates would be for purposes of future
6486 # expansion. But in the interests of keeping behaviors
6487 # predictable, might as well test for it, I guess.
6488 echo 'Fw2 duplicate=' >>${CVSROOT_DIRNAME}/first-dir/CVS/fileattr
6489 dotest devcom3-8 "${testcvs} watch on w1" ''
6490 dotest devcom3-9 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
6498 # Use -f because of the readonly files.
6500 rm -rf ${CVSROOT_DIRNAME}/first-dir
6504 # More watch tests, including adding directories.
6506 dotest watch4-0a "${testcvs} -q co -l ." ''
6508 dotest watch4-0b "${testcvs} add first-dir" \
6509 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
6512 dotest watch4-1 "${testcvs} watch on" ''
6513 # This is just like the 173 test
6515 dotest watch4-2 "${testcvs} add file1" \
6516 "${PROG} [a-z]*: scheduling file .file1. for addition
6517 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
6518 dotest watch4-3 "${testcvs} -q ci -m add" \
6519 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
6522 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
6523 initial revision: 1\.1
6525 # Now test the analogous behavior for directories.
6527 dotest watch4-4 "${testcvs} add subdir" \
6528 "Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository"
6531 dotest watch4-5 "${testcvs} add sfile" \
6532 "${PROG} [a-z]*: scheduling file .sfile. for addition
6533 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
6534 dotest watch4-6 "${testcvs} -q ci -m add" \
6535 "RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/sfile,v
6538 ${TESTDIR}/cvsroot/first-dir/subdir/sfile,v <-- sfile
6539 initial revision: 1\.1
6543 dotest watch4-7 "${testcvs} -q co first-dir" "U first-dir/file1
6544 U first-dir/subdir/sfile"
6545 dotest_fail watch4-8 "test -w first-dir/file1" ''
6546 dotest_fail watch4-9 "test -w first-dir/subdir/sfile" ''
6548 dotest watch4-10 "${testcvs} edit file1" ''
6549 echo 'edited in 2' >file1
6553 dotest watch4-11 "${testcvs} edit file1" ''
6554 echo 'edited in 1' >file1
6555 dotest watch4-12 "${testcvs} -q ci -m edit-in-1" \
6557 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
6558 new revision: 1\.2; previous revision: 1\.1
6562 dotest watch4-13 "${testcvs} -q update" \
6563 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
6564 retrieving revision 1\.1
6565 retrieving revision 1\.2
6566 Merging differences between 1\.1 and 1\.2 into file1
6567 rcsmerge: warning: conflicts during merge
6568 ${PROG} [a-z]*: conflicts found in file1
6570 if (echo yes | ${testcvs} unedit file1) >>${LOGFILE}; then
6575 # This could plausibly be defined to either go back to the revision
6576 # which was cvs edit'd (the status quo), or back to revision 1.2
6577 # (that is, the merge could update CVS/Base/file1). We pick the
6578 # former because it is easier to implement, not because we have
6579 # thought much about which is better.
6580 dotest watch4-16 "cat file1" ''
6581 # Make sure CVS really thinks we are at 1.1.
6582 dotest watch4-17 "${testcvs} -q update" "U file1"
6583 dotest watch4-18 "cat file1" "edited in 1"
6586 # As a sanity check, make sure we are in the right place.
6587 dotest watch4-cleanup-1 "test -d 1" ''
6588 dotest watch4-cleanup-1 "test -d 2" ''
6589 # Specify -f because of the readonly files.
6591 rm -rf ${CVSROOT_DIRNAME}/first-dir
6595 # On Windows, we can't check out CVSROOT, because the case
6596 # insensitivity means that this conflicts with cvsroot.
6600 dotest 187a1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
6602 echo rootig.c >cvsignore
6603 dotest 187a2 "${testcvs} add cvsignore" "${PROG}"' [a-z]*: scheduling file `cvsignore'"'"' for addition
6604 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
6606 # As of Jan 96, local CVS prints "Examining ." and remote doesn't.
6608 dotest 187a3 " ${testcvs} ci -m added" \
6609 "${PROG} [a-z]*: Examining \.
6610 RCS file: ${TESTDIR}/cvsroot/CVSROOT/cvsignore,v
6612 Checking in cvsignore;
6613 ${TESTDIR}/cvsroot/CVSROOT/cvsignore,v <-- cvsignore
6614 initial revision: 1\.1
6616 ${PROG} [a-z]*: Rebuilding administrative file database"
6619 if echo "yes" | ${testcvs} release -d CVSROOT >>${LOGFILE} ; then
6625 # CVS looks at the home dir from getpwuid, not HOME (is that correct
6626 # behavior?), so this is hard to test and we won't try.
6627 # echo foobar.c >${HOME}/.cvsignore
6628 CVSIGNORE=envig.c; export CVSIGNORE
6631 touch foobar.c bar.c rootig.c defig.o envig.c optig.c
6632 # We use sort because we can't predict the order in which
6633 # the files will be listed.
6634 dotest_sort 188a "${testcvs} import -m m -I optig.c first-dir tag1 tag2" \
6640 I first-dir/rootig.c
6642 N first-dir/foobar.c
6643 No conflicts created by this import'
6644 dotest_sort 188b "${testcvs} import -m m -I ! second-dir tag3 tag4" \
6648 N second-dir/defig.o
6649 N second-dir/envig.c
6650 N second-dir/foobar.c
6651 N second-dir/optig.c
6652 N second-dir/rootig.c
6653 No conflicts created by this import'
6659 dotest 189a "${testcvs} -q co second-dir" \
6661 U second-dir/defig.o
6662 U second-dir/envig.c
6663 U second-dir/foobar.c
6664 U second-dir/optig.c
6665 U second-dir/rootig.c'
6666 dotest 189b "${testcvs} -q co first-dir" 'U first-dir/bar.c
6667 U first-dir/foobar.c'
6669 touch rootig.c defig.o envig.c optig.c notig.c
6670 dotest 189c "${testcvs} -q update -I optig.c" "${QUESTION} notig.c"
6671 # The fact that CVS requires us to specify -I CVS here strikes me
6673 dotest_sort 189d "${testcvs} -q update -I ! -I CVS" \
6674 "${QUESTION} defig.o
6678 ${QUESTION} rootig.c"
6680 # Now test that commands other than update also print "? notig.c"
6681 # where appropriate. Only test this for remote, because local
6682 # CVS only prints it on update.
6684 if test "x$remote" = xyes; then
6685 dotest 189e "${testcvs} -q diff" "${QUESTION} notig.c"
6687 # Force the server to be contacted. Ugh. Having CVS
6688 # contact the server for the sole purpose of checking
6689 # the CVSROOT/cvsignore file does not seem like such a
6690 # good idea, so I imagine this will continue to be
6691 # necessary. Oh well, at least we test CVS's ablity to
6692 # handle a file with a modified timestamp but unmodified
6696 dotest 189f "${testcvs} -q ci -m commit-it" "${QUESTION} notig.c"
6699 # now test .cvsignore files
6701 echo notig.c >first-dir/.cvsignore
6702 echo foobar.c >second-dir/.cvsignore
6703 touch first-dir/notig.c second-dir/notig.c second-dir/foobar.c
6704 dotest_sort 190 "${testcvs} -qn update" \
6705 "${QUESTION} first-dir/.cvsignore
6706 ${QUESTION} second-dir/.cvsignore
6707 ${QUESTION} second-dir/notig.c"
6708 dotest_sort 191 "${testcvs} -qn update -I! -I CVS" \
6709 "${QUESTION} first-dir/.cvsignore
6710 ${QUESTION} first-dir/defig.o
6711 ${QUESTION} first-dir/envig.c
6712 ${QUESTION} first-dir/rootig.c
6713 ${QUESTION} second-dir/.cvsignore
6714 ${QUESTION} second-dir/notig.c"
6716 if echo yes | ${testcvs} release -d first-dir \
6717 >${TESTDIR}/ignore.tmp; then
6722 dotest ignore-193 "cat ${TESTDIR}/ignore.tmp" \
6723 "${QUESTION} \.cvsignore
6724 You have \[0\] altered files in this repository.
6725 Are you sure you want to release (and delete) directory .first-dir': "
6727 echo add a line >>second-dir/foobar.c
6728 rm second-dir/notig.c second-dir/.cvsignore
6729 if echo yes | ${testcvs} release -d second-dir \
6730 >${TESTDIR}/ignore.tmp; then
6735 dotest ignore-195 "cat ${TESTDIR}/ignore.tmp" \
6737 You have \[1\] altered files in this repository.
6738 Are you sure you want to release (and delete) directory .second-dir': "
6743 rm ${TESTDIR}/ignore.tmp
6744 rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
6748 # Test cvs's ability to handle binary files.
6749 mkdir ${CVSROOT_DIRNAME}/first-dir
6751 dotest binfiles-1 "${testcvs} -q co first-dir" ''
6752 awk 'BEGIN { printf "%c%c%c%c%c%c", 2, 10, 137, 0, 13, 10 }' \
6753 </dev/null >binfile.dat
6754 cat binfile.dat binfile.dat >binfile2.dat
6756 cp ../binfile.dat binfile
6757 dotest binfiles-2 "${testcvs} add -kb binfile" \
6758 "${PROG}"' [a-z]*: scheduling file `binfile'\'' for addition
6759 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
6760 dotest binfiles-3 "${testcvs} -q ci -m add-it" \
6761 "RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
6763 Checking in binfile;
6764 ${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
6765 initial revision: 1\.1
6769 dotest binfiles-4 "${testcvs} -q co first-dir" 'U first-dir/binfile'
6771 dotest binfiles-5 "cmp ../../1/binfile.dat binfile" ''
6772 # Testing that sticky options is -kb is the closest thing we have
6773 # to testing that binary files work right on non-unix machines
6774 # (until there is automated testing for such machines, of course).
6775 dotest binfiles-5.5 "${testcvs} status binfile" \
6776 "===================================================================
6777 File: binfile Status: Up-to-date
6779 Working revision: 1\.1.*
6780 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/binfile,v
6783 Sticky Options: -kb"
6785 # Test whether the default options from the RCS file are
6786 # also used when operating on files instead of whole
6790 dotest binfiles-5.5b0 "${testcvs} -q co first-dir/binfile" \
6791 'U first-dir/binfile'
6793 dotest binfiles-5.5b1 "${testcvs} status binfile" \
6794 "===================================================================
6795 File: binfile Status: Up-to-date
6797 Working revision: 1\.1.*
6798 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/binfile,v
6801 Sticky Options: -kb"
6806 cp ../../1/binfile2.dat binfile
6807 dotest binfiles-6 "${testcvs} -q ci -m modify-it" \
6808 "Checking in binfile;
6809 ${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
6810 new revision: 1\.2; previous revision: 1\.1
6812 cd ../../1/first-dir
6813 dotest binfiles-7 "${testcvs} -q update" '[UP] binfile'
6814 dotest binfiles-8 "cmp ../binfile2.dat binfile" ''
6816 # Now test handling of conflicts with binary files.
6817 cp ../binfile.dat binfile
6818 dotest binfiles-con0 "${testcvs} -q ci -m modify-it" \
6819 "Checking in binfile;
6820 ${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
6821 new revision: 1\.3; previous revision: 1\.2
6823 cd ../../2/first-dir
6824 echo 'edits in dir 2' >binfile
6825 dotest binfiles-con1 "${testcvs} -q update" \
6827 ${PROG} [a-z]*: nonmergeable file needs merge
6828 ${PROG} [a-z]*: revision 1\.3 from repository is now in binfile
6829 ${PROG} [a-z]*: file from working directory is now in \.#binfile\.1\.2
6831 dotest binfiles-con2 "cmp binfile ../../1/binfile.dat" ''
6832 dotest binfiles-con3 "cat .#binfile.1.2" 'edits in dir 2'
6834 cp ../../1/binfile2.dat binfile
6835 dotest binfiles-con4 "${testcvs} -q ci -m resolve-it" \
6836 "Checking in binfile;
6837 ${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
6838 new revision: 1\.4; previous revision: 1\.3
6840 cd ../../1/first-dir
6841 dotest binfiles-con5 "${testcvs} -q update" '[UP] binfile'
6843 dotest binfiles-9 "${testcvs} -q update -A" ''
6844 dotest binfiles-10 "${testcvs} -q update -kk" '[UP] binfile'
6845 dotest binfiles-11 "${testcvs} -q update" ''
6846 dotest binfiles-12 "${testcvs} -q update -A" '[UP] binfile'
6847 dotest binfiles-13 "${testcvs} -q update -A" ''
6854 dotest binfiles-13a0 "${testcvs} -q co -r HEAD first-dir" \
6855 'U first-dir/binfile'
6857 dotest binfiles-13a1 "${testcvs} status binfile" \
6858 "===================================================================
6859 File: binfile Status: Up-to-date
6861 Working revision: 1\.4.*
6862 Repository revision: 1\.4 ${TESTDIR}/cvsroot/first-dir/binfile,v
6863 Sticky Tag: HEAD (revision: 1\.4)
6865 Sticky Options: -kb"
6870 echo 'this file is $''RCSfile$' >binfile
6871 dotest binfiles-14a "${testcvs} -q ci -m modify-it" \
6872 "Checking in binfile;
6873 ${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
6874 new revision: 1\.5; previous revision: 1\.4
6876 dotest binfiles-14b "cat binfile" 'this file is $''RCSfile$'
6877 # See binfiles-5.5 for discussion of -kb.
6878 dotest binfiles-14c "${testcvs} status binfile" \
6879 "===================================================================
6880 File: binfile Status: Up-to-date
6882 Working revision: 1\.5.*
6883 Repository revision: 1\.5 ${TESTDIR}/cvsroot/first-dir/binfile,v
6886 Sticky Options: -kb"
6887 dotest binfiles-14d "${testcvs} admin -kv binfile" \
6888 "RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
6890 # cvs admin doesn't change the checked-out file or its sticky
6891 # kopts. There probably should be a way which does (but
6892 # what if the file is modified? And do we try to version
6893 # control the kopt setting?)
6894 dotest binfiles-14e "cat binfile" 'this file is $''RCSfile$'
6895 dotest binfiles-14f "${testcvs} status binfile" \
6896 "===================================================================
6897 File: binfile Status: Up-to-date
6899 Working revision: 1\.5.*
6900 Repository revision: 1\.5 ${TESTDIR}/cvsroot/first-dir/binfile,v
6903 Sticky Options: -kb"
6904 dotest binfiles-14g "${testcvs} -q update -A" '[UP] binfile'
6905 dotest binfiles-14h "cat binfile" 'this file is binfile,v'
6906 dotest binfiles-14i "${testcvs} status binfile" \
6907 "===================================================================
6908 File: binfile Status: Up-to-date
6910 Working revision: 1\.5.*
6911 Repository revision: 1\.5 ${TESTDIR}/cvsroot/first-dir/binfile,v
6914 Sticky Options: -kv"
6916 # Do sticky options work when used with 'cvs update'?
6917 echo "Not a binary file." > nibfile
6918 dotest binfiles-sticky1 "${testcvs} -q add nibfile" \
6919 "${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
6920 dotest binfiles-sticky2 "${testcvs} -q ci -m add-it nibfile" \
6921 "RCS file: ${TESTDIR}/cvsroot/first-dir/nibfile,v
6923 Checking in nibfile;
6924 ${TESTDIR}/cvsroot/first-dir/nibfile,v <-- nibfile
6925 initial revision: 1\.1
6927 dotest binfiles-sticky3 "${testcvs} -q update -kb nibfile" \
6929 dotest binfiles-sticky4 "${testcvs} -q status nibfile" \
6930 "===================================================================
6931 File: nibfile Status: Up-to-date
6933 Working revision: 1\.1.*
6934 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/nibfile,v
6937 Sticky Options: -kb"
6939 # Now test that -A can clear the sticky option.
6940 dotest binfiles-sticky5 "${testcvs} -q update -A nibfile" \
6942 dotest binfiles-sticky6 "${testcvs} -q status nibfile" \
6943 "===================================================================
6944 File: nibfile Status: Up-to-date
6946 Working revision: 1\.1.*
6947 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/nibfile,v
6950 Sticky Options: (none)"
6951 dotest binfiles-15 "${testcvs} -q admin -kb nibfile" \
6952 "RCS file: ${TESTDIR}/cvsroot/first-dir/nibfile,v
6954 dotest binfiles-16 "${testcvs} -q update nibfile" "[UP] nibfile"
6955 dotest binfiles-17 "${testcvs} -q status nibfile" \
6956 "===================================================================
6957 File: nibfile Status: Up-to-date
6959 Working revision: 1\.1.*
6960 Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/nibfile,v
6963 Sticky Options: -kb"
6965 dotest binfiles-o1 "${testcvs} admin -o1.3:: binfile" \
6966 "RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
6967 deleting revision 1\.5
6968 deleting revision 1\.4
6970 dotest binfiles-o2 "${testcvs} admin -o::1.3 binfile" \
6971 "RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
6972 deleting revision 1\.2
6973 deleting revision 1\.1
6975 dotest binfiles-o3 "${testcvs} -q log -h -N binfile" "
6976 RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
6977 Working file: binfile
6982 keyword substitution: v
6984 ============================================================================="
6987 rm -rf ${CVSROOT_DIRNAME}/first-dir
6992 # Test cvs's ability to handle binary files, particularly branching
6993 # and joining. The key thing we are worrying about is that CVS
6994 # doesn't print "cannot merge binary files" or some such, in
6995 # situations where no merging is required.
6996 # See also "join" which does this with non-binary files.
6998 # Cases (we are merging from the branch to the trunk):
6999 # binfile.dat) File added on branch, not on trunk.
7000 # File should be marked for addition.
7001 # brmod) File modified on branch, not on trunk.
7002 # File should be copied over to trunk (no merging is needed).
7003 # brmod-trmod) File modified on branch, also on trunk.
7004 # This is a conflict. Present the user with both files and
7005 # let them figure it out.
7006 # brmod-wdmod) File modified on branch, not modified in the trunk
7007 # repository, but modified in the (trunk) working directory.
7008 # This is also a conflict.
7010 mkdir ${CVSROOT_DIRNAME}/first-dir
7012 dotest binfiles2-1 "${testcvs} -q co first-dir" ''
7015 # The most important thing here is that binfile, binfile2, &c
7016 # each be distinct from each other. We also make sure to include
7017 # a few likely end-of-line patterns to make sure nothing is
7018 # being munged as if in text mode.
7019 awk 'BEGIN { printf "%c%c%c%c%c%c", 2, 10, 137, 0, 13, 10 }' \
7020 </dev/null >../binfile
7021 cat ../binfile ../binfile >../binfile2
7022 cat ../binfile2 ../binfile >../binfile3
7024 # FIXCVS: unless a branch has at least one file on it,
7025 # tag_check_valid won't know it exists. So if brmod didn't
7026 # exist, we would have to invent it.
7028 cp ../binfile brmod-trmod
7029 cp ../binfile brmod-wdmod
7030 dotest binfiles2-1a \
7031 "${testcvs} add -kb brmod brmod-trmod brmod-wdmod" \
7032 "${PROG} [a-z]*: scheduling file .brmod. for addition
7033 ${PROG} [a-z]*: scheduling file .brmod-trmod. for addition
7034 ${PROG} [a-z]*: scheduling file .brmod-wdmod. for addition
7035 ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
7036 dotest binfiles2-1b "${testcvs} -q ci -m add" \
7037 "RCS file: ${TESTDIR}/cvsroot/first-dir/brmod,v
7040 ${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
7041 initial revision: 1\.1
7043 RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
7045 Checking in brmod-trmod;
7046 ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
7047 initial revision: 1\.1
7049 RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v
7051 Checking in brmod-wdmod;
7052 ${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
7053 initial revision: 1\.1
7055 dotest binfiles2-2 "${testcvs} -q tag -b br" 'T brmod
7058 dotest binfiles2-3 "${testcvs} -q update -r br" ''
7059 cp ../binfile binfile.dat
7060 dotest binfiles2-4 "${testcvs} add -kb binfile.dat" \
7061 "${PROG} [a-z]*: scheduling file .binfile\.dat. for addition on branch .br.
7062 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
7063 cp ../binfile2 brmod
7064 cp ../binfile2 brmod-trmod
7065 cp ../binfile2 brmod-wdmod
7066 dotest binfiles2-5 "${testcvs} -q ci -m br-changes" \
7067 "RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/binfile\.dat,v
7069 Checking in binfile\.dat;
7070 ${TESTDIR}/cvsroot/first-dir/Attic/binfile\.dat,v <-- binfile\.dat
7071 new revision: 1\.1\.2\.1; previous revision: 1\.1
7074 ${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
7075 new revision: 1\.1\.2\.1; previous revision: 1\.1
7077 Checking in brmod-trmod;
7078 ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
7079 new revision: 1\.1\.2\.1; previous revision: 1\.1
7081 Checking in brmod-wdmod;
7082 ${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
7083 new revision: 1\.1\.2\.1; previous revision: 1\.1
7085 dotest binfiles2-6 "${testcvs} -q update -A" \
7086 "${PROG} [a-z]*: warning: binfile\.dat is not (any longer) pertinent
7090 dotest_fail binfiles2-7 "test -f binfile.dat" ''
7091 dotest binfiles2-7-brmod "cmp ../binfile brmod"
7092 cp ../binfile3 brmod-trmod
7093 dotest binfiles2-7a "${testcvs} -q ci -m tr-modify" \
7094 "Checking in brmod-trmod;
7095 ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
7096 new revision: 1\.2; previous revision: 1\.1
7098 cp ../binfile3 brmod-wdmod
7100 dotest binfiles2-8 "${testcvs} -q update -j br" \
7103 ${PROG} [a-z]*: nonmergeable file needs merge
7104 ${PROG} [a-z]*: revision 1.1.2.1 from repository is now in brmod-trmod
7105 ${PROG} [a-z]*: file from working directory is now in .#brmod-trmod.1.2
7108 ${PROG} [a-z]*: nonmergeable file needs merge
7109 ${PROG} [a-z]*: revision 1.1.2.1 from repository is now in brmod-wdmod
7110 ${PROG} [a-z]*: file from working directory is now in .#brmod-wdmod.1.1
7113 dotest binfiles2-9 "cmp ../binfile binfile.dat"
7114 dotest binfiles2-9-brmod "cmp ../binfile2 brmod"
7115 dotest binfiles2-9-brmod-trmod "cmp ../binfile2 brmod-trmod"
7116 dotest binfiles2-9-brmod-trmod "cmp ../binfile2 brmod-wdmod"
7117 dotest binfiles2-9a-brmod-trmod "cmp ../binfile3 .#brmod-trmod.1.2"
7118 dotest binfiles2-9a-brmod-wdmod "cmp ../binfile3 .#brmod-wdmod.1.1"
7120 # Test that everything was properly scheduled.
7121 dotest binfiles2-10 "${testcvs} -q ci -m checkin" \
7122 "Checking in binfile\.dat;
7123 ${TESTDIR}/cvsroot/first-dir/binfile\.dat,v <-- binfile\.dat
7124 new revision: 1\.2; previous revision: 1\.1
7127 ${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
7128 new revision: 1\.2; previous revision: 1\.1
7130 Checking in brmod-trmod;
7131 ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
7132 new revision: 1\.3; previous revision: 1\.2
7134 Checking in brmod-wdmod;
7135 ${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
7136 new revision: 1\.2; previous revision: 1\.1
7139 dotest_fail binfiles2-o1 "${testcvs} -q admin -o :1.2 brmod-trmod" \
7140 "RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
7141 deleting revision 1\.2
7142 ${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v: can't remove branch point 1\.1
7143 ${PROG} [a-z]*: cannot modify RCS file for .brmod-trmod."
7144 dotest binfiles2-o2 "${testcvs} -q admin -o 1.1.2.1: brmod-trmod" \
7145 "RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
7146 deleting revision 1\.1\.2\.1
7148 dotest binfiles2-o3 "${testcvs} -q admin -o :1.2 brmod-trmod" \
7149 "RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
7150 deleting revision 1\.2
7151 deleting revision 1\.1
7153 dotest binfiles2-o4 "${testcvs} -q log -N brmod-trmod" "
7154 RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
7155 Working file: brmod-trmod
7160 keyword substitution: b
7161 total revisions: 1; selected revisions: 1
7163 ----------------------------
7165 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
7167 ============================================================================="
7171 rm -rf ${CVSROOT_DIRNAME}/first-dir
7176 # See comment at "mwrap" test for list of other wrappers tests.
7177 # Test cvs's ability to handle nonmergeable files specified with
7178 # -m 'COPY' in wrappers. Similar to the binfiles2 test,
7179 # which tests the same thing for binary files
7180 # (which are non-mergeable in the same sense).
7182 # Cases (we are merging from the branch to the trunk):
7183 # brmod) File modified on branch, not on trunk.
7184 # File should be copied over to trunk (no merging is needed).
7185 # brmod-trmod) File modified on branch, also on trunk.
7186 # This is a conflict. Present the user with both files and
7187 # let them figure it out.
7188 # brmod-wdmod) File modified on branch, not modified in the trunk
7189 # repository, but modified in the (trunk) working directory.
7190 # This is also a conflict.
7192 # For the moment, remote CVS can't pass wrappers from CVSWRAPPERS
7193 # (see wrap_send). So skip these tests for remote.
7194 if test "x$remote" = xno; then
7196 mkdir ${CVSROOT_DIRNAME}/first-dir
7198 dotest mcopy-1 "${testcvs} -q co first-dir" ''
7201 # FIXCVS: unless a branch has at least one file on it,
7202 # tag_check_valid won't know it exists. So if brmod didn't
7203 # exist, we would have to invent it.
7204 echo 'brmod initial contents' >brmod
7205 echo 'brmod-trmod initial contents' >brmod-trmod
7206 echo 'brmod-wdmod initial contents' >brmod-wdmod
7207 echo "* -m 'COPY'" >.cvswrappers
7209 "${testcvs} add .cvswrappers brmod brmod-trmod brmod-wdmod" \
7210 "${PROG} [a-z]*: scheduling file .\.cvswrappers. for addition
7211 ${PROG} [a-z]*: scheduling file .brmod. for addition
7212 ${PROG} [a-z]*: scheduling file .brmod-trmod. for addition
7213 ${PROG} [a-z]*: scheduling file .brmod-wdmod. for addition
7214 ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
7215 dotest mcopy-1b "${testcvs} -q ci -m add" \
7216 "RCS file: ${TESTDIR}/cvsroot/first-dir/\.cvswrappers,v
7218 Checking in \.cvswrappers;
7219 ${TESTDIR}/cvsroot/first-dir/\.cvswrappers,v <-- \.cvswrappers
7220 initial revision: 1\.1
7222 RCS file: ${TESTDIR}/cvsroot/first-dir/brmod,v
7225 ${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
7226 initial revision: 1\.1
7228 RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v
7230 Checking in brmod-trmod;
7231 ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
7232 initial revision: 1\.1
7234 RCS file: ${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v
7236 Checking in brmod-wdmod;
7237 ${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
7238 initial revision: 1\.1
7241 # NOTE: .cvswrappers files are broken (see comment in
7242 # src/wrapper.c). So doing everything via the environment
7243 # variable is a workaround. Better would be to test them
7245 CVSWRAPPERS="* -m 'COPY'"
7247 dotest mcopy-2 "${testcvs} -q tag -b br" 'T \.cvswrappers
7251 dotest mcopy-3 "${testcvs} -q update -r br" ''
7252 echo 'modify brmod on br' >brmod
7253 echo 'modify brmod-trmod on br' >brmod-trmod
7254 echo 'modify brmod-wdmod on br' >brmod-wdmod
7255 dotest mcopy-5 "${testcvs} -q ci -m br-changes" \
7257 ${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
7258 new revision: 1\.1\.2\.1; previous revision: 1\.1
7260 Checking in brmod-trmod;
7261 ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
7262 new revision: 1\.1\.2\.1; previous revision: 1\.1
7264 Checking in brmod-wdmod;
7265 ${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
7266 new revision: 1\.1\.2\.1; previous revision: 1\.1
7268 dotest mcopy-6 "${testcvs} -q update -A" \
7272 dotest mcopy-7 "cat brmod brmod-trmod brmod-wdmod" \
7273 "brmod initial contents
7274 brmod-trmod initial contents
7275 brmod-wdmod initial contents"
7277 echo 'modify brmod-trmod again on trunk' >brmod-trmod
7278 dotest mcopy-7a "${testcvs} -q ci -m tr-modify" \
7279 "Checking in brmod-trmod;
7280 ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
7281 new revision: 1\.2; previous revision: 1\.1
7283 echo 'modify brmod-wdmod in working dir' >brmod-wdmod
7285 dotest mcopy-8 "${testcvs} -q update -j br" \
7287 ${PROG} [a-z]*: nonmergeable file needs merge
7288 ${PROG} [a-z]*: revision 1.1.2.1 from repository is now in brmod-trmod
7289 ${PROG} [a-z]*: file from working directory is now in .#brmod-trmod.1.2
7292 ${PROG} [a-z]*: nonmergeable file needs merge
7293 ${PROG} [a-z]*: revision 1.1.2.1 from repository is now in brmod-wdmod
7294 ${PROG} [a-z]*: file from working directory is now in .#brmod-wdmod.1.1
7297 dotest mcopy-9 "cat brmod brmod-trmod brmod-wdmod" \
7299 modify brmod-trmod on br
7300 modify brmod-wdmod on br"
7301 dotest mcopy-9a "cat .#brmod-trmod.1.2 .#brmod-wdmod.1.1" \
7302 "modify brmod-trmod again on trunk
7303 modify brmod-wdmod in working dir"
7305 # Test that everything was properly scheduled.
7306 dotest mcopy-10 "${testcvs} -q ci -m checkin" \
7308 ${TESTDIR}/cvsroot/first-dir/brmod,v <-- brmod
7309 new revision: 1\.2; previous revision: 1\.1
7311 Checking in brmod-trmod;
7312 ${TESTDIR}/cvsroot/first-dir/brmod-trmod,v <-- brmod-trmod
7313 new revision: 1\.3; previous revision: 1\.2
7315 Checking in brmod-wdmod;
7316 ${TESTDIR}/cvsroot/first-dir/brmod-wdmod,v <-- brmod-wdmod
7317 new revision: 1\.2; previous revision: 1\.1
7322 rm -rf ${CVSROOT_DIRNAME}/first-dir
7326 fi # end of tests to be skipped for remote
7331 # Test the ability to specify binary-ness based on file name.
7332 # See "mwrap" for a list of other wrappers tests.
7338 # While we're here, test for rejection of duplicate tag names.
7339 dotest_fail binwrap-0 \
7340 "${testcvs} import -m msg -I ! first-dir dup dup" \
7341 "${PROG} \[[a-z]* aborted\]: tag .dup. was specified more than once"
7343 if ${testcvs} import -m message -I ! -W "*.exe -k 'b'" \
7344 first-dir tag1 tag2 >>${LOGFILE}; then
7351 dotest binwrap-2 "${testcvs} -q co first-dir" 'U first-dir/foo.c
7352 U first-dir/foo.exe'
7353 dotest binwrap-3 "${testcvs} -q status first-dir" \
7354 "===================================================================
7355 File: foo\.c Status: Up-to-date
7357 Working revision: 1\.1\.1\.1.*
7358 Repository revision: 1\.1\.1\.1 ${TESTDIR}/cvsroot/first-dir/foo\.c,v
7361 Sticky Options: (none)
7363 ===================================================================
7364 File: foo\.exe Status: Up-to-date
7366 Working revision: 1\.1\.1\.1.*
7367 Repository revision: 1\.1\.1\.1 ${TESTDIR}/cvsroot/first-dir/foo\.exe,v
7370 Sticky Options: -kb"
7372 rm -rf ${CVSROOT_DIRNAME}/first-dir
7376 # Test the ability to specify binary-ness based on file name.
7377 # See "mwrap" for a list of other wrappers tests.
7383 # Specify that all files are binary except *.c.
7384 # The order seems to matter, with the earlier rules taking
7385 # precedence. I'm not sure whether that is good or not,
7386 # but it is the current behavior.
7387 if ${testcvs} import -m message -I ! \
7388 -W "*.c -k 'o'" -W "* -k 'b'" \
7389 first-dir tag1 tag2 >>${LOGFILE}; then
7396 dotest binwrap2-2 "${testcvs} -q co first-dir" 'U first-dir/foo.c
7397 U first-dir/foo.exe'
7398 dotest binwrap2-3 "${testcvs} -q status first-dir" \
7399 "===================================================================
7400 File: foo\.c Status: Up-to-date
7402 Working revision: 1\.1\.1\.1.*
7403 Repository revision: 1\.1\.1\.1 ${TESTDIR}/cvsroot/first-dir/foo\.c,v
7408 ===================================================================
7409 File: foo\.exe Status: Up-to-date
7411 Working revision: 1\.1\.1\.1.*
7412 Repository revision: 1\.1\.1\.1 ${TESTDIR}/cvsroot/first-dir/foo\.exe,v
7415 Sticky Options: -kb"
7417 rm -rf ${CVSROOT_DIRNAME}/first-dir
7421 # Test communication of file-specified -k wrappers between
7422 # client and server, in `import':
7424 # 1. Set up a directory tree, populate it with files.
7425 # 2. Give each directory a different .cvswrappers file.
7426 # 3. Give the server its own .cvswrappers file.
7427 # 4. Import the whole tree, see if the right files got set
7430 # The tree has a top ("0th") level, and two subdirs, sub1/
7431 # and sub2/; sub2/ contains directory subsub/. Every
7432 # directory has a .cvswrappers file as well as regular
7435 # In the file names, "foo-b.*" should end up binary, and
7436 # "foo-t.*" should end up text. Don't worry about the two
7437 # letter extensions; they're just there to help me keep
7440 # Here's the directory tree:
7450 # .cvswrappers .cvswrappers
7467 binwrap3_line1="This is a test file "
7468 binwrap3_line2="containing little of use "
7469 binwrap3_line3="except this non-haiku"
7471 binwrap3_text="${binwrap3_line1}${binwrap3_line2}${binwrap3_line3}"
7475 # On Windows, we can't check out CVSROOT, because the case
7476 # insensitivity means that this conflicts with cvsroot.
7480 mkdir binwrap3 # the 0th dir
7483 mkdir binwrap3/sub2/subsub
7485 echo "*.c0 -k 'b'" > binwrap3/.cvswrappers
7486 echo "whatever -k 'b'" >> binwrap3/.cvswrappers
7487 echo ${binwrap3_text} > binwrap3/foo-b.c0
7488 echo ${binwrap3_text} > binwrap3/foo-b.sb
7489 echo ${binwrap3_text} > binwrap3/foo-t.c1
7490 echo ${binwrap3_text} > binwrap3/foo-t.st
7492 echo "*.c1 -k 'b'" > binwrap3/sub1/.cvswrappers
7493 echo "whatever -k 'b'" >> binwrap3/sub1/.cvswrappers
7494 echo ${binwrap3_text} > binwrap3/sub1/foo-b.c1
7495 echo ${binwrap3_text} > binwrap3/sub1/foo-b.sb
7496 echo ${binwrap3_text} > binwrap3/sub1/foo-t.c0
7497 echo ${binwrap3_text} > binwrap3/sub1/foo-t.st
7499 echo "*.st -k 'b'" > binwrap3/sub2/.cvswrappers
7500 echo ${binwrap3_text} > binwrap3/sub2/foo-b.sb
7501 echo ${binwrap3_text} > binwrap3/sub2/foo-b.st
7502 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c0
7503 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c1
7504 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c2
7505 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c3
7507 echo "*.c3 -k 'b'" > binwrap3/sub2/subsub/.cvswrappers
7508 echo "foo -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
7509 echo "c0* -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
7510 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-b.c3
7511 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-b.sb
7512 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c0
7513 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c1
7514 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c2
7515 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.st
7517 # Now set up CVSROOT/cvswrappers, the easy way:
7518 dotest binwrap3-1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
7520 # This destroys anything currently in cvswrappers, but
7521 # presumably other tests will take care of it themselves if
7522 # they use cvswrappers:
7523 echo "foo*.sb -k 'b'" > cvswrappers
7524 dotest binwrap3-2 "${testcvs} -q ci -m cvswrappers-mod" \
7525 "Checking in cvswrappers;
7526 ${TESTDIR}/cvsroot/CVSROOT/cvswrappers,v <-- cvswrappers
7527 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
7529 ${PROG} [a-z]*: Rebuilding administrative file database"
7532 # Avoid environmental interference
7533 CVSWRAPPERS_SAVED=${CVSWRAPPERS}
7538 # Not importing .cvswrappers tests whether the client is really
7539 # letting the server know "honestly" whether the file is binary,
7540 # rather than just letting the server see the .cvswrappers file.
7541 dotest binwrap3-2a \
7542 "${testcvs} import -m . -I .cvswrappers binwrap3 tag1 tag2" \
7545 # OK, now test "cvs add".
7548 dotest binwrap3-2b "${testcvs} co binwrap3" "${DOTSTAR}"
7551 echo "*.newbin -k 'b'" > .cvswrappers
7552 echo .cvswrappers >.cvsignore
7553 echo .cvsignore >>.cvsignore
7554 touch file1.newbin file1.txt
7555 dotest binwrap3-2c "${testcvs} add file1.newbin file1.txt" \
7556 "${PROG} [a-z]*: scheduling file .file1\.newbin. for addition
7557 ${PROG} [a-z]*: scheduling file .file1\.txt. for addition
7558 ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
7559 dotest binwrap3-2d "${testcvs} -q ci -m add" \
7560 "RCS file: ${TESTDIR}/cvsroot/binwrap3/sub2/file1\.newbin,v
7562 Checking in file1\.newbin;
7563 ${TESTDIR}/cvsroot/binwrap3/sub2/file1\.newbin,v <-- file1\.newbin
7564 initial revision: 1\.1
7566 RCS file: ${TESTDIR}/cvsroot/binwrap3/sub2/file1\.txt,v
7568 Checking in file1\.txt;
7569 ${TESTDIR}/cvsroot/binwrap3/sub2/file1\.txt,v <-- file1\.txt
7570 initial revision: 1\.1
7574 # Now check out the module and see which files are binary.
7577 dotest binwrap3-3 "${testcvs} co binwrap3" "${DOTSTAR}"
7580 # Running "cvs status" and matching output is too
7581 # error-prone, too likely to falsely fail. Instead, we'll
7582 # just grep the Entries lines:
7584 dotest binwrap3-top1 "grep foo-b.c0 ./CVS/Entries" \
7585 "/foo-b.c0/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
7587 dotest binwrap3-top2 "grep foo-b.sb ./CVS/Entries" \
7588 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
7590 dotest binwrap3-top3 "grep foo-t.c1 ./CVS/Entries" \
7591 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
7593 dotest binwrap3-top4 "grep foo-t.st ./CVS/Entries" \
7594 "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
7596 dotest binwrap3-sub1-1 "grep foo-b.c1 sub1/CVS/Entries" \
7597 "/foo-b.c1/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
7599 dotest binwrap3-sub1-2 "grep foo-b.sb sub1/CVS/Entries" \
7600 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
7602 dotest binwrap3-sub1-3 "grep foo-t.c0 sub1/CVS/Entries" \
7603 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
7605 dotest binwrap3-sub1-4 "grep foo-t.st sub1/CVS/Entries" \
7606 "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
7608 dotest binwrap3-sub2-1 "grep foo-b.sb sub2/CVS/Entries" \
7609 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
7611 dotest binwrap3-sub2-2 "grep foo-b.st sub2/CVS/Entries" \
7612 "/foo-b.st/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
7614 dotest binwrap3-sub2-3 "grep foo-t.c0 sub2/CVS/Entries" \
7615 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
7617 dotest binwrap3-sub2-4 "grep foo-t.c1 sub2/CVS/Entries" \
7618 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
7620 dotest binwrap3-sub2-5 "grep foo-t.c2 sub2/CVS/Entries" \
7621 "/foo-t.c2/1.1.1.1/[A-Za-z0-9 :]*//"
7623 dotest binwrap3-sub2-6 "grep foo-t.c3 sub2/CVS/Entries" \
7624 "/foo-t.c3/1.1.1.1/[A-Za-z0-9 :]*//"
7626 dotest binwrap3-subsub1 "grep foo-b.c3 sub2/subsub/CVS/Entries" \
7627 "/foo-b.c3/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
7629 dotest binwrap3-subsub2 "grep foo-b.sb sub2/subsub/CVS/Entries" \
7630 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
7632 dotest binwrap3-subsub3 "grep foo-t.c0 sub2/subsub/CVS/Entries" \
7633 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
7635 dotest binwrap3-subsub4 "grep foo-t.c1 sub2/subsub/CVS/Entries" \
7636 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
7638 dotest binwrap3-subsub5 "grep foo-t.c2 sub2/subsub/CVS/Entries" \
7639 "/foo-t.c2/1.1.1.1/[A-Za-z0-9 :]*//"
7641 dotest binwrap3-subsub6 "grep foo-t.st sub2/subsub/CVS/Entries" \
7642 "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
7644 dotest binwrap3-sub2-add1 "grep file1.newbin sub2/CVS/Entries" \
7645 "/file1.newbin/1.1/[A-Za-z0-9 :]*/-kb/"
7646 dotest binwrap3-sub2-add2 "grep file1.txt sub2/CVS/Entries" \
7647 "/file1.txt/1.1/[A-Za-z0-9 :]*//"
7649 # Restore and clean up
7651 rm -r binwrap3 CVSROOT
7654 rm -rf ${CVSROOT_DIRNAME}/binwrap3
7655 CVSWRAPPERS=${CVSWRAPPERS_SAVED}
7659 # Tests of various wrappers features:
7660 # -m 'COPY' and cvs update: mwrap
7661 # -m 'COPY' and joining: mcopy
7662 # -k: binwrap, binwrap2
7663 # -t/-f: hasn't been written yet.
7665 # Tests of different ways of specifying wrappers:
7666 # CVSROOT/cvswrappers: mwrap
7667 # -W: binwrap, binwrap2
7668 # .cvswrappers in working directory, local: mcopy
7669 # CVSROOT/cvswrappers, .cvswrappers remote: binwrap3
7670 # CVSWRAPPERS environment variable: mcopy
7672 # This test is similar to binfiles-con1; -m 'COPY' specifies
7673 # non-mergeableness the same way that -kb does.
7675 # On Windows, we can't check out CVSROOT, because the case
7676 # insensitivity means that this conflicts with cvsroot.
7680 dotest mwrap-c1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
7682 echo "* -m 'COPY'" >>cvswrappers
7683 dotest mwrap-c2 "${testcvs} -q ci -m wrapper-mod" \
7684 "Checking in cvswrappers;
7685 ${TESTDIR}/cvsroot/CVSROOT/cvswrappers,v <-- cvswrappers
7686 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
7688 ${PROG} [a-z]*: Rebuilding administrative file database"
7691 dotest mwrap-1 "${testcvs} -q co -l ." ''
7693 dotest mwrap-2 "${testcvs} add first-dir" \
7694 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
7697 dotest mwrap-3 "${testcvs} add aa" \
7698 "${PROG} [a-z]*: scheduling file .aa. for addition
7699 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
7700 dotest mwrap-4 "${testcvs} -q ci -m add" \
7701 "RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
7704 ${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
7705 initial revision: 1\.1
7709 dotest mwrap-5 "${testcvs} -q co first-dir" "U first-dir/aa"
7711 echo "changed in m2" >aa
7712 dotest mwrap-6 "${testcvs} -q ci -m m2-mod" \
7714 ${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
7715 new revision: 1\.2; previous revision: 1\.1
7719 echo "changed in m1" >aa
7720 dotest_fail mwrap-7 "${testcvs} -nq update" "C aa"
7721 dotest mwrap-8 "${testcvs} -q update" \
7723 ${PROG} [a-z]*: nonmergeable file needs merge
7724 ${PROG} [a-z]*: revision 1\.2 from repository is now in aa
7725 ${PROG} [a-z]*: file from working directory is now in \.#aa\.1\.1
7727 dotest mwrap-9 "cat aa" "changed in m2"
7728 dotest mwrap-10 "cat .#aa.1.1" "changed in m1"
7731 echo '# comment out' >cvswrappers
7732 dotest mwrap-ce "${testcvs} -q ci -m wrapper-mod" \
7733 "Checking in cvswrappers;
7734 ${TESTDIR}/cvsroot/CVSROOT/cvswrappers,v <-- cvswrappers
7735 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
7737 ${PROG} [a-z]*: Rebuilding administrative file database"
7743 rm -rf ${CVSROOT_DIRNAME}/first-dir
7747 # Administrative file tests.
7748 # Here is a list of where each administrative file is tested:
7750 # modules: modules, modules2, modules3
7753 # cvswrappers: mwrap
7756 # On Windows, we can't check out CVSROOT, because the case
7757 # insensitivity means that this conflicts with cvsroot.
7761 dotest info-1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
7763 echo "ALL sh -c \"echo x\${=MYENV}\${=OTHER}y\${=ZEE}=\$USER=\$CVSROOT= >>$TESTDIR/testlog; cat >/dev/null\"" > loginfo
7764 # The following cases test the format string substitution
7765 echo "ALL echo %{sVv} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
7766 echo "ALL echo %{v} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
7767 echo "ALL echo %s >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
7768 echo "ALL echo %{V}AX >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
7769 echo "ALL echo %sux >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
7771 # Might be nice to move this to crerepos tests; it should
7772 # work to create a loginfo file if you didn't create one
7774 : dotest info-2 "${testcvs} add loginfo" \
7775 "${PROG}"' [a-z]*: scheduling file `loginfo'"'"' for addition
7776 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
7778 dotest info-3 "${testcvs} -q ci -m new-loginfo" \
7779 "Checking in loginfo;
7780 ${TESTDIR}/cvsroot/CVSROOT/loginfo,v <-- loginfo
7781 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
7783 ${PROG} [a-z]*: Rebuilding administrative file database"
7786 mkdir ${CVSROOT_DIRNAME}/first-dir
7787 dotest info-5 "${testcvs} -q co first-dir" ''
7790 dotest info-6 "${testcvs} add file1" \
7791 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
7792 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
7793 echo "cvs -s OTHER=not-this -s MYENV=env-" >>$HOME/.cvsrc
7794 dotest info-6a "${testcvs} -q -s OTHER=value ci -m add-it" \
7795 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
7798 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
7799 initial revision: 1\.1
7801 ${PROG} [a-z]*: loginfo:1: no such user variable \${=ZEE}"
7803 dotest info-7 "${testcvs} -q -s OTHER=value -s ZEE=z ci -m mod-it" \
7805 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
7806 new revision: 1\.2; previous revision: 1\.1
7809 dotest info-9 "cat $TESTDIR/testlog" "xenv-valueyz=${username}=${TESTDIR}/cvsroot="
7810 dotest info-10 "cat $TESTDIR/testlog2" 'first-dir file1,NONE,1.1
7815 first-dir file1,1.1,1.2
7822 echo '# do nothing' >loginfo
7823 dotest info-11 "${testcvs} -q -s ZEE=garbage ci -m nuke-loginfo" \
7824 "Checking in loginfo;
7825 ${TESTDIR}/cvsroot/CVSROOT/loginfo,v <-- loginfo
7826 new revision: 1\.[0-9]; previous revision: 1\.[0-9]
7828 ${PROG} [a-z]*: Rebuilding administrative file database"
7830 # Now test verifymsg
7831 cat >${TESTDIR}/vscript <<EOF
7833 if head -1 < \$1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
7836 echo "No BugId found."
7840 chmod +x ${TESTDIR}/vscript
7841 echo "^first-dir ${TESTDIR}/vscript" >>verifymsg
7842 dotest info-v1 "${testcvs} -q ci -m add-verification" \
7843 "Checking in verifymsg;
7844 ${TESTDIR}/cvsroot/CVSROOT/verifymsg,v <-- verifymsg
7845 new revision: 1\.2; previous revision: 1\.1
7847 ${PROG} [a-z]*: Rebuilding administrative file database"
7851 dotest_fail info-v2 "${testcvs} -q ci -m bogus" \
7853 ${PROG} \[[a-z]* aborted\]: Message verification failed"
7855 cat >${TESTDIR}/comment.tmp <<EOF
7857 and many more lines after it
7859 dotest info-v3 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
7861 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
7862 new revision: 1\.3; previous revision: 1\.2
7868 dotest_fail info-v4 \
7869 "${testcvs} import -m bogus first-dir/another x y" \
7871 ${PROG} \[[a-z]* aborted\]: Message verification failed"
7877 echo '# do nothing' >verifymsg
7878 dotest info-cleanup-verifymsg "${testcvs} -q ci -m nuke-verifymsg" \
7879 "Checking in verifymsg;
7880 ${TESTDIR}/cvsroot/CVSROOT/verifymsg,v <-- verifymsg
7881 new revision: 1\.[0-9]; previous revision: 1\.[0-9]
7883 ${PROG} [a-z]*: Rebuilding administrative file database"
7886 if echo "yes" | ${testcvs} release -d CVSROOT >>${LOGFILE} ; then
7891 if echo "yes" | ${testcvs} release -d first-dir >>${LOGFILE} ; then
7898 rm -rf ${CVSROOT_DIRNAME}/first-dir
7902 # Tests of the CVSROOT/config file. See the comment at the
7903 # "info" tests for a full list of administrative file tests.
7905 # On Windows, we can't check out CVSROOT, because the case
7906 # insensitivity means that this conflicts with cvsroot.
7910 dotest config-1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
7912 echo 'bogus line' >config
7913 dotest config-3 "${testcvs} -q ci -m change-to-bogus-line" \
7914 "Checking in config;
7915 ${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
7916 new revision: 1\.2; previous revision: 1\.1
7918 ${PROG} [a-z]*: Rebuilding administrative file database"
7919 echo 'BogusOption=yes' >config
7920 dotest config-4 "${testcvs} -q ci -m change-to-bogus-opt" \
7921 "${PROG} [a-z]*: syntax error in ${TESTDIR}/cvsroot/CVSROOT/config: line 'bogus line' is missing '='
7923 ${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
7924 new revision: 1\.3; previous revision: 1\.2
7926 ${PROG} [a-z]*: Rebuilding administrative file database"
7927 echo '# No config is a good config' > config
7928 dotest config-5 "${testcvs} -q ci -m change-to-comment" \
7929 "${PROG} [a-z]*: ${TESTDIR}/cvsroot/CVSROOT/config: unrecognized keyword 'BogusOption'
7931 ${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
7932 new revision: 1\.4; previous revision: 1\.3
7934 ${PROG} [a-z]*: Rebuilding administrative file database"
7935 dotest config-6 "${testcvs} -q update" ''
7944 # Test remote CVS handling of unpatchable files. This isn't
7945 # much of a test for local CVS.
7946 # We test this with some keyword expansion games, but the situation
7947 # also arises if the user modifies the file while CVS is running.
7948 mkdir ${CVSROOT_DIRNAME}/first-dir
7951 dotest serverpatch-1 "${testcvs} -q co first-dir" ''
7955 # Add a file with an RCS keyword.
7956 echo '$''Name$' > file1
7958 dotest serverpatch-2 "${testcvs} add file1" \
7959 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
7960 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
7962 dotest serverpatch-3 "${testcvs} -q commit -m add" \
7963 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
7966 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
7967 initial revision: 1\.1
7971 dotest serverpatch-4 "${testcvs} -q tag tag file1" 'T file1'
7973 # Check out a tagged copy of the file.
7977 dotest serverpatch-5 "${testcvs} -q co -r tag first-dir" \
7980 # Remove the tag. This will leave the tag string in the
7981 # expansion of the Name keyword.
7982 dotest serverpatch-6 "${testcvs} -q update -A" ''
7984 # Modify and check in the first copy.
7987 dotest serverpatch-7 "${testcvs} -q ci -mx file1" \
7989 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
7990 new revision: 1\.2; previous revision: 1\.1
7993 # Now update the second copy. When using remote CVS, the
7994 # patch will fail, forcing the file to be refetched.
7995 cd ../../2/first-dir
7996 dotest serverpatch-8 "${testcvs} -q update" \
7999 '"${PROG}"' [a-z]*: checksum failure after patch to ./file1; will refetch
8000 '"${PROG}"' [a-z]*: refetching unpatchable files
8005 rm -rf ${CVSROOT_DIRNAME}/first-dir
8009 # Test selecting revisions with cvs log.
8010 # See also log2 tests for more tests.
8011 # See also branches-14.3 for logging with a branch off of a branch.
8012 # See also multibranch-14 for logging with several branches off the
8014 # Tests of each option to cvs log:
8016 # -N: log, log2, admin-19a-log
8020 # Check in a file with a few revisions and branches.
8021 mkdir ${CVSROOT_DIRNAME}/first-dir
8022 dotest log-1 "${testcvs} -q co first-dir" ''
8024 echo 'first revision' > file1
8025 dotest log-2 "${testcvs} add file1" \
8026 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
8027 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
8029 # While we're at it, check multi-line comments, input from file,
8030 # and trailing whitespace trimming
8031 echo 'line 1 ' >${TESTDIR}/comment.tmp
8032 echo ' ' >>${TESTDIR}/comment.tmp
8033 echo 'line 2 ' >>${TESTDIR}/comment.tmp
8034 echo ' ' >>${TESTDIR}/comment.tmp
8035 echo ' ' >>${TESTDIR}/comment.tmp
8036 dotest log-3 "${testcvs} -q commit -F ${TESTDIR}/comment.tmp" \
8037 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8040 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8041 initial revision: 1\.1
8043 rm -f ${TESTDIR}/comment.tmp
8045 echo 'second revision' > file1
8046 dotest log-4 "${testcvs} -q ci -m2 file1" \
8048 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8049 new revision: 1\.2; previous revision: 1\.1
8052 dotest log-5 "${testcvs} -q tag -b branch file1" 'T file1'
8054 echo 'third revision' > file1
8055 dotest log-6 "${testcvs} -q ci -m3 file1" \
8057 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8058 new revision: 1\.3; previous revision: 1\.2
8061 dotest log-7 "${testcvs} -q update -r branch" '[UP] file1'
8063 echo 'first branch revision' > file1
8064 dotest log-8 "${testcvs} -q ci -m1b file1" \
8066 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8067 new revision: 1\.2\.2\.1; previous revision: 1\.2
8070 dotest log-9 "${testcvs} -q tag tag file1" 'T file1'
8072 echo 'second branch revision' > file1
8073 dotest log-10 "${testcvs} -q ci -m2b file1" \
8075 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8076 new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
8079 # Set up a bunch of shell variables to make the later tests
8080 # easier to describe.=
8082 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8088 log_tags='symbolic names:
8091 log_header2='keyword substitution: kv'
8092 log_dash='----------------------------
8094 log_date="date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;"
8095 log_lines=" lines: ${PLUS}1 -1"
8096 log_rev1="${log_dash} 1\.1
8101 log_rev2="${log_dash} 1\.2
8102 ${log_date}${log_lines}
8105 log_rev3="${log_dash} 1\.3
8106 ${log_date}${log_lines}
8108 log_rev1b="${log_dash} 1\.2\.2\.1
8109 ${log_date}${log_lines}
8111 log_rev2b="${log_dash} 1\.2\.2\.2
8112 ${log_date}${log_lines}
8114 log_trailer='============================================================================='
8116 # Now, finally, test the log output.
8118 dotest log-11 "${testcvs} log file1" \
8122 total revisions: 5; selected revisions: 5
8131 dotest log-12 "${testcvs} log -N file1" \
8134 total revisions: 5; selected revisions: 5
8143 dotest log-13 "${testcvs} log -b file1" \
8147 total revisions: 5; selected revisions: 3
8154 dotest log-14 "${testcvs} log -r file1" \
8158 total revisions: 5; selected revisions: 1
8163 dotest log-15 "${testcvs} log -r1.2 file1" \
8167 total revisions: 5; selected revisions: 1
8172 dotest log-16 "${testcvs} log -r1.2.2 file1" \
8176 total revisions: 5; selected revisions: 2
8182 # This test would fail with the old invocation of rlog, but it
8183 # works with the builtin log support.
8184 dotest log-17 "${testcvs} log -rbranch file1" \
8188 total revisions: 5; selected revisions: 2
8194 dotest log-18 "${testcvs} log -r1.2.2. file1" \
8198 total revisions: 5; selected revisions: 1
8203 # This test would fail with the old invocation of rlog, but it
8204 # works with the builtin log support.
8205 dotest log-19 "${testcvs} log -rbranch. file1" \
8209 total revisions: 5; selected revisions: 1
8214 dotest log-20 "${testcvs} log -r1.2: file1" \
8218 total revisions: 5; selected revisions: 2
8224 dotest log-21 "${testcvs} log -r:1.2 file1" \
8228 total revisions: 5; selected revisions: 2
8234 dotest log-22 "${testcvs} log -r1.1:1.2 file1" \
8238 total revisions: 5; selected revisions: 2
8244 dotest log-o0 "${testcvs} admin -o 1.2.2.2:: file1" \
8245 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8247 dotest log-o1 "${testcvs} admin -o ::1.2.2.1 file1" \
8248 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8250 dotest log-o2 "${testcvs} admin -o 1.2.2.1:: file1" \
8251 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8252 deleting revision 1\.2\.2\.2
8254 dotest log-o3 "${testcvs} log file1" \
8258 total revisions: 4; selected revisions: 4
8265 dotest log-o4 "${testcvs} -q update -p -r 1.2.2.1 file1" \
8266 "first branch revision"
8269 rm -rf ${CVSROOT_DIRNAME}/first-dir
8273 # More "cvs log" tests, for example the file description.
8276 mkdir ${CVSROOT_DIRNAME}/first-dir
8277 dotest log2-1 "${testcvs} -q co first-dir" ''
8279 echo 'first revision' > file1
8280 dotest log2-2 "${testcvs} add -m file1-is-for-testing file1" \
8281 "${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
8282 '"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently'
8283 dotest log2-3 "${testcvs} -q commit -m 1" \
8284 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8287 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8288 initial revision: 1\.1
8290 # Setting the file description with add -m doesn't yet work
8291 # client/server, so skip log2-4 for remote.
8292 if test "x$remote" = xno; then
8294 dotest log2-4 "${testcvs} log -N file1" "
8295 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8301 keyword substitution: kv
8302 total revisions: 1; selected revisions: 1
8304 file1-is-for-testing
8305 ----------------------------
8307 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
8309 ============================================================================="
8311 fi # end of tests skipped for remote
8313 dotest log2-5 "${testcvs} admin -t-change-description file1" \
8314 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8316 dotest log2-6 "${testcvs} log -N file1" "
8317 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8323 keyword substitution: kv
8324 total revisions: 1; selected revisions: 1
8327 ----------------------------
8329 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
8331 ============================================================================="
8333 # I believe that in Real Life (TM), this is broken for remote.
8334 # That is, the filename in question must be the filename of a
8335 # file on the server. It only happens to work here because the
8336 # client machine and the server machine are one and the same.
8337 echo 'longer description' >${TESTDIR}/descrip
8338 echo 'with two lines' >>${TESTDIR}/descrip
8339 dotest log2-7 "${testcvs} admin -t${TESTDIR}/descrip file1" \
8340 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8342 dotest log2-8 "${testcvs} log -N file1" "
8343 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8349 keyword substitution: kv
8350 total revisions: 1; selected revisions: 1
8354 ----------------------------
8356 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
8358 ============================================================================="
8360 # Reading the description from stdin is broken for remote.
8361 # See comments in cvs.texinfo for a few more notes on this.
8362 if test "x$remote" = xno; then
8364 if echo change from stdin | ${testcvs} admin -t -q file1
8370 dotest log2-10 "${testcvs} log -N file1" "
8371 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8377 keyword substitution: kv
8378 total revisions: 1; selected revisions: 1
8381 ----------------------------
8383 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
8385 ============================================================================="
8387 fi # end of tests skipped for remote
8390 rm ${TESTDIR}/descrip
8392 rm -rf ${CVSROOT_DIRNAME}/first-dir
8397 # Tests of "cvs annotate". See also basica-10.
8399 dotest ann-1 "${testcvs} -q co -l ." ''
8401 dotest ann-2 "${testcvs} add first-dir" \
8402 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
8411 dotest ann-3 "${testcvs} add file1" \
8412 "${PROG} [a-z]*: scheduling file .file1. for addition
8413 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
8414 dotest ann-4 "${testcvs} -q ci -m add file1" \
8415 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8418 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8419 initial revision: 1\.1
8432 dotest ann-5 "${testcvs} -q ci -m modify file1" \
8434 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8435 new revision: 1\.2; previous revision: 1\.1
8437 dotest ann-6 "${testcvs} -q tag -b br" "T file1"
8449 dotest ann-7 "${testcvs} -q ci -m modify file1" \
8451 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8452 new revision: 1\.3; previous revision: 1\.2
8454 dotest ann-8 "${testcvs} -q update -r br" "[UP] file1"
8468 dotest ann-9 "${testcvs} -q ci -m modify" \
8470 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8471 new revision: 1\.2\.2\.1; previous revision: 1\.2
8473 # Note that this annotates the trunk despite the presence
8474 # of a sticky tag in the current directory. This is
8475 # fairly bogus, but it is the longstanding behavior for
8476 # whatever that is worth.
8477 dotest ann-10 "${testcvs} ann" \
8478 "Annotations for file1
8479 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
8480 1\.1 (${username} *[0-9a-zA-Z-]*): this
8481 1\.1 (${username} *[0-9a-zA-Z-]*): is
8482 1\.2 (${username} *[0-9a-zA-Z-]*): a
8483 1\.3 (${username} *[0-9a-zA-Z-]*): trunk file
8484 1\.2 (${username} *[0-9a-zA-Z-]*):
8485 1\.2 (${username} *[0-9a-zA-Z-]*): with
8486 1\.2 (${username} *[0-9a-zA-Z-]*): a
8487 1\.2 (${username} *[0-9a-zA-Z-]*): blank
8488 1\.2 (${username} *[0-9a-zA-Z-]*): line"
8489 dotest ann-11 "${testcvs} ann -r br" \
8490 "Annotations for file1
8491 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
8492 1\.1 (${username} *[0-9a-zA-Z-]*): this
8493 1\.1 (${username} *[0-9a-zA-Z-]*): is
8494 1\.2 (${username} *[0-9a-zA-Z-]*): a
8495 1\.1 (${username} *[0-9a-zA-Z-]*): file
8496 1\.2 (${username} *[0-9a-zA-Z-]*):
8497 1\.2 (${username} *[0-9a-zA-Z-]*): with
8498 1\.2 (${username} *[0-9a-zA-Z-]*): a
8499 1\.2 (${username} *[0-9a-zA-Z-]*): blank
8500 1\.2 (${username} *[0-9a-zA-Z-]*): line
8501 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
8502 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
8506 rm -rf ${CVSROOT_DIRNAME}/first-dir
8510 # Various tests relating to creating repositories, operating
8511 # on repositories created with old versions of CVS, etc.
8513 # Because this test is all about -d options and such, it
8514 # at least to some extent needs to be different for remote vs.
8516 if test "x$remote" = "xno"; then
8518 # First, if the repository doesn't exist at all...
8519 dotest_fail crerepos-1 \
8520 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
8521 "${PROG} \[[a-z]* aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
8524 # The repository exists but CVSROOT doesn't.
8525 dotest_fail crerepos-2 \
8526 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
8527 "${PROG} \[[a-z]* aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
8528 mkdir crerepos/CVSROOT
8530 # Checkout of nonexistent module
8531 dotest_fail crerepos-3 \
8532 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
8533 "${PROG} [a-z]*: cannot find module .cvs-sanity. - ignored"
8535 # Now test that CVS works correctly without a modules file
8536 # or any of that other stuff. In particular, it *must*
8537 # function if administrative files added to CVS recently (since
8538 # CVS 1.3) do not exist, because the repository might have
8539 # been created with an old version of CVS.
8542 "${testcvs} -q -d ${TESTDIR}/crerepos co CVSROOT" \
8545 ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
8552 # The directory tmp should be empty
8553 dotest crerepos-6 "rmdir tmp" ''
8555 CREREPOS_ROOT=${TESTDIR}/crerepos
8558 # For remote, just create the repository. We don't yet do
8559 # the various other tests above for remote but that should be
8562 mkdir crerepos/CVSROOT
8564 CREREPOS_ROOT=:ext:`hostname`:${TESTDIR}/crerepos
8568 if test "x$remote" = "xno"; then
8569 # Test that CVS rejects a relative path in CVSROOT.
8571 dotest_fail crerepos-6a "${testcvs} -q -d ../crerepos get ." \
8572 "${PROG} \[[a-z]* aborted\]: CVSROOT ../crerepos must be an absolute pathname"
8577 dotest_fail crerepos-6b "${testcvs} -d crerepos init" \
8578 "${PROG} \[[a-z]* aborted\]: CVSROOT crerepos must be an absolute pathname"
8582 # Test that CVS rejects a relative path in CVSROOT.
8584 dotest_fail crerepos-6a \
8585 "${testcvs} -q -d :ext:`hostname`:../crerepos get ." \
8586 "Root ../crerepos must be an absolute pathname"
8591 dotest_fail crerepos-6b \
8592 "${testcvs} -d :ext:`hostname`:crerepos init" \
8593 "Root crerepos must be an absolute pathname"
8596 fi # end of tests to be skipped for remote
8598 # CVS better not create a history file--if the administrator
8599 # doesn't need it and wants to save on disk space, they just
8601 dotest_fail crerepos-7 \
8602 "test -f ${TESTDIR}/crerepos/CVSROOT/history" ''
8604 # Now test mixing repositories. This kind of thing tends to
8605 # happen accidentally when people work with several repositories.
8607 dotest crerepos-8 "${testcvs} -q co -l ." ''
8609 dotest crerepos-9 "${testcvs} add first-dir" \
8610 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
8613 dotest crerepos-10 "${testcvs} add file1" \
8614 "${PROG} [a-z]*: scheduling file .file1. for addition
8615 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
8616 dotest crerepos-11 "${testcvs} -q ci -m add-it" \
8617 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8620 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
8621 initial revision: 1\.1
8627 dotest crerepos-12 "${testcvs} -d ${CREREPOS_ROOT} -q co -l ." ''
8629 dotest crerepos-13 "${testcvs} add crerepos-dir" \
8630 "Directory ${TESTDIR}/crerepos/crerepos-dir added to the repository"
8633 dotest crerepos-14 "${testcvs} add cfile" \
8634 "${PROG} [a-z]*: scheduling file .cfile. for addition
8635 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
8636 dotest crerepos-15 "${testcvs} -q ci -m add-it" \
8637 "RCS file: ${TESTDIR}/crerepos/crerepos-dir/cfile,v
8640 ${TESTDIR}/crerepos/crerepos-dir/cfile,v <-- cfile
8641 initial revision: 1\.1
8647 dotest crerepos-16 "${testcvs} co first-dir" \
8648 "${PROG} [a-z]*: Updating first-dir
8650 dotest crerepos-17 "${testcvs} -d ${CREREPOS_ROOT} co crerepos-dir" \
8651 "${PROG} [a-z]*: Updating crerepos-dir
8652 U crerepos-dir/cfile"
8654 if test x`cat CVS/Repository` = x.; then
8656 # Fatal error so that we don't go traipsing through the
8657 # directories which happen to have the same names from the
8659 dotest_fail crerepos-18 "${testcvs} -q update" \
8660 "${PROG} \[[a-z]* aborted\]: cannot open directory ${TESTDIR}/cvsroot/crerepos-dir: .*" ''
8662 if test "$remote" = no; then
8663 # The lack of an error doesn't mean CVS is really
8664 # working (things are getting logged to the wrong
8665 # history file and such).
8666 dotest crerepos-18 "${testcvs} -q update" ''
8668 # Fatal error so that we don't go traipsing through the
8669 # directories which happen to have the same names from the
8671 dotest_fail crerepos-18 "${testcvs} -q update" \
8672 "protocol error: directory .${TESTDIR}/crerepos/crerepos-dir. not within root .${TESTDIR}/cvsroot."
8679 rm -rf ${CVSROOT_DIRNAME}/first-dir ${TESTDIR}/crerepos
8683 # Test ability to import an RCS file. Note that this format
8684 # is fixed--files written by RCS5, and other software which
8685 # implements this format, will be out there "forever" and
8686 # CVS must always be able to import such files.
8688 # See tests admin-13, admin-25 and rcs-8a for exporting RCS files.
8690 mkdir ${CVSROOT_DIRNAME}/first-dir
8692 # Currently the way to import an RCS file is to copy it
8693 # directly into the repository.
8695 # This file was written by RCS 5.7, and then the dates were
8696 # hacked so that we test year 2000 stuff. Note also that
8697 # "author" names are just strings, as far as importing
8698 # RCS files is concerned--they need not correspond to user
8699 # IDs on any particular system.
8701 # I also tried writing a file with the RCS supplied with
8702 # HPUX A.09.05. According to "man rcsintro" this is
8703 # "Revision Number: 3.0; Release Date: 83/05/11". There
8704 # were a few minor differences like whitespace but at least
8705 # in simple cases like this everything else seemed the same
8706 # as the file written by RCS 5.7 (so I won't try to make it
8707 # a separate test case).
8709 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
8718 date 2000.11.24.15.58.37; author kingdon; state Exp;
8723 date 96.11.24.15.57.41; author kingdon; state Exp;
8728 date 96.11.24.15.56.05; author kingdon; state Exp;
8734 @file1 is for testing CVS
8740 @delete second line; modify twelfth line
8743 @This is the first line
8744 This is the third line
8745 This is the fourth line
8746 This is the fifth line
8747 This is the sixth line
8748 This is the seventh line
8749 This is the eighth line
8750 This is the ninth line
8751 This is the tenth line
8752 This is the eleventh line
8753 This is the twelfth line (and what a line it is)
8754 This is the thirteenth line
8764 This is the second line
8767 This is the twelfth line
8779 dotest rcs-1 "${testcvs} -q co first-dir" 'U first-dir/file1'
8781 dotest rcs-2 "${testcvs} -q log" "
8782 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8789 keyword substitution: kv
8790 total revisions: 3; selected revisions: 3
8792 file1 is for testing CVS
8793 ----------------------------
8795 date: 2000/11/24 15:58:37; author: kingdon; state: Exp; lines: ${PLUS}1 -2
8796 delete second line; modify twelfth line
8797 ----------------------------
8799 date: 1996/11/24 15:57:41; author: kingdon; state: Exp; lines: ${PLUS}12 -0
8801 ----------------------------
8803 date: 1996/11/24 15:56:05; author: kingdon; state: Exp;
8805 ============================================================================="
8807 # Note that the dates here are chosen so that (a) we test
8808 # at least one date after 2000, (b) we will notice if the
8809 # month and day are getting mixed up with each other.
8810 # TODO: also test that year isn't getting mixed up with month
8811 # or day, for example 01-02-03.
8813 # ISO8601 format. There are many, many, other variations
8814 # specified by ISO8601 which we should be testing too.
8815 dotest rcs-3 "${testcvs} -q log -d 1996-12-11<" "
8816 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8823 keyword substitution: kv
8824 total revisions: 3; selected revisions: 1
8826 file1 is for testing CVS
8827 ----------------------------
8829 date: 2000/11/24 15:58:37; author: kingdon; state: Exp; lines: ${PLUS}1 -2
8830 delete second line; modify twelfth line
8831 ============================================================================="
8833 # RFC822 format (as amended by RFC1123).
8834 if ${testcvs} -q log -d '<3 Apr 2000 00:00' >${TESTDIR}/rcs4.tmp
8836 dotest rcs-4 "cat ${TESTDIR}/rcs4.tmp" "
8837 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
8844 keyword substitution: kv
8845 total revisions: 3; selected revisions: 2
8847 file1 is for testing CVS
8848 ----------------------------
8850 date: 1996/11/24 15:57:41; author: kingdon; state: Exp; lines: ${PLUS}12 -0
8852 ----------------------------
8854 date: 1996/11/24 15:56:05; author: kingdon; state: Exp;
8856 ============================================================================="
8861 # OK, here is another one. This one was written by hand based on
8862 # doc/RCSFILES and friends.
8863 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file2,v
8869 testofanewphrase @without newphrase we'd have trouble extending @@ all@ ;
8870 1.5 date 71.01.01.01.00.00; author joe; state bogus; branches; next 1.4;
8871 1.4 date 71.01.01.00.00.05; author joe; state bogus; branches; next 1.3;
8872 1.3 date 70.12.31.15.00.05; author joe; state bogus; branches; next 1.2;
8873 1.2 date 70.12.31.12.15.05; author me; state bogus; branches 1.2.6.1; next 1.1;
8874 1.1 date 70.12.31.11.00.05; author joe; state bogus; branches; next; newph;
8875 1.2.6.1 date 71.01.01.08.00.05; author joe; state Exp; branches; next;
8877 1.5 log @@ newphrase1; newphrase2 42; text @head revision@
8878 1.4 log @@ text @d1 1
8881 1.3 log @@ text @d1 1
8884 1.2 log @@ text @d1 1
8891 1.2.6.1 log @@ text @d1 1
8895 # First test the default branch.
8896 dotest rcs-5 "${testcvs} -q update file2" "U file2"
8897 dotest rcs-6 "cat file2" "branch revision"
8899 # Now get rid of the default branch, it will get in the way.
8900 dotest rcs-7 "${testcvs} admin -b file2" \
8901 "RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
8903 # But we do want to make sure that "cvs admin" leaves the newphrases
8905 # The extra whitespace regexps are for the RCS library, which does
8906 # not preserve whitespace in the dogmatic manner of RCS 5.7. -twp
8908 "grep testofanewphrase ${CVSROOT_DIRNAME}/first-dir/file2,v" \
8909 "testofanewphrase[ ][ ]*@without newphrase we'd have trouble extending @@ all@[ ]*;"
8910 # The easiest way to test for newphrases in deltas and deltatexts
8911 # is to just look at the whole file, I guess.
8912 dotest rcs-8a "cat ${CVSROOT_DIRNAME}/first-dir/file2,v" \
8918 testofanewphrase @without newphrase we'd have trouble extending @@ all@;
8921 date 71\.01\.01\.01\.00\.00; author joe; state bogus;
8926 date 71\.01\.01\.00\.00\.05; author joe; state bogus;
8931 date 70\.12\.31\.15\.00\.05; author joe; state bogus;
8936 date 70\.12\.31\.12\.15\.05; author me; state bogus;
8942 date 70\.12\.31\.11\.00\.05; author joe; state bogus;
8948 date 71\.01\.01\.08\.00\.05; author joe; state Exp;
9010 # For remote, the "update -p -D" usage seems not to work.
9011 # I'm not sure what is going on.
9012 if test "x$remote" = "xno"; then
9014 if ${testcvs} -q update -p -D '1970-12-31 11:30 UT' file2 \
9015 >${TESTDIR}/rcs4.tmp
9017 dotest rcs-9 "cat ${TESTDIR}/rcs4.tmp" "start revision"
9022 if ${testcvs} -q update -p -D '1970-12-31 12:30 UT' file2 \
9023 >${TESTDIR}/rcs4.tmp
9025 dotest rcs-10 "cat ${TESTDIR}/rcs4.tmp" "mid revision"
9030 if ${testcvs} -q update -p -D '1971-01-01 00:30 UT' file2 \
9031 >${TESTDIR}/rcs4.tmp
9033 dotest rcs-11 "cat ${TESTDIR}/rcs4.tmp" "new year revision"
9038 # Same test as rcs-10, but with am/pm.
9039 if ${testcvs} -q update -p -D 'December 31, 1970 12:30pm UT' file2 \
9040 >${TESTDIR}/rcs4.tmp
9042 dotest rcs-12 "cat ${TESTDIR}/rcs4.tmp" "mid revision"
9047 # Same test as rcs-11, but with am/pm.
9048 if ${testcvs} -q update -p -D 'January 1, 1971 12:30am UT' file2 \
9049 >${TESTDIR}/rcs4.tmp
9051 dotest rcs-13 "cat ${TESTDIR}/rcs4.tmp" "new year revision"
9056 fi # end of tests skipped for remote
9058 # OK, now make sure cvs log doesn't have any trouble with the
9059 # newphrases and such.
9060 dotest rcs-14 "${testcvs} -q log file2" "
9061 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
9068 keyword substitution: kv
9069 total revisions: 6; selected revisions: 6
9071 ----------------------------
9073 date: 1971/01/01 01:00:00; author: joe; state: bogus; lines: ${PLUS}1 -1
9074 \*\*\* empty log message \*\*\*
9075 ----------------------------
9077 date: 1971/01/01 00:00:05; author: joe; state: bogus; lines: ${PLUS}1 -1
9078 \*\*\* empty log message \*\*\*
9079 ----------------------------
9081 date: 1970/12/31 15:00:05; author: joe; state: bogus; lines: ${PLUS}1 -1
9082 \*\*\* empty log message \*\*\*
9083 ----------------------------
9085 date: 1970/12/31 12:15:05; author: me; state: bogus; lines: ${PLUS}1 -1
9087 \*\*\* empty log message \*\*\*
9088 ----------------------------
9090 date: 1970/12/31 11:00:05; author: joe; state: bogus;
9091 \*\*\* empty log message \*\*\*
9092 ----------------------------
9094 date: 1971/01/01 08:00:05; author: joe; state: Exp; lines: ${PLUS}1 -1
9095 \*\*\* empty log message \*\*\*
9096 ============================================================================="
9099 rm -r first-dir ${TESTDIR}/rcs4.tmp
9100 rm -rf ${CVSROOT_DIRNAME}/first-dir
9105 # Test ability to operate on big files. Intention is to
9106 # test various realloc'ing code in RCS_deltas, rcsgetkey,
9107 # etc. "big" is currently defined to be 1000 lines (64000
9108 # bytes), which in terms of files that users will use is not
9109 # large, merely average, but my reasoning is that this
9110 # should be big enough to make sure realloc'ing is going on
9111 # and that raising it a lot would start to stress resources
9112 # on machines which run the tests, without any significant
9115 mkdir ${CVSROOT_DIRNAME}/first-dir
9116 dotest big-1 "${testcvs} -q co first-dir" ''
9118 for i in 0 1 2 3 4 5 6 7 8 9; do
9119 for j in 0 1 2 3 4 5 6 7 8 9; do
9120 for k in 0 1 2 3 4 5 6 7 8 9; do
9122 "This is line ($i,$j,$k) which goes into the file file1 for testing" >>file1
9126 dotest big-2 "${testcvs} add file1" \
9127 "${PROG} [a-z]*: scheduling file .file1. for addition
9128 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
9129 dotest big-3 "${testcvs} -q ci -m add" \
9130 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
9133 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9134 initial revision: 1\.1
9139 dotest big-4 "${testcvs} -q get first-dir" "U first-dir/file1"
9141 echo "add a line to the end" >>file1
9142 dotest big-5 "${testcvs} -q ci -m modify" \
9144 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9145 new revision: 1\.2; previous revision: 1\.1
9148 # The idea here is particularly to test the Rcs-diff response
9149 # and the reallocing thereof, for remote.
9150 dotest big-6 "${testcvs} -q update" "[UP] file1"
9153 if test "$keep" = yes; then
9154 echo Keeping ${TESTDIR} and exiting due to --keep
9159 rm -rf ${CVSROOT_DIRNAME}/first-dir
9163 # Test repository permissions (CVSUMASK and so on).
9164 # Although the tests in this section "cheat" by testing
9165 # repository permissions, which are sort of not a user-visible
9166 # sort of thing, the modes do have user-visible consequences,
9167 # such as whether a second user can check out the files. But
9168 # it would be awkward to test the consequences, so we don't.
9170 # Solaris /bin/sh doesn't support export -n. I'm not sure
9171 # what we can do about this, other than hope that whoever
9172 # is running the tests doesn't have CVSUMASK set.
9173 #export -n CVSUMASK # if unset, defaults to 002
9177 dotest modes-1 "${testcvs} -q co -l ." ''
9179 dotest modes-2 "${testcvs} add first-dir" \
9180 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
9183 dotest modes-3 "${testcvs} add aa" \
9184 "${PROG} [a-z]*: scheduling file .aa. for addition
9185 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
9186 dotest modes-4 "${testcvs} -q ci -m add" \
9187 "RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
9190 ${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
9191 initial revision: 1\.1
9193 dotest modes-5 "ls -l ${TESTDIR}/cvsroot/first-dir/aa,v" \
9196 # Test for whether we can set the execute bit.
9199 dotest modes-6 "${testcvs} -q ci -m set-execute-bit" \
9201 ${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
9202 new revision: 1\.2; previous revision: 1\.1
9204 # If CVS let us update the execute bit, it would be set here.
9205 # But it doesn't, and as far as I know that is longstanding
9207 dotest modes-7 "ls -l ${TESTDIR}/cvsroot/first-dir/aa,v" \
9210 # OK, now manually change the modes and see what happens.
9211 chmod g=r,o= ${TESTDIR}/cvsroot/first-dir/aa,v
9212 echo second line >>aa
9213 dotest modes-7a "${testcvs} -q ci -m set-execute-bit" \
9215 ${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
9216 new revision: 1\.3; previous revision: 1\.2
9218 dotest modes-7b "ls -l ${TESTDIR}/cvsroot/first-dir/aa,v" \
9224 # Might as well test the execute bit too.
9226 dotest modes-8 "${testcvs} add ab" \
9227 "${PROG} [a-z]*: scheduling file .ab. for addition
9228 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
9229 dotest modes-9 "${testcvs} -q ci -m add" \
9230 "RCS file: ${TESTDIR}/cvsroot/first-dir/ab,v
9233 ${TESTDIR}/cvsroot/first-dir/ab,v <-- ab
9234 initial revision: 1\.1
9236 if test "x$remote" = xyes; then
9237 # The problem here is that the CVSUMASK environment variable
9238 # needs to be set on the server (e.g. .bashrc). This is, of
9239 # course, bogus, but that is the way it is currently.
9240 dotest modes-10 "ls -l ${TESTDIR}/cvsroot/first-dir/ab,v" \
9241 "-r-xr-x---.*" "-r-xr-xr-x.*"
9243 dotest modes-10 "ls -l ${TESTDIR}/cvsroot/first-dir/ab,v" \
9247 # OK, now add a file on a branch. Check that the mode gets
9248 # set the same way (it is a different code path in CVS).
9249 dotest modes-11 "${testcvs} -q tag -b br" 'T aa
9251 dotest modes-12 "${testcvs} -q update -r br" ''
9253 dotest modes-13 "${testcvs} add ac" \
9254 "${PROG} [a-z]*: scheduling file .ac. for addition on branch .br.
9255 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
9256 # Not sure it really makes sense to refer to a "previous revision"
9257 # when we are just now adding the file; as far as I know
9258 # that is longstanding CVS behavior, for what it's worth.
9259 dotest modes-14 "${testcvs} -q ci -m add" \
9260 "RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/ac,v
9263 ${TESTDIR}/cvsroot/first-dir/Attic/ac,v <-- ac
9264 new revision: 1\.1\.2\.1; previous revision: 1\.1
9266 if test "x$remote" = xyes; then
9267 # The problem here is that the CVSUMASK environment variable
9268 # needs to be set on the server (e.g. .bashrc). This is, of
9269 # course, bogus, but that is the way it is currently.
9271 "ls -l ${TESTDIR}/cvsroot/first-dir/Attic/ac,v" \
9275 "ls -l ${TESTDIR}/cvsroot/first-dir/Attic/ac,v" \
9281 rm -rf ${CVSROOT_DIRNAME}/first-dir
9282 # Perhaps should restore the umask and CVSUMASK. But the other
9283 # tests "should" not care about them...
9289 dotest stamps-1 "${testcvs} -q co -l ." ''
9291 dotest stamps-2 "${testcvs} add first-dir" \
9292 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
9296 ls -l aa >${TESTDIR}/1/stamp.aa.touch
9297 ls -l kw >${TESTDIR}/1/stamp.kw.touch
9298 # "sleep 1" would suffice if we could assume ls --full-time, but
9299 # that is as far as I know unique to GNU ls. Is there some POSIX.2
9300 # way to get the timestamp of a file, including the seconds?
9302 dotest stamps-3 "${testcvs} add aa kw" \
9303 "${PROG} [a-z]*: scheduling file .aa. for addition
9304 ${PROG} [a-z]*: scheduling file .kw. for addition
9305 ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
9306 ls -l aa >${TESTDIR}/1/stamp.aa.add
9307 ls -l kw >${TESTDIR}/1/stamp.kw.add
9308 # "cvs add" should not muck with the timestamp.
9310 "cmp ${TESTDIR}/1/stamp.aa.touch ${TESTDIR}/1/stamp.aa.add" ''
9312 "cmp ${TESTDIR}/1/stamp.kw.touch ${TESTDIR}/1/stamp.kw.add" ''
9314 dotest stamps-5 "${testcvs} -q ci -m add" \
9315 "RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
9318 ${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
9319 initial revision: 1\.1
9321 RCS file: ${TESTDIR}/cvsroot/first-dir/kw,v
9324 ${TESTDIR}/cvsroot/first-dir/kw,v <-- kw
9325 initial revision: 1\.1
9327 ls -l aa >${TESTDIR}/1/stamp.aa.ci
9328 ls -l kw >${TESTDIR}/1/stamp.kw.ci
9329 # If there are no keywords, "cvs ci" leaves the timestamp alone
9330 # If there are, it sets the timestamp to the date of the commit.
9331 # I'm not sure how logical this is, but it is intentional.
9332 # If we wanted to get fancy we would make sure the time as
9333 # reported in "cvs log kw" matched stamp.kw.ci. But that would
9336 "cmp ${TESTDIR}/1/stamp.aa.add ${TESTDIR}/1/stamp.aa.ci" ''
9337 if cmp ${TESTDIR}/1/stamp.kw.add ${TESTDIR}/1/stamp.kw.ci >/dev/null
9347 dotest stamps-7 "${testcvs} -q get first-dir" "U first-dir/aa
9350 ls -l aa >${TESTDIR}/1/stamp.aa.get
9351 ls -l kw >${TESTDIR}/1/stamp.kw.get
9352 # On checkout, CVS should set the timestamp to the date that the
9353 # file was committed. Could check that the time as reported in
9354 # "cvs log aa" matches stamp.aa.get, but that would be a lot of
9356 if cmp ${TESTDIR}/1/stamp.aa.ci ${TESTDIR}/1/stamp.aa.get >/dev/null
9363 "cmp ${TESTDIR}/1/stamp.kw.ci ${TESTDIR}/1/stamp.kw.get" ''
9365 # Now we want to see what "cvs update" does.
9367 echo add a line >>aa
9368 echo add a line >>kw
9369 dotest stamps-9 "${testcvs} -q ci -m change-them" \
9371 ${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
9372 new revision: 1\.2; previous revision: 1\.1
9375 ${TESTDIR}/cvsroot/first-dir/kw,v <-- kw
9376 new revision: 1\.2; previous revision: 1\.1
9378 ls -l aa >${TESTDIR}/1/stamp.aa.ci2
9379 ls -l kw >${TESTDIR}/1/stamp.kw.ci2
9383 dotest stamps-10 "${testcvs} -q update" '[UP] aa
9385 # this doesn't serve any function other than being able to
9386 # look at it manually, as we have no machinery for dates being
9387 # newer or older than other dates.
9388 date >${TESTDIR}/1/stamp.debug.update
9389 ls -l aa >${TESTDIR}/1/stamp.aa.update
9390 ls -l kw >${TESTDIR}/1/stamp.kw.update
9391 # stamp.aa.update and stamp.kw.update should both be approximately
9392 # the same as stamp.debug.update. Perhaps we could be testing
9393 # this in a more fancy fashion by "touch stamp.before" before
9394 # stamps-10, "touch stamp.after" after, and then using ls -t
9395 # to check them. But for now we just make sure that the *.update
9396 # stamps differ from the *.ci2 ones.
9397 # As for the rationale, this is so that if one updates and gets
9398 # a new revision, then "make" will be sure to regard those files
9399 # as newer than .o files which may be sitting around.
9400 if cmp ${TESTDIR}/1/stamp.aa.update ${TESTDIR}/1/stamp.aa.ci2 \
9407 if cmp ${TESTDIR}/1/stamp.kw.update ${TESTDIR}/1/stamp.kw.ci2 \
9417 if test "$keep" = yes; then
9418 echo Keeping ${TESTDIR} and exiting due to --keep
9423 rm -rf ${CVSROOT_DIRNAME}/first-dir
9427 # More tests of sticky tags, particularly non-branch sticky tags.
9428 # See many tests (e.g. multibranch) for ordinary sticky tag
9429 # operations such as adding files on branches.
9430 # See "head" test for interaction between stick tags and HEAD.
9432 dotest sticky-1 "${testcvs} -q co -l ." ''
9434 dotest sticky-2 "${testcvs} add first-dir" \
9435 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
9439 dotest sticky-3 "${testcvs} add file1" \
9440 "${PROG} [a-z]*: scheduling file .file1. for addition
9441 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
9442 dotest sticky-4 "${testcvs} -q ci -m add" \
9443 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
9446 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9447 initial revision: 1\.1
9449 dotest sticky-5 "${testcvs} -q tag tag1" "T file1"
9450 echo add a line >>file1
9451 dotest sticky-6 "${testcvs} -q ci -m modify" \
9453 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9454 new revision: 1\.2; previous revision: 1\.1
9456 dotest sticky-7 "${testcvs} -q update -r tag1" "[UP] file1"
9457 dotest sticky-8 "cat file1" ''
9458 dotest sticky-9 "${testcvs} -q update" ''
9459 dotest sticky-10 "cat file1" ''
9461 dotest_fail sticky-11 "${testcvs} add file2" \
9462 "${PROG} [a-z]*: cannot add file on non-branch tag tag1"
9463 dotest sticky-12 "${testcvs} -q update -A" "[UP] file1
9464 ${QUESTION} file2" "${QUESTION} file2
9466 dotest sticky-13 "${testcvs} add file2" \
9467 "${PROG} [a-z]*: scheduling file .file2. for addition
9468 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
9469 dotest sticky-14 "${testcvs} -q ci -m add" \
9470 "RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
9473 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
9474 initial revision: 1\.1
9478 dotest sticky-15 "${testcvs} -q update -r tag1" "[UP] file1
9479 ${PROG} [a-z]*: file2 is no longer in the repository"
9482 dotest sticky-16 "${testcvs} rm file1" \
9483 "${PROG} [a-z]*: scheduling .file1. for removal
9484 ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
9485 # Hmm, this command seems to silently remove the tag from
9486 # the file. This appears to be intentional.
9487 # The silently part especially strikes me as odd, though.
9488 dotest sticky-17 "${testcvs} -q ci -m remove-it" ""
9489 dotest sticky-18 "${testcvs} -q update -A" "U file1
9491 dotest sticky-19 "${testcvs} -q update -r tag1" \
9492 "${PROG} [a-z]*: file1 is no longer in the repository
9493 ${PROG} [a-z]*: file2 is no longer in the repository"
9494 dotest sticky-20 "${testcvs} -q update -A" "U file1
9497 # Now try with a numeric revision.
9498 dotest sticky-21 "${testcvs} -q update -r 1.1 file1" "U file1"
9500 dotest sticky-22 "${testcvs} rm file1" \
9501 "${PROG} [a-z]*: cannot remove file .file1. which has a numeric sticky tag of .1\.1."
9502 # The old behavior was that remove allowed this and then commit
9503 # gave an error, which was somewhat hard to clear. I mean, you
9504 # could get into a long elaborate discussion of this being a
9505 # conflict and two ways to resolve it, but I don't really see
9506 # why CVS should have a concept of conflict that arises, not from
9507 # parallel development, but from CVS's own sticky tags.
9509 # I'm kind of surprised that the "file1 was lost" doesn't crop
9510 # up elsewhere in the testsuite. It is a long-standing
9511 # discrepency between local and remote CVS and should probably
9512 # be cleaned up at some point.
9513 dotest sticky-23 "${testcvs} -q update -A" \
9514 "${PROG} [a-z]*: warning: file1 was lost
9519 rm -rf ${CVSROOT_DIRNAME}/first-dir
9523 # Test keyword expansion.
9524 # Various other tests relate to our ability to correctly
9525 # set the keyword expansion mode.
9526 # "binfiles" tests "cvs admin -k".
9527 # "binfiles" and "binfiles2" test "cvs add -k".
9528 # "rdiff" tests "cvs co -k".
9529 # "binfiles" (and this test) test "cvs update -k".
9530 # "binwrap" tests setting the mode from wrappers.
9531 # I don't think any test is testing "cvs import -k".
9533 dotest keyword-1 "${testcvs} -q co -l ." ''
9535 dotest keyword-2 "${testcvs} add first-dir" \
9536 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
9539 echo '$''Author$' > file1
9540 echo '$''Date$' >> file1
9541 echo '$''Header$' >> file1
9542 echo '$''Id$' >> file1
9543 echo '$''Locker$' >> file1
9544 echo '$''Name$' >> file1
9545 echo '$''RCSfile$' >> file1
9546 echo '$''Revision$' >> file1
9547 echo '$''Source$' >> file1
9548 echo '$''State$' >> file1
9549 echo '$''Nonkey$' >> file1
9550 # Omit the trailing dollar sign
9551 echo '$''Date' >> file1
9552 # Put two keywords on one line
9553 echo '$''State$' '$''State$' >> file1
9554 # Use a header for Log
9555 echo 'xx $''Log$' >> file1
9557 dotest keyword-3 "${testcvs} add file1" \
9558 "${PROG} [a-z]*: scheduling file .file1. for addition
9559 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
9560 dotest keyword-4 "${testcvs} -q ci -m add" \
9561 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
9564 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9565 initial revision: 1\.1
9567 dotest keyword-5 "cat file1" \
9568 '\$'"Author: ${username} "'\$'"
9569 "'\$'"Date: [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] "'\$'"
9570 "'\$'"Header: ${TESTDIR}/cvsroot/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
9571 "'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
9572 "'\$'"Locker: "'\$'"
9574 "'\$'"RCSfile: file1,v "'\$'"
9575 "'\$'"Revision: 1\.1 "'\$'"
9576 "'\$'"Source: ${TESTDIR}/cvsroot/first-dir/file1,v "'\$'"
9577 "'\$'"State: Exp "'\$'"
9580 "'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
9581 xx "'\$'"Log: file1,v "'\$'"
9582 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
9586 # Use cvs admin to lock the RCS file in order to check -kkvl
9587 # vs. -kkv. CVS does not normally lock RCS files, but some
9588 # people use cvs admin to enforce reserved checkouts.
9589 dotest keyword-6 "${testcvs} admin -l file1" \
9590 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
9594 dotest keyword-7 "${testcvs} update -kkv file1" "U file1"
9595 dotest keyword-8 "cat file1" \
9596 '\$'"Author: ${username} "'\$'"
9597 "'\$'"Date: [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] "'\$'"
9598 "'\$'"Header: ${TESTDIR}/cvsroot/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
9599 "'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
9600 "'\$'"Locker: "'\$'"
9602 "'\$'"RCSfile: file1,v "'\$'"
9603 "'\$'"Revision: 1\.1 "'\$'"
9604 "'\$'"Source: ${TESTDIR}/cvsroot/first-dir/file1,v "'\$'"
9605 "'\$'"State: Exp "'\$'"
9608 "'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
9609 xx "'\$'"Log: file1,v "'\$'"
9610 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
9614 dotest keyword-9 "${testcvs} update -kkvl file1" "U file1"
9615 dotest keyword-10 "cat file1" \
9616 '\$'"Author: ${username} "'\$'"
9617 "'\$'"Date: [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] "'\$'"
9618 "'\$'"Header: ${TESTDIR}/cvsroot/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp ${username} "'\$'"
9619 "'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp ${username} "'\$'"
9620 "'\$'"Locker: ${username} "'\$'"
9622 "'\$'"RCSfile: file1,v "'\$'"
9623 "'\$'"Revision: 1\.1 "'\$'"
9624 "'\$'"Source: ${TESTDIR}/cvsroot/first-dir/file1,v "'\$'"
9625 "'\$'"State: Exp "'\$'"
9628 "'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
9629 xx "'\$'"Log: file1,v "'\$'"
9630 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
9634 dotest keyword-11 "${testcvs} update -kk file1" "U file1"
9635 dotest keyword-12 "cat file1" \
9643 "'\$'"Revision"'\$'"
9648 "'\$'"State"'\$'" "'\$'"State"'\$'"
9650 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
9654 dotest keyword-13 "${testcvs} update -kv file1" "U file1"
9655 dotest keyword-14 "cat file1" \
9657 [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]
9658 ${TESTDIR}/cvsroot/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp
9659 file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp
9664 ${TESTDIR}/cvsroot/first-dir/file1,v
9670 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
9674 dotest keyword-15 "${testcvs} update -ko file1" "U file1"
9675 dotest keyword-16 "cat file1" \
9683 "'\$'"Revision"'\$'"
9688 "'\$'"State"'\$'" "'\$'"State"'\$'"
9691 # Test the Name keyword. First go back to normal expansion.
9693 dotest keyword-17 "${testcvs} update -A file1" "U file1"
9695 echo '$''Name$' > file1
9696 dotest keyword-18 "${testcvs} ci -m modify file1" \
9698 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9699 new revision: 1\.2; previous revision: 1\.1
9701 dotest keyword-19 "${testcvs} -q tag tag1" "T file1"
9702 echo "change" >> file1
9703 dotest keyword-20 "${testcvs} -q ci -m mod2 file1" \
9705 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9706 new revision: 1\.3; previous revision: 1\.2
9708 dotest keyword-21 "${testcvs} -q update -r tag1" "[UP] file1"
9710 # FIXME: This test fails when remote. The second expect
9711 # string below should be removed when this is fixed.
9712 dotest keyword-22 "cat file1" '\$'"Name: tag1 "'\$' \
9715 dotest keyword-23 "${testcvs} update -A file1" "[UP] file1"
9719 rm -rf ${CVSROOT_DIRNAME}/first-dir
9723 # Test the Log keyword.
9725 dotest keywordlog-1 "${testcvs} -q co -l ." ''
9727 dotest keywordlog-2 "${testcvs} add first-dir" \
9728 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
9731 dotest keywordlog-3 "${testcvs} add file1" \
9732 "${PROG} [a-z]*: scheduling file .file1. for addition
9733 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
9735 # Note that we wanted to try "ci -r 1.3 -m add file1" and CVS
9736 # seemed to get all confused, thinking it was adding on a branch
9737 # or something. FIXME? Do something about this? Document it
9738 # in BUGS or someplace?
9740 dotest keywordlog-4 "${testcvs} -q ci -m add file1" \
9741 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
9744 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9745 initial revision: 1\.1
9750 dotest keywordlog-4a "${testcvs} -q co first-dir" "U first-dir/file1"
9753 echo 'xx $''Log$' > file1
9754 cat >${TESTDIR}/comment.tmp <<EOF
9758 dotest keywordlog-5 "${testcvs} ci -F ${TESTDIR}/comment.tmp file1" \
9760 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9761 new revision: 1\.2; previous revision: 1\.1
9763 rm -f ${TESTDIR}/comment.tmp
9764 dotest keywordlog-6 "${testcvs} -q tag -b br" "T file1"
9765 dotest keywordlog-7 "cat file1" \
9766 "xx "'\$'"Log: file1,v "'\$'"
9767 xx Revision 1\.2 [0-9/]* [0-9:]* ${username}
9772 cd ../../2/first-dir
9773 dotest keywordlog-8 "${testcvs} -q update" "[UP] file1"
9774 dotest keywordlog-9 "cat file1" \
9775 "xx "'\$'"Log: file1,v "'\$'"
9776 xx Revision 1\.2 [0-9/]* [0-9:]* ${username}
9780 cd ../../1/first-dir
9782 echo "change" >> file1
9783 dotest keywordlog-10 "${testcvs} ci -m modify file1" \
9785 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9786 new revision: 1\.3; previous revision: 1\.2
9788 dotest keywordlog-11 "cat file1" \
9789 "xx "'\$'"Log: file1,v "'\$'"
9790 xx Revision 1\.3 [0-9/]* [0-9:]* ${username}
9793 xx Revision 1\.2 [0-9/]* [0-9:]* ${username}
9799 cd ../../2/first-dir
9800 dotest keywordlog-12 "${testcvs} -q update" "[UP] file1"
9801 dotest keywordlog-13 "cat file1" \
9802 "xx "'\$'"Log: file1,v "'\$'"
9803 xx Revision 1\.3 [0-9/]* [0-9:]* ${username}
9806 xx Revision 1\.2 [0-9/]* [0-9:]* ${username}
9812 cd ../../1/first-dir
9813 dotest keywordlog-14 "${testcvs} -q update -r br" "[UP] file1"
9814 echo br-change >>file1
9815 dotest keywordlog-15 "${testcvs} -q ci -m br-modify" \
9817 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
9818 new revision: 1\.2\.2\.1; previous revision: 1\.2
9820 dotest keywordlog-16 "cat file1" \
9821 "xx "'\$'"Log: file1,v "'\$'"
9822 xx Revision 1\.2\.2\.1 [0-9/]* [0-9:]* ${username}
9825 xx Revision 1\.2 [0-9/]* [0-9:]* ${username}
9830 cd ../../2/first-dir
9831 dotest keywordlog-17 "${testcvs} -q update -r br" "[UP] file1"
9832 dotest keywordlog-18 "cat file1" \
9833 "xx "'\$'"Log: file1,v "'\$'"
9834 xx Revision 1\.2\.2\.1 [0-9/]* [0-9:]* ${username}
9837 xx Revision 1\.2 [0-9/]* [0-9:]* ${username}
9843 dotest keywordlog-19 "${testcvs} -q co -p -r br first-dir/file1" \
9844 "xx "'\$'"Log: file1,v "'\$'"
9845 xx Revision 1\.2\.2\.1 [0-9/]* [0-9:]* ${username}
9848 xx Revision 1\.2 [0-9/]* [0-9:]* ${username}
9853 dotest keywordlog-20 "${testcvs} -q co -p first-dir/file1" \
9854 "xx "'\$'"Log: file1,v "'\$'"
9855 xx Revision 1\.3 [0-9/]* [0-9:]* ${username}
9858 xx Revision 1\.2 [0-9/]* [0-9:]* ${username}
9863 dotest keywordlog-21 "${testcvs} -q co -p -r 1.2 first-dir/file1" \
9864 "xx "'\$'"Log: file1,v "'\$'"
9865 xx Revision 1\.2 [0-9/]* [0-9:]* ${username}
9871 rm -rf ${CVSROOT_DIRNAME}/first-dir
9875 # test the feature that cvs creates a CVS subdir also for
9876 # the toplevel directory
9878 # Some test, somewhere, is creating Emptydir. That test
9879 # should, perhaps, clean up for itself, but I don't know which
9881 rm -rf ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
9884 dotest toplevel-1 "${testcvs} -q co -l ." ''
9885 mkdir top-dir second-dir
9886 dotest toplevel-2 "${testcvs} add top-dir second-dir" \
9887 "Directory ${TESTDIR}/cvsroot/top-dir added to the repository
9888 Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
9892 dotest toplevel-3 "${testcvs} add file1" \
9893 "${PROG} [a-z]*: scheduling file .file1. for addition
9894 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
9895 dotest toplevel-4 "${testcvs} -q ci -m add" \
9896 "RCS file: ${TESTDIR}/cvsroot/top-dir/file1,v
9899 ${TESTDIR}/cvsroot/top-dir/file1,v <-- file1
9900 initial revision: 1\.1
9906 dotest toplevel-3s "${testcvs} add file2" \
9907 "${PROG} [a-z]*: scheduling file .file2. for addition
9908 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
9909 dotest toplevel-4s "${testcvs} -q ci -m add" \
9910 "RCS file: ${TESTDIR}/cvsroot/second-dir/file2,v
9913 ${TESTDIR}/cvsroot/second-dir/file2,v <-- file2
9914 initial revision: 1\.1
9918 rm -r 1; mkdir 1; cd 1
9919 dotest toplevel-5 "${testcvs} co top-dir" \
9920 "${PROG} [a-z]*: Updating top-dir
9923 dotest toplevel-6 "${testcvs} update top-dir" \
9924 "${PROG} [a-z]*: Updating top-dir"
9925 dotest toplevel-7 "${testcvs} update" \
9926 "${PROG} [a-z]*: Updating \.
9927 ${PROG} [a-z]*: Updating top-dir"
9929 dotest toplevel-8 "${testcvs} update -d top-dir" \
9930 "${PROG} [a-z]*: Updating top-dir"
9931 # There is some sentiment that
9932 # "${PROG} [a-z]*: Updating \.
9933 # ${PROG} [a-z]*: Updating top-dir"
9934 # is correct but it isn't clear why that would be correct instead
9935 # of the remote CVS behavior (which also updates CVSROOT).
9937 # The DOTSTAR matches of a bunch of lines like
9938 # "U CVSROOT/checkoutlist". Trying to match them more precisely
9939 # seemed to cause trouble. For example CVSROOT/cvsignore will
9940 # be present or absent depending on whether we ran the "ignore"
9942 dotest toplevel-9 "${testcvs} update -d" \
9943 "${PROG} [a-z]*: Updating \.
9944 ${PROG} [a-z]*: Updating CVSROOT
9946 ${PROG} [a-z]*: Updating top-dir"
9949 rm -r 1; mkdir 1; cd 1
9950 dotest toplevel-10 "${testcvs} co top-dir" \
9951 "${PROG} [a-z]*: Updating top-dir
9953 # This tests more or less the same thing, in a particularly
9954 # "real life" example.
9955 dotest toplevel-11 "${testcvs} -q update -d second-dir" \
9956 "U second-dir/file2"
9958 # Now remove the CVS directory (people may do this manually,
9959 # especially if they formed their habits with CVS
9960 # 1.9 and older, which didn't create it. Or perhaps the working
9961 # directory itself was created with 1.9 or older).
9963 # Now set the permissions so we can't recreate it.
9965 # Now see whether CVS has trouble because it can't create CVS.
9966 dotest toplevel-12 "${testcvs} co top-dir" \
9967 "${PROG} [a-z]*: warning: cannot make directory ./CVS: Permission denied
9968 ${PROG} [a-z]*: Updating top-dir"
9973 rm -rf ${CVSROOT_DIRNAME}/top-dir
9977 # Testing handling of the HEAD special tag.
9978 # There are many cases involving added and removed files
9979 # which we don't yet try to deal with.
9980 # TODO: We also could be paying much closer attention to
9981 # "head of the trunk" versus "head of the default branch".
9982 # That is what "cvs import" is doing here (but I didn't really
9983 # fully follow through on writing the tests for that case).
9986 echo 'imported contents' >file1
9987 # It may seem like we don't do much with file2, but do note that
9988 # the "cvs diff" invocations do also diff file2 (and come up empty).
9989 echo 'imported contents' >file2
9990 dotest head-1 "${testcvs} import -m add first-dir tag1 tag2" \
9994 No conflicts created by this import"
9999 dotest head-2 "${testcvs} -q co first-dir" \
10003 echo 'add a line on trunk' >> file1
10004 dotest head-3 "${testcvs} -q ci -m modify" \
10005 "Checking in file1;
10006 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10007 new revision: 1\.2; previous revision: 1\.1
10009 dotest head-4 "${testcvs} -q tag trunktag" "T file1
10011 echo 'add a line on trunk after trunktag' >> file1
10012 dotest head-5 "${testcvs} -q ci -m modify" \
10013 "Checking in file1;
10014 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10015 new revision: 1\.3; previous revision: 1\.2
10017 dotest head-6 "${testcvs} -q tag -b br1" "T file1
10019 dotest head-7 "${testcvs} -q update -r br1" ""
10020 echo 'modify on branch' >>file1
10021 dotest head-8 "${testcvs} -q ci -m modify" \
10022 "Checking in file1;
10023 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10024 new revision: 1\.3\.2\.1; previous revision: 1\.3
10026 dotest head-9 "${testcvs} -q tag brtag" "T file1
10028 echo 'modify on branch after brtag' >>file1
10029 dotest head-10 "${testcvs} -q ci -m modify" \
10030 "Checking in file1;
10031 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10032 new revision: 1\.3\.2\.2; previous revision: 1\.3\.2\.1
10034 # With no sticky tags, HEAD is the head of the trunk.
10035 dotest head-trunk-setup "${testcvs} -q update -A" "[UP] file1"
10036 dotest head-trunk-update "${testcvs} -q update -r HEAD -p file1" \
10038 add a line on trunk
10039 add a line on trunk after trunktag"
10040 # and diff thinks so too. Case (a) from the comment in
10041 # cvs.texinfo (Common options).
10042 dotest_fail head-trunk-diff "${testcvs} -q diff -c -r HEAD -r br1" \
10044 ===================================================================
10045 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10046 retrieving revision 1\.3
10047 retrieving revision 1\.3\.2\.2
10048 diff -c -r1\.3 -r1\.3\.2\.2
10049 \*\*\* file1 [0-9/]* [0-9:]* 1\.3
10050 --- file1 [0-9/]* [0-9:]* 1\.3\.2\.2
10051 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
10052 \*\*\* 1,3 \*\*\*\*
10055 add a line on trunk
10056 add a line on trunk after trunktag
10057 ${PLUS} modify on branch
10058 ${PLUS} modify on branch after brtag"
10060 # With a branch sticky tag, HEAD is the head of the trunk.
10061 dotest head-br1-setup "${testcvs} -q update -r br1" "[UP] file1"
10062 dotest head-br1-update "${testcvs} -q update -r HEAD -p file1" \
10064 add a line on trunk
10065 add a line on trunk after trunktag"
10066 # But diff thinks that HEAD is "br1". Case (b) from cvs.texinfo.
10067 # Probably people are relying on it.
10068 dotest head-br1-diff "${testcvs} -q diff -c -r HEAD -r br1" ""
10070 # With a nonbranch sticky tag on a branch,
10071 # HEAD is the head of the trunk
10072 dotest head-brtag-setup "${testcvs} -q update -r brtag" "[UP] file1"
10073 dotest head-brtag-update "${testcvs} -q update -r HEAD -p file1" \
10075 add a line on trunk
10076 add a line on trunk after trunktag"
10077 # But diff thinks that HEAD is "brtag". Case (c) from
10078 # cvs.texinfo (the "strange, maybe accidental" case).
10079 dotest_fail head-brtag-diff "${testcvs} -q diff -c -r HEAD -r br1" \
10081 ===================================================================
10082 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10083 retrieving revision 1\.3\.2\.1
10084 retrieving revision 1\.3\.2\.2
10085 diff -c -r1\.3\.2\.1 -r1\.3\.2\.2
10086 \*\*\* file1 [0-9/]* [0-9:]* 1\.3\.2\.1
10087 --- file1 [0-9/]* [0-9:]* 1\.3\.2\.2
10088 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
10089 \*\*\* 2,4 \*\*\*\*
10091 add a line on trunk
10092 add a line on trunk after trunktag
10094 ${PLUS} modify on branch after brtag"
10096 # With a nonbranch sticky tag on the trunk, HEAD is the head
10097 # of the trunk, I think.
10098 dotest head-trunktag-setup "${testcvs} -q update -r trunktag" \
10100 dotest head-trunktag-check "cat file1" "imported contents
10101 add a line on trunk"
10102 dotest head-trunktag-update "${testcvs} -q update -r HEAD -p file1" \
10104 add a line on trunk
10105 add a line on trunk after trunktag"
10106 # Like head-brtag-diff, HEAD is the sticky tag. Similarly
10108 dotest_fail head-trunktag-diff \
10109 "${testcvs} -q diff -c -r HEAD -r br1" \
10111 ===================================================================
10112 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10113 retrieving revision 1\.2
10114 retrieving revision 1\.3\.2\.2
10115 diff -c -r1\.2 -r1\.3\.2\.2
10116 \*\*\* file1 [0-9/]* [0-9:]* 1\.2
10117 --- file1 [0-9/]* [0-9:]* 1\.3\.2\.2
10118 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
10119 \*\*\* 1,2 \*\*\*\*
10122 add a line on trunk
10123 ${PLUS} add a line on trunk after trunktag
10124 ${PLUS} modify on branch
10125 ${PLUS} modify on branch after brtag"
10127 # Also might test what happens if we setup with update -r
10128 # HEAD. In general, if sticky tags matter, does the
10129 # behavior of "update -r <foo>" (without -p) depend on the
10130 # sticky tags before or after the update?
10132 # Note that we are testing both the case where this deletes
10133 # a revision (file1) and the case where it does not (file2)
10134 dotest_fail head-o0a "${testcvs} admin -o ::br1" \
10135 "${PROG} [a-z]*: Administrating \.
10136 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10137 ${PROG} [a-z]*: cannot remove revision 1\.3\.2\.1 because it has tags
10138 ${PROG} [a-z]*: cannot modify RCS file for .file1.
10139 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
10141 dotest head-o0b "${testcvs} tag -d brtag" \
10142 "${PROG} [a-z]*: Untagging \.
10145 dotest head-o1 "${testcvs} admin -o ::br1" \
10146 "${PROG} [a-z]*: Administrating \.
10147 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10148 deleting revision 1\.3\.2\.1
10150 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
10154 rm -rf ${CVSROOT_DIRNAME}/first-dir
10158 # Test combining -r and -D.
10160 dotest tagdate-1 "${testcvs} -q co -l ." ''
10162 dotest tagdate-2 "${testcvs} add first-dir" \
10163 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
10166 echo trunk-1 >file1
10167 dotest tagdate-3 "${testcvs} add file1" \
10168 "${PROG} [a-z]*: scheduling file .file1. for addition
10169 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
10170 dotest tagdate-4 "${testcvs} -q ci -m add" \
10171 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10174 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10175 initial revision: 1\.1
10177 dotest tagdate-5 "${testcvs} -q tag -b br1" "T file1"
10178 dotest tagdate-6 "${testcvs} -q tag -b br2" "T file1"
10179 echo trunk-2 >file1
10180 dotest tagdate-7 "${testcvs} -q ci -m modify-on-trunk" \
10181 "Checking in file1;
10182 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10183 new revision: 1\.2; previous revision: 1\.1
10185 # We are testing -r -D where br1 is a (magic) branch without
10186 # any revisions. First the case where br2 doesn't have any
10187 # revisions either:
10188 dotest tagdate-8 "${testcvs} -q update -p -r br1 -D now" "trunk-1"
10189 dotest tagdate-9 "${testcvs} -q update -r br2" "[UP] file1"
10191 dotest tagdate-10 "${testcvs} -q ci -m modify-on-br2" \
10192 "Checking in file1;
10193 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10194 new revision: 1\.1\.4\.1; previous revision: 1\.1
10196 # Then the case where br2 does have revisions:
10197 dotest tagdate-11 "${testcvs} -q update -p -r br1 -D now" "trunk-1"
10201 rm -rf ${CVSROOT_DIRNAME}/first-dir
10205 # Commit the first delta on branch A when there is an older
10206 # branch, B, that already has a delta. A and B come from the
10207 # same branch point. Then verify that branches A and B are
10208 # in the right order.
10210 dotest multibranch2-1 "${testcvs} -q co -l ." ''
10212 dotest multibranch2-2 "${testcvs} add first-dir" \
10213 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
10216 echo trunk-1 >file1
10217 dotest multibranch2-3 "${testcvs} add file1" \
10218 "${PROG} [a-z]*: scheduling file .file1. for addition
10219 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
10220 dotest multibranch2-4 "${testcvs} -q ci -m add" \
10221 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10224 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10225 initial revision: 1\.1
10227 dotest multibranch2-5 "${testcvs} -q tag -b A" "T file1"
10228 dotest multibranch2-6 "${testcvs} -q tag -b B" "T file1"
10230 dotest multibranch2-7 "${testcvs} -q update -r B" ''
10231 echo branch-B >file1
10232 dotest multibranch2-8 "${testcvs} -q ci -m modify-on-B" \
10233 "Checking in file1;
10234 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10235 new revision: 1\.1\.4\.1; previous revision: 1\.1
10238 dotest multibranch2-9 "${testcvs} -q update -r A" '[UP] file1'
10239 echo branch-A >file1
10240 # When using cvs-1.9.20, this commit gets a failed assertion in rcs.c.
10241 dotest multibranch2-10 "${testcvs} -q ci -m modify-on-A" \
10242 "Checking in file1;
10243 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10244 new revision: 1\.1\.2\.1; previous revision: 1\.1
10247 dotest multibranch2-11 "${testcvs} -q log" \
10249 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10250 Working file: file1
10258 keyword substitution: kv
10259 total revisions: 3; selected revisions: 3
10261 ----------------------------
10263 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
10264 branches: 1\.1\.2; 1\.1\.4;
10266 ----------------------------
10267 revision 1\.1\.4\.1
10268 date: [0-9/]* [0-9:]*; author: $username; state: Exp; lines: ${PLUS}1 -1
10270 ----------------------------
10271 revision 1\.1\.2\.1
10272 date: [0-9/]* [0-9:]*; author: $username; state: Exp; lines: ${PLUS}1 -1
10274 ============================================================================="
10276 # This one is more concise.
10277 dotest multibranch2-12 "${testcvs} -q log -r1.1" \
10279 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10280 Working file: file1
10288 keyword substitution: kv
10289 total revisions: 3; selected revisions: 1
10291 ----------------------------
10293 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
10294 branches: 1\.1\.2; 1\.1\.4;
10296 ============================================================================="
10300 rm -rf ${CVSROOT_DIRNAME}/first-dir
10305 # More "cvs admin" tests.
10306 # The basicb-21 test tests rejecting an illegal option.
10307 # For -l and -u, see "reserved" and "keyword" tests.
10308 # "binfiles" test has a test of "cvs admin -k".
10309 # "log2" test has tests of -t and -q options to cvs admin.
10310 # "rcs" tests -b option also.
10312 # admin-22-o1 through admin-23 (various cases not involving ::)
10313 # binfiles2-o* (:rev, rev on trunk; rev:, deleting entire branch)
10314 # basica-o1 through basica-o3 (basic :: usage)
10315 # head-o1 (::branch, where this deletes a revision or is noop)
10316 # branches-o1 (::branch, similar, with different branch topology)
10317 # log-o1 (1.3.2.1::)
10318 # binfiles-o1 (1.3:: and ::1.3)
10319 # Also could be testing:
10323 # 1.3::1.3.2.6 (error? or synonym for ::1.3.2.6?)
10326 dotest admin-1 "${testcvs} -q co -l ." ''
10328 dotest admin-2 "${testcvs} add first-dir" \
10329 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
10332 dotest_fail admin-3 "${testcvs} -q admin -i file1" \
10333 "${PROG} admin: the -i option to admin is not supported
10334 ${PROG} admin: run add or import to create an RCS file
10335 ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information"
10336 dotest_fail admin-4 "${testcvs} -q log file1" \
10337 "${PROG} [a-z]*: nothing known about file1"
10339 # Set up some files, file2 a plain one and file1 with a revision
10342 dotest admin-5 "${testcvs} add file1 file2" \
10343 "${PROG} [a-z]*: scheduling file .file1. for addition
10344 ${PROG} [a-z]*: scheduling file .file2. for addition
10345 ${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
10346 dotest admin-6 "${testcvs} -q ci -m add" \
10347 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10350 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10351 initial revision: 1\.1
10353 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
10356 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
10357 initial revision: 1\.1
10359 dotest admin-7 "${testcvs} -q tag -b br" "T file1
10361 dotest admin-8 "${testcvs} -q update -r br" ""
10362 echo 'add a line on the branch' >> file1
10363 dotest admin-9 "${testcvs} -q ci -m modify-on-branch" \
10364 "Checking in file1;
10365 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10366 new revision: 1\.1\.2\.1; previous revision: 1\.1
10368 dotest admin-10 "${testcvs} -q update -A" "U file1"
10370 # Try to recurse with a numeric revision arg.
10371 # If we wanted to comprehensive about this, we would also test
10372 # this for -l, -u, and all the different -o syntaxes.
10373 dotest_fail admin-10a "${testcvs} -q admin -b1.1.2" \
10374 "${PROG} [a-z]*: while processing more than one file:
10375 ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
10376 dotest_fail admin-10b "${testcvs} -q admin -m1.1:bogus file1 file2" \
10377 "${PROG} [a-z]*: while processing more than one file:
10378 ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
10380 # Note that -s option applies to the new default branch, not
10382 # Also note that the implementation of -a via "rcs" requires
10383 # no space between -a and the argument. However, we expect
10384 # to change that once CVS parses options.
10385 dotest admin-11 "${testcvs} -q admin -afoo,bar -abaz \
10386 -b1.1.2 -cxx -U -sfoo file1" \
10387 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10390 dotest admin-12 "${testcvs} log -N file1" "
10391 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10392 Working file: file1
10400 keyword substitution: kv
10401 total revisions: 2; selected revisions: 2
10403 ----------------------------
10405 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
10408 ----------------------------
10409 revision 1\.1\.2\.1
10410 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
10412 ============================================================================="
10414 # "cvs log" doesn't print the comment leader. RCS 5.7 will print
10415 # the comment leader only if one specifies "-V4" to rlog. So it
10416 # seems like the only way to test it is by looking at the RCS file
10417 # directly. This also serves as a test of exporting RCS files
10418 # (analogous to the import tests in "rcs").
10419 # Rather than try to write a rigorous check for whether the
10420 # file CVS exports is legal, we just write a simpler
10421 # test for what CVS actually exports, and figure we can revise
10422 # the check as needed (within the confines of the RCS5 format as
10423 # documented in RCSFILES).
10424 dotest admin-13 "cat ${CVSROOT_DIRNAME}/first-dir/file1,v" \
10438 date [0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]; author ${username}; state Exp;
10444 date [0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]; author ${username}; state foo;
10467 add a line on the branch
10469 dotest admin-14 "${testcvs} -q admin -aauth3 -aauth2,foo \
10470 -soneone:1.1 -m1.1:changed-log-message -ntagone: file2" \
10471 "RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
10473 dotest admin-15 "${testcvs} -q log file2" "
10474 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
10475 Working file: file2
10486 keyword substitution: kv
10487 total revisions: 1; selected revisions: 1
10489 ----------------------------
10491 date: [0-9/]* [0-9:]*; author: ${username}; state: oneone;
10492 changed-log-message
10493 ============================================================================="
10495 dotest admin-16 "${testcvs} -q admin \
10496 -A${CVSROOT_DIRNAME}/first-dir/file2,v -b -L -Nbr:1.1 file1" \
10497 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10499 dotest admin-17 "${testcvs} -q log file1" "
10500 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10501 Working file: file1
10513 keyword substitution: kv
10514 total revisions: 2; selected revisions: 2
10516 ----------------------------
10518 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
10521 ----------------------------
10522 revision 1\.1\.2\.1
10523 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
10525 ============================================================================="
10527 dotest_fail admin-18 "${testcvs} -q admin -nbr:1.1.2 file1" \
10528 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10529 ${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/file1,v: symbolic name br already bound to 1\.1
10530 ${PROG} [a-z]*: cannot modify RCS file for .file1."
10531 dotest admin-19 "${testcvs} -q admin -ebaz -ebar,auth3 -nbr file1" \
10532 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10534 dotest admin-20 "${testcvs} -q log file1" "
10535 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10536 Working file: file1
10544 keyword substitution: kv
10545 total revisions: 2; selected revisions: 2
10547 ----------------------------
10549 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
10552 ----------------------------
10554 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
10556 ============================================================================="
10558 # OK, this is starting to get ridiculous, in terms of
10559 # testing a feature (access lists) which doesn't do anything
10560 # useful, but what about nonexistent files and
10561 # relative pathnames in admin -A?
10562 dotest_fail admin-19a-nonexist \
10563 "${testcvs} -q admin -A${TESTDIR}/foo/bar file1" \
10564 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10565 ${PROG} [a-z]*: Couldn't open rcs file .${TESTDIR}/foo/bar.: No such file or directory
10566 ${PROG} \[[a-z]* aborted\]: cannot continue"
10568 # In the remote case, we are cd'd off into the temp directory
10569 # and so these tests give "No such file or directory" errors.
10570 if test "x$remote" = xno; then
10572 dotest admin-19a-admin "${testcvs} -q admin -A../../cvsroot/first-dir/file2,v file1" \
10573 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10575 dotest admin-19a-log "${testcvs} -q log -h -N file1" "
10576 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10577 Working file: file1
10585 keyword substitution: kv
10587 ============================================================================="
10588 # Put the access list back, to avoid special cases later.
10589 dotest admin-19a-fix "${testcvs} -q admin -eauth3 file1" \
10590 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10592 fi # end of tests skipped for remote
10594 # Add another revision to file2, so we can delete one.
10595 echo 'add a line' >> file2
10596 dotest admin-21 "${testcvs} -q ci -m modify file2" \
10597 "Checking in file2;
10598 ${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
10599 new revision: 1\.2; previous revision: 1\.1
10601 dotest admin-22 "${testcvs} -q admin -o1.1 file2" \
10602 "RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
10603 deleting revision 1\.1
10605 # Test admin -o. More variants that we could be testing:
10606 # * REV: [on branch]
10607 # * REV1:REV2 [deleting whole branch]
10608 # * high branch numbers (e.g. 1.2.2.3.2.3)
10609 # ... and probably others. See RCS_delete_revs for ideas.
10611 echo first rev > aaa
10612 dotest admin-22-o1 "${testcvs} add aaa" \
10613 "${PROG} [a-z]*: scheduling file .aaa. for addition
10614 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
10615 dotest admin-22-o2 "${testcvs} -q ci -m first aaa" \
10616 "RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
10619 ${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
10620 initial revision: 1\.1
10622 echo second rev >> aaa
10623 dotest admin-22-o3 "${testcvs} -q ci -m second aaa" \
10625 ${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
10626 new revision: 1\.2; previous revision: 1\.1
10628 echo third rev >> aaa
10629 dotest admin-22-o4 "${testcvs} -q ci -m third aaa" \
10631 ${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
10632 new revision: 1\.3; previous revision: 1\.2
10634 echo fourth rev >> aaa
10635 dotest admin-22-o5 "${testcvs} -q ci -m fourth aaa" \
10637 ${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
10638 new revision: 1\.4; previous revision: 1\.3
10640 echo fifth rev >>aaa
10641 dotest admin-22-o6 "${testcvs} -q ci -m fifth aaa" \
10643 ${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
10644 new revision: 1\.5; previous revision: 1\.4
10646 echo sixth rev >> aaa
10647 dotest admin-22-o7 "${testcvs} -q ci -m sixth aaa" \
10649 ${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
10650 new revision: 1\.6; previous revision: 1\.5
10652 dotest admin-22-o8 "${testcvs} admin -l1.6 aaa" \
10653 "RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
10656 dotest admin-22-o9 "${testcvs} log -r1.6 aaa" "
10657 RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
10665 keyword substitution: kv
10666 total revisions: 6; selected revisions: 1
10668 ----------------------------
10669 revision 1\.6 locked by: ${username};
10670 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
10672 ============================================================================="
10673 dotest_fail admin-22-o10 "${testcvs} admin -o1.5: aaa" \
10674 "RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
10675 ${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/aaa,v: can't remove locked revision 1\.6
10676 ${PROG} [a-z]*: cannot modify RCS file for .aaa."
10677 dotest admin-22-o11 "${testcvs} admin -u aaa" \
10678 "RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
10681 dotest admin-22-o12 "${testcvs} admin -o1.5: aaa" \
10682 "RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
10683 deleting revision 1\.6
10684 deleting revision 1\.5
10686 dotest admin-22-o13 "${testcvs} log aaa" "
10687 RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
10694 keyword substitution: kv
10695 total revisions: 4; selected revisions: 4
10697 ----------------------------
10699 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
10701 ----------------------------
10703 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
10705 ----------------------------
10707 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
10709 ----------------------------
10711 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
10713 ============================================================================="
10715 dotest admin-22-o14 "${testcvs} tag -b -r1.3 br1 aaa" "T aaa"
10716 dotest admin-22-o15 "${testcvs} update -rbr1 aaa" "U aaa"
10717 echo new branch rev >> aaa
10718 dotest admin-22-o16 "${testcvs} ci -m new-branch aaa" \
10720 ${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
10721 new revision: 1\.3\.2\.1; previous revision: 1\.3
10723 dotest_fail admin-22-o17 "${testcvs} admin -o1.2:1.4 aaa" \
10724 "RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
10725 deleting revision 1\.4
10726 ${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/aaa,v: can't remove branch point 1\.3
10727 ${PROG} [a-z]*: cannot modify RCS file for .aaa."
10728 dotest admin-22-o18 "${testcvs} update -p -r1.4 aaa" \
10729 "===================================================================
10731 RCS: ${TESTDIR}/cvsroot/first-dir/aaa,v
10733 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
10738 echo second branch rev >> aaa
10739 dotest admin-22-o19 "${testcvs} ci -m branch-two aaa" \
10741 ${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
10742 new revision: 1\.3\.2\.2; previous revision: 1\.3\.2\.1
10744 echo third branch rev >> aaa
10745 dotest admin-22-o20 "${testcvs} ci -m branch-three aaa" \
10747 ${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
10748 new revision: 1\.3\.2\.3; previous revision: 1\.3\.2\.2
10750 echo fourth branch rev >> aaa
10751 dotest admin-22-o21 "${testcvs} ci -m branch-four aaa" \
10753 ${TESTDIR}/cvsroot/first-dir/aaa,v <-- aaa
10754 new revision: 1\.3\.2\.4; previous revision: 1\.3\.2\.3
10756 dotest admin-22-o22 "${testcvs} admin -o:1.3.2.3 aaa" \
10757 "RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
10758 deleting revision 1\.3\.2\.1
10759 deleting revision 1\.3\.2\.2
10760 deleting revision 1\.3\.2\.3
10762 dotest admin-22-o23 "${testcvs} log aaa" "
10763 RCS file: ${TESTDIR}/cvsroot/first-dir/aaa,v
10771 keyword substitution: kv
10772 total revisions: 5; selected revisions: 5
10774 ----------------------------
10776 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
10778 ----------------------------
10780 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
10783 ----------------------------
10785 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
10787 ----------------------------
10789 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
10791 ----------------------------
10792 revision 1\.3\.2\.4
10793 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}4 -0
10795 ============================================================================="
10797 dotest admin-22-o24 "${testcvs} -q update -p -r 1.3.2.4 aaa" \
10806 # The bit here about how there is a "tagone" tag pointing to
10807 # a nonexistent revision is documented by rcs. I dunno, I
10808 # wonder whether the "cvs admin -o" should give a warning in
10810 dotest admin-23 "${testcvs} -q log file2" "
10811 RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
10812 Working file: file2
10823 keyword substitution: kv
10824 total revisions: 1; selected revisions: 1
10826 ----------------------------
10828 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
10830 ============================================================================="
10832 dotest admin-25 "cat ${CVSROOT_DIRNAME}/first-dir/file1,v" \
10843 date [0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]; author ${username}; state Exp;
10849 date [0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]; author ${username}; state foo;
10872 add a line on the branch
10877 rm -rf ${CVSROOT_DIRNAME}/first-dir
10881 # Tests of reserved checkouts. Eventually this will test
10882 # rcslock.pl (or equivalent) and all kinds of stuff. Right
10883 # now it just does some very basic checks on cvs admin -u
10884 # and cvs admin -l.
10885 # Also should test locking on a branch (and making sure that
10886 # locks from one branch don't get mixed up with those from
10887 # another. Both the case where one of the branches is the
10888 # main branch, and in which neither one is).
10889 # See also test keyword, which tests that keywords and -kkvl
10890 # do the right thing in the presence of locks.
10892 # The usual setup, directory first-dir containing file file1.
10894 dotest reserved-1 "${testcvs} -q co -l ." ''
10896 dotest reserved-2 "${testcvs} add first-dir" \
10897 "Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
10900 dotest reserved-3 "${testcvs} add file1" \
10901 "${PROG} [a-z]*: scheduling file .file1. for addition
10902 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
10903 dotest reserved-4 "${testcvs} -q ci -m add" \
10904 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10907 ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
10908 initial revision: 1\.1
10911 dotest reserved-5 "${testcvs} -q admin -l file1" \
10912 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10915 dotest reserved-6 "${testcvs} log -N file1" "
10916 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10917 Working file: file1
10923 keyword substitution: kv
10924 total revisions: 1; selected revisions: 1
10926 ----------------------------
10927 revision 1\.1 locked by: ${username};
10928 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
10930 ============================================================================="
10932 # Note that this just tests the owner of the lock giving
10933 # it up. It doesn't test breaking a lock.
10934 dotest reserved-7 "${testcvs} -q admin -u file1" \
10935 "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10939 dotest reserved-8 "${testcvs} log -N file1" "
10940 RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
10941 Working file: file1
10946 keyword substitution: kv
10947 total revisions: 1; selected revisions: 1
10949 ----------------------------
10951 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
10953 ============================================================================="
10955 # rcslock.pl tests. Of course, the point isn't to test
10956 # rcslock.pl from the distribution but equivalent
10957 # functionality (for example, many sites may have an old
10958 # rcslock.pl). The functionality of this hook falls
10959 # short of the real rcslock.pl though.
10960 # Note that we can use rlog or look at the RCS file directly,
10961 # but we can't use "cvs log" because "cvs commit" has a lock.
10963 cat >${TESTDIR}/lockme <<EOF
10965 line=\`grep <\$1/\$2,v 'locks ${username}:1\.[0-9];'\`
10966 if test -z "\$line"; then
10970 user=\`echo \$line | sed -e 's/locks \\(${username}\\):[0-9.]*;.*/\\1/'\`
10971 version=\`echo \$line | sed -e 's/locks ${username}:\\([0-9.]*\\);.*/\\1/'\`
10972 echo "\$user has file a-lock locked for version \$version"
10976 chmod +x ${TESTDIR}/lockme
10978 echo stuff > a-lock
10979 dotest reserved-9 "${testcvs} add a-lock" \
10980 "${PROG} [a-z]*: scheduling file .a-lock. for addition
10981 ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
10982 dotest reserved-10 "${testcvs} -q ci -m new a-lock" \
10983 "RCS file: ${TESTDIR}/cvsroot/first-dir/a-lock,v
10985 Checking in a-lock;
10986 ${TESTDIR}/cvsroot/first-dir/a-lock,v <-- a-lock
10987 initial revision: 1\.1
10989 # FIXME: the contents of CVSROOT fluctuate a lot
10990 # here. Maybe the expect pattern should just
10991 # confirm that commitinfo is one of the files checked out,
10992 # but for now we just check that CVS exited with success.
10994 if ${testcvs} -q co CVSROOT >>${LOGFILE} ; then
11000 echo "DEFAULT ${TESTDIR}/lockme" >>commitinfo
11001 dotest reserved-12 "${testcvs} -q ci -m rcslock commitinfo" \
11002 "Checking in commitinfo;
11003 ${TESTDIR}/cvsroot/CVSROOT/commitinfo,v <-- commitinfo
11004 new revision: 1\.2; previous revision: 1\.1
11006 ${PROG} [a-z]*: Rebuilding administrative file database"
11007 cd ..; cd first-dir
11009 # Simulate (approximately) what a-lock would look like
11010 # if someone else had locked revision 1.1.
11011 sed -e 's/locks; strict;/locks fred:1.1; strict;/' ${TESTDIR}/cvsroot/first-dir/a-lock,v > a-lock,v
11012 chmod 644 ${TESTDIR}/cvsroot/first-dir/a-lock,v
11013 dotest reserved-13 "mv a-lock,v ${TESTDIR}/cvsroot/first-dir/a-lock,v"
11014 chmod 444 ${TESTDIR}/cvsroot/first-dir/a-lock,v
11015 echo more stuff >> a-lock
11016 dotest_fail reserved-13b "${testcvs} ci -m '' a-lock" \
11017 "fred has file a-lock locked for version 1\.1
11018 ${PROG} [a-z]*: Pre-commit check failed
11019 ${PROG} \[[a-z]* aborted\]: correct above errors first!"
11021 dotest reserved-14 "${testcvs} admin -u1.1 a-lock" \
11022 "RCS file: ${TESTDIR}/cvsroot/first-dir/a-lock,v
11025 dotest reserved-15 "${testcvs} -q ci -m success a-lock" \
11026 "Checking in a-lock;
11027 ${TESTDIR}/cvsroot/first-dir/a-lock,v <-- a-lock
11028 new revision: 1\.2; previous revision: 1\.1
11031 # undo commitinfo changes
11033 echo '# vanilla commitinfo' >commitinfo
11034 dotest reserved-16 "${testcvs} -q ci -m back commitinfo" \
11035 "Checking in commitinfo;
11036 ${TESTDIR}/cvsroot/CVSROOT/commitinfo,v <-- commitinfo
11037 new revision: 1\.3; previous revision: 1\.2
11039 ${PROG} [a-z]*: Rebuilding administrative file database"
11040 cd ..; rm -r CVSROOT; cd first-dir
11044 rm ${TESTDIR}/lockme
11045 rm -rf ${CVSROOT_DIRNAME}/first-dir
11049 # These test check the content of CVS' administrative
11050 # files as they are checked out in various configurations.
11051 # (As a side note, I'm not using the "-q" flag in any of
11052 # this code, which should provide some extra checking for
11053 # those messages which don't seem to be checked thoroughly
11054 # anywhere else.) To do a thorough test, we need to make
11055 # a bunch of modules in various configurations.
11057 # <1mod> is a directory at the top level of cvsroot
11059 # <2mod> is a directory at the second level of cvsroot
11061 # <1d1mod> is a directory at the top level which is
11062 # checked out into another directory
11063 # ``foo -d bar baz''
11064 # <1d2mod> is a directory at the second level which is
11065 # checked out into another directory
11066 # ``foo -d bar baz/quux''
11067 # <2d1mod> is a directory at the top level which is
11068 # checked out into a directory that is two deep
11069 # ``foo -d bar/baz quux''
11070 # <2d2mod> is a directory at the second level which is
11071 # checked out into a directory that is two deep
11072 # ``foo -d bar/baz quux''
11074 # The tests do each of these types separately and in twos.
11075 # We also repeat each test -d flag for 1-deep and 2-deep
11078 # Each test should check the output for the Repository
11079 # file, since that is the one which varies depending on
11080 # the directory and how it was checked out.
11082 # Yes, this is verbose, but at least it's very thorough.
11084 # convenience variables
11087 # First, check out the modules file and edit it.
11089 dotest cvsadm-1 "${testcvs} co CVSROOT/modules" \
11090 "U CVSROOT/modules"
11092 # Try to determine whether RELATIVE_REPOS is defined
11093 # so that we can make the following a lot less
11096 echo "${CVSROOT_DIRNAME}/." > ${TESTDIR}/dotest.abs
11097 echo "." > ${TESTDIR}/dotest.rel
11098 if cmp ${TESTDIR}/dotest.abs CVS/Repository >/dev/null 2>&1; then
11099 AREP="${CVSROOT_DIRNAME}/"
11100 elif cmp ${TESTDIR}/dotest.rel CVS/Repository >/dev/null 2>&1; then
11103 fail "Cannot figure out if RELATIVE_REPOS is defined."
11106 # Test CVS/Root once. Since there is only one part of
11107 # the code which writes CVS/Root files (Create_Admin),
11108 # there is no point in testing this every time.
11109 dotest cvsadm-1a "cat CVS/Root" ${REP}
11110 dotest cvsadm-1b "cat CVS/Repository" \
11112 dotest cvsadm-1c "cat CVSROOT/CVS/Root" ${REP}
11113 dotest cvsadm-1d "cat CVSROOT/CVS/Repository" \
11115 # All of the defined module names begin with a number.
11116 # All of the top-level directory names begin with "dir".
11117 # All of the subdirectory names begin with "sub".
11118 # All of the top-level modules begin with "mod".
11119 echo "# Module defs for cvsadm tests" > CVSROOT/modules
11120 echo "1mod mod1" >> CVSROOT/modules
11121 echo "1mod-2 mod1-2" >> CVSROOT/modules
11122 echo "2mod mod2/sub2" >> CVSROOT/modules
11123 echo "2mod-2 mod2-2/sub2-2" >> CVSROOT/modules
11124 echo "1d1mod -d dir1d1 mod1" >> CVSROOT/modules
11125 echo "1d1mod-2 -d dir1d1-2 mod1-2" >> CVSROOT/modules
11126 echo "1d2mod -d dir1d2 mod2/sub2" >> CVSROOT/modules
11127 echo "1d2mod-2 -d dir1d2-2 mod2-2/sub2-2" >> CVSROOT/modules
11128 echo "2d1mod -d dir2d1/sub2d1 mod1" >> CVSROOT/modules
11129 echo "2d1mod-2 -d dir2d1-2/sub2d1-2 mod1-2" >> CVSROOT/modules
11130 echo "2d2mod -d dir2d2/sub2d2 mod2/sub2" >> CVSROOT/modules
11131 echo "2d2mod-2 -d dir2d2-2/sub2d2-2 mod2-2/sub2-2" >> CVSROOT/modules
11132 dotest cvsadm-1e "${testcvs} ci -m add-modules" \
11133 "${PROG} [a-z]*: Examining .
11134 ${PROG} [a-z]*: Examining CVSROOT
11135 Checking in CVSROOT/modules;
11136 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
11137 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
11139 ${PROG} [a-z]*: Rebuilding administrative file database"
11140 rm -rf CVS CVSROOT;
11142 # Create the various modules
11143 mkdir ${CVSROOT_DIRNAME}/mod1
11144 mkdir ${CVSROOT_DIRNAME}/mod1-2
11145 mkdir ${CVSROOT_DIRNAME}/mod2
11146 mkdir ${CVSROOT_DIRNAME}/mod2/sub2
11147 mkdir ${CVSROOT_DIRNAME}/mod2-2
11148 mkdir ${CVSROOT_DIRNAME}/mod2-2/sub2-2
11149 dotest cvsadm-2 "${testcvs} co mod1 mod1-2 mod2 mod2-2" \
11150 "${PROG} [a-z]*: Updating mod1
11151 ${PROG} [a-z]*: Updating mod1-2
11152 ${PROG} [a-z]*: Updating mod2
11153 ${PROG} [a-z]*: Updating mod2/sub2
11154 ${PROG} [a-z]*: Updating mod2-2
11155 ${PROG} [a-z]*: Updating mod2-2/sub2-2"
11157 # Populate the directories for the halibut
11158 echo "file1" > mod1/file1
11159 echo "file1-2" > mod1-2/file1-2
11160 echo "file2" > mod2/sub2/file2
11161 echo "file2-2" > mod2-2/sub2-2/file2-2
11162 dotest cvsadm-2a "${testcvs} add mod1/file1 mod1-2/file1-2 mod2/sub2/file2 mod2-2/sub2-2/file2-2" \
11163 "${PROG} [a-z]*: scheduling file .mod1/file1. for addition
11164 ${PROG} [a-z]*: scheduling file .mod1-2/file1-2. for addition
11165 ${PROG} [a-z]*: scheduling file .mod2/sub2/file2. for addition
11166 ${PROG} [a-z]*: scheduling file .mod2-2/sub2-2/file2-2. for addition
11167 ${PROG} [a-z]*: use '${PROG} commit' to add these files permanently"
11169 dotest cvsadm-2b "${testcvs} ci -m yup mod1 mod1-2 mod2 mod2-2" \
11170 "${PROG} [a-z]*: Examining mod1
11171 ${PROG} [a-z]*: Examining mod1-2
11172 ${PROG} [a-z]*: Examining mod2
11173 ${PROG} [a-z]*: Examining mod2/sub2
11174 ${PROG} [a-z]*: Examining mod2-2
11175 ${PROG} [a-z]*: Examining mod2-2/sub2-2
11176 RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
11178 Checking in mod1/file1;
11179 ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
11180 initial revision: 1.1
11182 RCS file: ${CVSROOT_DIRNAME}/mod1-2/file1-2,v
11184 Checking in mod1-2/file1-2;
11185 ${CVSROOT_DIRNAME}/mod1-2/file1-2,v <-- file1-2
11186 initial revision: 1.1
11188 RCS file: ${CVSROOT_DIRNAME}/mod2/sub2/file2,v
11190 Checking in mod2/sub2/file2;
11191 ${CVSROOT_DIRNAME}/mod2/sub2/file2,v <-- file2
11192 initial revision: 1.1
11194 RCS file: ${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v
11196 Checking in mod2-2/sub2-2/file2-2;
11197 ${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v <-- file2-2
11198 initial revision: 1.1
11200 # Finished creating the modules -- clean up.
11201 rm -rf CVS mod1 mod1-2 mod2 mod2-2
11204 ##################################################
11205 ## Start the dizzying array of possibilities.
11206 ## Begin with each module type separately.
11207 ##################################################
11209 # Pattern -- after each checkout, first check the top-level
11210 # CVS directory. Then, check the directories in numerical
11213 dotest cvsadm-3 "${testcvs} co 1mod" \
11214 "${PROG} [a-z]*: Updating 1mod
11216 dotest cvsadm-3b "cat CVS/Repository" \
11218 dotest cvsadm-3d "cat 1mod/CVS/Repository" \
11222 dotest cvsadm-4 "${testcvs} co 2mod" \
11223 "${PROG} [a-z]*: Updating 2mod
11225 dotest cvsadm-4b "cat CVS/Repository" \
11227 dotest cvsadm-4d "cat 2mod/CVS/Repository" \
11231 dotest cvsadm-5 "${testcvs} co 1d1mod" \
11232 "${PROG} [a-z]*: Updating dir1d1
11234 dotest cvsadm-5b "cat CVS/Repository" \
11236 dotest cvsadm-5d "cat dir1d1/CVS/Repository" \
11240 dotest cvsadm-6 "${testcvs} co 1d2mod" \
11241 "${PROG} [a-z]*: Updating dir1d2
11243 dotest cvsadm-6b "cat CVS/Repository" \
11245 dotest cvsadm-6d "cat dir1d2/CVS/Repository" \
11249 dotest cvsadm-7 "${testcvs} co 2d1mod" \
11250 "${PROG} [a-z]*: Updating dir2d1/sub2d1
11251 U dir2d1/sub2d1/file1"
11252 dotest cvsadm-7b "cat CVS/Repository" \
11254 dotest cvsadm-7d "cat dir2d1/CVS/Repository" \
11255 "${AREP}CVSROOT/Emptydir"
11256 dotest cvsadm-7f "cat dir2d1/sub2d1/CVS/Repository" \
11260 dotest cvsadm-8 "${testcvs} co 2d2mod" \
11261 "${PROG} [a-z]*: Updating dir2d2/sub2d2
11262 U dir2d2/sub2d2/file2"
11263 dotest cvsadm-8b "cat CVS/Repository" \
11265 dotest cvsadm-8d "cat dir2d2/CVS/Repository" \
11266 "${AREP}CVSROOT/Emptydir"
11267 dotest cvsadm-8f "cat dir2d2/sub2d2/CVS/Repository" \
11271 ##################################################
11272 ## You are in a shell script of twisted little
11273 ## module combination statements, all alike.
11274 ##################################################
11278 dotest cvsadm-9 "${testcvs} co 1mod 1mod-2" \
11279 "${PROG} [a-z]*: Updating 1mod
11281 ${PROG} [a-z]*: Updating 1mod-2
11283 # the usual for the top level
11284 dotest cvsadm-9b "cat CVS/Repository" \
11286 # the usual for 1mod
11287 dotest cvsadm-9d "cat 1mod/CVS/Repository" \
11289 # the usual for 1mod copy
11290 dotest cvsadm-9f "cat 1mod-2/CVS/Repository" \
11292 rm -rf CVS 1mod 1mod-2
11294 # 1mod 2mod redmod bluemod
11295 dotest cvsadm-10 "${testcvs} co 1mod 2mod" \
11296 "${PROG} [a-z]*: Updating 1mod
11298 ${PROG} [a-z]*: Updating 2mod
11300 # the usual for the top level
11301 dotest cvsadm-10b "cat CVS/Repository" \
11303 # the usual for 1mod
11304 dotest cvsadm-10d "cat 1mod/CVS/Repository" \
11306 # the usual for 2dmod
11307 dotest cvsadm-10f "cat 2mod/CVS/Repository" \
11309 rm -rf CVS 1mod 2mod
11311 dotest cvsadm-11 "${testcvs} co 1mod 1d1mod" \
11312 "${PROG} [a-z]*: Updating 1mod
11314 ${PROG} [a-z]*: Updating dir1d1
11316 # the usual for the top level
11317 dotest cvsadm-11b "cat CVS/Repository" \
11319 # the usual for 1mod
11320 dotest cvsadm-11d "cat 1mod/CVS/Repository" \
11322 # the usual for 1d1mod
11323 dotest cvsadm-11f "cat dir1d1/CVS/Repository" \
11325 rm -rf CVS 1mod dir1d1
11327 dotest cvsadm-12 "${testcvs} co 1mod 1d2mod" \
11328 "${PROG} [a-z]*: Updating 1mod
11330 ${PROG} [a-z]*: Updating dir1d2
11332 # the usual for the top level
11333 dotest cvsadm-12b "cat CVS/Repository" \
11335 # the usual for 1mod
11336 dotest cvsadm-12d "cat 1mod/CVS/Repository" \
11338 # the usual for 1d2mod
11339 dotest cvsadm-12f "cat dir1d2/CVS/Repository" \
11341 rm -rf CVS 1mod dir1d2
11343 dotest cvsadm-13 "${testcvs} co 1mod 2d1mod" \
11344 "${PROG} [a-z]*: Updating 1mod
11346 ${PROG} [a-z]*: Updating dir2d1/sub2d1
11347 U dir2d1/sub2d1/file1"
11348 # the usual for the top level
11349 dotest cvsadm-13b "cat CVS/Repository" \
11351 # the usual for 1mod
11352 dotest cvsadm-13d "cat 1mod/CVS/Repository" \
11354 # the usual for 2d1mod
11355 dotest cvsadm-13f "cat dir2d1/CVS/Repository" \
11356 "${AREP}CVSROOT/Emptydir"
11357 dotest cvsadm-13h "cat dir2d1/sub2d1/CVS/Repository" \
11359 rm -rf CVS 1mod dir2d1
11361 dotest cvsadm-14 "${testcvs} co 1mod 2d2mod" \
11362 "${PROG} [a-z]*: Updating 1mod
11364 ${PROG} [a-z]*: Updating dir2d2/sub2d2
11365 U dir2d2/sub2d2/file2"
11366 # the usual for the top level
11367 dotest cvsadm-14b "cat CVS/Repository" \
11369 # the usual for 1mod
11370 dotest cvsadm-14d "cat 1mod/CVS/Repository" \
11372 # the usual for 2d2mod
11373 dotest cvsadm-14f "cat dir2d2/CVS/Repository" \
11374 "${AREP}CVSROOT/Emptydir"
11375 dotest cvsadm-14h "cat dir2d2/sub2d2/CVS/Repository" \
11377 rm -rf CVS 1mod dir2d2
11382 dotest cvsadm-15 "${testcvs} co 2mod 2mod-2" \
11383 "${PROG} [a-z]*: Updating 2mod
11385 ${PROG} [a-z]*: Updating 2mod-2
11387 # the usual for the top level
11388 dotest cvsadm-15b "cat CVS/Repository" \
11390 # the usual for 2mod
11391 dotest cvsadm-15d "cat 2mod/CVS/Repository" \
11393 # the usual for 2mod copy
11394 dotest cvsadm-15f "cat 2mod-2/CVS/Repository" \
11395 "${AREP}mod2-2/sub2-2"
11396 rm -rf CVS 2mod 2mod-2
11399 dotest cvsadm-16 "${testcvs} co 2mod 1d1mod" \
11400 "${PROG} [a-z]*: Updating 2mod
11402 ${PROG} [a-z]*: Updating dir1d1
11404 # the usual for the top level
11405 dotest cvsadm-16b "cat CVS/Repository" \
11407 # the usual for 2mod
11408 dotest cvsadm-16d "cat 2mod/CVS/Repository" \
11410 # the usual for 1d1mod
11411 dotest cvsadm-16f "cat dir1d1/CVS/Repository" \
11413 rm -rf CVS 2mod dir1d1
11415 dotest cvsadm-17 "${testcvs} co 2mod 1d2mod" \
11416 "${PROG} [a-z]*: Updating 2mod
11418 ${PROG} [a-z]*: Updating dir1d2
11420 # the usual for the top level
11421 dotest cvsadm-17b "cat CVS/Repository" \
11423 # the usual for 2mod
11424 dotest cvsadm-17d "cat 2mod/CVS/Repository" \
11426 # the usual for 1d2mod
11427 dotest cvsadm-17f "cat dir1d2/CVS/Repository" \
11429 rm -rf CVS 2mod dir1d2
11431 dotest cvsadm-18 "${testcvs} co 2mod 2d1mod" \
11432 "${PROG} [a-z]*: Updating 2mod
11434 ${PROG} [a-z]*: Updating dir2d1/sub2d1
11435 U dir2d1/sub2d1/file1"
11436 # the usual for the top level
11437 dotest cvsadm-18b "cat CVS/Repository" \
11439 # the usual for 2mod
11440 dotest cvsadm-18d "cat 2mod/CVS/Repository" \
11442 # the usual for 2d1mod
11443 dotest cvsadm-18f "cat dir2d1/CVS/Repository" \
11444 "${AREP}CVSROOT/Emptydir"
11445 dotest cvsadm-18h "cat dir2d1/sub2d1/CVS/Repository" \
11447 rm -rf CVS 2mod dir2d1
11449 dotest cvsadm-19 "${testcvs} co 2mod 2d2mod" \
11450 "${PROG} [a-z]*: Updating 2mod
11452 ${PROG} [a-z]*: Updating dir2d2/sub2d2
11453 U dir2d2/sub2d2/file2"
11454 # the usual for the top level
11455 dotest cvsadm-19b "cat CVS/Repository" \
11457 # the usual for 2mod
11458 dotest cvsadm-19d "cat 2mod/CVS/Repository" \
11460 # the usual for 2d2mod
11461 dotest cvsadm-19f "cat dir2d2/CVS/Repository" \
11462 "${AREP}CVSROOT/Emptydir"
11463 dotest cvsadm-19h "cat dir2d2/sub2d2/CVS/Repository" \
11465 rm -rf CVS 2mod dir2d2
11470 dotest cvsadm-20 "${testcvs} co 1d1mod 1d1mod-2" \
11471 "${PROG} [a-z]*: Updating dir1d1
11473 ${PROG} [a-z]*: Updating dir1d1-2
11474 U dir1d1-2/file1-2"
11475 # the usual for the top level
11476 dotest cvsadm-20b "cat CVS/Repository" \
11478 # the usual for 1d1mod
11479 dotest cvsadm-20d "cat dir1d1/CVS/Repository" \
11481 # the usual for 1d1mod copy
11482 dotest cvsadm-20f "cat dir1d1-2/CVS/Repository" \
11484 rm -rf CVS dir1d1 dir1d1-2
11486 dotest cvsadm-21 "${testcvs} co 1d1mod 1d2mod" \
11487 "${PROG} [a-z]*: Updating dir1d1
11489 ${PROG} [a-z]*: Updating dir1d2
11491 # the usual for the top level
11492 dotest cvsadm-21b "cat CVS/Repository" \
11494 # the usual for 1d1mod
11495 dotest cvsadm-21d "cat dir1d1/CVS/Repository" \
11497 # the usual for 1d2mod
11498 dotest cvsadm-21f "cat dir1d2/CVS/Repository" \
11500 rm -rf CVS dir1d1 dir1d2
11502 dotest cvsadm-22 "${testcvs} co 1d1mod 2d1mod" \
11503 "${PROG} [a-z]*: Updating dir1d1
11505 ${PROG} [a-z]*: Updating dir2d1/sub2d1
11506 U dir2d1/sub2d1/file1"
11507 # the usual for the top level
11508 dotest cvsadm-22b "cat CVS/Repository" \
11510 # the usual for 1d1mod
11511 dotest cvsadm-22d "cat dir1d1/CVS/Repository" \
11513 # the usual for 2d1mod
11514 dotest cvsadm-22f "cat dir2d1/CVS/Repository" \
11515 "${AREP}CVSROOT/Emptydir"
11516 dotest cvsadm-22h "cat dir2d1/sub2d1/CVS/Repository" \
11518 rm -rf CVS dir1d1 dir2d1
11520 dotest cvsadm-23 "${testcvs} co 1d1mod 2d2mod" \
11521 "${PROG} [a-z]*: Updating dir1d1
11523 ${PROG} [a-z]*: Updating dir2d2/sub2d2
11524 U dir2d2/sub2d2/file2"
11525 # the usual for the top level
11526 dotest cvsadm-23b "cat CVS/Repository" \
11528 # the usual for 1d1mod
11529 dotest cvsadm-23d "cat dir1d1/CVS/Repository" \
11531 # the usual for 2d2mod
11532 dotest cvsadm-23f "cat dir2d2/CVS/Repository" \
11533 "${AREP}CVSROOT/Emptydir"
11534 dotest cvsadm-23h "cat dir2d2/sub2d2/CVS/Repository" \
11536 rm -rf CVS dir1d1 dir2d2
11541 dotest cvsadm-24 "${testcvs} co 1d2mod 1d2mod-2" \
11542 "${PROG} [a-z]*: Updating dir1d2
11544 ${PROG} [a-z]*: Updating dir1d2-2
11545 U dir1d2-2/file2-2"
11546 # the usual for the top level
11547 dotest cvsadm-24b "cat CVS/Repository" \
11549 # the usual for 1d2mod
11550 dotest cvsadm-24d "cat dir1d2/CVS/Repository" \
11552 # the usual for 1d2mod copy
11553 dotest cvsadm-24f "cat dir1d2-2/CVS/Repository" \
11554 "${AREP}mod2-2/sub2-2"
11555 rm -rf CVS dir1d2 dir1d2-2
11557 dotest cvsadm-25 "${testcvs} co 1d2mod 2d1mod" \
11558 "${PROG} [a-z]*: Updating dir1d2
11560 ${PROG} [a-z]*: Updating dir2d1/sub2d1
11561 U dir2d1/sub2d1/file1"
11562 # the usual for the top level
11563 dotest cvsadm-25b "cat CVS/Repository" \
11565 # the usual for 1d2mod
11566 dotest cvsadm-25d "cat dir1d2/CVS/Repository" \
11568 # the usual for 2d1mod
11569 dotest cvsadm-25f "cat dir2d1/CVS/Repository" \
11570 "${AREP}CVSROOT/Emptydir"
11571 dotest cvsadm-25h "cat dir2d1/sub2d1/CVS/Repository" \
11573 rm -rf CVS dir1d2 dir2d1
11575 dotest cvsadm-26 "${testcvs} co 1d2mod 2d2mod" \
11576 "${PROG} [a-z]*: Updating dir1d2
11578 ${PROG} [a-z]*: Updating dir2d2/sub2d2
11579 U dir2d2/sub2d2/file2"
11580 # the usual for the top level
11581 dotest cvsadm-26b "cat CVS/Repository" \
11583 # the usual for 1d2mod
11584 dotest cvsadm-26d "cat dir1d2/CVS/Repository" \
11586 # the usual for 2d2mod
11587 dotest cvsadm-26f "cat dir2d2/CVS/Repository" \
11588 "${AREP}CVSROOT/Emptydir"
11589 dotest cvsadm-26h "cat dir2d2/sub2d2/CVS/Repository" \
11591 rm -rf CVS dir1d2 dir2d2
11596 dotest cvsadm-27 "${testcvs} co 2d1mod 2d1mod-2" \
11597 "${PROG} [a-z]*: Updating dir2d1/sub2d1
11598 U dir2d1/sub2d1/file1
11599 ${PROG} [a-z]*: Updating dir2d1-2/sub2d1-2
11600 U dir2d1-2/sub2d1-2/file1-2"
11601 # the usual for the top level
11602 dotest cvsadm-27b "cat CVS/Repository" \
11604 # the usual for 2d1mod
11605 dotest cvsadm-27d "cat dir2d1/CVS/Repository" \
11606 "${AREP}CVSROOT/Emptydir"
11607 dotest cvsadm-27f "cat dir2d1/sub2d1/CVS/Repository" \
11609 # the usual for 2d1mod
11610 dotest cvsadm-27h "cat dir2d1-2/CVS/Repository" \
11611 "${AREP}CVSROOT/Emptydir"
11612 dotest cvsadm-27j "cat dir2d1-2/sub2d1-2/CVS/Repository" \
11614 rm -rf CVS dir2d1 dir2d1-2
11616 dotest cvsadm-28 "${testcvs} co 2d1mod 2d2mod" \
11617 "${PROG} [a-z]*: Updating dir2d1/sub2d1
11618 U dir2d1/sub2d1/file1
11619 ${PROG} [a-z]*: Updating dir2d2/sub2d2
11620 U dir2d2/sub2d2/file2"
11621 # the usual for the top level
11622 dotest cvsadm-28b "cat CVS/Repository" \
11624 # the usual for 2d1mod
11625 dotest cvsadm-28d "cat dir2d1/CVS/Repository" \
11626 "${AREP}CVSROOT/Emptydir"
11627 dotest cvsadm-28f "cat dir2d1/sub2d1/CVS/Repository" \
11629 # the usual for 2d2mod
11630 dotest cvsadm-28h "cat dir2d2/CVS/Repository" \
11631 "${AREP}CVSROOT/Emptydir"
11632 dotest cvsadm-28j "cat dir2d2/sub2d2/CVS/Repository" \
11634 rm -rf CVS dir2d1 dir2d2
11639 dotest cvsadm-29 "${testcvs} co 2d2mod 2d2mod-2" \
11640 "${PROG} [a-z]*: Updating dir2d2/sub2d2
11641 U dir2d2/sub2d2/file2
11642 ${PROG} [a-z]*: Updating dir2d2-2/sub2d2-2
11643 U dir2d2-2/sub2d2-2/file2-2"
11644 # the usual for the top level
11645 dotest cvsadm-29b "cat CVS/Repository" \
11647 # the usual for 2d2mod
11648 dotest cvsadm-29d "cat dir2d2/CVS/Repository" \
11649 "${AREP}CVSROOT/Emptydir"
11650 dotest cvsadm-29f "cat dir2d2/sub2d2/CVS/Repository" \
11652 # the usual for 2d2mod
11653 dotest cvsadm-29h "cat dir2d2-2/CVS/Repository" \
11654 "${AREP}CVSROOT/Emptydir"
11655 dotest cvsadm-29j "cat dir2d2-2/sub2d2-2/CVS/Repository" \
11656 "${AREP}mod2-2/sub2-2"
11657 rm -rf CVS dir2d2 dir2d2-2
11659 ##################################################
11660 ## And now, all of that again using the "-d" flag
11661 ## on the command line.
11662 ##################################################
11664 dotest cvsadm-1d3 "${testcvs} co -d dir 1mod" \
11665 "${PROG} [a-z]*: Updating dir
11667 dotest cvsadm-1d3b "cat CVS/Repository" \
11669 dotest cvsadm-1d3d "cat dir/CVS/Repository" \
11673 dotest cvsadm-1d4 "${testcvs} co -d dir 2mod" \
11674 "${PROG} [a-z]*: Updating dir
11676 dotest cvsadm-1d4b "cat CVS/Repository" \
11678 dotest cvsadm-1d4d "cat dir/CVS/Repository" \
11682 dotest cvsadm-1d5 "${testcvs} co -d dir 1d1mod" \
11683 "${PROG} [a-z]*: Updating dir
11685 dotest cvsadm-1d5b "cat CVS/Repository" \
11687 dotest cvsadm-1d5d "cat dir/CVS/Repository" \
11691 dotest cvsadm-1d6 "${testcvs} co -d dir 1d2mod" \
11692 "${PROG} [a-z]*: Updating dir
11694 dotest cvsadm-1d6b "cat CVS/Repository" \
11696 dotest cvsadm-1d6d "cat dir/CVS/Repository" \
11700 dotest cvsadm-1d7 "${testcvs} co -d dir 2d1mod" \
11701 "${PROG} [a-z]*: Updating dir
11703 dotest cvsadm-1d7b "cat CVS/Repository" \
11705 dotest cvsadm-1d7d "cat dir/CVS/Repository" \
11709 dotest cvsadm-1d8 "${testcvs} co -d dir 2d2mod" \
11710 "${PROG} [a-z]*: Updating dir
11712 dotest cvsadm-1d8b "cat CVS/Repository" \
11714 dotest cvsadm-1d8d "cat dir/CVS/Repository" \
11718 ##################################################
11719 ## Los Combonaciones
11720 ##################################################
11724 dotest cvsadm-1d9 "${testcvs} co -d dir 1mod 1mod-2" \
11725 "${PROG} [a-z]*: Updating dir/1mod
11727 ${PROG} [a-z]*: Updating dir/1mod-2
11728 U dir/1mod-2/file1-2"
11729 # the usual for the top level
11730 dotest cvsadm-1d9b "cat CVS/Repository" \
11732 # the usual for the dir level
11733 dotest cvsadm-1d9d "cat dir/CVS/Repository" \
11735 # the usual for 1mod
11736 dotest cvsadm-1d9f "cat dir/1mod/CVS/Repository" \
11738 # the usual for 1mod copy
11739 dotest cvsadm-1d9h "cat dir/1mod-2/CVS/Repository" \
11743 # 1mod 2mod redmod bluemod
11744 dotest cvsadm-1d10 "${testcvs} co -d dir 1mod 2mod" \
11745 "${PROG} [a-z]*: Updating dir/1mod
11747 ${PROG} [a-z]*: Updating dir/2mod
11749 dotest cvsadm-1d10b "cat CVS/Repository" \
11751 # the usual for the dir level
11752 dotest cvsadm-1d10d "cat dir/CVS/Repository" \
11754 # the usual for 1mod
11755 dotest cvsadm-1d10f "cat dir/1mod/CVS/Repository" \
11757 # the usual for 2dmod
11758 dotest cvsadm-1d10h "cat dir/2mod/CVS/Repository" \
11762 dotest cvsadm-1d11 "${testcvs} co -d dir 1mod 1d1mod" \
11763 "${PROG} [a-z]*: Updating dir/1mod
11765 ${PROG} [a-z]*: Updating dir/dir1d1
11766 U dir/dir1d1/file1"
11767 dotest cvsadm-1d11b "cat CVS/Repository" \
11769 # the usual for the dir level
11770 dotest cvsadm-1d11d "cat dir/CVS/Repository" \
11772 # the usual for 1mod
11773 dotest cvsadm-1d11f "cat dir/1mod/CVS/Repository" \
11775 # the usual for 1d1mod
11776 dotest cvsadm-1d11h "cat dir/dir1d1/CVS/Repository" \
11780 dotest cvsadm-1d12 "${testcvs} co -d dir 1mod 1d2mod" \
11781 "${PROG} [a-z]*: Updating dir/1mod
11783 ${PROG} [a-z]*: Updating dir/dir1d2
11784 U dir/dir1d2/file2"
11785 dotest cvsadm-1d12b "cat CVS/Repository" \
11787 # the usual for the dir level
11788 dotest cvsadm-1d12d "cat dir/CVS/Repository" \
11790 # the usual for 1mod
11791 dotest cvsadm-1d12f "cat dir/1mod/CVS/Repository" \
11793 # the usual for 1d2mod
11794 dotest cvsadm-1d12h "cat dir/dir1d2/CVS/Repository" \
11798 dotest cvsadm-1d13 "${testcvs} co -d dir 1mod 2d1mod" \
11799 "${PROG} [a-z]*: Updating dir/1mod
11801 ${PROG} [a-z]*: Updating dir/dir2d1/sub2d1
11802 U dir/dir2d1/sub2d1/file1"
11803 dotest cvsadm-1d13b "cat CVS/Repository" \
11805 # the usual for the dir level
11806 dotest cvsadm-1d13d "cat dir/CVS/Repository" \
11808 # the usual for 1mod
11809 dotest cvsadm-1d13f "cat dir/1mod/CVS/Repository" \
11811 # the usual for 2d1mod
11812 dotest cvsadm-1d13h "cat dir/dir2d1/CVS/Repository" \
11813 "${AREP}CVSROOT/Emptydir"
11814 dotest cvsadm-1d13j "cat dir/dir2d1/sub2d1/CVS/Repository" \
11818 dotest cvsadm-1d14 "${testcvs} co -d dir 1mod 2d2mod" \
11819 "${PROG} [a-z]*: Updating dir/1mod
11821 ${PROG} [a-z]*: Updating dir/dir2d2/sub2d2
11822 U dir/dir2d2/sub2d2/file2"
11823 dotest cvsadm-1d14b "cat CVS/Repository" \
11825 # the usual for the dir level
11826 dotest cvsadm-1d14d "cat dir/CVS/Repository" \
11828 # the usual for 1mod
11829 dotest cvsadm-1d14f "cat dir/1mod/CVS/Repository" \
11831 # the usual for 2d2mod
11832 dotest cvsadm-1d14h "cat dir/dir2d2/CVS/Repository" \
11833 "${AREP}CVSROOT/Emptydir"
11834 dotest cvsadm-1d14j "cat dir/dir2d2/sub2d2/CVS/Repository" \
11841 dotest cvsadm-1d15 "${testcvs} co -d dir 2mod 2mod-2" \
11842 "${PROG} [a-z]*: Updating dir/2mod
11844 ${PROG} [a-z]*: Updating dir/2mod-2
11845 U dir/2mod-2/file2-2"
11846 dotest cvsadm-1d15b "cat CVS/Repository" \
11848 # the usual for the dir level
11849 dotest cvsadm-1d15d "cat dir/CVS/Repository" \
11851 # the usual for 2mod
11852 dotest cvsadm-1d15f "cat dir/2mod/CVS/Repository" \
11854 # the usual for 2mod copy
11855 dotest cvsadm-1d15h "cat dir/2mod-2/CVS/Repository" \
11856 "${AREP}mod2-2/sub2-2"
11859 dotest cvsadm-1d16 "${testcvs} co -d dir 2mod 1d1mod" \
11860 "${PROG} [a-z]*: Updating dir/2mod
11862 ${PROG} [a-z]*: Updating dir/dir1d1
11863 U dir/dir1d1/file1"
11864 dotest cvsadm-1d16b "cat CVS/Repository" \
11866 # the usual for the dir level
11867 dotest cvsadm-1d16d "cat dir/CVS/Repository" \
11869 # the usual for 2mod
11870 dotest cvsadm-1d16f "cat dir/2mod/CVS/Repository" \
11872 # the usual for 1d1mod
11873 dotest cvsadm-1d16h "cat dir/dir1d1/CVS/Repository" \
11877 dotest cvsadm-1d17 "${testcvs} co -d dir 2mod 1d2mod" \
11878 "${PROG} [a-z]*: Updating dir/2mod
11880 ${PROG} [a-z]*: Updating dir/dir1d2
11881 U dir/dir1d2/file2"
11882 dotest cvsadm-1d17b "cat CVS/Repository" \
11884 # the usual for the dir level
11885 dotest cvsadm-1d17d "cat dir/CVS/Repository" \
11887 # the usual for 2mod
11888 dotest cvsadm-1d17f "cat dir/2mod/CVS/Repository" \
11890 # the usual for 1d2mod
11891 dotest cvsadm-1d17h "cat dir/dir1d2/CVS/Repository" \
11895 dotest cvsadm-1d18 "${testcvs} co -d dir 2mod 2d1mod" \
11896 "${PROG} [a-z]*: Updating dir/2mod
11898 ${PROG} [a-z]*: Updating dir/dir2d1/sub2d1
11899 U dir/dir2d1/sub2d1/file1"
11900 dotest cvsadm-1d18b "cat CVS/Repository" \
11902 # the usual for the dir level
11903 dotest cvsadm-1d18d "cat dir/CVS/Repository" \
11905 # the usual for 2mod
11906 dotest cvsadm-1d18f "cat dir/2mod/CVS/Repository" \
11908 # the usual for 2d1mod
11909 dotest cvsadm-1d18h "cat dir/dir2d1/CVS/Repository" \
11910 "${AREP}CVSROOT/Emptydir"
11911 dotest cvsadm-1d18j "cat dir/dir2d1/sub2d1/CVS/Repository" \
11915 dotest cvsadm-1d19 "${testcvs} co -d dir 2mod 2d2mod" \
11916 "${PROG} [a-z]*: Updating dir/2mod
11918 ${PROG} [a-z]*: Updating dir/dir2d2/sub2d2
11919 U dir/dir2d2/sub2d2/file2"
11920 dotest cvsadm-1d19b "cat CVS/Repository" \
11922 # the usual for the dir level
11923 dotest cvsadm-1d19d "cat dir/CVS/Repository" \
11925 # the usual for 2mod
11926 dotest cvsadm-1d19f "cat dir/2mod/CVS/Repository" \
11928 # the usual for 2d2mod
11929 dotest cvsadm-1d19h "cat dir/dir2d2/CVS/Repository" \
11930 "${AREP}CVSROOT/Emptydir"
11931 dotest cvsadm-1d19j "cat dir/dir2d2/sub2d2/CVS/Repository" \
11938 dotest cvsadm-1d20 "${testcvs} co -d dir 1d1mod 1d1mod-2" \
11939 "${PROG} [a-z]*: Updating dir/dir1d1
11941 ${PROG} [a-z]*: Updating dir/dir1d1-2
11942 U dir/dir1d1-2/file1-2"
11943 dotest cvsadm-1d20b "cat CVS/Repository" \
11945 # the usual for the dir level
11946 dotest cvsadm-1d20d "cat dir/CVS/Repository" \
11948 # the usual for 1d1mod
11949 dotest cvsadm-1d20f "cat dir/dir1d1/CVS/Repository" \
11951 # the usual for 1d1mod copy
11952 dotest cvsadm-1d20h "cat dir/dir1d1-2/CVS/Repository" \
11956 dotest cvsadm-1d21 "${testcvs} co -d dir 1d1mod 1d2mod" \
11957 "${PROG} [a-z]*: Updating dir/dir1d1
11959 ${PROG} [a-z]*: Updating dir/dir1d2
11960 U dir/dir1d2/file2"
11961 dotest cvsadm-1d21b "cat CVS/Repository" \
11963 # the usual for the dir level
11964 dotest cvsadm-1d21d "cat dir/CVS/Repository" \
11966 # the usual for 1d1mod
11967 dotest cvsadm-1d21f "cat dir/dir1d1/CVS/Repository" \
11969 # the usual for 1d2mod
11970 dotest cvsadm-1d21h "cat dir/dir1d2/CVS/Repository" \
11974 dotest cvsadm-1d22 "${testcvs} co -d dir 1d1mod 2d1mod" \
11975 "${PROG} [a-z]*: Updating dir/dir1d1
11977 ${PROG} [a-z]*: Updating dir/dir2d1/sub2d1
11978 U dir/dir2d1/sub2d1/file1"
11979 dotest cvsadm-1d22b "cat CVS/Repository" \
11981 # the usual for the dir level
11982 dotest cvsadm-1d22d "cat dir/CVS/Repository" \
11984 # the usual for 1d1mod
11985 dotest cvsadm-1d22f "cat dir/dir1d1/CVS/Repository" \
11987 # the usual for 2d1mod
11988 dotest cvsadm-1d22h "cat dir/dir2d1/CVS/Repository" \
11989 "${AREP}CVSROOT/Emptydir"
11990 dotest cvsadm-1d22j "cat dir/dir2d1/sub2d1/CVS/Repository" \
11994 dotest cvsadm-1d23 "${testcvs} co -d dir 1d1mod 2d2mod" \
11995 "${PROG} [a-z]*: Updating dir/dir1d1
11997 ${PROG} [a-z]*: Updating dir/dir2d2/sub2d2
11998 U dir/dir2d2/sub2d2/file2"
11999 dotest cvsadm-1d23b "cat CVS/Repository" \
12001 # the usual for the dir level
12002 dotest cvsadm-1d23d "cat dir/CVS/Repository" \
12004 # the usual for 1d1mod
12005 dotest cvsadm-1d23f "cat dir/dir1d1/CVS/Repository" \
12007 # the usual for 2d2mod
12008 dotest cvsadm-1d23h "cat dir/dir2d2/CVS/Repository" \
12009 "${AREP}CVSROOT/Emptydir"
12010 dotest cvsadm-1d23j "cat dir/dir2d2/sub2d2/CVS/Repository" \
12017 dotest cvsadm-1d24 "${testcvs} co -d dir 1d2mod 1d2mod-2" \
12018 "${PROG} [a-z]*: Updating dir/dir1d2
12020 ${PROG} [a-z]*: Updating dir/dir1d2-2
12021 U dir/dir1d2-2/file2-2"
12022 dotest cvsadm-1d24b "cat CVS/Repository" \
12024 # the usual for the dir level
12025 dotest cvsadm-1d24d "cat dir/CVS/Repository" \
12027 # the usual for 1d2mod
12028 dotest cvsadm-1d24f "cat dir/dir1d2/CVS/Repository" \
12030 # the usual for 1d2mod copy
12031 dotest cvsadm-1d24h "cat dir/dir1d2-2/CVS/Repository" \
12032 "${AREP}mod2-2/sub2-2"
12035 dotest cvsadm-1d25 "${testcvs} co -d dir 1d2mod 2d1mod" \
12036 "${PROG} [a-z]*: Updating dir/dir1d2
12038 ${PROG} [a-z]*: Updating dir/dir2d1/sub2d1
12039 U dir/dir2d1/sub2d1/file1"
12040 dotest cvsadm-1d25b "cat CVS/Repository" \
12042 # the usual for the dir level
12043 dotest cvsadm-1d25d "cat dir/CVS/Repository" \
12045 # the usual for 1d2mod
12046 dotest cvsadm-1d25f "cat dir/dir1d2/CVS/Repository" \
12048 # the usual for 2d1mod
12049 dotest cvsadm-1d25h "cat dir/dir2d1/CVS/Repository" \
12050 "${AREP}CVSROOT/Emptydir"
12051 dotest cvsadm-1d25j "cat dir/dir2d1/sub2d1/CVS/Repository" \
12055 dotest cvsadm-1d26 "${testcvs} co -d dir 1d2mod 2d2mod" \
12056 "${PROG} [a-z]*: Updating dir/dir1d2
12058 ${PROG} [a-z]*: Updating dir/dir2d2/sub2d2
12059 U dir/dir2d2/sub2d2/file2"
12060 dotest cvsadm-1d26b "cat CVS/Repository" \
12062 # the usual for the dir level
12063 dotest cvsadm-1d26d "cat dir/CVS/Repository" \
12065 # the usual for 1d2mod
12066 dotest cvsadm-1d26f "cat dir/dir1d2/CVS/Repository" \
12068 # the usual for 2d2mod
12069 dotest cvsadm-1d26h "cat dir/dir2d2/CVS/Repository" \
12070 "${AREP}CVSROOT/Emptydir"
12071 dotest cvsadm-1d26j "cat dir/dir2d2/sub2d2/CVS/Repository" \
12078 dotest cvsadm-1d27 "${testcvs} co -d dir 2d1mod 2d1mod-2" \
12079 "${PROG} [a-z]*: Updating dir/dir2d1/sub2d1
12080 U dir/dir2d1/sub2d1/file1
12081 ${PROG} [a-z]*: Updating dir/dir2d1-2/sub2d1-2
12082 U dir/dir2d1-2/sub2d1-2/file1-2"
12083 dotest cvsadm-1d27b "cat CVS/Repository" \
12085 # the usual for the dir level
12086 dotest cvsadm-1d27d "cat dir/CVS/Repository" \
12088 # the usual for 2d1mod
12089 dotest cvsadm-1d27f "cat dir/dir2d1/CVS/Repository" \
12090 "${AREP}CVSROOT/Emptydir"
12091 dotest cvsadm-1d27h "cat dir/dir2d1/sub2d1/CVS/Repository" \
12093 # the usual for 2d1mod
12094 dotest cvsadm-1d27j "cat dir/dir2d1-2/CVS/Repository" \
12095 "${AREP}CVSROOT/Emptydir"
12096 dotest cvsadm-1d27l "cat dir/dir2d1-2/sub2d1-2/CVS/Repository" \
12100 dotest cvsadm-1d28 "${testcvs} co -d dir 2d1mod 2d2mod" \
12101 "${PROG} [a-z]*: Updating dir/dir2d1/sub2d1
12102 U dir/dir2d1/sub2d1/file1
12103 ${PROG} [a-z]*: Updating dir/dir2d2/sub2d2
12104 U dir/dir2d2/sub2d2/file2"
12105 dotest cvsadm-1d28b "cat CVS/Repository" \
12107 # the usual for the dir level
12108 dotest cvsadm-1d28d "cat dir/CVS/Repository" \
12110 # the usual for 2d1mod
12111 dotest cvsadm-1d28f "cat dir/dir2d1/CVS/Repository" \
12112 "${AREP}CVSROOT/Emptydir"
12113 dotest cvsadm-1d28h "cat dir/dir2d1/sub2d1/CVS/Repository" \
12115 # the usual for 2d2mod
12116 dotest cvsadm-1d28j "cat dir/dir2d2/CVS/Repository" \
12117 "${AREP}CVSROOT/Emptydir"
12118 dotest cvsadm-1d28l "cat dir/dir2d2/sub2d2/CVS/Repository" \
12125 dotest cvsadm-1d29 "${testcvs} co -d dir 2d2mod 2d2mod-2" \
12126 "${PROG} [a-z]*: Updating dir/dir2d2/sub2d2
12127 U dir/dir2d2/sub2d2/file2
12128 ${PROG} [a-z]*: Updating dir/dir2d2-2/sub2d2-2
12129 U dir/dir2d2-2/sub2d2-2/file2-2"
12130 dotest cvsadm-1d29b "cat CVS/Repository" \
12132 # the usual for the dir level
12133 dotest cvsadm-1d29d "cat dir/CVS/Repository" \
12135 # the usual for 2d2mod
12136 dotest cvsadm-1d29f "cat dir/dir2d2/CVS/Repository" \
12137 "${AREP}CVSROOT/Emptydir"
12138 dotest cvsadm-1d29h "cat dir/dir2d2/sub2d2/CVS/Repository" \
12140 # the usual for 2d2mod
12141 dotest cvsadm-1d29j "cat dir/dir2d2-2/CVS/Repository" \
12142 "${AREP}CVSROOT/Emptydir"
12143 dotest cvsadm-1d29l "cat dir/dir2d2-2/sub2d2-2/CVS/Repository" \
12144 "${AREP}mod2-2/sub2-2"
12147 ##################################################
12148 ## And now, some of that again using the "-d" flag
12149 ## on the command line, but use a longer path.
12150 ##################################################
12152 dotest cvsadm-2d3 "${testcvs} co -d dir/dir2 1mod" \
12153 "${PROG} [a-z]*: Updating dir/dir2
12155 dotest cvsadm-2d3b "cat CVS/Repository" \
12157 dotest cvsadm-2d3d "cat dir/CVS/Repository" \
12158 "${AREP}CVSROOT/Emptydir"
12159 dotest cvsadm-2d3f "cat dir/dir2/CVS/Repository" \
12163 dotest cvsadm-2d4 "${testcvs} co -d dir/dir2 2mod" \
12164 "${PROG} [a-z]*: Updating dir/dir2
12166 dotest cvsadm-2d4b "cat CVS/Repository" \
12168 dotest cvsadm-2d4d "cat dir/CVS/Repository" \
12169 "${AREP}CVSROOT/Emptydir"
12170 dotest cvsadm-2d4f "cat dir/dir2/CVS/Repository" \
12174 dotest cvsadm-2d5 "${testcvs} co -d dir/dir2 1d1mod" \
12175 "${PROG} [a-z]*: Updating dir/dir2
12177 dotest cvsadm-2d5b "cat CVS/Repository" \
12179 dotest cvsadm-2d5d "cat dir/CVS/Repository" \
12180 "${AREP}CVSROOT/Emptydir"
12181 dotest cvsadm-2d5f "cat dir/dir2/CVS/Repository" \
12185 dotest cvsadm-2d6 "${testcvs} co -d dir/dir2 1d2mod" \
12186 "${PROG} [a-z]*: Updating dir/dir2
12188 dotest cvsadm-2d6b "cat CVS/Repository" \
12190 dotest cvsadm-2d6d "cat dir/CVS/Repository" \
12191 "${AREP}CVSROOT/Emptydir"
12192 dotest cvsadm-2d6f "cat dir/dir2/CVS/Repository" \
12196 dotest cvsadm-2d7 "${testcvs} co -d dir/dir2 2d1mod" \
12197 "${PROG} [a-z]*: Updating dir/dir2
12199 dotest cvsadm-2d7b "cat CVS/Repository" \
12201 dotest cvsadm-2d7d "cat dir/CVS/Repository" \
12202 "${AREP}CVSROOT/Emptydir"
12203 dotest cvsadm-2d7f "cat dir/dir2/CVS/Repository" \
12207 dotest cvsadm-2d8 "${testcvs} co -d dir/dir2 2d2mod" \
12208 "${PROG} [a-z]*: Updating dir/dir2
12210 dotest cvsadm-2d8b "cat CVS/Repository" \
12212 dotest cvsadm-2d8d "cat dir/CVS/Repository" \
12213 "${AREP}CVSROOT/Emptydir"
12214 dotest cvsadm-2d8f "cat dir/dir2/CVS/Repository" \
12218 ##################################################
12219 ## And now, a few of those tests revisited to
12220 ## test the behavior of the -N flag.
12221 ##################################################
12223 dotest cvsadm-N3 "${testcvs} co -N 1mod" \
12224 "${PROG} [a-z]*: Updating 1mod
12226 dotest cvsadm-N3b "cat CVS/Repository" \
12228 dotest cvsadm-N3d "cat 1mod/CVS/Repository" \
12232 dotest cvsadm-N4 "${testcvs} co -N 2mod" \
12233 "${PROG} [a-z]*: Updating 2mod
12235 dotest cvsadm-N4b "cat CVS/Repository" \
12237 dotest cvsadm-N4d "cat 2mod/CVS/Repository" \
12241 dotest cvsadm-N5 "${testcvs} co -N 1d1mod" \
12242 "${PROG} [a-z]*: Updating dir1d1
12244 dotest cvsadm-N5b "cat CVS/Repository" \
12246 dotest cvsadm-N5d "cat dir1d1/CVS/Repository" \
12250 dotest cvsadm-N6 "${testcvs} co -N 1d2mod" \
12251 "${PROG} [a-z]*: Updating dir1d2
12253 dotest cvsadm-N6b "cat CVS/Repository" \
12255 dotest cvsadm-N6d "cat dir1d2/CVS/Repository" \
12259 dotest cvsadm-N7 "${testcvs} co -N 2d1mod" \
12260 "${PROG} [a-z]*: Updating dir2d1/sub2d1
12261 U dir2d1/sub2d1/file1"
12262 dotest cvsadm-N7b "cat CVS/Repository" \
12264 dotest cvsadm-N7d "cat dir2d1/CVS/Repository" \
12265 "${AREP}CVSROOT/Emptydir"
12266 dotest cvsadm-N7f "cat dir2d1/sub2d1/CVS/Repository" \
12270 dotest cvsadm-N8 "${testcvs} co -N 2d2mod" \
12271 "${PROG} [a-z]*: Updating dir2d2/sub2d2
12272 U dir2d2/sub2d2/file2"
12273 dotest cvsadm-N8b "cat CVS/Repository" \
12275 dotest cvsadm-N8d "cat dir2d2/CVS/Repository" \
12276 "${AREP}CVSROOT/Emptydir"
12277 dotest cvsadm-N8f "cat dir2d2/sub2d2/CVS/Repository" \
12281 ## the ones in one-deep directories
12283 dotest cvsadm-N1d3 "${testcvs} co -N -d dir 1mod" \
12284 "${PROG} [a-z]*: Updating dir/1mod
12286 dotest cvsadm-N1d3b "cat CVS/Repository" \
12288 dotest cvsadm-N1d3d "cat dir/CVS/Repository" \
12290 dotest cvsadm-N1d3f "cat dir/1mod/CVS/Repository" \
12294 dotest cvsadm-N1d4 "${testcvs} co -N -d dir 2mod" \
12295 "${PROG} [a-z]*: Updating dir/2mod
12297 dotest cvsadm-N1d4b "cat CVS/Repository" \
12299 dotest cvsadm-N1d4d "cat dir/CVS/Repository" \
12301 dotest cvsadm-N1d4f "cat dir/2mod/CVS/Repository" \
12305 dotest cvsadm-N1d5 "${testcvs} co -N -d dir 1d1mod" \
12306 "${PROG} [a-z]*: Updating dir/dir1d1
12307 U dir/dir1d1/file1"
12308 dotest cvsadm-N1d5b "cat CVS/Repository" \
12310 dotest cvsadm-N1d5d "cat dir/CVS/Repository" \
12312 dotest cvsadm-N1d5d "cat dir/dir1d1/CVS/Repository" \
12316 dotest cvsadm-N1d6 "${testcvs} co -N -d dir 1d2mod" \
12317 "${PROG} [a-z]*: Updating dir/dir1d2
12318 U dir/dir1d2/file2"
12319 dotest cvsadm-N1d6b "cat CVS/Repository" \
12321 dotest cvsadm-N1d6d "cat dir/CVS/Repository" \
12323 dotest cvsadm-N1d6f "cat dir/dir1d2/CVS/Repository" \
12327 dotest cvsadm-N1d7 "${testcvs} co -N -d dir 2d1mod" \
12328 "${PROG} [a-z]*: Updating dir/dir2d1/sub2d1
12329 U dir/dir2d1/sub2d1/file1"
12330 dotest cvsadm-N1d7b "cat CVS/Repository" \
12332 dotest cvsadm-N1d7d "cat dir/CVS/Repository" \
12334 dotest cvsadm-N1d7f "cat dir/dir2d1/CVS/Repository" \
12335 "${AREP}CVSROOT/Emptydir"
12336 dotest cvsadm-N1d7h "cat dir/dir2d1/sub2d1/CVS/Repository" \
12340 dotest cvsadm-N1d8 "${testcvs} co -N -d dir 2d2mod" \
12341 "${PROG} [a-z]*: Updating dir/dir2d2/sub2d2
12342 U dir/dir2d2/sub2d2/file2"
12343 dotest cvsadm-N1d8b "cat CVS/Repository" \
12345 dotest cvsadm-N1d8d "cat dir/CVS/Repository" \
12347 dotest cvsadm-N1d8d "cat dir/dir2d2/CVS/Repository" \
12348 "${AREP}CVSROOT/Emptydir"
12349 dotest cvsadm-N1d8d "cat dir/dir2d2/sub2d2/CVS/Repository" \
12353 ## the ones in two-deep directories
12355 dotest cvsadm-N2d3 "${testcvs} co -N -d dir/dir2 1mod" \
12356 "${PROG} [a-z]*: Updating dir/dir2/1mod
12357 U dir/dir2/1mod/file1"
12358 dotest cvsadm-N2d3b "cat CVS/Repository" \
12360 dotest cvsadm-N2d3d "cat dir/CVS/Repository" \
12361 "${AREP}CVSROOT/Emptydir"
12362 dotest cvsadm-N2d3f "cat dir/dir2/CVS/Repository" \
12364 dotest cvsadm-N2d3h "cat dir/dir2/1mod/CVS/Repository" \
12368 dotest cvsadm-N2d4 "${testcvs} co -N -d dir/dir2 2mod" \
12369 "${PROG} [a-z]*: Updating dir/dir2/2mod
12370 U dir/dir2/2mod/file2"
12371 dotest cvsadm-N2d4b "cat CVS/Repository" \
12373 dotest cvsadm-N2d4d "cat dir/CVS/Repository" \
12374 "${AREP}CVSROOT/Emptydir"
12375 dotest cvsadm-N2d4f "cat dir/dir2/CVS/Repository" \
12377 dotest cvsadm-N2d4h "cat dir/dir2/2mod/CVS/Repository" \
12381 dotest cvsadm-N2d5 "${testcvs} co -N -d dir/dir2 1d1mod" \
12382 "${PROG} [a-z]*: Updating dir/dir2/dir1d1
12383 U dir/dir2/dir1d1/file1"
12384 dotest cvsadm-N2d5b "cat CVS/Repository" \
12386 dotest cvsadm-N2d5d "cat dir/CVS/Repository" \
12387 "${AREP}CVSROOT/Emptydir"
12388 dotest cvsadm-N2d5f "cat dir/dir2/CVS/Repository" \
12390 dotest cvsadm-N2d5h "cat dir/dir2/dir1d1/CVS/Repository" \
12394 dotest cvsadm-N2d6 "${testcvs} co -N -d dir/dir2 1d2mod" \
12395 "${PROG} [a-z]*: Updating dir/dir2/dir1d2
12396 U dir/dir2/dir1d2/file2"
12397 dotest cvsadm-N2d6b "cat CVS/Repository" \
12399 dotest cvsadm-N2d6d "cat dir/CVS/Repository" \
12400 "${AREP}CVSROOT/Emptydir"
12401 dotest cvsadm-N2d6f "cat dir/dir2/CVS/Repository" \
12403 dotest cvsadm-N2d6h "cat dir/dir2/dir1d2/CVS/Repository" \
12407 dotest cvsadm-N2d7 "${testcvs} co -N -d dir/dir2 2d1mod" \
12408 "${PROG} [a-z]*: Updating dir/dir2/dir2d1/sub2d1
12409 U dir/dir2/dir2d1/sub2d1/file1"
12410 dotest cvsadm-N2d7b "cat CVS/Repository" \
12412 dotest cvsadm-N2d7d "cat dir/CVS/Repository" \
12413 "${AREP}CVSROOT/Emptydir"
12414 dotest cvsadm-N2d7f "cat dir/dir2/CVS/Repository" \
12416 dotest cvsadm-N2d7f "cat dir/dir2/dir2d1/CVS/Repository" \
12417 "${AREP}CVSROOT/Emptydir"
12418 dotest cvsadm-N2d7h "cat dir/dir2/dir2d1/sub2d1/CVS/Repository" \
12422 dotest cvsadm-N2d8 "${testcvs} co -N -d dir/dir2 2d2mod" \
12423 "${PROG} [a-z]*: Updating dir/dir2/dir2d2/sub2d2
12424 U dir/dir2/dir2d2/sub2d2/file2"
12425 dotest cvsadm-N2d8b "cat CVS/Repository" \
12427 dotest cvsadm-N2d8d "cat dir/CVS/Repository" \
12428 "${AREP}CVSROOT/Emptydir"
12429 dotest cvsadm-N2d8f "cat dir/dir2/CVS/Repository" \
12431 dotest cvsadm-N2d8h "cat dir/dir2/dir2d2/CVS/Repository" \
12432 "${AREP}CVSROOT/Emptydir"
12433 dotest cvsadm-N2d8j "cat dir/dir2/dir2d2/sub2d2/CVS/Repository" \
12437 ##################################################
12438 ## That's enough of that, thank you very much.
12439 ##################################################
12444 rm -rf ${CVSROOT_DIRNAME}/1mod
12445 rm -rf ${CVSROOT_DIRNAME}/1mod-2
12446 rm -rf ${CVSROOT_DIRNAME}/2mod
12447 rm -rf ${CVSROOT_DIRNAME}/2mod-2
12451 # Make sure CVS can merge correctly in circumstances where it
12452 # used to mess up (due to a bug which existed in diffutils 2.7
12453 # and 2.6, but not 2.5, and which has been fixed in CVS's diff
12454 # lib by Paul Eggert, bless his bitty heart).
12456 # This first test involves two working copies, "mine" and
12457 # "yours", checked out from the same repository at the same
12458 # time. In yours, you remove some text from the end of the
12459 # file and check it in; meanwhile, "me" has commented out some
12460 # lines earlier in the file, and I go to check it in right
12461 # after you checked yours in. CVS naturally tells me the file
12462 # is not up-to-date, so I run cvs update, but it updates
12463 # incorrectly, leaving in the lines of text you just deleted.
12464 # Bad! I'm in too much of a hurry to actually look at the
12465 # file, so I check it in and go home, and so your changes have
12466 # been lost. Later you discover this, and you suspect me of
12467 # deliberately sabotaging your work, so you let all the air
12468 # out of my tires. Only after a series of expensive lawsuits
12469 # and countersuits do we discover it this was all CVS's
12472 # Luckily, this problem has been fixed now, as our test will
12473 # handily confirm, no doubt:
12475 # First make a repository containing the original text:
12477 # We should be here anyway, but cd to it just in case:
12483 # The text of the file is inlined here because `echo' loses
12484 # newlines, and I don't know how portable the -e flag is.
12486 # This is the file we both start out with:
12487 echo "// Button.java
12489 package random.application;
12491 import random.util.star;
12493 public class Button
12495 /star Instantiates a Button with origin (0, 0) and zero width and height.
12496 star You must call an initializer method to properly initialize the Button.
12502 _titleColor = Color.black;
12503 _disabledTitleColor = Color.gray;
12504 _titleFont = Font.defaultFont ();
12507 /star Convenience constructor for instantiating a Button with
12508 star bounds x, y, width, and height. Equivalent to
12509 star foo = new Button ();
12510 star foo.init (x, y, width, height);
12512 public Button (int x, int y, int width, int height)
12515 init (x, y, width, height);
12519 dotest diffmerge1_import \
12520 "${testcvs} import -m import diffmerge1 tag1 tag2" \
12521 "${DOTSTAR}No conflicts created by this import"
12525 # Check out two working copies, one for "you" and one for "me"
12526 ${testcvs} checkout diffmerge1 >/dev/null 2>&1
12527 mv diffmerge1 diffmerge1_yours
12528 ${testcvs} checkout diffmerge1 >/dev/null 2>&1
12529 mv diffmerge1 diffmerge1_mine
12531 # In your working copy, you'll remove the Button() method, and
12532 # then check in your change before I check in mine:
12533 cd diffmerge1_yours
12534 echo "// Button.java
12536 package random.application;
12538 import random.util.star;
12540 public class Button
12542 /star Instantiates a Button with origin (0, 0) and zero width and height.
12543 star You must call an initializer method to properly initialize the Button.
12549 _titleColor = Color.black;
12550 _disabledTitleColor = Color.gray;
12551 _titleFont = Font.defaultFont ();
12554 dotest diffmerge1_yours \
12555 "${testcvs} ci -m yours" \
12556 "${DOTSTAR}hecking in ${DOTSTAR}"
12558 # My working copy still has the Button() method, but I
12559 # comment out some code at the top of the class. Then I
12560 # update, after both my modifications and your checkin:
12561 cd ../diffmerge1_mine
12562 echo "// Button.java
12564 package random.application;
12566 import random.util.star;
12568 public class Button
12570 /star Instantiates a Button with origin (0, 0) and zero width and height.
12571 star You must call an initializer method to properly initialize the Button.
12577 // _titleColor = Color.black;
12578 // _disabledTitleColor = Color.gray;
12579 // _titleFont = Font.defaultFont ();
12582 /star Convenience constructor for instantiating a Button with
12583 star bounds x, y, width, and height. Equivalent to
12584 star foo = new Button ();
12585 star foo.init (x, y, width, height);
12587 public Button (int x, int y, int width, int height)
12590 init (x, y, width, height);
12593 dotest diffmerge1_mine \
12594 "${testcvs} update" \
12595 "${DOTSTAR}erging${DOTSTAR}"
12597 # So if your changes didn't make it into my working copy, or
12598 # in any case if the file does not look like the final text as
12599 # quoted below, then the test flunks:
12600 echo "// Button.java
12602 package random.application;
12604 import random.util.star;
12606 public class Button
12608 /star Instantiates a Button with origin (0, 0) and zero width and height.
12609 star You must call an initializer method to properly initialize the Button.
12615 // _titleColor = Color.black;
12616 // _disabledTitleColor = Color.gray;
12617 // _titleFont = Font.defaultFont ();
12620 dotest diffmerge1_cmp "cmp the_file comp_me" ''
12622 # Clean up after ourselves:
12624 rm -rf diffmerge1_yours diffmerge1_mine ${CVSROOT_DIRNAME}/diffmerge1
12630 # FIXME: This test should be rewritten to be much more concise.
12631 # It currently weighs in at something like 600 lines, but the
12632 # same thing could probably be tested in more like 50-100 lines.
12635 # This tests for another diffmerge bug reported by Martin
12636 # Tomes; actually, his bug was probably caused by an initial
12637 # fix for the bug in test diffmerge1, and likely wasn't ever
12638 # a problem in CVS as long as one was using a normal
12639 # distribution of diff or a version of CVS that has the diff
12642 # Nevertheless, once burned twice cautious, so we test for his
12645 # Here is his report, more or less verbatim:
12646 # ------------------------------------------
12648 # Put the attached file (sgrid.h,v) into your repository
12649 # somewhere, check out the module and do this:
12651 # cvs update -j Review_Phase_2_Enhancements sgrid.h
12652 # cvs diff -r Review_V1p3 sgrid.h
12654 # As there have been no changes made on the trunk there
12655 # should be no differences, however this is output:
12657 # % cvs diff -r Review_V1p3 sgrid.h
12659 # ===================================================================
12660 # RCS file: /usr/local/repository/play/fred/sgrid.h,v
12661 # retrieving revision 1.1.2.1
12662 # diff -r1.1.2.1 sgrid.h
12664 # > /*--------------------------------------------------------------
12665 # > INLINE FUNCTION : HORIZONTALLINES
12666 # > NOTES : Description at the end of the file
12667 # > ----------------------------------------------------------------*/
12668 # > uint16 horizontalLines( void );
12671 # I did a cvs diff -c -r 1.1 -r 1.1.2.1 sgrid.h and patched those
12672 # differences to sgrid.h version 1.1 and got the correct result
12673 # so it looks like the built in patch is faulty.
12674 # -------------------------------------------------------------------
12676 # This is the RCS file, sgrid.h,v, that he sent:
12681 Review_V1p3:1.1.2.1
12682 Review_V1p3C:1.1.2.1
12683 Review_1p3A:1.1.2.1
12684 Review_V1p3A:1.1.2.1
12685 Review_Phase_2_Enhancements:1.1.0.2
12696 date 97.04.02.11.20.05; author colinl; state Exp;
12702 date 97.06.09.10.00.07; author colinl; state Exp;
12715 Tested By: Colin Law
12717 Reason for Change: Initial Revision of all files
12719 Design Change Details:
12724 @/* \$""Header: L:/gpanels/dis/sgrid.h_v 1.1.1.0 24 Jan 1996 14:59:20 PAULT \$ */
12726 * \$""Log: L:/gpanels/dis/sgrid.h_v \$
12728 * Rev 1.1.1.0 24 Jan 1996 14:59:20 PAULT
12731 * Rev 1.1 24 Jan 1996 12:09:52 PAULT
12732 * Consolidated 4100 code merged to trunk
12734 * Rev 1.0.2.0 01 Jun 1995 14:18:58 DAVEH
12737 * Rev 1.0 19 Apr 1995 16:32:48 COLINL
12738 * Initial revision.
12740 /*****************************************************************************
12743 AUTHOR : Dave Hartley
12744 SYSTEM : Borland C++
12745 DESCRIPTION : The declaration of the scrolling grid class
12747 *****************************************************************************/
12748 #if !defined(__SGRID_H)
12751 #if !defined(__SCROLL_H)
12752 #include <scroll.h>
12755 #if !defined(__GKI_H)
12759 #if defined PRINTING_SUPPORT
12763 /*****************************************************************************
12764 CLASS : ScrollingGrid
12765 DESCRIPTION: This class inherits from a grid and a scrollable, and
12766 can therefore use all the PUBLIC services provided by these
12767 classes. A description of these can be found in
12768 GRID.H and SCROLL.H.
12769 A scrolling grid is a set of horizontal and vertical lines
12770 that scroll and continually update to provide a complete grid
12772 *****************************************************************************/
12774 class ScrollingGrid : public Scrollable
12777 #if defined _WINDOWS
12778 /*---------------------------------------------------------------------------
12779 FUNCTION : CONSTRUCTOR
12780 DESCRIPTION : sets up the details of the grid, ready for painting
12781 ARGUMENTS : name : sgColour
12782 - the colour of the grid
12786 - the total number of horizontal grid lines
12788 - the min distance between the vertical grid lines
12789 on the scrolling axis
12791 - timestamp value now
12793 - number of timestamp ticks per second
12795 - number of timestamp ticks per pixel required
12799 ---------------------------------------------------------------------------*/
12800 ScrollingGrid( GkiColour sgColour, GkiLineType sgLineType,
12801 uint16 sgHorizontalTotal,
12802 uint16 verticalSpacingMin, uint32 currentTimestamp,
12803 uint16 ticksPerSecond, uint32 ticksPerPixel );
12805 /*---------------------------------------------------------------------------
12806 FUNCTION : CONSTRUCTOR
12807 DESCRIPTION : sets up the details of the grid, ready for painting
12808 ARGUMENTS : name : sgColour
12809 - the colour of the grid
12812 sgHorizontalTotal ( THE MAX NUMBER OF LINES IS 100 )
12813 - the total number of horizontal grid lines
12815 - the distance between the vertical grid lines
12816 on the scrolling axis
12819 NOTES : If the caller does not get the total grid lines value, synced
12820 with the overall size of the viewport, the spacing between
12821 grid lines will not be consistent.
12823 ---------------------------------------------------------------------------*/
12824 ScrollingGrid( GkiColour sgColour, GkiLineType sgLineType
12825 , uint16 sgHorizontalTotal, uint16 sgVerticalSpacing );
12827 /*---------------------------------------------------------------------------
12828 FUNCTION : DESTRUCTOR
12829 DESCRIPTION : tidies it all up
12834 ---------------------------------------------------------------------------*/
12835 ~ScrollingGrid( void );
12837 /*---------------------------------------------------------------------------
12839 DESCRIPTION : This service overloads the base class service, as it does
12840 additional work at the time of attachment.
12842 ARGUMENTS : name : tDrawingArea
12843 - the scrolled viewport to attach this trend to
12847 ---------------------------------------------------------------------------*/
12848 void attach( SViewport *tDrawingArea );
12850 #if defined _WINDOWS
12851 /*---------------------------------------------------------------------------
12852 FUNCTION : calculateVerticalSpacing
12853 DESCRIPTION : determines optimum spacing along time axis
12857 ---------------------------------------------------------------------------*/
12858 void calculateVerticalSpacing();
12860 /*---------------------------------------------------------------------------
12861 FUNCTION : gridSpacingTicks
12862 DESCRIPTION : Provides the grid spacing in the time axis in ticks
12864 RETURN : Number of ticks
12866 ---------------------------------------------------------------------------*/
12867 uint32 gridSpacingTicks();
12871 /*---------------------------------------------------------------------------
12872 INLINE FUNCTION : HORIZONTALLINES
12873 NOTES : Description at the end of the file
12874 ---------------------------------------------------------------------------*/
12875 uint16 horizontalLines( void );
12877 #if defined _WINDOWS
12878 // In Windows the OnDraw() function replaces paint()
12879 /*---------------------------------------------------------------------------
12880 FUNCTION : ScrollingGrid OnDraw
12881 DESCRIPTION : Paints the given area of the grid.
12883 ARGUMENTS : pDC pointer to the device context to use for display
12884 Note that the device context operates in the coords
12885 of the window owning the viewport
12888 ---------------------------------------------------------------------------*/
12889 virtual void OnDraw( CDC *pDC );
12891 #else // not Windows
12893 /*---------------------------------------------------------------------------
12895 DESCRIPTION : This extends the standard grid paint method to paint the
12896 viewport relative to its current position.
12902 ---------------------------------------------------------------------------*/
12903 void paint( void );
12906 /*---------------------------------------------------------------------------
12907 FUNCTION : P A I N T T E X T M A R K E R S
12908 DESCRIPTION : this service allow the text markers to be painted seperatley
12909 from the grid lines
12915 ---------------------------------------------------------------------------*/
12916 void paintTextMarkers();
12918 #if defined PRINTING_SUPPORT
12919 /*---------------------------------------------------------------------------
12920 FUNCTION : P R I N T
12921 DESCRIPTION : This print service prints a grid marker ( being either a
12922 timestamp or a date, IF there is one at the plot position
12927 - Where in the log to look to see if there is an
12931 the printer to print to
12935 ---------------------------------------------------------------------------*/
12936 void print( uint16 currentPrintPos, Printer *printerPtr );
12939 /*---------------------------------------------------------------------------
12940 FUNCTION : S E T D R I V E D I R E C T I O N
12941 DESCRIPTION : Sets direction for update and scrolling forwards or backwards
12942 ARGUMENTS : direction - required direction
12945 ---------------------------------------------------------------------------*/
12946 void setDriveDirection( ScrollDirection direction );
12948 /*---------------------------------------------------------------------------
12949 FUNCTION : S E T U P
12950 DESCRIPTION : service that will setup the grid prior to a paint
12957 the number of ticks that represent a plot point on
12962 ---------------------------------------------------------------------------*/
12963 void setup( uint32 newTimestamp, uint32 newTimeBase );
12965 #if defined PRINTING_SUPPORT
12966 /*---------------------------------------------------------------------------
12967 FUNCTION : S E T U P F O R P R I N T
12968 DESCRIPTION : This service iis to be called prior to printing. It allows
12969 the grid to prepare its markers ready for the print
12976 ---------------------------------------------------------------------------*/
12977 void setupForPrint();
12980 /*---------------------------------------------------------------------------
12982 DESCRIPTION : When this service is called it will calculate what needs to
12983 be painted and fill in the display again.
12985 ARGUMENTS : name : timeStamp
12986 - the reference time of this update.
12990 ---------------------------------------------------------------------------*/
12991 void update( uint32 timeStamp );
12993 /*---------------------------------------------------------------------------
12994 FUNCTION : U P D A T E B U F F E R
12995 DESCRIPTION : When a display update is not required, use this method. It
12996 updates the internal data ready for a call to paint that
12997 will then show the grid in the right position
13003 ---------------------------------------------------------------------------*/
13004 void updateBuffer( void );
13008 /*---------------------------------------------------------------------------
13009 FUNCTION : M A K E G R I D M A R K E R
13010 DESCRIPTION : service that perpares a string for display. The string will
13011 either be a short date, or short time. this is determined
13012 by the current setting of the dateMarker flag
13014 ARGUMENTS : name : timestampVal
13015 - the value to convert
13018 - the place to put the string
13022 ---------------------------------------------------------------------------*/
13023 void makeGridMarker( uint32 timestampVal, char *storePtr );
13025 /*---------------------------------------------------------------------------
13026 FUNCTION : P A I N T G R I D M A R K E R
13027 DESCRIPTION : given a position will put the string on the display
13031 - were it goes on the Y-axis
13038 ---------------------------------------------------------------------------*/
13039 void paintGridMarker( uint16 yPos, char *gridMarkerPtr );
13041 #if defined _WINDOWS
13042 /*---------------------------------------------------------------------------
13043 FUNCTION : PAINTHORIZONTALLINES
13044 DESCRIPTION : responsible for painting the grids horizontal lines
13045 ARGUMENTS : pRectToDraw pointer to rectangle that needs refreshing.
13047 pDC pointer to device context to use
13051 ---------------------------------------------------------------------------*/
13052 void paintHorizontalLines(RectCoords* pRectToDraw, CDC* pDC );
13054 /*---------------------------------------------------------------------------
13055 FUNCTION : PAINTHORIZONTALLINES
13056 DESCRIPTION : responsible for painting the grids horizontal lines
13057 ARGUMENTS : name: xStart
13058 - the starting X co-ordinate for the horizontal line
13060 - the ending X co-ordinate for the horizontal line
13063 NOTES : Remember lines are drawn from origin. The origin in a
13064 horizontal viewport will be the top.
13065 ---------------------------------------------------------------------------*/
13066 void paintHorizontalLines( uint16 xStart, uint16 xEnd );
13069 #if defined _WINDOWS
13070 /*---------------------------------------------------------------------------
13071 FUNCTION : PAINTVERTICALLINES
13072 DESCRIPTION : responsible for painting the grids vertical lines
13073 ARGUMENTS : pRectToDraw pointer to rectangle that needs refreshing.
13075 offset offset from rhs that rightmost line would be
13076 drawn if rectangle included whole viewport
13077 pDC pointer to device context to use
13080 ---------------------------------------------------------------------------*/
13081 void paintVerticalLines( RectCoords* pRectToDraw, uint16 offset,
13084 /*---------------------------------------------------------------------------
13085 FUNCTION : PAINTVERTICALLINES
13086 DESCRIPTION : responsible for painting the grids vertical lines
13087 ARGUMENTS : name : yStart
13088 - the starting Y co-ordinate for the vertical line
13090 - the ending Y co-ordinate for the vertical line
13092 - a starting point offset that determines at what X
13093 position the first line will be drawn
13098 ---------------------------------------------------------------------------*/
13099 void paintVerticalLines( uint16 yStart, uint16 yEnd, uint16 offset );
13102 #if defined _WINDOWS
13103 /*---------------------------------------------------------------------------
13104 FUNCTION : PAINTVERTICALLINE
13105 DESCRIPTION : paints one line at the position specified, and length
13106 ARGUMENTS : name : yStart
13107 - the starting point on the y axis for the line
13109 - the end point on the y axis for the line
13111 - The horizontal offset from the start of the viewport
13112 pDC pointer to device context to use
13115 NOTES : There is not an equivalent horizontal method as yet. This
13116 is a seperate method because the service is useful to a
13117 derivation of this class
13118 ---------------------------------------------------------------------------*/
13119 void paintVerticalLine( uint16 yStart, uint16 yEnd
13120 , uint16 xPosition, CDC *pDC );
13122 /*---------------------------------------------------------------------------
13123 FUNCTION : PAINTVERTICALLINE
13124 DESCRIPTION : paints one line at the position specified, and length
13125 ARGUMENTS : name : yStart
13126 - the starting point on the y axis for the line
13128 - the end point on the y axis for the line
13130 - The horizontal offset from the start of the viewport
13133 NOTES : There is not an equivalent horizontal method as yet. This
13134 is a seperate method because the service is useful to a
13135 derivation of this class
13136 ---------------------------------------------------------------------------*/
13137 void paintVerticalLine( uint16 yStart, uint16 yEnd
13138 , uint16 xPosition );
13141 /*---------------------------------------------------------------------------
13142 INLINE FUNCTION : VERTICALSPACING
13143 NOTES : Description at the end of the file
13144 ---------------------------------------------------------------------------*/
13145 uint16 verticalSpacing( void );
13148 // Position in viewport that we are now writing to if going forwards
13149 // Note that if this is greater than viewport length then we have
13150 // just scrolled and value must be adjusted before use.
13151 sint16 forwardsOutputPosition;
13153 // Position in viewport that we are now writing to if going backwards
13154 // Note that if this is less than zero then we have
13155 // just scrolled and value must be adjusted before use.
13156 sint16 backwardsOutputPosition;
13158 // position in grid cycle of forwards output position.
13159 // if zero then it is time to output a grid line
13160 sint16 forwardsIntervalCount;
13162 // position in grid cycle of forwards output position.
13163 // if zero then it is time to output a grid line
13164 sint16 backwardsIntervalCount;
13166 uint32 lastUpdateTimestamp;
13167 uint32 timeBase; // ticks per pixel
13168 uint16 currentOutputPosition;
13169 uint16 gridTimestampSpacing;
13170 uint16 intervalCount;
13171 uint16 horizontalTotal;
13173 #if defined PRINTING_SUPPORT
13174 uint16 numberOfGridMarkersPrinted;
13176 bool firstTime; // indicates first time through
13179 GkiLineType lineType;
13180 GkiColour gridColour;
13182 #if defined _WINDOWS
13183 uint16 ticksPerSec; // number of time ticks per second
13184 uint16 vSpacingMin; // minimum pixels per division along time axis
13185 CPen *pPen; // the pen to use for drawing in windows
13191 /*****************************************************************************
13192 I N L I N E F U N C T I O N S
13193 *****************************************************************************/
13195 /*---------------------------------------------------------------------------
13196 FUNCTION : HORIZONTALLINES
13197 DESCRIPTION : supplies the number of horizontal lines in the grid
13202 ---------------------------------------------------------------------------*/
13203 inline uint16 ScrollingGrid::horizontalLines( void )
13205 return( horizontalTotal );
13207 /*---------------------------------------------------------------------------
13208 FUNCTION : VERTICALSPACING
13209 DESCRIPTION : returns the distance between adjacent vertical lines
13214 ---------------------------------------------------------------------------*/
13215 inline uint16 ScrollingGrid::verticalSpacing( void )
13217 return( vSpacing );
13226 @DEV1194:DS4 Provision of major and minor grid lines
13231 /* \$""Header: /usr/local/repository/cmnsrc/review/src/sgrid.h,v 1.1 1997/04/02 11:20:05 colinl Exp \$ */
13234 * \$""Log: sgrid.h,v \$
13235 * Revision 1.1 1997/04/02 11:20:05 colinl
13238 * Tested By: Colin Law
13240 * Reason for Change: Initial Revision of all files
13242 * Design Change Details:
13248 ARGUMENTS : name : majorColour colour for major grid lines
13249 minorColour colour for minor grid lines
13250 sgLineType line type for minor grid lines
13251 yMajorGridLines number of major y lines on grid
13252 yMinorGridLines number of major y lines on grid
13255 ScrollingGrid( GkiColour majorColour, GkiColour minorColour,
13256 GkiLineType sgLineType,
13257 uint16 yMajorGridLines, uint16 yMinorGridLines,
13259 FUNCTION : DrawHorizontalGridLines
13261 DESCRIPTION : Draws major or minor grid lines
13262 ARGUMENTS : pDC device context
13264 numLines total lines required
13265 yLow, yHigh, xLow, xHigh rectangle to draw in
13269 ---------------------------------------------------------------------------*/
13270 void DrawHorizontalGridLines( CDC* pDC, CPen* pPen,
13272 uint16 yLow, uint16 yHigh, uint16 xLow, uint16 xHigh,
13275 /*---------------------------------------------------------------------------
13279 uint16 m_yMajorGridLines;
13280 uint16 m_yMinorGridLines;
13283 GkiLineType lineType; // line type for minor grid lines
13284 GkiColour m_majorColour;
13285 GkiColour m_minorColour;
13288 CPen *pMajorPen; // pen to use for drawing major grid lines
13289 CPen *pMinorPen; // pen to use for drawing minor grid lines
13291 @" > diffmerge2/sgrid.h,v
13293 # We have to put the RCS file in the repository by hand for
13295 mkdir ${CVSROOT_DIRNAME}/diffmerge2
13296 cp diffmerge2/sgrid.h,v ${CVSROOT_DIRNAME}/diffmerge2/sgrid.h,v
13298 dotest diffmerge2_co \
13299 "${testcvs} co diffmerge2" "${DOTSTAR}U ${DOTSTAR}"
13301 dotest diffmerge2_update \
13302 "${testcvs} update -j Review_Phase_2_Enhancements sgrid.h" \
13303 "${DOTSTAR}erging ${DOTSTAR}"
13304 # This is the one that counts -- there should be no output:
13305 dotest diffmerge2_diff \
13306 "${testcvs} diff -r Review_V1p3 sgrid.h" ''
13311 echo $what is not the name of a test -- ignored
13316 echo "OK, all tests completed."
13319 # * use "test" not "[" and see if all test's support `-z'
13320 # * Test `cvs update -d foo' (where foo does not exist).
13321 # * Test `cvs update foo bar' (where foo and bar are both from the
13322 # same directory in the repository). Suppose one is a branch--make
13323 # sure that both directories get updated with the respective correct
13325 # * `cvs update ../foo'. Also ../../foo ./../foo foo/../../bar /foo/bar
13326 # foo/.././../bar foo/../bar etc.
13327 # * Test all flags in modules file.
13328 # Test that ciprog gets run both on checkin in that directory, or a
13329 # higher-level checkin which recurses into it.
13330 # * Test operations on a directory that contains other directories but has
13331 # no files of its own.
13332 # * -t global option
13333 # * cvs rm followed by cvs add or vice versa (with no checkin in between).
13334 # * cvs rm twice (should be a nice error message).
13335 # * -P option to checkout--(a) refrains from checking out new empty dirs,
13336 # (b) prunes empty dirs already there.
13337 # * Test that cvs -d `hostname`:${TESTDIR}/non/existent co foo
13338 # gives an appropriate error (e.g.
13339 # Cannot access ${TESTDIR}/non-existent/CVSROOT
13340 # No such file or directory).
13341 # (like basica-9, but for remote).
13342 # * Test ability to send notifications in response to watches. (currently
13343 # hard to test because CVS doesn't send notifications if username is the
13345 # * Test that remote edit and/or unedit works when disconnected from
13346 # server (e.g. set CVS_SERVER to "foobar").
13347 # * Test the contents of adm files other than Root and Repository.
13348 # Entries seems the next most important thing.
13349 # End of TODO list.
13351 # Remove the test directory, but first change out of it.