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
24 echo "Usage: `basename $0` --help"
25 echo "Usage: `basename $0` [-klr] [-f FROM-TEST] [-h HOSTNAME] CVS-TO-TEST [TESTS-TO-RUN...]"
38 echo "-H|--help display this text"
40 echo " test CVS using a symlink to a real CVSROOT"
41 echo "-r|--remote test remote instead of local cvs"
42 echo "-h HOSTNAME Use :ext:HOSTNAME to run remote tests rather than"
43 echo " :fork:. Implies --remote and assumes that \$TESTDIR"
44 echo " resolves to the same directory on both the client and"
46 echo "-k|--keep try to keep directories created by individual tests"
47 echo " around, exiting after the first test which supports"
49 echo "-f FROM-TEST run TESTS-TO-RUN, skipping all tests in the list before"
52 echo "CVS-TO-TEST the path to the CVS executable to be tested"
53 echo "TESTS-TO-RUN the names of the tests to run (defaults to all tests)"
57 # See TODO list at end of file.
59 # required to make this script work properly.
62 # We want to invoke a predictable set of i18n behaviors, not whatever
63 # the user running this script might have set.
65 # 'sort' and tabs and spaces (LC_COLLATE).
66 # Messages from getopt (LC_MESSAGES) (in the future, CVS itself might
67 # also alter its messages based on LC_MESSAGES).
83 while getopts f:h:Hklr-: option ; do
84 # convert the long opts to short opts
85 if test x$option = x-; then
87 [hH]|[hH][eE]|[hH][eE][lL]|[hH][eE][lL][pP])
91 [kK]|[kK][eE]|[kK][eE][eE]|[kK][eE][eE][pP])
95 l|li|lin|link|link-|link-r]|link-ro|link-roo|link-root)
99 [rR]|[rR][eE]|[rR][eE][mM]|[rR][eE][mM][oO]|[rR][eE][mM][oO][tT]|[rR][eE][mM][oO][tT][eE])
113 # Set a remotehost to run the remote tests on via :ext:
114 # Implies `-r' and assumes that $TESTDIR resolves to the same
115 # directory on the client and the server.
123 # The -k (keep) option will eventually cause all the tests to
124 # leave around the contents of the /tmp directory; right now only
125 # some implement it. Not originally intended to be useful with
126 # more than one test, but this should work if each test uses a
127 # uniquely named dir (use the name of the test).
142 # boot the arguments we used above
143 while test $OPTIND -gt 1 ; do
145 OPTIND=`expr $OPTIND - 1`
148 # Use full path for CVS executable, so that CVS_SERVER gets set properly
163 # If $remotehost is set, warn if $TESTDIR isn't since we are pretty sure
164 # that its default value of `/tmp/cvs-sanity' will not resolve to the same
165 # directory on two different machines.
166 if test -n "$remotehost" && test -z "$TESTDIR"; then
167 echo "WARNING: CVS server hostname is set and \$TESTDIR is not. If" >&2
168 echo "$remotehost is not the local machine, then it is unlikely that" >&2
169 echo "the default value assigned to \$TESTDIR will resolve to the same" >&2
170 echo "directory on both this client and the CVS server." >&2
182 echo 'This test should produce no other output than this message, and a final "OK".'
183 echo '(Note that the test can take an hour or more to run and periodically stops'
184 echo 'for as long as one minute. Do not assume there is a problem just because'
185 echo 'nothing seems to happen for a long time. If you cannot live without'
186 echo "running status, try the command: \`tail -f check.log' from another window.)"
188 # Regexp to match what CVS will call itself in output that it prints.
189 # FIXME: we don't properly quote this--if the name contains . we'll
190 # just spuriously match a few things; if the name contains other regexp
191 # special characters we are probably in big trouble.
192 PROG=`basename ${testcvs}`
194 # Regexp to match an author name. I'm not really sure what characters
195 # should be here. a-zA-Z obviously. People complained when 0-9 were
196 # not allowed in usernames. Other than that I'm not sure.
197 username="[-a-zA-Z0-9][-a-zA-Z0-9]*"
198 author="[-a-zA-Z0-9][-a-zA-Z0-9]*"
199 hostname="[-_.a-zA-Z0-9]*"
201 # Regexp to match the name of a temporary file (from cvs_temp_name).
202 # This appears in certain diff output.
203 tempname="[-a-zA-Z0-9/.%_]*"
205 # Regexp to match a date in RFC822 format (as amended by RFC1123).
206 RFCDATE="[a-zA-Z0-9 ][a-zA-Z0-9 ]* [0-9:][0-9:]* -0000"
207 RFCDATE_EPOCH="1 Jan 1970 00:00:00 -0000"
209 # Regexp to match a date in standard Unix format as used by rdiff
210 # FIXCVS: There's no reason for rdiff to use a different date format
212 DATE="[a-zA-Z]* [a-zA-Z]* [ 1-3][0-9] [0-9:]* [0-9]*"
214 # On cygwin32, we may not have /bin/sh.
215 if test -r /bin/sh; then
218 TESTSHELL=`type -p sh 2>/dev/null`
219 if test ! -r "$TESTSHELL"; then
224 # FIXME: try things (what things? checkins?) without -m.
226 # Some of these tests are written to expect -Q. But testing with
227 # -Q is kind of bogus, it is not the way users actually use CVS (usually).
228 # So new tests probably should invoke ${testcvs} directly, rather than ${CVS}.
229 # and then they've obviously got to do something with the output....
233 LOGFILE=`pwd`/check.log
235 # Save the previous log in case the person running the tests decides
236 # they want to look at it. The extension ".plog" is chosen for consistency
238 if test -f check.log; then
239 mv check.log check.plog
242 # Create the log file so check.log can be tailed almost immediately after
243 # this script is started. Otherwise it can take up to a minute or two before
244 # the log file gets created when $remotehost is specified on some systems,
245 # which makes for a lot of failed `tail -f' attempts.
248 # The default value of /tmp/cvs-sanity for TESTDIR is dubious,
249 # because it loses if two people/scripts try to run the tests
250 # at the same time. Some possible solutions:
251 # 1. Use /tmp/cvs-test$$. One disadvantage is that the old
252 # cvs-test* directories would pile up, because they wouldn't
253 # necessarily get removed.
254 # 2. Have everyone/everything running the testsuite set
255 # TESTDIR to some appropriate directory.
256 # 3. Have the default value of TESTDIR be some variation of
257 # `pwd`/cvs-sanity. The biggest problem here is that we have
258 # been fairly careful to test that CVS prints in messages the
259 # actual pathnames that we pass to it, rather than a different
260 # pathname for the same directory, as may come out of `pwd`.
261 # So this would be lost if everything was `pwd`-based. I suppose
262 # if we wanted to get baroque we could start making symlinks
263 # to ensure the two are different.
264 : ${CVS_RSH=rsh}; export CVS_RSH
265 if test -n "$remotehost"; then
266 # We need to set $tmp on the server since $TMPDIR is compared against
267 # messages generated by the server.
268 tmp=`$CVS_RSH $remotehost 'cd /tmp; /bin/pwd || pwd' 2>/dev/null`
269 if test $? != 0; then
270 echo "$CVS_RSH $remotehost failed." >&2
274 tmp=`(cd /tmp; /bin/pwd || pwd) 2>/dev/null`
278 # 1) Set TESTDIR if it's not set already
279 # 2) Remove any old test remnants
281 # 4) Normalize TESTDIR with `cd && (/bin/pwd || pwd)`
282 # (This will match CVS output later)
283 : ${TESTDIR=$tmp/cvs-sanity}
284 # clean any old remnants (we need the chmod because some tests make
285 # directories read-only)
286 if test -d ${TESTDIR}; then
287 chmod -R a+wx ${TESTDIR}
290 # These exits are important. The first time I tried this, if the `mkdir && cd`
291 # failed then the build directory would get blown away. Some people probably
292 # wouldn't appreciate that.
293 mkdir ${TESTDIR} || exit 1
294 cd ${TESTDIR} || exit 1
295 # Ensure $TESTDIR is absolute
296 if echo "${TESTDIR}" |grep '^[^/]'; then
297 # Don't resolve this unless we have to. This keeps symlinks intact. This
298 # is important at least when testing using -h $remotehost, because the same
299 # value for $TESTDIR must resolve to the same directory on the client and
300 # the server and we likely used Samba, and possibly symlinks, to do this.
301 TESTDIR=`(/bin/pwd || pwd) 2>/dev/null`
304 if test -z "${TESTDIR}" || echo "${TESTDIR}" |grep '^[^/]'; then
305 echo "Unable to resolve TESTDIR to an absolute directory." >&2
310 # Now set $TMPDIR if the user hasn't overridden it.
312 # We use a $TMPDIR under $TESTDIR by default so that two tests may be run at
313 # the same time without bumping heads without requiring the user to specify
314 # more than $TESTDIR. See the test for leftover cvs-serv* directories near the
315 # end of this script at the end of "The big loop".
316 : ${TMPDIR=$TESTDIR/tmp}
318 if test -d $TMPDIR; then :; else
322 # Make sure various tools work the way we expect, or try to find
331 GLOCS="`echo $PATH | sed 's/:/ /g'` /usr/local/bin /usr/contrib/bin /usr/gnu/bin /local/bin /local/gnu/bin /gnu/bin"
333 for path in $GLOCS ; do
334 if test -x $path/g$1 ; then
335 RES="`$path/g$1 --version </dev/null 2>/dev/null`"
336 if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
341 if test -x $path/$1 ; then
342 RES="`$path/$1 --version </dev/null 2>/dev/null`"
343 if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
349 if test -z "$TOOL"; then
352 echo "Notice: The default version of \`$1' is defective, using" >&2
353 echo "\`$TOOL' instead." >&2
358 # You can't run CVS as root; print a nice error message here instead
359 # of somewhere later, after making a mess.
361 # FIXME - find_tool() finds the 'gid' from GNU id-utils if I pull 'id' out of
363 for pass in false :; do
364 case "`$ID -u 2>/dev/null`" in
366 echo "Test suite does not work correctly when run as root" >&2
371 if $pass; then :; else
374 if $pass || test -z "$ID" ; then
375 echo "Running these tests requires an \`id' program that understands the" >&2
376 echo "-u and -n flags. Make sure that such an id (GNU, or many but not" >&2
377 echo "all vendor-supplied versions) is in your path." >&2
388 # Cause NextStep 3.3 users to lose in a more graceful fashion.
391 def' >/dev/null; then
394 EXPR=`find_tool expr`
395 if test -z "$EXPR" ; then
396 echo 'Running these tests requires an "expr" program that can handle' >&2
397 echo 'multi-line patterns. Make sure that such an expr (GNU, or many but' >&2
398 echo 'not all vendor-supplied versions) is in your path.' >&2
403 # Warn SunOS, SysVr3.2, etc., users that they may be partially losing
404 # if we can't find a GNU expr to ease their troubles...
408 EXPR=`find_tool expr`
409 if test -z "$EXPR" ; then
410 echo 'Warning: you are using a version of expr that does not correctly'
411 echo 'match multi-line patterns. Some tests may spuriously pass or fail.'
412 echo 'You may wish to make sure GNU expr is in your path.'
419 # More SunOS lossage...
420 echo 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >${TESTDIR}/foo
421 cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
422 cat ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar >${TESTDIR}/foo
423 cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
424 if $EXPR "`cat ${TESTDIR}/bar`" : "`cat ${TESTDIR}/bar`" >/dev/null; then
427 EXPR=`find_tool expr`
428 if test -z "$EXPR" ; then
429 echo 'Warning: you are using a version of expr that does not correctly'
430 echo 'match large patterns. Some tests may spuriously pass or fail.'
431 echo 'You may wish to make sure GNU expr is in your path.'
435 if $EXPR "`cat ${TESTDIR}/bar`x" : "`cat ${TESTDIR}/bar`y" >/dev/null; then
436 EXPR=`find_tool expr`
437 if test -z "$EXPR" ; then
438 echo 'Warning: you are using a version of expr that does not correctly'
439 echo 'match large patterns. Some tests may spuriously pass or fail.'
440 echo 'You may wish to make sure GNU expr is in your path.'
447 # That we should have to do this is total bogosity, but GNU expr
448 # version 1.9.4-1.12 uses the emacs definition of "$" instead of the unix
449 # (e.g. SunOS 4.1.3 expr) one. Rumor has it this will be fixed in the
450 # next release of GNU expr after 1.12 (but we still have to cater to the old
451 # ones for some time because they are in many linux distributions).
454 def' : 'abc$' >/dev/null; then
458 # Work around another GNU expr (version 1.10-1.12) bug/incompatibility.
459 # "." doesn't appear to match a newline (it does with SunOS 4.1.3 expr).
460 # Note that the workaround is not a complete equivalent of .* because
461 # the first parenthesized expression in the regexp must match something
462 # in order for expr to return a successful exit status.
463 # Rumor has it this will be fixed in the
464 # next release of GNU expr after 1.12 (but we still have to cater to the old
465 # ones for some time because they are in many linux distributions).
468 def' : "a${DOTSTAR}f" >/dev/null; then
475 # Now that we have DOTSTAR, make sure it works with big matches
476 if $EXPR "`cat ${TESTDIR}/bar`" : "${DOTSTAR}xyzABC${DOTSTAR}$" >/dev/null; then
479 EXPR=`find_tool expr`
480 if test -z "$EXPR" ; then
481 echo 'Warning: you are using a version of expr that does not correctly'
482 echo 'match large patterns. Some tests may spuriously pass or fail.'
483 echo 'You may wish to make sure GNU expr is in your path.'
488 rm -f ${TESTDIR}/foo ${TESTDIR}/bar
490 # Work around yet another GNU expr (version 1.10) bug/incompatibility.
491 # "+" is a special character, yet for unix expr (e.g. SunOS 4.1.3)
492 # it is not. I doubt that POSIX allows us to use \+ and assume it means
493 # (non-special) +, so here is another workaround
494 # Rumor has it this will be fixed in the
495 # next release of GNU expr after 1.12 (but we still have to cater to the old
496 # ones for some time because they are in many linux distributions).
498 if $EXPR 'a +b' : "a ${PLUS}b" >/dev/null; then
506 if $EXPR 'a?b' : "a${QUESTION}b" >/dev/null; then
512 # Now test the username to make sure it contains only valid characters
514 if $EXPR "${username}" : "${username}" >/dev/null; then
517 echo "Test suite does not work correctly when run by a username" >&2
518 echo "containing regular expression meta-characters." >&2
522 # now make sure that tr works on NULs
523 if $EXPR `echo "123" | ${TR} '2' '\0'` : "123" >/dev/null 2>&1; then
525 if test -z "$TR" ; then
526 echo 'Warning: you are using a version of tr which does not correctly'
527 echo 'handle NUL bytes. Some tests may spuriously pass or fail.'
528 echo 'You may wish to make sure GNU tr is in your path.'
537 echo "PASS: $1" >>${LOGFILE}
542 echo "FAIL: $1" | tee -a ${LOGFILE}
543 echo "*** Please see the \`TESTS' and \`check.log' files for more information." >&2
544 # This way the tester can go and see what remnants were left
548 # See dotest and dotest_fail for explanation (this is the parts
549 # of the implementation common to the two).
552 if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$3${ENDANCHOR}" >/dev/null; then
553 # Why, I hear you ask, do we write this to the logfile
554 # even when the test passes? The reason is that the test
555 # may give us the regexp which we were supposed to match,
556 # but sometimes it may be useful to look at the exact
557 # text which was output. For example, suppose one wants
558 # to grep for a particular warning, and make _sure_ that
559 # CVS never hits it (even in cases where the tests might
560 # match it with .*). Or suppose one wants to see the exact
561 # date format output in a certain case (where the test will
562 # surely use a somewhat non-specific pattern).
563 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
565 # expr can't distinguish between "zero characters matched" and "no match",
566 # so special-case it.
567 elif test -z "$3" && test ! -s ${TESTDIR}/dotest.tmp; then
569 elif test x"$4" != x; then
570 if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$4${ENDANCHOR}" >/dev/null; then
571 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
574 echo "** expected: " >>${LOGFILE}
575 echo "$3" >>${LOGFILE}
576 echo "$3" > ${TESTDIR}/dotest.ex1
577 echo "** or: " >>${LOGFILE}
578 echo "$4" >>${LOGFILE}
579 echo "$4" > ${TESTDIR}/dotest.ex2
580 echo "** got: " >>${LOGFILE}
581 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
585 echo "** expected: " >>${LOGFILE}
586 echo "$3" >>${LOGFILE}
587 echo "$3" > ${TESTDIR}/dotest.exp
588 echo "** got: " >>${LOGFILE}
589 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
596 if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : \
597 "`cat ${TESTDIR}/dotest.exp`" >/dev/null; then
603 # WARNING: this won't work with REs that match newlines....
605 dotest_line_by_line ()
608 while [ $line -le `wc -l <${TESTDIR}/dotest.tmp` ] ; do
609 if $EXPR "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" : \
610 "`sed -n ${line}p ${TESTDIR}/dotest.exp`" >/dev/null; then
612 elif test -z "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" &&
613 test -z "`sed -n ${line}p ${TESTDIR}/dotest.exp`"; then
616 echo "Line $line:" >> ${LOGFILE}
617 echo "**** expected: " >>${LOGFILE}
618 sed -n ${line}p ${TESTDIR}/dotest.exp >>${LOGFILE}
619 echo "**** got: " >>${LOGFILE}
620 sed -n ${line}p ${TESTDIR}/dotest.tmp >>${LOGFILE}
624 line=`expr $line + 1`
630 # If you are having trouble telling which line of a multi-line
631 # expression is not being matched, replace calls to dotest_internal()
632 # with calls to this function:
634 dotest_internal_debug ()
636 if test -z "$3"; then
637 if test -s ${TESTDIR}/dotest.tmp; then
638 echo "** expected: " >>${LOGFILE}
639 echo "$3" >>${LOGFILE}
640 echo "$3" > ${TESTDIR}/dotest.exp
641 rm -f ${TESTDIR}/dotest.ex2
642 echo "** got: " >>${LOGFILE}
643 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
649 echo "$3" > ${TESTDIR}/dotest.exp
650 if dotest_line_by_line "$1" "$2"; then
653 if test x"$4" != x; then
654 mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex1
655 echo "$4" > ${TESTDIR}/dotest.exp
656 if dotest_line_by_line "$1" "$2"; then
659 mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex2
660 echo "** expected: " >>${LOGFILE}
661 echo "$3" >>${LOGFILE}
662 echo "** or: " >>${LOGFILE}
663 echo "$4" >>${LOGFILE}
664 echo "** got: " >>${LOGFILE}
665 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
669 echo "** expected: " >>${LOGFILE}
670 echo "$3" >>${LOGFILE}
671 echo "** got: " >>${LOGFILE}
672 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
680 # dotest TESTNAME COMMAND OUTPUT [OUTPUT2]
681 # TESTNAME is the name used in the log to identify the test.
682 # COMMAND is the command to run; for the test to pass, it exits with
684 # OUTPUT is a regexp which is compared against the output (stdout and
685 # stderr combined) from the test. It is anchored to the start and end
686 # of the output, so should start or end with ".*" if that is what is desired.
687 # Trailing newlines are stripped from the command's actual output before
688 # matching against OUTPUT.
689 # If OUTPUT2 is specified and the output matches it, then it is also
690 # a pass (partial workaround for the fact that some versions of expr
694 rm -f ${TESTDIR}/dotest.ex? 2>&1
695 eval "$2" >${TESTDIR}/dotest.tmp 2>&1
697 if test "$status" != 0; then
698 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
699 echo "exit status was $status" >>${LOGFILE}
705 # Like dotest except only 2 args and result must exactly match stdin
708 rm -f ${TESTDIR}/dotest.ex? 2>&1
709 eval "$2" >${TESTDIR}/dotest.tmp 2>&1
711 if test "$status" != 0; then
712 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
713 echo "exit status was $status" >>${LOGFILE}
716 cat >${TESTDIR}/dotest.exp
717 if cmp ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.tmp >/dev/null 2>&1; then
720 echo "** expected: " >>${LOGFILE}
721 cat ${TESTDIR}/dotest.exp >>${LOGFILE}
722 echo "** got: " >>${LOGFILE}
723 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
728 # Like dotest except exitstatus should be nonzero.
731 rm -f ${TESTDIR}/dotest.ex? 2>&1
732 eval "$2" >${TESTDIR}/dotest.tmp 2>&1
734 if test "$status" = 0; then
735 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
736 echo "exit status was $status" >>${LOGFILE}
742 # Like dotest except output is sorted.
745 rm -f ${TESTDIR}/dotest.ex? 2>&1
746 eval "$2" >${TESTDIR}/dotest.tmp1 2>&1
748 if test "$status" != 0; then
749 cat ${TESTDIR}/dotest.tmp1 >>${LOGFILE}
750 echo "exit status was $status" >>${LOGFILE}
753 ${TR} ' ' ' ' < ${TESTDIR}/dotest.tmp1 | sort > ${TESTDIR}/dotest.tmp
757 # Avoid picking up any stray .cvsrc, etc., from the user running the tests
759 HOME=${TESTDIR}/home; export HOME
761 # Make sure this variable is not defined to anything that would
762 # change the format of rcs dates. Otherwise people using e.g.,
763 # RCSINIT=-zLT get lots of spurious failures.
764 RCSINIT=; export RCSINIT
766 # Remaining arguments are the names of tests to run.
768 # The testsuite is broken up into (hopefully manageably-sized)
769 # independently runnable tests, so that one can quickly get a result
770 # from a cvs or testsuite change, and to facilitate understanding the
773 if test x"$*" = x; then
774 # Basic/miscellaneous functionality
775 tests="version basica basicb basicc basic1 deep basic2"
776 tests="${tests} parseroot files spacefiles commit-readonly"
777 tests="${tests} commit-add-missing"
778 tests="${tests} status"
779 # Branching, tagging, removing, adding, multiple directories
780 tests="${tests} rdiff rdiff-short"
781 tests="${tests} rdiff2 diff diffnl death death2"
782 tests="${tests} rm-update-message rmadd rmadd2 rmadd3 resurrection"
783 tests="${tests} dirs dirs2 branches branches2 tagc tagf"
784 tests="${tests} rcslib multibranch import importb importc import-CVS"
785 tests="${tests} update-p import-after-initial branch-after-import"
786 tests="${tests} join join2 join3 join4 join5 join6"
787 tests="${tests} join-readonly-conflict join-admin join-admin-2"
788 tests="${tests} join-rm"
789 tests="${tests} new newb conflicts conflicts2 conflicts3"
790 tests="${tests} clean"
791 # Checking out various places (modules, checkout -d, &c)
792 tests="${tests} modules modules2 modules3 modules4 modules5 modules6"
793 tests="${tests} mkmodules co-d"
794 tests="${tests} cvsadm emptydir abspath abspath2 toplevel toplevel2"
795 tests="${tests} rstar-toplevel trailingslashes checkout_repository"
796 # Log messages, error messages.
797 tests="${tests} mflag editor errmsg1 errmsg2 adderrmsg opterrmsg"
798 # Watches, binary files, history browsing, &c.
799 tests="${tests} devcom devcom2 devcom3 watch4 watch5"
800 tests="${tests} unedit-without-baserev"
801 tests="${tests} ignore ignore-on-branch binfiles binfiles2 binfiles3"
802 tests="${tests} mcopy binwrap binwrap2"
803 tests="${tests} binwrap3 mwrap info taginfo config"
804 tests="${tests} serverpatch log log2 logopt ann ann-id"
805 # Repository Storage (RCS file format, CVS lock files, creating
806 # a repository without "cvs init", &c).
807 tests="${tests} crerepos rcs rcs2 rcs3 lockfiles backuprecover"
808 # More history browsing, &c.
809 tests="${tests} history"
810 tests="${tests} big modes modes2 modes3 stamps"
811 # PreservePermissions stuff: permissions, symlinks et al.
812 # tests="${tests} perms symlinks symlinks2 hardlinks"
813 # More tag and branch tests, keywords.
814 tests="${tests} sticky keyword keywordlog keywordname keyword2"
815 tests="${tests} head tagdate multibranch2 tag8k"
816 # "cvs admin", reserved checkouts.
817 tests="${tests} admin reserved"
818 # Nuts and bolts of diffing/merging (diff library, &c)
819 tests="${tests} diffmerge1 diffmerge2"
820 # Release of multiple directories
821 tests="${tests} release"
822 tests="${tests} recase"
823 # Multiple root directories and low-level protocol tests.
824 tests="${tests} multiroot multiroot2 multiroot3 multiroot4"
825 tests="${tests} rmroot reposmv pserver server server2 client"
826 tests="${tests} dottedroot fork commit-d"
831 # Now check the -f argument for validity.
832 if test -n "$fromtest"; then
833 # Don't allow spaces - they are our delimiters in tests
835 for sub in $fromtest; do
836 count=`expr $count + 1`
838 if test $count != 1; then
839 echo "No such test \`$fromtest'." >&2
842 # make sure it is in $tests
847 echo "No such test \`$fromtest'." >&2
855 # a simple function to compare directory contents
857 # Returns: 0 for same, 1 for different
866 find . -print | fgrep -v /CVS | sort > $TESTDIR/dc$$d1
868 # go back where we were to avoid symlink hell...
871 find . -print | fgrep -v /CVS | sort > $TESTDIR/dc$$d2
873 if diff $TESTDIR/dc$$d1 $TESTDIR/dc$$d2 >/dev/null 2>&1
882 if test -f $DIR_1/"$a" ; then
883 cmp -s $DIR_1/"$a" $DIR_2/"$a"
884 if test $? -ne 0 ; then
888 done < $TESTDIR/dc$$d1
896 # The following 4 functions are used by the diffmerge1 test case. They set up,
897 # respectively, the four versions of the files necessary:
899 # 1. Ancestor revisions.
902 # 4. Expected merge result.
905 # Create ancestor revisions for diffmerge1
906 diffmerge_create_older_files() {
907 # This test case was supplied by Noah Friedman:
908 cat >testcase01 <<EOF
911 package random.application;
913 import random.util.*;
917 /* Instantiates a Button with origin (0, 0) and zero width and height.
918 * You must call an initializer method to properly initialize the Button.
924 _titleColor = Color.black;
925 _disabledTitleColor = Color.gray;
926 _titleFont = Font.defaultFont ();
929 /* Convenience constructor for instantiating a Button with
930 * bounds x, y, width, and height. Equivalent to
931 * foo = new Button ();
932 * foo.init (x, y, width, height);
934 public Button (int x, int y, int width, int height)
937 init (x, y, width, height);
942 # This test case was supplied by Jacob Burckhardt:
943 cat >testcase02 <<EOF
951 # This test case was supplied by Karl Tomlinson who also wrote the
952 # patch which lets CVS correctly handle this and several other cases:
953 cat >testcase03 <<EOF
962 # This test case was supplied by Karl Tomlinson:
963 cat >testcase04 <<EOF
979 # This test case was supplied by Karl Tomlinson:
980 cat >testcase05 <<EOF
1008 # This test case was supplied by Jacob Burckhardt:
1009 cat >testcase06 <<EOF
1025 # This test is supposed to verify that the horizon lines are the same
1026 # for both 2-way diffs, but unfortunately, it does not fail with the
1027 # old version of cvs. However, Karl Tomlinson still thought it would
1028 # be good to test it anyway:
1029 cat >testcase07 <<EOF
1060 # This test case was supplied by Jacob Burckhardt:
1061 cat >testcase08 <<EOF
1062 Both changes move this line to the end of the file.
1068 First change will delete this line.
1070 First change will also delete this line.
1076 Second change will change it here.
1083 # This test case was supplied by Jacob Burckhardt. Note that I do not
1084 # think cvs has ever failed with this case, but I include it anyway,
1085 # since I think it is a hard case. It is hard because Peter Miller's
1086 # fmerge utility fails on it:
1087 cat >testcase09 <<EOF
1097 # This test case was supplied by Martin Dorey and simplified by Jacob
1099 cat >testcase10 <<EOF
1102 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1104 MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
1105 OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
1107 Bloke_GttpfIRte_MtpeaL ( &acI );
1108 MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
1112 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1113 Y * jfle_Uecopd_MfJe_fY_Mectopk,
1114 jfle_Uecopd_MfJe_fY_Mectopk,
1119 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1120 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
1121 jfle_Uecopd_MfJe_fY_Mectopk,
1128 /****************************************************************************
1130 * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
1132 ****************************************************************************/
1134 MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
1138 MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
1143 HfkQipfte ( waYdle, /* waYdle */
1144 waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
1145 (coYkt RfYt8*) nRVVep, /* nRVVep */
1146 0, /* MRrepVlRoRk KfxoYfkL */
1147 beYgtz /* nEtek to Apfte */
1155 # Create "your" revisions for diffmerge1
1156 diffmerge_create_your_files() {
1157 # remove the Button() method
1158 cat >testcase01 <<\EOF
1161 package random.application;
1163 import random.util.*;
1167 /* Instantiates a Button with origin (0, 0) and zero width and height.
1168 * You must call an initializer method to properly initialize the Button.
1174 _titleColor = Color.black;
1175 _disabledTitleColor = Color.gray;
1176 _titleFont = Font.defaultFont ();
1181 cat >testcase02 <<\EOF
1189 cat >testcase03 <<\EOF
1200 cat >testcase04 <<\EOF
1210 cat >testcase05 <<\EOF
1227 # Test case 6 and test case 7 both use the same input files, but they
1228 # order the input files differently. In one case, a certain file is
1229 # used as the older file, but in the other test case, that same file
1230 # is used as the file which has changes. I could have put echo
1231 # commands here, but since the echo lines would be the same as those
1232 # in the previous function, I decided to save space and avoid repeating
1233 # several lines of code. Instead, I merely swap the files:
1235 mv testcase06 testcase07
1238 # Make the date newer so that cvs thinks that the files are changed:
1239 touch testcase06 testcase07
1241 cat >testcase08 <<\EOF
1246 First change has now added this in.
1252 Second change will change it here.
1258 Both changes move this line to the end of the file.
1261 cat >testcase09 <<\EOF
1275 cat >testcase10 <<\EOF
1277 fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
1280 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1282 fV ( jfle_Uecopd_KRLIep < 16 )
1284 MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
1288 MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
1289 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1291 MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
1292 OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
1294 Bloke_GttpfIRte_MtpeaL ( &acI );
1295 MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
1301 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1302 Y * jfle_Uecopd_MfJe_fY_Mectopk,
1303 jfle_Uecopd_MfJe_fY_Mectopk,
1308 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1309 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
1310 jfle_Uecopd_MfJe_fY_Mectopk,
1319 /****************************************************************************
1321 * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
1323 ****************************************************************************/
1325 MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
1329 MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
1334 HfkQipfte ( waYdle, /* waYdle */
1335 waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
1336 (coYkt RfYt8*) nRVVep, /* nRVVep */
1337 0, /* MRrepVlRoRk KfxoYfkL */
1338 beYgtz /* nEtek to Apfte */
1347 # Create "my" revisions for diffmerge1
1348 diffmerge_create_my_files() {
1349 # My working copy still has the Button() method, but I
1350 # comment out some code at the top of the class.
1351 cat >testcase01 <<\EOF
1354 package random.application;
1356 import random.util.*;
1360 /* Instantiates a Button with origin (0, 0) and zero width and height.
1361 * You must call an initializer method to properly initialize the Button.
1367 // _titleColor = Color.black;
1368 // _disabledTitleColor = Color.gray;
1369 // _titleFont = Font.defaultFont ();
1372 /* Convenience constructor for instantiating a Button with
1373 * bounds x, y, width, and height. Equivalent to
1374 * foo = new Button ();
1375 * foo.init (x, y, width, height);
1377 public Button (int x, int y, int width, int height)
1380 init (x, y, width, height);
1385 cat >testcase02 <<\EOF
1393 cat >testcase03 <<\EOF
1403 cat >testcase04 <<\EOF
1421 # Note that in test case 5, there are no changes in the "mine"
1422 # section, which explains why there is no command here which writes to
1425 # no changes for testcase06
1427 # The two branches make the same changes:
1428 cp ../yours/testcase07 .
1430 cat >testcase08 <<\EOF
1435 First change will delete this line.
1437 First change will also delete this line.
1443 Second change has now changed it here.
1449 Both changes move this line to the end of the file.
1452 cat >testcase09 <<\EOF
1465 cat >testcase10 <<\EOF
1468 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1470 MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
1471 OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
1473 Bloke_GttpfIRte_MtpeaL ( &acI );
1474 MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
1478 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1479 Y * jfle_Uecopd_MfJe_fY_Mectopk,
1480 jfle_Uecopd_MfJe_fY_Mectopk,
1485 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1486 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
1487 jfle_Uecopd_MfJe_fY_Mectopk,
1494 /****************************************************************************
1496 * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
1498 ****************************************************************************/
1500 MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
1504 MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
1509 HfkQipfte ( waYdle, /* waYdle */
1510 waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
1511 (coYkt RfYt8*) nRVVep, /* nRVVep */
1512 beYgtz /* nEtek to Apfte */
1521 # Create expected results of merge for diffmerge1
1522 diffmerge_create_expected_files() {
1523 cat >testcase01 <<\EOF
1526 package random.application;
1528 import random.util.*;
1532 /* Instantiates a Button with origin (0, 0) and zero width and height.
1533 * You must call an initializer method to properly initialize the Button.
1539 // _titleColor = Color.black;
1540 // _disabledTitleColor = Color.gray;
1541 // _titleFont = Font.defaultFont ();
1546 cat >testcase02 <<\EOF
1554 cat >testcase03 <<\EOF
1566 cat >testcase04 <<\EOF
1578 # Since there are no changes in the "mine" section, just take exactly
1579 # the version in the "yours" section:
1580 cp ../yours/testcase05 .
1582 cp ../yours/testcase06 .
1584 # Since the two branches make the same changes, the result should be
1585 # the same as both branches. Here, I happen to pick yours to copy from,
1586 # but I could have also picked mine, since the source of the copy is
1587 # the same in either case. However, the mine has already been
1588 # altered by the update command, so don't use it. Instead, use the
1589 # yours section which has not had an update on it and so is unchanged:
1590 cp ../yours/testcase07 .
1592 cat >testcase08 <<\EOF
1597 First change has now added this in.
1603 Second change has now changed it here.
1609 Both changes move this line to the end of the file.
1612 cat >testcase09 <<\EOF
1626 cat >testcase10 <<\EOF
1628 fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
1631 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1633 fV ( jfle_Uecopd_KRLIep < 16 )
1635 MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
1639 MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
1640 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1642 MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
1643 OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
1645 Bloke_GttpfIRte_MtpeaL ( &acI );
1646 MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
1652 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1653 Y * jfle_Uecopd_MfJe_fY_Mectopk,
1654 jfle_Uecopd_MfJe_fY_Mectopk,
1659 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1660 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
1661 jfle_Uecopd_MfJe_fY_Mectopk,
1670 /****************************************************************************
1672 * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
1674 ****************************************************************************/
1676 MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
1680 MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
1685 HfkQipfte ( waYdle, /* waYdle */
1686 waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
1687 (coYkt RfYt8*) nRVVep, /* nRVVep */
1688 beYgtz /* nEtek to Apfte */
1699 # Echo a new CVSROOT based on $1, $remote, and $remotehost
1702 if test -n "$remotehost"; then
1703 echo :ext:$remotehost$1
1714 # Set up CVSROOT (the crerepos tests will test operating without CVSROOT set).
1716 # Currently we test :fork: and :ext: (see crerepos test). There is a
1717 # known difference between the two in modes-15 (see comments there).
1719 # :ext: can be tested against a remote machine if:
1721 # 1. $remotehost is set using the `-h' option to this script.
1722 # 2. ${CVS_RSH=rsh} $remotehost works.
1723 # 3. The path to $TESTDIR is the same on both machines (symlinks are okay)
1724 # 4. The path to $testcvs is the same on both machines (symlinks are okay)
1725 # or $CVS_SERVER is overridden in this script's environment to point to
1726 # a working CVS exectuable on the remote machine.
1728 # Testing :pserver: would be hard (inetd issues). (How about using tcpserver
1729 # and some high port number? DRP)
1731 # Allow CVS_SERVER to be overridden. This facilitates constructs like
1732 # testing a local case-insensitive client against a remote case
1733 # sensitive server and visa versa.
1734 : ${CVS_SERVER=$testcvs}; export CVS_SERVER
1737 mkdir ${TESTDIR}/realcvsroot
1738 ln -s realcvsroot ${TESTDIR}/cvsroot
1740 CVSROOT_DIRNAME=${TESTDIR}/cvsroot
1741 CVSROOT=`newroot $CVSROOT_DIRNAME`; export CVSROOT
1748 dotest 1 "${testcvs} init" ''
1749 dotest 1a "${testcvs} init" ''
1752 for what in $tests; do
1753 if test -n "$fromtest" ; then
1754 if test $fromtest = $what ; then
1763 # We've had cases where the version command started dumping core,
1764 # so we might as well test it
1765 dotest version-1 "${testcvs} --version" \
1767 Concurrent Versions System (CVS) [0-9.]*.*
1769 Copyright (c) [-0-9]* Brian Berliner, david d .zoo. zuhn,
1770 Jeff Polk, and other authors
1772 CVS may be copied only under the terms of the GNU General Public License,
1773 a copy of which can be found with the CVS distribution kit.
1775 Specify the --help option for further information about CVS'
1778 dotest version-2r "${testcvs} version" \
1779 'Client: Concurrent Versions System (CVS) [0-9p.]* (client/server)
1780 Server: Concurrent Versions System (CVS) [0-9p.]* (client/server)'
1782 dotest version-2 "${testcvs} version" \
1783 'Concurrent Versions System (CVS) [0-9.]*.*'
1788 # Similar in spirit to some of the basic1, and basic2
1789 # tests, but hopefully a lot faster. Also tests operating on
1790 # files two directories down *without* operating on the parent dirs.
1792 # Tests basica-0a and basica-0b provide the equivalent of the:
1793 # mkdir ${CVSROOT_DIRNAME}/first-dir
1794 # used by many of the tests. It is "more official" in the sense
1795 # that is does everything through CVS; the reason most of the
1796 # tests don't use it is mostly historical.
1798 dotest basica-0a "${testcvs} -q co -l ." ''
1800 dotest basica-0b "${testcvs} add first-dir" \
1801 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
1805 dotest basica-1 "${testcvs} -q co first-dir" ''
1808 # Test a few operations, to ensure they gracefully do
1809 # nothing in an empty directory.
1810 dotest basica-1a0 "${testcvs} -q update" ''
1811 dotest basica-1a1 "${testcvs} -q diff -c" ''
1812 dotest basica-1a2 "${testcvs} -q status" ''
1813 dotest basica-1a3 "${testcvs} -q update ." ''
1814 dotest basica-1a4 "${testcvs} -q update ./" ''
1817 # Remote CVS gives the "cannot open CVS/Entries" error, which is
1818 # clearly a bug, but not a simple one to fix.
1819 dotest basica-1a10 "${testcvs} -n add sdir" \
1820 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository" \
1821 "${PROG} add: cannot open CVS/Entries for reading: No such file or directory
1822 Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
1823 dotest_fail basica-1a11 \
1824 "test -d ${CVSROOT_DIRNAME}/first-dir/sdir" ''
1825 dotest basica-2 "${testcvs} add sdir" \
1826 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
1829 dotest basica-3 "${testcvs} add ssdir" \
1830 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir added to the repository"
1834 # Trying to commit it without a "cvs add" should be an error.
1835 # The "use `cvs add' to create an entry" message is the one
1836 # that I consider to be more correct, but local cvs prints the
1837 # "nothing known" message and noone has gotten around to fixing it.
1838 dotest_fail basica-notadded "${testcvs} -q ci ssfile" \
1839 "${PROG} [a-z]*: use .${PROG} add. to create an entry for ssfile
1840 ${PROG}"' \[[a-z]* aborted\]: correct above errors first!' \
1841 "${PROG}"' [a-z]*: nothing known about `ssfile'\''
1842 '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
1844 dotest basica-4 "${testcvs} add ssfile" \
1845 "${PROG}"' add: scheduling file `ssfile'\'' for addition
1846 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
1847 dotest_fail basica-4a "${testcvs} tag tag0 ssfile" \
1848 "${PROG} tag: nothing known about ssfile
1849 ${PROG} "'\[tag aborted\]: correct the above errors first!'
1851 dotest basica-5 "${testcvs} -q ci -m add-it" \
1852 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
1854 Checking in sdir/ssdir/ssfile;
1855 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1856 initial revision: 1\.1
1858 dotest_fail basica-5a \
1859 "${testcvs} -q tag BASE sdir/ssdir/ssfile" \
1860 "${PROG} tag: Attempt to add reserved tag name BASE
1861 ${PROG} \[tag aborted\]: failed to set tag BASE to revision 1\.1 in ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v"
1862 dotest basica-5b "${testcvs} -q tag NOT_RESERVED" \
1863 'T sdir/ssdir/ssfile'
1865 dotest basica-6 "${testcvs} -q update" ''
1866 echo "ssfile line 2" >>sdir/ssdir/ssfile
1867 dotest_fail basica-6.2 "${testcvs} -q diff -c" \
1868 "Index: sdir/ssdir/ssfile
1869 ===================================================================
1870 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
1871 retrieving revision 1\.1
1872 diff -c -r1\.1 ssfile
1873 \*\*\* sdir/ssdir/ssfile ${RFCDATE} 1\.1
1874 --- sdir/ssdir/ssfile ${RFCDATE}
1875 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
1879 ${PLUS} ssfile line 2"
1880 dotest_fail basica-6.3 "${testcvs} -q diff -c -rBASE" \
1881 "Index: sdir/ssdir/ssfile
1882 ===================================================================
1883 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
1884 retrieving revision 1\.1
1885 diff -c -r1\.1 ssfile
1886 \*\*\* sdir/ssdir/ssfile ${RFCDATE} 1\.1
1887 --- sdir/ssdir/ssfile ${RFCDATE}
1888 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
1892 ${PLUS} ssfile line 2"
1893 dotest_fail basica-6.4 "${testcvs} -q diff -c -rBASE -C3isacrowd" \
1894 "Index: sdir/ssdir/ssfile
1895 ===================================================================
1896 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
1897 retrieving revision 1\.1
1898 diff -c -C3isacrowd -r1\.1 ssfile
1899 ${PROG} diff: invalid context length argument"
1900 dotest basica-7 "${testcvs} -q ci -m modify-it" \
1901 "Checking in sdir/ssdir/ssfile;
1902 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1903 new revision: 1\.2; previous revision: 1\.1
1905 dotest_fail basica-nonexist "${testcvs} -q ci nonexist" \
1906 "${PROG}"' [a-z]*: nothing known about `nonexist'\''
1907 '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
1908 dotest basica-8 "${testcvs} -q update ." ''
1910 # Test the -f option to ci
1912 dotest basica-8a0 "${testcvs} -q ci -m not-modified ssfile" ''
1913 dotest basica-8a "${testcvs} -q ci -f -m force-it" \
1914 "Checking in ssfile;
1915 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1916 new revision: 1\.3; previous revision: 1\.2
1918 dotest basica-8a1 "${testcvs} -q ci -m bump-it -r 2.0" \
1919 "Checking in ssfile;
1920 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1921 new revision: 2\.0; previous revision: 1\.3
1923 dotest basica-8a1a "${testcvs} -q ci -m bump-it -r 2.9" \
1924 "Checking in ssfile;
1925 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1926 new revision: 2\.9; previous revision: 2\.0
1928 # Test string-based revion number increment rollover
1929 dotest basica-8a1b "${testcvs} -q ci -m bump-it -f -r 2" \
1930 "Checking in ssfile;
1931 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1932 new revision: 2\.10; previous revision: 2\.9
1934 dotest basica-8a1c "${testcvs} -q ci -m bump-it -r 2.99" \
1935 "Checking in ssfile;
1936 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1937 new revision: 2\.99; previous revision: 2\.10
1939 # Test string-based revion number increment rollover
1940 dotest basica-8a1d "${testcvs} -q ci -m bump-it -f -r 2" \
1941 "Checking in ssfile;
1942 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1943 new revision: 2\.100; previous revision: 2\.99
1945 dotest basica-8a1e "${testcvs} -q ci -m bump-it -r 2.1099" \
1946 "Checking in ssfile;
1947 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1948 new revision: 2\.1099; previous revision: 2\.100
1950 # Test string-based revion number increment rollover
1951 dotest basica-8a1f "${testcvs} -q ci -m bump-it -f -r 2" \
1952 "Checking in ssfile;
1953 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1954 new revision: 2\.1100; previous revision: 2\.1099
1956 # -f should not be necessary, but it should be harmless.
1957 # Also test the "-r 3" (rather than "-r 3.0") usage.
1958 dotest basica-8a2 "${testcvs} -q ci -m bump-it -f -r 3" \
1959 "Checking in ssfile;
1960 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1961 new revision: 3\.1; previous revision: 2\.1100
1964 # Test using -r to create a branch
1965 dotest_fail basica-8a3 "${testcvs} -q ci -m bogus -r 3.0.0" \
1966 "Checking in ssfile;
1967 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1968 ${PROG} commit: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: can't find branch point 3\.0
1969 ${PROG} commit: could not check in ssfile"
1970 dotest basica-8a4 "${testcvs} -q ci -m valid -r 3.1.2" \
1971 "Checking in ssfile;
1972 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
1973 new revision: 3\.1\.2\.1; previous revision: 3\.1
1975 # now get rid of the sticky tag and go back to the trunk
1976 dotest basica-8a5 "${testcvs} -q up -A ./" "[UP] ssfile"
1979 dotest basica-8b "${testcvs} -q diff -r1.2 -r1.3"
1980 dotest basica-8b1 "${testcvs} -q diff -r1.2 -r1.3 -C 3isacrowd"
1982 # The .* here will normally be "No such file or directory",
1983 # but if memory serves some systems (AIX?) have a different message.
1984 : dotest_fail basica-9 \
1985 "${testcvs} -q -d ${TESTDIR}/nonexist update" \
1986 "${PROG}: cannot access cvs root ${TESTDIR}/nonexist: .*"
1987 dotest_fail basica-9 \
1988 "${testcvs} -q -d ${TESTDIR}/nonexist update" \
1989 "${PROG} \[[a-z]* aborted\]: ${TESTDIR}/nonexist/CVSROOT: .*"
1991 dotest basica-10 "${testcvs} annotate" \
1993 Annotations for sdir/ssdir/ssfile
1994 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
1995 1\.1 .'"${username}"' *[0-9a-zA-Z-]*.: ssfile
1996 1\.2 .'"${username}"' *[0-9a-zA-Z-]*.: ssfile line 2'
1998 # Test resurrecting with strange revision numbers
2000 dotest basica-r1 "${testcvs} rm -f ssfile" \
2001 "${PROG} remove: scheduling .ssfile. for removal
2002 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
2003 dotest basica-r2 "${testcvs} -q ci -m remove" \
2005 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2006 new revision: delete; previous revision: 3\.1
2008 dotest basica-r3 "${testcvs} -q up -p -r 3.1 ./ssfile >ssfile" ""
2009 dotest basica-r4 "${testcvs} add ssfile" \
2010 "${PROG} add: Re-adding file .ssfile. (in place of dead revision 3\.2)\.
2011 ${PROG} add: use .${PROG} commit. to add this file permanently"
2012 dotest basica-r5 "${testcvs} -q ci -m resurrect" \
2013 "Checking in ssfile;
2014 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2015 new revision: 3\.3; previous revision: 3\.2
2019 # As long as we have a file with a few revisions, test
2020 # a few "cvs admin -o" invocations.
2022 dotest_fail basica-o1 "${testcvs} admin -o 1.2::1.2" \
2023 "${PROG} [a-z]*: while processing more than one file:
2024 ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
2025 dotest basica-o2 "${testcvs} admin -o 1.2::1.2 ssfile" \
2026 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2028 dotest basica-o2a "${testcvs} admin -o 1.1::NOT_RESERVED ssfile" \
2029 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2031 dotest_fail basica-o2b "${testcvs} admin -o 1.1::NOT_EXIST ssfile" \
2032 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2033 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: Revision NOT_EXIST doesn't exist.
2034 ${PROG} admin: RCS file for .ssfile. not modified\."
2035 dotest basica-o3 "${testcvs} admin -o 1.2::1.3 ssfile" \
2036 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2038 dotest basica-o4 "${testcvs} admin -o 3.1:: ssfile" \
2039 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2040 deleting revision 3\.3
2041 deleting revision 3\.2
2043 dotest basica-o5 "${testcvs} admin -o ::1.1 ssfile" \
2044 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2046 dotest basica-o5a "${testcvs} -n admin -o 1.2::3.1 ssfile" \
2047 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2048 deleting revision 2\.1100
2049 deleting revision 2\.1099
2050 deleting revision 2\.100
2051 deleting revision 2\.99
2052 deleting revision 2\.10
2053 deleting revision 2\.9
2054 deleting revision 2\.0
2055 deleting revision 1\.3
2057 dotest basica-o6 "${testcvs} admin -o 1.2::3.1 ssfile" \
2058 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2059 deleting revision 2\.1100
2060 deleting revision 2\.1099
2061 deleting revision 2\.100
2062 deleting revision 2\.99
2063 deleting revision 2\.10
2064 deleting revision 2\.9
2065 deleting revision 2\.0
2066 deleting revision 1\.3
2068 dotest basica-o6a "${testcvs} admin -o 3.1.2: ssfile" \
2069 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2070 deleting revision 3\.1\.2\.1
2072 dotest basica-o7 "${testcvs} log -N ssfile" "
2073 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2074 Working file: ssfile
2079 keyword substitution: kv
2080 total revisions: 3; selected revisions: 3
2082 ----------------------------
2084 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
2086 ----------------------------
2088 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
2090 ----------------------------
2092 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
2094 ============================================================================="
2095 dotest basica-o8 "${testcvs} -q update -p -r 1.1 ./ssfile" "ssfile"
2100 rm -rf ${CVSROOT_DIRNAME}/first-dir
2105 # More basic tests, including non-branch tags and co -d.
2107 dotest basicb-0a "${testcvs} -q co -l ." ''
2109 dotest basicb-0b "${testcvs} add topfile" \
2110 "${PROG} add: scheduling file .topfile. for addition
2111 ${PROG} add: use .${PROG} commit. to add this file permanently"
2112 dotest basicb-0c "${testcvs} -q ci -m add-it topfile" \
2113 "RCS file: ${CVSROOT_DIRNAME}/topfile,v
2115 Checking in topfile;
2116 ${CVSROOT_DIRNAME}/topfile,v <-- topfile
2117 initial revision: 1\.1
2122 dotest basicb-0d "${testcvs} -q co -l ." "U topfile"
2123 # Now test the ability to run checkout on an existing working
2124 # directory without having it lose its mind. I don't know
2125 # whether this is tested elsewhere in sanity.sh. A more elaborate
2126 # test might also have modified files, make sure it works if
2127 # the modules file was modified to add new directories to the
2129 dotest basicb-0d0 "${testcvs} -q co -l ." ""
2131 dotest basicb-0e "${testcvs} add first-dir" \
2132 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
2136 dotest basicb-1 "${testcvs} -q co first-dir" ''
2138 # The top-level CVS directory is not created by default.
2139 # I'm leaving basicb-1a and basicb-1b untouched, mostly, in
2140 # case we decide that the default should be reversed...
2142 dotest_fail basicb-1a "test -d CVS" ''
2144 dotest basicb-1c "cat first-dir/CVS/Repository" "first-dir"
2147 # Note that the name Emptydir is chosen to test that CVS just
2148 # treats it like any other directory name. It should be
2149 # special only when it is directly in $CVSROOT/CVSROOT.
2150 mkdir Emptydir sdir2
2151 dotest basicb-2 "${testcvs} add Emptydir sdir2" \
2152 "Directory ${CVSROOT_DIRNAME}/first-dir/Emptydir added to the repository
2153 Directory ${CVSROOT_DIRNAME}/first-dir/sdir2 added to the repository"
2155 echo sfile1 starts >sfile1
2156 dotest basicb-2a10 "${testcvs} -n add sfile1" \
2157 "${PROG} add: scheduling file .sfile1. for addition
2158 ${PROG} add: use .${PROG} commit. to add this file permanently"
2159 dotest basicb-2a11 "${testcvs} status sfile1" \
2160 "${PROG} status: use .${PROG} add. to create an entry for sfile1
2161 ===================================================================
2162 File: sfile1 Status: Unknown
2164 Working revision: No entry for sfile1
2165 Repository revision: No revision control file"
2166 dotest basicb-3 "${testcvs} add sfile1" \
2167 "${PROG} add: scheduling file .sfile1. for addition
2168 ${PROG} add: use .${PROG} commit. to add this file permanently"
2169 dotest basicb-3a1 "${testcvs} status sfile1" \
2170 "===================================================================
2171 File: sfile1 Status: Locally Added
2173 Working revision: New file!
2174 Repository revision: No revision control file
2177 Sticky Options: (none)"
2180 echo sfile2 starts >sfile2
2181 dotest basicb-4 "${testcvs} add sfile2" \
2182 "${PROG} add: scheduling file .sfile2. for addition
2183 ${PROG} add: use .${PROG} commit. to add this file permanently"
2184 dotest basicb-4a "${testcvs} -q ci CVS" \
2185 "${PROG} [a-z]*: warning: directory CVS specified in argument
2186 ${PROG} [a-z]*: but CVS uses CVS for its own purposes; skipping CVS directory"
2188 dotest basicb-5 "${testcvs} -q ci -m add" \
2189 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v
2191 Checking in Emptydir/sfile1;
2192 ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v <-- sfile1
2193 initial revision: 1\.1
2195 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
2197 Checking in sdir2/sfile2;
2198 ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v <-- sfile2
2199 initial revision: 1\.1
2201 echo sfile1 develops >Emptydir/sfile1
2202 dotest basicb-6 "${testcvs} -q ci -m modify" \
2203 "Checking in Emptydir/sfile1;
2204 ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v <-- sfile1
2205 new revision: 1\.2; previous revision: 1\.1
2207 dotest basicb-7 "${testcvs} -q tag release-1" 'T Emptydir/sfile1
2209 echo not in time for release-1 >sdir2/sfile2
2210 dotest basicb-8 "${testcvs} -q ci -m modify-2" \
2211 "Checking in sdir2/sfile2;
2212 ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v <-- sfile2
2213 new revision: 1\.2; previous revision: 1\.1
2215 # See if CVS can correctly notice when an invalid numeric
2216 # revision is specified.
2217 # Commented out until we get around to fixing CVS
2218 : dotest basicb-8a0 "${testcvs} diff -r 1.5 -r 1.7 sfile2" 'error msg'
2221 # Test that we recurse into the correct directory when checking
2222 # for existing files, even if co -d is in use.
2223 touch first-dir/extra
2224 dotest basicb-cod-1 "${testcvs} -q co -d first-dir1 first-dir" \
2225 'U first-dir1/Emptydir/sfile1
2226 U first-dir1/sdir2/sfile2'
2231 # FIXME? basicb-9 used to check things out like this:
2232 # U newdir/Emptydir/sfile1
2233 # U newdir/sdir2/sfile2
2234 # but that's difficult to do. The whole "shorten" thing
2235 # is pretty bogus, because it will break on things
2236 # like "cvs co foo/bar baz/quux". Unless there's some
2237 # pretty detailed expansion and analysis of the command-line
2238 # arguments, we shouldn't do "shorten" stuff at all.
2241 "${testcvs} -q co -d newdir -r release-1 first-dir/Emptydir first-dir/sdir2" \
2242 'U newdir/first-dir/Emptydir/sfile1
2243 U newdir/first-dir/sdir2/sfile2'
2245 # basicb-9a and basicb-9b: see note about basicb-1a
2247 dotest_fail basicb-9a "test -d CVS" ''
2249 dotest basicb-9c "cat newdir/CVS/Repository" "\."
2250 dotest basicb-9d "cat newdir/first-dir/CVS/Repository" \
2251 "${CVSROOT_DIRNAME}/first-dir" \
2253 dotest basicb-9e "cat newdir/first-dir/Emptydir/CVS/Repository" \
2254 "${CVSROOT_DIRNAME}/first-dir/Emptydir" \
2255 "first-dir/Emptydir"
2256 dotest basicb-9f "cat newdir/first-dir/sdir2/CVS/Repository" \
2257 "${CVSROOT_DIRNAME}/first-dir/sdir2" \
2260 dotest basicb-10 "cat newdir/first-dir/Emptydir/sfile1 newdir/first-dir/sdir2/sfile2" \
2266 # Hmm, this might be a case for CVSNULLREPOS, but CVS doesn't
2267 # seem to deal with it...
2269 dotest basicb-11 "${testcvs} -q co -d sub1/sub2 first-dir" \
2270 "U sub1/sub2/Emptydir/sfile1
2271 U sub1/sub2/sdir2/sfile2"
2273 dotest basicb-12 "${testcvs} -q update ./." ''
2275 dotest basicb-13 "${testcvs} add xx" fixme
2278 # to test: sub1/sub2/sub3
2279 fi # end of tests commented out.
2281 # Create a second directory.
2284 dotest basicb-14 "${testcvs} -q co -l ." 'U topfile'
2286 dotest basicb-15 "${testcvs} add second-dir" \
2287 "Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
2290 dotest basicb-16 "${testcvs} add aa" \
2291 "${PROG} add: scheduling file .aa. for addition
2292 ${PROG} add: use .${PROG} commit. to add this file permanently"
2293 dotest basicb-17 "${testcvs} -q ci -m add" \
2294 "RCS file: ${CVSROOT_DIRNAME}/second-dir/aa,v
2297 ${CVSROOT_DIRNAME}/second-dir/aa,v <-- aa
2298 initial revision: 1\.1
2302 # Try to remove all revisions in a file.
2303 dotest_fail basicb-o1 "${testcvs} admin -o1.1 topfile" \
2304 "RCS file: ${CVSROOT_DIRNAME}/topfile,v
2305 deleting revision 1\.1
2306 ${PROG} \[admin aborted\]: attempt to delete all revisions"
2307 dotest basicb-o2 "${testcvs} -q update -d first-dir" \
2308 "U first-dir/Emptydir/sfile1
2309 U first-dir/sdir2/sfile2"
2310 dotest_fail basicb-o3 \
2311 "${testcvs} admin -o1.1:1.2 first-dir/sdir2/sfile2" \
2312 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
2313 deleting revision 1\.2
2314 deleting revision 1\.1
2315 ${PROG} \[admin aborted\]: attempt to delete all revisions"
2320 # Note that -H is an illegal option.
2321 # I suspect that the choice between "illegal" and "invalid"
2322 # depends on the user's environment variables, the phase
2323 # of the moon (weirdness with optind), and who knows what else.
2324 # I've been seeing "illegal"...
2325 dotest_fail basicb-21 "${testcvs} -q admin -H" \
2326 "admin: illegal option -- H
2327 ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information" \
2328 "admin: invalid option -- H
2329 ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information"
2334 echo Keeping ${TESTDIR} and exiting due to --keep
2338 rm -rf ${CVSROOT_DIRNAME}/first-dir
2339 rm -rf ${CVSROOT_DIRNAME}/second-dir
2340 rm -f ${CVSROOT_DIRNAME}/topfile,v
2344 # More tests of basic/miscellaneous functionality.
2346 dotest_fail basicc-1 "${testcvs} diff" \
2347 "${PROG} [a-z]*: in directory \.:
2348 ${PROG} \[[a-z]* aborted\]: there is no version here; run .${PROG} checkout. first"
2349 dotest basicc-2 "${testcvs} -q co -l ." ''
2350 mkdir first-dir second-dir
2351 dotest basicc-3 "${testcvs} add first-dir second-dir" \
2352 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
2353 Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
2354 # Old versions of CVS often didn't create this top-level CVS
2355 # directory in the first place. I think that maybe the only
2356 # way to get it to work currently is to let CVS create it,
2357 # and then blow it away (don't complain if it does not
2358 # exist). But that is perfectly legal; people who are used
2359 # to the old behavior especially may be interested.
2360 # FIXME: this test is intended for the TopLevelAdmin=yes case;
2361 # should adjust/move it accordingly.
2363 dotest basicc-4 "echo *" "first-dir second-dir"
2364 dotest basicc-5 "${testcvs} update" \
2365 "${PROG} update: Updating first-dir
2366 ${PROG} update: Updating second-dir" \
2367 "${PROG} update: Updating \.
2368 ${PROG} update: Updating first-dir
2369 ${PROG} update: Updating second-dir"
2372 dotest basicc-6 "${testcvs} release -d" ""
2373 dotest basicc-7 "test -d ../first-dir" ""
2374 # The Linux 2.2 kernel lets you delete ".". That's OK either way,
2375 # the point is that CVS must not mess with anything *outside* "."
2376 # the way that CVS 1.10 and older tried to.
2377 dotest basicc-8 "${testcvs} -Q release -d ." \
2378 "" "${PROG} release: deletion of directory \. failed: .*"
2379 dotest basicc-9 "test -d ../second-dir" ""
2380 # For CVS to make a syntactic check for "." wouldn't suffice.
2381 # On Linux 2.2 systems, the cwd may be gone, so we recreate it
2382 # to allow basicc-11 to actually happen
2383 if test ! -d ../first-dir; then
2388 dotest basicc-11 "${testcvs} -Q release -d ./." \
2389 "" "${PROG} release: deletion of directory \./\. failed: .*"
2390 dotest basicc-11a "test -d ../second-dir" ""
2396 dotest basicc-12 "${testcvs} -Q co ." ""
2397 # actual entries can be in either Entries or Entries.log, do
2398 # an update to get them consolidated into Entries
2399 dotest basicc-12a "${testcvs} -Q up" ""
2400 dotest basicc-12b "cat CVS/Entries" \
2404 dotest basicc-13 "echo *" "CVS CVSROOT first-dir second-dir"
2405 dotest basicc-14 "${testcvs} -Q release first-dir second-dir" ""
2406 # a normal release shouldn't affect the Entries file
2407 dotest basicc-14b "cat CVS/Entries" \
2411 # FIXCVS: but release -d probably should
2412 dotest basicc-15 "${testcvs} -Q release -d first-dir second-dir" ""
2413 dotest basicc-16 "echo *" "CVS CVSROOT"
2414 dotest basicc-17 "cat CVS/Entries" \
2418 # FIXCVS: if not, update should notice the missing directories
2419 # and update Entries accordingly
2420 dotest basicc-18 "${testcvs} -Q up" ""
2421 dotest basicc-19 "cat CVS/Entries" \
2428 rm -rf ${CVSROOT_DIRNAME}/first-dir
2432 # first dive - add a files, first singly, then in a group.
2433 mkdir ${CVSROOT_DIRNAME}/first-dir
2434 mkdir basic1; cd basic1
2435 # check out an empty directory
2436 dotest basic1-1 "${testcvs} -q co first-dir" ''
2444 dotest basic1-14-add-add "${testcvs} add file2 file3 file4 file5" \
2445 "${PROG} add: scheduling file \`file2' for addition
2446 ${PROG} add: scheduling file \`file3' for addition
2447 ${PROG} add: scheduling file \`file4' for addition
2448 ${PROG} add: scheduling file \`file5' for addition
2449 ${PROG} add: use .${PROG} commit. to add these files permanently"
2450 dotest basic1-15-add-add \
2451 "${testcvs} -q update file2 file3 file4 file5" \
2456 dotest basic1-16-add-add "${testcvs} -q update" \
2461 dotest basic1-17-add-add "${testcvs} -q status" \
2462 "===================================================================
2463 File: file2 Status: Locally Added
2465 Working revision: New file!
2466 Repository revision: No revision control file
2469 Sticky Options: (none)
2471 ===================================================================
2472 File: file3 Status: Locally Added
2474 Working revision: New file!
2475 Repository revision: No revision control file
2478 Sticky Options: (none)
2480 ===================================================================
2481 File: file4 Status: Locally Added
2483 Working revision: New file!
2484 Repository revision: No revision control file
2487 Sticky Options: (none)
2489 ===================================================================
2490 File: file5 Status: Locally Added
2492 Working revision: New file!
2493 Repository revision: No revision control file
2496 Sticky Options: (none)"
2497 dotest basic1-18-add-add "${testcvs} -q log" \
2498 "${PROG} log: file2 has been added, but not committed
2499 ${PROG} log: file3 has been added, but not committed
2500 ${PROG} log: file4 has been added, but not committed
2501 ${PROG} log: file5 has been added, but not committed"
2503 dotest basic1-21-add-add "${testcvs} -q update" \
2508 # FIXCVS? Shouldn't this read first-dir/file2 instead of file2?
2509 dotest basic1-22-add-add "${testcvs} log first-dir" \
2510 "${PROG} log: Logging first-dir
2511 ${PROG} log: file2 has been added, but not committed
2512 ${PROG} log: file3 has been added, but not committed
2513 ${PROG} log: file4 has been added, but not committed
2514 ${PROG} log: file5 has been added, but not committed"
2515 dotest basic1-23-add-add "${testcvs} status first-dir" \
2516 "${PROG} status: Examining first-dir
2517 ===================================================================
2518 File: file2 Status: Locally Added
2520 Working revision: New file!
2521 Repository revision: No revision control file
2524 Sticky Options: (none)
2526 ===================================================================
2527 File: file3 Status: Locally Added
2529 Working revision: New file!
2530 Repository revision: No revision control file
2533 Sticky Options: (none)
2535 ===================================================================
2536 File: file4 Status: Locally Added
2538 Working revision: New file!
2539 Repository revision: No revision control file
2542 Sticky Options: (none)
2544 ===================================================================
2545 File: file5 Status: Locally Added
2547 Working revision: New file!
2548 Repository revision: No revision control file
2551 Sticky Options: (none)"
2552 dotest basic1-24-add-add "${testcvs} update first-dir" \
2553 "${PROG} update: Updating first-dir
2558 dotest basic1-27-add-add "${testcvs} co first-dir" \
2559 "${PROG} checkout: Updating first-dir
2565 dotest basic1-14-add-ci \
2566 "${testcvs} commit -m test file2 file3 file4 file5" \
2567 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
2570 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
2571 initial revision: 1\.1
2573 RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
2576 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
2577 initial revision: 1\.1
2579 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
2582 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
2583 initial revision: 1\.1
2585 RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
2588 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
2589 initial revision: 1\.1
2591 dotest basic1-15-add-ci \
2592 "${testcvs} -q update file2 file3 file4 file5" ''
2593 dotest basic1-16-add-ci "${testcvs} -q update" ''
2594 dotest basic1-17-add-ci "${testcvs} -q status" \
2595 "===================================================================
2596 File: file2 Status: Up-to-date
2598 Working revision: 1\.1.*
2599 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
2602 Sticky Options: (none)
2604 ===================================================================
2605 File: file3 Status: Up-to-date
2607 Working revision: 1\.1.*
2608 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file3,v
2611 Sticky Options: (none)
2613 ===================================================================
2614 File: file4 Status: Up-to-date
2616 Working revision: 1\.1.*
2617 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file4,v
2620 Sticky Options: (none)
2622 ===================================================================
2623 File: file5 Status: Up-to-date
2625 Working revision: 1\.1.*
2626 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file5,v
2629 Sticky Options: (none)"
2630 # The "log" tests and friends probably already test the output
2631 # from log quite adequately.
2632 # Note: using dotest fails here. It seems to be related
2633 # to the output being sufficiently large (Red Hat 4.1).
2634 # dotest basic1-18-add-ci "${testcvs} log" "${DOTSTAR}"
2635 if ${testcvs} -q log >>${LOGFILE}; then
2636 pass basic1-18-add-ci
2638 pass basic1-18-add-ci
2641 dotest basic1-21-add-ci "${testcvs} -q update" ''
2642 # See test basic1-18-add-ci for explanation of non-use of dotest.
2643 if ${testcvs} -q log first-dir >>${LOGFILE}; then
2644 pass basic1-22-add-ci
2646 pass basic1-22-add-ci
2648 # At least for the moment I am going to consider 17-add-ci
2649 # an adequate test of the output here.
2650 # See test basic1-18-add-ci for explanation of non-use of dotest.
2651 if ${testcvs} -q status first-dir >>${LOGFILE}; then
2652 pass basic1-23-add-ci
2654 pass basic1-23-add-ci
2656 dotest basic1-24-add-ci "${testcvs} -q update first-dir" ''
2657 dotest basic1-27-add-ci "${testcvs} -q co first-dir" ''
2660 rm file2 file3 file4 file5
2661 dotest basic1-14-rm-rm "${testcvs} rm file2 file3 file4 file5" \
2662 "${PROG} remove: scheduling .file2. for removal
2663 ${PROG} remove: scheduling .file3. for removal
2664 ${PROG} remove: scheduling .file4. for removal
2665 ${PROG} remove: scheduling .file5. for removal
2666 ${PROG} remove: use .${PROG} commit. to remove these files permanently"
2667 # 15-rm-rm was commented out. Why?
2668 dotest basic1-15-rm-rm \
2669 "${testcvs} -q update file2 file3 file4 file5" \
2674 dotest basic1-16-rm-rm "${testcvs} -q update" \
2679 dotest basic1-17-rm-rm "${testcvs} -q status" \
2680 "===================================================================
2681 File: no file file2 Status: Locally Removed
2683 Working revision: -1\.1.*
2684 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
2687 Sticky Options: (none)
2689 ===================================================================
2690 File: no file file3 Status: Locally Removed
2692 Working revision: -1\.1.*
2693 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file3,v
2696 Sticky Options: (none)
2698 ===================================================================
2699 File: no file file4 Status: Locally Removed
2701 Working revision: -1\.1.*
2702 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file4,v
2705 Sticky Options: (none)
2707 ===================================================================
2708 File: no file file5 Status: Locally Removed
2710 Working revision: -1\.1.*
2711 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file5,v
2714 Sticky Options: (none)"
2715 # Would be nice to test that real logs appear (with dead state
2716 # and all), either here or someplace like log2 tests.
2717 if ${testcvs} -q log >>${LOGFILE}; then
2718 pass basic1-18-rm-rm
2720 fail basic1-18-rm-rm
2723 dotest basic1-21-rm-rm "${testcvs} -q update" \
2728 if ${testcvs} -q log first-dir >>${LOGFILE}; then
2729 pass basic1-22-rm-rm
2731 fail basic1-22-rm-rm
2733 if ${testcvs} -q status first-dir >>${LOGFILE}; then
2734 pass basic1-23-rm-rm
2736 fail basic1-23-rm-rm
2738 dotest basic1-24-rm-rm "${testcvs} -q update first-dir" \
2743 dotest basic1-27-rm-rm "${testcvs} -q co first-dir" \
2749 dotest basic1-14-rm-ci "${testcvs} -q commit -m test" \
2751 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
2752 new revision: delete; previous revision: 1\.1
2755 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
2756 new revision: delete; previous revision: 1\.1
2759 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
2760 new revision: delete; previous revision: 1\.1
2763 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
2764 new revision: delete; previous revision: 1\.1
2766 dotest basic1-15-rm-ci \
2767 "${testcvs} -q update file2 file3 file4 file5" ''
2768 dotest basic1-16-rm-ci "${testcvs} -q update" ''
2769 dotest basic1-17-rm-ci "${testcvs} -q status" ''
2770 # Would be nice to test that real logs appear (with dead state
2771 # and all), either here or someplace like log2 tests.
2772 if ${testcvs} -q log >>${LOGFILE}; then
2773 pass basic1-18-rm-ci
2775 fail basic1-18-rm-ci
2778 dotest basic1-21-rm-ci "${testcvs} -q update" ''
2779 if ${testcvs} -q log first-dir >>${LOGFILE}; then
2780 pass basic1-22-rm-ci
2782 fail basic1-22-rm-ci
2784 if ${testcvs} -q status first-dir >>${LOGFILE}; then
2785 pass basic1-23-rm-ci
2787 fail basic1-23-rm-ci
2789 dotest basic1-24-rm-ci "${testcvs} -q update first-dir" ''
2790 dotest basic1-27-rm-ci "${testcvs} -q co first-dir" ''
2792 # All the files are removed, so nothing gets tagged.
2793 dotest basic1-28 "${testcvs} -q tag first-dive" ''
2798 echo Keeping ${TESTDIR} and exiting due to --keep
2803 rm -rf ${CVSROOT_DIRNAME}/first-dir
2807 # Test the ability to operate on directories nested rather deeply.
2808 mkdir ${CVSROOT_DIRNAME}/first-dir
2809 dotest deep-1 "${testcvs} -q co first-dir" ''
2811 for i in dir1 dir2 dir3 dir4 dir5 dir6 dir7 dir8; do
2813 dotest deep-2-$i "${testcvs} add $i" \
2814 "Directory ${CVSROOT_DIRNAME}/first-dir/dir1[/dir0-9]* added to the repository"
2817 dotest deep-3-$i "${testcvs} add file1" \
2818 "${PROG}"' add: scheduling file `file1'\'' for addition
2819 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
2821 cd ../../../../../../../../..
2822 dotest_lit deep-4 "${testcvs} -q ci -m add-them first-dir" <<HERE
2823 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file1,v
2825 Checking in first-dir/dir1/file1;
2826 ${CVSROOT_DIRNAME}/first-dir/dir1/file1,v <-- file1
2827 initial revision: 1.1
2829 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file1,v
2831 Checking in first-dir/dir1/dir2/file1;
2832 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file1,v <-- file1
2833 initial revision: 1.1
2835 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/file1,v
2837 Checking in first-dir/dir1/dir2/dir3/file1;
2838 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/file1,v <-- file1
2839 initial revision: 1.1
2841 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/file1,v
2843 Checking in first-dir/dir1/dir2/dir3/dir4/file1;
2844 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/file1,v <-- file1
2845 initial revision: 1.1
2847 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v
2849 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/file1;
2850 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
2851 initial revision: 1.1
2853 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v
2855 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1;
2856 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
2857 initial revision: 1.1
2859 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v
2861 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1;
2862 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
2863 initial revision: 1.1
2865 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v
2867 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1;
2868 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
2869 initial revision: 1.1
2873 cd first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
2875 dotest deep-4a0 "${testcvs} rm file1" \
2876 "${PROG} remove: scheduling .file1. for removal
2877 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
2878 dotest deep-4a1 "${testcvs} -q ci -m rm-it" "Removing file1;
2879 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
2880 new revision: delete; previous revision: 1\.1
2883 dotest deep-4a2 "${testcvs} -q update -P dir6/dir7" ''
2884 # Should be using "test -e" if that is portable enough.
2885 dotest_fail deep-4a3 "test -d dir6/dir7/dir8" ''
2887 # Test that if we remove the working directory, CVS does not
2888 # recreate it. (I realize that this behavior is what the
2889 # users expect, but in the longer run we might want to
2890 # re-think it. The corresponding behavior for a file is that
2891 # CVS *will* recreate it, and we might want to make it so
2892 # that "cvs release -d" is the way to delete the directory
2893 # and have it stay gone -kingdon, Oct1996).
2895 dotest deep-4b0a "${testcvs} -q diff" ''
2896 dotest deep-4b0b "${testcvs} -q ci" ''
2897 dotest deep-4b1 "${testcvs} -q update" ''
2898 dotest deep-4b2 "${testcvs} -q update -d -P" \
2902 # Test what happens if one uses -P when there are files removed
2903 # but not committed.
2905 dotest deep-rm1 "${testcvs} rm -f file1" \
2906 "${PROG} remove: scheduling .file1. for removal
2907 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
2909 dotest deep-rm2 "${testcvs} -q update -d -P" 'R dir7/file1'
2910 dotest deep-rm3 "test -d dir7" ''
2911 dotest deep-rm4 "${testcvs} -q ci -m rm-it" "Removing dir7/file1;
2912 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
2913 new revision: delete; previous revision: 1\.1
2915 dotest deep-rm5 "${testcvs} -q update -d -P" ''
2916 dotest_fail deep-rm6 "test -d dir7" ''
2920 dotest deep-rm7 "${testcvs} rm -f -R dir5" \
2921 "${PROG} remove: Removing dir5
2922 ${PROG} remove: scheduling .dir5/file1. for removal
2923 ${PROG} remove: Removing dir5/dir6
2924 ${PROG} remove: scheduling .dir5/dir6/file1. for removal
2925 ${PROG} remove: use .${PROG} commit. to remove these files permanently"
2926 dotest deep-rm8 "${testcvs} -q ci -m rm-it" \
2927 "Removing dir5/file1;
2928 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
2929 new revision: delete; previous revision: 1\.1
2931 Removing dir5/dir6/file1;
2932 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
2933 new revision: delete; previous revision: 1\.1
2935 dotest deep-rm9 "${testcvs} -q update -d -P" ''
2936 dotest_fail deep-rm10 "test -d dir5"
2940 if echo "yes" | ${testcvs} release -d first-dir >>${LOGFILE}; then
2945 rm -rf ${CVSROOT_DIRNAME}/first-dir
2949 # Test rtag, import, history, various miscellaneous operations
2951 # NOTE: this section has reached the size and
2952 # complexity where it is getting to be a good idea to
2953 # add new tests to a new section rather than
2954 # continuing to piggyback them onto the tests here.
2956 # First empty the history file
2957 rm ${CVSROOT_DIRNAME}/CVSROOT/history
2958 touch ${CVSROOT_DIRNAME}/CVSROOT/history
2960 ### XXX maybe should use 'cvs imprt -b1 -m new-module first-dir F F1' in an
2961 ### empty directory to do this instead of hacking directly into $CVSROOT
2962 mkdir ${CVSROOT_DIRNAME}/first-dir
2963 dotest basic2-1 "${testcvs} -q co first-dir" ''
2964 for i in first-dir dir1 dir2 ; do
2965 if test ! -d $i ; then
2967 dotest basic2-2-$i "${testcvs} add $i" \
2968 "Directory ${CVSROOT_DIRNAME}/.*/$i added to the repository"
2973 for j in file6 file7; do
2977 dotest basic2-3-$i "${testcvs} add file6 file7" \
2978 "${PROG} add: scheduling file .file6. for addition
2979 ${PROG} add: scheduling file .file7. for addition
2980 ${PROG} add: use .${PROG} commit. to add these files permanently"
2984 dotest basic2-4 "${testcvs} update first-dir" \
2985 "${PROG} update: Updating first-dir
2988 ${PROG} update: Updating first-dir/dir1
2989 A first-dir/dir1/file6
2990 A first-dir/dir1/file7
2991 ${PROG} update: Updating first-dir/dir1/dir2
2992 A first-dir/dir1/dir2/file6
2993 A first-dir/dir1/dir2/file7"
2995 # fixme: doesn't work right for added files.
2996 dotest basic2-5 "${testcvs} log first-dir" \
2997 "${PROG} log: Logging first-dir
2998 ${PROG} log: file6 has been added, but not committed
2999 ${PROG} log: file7 has been added, but not committed
3000 ${PROG} log: Logging first-dir/dir1
3001 ${PROG} log: file6 has been added, but not committed
3002 ${PROG} log: file7 has been added, but not committed
3003 ${PROG} log: Logging first-dir/dir1/dir2
3004 ${PROG} log: file6 has been added, but not committed
3005 ${PROG} log: file7 has been added, but not committed"
3007 dotest basic2-6 "${testcvs} status first-dir" \
3008 "${PROG} status: Examining first-dir
3009 ===================================================================
3010 File: file6 Status: Locally Added
3012 Working revision: New file!
3013 Repository revision: No revision control file
3016 Sticky Options: (none)
3018 ===================================================================
3019 File: file7 Status: Locally Added
3021 Working revision: New file!
3022 Repository revision: No revision control file
3025 Sticky Options: (none)
3027 ${PROG} status: Examining first-dir/dir1
3028 ===================================================================
3029 File: file6 Status: Locally Added
3031 Working revision: New file!
3032 Repository revision: No revision control file
3035 Sticky Options: (none)
3037 ===================================================================
3038 File: file7 Status: Locally Added
3040 Working revision: New file!
3041 Repository revision: No revision control file
3044 Sticky Options: (none)
3046 ${PROG} status: Examining first-dir/dir1/dir2
3047 ===================================================================
3048 File: file6 Status: Locally Added
3050 Working revision: New file!
3051 Repository revision: No revision control file
3054 Sticky Options: (none)
3056 ===================================================================
3057 File: file7 Status: Locally Added
3059 Working revision: New file!
3060 Repository revision: No revision control file
3063 Sticky Options: (none)"
3065 # XXX why is this commented out???
3066 # if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
3072 dotest basic2-8 "${testcvs} -q ci -m 'second dive' first-dir" \
3073 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
3075 Checking in first-dir/file6;
3076 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
3077 initial revision: 1\.1
3079 RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
3081 Checking in first-dir/file7;
3082 ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
3083 initial revision: 1\.1
3085 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
3087 Checking in first-dir/dir1/file6;
3088 ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v <-- file6
3089 initial revision: 1\.1
3091 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
3093 Checking in first-dir/dir1/file7;
3094 ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v <-- file7
3095 initial revision: 1\.1
3097 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
3099 Checking in first-dir/dir1/dir2/file6;
3100 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v <-- file6
3101 initial revision: 1\.1
3103 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
3105 Checking in first-dir/dir1/dir2/file7;
3106 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v <-- file7
3107 initial revision: 1\.1
3110 dotest basic2-9 "${testcvs} tag second-dive first-dir" \
3111 "${PROG} tag: Tagging first-dir
3114 ${PROG} tag: Tagging first-dir/dir1
3115 T first-dir/dir1/file6
3116 T first-dir/dir1/file7
3117 ${PROG} tag: Tagging first-dir/dir1/dir2
3118 T first-dir/dir1/dir2/file6
3119 T first-dir/dir1/dir2/file7"
3121 # third dive - in bunch o' directories, add bunch o' files,
3122 # delete some, change some.
3124 for i in first-dir dir1 dir2 ; do
3133 dotest basic2-10-$i "${testcvs} rm file7" \
3134 "${PROG} remove: scheduling .file7. for removal
3135 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
3137 # and add a new file
3140 dotest basic2-11-$i "${testcvs} add file14" \
3141 "${PROG} add: scheduling file .file14. for addition
3142 ${PROG} add: use .${PROG} commit. to add this file permanently"
3146 dotest basic2-12 "${testcvs} update first-dir" \
3147 "${PROG} update: Updating first-dir
3151 ${PROG} update: Updating first-dir/dir1
3152 A first-dir/dir1/file14
3153 M first-dir/dir1/file6
3154 R first-dir/dir1/file7
3155 ${PROG} update: Updating first-dir/dir1/dir2
3156 A first-dir/dir1/dir2/file14
3157 M first-dir/dir1/dir2/file6
3158 R first-dir/dir1/dir2/file7"
3160 # FIXME: doesn't work right for added files
3161 dotest basic2-13 "${testcvs} log first-dir" \
3162 "${PROG} log: Logging first-dir
3163 ${PROG} log: file14 has been added, but not committed
3165 RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
3166 Working file: first-dir/file6
3173 keyword substitution: kv
3174 total revisions: 1; selected revisions: 1
3176 ----------------------------
3178 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3180 =============================================================================
3182 RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
3183 Working file: first-dir/file7
3190 keyword substitution: kv
3191 total revisions: 1; selected revisions: 1
3193 ----------------------------
3195 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3197 =============================================================================
3198 ${PROG} log: Logging first-dir/dir1
3199 ${PROG} log: file14 has been added, but not committed
3201 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
3202 Working file: first-dir/dir1/file6
3209 keyword substitution: kv
3210 total revisions: 1; selected revisions: 1
3212 ----------------------------
3214 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3216 =============================================================================
3218 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
3219 Working file: first-dir/dir1/file7
3226 keyword substitution: kv
3227 total revisions: 1; selected revisions: 1
3229 ----------------------------
3231 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3233 =============================================================================
3234 ${PROG} log: Logging first-dir/dir1/dir2
3235 ${PROG} log: file14 has been added, but not committed
3237 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
3238 Working file: first-dir/dir1/dir2/file6
3245 keyword substitution: kv
3246 total revisions: 1; selected revisions: 1
3248 ----------------------------
3250 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3252 =============================================================================
3254 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
3255 Working file: first-dir/dir1/dir2/file7
3262 keyword substitution: kv
3263 total revisions: 1; selected revisions: 1
3265 ----------------------------
3267 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3269 ============================================================================="
3271 dotest basic2-14 "${testcvs} status first-dir" \
3272 "${PROG} status: Examining first-dir
3273 ===================================================================
3274 File: file14 Status: Locally Added
3276 Working revision: New file!
3277 Repository revision: No revision control file
3280 Sticky Options: (none)
3282 ===================================================================
3283 File: file6 Status: Locally Modified
3285 Working revision: 1\.1.*
3286 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file6,v
3289 Sticky Options: (none)
3291 ===================================================================
3292 File: no file file7 Status: Locally Removed
3294 Working revision: -1\.1.*
3295 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file7,v
3298 Sticky Options: (none)
3300 ${PROG} status: Examining first-dir/dir1
3301 ===================================================================
3302 File: file14 Status: Locally Added
3304 Working revision: New file!
3305 Repository revision: No revision control file
3308 Sticky Options: (none)
3310 ===================================================================
3311 File: file6 Status: Locally Modified
3313 Working revision: 1\.1.*
3314 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
3317 Sticky Options: (none)
3319 ===================================================================
3320 File: no file file7 Status: Locally Removed
3322 Working revision: -1\.1.*
3323 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
3326 Sticky Options: (none)
3328 ${PROG} status: Examining first-dir/dir1/dir2
3329 ===================================================================
3330 File: file14 Status: Locally Added
3332 Working revision: New file!
3333 Repository revision: No revision control file
3336 Sticky Options: (none)
3338 ===================================================================
3339 File: file6 Status: Locally Modified
3341 Working revision: 1\.1.*
3342 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
3345 Sticky Options: (none)
3347 ===================================================================
3348 File: no file file7 Status: Locally Removed
3350 Working revision: -1\.1.*
3351 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
3354 Sticky Options: (none)"
3356 # XXX why is this commented out?
3357 # if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
3363 dotest basic2-16 "${testcvs} ci -m 'third dive' first-dir" \
3364 "${PROG} [a-z]*: Examining first-dir
3365 ${PROG} [a-z]*: Examining first-dir/dir1
3366 ${PROG} [a-z]*: Examining first-dir/dir1/dir2
3367 RCS file: ${CVSROOT_DIRNAME}/first-dir/file14,v
3369 Checking in first-dir/file14;
3370 ${CVSROOT_DIRNAME}/first-dir/file14,v <-- file14
3371 initial revision: 1\.1
3373 Checking in first-dir/file6;
3374 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
3375 new revision: 1\.2; previous revision: 1\.1
3377 Removing first-dir/file7;
3378 ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
3379 new revision: delete; previous revision: 1\.1
3381 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file14,v
3383 Checking in first-dir/dir1/file14;
3384 ${CVSROOT_DIRNAME}/first-dir/dir1/file14,v <-- file14
3385 initial revision: 1\.1
3387 Checking in first-dir/dir1/file6;
3388 ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v <-- file6
3389 new revision: 1\.2; previous revision: 1\.1
3391 Removing first-dir/dir1/file7;
3392 ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v <-- file7
3393 new revision: delete; previous revision: 1\.1
3395 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v
3397 Checking in first-dir/dir1/dir2/file14;
3398 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v <-- file14
3399 initial revision: 1\.1
3401 Checking in first-dir/dir1/dir2/file6;
3402 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v <-- file6
3403 new revision: 1\.2; previous revision: 1\.1
3405 Removing first-dir/dir1/dir2/file7;
3406 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v <-- file7
3407 new revision: delete; previous revision: 1\.1
3409 dotest basic2-17 "${testcvs} -q update first-dir" ''
3411 dotest basic2-18 "${testcvs} tag third-dive first-dir" \
3412 "${PROG} tag: Tagging first-dir
3415 ${PROG} tag: Tagging first-dir/dir1
3416 T first-dir/dir1/file14
3417 T first-dir/dir1/file6
3418 ${PROG} tag: Tagging first-dir/dir1/dir2
3419 T first-dir/dir1/dir2/file14
3420 T first-dir/dir1/dir2/file6"
3422 dotest basic2-19 "echo yes | ${testcvs} release -d first-dir" \
3423 "You have \[0\] altered files in this repository\.
3424 Are you sure you want to release (and delete) directory .first-dir.: "
3427 dotest_fail basic2-20 "test -d first-dir" ""
3429 # now try some rtags
3432 dotest basic2-21 "${testcvs} rtag rtagged-by-head first-dir" \
3433 "${PROG} rtag: Tagging first-dir
3434 ${PROG} rtag: Tagging first-dir/dir1
3435 ${PROG} rtag: Tagging first-dir/dir1/dir2"
3438 dotest basic2-22 "${testcvs} rtag -r rtagged-by-head rtagged-by-tag first-dir" \
3439 "${PROG} rtag: Tagging first-dir
3440 ${PROG} rtag: Tagging first-dir/dir1
3441 ${PROG} rtag: Tagging first-dir/dir1/dir2"
3444 dotest basic2-23 "${testcvs} rtag -r1.1 rtagged-by-revision first-dir" \
3445 "${PROG} rtag: Tagging first-dir
3446 ${PROG} rtag: Tagging first-dir/dir1
3447 ${PROG} rtag: Tagging first-dir/dir1/dir2"
3450 dotest basic2-24 "${testcvs} rdiff -r1.1 -rrtagged-by-head first-dir" \
3451 "${PROG} rdiff: Diffing first-dir
3452 Index: first-dir/file6
3453 diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
3454 \*\*\* first-dir/file6:1\.1 ${DATE}
3455 --- first-dir/file6 ${DATE}
3456 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3461 Index: first-dir/file7
3462 diff -c first-dir/file7:1\.1 first-dir/file7:removed
3463 \*\*\* first-dir/file7:1.1 ${DATE}
3464 --- first-dir/file7 ${DATE}
3465 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3469 ${PROG} rdiff: Diffing first-dir/dir1
3470 Index: first-dir/dir1/file6
3471 diff -c first-dir/dir1/file6:1\.1 first-dir/dir1/file6:1\.2
3472 \*\*\* first-dir/dir1/file6:1\.1 ${DATE}
3473 --- first-dir/dir1/file6 ${DATE}
3474 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3479 Index: first-dir/dir1/file7
3480 diff -c first-dir/dir1/file7:1\.1 first-dir/dir1/file7:removed
3481 \*\*\* first-dir/dir1/file7:1\.1 ${DATE}
3482 --- first-dir/dir1/file7 ${DATE}
3483 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3487 ${PROG} rdiff: Diffing first-dir/dir1/dir2
3488 Index: first-dir/dir1/dir2/file6
3489 diff -c first-dir/dir1/dir2/file6:1\.1 first-dir/dir1/dir2/file6:1\.2
3490 \*\*\* first-dir/dir1/dir2/file6:1\.1 ${DATE}
3491 --- first-dir/dir1/dir2/file6 ${DATE}
3492 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3497 Index: first-dir/dir1/dir2/file7
3498 diff -c first-dir/dir1/dir2/file7:1\.1 first-dir/dir1/dir2/file7:removed
3499 \*\*\* first-dir/dir1/dir2/file7:1\.1 ${DATE}
3500 --- first-dir/dir1/dir2/file7 ${DATE}
3501 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3505 dotest basic2-24a "${testcvs} rdiff -l -r1.1 -rrtagged-by-head first-dir" \
3506 "${PROG} rdiff: Diffing first-dir
3507 Index: first-dir/file6
3508 diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
3509 \*\*\* first-dir/file6:1\.1 ${DATE}
3510 --- first-dir/file6 ${DATE}
3511 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3516 Index: first-dir/file7
3517 diff -c first-dir/file7:1\.1 first-dir/file7:removed
3518 \*\*\* first-dir/file7:1.1 ${DATE}
3519 --- first-dir/file7 ${DATE}
3520 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3524 # now export by rtagged-by-head and rtagged-by-tag and compare.
3525 dotest basic2-25 "${testcvs} export -r rtagged-by-head -d 1dir first-dir" \
3526 "${PROG} export: Updating 1dir
3529 ${PROG} export: Updating 1dir/dir1
3532 ${PROG} export: Updating 1dir/dir1/dir2
3533 U 1dir/dir1/dir2/file14
3534 U 1dir/dir1/dir2/file6"
3535 dotest_fail basic2-25a "test -d 1dir/CVS"
3536 dotest_fail basic2-25b "test -d 1dir/dir1/CVS"
3537 dotest_fail basic2-25c "test -d 1dir/dir1/dir2/CVS"
3539 dotest basic2-26 "${testcvs} export -r rtagged-by-tag first-dir" \
3540 "${PROG} export: Updating first-dir
3543 ${PROG} export: Updating first-dir/dir1
3544 U first-dir/dir1/file14
3545 U first-dir/dir1/file6
3546 ${PROG} export: Updating first-dir/dir1/dir2
3547 U first-dir/dir1/dir2/file14
3548 U first-dir/dir1/dir2/file6"
3549 dotest_fail basic2-26a "test -d first-dir/CVS"
3550 dotest_fail basic2-26b "test -d first-dir/dir1/CVS"
3551 dotest_fail basic2-26c "test -d first-dir/dir1/dir2/CVS"
3553 dotest basic2-27 "directory_cmp 1dir first-dir"
3554 rm -r 1dir first-dir
3556 # checkout by revision vs export by rtagged-by-revision and compare.
3558 dotest basic2-28 "${testcvs} export -rrtagged-by-revision -d export-dir first-dir" \
3559 "${PROG} export: Updating export-dir
3563 ${PROG} export: Updating export-dir/dir1
3564 U export-dir/dir1/file14
3565 U export-dir/dir1/file6
3566 U export-dir/dir1/file7
3567 ${PROG} export: Updating export-dir/dir1/dir2
3568 U export-dir/dir1/dir2/file14
3569 U export-dir/dir1/dir2/file6
3570 U export-dir/dir1/dir2/file7"
3571 dotest_fail basic2-28a "test -d export-dir/CVS"
3572 dotest_fail basic2-28b "test -d export-dir/dir1/CVS"
3573 dotest_fail basic2-28c "test -d export-dir/dir1/dir2/CVS"
3575 dotest basic2-29 "${testcvs} co -r1.1 first-dir" \
3576 "${PROG} checkout: Updating first-dir
3580 ${PROG} checkout: Updating first-dir/dir1
3581 U first-dir/dir1/file14
3582 U first-dir/dir1/file6
3583 U first-dir/dir1/file7
3584 ${PROG} checkout: Updating first-dir/dir1/dir2
3585 U first-dir/dir1/dir2/file14
3586 U first-dir/dir1/dir2/file6
3587 U first-dir/dir1/dir2/file7"
3589 # directory copies are done in an oblique way in order to avoid a bug in sun's tmp filesystem.
3590 mkdir first-dir.cpy ; (cd first-dir ; tar cf - . | (cd ../first-dir.cpy ; tar xf -))
3592 dotest basic2-30 "directory_cmp first-dir export-dir"
3594 # interrupt, while we've got a clean 1.1 here, let's import it
3595 # into a couple of other modules.
3597 dotest_sort basic2-31 "${testcvs} import -m first-import second-dir first-immigration immigration1 immigration1_0" \
3600 N second-dir/dir1/dir2/file14
3601 N second-dir/dir1/dir2/file6
3602 N second-dir/dir1/dir2/file7
3603 N second-dir/dir1/file14
3604 N second-dir/dir1/file6
3605 N second-dir/dir1/file7
3609 No conflicts created by this import
3610 ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/dir1
3611 ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/dir1/dir2"
3614 dotest basic2-32 "${testcvs} export -r HEAD second-dir" \
3615 "${PROG} export: Updating second-dir
3619 ${PROG} export: Updating second-dir/dir1
3620 U second-dir/dir1/file14
3621 U second-dir/dir1/file6
3622 U second-dir/dir1/file7
3623 ${PROG} export: Updating second-dir/dir1/dir2
3624 U second-dir/dir1/dir2/file14
3625 U second-dir/dir1/dir2/file6
3626 U second-dir/dir1/dir2/file7"
3628 dotest basic2-33 "directory_cmp first-dir second-dir"
3632 rm -r export-dir first-dir
3634 (cd first-dir.cpy ; tar cf - . | (cd ../first-dir ; tar xf -))
3636 # update the top, cancelling sticky tags, retag, update other copy, compare.
3638 dotest basic2-34 "${testcvs} update -A -l *file*" \
3640 ${PROG} update: file7 is no longer in the repository"
3642 # If we don't delete the tag first, cvs won't retag it.
3643 # This would appear to be a feature.
3644 dotest basic2-35 "${testcvs} tag -l -d rtagged-by-revision" \
3645 "${PROG} tag: Untagging \.
3648 dotest basic2-36 "${testcvs} tag -l rtagged-by-revision" \
3649 "${PROG} tag: Tagging \.
3655 mv first-dir.cpy first-dir
3658 dotest basic2-37 "${testcvs} -q diff -u" ''
3660 dotest basic2-38 "${testcvs} update" \
3661 "${PROG} update: Updating .
3662 ${PROG} update: Updating dir1
3663 ${PROG} update: Updating dir1/dir2"
3667 #### FIXME: is this expected to work??? Need to investigate
3668 #### and fix or remove the test.
3669 # dotest basic2-39 "directory_cmp 1dir first-dir"
3671 rm -r 1dir first-dir
3673 # Test the cvs history command.
3675 # The reason that there are two patterns rather than using
3676 # \(${TESTDIR}\|<remote>\) is that we are trying to
3677 # make this portable. Perhaps at some point we should
3678 # ditch that notion and require GNU expr (or dejagnu or....)
3679 # since it seems to be so painful.
3681 # why are there two lines at the end of the local output
3682 # which don't exist in the remote output? would seem to be
3684 dotest basic2-64 "${testcvs} his -x TOFWUPCGMAR -a" \
3685 "O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= ${TESTDIR}/\*
3686 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == ${TESTDIR}
3687 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == ${TESTDIR}
3688 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == ${TESTDIR}
3689 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == ${TESTDIR}
3690 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == ${TESTDIR}
3691 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == ${TESTDIR}
3692 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == ${TESTDIR}
3693 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TESTDIR}
3694 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TESTDIR}
3695 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == ${TESTDIR}
3696 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == ${TESTDIR}
3697 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == ${TESTDIR}
3698 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == ${TESTDIR}
3699 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == ${TESTDIR}
3700 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == ${TESTDIR}
3701 F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= ${TESTDIR}/\*
3702 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
3703 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
3704 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
3705 O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= ${TESTDIR}/\*
3706 U [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TESTDIR}/first-dir
3707 W [0-9-]* [0-9:]* ${PLUS}0000 ${username} file7 first-dir == ${TESTDIR}/first-dir" \
3708 "O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= <remote>/\*
3709 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == <remote>
3710 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == <remote>
3711 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == <remote>
3712 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == <remote>
3713 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == <remote>
3714 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == <remote>
3715 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == <remote>
3716 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
3717 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == <remote>
3718 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == <remote>
3719 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == <remote>
3720 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == <remote>
3721 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == <remote>
3722 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == <remote>
3723 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == <remote>
3724 F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= <remote>/\*
3725 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
3726 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
3727 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
3728 O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= <remote>/\*
3729 P [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
3730 W [0-9-]* [0-9:]* ${PLUS}0000 ${username} file7 first-dir == <remote>"
3732 rm -rf ${CVSROOT_DIRNAME}/first-dir
3733 rm -rf ${CVSROOT_DIRNAME}/second-dir
3738 # Test odd cases involving CVSROOT. At the moment, that means we
3739 # are testing roots with '/'s on the end, which CVS should parse off.
3740 CVSROOT_save=${CVSROOT}
3741 CVSROOT="${CVSROOT}/////"
3742 dotest parseroot-1 "${testcvs} -q co CVSROOT/modules" \
3744 dotest parseroot-2 "${testcvs} -q ci -fmnull-change CVSROOT/modules" \
3745 "Checking in CVSROOT/modules;
3746 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
3747 new revision: 1\.2; previous revision: 1\.1
3749 ${PROG} commit: Rebuilding administrative file database"
3752 # I only test these when testing remote in case CVS was compiled
3753 # without client support.
3755 # logout does not try to contact the server.
3756 CVSROOT=":pserver;proxy=localhost;proxyport=8080:localhost/dev/null"
3757 dotest parseroot-3r "$testcvs -d'$CVSROOT' logout" \
3758 "$PROG logout: WARNING: Ignoring method options found in CVSROOT: \`proxy=localhost;proxyport=8080'\.
3759 $PROG logout: Use CVS version 1\.12\.7 or later to handle method options\.
3760 Logging out of :pserver:$username@localhost:2401/dev/null
3761 $PROG logout: warning: failed to open $HOME/\.cvspass for reading: No such file or directory
3762 $PROG logout: Entry not found\."
3766 echo Keeping $TESTDIR and exiting due to --keep
3770 CVSROOT=$CVSROOT_save
3776 # Test of how we specify files on the command line
3777 # (recurse.c and that sort of thing). Vaguely similar to
3778 # tests like basic* and deep. See modules and such tests
3779 # for what happens when we throw in modules and co -d, &c.
3781 # This particular test is fairly carefully crafted, to spot
3782 # one particular issue with remote.
3784 dotest files-1 "${testcvs} -q co -l ." ""
3786 dotest files-2 "${testcvs} add first-dir" \
3787 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
3790 dotest files-3 "${testcvs} add tfile" \
3791 "${PROG} add: scheduling file .tfile. for addition
3792 ${PROG} add: use .${PROG} commit. to add this file permanently"
3793 dotest files-4 "${testcvs} -q ci -m add" \
3794 "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
3797 ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
3798 initial revision: 1\.1
3800 dotest files-5 "${testcvs} -q tag -b C" "T tfile"
3801 dotest files-6 "${testcvs} -q update -r C" ""
3803 dotest files-7 "${testcvs} add dir" \
3804 "Directory ${CVSROOT_DIRNAME}/first-dir/dir added to the repository
3805 --> Using per-directory sticky tag .C'"
3808 dotest files-6 "${testcvs} add .file" \
3809 "${PROG} add: scheduling file .\.file' for addition on branch .C.
3810 ${PROG} add: use .${PROG} commit. to add this file permanently"
3812 dotest files-7 "${testcvs} add sdir" \
3813 "Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir added to the repository
3814 --> Using per-directory sticky tag .C'"
3817 dotest files-8 "${testcvs} add ssdir" \
3818 "Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir added to the repository
3819 --> Using per-directory sticky tag .C'"
3822 dotest files-9 "${testcvs} add .file" \
3823 "${PROG} add: scheduling file .\.file' for addition on branch .C.
3824 ${PROG} add: use .${PROG} commit. to add this file permanently"
3826 dotest files-10 "${testcvs} -q ci -m test" \
3827 "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v
3830 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
3831 new revision: 1\.1\.2\.1; previous revision: 1\.1
3833 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v
3835 Checking in sdir/ssdir/\.file;
3836 ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
3837 new revision: 1\.1\.2\.1; previous revision: 1\.1
3840 "${testcvs} commit -m test -f ./.file ./sdir/ssdir/.file" \
3841 "Checking in \.file;
3842 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
3843 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
3845 Checking in \./sdir/ssdir/\.file;
3846 ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
3847 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
3850 # This is a bug, looks like that toplevel_repos cruft in
3851 # client.c is coming back to haunt us.
3852 # May want to think about the whole issue, toplevel_repos
3853 # has always been crufty and trying to patch it up again
3854 # might be a mistake.
3855 dotest_fail files-12 \
3856 "${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
3857 "${PROG} commit: Up-to-date check failed for .\.file'
3858 ${PROG} \[commit aborted\]: correct above errors first!"
3860 # Sync up the version numbers so that the rest of the
3861 # tests don't need to expect different numbers based
3863 dotest files-12-workaround \
3864 "${testcvs} commit -f -m test sdir/ssdir/.file .file" \
3865 "Checking in sdir/ssdir/\.file;
3866 ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
3867 new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
3870 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
3871 new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
3875 "${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
3876 "Checking in \./sdir/ssdir/\.file;
3877 ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
3878 new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
3881 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
3882 new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
3886 "${testcvs} commit -fmtest ./sdir/../sdir/ssdir/..///ssdir/.file" \
3887 "Checking in \./sdir/\.\./sdir/ssdir/\.\.///ssdir/\.file;
3888 ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
3889 new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
3893 "${testcvs} commit -fmtest ../../first-dir/dir/.file" \
3894 "Checking in \.\./\.\./first-dir/dir/\.file;
3895 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- .file
3896 new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
3900 "${testcvs} commit -fmtest ../../first-dir/dir/.file" \
3901 "Checking in \.\./\.\./first-dir/dir/\.file;
3902 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
3903 new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
3909 rm -rf ${CVSROOT_DIRNAME}/first-dir
3913 # More filename tests, in particular spaces in file names.
3914 # (it might be better to just change a few of the names in
3915 # basica or some other test instead, always good to keep the
3916 # testsuite concise).
3919 dotest spacefiles-1 "${testcvs} -q co -l ." ""
3921 dotest spacefiles-2 "${testcvs} add -- -c" \
3922 "${PROG} add: scheduling file .-c. for addition
3923 ${PROG} add: use .${PROG} commit. to add this file permanently"
3924 dotest spacefiles-3 "${testcvs} -q ci -m add" \
3925 "RCS file: ${CVSROOT_DIRNAME}/-c,v
3928 ${CVSROOT_DIRNAME}/-c,v <-- -c
3929 initial revision: 1\.1
3932 dotest spacefiles-4 "${testcvs} add 'first dir'" \
3933 "Directory ${CVSROOT_DIRNAME}/first dir added to the repository"
3935 dotest spacefiles-5 "${testcvs} add -- -b" \
3936 "Directory ${CVSROOT_DIRNAME}/-b added to the repository"
3939 dotest spacefiles-6 "${testcvs} add 'a file'" \
3940 "${PROG} add: scheduling file .a file. for addition
3941 ${PROG} add: use .${PROG} commit. to add this file permanently"
3942 dotest spacefiles-7 "${testcvs} -q ci -m add" \
3943 "RCS file: ${CVSROOT_DIRNAME}/first dir/a file,v
3946 ${CVSROOT_DIRNAME}/first dir/a file,v <-- a file
3947 initial revision: 1\.1
3949 dotest spacefiles-8 "${testcvs} -q tag new-tag" "T a file"
3953 dotest spacefiles-10 "${testcvs} co -- -b" \
3954 "${PROG} checkout: Updating -b"
3955 dotest spacefiles-11 "${testcvs} -q co -- -c" "U \./-c"
3957 dotest spacefiles-13 "${testcvs} -q co 'first dir'" \
3958 "U first dir/a file"
3962 dotest spacefiles-14 "${testcvs} -q co 'first dir/a file'" \
3963 "U first dir/a file"
3967 rm -rf "${CVSROOT_DIRNAME}/first dir"
3968 rm -r ${CVSROOT_DIRNAME}/-b
3969 rm -f ${CVSROOT_DIRNAME}/-c,v
3977 dotest commit-readonly-1 "$testcvs -Q import -m . $module X Y" ''
3978 dotest commit-readonly-2 "$testcvs -Q co $module" ''
3983 # Include an rcs keyword to be expanded.
3984 echo '$Id''$' > $file
3986 dotest commit-readonly-3 "$testcvs add $file" \
3987 "${PROG} add: scheduling file .$file. for addition
3988 ${PROG} add: use .${PROG} commit. to add this file permanently"
3989 dotest commit-readonly-4 "$testcvs -Q ci -m . $file" \
3990 "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
3993 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
3994 initial revision: 1\.1
3998 # Make the file read-only.
4001 dotest commit-readonly-5 "$testcvs -Q ci -m . $file" \
4003 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
4004 new revision: 1\.2; previous revision: 1\.1
4009 rm -rf ${CVSROOT_DIRNAME}/$module
4013 # This tests for a bug in the status command which failed to
4014 # notice resolved conflicts.
4015 mkdir status; cd status
4016 dotest status-init-1 "${testcvs} -q co -l ." ""
4018 dotest status-init-2 "${testcvs} add first-dir" \
4019 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
4022 dotest status-init-3 "${testcvs} add tfile" \
4023 "${PROG} add: scheduling file .tfile. for addition
4024 ${PROG} add: use .${PROG} commit. to add this file permanently"
4025 dotest status-init-4 "${testcvs} -q ci -m add" \
4026 "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
4029 ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
4030 initial revision: 1\.1
4033 dotest status-init-5 "${testcvs} -q co -dsecond-dir first-dir" \
4034 "U second-dir/tfile"
4036 echo some junk >>tfile
4037 dotest status-init-6 "${testcvs} -q ci -maline" \
4039 ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
4040 new revision: 1\.2; previous revision: 1\.1
4043 echo force a conflict >>tfile
4044 dotest status-init-7 "${testcvs} -q up" \
4045 "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
4046 retrieving revision 1\.1
4047 retrieving revision 1\.2
4048 Merging differences between 1\.1 and 1\.2 into tfile
4049 rcsmerge: warning: conflicts during merge
4050 ${PROG} update: conflicts found in tfile
4053 # Now note our status
4054 dotest status-1 "${testcvs} status tfile" \
4055 "===================================================================
4056 File: tfile Status: File had conflicts on merge
4058 Working revision: 1\.2.*
4059 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
4062 Sticky Options: (none)"
4064 # touch the file, leaving conflict markers in place
4065 # and note our status
4067 dotest status-2 "${testcvs} status tfile" \
4068 "===================================================================
4069 File: tfile Status: File had conflicts on merge
4071 Working revision: 1\.2.*
4072 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
4075 Sticky Options: (none)"
4077 # resolve the conflict
4078 echo resolution >tfile
4079 dotest status-3 "${testcvs} status tfile" \
4080 "===================================================================
4081 File: tfile Status: Locally Modified
4083 Working revision: 1\.2.*
4084 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
4087 Sticky Options: (none)"
4090 # Update is supposed to re-Register() the file when it
4091 # finds resolved conflicts:
4092 dotest status-4 "grep 'Result of merge' CVS/Entries" \
4093 "/tfile/1\.2/Result of merge${PLUS}[a-zA-Z0-9 :]*//"
4097 dotest status-init-8 "$testcvs add fourth-dir" \
4098 "Directory $CVSROOT_DIRNAME/fourth-dir added to the repository"
4100 echo yet another line >t3file
4101 dotest status-init-9 "$testcvs add t3file" \
4102 "$PROG add: scheduling file .t3file. for addition
4103 $PROG add: use .$PROG commit. to add this file permanently"
4104 dotest status-init-10 "$testcvs -q ci -m add" \
4105 "RCS file: $CVSROOT_DIRNAME/fourth-dir/t3file,v
4108 $CVSROOT_DIRNAME/fourth-dir/t3file,v <-- t3file
4109 initial revision: 1\.1
4113 dotest status-init-11 "$testcvs add third-dir" \
4114 "Directory $CVSROOT_DIRNAME/first-dir/third-dir added to the repository"
4116 echo another line >t2file
4117 dotest status-init-12 "$testcvs add t2file" \
4118 "$PROG add: scheduling file .t2file. for addition
4119 $PROG add: use .$PROG commit. to add this file permanently"
4120 dotest status-init-13 "$testcvs -q ci -m add" \
4121 "RCS file: $CVSROOT_DIRNAME/first-dir/third-dir/t2file,v
4124 $CVSROOT_DIRNAME/first-dir/third-dir/t2file,v <-- t2file
4125 initial revision: 1\.1
4127 dotest status-5 "$testcvs status ../tfile" \
4128 "===================================================================
4129 File: tfile Status: Locally Modified
4131 Working revision: 1\.2.*
4132 Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/tfile,v
4135 Sticky Options: (none)"
4136 dotest status-6 "$testcvs status ../../fourth-dir/t3file" \
4137 "===================================================================
4138 File: t3file Status: Up-to-date
4140 Working revision: 1\.1.*
4141 Repository revision: 1\.1 $CVSROOT_DIRNAME/fourth-dir/t3file,v
4144 Sticky Options: (none)"
4147 echo Keeping $TESTDIR and exiting due to --keep
4153 rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/fourth-dir
4158 # XXX for now this is just the most essential test...
4164 echo '$''Name$' >> foo
4166 echo '$''Name$' >> bar
4167 dotest_sort rdiff-1 \
4168 "${testcvs} import -I ! -m test-import-with-keyword trdiff TRDIFF T1" \
4173 No conflicts created by this import'
4175 "${testcvs} co -ko trdiff" \
4176 "${PROG} checkout: Updating trdiff
4180 echo something >> foo
4182 "${testcvs} ci -m added-something foo" \
4184 ${CVSROOT_DIRNAME}/trdiff/foo,v <-- foo
4185 new revision: 1\.2; previous revision: 1\.1
4187 echo '#ident "@(#)trdiff:$''Name$:$''Id$"' > new
4188 echo "new file" >> new
4190 "${testcvs} add -m new-file-description new" \
4191 "${PROG} add: scheduling file \`new' for addition
4192 ${PROG} add: use .${PROG} commit. to add this file permanently"
4194 "${testcvs} commit -m added-new-file new" \
4195 "RCS file: ${CVSROOT_DIRNAME}/trdiff/new,v
4198 ${CVSROOT_DIRNAME}/trdiff/new,v <-- new
4199 initial revision: 1\.1
4202 "${testcvs} tag local-v0" \
4203 "${PROG} tag: Tagging .
4208 "${testcvs} status -v foo" \
4209 "===================================================================
4210 File: foo Status: Up-to-date
4212 Working revision: 1\.2.*
4213 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/trdiff/foo,v
4219 local-v0 (revision: 1\.2)
4220 T1 (revision: 1\.1\.1\.1)
4221 TRDIFF (branch: 1\.1\.1)"
4227 "${testcvs} rdiff -r T1 -r local-v0 trdiff" \
4228 "${PROG}"' rdiff: Diffing trdiff
4230 diff -c trdiff/foo:1\.1\.1\.1 trdiff/foo:1\.2
4231 \*\*\* trdiff/foo:1\.1\.1\.1 '"${DATE}"'
4232 --- trdiff/foo '"${DATE}"'
4233 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4235 ! \$''Id: foo,v 1\.1\.1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$
4238 ! \$''Id: foo,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
4239 ! \$''Name: local-v0 \$
4242 diff -c /dev/null trdiff/new:1\.1
4243 \*\*\* /dev/null '"${DATE}"'
4244 --- trdiff/new '"${DATE}"'
4245 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4248 '"${PLUS}"' #ident "@(#)trdiff:\$''Name: local-v0 \$:\$''Id: new,v 1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$"
4249 '"${PLUS}"' new file'
4252 echo Keeping ${TESTDIR} and exiting due to --keep
4258 rm -rf ${CVSROOT_DIRNAME}/trdiff
4262 # Test that the short patch behaves as expected
4265 # 3) Different revision number with no difference.
4266 # 4) Different revision number with changes.
4268 # 6) Same revision number (no difference).
4269 mkdir rdiff-short; cd rdiff-short
4271 dotest rdiff-short-init-1 \
4272 "${testcvs} -q import -I ! -m initial-import abc vendor initial" \
4274 No conflicts created by this import'
4276 dotest rdiff-short-init-2 "${testcvs} -q get abc" ''
4278 echo "abc" >file1.txt
4279 dotest rdiff-short-init-3 "${testcvs} add file1.txt" \
4280 "${PROG} add: scheduling file .file1\.txt' for addition
4281 ${PROG} add: use .${PROG} commit. to add this file permanently"
4282 dotest rdiff-short-init-4 \
4283 "${testcvs} commit -madd-file1 file1.txt" \
4284 "RCS file: ${CVSROOT_DIRNAME}/abc/file1\.txt,v
4286 Checking in file1\.txt;
4287 ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
4288 initial revision: 1\.1
4290 echo def >>file1.txt
4291 dotest rdiff-short-init-5 \
4292 "${testcvs} commit -mchange-file1 file1.txt" \
4293 "Checking in file1\.txt;
4294 ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
4295 new revision: 1\.2; previous revision: 1\.1
4297 echo "abc" >file1.txt
4298 dotest rdiff-short-init-6 \
4299 "${testcvs} commit -mrestore-file1-rev1 file1.txt" \
4300 "Checking in file1\.txt;
4301 ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
4302 new revision: 1\.3; previous revision: 1\.2
4304 dotest rdiff-short-init-7 \
4305 "${testcvs} tag -r 1.1 tag1 file1.txt" \
4307 dotest rdiff-short-init-8 \
4308 "${testcvs} tag -r 1.2 tag2 file1.txt" \
4310 dotest rdiff-short-init-9 \
4311 "${testcvs} tag -r 1.3 tag3 file1.txt" \
4313 echo "abc" >file2.txt
4314 dotest rdiff-short-init-10 \
4315 "${testcvs} add file2.txt" \
4316 "${PROG} add: scheduling file .file2\.txt' for addition
4317 ${PROG} add: use .${PROG} commit. to add this file permanently"
4318 dotest rdiff-add-remove-nodiff-init-11 \
4319 "${testcvs} commit -madd-file2 file2.txt" \
4320 "RCS file: ${CVSROOT_DIRNAME}/abc/file2\.txt,v
4322 Checking in file2\.txt;
4323 ${CVSROOT_DIRNAME}/abc/file2\.txt,v <-- file2\.txt
4324 initial revision: 1\.1
4326 dotest rdiff-short-init-12 \
4327 "${testcvs} tag -r 1.1 tag4 file2.txt" \
4329 dotest rdiff-short-init-13 \
4330 "${testcvs} tag -r 1.1 tag5 file2.txt" \
4335 # 3) Different revision number with no difference.
4336 dotest rdiff-short-no-real-change \
4337 "${testcvs} -q rdiff -s -r tag1 -r tag3 abc"
4339 # 4) Different revision number with changes.
4340 dotest rdiff-short-real-change \
4341 "${testcvs} -q rdiff -s -r tag1 -r tag2 abc" \
4342 'File abc/file1.txt changed from revision 1\.1 to 1\.2'
4346 dotest_sort rdiff-short-remove-add \
4347 "${testcvs} -q rdiff -s -r tag2 -r tag4 abc" \
4348 'File abc/file1\.txt is removed; tag2 revision 1\.2
4349 File abc/file2\.txt is new; tag4 revision 1\.1'
4351 # 6) Same revision number (no difference).
4352 dotest rdiff-short-no-change \
4353 "${testcvs} -q rdiff -s -r tag4 -r tag5 abc"
4356 # Check that the messages change when we diff against the trunk
4357 # rather than a tag or date.
4358 dotest rdiff-short-against-trunk-1 \
4359 "${testcvs} -q rdiff -s -rtag4 abc" \
4360 "File abc/file1\.txt is new; current revision 1\.3"
4362 dotest rdiff-short-against-trunk-2 \
4363 "${testcvs} -q rdiff -s -rtag2 abc" \
4364 "File abc/file1\.txt changed from revision 1\.2 to 1\.3
4365 File abc/file2\.txt is new; current revision 1\.1"
4367 rm -rf ${CVSROOT_DIRNAME}/abc
4371 # Test for the segv problem reported by James Cribb
4373 mkdir rdiff2; cd rdiff2
4374 # Create a module "m" with files "foo" and "d/bar"
4379 dotest_sort rdiff2-1 \
4380 "${testcvs} -q import -I ! -m initial-import m vendor initial" \
4385 No conflicts created by this import'
4391 dotest rdiff2-2 "${testcvs} get m" \
4392 "${PROG} checkout: Updating m
4394 ${PROG} checkout: Updating m/d
4397 dotest rdiff2-3 "${testcvs} rm -f foo" \
4398 "${PROG} remove: scheduling .foo. for removal
4399 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
4401 dotest rdiff2-4 "${testcvs} commit -m Removed foo" \
4403 ${CVSROOT_DIRNAME}/m/foo,v <-- foo
4404 new revision: delete; previous revision: 1\.1\.1\.1
4409 dotest rdiff2-5 "${testcvs} commit -m Changed d/bar" \
4411 ${CVSROOT_DIRNAME}/m/d/bar,v <-- bar
4412 new revision: 1\.2; previous revision: 1\.1
4415 # Crash before showing d/bar diffs
4416 dotest_fail rdiff2-6 "${testcvs} rdiff -t m" \
4417 "${PROG} rdiff: Diffing m
4418 ${PROG} rdiff: Diffing m/d
4420 diff -c m/d/bar:1\.1\.1\.1 m/d/bar:1\.2
4421 \*\*\* m/d/bar:1\.1\.1\.1 ${DATE}
4423 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4429 echo Keeping ${TESTDIR} and exiting due to --keep
4434 rm -rf ${CVSROOT_DIRNAME}/m
4438 # Various tests specific to the "cvs diff" command.
4441 # rcslib: cvs diff and $Name.
4443 # diffmerge*: nuts and bolts (stuff within diff library)
4445 dotest diff-1 "${testcvs} -q co -l ." ''
4447 dotest diff-2 "${testcvs} add first-dir" \
4448 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
4451 # diff is anomalous. Most CVS commands print the "nothing
4452 # known" message (or worse yet, no message in some cases) but
4453 # diff says "I know nothing". Shrug.
4454 dotest_fail diff-3 "${testcvs} diff xyzpdq" \
4455 "${PROG} diff: I know nothing about xyzpdq"
4457 dotest diff-4 "${testcvs} add abc" \
4458 "${PROG} add: scheduling file .abc. for addition
4459 ${PROG} add: use .${PROG} commit. to add this file permanently"
4460 dotest diff-5 "${testcvs} -q ci -mtest" \
4461 "RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4464 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
4465 initial revision: 1\.1
4467 echo "extern int gethostname ();" >abc
4468 dotest diff-6 "${testcvs} -q ci -mtest" \
4470 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
4471 new revision: 1\.2; previous revision: 1\.1
4473 echo "#include <winsock.h>" >abc
4474 # check the behavior of the --ifdef=MACRO option
4475 dotest_fail diff-7 "${testcvs} -q diff --ifdef=HAVE_WINSOCK_H" \
4477 ===================================================================
4478 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4479 retrieving revision 1\.2
4480 diff --ifdef=HAVE_WINSOCK_H -r1\.2 abc
4481 #ifndef HAVE_WINSOCK_H
4482 extern int gethostname ();
4483 #else /\* HAVE_WINSOCK_H \*/
4484 #include <winsock\.h>
4485 #endif /\* HAVE_WINSOCK_H \*/"
4488 echo Keeping ${TESTDIR} and exiting due to --keep
4493 rm -rf ${CVSROOT_DIRNAME}/first-dir
4498 # Test handling of 'cvs diff' of files without newlines
4500 dotest diffnl-000 "${testcvs} -q co -l ." ''
4502 dotest diffnl-001 "${testcvs} add first-dir" \
4503 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
4506 ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nfive\nsix")}' </dev/null >abc
4507 dotest diffnl-002 "${testcvs} add abc" \
4508 "${PROG} add: scheduling file .abc. for addition
4509 ${PROG} add: use .${PROG} commit. to add this file permanently"
4510 dotest diffnl-003 "${testcvs} -q ci -mtest" \
4511 "RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4514 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
4515 initial revision: 1\.1
4518 # change to line near EOF
4519 ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nsix")}' </dev/null >abc
4520 dotest_fail diffnl-100 "${testcvs} diff abc" \
4522 ===================================================================
4523 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4524 retrieving revision 1\.1
4528 dotest_fail diffnl-101 "${testcvs} diff -u abc" \
4530 ===================================================================
4531 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4532 retrieving revision 1\.1
4534 --- abc ${RFCDATE} 1\.1
4542 \\\\ No newline at end of file"
4543 dotest diffnl-102 "${testcvs} -q ci -mtest abc" \
4545 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
4546 new revision: 1\.2; previous revision: 1\.1
4549 # Change to last line
4550 ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nseven")}' </dev/null >abc
4551 dotest_fail diffnl-200 "${testcvs} diff abc" \
4553 ===================================================================
4554 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4555 retrieving revision 1\.2
4559 \\\\ No newline at end of file
4562 \\\\ No newline at end of file"
4563 dotest_fail diffnl-201 "${testcvs} diff -u abc" \
4565 ===================================================================
4566 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4567 retrieving revision 1\.2
4569 --- abc ${RFCDATE} 1\.2
4576 \\\\ No newline at end of file
4578 \\\\ No newline at end of file"
4579 dotest diffnl-202 "${testcvs} ci -mtest abc" \
4581 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
4582 new revision: 1\.3; previous revision: 1\.2
4585 # Addition of newline
4591 dotest_fail diffnl-300 "${testcvs} diff abc" \
4593 ===================================================================
4594 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4595 retrieving revision 1\.3
4599 \\\\ No newline at end of file
4602 dotest_fail diffnl-301 "${testcvs} diff -u abc" \
4604 ===================================================================
4605 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4606 retrieving revision 1\.3
4608 --- abc ${RFCDATE} 1\.3
4615 \\\\ No newline at end of file
4617 dotest diffnl-302 "${testcvs} ci -mtest abc" \
4619 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
4620 new revision: 1\.4; previous revision: 1\.3
4623 # Removal of newline
4624 ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nseven")}' </dev/null >abc
4625 dotest_fail diffnl-400 "${testcvs} diff abc" \
4627 ===================================================================
4628 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4629 retrieving revision 1\.4
4635 \\\\ No newline at end of file"
4636 dotest_fail diffnl-401 "${testcvs} diff -u abc" \
4638 ===================================================================
4639 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4640 retrieving revision 1\.4
4642 --- abc ${RFCDATE} 1\.4
4650 \\\\ No newline at end of file"
4654 rm -rf ${CVSROOT_DIRNAME}/first-dir
4658 # next dive. test death support.
4660 # NOTE: this section has reached the size and
4661 # complexity where it is getting to be a good idea to
4662 # add new death support tests to a new section rather
4663 # than continuing to piggyback them onto the tests here.
4665 mkdir ${CVSROOT_DIRNAME}/first-dir
4666 if ${CVS} co first-dir ; then
4674 # Create a directory with only dead files, to make sure CVS
4675 # doesn't get confused by it.
4677 dotest 65a0 "${testcvs} add subdir" \
4678 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
4680 echo file in subdir >sfile
4681 dotest 65a1 "${testcvs} add sfile" \
4682 "${PROG}"' add: scheduling file `sfile'\'' for addition
4683 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
4684 dotest 65a2 "${testcvs} -q ci -m add-it" \
4685 "RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v
4688 ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
4689 initial revision: 1\.1
4692 dotest 65a3 "${testcvs} rm sfile" \
4693 "${PROG}"' remove: scheduling `sfile'\'' for removal
4694 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
4695 dotest 65a4 "${testcvs} -q ci -m remove-it" \
4697 ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
4698 new revision: delete; previous revision: 1\.1
4701 dotest 65a5 "${testcvs} -q update -P" ''
4702 dotest_fail 65a6 "test -d subdir" ''
4706 if ${CVS} add file1 2>> ${LOGFILE}; then
4713 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
4721 if ${CVS} rm file1 2>> ${LOGFILE}; then
4728 if ${CVS} ci -m test >>${LOGFILE} ; then
4734 dotest_fail 69a0 "test -f file1" ''
4735 # get the old contents of file1 back
4736 if ${testcvs} update -p -r 1.1 file1 >file1 2>>${LOGFILE}; then
4741 dotest 69a2 "cat file1" ''
4743 # create second file
4745 if ${CVS} add file1 file2 2>> ${LOGFILE}; then
4752 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
4759 if ${CVS} log file1 >> ${LOGFILE}; then
4765 # file4 will be dead at the time of branching and stay dead.
4767 dotest death-file4-add "${testcvs} add file4" \
4768 "${PROG}"' add: scheduling file `file4'\'' for addition
4769 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
4770 dotest death-file4-ciadd "${testcvs} -q ci -m add file4" \
4771 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
4774 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
4775 initial revision: 1\.1
4778 dotest death-file4-rm "${testcvs} remove file4" \
4779 "${PROG}"' remove: scheduling `file4'\'' for removal
4780 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
4781 dotest death-file4-cirm "${testcvs} -q ci -m remove file4" \
4783 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
4784 new revision: delete; previous revision: 1\.1
4787 # Tag the branchpoint.
4788 dotest death-72a "${testcvs} -q tag bp_branch1" 'T file1
4792 if ${CVS} tag -b branch1 ; then
4798 # and move to the branch.
4799 if ${CVS} update -r branch1 ; then
4805 dotest_fail death-file4-3 "test -f file4" ''
4807 # add a file in the branch
4808 echo line1 from branch1 >> file3
4809 if ${CVS} add file3 2>> ${LOGFILE}; then
4816 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
4823 "${testcvs} -q rdiff -r bp_branch1 -r branch1 first-dir" \
4824 "Index: first-dir/file3
4825 diff -c /dev/null first-dir/file3:1\.1\.2\.1
4826 \*\*\* /dev/null ${DATE}
4827 --- first-dir/file3 ${DATE}
4828 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4831 ${PLUS} line1 from branch1"
4833 "${testcvs} -q rdiff -r branch1 -r bp_branch1 first-dir" \
4834 "Index: first-dir/file3
4835 diff -c first-dir/file3:1\.1\.2\.1 first-dir/file3:removed
4836 \*\*\* first-dir/file3:1\.1\.2\.1 ${DATE}
4837 --- first-dir/file3 ${DATE}
4838 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4840 - line1 from branch1
4845 if ${CVS} rm file3 2>> ${LOGFILE}; then
4852 if ${CVS} ci -m test >>${LOGFILE} ; then
4859 echo line1 from branch1 >> file3
4860 if ${CVS} add file3 2>> ${LOGFILE}; then
4867 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
4873 # change the first file
4874 echo line2 from branch1 >> file1
4877 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
4885 if ${CVS} rm file2 2>> ${LOGFILE}; then
4892 if ${CVS} ci -m test >>${LOGFILE}; then
4898 # back to the trunk.
4899 if ${CVS} update -A 2>> ${LOGFILE}; then
4905 dotest_fail death-file4-4 "test -f file4" ''
4907 if test -f file3 ; then
4914 dotest 86 "${testcvs} -q update -j branch1" \
4915 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
4916 retrieving revision 1\.3
4917 retrieving revision 1\.3\.2\.1
4918 Merging differences between 1\.3 and 1\.3\.2\.1 into file1
4919 ${PROG} update: scheduling file2 for removal
4922 dotest_fail death-file4-5 "test -f file4" ''
4924 if test -f file3 ; then
4930 # Make sure that we joined the correct change to file1
4931 if echo line2 from branch1 | cmp - file1 >/dev/null; then
4938 if ${CVS} update ; then
4945 dotest 89 "${testcvs} -q ci -m test" \
4947 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
4948 new revision: 1\.4; previous revision: 1\.3
4951 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
4952 new revision: delete; previous revision: 1\.1
4955 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
4956 new revision: 1\.2; previous revision: 1\.1
4961 dotest 89a "${testcvs} -q co first-dir" 'U first-dir/file1
4967 # remove first file.
4969 if ${CVS} rm file1 2>> ${LOGFILE}; then
4976 if ${CVS} ci -m test >>${LOGFILE}; then
4982 if test -f file1 ; then
4988 # typo; try to get to the branch and fail
4989 dotest_fail 92.1a "${testcvs} update -r brnach1" \
4990 "${PROG}"' \[update aborted\]: no such tag brnach1'
4991 # Make sure we are still on the trunk
4992 if test -f file1 ; then
4997 if test -f file3 ; then
5004 if ${CVS} update -r branch1 2>> ${LOGFILE}; then
5010 dotest_fail death-file4-6 "test -f file4" ''
5012 if test -f file1 ; then
5019 dotest 95 "${testcvs} -q update -j HEAD" \
5020 "${PROG}"' update: file file1 has been modified, but has been removed in revision HEAD
5021 '"${PROG}"' update: file file3 exists, but has been added in revision HEAD'
5023 dotest_fail death-file4-7 "test -f file4" ''
5025 # file2 should not have been recreated. It was
5026 # deleted on the branch, and has not been modified on
5027 # the trunk. That means that there have been no
5028 # changes between the greatest common ancestor (the
5029 # trunk version) and HEAD.
5030 dotest_fail death-file2-1 "test -f file2" ''
5032 cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
5036 # More tests of death support.
5037 mkdir ${CVSROOT_DIRNAME}/first-dir
5038 dotest death2-1 "${testcvs} -q co first-dir" ''
5042 # Add two files on the trunk.
5043 echo "first revision" > file1
5044 echo "file4 first revision" > file4
5045 dotest death2-2 "${testcvs} add file1 file4" \
5046 "${PROG}"' add: scheduling file `file1'\'' for addition
5047 '"${PROG}"' add: scheduling file `file4'\'' for addition
5048 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
5050 dotest death2-3 "${testcvs} -q commit -m add" \
5051 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5054 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5055 initial revision: 1\.1
5057 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
5060 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
5061 initial revision: 1\.1
5064 # Make a branch and a non-branch tag.
5065 dotest death2-4 "${testcvs} -q tag -b branch" \
5068 dotest death2-5 "${testcvs} -q tag tag" \
5072 # Switch over to the branch.
5073 dotest death2-6 "${testcvs} -q update -r branch" ''
5075 # Delete the file on the branch.
5077 dotest death2-7 "${testcvs} rm file1" \
5078 "${PROG} remove: scheduling .file1. for removal
5079 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
5081 # Test diff of the removed file before it is committed.
5082 dotest_fail death2-diff-1 "${testcvs} -q diff file1" \
5083 "${PROG} diff: file1 was removed, no comparison available"
5085 dotest_fail death2-diff-2 "${testcvs} -q diff -N -c file1" \
5087 ===================================================================
5090 \*\*\* file1 ${RFCDATE} [0-9.]*
5091 --- /dev/null ${RFCDATE_EPOCH}
5092 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5097 dotest death2-8 "${testcvs} -q ci -m removed" \
5099 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5100 new revision: delete; previous revision: 1\.1
5103 # Test diff of a dead file.
5104 dotest_fail death2-diff-3 \
5105 "${testcvs} -q diff -r1.1 -rbranch -c file1" \
5106 "${PROG} diff: Tag branch refers to a dead (removed) revision in file .file1.\.
5107 ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
5109 dotest_fail death2-diff-3a \
5110 "${testcvs} -q diff -rbranch -r1.1 -c file1" \
5111 "${PROG} diff: Tag branch refers to a dead (removed) revision in file .file1.\.
5112 ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
5114 dotest_fail death2-diff-4 \
5115 "${testcvs} -q diff -r1.1 -rbranch -N -c file1" \
5117 ===================================================================
5120 \*\*\* file1 ${RFCDATE} [0-9.]*
5121 --- /dev/null ${RFCDATE_EPOCH}
5122 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5127 dotest_fail death2-diff-4a \
5128 "${testcvs} -q diff -rbranch -r1.1 -N -c file1" \
5130 ===================================================================
5133 \*\*\* /dev/null ${RFCDATE_EPOCH}
5134 --- file1 ${RFCDATE} [0-9.]*
5135 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5141 dotest_fail death2-diff-5 "${testcvs} -q diff -rtag -c ." \
5142 "${PROG} diff: file1 no longer exists, no comparison available"
5144 dotest_fail death2-diff-6 "${testcvs} -q diff -rtag -N -c ." \
5146 ===================================================================
5149 \*\*\* file1 [-a-zA-Z0-9: ]* [0-9.]*
5150 --- /dev/null ${RFCDATE_EPOCH}
5151 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5156 # Test rdiff of a dead file.
5157 dotest death2-rdiff-1 \
5158 "${testcvs} -q rtag -rbranch rdiff-tag first-dir" ''
5160 dotest death2-rdiff-2 "${testcvs} -q rdiff -rtag -rbranch first-dir" \
5161 "Index: first-dir/file1
5162 diff -c first-dir/file1:1\.1 first-dir/file1:removed
5163 \*\*\* first-dir/file1:1\.1 [a-zA-Z0-9: ]*
5164 --- first-dir/file1 [a-zA-Z0-9: ]*
5165 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5170 # Readd the file to the branch.
5171 echo "second revision" > file1
5172 dotest death2-9 "${testcvs} add file1" \
5173 "${PROG}"' add: file `file1'\'' will be added on branch `branch'\'' from version 1\.1\.2\.1
5174 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
5176 # Test diff of the added file before it is committed.
5177 dotest_fail death2-diff-7 "${testcvs} -q diff file1" \
5178 "${PROG} diff: file1 is a new entry, no comparison available"
5180 dotest_fail death2-diff-8 "${testcvs} -q diff -N -c file1" \
5182 ===================================================================
5185 \*\*\* /dev/null ${RFCDATE_EPOCH}
5186 --- file1 ${RFCDATE}
5187 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5190 ${PLUS} second revision"
5192 dotest death2-10 "${testcvs} -q commit -m add" \
5194 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5195 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
5198 # Delete file4 from the branch
5199 dotest death2-10a "${testcvs} rm -f file4" \
5200 "${PROG} remove: scheduling .file4. for removal
5201 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
5202 dotest death2-10b "${testcvs} -q ci -m removed" \
5204 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
5205 new revision: delete; previous revision: 1\.1
5208 # Back to the trunk.
5209 dotest death2-11 "${testcvs} -q update -A" \
5213 # Add another file on the trunk.
5214 echo "first revision" > file2
5215 dotest death2-12 "${testcvs} add file2" \
5216 "${PROG}"' add: scheduling file `file2'\'' for addition
5217 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
5218 dotest death2-13 "${testcvs} -q commit -m add" \
5219 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
5222 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
5223 initial revision: 1\.1
5226 # Modify file4 on the trunk.
5227 echo "new file4 revision" > file4
5228 dotest death2-13a "${testcvs} -q commit -m mod" \
5230 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
5231 new revision: 1\.2; previous revision: 1\.1
5234 # Back to the branch.
5235 # The ``no longer in the repository'' message doesn't really
5236 # look right to me, but that's what CVS currently prints for
5238 dotest death2-14 "${testcvs} -q update -r branch" \
5240 ${PROG} update: file2 is no longer in the repository
5241 ${PROG} update: file4 is no longer in the repository"
5243 # Add a file on the branch with the same name.
5244 echo "branch revision" > file2
5245 dotest death2-15 "${testcvs} add file2" \
5246 "${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
5247 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
5248 dotest death2-16 "${testcvs} -q commit -m add" \
5250 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
5251 new revision: 1\.1\.2\.1; previous revision: 1\.1
5254 # Add a new file on the branch.
5255 echo "first revision" > file3
5256 dotest death2-17 "${testcvs} add file3" \
5257 "${PROG}"' add: scheduling file `file3'\'' for addition on branch `branch'\''
5258 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
5259 dotest death2-18 "${testcvs} -q commit -m add" \
5260 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
5263 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
5264 new revision: 1\.1\.2\.1; previous revision: 1\.1
5267 # Test diff of a nonexistent tag
5268 dotest_fail death2-diff-9 "${testcvs} -q diff -rtag -c file3" \
5269 "${PROG} diff: tag tag is not in file file3"
5271 dotest_fail death2-diff-10 "${testcvs} -q diff -rtag -N -c file3" \
5273 ===================================================================
5276 \*\*\* /dev/null ${RFCDATE_EPOCH}
5277 --- file3 ${RFCDATE} [0-9.]*
5278 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5281 ${PLUS} first revision"
5283 dotest_fail death2-diff-11 "${testcvs} -q diff -rtag -c ." \
5285 ===================================================================
5286 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5287 retrieving revision 1\.1
5288 retrieving revision 1\.1\.2\.2
5289 diff -c -r1\.1 -r1\.1\.2\.2
5290 \*\*\* file1 ${RFCDATE} [0-9.]*
5291 --- file1 ${RFCDATE} [0-9.]*
5292 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5297 ${PROG} diff: tag tag is not in file file2
5298 ${PROG} diff: tag tag is not in file file3
5299 ${PROG} diff: file4 no longer exists, no comparison available"
5301 dotest_fail death2-diff-12 "${testcvs} -q diff -rtag -c -N ." \
5303 ===================================================================
5304 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5305 retrieving revision 1\.1
5306 retrieving revision 1\.1\.2\.2
5307 diff -c -r1\.1 -r1\.1\.2\.2
5308 \*\*\* file1 ${RFCDATE} [0-9.]*
5309 --- file1 ${RFCDATE} [0-9.]*
5310 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5316 ===================================================================
5319 \*\*\* /dev/null ${RFCDATE_EPOCH}
5320 --- file2 ${RFCDATE} [0-9.]*
5321 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5324 ${PLUS} branch revision
5326 ===================================================================
5329 \*\*\* /dev/null ${RFCDATE_EPOCH}
5330 --- file3 ${RFCDATE} [0-9.]*
5331 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5334 ${PLUS} first revision
5336 ===================================================================
5339 \*\*\* file4 ${RFCDATE} [0-9.]*
5340 --- /dev/null ${RFCDATE_EPOCH}
5341 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5343 - file4 first revision
5346 # Switch to the nonbranch tag.
5347 dotest death2-19 "${testcvs} -q update -r tag" \
5349 ${PROG} update: file2 is no longer in the repository
5350 ${PROG} update: file3 is no longer in the repository
5353 dotest_fail death2-20 "test -f file2"
5355 # Make sure diff only reports appropriate files.
5356 dotest_fail death2-diff-13 "${testcvs} -q diff -r rdiff-tag" \
5357 "${PROG} diff: Tag rdiff-tag refers to a dead (removed) revision in file .file1.\.
5358 ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
5360 dotest_fail death2-diff-14 "${testcvs} -q diff -r rdiff-tag -c -N" \
5362 ===================================================================
5365 \*\*\* /dev/null ${RFCDATE_EPOCH}
5366 --- file1 ${RFCDATE} [0-9.]*
5367 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5370 ${PLUS} first revision"
5372 # now back to the trunk
5373 dotest death2-21 "${testcvs} -q update -A" \
5377 # test merging with a dead file
5378 dotest death2-22 "${testcvs} -q co first-dir" \
5384 dotest death2-23 "${testcvs} rm -f file4" \
5385 "${PROG} remove: scheduling .file4. for removal
5386 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
5387 dotest death2-24 "${testcvs} -q ci -m removed file4" \
5389 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
5390 new revision: delete; previous revision: 1\.2
5393 echo "new stuff" >file4
5394 dotest_fail death2-25 "${testcvs} up file4" \
5395 "${PROG} update: conflict: file4 is modified but no longer in the repository
5398 cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
5403 # local CVS prints a warning message when update notices a missing
5404 # file and client/server CVS doesn't. These should be identical.
5405 mkdir rm-update-message; cd rm-update-message
5406 mkdir $CVSROOT_DIRNAME/rm-update-message
5407 dotest rm-update-message-setup-1 "$testcvs -q co rm-update-message" ''
5408 cd rm-update-message
5411 dotest rm-update-message-setup-2 "$testcvs -q add $file" \
5412 "${PROG} add: use .${PROG} commit. to add this file permanently"
5413 dotest rm-update-message-setup-3 "$testcvs -q ci -mcreate $file" \
5414 "RCS file: $CVSROOT_DIRNAME/rm-update-message/$file,v
5417 $CVSROOT_DIRNAME/rm-update-message/$file,v <-- $file
5418 initial revision: 1\.1
5422 dotest rm-update-message-1 "$testcvs up $file" \
5423 "${PROG} update: warning: $file was lost
5427 if $keep; then :; else
5428 rm -rf rm-update-message
5429 rm -rf $CVSROOT_DIRNAME/rm-update-message
5434 # More tests of adding and removing files.
5435 # In particular ci -r.
5436 # Other ci -r tests:
5437 # * editor-9: checking in a modified file,
5438 # where "ci -r" means a branch.
5439 # * basica-8a1: checking in a modified file with numeric revision.
5440 # * basica-8a2: likewise.
5441 # * keywordlog-4: adding a new file with numeric revision.
5443 dotest rmadd-1 "${testcvs} -q co -l ." ''
5445 dotest rmadd-2 "${testcvs} add first-dir" \
5446 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
5448 echo first file1 >file1
5449 dotest rmadd-3 "${testcvs} add file1" \
5450 "${PROG} add: scheduling file .file1. for addition
5451 ${PROG} add: use .${PROG} commit. to add this file permanently"
5453 dotest_fail rmadd-4 "${testcvs} -q ci -r 1.2.2.4 -m add" \
5454 "${PROG} commit: cannot add file .file1' with revision .1\.2\.2\.4'; must be on trunk
5455 ${PROG} \[commit aborted\]: correct above errors first!"
5456 dotest_fail rmadd-5 "${testcvs} -q ci -r 1.2.2 -m add" \
5457 "${PROG} commit: cannot add file .file1' with revision .1\.2\.2'; must be on trunk
5458 ${PROG} \[commit aborted\]: correct above errors first!"
5459 dotest_fail rmadd-6 "${testcvs} -q ci -r mybranch -m add" \
5460 "${PROG} \[commit aborted\]: no such tag mybranch"
5462 # The thing with the trailing periods strikes me as a very
5463 # bizarre behavior, but it would seem to be intentional
5464 # (see commit.c). It probably could go away....
5465 dotest rmadd-7 "${testcvs} -q ci -r 7.... -m add" \
5466 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5469 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5470 initial revision: 7\.1
5473 # I guess remote doesn't set a sticky tag in this case.
5474 # Kind of odd, in the sense that rmadd-24a does set one
5475 # both local and remote.
5476 dotest_fail rmadd-7a "test -f CVS/Tag"
5479 dotest rmadd-7a "cat CVS/Tag" "T7"
5482 dotest rmadd-8 "${testcvs} -q tag -b mybranch" "T file1"
5483 dotest rmadd-9 "${testcvs} -q tag mynonbranch" "T file1"
5486 # The previous "cvs ci -r" set a sticky tag of '7'. Seems a
5487 # bit odd, and I guess commit.c (findmaxrev) makes '7' sticky
5488 # tags unnecessary (?). I kind of suspect that it should be
5489 # saying "sticky tag is not a branch" like keywordlog-4b.
5491 dotest rmadd-10 "${testcvs} add file2" \
5492 "${PROG} add: scheduling file .file2. for addition on branch .7'
5493 ${PROG} add: use .${PROG} commit. to add this file permanently"
5494 # As in the previous example, CVS is confused....
5495 dotest rmadd-11 "${testcvs} -q ci -m add" \
5496 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
5499 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
5500 initial revision: 7\.1
5503 dotest rmadd-12 "${testcvs} -q update -A" ""
5505 dotest rmadd-13 "${testcvs} add file3" \
5506 "${PROG} add: scheduling file .file3. for addition
5507 ${PROG} add: use .${PROG} commit. to add this file permanently"
5508 # Huh? file2 is not up to date? Seems buggy to me....
5509 dotest_fail rmadd-14 "${testcvs} -q ci -r mybranch -m add" \
5510 "${PROG} commit: Up-to-date check failed for .file2'
5511 ${PROG} \[commit aborted\]: correct above errors first!"
5512 # Whatever, let's not let file2 distract us....
5513 dotest rmadd-15 "${testcvs} -q ci -r mybranch -m add file3" \
5514 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
5517 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
5518 new revision: 1\.1\.2\.1; previous revision: 1\.1
5522 dotest rmadd-16 "${testcvs} add file4" \
5523 "${PROG} add: scheduling file .file4. for addition
5524 ${PROG} add: use .${PROG} commit. to add this file permanently"
5525 # Same "Up-to-date check" issues as in rmadd-14.
5526 # The "no such tag" thing is due to the fact that we only
5527 # update val-tags when the tag is used (might be more of a
5528 # bug than a feature, I dunno).
5529 dotest_fail rmadd-17 \
5530 "${testcvs} -q ci -r mynonbranch -m add file4" \
5531 "${PROG} \[commit aborted\]: no such tag mynonbranch"
5532 # Try to make CVS write val-tags.
5533 dotest rmadd-18 "${testcvs} -q update -p -r mynonbranch file1" \
5535 # Oops, -p suppresses writing val-tags (probably a questionable
5537 dotest_fail rmadd-19 \
5538 "${testcvs} -q ci -r mynonbranch -m add file4" \
5539 "${PROG} \[commit aborted\]: no such tag mynonbranch"
5540 # Now make CVS write val-tags for real.
5541 dotest rmadd-20 "${testcvs} -q update -r mynonbranch file1" ""
5542 # Oops - CVS isn't distinguishing between a branch tag and
5545 "${testcvs} -q ci -r mynonbranch -m add file4" \
5546 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file4,v
5549 ${CVSROOT_DIRNAME}/first-dir/Attic/file4,v <-- file4
5550 new revision: 1\.1\.2\.1; previous revision: 1\.1
5553 # OK, we add this one in a vanilla way, but then check in
5554 # a modification with ci -r and sniff around for sticky tags.
5556 dotest rmadd-22 "${testcvs} add file5" \
5557 "${PROG} add: scheduling file .file5. for addition
5558 ${PROG} add: use .${PROG} commit. to add this file permanently"
5560 # Interesting bug (or missing feature) here. findmaxrev
5561 # gets the major revision from the Entries. Well, remote
5562 # doesn't send the entries for files which are not involved.
5563 dotest rmadd-23r "${testcvs} -q ci -m add" \
5564 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
5567 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
5568 initial revision: 1\.1
5570 dotest rmadd-23-workaroundr \
5571 "${testcvs} -q ci -r 7 -m bump-it file5" \
5573 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
5574 new revision: 7\.1; previous revision: 1\.1
5577 dotest rmadd-23 "${testcvs} -q ci -m add" \
5578 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
5581 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
5582 initial revision: 7\.1
5585 echo change it >file5
5586 dotest_fail rmadd-24 "${testcvs} -q ci -r 4.8 -m change file5" \
5588 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
5589 ${PROG} commit: ${CVSROOT_DIRNAME}/first-dir/file5,v: revision 4\.8 too low; must be higher than 7\.1
5590 ${PROG} commit: could not check in file5"
5591 dotest rmadd-24a "${testcvs} -q ci -r 8.4 -m change file5" \
5593 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
5594 new revision: 8\.4; previous revision: 7\.1
5596 # I'm not really sure that a sticky tag make sense here.
5597 # It seems to be longstanding behavior for what that is worth.
5598 dotest rmadd-25 "${testcvs} status file5" \
5599 "===================================================================
5600 File: file5 Status: Up-to-date
5602 Working revision: 8\.4.*
5603 Repository revision: 8\.4 ${CVSROOT_DIRNAME}/first-dir/file5,v
5606 Sticky Options: (none)"
5608 # now try forced revision with recursion
5610 dotest rmadd-26 "${testcvs} -q add sub" \
5611 "Directory ${CVSROOT_DIRNAME}/first-dir/sub added to the repository"
5612 echo hello >sub/subfile
5613 dotest rmadd-27 "${testcvs} -q add sub/subfile" \
5614 "${PROG} add: use .${PROG} commit. to add this file permanently"
5616 dotest rmadd-28 "${testcvs} -q ci -m. sub" \
5617 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v
5619 Checking in sub/subfile;
5620 ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v <-- subfile
5621 initial revision: 1\.1
5625 dotest rmadd-29 "${testcvs} -q up -A" \
5626 "${PROG} update: file3 is no longer in the repository
5627 ${PROG} update: file4 is no longer in the repository"
5629 # -f disables recursion
5630 dotest rmadd-30 "${testcvs} -q ci -f -r9 -m." \
5632 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5633 new revision: 9\.1; previous revision: 7\.1
5636 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
5637 new revision: 9\.1; previous revision: 7\.1
5640 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
5641 new revision: 9\.1; previous revision: 8\.4
5644 # add -R to force recursion
5645 dotest rmadd-31 "${testcvs} -q ci -f -r9 -R -m." \
5647 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5648 new revision: 9\.2; previous revision: 9\.1
5651 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
5652 new revision: 9\.2; previous revision: 9\.1
5655 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
5656 new revision: 9\.2; previous revision: 9\.1
5658 Checking in sub/subfile;
5659 ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v <-- subfile
5660 new revision: 9\.1; previous revision: 1\.1
5664 # as noted above, remote doesn't set a sticky tag
5667 dotest rmadd-32 "cat CVS/Tag" "T9"
5668 dotest rmadd-33 "cat sub/CVS/Tag" "T9"
5673 rm -rf ${CVSROOT_DIRNAME}/first-dir
5677 # Tests of undoing commits, including in the presence of
5678 # adding and removing files. See join for a list of -j tests.
5680 dotest rmadd2-1 "${testcvs} -q co -l ." ''
5682 dotest rmadd2-2 "${testcvs} add first-dir" \
5683 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
5685 echo 'initial contents' >file1
5686 dotest rmadd2-3 "${testcvs} add file1" \
5687 "${PROG} add: scheduling file .file1. for addition
5688 ${PROG} add: use .${PROG} commit. to add this file permanently"
5689 dotest rmadd2-4 "${testcvs} -q ci -m add" \
5690 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5693 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5694 initial revision: 1\.1
5696 dotest rmadd2-4a "${testcvs} -Q tag tagone" ""
5697 dotest rmadd2-5 "${testcvs} rm -f file1" \
5698 "${PROG} remove: scheduling .file1. for removal
5699 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
5700 dotest rmadd2-6 "${testcvs} -q ci -m remove" \
5702 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5703 new revision: delete; previous revision: 1\.1
5705 dotest rmadd2-7 "${testcvs} -q update -j 1.2 -j 1.1 file1" "U file1"
5706 dotest rmadd2-8 "${testcvs} -q ci -m readd" \
5708 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5709 new revision: 1\.3; previous revision: 1\.2
5711 echo 'new contents' >file1
5712 dotest rmadd2-9 "${testcvs} -q ci -m modify" \
5714 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5715 new revision: 1\.4; previous revision: 1\.3
5717 dotest rmadd2-10 "${testcvs} -q update -j 1.4 -j 1.3 file1" \
5718 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5719 retrieving revision 1\.4
5720 retrieving revision 1\.3
5721 Merging differences between 1\.4 and 1\.3 into file1"
5722 dotest rmadd2-11 "${testcvs} -q ci -m undo" \
5724 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5725 new revision: 1\.5; previous revision: 1\.4
5727 dotest rmadd2-12 "cat file1" "initial contents"
5728 dotest rmadd2-13 "${testcvs} -q update -p -r 1.3" "initial contents"
5730 # Hmm, might be a bit odd that this works even if 1.3 is not
5732 dotest rmadd2-14 "${testcvs} -q update -j 1.3 -j 1.2 file1" \
5733 "${PROG} update: scheduling file1 for removal"
5735 # Check that -p can get arbitrary revisions of a removed file
5736 dotest rmadd2-14a "${testcvs} -q update -p" "initial contents"
5737 dotest rmadd2-14b "${testcvs} -q update -p -r 1.5" "initial contents"
5738 dotest rmadd2-14c "${testcvs} -q update -p -r 1.3" "initial contents"
5740 dotest rmadd2-15 "${testcvs} -q ci -m re-remove" \
5742 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5743 new revision: delete; previous revision: 1\.5
5745 dotest rmadd2-16 "${testcvs} log -h file1" "
5746 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
5754 keyword substitution: kv
5756 ============================================================================="
5757 dotest rmadd2-17 "${testcvs} status -v file1" \
5758 "===================================================================
5759 File: no file file1 Status: Up-to-date
5761 Working revision: No entry for file1
5762 Repository revision: 1\.6 ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
5765 tagone (revision: 1.1)"
5770 rm -rf ${CVSROOT_DIRNAME}/first-dir
5774 # This test demonstrates that CVS notices that file1 exists rather
5775 # that deleting or writing over it after:
5777 # cvs remove -f file1; touch file1; cvs add file1.
5779 # According to the manual, this should work for:
5781 # rm file1; cvs remove file1; cvs add file1
5783 # but in past version of CVS, new content in file1 would be
5784 # erroneously deleted when file1 reappeared between the remove and
5787 # Later versions of CVS would refuse to perform the add, but still
5788 # allow a subsequent local commit to erase the file from the
5789 # workspace, possibly losing data.
5791 dotest rmadd3-init1 "${testcvs} -q co -l ." ''
5793 dotest rmadd3-init2 "${testcvs} add first-dir" \
5794 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
5797 echo initial content for file1 >file1
5798 dotest rmadd3-init3 "${testcvs} add file1" \
5799 "${PROG} add: scheduling file \`file1' for addition
5800 ${PROG} add: use '${PROG} commit' to add this file permanently"
5801 dotest rmadd3-init4 "${testcvs} -q ci -m add" \
5802 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5805 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5806 initial revision: 1\.1
5809 # Here begins the guts of this test, as detailed above.
5810 dotest rmadd3-1 "${testcvs} rm -f file1" \
5811 "${PROG} remove: scheduling \`file1' for removal
5812 ${PROG} remove: use '${PROG} commit' to remove this file permanently"
5814 # Now recreate the file:
5815 echo desired future contents for file1 >file1
5817 # And attempt to resurrect it at the same time:
5818 dotest_fail rmadd3-2 "${testcvs} add file1" \
5819 "${PROG} add: file1 should be removed and is still there (or is back again)"
5821 # Now prove that commit knows that it shouldn't erase files.
5822 dotest_fail rmadd3-3 "${testcvs} -q ci -m." \
5823 "$PROG commit: \`file1' should be removed and is still there (or is back again)
5824 $PROG \[commit aborted\]: correct above errors first!"
5826 # Then these should pass too:
5827 dotest rmadd3-4 "test -f file1"
5828 dotest rmadd3-5 "cat file1" "desired future contents for file1"
5831 echo Keeping ${TESTDIR} and exiting due to --keep
5837 rm -rf ${CVSROOT_DIRNAME}/first-dir
5841 # This test tests a few file resurrection scenarios.
5843 dotest resurrection-init1 "$testcvs -q co -l ." ''
5845 dotest resurrection-init2 "$testcvs add first-dir" \
5846 "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
5849 echo initial content for file1 >file1
5850 dotest resurrection-init3 "$testcvs add file1" \
5851 "$PROG add: scheduling file \`file1' for addition
5852 $PROG add: use '$PROG commit' to add this file permanently"
5853 dotest resurrection-init4 "$testcvs -q ci -m add" \
5854 "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
5857 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
5858 initial revision: 1\.1
5861 dotest resurrection-init5 "$testcvs -Q rm -f file1"
5863 # The first test is that `cvs add' will resurrect a file before it
5864 # has been committed.
5865 dotest_sort resurrection-1 "$testcvs add file1" \
5867 $PROG add: file1, version 1\.1, resurrected"
5868 dotest resurrection-2 "$testcvs -Q diff file1" ""
5870 dotest resurrection-init6 "$testcvs -Q tag -b resurrection"
5871 dotest resurrection-init7 "$testcvs -Q rm -f file1"
5872 dotest resurrection-init8 "$testcvs -Q ci -mrm" \
5874 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
5875 new revision: delete; previous revision: 1\.1
5878 # The next test is that CVS will resurrect a committed removal.
5879 dotest_sort resurrection-3 "$testcvs add file1" \
5881 $PROG add: Re-adding file \`file1' (in place of dead revision 1\.2)\.
5882 $PROG add: Resurrecting file \`file1' from revision 1\.1\.
5883 $PROG add: use 'cvs commit' to add this file permanently"
5884 dotest resurrection-4 "$testcvs -q diff -r1.1 file1" ""
5885 dotest resurrection-5 "$testcvs -q ci -mreadd" \
5887 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
5888 new revision: 1\.3; previous revision: 1\.2
5891 dotest resurrection-init9 "$testcvs -Q up -rresurrection"
5892 dotest resurrection-init10 "$testcvs -Q rm -f file1"
5893 dotest resurrection-init11 "$testcvs -Q ci -mrm-on-resurrection" \
5895 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
5896 new revision: delete; previous revision: 1\.1
5899 # The next test is that CVS will resurrect a committed removal to a
5901 dotest_sort resurrection-6 "$testcvs add file1" \
5903 $PROG add: Resurrecting file \`file1' from revision 1\.1\.
5904 $PROG add: file \`file1' will be added on branch \`resurrection' from version 1\.1\.2\.1
5905 $PROG add: use 'cvs commit' to add this file permanently"
5906 dotest resurrection-7 "$testcvs -Q diff -r1.1 file1" ""
5907 dotest resurrection-8 "$testcvs -q ci -mreadd" \
5909 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
5910 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
5913 echo Keeping $TESTDIR and exiting due to --keep
5919 rm -rf $CVSROOT_DIRNAME/first-dir
5923 # Tests related to removing and adding directories.
5925 # conflicts (especially dir1 in conflicts-130): What happens if
5926 # directory exists in repository and a non-CVS-controlled
5927 # directory in the working directory?
5928 # conflicts3-15. More cases, especially where CVS directory
5929 # exists but without CVS/Repository and friends.
5930 # conflicts3-22. Similar to conflicts-130 but there is a file
5932 # dirs2. Sort of similar to conflicts3-22 but somewhat different.
5933 mkdir imp-dir; cd imp-dir
5936 echo sfile >sdir/sfile
5937 dotest_sort dirs-1 \
5938 "${testcvs} import -m import-it dir1 vend rel" "
5942 No conflicts created by this import
5943 ${PROG} import: Importing ${CVSROOT_DIRNAME}/dir1/sdir"
5947 dotest dirs-2 "${testcvs} -Q co dir1" ""
5949 # Various CVS administrators are in the habit of removing
5950 # the repository directory for things they don't want any
5951 # more. I've even been known to do it myself (on rare
5952 # occasions). Not the usual recommended practice, but we want
5953 # to try to come up with some kind of reasonable/documented/sensible
5955 rm -rf ${CVSROOT_DIRNAME}/dir1/sdir
5957 dotest dirs-3 "${testcvs} update" \
5958 "${PROG} update: Updating dir1
5959 ${PROG} update: Updating dir1/sdir
5960 ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
5961 ${PROG} update: skipping directory dir1/sdir"
5962 dotest dirs-3a "${testcvs} update -d" \
5963 "${PROG} update*: Updating dir1
5964 ${PROG} update: Updating dir1/sdir
5965 ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
5966 ${PROG} update: skipping directory dir1/sdir"
5968 # If we say "yes", then CVS gives errors about not being able to
5969 # create lock files.
5970 # The fact that it says "skipping directory " rather than
5971 # "skipping directory dir1/sdir" is some kind of bug.
5972 dotest dirs-4 "echo no | ${testcvs} release -d dir1/sdir" \
5973 "${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
5974 ${PROG} update: skipping directory
5975 You have \[0\] altered files in this repository\.
5976 Are you sure you want to release (and delete) directory .dir1/sdir': .. .release' aborted by user choice."
5978 # OK, if "cvs release" won't help, we'll try it the other way...
5981 dotest dirs-5 "cat dir1/CVS/Entries" \
5982 "/file1/1.1.1.1/[a-zA-Z0-9 :]*//
5984 dotest dirs-6 "${testcvs} update" "${PROG} update: Updating dir1"
5985 dotest dirs-7 "cat dir1/CVS/Entries" \
5986 "/file1/1.1.1.1/[a-zA-Z0-9 :]*//
5988 dotest dirs-8 "${testcvs} update -d dir1" \
5989 "${PROG} update: Updating dir1"
5995 # clean up our repositories
5996 rm -rf ${CVSROOT_DIRNAME}/dir1
6000 # See "dirs" for a list of tests involving adding and
6001 # removing directories.
6003 dotest dirs2-1 "${testcvs} -q co -l ." ''
6005 dotest dirs2-2 "${testcvs} add first-dir" \
6006 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
6009 dotest dirs2-3 "${testcvs} add sdir" \
6010 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
6012 dotest dirs2-4 "${testcvs} add sdir/file1" \
6013 "${PROG} add: scheduling file .sdir/file1. for addition
6014 ${PROG} add: use .${PROG} commit. to add this file permanently"
6015 dotest dirs2-5 "${testcvs} -q ci -m add" \
6016 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v
6018 Checking in sdir/file1;
6019 ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v <-- file1
6020 initial revision: 1\.1
6024 # This is just like conflicts3-23
6025 dotest_fail dirs2-6 "${testcvs} update -d" \
6027 ${PROG} update: Updating \.
6028 ${PROG} update: Updating sdir
6029 ${PROG} update: move away sdir/file1; it is in the way
6034 # This is where things are not just like conflicts3-23
6035 dotest dirs2-7 "${testcvs} update -d" \
6037 ${PROG} update: Updating \.
6038 ${PROG} update: Updating sdir
6041 dotest dirs2-6 "${testcvs} update -d" \
6042 "${PROG} update: Updating \.
6045 dotest dirs2-7 "${testcvs} update -d" \
6046 "${PROG} update: Updating \.
6051 # Now, the same thing (more or less) on a branch.
6053 dotest dirs2-8 "${testcvs} -q co first-dir" 'U first-dir/sdir/file1'
6055 dotest dirs2-9 "${testcvs} -q tag -b br" "T sdir/file1"
6058 # Cute little quirk of val-tags; if we don't recurse into
6059 # the directories where the tag is defined, val-tags won't
6061 dotest_fail dirs2-10 "${testcvs} update -d -r br" \
6063 ${PROG} \[update aborted\]: no such tag br"
6065 "${testcvs} -q rdiff -u -r 1.1 -r br first-dir/sdir/file1"
6066 dotest_fail dirs2-10-again "${testcvs} update -d -r br" \
6068 ${PROG} update: Updating \.
6069 ${PROG} update: Updating sdir
6070 ${PROG} update: move away sdir/file1; it is in the way
6073 dotest_fail dirs2-10 "${testcvs} update -d -r br" \
6074 "${PROG} update: in directory sdir:
6075 ${PROG} \[update aborted\]: there is no version here; do '${PROG} checkout' first"
6079 # OK, the above tests make the situation somewhat harder
6080 # than it might be, in the sense that they actually have a
6081 # file which is alive on the branch we are updating. Let's
6082 # try it where it is just a directory where all the files
6083 # have been removed.
6085 dotest dirs2-11 "${testcvs} -q co -r br first-dir" \
6086 "U first-dir/sdir/file1"
6088 # Hmm, this doesn't mention the branch like add does. That's
6089 # an odd non-orthogonality.
6090 dotest dirs2-12 "${testcvs} rm -f sdir/file1" \
6091 "${PROG} remove: scheduling .sdir/file1. for removal
6092 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
6093 dotest dirs2-13 "${testcvs} -q ci -m remove" \
6094 "Removing sdir/file1;
6095 ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v <-- file1
6096 new revision: delete; previous revision: 1\.1
6098 cd ../../2/first-dir
6100 dotest dirs2-14 "${testcvs} update -d -r br" \
6101 "${QUESTION} sdir/file1
6102 ${PROG} update: Updating \.
6103 ${PROG} update: Updating sdir"
6105 dotest dirs2-14 "${testcvs} update -d -r br" \
6106 "${PROG} update: Updating \.
6112 rm -rf ${CVSROOT_DIRNAME}/first-dir
6116 # More branch tests, including branches off of branches
6117 mkdir ${CVSROOT_DIRNAME}/first-dir
6118 dotest branches-1 "${testcvs} -q co first-dir" ''
6120 echo 1:ancest >file1
6121 echo 2:ancest >file2
6122 echo 3:ancest >file3
6123 echo 4:trunk-1 >file4
6124 dotest branches-2 "${testcvs} add file1 file2 file3 file4" \
6125 "${PROG}"' add: scheduling file `file1'\'' for addition
6126 '"${PROG}"' add: scheduling file `file2'\'' for addition
6127 '"${PROG}"' add: scheduling file `file3'\'' for addition
6128 '"${PROG}"' add: scheduling file `file4'\'' for addition
6129 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
6130 dotest branches-2a "${testcvs} -n -q ci -m dont-commit" ""
6131 dotest_lit branches-3 "${testcvs} -q ci -m add-it" <<HERE
6132 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6135 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6136 initial revision: 1.1
6138 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
6141 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6142 initial revision: 1.1
6144 RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
6147 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
6148 initial revision: 1.1
6150 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
6153 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6154 initial revision: 1.1
6157 echo 4:trunk-2 >file4
6158 dotest branches-3.2 "${testcvs} -q ci -m trunk-before-branch" \
6160 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6161 new revision: 1\.2; previous revision: 1\.1
6163 # The "cvs log file4" in test branches-14.3 will test that we
6164 # didn't really add the tag.
6165 dotest branches-3.3 "${testcvs} -qn tag dont-tag" \
6170 # Modify this file before branching, to deal with the case where
6171 # someone is hacking along, says "oops, I should be doing this on
6172 # a branch", and only then creates the branch.
6174 dotest branches-4 "${testcvs} tag -b br1" "${PROG}"' tag: Tagging \.
6179 dotest branches-5 "${testcvs} update -r br1" \
6180 "${PROG} update: Updating \.
6184 dotest branches-6 "${testcvs} -q ci -m modify" \
6186 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6187 new revision: 1\.1\.2\.1; previous revision: 1\.1
6190 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6191 new revision: 1\.1\.2\.1; previous revision: 1\.1
6194 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6195 new revision: 1\.2\.2\.1; previous revision: 1\.2
6197 dotest branches-7 "${testcvs} -q tag -b brbr" 'T file1
6201 dotest branches-8 "${testcvs} -q update -r brbr" ''
6204 dotest branches-9 "${testcvs} -q ci -m modify" \
6206 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6207 new revision: 1\.1\.2\.1\.2\.1; previous revision: 1\.1\.2\.1
6210 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6211 new revision: 1\.2\.2\.1\.2\.1; previous revision: 1\.2\.2\.1
6213 dotest branches-10 "cat file1 file2 file3 file4" '1:brbr
6217 dotest branches-11 "${testcvs} -q update -r br1" \
6220 dotest branches-12 "cat file1 file2 file3 file4" '1:br1
6225 dotest branches-12.2 "${testcvs} -q ci -m change-on-br1" \
6227 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6228 new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
6230 dotest branches-13 "${testcvs} -q update -A" '[UP] file1
6233 dotest branches-14 "cat file1 file2 file3 file4" '1:ancest
6237 echo 4:trunk-3 >file4
6238 dotest branches-14.2 \
6239 "${testcvs} -q ci -m trunk-change-after-branch" \
6241 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6242 new revision: 1\.3; previous revision: 1\.2
6244 dotest branches-14.3 "${testcvs} log file4" \
6246 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
6253 brbr: 1\.2\.2\.1\.0\.2
6255 keyword substitution: kv
6256 total revisions: 6; selected revisions: 6
6258 ----------------------------
6260 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
6261 trunk-change-after-branch
6262 ----------------------------
6264 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
6267 ----------------------------
6269 date: [0-9/: ]*; author: ${username}; state: Exp;
6271 ----------------------------
6273 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
6275 ----------------------------
6277 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
6278 branches: 1\.2\.2\.1\.2;
6280 ----------------------------
6281 revision 1\.2\.2\.1\.2\.1
6282 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
6284 ============================================================================="
6285 dotest_fail branches-14.4 \
6286 "${testcvs} diff -c -r 1.1 -r 1.3 file4" \
6288 ===================================================================
6289 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
6290 retrieving revision 1\.1
6291 retrieving revision 1\.3
6292 diff -c -r1\.1 -r1\.3
6293 \*\*\* file4 ${RFCDATE} 1\.1
6294 --- file4 ${RFCDATE} 1\.3
6295 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6300 dotest_fail branches-14.5 \
6301 "${testcvs} diff -c -r 1.1 -r 1.2.2.1 file4" \
6303 ===================================================================
6304 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
6305 retrieving revision 1\.1
6306 retrieving revision 1\.2\.2\.1
6307 diff -c -r1\.1 -r1\.2\.2\.1
6308 \*\*\* file4 ${RFCDATE} 1\.1
6309 --- file4 ${RFCDATE} 1\.2\.2\.1
6310 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6315 dotest branches-15 \
6316 "${testcvs} update -j 1.1.2.1 -j 1.1.2.1.2.1 file1" \
6317 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6318 retrieving revision 1\.1\.2\.1
6319 retrieving revision 1\.1\.2\.1\.2\.1
6320 Merging differences between 1\.1\.2\.1 and 1\.1\.2\.1\.2\.1 into file1
6321 rcsmerge: warning: conflicts during merge"
6322 dotest branches-16 "cat file1" '<<<<<<< file1
6326 [>]>>>>>> 1\.1\.2\.1\.2\.1'
6328 dotest branches-o1 "${testcvs} -q admin -o ::brbr" \
6329 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6331 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
6333 RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
6335 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
6340 echo Keeping ${TESTDIR} and exiting due to --keep
6344 rm -rf ${CVSROOT_DIRNAME}/first-dir
6349 # More branch tests.
6350 # Test that when updating a new subdirectory in a directory
6351 # which was checked out on a branch, the new subdirectory is
6352 # created on the appropriate branch. Test this when joining
6355 mkdir ${CVSROOT_DIRNAME}/first-dir
6356 mkdir trunk; cd trunk
6359 dotest branches2-1 "${testcvs} -q co first-dir"
6361 echo "file1 first revision" > file1
6362 dotest branches2-2 "${testcvs} add file1" \
6363 "${PROG} add: scheduling file .file1. for addition
6364 ${PROG} add: use .${PROG} commit. to add this file permanently"
6365 dotest branches2-3 "${testcvs} commit -m add file1" \
6366 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6369 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6370 initial revision: 1\.1
6374 dotest branches2-4 "${testcvs} -q tag tag1" 'T file1'
6376 # Make two branches.
6377 dotest branches2-5 "${testcvs} -q rtag -b -r tag1 b1 first-dir" ''
6378 dotest branches2-6 "${testcvs} -q rtag -b -r tag1 b2 first-dir" ''
6380 # Create some files and a subdirectory on branch b1.
6383 dotest branches2-7 "${testcvs} -q co -r b1 first-dir" \
6386 echo "file2 first revision" > file2
6387 dotest branches2-8 "${testcvs} add file2" \
6388 "${PROG}"' add: scheduling file `file2'\'' for addition on branch `b1'\''
6389 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
6391 dotest branches2-9 "${testcvs} add dir1" \
6392 "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository
6393 --> Using per-directory sticky tag "'`'"b1'"
6394 echo "file3 first revision" > dir1/file3
6395 dotest branches2-10 "${testcvs} add dir1/file3" \
6396 "${PROG}"' add: scheduling file `dir1/file3'\'' for addition on branch `b1'\''
6397 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
6398 dotest branches2-11 "${testcvs} -q ci -madd ." \
6399 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v
6402 ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v <-- file2
6403 new revision: 1\.1\.2\.1; previous revision: 1\.1
6405 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
6407 Checking in dir1/file3;
6408 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v <-- file3
6409 new revision: 1\.1\.2\.1; previous revision: 1\.1
6412 # Check out the second branch, and update the working
6413 # directory to the first branch, to make sure the right
6414 # happens with dir1.
6417 dotest branches2-12 "${testcvs} -q co -r b2 first-dir" \
6420 dotest branches2-13 "${testcvs} update -d -r b1 dir1" \
6421 "${PROG} update: Updating dir1
6423 dotest branches2-14 "${testcvs} -q status" \
6424 "===================================================================
6425 File: file1 Status: Up-to-date
6427 Working revision: 1\.1.*
6428 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
6429 Sticky Tag: b2 (branch: 1\.1\.4)
6431 Sticky Options: (none)
6433 ===================================================================
6434 File: file3 Status: Up-to-date
6436 Working revision: 1\.1\.2\.1.*
6437 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
6438 Sticky Tag: b1 (branch: 1\.1\.2)
6440 Sticky Options: (none)"
6442 # FIXME: Just clobbering the directory like this is a bit
6443 # tacky, although people generally expect it to work. Maybe
6444 # we should release it instead. We do it a few other places
6447 dotest branches2-15 "${testcvs} update -d -j b1 dir1" \
6448 "${PROG} update: Updating dir1
6450 # FIXCVS: The `No revision control file' stuff seems to be
6451 # CVS's way of telling us that we're adding the file on a
6452 # branch, and the file is not on that branch yet. This
6454 dotest branches2-16 "${testcvs} -q status" \
6455 "===================================================================
6456 File: file1 Status: Up-to-date
6458 Working revision: 1\.1.*
6459 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
6460 Sticky Tag: b2 (branch: 1\.1\.4)
6462 Sticky Options: (none)
6464 ===================================================================
6465 File: file3 Status: Locally Added
6467 Working revision: New file!
6468 Repository revision: No revision control file
6469 Sticky Tag: b2 - MISSING from RCS file!
6471 Sticky Options: (none)"
6473 cd ../../trunk/first-dir
6474 dotest branches2-17 "${testcvs} update -d -P dir1" \
6475 "${PROG} update: Updating dir1"
6476 dotest_fail branches2-18 "test -d dir1"
6477 dotest branches2-19 "${testcvs} update -d -P -r b1 dir1" \
6478 "${PROG} update: Updating dir1
6480 dotest branches2-20 "${testcvs} -q status" \
6481 "===================================================================
6482 File: file1 Status: Up-to-date
6484 Working revision: 1\.1.*
6485 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
6488 Sticky Options: (none)
6490 ===================================================================
6491 File: file3 Status: Up-to-date
6493 Working revision: 1\.1\.2\.1.*
6494 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
6495 Sticky Tag: b1 (branch: 1\.1\.2)
6497 Sticky Options: (none)"
6500 dotest branches2-21 "${testcvs} update -d -P -j b1 dir1" \
6501 "${PROG} update: Updating dir1
6503 dotest branches2-22 "${testcvs} -q status" \
6504 "===================================================================
6505 File: file1 Status: Up-to-date
6507 Working revision: 1\.1.*
6508 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
6511 Sticky Options: (none)
6513 ===================================================================
6514 File: file3 Status: Locally Added
6516 Working revision: New file!
6517 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
6520 Sticky Options: (none)"
6525 # Check out branch b1 twice. Crate a new directory in one
6526 # working directory, then do a cvs update in the other
6527 # working directory and see if the tags are right.
6531 dotest branches2-23 "${testcvs} -q co -r b1 first-dir" \
6534 U first-dir/dir1/file3'
6536 dotest branches2-24 "${testcvs} -q co -r b1 first-dir" \
6539 U first-dir/dir1/file3'
6542 dotest branches2-25 "${testcvs} add dir2" \
6543 "Directory ${CVSROOT_DIRNAME}/first-dir/dir2 added to the repository
6544 --> Using per-directory sticky tag "'`'"b1'"
6545 echo "file4 first revision" > dir2/file4
6546 dotest branches2-26 "${testcvs} add dir2/file4" \
6547 "${PROG}"' add: scheduling file `dir2/file4'\'' for addition on branch `b1'\''
6548 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
6549 dotest branches2-27 "${testcvs} -q commit -madd" \
6550 "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
6552 Checking in dir2/file4;
6553 ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v <-- file4
6554 new revision: 1\.1\.2\.1; previous revision: 1\.1
6557 cd ../../b1b/first-dir
6558 dotest branches2-28 "${testcvs} update -d dir2" \
6559 "${PROG} update: Updating dir2
6562 dotest branches2-29 "${testcvs} -q status" \
6563 "===================================================================
6564 File: file4 Status: Up-to-date
6566 Working revision: 1\.1\.2\.1.*
6567 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
6568 Sticky Tag: b1 (branch: 1\.1\.2)
6570 Sticky Options: (none)"
6571 dotest branches2-30 "cat CVS/Tag" 'Tb1'
6573 # Test update -A on a subdirectory
6576 dotest branches2-31 "${testcvs} update -A -d dir2" \
6577 "${PROG} update: Updating dir2"
6579 dotest branches2-32 "${testcvs} -q status" ''
6580 dotest_fail branches2-33 "test -f CVS/Tag"
6582 # Add a file on the trunk.
6583 echo "file5 first revision" > file5
6584 dotest branches2-34 "${testcvs} add file5" \
6585 "${PROG}"' add: scheduling file `file5'\'' for addition
6586 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
6587 dotest branches2-35 "${testcvs} -q commit -madd" \
6588 "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
6591 ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v <-- file5
6592 initial revision: 1\.1
6595 cd ../../../trunk/first-dir
6596 dotest branches2-36 "${testcvs} -q update -d dir2" 'U dir2/file5'
6598 dotest branches2-37 "${testcvs} -q status" \
6599 "===================================================================
6600 File: file5 Status: Up-to-date
6602 Working revision: 1\.1.*
6603 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
6606 Sticky Options: (none)"
6607 dotest_fail branches2-38 "test -f CVS/status"
6610 rm -rf ${CVSROOT_DIRNAME}/first-dir
6615 # Test the tag -c option.
6617 dotest tagc-1 "${testcvs} -q co -l ." ''
6619 dotest tagc-2 "${testcvs} add first-dir" \
6620 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
6623 dotest tagc-3 "${testcvs} add file1 file2" \
6624 "${PROG} add: scheduling file .file1. for addition
6625 ${PROG} add: scheduling file .file2. for addition
6626 ${PROG} add: use .${PROG} commit. to add these files permanently"
6627 dotest tagc-4 "${testcvs} -q ci -m add" \
6628 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6631 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6632 initial revision: 1\.1
6634 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
6637 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6638 initial revision: 1\.1
6640 dotest tagc-5 "${testcvs} -q tag -c tag1" \
6644 dotest tagc-6 "${testcvs} -q tag -c tag2" \
6647 # Avoid timestamp granularity bugs (FIXME: CVS should be
6648 # doing the sleep, right?).
6651 dotest tagc-6a "${testcvs} rm -f file2" \
6652 "${PROG} remove: scheduling .file2. for removal
6653 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
6655 dotest tagc-6b "${testcvs} add file3" \
6656 "${PROG} add: scheduling file .file3. for addition
6657 ${PROG} add: use .${PROG} commit. to add this file permanently"
6658 dotest_fail tagc-7 "${testcvs} -q tag -c tag3" \
6659 "${PROG} tag: file1 is locally modified
6660 ${PROG} tag: file2 is locally modified
6661 ${PROG} tag: file3 is locally modified
6662 ${PROG} \[tag aborted\]: correct the above errors first!"
6666 dotest tagc-8 "${testcvs} -q co first-dir" \
6670 dotest tagc-9 "${testcvs} -q ci -m modify" \
6672 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6673 new revision: 1\.2; previous revision: 1\.1
6676 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6677 new revision: delete; previous revision: 1\.1
6679 RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
6682 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
6683 initial revision: 1\.1
6685 cd ../../2/first-dir
6686 dotest tagc-10 "${testcvs} -q tag -c tag4" \
6687 "${PROG} tag: file2 is no longer in the repository
6693 rm -rf ${CVSROOT_DIRNAME}/first-dir
6697 # Make sure `cvs update -p -rT FILE' works from a branch when
6698 # FILE is already on the trunk and is being added to that branch.
6705 # Create the module.
6707 "$testcvs -Q import -m. $module X Y" ''
6710 # Check it out and tag it.
6711 dotest update-p-2 "$testcvs -Q co $module" ''
6713 dotest update-p-3 "$testcvs -Q tag -b B" ''
6715 dotest update-p-4 "$testcvs -Q add $file" ''
6716 dotest update-p-5 "$testcvs -Q ci -m. $file" \
6717 "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
6720 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
6721 initial revision: 1\.1
6723 dotest update-p-6 "$testcvs -Q tag T $file" ''
6724 dotest update-p-7 "$testcvs -Q update -rB" ''
6726 # This merge effectively adds file F on branch B.
6727 dotest update-p-8 "$testcvs -Q update -jT" ''
6729 # Before the fix that prompted the addition of this test,
6730 # the following command would fail with this diagnostic:
6731 # cvs update: conflict: F created independently by second party
6732 dotest update-p-9 "$testcvs update -p -rT $file" \
6733 "===================================================================
6735 RCS: ${CVSROOT_DIRNAME}/$module/$file,v
6737 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6740 # Repeat the above, but with $file removed.
6741 # This exercises a slightly different code path.
6743 # Before the fix that prompted the addition of this test,
6744 # the following command would fail with this diagnostic:
6745 # cvs update: warning: new-born F has disappeared
6746 dotest update-p-10 "$testcvs update -p -rT $file" \
6747 "===================================================================
6749 RCS: ${CVSROOT_DIRNAME}/$module/$file,v
6751 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6754 # Exercise yet another code path:
6755 # the one that involves reviving a `dead' file.
6756 # And a little more, for good measure...
6758 dotest update-p-a1 "$testcvs -Q add new" ''
6759 dotest update-p-a2 "$testcvs -Q update -p new" ''
6760 dotest update-p-a3 "$testcvs -Q rm -f new" ''
6762 # Both an update -A, *and* the following update are required
6763 # to return to the state of being on the trunk with a $file
6764 # that we can then remove.
6765 dotest update-p-undead-0 "$testcvs update -A" \
6766 "${PROG} update: Updating \.
6767 ${PROG} update: warning: new-born $file has disappeared"
6768 dotest update-p-undead-1 "$testcvs update" \
6769 "${PROG} update: Updating \.
6771 dotest update-p-undead-2 "$testcvs -Q update -p -rT $file" v1
6772 dotest update-p-undead-3 "$testcvs -Q rm -f $file" ''
6773 dotest update-p-undead-4 "$testcvs -Q update -p -rT $file" v1
6774 dotest update-p-undead-5 "$testcvs -Q ci -m. $file" \
6776 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
6777 new revision: delete; previous revision: 1\.1
6779 dotest update-p-undead-6 "$testcvs -Q update -p -rT $file" v1
6781 dotest update-p-undead-7 "$testcvs -Q update -p -rT $file" v1
6782 dotest update-p-undead-8 "$testcvs add $file" \
6783 "${PROG} add: Re-adding file .$file. (in place of dead revision 1\.2)\.
6784 ${PROG} add: use .${PROG} commit. to add this file permanently"
6786 dotest update-p-undead-9 "$testcvs -Q update -p -rT $file" v1
6790 rm -rf ${CVSROOT_DIRNAME}/$module
6794 # More tagging tests, including using tag -F -B to convert a
6795 # branch tag to a regular tag and recovering thereof.
6797 # Setup; check in first-dir/file1
6799 dotest tagf-1 "${testcvs} -q co -l ." ''
6801 dotest tagf-2 "${testcvs} add first-dir" \
6802 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
6805 dotest tagf-3 "${testcvs} add file1 file2" \
6806 "${PROG} add: scheduling file .file1. for addition
6807 ${PROG} add: scheduling file .file2. for addition
6808 ${PROG} add: use .${PROG} commit. to add these files permanently"
6809 dotest tagf-4 "${testcvs} -q ci -m add" \
6810 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6813 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6814 initial revision: 1\.1
6816 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
6819 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6820 initial revision: 1\.1
6823 # Now create a branch and commit a revision there.
6824 dotest tagf-5 "${testcvs} -q tag -b br" "T file1
6826 dotest tagf-6 "${testcvs} -q update -r br" ""
6829 dotest tagf-7 "${testcvs} -q ci -m modify" \
6831 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6832 new revision: 1\.1\.2\.1; previous revision: 1\.1
6835 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6836 new revision: 1\.1\.2\.1; previous revision: 1\.1
6838 # Here we try to make it a non-branch tag, but will
6839 # succeed in getting only warnings, even with -F
6840 # because converting a branch tag to non-branch
6841 # is potentially catastrophic.
6842 dotest tagf-8a "${testcvs} -q tag -F br" \
6843 "${PROG} tag: file1: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\\.2\.1\.
6844 ${PROG} tag: file2: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\.2\.1\."
6845 # however, if we *really* are sure we want to move a branch tag,
6846 # "-F -B" will do the trick
6847 dotest tagf-8 "${testcvs} -q tag -F -B br" "T file1
6849 echo moremod >> file1
6850 echo moremod >> file2
6851 dotest tagf-9 "${testcvs} -q status -v file1" \
6852 "===================================================================
6853 File: file1 Status: Locally Modified
6855 Working revision: 1\.1\.2\.1.*
6856 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
6857 Sticky Tag: br (revision: 1\.1\.2\.1)
6859 Sticky Options: (none)
6862 br (revision: 1\.1\.2\.1)"
6864 # Now, how do we recover?
6865 dotest tagf-10 "${testcvs} -q tag -d br" "D file1
6867 # This creates a new branch, 1.1.4. See the code in RCS_magicrev
6868 # which will notice that there is a (non-magic) 1.1.2 and thus
6870 dotest tagf-11 "${testcvs} -q tag -r 1.1 -b br file1" "T file1"
6871 # Fix it with admin -n (cf admin-18, admin-26-4).
6872 dotest tagf-12 "${testcvs} -q admin -nbr:1.1.2 file2" \
6873 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
6875 # Another variation on the file2 test would be to use two working
6876 # directories so that the update -r br would need to
6877 # a merge to get from 1.1.2.1 to the head of the 1.1.2 branch.
6878 dotest tagf-13 "${testcvs} -q update -r br" \
6879 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6880 retrieving revision 1\.1\.2\.1
6881 retrieving revision 1\.1
6882 Merging differences between 1\.1\.2\.1 and 1\.1 into file1
6883 rcsmerge: warning: conflicts during merge
6884 ${PROG} update: conflicts found in file1
6887 # CVS is giving a conflict because we are trying to get back to
6888 # 1.1.4. I'm not sure why it is a conflict rather than just
6890 dotest tagf-14 "cat file1" \
6897 dotest tagf-15 "${testcvs} -q ci -m recovered" \
6899 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6900 new revision: 1\.1\.4\.1; previous revision: 1\.1
6903 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6904 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
6906 # try accidentally deleting branch tag, "tag -d"
6907 dotest_fail tagf-16 "${testcvs} tag -d br" \
6908 "${PROG} tag: Untagging \.
6909 ${PROG} tag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\.
6910 ${PROG} tag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\."
6911 # try accidentally deleting branch tag, "rtag -d"
6912 dotest_fail tagf-17 "${testcvs} rtag -d br first-dir" \
6913 "${PROG} rtag: Untagging first-dir
6914 ${PROG} rtag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\.
6915 ${PROG} rtag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\."
6916 # try accidentally converting branch tag to non-branch tag "tag -F"
6917 dotest tagf-18 "${testcvs} tag -r1.1 -F br file1" \
6918 "${PROG} tag: file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\."
6919 # try accidentally converting branch tag to non-branch tag "rtag -F"
6920 dotest tagf-19 "${testcvs} rtag -r1.1 -F br first-dir" \
6921 "${PROG} rtag: Tagging first-dir
6922 ${PROG} rtag: first-dir/file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\.
6923 ${PROG} rtag: first-dir/file2: Not moving branch tag .br. from 1\.1\.2\.2 to 1\.1\."
6924 # create a non-branch tag
6925 dotest tagf-20 "${testcvs} rtag regulartag first-dir" \
6926 "${PROG} rtag: Tagging first-dir"
6927 # try accidentally converting non-branch tag to branch tag (tag -F -B -b)
6928 dotest tagf-21 "${testcvs} tag -F -B -b regulartag file1" \
6929 "${PROG} tag: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1\.0\.2 due to .-B. option\."
6930 # try accidentally converting non-branch tag to branch rtag (rtag -F -B -b)
6931 dotest tagf-22 "${testcvs} rtag -F -B -b regulartag first-dir" \
6932 "${PROG} rtag: Tagging first-dir
6933 ${PROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.6 due to .-B. option\.
6934 ${PROG} rtag: first-dir/file2: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.4 due to .-B. option\."
6935 # Try accidentally deleting non-branch: (tag -d -B)
6936 dotest_fail tagf-23 "${testcvs} tag -d -B regulartag file1" \
6937 "${PROG} tag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\."
6938 # Try accidentally deleting non-branch: (rtag -d -B)
6939 dotest_fail tagf-24 \
6940 "${testcvs} rtag -d -B regulartag first-dir" \
6941 "${PROG} rtag: Untagging first-dir
6942 ${PROG} rtag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\.
6943 ${PROG} rtag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file2,v. due to .-B. option\."
6945 # the following tests (throught the next commit) keep moving the same
6946 # tag back and forth between 1.1.6 & 1.1.8 in file1 and between
6947 # 1.1.4 and 1.1.6 in file2 since nothing was checked in on some of
6948 # these branches and CVS only tracks branches via tags unless they contain data.
6950 # try intentionally converting non-branch tag to branch tag (tag -F -b)
6951 dotest tagf-25a "${testcvs} tag -F -b regulartag file1" "T file1"
6952 # try intentionally moving a branch tag to a newly created branch (tag -F -b -B)
6953 dotest tagf-25b "${testcvs} tag -F -B -b -r1.1 regulartag file1" \
6955 # try intentionally converting mixed tags to branch tags (rtag -F -b)
6956 dotest tagf-26a "${testcvs} rtag -F -b regulartag first-dir" \
6957 "${PROG} rtag: Tagging first-dir
6958 ${PROG} rtag: first-dir/file1: Not moving branch tag .regulartag. from 1\.1 to 1\.1\.0\.8\."
6959 # try intentionally converting a branch to a new branch tag (rtag -F -b -B)
6960 dotest tagf-26b "${testcvs} rtag -F -B -b -r1.1 regulartag first-dir" \
6961 "${PROG} rtag: Tagging first-dir"
6962 # update to our new branch
6963 dotest tagf-27 "${testcvs} update -r regulartag" \
6964 "${PROG} update: Updating \.
6967 # commit some changes and see that all rev numbers look right
6968 echo changes >> file1
6969 echo changes >> file2
6970 dotest tagf-28 "${testcvs} ci -m changes" \
6971 "${PROG} [a-z]*: Examining \.
6973 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6974 new revision: 1\.1\.8\.1; previous revision: 1\.1
6977 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6978 new revision: 1\.1\.6\.1; previous revision: 1\.1
6980 # try intentional branch to non-branch (tag -F -B)
6981 dotest tagf-29 "${testcvs} tag -F -B -r1.1 regulartag file1" \
6983 # try non-branch to non-branch (tag -F -B)
6984 dotest tagf-29a "${testcvs} tag -F -B -r br regulartag file1" \
6985 "${PROG} tag: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\."
6986 # try mixed-branch to non-branch (rtag -F -B )
6987 dotest tagf-29b "${testcvs} rtag -F -B -r br regulartag first-dir" \
6988 "${PROG} rtag: Tagging first-dir
6989 ${PROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\."
6990 # at this point, regulartag is a regular tag within
6993 # try intentional branch to non-branch (rtag -F -B)
6994 dotest tagf-30 "${testcvs} rtag -F -B -r1.1 br first-dir" \
6995 "${PROG} rtag: Tagging first-dir"
6996 # create a branch tag so we can try to delete it.
6997 dotest tagf-31 "${testcvs} rtag -b brtag first-dir" \
6998 "${PROG} rtag: Tagging first-dir"
7000 # try intentinal deletion of branch tag (tag -d -B)
7001 dotest tagf-32 "${testcvs} tag -d -B brtag file1" "D file1"
7002 # try intentinal deletion of branch tag (rtag -d -B)
7003 dotest tagf-33 "${testcvs} rtag -d -B brtag first-dir" \
7004 "${PROG} rtag: Untagging first-dir"
7009 rm -rf ${CVSROOT_DIRNAME}/first-dir
7013 # Test librarification of RCS.
7014 # First: test whether `cvs diff' handles $Name expansion
7015 # correctly. We diff two revisions with their symbolic tags;
7016 # neither tag should be expanded in the output. Also diff
7017 # one revision with the working copy.
7019 mkdir ${CVSROOT_DIRNAME}/first-dir
7020 dotest rcsdiff-1 "${testcvs} -q co first-dir" ''
7022 echo "I am the first foo, and my name is $""Name$." > foo.c
7023 dotest rcsdiff-2 "${testcvs} add -m new-file foo.c" \
7024 "${PROG} add: scheduling file .foo\.c. for addition
7025 ${PROG} add: use .${PROG} commit. to add this file permanently"
7026 dotest rcsdiff-3 "${testcvs} commit -m rev1 foo.c" \
7027 "RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
7030 ${CVSROOT_DIRNAME}/first-dir/foo.c,v <-- foo\.c
7031 initial revision: 1\.1
7033 dotest rcsdiff-4 "${testcvs} tag first foo.c" "T foo\.c"
7034 dotest rcsdiff-5 "${testcvs} update -p -r first foo.c" \
7035 "===================================================================
7037 RCS: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
7039 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
7040 I am the first foo, and my name is \$""Name: first \$\."
7042 echo "I am the second foo, and my name is $""Name$." > foo.c
7043 dotest rcsdiff-6 "${testcvs} commit -m rev2 foo.c" \
7044 "Checking in foo\.c;
7045 ${CVSROOT_DIRNAME}/first-dir/foo\.c,v <-- foo\.c
7046 new revision: 1\.2; previous revision: 1\.1
7048 dotest rcsdiff-7 "${testcvs} tag second foo.c" "T foo\.c"
7049 dotest rcsdiff-8 "${testcvs} update -p -r second foo.c" \
7050 "===================================================================
7052 RCS: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
7054 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
7055 I am the second foo, and my name is \$""Name: second \$\."
7057 dotest_fail rcsdiff-9 "${testcvs} diff -r first -r second" \
7058 "${PROG} diff: Diffing \.
7060 ===================================================================
7061 RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
7062 retrieving revision 1\.1
7063 retrieving revision 1\.2
7066 < I am the first foo, and my name is \$""Name: \$\.
7068 > I am the second foo, and my name is \$""Name: \$\."
7070 echo "I am the once and future foo, and my name is $""Name$." > foo.c
7071 dotest_fail rcsdiff-10 "${testcvs} diff -r first" \
7072 "${PROG} diff: Diffing \.
7074 ===================================================================
7075 RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
7076 retrieving revision 1\.1
7079 < I am the first foo, and my name is \$""Name: \$\.
7081 > I am the once and future foo, and my name is \$""Name\$\."
7083 # Test handling of libdiff options. diff gets quite enough
7084 # of a workout elsewhere in sanity.sh, so we assume that it's
7085 # mostly working properly if it passes all the other tests.
7086 # The main one we want to try is regex handling, since we are
7087 # using CVS's regex matcher and not diff's.
7090 test_regex (whiz, bang)
7099 dotest rcslib-diffrgx-1 "${testcvs} -q add -m '' rgx.c" \
7100 "${PROG} add: use .${PROG} commit. to add this file permanently"
7101 dotest rcslib-diffrgx-2 "${testcvs} -q ci -m '' rgx.c" \
7102 "RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
7105 ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v <-- rgx\.c
7106 initial revision: 1\.1
7109 test_regex (whiz, bang)
7117 # Use dotest_fail because exit status from `cvs diff' must be 1.
7118 dotest_fail rcslib-diffrgx-3 "${testcvs} diff -c -F'.*(' rgx.c" \
7120 ===================================================================
7121 RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
7122 retrieving revision 1\.1
7123 diff -c -F\.\*( -r1\.1 rgx\.c
7124 \*\*\* rgx\.c ${RFCDATE} 1\.1
7125 --- rgx\.c ${RFCDATE}
7126 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* test_regex (whiz, bang)
7140 # Tests of rcsmerge/diff3. Merge operations get a good general
7141 # workout elsewhere; we want to make sure that options are still
7142 # handled properly. Try merging two branches with -kv, to test
7143 # both -j and -k switches.
7147 rm -rf ${CVSROOT_DIRNAME}/first-dir
7151 dotest rcslib-merge-1 "${testcvs} -q co -l ." ""
7153 dotest rcslib-merge-2 "${testcvs} -q add first-dir" \
7154 "Directory ${CVSROOT_DIRNAME}.*/first-dir added to the repository"
7157 dotest rcslib-merge-3 "${testcvs} -q co first-dir" ""
7160 echo '$''Revision$' > file1
7163 dotest rcslib-merge-4 "${testcvs} -q add file1" \
7164 "${PROG} add: use .${PROG} commit. to add this file permanently"
7165 dotest rcslib-merge-5 "${testcvs} -q commit -m '' file1" \
7166 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7169 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7170 initial revision: 1\.1
7172 sed -e 's/2/two/' file1 > f; mv f file1
7173 dotest rcslib-merge-6 "${testcvs} -q commit -m '' file1" \
7175 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7176 new revision: 1\.2; previous revision: 1\.1
7178 dotest rcslib-merge-7 "${testcvs} -q tag -b -r 1.1 patch1" "T file1"
7179 dotest rcslib-merge-8 "${testcvs} -q update -r patch1" "[UP] file1"
7180 dotest rcslib-merge-9 "${testcvs} -q status" \
7181 "===================================================================
7182 File: file1 Status: Up-to-date
7184 Working revision: 1\.1.*
7185 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
7186 Sticky Tag: patch1 (branch: 1\.1\.2)
7188 Sticky Options: (none)"
7189 dotest rcslib-merge-10 "cat file1" \
7190 '$''Revision: 1\.1 $
7193 sed -e 's/3/three/' file1 > f; mv f file1
7194 dotest rcslib-merge-11 "${testcvs} -q commit -m '' file1" \
7196 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7197 new revision: 1\.1\.2\.1; previous revision: 1\.1
7199 dotest rcslib-merge-12 "${testcvs} -q update -kv -j1.2" \
7201 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7202 retrieving revision 1\.1
7203 retrieving revision 1\.2
7204 Merging differences between 1\.1 and 1\.2 into file1
7205 rcsmerge: warning: conflicts during merge"
7206 dotest rcslib-merge-13 "cat file1" \
7217 # Test behavior of symlinks in the repository.
7218 if test -n "$remotehost"; then
7219 # Create the link on the remote system. This is because Cygwin's
7220 # Windows support creates *.lnk files for Windows. When creating
7221 # these in an SMB share from UNIX, these links won't work from the
7223 dotest rcslib-symlink-1remotehost "${CVS_RSH} $remotehost 'ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
7225 dotest rcslib-symlink-1 "ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
7227 dotest rcslib-symlink-2 "${testcvs} update file2" "U file2"
7228 echo "This is a change" >> file2
7229 dotest rcslib-symlink-3 "${testcvs} ci -m because file2" \
7231 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file2
7232 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
7235 # Switch as for rcslib-symlink-1
7236 if test -n "$remotehost"; then
7237 dotest rcslib-symlink-4 "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/file2,v'" \
7238 ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
7240 dotest rcslib-symlink-4 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
7241 ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
7244 # CVS was failing to check both the symlink and the file
7245 # for timestamp changes for a while. Test that.
7247 dotest rcslib-symlink-3a "${testcvs} -q up file1" \
7248 "${PROG} update: warning: file1 was lost
7250 echo "This is a change" >> file1
7251 dotest rcslib-symlink-3b "${testcvs} ci -m because file1" \
7253 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7254 new revision: 1\.1\.2\.[0-9]*; previous revision: 1\.1\.2\.[0-9]*
7256 dotest rcslib-symlink-3c "${testcvs} update file2" "[UP] file2"
7258 echo some new text >file3
7259 dotest rcslib-symlink-3d "${testcvs} -Q add file3" ''
7260 dotest rcslib-symlink-3e "${testcvs} -Q ci -mtest file3" \
7261 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
7264 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
7265 new revision: 1\.1\.2\.1; previous revision: 1\.1
7268 rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v
7269 # As for rcslib-symlink-1
7270 if test -n "$remotehost"; then
7271 dotest rcslib-symlink-3f "$CVS_RSH $remotehost 'ln -s Attic/file3,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
7273 dotest rcslib-symlink-3f "ln -s Attic/file3,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
7276 dotest rcslib-symlink-3g "${testcvs} update file2" "U file2"
7278 # restore the link to file1 for the following tests
7279 dotest rcslib-symlink-3i "${testcvs} -Q rm -f file3" ''
7280 dotest rcslib-symlink-3j "${testcvs} -Q ci -mwhatever file3" \
7282 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
7283 new revision: delete; previous revision: 1\.1\.2\.1
7285 rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v
7286 rm -f ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
7287 # As for rcslib-symlink-1
7288 if test -n "$remotehost"; then
7289 dotest rcslib-symlink-3h "$CVS_RSH $remotehost 'ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
7291 dotest rcslib-symlink-3h "ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
7294 # Test 5 reveals a problem with having symlinks in the
7295 # repository. CVS will try to tag both of the files
7296 # separately. After processing one, it will do the same
7297 # operation to the other, which is actually the same file,
7298 # so the tag will already be there. FIXME: do we bother
7299 # changing operations to notice cases like this? This
7300 # strikes me as a difficult problem. -Noel
7301 dotest rcslib-symlink-5 "${testcvs} tag the_tag" \
7302 "${PROG} tag: Tagging .
7304 W file2 : the_tag already exists on version 1.1.2.3 : NOT MOVING tag to version 1.1.2.1"
7305 # As for rcslib-symlink-1
7306 if test -n "$remotehost"; then
7307 dotest rcslib-symlink-6 "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/file2,v'" \
7308 ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
7310 dotest rcslib-symlink-6 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
7311 ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
7314 # Symlinks tend to interact poorly with the Attic.
7317 dotest rcslib-symlink-7 "${testcvs} -q co first-dir" \
7321 dotest rcslib-symlink-8 "${testcvs} rm -f file2" \
7322 "${PROG} remove: scheduling .file2. for removal
7323 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
7324 dotest rcslib-symlink-9 "${testcvs} -q ci -m rm-it" \
7326 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file2
7327 new revision: delete; previous revision: 1\.2
7329 # OK, why this message happens twice is relatively clear
7330 # (the check_* and rtag_* calls to start_recursion).
7331 # Why it happens a third time I didn't try to find out.
7332 dotest rcslib-symlink-10 \
7333 "${testcvs} -q rtag -b -r the_tag brtag first-dir" \
7334 "${PROG} rtag: could not read RCS file for file2
7335 ${PROG} rtag: could not read RCS file for first-dir/file2
7336 ${PROG} rtag: could not read RCS file for first-dir/file2"
7342 echo Keeping ${TESTDIR} and exiting due to --keep
7346 # Must remove the symlink first. Samba doesn't appear to show
7347 # broken symlink across the SMB share, and rm -rf by itself
7348 # will remove file1,v first and leave file2,v a broken link and the
7349 # rm -rf will fail since it doesn't find file2,v and it still gets
7350 # directory not empty errors removing cvsroot/first-dir.
7352 # I'm not sure why I need to do this on $remotehost. The rm above
7353 # rcslib-symlink-3j works fine, but the next one doesn't unless run
7354 # remotely under Cygwin and using a TESTDIR on a Samba share.
7355 if test -n "$remotehost"; then
7356 $CVS_RSH $remotehost "rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v"
7358 rm -rf ${CVSROOT_DIRNAME}/first-dir
7363 # Test the ability to have several branchpoints coming off the
7365 mkdir ${CVSROOT_DIRNAME}/first-dir
7366 dotest multibranch-1 "${testcvs} -q co first-dir" ''
7368 echo 1:trunk-1 >file1
7369 dotest multibranch-2 "${testcvs} add file1" \
7370 "${PROG}"' add: scheduling file `file1'\'' for addition
7371 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
7372 dotest_lit multibranch-3 "${testcvs} -q ci -m add-it" <<HERE
7373 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7376 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7377 initial revision: 1.1
7380 dotest multibranch-4 "${testcvs} tag -b br1" \
7381 "${PROG} tag: Tagging \.
7383 dotest multibranch-5 "${testcvs} tag -b br2" \
7384 "${PROG} tag: Tagging \.
7386 dotest multibranch-6 "${testcvs} -q update -r br1" ''
7388 dotest multibranch-7 "${testcvs} -q ci -m modify-on-br1" \
7390 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7391 new revision: 1\.1\.2\.1; previous revision: 1\.1
7393 dotest multibranch-8 "${testcvs} -q update -r br2" '[UP] file1'
7394 echo br2 adds a line >>file1
7395 dotest multibranch-9 "${testcvs} -q ci -m modify-on-br2" \
7397 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7398 new revision: 1\.1\.4\.1; previous revision: 1\.1
7400 dotest multibranch-10 "${testcvs} -q update -r br1" '[UP] file1'
7401 dotest multibranch-11 "cat file1" 'on-br1'
7402 dotest multibranch-12 "${testcvs} -q update -r br2" '[UP] file1'
7403 dotest multibranch-13 "cat file1" '1:trunk-1
7406 dotest multibranch-14 "${testcvs} log file1" \
7408 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7417 keyword substitution: kv
7418 total revisions: 3; selected revisions: 3
7420 ----------------------------
7422 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
7423 branches: 1\.1\.2; 1\.1\.4;
7425 ----------------------------
7427 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
7429 ----------------------------
7431 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
7433 ============================================================================="
7437 echo Keeping ${TESTDIR} and exiting due to --keep
7441 rm -rf ${CVSROOT_DIRNAME}/first-dir
7445 import) # test death after import
7446 # Tests of "cvs import":
7448 # rdiff -- imports with keywords
7449 # import -- more tests of imports with keywords
7450 # importb -- -b option.
7451 # importc -- bunch o' files in bunch o' directories
7453 # mflag -- various -m messages
7454 # ignore -- import and cvsignore
7455 # binwrap -- import and -k wrappers
7456 # info -- imports which are rejected by verifymsg
7457 # head -- intended to test vendor branches and HEAD,
7458 # although it doesn't really do it yet.
7459 # import-CVS -- refuse to import directories named "CVS".
7462 mkdir import-dir ; cd import-dir
7464 for i in 1 2 3 4 ; do
7465 echo imported file"$i" > imported-f"$i"
7468 # This directory should be on the default ignore list,
7469 # so it shouldn't get imported.
7471 echo ignore.me >RCS/ignore.me
7473 echo 'import should not expand $''Id$' >>imported-f2
7474 cp imported-f2 ../imported-f2-orig.tmp
7476 dotest_sort import-96 \
7477 "${testcvs} import -m first-import first-dir vendor-branch junk-1_0" \
7481 N first-dir/imported-f1
7482 N first-dir/imported-f2
7483 N first-dir/imported-f3
7484 N first-dir/imported-f4
7485 No conflicts created by this import"
7487 dotest import-96.5 "cmp ../imported-f2-orig.tmp imported-f2" ''
7492 dotest import-97 "${testcvs} -q co first-dir" \
7493 "U first-dir/imported-f1
7494 U first-dir/imported-f2
7495 U first-dir/imported-f3
7496 U first-dir/imported-f4"
7500 for i in 1 2 3 4 ; do
7501 dotest import-98-$i "test -f imported-f$i" ''
7503 dotest_fail import-98.5 "test -d RCS" ''
7507 dotest import-99 "${testcvs} rm imported-f1" \
7508 "${PROG}"' remove: scheduling `imported-f1'\'' for removal
7509 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
7512 echo local-change >> imported-f2
7515 dotest import-100 "${testcvs} ci -m local-changes" \
7516 "${PROG} [a-z]*: Examining .
7517 Removing imported-f1;
7518 ${CVSROOT_DIRNAME}/first-dir/imported-f1,v <-- imported-f1
7519 new revision: delete; previous revision: 1\.1\.1\.1
7521 Checking in imported-f2;
7522 ${CVSROOT_DIRNAME}/first-dir/imported-f2,v <-- imported-f2
7523 new revision: 1\.2; previous revision: 1\.1
7527 dotest import-101 "${testcvs} log imported-f1" \
7529 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/imported-f1,v
7530 Working file: imported-f1
7536 junk-1_0: 1\.1\.1\.1
7537 vendor-branch: 1\.1\.1
7538 keyword substitution: kv
7539 total revisions: 3; selected revisions: 3
7541 ----------------------------
7543 date: [0-9/]* [0-9:]*; author: ${username}; state: dead; lines: ${PLUS}0 -0
7545 ----------------------------
7547 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
7550 ----------------------------
7552 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
7554 ============================================================================="
7556 # update into the vendor branch.
7557 dotest import-102 "${testcvs} update -rvendor-branch" \
7558 "${PROG} update: Updating .
7562 # remove file4 on the vendor branch
7564 dotest import-103 "${testcvs} rm imported-f4" \
7565 "${PROG}"' remove: scheduling `imported-f4'\'' for removal
7566 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
7570 "${testcvs} ci -m vendor-removed imported-f4" \
7571 "Removing imported-f4;
7572 ${CVSROOT_DIRNAME}/first-dir/imported-f4,v <-- imported-f4
7573 new revision: delete; previous revision: 1\.1\.1\.1
7576 # update to main line
7577 dotest import-105 "${testcvs} -q update -A" \
7578 "${PROG} update: imported-f1 is no longer in the repository
7581 # second import - file4 deliberately unchanged
7584 echo rev 2 of file $i >> imported-f"$i"
7586 cp imported-f2 ../imported-f2-orig.tmp
7588 dotest_sort import-106 \
7589 "${testcvs} import -m second-import first-dir vendor-branch junk-2_0" \
7593 ${PROG} checkout -j<prev_rel_tag> -jjunk-2_0 first-dir
7594 2 conflicts created by this import.
7595 C first-dir/imported-f1
7596 C first-dir/imported-f2
7598 U first-dir/imported-f3
7599 U first-dir/imported-f4
7600 Use the following command to help the merge:"
7602 dotest import-106.5 "cmp ../imported-f2-orig.tmp imported-f2" \
7607 rm imported-f2-orig.tmp
7610 dotest import-107 "${testcvs} co first-dir" \
7611 "${PROG} checkout: Updating first-dir
7612 [UP] first-dir/imported-f3
7613 [UP] first-dir/imported-f4"
7617 dotest_fail import-108 "test -f imported-f1" ''
7620 dotest import-109-$i "test -f imported-f$i" ''
7623 # check vendor branch for file4
7624 dotest import-110 "${testcvs} -q update -rvendor-branch" \
7628 dotest import-111 "test -f imported-f4" ''
7630 # update to main line
7631 dotest import-112 "${testcvs} -q update -A" \
7632 "${PROG} update: imported-f1 is no longer in the repository
7638 "${testcvs} -q co -jjunk-1_0 -jjunk-2_0 first-dir" \
7639 "${PROG} checkout: file first-dir/imported-f1 does not exist, but is present in revision junk-2_0
7640 RCS file: ${CVSROOT_DIRNAME}/first-dir/imported-f2,v
7641 retrieving revision 1\.1\.1\.1
7642 retrieving revision 1\.1\.1\.2
7643 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into imported-f2
7644 rcsmerge: warning: conflicts during merge
7645 first-dir/imported-f3 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.2
7646 first-dir/imported-f4 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.3"
7650 dotest_fail import-114 "test -f imported-f1" ''
7653 dotest import-115-$i "test -f imported-f$i" ''
7656 dotest import-116 'cat imported-f2' \
7658 [<]<<<<<< imported-f2
7659 import should not expand \$''Id: imported-f2,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
7662 import should not expand \$''Id: imported-f2,v 1\.1\.1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
7664 [>]>>>>>> 1\.1\.1\.2'
7668 rm -rf ${CVSROOT_DIRNAME}/first-dir
7673 # More cvs import tests, especially -b option.
7675 # OK, first we get some sources from the NetMunger project, and
7676 # import them into the 1.1.1 vendor branch.
7679 echo 'OpenMunger sources' >file1
7680 echo 'OpenMunger sources' >file2
7681 dotest_sort importb-1 \
7682 "${testcvs} import -m add first-dir openmunger openmunger-1_0" \
7687 No conflicts created by this import"
7691 # Now we put the sources we get from FreeMunger into 1.1.3
7694 echo 'FreeMunger sources' >file1
7695 echo 'FreeMunger sources' >file2
7696 # Not completely sure how the conflict detection is supposed to
7697 # be working here (haven't really thought about it).
7698 # We use an explicit -d option to test that it is reflected
7699 # in the suggested checkout.
7700 dotest_sort importb-2 \
7701 "${testcvs} -d ${CVSROOT} import -m add -b 1.1.3 first-dir freemunger freemunger-1_0" \
7705 ${PROG} -d ${CVSROOT} checkout -j<prev_rel_tag> -jfreemunger-1_0 first-dir
7706 2 conflicts created by this import.
7709 Use the following command to help the merge:"
7713 # Now a test of main branch import (into second-dir, not first-dir).
7716 echo 'my own stuff' >mine1.c
7717 echo 'my own stuff' >mine2.c
7718 dotest_fail importb-3 \
7719 "${testcvs} import -m add -b 1 second-dir dummy really_dumb_y" \
7720 "${PROG} \[[a-z]* aborted\]: Only branches with two dots are supported: 1"
7721 : when we implement main-branch import, should be \
7722 "N second-dir/mine1\.c
7723 N second-dir/mine2\.c
7725 No conflicts created by this import"
7731 # when we implement main branch import, will want to
7732 # add "second-dir" here.
7733 dotest importb-4 "${testcvs} -q co first-dir" \
7737 dotest importb-5 "${testcvs} -q log file1" "
7738 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7745 freemunger-1_0: 1\.1\.3\.1
7747 openmunger-1_0: 1\.1\.1\.1
7749 keyword substitution: kv
7750 total revisions: 3; selected revisions: 3
7752 ----------------------------
7754 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
7755 branches: 1\.1\.1; 1\.1\.3;
7757 ----------------------------
7759 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
7761 ----------------------------
7763 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
7765 ============================================================================="
7769 rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
7773 # Test importing a bunch o' files in a bunch o' directories.
7774 # Also the -d option.
7776 mkdir adir bdir cdir
7777 mkdir adir/sub1 adir/sub2
7778 mkdir adir/sub1/ssdir
7780 touch adir/sub1/file1 adir/sub2/file2 adir/sub1/ssdir/ssfile
7781 touch -t 197107040343 bdir/subdir/file1
7782 touch -t 203412251801 cdir/cfile
7783 dotest_sort importc-1 \
7784 "${testcvs} import -d -m import-it first-dir vendor release" \
7787 N first-dir/adir/sub1/file1
7788 N first-dir/adir/sub1/ssdir/ssfile
7789 N first-dir/adir/sub2/file2
7790 N first-dir/bdir/subdir/file1
7791 N first-dir/cdir/cfile
7792 No conflicts created by this import
7793 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir
7794 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1
7795 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1/ssdir
7796 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub2
7797 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/bdir
7798 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/bdir/subdir
7799 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/cdir"
7802 dotest importc-2 "${testcvs} -q co first-dir" \
7803 "U first-dir/adir/sub1/file1
7804 U first-dir/adir/sub1/ssdir/ssfile
7805 U first-dir/adir/sub2/file2
7806 U first-dir/bdir/subdir/file1
7807 U first-dir/cdir/cfile"
7809 dotest importc-3 "${testcvs} update adir/sub1" \
7810 "${PROG} update: Updating adir/sub1
7811 ${PROG} update: Updating adir/sub1/ssdir"
7812 dotest importc-4 "${testcvs} update adir/sub1 bdir/subdir" \
7813 "${PROG} update: Updating adir/sub1
7814 ${PROG} update: Updating adir/sub1/ssdir
7815 ${PROG} update: Updating bdir/subdir"
7817 echo modify >>cdir/cfile
7819 "${testcvs} -q rtag -b -r release wip_test first-dir" ""
7820 dotest importc-6 "${testcvs} -q update -r wip_test" "M cdir/cfile"
7822 # This used to fail in local mode
7823 dotest importc-7 "${testcvs} -q ci -m modify -r wip_test" \
7824 "Checking in cdir/cfile;
7825 ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v <-- cfile
7826 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
7829 # TODO: should also be testing "import -d" when we update
7831 dotest importc-8 "${testcvs} -q log cdir/cfile" "
7832 RCS file: ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v
7833 Working file: cdir/cfile
7839 wip_test: 1\.1\.1\.1\.0\.2
7842 keyword substitution: kv
7843 total revisions: 3; selected revisions: 3
7845 ----------------------------
7847 date: 2034/12/2[4-6] [0-9][0-9]:01:[0-9][0-9]; author: ${username}; state: Exp;
7850 ----------------------------
7852 date: 2034/12/2[4-6] [0-9][0-9]:01:[0-9][0-9]; author: ${username}; state: Exp; lines: ${PLUS}0 -0
7853 branches: 1\.1\.1\.1\.2;
7855 ----------------------------
7856 revision 1\.1\.1\.1\.2\.1
7857 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
7859 ============================================================================="
7861 dotest importc-9 "${testcvs} -q log bdir/subdir/file1" "
7862 RCS file: ${CVSROOT_DIRNAME}/first-dir/bdir/subdir/file1,v
7863 Working file: bdir/subdir/file1
7869 wip_test: 1\.1\.1\.1\.0\.2
7872 keyword substitution: kv
7873 total revisions: 2; selected revisions: 2
7875 ----------------------------
7877 date: 1971/07/0[3-5] [0-9][0-9]:43:[0-9][0-9]; author: ${username}; state: Exp;
7880 ----------------------------
7882 date: 1971/07/0[3-5] [0-9][0-9]:43:[0-9][0-9]; author: ${username}; state: Exp; lines: ${PLUS}0 -0
7884 ============================================================================="
7887 # Now tests of absolute pathnames and .. as repository directory.
7889 dotest_fail importc-10 \
7890 "${testcvs} import -m imp ../other vendor release2" \
7891 "${PROG} \[[a-z]* aborted\]: directory \.\./other not relative within the repository"
7892 dotest_fail importc-11 \
7893 "${testcvs} import -m imp ${TESTDIR}/other vendor release3" \
7894 "${PROG} \[[a-z]* aborted\]: directory ${TESTDIR}/other not relative within the repository"
7895 dotest_fail importc-12 "test -d ${TESTDIR}/other" ""
7899 rm -rf ${CVSROOT_DIRNAME}/first-dir
7905 touch file1 file2 file3
7906 dotest_fail import-CVS-1 "$testcvs import CVS vtag rtag" \
7907 "$PROG import: The word \`CVS' is reserved by CVS and may not be used
7908 $PROG \[import aborted\]: as a directory in a path or as a file name\."
7911 touch sdir/CVS/file4 sdir/CVS/file5 sdir/file6 sdir/file7
7912 # Calling the imported directory import-CVS is dual purpose in the
7913 # following test. It makes sure the path test which matched above
7914 # wasn't too strict.
7915 dotest_sort import-CVS-2 \
7916 "$testcvs import -I! -mimport import-CVS vtag rtag" \
7919 I import-CVS/sdir/CVS
7923 N import-CVS/sdir/file6
7924 N import-CVS/sdir/file7
7925 No conflicts created by this import
7926 $PROG import: Importing $CVSROOT_DIRNAME/import-CVS/sdir"
7929 echo Keeping ${TESTDIR} and exiting due to --keep
7935 rm -rf $CVSROOT_DIRNAME/import-CVS
7938 import-after-initial)
7939 # Properly handle the case in which the first version of a
7940 # file is created by a regular cvs add and commit, and there
7941 # is a subsequent cvs import of the same file. cvs update with
7942 # a date tag must resort to searching the vendor branch only if
7943 # the initial version of the file was created at the same time
7944 # as the initial version on the vendor branch.
7951 # Create the module.
7952 dotest import-after-initial-1 \
7953 "$testcvs -Q import -m. $module X Y" ''
7956 # Check it out and add a file.
7957 dotest import-after-initial-2 "$testcvs -Q co $module" ''
7959 echo original > $file
7960 dotest import-after-initial-3 "${testcvs} -Q add $file" ""
7961 dotest import-after-initial-4 "${testcvs} -Q ci -m. $file" \
7962 "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
7965 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
7966 initial revision: 1\.1
7969 # Delay a little so the following import isn't done in the same
7970 # second as the preceding commit.
7973 # Do the first import of $file *after* $file already has an
7977 echo newer-via-import > $file
7978 dotest import-after-initial-5 \
7979 "$testcvs -Q import -m. $module X Y2" ''
7982 # Sleep a second so we're sure to be after the second of the import.
7985 dotest import-after-initial-6 \
7986 "$testcvs -Q update -p -D now $file" 'original'
7990 rm -rf ${CVSROOT_DIRNAME}/$module
7993 branch-after-import)
7994 # Test branching after an import via both cvs tag -b and
7995 # cvs add to verify that the HEAD remains at 1.1.1.1
7996 # This was a FreeBSD bug documented at the URL:
7997 # http://www.freebsd.org/cgi/query-pr.cgi?pr=4033
7999 mkdir branch-after-import
8000 cd branch-after-import
8002 # OK, first we get some sources from the NetMunger project,
8003 # and import them into the 1.1.1 vendor branch.
8006 echo 'OpenMunger sources' >file1
8007 echo 'OpenMunger sources' >file2
8008 dotest_sort branch-after-import-1 \
8009 "${testcvs} import -m add first-dir openmunger openmunger-1_0" \
8014 No conflicts created by this import'
8017 # Next checkout the new module
8018 dotest branch-after-import-2 \
8019 "${testcvs} -q co first-dir" \
8023 # Branch tag the file1 and cvs add file2,
8024 # the branch should remain the same in both cases
8025 # such that a new import will not require a conflict
8027 dotest branch-after-import-3 \
8028 "${testcvs} tag -b TESTTOTRON file1" \
8030 dotest branch-after-import-4 \
8031 "${testcvs} -q update -r TESTTOTRON" \
8032 "${PROG} update: file2 is no longer in the repository"
8034 cp ../imp-dir/file2 .
8035 dotest branch-after-import-5 \
8036 "${testcvs} add file2" \
8037 "${PROG} add: scheduling file .file2. for addition on branch .TESTTOTRON.
8038 ${PROG} add: use .${PROG} commit. to add this file permanently"
8040 dotest branch-after-import-6 \
8041 "${testcvs} commit -m cvs-add file2" \
8043 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
8044 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
8048 echo Keeping ${TESTDIR} and exiting due to --keep
8053 rm -r branch-after-import
8054 rm -rf ${CVSROOT_DIRNAME}/first-dir
8058 # Test doing joins which involve adding and removing files.
8059 # Variety of scenarios (see list below), in the context of:
8060 # * merge changes from T1 to T2 into the main line
8061 # * merge changes from branch 'branch' into the main line
8062 # * merge changes from branch 'branch' into branch 'br2'.
8063 # See also binfile2, which does similar things with binary files.
8064 # See also join2, which tests joining (and update -A) on only
8065 # a single file, rather than a directory.
8066 # See also rmadd2, which tests -j cases not involving branches
8067 # (e.g. undoing a commit)
8068 # See also join3, which tests some cases involving the greatest
8069 # common ancestor. Here is a list of tests according to branch
8072 # --->bp---->trunk too many to mention
8076 # --->bp---->trunk multibranch, multibranch2
8079 # --->bp1----->bp2---->trunk join3
8082 # --->bp1----->trunk
8083 # \----bp2---->branch branches
8084 # \------>branch-of-branch
8086 # We check merging changes from T1 to T2 into the main line.
8087 # Here are the interesting cases I can think of:
8088 # 1) File added between T1 and T2, not on main line.
8089 # File should be marked for addition.
8090 # 2) File added between T1 and T2, also added on main line.
8092 # 3) File removed between T1 and T2, unchanged on main line.
8093 # File should be marked for removal.
8094 # 4) File removed between T1 and T2, modified on main line.
8095 # If mod checked in, file should be marked for removal.
8096 # If mod still in working directory, conflict.
8097 # 5) File removed between T1 and T2, was never on main line.
8098 # Nothing should happen.
8099 # 6) File removed between T1 and T2, also removed on main line.
8100 # Nothing should happen.
8101 # 7) File not added between T1 and T2, added on main line.
8102 # Nothing should happen.
8103 # 8) File not modified between T1 and T2, removed on main line.
8104 # Nothing should happen.
8105 # 9) File modified between T1 and T2, removed on main line.
8107 # 10) File was never on branch, removed on main line.
8108 # Nothing should happen.
8110 # We also check merging changes from a branch into the main
8111 # line. Here are the interesting cases:
8112 # 1) File added on branch, not on main line.
8113 # File should be marked for addition.
8114 # 2) File added on branch, also added on main line.
8116 # 3) File removed on branch, unchanged on main line.
8117 # File should be marked for removal.
8118 # 4) File removed on branch, modified on main line.
8120 # 5) File removed on branch, was never on main line.
8121 # Nothing should happen.
8122 # 6) File removed on branch, also removed on main line.
8123 # Nothing should happen.
8124 # 7) File added on main line, not added on branch.
8125 # Nothing should happen.
8126 # 8) File removed on main line, not modified on branch.
8127 # Nothing should happen.
8128 # 9) File modified on branch, removed on main line.
8130 # 10) File was never on branch, removed on main line.
8131 # Nothing should happen.
8133 # In the tests below, fileN represents case N in the above
8136 mkdir ${CVSROOT_DIRNAME}/first-dir
8139 dotest join-1 "${testcvs} -q co first-dir" ''
8144 echo 'first revision of file3' > file3
8145 echo 'first revision of file4' > file4
8146 echo 'first revision of file6' > file6
8147 echo 'first revision of file8' > file8
8148 echo 'first revision of file9' > file9
8149 dotest join-2 "${testcvs} add file3 file4 file6 file8 file9" \
8150 "${PROG}"' add: scheduling file `file3'\'' for addition
8151 '"${PROG}"' add: scheduling file `file4'\'' for addition
8152 '"${PROG}"' add: scheduling file `file6'\'' for addition
8153 '"${PROG}"' add: scheduling file `file8'\'' for addition
8154 '"${PROG}"' add: scheduling file `file9'\'' for addition
8155 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
8157 dotest join-3 "${testcvs} -q commit -m add" \
8158 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
8161 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
8162 initial revision: 1\.1
8164 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
8167 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
8168 initial revision: 1\.1
8170 RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
8173 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
8174 initial revision: 1\.1
8176 RCS file: ${CVSROOT_DIRNAME}/first-dir/file8,v
8179 ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
8180 initial revision: 1\.1
8182 RCS file: ${CVSROOT_DIRNAME}/first-dir/file9,v
8185 ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
8186 initial revision: 1\.1
8190 dotest join-4 "${testcvs} -q tag -b branch ." \
8197 # Add file2, file7, and file10, modify file4, and remove
8198 # file6, file8, and file9.
8199 echo 'first revision of file2' > file2
8200 echo 'second revision of file4' > file4
8201 echo 'first revision of file7' > file7
8202 rm file6 file8 file9
8203 echo 'first revision of file10' > file10
8204 dotest join-5 "${testcvs} add file2 file7 file10" \
8205 "${PROG}"' add: scheduling file `file2'\'' for addition
8206 '"${PROG}"' add: scheduling file `file7'\'' for addition
8207 '"${PROG}"' add: scheduling file `file10'\'' for addition
8208 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
8209 dotest join-6 "${testcvs} rm file6 file8 file9" \
8210 "${PROG}"' remove: scheduling `file6'\'' for removal
8211 '"${PROG}"' remove: scheduling `file8'\'' for removal
8212 '"${PROG}"' remove: scheduling `file9'\'' for removal
8213 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
8214 dotest join-7 "${testcvs} -q ci -mx ." \
8215 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
8218 ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
8219 initial revision: 1\.1
8221 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
8224 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
8225 initial revision: 1\.1
8228 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
8229 new revision: 1\.2; previous revision: 1\.1
8232 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
8233 new revision: delete; previous revision: 1\.1
8235 RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
8238 ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
8239 initial revision: 1\.1
8242 ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
8243 new revision: delete; previous revision: 1\.1
8246 ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
8247 new revision: delete; previous revision: 1\.1
8251 dotest join-7a "${testcvs} rm -f file10" \
8252 "${PROG}"' remove: scheduling `file10'\'' for removal
8253 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
8254 dotest join-7b "${testcvs} -q ci -mx ." \
8256 ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
8257 new revision: delete; previous revision: 1\.1
8260 # Check out the branch.
8264 dotest join-8 "${testcvs} -q co -r branch first-dir" \
8273 # Modify the files on the branch, so that T1 is not an
8274 # ancestor of the main line, and add file5
8275 echo 'first branch revision of file3' > file3
8276 echo 'first branch revision of file4' > file4
8277 echo 'first branch revision of file5' > file5
8278 echo 'first branch revision of file6' > file6
8279 echo 'first branch revision of file9' > file9
8280 dotest join-9 "${testcvs} add file5" \
8281 "${PROG}"' add: scheduling file `file5'\'' for addition on branch `branch'\''
8282 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
8283 dotest join-10 "${testcvs} -q ci -mx ." \
8285 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
8286 new revision: 1\.1\.2\.1; previous revision: 1\.1
8289 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
8290 new revision: 1\.1\.2\.1; previous revision: 1\.1
8292 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v
8295 ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
8296 new revision: 1\.1\.2\.1; previous revision: 1\.1
8299 ${CVSROOT_DIRNAME}/first-dir/Attic/file6,v <-- file6
8300 new revision: 1\.1\.2\.1; previous revision: 1\.1
8303 ${CVSROOT_DIRNAME}/first-dir/Attic/file9,v <-- file9
8304 new revision: 1\.1\.2\.1; previous revision: 1\.1
8307 # Tag the current revisions on the branch.
8308 dotest join-11 "${testcvs} -q tag T1 ." \
8316 # Add file1 and file2, modify file9, and remove the other files.
8317 echo 'first branch revision of file1' > file1
8318 echo 'first branch revision of file2' > file2
8319 echo 'second branch revision of file9' > file9
8320 rm file3 file4 file5 file6
8321 dotest join-12 "${testcvs} add file1 file2" \
8322 "${PROG}"' add: scheduling file `file1'\'' for addition on branch `branch'\''
8323 '"${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
8324 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
8325 dotest join-13 "${testcvs} rm file3 file4 file5 file6" \
8326 "${PROG}"' remove: scheduling `file3'\'' for removal
8327 '"${PROG}"' remove: scheduling `file4'\'' for removal
8328 '"${PROG}"' remove: scheduling `file5'\'' for removal
8329 '"${PROG}"' remove: scheduling `file6'\'' for removal
8330 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
8331 dotest join-14 "${testcvs} -q ci -mx ." \
8332 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
8335 ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v <-- file1
8336 new revision: 1\.1\.2\.1; previous revision: 1\.1
8339 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
8340 new revision: 1\.1\.2\.1; previous revision: 1\.1
8343 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
8344 new revision: delete; previous revision: 1\.1\.2\.1
8347 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
8348 new revision: delete; previous revision: 1\.1\.2\.1
8351 ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
8352 new revision: delete; previous revision: 1\.1\.2\.1
8355 ${CVSROOT_DIRNAME}/first-dir/Attic/file6,v <-- file6
8356 new revision: delete; previous revision: 1\.1\.2\.1
8359 ${CVSROOT_DIRNAME}/first-dir/Attic/file9,v <-- file9
8360 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
8363 # Tag the current revisions on the branch.
8364 dotest join-15 "${testcvs} -q tag T2 ." \
8370 # Do a checkout with a merge.
8374 dotest join-16 "${testcvs} -q co -jT1 -jT2 first-dir" \
8377 '"${PROG}"' checkout: file first-dir/file2 exists, but has been added in revision T2
8379 '"${PROG}"' checkout: scheduling first-dir/file3 for removal
8381 '"${PROG}"' checkout: scheduling first-dir/file4 for removal
8383 '"${PROG}"' checkout: file first-dir/file9 does not exist, but is present in revision T2'
8385 # Verify that the right changes have been scheduled.
8387 dotest join-17 "${testcvs} -q update" \
8392 # Modify file4 locally, and do an update with a merge.
8393 cd ../../1/first-dir
8394 echo 'third revision of file4' > file4
8395 dotest join-18 "${testcvs} -q update -jT1 -jT2 ." \
8397 '"${PROG}"' update: file file2 exists, but has been added in revision T2
8398 '"${PROG}"' update: scheduling file3 for removal
8400 '"${PROG}"' update: file file4 is locally modified, but has been removed in revision T2
8401 '"${PROG}"' update: file file9 does not exist, but is present in revision T2'
8403 # Verify that the right changes have been scheduled.
8404 dotest join-19 "${testcvs} -q update" \
8409 # Do a checkout with a merge from a single revision.
8411 # FIXME: CVS currently gets this wrong. file2 has been
8412 # added on both the branch and the main line, and so should
8413 # be regarded as a conflict. However, given the way that
8414 # CVS sets up the RCS file, there is no way to distinguish
8415 # this case from the case of file2 having existed before the
8416 # branch was made. This could be fixed by reserving
8417 # a revision somewhere, perhaps 1.1, as an always dead
8418 # revision which can be used as the source for files added
8422 dotest join-20 "${testcvs} -q co -jbranch first-dir" \
8425 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
8426 retrieving revision 1\.1
8427 retrieving revision 1\.1\.2\.1
8428 Merging differences between 1\.1 and 1\.1\.2\.1 into file2
8430 ${PROG} checkout: scheduling first-dir/file3 for removal
8432 ${PROG} checkout: file first-dir/file4 has been modified, but has been removed in revision branch
8434 ${PROG} checkout: file first-dir/file9 does not exist, but is present in revision branch"
8436 # Verify that the right changes have been scheduled.
8437 # The M file2 line is a bug; see above join-20.
8439 dotest join-21 "${testcvs} -q update" \
8444 # Checkout the main line again.
8447 dotest join-22 "${testcvs} -q co first-dir" \
8453 # Modify file4 locally, and do an update with a merge from a
8455 # The file2 handling is a bug; see above join-20.
8457 echo 'third revision of file4' > file4
8458 dotest join-23 "${testcvs} -q update -jbranch ." \
8460 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
8461 retrieving revision 1\.1
8462 retrieving revision 1\.1\.2\.1
8463 Merging differences between 1\.1 and 1\.1\.2\.1 into file2
8464 ${PROG} update: scheduling file3 for removal
8466 ${PROG} update: file file4 is locally modified, but has been removed in revision branch
8467 ${PROG} update: file file9 does not exist, but is present in revision branch"
8469 # Verify that the right changes have been scheduled.
8470 # The M file2 line is a bug; see above join-20
8471 dotest join-24 "${testcvs} -q update" \
8479 # Checkout the main line again and make a new branch which we
8482 dotest join-25 "${testcvs} -q co first-dir" \
8488 dotest join-26 "${testcvs} -q tag -b br2" \
8493 dotest join-27 "${testcvs} -q update -r br2" ""
8494 # The handling of file8 and file9 here look fishy to me. I don't
8495 # see why it should be different from the case where we merge to
8496 # the trunk (e.g. join-23).
8497 dotest join-28 "${testcvs} -q update -j branch" \
8499 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
8500 retrieving revision 1.1
8501 retrieving revision 1.1.2.1
8502 Merging differences between 1.1 and 1.1.2.1 into file2
8503 ${PROG} update: scheduling file3 for removal
8504 ${PROG} update: file file4 has been modified, but has been removed in revision branch
8507 # Verify that the right changes have been scheduled.
8508 dotest join-29 "${testcvs} -q update" \
8515 # Checkout the mainline again to try updating and merging between two
8516 # branches in the same step
8517 # this seems a likely scenario - the user finishes up on branch and
8518 # updates to br2 and merges in the same step - and there was a bug
8519 # once that if the file was removed in the update then it wouldn't be
8520 # readded in the merge
8523 dotest join-twobranch-1 "${testcvs} -q co -rbranch first-dir" \
8529 dotest join-twobranch-2 "${testcvs} -q update -rbr2 -jbranch" \
8530 "${PROG} update: file1 is no longer in the repository
8533 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
8534 retrieving revision 1\.1
8535 retrieving revision 1\.1\.2\.1
8536 Merging differences between 1\.1 and 1\.1\.2\.1 into file2
8538 ${PROG} update: scheduling file3 for removal
8540 ${PROG} update: file file4 has been modified, but has been removed in revision branch
8542 ${PROG} update: file8 is no longer in the repository
8544 ${PROG} update: file9 is no longer in the repository
8546 # Verify that the right changes have been scheduled.
8547 dotest join-twobranch-3 "${testcvs} -q update" \
8554 # Checkout the mainline again to try merging from the trunk
8558 dotest join-30 "${testcvs} -q co first-dir" \
8565 # Tag the current revisions on the trunk.
8566 dotest join-31 "${testcvs} -q tag T3 ." \
8573 echo 'second revision of file7' > file7
8574 dotest join-32 "${testcvs} -q ci -mx ." \
8576 ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
8577 new revision: 1\.2; previous revision: 1\.1
8581 dotest join-33 "${testcvs} -q tag T4 ." \
8587 # Now update branch to T3.
8588 cd ../../2/first-dir
8589 dotest join-34 "${testcvs} -q up -jT3" \
8590 "${PROG} update: file file4 does not exist, but is present in revision T3
8593 # Verify that the right changes have been scheduled.
8594 dotest join-35 "${testcvs} -q update" \
8598 # This is probably a bug, although in this particular case it just
8599 # happens to do the right thing; see above join-20.
8600 dotest join-36 "${testcvs} -q up -j T3 -j T4" \
8602 RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
8603 retrieving revision 1\.1
8604 retrieving revision 1\.2
8605 Merging differences between 1\.1 and 1\.2 into file7"
8607 # Verify that the right changes have been scheduled.
8608 dotest join-37 "${testcvs} -q update" \
8614 rm -rf ${CVSROOT_DIRNAME}/first-dir
8618 # More joining tests.
8620 # First the usual setup; create a directory first-dir, a file
8621 # first-dir/file1, and a branch br1.
8623 dotest join2-1 "${testcvs} -q co -l ." ''
8625 dotest join2-2 "${testcvs} add first-dir" \
8626 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
8628 echo 'initial contents of file1' >file1
8629 dotest join2-3 "${testcvs} add file1" \
8630 "${PROG} add: scheduling file .file1. for addition
8631 ${PROG} add: use .${PROG} commit. to add this file permanently"
8632 dotest join2-4 "${testcvs} -q ci -m add" \
8633 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8636 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8637 initial revision: 1\.1
8639 dotest join2-5 "${testcvs} -q tag -b br1" "T file1"
8640 dotest join2-6 "${testcvs} -q update -r br1" ""
8641 echo 'modify on branch' >>file1
8643 dotest join2-6a "${testcvs} add bradd" \
8644 "${PROG} add: scheduling file .bradd. for addition on branch .br1.
8645 ${PROG} add: use .${PROG} commit. to add this file permanently"
8646 dotest join2-7 "${testcvs} -q ci -m modify" \
8647 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
8650 ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v <-- bradd
8651 new revision: 1\.1\.2\.1; previous revision: 1\.1
8654 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8655 new revision: 1\.1\.2\.1; previous revision: 1\.1
8658 # Here is the unusual/pathological part. We switch back to
8659 # the trunk *for file1 only*, not for the whole directory.
8660 dotest join2-8 "${testcvs} -q update -A file1" '[UP] file1'
8661 dotest join2-9 "${testcvs} -q status file1" \
8662 "===================================================================
8663 File: file1 Status: Up-to-date
8665 Working revision: 1\.1.*
8666 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
8669 Sticky Options: (none)"
8670 dotest join2-10 "cat CVS/Tag" "Tbr1"
8672 dotest join2-11 "${testcvs} -q update -j br1 file1" \
8673 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8674 retrieving revision 1\.1
8675 retrieving revision 1\.1\.2\.1
8676 Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
8677 dotest join2-12 "cat file1" "initial contents of file1
8679 # We should have no sticky tag on file1
8680 dotest join2-13 "${testcvs} -q status file1" \
8681 "===================================================================
8682 File: file1 Status: Locally Modified
8684 Working revision: 1\.1.*
8685 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
8688 Sticky Options: (none)"
8689 dotest join2-14 "cat CVS/Tag" "Tbr1"
8690 # And the checkin should go to the trunk
8691 dotest join2-15 "${testcvs} -q ci -m modify file1" \
8693 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8694 new revision: 1\.2; previous revision: 1\.1
8697 # OK, the above is all well and good and has worked for some
8698 # time. Now try the case where the file had been added on
8700 dotest join2-16 "${testcvs} -q update -r br1" "[UP] file1"
8701 # The workaround is to update the whole directory.
8702 # The non-circumvented version won't work. The reason is that
8703 # update removes the entry from CVS/Entries, so of course we get
8704 # the tag from CVS/Tag and not Entries. I suppose maybe
8705 # we could invent some new format in Entries which would handle
8706 # this, but doing so, and handling it properly throughout
8707 # CVS, would be a lot of work and I'm not sure this case justifies
8709 dotest join2-17-circumvent "${testcvs} -q update -A" \
8710 "${PROG} update: bradd is no longer in the repository
8712 : dotest join2-17 "${testcvs} -q update -A bradd" \
8713 "${PROG} update: warning: bradd is not (any longer) pertinent"
8714 dotest join2-18 "${testcvs} -q update -j br1 bradd" "U bradd"
8715 dotest join2-19 "${testcvs} -q status bradd" \
8716 "===================================================================
8717 File: bradd Status: Locally Added
8719 Working revision: New file!
8720 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
8723 Sticky Options: (none)"
8724 dotest join2-20 "${testcvs} -q ci -m modify bradd" \
8726 ${CVSROOT_DIRNAME}/first-dir/bradd,v <-- bradd
8727 new revision: 1\.2; previous revision: 1\.1
8732 rm -rf ${CVSROOT_DIRNAME}/first-dir
8736 # See "join" for a list of other joining/branching tests.
8737 # First the usual setup; create a directory first-dir, a file
8738 # first-dir/file1, and a branch br1.
8740 dotest join3-1 "${testcvs} -q co -l ." ''
8742 dotest join3-2 "${testcvs} add first-dir" \
8743 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
8745 echo 'initial contents of file1' >file1
8746 dotest join3-3 "${testcvs} add file1" \
8747 "${PROG} add: scheduling file .file1. for addition
8748 ${PROG} add: use .${PROG} commit. to add this file permanently"
8749 dotest join3-4 "${testcvs} -q ci -m add" \
8750 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8753 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8754 initial revision: 1\.1
8756 dotest join3-5 "${testcvs} -q tag -b br1" "T file1"
8757 dotest join3-6 "${testcvs} -q update -r br1" ""
8758 echo 'br1:line1' >>file1
8759 dotest join3-7 "${testcvs} -q ci -m modify" \
8761 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8762 new revision: 1\.1\.2\.1; previous revision: 1\.1
8765 # Now back to the trunk for:
8766 # another revision and another branch for file1.
8767 # add file2, which will exist on trunk and br2 but not br1.
8768 dotest join3-8 "${testcvs} -q update -A" "[UP] file1"
8769 echo 'trunk:line1' > file2
8770 dotest join3-8a "${testcvs} add file2" \
8771 "${PROG} add: scheduling file .file2. for addition
8772 ${PROG} add: use .${PROG} commit. to add this file permanently"
8773 echo 'trunk:line1' >>file1
8774 dotest join3-9 "${testcvs} -q ci -m modify" \
8776 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8777 new revision: 1\.2; previous revision: 1\.1
8779 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
8782 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
8783 initial revision: 1\.1
8785 dotest join3-10 "${testcvs} -q tag -b br2" "T file1
8788 # Before we actually have any revision on br2, let's try a join
8789 dotest join3-11 "${testcvs} -q update -r br1" "[UP] file1
8790 ${PROG} update: file2 is no longer in the repository"
8791 dotest join3-12 "${testcvs} -q update -j br2" \
8792 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8793 retrieving revision 1\.1
8794 retrieving revision 1\.2
8795 Merging differences between 1\.1 and 1\.2 into file1
8796 rcsmerge: warning: conflicts during merge
8798 dotest join3-13 "cat file1" \
8799 "initial contents of file1
8807 # OK, we'll try the same thing with a revision on br2.
8808 dotest join3-14 "${testcvs} -q update -r br2 file1" \
8809 "${PROG} update: warning: file1 was lost
8811 echo 'br2:line1' >>file1
8812 dotest join3-15 "${testcvs} -q ci -m modify file1" \
8814 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8815 new revision: 1\.2\.2\.1; previous revision: 1\.2
8818 # OK, now we can join br2 to br1
8819 dotest join3-16 "${testcvs} -q update -r br1 file1" "[UP] file1"
8820 # It may seem odd, to merge a higher branch into a lower
8821 # branch, but in fact CVS defines the ancestor as 1.1
8822 # and so it merges both the 1.1->1.2 and 1.2->1.2.2.1 changes.
8823 # This seems like a reasonably plausible behavior.
8824 dotest join3-17 "${testcvs} -q update -j br2 file1" \
8825 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8826 retrieving revision 1\.1
8827 retrieving revision 1\.2\.2\.1
8828 Merging differences between 1\.1 and 1\.2\.2\.1 into file1
8829 rcsmerge: warning: conflicts during merge"
8830 dotest join3-18 "cat file1" \
8831 "initial contents of file1
8837 [>]>>>>>> 1\.2\.2\.1"
8841 rm -rf ${CVSROOT_DIRNAME}/first-dir
8845 # Like join, but with local (uncommitted) modifications.
8847 mkdir ${CVSROOT_DIRNAME}/first-dir
8850 dotest join4-1 "${testcvs} -q co first-dir" ''
8855 echo 'first revision of file3' > file3
8856 echo 'first revision of file4' > file4
8857 echo 'first revision of file6' > file6
8858 echo 'first revision of file8' > file8
8859 echo 'first revision of file9' > file9
8860 dotest join4-2 "${testcvs} add file3 file4 file6 file8 file9" \
8861 "${PROG}"' add: scheduling file `file3'\'' for addition
8862 '"${PROG}"' add: scheduling file `file4'\'' for addition
8863 '"${PROG}"' add: scheduling file `file6'\'' for addition
8864 '"${PROG}"' add: scheduling file `file8'\'' for addition
8865 '"${PROG}"' add: scheduling file `file9'\'' for addition
8866 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
8868 dotest join4-3 "${testcvs} -q commit -m add" \
8869 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
8872 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
8873 initial revision: 1\.1
8875 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
8878 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
8879 initial revision: 1\.1
8881 RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
8884 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
8885 initial revision: 1\.1
8887 RCS file: ${CVSROOT_DIRNAME}/first-dir/file8,v
8890 ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
8891 initial revision: 1\.1
8893 RCS file: ${CVSROOT_DIRNAME}/first-dir/file9,v
8896 ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
8897 initial revision: 1\.1
8901 dotest join4-4 "${testcvs} -q tag -b branch ." \
8909 echo 'first revision of file10' > file10
8910 dotest join4-7a "${testcvs} add file10" \
8911 "${PROG}"' add: scheduling file `file10'\'' for addition
8912 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
8913 dotest join4-7b "${testcvs} -q ci -mx ." \
8914 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
8917 ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
8918 initial revision: 1\.1
8921 # Add file2 and file7, modify file4, and remove
8922 # file6, file8, file9, and file10.
8923 echo 'first revision of file2' > file2
8924 echo 'second revision of file4' > file4
8925 echo 'first revision of file7' > file7
8926 rm file6 file8 file9 file10
8927 dotest join4-5 "${testcvs} add file2 file7" \
8928 "${PROG}"' add: scheduling file `file2'\'' for addition
8929 '"${PROG}"' add: scheduling file `file7'\'' for addition
8930 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
8931 dotest join4-6 "${testcvs} rm file6 file8 file9 file10" \
8932 "${PROG}"' remove: scheduling `file6'\'' for removal
8933 '"${PROG}"' remove: scheduling `file8'\'' for removal
8934 '"${PROG}"' remove: scheduling `file9'\'' for removal
8935 '"${PROG}"' remove: scheduling `file10'\'' for removal
8936 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
8938 # Check out the branch.
8942 dotest join4-8 "${testcvs} -q co -r branch first-dir" \
8951 # Modify the files on the branch, so that T1 is not an
8952 # ancestor of the main line, and add file5
8953 echo 'first branch revision of file3' > file3
8954 echo 'first branch revision of file4' > file4
8955 echo 'first branch revision of file5' > file5
8956 echo 'first branch revision of file6' > file6
8957 echo 'first branch revision of file9' > file9
8958 dotest join4-9 "${testcvs} add file5" \
8959 "${PROG}"' add: scheduling file `file5'\'' for addition on branch `branch'\''
8960 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
8961 dotest join4-10 "${testcvs} -q ci -mx ." \
8963 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
8964 new revision: 1\.1\.2\.1; previous revision: 1\.1
8967 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
8968 new revision: 1\.1\.2\.1; previous revision: 1\.1
8970 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v
8973 ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
8974 new revision: 1\.1\.2\.1; previous revision: 1\.1
8977 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
8978 new revision: 1\.1\.2\.1; previous revision: 1\.1
8981 ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
8982 new revision: 1\.1\.2\.1; previous revision: 1\.1
8985 # Tag the current revisions on the branch.
8986 dotest join4-11 "${testcvs} -q tag T1 ." \
8994 # Add file1 and file2, modify file9, and remove the other files.
8995 echo 'first branch revision of file1' > file1
8996 echo 'first branch revision of file2' > file2
8997 echo 'second branch revision of file9' > file9
8998 rm file3 file4 file5 file6
8999 dotest join4-12 "${testcvs} add file1 file2" \
9000 "${PROG}"' add: scheduling file `file1'\'' for addition on branch `branch'\''
9001 '"${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
9002 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
9003 dotest join4-13 "${testcvs} rm file3 file4 file5 file6" \
9004 "${PROG}"' remove: scheduling `file3'\'' for removal
9005 '"${PROG}"' remove: scheduling `file4'\'' for removal
9006 '"${PROG}"' remove: scheduling `file5'\'' for removal
9007 '"${PROG}"' remove: scheduling `file6'\'' for removal
9008 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
9009 dotest join4-14 "${testcvs} -q ci -mx ." \
9010 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
9013 ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v <-- file1
9014 new revision: 1\.1\.2\.1; previous revision: 1\.1
9016 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v
9019 ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v <-- file2
9020 new revision: 1\.1\.2\.1; previous revision: 1\.1
9023 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
9024 new revision: delete; previous revision: 1\.1\.2\.1
9027 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
9028 new revision: delete; previous revision: 1\.1\.2\.1
9031 ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
9032 new revision: delete; previous revision: 1\.1\.2\.1
9035 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
9036 new revision: delete; previous revision: 1\.1\.2\.1
9039 ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
9040 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
9043 # Tag the current revisions on the branch.
9044 dotest join4-15 "${testcvs} -q tag T2 ." \
9050 # Modify file4 locally, and do an update with a merge.
9051 cd ../../1/first-dir
9052 echo 'third revision of file4' > file4
9053 dotest join4-18 "${testcvs} -q update -jT1 -jT2 ." \
9057 '"${PROG}"' update: file file2 exists, but has been added in revision T2
9058 '"${PROG}"' update: scheduling file3 for removal
9060 '"${PROG}"' update: file file4 is locally modified, but has been removed in revision T2
9065 '"${PROG}"' update: file file9 does not exist, but is present in revision T2'
9067 # Verify that the right changes have been scheduled.
9068 dotest join4-19 "${testcvs} -q update" \
9082 rm -rf ${CVSROOT_DIRNAME}/first-dir
9086 # This test verifies that CVS can handle filenames starting with a
9087 # dash (`-') properly. What used to happen was that CVS handled it
9088 # just fine, until it went to pass them as arguments to the diff
9089 # library, at which point it neglected to pass `--' before the file
9090 # list, causing the diff library to attempt to interpret the file
9091 # name as an argument.
9092 mkdir join5; cd join5
9094 dotest join5-init-1 "${testcvs} -Q co -l ."
9096 dotest join5-init-2 "${testcvs} -Q add join5"
9098 echo "there once was a file from harrisburg" >-file
9099 echo "who's existance it seems was quiteabsurd" >>-file
9100 dotest join5-init-3 "${testcvs} -Q add -- -file"
9101 dotest join5-init-4 "${testcvs} -q ci -minitial" \
9102 "RCS file: ${CVSROOT_DIRNAME}/join5/-file,v
9105 ${CVSROOT_DIRNAME}/join5/-file,v <-- -file
9106 initial revision: 1\.1
9111 dotest join5-init-5 "${testcvs} -Q co join5"
9113 echo "it tested for free" >>-file
9114 echo "when paid it should be" >>-file
9115 dotest join5-init-4 "${testcvs} -q ci -msecond" \
9117 ${CVSROOT_DIRNAME}/join5/-file,v <-- -file
9118 new revision: 1\.2; previous revision: 1\.1
9123 echo "but maybe it could charge bytheword" >>-file
9124 # This is the test that used to spew complaints from diff3:
9125 dotest join5 "${testcvs} up" \
9126 "${PROG} update: Updating \.
9127 RCS file: ${CVSROOT_DIRNAME}/join5/-file,v
9128 retrieving revision 1\.1
9129 retrieving revision 1\.2
9130 Merging differences between 1\.1 and 1\.2 into -file
9131 rcsmerge: warning: conflicts during merge
9132 ${PROG} update: conflicts found in -file
9137 echo Keeping ${TESTDIR} and exiting due to --keep
9143 rm -rf ${CVSROOT_DIRNAME}/join5
9147 mkdir join6; cd join6
9149 dotest join6-init-1 "${testcvs} -Q co -l ."
9151 dotest join6-init-2 "${testcvs} -Q add join6"
9156 dotest join6-1 "${testcvs} -Q add temp.txt"
9157 dotest join6-2 "${testcvs} -q commit -minitial temp.txt" \
9158 "RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
9160 Checking in temp\.txt;
9161 ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
9162 initial revision: 1\.1
9164 cp temp.txt temp2.txt
9166 dotest join6-3 "${testcvs} -q commit -madd temp.txt" \
9167 "Checking in temp\.txt;
9168 ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
9169 new revision: 1\.2; previous revision: 1\.1
9172 # The case where the merge target is up-to-date and its base revision
9173 # matches the second argument to -j: CVS doesn't bother attempting
9174 # the merge since it already knows that the target contains the
9176 dotest join6-3.3 "${testcvs} update -j1.1 -j1.2 temp.txt" \
9177 "temp\.txt already contains the differences between 1\.1 and 1\.2"
9178 dotest join6-3.4 "${testcvs} diff temp.txt" ""
9180 # The case where the merge target is modified but already contains
9185 dotest join6-3.5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
9187 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
9188 retrieving revision 1\.1
9189 retrieving revision 1\.2
9190 Merging differences between 1\.1 and 1\.2 into temp\.txt
9191 temp\.txt already contains the differences between 1\.1 and 1\.2"
9192 dotest_fail join6-3.6 "${testcvs} diff temp.txt" \
9194 ===================================================================
9195 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
9196 retrieving revision 1\.2
9197 diff -r1\.2 temp.txt
9201 cp temp2.txt temp.txt
9202 dotest_fail join6-4 "${testcvs} diff temp.txt" \
9204 ===================================================================
9205 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
9206 retrieving revision 1\.2
9207 diff -r1\.2 temp\.txt
9211 dotest join6-5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
9213 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
9214 retrieving revision 1\.1
9215 retrieving revision 1\.2
9216 Merging differences between 1\.1 and 1\.2 into temp\.txt"
9217 dotest join6-6 "${testcvs} diff temp.txt" ""
9218 mv temp.txt temp3.txt
9219 dotest join6-7 "sed 's/ddd/dddd/' < temp3.txt > temp.txt" ""
9220 dotest join6-8 "${testcvs} update -j1.1 -j1.2 temp.txt" \
9222 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
9223 retrieving revision 1\.1
9224 retrieving revision 1\.2
9225 Merging differences between 1\.1 and 1\.2 into temp\.txt
9226 rcsmerge: warning: conflicts during merge"
9227 dotest_fail join6-9 "${testcvs} diff temp.txt" \
9229 ===================================================================
9230 RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
9231 retrieving revision 1\.2
9232 diff -r1\.2 temp\.txt
9239 cp temp2.txt temp.txt
9240 dotest join6-10 "${testcvs} -q ci -m del temp.txt" \
9241 "Checking in temp\.txt;
9242 ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
9243 new revision: 1\.3; previous revision: 1\.2
9245 cp temp3.txt temp.txt
9246 dotest_fail join6-11 "${testcvs} diff temp.txt" \
9248 ===================================================================
9249 RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
9250 retrieving revision 1\.3
9251 diff -r1\.3 temp\.txt
9254 dotest join6-12 "${testcvs} update -j1.2 -j1.3 temp.txt" \
9256 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
9257 retrieving revision 1\.2
9258 retrieving revision 1\.3
9259 Merging differences between 1\.2 and 1\.3 into temp\.txt"
9260 dotest join6-13 "${testcvs} diff temp.txt" ""
9262 # The case where the merge target wasn't created until after the
9263 # first tag was applied
9264 rm temp2.txt temp3.txt
9265 dotest join6-20 "${testcvs} -q tag -r1.1 t1" \
9268 dotest join6-21 "${testcvs} -Q add temp2.txt"
9269 dotest join6-22 "${testcvs} -q ci -m." \
9270 "RCS file: ${CVSROOT_DIRNAME}/join6/temp2.txt,v
9272 Checking in temp2\.txt;
9273 ${CVSROOT_DIRNAME}/join6/temp2\.txt,v <-- temp2\.txt
9274 initial revision: 1\.1
9276 dotest join6-23 "${testcvs} -q tag t2" \
9280 dotest join6-24 "${testcvs} -q ci -m." \
9281 "Checking in temp\.txt;
9282 ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
9283 new revision: 1\.4; previous revision: 1\.3
9285 dotest join6-25 "${testcvs} -q up -jt1 -jt2" \
9286 "RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
9287 retrieving revision 1\.1
9288 retrieving revision 1\.3
9289 Merging differences between 1\.1 and 1\.3 into temp.txt
9290 temp.txt already contains the differences between 1\.1 and 1\.3
9291 temp2.txt already contains the differences between creation and 1\.1"
9293 # Now for my next trick: delete the file, recreate it, and
9295 dotest join6-30 "${testcvs} -q rm -f temp2.txt" \
9296 "${PROG} remove: use .${PROG} commit. to remove this file permanently"
9297 dotest join6-31 "${testcvs} -q ci -m. temp2.txt" \
9298 "Removing temp2\.txt;
9299 ${CVSROOT_DIRNAME}/join6/temp2\.txt,v <-- temp2\.txt
9300 new revision: delete; previous revision: 1\.1
9303 # FIXCVS: Local and remote really shouldn't be different and there
9304 # really shouldn't be two different status lines for temp2.txt
9306 dotest_fail join6-32 "${testcvs} -q up -jt1 -jt2" \
9308 RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
9309 retrieving revision 1\.1
9310 retrieving revision 1\.3
9311 Merging differences between 1\.1 and 1\.3 into temp.txt
9312 temp.txt already contains the differences between 1\.1 and 1\.3
9313 ${PROG} update: move away \./temp2\.txt; it is in the way
9316 dotest join6-32 "${testcvs} -q up -jt1 -jt2" \
9317 "RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
9318 retrieving revision 1\.1
9319 retrieving revision 1\.3
9320 Merging differences between 1\.1 and 1\.3 into temp.txt
9321 temp.txt already contains the differences between 1\.1 and 1\.3
9322 ${PROG} update: use .${PROG} add. to create an entry for temp2\.txt
9330 echo Keeping ${TESTDIR} and exiting due to --keep
9335 rm -rf ${CVSROOT_DIRNAME}/join6
9338 join-readonly-conflict)
9339 # Previously, only tests 1 & 11 were being tested. I added the
9340 # intermediate dotest's to try and diagnose a different failure
9342 # Demonstrate that cvs-1.9.29 can fail on 2nd and subsequent
9343 # conflict-evoking join attempts.
9344 # Even with that version of CVS, This test failed only in
9345 # client-server mode, and would have been noticed in normal
9346 # operation only for files that were read-only (either due to
9347 # use of cvs' global -r option, setting the CVSREAD envvar,
9348 # or use of watch lists).
9349 mkdir join-readonly-conflict; cd join-readonly-conflict
9350 dotest join-readonly-conflict-1 "$testcvs -q co -l ." ''
9351 module=join-readonly-conflict
9353 $testcvs -q add $module >>$LOGFILE 2>&1
9358 dotest join-readonly-conflict-2 "$testcvs -Q add $file" ''
9360 dotest join-readonly-conflict-3 "$testcvs -q ci -m . $file" \
9361 "RCS file: $CVSROOT_DIRNAME/$module/$file,v
9364 $CVSROOT_DIRNAME/$module/$file,v <-- $file
9365 initial revision: 1\.1
9368 dotest join-readonly-conflict-4 "$testcvs tag -b B $file" "T $file"
9369 dotest join-readonly-conflict-5 "$testcvs -q update -rB $file" ''
9370 echo branch B > $file
9371 dotest join-readonly-conflict-6 "$testcvs -q ci -m . $file" \
9373 $CVSROOT_DIRNAME/$module/$file,v <-- $file
9374 new revision: 1\.1\.2\.1; previous revision: 1\.1
9378 dotest join-readonly-conflict-7 "$testcvs -Q update -A $file" ''
9379 # Make sure $file is read-only. This can happen more realistically
9380 # via patch -- which could be used to apply a delta, yet would
9381 # preserve a file's read-only permissions.
9382 echo conflict > $file; chmod u-w $file
9383 dotest join-readonly-conflict-8 "$testcvs update -r B $file" \
9384 "RCS file: $CVSROOT_DIRNAME/$module/$file,v
9385 retrieving revision 1\.1
9386 retrieving revision 1\.1\.2\.1
9387 Merging differences between 1\.1 and 1\.1\.2\.1 into $file
9388 rcsmerge: warning: conflicts during merge
9389 ${PROG} update: conflicts found in $file
9392 # restore to the trunk
9394 dotest join-readonly-conflict-9 "$testcvs -Q update -A $file" ''
9396 # This one would fail because cvs couldn't open the existing
9397 # (and read-only) .# file for writing.
9398 echo conflict > $file
9400 # verify that the backup file is writable
9401 if test -w ".#$file.1.1"; then
9402 fail "join-readonly-conflict-10 : .#$file.1.1 is writable"
9404 pass "join-readonly-conflict-10"
9406 dotest join-readonly-conflict-11 "$testcvs update -r B $file" \
9407 "RCS file: $CVSROOT_DIRNAME/$module/$file,v
9408 retrieving revision 1\.1
9409 retrieving revision 1\.1\.2\.1
9410 Merging differences between 1\.1 and 1\.1\.2\.1 into $file
9411 rcsmerge: warning: conflicts during merge
9412 ${PROG} update: conflicts found in $file
9416 if $keep; then :; else
9417 rm -rf join-readonly-conflict
9418 rm -rf $CVSROOT_DIRNAME/$module
9424 dotest join-admin-1 "$testcvs -q co -l ." ''
9427 $testcvs -q add $module >>$LOGFILE 2>&1
9430 # Create a file so applying the first tag works.
9432 $testcvs -Q add a > /dev/null 2>&1
9433 $testcvs -Q ci -m. a > /dev/null 2>&1
9435 $testcvs -Q tag -b B
9436 $testcvs -Q tag -b M1
9438 $testcvs -Q add b > /dev/null 2>&1
9439 $testcvs -Q ci -m. b > /dev/null 2>&1
9440 $testcvs -Q tag -b M2
9442 $testcvs -Q update -r B
9443 $testcvs -Q update -kk -jM1 -jM2
9444 $testcvs -Q ci -m. b >/dev/null 2>&1
9446 $testcvs -Q update -A
9448 # Verify that the -kk flag from the update did not
9449 # propagate to the repository.
9450 dotest join-admin-1 "$testcvs status b" \
9451 "===================================================================
9452 File: b Status: Up-to-date
9454 Working revision: 1\.1.*
9455 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/x/b,v
9458 Sticky Options: (none)"
9462 rm -rf ${CVSROOT_DIRNAME}/$module
9466 # Show that when a merge (via update -kk -jtag1 -jtag2) first
9467 # removes a file, then modifies another containing an $Id...$ line,
9468 # the resulting file contains the unexpanded `$Id.$' string, as
9471 dotest join-admin-2-1 "$testcvs -q co -l ." ''
9474 dotest join-admin-2-2 "$testcvs -q add $module" \
9475 "Directory ${CVSROOT_DIRNAME}/x added to the repository"
9478 # Create a file so applying the first tag works.
9481 dotest join-admin-2-3 "$testcvs -Q add e" ''
9482 dotest join-admin-2-4 "$testcvs -Q ci -m. e" \
9483 "RCS file: ${CVSROOT_DIRNAME}/x/e,v
9486 ${CVSROOT_DIRNAME}/x/e,v <-- e
9487 initial revision: 1\.1
9490 dotest join-admin-2-5 "$testcvs -Q tag -b T" '' "${QUESTION} e0"
9491 dotest join-admin-2-6 "$testcvs -Q update -r T" '' "${QUESTION} e0"
9493 dotest join-admin-2-7 "$testcvs -Q ci -m. e" \
9495 ${CVSROOT_DIRNAME}/x/e,v <-- e
9496 new revision: 1\.1\.2\.1; previous revision: 1\.1
9499 dotest join-admin-2-8 "$testcvs -Q update -A" '' "${QUESTION} e0"
9500 dotest join-admin-2-9 "$testcvs -Q tag -b M1" '' "${QUESTION} e0"
9503 dotest join-admin-2-10 "$testcvs -Q add b" ''
9505 dotest join-admin-2-11 "$testcvs -Q ci -m. b e" \
9506 "RCS file: ${CVSROOT_DIRNAME}/x/b,v
9509 ${CVSROOT_DIRNAME}/x/b,v <-- b
9510 initial revision: 1\.1
9513 ${CVSROOT_DIRNAME}/x/e,v <-- e
9514 new revision: 1\.2; previous revision: 1\.1
9517 dotest join-admin-2-12 "$testcvs -Q tag -b M2" '' "${QUESTION} e0"
9519 dotest join-admin-2-13 "$testcvs -Q update -r T" '' "${QUESTION} e0"
9520 dotest join-admin-2-14 "$testcvs update -kk -jM1 -jM2" \
9521 "${PROG} update: Updating .
9524 RCS file: ${CVSROOT_DIRNAME}/x/e,v
9525 retrieving revision 1\.1
9526 retrieving revision 1\.2
9527 Merging differences between 1\.1 and 1\.2 into e
9528 e already contains the differences between 1\.1 and 1\.2
9531 ${PROG} update: Updating .
9534 RCS file: ${CVSROOT_DIRNAME}/x/e,v
9535 retrieving revision 1\.1
9536 retrieving revision 1\.2
9537 Merging differences between 1\.1 and 1\.2 into e
9538 e already contains the differences between 1\.1 and 1\.2"
9540 # Verify that the $Id.$ string is not expanded.
9541 dotest join-admin-2-15 "cat e" '$''Id$'
9545 rm -rf ${CVSROOT_DIRNAME}/$module
9549 # This first half of this test checks that a single-argument merge
9550 # from a branch is capable of removing files.
9552 # The second half verifies that an update to another location with an
9553 # uncommitted removal will transfer the destination branch of the
9557 mkdir $module; cd $module
9559 dotest join-rm-init-1 "$testcvs -q co -l ." ''
9561 dotest join-rm-init-2 "$testcvs -q add $module" \
9562 "Directory $CVSROOT_DIRNAME/$module added to the repository"
9567 dotest join-rm-init-3 "$testcvs -Q add a b c d e f g"
9568 dotest join-rm-init-4 "$testcvs -Q ci -m add-em" \
9569 "RCS file: $CVSROOT_DIRNAME/join-rm/a,v
9572 $CVSROOT_DIRNAME/join-rm/a,v <-- a
9573 initial revision: 1\.1
9575 RCS file: $CVSROOT_DIRNAME/join-rm/b,v
9578 $CVSROOT_DIRNAME/join-rm/b,v <-- b
9579 initial revision: 1\.1
9581 RCS file: $CVSROOT_DIRNAME/join-rm/c,v
9584 $CVSROOT_DIRNAME/join-rm/c,v <-- c
9585 initial revision: 1\.1
9587 RCS file: $CVSROOT_DIRNAME/join-rm/d,v
9590 $CVSROOT_DIRNAME/join-rm/d,v <-- d
9591 initial revision: 1\.1
9593 RCS file: $CVSROOT_DIRNAME/join-rm/e,v
9596 $CVSROOT_DIRNAME/join-rm/e,v <-- e
9597 initial revision: 1\.1
9599 RCS file: $CVSROOT_DIRNAME/join-rm/f,v
9602 $CVSROOT_DIRNAME/join-rm/f,v <-- f
9603 initial revision: 1\.1
9605 RCS file: $CVSROOT_DIRNAME/join-rm/g,v
9608 $CVSROOT_DIRNAME/join-rm/g,v <-- g
9609 initial revision: 1\.1
9612 # create the branch and update to it
9613 dotest join-rm-init-5 "$testcvs -Q tag -b br"
9614 dotest join-rm-init-6 "$testcvs -Q up -rbr"
9616 # remove a few files from the branch
9617 dotest join-rm-init-7 "$testcvs -Q rm -f b d g"
9618 dotest join-rm-init-8 "$testcvs -Q ci -mrm" \
9620 $CVSROOT_DIRNAME/join-rm/b,v <-- b
9621 new revision: delete; previous revision: 1\.1
9624 $CVSROOT_DIRNAME/join-rm/d,v <-- d
9625 new revision: delete; previous revision: 1\.1
9628 $CVSROOT_DIRNAME/join-rm/g,v <-- g
9629 new revision: delete; previous revision: 1\.1
9632 # update to the trunk
9633 dotest join-rm-init-9 "$testcvs -Q up -A"
9635 # now for the test - try and merge the removals.
9636 dotest join-rm-1 "$testcvs -q up -jbr" \
9637 "$PROG update: scheduling b for removal
9638 $PROG update: scheduling d for removal
9639 $PROG update: scheduling g for removal"
9641 # And make sure the merge took
9642 dotest join-rm-2 "$testcvs -qn up" \
9647 dotest join-rm-3 "$testcvs -q ci -m 'save the merge'" \
9649 $CVSROOT_DIRNAME/join-rm/b,v <-- b
9650 new revision: delete; previous revision: 1\.1
9653 $CVSROOT_DIRNAME/join-rm/d,v <-- d
9654 new revision: delete; previous revision: 1\.1
9657 $CVSROOT_DIRNAME/join-rm/g,v <-- g
9658 new revision: delete; previous revision: 1\.1
9661 # and verify that it was the head revision which was removed.
9662 dotest join-rm-4 "$testcvs -q log b" "
9663 RCS file: $CVSROOT_DIRNAME/join-rm/Attic/b,v
9671 keyword substitution: kv
9672 total revisions: 3; selected revisions: 3
9674 ----------------------------
9676 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: ${PLUS}0 -0
9678 ----------------------------
9680 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
9683 ----------------------------
9685 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: ${PLUS}0 -0
9687 ============================================================================="
9689 # go back to the branch to set up for the second set of tests
9690 dotest join-rm-init-10 "$testcvs -Q up -rbr"
9691 dotest join-rm-init-11 "$testcvs -Q rm -f a"
9692 dotest join-rm-init-12 "$testcvs -Q ci -m rma" \
9694 $CVSROOT_DIRNAME/join-rm/a,v <-- a
9695 new revision: delete; previous revision: 1\.1
9698 # now the test: update to the trunk
9700 # FIXCVS: This update should merge the removal to the trunk. It does
9702 dotest join-rm-5 "$testcvs -q up -A" "U a"
9704 # and verify that there is no sticky tag
9705 dotest join-rm-6 "$testcvs status a" \
9706 "===================================================================
9707 File: a Status: Up-to-date
9709 Working revision: 1\.1.*
9710 Repository revision: 1\.1 $CVSROOT_DIRNAME/join-rm/a,v
9713 Sticky Options: (none)"
9716 echo Keeping $TESTDIR and exiting due to --keep
9721 rm -rf $CVSROOT_DIRNAME/$module
9725 new) # look for stray "no longer pertinent" messages.
9726 mkdir ${CVSROOT_DIRNAME}/first-dir
9728 if ${CVS} co first-dir ; then
9737 if ${CVS} add a 2>>${LOGFILE}; then
9743 if ${CVS} ci -m added >>${LOGFILE} 2>&1; then
9751 if ${CVS} rm a 2>>${LOGFILE}; then
9757 if ${CVS} ci -m removed >>${LOGFILE} ; then
9763 if ${CVS} update -A 2>&1 | grep longer ; then
9769 if ${CVS} update -rHEAD 2>&1 | grep longer ; then
9777 rm -rf ${CVSROOT_DIRNAME}/first-dir
9781 # Test removing a file on a branch and then checking it out.
9783 # We call this "newb" only because it, like the "new" tests,
9784 # has something to do with "no longer pertinent" messages.
9785 # Not necessarily the most brilliant nomenclature.
9788 mkdir ${CVSROOT_DIRNAME}/first-dir
9789 dotest newb-123a "${testcvs} -q co first-dir" ''
9792 dotest newb-123b "${testcvs} add a" \
9793 "${PROG} add: scheduling file .a. for addition
9794 ${PROG} add: use .${PROG} commit. to add this file permanently"
9795 dotest newb-123c "${testcvs} -q ci -m added" \
9796 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
9799 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
9800 initial revision: 1\.1
9804 dotest newb-123d "${testcvs} -q tag -b branch" "T a"
9806 # Check out the branch.
9811 dotest newb-123e "${testcvs} -q co -r branch first-dir" \
9814 # Remove 'a' on another copy of the branch.
9818 dotest newb-123f "${testcvs} -q co -r branch first-dir" \
9822 dotest newb-123g "${testcvs} rm a" \
9823 "${PROG} remove: scheduling .a. for removal
9824 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
9825 dotest newb-123h "${testcvs} -q ci -m removed" \
9827 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
9828 new revision: delete; previous revision: 1\.1
9831 # Check out the file on the branch. This should report
9832 # that the file is not pertinent, but it should not
9833 # say anything else.
9836 dotest newb-123i "${testcvs} -q co -r branch first-dir/a" \
9837 "${PROG} checkout: warning: first-dir/a is not (any longer) pertinent"
9839 # Update the other copy, and make sure that a is removed.
9841 # "Entry Invalid" is a rather strange output here. Something like
9842 # "Removed in Repository" would make more sense.
9843 dotest newb-123j0 "${testcvs} status a" \
9844 "${PROG} status: a is no longer in the repository
9845 ===================================================================
9846 File: a Status: Entry Invalid
9848 Working revision: 1\.1.*
9849 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/a,v
9850 Sticky Tag: branch (branch: 1\.1\.2)
9852 Sticky Options: (none)"
9853 dotest newb-123j "${testcvs} -q update" \
9854 "${PROG} update: a is no longer in the repository"
9864 rm -rf ${CVSROOT_DIRNAME}/first-dir
9868 mkdir ${CVSROOT_DIRNAME}/first-dir
9873 dotest conflicts-124 "${testcvs} -q co first-dir" ''
9878 dotest conflicts-125 "${testcvs} add a" \
9879 "${PROG} add: scheduling file .a. for addition
9880 ${PROG} add: use .${PROG} commit. to add this file permanently"
9881 dotest conflicts-126 "${testcvs} -q ci -m added" \
9882 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
9885 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
9886 initial revision: 1\.1
9893 dotest conflicts-126.5 "${testcvs} co -p first-dir" \
9894 "${PROG} checkout: Updating first-dir
9895 ===================================================================
9896 Checking out first-dir/a
9897 RCS: ${CVSROOT_DIRNAME}/first-dir/a,v
9899 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
9900 if ${CVS} co first-dir ; then
9912 cd ../../1/first-dir
9915 dotest conflicts-127b "${testcvs} add dir1" \
9916 "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
9917 dotest conflicts-128 "${testcvs} -q ci -m changed" \
9919 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
9920 new revision: 1\.2; previous revision: 1\.1
9924 # Similar to conflicts-126.5, but now the file has nonempty
9928 dotest conflicts-128.5 "${testcvs} co -p -l first-dir" \
9929 "${PROG} checkout: Updating first-dir
9930 ===================================================================
9931 Checking out first-dir/a
9932 RCS: ${CVSROOT_DIRNAME}/first-dir/a,v
9934 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
9939 # Now go over the to the other working directory and
9940 # start testing conflicts
9942 echo add a conflicting line >>a
9943 dotest_fail conflicts-129 "${testcvs} -q ci -m changed" \
9944 "${PROG}"' commit: Up-to-date check failed for `a'\''
9945 '"${PROG}"' \[commit aborted\]: correct above errors first!'
9948 dotest conflicts-status-0 "${testcvs} status a" \
9949 "===================================================================
9950 File: a Status: Needs Merge
9952 Working revision: 1\.1.*
9953 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
9956 Sticky Options: (none)"
9957 dotest conflicts-129a "${testcvs} -nq update a" \
9958 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
9959 retrieving revision 1\.1
9960 retrieving revision 1\.2
9961 Merging differences between 1\.1 and 1\.2 into a
9962 rcsmerge: warning: conflicts during merge
9963 ${PROG} update: conflicts found in a
9965 dotest conflicts-130 "${testcvs} -q update" \
9966 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
9967 retrieving revision 1\.1
9968 retrieving revision 1\.2
9969 Merging differences between 1\.1 and 1\.2 into a
9970 rcsmerge: warning: conflicts during merge
9971 ${PROG} update: conflicts found in a
9977 RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
9978 retrieving revision 1\.1
9979 retrieving revision 1\.2
9980 Merging differences between 1\.1 and 1\.2 into a
9981 rcsmerge: warning: conflicts during merge
9982 ${PROG} update: conflicts found in a
9986 dotest conflicts-status-1 "${testcvs} status a" \
9987 "===================================================================
9988 File: a Status: File had conflicts on merge
9990 Working revision: 1\.2.*
9991 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
9994 Sticky Options: (none)"
9995 dotest_fail conflicts-131 "${testcvs} -q ci -m try" \
9996 "${PROG} commit: file .a. had a conflict and has not been modified
9997 ${PROG} \[commit aborted\]: correct above errors first!"
9999 # Try to check in the file with the conflict markers in it.
10000 # Make sure we detect any one of the three conflict markers
10002 grep '^<<<<<<<' aa >a
10003 dotest conflicts-status-2 "${testcvs} -nq ci -m try a" \
10004 "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
10006 grep '^=======' aa >a
10007 dotest conflicts-status-3 "${testcvs} -nq ci -m try a" \
10008 "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
10010 grep '^>>>>>>>' aa >a
10011 dotest conflicts-status-4 "${testcvs} -qn ci -m try a" \
10012 "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
10015 echo lame attempt at resolving it >>a
10016 dotest conflicts-status-5 "${testcvs} status a" \
10017 "===================================================================
10018 File: a Status: File had conflicts on merge
10020 Working revision: 1\.2.*
10021 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
10023 Sticky Date: (none)
10024 Sticky Options: (none)"
10025 dotest conflicts-132 "${testcvs} -q ci -m try" \
10026 "${PROG} commit: warning: file .a. seems to still contain conflict indicators
10028 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
10029 new revision: 1\.3; previous revision: 1\.2
10032 # OK, the user saw the warning (good user), and now
10033 # resolves it for real.
10034 echo resolve conflict >a
10035 dotest conflicts-status-6 "${testcvs} status a" \
10036 "===================================================================
10037 File: a Status: Locally Modified
10039 Working revision: 1\.3.*
10040 Repository revision: 1\.3 ${CVSROOT_DIRNAME}/first-dir/a,v
10042 Sticky Date: (none)
10043 Sticky Options: (none)"
10044 dotest conflicts-133 "${testcvs} -q ci -m resolved" \
10046 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
10047 new revision: 1\.4; previous revision: 1\.3
10049 dotest conflicts-status-7 "${testcvs} status a" \
10050 "===================================================================
10051 File: a Status: Up-to-date
10053 Working revision: 1\.4.*
10054 Repository revision: 1\.4 ${CVSROOT_DIRNAME}/first-dir/a,v
10056 Sticky Date: (none)
10057 Sticky Options: (none)"
10059 # Now test that we can add a file in one working directory
10060 # and have an update in another get it.
10061 cd ../../1/first-dir
10063 if ${testcvs} add abc >>${LOGFILE} 2>&1; then
10068 if ${testcvs} ci -m 'add abc' abc >>${LOGFILE} 2>&1; then
10074 mkdir first-dir/dir1 first-dir/sdir
10075 dotest conflicts-136 "${testcvs} -q update first-dir" \
10076 '[UP] first-dir/abc
10077 '"${QUESTION}"' first-dir/dir1
10078 '"${QUESTION}"' first-dir/sdir' \
10079 ''"${QUESTION}"' first-dir/dir1
10080 '"${QUESTION}"' first-dir/sdir
10081 [UP] first-dir/abc'
10082 dotest conflicts-137 'test -f first-dir/abc' ''
10083 rmdir first-dir/dir1 first-dir/sdir
10085 # Now test something similar, but in which the parent directory
10086 # (not the directory in question) has the Entries.Static flag
10090 if ${testcvs} add subdir >>${LOGFILE}; then
10098 if ${testcvs} -q co first-dir/abc first-dir/subdir \
10104 cd ../1/first-dir/subdir
10106 if ${testcvs} add sss >>${LOGFILE} 2>&1; then
10111 if ${testcvs} ci -m adding sss >>${LOGFILE} 2>&1; then
10116 cd ../../../3/first-dir
10117 if ${testcvs} -q update >>${LOGFILE}; then
10122 if test -f subdir/sss; then
10128 rm -r 1 2 3 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
10132 # More conflicts tests; separate from conflicts to keep each
10133 # test a manageable size.
10134 mkdir ${CVSROOT_DIRNAME}/first-dir
10139 dotest conflicts2-142a1 "${testcvs} -q co first-dir" ''
10144 dotest conflicts2-142a2 "${testcvs} add a abc" \
10145 "${PROG} add: scheduling file .a. for addition
10146 ${PROG} add: scheduling file .abc. for addition
10147 ${PROG} add: use .${PROG} commit. to add these files permanently"
10148 dotest conflicts2-142a3 "${testcvs} -q ci -m added" \
10149 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
10152 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
10153 initial revision: 1\.1
10155 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
10158 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
10159 initial revision: 1\.1
10166 dotest conflicts2-142a4 "${testcvs} -q co first-dir" 'U first-dir/a
10170 # BEGIN TESTS USING THE FILE A
10171 # FIXME: would be cleaner to separate them out into their own
10172 # tests; conflicts2 is getting long.
10173 # Now test that if one person modifies and commits a
10174 # file and a second person removes it, it is a
10178 dotest conflicts2-142b2 "${testcvs} -q ci -m modify-a" \
10180 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
10181 new revision: 1\.2; previous revision: 1\.1
10183 cd ../../2/first-dir
10185 dotest conflicts2-142b3 "${testcvs} rm a" \
10186 "${PROG} remove: scheduling .a. for removal
10187 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
10188 dotest_fail conflicts2-142b4 "${testcvs} -q update" \
10189 "${PROG} update: conflict: removed a was modified by second party
10191 # Resolve the conflict by deciding not to remove the file
10193 dotest_sort conflicts2-142b5 "${testcvs} add a" "U a
10194 ${PROG} add: a, version 1\.1, resurrected"
10195 dotest conflicts2-142b5b1 "$testcvs status a" \
10196 "===================================================================
10197 File: a Status: Needs Patch
10199 Working revision: 1\.1.*
10200 Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/a,v
10202 Sticky Date: (none)
10203 Sticky Options: (none)"
10204 dotest conflicts2-142b6 "${testcvs} -q update" 'U a'
10206 # Now one level up.
10208 dotest conflicts2-142b7 "${testcvs} rm -f first-dir/a" \
10209 "${PROG} remove: scheduling .first-dir/a. for removal
10210 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
10213 # Haven't investigated this one.
10214 dotest_fail conflicts2-142b8r "$testcvs add first-dir/a" \
10215 "${PROG} add: in directory \.:
10216 ${PROG} \[add aborted\]: there is no version here; do '${PROG} checkout' first"
10219 dotest conflicts2-142b8 "${testcvs} add first-dir/a" \
10221 ${PROG} add: first-dir/a, version 1\.2, resurrected"
10223 # Now recover from the damage that the 142b8 test did.
10224 dotest conflicts2-142b9 "${testcvs} rm -f a" \
10225 "${PROG} remove: scheduling .a. for removal
10226 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
10229 dotest_sort conflicts2-142b10 "${testcvs} add a" "U a
10230 ${PROG} add: a, version 1\.2, resurrected"
10231 # As with conflicts2-142b6, check that things are normal again.
10232 dotest conflicts2-142b11 "${testcvs} -q update" ''
10234 # END TESTS USING THE FILE A
10236 # Now test that if one person removes a file and
10237 # commits it, and a second person removes it, is it
10241 dotest conflicts2-142c0 "${testcvs} rm abc" \
10242 "${PROG} remove: scheduling .abc. for removal
10243 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
10244 dotest conflicts2-142c1 "${testcvs} -q ci -m remove-abc" \
10246 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
10247 new revision: delete; previous revision: 1\.1
10249 cd ../../2/first-dir
10251 dotest conflicts2-142c2 "${testcvs} rm abc" \
10252 "${PROG} remove: scheduling .abc. for removal
10253 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
10254 dotest conflicts2-142c3 "${testcvs} update" \
10255 "${PROG} update: Updating \."
10258 # conflicts2-142d*: test that if one party adds a file, and another
10259 # party has a file of the same name, cvs notices
10262 echo 'contents unchanged' >same.c
10263 dotest conflicts2-142d0 "${testcvs} add aa.c same.c" \
10264 "${PROG} add: scheduling file .aa\.c. for addition
10265 ${PROG} add: scheduling file .same\.c. for addition
10266 ${PROG} add: use .${PROG} commit. to add these files permanently"
10267 dotest conflicts2-142d1 "${testcvs} -q ci -m added" \
10268 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa\.c,v
10271 ${CVSROOT_DIRNAME}/first-dir/aa\.c,v <-- aa\.c
10272 initial revision: 1\.1
10274 RCS file: ${CVSROOT_DIRNAME}/first-dir/same\.c,v
10276 Checking in same\.c;
10277 ${CVSROOT_DIRNAME}/first-dir/same\.c,v <-- same\.c
10278 initial revision: 1\.1
10280 cd ../../2/first-dir
10281 echo "don't you dare obliterate this text" >aa.c
10282 echo 'contents unchanged' >same.c
10283 # Note the discrepancy between local and remote in the handling
10284 # of same.c. I kind
10285 # of suspect that the local CVS behavior is the more useful one
10286 # although I do sort of wonder whether we should make people run
10287 # cvs add just to get them in that habit (also, trying to implement
10288 # the local CVS behavior for remote without the cvs add seems
10289 # pretty difficult).
10291 dotest_fail conflicts2-142d2 "${testcvs} -q update" \
10293 ${QUESTION} same\.c
10294 ${PROG} update: move away \./aa\.c; it is in the way
10296 ${PROG} update: move away \./same\.c; it is in the way
10299 dotest_fail conflicts2-142d2 "${testcvs} -q update" \
10300 "${PROG} [a-z]*: move away aa\.c; it is in the way
10304 dotest conflicts2-142d3 "${testcvs} -q status aa.c" \
10305 "${PROG} status: move away aa\.c; it is in the way
10306 ===================================================================
10307 File: aa\.c Status: Unresolved Conflict
10309 Working revision: No entry for aa\.c
10310 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/aa\.c,v"
10312 # Could also be testing the case in which the cvs add happened
10313 # before the commit by the other user.
10314 # This message seems somewhat bogus. I mean, parallel development
10315 # means that we get to work in parallel if we choose, right? And
10316 # then at commit time it would be a conflict.
10317 dotest_fail conflicts2-142d4 "${testcvs} -q add aa.c" \
10318 "${PROG} add: aa.c added independently by second party"
10320 # The user might want to see just what the conflict is.
10321 # Don't bother, diff seems to kind of lose its mind, with or
10322 # without -N. This is a CVS bug(s).
10323 #dotest conflicts2-142d5 "${testcvs} -q diff -r HEAD -N aa.c" fixme
10325 # Now: "how can the user resolve this conflict", I hear you cry.
10326 # Well, one way is to forget about the file in the working
10328 # Since it didn't let us do the add in conflicts2-142d4, there
10329 # is no need to run cvs rm here.
10330 #dotest conflicts2-142d6 "${testcvs} -q rm -f aa.c" fixme
10331 dotest conflicts2-142d6 "rm aa.c" ''
10332 dotest conflicts2-142d7 "${testcvs} -q update aa.c" "U aa\.c"
10333 dotest conflicts2-142d8 "cat aa.c" ''
10335 # The other way is to use the version from the working directory
10336 # instead of the version from the repository. Unfortunately,
10337 # there doesn't seem to be any particularly clear way to do
10342 rm -r 1 2; rm -rf ${CVSROOT_DIRNAME}/first-dir
10346 # More tests of conflicts and/or multiple working directories
10350 dotest conflicts3-1 "${testcvs} -q co -l ." ''
10352 dotest conflicts3-2 "${testcvs} add first-dir" \
10353 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
10356 dotest conflicts3-3 "${testcvs} -q co -l first-dir" ''
10359 dotest conflicts3-4 "${testcvs} add file1 file2" \
10360 "${PROG} add: scheduling file .file1. for addition
10361 ${PROG} add: scheduling file .file2. for addition
10362 ${PROG} add: use .${PROG} commit. to add these files permanently"
10363 dotest conflicts3-5 "${testcvs} -q ci -m add-them" \
10364 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
10367 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
10368 initial revision: 1\.1
10370 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
10373 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
10374 initial revision: 1\.1
10376 cd ../../2/first-dir
10377 # Check that -n doesn't make CVS lose its mind as it creates
10378 # (or rather, doesn't) a new file.
10379 dotest conflicts3-6 "${testcvs} -nq update" \
10382 dotest_fail conflicts3-7 "test -f file1" ''
10383 dotest conflicts3-8 "${testcvs} -q update" \
10386 dotest conflicts3-9 "test -f file2" ''
10388 # OK, now remove two files at once
10389 dotest conflicts3-10 "${testcvs} rm -f file1 file2" \
10390 "${PROG} remove: scheduling .file1. for removal
10391 ${PROG} remove: scheduling .file2. for removal
10392 ${PROG} remove: use .${PROG} commit. to remove these files permanently"
10393 dotest conflicts3-11 "${testcvs} -q ci -m remove-them" \
10395 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
10396 new revision: delete; previous revision: 1\.1
10399 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
10400 new revision: delete; previous revision: 1\.1
10402 cd ../../1/first-dir
10403 dotest conflicts3-12 "${testcvs} -n -q update" \
10404 "${PROG} update: file1 is no longer in the repository
10405 ${PROG} update: file2 is no longer in the repository"
10406 dotest conflicts3-13 "${testcvs} -q update" \
10407 "${PROG} update: file1 is no longer in the repository
10408 ${PROG} update: file2 is no longer in the repository"
10410 # OK, now add a directory to both working directories
10411 # and see that CVS doesn't lose its mind.
10413 dotest conflicts3-14 "${testcvs} add sdir" \
10414 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
10416 dotest conflicts3-14a "${testcvs} add sdir/sfile" \
10417 "${PROG} add: scheduling file .sdir/sfile. for addition
10418 ${PROG} add: use .${PROG} commit. to add this file permanently"
10419 dotest conflicts3-14b "${testcvs} -q ci -m add" \
10420 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v
10422 Checking in sdir/sfile;
10423 ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v <-- sfile
10424 initial revision: 1\.1
10427 cd ../../2/first-dir
10429 # Create a CVS directory without the proper administrative
10430 # files in it. This can happen for example if you hit ^C
10431 # in the middle of a checkout.
10434 # OK, in the local case CVS sees that the directory exists
10435 # in the repository and recurses into it. In the remote case
10436 # CVS can't see the repository and has no way of knowing
10437 # that sdir is even a directory (stat'ing everything would be
10438 # too slow). The remote behavior makes more sense to me (but
10439 # would this affect other cases?).
10441 dotest conflicts3-15 "${testcvs} -q update" \
10444 dotest conflicts3-15 "${testcvs} -q update" \
10446 ${PROG} update: ignoring sdir (CVS/Repository missing)"
10447 touch sdir/CVS/Repository
10448 dotest conflicts3-16 "${testcvs} -q update" \
10450 ${PROG} update: ignoring sdir (CVS/Entries missing)"
10452 dotest conflicts3-16a "${testcvs} -q update first-dir" \
10453 "${QUESTION} first-dir/sdir
10454 ${PROG} update: ignoring first-dir/sdir (CVS/Entries missing)"
10459 # OK, now the same thing, but the directory doesn't exist
10460 # in the repository.
10463 dotest conflicts3-17 "${testcvs} -q update" "${QUESTION} newdir"
10464 echo "D/newdir////" >> CVS/Entries
10465 dotest conflicts3-18 "${testcvs} -q update" \
10466 "${PROG} [a-z]*: ignoring newdir (CVS/Repository missing)"
10467 touch newdir/CVS/Repository
10468 dotest conflicts3-19 "${testcvs} -q update" \
10469 "${PROG} [a-z]*: ignoring newdir (CVS/Entries missing)"
10471 dotest conflicts3-20 "${testcvs} -q update first-dir" \
10472 "${PROG} [a-z]*: ignoring first-dir/newdir (CVS/Entries missing)"
10476 # The previous tests have left CVS/Entries in something of a mess.
10477 # While we "should" be able to deal with that (maybe), for now
10478 # we just start over.
10481 dotest conflicts3-20a "${testcvs} -q co -l first-dir" ''
10484 dotest conflicts3-21 "${testcvs} -q update -d sdir" "U sdir/sfile"
10486 dotest conflicts3-22 "${testcvs} -q update" "${QUESTION} sdir"
10488 dotest_fail conflicts3-23 "${testcvs} -q update -PdA" \
10490 ${PROG} update: move away sdir/sfile; it is in the way
10493 dotest conflicts3-23 "${testcvs} -q update -PdA" \
10497 # Not that it should really affect much, but let's do the case
10498 # where sfile has been removed. For example, suppose that sdir
10499 # had been a CVS-controlled directory which was then removed
10500 # by removing each file (and using update -P or some such). Then
10501 # suppose that the build process creates an sdir directory which
10502 # is not supposed to be under CVS.
10504 dotest conflicts3-24 "${testcvs} -q update -d sdir" "U sdir/sfile"
10506 dotest conflicts3-25 "${testcvs} rm sdir/sfile" \
10507 "${PROG} remove: scheduling .sdir/sfile. for removal
10508 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
10509 dotest conflicts3-26 "${testcvs} ci -m remove sdir/sfile" \
10510 "Removing sdir/sfile;
10511 ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v <-- sfile
10512 new revision: delete; previous revision: 1\.1
10515 dotest conflicts3-27 "${testcvs} -q update" "${QUESTION} sdir"
10516 dotest conflicts3-28 "${testcvs} -q update -PdA" \
10522 rm -rf ${CVSROOT_DIRNAME}/first-dir
10526 # Test update -C (overwrite local mods w/ repository copies)
10528 dotest clean-1 "${testcvs} -q co -l ." ''
10530 dotest clean-2 "${testcvs} add first-dir" \
10531 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
10533 echo "The usual boring test text." > cleanme.txt
10534 dotest clean-3 "${testcvs} add cleanme.txt" \
10535 "${PROG} add: scheduling file .cleanme\.txt. for addition
10536 ${PROG} add: use .${PROG} commit. to add this file permanently"
10537 dotest clean-4 "${testcvs} -q ci -m clean-3" \
10538 "RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
10540 Checking in cleanme\.txt;
10541 ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v <-- cleanme\.txt
10542 initial revision: 1\.1
10544 # Okay, preparation is done, now test.
10545 # Check that updating an unmodified copy works.
10546 dotest clean-5 "${testcvs} -q update" ''
10547 # Check that updating -C an unmodified copy works.
10548 dotest clean-6 "${testcvs} -q update -C" ''
10549 # Check that updating a modified copy works.
10550 echo "fish" >> cleanme.txt
10551 dotest clean-7 "${testcvs} -q update" 'M cleanme\.txt'
10552 # Check that updating -C a modified copy works.
10553 dotest clean-8 "${testcvs} -q update -C" \
10554 "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
10556 # And check that the backup copy really was made.
10557 dotest clean-9 "cat .#cleanme.txt.1.1" \
10558 "The usual boring test text\.
10561 # Do it all again, this time naming the file explicitly.
10562 rm .#cleanme.txt.1.1
10563 dotest clean-10 "${testcvs} -q update cleanme.txt" ''
10564 dotest clean-11 "${testcvs} -q update -C cleanme.txt" ''
10565 echo "bluegill" >> cleanme.txt
10566 dotest clean-12 "${testcvs} -q update cleanme.txt" 'M cleanme\.txt'
10567 dotest clean-13 "${testcvs} -q update -C cleanme.txt" \
10568 "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
10570 # And check that the backup copy really was made.
10571 dotest clean-14 "cat .#cleanme.txt.1.1" \
10572 "The usual boring test text\.
10575 # Now try with conflicts
10577 dotest clean-15 "${testcvs} -q co -d second-dir first-dir" \
10578 'U second-dir/cleanme\.txt'
10580 echo "conflict test" >> cleanme.txt
10581 dotest clean-16 "${testcvs} -q ci -m." \
10582 "Checking in cleanme\.txt;
10583 ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v <-- cleanme\.txt
10584 new revision: 1\.2; previous revision: 1\.1
10587 echo "fish" >> cleanme.txt
10588 dotest clean-17 "${testcvs} -nq update" \
10589 "RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
10590 retrieving revision 1\.1
10591 retrieving revision 1\.2
10592 Merging differences between 1\.1 and 1\.2 into cleanme\.txt
10593 rcsmerge: warning: conflicts during merge
10594 ${PROG} update: conflicts found in cleanme\.txt
10596 dotest clean-18 "${testcvs} -q update -C" \
10597 "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
10599 dotest clean-19 "cat .#cleanme.txt.1.1" \
10600 "The usual boring test text\.
10606 rm -rf ${CVSROOT_DIRNAME}/first-dir
10610 # Tests of various ways to define and use modules.
10611 # Roadmap to various modules tests:
10613 # error on incorrect placement: modules
10614 # error combining with other options: modules2-a*
10615 # infinite loops: modules148a1.1 - modules148a1.2
10616 # use to specify a file more than once: modules3
10617 # use with ! feature: modules4
10618 # regular modules: modules, modules2, cvsadm
10619 # ampersand modules: modules2
10621 # -d: modules, modules3, cvsadm
10622 # -i, -o, -u, -e, -t: modules5
10623 # slashes in module names: modules3
10624 # invalid module definitions: modules6
10626 ############################################################
10627 # These tests are to make sure that administrative files get
10628 # rebuilt, regardless of how and where files are checked
10630 ############################################################
10631 # Check out the whole repository
10633 dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/checkoutlist
10634 U CVSROOT/commitinfo
10636 U CVSROOT/cvswrappers
10643 U CVSROOT/verifymsg'
10644 echo "# made a change" >>CVSROOT/modules
10645 dotest modules-1d "${testcvs} -q ci -m add-modules" \
10646 "Checking in CVSROOT/modules;
10647 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
10648 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
10650 ${PROG} commit: Rebuilding administrative file database"
10654 ############################################################
10655 # Check out CVSROOT
10657 dotest modules-2 "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist
10658 U CVSROOT/commitinfo
10660 U CVSROOT/cvswrappers
10667 U CVSROOT/verifymsg'
10668 echo "# made a change" >>CVSROOT/modules
10669 dotest modules-2d "${testcvs} -q ci -m add-modules" \
10670 "Checking in CVSROOT/modules;
10671 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
10672 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
10674 ${PROG} commit: Rebuilding administrative file database"
10678 ############################################################
10679 # Check out CVSROOT in some other directory
10680 mkdir ${CVSROOT_DIRNAME}/somedir
10682 dotest modules-3 "${testcvs} -q co somedir" ''
10684 dotest modules-3d "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist
10685 U CVSROOT/commitinfo
10687 U CVSROOT/cvswrappers
10694 U CVSROOT/verifymsg'
10695 echo "# made a change" >>CVSROOT/modules
10696 dotest modules-3g "${testcvs} -q ci -m add-modules" \
10697 "Checking in CVSROOT/modules;
10698 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
10699 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
10701 ${PROG} commit: Rebuilding administrative file database"
10704 rm -rf ${CVSROOT_DIRNAME}/somedir
10705 ############################################################
10706 # end rebuild tests
10707 ############################################################
10710 mkdir ${CVSROOT_DIRNAME}/first-dir
10715 dotest modules-143 "${testcvs} -q co first-dir" ""
10719 dotest modules-143a "${testcvs} add subdir" \
10720 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
10724 dotest modules-143b "${testcvs} add ssdir" \
10725 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
10729 dotest modules-144 "${testcvs} add a b" \
10730 "${PROG} add: scheduling file .a. for addition
10731 ${PROG} add: scheduling file .b. for addition
10732 ${PROG} add: use .${PROG} commit. to add these files permanently"
10734 dotest modules-145 "${testcvs} ci -m added" \
10735 "${PROG} [a-z]*: Examining .
10736 ${PROG} [a-z]*: Examining ssdir
10737 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/a,v
10740 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
10741 initial revision: 1\.1
10743 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/b,v
10746 ${CVSROOT_DIRNAME}/first-dir/subdir/b,v <-- b
10747 initial revision: 1\.1
10751 dotest modules-146 "${testcvs} -q co CVSROOT" \
10752 "U CVSROOT/checkoutlist
10753 U CVSROOT/commitinfo
10755 U CVSROOT/cvswrappers
10762 U CVSROOT/verifymsg"
10764 # Here we test that CVS can deal with CVSROOT (whose repository
10765 # is at top level) in the same directory as subdir (whose repository
10766 # is a subdirectory of first-dir). TODO: Might want to check that
10767 # files can actually get updated in this state.
10768 dotest modules-147 "${testcvs} -q update" ""
10770 cat >CVSROOT/modules <<EOF
10771 realmodule first-dir/subdir a
10772 dirmodule first-dir/subdir
10773 namedmodule -d nameddir first-dir/subdir
10774 aliasmodule -a first-dir/subdir/a
10775 aliasnested -a first-dir/subdir/ssdir
10776 topfiles -a first-dir/file1 first-dir/file2
10778 statusmod -s Mungeable
10779 # Check for ability to block infinite loops.
10780 infinitealias -a infinitealias
10781 # Prior to 1.11.12 & 1.12.6, the infinite alias loop check didn't strip
10782 # slashes or work if a module called a module which then called itself
10783 # (A -> A was blocked, but not A -> B -> A or deeper).
10784 infinitealias2 -a infinitealias2/
10785 infinitealias3 -a infinitealias4/
10786 infinitealias4 -a aliasmodule infinitealias5
10787 infinitealias5 -a infinitealias3/
10788 # Options must come before arguments. It is possible this should
10789 # be relaxed at some point (though the result would be bizarre for
10790 # -a); for now test the current behavior.
10791 bogusalias first-dir/subdir/a -a
10793 dotest modules-148 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
10794 "Checking in CVSROOT/modules;
10795 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
10796 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
10798 ${PROG} commit: Rebuilding administrative file database"
10801 # The "statusmod" module contains an error; trying to use it
10802 # will produce "modules file missing directory" I think.
10803 # However, that shouldn't affect the ability of "cvs co -c" or
10804 # "cvs co -s" to do something reasonable with it.
10805 dotest modules-148a0 "${testcvs} co -c" 'aliasmodule -a first-dir/subdir/a
10806 aliasnested -a first-dir/subdir/ssdir
10807 bogusalias first-dir/subdir/a -a
10808 dirmodule first-dir/subdir
10809 infinitealias -a infinitealias
10810 infinitealias2 -a infinitealias2/
10811 infinitealias3 -a infinitealias4/
10812 infinitealias4 -a aliasmodule infinitealias5
10813 infinitealias5 -a infinitealias3/
10814 namedmodule -d nameddir first-dir/subdir
10815 realmodule first-dir/subdir a
10816 statusmod -s Mungeable
10817 topfiles -a first-dir/file1 first-dir/file2
10819 # There is code in modules.c:save_d which explicitly skips
10820 # modules defined with -a, which is why aliasmodule is not
10822 dotest modules-148a1 "${testcvs} co -s" \
10823 'statusmod Mungeable
10824 bogusalias NONE first-dir/subdir/a -a
10825 dirmodule NONE first-dir/subdir
10826 namedmodule NONE first-dir/subdir
10827 realmodule NONE first-dir/subdir a'
10829 # Check that infinite loops are avoided
10830 dotest modules-148a1.1 "${testcvs} co infinitealias" \
10831 "$PROG checkout: module \`infinitealias' in modules file contains infinite loop" \
10832 "$PROG server: module \`infinitealias' in modules file contains infinite loop
10833 $PROG checkout: module \`infinitealias' in modules file contains infinite loop"
10834 # Prior to 1.11.12 & 1.12.6, the inifinte alias loop check did not
10836 dotest modules-148a1.2 "${testcvs} co infinitealias2" \
10837 "$PROG checkout: module \`infinitealias2' in modules file contains infinite loop" \
10838 "$PROG server: module \`infinitealias2' in modules file contains infinite loop
10839 $PROG checkout: module \`infinitealias2' in modules file contains infinite loop"
10840 # Prior to 1.11.12 & 1.12.6, the inifinte alias loop check did not
10841 # notice when A -> B -> A, it only noticed A -> A.
10842 dotest modules-148a1.3 "${testcvs} co infinitealias3/" \
10843 "$PROG checkout: module \`infinitealias3' in modules file contains infinite loop" \
10844 "$PROG server: module \`infinitealias3' in modules file contains infinite loop
10845 $PROG checkout: module \`infinitealias3' in modules file contains infinite loop"
10847 # Test that real modules check out to realmodule/a, not subdir/a.
10848 dotest modules-149a1 "${testcvs} co realmodule" "U realmodule/a"
10849 dotest modules-149a2 "test -d realmodule && test -f realmodule/a" ""
10850 dotest_fail modules-149a3 "test -f realmodule/b" ""
10851 dotest modules-149a4 "${testcvs} -q co realmodule" ""
10852 dotest modules-149a5 "echo yes | ${testcvs} release -d realmodule" \
10853 "You have \[0\] altered files in this repository\.
10854 Are you sure you want to release (and delete) directory .realmodule.: "
10856 dotest_fail modules-149b1 "${testcvs} co realmodule/a" \
10857 "${PROG}"' checkout: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
10858 "${PROG}"' server: module `realmodule/a'\'' is a request for a file in a module which is not a directory
10859 '"${PROG}"' \[checkout aborted\]: cannot expand modules'
10861 # Now test the ability to check out a single file from a directory
10862 dotest modules-150c "${testcvs} co dirmodule/a" "U dirmodule/a"
10863 dotest modules-150d "test -d dirmodule && test -f dirmodule/a" ""
10864 dotest_fail modules-150e "test -f dirmodule/b" ""
10865 dotest modules-150f "echo yes | ${testcvs} release -d dirmodule" \
10866 "You have \[0\] altered files in this repository\.
10867 Are you sure you want to release (and delete) directory .dirmodule.: "
10868 # Now test the ability to correctly reject a non-existent filename.
10869 # For maximum studliness we would check that an error message is
10871 # We accept a zero exit status because it is what CVS does
10872 # (Dec 95). Probably the exit status should be nonzero,
10874 dotest modules-150g1 "${testcvs} co dirmodule/nonexist" \
10875 "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared"
10876 # We tolerate the creation of the dirmodule directory, since that
10877 # is what CVS does, not because we view that as preferable to not
10879 dotest_fail modules-150g2 "test -f dirmodule/a || test -f dirmodule/b" ""
10882 # Now test that a module using -d checks out to the specified
10884 dotest modules-150h1 "${testcvs} -q co namedmodule" \
10887 dotest modules-150h2 "test -f nameddir/a && test -f nameddir/b" ""
10888 echo add line >>nameddir/a
10889 dotest modules-150h3 "${testcvs} -q co namedmodule" 'M nameddir/a'
10891 dotest modules-150h4 "${testcvs} -q co namedmodule" 'U nameddir/a'
10892 dotest modules-150h99 "echo yes | ${testcvs} release -d nameddir" \
10893 "You have \[0\] altered files in this repository\.
10894 Are you sure you want to release (and delete) directory .nameddir.: "
10896 # Now test that alias modules check out to subdir/a, not
10898 dotest modules-151 "${testcvs} co aliasmodule" ""
10899 dotest_fail modules-152 "test -d aliasmodule" ""
10900 echo abc >>first-dir/subdir/a
10901 dotest modules-153 "${testcvs} -q co aliasmodule" "M first-dir/subdir/a"
10908 dotest modules-155a0 "${testcvs} co aliasnested" \
10909 "${PROG} checkout: Updating first-dir/subdir/ssdir"
10910 dotest modules-155a1 "test -d first-dir" ''
10911 dotest modules-155a2 "test -d first-dir/subdir" ''
10912 dotest modules-155a3 "test -d first-dir/subdir/ssdir" ''
10913 # Test that nothing extraneous got created.
10914 dotest modules-155a4 "ls" "first-dir" \
10920 # Test checking out everything.
10923 dotest modules-155b "${testcvs} -q co world" \
10924 "U CVSROOT/${DOTSTAR}
10925 U first-dir/subdir/a
10926 U first-dir/subdir/b"
10930 # Test checking out a module which lists at least two
10931 # specific files twice. At one time, this failed over
10935 dotest modules-155c1 "${testcvs} -q co first-dir" \
10936 "U first-dir/subdir/a
10937 U first-dir/subdir/b"
10940 echo 'first revision' > file1
10941 echo 'first revision' > file2
10942 dotest modules-155c2 "${testcvs} add file1 file2" \
10943 "${PROG}"' add: scheduling file `file1'\'' for addition
10944 '"${PROG}"' add: scheduling file `file2'\'' for addition
10945 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
10946 dotest modules-155c3 "${testcvs} -q ci -m add-it" \
10947 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
10950 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
10951 initial revision: 1\.1
10953 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
10956 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
10957 initial revision: 1\.1
10962 dotest modules-155c4 "${testcvs} -q co topfiles" \
10965 dotest modules-155c5 "${testcvs} -q co topfiles" ""
10967 # Make sure the right thing happens if we remove a file.
10969 dotest modules-155c6 "${testcvs} -q rm -f file1" \
10970 "${PROG} remove: use .${PROG} commit. to remove this file permanently"
10971 dotest modules-155c7 "${testcvs} -q ci -m remove-it" \
10973 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
10974 new revision: delete; previous revision: 1\.1
10978 dotest modules-155c8 "${testcvs} -q co topfiles" \
10979 "${PROG} checkout: warning: first-dir/file1 is not (any longer) pertinent
10985 rm -rf ${CVSROOT_DIRNAME}/first-dir
10989 # More tests of modules, in particular the & feature.
10991 dotest modules2-setup-1 "${testcvs} -q co -l ." ''
10992 mkdir first-dir second-dir third-dir
10993 dotest modules2-setup-2 \
10994 "${testcvs} add first-dir second-dir third-dir" \
10995 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
10996 Directory ${CVSROOT_DIRNAME}/second-dir added to the repository
10997 Directory ${CVSROOT_DIRNAME}/third-dir added to the repository"
11000 dotest modules2-setup-3 "${testcvs} add file3" \
11001 "${PROG} add: scheduling file .file3. for addition
11002 ${PROG} add: use .${PROG} commit. to add this file permanently"
11003 dotest modules2-setup-4 "${testcvs} -q ci -m add file3" \
11004 "RCS file: ${CVSROOT_DIRNAME}/third-dir/file3,v
11007 ${CVSROOT_DIRNAME}/third-dir/file3,v <-- file3
11008 initial revision: 1\.1
11016 dotest modules2-1 "${testcvs} -q co CVSROOT/modules" \
11017 'U CVSROOT/modules'
11019 cat >> modules << EOF
11020 ampermodule &first-dir &second-dir
11021 combmodule third-dir file3 &first-dir
11022 ampdirmod -d newdir &first-dir &second-dir
11024 messymod first-dir &messymodchild
11025 messymodchild -d sdir/child second-dir
11027 # Depending on whether the user also ran the modules test
11028 # we will be checking in revision 1.2 or 1.3.
11029 dotest modules2-2 "${testcvs} -q ci -m add-modules" \
11030 "Checking in modules;
11031 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
11032 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
11034 ${PROG} commit: Rebuilding administrative file database"
11038 dotest modules2-3 "${testcvs} -q co ampermodule" ''
11039 dotest modules2-4 "test -d ampermodule/first-dir" ''
11040 dotest modules2-5 "test -d ampermodule/second-dir" ''
11042 # Test ability of cvs release to handle multiple arguments
11043 # See comment at "release" for list of other cvs release tests.
11045 if ${testcvs} release -d first-dir second-dir <<EOF >>${LOGFILE}
11054 dotest_fail modules2-7 "test -d first-dir" ''
11055 dotest_fail modules2-8 "test -d second-dir" ''
11059 # There used to be a nasty-hack that made CVS skip creation of the
11060 # module dir (in this case ampermodule) when -n was specified
11061 dotest modules2-ampermod-1 "${testcvs} -q co -n ampermodule" ''
11062 dotest modules2-ampermod-2 "test -d ampermodule/first-dir" ''
11063 dotest modules2-ampermod-3 "test -d ampermodule/second-dir" ''
11065 # Test release of a module
11066 if echo yes |${testcvs} release -d ampermodule >>${LOGFILE}; then
11067 pass modules2-ampermod-release-1
11069 fail modules2-ampermod-release-1
11071 dotest_fail modules2-ampermod-release-2 "test -d ampermodule" ''
11073 # and the '-n' test again, but in conjunction with '-d'
11074 dotest modules2-ampermod-4 "${testcvs} -q co -n -d newname ampermodule" ''
11075 dotest modules2-ampermod-5 "test -d newname/first-dir" ''
11076 dotest modules2-ampermod-6 "test -d newname/second-dir" ''
11079 # Now we create another directory named first-dir and make
11080 # sure that CVS doesn't get them mixed up.
11082 # Note that this message should say "Updating ampermodule/first-dir"
11083 # I suspect. This is a long-standing behavior/bug....
11084 dotest modules2-9 "${testcvs} co ampermodule" \
11085 "${PROG} checkout: Updating first-dir
11086 ${PROG} checkout: Updating second-dir"
11087 touch ampermodule/first-dir/amper1
11089 dotest modules2-10 "${testcvs} add first-dir/amper1" \
11090 "${PROG} add: scheduling file .first-dir/amper1. for addition
11091 ${PROG} add: use .${PROG} commit. to add this file permanently"
11094 # As with the "Updating xxx" message, the "U first-dir/amper1"
11095 # message (instead of "U ampermodule/first-dir/amper1") is
11097 dotest modules2-12 "${testcvs} co ampermodule" \
11098 "${PROG} checkout: Updating first-dir
11100 ${PROG} checkout: Updating second-dir"
11103 dotest modules2-13 "${testcvs} -q ci -m add-it ampermodule" \
11104 "RCS file: ${CVSROOT_DIRNAME}/first-dir/amper1,v
11106 Checking in ampermodule/first-dir/amper1;
11107 ${CVSROOT_DIRNAME}/first-dir/amper1,v <-- amper1
11108 initial revision: 1\.1
11111 # Trying this as above led to a "protocol error" message.
11112 # Work around this bug.
11114 dotest modules2-13 "${testcvs} -q ci -m add-it" \
11115 "RCS file: ${CVSROOT_DIRNAME}/first-dir/amper1,v
11117 Checking in first-dir/amper1;
11118 ${CVSROOT_DIRNAME}/first-dir/amper1,v <-- amper1
11119 initial revision: 1\.1
11126 # Now test the "combmodule" module (combining regular modules
11127 # and ampersand modules in the same module definition).
11129 dotest modules2-14 "${testcvs} co combmodule" \
11130 "U combmodule/file3
11131 ${PROG} checkout: Updating first-dir
11132 U first-dir/amper1"
11133 dotest modules2-15 "test -f combmodule/file3" ""
11134 dotest modules2-16 "test -f combmodule/first-dir/amper1" ""
11137 # At least for now there is no way to tell CVS that
11138 # some files/subdirectories come from one repository directory,
11139 # and others from another.
11140 # This seems like a pretty sensible behavior to me, in the
11141 # sense that first-dir doesn't "really" exist within
11142 # third-dir, so CVS just acts as if there is nothing there
11144 dotest modules2-17 "${testcvs} update -d" \
11145 "${PROG} update: Updating \."
11148 dotest modules2-18 "${testcvs} -q co combmodule" \
11149 "U first-dir/amper1"
11150 dotest modules2-19 "test -f combmodule/first-dir/amper1" ""
11154 # Now test the "ampdirmod" and "badmod" modules to be sure that
11155 # options work with ampersand modules but don't prevent the
11156 # "missing directory" error message.
11158 dotest modules2-20 "${testcvs} co ampdirmod" \
11159 "${PROG} checkout: Updating first-dir
11161 ${PROG} checkout: Updating second-dir"
11162 dotest modules2-21 "test -f newdir/first-dir/amper1" ""
11163 dotest modules2-22 "test -d newdir/second-dir" ""
11164 dotest_fail modules2-23 "${testcvs} co badmod" \
11165 "${PROG} checkout: modules file missing directory for module badmod" \
11166 "${PROG} server: modules file missing directory for module badmod
11167 ${PROG} \[checkout aborted\]: cannot expand modules"
11171 # Confirm that a rename with added depth nested in an ampersand
11174 dotest modules2-nestedrename-1 "${testcvs} -q co messymod" \
11175 "U messymod/amper1"
11176 dotest modules2-nestedrename-2 "test -d messymod/sdir" ''
11177 dotest modules2-nestedrename-3 "test -d messymod/sdir/CVS" ''
11178 dotest modules2-nestedrename-4 "test -d messymod/sdir/child" ''
11179 dotest modules2-nestedrename-5 "test -d messymod/sdir/child/CVS" ''
11182 # FIXME: client/server has a bug. It should be working like a local
11183 # repository in this case, but fails to check out the second module
11184 # in the list when a branch is specified.
11186 dotest modules2-ampertag-setup-1 \
11187 "${testcvs} -Q rtag tag first-dir second-dir third-dir" \
11189 dotest modules2-ampertag-1 "${testcvs} -q co -rtag ampermodule" \
11190 "U first-dir/amper1"
11192 dotest_fail modules2-ampertag-2 "test -d ampermodule/second-dir" ''
11193 dotest_fail modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
11195 dotest modules2-ampertag-2 "test -d ampermodule/second-dir" ''
11196 dotest modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
11200 # Test for tag files when an ampermod is renamed with more path
11201 # elements than it started with.
11203 # FIXME: This is currently broken in the remote case, possibly only
11204 # because the messymodchild isn't being checked out at all.
11206 # dotest modules2-tagfiles-setup-1 \
11207 #"${testcvs} -Q rtag -b branch first-dir second-dir" \
11209 dotest modules2-tagfiles-1 "${testcvs} -q co -rtag messymod" \
11210 "U messymod/amper1"
11212 dotest_fail modules2-tagfiles-2r "test -d messymod/sdir" ''
11214 dotest modules2-tagfiles-2 "cat messymod/sdir/CVS/Tag" 'Ttag'
11218 # Test that CVS gives an error if one combines -a with
11220 # Probably would be better to break this out into a separate
11221 # test. Although it is short, it shares no files/state with
11222 # the rest of the modules2 tests.
11224 dotest modules2-a0.5 "${testcvs} -q co CVSROOT/modules" \
11225 'U CVSROOT/modules'
11227 echo 'aliasopt -a -d onedir first-dir' >modules
11228 dotest modules2-a0 "${testcvs} -q ci -m add-modules" \
11229 "Checking in modules;
11230 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
11231 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
11233 ${PROG} commit: Rebuilding administrative file database"
11235 dotest_fail modules2-a1 "${testcvs} -q co aliasopt" \
11236 "${PROG} checkout: -a cannot be specified in the modules file along with other options" \
11237 "${PROG} server: -a cannot be specified in the modules file along with other options
11238 ${PROG} \[checkout aborted\]: cannot expand modules"
11242 rm -rf ${CVSROOT_DIRNAME}/first-dir
11243 rm -rf ${CVSROOT_DIRNAME}/second-dir
11244 rm -rf ${CVSROOT_DIRNAME}/third-dir
11248 # More tests of modules, in particular what happens if several
11249 # modules point to the same file.
11251 # First just set up a directory first-dir and a file file1 in it.
11254 dotest modules3-0 "${testcvs} -q co -l ." ''
11256 dotest modules3-1 "${testcvs} add first-dir" \
11257 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
11261 dotest modules3-2 "${testcvs} add file1" \
11262 "${PROG} add: scheduling file \`file1' for addition
11263 ${PROG} add: use '${PROG} commit' to add this file permanently"
11264 dotest modules3-3 "${testcvs} -q ci -m add-it" \
11265 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
11268 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
11269 initial revision: 1\.1
11273 dotest modules3-4 "${testcvs} -q update -d CVSROOT" \
11274 "U CVSROOT${DOTSTAR}"
11277 mod1 -a first-dir/file1
11278 bigmod -a mod1 first-dir/file1
11279 namednest -d src/sub/dir first-dir
11280 nestdeeper -d src/sub1/sub2/sub3/dir first-dir
11281 nestshallow -d src/dir second-dir/suba/subb
11282 path/in/modules &mod1
11283 another/path/test -d another/path/test first-dir
11285 dotest modules3-5 "${testcvs} -q ci -m add-modules" \
11286 "Checking in modules;
11287 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
11288 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
11290 ${PROG} commit: Rebuilding administrative file database"
11293 dotest modules3-6 "${testcvs} -q co bigmod" ''
11295 dotest modules3-7 "${testcvs} -q co bigmod" 'U first-dir/file1'
11302 # This fails to work remote (it doesn't notice the directories,
11303 # I suppose because they contain no files). Bummer, especially
11304 # considering this is a documented technique and everything.
11305 dotest modules3-7a \
11306 "${testcvs} import -m add-dirs second-dir tag1 tag2" \
11307 "${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/suba
11308 ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/suba/subb
11310 No conflicts created by this import" "
11311 No conflicts created by this import"
11314 dotest modules3-7b "${testcvs} co second-dir" \
11315 "${PROG} checkout: Updating second-dir
11316 ${PROG} checkout: Updating second-dir/suba
11317 ${PROG} checkout: Updating second-dir/suba/subb" \
11318 "${PROG} checkout: Updating second-dir"
11323 dotest modules3-7-workaround1 "${testcvs} add suba" \
11324 "Directory ${CVSROOT_DIRNAME}/second-dir/suba added to the repository"
11327 dotest modules3-7-workaround2 "${testcvs} add subb" \
11328 "Directory ${CVSROOT_DIRNAME}/second-dir/suba/subb added to the repository"
11332 cd second-dir/suba/subb
11334 dotest modules3-7c "${testcvs} add fileb" \
11335 "${PROG} add: scheduling file .fileb. for addition
11336 ${PROG} add: use .${PROG} commit. to add this file permanently"
11337 dotest modules3-7d "${testcvs} -q ci -m add-it" \
11338 "RCS file: ${CVSROOT_DIRNAME}/second-dir/suba/subb/fileb,v
11341 ${CVSROOT_DIRNAME}/second-dir/suba/subb/fileb,v <-- fileb
11342 initial revision: 1\.1
11349 dotest modules3-8 "${testcvs} -q co namednest" \
11350 'U src/sub/dir/file1'
11351 dotest modules3-9 "test -f src/sub/dir/file1" ''
11355 # Try the same thing, but with the directories nested even
11356 # deeper (deeply enough so they are nested more deeply than
11357 # the number of directories from / to ${TESTDIR}).
11360 dotest modules3-10 "${testcvs} -q co nestdeeper" \
11361 'U src/sub1/sub2/sub3/dir/file1'
11362 dotest modules3-11 "test -f src/sub1/sub2/sub3/dir/file1" ''
11364 # While we are doing things like twisted uses of '/' (e.g.
11365 # modules3-12), try this one.
11367 dotest_fail modules3-11b \
11368 "${testcvs} -q update ${TESTDIR}/1/src/sub1/sub2/sub3/dir/file1" \
11369 "absolute pathname .${TESTDIR}/1/src/sub1/sub2/sub3/dir. illegal for server"
11370 fi # end of remote-only tests
11375 # This one is almost too twisted for words. The pathname output
11376 # in the message from "co" doesn't include the "path/in/modules",
11377 # but those directories do get created (with no CVSADM except
11378 # in "modules" which has a CVSNULLREPOS).
11379 # I'm not sure anyone is relying on this nonsense or whether we
11380 # need to keep doing it, but it is what CVS currently does...
11381 # Skip it for remote; the remote code has the good sense to
11382 # not deal with it (on the minus side it gives
11383 # "internal error: repository string too short." (CVS 1.9) or
11384 # "warning: server is not creating directories one at a time" (now)
11385 # instead of a real error).
11386 # I'm tempted to just make it a fatal error to have '/' in a
11387 # module name. But see comments at modules3-16.
11388 if $remote; then :; else
11390 dotest modules3-12 "${testcvs} -q co path/in/modules" \
11391 "U first-dir/file1"
11392 dotest modules3-13 "test -f path/in/modules/first-dir/file1" ''
11394 fi # end of tests skipped for remote
11396 # Now here is where it used to get seriously bogus.
11398 dotest modules3-14 \
11399 "${testcvs} -q rtag tag1 path/in/modules" ''
11400 # CVS used to create this even though rtag should *never* affect
11401 # the directory current when it is called!
11402 dotest_fail modules3-15 "test -d path/in/modules" ''
11403 # Just for trivia's sake, rdiff was not similarly vulnerable
11404 # because it passed 0 for run_module_prog to do_module.
11407 # Some people seem to want this to work. I still suspect there
11408 # are dark corners in slashes in module names. This probably wants
11409 # more thought before we start hacking on CVS (one way or the other)
11410 # or documenting this.
11412 dotest modules3-16 "${testcvs} -q co another/path/test" \
11413 "U another/path/test/file1"
11414 dotest modules3-17 "cat another/path/test/file1" 'file1'
11417 rm -rf ${CVSROOT_DIRNAME}/first-dir
11418 rm -rf ${CVSROOT_DIRNAME}/second-dir
11422 # Some tests using the modules file with aliases that
11423 # exclude particular directories.
11427 dotest modules4-1 "${testcvs} -q co -l ." ''
11429 dotest modules4-2 "${testcvs} add first-dir" \
11430 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
11434 dotest modules4-3 "${testcvs} add subdir" \
11435 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
11438 dotest modules4-4 "${testcvs} add file1" \
11439 "${PROG}"' add: scheduling file `file1'\'' for addition
11440 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
11442 echo file2 > subdir/file2
11443 dotest modules4-5 "${testcvs} add subdir/file2" \
11444 "${PROG}"' add: scheduling file `subdir/file2'\'' for addition
11445 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
11447 dotest modules4-6 "${testcvs} -q ci -m add-it" \
11448 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
11451 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
11452 initial revision: 1\.1
11454 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
11456 Checking in subdir/file2;
11457 ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v <-- file2
11458 initial revision: 1\.1
11463 dotest modules4-7 "${testcvs} -q update -d CVSROOT" \
11464 "U CVSROOT${DOTSTAR}"
11468 some -a !first-dir/subdir first-dir
11469 somewhat -a first-dir !first-dir/subdir
11471 dotest modules4-8 "${testcvs} -q ci -m add-modules" \
11472 "Checking in modules;
11473 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
11474 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
11476 ${PROG} commit: Rebuilding administrative file database"
11482 dotest modules4-9 "${testcvs} -q co all" \
11484 U first-dir/subdir/file2"
11487 dotest modules4-10 "${testcvs} -q co some" "U first-dir/file1"
11488 dotest_fail modules4-11 "test -d first-dir/subdir" ''
11492 # But remote seems to do it the other way.
11493 dotest modules4-11a "${testcvs} -q co somewhat" "U first-dir/file1"
11494 dotest_fail modules4-11b "test -d first-dir/subdir" ''
11496 # This is strange behavior, in that the order of the
11497 # "!first-dir/subdir" and "first-dir" matter, and it isn't
11498 # clear that they should. I suspect it is long-standing
11499 # strange behavior but I haven't verified that.
11500 dotest modules4-11a "${testcvs} -q co somewhat" \
11502 U first-dir/subdir/file2"
11509 dotest modules4-12 "${testcvs} rtag tag some" \
11510 "${PROG} rtag: Tagging first-dir
11511 ${PROG} rtag: Ignoring first-dir/subdir"
11513 cd 1/first-dir/subdir
11514 dotest modules4-13 "${testcvs} log file2" "
11515 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
11516 Working file: file2
11522 keyword substitution: kv
11523 total revisions: 1; selected revisions: 1
11525 ----------------------------
11527 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
11529 ============================================================================="
11534 rm -rf ${CVSROOT_DIRNAME}/first-dir
11538 # Test module programs
11540 mkdir ${CVSROOT_DIRNAME}/first-dir
11543 dotest modules5-1 "${testcvs} -q co first-dir" ""
11546 dotest modules5-2 "${testcvs} add subdir" \
11547 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
11550 dotest modules5-3 "${testcvs} add ssdir" \
11551 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
11553 dotest modules5-4 "${testcvs} add a b" \
11554 "${PROG} add: scheduling file .a. for addition
11555 ${PROG} add: scheduling file .b. for addition
11556 ${PROG} add: use .${PROG} commit. to add these files permanently"
11558 dotest modules5-5 "${testcvs} ci -m added" \
11559 "${PROG} [a-z]*: Examining .
11560 ${PROG} [a-z]*: Examining ssdir
11561 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/a,v
11564 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
11565 initial revision: 1\.1
11567 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/b,v
11570 ${CVSROOT_DIRNAME}/first-dir/subdir/b,v <-- b
11571 initial revision: 1\.1
11575 dotest modules5-6 "${testcvs} -q co CVSROOT" \
11576 "U CVSROOT/checkoutlist
11577 U CVSROOT/commitinfo
11579 U CVSROOT/cvswrappers
11586 U CVSROOT/verifymsg"
11588 # FIXCVS: The sleep in the following script helps avoid out of
11589 # order messages, but we really need to figure out how to fix
11590 # cvs to prevent them in the first place.
11591 for i in checkout export tag; do
11592 cat >> ${CVSROOT_DIRNAME}/$i.sh <<EOF
11595 echo "$i script invoked in \`pwd\`"
11598 # Cygwin doesn't set premissions correctly over the Samba share.
11599 if test -n "$remotehost"; then
11600 $CVS_RSH $remotehost "chmod +x ${CVSROOT_DIRNAME}/$i.sh"
11602 chmod +x ${CVSROOT_DIRNAME}/$i.sh
11606 OPTS="-o${CVSROOT_DIRNAME}/checkout.sh -e ${CVSROOT_DIRNAME}/export.sh -t${CVSROOT_DIRNAME}/tag.sh"
11607 cat >CVSROOT/modules <<EOF
11608 realmodule ${OPTS} first-dir/subdir a
11609 dirmodule ${OPTS} first-dir/subdir
11610 namedmodule -d nameddir ${OPTS} first-dir/subdir
11613 dotest modules5-7 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
11615 "Checking in CVSROOT/modules;
11616 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
11617 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
11619 ${PROG} commit: Rebuilding administrative file database"
11624 # Test that real modules check out to realmodule/a, not subdir/a.
11626 dotest modules5-8 "${testcvs} co realmodule" \
11628 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
11629 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11632 dotest modules5-8 "${testcvs} co realmodule" \
11634 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
11635 checkout script invoked in ${TESTDIR}/1
11638 dotest modules5-9 "test -d realmodule && test -f realmodule/a" ""
11639 dotest_fail modules5-10 "test -f realmodule/b" ""
11641 dotest modules5-11 "${testcvs} -q co realmodule" \
11642 "checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11644 dotest modules5-12 "${testcvs} -q update" ''
11645 echo "change" >>realmodule/a
11646 dotest modules5-13 "${testcvs} -q ci -m." \
11647 "Checking in realmodule/a;
11648 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
11649 new revision: 1\.2; previous revision: 1\.1
11652 dotest modules5-11 "${testcvs} -q co realmodule" \
11653 "checkout script invoked in ${TESTDIR}/1
11655 dotest modules5-12 "${testcvs} -q update" ''
11656 echo "change" >>realmodule/a
11657 dotest modules5-13 "${testcvs} -q ci -m." \
11658 "Checking in realmodule/a;
11659 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
11660 new revision: 1\.2; previous revision: 1\.1
11663 dotest modules5-14 "echo yes | ${testcvs} release -d realmodule" \
11664 "You have \[0\] altered files in this repository\.
11665 Are you sure you want to release (and delete) directory .realmodule.: "
11666 dotest modules5-15 "${testcvs} -q rtag -Dnow MYTAG realmodule" \
11667 "tag script invoked in ${TESTDIR}/1
11668 args: realmodule MYTAG" \
11669 "tag script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11670 args: realmodule MYTAG"
11672 dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
11674 export script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11677 dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
11679 export script invoked in ${TESTDIR}/1
11684 dotest_fail modules5-17 "${testcvs} co realmodule/a" \
11685 "${PROG}"' checkout: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
11686 "${PROG}"' server: module `realmodule/a'\'' is a request for a file in a module which is not a directory
11687 '"${PROG}"' \[checkout aborted\]: cannot expand modules'
11689 # Now test the ability to check out a single file from a directory
11691 dotest modules5-18 "${testcvs} co dirmodule/a" \
11693 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
11694 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11697 dotest modules5-18 "${testcvs} co dirmodule/a" \
11699 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
11700 checkout script invoked in ${TESTDIR}/1
11703 dotest modules5-19 "test -d dirmodule && test -f dirmodule/a" ""
11704 dotest_fail modules5-20 "test -f dirmodule/b" ""
11705 dotest modules5-21 "echo yes | ${testcvs} release -d dirmodule" \
11706 "You have \[0\] altered files in this repository\.
11707 Are you sure you want to release (and delete) directory .dirmodule.: "
11709 # Now test the ability to correctly reject a non-existent filename.
11710 # For maximum studliness we would check that an error message is
11712 # We accept a zero exit status because it is what CVS does
11713 # (Dec 95). Probably the exit status should be nonzero,
11716 dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
11717 "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared
11718 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
11719 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11722 dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
11723 "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared
11724 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
11725 checkout script invoked in ${TESTDIR}/1
11728 # We tolerate the creation of the dirmodule directory, since that
11729 # is what CVS does, not because we view that as preferable to not
11731 dotest_fail modules5-23 "test -f dirmodule/a || test -f dirmodule/b" ""
11734 # Now test that a module using -d checks out to the specified
11737 dotest modules5-24 "${testcvs} -q co namedmodule" \
11740 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11743 dotest modules5-24 "${testcvs} -q co namedmodule" \
11746 checkout script invoked in ${TESTDIR}/1
11749 dotest modules5-25 "test -f nameddir/a && test -f nameddir/b" ""
11750 echo add line >>nameddir/a
11751 # This seems suspicious: when we checkout an existing directory,
11752 # the checkout script gets executed in addition to the update
11753 # script. Is that by design or accident?
11755 dotest modules5-26 "${testcvs} -q co namedmodule" \
11757 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11760 dotest modules5-26 "${testcvs} -q co namedmodule" \
11762 checkout script invoked in ${TESTDIR}/1
11768 dotest modules5-27 "${testcvs} -q co namedmodule" \
11770 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11773 dotest modules5-27 "${testcvs} -q co namedmodule" \
11775 checkout script invoked in ${TESTDIR}/1
11778 dotest modules5-28 "echo yes | ${testcvs} release -d nameddir" \
11779 "You have \[0\] altered files in this repository\.
11780 Are you sure you want to release (and delete) directory .nameddir.: "
11782 # Now try the same tests with -d on command line
11783 # FIXCVS? The manual says the modules programs get the module name,
11784 # but they really get the directory name.
11786 dotest modules5-29 "${testcvs} co -d mydir realmodule" \
11788 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
11789 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11792 dotest modules5-29 "${testcvs} co -d mydir realmodule" \
11794 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
11795 checkout script invoked in ${TESTDIR}/1
11798 dotest modules5-30 "test -d mydir && test -f mydir/a" ""
11799 dotest_fail modules5-31 "test -d realmodule || test -f mydir/b" ""
11801 dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \
11802 "checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11804 dotest modules5-33 "${testcvs} -q update" ''
11805 echo "change" >>mydir/a
11806 dotest modules5-34 "${testcvs} -q ci -m." \
11807 "Checking in mydir/a;
11808 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
11809 new revision: 1\.3; previous revision: 1\.2
11812 dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \
11813 "checkout script invoked in ${TESTDIR}/1
11815 dotest modules5-33 "${testcvs} -q update" ''
11816 echo "change" >>mydir/a
11817 dotest modules5-34 "${testcvs} -q ci -m." \
11818 "Checking in mydir/a;
11819 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
11820 new revision: 1\.3; previous revision: 1\.2
11823 dotest modules5-35 "echo yes | ${testcvs} release -d mydir" \
11824 "You have \[0\] altered files in this repository\.
11825 Are you sure you want to release (and delete) directory .mydir.: "
11827 dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \
11828 "tag script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11829 args: realmodule MYTAG2"
11830 dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \
11832 export script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11835 dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \
11836 "tag script invoked in ${TESTDIR}/1
11837 args: realmodule MYTAG2"
11838 dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \
11840 export script invoked in ${TESTDIR}/1
11845 # Now test the ability to check out a single file from a directory
11847 dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \
11849 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
11850 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11853 dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \
11855 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
11856 checkout script invoked in ${TESTDIR}/1
11859 dotest modules5-39 "test -d mydir && test -f mydir/a" ""
11860 dotest_fail modules5-40 "test -d dirmodule || test -f mydir/b" ""
11861 dotest modules5-41 "echo yes | ${testcvs} release -d mydir" \
11862 "You have \[0\] altered files in this repository\.
11863 Are you sure you want to release (and delete) directory .mydir.: "
11865 # Now test the ability to correctly reject a non-existent filename.
11866 # For maximum studliness we would check that an error message is
11868 # We accept a zero exit status because it is what CVS does
11869 # (Dec 95). Probably the exit status should be nonzero,
11872 dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \
11873 "${PROG} checkout: warning: new-born mydir/nonexist has disappeared
11874 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
11875 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11878 dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \
11879 "${PROG} checkout: warning: new-born mydir/nonexist has disappeared
11880 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
11881 checkout script invoked in ${TESTDIR}/1
11884 # We tolerate the creation of the mydir directory, since that
11885 # is what CVS does, not because we view that as preferable to not
11887 dotest_fail modules5-43 "test -f mydir/a || test -f mydir/b" ""
11891 dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \
11894 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11897 dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \
11900 checkout script invoked in ${TESTDIR}/1
11903 dotest modules5-45 "test -f mydir/a && test -f mydir/b" ""
11904 dotest_fail modules5-46 "test -d namedir"
11905 echo add line >>mydir/a
11906 # This seems suspicious: when we checkout an existing directory,
11907 # the checkout script gets executed in addition to the update
11908 # script. Is that by design or accident?
11910 dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \
11912 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11915 dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \
11917 checkout script invoked in ${TESTDIR}/1
11923 dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \
11925 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
11928 dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \
11930 checkout script invoked in ${TESTDIR}/1
11933 dotest modules5-49 "echo yes | ${testcvs} release -d mydir" \
11934 "You have \[0\] altered files in this repository\.
11935 Are you sure you want to release (and delete) directory .mydir.: "
11938 rm -rf 1 ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/*.sh
11943 # Test invalid module definitions
11945 # See the header comment for the `modules' test for an index of
11946 # the complete suite of modules tests.
11950 # There was a bug in CVS through 1.11.1p1 where a bad module name
11951 # would cause the previous line to be parsed as the module
11952 # definition. This test proves this doesn't happen anymore.
11956 dotest module6-setup-1 "${testcvs} -Q co CVSROOT" ""
11958 echo "longmodulename who cares" >modules
11959 echo "badname" >>modules
11960 # This test almost isn't setup since it generates the error message
11961 # we are looking for if `-Q' isn't specified, but I want to test the
11962 # filename in the message later.
11963 dotest modules6-setup-2 "${testcvs} -Q ci -mbad-modules" \
11964 "Checking in modules;
11965 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
11966 new revision: [0-9.]*; previous revision: [0-9.]*
11968 ${PROG} commit: Rebuilding administrative file database"
11970 # Here's where CVS would report not being able to find `lename'
11972 dotest_fail modules6-1 "${testcvs} -q co badname" \
11973 "${PROG} checkout: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules.
11974 ${PROG} checkout: cannot find module .badname. - ignored" \
11975 "${PROG} server: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules.
11976 ${PROG} server: cannot find module .badname. - ignored
11977 ${PROG} \[checkout aborted\]: cannot expand modules"
11981 echo "# empty modules file" >modules
11982 dotest modules6-cleanup-1 "${testcvs} -Q ci -mempty-modules" \
11983 "Checking in modules;
11984 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
11985 new revision: [0-9.]*; previous revision: [0-9.]*
11987 ${PROG} commit: Rebuilding administrative file database"
11990 if $keep; then :; else
11996 # When a file listed in checkoutlist doesn't exist, cvs-1.10.4
11997 # would fail to remove the CVSROOT/.#[0-9]* temporary file it
11998 # creates while mkmodules is in the process of trying to check
11999 # out the missing file.
12002 dotest mkmodules-temp-file-removal-1 "${testcvs} -Q co CVSROOT" ''
12004 echo no-such-file >> checkoutlist
12005 dotest mkmodules-temp-file-removal-2 "${testcvs} -Q ci -m. checkoutlist" \
12006 "Checking in checkoutlist;
12007 $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
12008 new revision: 1\.2; previous revision: 1\.1
12010 ${PROG} commit: Rebuilding administrative file database"
12012 dotest mkmodules-temp-file-removal-3 "echo $CVSROOT_DIRNAME/CVSROOT/.#[0-9]*" \
12013 "$CVSROOT_DIRNAME/CVSROOT/\.#\[0-9\]\*"
12015 # Versions 1.11.6 & 1.12.1 and earlier of CVS printed most of the
12016 # white space included before error messages in checkoutlist.
12017 echo "no-such-file Failed to update no-such-file." >checkoutlist
12018 dotest mkmodules-error-message-1 "${testcvs} -Q ci -m. checkoutlist" \
12019 "Checking in checkoutlist;
12020 $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
12021 new revision: 1\.3; previous revision: 1\.2
12023 ${PROG} commit: Rebuilding administrative file database
12024 ${PROG} commit: Failed to update no-such-file\."
12026 # Versions 1.11.6 & 1.12.1 and earlier of CVS used the error string
12027 # from the checkoutlist file as the format string passed to error()'s
12028 # printf. Check that this is no longer the case by verifying that
12029 # printf format patterns remain unchanged.
12030 echo "no-such-file Failed to update %s %lx times because %s happened %d times." >checkoutlist
12031 dotest mkmodules-error-message-2 "${testcvs} -Q ci -m. checkoutlist" \
12032 "Checking in checkoutlist;
12033 $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
12034 new revision: 1\.4; previous revision: 1\.3
12036 ${PROG} commit: Rebuilding administrative file database
12037 ${PROG} commit: Failed to update %s %lx times because %s happened %d times\."
12039 dotest mkmodules-cleanup-1 "${testcvs} -Q up -pr1.1 checkoutlist >checkoutlist"
12040 dotest mkmodules-cleanup-2 "${testcvs} -Q ci -m. checkoutlist" \
12041 "Checking in checkoutlist;
12042 $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
12043 new revision: 1\.5; previous revision: 1\.4
12045 ${PROG} commit: Rebuilding administrative file database"
12052 # Some tests of various permutations of co-d when directories exist
12053 # and checkouts lengthen.
12055 # Interestingly enough, these same tests pass when the directory
12056 # lengthening happens via the modules file. Go figure.
12058 mkdir $module; cd $module
12060 dotest co-d-init-1 "$testcvs -Q co -l ."
12062 dotest co-d-init-2 "$testcvs -Q add $module"
12064 echo content >file1
12065 echo different content >file2
12066 dotest co-d-init-3 "$testcvs -Q add file1 file2"
12067 dotest co-d-init-4 "$testcvs -Q ci -madd-em" \
12068 "RCS file: $CVSROOT_DIRNAME/co-d/file1,v
12071 $CVSROOT_DIRNAME/co-d/file1,v <-- file1
12072 initial revision: 1\.1
12074 RCS file: $CVSROOT_DIRNAME/co-d/file2,v
12077 $CVSROOT_DIRNAME/co-d/file2,v <-- file2
12078 initial revision: 1\.1
12083 dotest co-d-1 "$testcvs -q co -d dir $module" \
12086 dotest co-d-1.2 "cat dir/CVS/Repository" "$module"
12088 # FIXCVS: This should work. Correct expected result:
12090 #"U dir2/sdir/file1
12091 #U dir2/sdir/file2"
12092 dotest_fail co-d-2 "$testcvs -q co -d dir2/sdir $module" \
12093 "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir2': No such file or directory"
12095 # dotest co-d-2.2 "cat dir4/CVS/Repository" "CVSROOT/Emptydir"
12096 # dotest co-d-2.3 "cat dir5/CVS/Repository" "$module"
12099 dotest co-d-3 "$testcvs -q co -d dir3 $module" \
12102 dotest co-d-3.2 "cat dir3/CVS/Repository" "$module"
12105 # FIXCVS: As for co-d-2.
12107 dotest_fail co-d-4r "$testcvs -q co -d dir4/sdir $module" \
12108 "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir4': No such file or directory"
12110 # FIXCVS: As for co-d-2.
12113 dotest_fail co-d-5r "$testcvs -q co -d dir5/sdir $module" \
12114 "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir5': No such file or directory"
12117 dotest co-d-4 "$testcvs -q co -d dir4/sdir $module" \
12120 # CVS only creates administration directories for directories it
12121 # creates, and the last portion of the path passed to -d
12123 dotest_fail co-d-4.2 "test -d dir4/CVS"
12124 dotest co-d-4.3 "cat dir4/sdir/CVS/Repository" "$module"
12128 dotest co-d-5 "$testcvs -q co -d dir5/sdir $module" \
12131 # CVS only creates administration directories for directories it
12132 # creates, and the last portion of the path passed to -d
12134 dotest_fail co-d-5.2 "test -d dir5/CVS"
12135 dotest co-d-5.3 "cat dir5/sdir/CVS/Repository" "$module"
12140 echo Keeping ${TESTDIR} and exiting due to --keep
12145 rm -rf $CVSROOT_DIRNAME/$module
12150 # These test check the content of CVS' administrative
12151 # files as they are checked out in various configurations.
12152 # (As a side note, I'm not using the "-q" flag in any of
12153 # this code, which should provide some extra checking for
12154 # those messages which don't seem to be checked thoroughly
12155 # anywhere else.) To do a thorough test, we need to make
12156 # a bunch of modules in various configurations.
12158 # <1mod> is a directory at the top level of cvsroot
12160 # <2mod> is a directory at the second level of cvsroot
12162 # <1d1mod> is a directory at the top level which is
12163 # checked out into another directory
12164 # ``foo -d bar baz''
12165 # <1d2mod> is a directory at the second level which is
12166 # checked out into another directory
12167 # ``foo -d bar baz/quux''
12168 # <2d1mod> is a directory at the top level which is
12169 # checked out into a directory that is two deep
12170 # ``foo -d bar/baz quux''
12171 # <2d2mod> is a directory at the second level which is
12172 # checked out into a directory that is two deep
12173 # ``foo -d bar/baz quux''
12175 # The tests do each of these types separately and in twos.
12176 # We also repeat each test -d flag for 1-deep and 2-deep
12179 # Each test should check the output for the Repository
12180 # file, since that is the one which varies depending on
12181 # the directory and how it was checked out.
12183 # Yes, this is verbose, but at least it's very thorough.
12185 # convenience variables
12188 # First, set TopLevelAdmin=yes so we're sure to get
12189 # top-level CVS directories.
12191 dotest cvsadm-setup-1 "${testcvs} -q co CVSROOT/config" \
12194 echo "TopLevelAdmin=yes" >config
12195 dotest cvsadm-setup-2 "${testcvs} -q ci -m yes-top-level" \
12196 "Checking in config;
12197 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
12198 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12200 ${PROG} commit: Rebuilding administrative file database"
12204 # Second, check out the modules file and edit it.
12206 dotest cvsadm-1 "${testcvs} co CVSROOT/modules" \
12207 "U CVSROOT/modules"
12209 # Test CVS/Root once. Since there is only one part of
12210 # the code which writes CVS/Root files (Create_Admin),
12211 # there is no point in testing this every time.
12212 dotest cvsadm-1a "cat CVS/Root" ${REP}
12213 dotest cvsadm-1b "cat CVS/Repository" "\."
12214 dotest cvsadm-1c "cat CVSROOT/CVS/Root" ${REP}
12215 dotest cvsadm-1d "cat CVSROOT/CVS/Repository" "CVSROOT"
12216 # All of the defined module names begin with a number.
12217 # All of the top-level directory names begin with "dir".
12218 # All of the subdirectory names begin with "sub".
12219 # All of the top-level modules begin with "mod".
12220 echo "# Module defs for cvsadm tests" > CVSROOT/modules
12221 echo "1mod mod1" >> CVSROOT/modules
12222 echo "1mod-2 mod1-2" >> CVSROOT/modules
12223 echo "2mod mod2/sub2" >> CVSROOT/modules
12224 echo "2mod-2 mod2-2/sub2-2" >> CVSROOT/modules
12225 echo "1d1mod -d dir1d1 mod1" >> CVSROOT/modules
12226 echo "1d1mod-2 -d dir1d1-2 mod1-2" >> CVSROOT/modules
12227 echo "1d2mod -d dir1d2 mod2/sub2" >> CVSROOT/modules
12228 echo "1d2mod-2 -d dir1d2-2 mod2-2/sub2-2" >> CVSROOT/modules
12229 echo "2d1mod -d dir2d1/sub2d1 mod1" >> CVSROOT/modules
12230 echo "2d1mod-2 -d dir2d1-2/sub2d1-2 mod1-2" >> CVSROOT/modules
12231 echo "2d2mod -d dir2d2/sub2d2 mod2/sub2" >> CVSROOT/modules
12232 echo "2d2mod-2 -d dir2d2-2/sub2d2-2 mod2-2/sub2-2" >> CVSROOT/modules
12233 dotest cvsadm-1e "${testcvs} ci -m add-modules" \
12234 "${PROG} [a-z]*: Examining .
12235 ${PROG} [a-z]*: Examining CVSROOT
12236 Checking in CVSROOT/modules;
12237 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
12238 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12240 ${PROG} commit: Rebuilding administrative file database" \
12241 "${PROG} commit: Examining .
12242 ${PROG} commit: Examining CVSROOT"
12243 rm -rf CVS CVSROOT;
12245 # Create the various modules
12246 dotest cvsadm-2 "${testcvs} -q co -l ." ''
12252 mkdir mod2-2/sub2-2
12253 dotest cvsadm-2a "${testcvs} add mod1 mod1-2 mod2 mod2/sub2 mod2-2 mod2-2/sub2-2" \
12254 "Directory ${CVSROOT_DIRNAME}/mod1 added to the repository
12255 Directory ${CVSROOT_DIRNAME}/mod1-2 added to the repository
12256 Directory ${CVSROOT_DIRNAME}/mod2 added to the repository
12257 Directory ${CVSROOT_DIRNAME}/mod2/sub2 added to the repository
12258 Directory ${CVSROOT_DIRNAME}/mod2-2 added to the repository
12259 Directory ${CVSROOT_DIRNAME}/mod2-2/sub2-2 added to the repository"
12261 # Populate the directories for the halibut
12262 echo "file1" > mod1/file1
12263 echo "file1-2" > mod1-2/file1-2
12264 echo "file2" > mod2/sub2/file2
12265 echo "file2-2" > mod2-2/sub2-2/file2-2
12266 dotest cvsadm-2aa "${testcvs} add mod1/file1 mod1-2/file1-2 mod2/sub2/file2 mod2-2/sub2-2/file2-2" \
12267 "${PROG} add: scheduling file .mod1/file1. for addition
12268 ${PROG} add: scheduling file .mod1-2/file1-2. for addition
12269 ${PROG} add: scheduling file .mod2/sub2/file2. for addition
12270 ${PROG} add: scheduling file .mod2-2/sub2-2/file2-2. for addition
12271 ${PROG} add: use .${PROG} commit. to add these files permanently"
12273 dotest cvsadm-2b "${testcvs} ci -m yup mod1 mod1-2 mod2 mod2-2" \
12274 "${PROG} [a-z]*: Examining mod1
12275 ${PROG} [a-z]*: Examining mod1-2
12276 ${PROG} [a-z]*: Examining mod2
12277 ${PROG} [a-z]*: Examining mod2/sub2
12278 ${PROG} [a-z]*: Examining mod2-2
12279 ${PROG} [a-z]*: Examining mod2-2/sub2-2
12280 RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
12282 Checking in mod1/file1;
12283 ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
12284 initial revision: 1.1
12286 RCS file: ${CVSROOT_DIRNAME}/mod1-2/file1-2,v
12288 Checking in mod1-2/file1-2;
12289 ${CVSROOT_DIRNAME}/mod1-2/file1-2,v <-- file1-2
12290 initial revision: 1.1
12292 RCS file: ${CVSROOT_DIRNAME}/mod2/sub2/file2,v
12294 Checking in mod2/sub2/file2;
12295 ${CVSROOT_DIRNAME}/mod2/sub2/file2,v <-- file2
12296 initial revision: 1.1
12298 RCS file: ${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v
12300 Checking in mod2-2/sub2-2/file2-2;
12301 ${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v <-- file2-2
12302 initial revision: 1.1
12304 # Finished creating the modules -- clean up.
12305 rm -rf CVS mod1 mod1-2 mod2 mod2-2
12308 ##################################################
12309 ## Start the dizzying array of possibilities.
12310 ## Begin with each module type separately.
12311 ##################################################
12313 # Pattern -- after each checkout, first check the top-level
12314 # CVS directory. Then, check the directories in numerical
12317 dotest cvsadm-3 "${testcvs} co 1mod" \
12318 "${PROG} checkout: Updating 1mod
12320 dotest cvsadm-3b "cat CVS/Repository" "\."
12321 dotest cvsadm-3d "cat 1mod/CVS/Repository" "mod1"
12324 dotest cvsadm-4 "${testcvs} co 2mod" \
12325 "${PROG} checkout: Updating 2mod
12327 dotest cvsadm-4b "cat CVS/Repository" "\."
12328 dotest cvsadm-4d "cat 2mod/CVS/Repository" "mod2/sub2"
12331 dotest cvsadm-5 "${testcvs} co 1d1mod" \
12332 "${PROG} checkout: Updating dir1d1
12334 dotest cvsadm-5b "cat CVS/Repository" "\."
12335 dotest cvsadm-5d "cat dir1d1/CVS/Repository" "mod1"
12338 dotest cvsadm-6 "${testcvs} co 1d2mod" \
12339 "${PROG} checkout: Updating dir1d2
12341 dotest cvsadm-6b "cat CVS/Repository" "\."
12342 dotest cvsadm-6d "cat dir1d2/CVS/Repository" "mod2/sub2"
12345 dotest cvsadm-7 "${testcvs} co 2d1mod" \
12346 "${PROG} checkout: Updating dir2d1/sub2d1
12347 U dir2d1/sub2d1/file1"
12348 dotest cvsadm-7b "cat CVS/Repository" "\."
12349 dotest cvsadm-7d "cat dir2d1/CVS/Repository" "\."
12350 dotest cvsadm-7f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
12353 dotest cvsadm-8 "${testcvs} co 2d2mod" \
12354 "${PROG} checkout: Updating dir2d2/sub2d2
12355 U dir2d2/sub2d2/file2"
12356 dotest cvsadm-8b "cat CVS/Repository" "\."
12357 dotest cvsadm-8d "cat dir2d2/CVS/Repository" "mod2"
12358 dotest cvsadm-8f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
12361 ##################################################
12362 ## You are in a shell script of twisted little
12363 ## module combination statements, all alike.
12364 ##################################################
12368 dotest cvsadm-9 "${testcvs} co 1mod 1mod-2" \
12369 "${PROG} checkout: Updating 1mod
12371 ${PROG} checkout: Updating 1mod-2
12373 # the usual for the top level
12374 dotest cvsadm-9b "cat CVS/Repository" "\."
12375 # the usual for 1mod
12376 dotest cvsadm-9d "cat 1mod/CVS/Repository" "mod1"
12377 # the usual for 1mod copy
12378 dotest cvsadm-9f "cat 1mod-2/CVS/Repository" "mod1-2"
12379 rm -rf CVS 1mod 1mod-2
12381 # 1mod 2mod redmod bluemod
12382 dotest cvsadm-10 "${testcvs} co 1mod 2mod" \
12383 "${PROG} checkout: Updating 1mod
12385 ${PROG} checkout: Updating 2mod
12387 # the usual for the top level
12388 dotest cvsadm-10b "cat CVS/Repository" "\."
12389 # the usual for 1mod
12390 dotest cvsadm-10d "cat 1mod/CVS/Repository" "mod1"
12391 # the usual for 2dmod
12392 dotest cvsadm-10f "cat 2mod/CVS/Repository" "mod2/sub2"
12393 rm -rf CVS 1mod 2mod
12395 dotest cvsadm-11 "${testcvs} co 1mod 1d1mod" \
12396 "${PROG} checkout: Updating 1mod
12398 ${PROG} checkout: Updating dir1d1
12400 # the usual for the top level
12401 dotest cvsadm-11b "cat CVS/Repository" "\."
12402 # the usual for 1mod
12403 dotest cvsadm-11d "cat 1mod/CVS/Repository" "mod1"
12404 # the usual for 1d1mod
12405 dotest cvsadm-11f "cat dir1d1/CVS/Repository" "mod1"
12406 rm -rf CVS 1mod dir1d1
12408 dotest cvsadm-12 "${testcvs} co 1mod 1d2mod" \
12409 "${PROG} checkout: Updating 1mod
12411 ${PROG} checkout: Updating dir1d2
12413 # the usual for the top level
12414 dotest cvsadm-12b "cat CVS/Repository" "\."
12415 # the usual for 1mod
12416 dotest cvsadm-12d "cat 1mod/CVS/Repository" "mod1"
12417 # the usual for 1d2mod
12418 dotest cvsadm-12f "cat dir1d2/CVS/Repository" "mod2/sub2"
12419 rm -rf CVS 1mod dir1d2
12421 dotest cvsadm-13 "${testcvs} co 1mod 2d1mod" \
12422 "${PROG} checkout: Updating 1mod
12424 ${PROG} checkout: Updating dir2d1/sub2d1
12425 U dir2d1/sub2d1/file1"
12426 # the usual for the top level
12427 dotest cvsadm-13b "cat CVS/Repository" "\."
12428 # the usual for 1mod
12429 dotest cvsadm-13d "cat 1mod/CVS/Repository" "mod1"
12430 # the usual for 2d1mod
12431 dotest cvsadm-13f "cat dir2d1/CVS/Repository" "\."
12432 dotest cvsadm-13h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
12433 rm -rf CVS 1mod dir2d1
12435 dotest cvsadm-14 "${testcvs} co 1mod 2d2mod" \
12436 "${PROG} checkout: Updating 1mod
12438 ${PROG} checkout: Updating dir2d2/sub2d2
12439 U dir2d2/sub2d2/file2"
12440 # the usual for the top level
12441 dotest cvsadm-14b "cat CVS/Repository" "\."
12442 # the usual for 1mod
12443 dotest cvsadm-14d "cat 1mod/CVS/Repository" "mod1"
12444 # the usual for 2d2mod
12445 dotest cvsadm-14f "cat dir2d2/CVS/Repository" "mod2"
12446 dotest cvsadm-14h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
12447 rm -rf CVS 1mod dir2d2
12452 dotest cvsadm-15 "${testcvs} co 2mod 2mod-2" \
12453 "${PROG} checkout: Updating 2mod
12455 ${PROG} checkout: Updating 2mod-2
12457 # the usual for the top level
12458 dotest cvsadm-15b "cat CVS/Repository" "\."
12459 # the usual for 2mod
12460 dotest cvsadm-15d "cat 2mod/CVS/Repository" "mod2/sub2"
12461 # the usual for 2mod copy
12462 dotest cvsadm-15f "cat 2mod-2/CVS/Repository" "mod2-2/sub2-2"
12463 rm -rf CVS 2mod 2mod-2
12466 dotest cvsadm-16 "${testcvs} co 2mod 1d1mod" \
12467 "${PROG} checkout: Updating 2mod
12469 ${PROG} checkout: Updating dir1d1
12471 # the usual for the top level
12472 dotest cvsadm-16b "cat CVS/Repository" "\."
12473 # the usual for 2mod
12474 dotest cvsadm-16d "cat 2mod/CVS/Repository" "mod2/sub2"
12475 # the usual for 1d1mod
12476 dotest cvsadm-16f "cat dir1d1/CVS/Repository" "mod1"
12477 rm -rf CVS 2mod dir1d1
12479 dotest cvsadm-17 "${testcvs} co 2mod 1d2mod" \
12480 "${PROG} checkout: Updating 2mod
12482 ${PROG} checkout: Updating dir1d2
12484 # the usual for the top level
12485 dotest cvsadm-17b "cat CVS/Repository" "\."
12486 # the usual for 2mod
12487 dotest cvsadm-17d "cat 2mod/CVS/Repository" "mod2/sub2"
12488 # the usual for 1d2mod
12489 dotest cvsadm-17f "cat dir1d2/CVS/Repository" "mod2/sub2"
12490 rm -rf CVS 2mod dir1d2
12492 dotest cvsadm-18 "${testcvs} co 2mod 2d1mod" \
12493 "${PROG} checkout: Updating 2mod
12495 ${PROG} checkout: Updating dir2d1/sub2d1
12496 U dir2d1/sub2d1/file1"
12497 # the usual for the top level
12498 dotest cvsadm-18b "cat CVS/Repository" "\."
12499 # the usual for 2mod
12500 dotest cvsadm-18d "cat 2mod/CVS/Repository" "mod2/sub2"
12501 # the usual for 2d1mod
12502 dotest cvsadm-18f "cat dir2d1/CVS/Repository" "\."
12503 dotest cvsadm-18h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
12504 rm -rf CVS 2mod dir2d1
12506 dotest cvsadm-19 "${testcvs} co 2mod 2d2mod" \
12507 "${PROG} checkout: Updating 2mod
12509 ${PROG} checkout: Updating dir2d2/sub2d2
12510 U dir2d2/sub2d2/file2"
12511 # the usual for the top level
12512 dotest cvsadm-19b "cat CVS/Repository" "\."
12513 # the usual for 2mod
12514 dotest cvsadm-19d "cat 2mod/CVS/Repository" "mod2/sub2"
12515 # the usual for 2d2mod
12516 dotest cvsadm-19f "cat dir2d2/CVS/Repository" "mod2"
12517 dotest cvsadm-19h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
12518 rm -rf CVS 2mod dir2d2
12523 dotest cvsadm-20 "${testcvs} co 1d1mod 1d1mod-2" \
12524 "${PROG} checkout: Updating dir1d1
12526 ${PROG} checkout: Updating dir1d1-2
12527 U dir1d1-2/file1-2"
12528 # the usual for the top level
12529 dotest cvsadm-20b "cat CVS/Repository" "\."
12530 # the usual for 1d1mod
12531 dotest cvsadm-20d "cat dir1d1/CVS/Repository" "mod1"
12532 # the usual for 1d1mod copy
12533 dotest cvsadm-20f "cat dir1d1-2/CVS/Repository" "mod1-2"
12534 rm -rf CVS dir1d1 dir1d1-2
12536 dotest cvsadm-21 "${testcvs} co 1d1mod 1d2mod" \
12537 "${PROG} checkout: Updating dir1d1
12539 ${PROG} checkout: Updating dir1d2
12541 # the usual for the top level
12542 dotest cvsadm-21b "cat CVS/Repository" "\."
12543 # the usual for 1d1mod
12544 dotest cvsadm-21d "cat dir1d1/CVS/Repository" "mod1"
12545 # the usual for 1d2mod
12546 dotest cvsadm-21f "cat dir1d2/CVS/Repository" "mod2/sub2"
12547 rm -rf CVS dir1d1 dir1d2
12549 dotest cvsadm-22 "${testcvs} co 1d1mod 2d1mod" \
12550 "${PROG} checkout: Updating dir1d1
12552 ${PROG} checkout: Updating dir2d1/sub2d1
12553 U dir2d1/sub2d1/file1"
12554 # the usual for the top level
12555 dotest cvsadm-22b "cat CVS/Repository" "\."
12556 # the usual for 1d1mod
12557 dotest cvsadm-22d "cat dir1d1/CVS/Repository" "mod1"
12558 # the usual for 2d1mod
12559 dotest cvsadm-22f "cat dir2d1/CVS/Repository" "\."
12560 dotest cvsadm-22h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
12561 rm -rf CVS dir1d1 dir2d1
12563 dotest cvsadm-23 "${testcvs} co 1d1mod 2d2mod" \
12564 "${PROG} checkout: Updating dir1d1
12566 ${PROG} checkout: Updating dir2d2/sub2d2
12567 U dir2d2/sub2d2/file2"
12568 # the usual for the top level
12569 dotest cvsadm-23b "cat CVS/Repository" "\."
12570 # the usual for 1d1mod
12571 dotest cvsadm-23d "cat dir1d1/CVS/Repository" "mod1"
12572 # the usual for 2d2mod
12573 dotest cvsadm-23f "cat dir2d2/CVS/Repository" "mod2"
12574 dotest cvsadm-23h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
12575 rm -rf CVS dir1d1 dir2d2
12580 dotest cvsadm-24 "${testcvs} co 1d2mod 1d2mod-2" \
12581 "${PROG} checkout: Updating dir1d2
12583 ${PROG} checkout: Updating dir1d2-2
12584 U dir1d2-2/file2-2"
12585 # the usual for the top level
12586 dotest cvsadm-24b "cat CVS/Repository" "\."
12587 # the usual for 1d2mod
12588 dotest cvsadm-24d "cat dir1d2/CVS/Repository" "mod2/sub2"
12589 # the usual for 1d2mod copy
12590 dotest cvsadm-24f "cat dir1d2-2/CVS/Repository" "mod2-2/sub2-2"
12591 rm -rf CVS dir1d2 dir1d2-2
12593 dotest cvsadm-25 "${testcvs} co 1d2mod 2d1mod" \
12594 "${PROG} checkout: Updating dir1d2
12596 ${PROG} checkout: Updating dir2d1/sub2d1
12597 U dir2d1/sub2d1/file1"
12598 # the usual for the top level
12599 dotest cvsadm-25b "cat CVS/Repository" "\."
12600 # the usual for 1d2mod
12601 dotest cvsadm-25d "cat dir1d2/CVS/Repository" "mod2/sub2"
12602 # the usual for 2d1mod
12603 dotest cvsadm-25f "cat dir2d1/CVS/Repository" "\."
12604 dotest cvsadm-25h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
12605 rm -rf CVS dir1d2 dir2d1
12607 dotest cvsadm-26 "${testcvs} co 1d2mod 2d2mod" \
12608 "${PROG} checkout: Updating dir1d2
12610 ${PROG} checkout: Updating dir2d2/sub2d2
12611 U dir2d2/sub2d2/file2"
12612 # the usual for the top level
12613 dotest cvsadm-26b "cat CVS/Repository" "\."
12614 # the usual for 1d2mod
12615 dotest cvsadm-26d "cat dir1d2/CVS/Repository" "mod2/sub2"
12616 # the usual for 2d2mod
12617 dotest cvsadm-26f "cat dir2d2/CVS/Repository" "mod2"
12618 dotest cvsadm-26h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
12619 rm -rf CVS dir1d2 dir2d2
12624 dotest cvsadm-27 "${testcvs} co 2d1mod 2d1mod-2" \
12625 "${PROG} checkout: Updating dir2d1/sub2d1
12626 U dir2d1/sub2d1/file1
12627 ${PROG} checkout: Updating dir2d1-2/sub2d1-2
12628 U dir2d1-2/sub2d1-2/file1-2"
12629 # the usual for the top level
12630 dotest cvsadm-27b "cat CVS/Repository" "\."
12631 # the usual for 2d1mod
12632 dotest cvsadm-27d "cat dir2d1/CVS/Repository" "\."
12633 dotest cvsadm-27f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
12634 # the usual for 2d1mod
12635 dotest cvsadm-27h "cat dir2d1-2/CVS/Repository" "\."
12636 dotest cvsadm-27j "cat dir2d1-2/sub2d1-2/CVS/Repository" "mod1-2"
12637 rm -rf CVS dir2d1 dir2d1-2
12639 dotest cvsadm-28 "${testcvs} co 2d1mod 2d2mod" \
12640 "${PROG} checkout: Updating dir2d1/sub2d1
12641 U dir2d1/sub2d1/file1
12642 ${PROG} checkout: Updating dir2d2/sub2d2
12643 U dir2d2/sub2d2/file2"
12644 # the usual for the top level
12645 dotest cvsadm-28b "cat CVS/Repository" "\."
12646 # the usual for 2d1mod
12647 dotest cvsadm-28d "cat dir2d1/CVS/Repository" "\."
12648 dotest cvsadm-28f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
12649 # the usual for 2d2mod
12650 dotest cvsadm-28h "cat dir2d2/CVS/Repository" "mod2"
12651 dotest cvsadm-28j "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
12652 rm -rf CVS dir2d1 dir2d2
12657 dotest cvsadm-29 "${testcvs} co 2d2mod 2d2mod-2" \
12658 "${PROG} checkout: Updating dir2d2/sub2d2
12659 U dir2d2/sub2d2/file2
12660 ${PROG} checkout: Updating dir2d2-2/sub2d2-2
12661 U dir2d2-2/sub2d2-2/file2-2"
12662 # the usual for the top level
12663 dotest cvsadm-29b "cat CVS/Repository" "\."
12664 # the usual for 2d2mod
12665 dotest cvsadm-29d "cat dir2d2/CVS/Repository" "mod2"
12666 dotest cvsadm-29f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
12667 # the usual for 2d2mod
12668 dotest cvsadm-29h "cat dir2d2-2/CVS/Repository" "mod2-2"
12669 dotest cvsadm-29j "cat dir2d2-2/sub2d2-2/CVS/Repository" \
12671 rm -rf CVS dir2d2 dir2d2-2
12673 ##################################################
12674 ## And now, all of that again using the "-d" flag
12675 ## on the command line.
12676 ##################################################
12678 dotest cvsadm-1d3 "${testcvs} co -d dir 1mod" \
12679 "${PROG} checkout: Updating dir
12681 dotest cvsadm-1d3b "cat CVS/Repository" "\."
12682 dotest cvsadm-1d3d "cat dir/CVS/Repository" "mod1"
12685 dotest cvsadm-1d4 "${testcvs} co -d dir 2mod" \
12686 "${PROG} checkout: Updating dir
12688 dotest cvsadm-1d4b "cat CVS/Repository" "\."
12689 dotest cvsadm-1d4d "cat dir/CVS/Repository" "mod2/sub2"
12692 dotest cvsadm-1d5 "${testcvs} co -d dir 1d1mod" \
12693 "${PROG} checkout: Updating dir
12695 dotest cvsadm-1d5b "cat CVS/Repository" "\."
12696 dotest cvsadm-1d5d "cat dir/CVS/Repository" "mod1"
12699 dotest cvsadm-1d6 "${testcvs} co -d dir 1d2mod" \
12700 "${PROG} checkout: Updating dir
12702 dotest cvsadm-1d6b "cat CVS/Repository" "\."
12703 dotest cvsadm-1d6d "cat dir/CVS/Repository" "mod2/sub2"
12706 dotest cvsadm-1d7 "${testcvs} co -d dir 2d1mod" \
12707 "${PROG} checkout: Updating dir
12709 dotest cvsadm-1d7b "cat CVS/Repository" "\."
12710 dotest cvsadm-1d7d "cat dir/CVS/Repository" "mod1"
12713 dotest cvsadm-1d8 "${testcvs} co -d dir 2d2mod" \
12714 "${PROG} checkout: Updating dir
12716 dotest cvsadm-1d8b "cat CVS/Repository" "\."
12717 dotest cvsadm-1d8d "cat dir/CVS/Repository" "mod2/sub2"
12720 ##################################################
12721 ## Los Combonaciones
12722 ##################################################
12726 dotest cvsadm-1d9 "${testcvs} co -d dir 1mod 1mod-2" \
12727 "${PROG} checkout: Updating dir/1mod
12729 ${PROG} checkout: Updating dir/1mod-2
12730 U dir/1mod-2/file1-2"
12731 # the usual for the top level
12732 dotest cvsadm-1d9b "cat CVS/Repository" "\."
12733 # the usual for the dir level
12734 dotest cvsadm-1d9d "cat dir/CVS/Repository" "\."
12735 # the usual for 1mod
12736 dotest cvsadm-1d9f "cat dir/1mod/CVS/Repository" "mod1"
12737 # the usual for 1mod copy
12738 dotest cvsadm-1d9h "cat dir/1mod-2/CVS/Repository" "mod1-2"
12741 # 1mod 2mod redmod bluemod
12742 dotest cvsadm-1d10 "${testcvs} co -d dir 1mod 2mod" \
12743 "${PROG} checkout: Updating dir/1mod
12745 ${PROG} checkout: Updating dir/2mod
12747 dotest cvsadm-1d10b "cat CVS/Repository" "\."
12748 # the usual for the dir level
12749 dotest cvsadm-1d10d "cat dir/CVS/Repository" "\."
12750 # the usual for 1mod
12751 dotest cvsadm-1d10f "cat dir/1mod/CVS/Repository" "mod1"
12752 # the usual for 2dmod
12753 dotest cvsadm-1d10h "cat dir/2mod/CVS/Repository" "mod2/sub2"
12756 dotest cvsadm-1d11 "${testcvs} co -d dir 1mod 1d1mod" \
12757 "${PROG} checkout: Updating dir/1mod
12759 ${PROG} checkout: Updating dir/dir1d1
12760 U dir/dir1d1/file1"
12761 dotest cvsadm-1d11b "cat CVS/Repository" "\."
12762 # the usual for the dir level
12763 dotest cvsadm-1d11d "cat dir/CVS/Repository" "\."
12764 # the usual for 1mod
12765 dotest cvsadm-1d11f "cat dir/1mod/CVS/Repository" "mod1"
12766 # the usual for 1d1mod
12767 dotest cvsadm-1d11h "cat dir/dir1d1/CVS/Repository" "mod1"
12770 dotest cvsadm-1d12 "${testcvs} co -d dir 1mod 1d2mod" \
12771 "${PROG} checkout: Updating dir/1mod
12773 ${PROG} checkout: Updating dir/dir1d2
12774 U dir/dir1d2/file2"
12775 dotest cvsadm-1d12b "cat CVS/Repository" "\."
12776 # the usual for the dir level
12777 dotest cvsadm-1d12d "cat dir/CVS/Repository" "\."
12778 # the usual for 1mod
12779 dotest cvsadm-1d12f "cat dir/1mod/CVS/Repository" "mod1"
12780 # the usual for 1d2mod
12781 dotest cvsadm-1d12h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
12784 dotest cvsadm-1d13 "${testcvs} co -d dir 1mod 2d1mod" \
12785 "${PROG} checkout: Updating dir/1mod
12787 ${PROG} checkout: Updating dir/dir2d1/sub2d1
12788 U dir/dir2d1/sub2d1/file1"
12789 dotest cvsadm-1d13b "cat CVS/Repository" "\."
12790 # the usual for the dir level
12791 dotest cvsadm-1d13d "cat dir/CVS/Repository" "\."
12792 # the usual for 1mod
12793 dotest cvsadm-1d13f "cat dir/1mod/CVS/Repository" "mod1"
12794 # the usual for 2d1mod
12795 dotest cvsadm-1d13h "cat dir/dir2d1/CVS/Repository" "\."
12796 dotest cvsadm-1d13j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
12799 dotest cvsadm-1d14 "${testcvs} co -d dir 1mod 2d2mod" \
12800 "${PROG} checkout: Updating dir/1mod
12802 ${PROG} checkout: Updating dir/dir2d2/sub2d2
12803 U dir/dir2d2/sub2d2/file2"
12804 dotest cvsadm-1d14b "cat CVS/Repository" "\."
12805 # the usual for the dir level
12806 dotest cvsadm-1d14d "cat dir/CVS/Repository" "\."
12807 # the usual for 1mod
12808 dotest cvsadm-1d14f "cat dir/1mod/CVS/Repository" "mod1"
12809 # the usual for 2d2mod
12810 dotest cvsadm-1d14h "cat dir/dir2d2/CVS/Repository" "mod2"
12811 dotest cvsadm-1d14j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
12817 dotest cvsadm-1d15 "${testcvs} co -d dir 2mod 2mod-2" \
12818 "${PROG} checkout: Updating dir/2mod
12820 ${PROG} checkout: Updating dir/2mod-2
12821 U dir/2mod-2/file2-2"
12822 dotest cvsadm-1d15b "cat CVS/Repository" "\."
12823 # the usual for the dir level
12824 dotest cvsadm-1d15d "cat dir/CVS/Repository" "mod2"
12825 # the usual for 2mod
12826 dotest cvsadm-1d15f "cat dir/2mod/CVS/Repository" "mod2/sub2"
12827 # the usual for 2mod copy
12828 dotest cvsadm-1d15h "cat dir/2mod-2/CVS/Repository" "mod2-2/sub2-2"
12831 dotest cvsadm-1d16 "${testcvs} co -d dir 2mod 1d1mod" \
12832 "${PROG} checkout: Updating dir/2mod
12834 ${PROG} checkout: Updating dir/dir1d1
12835 U dir/dir1d1/file1"
12836 dotest cvsadm-1d16b "cat CVS/Repository" "\."
12837 # the usual for the dir level
12838 dotest cvsadm-1d16d "cat dir/CVS/Repository" "mod2"
12839 # the usual for 2mod
12840 dotest cvsadm-1d16f "cat dir/2mod/CVS/Repository" "mod2/sub2"
12841 # the usual for 1d1mod
12842 dotest cvsadm-1d16h "cat dir/dir1d1/CVS/Repository" "mod1"
12845 dotest cvsadm-1d17 "${testcvs} co -d dir 2mod 1d2mod" \
12846 "${PROG} checkout: Updating dir/2mod
12848 ${PROG} checkout: Updating dir/dir1d2
12849 U dir/dir1d2/file2"
12850 dotest cvsadm-1d17b "cat CVS/Repository" "\."
12851 # the usual for the dir level
12852 dotest cvsadm-1d17d "cat dir/CVS/Repository" "mod2"
12853 # the usual for 2mod
12854 dotest cvsadm-1d17f "cat dir/2mod/CVS/Repository" "mod2/sub2"
12855 # the usual for 1d2mod
12856 dotest cvsadm-1d17h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
12859 dotest cvsadm-1d18 "${testcvs} co -d dir 2mod 2d1mod" \
12860 "${PROG} checkout: Updating dir/2mod
12862 ${PROG} checkout: Updating dir/dir2d1/sub2d1
12863 U dir/dir2d1/sub2d1/file1"
12864 dotest cvsadm-1d18b "cat CVS/Repository" "\."
12865 # the usual for the dir level
12866 dotest cvsadm-1d18d "cat dir/CVS/Repository" "mod2"
12867 # the usual for 2mod
12868 dotest cvsadm-1d18f "cat dir/2mod/CVS/Repository" "mod2/sub2"
12869 # the usual for 2d1mod
12870 dotest cvsadm-1d18h "cat dir/dir2d1/CVS/Repository" "\."
12871 dotest cvsadm-1d18j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
12874 dotest cvsadm-1d19 "${testcvs} co -d dir 2mod 2d2mod" \
12875 "${PROG} checkout: Updating dir/2mod
12877 ${PROG} checkout: Updating dir/dir2d2/sub2d2
12878 U dir/dir2d2/sub2d2/file2"
12879 dotest cvsadm-1d19b "cat CVS/Repository" "\."
12880 # the usual for the dir level
12881 dotest cvsadm-1d19d "cat dir/CVS/Repository" "mod2"
12882 # the usual for 2mod
12883 dotest cvsadm-1d19f "cat dir/2mod/CVS/Repository" "mod2/sub2"
12884 # the usual for 2d2mod
12885 dotest cvsadm-1d19h "cat dir/dir2d2/CVS/Repository" "mod2"
12886 dotest cvsadm-1d19j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
12892 dotest cvsadm-1d20 "${testcvs} co -d dir 1d1mod 1d1mod-2" \
12893 "${PROG} checkout: Updating dir/dir1d1
12895 ${PROG} checkout: Updating dir/dir1d1-2
12896 U dir/dir1d1-2/file1-2"
12897 dotest cvsadm-1d20b "cat CVS/Repository" "\."
12898 # the usual for the dir level
12899 dotest cvsadm-1d20d "cat dir/CVS/Repository" "\."
12900 # the usual for 1d1mod
12901 dotest cvsadm-1d20f "cat dir/dir1d1/CVS/Repository" "mod1"
12902 # the usual for 1d1mod copy
12903 dotest cvsadm-1d20h "cat dir/dir1d1-2/CVS/Repository" "mod1-2"
12906 dotest cvsadm-1d21 "${testcvs} co -d dir 1d1mod 1d2mod" \
12907 "${PROG} checkout: Updating dir/dir1d1
12909 ${PROG} checkout: Updating dir/dir1d2
12910 U dir/dir1d2/file2"
12911 dotest cvsadm-1d21b "cat CVS/Repository" "\."
12912 # the usual for the dir level
12913 dotest cvsadm-1d21d "cat dir/CVS/Repository" "\."
12914 # the usual for 1d1mod
12915 dotest cvsadm-1d21f "cat dir/dir1d1/CVS/Repository" "mod1"
12916 # the usual for 1d2mod
12917 dotest cvsadm-1d21h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
12920 dotest cvsadm-1d22 "${testcvs} co -d dir 1d1mod 2d1mod" \
12921 "${PROG} checkout: Updating dir/dir1d1
12923 ${PROG} checkout: Updating dir/dir2d1/sub2d1
12924 U dir/dir2d1/sub2d1/file1"
12925 dotest cvsadm-1d22b "cat CVS/Repository" "\."
12926 # the usual for the dir level
12927 dotest cvsadm-1d22d "cat dir/CVS/Repository" "\."
12928 # the usual for 1d1mod
12929 dotest cvsadm-1d22f "cat dir/dir1d1/CVS/Repository" "mod1"
12930 # the usual for 2d1mod
12931 dotest cvsadm-1d22h "cat dir/dir2d1/CVS/Repository" "\."
12932 dotest cvsadm-1d22j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
12935 dotest cvsadm-1d23 "${testcvs} co -d dir 1d1mod 2d2mod" \
12936 "${PROG} checkout: Updating dir/dir1d1
12938 ${PROG} checkout: Updating dir/dir2d2/sub2d2
12939 U dir/dir2d2/sub2d2/file2"
12940 dotest cvsadm-1d23b "cat CVS/Repository" "\."
12941 # the usual for the dir level
12942 dotest cvsadm-1d23d "cat dir/CVS/Repository" "\."
12943 # the usual for 1d1mod
12944 dotest cvsadm-1d23f "cat dir/dir1d1/CVS/Repository" "mod1"
12945 # the usual for 2d2mod
12946 dotest cvsadm-1d23h "cat dir/dir2d2/CVS/Repository" "mod2"
12947 dotest cvsadm-1d23j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
12953 dotest cvsadm-1d24 "${testcvs} co -d dir 1d2mod 1d2mod-2" \
12954 "${PROG} checkout: Updating dir/dir1d2
12956 ${PROG} checkout: Updating dir/dir1d2-2
12957 U dir/dir1d2-2/file2-2"
12958 dotest cvsadm-1d24b "cat CVS/Repository" "\."
12959 # the usual for the dir level
12960 dotest cvsadm-1d24d "cat dir/CVS/Repository" "mod2"
12961 # the usual for 1d2mod
12962 dotest cvsadm-1d24f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
12963 # the usual for 1d2mod copy
12964 dotest cvsadm-1d24h "cat dir/dir1d2-2/CVS/Repository" "mod2-2/sub2-2"
12967 dotest cvsadm-1d25 "${testcvs} co -d dir 1d2mod 2d1mod" \
12968 "${PROG} checkout: Updating dir/dir1d2
12970 ${PROG} checkout: Updating dir/dir2d1/sub2d1
12971 U dir/dir2d1/sub2d1/file1"
12972 dotest cvsadm-1d25b "cat CVS/Repository" "\."
12973 # the usual for the dir level
12974 dotest cvsadm-1d25d "cat dir/CVS/Repository" "mod2"
12975 # the usual for 1d2mod
12976 dotest cvsadm-1d25f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
12977 # the usual for 2d1mod
12978 dotest cvsadm-1d25h "cat dir/dir2d1/CVS/Repository" "\."
12979 dotest cvsadm-1d25j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
12982 dotest cvsadm-1d26 "${testcvs} co -d dir 1d2mod 2d2mod" \
12983 "${PROG} checkout: Updating dir/dir1d2
12985 ${PROG} checkout: Updating dir/dir2d2/sub2d2
12986 U dir/dir2d2/sub2d2/file2"
12987 dotest cvsadm-1d26b "cat CVS/Repository" "\."
12988 # the usual for the dir level
12989 dotest cvsadm-1d26d "cat dir/CVS/Repository" "mod2"
12990 # the usual for 1d2mod
12991 dotest cvsadm-1d26f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
12992 # the usual for 2d2mod
12993 dotest cvsadm-1d26h "cat dir/dir2d2/CVS/Repository" "mod2"
12994 dotest cvsadm-1d26j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
13000 dotest cvsadm-1d27 "${testcvs} co -d dir 2d1mod 2d1mod-2" \
13001 "${PROG} checkout: Updating dir/dir2d1/sub2d1
13002 U dir/dir2d1/sub2d1/file1
13003 ${PROG} checkout: Updating dir/dir2d1-2/sub2d1-2
13004 U dir/dir2d1-2/sub2d1-2/file1-2"
13005 dotest cvsadm-1d27b "cat CVS/Repository" "\."
13006 # the usual for the dir level
13007 dotest cvsadm-1d27d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
13008 # the usual for 2d1mod
13009 dotest cvsadm-1d27f "cat dir/dir2d1/CVS/Repository" "\."
13010 dotest cvsadm-1d27h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
13011 # the usual for 2d1mod
13012 dotest cvsadm-1d27j "cat dir/dir2d1-2/CVS/Repository" "\."
13013 dotest cvsadm-1d27l "cat dir/dir2d1-2/sub2d1-2/CVS/Repository" \
13017 dotest cvsadm-1d28 "${testcvs} co -d dir 2d1mod 2d2mod" \
13018 "${PROG} checkout: Updating dir/dir2d1/sub2d1
13019 U dir/dir2d1/sub2d1/file1
13020 ${PROG} checkout: Updating dir/dir2d2/sub2d2
13021 U dir/dir2d2/sub2d2/file2"
13022 dotest cvsadm-1d28b "cat CVS/Repository" "\."
13023 # the usual for the dir level
13024 dotest cvsadm-1d28d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
13025 # the usual for 2d1mod
13026 dotest cvsadm-1d28f "cat dir/dir2d1/CVS/Repository" "\."
13027 dotest cvsadm-1d28h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
13028 # the usual for 2d2mod
13029 dotest cvsadm-1d28j "cat dir/dir2d2/CVS/Repository" "mod2"
13030 dotest cvsadm-1d28l "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
13036 dotest cvsadm-1d29 "${testcvs} co -d dir 2d2mod 2d2mod-2" \
13037 "${PROG} checkout: Updating dir/dir2d2/sub2d2
13038 U dir/dir2d2/sub2d2/file2
13039 ${PROG} checkout: Updating dir/dir2d2-2/sub2d2-2
13040 U dir/dir2d2-2/sub2d2-2/file2-2"
13041 dotest cvsadm-1d29b "cat CVS/Repository" "\."
13042 # the usual for the dir level
13043 dotest cvsadm-1d29d "cat dir/CVS/Repository" "\."
13044 # the usual for 2d2mod
13045 dotest cvsadm-1d29f "cat dir/dir2d2/CVS/Repository" "mod2"
13046 dotest cvsadm-1d29h "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
13047 # the usual for 2d2mod
13048 dotest cvsadm-1d29j "cat dir/dir2d2-2/CVS/Repository" "mod2-2"
13049 dotest cvsadm-1d29l "cat dir/dir2d2-2/sub2d2-2/CVS/Repository" \
13053 ##################################################
13054 ## And now, some of that again using the "-d" flag
13055 ## on the command line, but use a longer path.
13056 ##################################################
13058 dotest_fail cvsadm-2d3-1 "${testcvs} co -d dir/dir2 1mod" \
13059 "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .dir.: No such file or directory"
13061 if $remote; then :; else
13062 # Remote can't handle this, even with the "mkdir dir".
13063 # This was also true of CVS 1.9.
13066 dotest cvsadm-2d3 "${testcvs} co -d dir/dir2 1mod" \
13067 "${PROG} checkout: Updating dir/dir2
13069 dotest cvsadm-2d3b "cat CVS/Repository" "\."
13070 dotest_fail cvsadm-2d3d "test -f dir/CVS/Repository" ""
13071 dotest cvsadm-2d3f "cat dir/dir2/CVS/Repository" "mod1"
13075 dotest cvsadm-2d4 "${testcvs} co -d dir/dir2 2mod" \
13076 "${PROG} checkout: Updating dir/dir2
13078 dotest cvsadm-2d4b "cat CVS/Repository" "\."
13079 dotest cvsadm-2d4f "cat dir/dir2/CVS/Repository" "mod2/sub2"
13083 dotest cvsadm-2d5 "${testcvs} co -d dir/dir2 1d1mod" \
13084 "${PROG} checkout: Updating dir/dir2
13086 dotest cvsadm-2d5b "cat CVS/Repository" "\."
13087 dotest cvsadm-2d5f "cat dir/dir2/CVS/Repository" "mod1"
13091 dotest cvsadm-2d6 "${testcvs} co -d dir/dir2 1d2mod" \
13092 "${PROG} checkout: Updating dir/dir2
13094 dotest cvsadm-2d6b "cat CVS/Repository" "\."
13095 dotest cvsadm-2d6f "cat dir/dir2/CVS/Repository" "mod2/sub2"
13099 dotest cvsadm-2d7 "${testcvs} co -d dir/dir2 2d1mod" \
13100 "${PROG} checkout: Updating dir/dir2
13102 dotest cvsadm-2d7b "cat CVS/Repository" "\."
13103 dotest cvsadm-2d7f "cat dir/dir2/CVS/Repository" "mod1"
13107 dotest cvsadm-2d8 "${testcvs} co -d dir/dir2 2d2mod" \
13108 "${PROG} checkout: Updating dir/dir2
13110 dotest cvsadm-2d8b "cat CVS/Repository" "\."
13111 dotest cvsadm-2d8f "cat dir/dir2/CVS/Repository" "mod2/sub2"
13114 ##################################################
13115 ## And now, a few of those tests revisited to
13116 ## test the behavior of the -N flag.
13117 ##################################################
13119 dotest cvsadm-N3 "${testcvs} co -N 1mod" \
13120 "${PROG} checkout: Updating 1mod
13122 dotest cvsadm-N3b "cat CVS/Repository" "\."
13123 dotest cvsadm-N3d "cat 1mod/CVS/Repository" "mod1"
13126 dotest cvsadm-N4 "${testcvs} co -N 2mod" \
13127 "${PROG} checkout: Updating 2mod
13129 dotest cvsadm-N4b "cat CVS/Repository" "\."
13130 dotest cvsadm-N4d "cat 2mod/CVS/Repository" "mod2/sub2"
13133 dotest cvsadm-N5 "${testcvs} co -N 1d1mod" \
13134 "${PROG} checkout: Updating dir1d1
13136 dotest cvsadm-N5b "cat CVS/Repository" "\."
13137 dotest cvsadm-N5d "cat dir1d1/CVS/Repository" "mod1"
13140 dotest cvsadm-N6 "${testcvs} co -N 1d2mod" \
13141 "${PROG} checkout: Updating dir1d2
13143 dotest cvsadm-N6b "cat CVS/Repository" "\."
13144 dotest cvsadm-N6d "cat dir1d2/CVS/Repository" "mod2/sub2"
13147 dotest cvsadm-N7 "${testcvs} co -N 2d1mod" \
13148 "${PROG} checkout: Updating dir2d1/sub2d1
13149 U dir2d1/sub2d1/file1"
13150 dotest cvsadm-N7b "cat CVS/Repository" "\."
13151 dotest cvsadm-N7d "cat dir2d1/CVS/Repository" "\."
13152 dotest cvsadm-N7f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
13155 dotest cvsadm-N8 "${testcvs} co -N 2d2mod" \
13156 "${PROG} checkout: Updating dir2d2/sub2d2
13157 U dir2d2/sub2d2/file2"
13158 dotest cvsadm-N8b "cat CVS/Repository" "\."
13159 dotest cvsadm-N8d "cat dir2d2/CVS/Repository" "mod2"
13160 dotest cvsadm-N8f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
13163 ## the ones in one-deep directories
13165 dotest cvsadm-N1d3 "${testcvs} co -N -d dir 1mod" \
13166 "${PROG} checkout: Updating dir/1mod
13168 dotest cvsadm-N1d3b "cat CVS/Repository" "\."
13169 dotest cvsadm-N1d3d "cat dir/CVS/Repository" "\."
13170 dotest cvsadm-N1d3f "cat dir/1mod/CVS/Repository" "mod1"
13173 dotest cvsadm-N1d4 "${testcvs} co -N -d dir 2mod" \
13174 "${PROG} checkout: Updating dir/2mod
13176 dotest cvsadm-N1d4b "cat CVS/Repository" "\."
13177 dotest cvsadm-N1d4d "cat dir/CVS/Repository" "mod2"
13178 dotest cvsadm-N1d4f "cat dir/2mod/CVS/Repository" "mod2/sub2"
13181 dotest cvsadm-N1d5 "${testcvs} co -N -d dir 1d1mod" \
13182 "${PROG} checkout: Updating dir/dir1d1
13183 U dir/dir1d1/file1"
13184 dotest cvsadm-N1d5b "cat CVS/Repository" "\."
13185 dotest cvsadm-N1d5d "cat dir/CVS/Repository" "\."
13186 dotest cvsadm-N1d5d "cat dir/dir1d1/CVS/Repository" "mod1"
13189 dotest cvsadm-N1d6 "${testcvs} co -N -d dir 1d2mod" \
13190 "${PROG} checkout: Updating dir/dir1d2
13191 U dir/dir1d2/file2"
13192 dotest cvsadm-N1d6b "cat CVS/Repository" "\."
13193 dotest cvsadm-N1d6d "cat dir/CVS/Repository" "mod2"
13194 dotest cvsadm-N1d6f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
13197 dotest cvsadm-N1d7 "${testcvs} co -N -d dir 2d1mod" \
13198 "${PROG} checkout: Updating dir/dir2d1/sub2d1
13199 U dir/dir2d1/sub2d1/file1"
13200 dotest cvsadm-N1d7b "cat CVS/Repository" "\."
13201 dotest cvsadm-N1d7d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
13202 dotest cvsadm-N1d7f "cat dir/dir2d1/CVS/Repository" "\."
13203 dotest cvsadm-N1d7h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
13206 dotest cvsadm-N1d8 "${testcvs} co -N -d dir 2d2mod" \
13207 "${PROG} checkout: Updating dir/dir2d2/sub2d2
13208 U dir/dir2d2/sub2d2/file2"
13209 dotest cvsadm-N1d8b "cat CVS/Repository" "\."
13210 dotest cvsadm-N1d8d "cat dir/CVS/Repository" "\."
13211 dotest cvsadm-N1d8d "cat dir/dir2d2/CVS/Repository" "mod2"
13212 dotest cvsadm-N1d8d "cat dir/dir2d2/sub2d2/CVS/Repository" \
13216 ## the ones in two-deep directories
13219 dotest cvsadm-N2d3 "${testcvs} co -N -d dir/dir2 1mod" \
13220 "${PROG} checkout: Updating dir/dir2/1mod
13221 U dir/dir2/1mod/file1"
13222 dotest cvsadm-N2d3b "cat CVS/Repository" "\."
13223 dotest cvsadm-N2d3f "cat dir/dir2/CVS/Repository" "\."
13224 dotest cvsadm-N2d3h "cat dir/dir2/1mod/CVS/Repository" "mod1"
13228 dotest cvsadm-N2d4 "${testcvs} co -N -d dir/dir2 2mod" \
13229 "${PROG} checkout: Updating dir/dir2/2mod
13230 U dir/dir2/2mod/file2"
13231 dotest cvsadm-N2d4b "cat CVS/Repository" "\."
13232 dotest cvsadm-N2d4f "cat dir/dir2/CVS/Repository" "mod2"
13233 dotest cvsadm-N2d4h "cat dir/dir2/2mod/CVS/Repository" "mod2/sub2"
13237 dotest cvsadm-N2d5 "${testcvs} co -N -d dir/dir2 1d1mod" \
13238 "${PROG} checkout: Updating dir/dir2/dir1d1
13239 U dir/dir2/dir1d1/file1"
13240 dotest cvsadm-N2d5b "cat CVS/Repository" "\."
13241 dotest cvsadm-N2d5f "cat dir/dir2/CVS/Repository" "\."
13242 dotest cvsadm-N2d5h "cat dir/dir2/dir1d1/CVS/Repository" "mod1"
13246 dotest cvsadm-N2d6 "${testcvs} co -N -d dir/dir2 1d2mod" \
13247 "${PROG} checkout: Updating dir/dir2/dir1d2
13248 U dir/dir2/dir1d2/file2"
13249 dotest cvsadm-N2d6b "cat CVS/Repository" "\."
13250 dotest cvsadm-N2d6f "cat dir/dir2/CVS/Repository" "mod2"
13251 dotest cvsadm-N2d6h "cat dir/dir2/dir1d2/CVS/Repository" "mod2/sub2"
13255 dotest cvsadm-N2d7 "${testcvs} co -N -d dir/dir2 2d1mod" \
13256 "${PROG} checkout: Updating dir/dir2/dir2d1/sub2d1
13257 U dir/dir2/dir2d1/sub2d1/file1"
13258 dotest cvsadm-N2d7b "cat CVS/Repository" "\."
13259 dotest cvsadm-N2d7f "cat dir/dir2/CVS/Repository" "CVSROOT/Emptydir"
13260 dotest cvsadm-N2d7g "cat dir/dir2/dir2d1/CVS/Repository" "\."
13261 dotest cvsadm-N2d7h "cat dir/dir2/dir2d1/sub2d1/CVS/Repository" \
13266 dotest cvsadm-N2d8 "${testcvs} co -N -d dir/dir2 2d2mod" \
13267 "${PROG} checkout: Updating dir/dir2/dir2d2/sub2d2
13268 U dir/dir2/dir2d2/sub2d2/file2"
13269 dotest cvsadm-N2d8b "cat CVS/Repository" "\."
13270 dotest cvsadm-N2d8f "cat dir/dir2/CVS/Repository" "\."
13271 dotest cvsadm-N2d8h "cat dir/dir2/dir2d2/CVS/Repository" "mod2"
13272 dotest cvsadm-N2d8j "cat dir/dir2/dir2d2/sub2d2/CVS/Repository" \
13276 fi # end of tests to be skipped for remote
13278 ##################################################
13279 ## That's enough of that, thank you very much.
13280 ##################################################
13282 dotest cvsadm-cleanup-1 "${testcvs} -q co CVSROOT/config" \
13285 echo "# empty file" >config
13286 dotest cvsadm-cleanup-2 "${testcvs} -q ci -m cvsadm-cleanup" \
13287 "Checking in config;
13288 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
13289 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13291 ${PROG} commit: Rebuilding administrative file database"
13298 rm -rf ${CVSROOT_DIRNAME}/1mod
13299 rm -rf ${CVSROOT_DIRNAME}/1mod-2
13300 rm -rf ${CVSROOT_DIRNAME}/2mod
13301 rm -rf ${CVSROOT_DIRNAME}/2mod-2
13302 rm -rf ${CVSROOT_DIRNAME}/mod1
13303 rm -rf ${CVSROOT_DIRNAME}/mod1-2
13304 rm -rf ${CVSROOT_DIRNAME}/mod2
13305 rm -rf ${CVSROOT_DIRNAME}/mod2-2
13309 # Various tests of the Emptydir (CVSNULLREPOS) code. See also:
13310 # cvsadm: tests of Emptydir in various module definitions
13311 # basicb: Test that "Emptydir" is non-special in ordinary contexts
13314 dotest emptydir-1 "${testcvs} co CVSROOT/modules" \
13315 "U CVSROOT/modules"
13316 echo "# Module defs for emptydir tests" > CVSROOT/modules
13317 echo "2d1mod -d dir2d1/sub/sub2d1 mod1" >> CVSROOT/modules
13318 echo "2d1moda -d dir2d1/suba moda/modasub" >> CVSROOT/modules
13319 echo "2d1modb -d dir2d1/suba mod1" >> CVSROOT/modules
13320 echo "comb -a 2d1modb 2d1moda" >> CVSROOT/modules
13322 dotest emptydir-2 "${testcvs} ci -m add-modules" \
13323 "${PROG} [a-z]*: Examining CVSROOT
13324 Checking in CVSROOT/modules;
13325 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
13326 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13328 ${PROG} commit: Rebuilding administrative file database" \
13329 "${PROG} commit: Examining CVSROOT"
13332 mkdir ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda
13333 # Populate. Not sure we really need to do this.
13334 dotest emptydir-3 "${testcvs} -q co -l ." ""
13335 dotest emptydir-3a "${testcvs} co mod1 moda" \
13336 "${PROG} checkout: Updating mod1
13337 ${PROG} checkout: Updating moda"
13338 echo "file1" > mod1/file1
13340 dotest emptydir-3b "${testcvs} add moda/modasub" \
13341 "Directory ${CVSROOT_DIRNAME}/moda/modasub added to the repository"
13342 echo "filea" > moda/modasub/filea
13343 dotest emptydir-4 "${testcvs} add mod1/file1 moda/modasub/filea" \
13344 "${PROG} add: scheduling file .mod1/file1. for addition
13345 ${PROG} add: scheduling file .moda/modasub/filea. for addition
13346 ${PROG} add: use .${PROG} commit. to add these files permanently"
13347 dotest emptydir-5 "${testcvs} -q ci -m yup" \
13348 "RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
13350 Checking in mod1/file1;
13351 ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
13352 initial revision: 1\.1
13354 RCS file: ${CVSROOT_DIRNAME}/moda/modasub/filea,v
13356 Checking in moda/modasub/filea;
13357 ${CVSROOT_DIRNAME}/moda/modasub/filea,v <-- filea
13358 initial revision: 1\.1
13360 rm -rf mod1 moda CVS
13363 dotest emptydir-6 "${testcvs} co 2d1mod" \
13364 "${PROG} checkout: Updating dir2d1/sub/sub2d1
13365 U dir2d1/sub/sub2d1/file1"
13368 # It doesn't make any sense to add a file (or do much of anything
13369 # else) in Emptydir; Emptydir is a placeholder indicating that
13370 # the working directory doesn't correspond to anything in
13372 dotest_fail emptydir-7 "${testcvs} add emptyfile" \
13373 "${PROG} \[add aborted\]: cannot add to ${CVSROOT_DIRNAME}/CVSROOT/Emptydir"
13375 dotest_fail emptydir-8 "${testcvs} add emptydir" \
13376 "${PROG} \[[a-z]* aborted\]: cannot add to ${CVSROOT_DIRNAME}/CVSROOT/Emptydir"
13380 # OK, while we have an Emptydir around, test a few obscure
13382 mkdir edir; cd edir
13383 dotest emptydir-9 "${testcvs} -q co -l CVSROOT" \
13384 "U CVSROOT${DOTSTAR}"
13386 dotest_fail emptydir-10 "test -d Emptydir" ''
13387 # This tests the code in find_dirs which skips Emptydir.
13388 dotest emptydir-11 "${testcvs} -q -n update -d -P" ''
13393 # Now start playing with moda.
13395 dotest emptydir-12 "${testcvs} -q co 2d1moda" \
13396 "U dir2d1/suba/filea"
13397 # OK, this is the crux of the matter. This used to show "Emptydir",
13398 # but everyone seemed to think it should show "moda". This
13399 # usually works better, but not always as shown by the following
13401 dotest emptydir-13 "cat dir2d1/CVS/Repository" "moda"
13402 dotest_fail emptydir-14 "${testcvs} co comb" \
13403 "${PROG} checkout: existing repository ${CVSROOT_DIRNAME}/moda/modasub does not match ${CVSROOT_DIRNAME}/mod1
13404 ${PROG} checkout: ignoring module 2d1modb
13405 ${PROG} checkout: Updating dir2d1/suba"
13406 dotest emptydir-15 "cat dir2d1/CVS/Repository" "moda"
13409 # Test the effect of a non-cvs directory already existing with the
13410 # same name as one in the modules file.
13413 dotest emptydir-16 "${testcvs} co 2d1mod" \
13414 "${PROG} checkout: Updating dir2d1/sub/sub2d1
13415 U dir2d1/sub/sub2d1/file1"
13416 dotest emptydir-17 "test -d dir2d1/CVS"
13420 echo Keeping ${TESTDIR} and exiting due to --keep
13426 rm -rf ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda
13427 # I guess for the moment the convention is going to be
13428 # that we don't need to remove ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
13433 # These tests test the thituations thin thwitch thoo theck
13434 # things thout twith thabsolute thaths. Threally.
13440 # Create a few modules to use
13441 mkdir ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/mod2
13442 dotest abspath-1a "${testcvs} co mod1 mod2" \
13443 "${PROG} checkout: Updating mod1
13444 ${PROG} checkout: Updating mod2"
13446 # Populate the module
13447 echo "file1" > mod1/file1
13448 echo "file2" > mod2/file2
13450 dotest abspath-1ba "${testcvs} add file1" \
13451 "${PROG} add: scheduling file .file1. for addition
13452 ${PROG} add: use .${PROG} commit. to add this file permanently"
13455 dotest abspath-1bb "${testcvs} add file2" \
13456 "${PROG} add: scheduling file .file2. for addition
13457 ${PROG} add: use .${PROG} commit. to add this file permanently"
13460 dotest abspath-1c "${testcvs} ci -m yup mod1 mod2" \
13461 "${PROG} [a-z]*: Examining mod1
13462 ${PROG} [a-z]*: Examining mod2
13463 RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
13465 Checking in mod1/file1;
13466 ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
13467 initial revision: 1.1
13469 RCS file: ${CVSROOT_DIRNAME}/mod2/file2,v
13471 Checking in mod2/file2;
13472 ${CVSROOT_DIRNAME}/mod2/file2,v <-- file2
13473 initial revision: 1.1
13475 # Finished creating the module -- clean up.
13476 rm -rf CVS mod1 mod2
13479 # Try checking out the module in a local directory
13481 dotest_fail abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
13482 "${PROG} \[checkout aborted\]: absolute pathname .${TESTDIR}/1. illegal for server"
13483 dotest abspath-2a-try2 "${testcvs} co -d 1 mod1" \
13484 "${PROG} checkout: Updating 1
13487 dotest abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
13488 "${PROG} checkout: Updating ${TESTDIR}/1
13489 U ${TESTDIR}/1/file1"
13490 fi # remote workaround
13492 dotest abspath-2b "cat ${TESTDIR}/1/CVS/Repository" "mod1"
13495 rm -rf ${TESTDIR}/1
13498 # Now try in a subdirectory. We're not covering any more
13499 # code here, but we might catch a future error if someone
13500 # changes the checkout code.
13502 # Note that for the same reason that the shell command
13503 # "touch 1/2/3" requires directories 1 and 1/2 to already
13504 # exist, we expect ${TESTDIR}/1 to already exist. I believe
13505 # this is the behavior of CVS 1.9 and earlier.
13506 if $remote; then :; else
13507 dotest_fail abspath-3.1 "${testcvs} co -d ${TESTDIR}/1/2 mod1" \
13508 "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .${TESTDIR}/1.: No such file or directory"
13510 dotest_fail abspath-3.2 "${testcvs} co -d 1/2 mod1" \
13511 "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .1.: No such file or directory"
13516 # The server wants the directory to exist, but that is
13517 # a bug, it should only need to exist on the client side.
13518 # See also cvsadm-2d3.
13519 dotest_fail abspath-3a "${testcvs} co -d 1/2 mod1" \
13520 "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .1.: No such file or directory"
13522 dotest abspath-3a-try2 "${testcvs} co -d 2 mod1" \
13523 "${PROG} checkout: Updating 2
13528 dotest abspath-3a "${testcvs} co -d ${TESTDIR}/1/2 mod1" \
13529 "${PROG} checkout: Updating ${TESTDIR}/1/2
13530 U ${TESTDIR}/1/2/file1"
13531 fi # remote workaround
13532 dotest abspath-3b "cat ${TESTDIR}/1/2/CVS/Repository" "mod1"
13534 # For all the same reasons that we want "1" to already
13535 # exist, we don't to mess with it to traverse it, for
13536 # example by creating a CVS directory.
13538 dotest_fail abspath-3c "test -d ${TESTDIR}/1/CVS" ''
13540 rm -rf ${TESTDIR}/1
13543 # Now try someplace where we don't have permission.
13544 mkdir ${TESTDIR}/barf
13545 chmod -w ${TESTDIR}/barf
13546 dotest_fail abspath-4r "${testcvs} co -d ${TESTDIR}/barf/sub mod1" \
13547 "${PROG} \[checkout aborted\]: absolute pathname .${TESTDIR}/barf/sub. illegal for server" \
13548 "${PROG} \[checkout aborted\]: cannot make directory sub: Permission denied"
13549 chmod +w ${TESTDIR}/barf
13550 rmdir ${TESTDIR}/barf
13551 # Done. Nothing to clean up.
13554 # Try checking out two modules into the same directory.
13556 dotest abspath-5ar "${testcvs} co -d 1 mod1 mod2" \
13557 "${PROG} checkout: Updating 1/mod1
13559 ${PROG} checkout: Updating 1/mod2
13562 dotest abspath-5a "${testcvs} co -d ${TESTDIR}/1 mod1 mod2" \
13563 "${PROG} checkout: Updating ${TESTDIR}/1/mod1
13564 U ${TESTDIR}/1/mod1/file1
13565 ${PROG} checkout: Updating ${TESTDIR}/1/mod2
13566 U ${TESTDIR}/1/mod2/file2"
13567 fi # end remote workaround
13568 dotest abspath-5b "cat ${TESTDIR}/1/CVS/Repository" "\."
13569 dotest abspath-5c "cat ${TESTDIR}/1/mod1/CVS/Repository" "mod1"
13570 dotest abspath-5d "cat ${TESTDIR}/1/mod2/CVS/Repository" "mod2"
13572 rm -rf ${TESTDIR}/1
13575 # Try checking out the top-level module.
13577 dotest abspath-6ar "${testcvs} co -d 1 ." \
13578 "${PROG} checkout: Updating 1
13579 ${PROG} checkout: Updating 1/CVSROOT
13581 ${PROG} checkout: Updating 1/mod1
13583 ${PROG} checkout: Updating 1/mod2
13586 dotest abspath-6a "${testcvs} co -d ${TESTDIR}/1 ." \
13587 "${PROG} checkout: Updating ${TESTDIR}/1
13588 ${PROG} checkout: Updating ${TESTDIR}/1/CVSROOT
13590 ${PROG} checkout: Updating ${TESTDIR}/1/mod1
13591 U ${TESTDIR}/1/mod1/file1
13592 ${PROG} checkout: Updating ${TESTDIR}/1/mod2
13593 U ${TESTDIR}/1/mod2/file2"
13594 fi # end of remote workaround
13595 dotest abspath-6b "cat ${TESTDIR}/1/CVS/Repository" "\."
13596 dotest abspath-6c "cat ${TESTDIR}/1/CVSROOT/CVS/Repository" "CVSROOT"
13597 dotest abspath-6c "cat ${TESTDIR}/1/mod1/CVS/Repository" "mod1"
13598 dotest abspath-6d "cat ${TESTDIR}/1/mod2/CVS/Repository" "mod2"
13600 rm -rf ${TESTDIR}/1
13602 # Test that an absolute pathname to some other directory
13603 # doesn't mess with the current working directory.
13607 dotest_fail abspath-7ar "${testcvs} -q co -d ../2 mod2" \
13608 "${PROG} checkout: protocol error: .\.\./2. contains more leading \.\.
13609 ${PROG} \[checkout aborted\]: than the 0 which Max-dotdot specified"
13611 dotest abspath-7a-try2r "${testcvs} -q co -d 2 mod2" \
13615 dotest abspath-7a "${testcvs} -q co -d ${TESTDIR}/2 mod2" \
13616 "U ${TESTDIR}/2/file2"
13617 fi # remote workaround
13618 dotest abspath-7b "ls" ""
13619 dotest abspath-7c "${testcvs} -q co mod1" \
13624 dotest abspath-7dr "${testcvs} -q co -d 3 mod2" \
13628 dotest abspath-7d "${testcvs} -q co -d ${TESTDIR}/3 mod2" \
13629 "U ${TESTDIR}/3/file2"
13630 fi # remote workaround
13631 dotest abspath-7e "${testcvs} -q update -d" ""
13636 # FIXME: do other functions here (e.g. update /tmp/foo)
13639 # Finished with all tests. Remove the module.
13640 rm -rf ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/mod2
13647 # More absolute path checks. The following used to attempt to create
13648 # directories in /:
13650 # $ cvs -d:fork:/cvsroot co /foo
13651 # cvs checkout: warning: cannot make directory CVS in /: Permission denied
13652 # cvs [checkout aborted]: cannot make directory /foo: Permission denied
13654 dotest_fail abspath2-1 "${testcvs} co /foo" \
13655 "$PROG \[checkout aborted\]: Absolute module reference invalid: \`/foo'" \
13656 "$PROG \[server aborted\]: Absolute module reference invalid: \`/foo'
13657 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
13663 # test the feature that cvs creates a CVS subdir also for
13664 # the toplevel directory
13666 # First set the TopLevelAdmin setting.
13668 dotest toplevel-1a "${testcvs} -q co CVSROOT/config" \
13671 echo "TopLevelAdmin=yes" >config
13672 dotest toplevel-1b "${testcvs} -q ci -m yes-top-level" \
13673 "Checking in config;
13674 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
13675 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13677 ${PROG} commit: Rebuilding administrative file database"
13682 dotest toplevel-1 "${testcvs} -q co -l ." ''
13683 mkdir top-dir second-dir
13684 dotest toplevel-2 "${testcvs} add top-dir second-dir" \
13685 "Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
13686 Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
13690 dotest toplevel-3 "${testcvs} add file1" \
13691 "${PROG} add: scheduling file .file1. for addition
13692 ${PROG} add: use .${PROG} commit. to add this file permanently"
13693 dotest toplevel-4 "${testcvs} -q ci -m add" \
13694 "RCS file: ${CVSROOT_DIRNAME}/top-dir/file1,v
13697 ${CVSROOT_DIRNAME}/top-dir/file1,v <-- file1
13698 initial revision: 1\.1
13704 dotest toplevel-3s "${testcvs} add file2" \
13705 "${PROG} add: scheduling file .file2. for addition
13706 ${PROG} add: use .${PROG} commit. to add this file permanently"
13707 dotest toplevel-4s "${testcvs} -q ci -m add" \
13708 "RCS file: ${CVSROOT_DIRNAME}/second-dir/file2,v
13711 ${CVSROOT_DIRNAME}/second-dir/file2,v <-- file2
13712 initial revision: 1\.1
13716 rm -r 1; mkdir 1; cd 1
13717 dotest toplevel-5 "${testcvs} co top-dir" \
13718 "${PROG} checkout: Updating top-dir
13721 dotest toplevel-6 "${testcvs} update top-dir" \
13722 "${PROG} update: Updating top-dir"
13723 dotest toplevel-7 "${testcvs} update" \
13724 "${PROG} update: Updating \.
13725 ${PROG} update: Updating top-dir"
13727 dotest toplevel-8 "${testcvs} update -d top-dir" \
13728 "${PROG} update: Updating top-dir"
13729 # There is some sentiment that
13730 # "${PROG} update: Updating \.
13731 # ${PROG} update: Updating top-dir"
13732 # is correct but it isn't clear why that would be correct instead
13733 # of the remote CVS behavior (which also updates CVSROOT).
13735 # The DOTSTAR matches of a bunch of lines like
13736 # "U CVSROOT/checkoutlist". Trying to match them more precisely
13737 # seemed to cause trouble. For example CVSROOT/cvsignore will
13738 # be present or absent depending on whether we ran the "ignore"
13740 dotest toplevel-9 "${testcvs} update -d" \
13741 "${PROG} update: Updating \.
13742 ${PROG} update: Updating CVSROOT
13744 ${PROG} update: Updating top-dir"
13747 rm -r 1; mkdir 1; cd 1
13748 dotest toplevel-10 "${testcvs} co top-dir" \
13749 "${PROG} checkout: Updating top-dir
13752 # This tests more or less the same thing, in a particularly
13753 # "real life" example.
13754 dotest toplevel-11 "${testcvs} -q update -d second-dir" \
13755 "U second-dir/file2"
13757 # Now remove the CVS directory (people may do this manually,
13758 # especially if they formed their habits with CVS
13759 # 1.9 and older, which didn't create it. Or perhaps the working
13760 # directory itself was created with 1.9 or older).
13762 # Now set the permissions so we can't recreate it.
13763 if test -n "$remotehost"; then
13765 $CVS_RSH $remotehost "chmod -w $TESTDIR/1"
13769 # Now see whether CVS has trouble because it can't create CVS.
13770 # First string is for local, second is for remote.
13771 dotest toplevel-12 "${testcvs} co top-dir" \
13772 "${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
13773 ${PROG} checkout: Updating top-dir" \
13774 "${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
13775 ${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
13776 ${PROG} checkout: in directory \.:
13777 ${PROG} checkout: cannot open CVS/Entries for reading: No such file or directory
13778 ${PROG} checkout: Updating top-dir"
13782 dotest toplevel-cleanup-1 "${testcvs} -q co CVSROOT/config" \
13785 echo "# empty file" >config
13786 dotest toplevel-cleanup-2 "${testcvs} -q ci -m toplevel-cleanup" \
13787 "Checking in config;
13788 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
13789 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13791 ${PROG} commit: Rebuilding administrative file database"
13795 rm -rf ${CVSROOT_DIRNAME}/top-dir ${CVSROOT_DIRNAME}/second-dir
13799 # Similar to toplevel, but test the case where TopLevelAdmin=no.
13801 # First set the TopLevelAdmin setting.
13803 dotest toplevel2-1a "${testcvs} -q co CVSROOT/config" \
13806 echo "TopLevelAdmin=no" >config
13807 dotest toplevel2-1b "${testcvs} -q ci -m no-top-level" \
13808 "Checking in config;
13809 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
13810 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13812 ${PROG} commit: Rebuilding administrative file database"
13816 # Now set up some directories and subdirectories
13818 dotest toplevel2-1 "${testcvs} -q co -l ." ''
13819 mkdir top-dir second-dir
13820 dotest toplevel2-2 "${testcvs} add top-dir second-dir" \
13821 "Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
13822 Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
13826 dotest toplevel2-3 "${testcvs} add file1" \
13827 "${PROG} add: scheduling file .file1. for addition
13828 ${PROG} add: use .${PROG} commit. to add this file permanently"
13829 dotest toplevel2-4 "${testcvs} -q ci -m add" \
13830 "RCS file: ${CVSROOT_DIRNAME}/top-dir/file1,v
13833 ${CVSROOT_DIRNAME}/top-dir/file1,v <-- file1
13834 initial revision: 1\.1
13840 dotest toplevel2-3s "${testcvs} add file2" \
13841 "${PROG} add: scheduling file .file2. for addition
13842 ${PROG} add: use .${PROG} commit. to add this file permanently"
13843 dotest toplevel2-4s "${testcvs} -q ci -m add" \
13844 "RCS file: ${CVSROOT_DIRNAME}/second-dir/file2,v
13847 ${CVSROOT_DIRNAME}/second-dir/file2,v <-- file2
13848 initial revision: 1\.1
13852 rm -r 1; mkdir 1; cd 1
13853 dotest toplevel2-5 "${testcvs} co top-dir" \
13854 "${PROG} checkout: Updating top-dir
13857 dotest toplevel2-6 "${testcvs} update top-dir" \
13858 "${PROG} update: Updating top-dir"
13859 dotest toplevel2-7 "${testcvs} update" \
13860 "${PROG} update: Updating top-dir"
13862 dotest toplevel2-8 "${testcvs} update -d top-dir" \
13863 "${PROG} update: Updating top-dir"
13864 # Contrast this with toplevel-9, which has TopLevelAdmin=yes.
13865 dotest toplevel2-9 "${testcvs} update -d" \
13866 "${PROG} update: Updating top-dir"
13869 rm -r 1; mkdir 1; cd 1
13870 dotest toplevel2-10 "${testcvs} co top-dir" \
13871 "${PROG} checkout: Updating top-dir
13873 # This tests more or less the same thing, in a particularly
13874 # "real life" example. With TopLevelAdmin=yes, this command
13875 # would give us second-dir and CVSROOT directories too.
13876 dotest toplevel2-11 "${testcvs} -q update -d" ""
13878 dotest toplevel2-cleanup-1 "${testcvs} -q co CVSROOT/config" \
13881 echo "# empty file" >config
13882 dotest toplevel2-cleanup-2 "${testcvs} -q ci -m toplevel2-cleanup" \
13883 "Checking in config;
13884 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
13885 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13887 ${PROG} commit: Rebuilding administrative file database"
13890 rm -rf ${CVSROOT_DIRNAME}/top-dir ${CVSROOT_DIRNAME}/second-dir
13897 # This test confirms a bug that exists in the r* commands currently
13898 # when run against the top-level project.
13900 # The assertion failure is something like:
13901 # do_recursion: Assertion \`strstr (repository, \"/\./\") == ((void \*)0)' failed\..*"
13902 dotest_fail rstar-toplevel-1 "$testcvs rlog ." \
13903 "${DOTSTAR}ssertion.*failed${DOTSTAR}" "${DOTSTAR}failed assertion${DOTSTAR}"
13906 echo Keeping ${TESTDIR} and exiting due to --keep
13914 # Some tests of CVS's reactions to path specifications containing
13915 # trailing slashes.
13916 mkdir trailingslashes; cd trailingslashes
13917 dotest trailingslashes-init-1 "$testcvs -Q co -ldt ."
13918 dotest trailingslashes-init-2 "$testcvs -Q co -dt2 ."
13920 echo "Ahh'll be baaack." >topfile
13921 dotest trailingslashes-init-3 "$testcvs -Q add topfile"
13922 dotest trailingslashes-init-4 "$testcvs -Q ci -mto-top" \
13923 "RCS file: $CVSROOT_DIRNAME/topfile,v
13925 Checking in topfile;
13926 $CVSROOT_DIRNAME/topfile,v <-- topfile
13927 initial revision: 1\.1
13930 # First, demonstrate the usual case.
13932 dotest trailingslashes-1 "$testcvs -q up CVSROOT"
13933 dotest_fail trailingslashes-1a "test -f topfile"
13936 # Now the one that fails in remote mode.
13937 # This highlights one of the failure cases mentioned in TODO item
13940 dotest trailingslashes-2 "$testcvs -q up CVSROOT/" \
13942 dotest trailingslashes-2a "test -f topfile"
13944 dotest trailingslashes-2 "$testcvs -q up CVSROOT/"
13945 dotest_fail trailingslashes-2a "test -f topfile"
13949 echo Keeping $TESTDIR and exiting due to --keep
13954 rm -rf trailingslashes $CVSROOT_DIRNAME/topfile,v
13959 checkout_repository)
13960 dotest_fail checkout_repository-1 \
13961 "${testcvs} co -d ${CVSROOT_DIRNAME} CVSROOT" \
13962 "${PROG} \[checkout aborted\]: Cannot check out files into the repository itself" \
13963 "${PROG} \[checkout aborted\]: absolute pathname \`${CVSROOT_DIRNAME}' illegal for server"
13965 # The behavior of the client/server test below should be correct.
13966 # The CVS client currently has no way of knowing that the client and
13967 # server are the same machine and thus skips the $CVSROOT checks.
13968 # I think checking for this case in CVS would be bloat since this
13969 # should be a fairly rare occurance.
13970 cd ${CVSROOT_DIRNAME}
13971 dotest_fail checkout_repository-2 "${testcvs} co CVSROOT" \
13972 "${PROG} \[checkout aborted\]: Cannot check out files into the repository itself" \
13973 "${PROG} checkout: Updating CVSROOT
13974 ${PROG} checkout: move away CVSROOT/checkoutlist; it is in the way
13975 C CVSROOT/checkoutlist
13976 ${PROG} checkout: move away CVSROOT/commitinfo; it is in the way
13977 C CVSROOT/commitinfo
13978 ${PROG} checkout: move away CVSROOT/config; it is in the way
13980 ${PROG} checkout: move away CVSROOT/cvswrappers; it is in the way
13981 C CVSROOT/cvswrappers
13982 ${PROG} checkout: move away CVSROOT/editinfo; it is in the way
13984 ${PROG} checkout: move away CVSROOT/loginfo; it is in the way
13986 ${PROG} checkout: move away CVSROOT/modules; it is in the way
13988 ${PROG} checkout: move away CVSROOT/notify; it is in the way
13990 ${PROG} checkout: move away CVSROOT/rcsinfo; it is in the way
13992 ${PROG} checkout: move away CVSROOT/taginfo; it is in the way
13994 ${PROG} checkout: move away CVSROOT/verifymsg; it is in the way
13995 C CVSROOT/verifymsg"
13997 dotest checkout_repository-3 \
13998 "${testcvs} co -p CVSROOT/modules >/dev/null" \
13999 "===================================================================
14000 Checking out CVSROOT/modules
14001 RCS: ${CVSROOT_DIRNAME}/CVSROOT/modules,v
14003 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
14008 for message in '' ' ' '
14011 mkdir a-dir; cd a-dir
14012 # Test handling of -m during import
14014 if ${testcvs} import -m "$message" a-dir A A1 >>${LOGFILE} 2>&1;then
14019 # Must import twice since the first time uses inline code that
14022 if ${testcvs} import -m "$message" a-dir A A2 >>${LOGFILE} 2>&1;then
14027 # Test handling of -m during ci
14029 if ${testcvs} co a-dir >>${LOGFILE} 2>&1; then
14036 if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
14041 # Test handling of -m during rm/ci
14043 if ${testcvs} rm test >>${LOGFILE} 2>&1; then
14048 if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
14056 rm -rf ${CVSROOT_DIRNAME}/a-dir
14061 # More tests of log messages, in this case the ability to
14062 # run an external editor.
14064 # * also test $EDITOR, $CVSEDITOR, &c.
14065 # * test what happens if up-to-date check fails.
14067 # Our "editor" puts "x" at the start of each line, so we
14068 # can see the "CVS:" lines.
14069 cat >${TESTDIR}/editme <<EOF
14072 sed <\$1 -e 's/^/x/' >${TESTDIR}/edit.new
14073 mv ${TESTDIR}/edit.new \$1
14076 chmod +x ${TESTDIR}/editme
14079 dotest editor-1 "${testcvs} -q co -l ." ''
14081 dotest editor-2 "${testcvs} add first-dir" \
14082 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
14085 dotest editor-3 "${testcvs} add file1 file2" \
14086 "${PROG} add: scheduling file .file1. for addition
14087 ${PROG} add: scheduling file .file2. for addition
14088 ${PROG} add: use .${PROG} commit. to add these files permanently"
14089 dotest editor-4 "${testcvs} -e ${TESTDIR}/editme -q ci" \
14090 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
14093 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
14094 initial revision: 1\.1
14096 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
14099 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
14100 initial revision: 1\.1
14102 dotest editor-5 "${testcvs} -q tag -b br" "T file1
14104 dotest editor-6 "${testcvs} -q update -r br" ''
14105 echo modify >>file1
14106 dotest editor-7 "${testcvs} -e ${TESTDIR}/editme -q ci" \
14107 "Checking in file1;
14108 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
14109 new revision: 1\.1\.2\.1; previous revision: 1\.1
14111 # OK, now we want to make sure "ci -r" puts in the branch
14112 # where appropriate. Note that we can check in on the branch
14113 # without being on the branch, because there is not a revision
14114 # already on the branch. If there were a revision on the branch,
14115 # CVS would correctly give an up-to-date check failed.
14116 dotest editor-8 "${testcvs} -q update -A" "U file1"
14117 echo add a line >>file2
14118 dotest editor-9 "${testcvs} -q -e ${TESTDIR}/editme ci -rbr file2" \
14119 "Checking in file2;
14120 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
14121 new revision: 1\.1\.2\.1; previous revision: 1\.1
14124 dotest editor-log-file1 "${testcvs} log -N file1" "
14125 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
14126 Working file: file1
14131 keyword substitution: kv
14132 total revisions: 2; selected revisions: 2
14134 ----------------------------
14136 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
14138 xCVS: ----------------------------------------------------------------------
14139 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
14141 xCVS: Committing in .
14145 xCVS: ----------------------------------------------------------------------
14146 ----------------------------
14147 revision 1\.1\.2\.1
14148 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
14149 xCVS: ----------------------------------------------------------------------
14150 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
14152 xCVS: Committing in .
14154 xCVS: Modified Files:
14157 xCVS: ----------------------------------------------------------------------
14158 ============================================================================="
14160 # The only difference between the two expect strings is the
14161 # presence or absence of "Committing in ." for 1.1.2.1.
14162 dotest editor-log-file2 "${testcvs} log -N file2" "
14163 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
14164 Working file: file2
14169 keyword substitution: kv
14170 total revisions: 2; selected revisions: 2
14172 ----------------------------
14174 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
14176 xCVS: ----------------------------------------------------------------------
14177 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
14179 xCVS: Committing in .
14183 xCVS: ----------------------------------------------------------------------
14184 ----------------------------
14185 revision 1\.1\.2\.1
14186 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
14187 xCVS: ----------------------------------------------------------------------
14188 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
14190 xCVS: Modified Files:
14193 xCVS: ----------------------------------------------------------------------
14194 =============================================================================" "
14195 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
14196 Working file: file2
14201 keyword substitution: kv
14202 total revisions: 2; selected revisions: 2
14204 ----------------------------
14206 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
14208 xCVS: ----------------------------------------------------------------------
14209 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
14211 xCVS: Committing in .
14215 xCVS: ----------------------------------------------------------------------
14216 ----------------------------
14217 revision 1\.1\.2\.1
14218 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
14219 xCVS: ----------------------------------------------------------------------
14220 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
14222 xCVS: Committing in .
14224 xCVS: Modified Files:
14227 xCVS: ----------------------------------------------------------------------
14228 ============================================================================="
14230 # Test CVS's response to an unchanged log message
14231 cat >${TESTDIR}/editme <<EOF
14236 chmod +x ${TESTDIR}/editme
14237 dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
14239 Log message unchanged or not specified
14240 a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
14241 Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
14243 # Test CVS's response to an empty log message
14244 cat >${TESTDIR}/editme <<EOF
14250 chmod +x ${TESTDIR}/editme
14251 dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
14253 Log message unchanged or not specified
14254 a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
14255 Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
14257 # Test CVS's response to a log message with one blank line
14258 cat >${TESTDIR}/editme <<EOF
14264 chmod +x ${TESTDIR}/editme
14265 dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
14267 Log message unchanged or not specified
14268 a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
14269 Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
14271 # Test CVS's response to a log message with only comments
14272 cat >${TESTDIR}/editme <<EOF
14275 cat \$1 >${TESTDIR}/edit.new
14276 mv ${TESTDIR}/edit.new \$1
14279 chmod +x ${TESTDIR}/editme
14280 dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
14282 Log message unchanged or not specified
14283 a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
14284 Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
14286 # Test CVS's response to a log message that is zero bytes
14287 # in length. This caused core dumps in cvs 1.11.5 on Solaris
14290 dotest editor-emptylog-continue-1 "${testcvs} -q co CVSROOT/loginfo" \
14291 "U CVSROOT/loginfo"
14294 echo 'DEFAULT (echo Start-Log;cat;echo End-Log) >> \$CVSROOT/CVSROOT/commitlog' > loginfo
14295 dotest editor-emptylog-continue-2 "${testcvs} commit -m add loginfo" \
14296 "Checking in loginfo;
14297 ${CVSROOT_DIRNAME}/CVSROOT/loginfo,v <-- loginfo
14298 new revision: 1\.2; previous revision: 1\.1
14300 ${PROG} commit: Rebuilding administrative file database"
14303 cat >${TESTDIR}/editme <<EOF
14309 chmod +x ${TESTDIR}/editme
14310 dotest editor-emptylog-continue-3 "echo c |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
14311 "${PROG} [a-z]*: warning: editor session failed
14313 Log message unchanged or not specified
14314 a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
14315 Action: (continue) Checking in file1;
14316 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
14317 new revision: 1\.2; previous revision: 1\.1
14319 # The loginfo Log message should be an empty line and not "(null)"
14320 # which is what some fprintf() implementations do with "%s"
14321 # format and a NULL pointer...
14323 dotest editor-emptylog-continue-4r \
14324 "cat ${CVSROOT_DIRNAME}/CVSROOT/commitlog" \
14326 Update of ${CVSROOT_DIRNAME}/first-dir
14327 In directory ${hostname}:${TMPDIR}/cvs-serv[0-9a-z]*
14335 dotest editor-emptylog-continue-4 \
14336 "cat ${CVSROOT_DIRNAME}/CVSROOT/commitlog" \
14338 Update of ${CVSROOT_DIRNAME}/first-dir
14339 In directory ${hostname}:${TESTDIR}/1/first-dir
14347 # There should have an empty log message at this point
14348 dotest editor-emptylog-continue-5 "${testcvs} log -N -r1.2 file1" \
14350 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
14351 Working file: file1
14356 keyword substitution: kv
14357 total revisions: 3; selected revisions: 1
14359 ----------------------------
14361 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: +0 -0
14362 \*\*\* empty log message \*\*\*
14363 ============================================================================="
14367 echo Keeping ${TESTDIR} and exiting due to --keep
14371 # restore the default loginfo script
14372 rm -f ${CVSROOT_DIRNAME}/CVSROOT/loginfo,v \
14373 ${CVSROOT_DIRNAME}/CVSROOT/loginfo \
14374 ${CVSROOT_DIRNAME}/CVSROOT/commitlog
14375 dotest editor-emptylog-continue-cleanup-1 "${testcvs} init" ''
14379 rm ${TESTDIR}/editme
14380 rm -rf ${CVSROOT_DIRNAME}/first-dir
14384 mkdir ${CVSROOT_DIRNAME}/1dir
14387 if ${testcvs} -q co 1dir; then
14394 if ${testcvs} add foo 2>>${LOGFILE}; then
14399 if ${testcvs} ci -m added >>${LOGFILE} 2>&1; then
14407 if ${testcvs} -q co 1dir >>${LOGFILE}; then
14415 if ${testcvs} rm foo >>${LOGFILE} 2>&1; then
14420 if ${testcvs} ci -m removed >>${LOGFILE} 2>&1; then
14427 # The second case in the local and remote versions of errmsg1-168
14428 # below happens on Cygwin under Windows, where write privileges
14429 # aren't enforced properly.
14431 dotest errmsg1-168r "${testcvs} -q update" \
14432 "${PROG} update: foo is no longer in the repository
14433 ${PROG} update: unable to remove \./foo: Permission denied" \
14434 "${PROG} update: foo is no longer in the repository"
14436 dotest errmsg1-168 "${testcvs} -q update" \
14437 "${PROG} update: foo is no longer in the repository
14438 ${PROG} update: unable to remove foo: Permission denied" \
14439 "${PROG} update: foo is no longer in the repository"
14446 rm -rf ${CVSROOT_DIRNAME}/1dir
14450 # More tests of various miscellaneous error handling,
14451 # and cvs add behavior in general.
14452 # See also test basicb-4a, concerning "cvs ci CVS".
14453 # Too many tests to mention test the simple cases of
14454 # adding files and directories.
14455 # Test basicb-2a10 tests cvs -n add.
14457 # First the usual setup; create a directory first-dir.
14459 dotest errmsg2-1 "${testcvs} -q co -l ." ''
14461 dotest errmsg2-2 "${testcvs} add first-dir" \
14462 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
14464 dotest_fail errmsg2-3 "${testcvs} add CVS" \
14465 "${PROG} [a-z]*: cannot add special file .CVS.; skipping"
14467 # For the most part add returns a failure exitstatus if
14468 # there are any errors, even if the remaining files are
14469 # processed without incident. The "cannot add
14470 # special file" message fits this pattern, at
14472 dotest_fail errmsg2-4 "${testcvs} add CVS file1" \
14473 "${PROG} add: cannot add special file .CVS.; skipping
14474 ${PROG} add: scheduling file .file1. for addition
14475 ${PROG} add: use .${PROG} commit. to add this file permanently"
14476 # I'm not sure these tests completely convey the various strange
14477 # behaviors that CVS had before it specially checked for "." and
14478 # "..". Suffice it to say that these are unlikely to work right
14479 # without a special case.
14480 dotest_fail errmsg2-5 "${testcvs} add ." \
14481 "${PROG} [a-z]*: cannot add special file .\..; skipping"
14482 dotest_fail errmsg2-6 "${testcvs} add .." \
14483 "${PROG} [a-z]*: cannot add special file .\.\..; skipping"
14484 # Make sure that none of the error messages left droppings
14485 # which interfere with normal operation.
14486 dotest errmsg2-7 "${testcvs} -q ci -m add-file1" \
14487 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
14490 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
14491 initial revision: 1\.1
14495 dotest errmsg2-8 "${testcvs} add first-dir/sdir" \
14496 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
14497 # while we're here... check commit with no CVS directory
14498 dotest_fail errmsg2-8a "${testcvs} -q ci first-dir nonexistant" \
14499 "${PROG} [a-z]*: nothing known about .nonexistant'
14500 ${PROG} \[[a-z]* aborted\]: correct above errors first!"
14501 dotest_fail errmsg2-8b "${testcvs} -q ci nonexistant first-dir" \
14502 "${PROG} [a-z]*: nothing known about .nonexistant'
14503 ${PROG} \[[a-z]* aborted\]: correct above errors first!"
14504 dotest errmsg2-8c "${testcvs} -q ci first-dir" ""
14510 dotest errmsg2-10 "${testcvs} add file10 sdir10" \
14511 "${PROG} add: scheduling file .file10. for addition
14512 Directory ${CVSROOT_DIRNAME}/first-dir/sdir10 added to the repository
14513 ${PROG} add: use .${PROG} commit. to add this file permanently"
14514 dotest errmsg2-11 "${testcvs} -q ci -m add-file10" \
14515 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
14517 Checking in file10;
14518 ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
14519 initial revision: 1\.1
14521 # Try to see that there are no droppings left by
14522 # any of the previous tests.
14523 dotest errmsg2-12 "${testcvs} -q update" ""
14525 # Now test adding files with '/' in the name, both one level
14526 # down and more than one level down.
14528 mkdir first-dir/sdir10/ssdir
14529 dotest errmsg2-13 "${testcvs} add first-dir/sdir10/ssdir" \
14530 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir10/ssdir added to the repository"
14532 touch first-dir/sdir10/ssdir/ssfile
14533 dotest errmsg2-14 \
14534 "${testcvs} add first-dir/sdir10/ssdir/ssfile" \
14535 "${PROG} add: scheduling file .first-dir/sdir10/ssdir/ssfile. for addition
14536 ${PROG} add: use .${PROG} commit. to add this file permanently"
14537 touch first-dir/file15
14538 dotest errmsg2-15 "${testcvs} add first-dir/file15" \
14539 "${PROG} add: scheduling file .first-dir/file15. for addition
14540 ${PROG} add: use .${PROG} commit. to add this file permanently"
14542 # Now the case where we try to give it a directory which is not
14543 # under CVS control.
14545 touch bogus-dir/file16
14546 # The first message, from local CVS, is nice. The second one
14547 # is not nice; would be good to fix remote CVS to give a clearer
14548 # message (e.g. the one from local CVS). But at least it is an
14550 dotest_fail errmsg2-16 "${testcvs} add bogus-dir/file16" \
14551 "${PROG} add: in directory bogus-dir:
14552 ${PROG} \[add aborted\]: there is no version here; do .${PROG} checkout. first" \
14553 "${PROG} add: cannot open CVS/Entries for reading: No such file or directory
14554 ${PROG} \[add aborted\]: no repository"
14557 # One error condition we don't test for is trying to add a file
14558 # or directory which already is there.
14560 dotest errmsg2-17 "${testcvs} -q ci -m checkin" \
14561 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file15,v
14563 Checking in first-dir/file15;
14564 ${CVSROOT_DIRNAME}/first-dir/file15,v <-- file15
14565 initial revision: 1\.1
14567 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir10/ssdir/ssfile,v
14569 Checking in first-dir/sdir10/ssdir/ssfile;
14570 ${CVSROOT_DIRNAME}/first-dir/sdir10/ssdir/ssfile,v <-- ssfile
14571 initial revision: 1\.1
14573 dotest errmsg2-18 "${testcvs} -Q tag test" ''
14575 # trying to import the repository
14577 if $remote; then :; else
14578 cd ${CVSROOT_DIRNAME}
14579 dotest_fail errmsg2-20 "${testcvs} import -mtest . A B" \
14580 "${PROG} \[import aborted\]: attempt to import the repository"
14581 dotest_fail errmsg2-21 "${testcvs} import -mtest first-dir A B" \
14582 "${PROG} \[import aborted\]: attempt to import the repository"
14587 rm -rf ${CVSROOT_DIRNAME}/first-dir
14591 # Test some of the error messages the 'add' command can return and
14592 # their reactions to '-q'.
14594 # First the usual setup; create a directory first-dir.
14596 dotest adderrmsg-init1 "${testcvs} -q co -l ." ''
14597 mkdir adderrmsg-dir
14598 dotest adderrmsg-init2 "${testcvs} add adderrmsg-dir" \
14599 "Directory ${CVSROOT_DIRNAME}/adderrmsg-dir added to the repository"
14602 # try to add the admin dir
14603 dotest_fail adderrmsg-1 "${testcvs} add CVS" \
14604 "${PROG} [a-z]*: cannot add special file .CVS.; skipping"
14605 # might not want to see this message when you 'cvs add *'
14606 dotest_fail adderrmsg-2 "${testcvs} -q add CVS" ""
14608 # to test some other messages
14610 dotest adderrmsg-3 "${testcvs} add file1" \
14611 "${PROG} add: scheduling file .file1. for addition
14612 ${PROG} add: use .${PROG} commit. to add this file permanently"
14615 dotest_fail adderrmsg-4 "${testcvs} add file1" \
14616 "${PROG} add: file1 has already been entered"
14617 dotest_fail adderrmsg-5 "${testcvs} -q add file1" ""
14619 dotest adderrmsg-6 "${testcvs} -q ci -madd" \
14620 "RCS file: ${CVSROOT_DIRNAME}/adderrmsg-dir/file1,v
14623 ${CVSROOT_DIRNAME}/adderrmsg-dir/file1,v <-- file1
14624 initial revision: 1\.1
14627 # file in Entries & repository
14628 dotest_fail adderrmsg-7 "${testcvs} add file1" \
14629 "${PROG} add: file1 already exists, with version number 1\.1"
14630 dotest_fail adderrmsg-8 "${testcvs} -q add file1" ""
14634 if $keep; then :; else
14636 rm -rf ${CVSROOT_DIRNAME}/adderrmsg-dir
14641 # Test some option parsing error messages
14643 # No init is necessary since these error messages are printed b4
14644 # CVS looks for a sandbox or repository
14646 # -z used to accept non-numeric arguments. This bit someone who
14647 # attempted `cvs -z -n up' when the -n was read as the argument to
14649 dotest_fail opterrmsg-1 "${testcvs} -z -n up" \
14650 "${PROG}: gzip compression level must be between 0 and 9"
14652 # Some general -z checks
14653 dotest_fail opterrmsg-2 "${testcvs} -z -1 up" \
14654 "${PROG}: gzip compression level must be between 0 and 9"
14655 dotest_fail opterrmsg-3 "${testcvs} -z10 up" \
14656 "${PROG}: gzip compression level must be between 0 and 9"
14660 mkdir ${CVSROOT_DIRNAME}/first-dir
14663 dotest devcom-1 "${testcvs} -q co first-dir"
14667 dotest devcom-2 "${testcvs} add abb" \
14668 "$PROG add: scheduling file \`abb' for addition
14669 $PROG add: use '$PROG commit' to add this file permanently"
14671 dotest devcom-3 "${testcvs} -q ci -m added" \
14672 "RCS file: ${CVSROOT_DIRNAME}/first-dir/abb,v
14675 ${CVSROOT_DIRNAME}/first-dir/abb,v <-- abb
14676 initial revision: 1\.1
14679 dotest_fail devcom-4 "${testcvs} watch" "Usage${DOTSTAR}"
14681 dotest devcom-5 "${testcvs} watch on"
14684 dotest devcom-6 "${testcvs} add abc" \
14685 "$PROG add: scheduling file \`abc' for addition
14686 $PROG add: use '$PROG commit' to add this file permanently"
14688 dotest devcom-7 "${testcvs} -q ci -m added" \
14689 "RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
14692 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
14693 initial revision: 1\.1
14700 dotest devcom-8 "${testcvs} -q co first-dir" \
14705 dotest_fail devcom-9 "test -w abb"
14706 dotest_fail devcom-9 "test -w abc"
14708 dotest devcom-10 "${testcvs} editors" ""
14710 dotest devcom-11 "${testcvs} edit abb"
14712 # Here we test for the traditional ISO C ctime() date format.
14713 # We assume the C locale; I guess that works provided we set
14714 # LC_ALL at the start of this script but whether these
14715 # strings should vary based on locale does not strike me as
14717 dotest devcom-12 "${testcvs} editors" \
14718 "abb ${username} [SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] GMT [-a-zA-Z_.0-9]* ${TESTDIR}/2/first-dir"
14721 dotest devcom-13 "${testcvs} ci -m modify abb" \
14723 ${CVSROOT_DIRNAME}/first-dir/abb,v <-- abb
14724 new revision: 1\.2; previous revision: 1\.1
14727 # Unedit of a file not being edited should be a noop.
14728 dotest devcom-14 "${testcvs} unedit abb" ''
14730 dotest devcom-15 "${testcvs} editors" ""
14732 dotest_fail devcom-16 "test -w abb"
14734 dotest devcom-17 "${testcvs} edit abc"
14736 # Unedit of an unmodified file.
14737 dotest devcom-18 "${testcvs} unedit abc"
14738 dotest devcom-19 "${testcvs} edit abc"
14740 echo changedabc >abc
14741 # Try to unedit a modified file; cvs should ask for confirmation
14742 dotest devcom-20 "echo no | ${testcvs} unedit abc" \
14743 "abc has been modified; revert changes? "
14745 dotest devcom-21 "echo changedabc | cmp - abc"
14747 # OK, now confirm the unedit
14748 dotest devcom-22 "echo yes | ${testcvs} unedit abc" \
14749 "abc has been modified; revert changes? "
14751 dotest devcom-23 "echo abc | cmp - abc"
14753 dotest devcom-24 "${testcvs} watchers" ''
14755 # FIXME: This probably should be an error message instead
14756 # of silently succeeding and printing nothing.
14757 dotest devcom-a-nonexist "${testcvs} watchers nonexist" ''
14759 dotest devcom-a1 "${testcvs} watch add" ''
14760 dotest devcom-a2 "${testcvs} watchers" \
14761 "abb ${username} edit unedit commit
14762 abc ${username} edit unedit commit"
14763 dotest devcom-a3 "${testcvs} watch remove -a unedit abb" ''
14764 dotest devcom-a4 "${testcvs} watchers abb" \
14765 "abb ${username} edit commit"
14767 # Check tagging and checking out while we have a CVS
14768 # directory in the repository.
14769 dotest devcom-t0 "${testcvs} -q tag tag" \
14776 # Test commented out because the bug it tests for is not fixed
14778 # cvs watchers: cannot open CVS/Entries for reading: No such file or directory
14779 # cvs: ../../work/ccvs/src/fileattr.c:75: fileattr_read: Assertion `fileattr_stored_repos != ((void *)0)' failed.
14780 : dotest devcom-t-nonexist "${testcvs} watchers nonexist" fixme
14782 dotest devcom-t1 "${testcvs} -q co -rtag first-dir/abb" \
14785 # Since first-dir/abb is readonly, use -f.
14788 # Test checking out the directory rather than the file.
14791 dotest devcom-t2 "${testcvs} -q co -rtag first-dir" \
14795 # Since the files are readonly, use -f.
14798 # Now do it again, after removing the val-tags file created
14799 # by devcom-t1 to force CVS to search the repository
14800 # containing CVS directories.
14801 rm ${CVSROOT_DIRNAME}/CVSROOT/val-tags
14804 dotest devcom-t3 "${testcvs} -q co -rtag first-dir" \
14808 # Since the files are readonly, use -f.
14811 # Now remove all the file attributes
14813 dotest devcom-b0 "${testcvs} watch off" ''
14814 dotest devcom-b1 "${testcvs} watch remove" ''
14815 # Test that CVS 1.6 and earlier can handle the repository.
14816 dotest_fail devcom-b2 "test -d ${CVSROOT_DIRNAME}/first-dir/CVS"
14818 # Now test watching just some, not all, files.
14819 dotest devcom-some0 "${testcvs} watch on abc" ''
14823 dotest devcom-some1 "${testcvs} -q co first-dir" 'U first-dir/abb
14825 dotest devcom-some2 "test -w first-dir/abb" ''
14826 dotest_fail devcom-some3 "test -w first-dir/abc" ''
14830 echo Keeping ${TESTDIR} and exiting due to --keep
14834 # Use -f because of the readonly files.
14836 rm -rf ${CVSROOT_DIRNAME}/first-dir
14840 # More watch tests, most notably setting watches on
14841 # files in various different states.
14842 mkdir ${CVSROOT_DIRNAME}/first-dir
14845 dotest devcom2-1 "${testcvs} -q co first-dir" ''
14848 # This should probably be an error; setting a watch on a totally
14849 # unknown file is more likely to be a typo than intentional.
14850 # But that isn't the currently implemented behavior.
14851 dotest devcom2-2 "${testcvs} watch on w1" ''
14854 dotest devcom2-3 "${testcvs} add w1 w2 w3 nw1" "${DOTSTAR}"
14855 # Letting the user set the watch here probably can be considered
14856 # a feature--although it leads to a few potentially strange
14857 # consequences like one user can set the watch and another actually
14859 dotest devcom2-4 "${testcvs} watch on w2" ''
14860 dotest devcom2-5 "${testcvs} -q ci -m add-them" "${DOTSTAR}"
14862 # Note that this test differs in a subtle way from devcom-some0;
14863 # in devcom-some0 the watch is creating a new fileattr file, and
14864 # here we are modifying an existing one.
14865 dotest devcom2-6 "${testcvs} watch on w3" ''
14867 # Now test that all the watches got set on the correct files
14868 # FIXME: CVS should have a way to report whether watches are
14869 # set, I think. The "check it out and see if it read-only" is
14870 # sort of OK, but is complicated by CVSREAD and doesn't help
14871 # if the file is added and not yet committed or some such.
14872 # Probably "cvs status" should report "watch: on" if watch is on
14873 # (and nothing if watch is off, so existing behavior is preserved).
14877 dotest devcom2-7 "${testcvs} -q co first-dir" 'U first-dir/nw1
14881 dotest devcom2-8 "test -w first-dir/nw1" ''
14882 dotest_fail devcom2-9 "test -w first-dir/w1" ''
14883 dotest_fail devcom2-10 "test -w first-dir/w2" ''
14884 dotest_fail devcom2-11 "test -w first-dir/w3" ''
14887 # OK, now we want to try files in various states with cvs edit.
14888 dotest devcom2-12 "${testcvs} edit w4" \
14889 "${PROG} edit: no such file w4; ignored"
14890 # Try the same thing with a per-directory watch set.
14891 dotest devcom2-13 "${testcvs} watch on" ''
14892 dotest devcom2-14 "${testcvs} edit w5" \
14893 "${PROG} edit: no such file w5; ignored"
14894 dotest devcom2-15 "${testcvs} editors" ''
14895 dotest devcom2-16 "${testcvs} editors w4" ''
14896 # Make sure there are no droppings lying around
14897 dotest devcom2-17 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
14905 # Do a little error testing
14906 dotest devcom2-18 "${testcvs} -q co -d first+dir first-dir" \
14907 "U first${PLUS}dir/nw1
14908 U first${PLUS}dir/w1
14909 U first${PLUS}dir/w2
14910 U first${PLUS}dir/w3"
14912 dotest_fail devcom2-19 "${testcvs} edit" \
14913 "${PROG} \[[a-z]* aborted\]: current directory (${TESTDIR}/2/first${PLUS}dir) contains an invalid character (${PLUS},>;=\\\\t\\\\n)"
14915 # Make sure there are no droppings lying around
14916 dotest devcom2-20 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
14925 # Use -f because of the readonly files.
14927 rm -rf ${CVSROOT_DIRNAME}/first-dir
14931 # More watch tests, most notably handling of features designed
14932 # for future expansion.
14933 mkdir ${CVSROOT_DIRNAME}/first-dir
14936 dotest devcom3-1 "${testcvs} -q co first-dir" ''
14940 dotest devcom3-2 "${testcvs} add w1 w2" "${DOTSTAR}"
14941 dotest devcom3-3 "${testcvs} watch on w1 w2" ''
14942 dotest devcom3-4 "${testcvs} -q ci -m add-them" "${DOTSTAR}"
14944 # OK, since we are about to delve into CVS's internals, make
14945 # sure that we seem to be correct about how they work.
14946 dotest devcom3-5 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
14949 # Now write a few more lines, just as if we were a newer version
14950 # of CVS implementing some new feature.
14951 cat <<'EOF' >>${CVSROOT_DIRNAME}/first-dir/CVS/fileattr
14955 # Now get CVS to write to the fileattr file....
14956 dotest devcom3-6 "${testcvs} watch off w1" ''
14957 # ...and make sure that it hasn't clobbered our new lines.
14958 # Note that writing these lines in another order would be OK
14960 dotest devcom3-7 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
14965 # See what CVS does when a file name is duplicated. The
14966 # behavior of all versions of CVS since file attributes were
14967 # implemented is that it nukes the duplications. This seems
14968 # reasonable enough, although it means it isn't clear how
14969 # useful duplicates would be for purposes of future
14970 # expansion. But in the interests of keeping behaviors
14971 # predictable, might as well test for it, I guess.
14972 echo 'Fw2 duplicate=' >>${CVSROOT_DIRNAME}/first-dir/CVS/fileattr
14973 dotest devcom3-8 "${testcvs} watch on w1" ''
14974 dotest devcom3-9 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
14980 # Now test disconnected "cvs edit" and the format of the
14983 CVS_SERVER_save=${CVS_SERVER}
14984 CVS_SERVER=${TESTDIR}/cvs-none; export CVS_SERVER
14986 # The ${DOTSTAR} below matches the exact CVS server error message,
14987 # which in :fork: mode is:
14988 # "$PROG \[edit aborted\]: cannot exec $TESTDIR/cvs-none: ${DOTSTAR}",
14990 # "bash2: line 1: $TESTDIR/cvs-none: No such file or directory"
14991 # when testing across an :ext:/ssh link to my Linux 2.4 box.
14993 # I can't even test for the second part of the error message,
14994 # from the client, which varies more consistently, usually either
14995 # "end of file from server" (if the process doing the exec exits
14996 # before the parent gets around to sending data to it) or
14997 # "received broken pipe signal" (if it is the other way around),
14998 # since HP-UX fails to output it.
14999 dotest_fail devcom3-9ar "${testcvs} edit w1 2>/dev/null"
15000 dotest devcom3-9br "test -w w1" ""
15001 dotest devcom3-9cr "cat CVS/Notify" \
15002 "Ew1 [SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] GMT [-a-zA-Z_.0-9]* ${TESTDIR}/1/first-dir EUC"
15003 CVS_SERVER=${CVS_SERVER_save}; export CVS_SERVER
15004 dotest devcom3-9dr "${testcvs} -q update" ""
15005 dotest_fail devcom3-9er "test -f CVS/Notify" ""
15006 dotest devcom3-9fr "${testcvs} watchers w1" \
15007 "w1 ${username} tedit tunedit tcommit"
15008 dotest devcom3-9gr "${testcvs} unedit w1" ""
15009 dotest devcom3-9hr "${testcvs} watchers w1" ""
15013 # OK, now change the tab to a space, and see that CVS gives
15014 # a reasonable error (this is database corruption but CVS should
15015 # not lose its mind).
15016 sed -e 's/Fw2 /Fw2 /' <${CVSROOT_DIRNAME}/first-dir/CVS/fileattr \
15017 >${CVSROOT_DIRNAME}/first-dir/CVS/fileattr.new
15018 mv ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr.new \
15019 ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr
15021 dotest_fail devcom3-10 "${testcvs} -Q co ." \
15022 "${PROG} \[checkout aborted\]: file attribute database corruption: tab missing in ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr"
15025 # Use -f because of the readonly files.
15027 rm -rf ${CVSROOT_DIRNAME}/first-dir
15031 # More watch tests, including adding directories.
15033 dotest watch4-0a "${testcvs} -q co -l ." ''
15035 dotest watch4-0b "${testcvs} add first-dir" \
15036 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
15039 dotest watch4-1 "${testcvs} watch on" ''
15040 # This is just like the 173 test
15042 dotest watch4-2 "${testcvs} add file1" \
15043 "${PROG} add: scheduling file .file1. for addition
15044 ${PROG} add: use .${PROG} commit. to add this file permanently"
15045 dotest watch4-3 "${testcvs} -q ci -m add" \
15046 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
15049 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15050 initial revision: 1\.1
15052 # Now test the analogous behavior for directories.
15054 dotest watch4-4 "${testcvs} add subdir" \
15055 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
15058 dotest watch4-5 "${testcvs} add sfile" \
15059 "${PROG} add: scheduling file .sfile. for addition
15060 ${PROG} add: use .${PROG} commit. to add this file permanently"
15061 dotest watch4-6 "${testcvs} -q ci -m add" \
15062 "RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v
15065 ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
15066 initial revision: 1\.1
15070 dotest watch4-7 "${testcvs} -q co first-dir" "U first-dir/file1
15071 U first-dir/subdir/sfile"
15072 dotest_fail watch4-8 "test -w first-dir/file1" ''
15073 dotest_fail watch4-9 "test -w first-dir/subdir/sfile" ''
15075 dotest watch4-10 "${testcvs} edit file1" ''
15076 echo 'edited in 2' >file1
15080 dotest watch4-11 "${testcvs} edit file1" ''
15081 echo 'edited in 1' >file1
15082 dotest watch4-12 "${testcvs} -q ci -m edit-in-1" \
15083 "Checking in file1;
15084 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15085 new revision: 1\.2; previous revision: 1\.1
15089 dotest watch4-13 "${testcvs} -q update" \
15090 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
15091 retrieving revision 1\.1
15092 retrieving revision 1\.2
15093 Merging differences between 1\.1 and 1\.2 into file1
15094 rcsmerge: warning: conflicts during merge
15095 ${PROG} update: conflicts found in file1
15097 if (echo yes | ${testcvs} unedit file1) >>${LOGFILE}; then
15102 # This could plausibly be defined to either go back to the revision
15103 # which was cvs edit'd (the status quo), or back to revision 1.2
15104 # (that is, the merge could update CVS/Base/file1). We pick the
15105 # former because it is easier to implement, not because we have
15106 # thought much about which is better.
15107 dotest watch4-16 "cat file1" ''
15108 # Make sure CVS really thinks we are at 1.1.
15109 dotest watch4-17 "${testcvs} -q update" "U file1"
15110 dotest watch4-18 "cat file1" "edited in 1"
15113 # As a sanity check, make sure we are in the right place.
15114 dotest watch4-cleanup-1 "test -d 1" ''
15115 dotest watch4-cleanup-1 "test -d 2" ''
15116 # Specify -f because of the readonly files.
15118 rm -rf ${CVSROOT_DIRNAME}/first-dir
15122 # This test was designed to catch a problem in server
15123 # mode where an 'cvs edit'd file disappeared from the
15124 # CVS/Base directory when 'cvs status' or 'cvs update'
15125 # was called on the file after the file was touched.
15127 # This test is still here to prevent the bug from
15128 # being reintroduced.
15130 # The rationale for having CVS/Base stay around is that
15131 # CVS/Base should be there if "cvs edit" has been run (this
15132 # may be helpful as a "cvs editors" analogue, it is
15133 # client-side and based on working directory not username;
15134 # but more importantly, it isn't clear why a "cvs status"
15135 # would act like an unedit, and even if it does, it would
15136 # need to make the file read-only again).
15138 mkdir watch5; cd watch5
15139 dotest watch5-0a "${testcvs} -q co -l ." ''
15141 dotest watch5-0b "${testcvs} add first-dir" \
15142 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
15145 dotest watch5-1 "${testcvs} watch on" ''
15146 # This is just like the 173 test
15148 dotest watch5-2 "${testcvs} add file1" \
15149 "${PROG} add: scheduling file .file1. for addition
15150 ${PROG} add: use .${PROG} commit. to add this file permanently"
15151 dotest watch5-3 "${testcvs} -q ci -m add" \
15152 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
15155 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15156 initial revision: 1\.1
15158 dotest watch5-4 "${testcvs} edit file1" ''
15159 dotest watch5-5 "test -f CVS/Base/file1" ''
15160 if ${testcvs} status file1 >>${LOGFILE} 2>&1; then
15165 dotest watch5-7 "test -f CVS/Base/file1" ''
15167 # Here's where the file used to dissappear
15169 if ${testcvs} status file1 >>${LOGFILE} 2>&1; then
15174 dotest watch5-10 "test -f CVS/Base/file1" ''
15176 # Make sure update won't remove the file either
15178 dotest watch5-11 "${testcvs} -q up" ''
15179 dotest watch5-12 "test -f CVS/Base/file1" ''
15183 rm -rf ${CVSROOT_DIRNAME}/first-dir
15186 unedit-without-baserev)
15192 dotest unedit-without-baserev-1 \
15193 "$testcvs -Q import -m . $module X Y" ''
15194 dotest unedit-without-baserev-2 "$testcvs -Q co $module" ''
15197 dotest unedit-without-baserev-3 "$testcvs -Q edit $file" ''
15199 echo add a line >> $file
15202 # This will fail on most systems.
15203 echo "yes" | dotest unedit-without-baserev-4 "${testcvs} -Q unedit $file" \
15204 "m has been modified; revert changes${QUESTION} ${PROG} unedit: m not mentioned in CVS/Baserev
15205 ${PROG} unedit: run update to complete the unedit"
15207 # SunOS4.1.4 systems make it this far, but with a corrupted
15208 # CVS/Entries file. Demonstrate the corruption!
15209 dotest unedit-without-baserev-5 "cat CVS/Entries" \
15210 "/$file/1\.1\.1\.1/${DOTSTAR}"
15212 dotest unedit-without-baserev-6 "${testcvs} -q update" \
15213 "${PROG} update: warning: m was lost
15216 # OK, those were the easy cases. Now tackle the hard one
15217 # (the reason that CVS/Baserev was invented rather than just
15218 # getting the revision from CVS/Entries). This is very
15219 # similar to watch4-10 through watch4-18 but with Baserev
15223 dotest unedit-without-baserev-7 "${testcvs} -Q co x" ''
15226 dotest unedit-without-baserev-10 "${testcvs} edit m" ''
15227 echo 'edited in 2' >m
15231 dotest unedit-without-baserev-11 "${testcvs} edit m" ''
15232 echo 'edited in 1' >m
15233 dotest unedit-without-baserev-12 "${testcvs} -q ci -m edit-in-1" \
15235 ${CVSROOT_DIRNAME}/x/m,v <-- m
15236 new revision: 1\.2; previous revision: 1\.1
15240 dotest unedit-without-baserev-13 "${testcvs} -q update" \
15241 "RCS file: ${CVSROOT_DIRNAME}/x/m,v
15242 retrieving revision 1\.1\.1\.1
15243 retrieving revision 1\.2
15244 Merging differences between 1\.1\.1\.1 and 1\.2 into m
15245 rcsmerge: warning: conflicts during merge
15246 ${PROG} update: conflicts found in m
15249 dotest unedit-without-baserev-14 "echo yes | ${testcvs} unedit m" \
15250 "m has been modified; revert changes${QUESTION} ${PROG} unedit: m not mentioned in CVS/Baserev
15251 ${PROG} unedit: run update to complete the unedit"
15252 dotest unedit-without-baserev-15 "${testcvs} -q update" \
15253 "${PROG} update: warning: m was lost
15255 # The following tests are kind of degenerate compared with
15256 # watch4-16 through watch4-18 but might as well make sure that
15257 # nothing seriously wrong has happened to the working directory.
15258 dotest unedit-without-baserev-16 "cat m" 'edited in 1'
15259 # Make sure CVS really thinks we are at 1.2.
15260 dotest unedit-without-baserev-17 "${testcvs} -q update" ""
15261 dotest unedit-without-baserev-18 "cat m" "edited in 1"
15266 rm -rf ${CVSROOT_DIRNAME}/$module
15270 # On Windows, we can't check out CVSROOT, because the case
15271 # insensitivity means that this conflicts with cvsroot.
15275 dotest ignore-1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
15277 echo rootig.c >cvsignore
15278 dotest ignore-2 "${testcvs} add cvsignore" \
15279 "${PROG}"' add: scheduling file `cvsignore'"'"' for addition
15280 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
15282 # As of Jan 96, local CVS prints "Examining ." and remote doesn't.
15284 dotest ignore-3 " ${testcvs} ci -m added" \
15285 "${PROG} [a-z]*: Examining \.
15286 RCS file: ${CVSROOT_DIRNAME}/CVSROOT/cvsignore,v
15288 Checking in cvsignore;
15289 ${CVSROOT_DIRNAME}/CVSROOT/cvsignore,v <-- cvsignore
15290 initial revision: 1\.1
15292 ${PROG} commit: Rebuilding administrative file database"
15295 if echo "yes" | ${testcvs} release -d CVSROOT >>${LOGFILE} ; then
15301 # CVS looks at the home dir from getpwuid, not HOME (is that correct
15302 # behavior?), so this is hard to test and we won't try.
15303 # echo foobar.c >${HOME}/.cvsignore
15304 CVSIGNORE=envig.c; export CVSIGNORE
15305 mkdir dir-to-import
15307 touch foobar.c bar.c rootig.c defig.o envig.c optig.c
15308 # We use sort because we can't predict the order in which
15309 # the files will be listed.
15310 dotest_sort ignore-5 "${testcvs} import -m m -I optig.c ignore/first-dir tag1 tag2" \
15313 I ignore/first-dir/defig.o
15314 I ignore/first-dir/envig.c
15315 I ignore/first-dir/optig.c
15316 I ignore/first-dir/rootig.c
15317 N ignore/first-dir/bar.c
15318 N ignore/first-dir/foobar.c
15319 No conflicts created by this import'
15320 dotest_sort ignore-6 "${testcvs} import -m m -I ! ignore/second-dir tag3 tag4" \
15323 N ignore/second-dir/bar.c
15324 N ignore/second-dir/defig.o
15325 N ignore/second-dir/envig.c
15326 N ignore/second-dir/foobar.c
15327 N ignore/second-dir/optig.c
15328 N ignore/second-dir/rootig.c
15329 No conflicts created by this import'
15331 rm -r dir-to-import
15335 dotest ignore-7 "${testcvs} -q co -dsecond-dir ignore/second-dir" \
15336 'U second-dir/bar.c
15337 U second-dir/defig.o
15338 U second-dir/envig.c
15339 U second-dir/foobar.c
15340 U second-dir/optig.c
15341 U second-dir/rootig.c'
15342 dotest ignore-8 "${testcvs} -q co -dfirst-dir ignore/first-dir" 'U first-dir/bar.c
15343 U first-dir/foobar.c'
15345 touch rootig.c defig.o envig.c optig.c notig.c
15346 dotest ignore-9 "${testcvs} -q update -I optig.c" "${QUESTION} notig.c"
15347 # The fact that CVS requires us to specify -I CVS here strikes me
15349 dotest_sort ignore-10 "${testcvs} -q update -I ! -I CVS" \
15350 "${QUESTION} defig.o
15351 ${QUESTION} envig.c
15352 ${QUESTION} notig.c
15353 ${QUESTION} optig.c
15354 ${QUESTION} rootig.c"
15356 # Now test that commands other than update also print "? notig.c"
15357 # where appropriate. Only test this for remote, because local
15358 # CVS only prints it on update.
15361 dotest ignore-11r "${testcvs} -q diff" "${QUESTION} notig.c"
15363 # Force the server to be contacted. Ugh. Having CVS
15364 # contact the server for the sole purpose of checking
15365 # the CVSROOT/cvsignore file does not seem like such a
15366 # good idea, so I imagine this will continue to be
15367 # necessary. Oh well, at least we test CVS's ablity to
15368 # handle a file with a modified timestamp but unmodified
15372 dotest ignore-11r "${testcvs} -q ci -m commit-it" "${QUESTION} notig.c"
15375 # now test .cvsignore files
15377 echo notig.c >first-dir/.cvsignore
15378 echo foobar.c >second-dir/.cvsignore
15379 touch first-dir/notig.c second-dir/notig.c second-dir/foobar.c
15380 dotest_sort ignore-12 "${testcvs} -qn update" \
15381 "${QUESTION} first-dir/.cvsignore
15382 ${QUESTION} second-dir/.cvsignore
15383 ${QUESTION} second-dir/notig.c"
15384 dotest_sort ignore-13 "${testcvs} -qn update -I! -I CVS" \
15385 "${QUESTION} first-dir/.cvsignore
15386 ${QUESTION} first-dir/defig.o
15387 ${QUESTION} first-dir/envig.c
15388 ${QUESTION} first-dir/rootig.c
15389 ${QUESTION} second-dir/.cvsignore
15390 ${QUESTION} second-dir/notig.c"
15392 echo yes | dotest ignore-14 "${testcvs} release -d first-dir" \
15393 "${QUESTION} \.cvsignore
15394 You have \[0\] altered files in this repository.
15395 Are you sure you want to release (and delete) directory .first-dir': "
15397 echo add a line >>second-dir/foobar.c
15398 rm second-dir/notig.c second-dir/.cvsignore
15399 echo yes | dotest ignore-15 "${testcvs} release -d second-dir" \
15401 You have \[1\] altered files in this repository.
15402 Are you sure you want to release (and delete) directory .second-dir': "
15405 if $keep; then :; else
15407 rm -rf ${CVSROOT_DIRNAME}/ignore
15412 # Test that CVS _doesn't_ ignore files on branches because they were
15413 # added to the trunk.
15414 mkdir ignore-on-branch; cd ignore-on-branch
15415 mkdir $CVSROOT_DIRNAME/ignore-on-branch
15417 # create file1 & file2 on trunk
15418 dotest ignore-on-branch-setup-1 "$testcvs -q co -dsetup ignore-on-branch" ''
15421 dotest ignore-on-branch-setup-2 "$testcvs -q add file1" \
15422 "${PROG} add: use .${PROG} commit. to add this file permanently"
15423 dotest ignore-on-branch-setup-3 "$testcvs -q ci -mfile1 file1" \
15424 "RCS file: $CVSROOT_DIRNAME/ignore-on-branch/file1,v
15427 $CVSROOT_DIRNAME/ignore-on-branch/file1,v <-- file1
15428 initial revision: 1\.1
15430 dotest ignore-on-branch-setup-4 "$testcvs -q tag -b branch" 'T file1'
15432 dotest ignore-on-branch-setup-5 "$testcvs -q add file2" \
15433 "${PROG} add: use .${PROG} commit. to add this file permanently"
15434 dotest ignore-on-branch-setup-6 "$testcvs -q ci -mtrunk file2" \
15435 "RCS file: $CVSROOT_DIRNAME/ignore-on-branch/file2,v
15438 $CVSROOT_DIRNAME/ignore-on-branch/file2,v <-- file2
15439 initial revision: 1\.1
15444 # Check out branch.
15446 # - This was the original failure case - file2 would not be flagged
15448 dotest ignore-on-branch-1 "$testcvs -q co -rbranch ignore-on-branch" \
15449 'U ignore-on-branch/file1'
15450 cd ignore-on-branch
15451 echo file2 on branch >file2
15452 dotest ignore-on-branch-2 "$testcvs -nq update" '? file2'
15454 # Now set up for a join. One of the original fixes for this would
15455 # print out a 'U' and a '?' during a join which added a file.
15457 dotest ignore-on-branch-3 "$testcvs -q tag -b branch2" \
15461 dotest ignore-on-branch-3 "$testcvs -q tag -b branch2" 'T file1'
15463 dotest ignore-on-branch-4 "$testcvs -q add file2" \
15464 "${PROG} add: use .${PROG} commit. to add this file permanently"
15465 dotest ignore-on-branch-5 "$testcvs -q ci -mbranch file2" \
15466 "Checking in file2;
15467 $CVSROOT_DIRNAME/ignore-on-branch/file2,v <-- file2
15468 new revision: 1\.1\.2\.1; previous revision: 1\.1
15470 dotest ignore-on-branch-6 "$testcvs -q up -rbranch2" \
15471 "${PROG} update: file2 is no longer in the repository"
15472 dotest ignore-on-branch-7 "$testcvs -q up -jbranch" 'U file2'
15475 if $keep; then :; else
15476 rm -r ignore-on-branch
15477 rm -rf $CVSROOT_DIRNAME/ignore-on-branch
15482 # Test cvs's ability to handle binary files.
15483 # List of binary file tests:
15484 # * conflicts, "cvs admin": binfiles
15485 # * branching and joining: binfiles2
15486 # * adding and removing files: binfiles3
15487 # * -k wrappers: binwrap, binwrap2, binwrap3
15488 # * "cvs import" and wrappers: binwrap, binwrap2, binwrap3
15489 # * -k option to "cvs import": none yet, as far as I know.
15490 mkdir ${CVSROOT_DIRNAME}/first-dir
15492 dotest binfiles-1 "${testcvs} -q co first-dir" ''
15493 ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
15494 </dev/null | ${TR} '@' '\000' >binfile.dat
15495 cat binfile.dat binfile.dat >binfile2.dat
15497 cp ../binfile.dat binfile
15498 dotest binfiles-2 "${testcvs} add -kb binfile" \
15499 "${PROG}"' add: scheduling file `binfile'\'' for addition
15500 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
15501 dotest binfiles-3 "${testcvs} -q ci -m add-it" \
15502 "RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
15504 Checking in binfile;
15505 ${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
15506 initial revision: 1\.1
15510 dotest binfiles-4 "${testcvs} -q co first-dir" 'U first-dir/binfile'
15512 dotest binfiles-5 "cmp ../../1/binfile.dat binfile" ''
15513 # Testing that sticky options is -kb is the closest thing we have
15514 # to testing that binary files work right on non-unix machines
15515 # (until there is automated testing for such machines, of course).
15516 dotest binfiles-5.5 "${testcvs} status binfile" \
15517 "===================================================================
15518 File: binfile Status: Up-to-date
15520 Working revision: 1\.1.*
15521 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
15523 Sticky Date: (none)
15524 Sticky Options: -kb"
15526 # Test whether the default options from the RCS file are
15527 # also used when operating on files instead of whole
15531 dotest binfiles-5.5b0 "${testcvs} -q co first-dir/binfile" \
15532 'U first-dir/binfile'
15534 dotest binfiles-5.5b1 "${testcvs} status binfile" \
15535 "===================================================================
15536 File: binfile Status: Up-to-date
15538 Working revision: 1\.1.*
15539 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
15541 Sticky Date: (none)
15542 Sticky Options: -kb"
15547 cp ../../1/binfile2.dat binfile
15548 dotest binfiles-6 "${testcvs} -q ci -m modify-it" \
15549 "Checking in binfile;
15550 ${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
15551 new revision: 1\.2; previous revision: 1\.1
15553 cd ../../1/first-dir
15554 dotest binfiles-7 "${testcvs} -q update" '[UP] binfile'
15555 dotest binfiles-8 "cmp ../binfile2.dat binfile" ''
15557 # Now test handling of conflicts with binary files.
15558 cp ../binfile.dat binfile
15559 dotest binfiles-con0 "${testcvs} -q ci -m modify-it" \
15560 "Checking in binfile;
15561 ${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
15562 new revision: 1\.3; previous revision: 1\.2
15564 cd ../../2/first-dir
15565 echo 'edits in dir 2' >binfile
15566 dotest binfiles-con1 "${testcvs} -q update" \
15568 ${PROG} update: nonmergeable file needs merge
15569 ${PROG} update: revision 1\.3 from repository is now in binfile
15570 ${PROG} update: file from working directory is now in \.#binfile\.1\.2
15572 dotest binfiles-con2 "cmp binfile ../../1/binfile.dat" ''
15573 dotest binfiles-con3 "cat .#binfile.1.2" 'edits in dir 2'
15575 cp ../../1/binfile2.dat binfile
15576 dotest binfiles-con4 "${testcvs} -q ci -m resolve-it" \
15577 "Checking in binfile;
15578 ${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
15579 new revision: 1\.4; previous revision: 1\.3
15581 cd ../../1/first-dir
15582 dotest binfiles-con5 "${testcvs} -q update" '[UP] binfile'
15584 dotest binfiles-9 "${testcvs} -q update -A" ''
15585 dotest binfiles-10 "${testcvs} -q update -kk" '[UP] binfile'
15586 dotest binfiles-11 "${testcvs} -q update" ''
15587 dotest binfiles-12 "${testcvs} -q update -A" '[UP] binfile'
15588 dotest binfiles-13 "${testcvs} -q update -A" ''
15594 dotest binfiles-13a0 "${testcvs} -q co -r HEAD first-dir" \
15595 'U first-dir/binfile'
15597 dotest binfiles-13a1 "${testcvs} status binfile" \
15598 "===================================================================
15599 File: binfile Status: Up-to-date
15601 Working revision: 1\.4.*
15602 Repository revision: 1\.4 ${CVSROOT_DIRNAME}/first-dir/binfile,v
15603 Sticky Tag: HEAD (revision: 1\.4)
15604 Sticky Date: (none)
15605 Sticky Options: -kb"
15610 echo 'this file is $''RCSfile$' >binfile
15611 dotest binfiles-14a "${testcvs} -q ci -m modify-it" \
15612 "Checking in binfile;
15613 ${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
15614 new revision: 1\.5; previous revision: 1\.4
15616 dotest binfiles-14b "cat binfile" 'this file is $''RCSfile$'
15617 # See binfiles-5.5 for discussion of -kb.
15618 dotest binfiles-14c "${testcvs} status binfile" \
15619 "===================================================================
15620 File: binfile Status: Up-to-date
15622 Working revision: 1\.5.*
15623 Repository revision: 1\.5 ${CVSROOT_DIRNAME}/first-dir/binfile,v
15625 Sticky Date: (none)
15626 Sticky Options: -kb"
15627 dotest binfiles-14d "${testcvs} admin -kv binfile" \
15628 "RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
15630 # cvs admin doesn't change the checked-out file or its sticky
15631 # kopts. There probably should be a way which does (but
15632 # what if the file is modified? And do we try to version
15633 # control the kopt setting?)
15634 dotest binfiles-14e "cat binfile" 'this file is $''RCSfile$'
15635 dotest binfiles-14f "${testcvs} status binfile" \
15636 "===================================================================
15637 File: binfile Status: Up-to-date
15639 Working revision: 1\.5.*
15640 Repository revision: 1\.5 ${CVSROOT_DIRNAME}/first-dir/binfile,v
15642 Sticky Date: (none)
15643 Sticky Options: -kb"
15644 dotest binfiles-14g "${testcvs} -q update -A" '[UP] binfile'
15645 dotest binfiles-14h "cat binfile" 'this file is binfile,v'
15646 dotest binfiles-14i "${testcvs} status binfile" \
15647 "===================================================================
15648 File: binfile Status: Up-to-date
15650 Working revision: 1\.5.*
15651 Repository revision: 1\.5 ${CVSROOT_DIRNAME}/first-dir/binfile,v
15653 Sticky Date: (none)
15654 Sticky Options: -kv"
15656 # Do sticky options work when used with 'cvs update'?
15657 echo "Not a binary file." > nibfile
15658 dotest binfiles-sticky1 "${testcvs} -q add nibfile" \
15659 "${PROG} add: use .${PROG} commit. to add this file permanently"
15660 dotest binfiles-sticky2 "${testcvs} -q ci -m add-it nibfile" \
15661 "RCS file: ${CVSROOT_DIRNAME}/first-dir/nibfile,v
15663 Checking in nibfile;
15664 ${CVSROOT_DIRNAME}/first-dir/nibfile,v <-- nibfile
15665 initial revision: 1\.1
15667 dotest binfiles-sticky3 "${testcvs} -q update -kb nibfile" \
15669 dotest binfiles-sticky4 "${testcvs} -q status nibfile" \
15670 "===================================================================
15671 File: nibfile Status: Up-to-date
15673 Working revision: 1\.1.*
15674 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/nibfile,v
15676 Sticky Date: (none)
15677 Sticky Options: -kb"
15679 # Now test that -A can clear the sticky option.
15680 dotest binfiles-sticky5 "${testcvs} -q update -A nibfile" \
15682 dotest binfiles-sticky6 "${testcvs} -q status nibfile" \
15683 "===================================================================
15684 File: nibfile Status: Up-to-date
15686 Working revision: 1\.1.*
15687 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/nibfile,v
15689 Sticky Date: (none)
15690 Sticky Options: (none)"
15691 dotest binfiles-15 "${testcvs} -q admin -kb nibfile" \
15692 "RCS file: ${CVSROOT_DIRNAME}/first-dir/nibfile,v
15694 dotest binfiles-16 "${testcvs} -q update nibfile" "[UP] nibfile"
15695 dotest binfiles-17 "${testcvs} -q status nibfile" \
15696 "===================================================================
15697 File: nibfile Status: Up-to-date
15699 Working revision: 1\.1.*
15700 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/nibfile,v
15702 Sticky Date: (none)
15703 Sticky Options: -kb"
15705 dotest binfiles-o1 "${testcvs} admin -o1.3:: binfile" \
15706 "RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
15707 deleting revision 1\.5
15708 deleting revision 1\.4
15710 dotest binfiles-o2 "${testcvs} admin -o::1.3 binfile" \
15711 "RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
15712 deleting revision 1\.2
15713 deleting revision 1\.1
15715 dotest binfiles-o3 "${testcvs} -q log -h -N binfile" "
15716 RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
15717 Working file: binfile
15722 keyword substitution: v
15724 ============================================================================="
15726 # Check that the contents were right. This isn't the hard case
15727 # (in which RCS_delete_revs does a diff), but might as well.
15728 dotest binfiles-o4 "${testcvs} -q update binfile" "U binfile"
15729 dotest binfiles-o5 "cmp binfile ../../1/binfile.dat" ""
15732 rm -rf ${CVSROOT_DIRNAME}/first-dir
15738 # Test cvs's ability to handle binary files, particularly branching
15739 # and joining. The key thing we are worrying about is that CVS
15740 # doesn't print "cannot merge binary files" or some such, in
15741 # situations where no merging is required.
15742 # See also "join" which does this with non-binary files.
15744 # Cases (we are merging from the branch to the trunk):
15745 # binfile.dat) File added on branch, not on trunk.
15746 # File should be marked for addition.
15747 # brmod) File modified on branch, not on trunk.
15748 # File should be copied over to trunk (no merging is needed).
15749 # brmod-trmod) File modified on branch, also on trunk.
15750 # This is a conflict. Present the user with both files and
15751 # let them figure it out.
15752 # brmod-wdmod) File modified on branch, not modified in the trunk
15753 # repository, but modified in the (trunk) working directory.
15754 # This is also a conflict.
15756 mkdir ${CVSROOT_DIRNAME}/first-dir
15758 dotest binfiles2-1 "${testcvs} -q co first-dir" ''
15761 # The most important thing here is that binfile, binfile2, &c
15762 # each be distinct from each other. We also make sure to include
15763 # a few likely end-of-line patterns to make sure nothing is
15764 # being munged as if in text mode.
15765 ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
15766 </dev/null | ${TR} '@' '\000' >../binfile
15767 cat ../binfile ../binfile >../binfile2
15768 cat ../binfile2 ../binfile >../binfile3
15770 # FIXCVS: unless a branch has at least one file on it,
15771 # tag_check_valid won't know it exists. So if brmod didn't
15772 # exist, we would have to invent it.
15773 cp ../binfile brmod
15774 cp ../binfile brmod-trmod
15775 cp ../binfile brmod-wdmod
15776 dotest binfiles2-1a \
15777 "${testcvs} add -kb brmod brmod-trmod brmod-wdmod" \
15778 "${PROG} add: scheduling file .brmod. for addition
15779 ${PROG} add: scheduling file .brmod-trmod. for addition
15780 ${PROG} add: scheduling file .brmod-wdmod. for addition
15781 ${PROG} add: use .${PROG} commit. to add these files permanently"
15782 dotest binfiles2-1b "${testcvs} -q ci -m add" \
15783 "RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod,v
15786 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
15787 initial revision: 1\.1
15789 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
15791 Checking in brmod-trmod;
15792 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
15793 initial revision: 1\.1
15795 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v
15797 Checking in brmod-wdmod;
15798 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
15799 initial revision: 1\.1
15801 dotest binfiles2-2 "${testcvs} -q tag -b br" 'T brmod
15804 dotest binfiles2-3 "${testcvs} -q update -r br" ''
15805 cp ../binfile binfile.dat
15806 dotest binfiles2-4 "${testcvs} add -kb binfile.dat" \
15807 "${PROG} add: scheduling file .binfile\.dat. for addition on branch .br.
15808 ${PROG} add: use .${PROG} commit. to add this file permanently"
15809 cp ../binfile2 brmod
15810 cp ../binfile2 brmod-trmod
15811 cp ../binfile2 brmod-wdmod
15812 dotest binfiles2-5 "${testcvs} -q ci -m br-changes" \
15813 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/binfile\.dat,v
15815 Checking in binfile\.dat;
15816 ${CVSROOT_DIRNAME}/first-dir/Attic/binfile\.dat,v <-- binfile\.dat
15817 new revision: 1\.1\.2\.1; previous revision: 1\.1
15820 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
15821 new revision: 1\.1\.2\.1; previous revision: 1\.1
15823 Checking in brmod-trmod;
15824 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
15825 new revision: 1\.1\.2\.1; previous revision: 1\.1
15827 Checking in brmod-wdmod;
15828 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
15829 new revision: 1\.1\.2\.1; previous revision: 1\.1
15831 dotest binfiles2-6 "${testcvs} -q update -A" \
15832 "${PROG} update: binfile\.dat is no longer in the repository
15836 dotest_fail binfiles2-7 "test -f binfile.dat" ''
15837 dotest binfiles2-7-brmod "cmp ../binfile brmod"
15838 cp ../binfile3 brmod-trmod
15839 dotest binfiles2-7a "${testcvs} -q ci -m tr-modify" \
15840 "Checking in brmod-trmod;
15841 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
15842 new revision: 1\.2; previous revision: 1\.1
15844 cp ../binfile3 brmod-wdmod
15846 dotest binfiles2-8 "${testcvs} -q update -j br" \
15849 ${PROG} update: nonmergeable file needs merge
15850 ${PROG} update: revision 1.1.2.1 from repository is now in brmod-trmod
15851 ${PROG} update: file from working directory is now in .#brmod-trmod.1.2
15854 ${PROG} update: nonmergeable file needs merge
15855 ${PROG} update: revision 1.1.2.1 from repository is now in brmod-wdmod
15856 ${PROG} update: file from working directory is now in .#brmod-wdmod.1.1
15859 dotest binfiles2-9 "cmp ../binfile binfile.dat"
15860 dotest binfiles2-9-brmod "cmp ../binfile2 brmod"
15861 dotest binfiles2-9-brmod-trmod "cmp ../binfile2 brmod-trmod"
15862 dotest binfiles2-9-brmod-trmod "cmp ../binfile2 brmod-wdmod"
15863 dotest binfiles2-9a-brmod-trmod "cmp ../binfile3 .#brmod-trmod.1.2"
15864 dotest binfiles2-9a-brmod-wdmod "cmp ../binfile3 .#brmod-wdmod.1.1"
15866 # Test that everything was properly scheduled.
15867 dotest binfiles2-10 "${testcvs} -q ci -m checkin" \
15868 "Checking in binfile\.dat;
15869 ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
15870 new revision: 1\.2; previous revision: 1\.1
15873 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
15874 new revision: 1\.2; previous revision: 1\.1
15876 Checking in brmod-trmod;
15877 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
15878 new revision: 1\.3; previous revision: 1\.2
15880 Checking in brmod-wdmod;
15881 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
15882 new revision: 1\.2; previous revision: 1\.1
15885 dotest_fail binfiles2-o1 "${testcvs} -q admin -o :1.2 brmod-trmod" \
15886 "RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
15887 deleting revision 1\.2
15888 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v: can't remove branch point 1\.1
15889 ${PROG} admin: RCS file for .brmod-trmod. not modified\."
15890 dotest binfiles2-o2 "${testcvs} -q admin -o 1.1.2.1: brmod-trmod" \
15891 "RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
15892 deleting revision 1\.1\.2\.1
15894 dotest binfiles2-o3 "${testcvs} -q admin -o :1.2 brmod-trmod" \
15895 "RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
15896 deleting revision 1\.2
15897 deleting revision 1\.1
15899 dotest binfiles2-o4 "${testcvs} -q log -N brmod-trmod" "
15900 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
15901 Working file: brmod-trmod
15906 keyword substitution: b
15907 total revisions: 1; selected revisions: 1
15909 ----------------------------
15911 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
15913 ============================================================================="
15917 rm -rf ${CVSROOT_DIRNAME}/first-dir
15922 # More binary file tests, especially removing, adding, &c.
15923 # See "binfiles" for a list of binary file tests.
15924 mkdir ${CVSROOT_DIRNAME}/first-dir
15926 dotest binfiles3-1 "${testcvs} -q co first-dir" ''
15927 ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
15928 </dev/null | ${TR} '@' '\000' >binfile.dat
15931 dotest binfiles3-2 "${testcvs} add file1" \
15932 "${PROG} add: scheduling file .file1. for addition
15933 ${PROG} add: use .${PROG} commit. to add this file permanently"
15934 dotest binfiles3-3 "${testcvs} -q ci -m add-it" \
15935 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
15938 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15939 initial revision: 1\.1
15942 dotest binfiles3-4 "${testcvs} rm file1" \
15943 "${PROG} remove: scheduling .file1. for removal
15944 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
15945 dotest binfiles3-5 "${testcvs} -q ci -m remove-it" \
15947 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15948 new revision: delete; previous revision: 1\.1
15950 cp ../binfile.dat file1
15951 dotest binfiles3-6 "${testcvs} add -kb file1" \
15952 "${PROG} add: Re-adding file .file1. (in place of dead revision 1\.2)\.
15953 ${PROG} add: use .${PROG} commit. to add this file permanently"
15954 # The idea behind this test is to make sure that the file
15955 # gets opened in binary mode to send to "cvs ci".
15956 dotest binfiles3-6a "cat CVS/Entries" \
15957 "/file1/0/[A-Za-z0-9 :]*/-kb/
15959 # TODO: This just tests the case where the old keyword
15960 # expansion mode is the default (RCS_getexpand == NULL
15961 # in checkaddfile()); should also test the case in which
15962 # we are changing it from one non-default value to another.
15963 dotest binfiles3-7 "${testcvs} -q ci -m readd-it" \
15964 "${PROG} commit: changing keyword expansion mode to -kb
15966 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15967 new revision: 1\.3; previous revision: 1\.2
15969 dotest binfiles3-8 "${testcvs} -q log -h -N file1" "
15970 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
15971 Working file: file1
15976 keyword substitution: b
15978 ============================================================================="
15980 # OK, now test admin -o on a binary file. See "admin"
15981 # test for a more complete list of admin -o tests.
15982 cp ${TESTDIR}/1/binfile.dat ${TESTDIR}/1/binfile4.dat
15983 echo '%%$$##@@!!jjiiuull' | ${TR} j '\000' >>${TESTDIR}/1/binfile4.dat
15984 cp ${TESTDIR}/1/binfile4.dat ${TESTDIR}/1/binfile5.dat
15985 echo 'aawwee%$$##@@!!jjil' | ${TR} w '\000' >>${TESTDIR}/1/binfile5.dat
15987 cp ../binfile4.dat file1
15988 dotest binfiles3-9 "${testcvs} -q ci -m change" \
15989 "Checking in file1;
15990 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15991 new revision: 1\.4; previous revision: 1\.3
15993 cp ../binfile5.dat file1
15994 dotest binfiles3-10 "${testcvs} -q ci -m change" \
15995 "Checking in file1;
15996 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15997 new revision: 1\.5; previous revision: 1\.4
15999 dotest binfiles3-11 "${testcvs} admin -o 1.3::1.5 file1" \
16000 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
16001 deleting revision 1\.4
16003 dotest binfiles3-12 "${testcvs} -q update -r 1.3 file1" "U file1"
16004 dotest binfiles3-13 "cmp file1 ${TESTDIR}/1/binfile.dat" ""
16008 rm -rf ${CVSROOT_DIRNAME}/first-dir
16012 # See comment at "mwrap" test for list of other wrappers tests.
16013 # Test cvs's ability to handle nonmergeable files specified with
16014 # -m 'COPY' in wrappers. Similar to the binfiles2 test,
16015 # which tests the same thing for binary files
16016 # (which are non-mergeable in the same sense).
16018 # Cases (we are merging from the branch to the trunk):
16019 # brmod) File modified on branch, not on trunk.
16020 # File should be copied over to trunk (no merging is needed).
16021 # brmod-trmod) File modified on branch, also on trunk.
16022 # This is a conflict. Present the user with both files and
16023 # let them figure it out.
16024 # brmod-wdmod) File modified on branch, not modified in the trunk
16025 # repository, but modified in the (trunk) working directory.
16026 # This is also a conflict.
16028 # For the moment, remote CVS can't pass wrappers from CVSWRAPPERS
16029 # (see wrap_send). So skip these tests for remote.
16030 if $remote; then :; else
16032 mkdir ${CVSROOT_DIRNAME}/first-dir
16034 dotest mcopy-1 "${testcvs} -q co first-dir" ''
16037 # FIXCVS: unless a branch has at least one file on it,
16038 # tag_check_valid won't know it exists. So if brmod didn't
16039 # exist, we would have to invent it.
16040 echo 'brmod initial contents' >brmod
16041 echo 'brmod-trmod initial contents' >brmod-trmod
16042 echo 'brmod-wdmod initial contents' >brmod-wdmod
16043 echo "* -m 'COPY'" >.cvswrappers
16045 "${testcvs} add .cvswrappers brmod brmod-trmod brmod-wdmod" \
16046 "${PROG} add: scheduling file .\.cvswrappers. for addition
16047 ${PROG} add: scheduling file .brmod. for addition
16048 ${PROG} add: scheduling file .brmod-trmod. for addition
16049 ${PROG} add: scheduling file .brmod-wdmod. for addition
16050 ${PROG} add: use .${PROG} commit. to add these files permanently"
16051 dotest mcopy-1b "${testcvs} -q ci -m add" \
16052 "RCS file: ${CVSROOT_DIRNAME}/first-dir/\.cvswrappers,v
16054 Checking in \.cvswrappers;
16055 ${CVSROOT_DIRNAME}/first-dir/\.cvswrappers,v <-- \.cvswrappers
16056 initial revision: 1\.1
16058 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod,v
16061 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
16062 initial revision: 1\.1
16064 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
16066 Checking in brmod-trmod;
16067 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
16068 initial revision: 1\.1
16070 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v
16072 Checking in brmod-wdmod;
16073 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
16074 initial revision: 1\.1
16077 # NOTE: .cvswrappers files are broken (see comment in
16078 # src/wrapper.c). So doing everything via the environment
16079 # variable is a workaround. Better would be to test them
16081 CVSWRAPPERS="* -m 'COPY'"
16083 dotest mcopy-2 "${testcvs} -q tag -b br" 'T \.cvswrappers
16087 dotest mcopy-3 "${testcvs} -q update -r br" ''
16088 echo 'modify brmod on br' >brmod
16089 echo 'modify brmod-trmod on br' >brmod-trmod
16090 echo 'modify brmod-wdmod on br' >brmod-wdmod
16091 dotest mcopy-5 "${testcvs} -q ci -m br-changes" \
16092 "Checking in brmod;
16093 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
16094 new revision: 1\.1\.2\.1; previous revision: 1\.1
16096 Checking in brmod-trmod;
16097 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
16098 new revision: 1\.1\.2\.1; previous revision: 1\.1
16100 Checking in brmod-wdmod;
16101 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
16102 new revision: 1\.1\.2\.1; previous revision: 1\.1
16104 dotest mcopy-6 "${testcvs} -q update -A" \
16108 dotest mcopy-7 "cat brmod brmod-trmod brmod-wdmod" \
16109 "brmod initial contents
16110 brmod-trmod initial contents
16111 brmod-wdmod initial contents"
16113 echo 'modify brmod-trmod again on trunk' >brmod-trmod
16114 dotest mcopy-7a "${testcvs} -q ci -m tr-modify" \
16115 "Checking in brmod-trmod;
16116 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
16117 new revision: 1\.2; previous revision: 1\.1
16119 echo 'modify brmod-wdmod in working dir' >brmod-wdmod
16121 dotest mcopy-8 "${testcvs} -q update -j br" \
16123 ${PROG} update: nonmergeable file needs merge
16124 ${PROG} update: revision 1.1.2.1 from repository is now in brmod-trmod
16125 ${PROG} update: file from working directory is now in .#brmod-trmod.1.2
16128 ${PROG} update: nonmergeable file needs merge
16129 ${PROG} update: revision 1.1.2.1 from repository is now in brmod-wdmod
16130 ${PROG} update: file from working directory is now in .#brmod-wdmod.1.1
16133 dotest mcopy-9 "cat brmod brmod-trmod brmod-wdmod" \
16134 "modify brmod on br
16135 modify brmod-trmod on br
16136 modify brmod-wdmod on br"
16137 dotest mcopy-9a "cat .#brmod-trmod.1.2 .#brmod-wdmod.1.1" \
16138 "modify brmod-trmod again on trunk
16139 modify brmod-wdmod in working dir"
16141 # Test that everything was properly scheduled.
16142 dotest mcopy-10 "${testcvs} -q ci -m checkin" \
16143 "Checking in brmod;
16144 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
16145 new revision: 1\.2; previous revision: 1\.1
16147 Checking in brmod-trmod;
16148 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
16149 new revision: 1\.3; previous revision: 1\.2
16151 Checking in brmod-wdmod;
16152 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
16153 new revision: 1\.2; previous revision: 1\.1
16158 rm -rf ${CVSROOT_DIRNAME}/first-dir
16162 fi # end of tests to be skipped for remote
16167 # Test the ability to specify binary-ness based on file name.
16168 # See "mwrap" for a list of other wrappers tests.
16170 mkdir dir-to-import
16172 touch foo.c foo.exe
16174 # While we're here, test for rejection of duplicate tag names.
16175 dotest_fail binwrap-0 \
16176 "${testcvs} import -m msg -I ! first-dir dup dup" \
16177 "${PROG} \[[a-z]* aborted\]: tag .dup. was specified more than once"
16179 if ${testcvs} import -m message -I ! -W "*.exe -k 'b'" \
16180 first-dir tag1 tag2 >>${LOGFILE}; then
16186 rm -r dir-to-import
16187 dotest binwrap-2 "${testcvs} -q co first-dir" 'U first-dir/foo.c
16188 U first-dir/foo.exe'
16189 dotest binwrap-3 "${testcvs} -q status first-dir" \
16190 "===================================================================
16191 File: foo\.c Status: Up-to-date
16193 Working revision: 1\.1\.1\.1.*
16194 Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
16196 Sticky Date: (none)
16197 Sticky Options: (none)
16199 ===================================================================
16200 File: foo\.exe Status: Up-to-date
16202 Working revision: 1\.1\.1\.1.*
16203 Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.exe,v
16205 Sticky Date: (none)
16206 Sticky Options: -kb"
16208 rm -rf ${CVSROOT_DIRNAME}/first-dir
16212 # Test the ability to specify binary-ness based on file name.
16213 # See "mwrap" for a list of other wrappers tests.
16215 mkdir dir-to-import
16217 touch foo.c foo.exe
16219 # Specify that all files are binary except *.c.
16220 # The order seems to matter, with the earlier rules taking
16221 # precedence. I'm not sure whether that is good or not,
16222 # but it is the current behavior.
16223 if ${testcvs} import -m message -I ! \
16224 -W "*.c -k 'o'" -W "* -k 'b'" \
16225 first-dir tag1 tag2 >>${LOGFILE}; then
16231 rm -r dir-to-import
16232 dotest binwrap2-2 "${testcvs} -q co first-dir" 'U first-dir/foo.c
16233 U first-dir/foo.exe'
16234 dotest binwrap2-3 "${testcvs} -q status first-dir" \
16235 "===================================================================
16236 File: foo\.c Status: Up-to-date
16238 Working revision: 1\.1\.1\.1.*
16239 Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
16241 Sticky Date: (none)
16242 Sticky Options: -ko
16244 ===================================================================
16245 File: foo\.exe Status: Up-to-date
16247 Working revision: 1\.1\.1\.1.*
16248 Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.exe,v
16250 Sticky Date: (none)
16251 Sticky Options: -kb"
16253 rm -rf ${CVSROOT_DIRNAME}/first-dir
16257 # Test communication of file-specified -k wrappers between
16258 # client and server, in `import':
16260 # 1. Set up a directory tree, populate it with files.
16261 # 2. Give each directory a different .cvswrappers file.
16262 # 3. Give the server its own .cvswrappers file.
16263 # 4. Import the whole tree, see if the right files got set
16266 # The tree has a top ("0th") level, and two subdirs, sub1/
16267 # and sub2/; sub2/ contains directory subsub/. Every
16268 # directory has a .cvswrappers file as well as regular
16271 # In the file names, "foo-b.*" should end up binary, and
16272 # "foo-t.*" should end up text. Don't worry about the two
16273 # letter extensions; they're just there to help me keep
16276 # Here's the directory tree:
16286 # .cvswrappers .cvswrappers
16287 # foo-b.c1 foo-b.sb
16288 # foo-b.sb foo-b.st
16289 # foo-t.c0 foo-t.c0
16290 # foo-t.st foo-t.c1
16303 binwrap3_line1="This is a test file "
16304 binwrap3_line2="containing little of use "
16305 binwrap3_line3="except this non-haiku"
16307 binwrap3_text="${binwrap3_line1}${binwrap3_line2}${binwrap3_line3}"
16311 # On Windows, we can't check out CVSROOT, because the case
16312 # insensitivity means that this conflicts with cvsroot.
16316 mkdir binwrap3 # the 0th dir
16317 mkdir binwrap3/sub1
16318 mkdir binwrap3/sub2
16319 mkdir binwrap3/sub2/subsub
16321 echo "bar*" > binwrap3/.cvswrappers
16322 echo "*.c0 -k 'b'" >> binwrap3/.cvswrappers
16323 echo "whatever -k 'b'" >> binwrap3/.cvswrappers
16324 echo ${binwrap3_text} > binwrap3/foo-b.c0
16325 echo ${binwrap3_text} > binwrap3/bar-t.c0
16326 echo ${binwrap3_text} > binwrap3/foo-b.sb
16327 echo ${binwrap3_text} > binwrap3/foo-t.sb
16328 echo ${binwrap3_text} > binwrap3/foo-t.c1
16329 echo ${binwrap3_text} > binwrap3/foo-t.st
16331 echo "bar* -k 'kv'" > binwrap3/sub1/.cvswrappers
16332 echo "*.c1 -k 'b'" >> binwrap3/sub1/.cvswrappers
16333 echo "whatever -k 'b'" >> binwrap3/sub1/.cvswrappers
16334 echo ${binwrap3_text} > binwrap3/sub1/foo-b.c1
16335 echo ${binwrap3_text} > binwrap3/sub1/bar-t.c1
16336 echo ${binwrap3_text} > binwrap3/sub1/foo-b.sb
16337 echo ${binwrap3_text} > binwrap3/sub1/foo-t.sb
16338 echo ${binwrap3_text} > binwrap3/sub1/foo-t.c0
16339 echo ${binwrap3_text} > binwrap3/sub1/foo-t.st
16341 echo "bar*" > binwrap3/sub2/.cvswrappers
16342 echo "*.st -k 'b'" >> binwrap3/sub2/.cvswrappers
16343 echo ${binwrap3_text} > binwrap3/sub2/foo-b.sb
16344 echo ${binwrap3_text} > binwrap3/sub2/foo-t.sb
16345 echo ${binwrap3_text} > binwrap3/sub2/foo-b.st
16346 echo ${binwrap3_text} > binwrap3/sub2/bar-t.st
16347 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c0
16348 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c1
16349 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c2
16350 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c3
16352 echo "bar* -k 'kv'" > binwrap3/sub2/subsub/.cvswrappers
16353 echo "*.c3 -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
16354 echo "foo -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
16355 echo "c0* -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
16356 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-b.c3
16357 echo ${binwrap3_text} > binwrap3/sub2/subsub/bar-t.c3
16358 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-b.sb
16359 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.sb
16360 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c0
16361 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c1
16362 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c2
16363 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.st
16365 # Now set up CVSROOT/cvswrappers, the easy way:
16366 dotest binwrap3-1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
16368 # This destroys anything currently in cvswrappers, but
16369 # presumably other tests will take care of it themselves if
16370 # they use cvswrappers:
16371 echo "foo-t.sb" > cvswrappers
16372 echo "foo*.sb -k 'b'" >> cvswrappers
16373 dotest binwrap3-2 "${testcvs} -q ci -m cvswrappers-mod" \
16374 "Checking in cvswrappers;
16375 ${CVSROOT_DIRNAME}/CVSROOT/cvswrappers,v <-- cvswrappers
16376 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16378 ${PROG} commit: Rebuilding administrative file database"
16381 # Avoid environmental interference
16382 CVSWRAPPERS_save=${CVSWRAPPERS}
16387 # Not importing .cvswrappers tests whether the client is really
16388 # letting the server know "honestly" whether the file is binary,
16389 # rather than just letting the server see the .cvswrappers file.
16390 dotest binwrap3-2a \
16391 "${testcvs} import -m . -I .cvswrappers binwrap3 tag1 tag2" \
16394 # OK, now test "cvs add".
16397 dotest binwrap3-2b "${testcvs} co binwrap3" "${DOTSTAR}"
16400 echo "*.newbin -k 'b'" > .cvswrappers
16401 echo .cvswrappers >.cvsignore
16402 echo .cvsignore >>.cvsignore
16403 touch file1.newbin file1.txt
16404 dotest binwrap3-2c "${testcvs} add file1.newbin file1.txt" \
16405 "${PROG} add: scheduling file .file1\.newbin. for addition
16406 ${PROG} add: scheduling file .file1\.txt. for addition
16407 ${PROG} add: use .${PROG} commit. to add these files permanently"
16408 dotest binwrap3-2d "${testcvs} -q ci -m add" \
16409 "RCS file: ${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.newbin,v
16411 Checking in file1\.newbin;
16412 ${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.newbin,v <-- file1\.newbin
16413 initial revision: 1\.1
16415 RCS file: ${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.txt,v
16417 Checking in file1\.txt;
16418 ${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.txt,v <-- file1\.txt
16419 initial revision: 1\.1
16423 # Now check out the module and see which files are binary.
16426 dotest binwrap3-3 "${testcvs} co binwrap3" "${DOTSTAR}"
16429 # Running "cvs status" and matching output is too
16430 # error-prone, too likely to falsely fail. Instead, we'll
16431 # just grep the Entries lines:
16433 dotest binwrap3-top1 "grep foo-b.c0 ./CVS/Entries" \
16434 "/foo-b.c0/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
16436 dotest binwrap3-top2 "grep foo-b.sb ./CVS/Entries" \
16437 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
16439 dotest binwrap3-top3 "grep foo-t.c1 ./CVS/Entries" \
16440 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
16442 dotest binwrap3-top4 "grep foo-t.st ./CVS/Entries" \
16443 "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
16445 dotest binwrap3-top5 "grep foo-t.sb ./CVS/Entries" \
16446 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//"
16448 dotest binwrap3-top6 "grep bar-t.c0 ./CVS/Entries" \
16449 "/bar-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
16451 dotest binwrap3-sub1-1 "grep foo-b.c1 sub1/CVS/Entries" \
16452 "/foo-b.c1/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
16454 dotest binwrap3-sub1-2 "grep foo-b.sb sub1/CVS/Entries" \
16455 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
16457 dotest binwrap3-sub1-3 "grep foo-t.c0 sub1/CVS/Entries" \
16458 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
16460 dotest binwrap3-sub1-4 "grep foo-t.st sub1/CVS/Entries" \
16461 "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
16463 dotest binwrap3-sub1-5 "grep foo-t.sb sub1/CVS/Entries" \
16464 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//"
16466 dotest binwrap3-sub1-6 "grep bar-t.c1 sub1/CVS/Entries" \
16467 "/bar-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
16469 dotest binwrap3-sub2-1 "grep foo-b.sb sub2/CVS/Entries" \
16470 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
16472 dotest binwrap3-sub2-2 "grep foo-b.st sub2/CVS/Entries" \
16473 "/foo-b.st/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
16475 dotest binwrap3-sub2-3 "grep foo-t.c0 sub2/CVS/Entries" \
16476 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
16478 dotest binwrap3-sub2-4 "grep foo-t.c1 sub2/CVS/Entries" \
16479 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
16481 dotest binwrap3-sub2-5 "grep foo-t.c2 sub2/CVS/Entries" \
16482 "/foo-t.c2/1.1.1.1/[A-Za-z0-9 :]*//"
16484 dotest binwrap3-sub2-6 "grep foo-t.c3 sub2/CVS/Entries" \
16485 "/foo-t.c3/1.1.1.1/[A-Za-z0-9 :]*//"
16487 dotest binwrap3-sub2-7 "grep foo-t.sb sub2/CVS/Entries" \
16488 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//"
16490 dotest binwrap3-sub2-8 "grep bar-t.st sub2/CVS/Entries" \
16491 "/bar-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
16493 dotest binwrap3-subsub1 "grep foo-b.c3 sub2/subsub/CVS/Entries" \
16494 "/foo-b.c3/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
16496 dotest binwrap3-subsub2 "grep foo-b.sb sub2/subsub/CVS/Entries" \
16497 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
16499 dotest binwrap3-subsub3 "grep foo-t.c0 sub2/subsub/CVS/Entries" \
16500 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
16502 dotest binwrap3-subsub4 "grep foo-t.c1 sub2/subsub/CVS/Entries" \
16503 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
16505 dotest binwrap3-subsub5 "grep foo-t.c2 sub2/subsub/CVS/Entries" \
16506 "/foo-t.c2/1.1.1.1/[A-Za-z0-9 :]*//"
16508 dotest binwrap3-subsub6 "grep foo-t.st sub2/subsub/CVS/Entries" \
16509 "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
16511 dotest binwrap3-subsub7 "grep foo-t.sb sub2/subsub/CVS/Entries" \
16512 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//"
16514 dotest binwrap3-subsub8 "grep bar-t.c3 sub2/subsub/CVS/Entries" \
16515 "/bar-t.c3/1.1.1.1/[A-Za-z0-9 :]*//"
16517 dotest binwrap3-sub2-add1 "grep file1.newbin sub2/CVS/Entries" \
16518 "/file1.newbin/1.1/[A-Za-z0-9 :]*/-kb/"
16519 dotest binwrap3-sub2-add2 "grep file1.txt sub2/CVS/Entries" \
16520 "/file1.txt/1.1/[A-Za-z0-9 :]*//"
16522 # Restore and clean up
16524 rm -r binwrap3 CVSROOT
16527 rm -rf ${CVSROOT_DIRNAME}/binwrap3
16528 CVSWRAPPERS=${CVSWRAPPERS_save}
16532 # Tests of various wrappers features:
16533 # -m 'COPY' and cvs update: mwrap
16534 # -m 'COPY' and joining: mcopy
16535 # -k: binwrap, binwrap2
16536 # -t/-f: hasn't been written yet.
16538 # Tests of different ways of specifying wrappers:
16539 # CVSROOT/cvswrappers: mwrap
16540 # -W: binwrap, binwrap2
16541 # .cvswrappers in working directory, local: mcopy
16542 # CVSROOT/cvswrappers, .cvswrappers remote: binwrap3
16543 # CVSWRAPPERS environment variable: mcopy
16545 # This test is similar to binfiles-con1; -m 'COPY' specifies
16546 # non-mergeableness the same way that -kb does.
16548 # On Windows, we can't check out CVSROOT, because the case
16549 # insensitivity means that this conflicts with cvsroot.
16553 dotest mwrap-c1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
16555 echo "* -m 'COPY'" >>cvswrappers
16556 dotest mwrap-c2 "${testcvs} -q ci -m wrapper-mod" \
16557 "Checking in cvswrappers;
16558 ${CVSROOT_DIRNAME}/CVSROOT/cvswrappers,v <-- cvswrappers
16559 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16561 ${PROG} commit: Rebuilding administrative file database"
16564 dotest mwrap-1 "${testcvs} -q co -l ." ''
16566 dotest mwrap-2 "${testcvs} add first-dir" \
16567 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
16570 dotest mwrap-3 "${testcvs} add aa" \
16571 "${PROG} add: scheduling file .aa. for addition
16572 ${PROG} add: use .${PROG} commit. to add this file permanently"
16573 dotest mwrap-4 "${testcvs} -q ci -m add" \
16574 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
16577 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
16578 initial revision: 1\.1
16582 dotest mwrap-5 "${testcvs} -q co first-dir" "U first-dir/aa"
16584 echo "changed in m2" >aa
16585 dotest mwrap-6 "${testcvs} -q ci -m m2-mod" \
16587 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
16588 new revision: 1\.2; previous revision: 1\.1
16592 echo "changed in m1" >aa
16594 # The tagged text code swallows up "U aa" but isn't yet up to
16595 # trying to figure out how it interacts with the "C aa" and
16596 # other stuff. The whole deal of having both is pretty iffy.
16597 dotest mwrap-7 "${testcvs} -nq update" \
16598 "${PROG} update: nonmergeable file needs merge
16599 ${PROG} update: revision 1\.2 from repository is now in aa
16600 ${PROG} update: file from working directory is now in \.#aa\.1\.1
16604 dotest mwrap-7 "${testcvs} -nq update" \
16606 ${PROG} update: nonmergeable file needs merge
16607 ${PROG} update: revision 1\.2 from repository is now in aa
16608 ${PROG} update: file from working directory is now in \.#aa\.1\.1
16611 dotest mwrap-8 "${testcvs} -q update" \
16613 ${PROG} update: nonmergeable file needs merge
16614 ${PROG} update: revision 1\.2 from repository is now in aa
16615 ${PROG} update: file from working directory is now in \.#aa\.1\.1
16617 dotest mwrap-9 "cat aa" "changed in m2"
16618 dotest mwrap-10 "cat .#aa.1.1" "changed in m1"
16621 echo '# comment out' >cvswrappers
16622 dotest mwrap-ce "${testcvs} -q ci -m wrapper-mod" \
16623 "Checking in cvswrappers;
16624 ${CVSROOT_DIRNAME}/CVSROOT/cvswrappers,v <-- cvswrappers
16625 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16627 ${PROG} commit: Rebuilding administrative file database"
16633 rm -rf ${CVSROOT_DIRNAME}/first-dir
16637 # Administrative file tests.
16638 # Here is a list of where each administrative file is tested:
16640 # modules: modules, modules2, modules3
16641 # cvsignore: ignore
16643 # cvswrappers: mwrap
16647 # On Windows, we can't check out CVSROOT, because the case
16648 # insensitivity means that this conflicts with cvsroot.
16652 dotest info-1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
16654 rm -f $TESTDIR/testlog $TESTDIR/testlog2
16655 echo "ALL sh -c \"echo x\${=MYENV}\${=OTHER}y\${=ZEE}=\$USER=\$CVSROOT= >>$TESTDIR/testlog; cat >/dev/null\"" > loginfo
16656 # The following cases test the format string substitution
16657 echo "ALL echo %{sVv} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
16658 echo "ALL echo %{v} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
16659 echo "ALL echo %s >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
16660 echo "ALL echo %{V}AX >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
16661 echo "first-dir echo %sux >>$TESTDIR/testlog2; cat >/dev/null" \
16664 # Might be nice to move this to crerepos tests; it should
16665 # work to create a loginfo file if you didn't create one
16667 : dotest info-2 "${testcvs} add loginfo" \
16668 "${PROG}"' add: scheduling file `loginfo'"'"' for addition
16669 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
16671 dotest info-3 "${testcvs} -q ci -m new-loginfo" \
16672 "Checking in loginfo;
16673 ${CVSROOT_DIRNAME}/CVSROOT/loginfo,v <-- loginfo
16674 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16676 ${PROG} commit: Rebuilding administrative file database"
16679 mkdir ${CVSROOT_DIRNAME}/first-dir
16680 dotest info-5 "${testcvs} -q co first-dir" ''
16683 dotest info-6 "${testcvs} add file1" \
16684 "${PROG}"' add: scheduling file `file1'\'' for addition
16685 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
16686 echo "cvs -s OTHER=not-this -s MYENV=env-" >>$HOME/.cvsrc
16687 dotest info-6a "${testcvs} -q -s OTHER=value ci -m add-it" \
16688 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
16691 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
16692 initial revision: 1\.1
16694 ${PROG} commit: loginfo:1: no such user variable \${=ZEE}"
16696 dotest info-6b "${testcvs} -q -sOTHER=foo ci -m mod-it" \
16697 "Checking in file1;
16698 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
16699 new revision: 1\.2; previous revision: 1\.1
16701 ${PROG} commit: loginfo:1: no such user variable \${=ZEE}"
16703 dotest info-7 "${testcvs} -q -s OTHER=value -s ZEE=z ci -m mod-it" \
16704 "Checking in file1;
16705 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
16706 new revision: 1\.3; previous revision: 1\.2
16709 dotest info-9 "cat $TESTDIR/testlog" "xenv-valueyz=${username}=${CVSROOT_DIRNAME}="
16710 dotest info-10 "cat $TESTDIR/testlog2" \
16711 'first-dir file1,NONE,1.1
16716 first-dir file1,1.1,1.2
16721 first-dir file1,1.2,1.3
16728 echo '# do nothing' >loginfo
16729 dotest info-11 "${testcvs} -q -s ZEE=garbage ci -m nuke-loginfo" \
16730 "Checking in loginfo;
16731 ${CVSROOT_DIRNAME}/CVSROOT/loginfo,v <-- loginfo
16732 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16734 ${PROG} commit: Rebuilding administrative file database"
16736 # Now test verifymsg
16737 cat >${TESTDIR}/vscript <<EOF
16739 if sed 1q < \$1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
16741 elif sed 1q < \$1 | grep '^BugId:[ ]*new$' > /dev/null; then
16742 echo A new bugid was found. >> \$1
16745 echo "No BugId found."
16750 cat >${TESTDIR}/vscript2 <<EOF
16752 if test -f CVS/Repository; then
16753 repo=\`cat CVS/Repository\`
16758 if echo "\$repo" |grep yet-another/ >/dev/null 2>&1; then
16764 # Grumble, grumble, mumble, search for "Cygwin".
16765 if test -n "$remotehost"; then
16766 $CVS_RSH $remotehost "chmod +x ${TESTDIR}/vscript*"
16768 chmod +x ${TESTDIR}/vscript*
16770 echo "^first-dir/yet-another\\(/\\|\$\\) ${TESTDIR}/vscript2" >>verifymsg
16771 echo "^first-dir\\(/\\|\$\\) ${TESTDIR}/vscript" >>verifymsg
16772 echo "^missing-script\$ ${TESTDIR}/bogus" >>verifymsg
16773 echo "^missing-var\$ ${TESTDIR}/vscript \${=Bogus}" >>verifymsg
16774 # first test the directory independant verifymsg
16775 dotest info-v1 "${testcvs} -q ci -m add-verification" \
16776 "Checking in verifymsg;
16777 ${CVSROOT_DIRNAME}/CVSROOT/verifymsg,v <-- verifymsg
16778 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16780 ${PROG} commit: Rebuilding administrative file database"
16784 dotest_fail info-v2 "${testcvs} -q ci -m bogus" \
16786 ${PROG} \[commit aborted\]: Message verification failed"
16788 cat >${TESTDIR}/comment.tmp <<EOF
16790 and many more lines after it
16792 dotest info-v3 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
16793 "Checking in file1;
16794 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
16795 new revision: 1\.4; previous revision: 1\.3
16797 rm ${TESTDIR}/comment.tmp
16803 dotest_fail info-v4 \
16804 "${testcvs} import -m bogus first-dir/another x y" \
16806 ${PROG} \[import aborted\]: Message verification failed"
16808 # now verify that directory dependent verifymsgs work
16810 "${testcvs} import -m bogus first-dir/yet-another x y" \
16811 "${TESTDIR}/wnt/another-dir
16812 N first-dir/yet-another/file2
16814 No conflicts created by this import" \
16815 "${CVSROOT_DIRNAME}/first-dir/yet-another
16816 N first-dir/yet-another/file2
16818 No conflicts created by this import"
16822 # note that in the local case the error message is the same as
16825 # This means that the verifymsg scripts cannot reliably and
16826 # consistantly obtain information on which directory is being
16827 # committed to. Thus it is currently useless for them to be
16828 # running in every dir. They should either be run once or
16829 # directory information should be passed.
16831 dotest_fail info-v6r \
16832 "${testcvs} import -m bogus first-dir/yet-another/and-another x y" \
16833 "${CVSROOT_DIRNAME}/first-dir/yet-another/and-another
16834 ${PROG} \[import aborted\]: Message verification failed"
16837 "${testcvs} import -m bogus first-dir/yet-another/and-another x y" \
16838 "${TESTDIR}/wnt/another-dir
16839 N first-dir/yet-another/and-another/file2
16841 No conflicts created by this import"
16844 # check that errors invoking the script cause verification failure
16846 # The second text below occurs on Cygwin, where I assume execvp
16847 # does not return to let CVS print the error message when its
16848 # argument does not exist.
16849 dotest_fail info-v7 "${testcvs} import -m bogus missing-script x y" \
16850 "${PROG} import: cannot exec ${TESTDIR}/bogus: No such file or directory
16851 ${PROG} \[import aborted\]: Message verification failed" \
16852 "${PROG} \[import aborted\]: Message verification failed"
16854 dotest_fail info-v8 "${testcvs} import -m bogus missing-var x y" \
16855 "${PROG} import: verifymsg:25: no such user variable \${=Bogus}
16856 ${PROG} \[import aborted\]: Message verification failed"
16863 echo "RereadLogAfterVerify=always" >>config
16864 dotest info-rereadlog-1 "${testcvs} -q ci -m add-RereadLogAfterVerify=always" \
16865 "Checking in config;
16866 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
16867 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16869 ${PROG} commit: Rebuilding administrative file database"
16872 cat >${TESTDIR}/comment.tmp <<EOF
16874 See what happens next.
16876 dotest info-reread-2 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
16877 "Checking in file1;
16878 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
16879 new revision: 1\.5; previous revision: 1\.4
16881 dotest info-reread-3 "${testcvs} -q log -N -r1.5 file1" "
16884 See what happens next.
16885 A new bugid was found.
16886 ============================================================================="
16889 grep -v "RereadLogAfterVerify" config > config.new
16890 mv config.new config
16891 echo "RereadLogAfterVerify=stat" >>config
16892 dotest info-reread-4 "${testcvs} -q ci -m add-RereadLogAfterVerify=stat" \
16893 "Checking in config;
16894 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
16895 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16897 ${PROG} commit: Rebuilding administrative file database"
16900 cat >${TESTDIR}/comment.tmp <<EOF
16902 See what happens next with stat.
16904 dotest info-reread-5 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
16905 "Checking in file1;
16906 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
16907 new revision: 1\.6; previous revision: 1\.5
16909 dotest info-reread-6 "${testcvs} -q log -N -r1.6 file1" "
16912 See what happens next with stat.
16913 A new bugid was found.
16914 ============================================================================="
16917 grep -v "RereadLogAfterVerify" config > config.new
16918 mv config.new config
16919 echo "RereadLogAfterVerify=never" >>config
16920 dotest info-reread-7 "${testcvs} -q ci -m add-RereadLogAfterVerify=never" \
16921 "Checking in config;
16922 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
16923 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16925 ${PROG} commit: Rebuilding administrative file database"
16928 cat >${TESTDIR}/comment.tmp <<EOF
16930 See what happens next.
16932 dotest info-reread-8 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
16933 "Checking in file1;
16934 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
16935 new revision: 1\.7; previous revision: 1\.6
16937 dotest info-reread-6 "${testcvs} -q log -N -r1.7 file1" "
16940 See what happens next.
16941 ============================================================================="
16944 echo 'DEFAULT false' >verifymsg
16945 echo 'DEFAULT true' >>verifymsg
16946 echo '# defaults' >config
16947 dotest info-multdef "${testcvs} -q ci -m multdef" \
16948 "Checking in config;
16949 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
16950 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16952 Checking in verifymsg;
16953 ${CVSROOT_DIRNAME}/CVSROOT/verifymsg,v <-- verifymsg
16954 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16956 ${PROG} commit: Rebuilding administrative file database"
16959 echo '# do nothing' >verifymsg
16960 dotest info-cleanup-verifymsg "${testcvs} -q ci -m nuke-verifymsg" \
16961 "${PROG} commit: Multiple .DEFAULT. lines (1 and 2) in verifymsg file
16962 Checking in verifymsg;
16963 ${CVSROOT_DIRNAME}/CVSROOT/verifymsg,v <-- verifymsg
16964 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
16966 ${PROG} commit: Rebuilding administrative file database"
16967 rm ${TESTDIR}/vscript*
16970 dotest_fail info-cleanup-0 "${testcvs} -n release -d CVSROOT" \
16971 "${PROG} \[release aborted\]: cannot run command ${DOTSTAR}"
16973 if echo "yes" | ${testcvs} release -d CVSROOT >>${LOGFILE} ; then
16978 if echo "yes" | ${testcvs} release -d first-dir >>${LOGFILE} ; then
16979 pass info-cleanup-2
16981 fail info-cleanup-2
16986 rm -rf ${CVSROOT_DIRNAME}/first-dir
16990 # Tests of the CVSROOT/taginfo file. See the comment at the
16991 # "info" tests for a full list of administrative file tests.
16997 dotest taginfo-1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
16999 cat >${TESTDIR}/1/loggit <<EOF
17001 if test "\$1" = rejectme; then
17004 echo "\$@" >>${TESTDIR}/1/taglog
17009 if test -n "$remotehost"; then
17010 $CVS_RSH $remotehost "chmod +x ${TESTDIR}/1/loggit"
17012 chmod +x ${TESTDIR}/1/loggit
17014 echo "ALL ${TESTDIR}/1/loggit" >taginfo
17015 dotest taginfo-2 "${testcvs} -q ci -m check-in-taginfo" \
17016 "Checking in taginfo;
17017 ${CVSROOT_DIRNAME}/CVSROOT/taginfo,v <-- taginfo
17018 new revision: 1\.2; previous revision: 1\.1
17020 ${PROG} commit: Rebuilding administrative file database"
17023 # taginfo-3 used to rely on the top-level CVS directory
17024 # being created to add "first-dir" to the repository. Since
17025 # that won't happen anymore, we create the directory in the
17027 mkdir ${CVSROOT_DIRNAME}/first-dir
17028 dotest taginfo-3 "${testcvs} -q co first-dir" ''
17032 dotest taginfo-4 "${testcvs} add file1" \
17033 "${PROG} add: scheduling file .file1. for addition
17034 ${PROG} add: use .${PROG} commit. to add this file permanently"
17035 dotest taginfo-5 "${testcvs} -q ci -m add-it" \
17036 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
17039 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17040 initial revision: 1\.1
17042 dotest taginfo-6 "${testcvs} -q tag tag1" "T file1"
17043 dotest taginfo-7 "${testcvs} -q tag -b br" "T file1"
17044 dotest taginfo-8 "${testcvs} -q update -r br" ""
17045 echo add text on branch >>file1
17046 dotest taginfo-9 "${testcvs} -q ci -m modify-on-br" \
17047 "Checking in file1;
17048 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17049 new revision: 1\.1\.2\.1; previous revision: 1\.1
17051 dotest taginfo-10 "${testcvs} -q tag -F -c brtag" "T file1"
17053 dotest_fail taginfo-11 "${testcvs} -q tag rejectme" \
17054 "${PROG} tag: Pre-tag check failed
17055 ${PROG} \[tag aborted\]: correct the above errors first!"
17057 # When we are using taginfo to allow/disallow, it would be
17058 # convenient to be able to use "cvs -n tag" to test whether
17059 # the allow/disallow functionality is working as expected.
17060 dotest taginfo-12 "${testcvs} -nq tag rejectme" "T file1"
17062 # But when taginfo is used for logging, it is a pain for -n
17063 # to call taginfo, since taginfo doesn't know whether -n was
17064 # specified or not.
17065 dotest taginfo-13 "${testcvs} -nq tag would-be-tag" "T file1"
17067 # Deleting: the cases are basically either the tag existed,
17068 # or it didn't exist.
17069 dotest taginfo-14 "${testcvs} -q tag -d tag1" "D file1"
17070 dotest taginfo-15 "${testcvs} -q tag -d tag1" ""
17072 # Likewise with rtag.
17073 dotest taginfo-16 "${testcvs} -q rtag tag1 first-dir" ""
17074 dotest taginfo-17 "${testcvs} -q rtag -d tag1 first-dir" ""
17075 dotest taginfo-18 "${testcvs} -q rtag -d tag1 first-dir" ""
17077 # The "br" example should be passing 1.1.2 or 1.1.0.2.
17078 # But it turns out that is very hard to implement, since
17079 # check_fileproc doesn't know what branch number it will
17080 # get. Probably the whole thing should be re-architected
17081 # so that taginfo only allows/denies tagging, and a new
17082 # hook, which is done from tag_fileproc, does logging.
17083 # That would solve this, some more subtle races, and also
17084 # the fact that it is nice for users to run "-n tag foo" to
17085 # see whether a tag would be allowed. Failing that,
17086 # I suppose passing "1.1.branch" or "branch" for "br"
17087 # would be an improvement.
17088 dotest taginfo-examine "cat ${TESTDIR}/1/taglog" \
17089 "tag1 add ${CVSROOT_DIRNAME}/first-dir file1 1.1
17090 br add ${CVSROOT_DIRNAME}/first-dir file1 1.1
17091 brtag mov ${CVSROOT_DIRNAME}/first-dir file1 1.1.2.1
17092 tag1 del ${CVSROOT_DIRNAME}/first-dir file1 1.1
17093 tag1 del ${CVSROOT_DIRNAME}/first-dir
17094 tag1 add ${CVSROOT_DIRNAME}/first-dir file1 1.1
17095 tag1 del ${CVSROOT_DIRNAME}/first-dir file1 1.1
17096 tag1 del ${CVSROOT_DIRNAME}/first-dir"
17100 echo '# Keep life simple' > taginfo
17101 dotest taginfo-cleanup-1 "${testcvs} -q ci -m check-in-taginfo" \
17102 "Checking in taginfo;
17103 ${CVSROOT_DIRNAME}/CVSROOT/taginfo,v <-- taginfo
17104 new revision: 1\.3; previous revision: 1\.2
17106 ${PROG} commit: Rebuilding administrative file database"
17110 rm -rf ${CVSROOT_DIRNAME}/first-dir
17114 # Tests of the CVSROOT/config file. See the comment at the
17115 # "info" tests for a full list of administrative file tests.
17117 # On Windows, we can't check out CVSROOT, because the case
17118 # insensitivity means that this conflicts with cvsroot.
17122 dotest config-1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
17124 echo 'bogus line' >config
17125 # We can't rely on specific revisions, since other tests
17126 # might need to modify CVSROOT/config
17127 dotest config-3 "${testcvs} -q ci -m change-to-bogus-line" \
17128 "Checking in config;
17129 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
17130 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
17132 ${PROG} commit: Rebuilding administrative file database"
17133 echo 'BogusOption=yes' >config
17134 dotest config-4 "${testcvs} -q ci -m change-to-bogus-opt" \
17135 "${PROG} [a-z]*: syntax error in ${CVSROOT_DIRNAME}/CVSROOT/config: line 'bogus line' is missing '='
17136 Checking in config;
17137 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
17138 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
17140 ${PROG} commit: Rebuilding administrative file database"
17141 echo '# No config is a good config' > config
17142 dotest config-5 "${testcvs} -q ci -m change-to-comment" \
17143 "${PROG} [a-z]*: ${CVSROOT_DIRNAME}/CVSROOT/config: unrecognized keyword 'BogusOption'
17144 Checking in config;
17145 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
17146 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
17148 ${PROG} commit: Rebuilding administrative file database"
17149 dotest config-6 "${testcvs} -q update" ''
17158 # Test remote CVS handling of unpatchable files. This isn't
17159 # much of a test for local CVS.
17160 # We test this with some keyword expansion games, but the situation
17161 # also arises if the user modifies the file while CVS is running.
17162 mkdir ${CVSROOT_DIRNAME}/first-dir
17165 dotest serverpatch-1 "${testcvs} -q co first-dir" ''
17169 # Add a file with an RCS keyword.
17170 echo '$''Name$' > file1
17172 dotest serverpatch-2 "${testcvs} add file1" \
17173 "${PROG}"' add: scheduling file `file1'\'' for addition
17174 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
17176 dotest serverpatch-3 "${testcvs} -q commit -m add" \
17177 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
17180 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17181 initial revision: 1\.1
17185 dotest serverpatch-4 "${testcvs} -q tag tag file1" 'T file1'
17187 # Check out a tagged copy of the file.
17191 dotest serverpatch-5 "${testcvs} -q co -r tag first-dir" \
17192 'U first-dir/file1'
17194 # Remove the tag. This will leave the tag string in the
17195 # expansion of the Name keyword.
17196 dotest serverpatch-6 "${testcvs} -q update -A first-dir" ''
17198 # Modify and check in the first copy.
17201 dotest serverpatch-7 "${testcvs} -q ci -mx file1" \
17202 "Checking in file1;
17203 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17204 new revision: 1\.2; previous revision: 1\.1
17207 # Now update the second copy. When using remote CVS, the
17208 # patch will fail, forcing the file to be refetched.
17209 cd ../../2/first-dir
17210 dotest serverpatch-8 "${testcvs} -q update" \
17213 ${PROG} update: checksum failure after patch to \./file1; will refetch
17214 ${PROG} client: refetching unpatchable files
17215 ${PROG} update: warning: file1 was lost
17220 rm -rf ${CVSROOT_DIRNAME}/first-dir
17224 # Test selecting revisions with cvs log.
17225 # See also log2 tests for more tests.
17226 # See also branches-14.3 for logging with a branch off of a branch.
17227 # See also multibranch-14 for logging with several branches off the
17228 # same branchpoint.
17229 # Tests of each option to cvs log:
17230 # -h: admin-19a-log
17231 # -N: log, log2, admin-19a-log
17236 # -w, -t: not tested yet (TODO)
17238 # Check in a file with a few revisions and branches.
17239 mkdir ${CVSROOT_DIRNAME}/first-dir
17240 dotest log-1 "${testcvs} -q co first-dir" ''
17242 echo 'first revision' > file1
17243 echo 'first revision' > file2
17244 dotest log-2 "${testcvs} add file1 file2" \
17245 "${PROG} add: scheduling file .file1. for addition
17246 ${PROG} add: scheduling file .file2. for addition
17247 ${PROG} add: use .${PROG} commit. to add these files permanently"
17249 # While we're at it, check multi-line comments, input from file,
17250 # and trailing whitespace trimming
17251 echo 'line 1 ' >${TESTDIR}/comment.tmp
17252 echo ' ' >>${TESTDIR}/comment.tmp
17253 echo 'line 2 ' >>${TESTDIR}/comment.tmp
17254 echo ' ' >>${TESTDIR}/comment.tmp
17255 echo ' ' >>${TESTDIR}/comment.tmp
17256 dotest log-3 "${testcvs} -q commit -F ${TESTDIR}/comment.tmp" \
17257 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
17260 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17261 initial revision: 1\.1
17263 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
17266 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
17267 initial revision: 1\.1
17269 rm -f ${TESTDIR}/comment.tmp
17271 echo 'second revision' > file1
17272 echo 'second revision' > file2
17273 dotest log-4 "${testcvs} -q ci -m2 file1 file2" \
17274 "Checking in file1;
17275 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17276 new revision: 1\.2; previous revision: 1\.1
17279 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
17280 new revision: 1\.2; previous revision: 1\.1
17283 dotest log-5 "${testcvs} -q tag -b branch file1" 'T file1'
17284 dotest log-5a "${testcvs} -q tag tag1 file2" 'T file2'
17286 echo 'third revision' > file1
17287 echo 'third revision' > file2
17288 dotest log-6 "${testcvs} -q ci -m3 file1 file2" \
17289 "Checking in file1;
17290 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17291 new revision: 1\.3; previous revision: 1\.2
17294 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
17295 new revision: 1\.3; previous revision: 1\.2
17298 dotest log-6a "${testcvs} -q tag tag2 file2" 'T file2'
17300 dotest log-7 "${testcvs} -q update -r branch" \
17302 ${PROG} update: file2 is no longer in the repository"
17304 echo 'first branch revision' > file1
17305 dotest log-8 "${testcvs} -q ci -m1b file1" \
17306 "Checking in file1;
17307 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17308 new revision: 1\.2\.2\.1; previous revision: 1\.2
17311 dotest log-9 "${testcvs} -q tag tag file1" 'T file1'
17313 echo 'second branch revision' > file1
17314 dotest log-10 "${testcvs} -q ci -m2b file1" \
17315 "Checking in file1;
17316 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17317 new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
17320 # Set up a bunch of shell variables to make the later tests
17321 # easier to describe.=
17323 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
17324 Working file: file1
17330 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
17335 log_tags1='symbolic names:
17337 branch: 1\.2\.0\.2'
17338 log_keyword='keyword substitution: kv'
17339 log_dash='----------------------------
17341 log_date="date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;"
17342 log_lines=" lines: ${PLUS}1 -1"
17343 log_rev1="${log_dash} 1\.1
17348 log_rev2="${log_dash} 1\.2
17349 ${log_date}${log_lines}
17352 log_rev3="${log_dash} 1\.3
17353 ${log_date}${log_lines}
17355 log_rev1b="${log_dash} 1\.2\.2\.1
17356 ${log_date}${log_lines}
17358 log_rev2b="${log_dash} 1\.2\.2\.2
17359 ${log_date}${log_lines}
17361 log_trailer='============================================================================='
17363 # Now, finally, test the log output.
17365 dotest log-11 "${testcvs} log file1" \
17369 total revisions: 5; selected revisions: 5
17378 dotest log-12 "${testcvs} log -N file1" \
17381 total revisions: 5; selected revisions: 5
17390 dotest log-13 "${testcvs} log -b file1" \
17394 total revisions: 5; selected revisions: 3
17401 dotest log-14 "${testcvs} log -r file1" \
17405 total revisions: 5; selected revisions: 1
17410 dotest log-14a "${testcvs} log -rHEAD file1" \
17414 total revisions: 5; selected revisions: 1
17419 # The user might not realize that "-r" must not take a space.
17420 # In the error message, HEAD is a file name, not a tag name (which
17421 # might be confusing itself).
17422 dotest_fail log-14b "${testcvs} log -r HEAD file1" \
17423 "${PROG} log: nothing known about HEAD
17427 total revisions: 5; selected revisions: 1
17432 # Check that unusual syntax works correctly.
17434 dotest log-14c "${testcvs} log -r: file1" \
17438 total revisions: 5; selected revisions: 1
17442 dotest log-14d "${testcvs} log -r, file1" \
17446 total revisions: 5; selected revisions: 1
17450 dotest log-14e "${testcvs} log -r. file1" \
17454 total revisions: 5; selected revisions: 1
17458 dotest log-14f "${testcvs} log -r:: file1" \
17462 total revisions: 5; selected revisions: 0
17466 dotest log-15 "${testcvs} log -r1.2 file1" \
17470 total revisions: 5; selected revisions: 1
17475 dotest log-16 "${testcvs} log -r1.2.2 file1" \
17479 total revisions: 5; selected revisions: 2
17485 # This test would fail with the old invocation of rlog, but it
17486 # works with the builtin log support.
17487 dotest log-17 "${testcvs} log -rbranch file1" \
17491 total revisions: 5; selected revisions: 2
17497 dotest log-18 "${testcvs} log -r1.2.2. file1" \
17501 total revisions: 5; selected revisions: 1
17506 # Multiple -r options are undocumented; see comments in
17507 # cvs.texinfo about whether they should be deprecated.
17508 dotest log-18a "${testcvs} log -r1.2.2.2 -r1.3:1.3 file1" \
17512 total revisions: 5; selected revisions: 2
17518 # This test would fail with the old invocation of rlog, but it
17519 # works with the builtin log support.
17520 dotest log-19 "${testcvs} log -rbranch. file1" \
17524 total revisions: 5; selected revisions: 1
17529 dotest log-20 "${testcvs} log -r1.2: file1" \
17533 total revisions: 5; selected revisions: 2
17539 dotest log-20a "${testcvs} log -r1.2:: file1" \
17543 total revisions: 5; selected revisions: 1
17548 dotest log-21 "${testcvs} log -r:1.2 file1" \
17552 total revisions: 5; selected revisions: 2
17558 dotest log-21a "${testcvs} log -r::1.2 file1" \
17562 total revisions: 5; selected revisions: 2
17568 dotest log-22 "${testcvs} log -r1.1:1.2 file1" \
17572 total revisions: 5; selected revisions: 2
17578 dotest log-22a "${testcvs} log -r1.1::1.2 file1" \
17582 total revisions: 5; selected revisions: 1
17587 dotest log-22b "${testcvs} log -r1.1::1.3 file1" \
17591 total revisions: 5; selected revisions: 2
17597 # Now the same tests but with rlog
17599 dotest log-r11 "${testcvs} rlog first-dir/file1" \
17603 total revisions: 5; selected revisions: 5
17612 dotest log-r12 "${testcvs} rlog -N first-dir/file1" \
17615 total revisions: 5; selected revisions: 5
17624 dotest log-r13 "${testcvs} rlog -b first-dir/file1" \
17628 total revisions: 5; selected revisions: 3
17635 dotest log-r14 "${testcvs} rlog -r first-dir/file1" \
17639 total revisions: 5; selected revisions: 1
17644 dotest log-r14a "${testcvs} rlog -rHEAD first-dir/file1" \
17648 total revisions: 5; selected revisions: 1
17653 dotest_fail log-r14b "${testcvs} rlog -r HEAD first-dir/file1" \
17654 "${PROG} rlog: cannot find module .HEAD. - ignored
17658 total revisions: 5; selected revisions: 1
17663 dotest log-r14c "${testcvs} rlog -r: first-dir/file1" \
17667 total revisions: 5; selected revisions: 1
17671 dotest log-r14d "${testcvs} rlog -r, first-dir/file1" \
17675 total revisions: 5; selected revisions: 1
17679 dotest log-r14e "${testcvs} rlog -r. first-dir/file1" \
17683 total revisions: 5; selected revisions: 1
17687 dotest log-r14f "${testcvs} rlog -r:: first-dir/file1" \
17691 total revisions: 5; selected revisions: 0
17695 dotest log-r15 "${testcvs} rlog -r1.2 first-dir/file1" \
17699 total revisions: 5; selected revisions: 1
17704 dotest log-r16 "${testcvs} rlog -r1.2.2 first-dir/file1" \
17708 total revisions: 5; selected revisions: 2
17714 dotest log-r17 "${testcvs} rlog -rbranch first-dir/file1" \
17718 total revisions: 5; selected revisions: 2
17724 dotest log-r18 "${testcvs} rlog -r1.2.2. first-dir/file1" \
17728 total revisions: 5; selected revisions: 1
17733 dotest log-r18a "${testcvs} rlog -r1.2.2.2 -r1.3:1.3 first-dir/file1" \
17737 total revisions: 5; selected revisions: 2
17743 dotest log-r19 "${testcvs} rlog -rbranch. first-dir/file1" \
17747 total revisions: 5; selected revisions: 1
17752 dotest log-r20 "${testcvs} rlog -r1.2: first-dir/file1" \
17756 total revisions: 5; selected revisions: 2
17762 dotest log-r20a "${testcvs} rlog -r1.2:: first-dir/file1" \
17766 total revisions: 5; selected revisions: 1
17771 dotest log-r21 "${testcvs} rlog -r:1.2 first-dir/file1" \
17775 total revisions: 5; selected revisions: 2
17781 dotest log-r21a "${testcvs} rlog -r::1.2 first-dir/file1" \
17785 total revisions: 5; selected revisions: 2
17791 dotest log-r22 "${testcvs} rlog -r1.1:1.2 first-dir/file1" \
17795 total revisions: 5; selected revisions: 2
17801 dotest log-r22a "${testcvs} rlog -r1.1::1.2 first-dir/file1" \
17805 total revisions: 5; selected revisions: 1
17810 dotest log-r22b "${testcvs} rlog -r1.1::1.3 first-dir/file1" \
17814 total revisions: 5; selected revisions: 2
17820 # Test when head is dead
17822 dotest log-d0 "${testcvs} -q up -A" \
17825 dotest log-d1 "${testcvs} -q rm -f file1" \
17826 "${PROG} remove: use .${PROG} commit. to remove this file permanently"
17827 dotest log-d2 "${testcvs} -q ci -m4" \
17829 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17830 new revision: delete; previous revision: 1\.3
17834 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
17835 Working file: file1
17841 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
17847 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
17848 Working file: file2
17854 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
17859 log_tags2='symbolic names:
17862 log_rev4="${log_dash} 1\.4
17863 date: [0-9/]* [0-9:]*; author: ${username}; state: dead; lines: ${PLUS}0 -0
17865 log_rev22="${log_dash} 1\.2
17866 ${log_date}${log_lines}
17869 dotest log-d3 "${testcvs} log -rbranch file1" \
17873 total revisions: 6; selected revisions: 2
17878 dotest log-rd3 "${testcvs} rlog -rbranch first-dir/file1" \
17882 total revisions: 6; selected revisions: 2
17887 dotest log-d4 "${testcvs} -q log -rbranch" \
17891 total revisions: 6; selected revisions: 2
17896 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
17900 total revisions: 3; selected revisions: 0
17903 dotest log-d4a "${testcvs} -q log -t -rbranch" \
17910 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
17917 dotest log-d4b "${testcvs} -q log -tS -rbranch" \
17921 total revisions: 6; selected revisions: 2
17924 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
17925 dotest log-d4c "${testcvs} -q log -h -rbranch" \
17931 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
17937 dotest log-d4d "${testcvs} -q log -hS -rbranch" \
17941 total revisions: 6; selected revisions: 2
17943 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
17944 dotest log-d4e "${testcvs} -q log -R -rbranch" \
17945 "${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
17946 ${CVSROOT_DIRNAME}/first-dir/file2,v"
17947 dotest log-d4f "${testcvs} -q log -R -S -rbranch" \
17948 "${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
17949 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
17950 dotest log-rd4 "${testcvs} -q rlog -rbranch first-dir" \
17954 total revisions: 6; selected revisions: 2
17959 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
17963 total revisions: 3; selected revisions: 0
17966 dotest log-rd4a "${testcvs} -q rlog -t -rbranch first-dir" \
17973 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
17980 dotest log-rd4b "${testcvs} -q rlog -St -rbranch first-dir" \
17984 total revisions: 6; selected revisions: 2
17987 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
17988 dotest log-rd4c "${testcvs} -q rlog -h -rbranch first-dir" \
17994 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
18000 dotest log-rd4d "${testcvs} -q rlog -Sh -rbranch first-dir" \
18004 total revisions: 6; selected revisions: 2
18006 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
18007 dotest log-rd4e "${testcvs} -q rlog -R -rbranch first-dir" \
18008 "${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
18009 ${CVSROOT_DIRNAME}/first-dir/file2,v"
18010 dotest log-rd4f "${testcvs} -q rlog -R -S -rbranch first-dir" \
18011 "${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
18012 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
18013 dotest log-d5 "${testcvs} log -r1.2.2.1:1.2.2.2 file1" \
18017 total revisions: 6; selected revisions: 2
18022 dotest log-rd5 "${testcvs} rlog -r1.2.2.1:1.2.2.2 first-dir/file1" \
18026 total revisions: 6; selected revisions: 2
18031 dotest log-d6 "${testcvs} -q log -r1.2.2.1:1.2.2.2" \
18035 total revisions: 6; selected revisions: 2
18043 total revisions: 3; selected revisions: 0
18046 dotest log-rd6 "${testcvs} -q rlog -r1.2.2.1:1.2.2.2 first-dir" \
18050 total revisions: 6; selected revisions: 2
18058 total revisions: 3; selected revisions: 0
18061 dotest log-d7 "${testcvs} log -r1.2:1.3 file1" \
18065 total revisions: 6; selected revisions: 2
18070 dotest log-rd7 "${testcvs} -q rlog -r1.2:1.3 first-dir/file1" \
18074 total revisions: 6; selected revisions: 2
18079 dotest log-d8 "${testcvs} -q log -rtag1:tag2" \
18080 "${PROG} log: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
18081 ${PROG} log: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
18085 total revisions: 6; selected revisions: 0
18091 total revisions: 3; selected revisions: 2
18096 dotest log-d8a "${testcvs} -q log -rtag1:tag2 -S" \
18097 "${PROG} log: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
18098 ${PROG} log: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
18102 total revisions: 3; selected revisions: 2
18107 dotest log-rd8 "${testcvs} -q rlog -rtag1:tag2 first-dir" \
18108 "${PROG} rlog: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
18109 ${PROG} rlog: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
18113 total revisions: 6; selected revisions: 0
18119 total revisions: 3; selected revisions: 2
18124 dotest log-rd8a "${testcvs} -q rlog -rtag1:tag2 -S first-dir" \
18125 "${PROG} rlog: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
18126 ${PROG} rlog: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
18130 total revisions: 3; selected revisions: 2
18136 dotest log-d99 "${testcvs} -q up -rbranch" \
18138 ${PROG} update: file2 is no longer in the repository"
18140 # Now test outdating revisions
18142 dotest log-o0 "${testcvs} admin -o 1.2.2.2:: file1" \
18143 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
18145 dotest log-o1 "${testcvs} admin -o ::1.2.2.1 file1" \
18146 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
18148 dotest log-o2 "${testcvs} admin -o 1.2.2.1:: file1" \
18149 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
18150 deleting revision 1\.2\.2\.2
18152 dotest log-o3 "${testcvs} log file1" \
18156 total revisions: 5; selected revisions: 5
18164 dotest log-ro3 "${testcvs} rlog first-dir/file1" \
18168 total revisions: 5; selected revisions: 5
18176 dotest log-o4 "${testcvs} -q update -p -r 1.2.2.1 file1" \
18177 "first branch revision"
18181 rm -rf ${CVSROOT_DIRNAME}/first-dir
18185 # More "cvs log" tests, for example the file description.
18188 mkdir ${CVSROOT_DIRNAME}/first-dir
18189 dotest log2-1 "${testcvs} -q co first-dir" ''
18191 echo 'first revision' > file1
18192 dotest log2-2 "${testcvs} add -m file1-is-for-testing file1" \
18193 "${PROG}"' add: scheduling file `file1'\'' for addition
18194 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
18195 dotest log2-3 "${testcvs} -q commit -m 1" \
18196 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18199 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18200 initial revision: 1\.1
18202 # Setting the file description with add -m doesn't yet work
18203 # client/server, so skip log2-4 for remote.
18204 if $remote; then :; else
18206 dotest log2-4 "${testcvs} log -N file1" "
18207 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18208 Working file: file1
18213 keyword substitution: kv
18214 total revisions: 1; selected revisions: 1
18216 file1-is-for-testing
18217 ----------------------------
18219 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
18221 ============================================================================="
18223 fi # end of tests skipped for remote
18225 dotest log2-5 "${testcvs} admin -t-change-description file1" \
18226 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18228 dotest log2-6 "${testcvs} log -N file1" "
18229 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18230 Working file: file1
18235 keyword substitution: kv
18236 total revisions: 1; selected revisions: 1
18239 ----------------------------
18241 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
18243 ============================================================================="
18245 echo 'longer description' >${TESTDIR}/descrip
18246 echo 'with two lines' >>${TESTDIR}/descrip
18247 dotest log2-7 "${testcvs} admin -t${TESTDIR}/descrip file1" \
18248 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18250 dotest_fail log2-7a "${testcvs} admin -t${TESTDIR}/nonexist file1" \
18251 "${PROG} \[[a-z]* aborted\]: can't stat ${TESTDIR}/nonexist: No such file or directory"
18252 dotest log2-8 "${testcvs} log -N file1" "
18253 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18254 Working file: file1
18259 keyword substitution: kv
18260 total revisions: 1; selected revisions: 1
18264 ----------------------------
18266 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
18268 ============================================================================="
18270 # TODO: `cvs admin -t "my message" file1' is a request to
18271 # read the message from stdin and to operate on two files.
18272 # Should test that there is an error because "my message"
18275 dotest log2-9 "echo change from stdin | ${testcvs} admin -t -q file1" ""
18276 dotest log2-10 "${testcvs} log -N file1" "
18277 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18278 Working file: file1
18283 keyword substitution: kv
18284 total revisions: 1; selected revisions: 1
18287 ----------------------------
18289 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
18291 ============================================================================="
18294 rm ${TESTDIR}/descrip
18296 rm -rf ${CVSROOT_DIRNAME}/first-dir
18301 # Some tests of log.c's option parsing and such things.
18303 dotest logopt-1 "${testcvs} -q co -l ." ''
18305 dotest logopt-2 "${testcvs} add first-dir" \
18306 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
18309 dotest logopt-3 "${testcvs} add file1" \
18310 "${PROG} add: scheduling file .file1. for addition
18311 ${PROG} add: use .${PROG} commit. to add this file permanently"
18312 dotest logopt-4 "${testcvs} -q ci -m add file1" \
18313 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18316 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18317 initial revision: 1\.1
18321 dotest logopt-5 "${testcvs} log -R -d 2038-01-01" \
18322 "${PROG} log: Logging \.
18323 ${PROG} log: Logging first-dir
18324 ${CVSROOT_DIRNAME}/first-dir/file1,v"
18325 dotest logopt-6 "${testcvs} log -d 2038-01-01 -R" \
18326 "${PROG} log: Logging \.
18327 ${PROG} log: Logging first-dir
18328 ${CVSROOT_DIRNAME}/first-dir/file1,v"
18329 dotest logopt-6a "${testcvs} log -Rd 2038-01-01" \
18330 "${PROG} log: Logging \.
18331 ${PROG} log: Logging first-dir
18332 ${CVSROOT_DIRNAME}/first-dir/file1,v"
18333 dotest logopt-7 "${testcvs} log -s Exp -R" \
18334 "${PROG} log: Logging \.
18335 ${PROG} log: Logging first-dir
18336 ${CVSROOT_DIRNAME}/first-dir/file1,v"
18340 rm -rf ${CVSROOT_DIRNAME}/first-dir
18344 # Tests of "cvs annotate". See also:
18345 # basica-10 A simple annotate test
18346 # rcs Annotate and the year 2000
18347 # keywordlog Annotate and $Log.
18349 dotest ann-1 "${testcvs} -q co -l ." ''
18351 dotest ann-2 "${testcvs} add first-dir" \
18352 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
18361 dotest ann-3 "${testcvs} add file1" \
18362 "${PROG} add: scheduling file .file1. for addition
18363 ${PROG} add: use .${PROG} commit. to add this file permanently"
18364 dotest ann-4 "${testcvs} -q ci -m add file1" \
18365 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18368 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18369 initial revision: 1\.1
18382 dotest ann-5 "${testcvs} -q ci -m modify file1" \
18383 "Checking in file1;
18384 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18385 new revision: 1\.2; previous revision: 1\.1
18387 dotest ann-6 "${testcvs} -q tag -b br" "T file1"
18399 dotest ann-7 "${testcvs} -q ci -m modify file1" \
18400 "Checking in file1;
18401 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18402 new revision: 1\.3; previous revision: 1\.2
18404 dotest ann-8 "${testcvs} -q update -r br" "[UP] file1"
18418 dotest ann-9 "${testcvs} -q ci -m modify" \
18419 "Checking in file1;
18420 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18421 new revision: 1\.2\.2\.1; previous revision: 1\.2
18423 # Note that this annotates the trunk despite the presence
18424 # of a sticky tag in the current directory. This is
18425 # fairly bogus, but it is the longstanding behavior for
18426 # whatever that is worth.
18427 dotest ann-10 "${testcvs} ann" \
18429 Annotations for file1
18430 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
18431 1\.1 (${username} *[0-9a-zA-Z-]*): this
18432 1\.1 (${username} *[0-9a-zA-Z-]*): is
18433 1\.2 (${username} *[0-9a-zA-Z-]*): a
18434 1\.3 (${username} *[0-9a-zA-Z-]*): trunk file
18435 1\.2 (${username} *[0-9a-zA-Z-]*):
18436 1\.2 (${username} *[0-9a-zA-Z-]*): with
18437 1\.2 (${username} *[0-9a-zA-Z-]*): a
18438 1\.2 (${username} *[0-9a-zA-Z-]*): blank
18439 1\.2 (${username} *[0-9a-zA-Z-]*): line"
18440 dotest ann-11 "${testcvs} ann -r br" \
18442 Annotations for file1
18443 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
18444 1\.1 (${username} *[0-9a-zA-Z-]*): this
18445 1\.1 (${username} *[0-9a-zA-Z-]*): is
18446 1\.2 (${username} *[0-9a-zA-Z-]*): a
18447 1\.1 (${username} *[0-9a-zA-Z-]*): file
18448 1\.2 (${username} *[0-9a-zA-Z-]*):
18449 1\.2 (${username} *[0-9a-zA-Z-]*): with
18450 1\.2 (${username} *[0-9a-zA-Z-]*): a
18451 1\.2 (${username} *[0-9a-zA-Z-]*): blank
18452 1\.2 (${username} *[0-9a-zA-Z-]*): line
18453 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
18454 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
18455 # FIXCVS: shouldn't "-r 1.2.0.2" be the same as "-r br"?
18456 dotest ann-12 "${testcvs} ann -r 1.2.0.2 file1" ""
18457 dotest ann-13 "${testcvs} ann -r 1.2.2 file1" \
18459 Annotations for file1
18460 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
18461 1\.1 (${username} *[0-9a-zA-Z-]*): this
18462 1\.1 (${username} *[0-9a-zA-Z-]*): is
18463 1\.2 (${username} *[0-9a-zA-Z-]*): a
18464 1\.1 (${username} *[0-9a-zA-Z-]*): file
18465 1\.2 (${username} *[0-9a-zA-Z-]*):
18466 1\.2 (${username} *[0-9a-zA-Z-]*): with
18467 1\.2 (${username} *[0-9a-zA-Z-]*): a
18468 1\.2 (${username} *[0-9a-zA-Z-]*): blank
18469 1\.2 (${username} *[0-9a-zA-Z-]*): line
18470 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
18471 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
18472 dotest_fail ann-14 "${testcvs} ann -r bill-clintons-chastity file1" \
18473 "${PROG} \[annotate aborted\]: no such tag bill-clintons-chastity"
18475 # Now get rid of the working directory and test rannotate
18479 dotest ann-r10 "${testcvs} rann first-dir" \
18481 Annotations for first-dir/file1
18482 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
18483 1\.1 (${username} *[0-9a-zA-Z-]*): this
18484 1\.1 (${username} *[0-9a-zA-Z-]*): is
18485 1\.2 (${username} *[0-9a-zA-Z-]*): a
18486 1\.3 (${username} *[0-9a-zA-Z-]*): trunk file
18487 1\.2 (${username} *[0-9a-zA-Z-]*):
18488 1\.2 (${username} *[0-9a-zA-Z-]*): with
18489 1\.2 (${username} *[0-9a-zA-Z-]*): a
18490 1\.2 (${username} *[0-9a-zA-Z-]*): blank
18491 1\.2 (${username} *[0-9a-zA-Z-]*): line"
18492 dotest ann-r11 "${testcvs} rann -r br first-dir" \
18494 Annotations for first-dir/file1
18495 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
18496 1\.1 (${username} *[0-9a-zA-Z-]*): this
18497 1\.1 (${username} *[0-9a-zA-Z-]*): is
18498 1\.2 (${username} *[0-9a-zA-Z-]*): a
18499 1\.1 (${username} *[0-9a-zA-Z-]*): file
18500 1\.2 (${username} *[0-9a-zA-Z-]*):
18501 1\.2 (${username} *[0-9a-zA-Z-]*): with
18502 1\.2 (${username} *[0-9a-zA-Z-]*): a
18503 1\.2 (${username} *[0-9a-zA-Z-]*): blank
18504 1\.2 (${username} *[0-9a-zA-Z-]*): line
18505 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
18506 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
18507 dotest ann-r12 "${testcvs} rann -r 1.2.0.2 first-dir/file1" ""
18508 dotest ann-r13 "${testcvs} rann -r 1.2.2 first-dir/file1" \
18510 Annotations for first-dir/file1
18511 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
18512 1\.1 (${username} *[0-9a-zA-Z-]*): this
18513 1\.1 (${username} *[0-9a-zA-Z-]*): is
18514 1\.2 (${username} *[0-9a-zA-Z-]*): a
18515 1\.1 (${username} *[0-9a-zA-Z-]*): file
18516 1\.2 (${username} *[0-9a-zA-Z-]*):
18517 1\.2 (${username} *[0-9a-zA-Z-]*): with
18518 1\.2 (${username} *[0-9a-zA-Z-]*): a
18519 1\.2 (${username} *[0-9a-zA-Z-]*): blank
18520 1\.2 (${username} *[0-9a-zA-Z-]*): line
18521 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
18522 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
18523 dotest_fail ann-r14 "${testcvs} rann -r bill-clintons-chastity first-dir/file1" \
18524 "${PROG} \[rannotate aborted\]: no such tag bill-clintons-chastity"
18526 rm -rf ${CVSROOT_DIRNAME}/first-dir
18530 # Demonstrate that cvs-1.9.28.1 improperly expands rcs keywords in
18531 # the output of `cvs annotate' -- it uses values from the previous
18532 # delta. In this case, `1.1' instead of `1.2', even though it puts
18533 # the proper version number on the prefix to each line of output.
18535 dotest ann-id-1 "${testcvs} -q co -l ." ''
18538 dotest ann-id-2 "${testcvs} add $module" \
18539 "Directory ${CVSROOT_DIRNAME}/$module added to the repository"
18543 echo '$Id''$' > $file
18545 dotest ann-id-3 "$testcvs add $file" \
18546 "${PROG} add: scheduling file .$file. for addition
18547 ${PROG} add: use .${PROG} commit. to add this file permanently"
18548 dotest ann-id-4 "$testcvs -Q ci -m . $file" \
18549 "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
18552 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
18553 initial revision: 1\.1
18556 echo line2 >> $file
18557 dotest ann-id-5 "$testcvs -Q ci -m . $file" \
18558 "Checking in $file;
18559 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
18560 new revision: 1\.2; previous revision: 1\.1
18563 # The version number after $file,v should be `1.2'.
18564 # 1.9.28.1 puts `1.1' there.
18565 dotest ann-id-6 "$testcvs -Q ann $file" \
18567 Annotations for $file
18568 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
18569 1.2 ($username *[0-9a-zA-Z-]*): "'\$'"Id: $file,v 1.1 [0-9/]* [0-9:]* $username Exp "'\$'"
18570 1.2 ($username *[0-9a-zA-Z-]*): line2"
18574 rm -rf ${CVSROOT_DIRNAME}/$module
18578 # Various tests relating to creating repositories, operating
18579 # on repositories created with old versions of CVS, etc.
18581 CVS_SERVER_save=$CVS_SERVER
18583 # Because this test is all about -d options and such, it
18584 # at least to some extent needs to be different for remote vs.
18588 # For remote, just create the repository. We don't yet do
18589 # the various other tests above for remote but that should be
18592 mkdir crerepos/CVSROOT
18594 # Use :ext: rather than :fork:. Most of the tests use :fork:,
18595 # so we want to make sure that we test :ext: _somewhere_.
18597 # Maybe a bit dubious in the sense that people need to
18598 # have rsh working to run the tests, but at least it
18599 # isn't inetd :-). Might want to think harder about this -
18600 # maybe try :ext:, and if it fails, print a (single, nice)
18601 # message and fall back to :fork:. Maybe testing :ext:
18602 # with our own CVS_RSH rather than worrying about a system one
18603 # would do the trick.
18605 # Make sure server ignores real ${HOME}/.cvsrc:
18606 cat >$TESTDIR/cvs-setHome <<EOF
18610 exec $CVS_SERVER_save "\$@"
18612 chmod a+x $TESTDIR/cvs-setHome
18614 # Note that we set CVS_SERVER at the beginning.
18615 CVS_SERVER=$TESTDIR/cvs-setHome; export CVS_SERVER
18617 if test -n "$remotehost"; then
18618 CREREPOS_ROOT=:ext:$remotehost${TESTDIR}/crerepos
18620 CREREPOS_ROOT=:ext:`hostname`:${TESTDIR}/crerepos
18623 # If we're going to do remote testing, make sure 'rsh' works first.
18625 if test "x`${CVS_RSH} $host -n 'echo hi'`" != "xhi"; then
18626 echo "ERROR: cannot test remote CVS, because \`${CVS_RSH} $host' fails." >&2
18632 # First, if the repository doesn't exist at all...
18633 dotest_fail crerepos-1 \
18634 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
18635 "${PROG} \[checkout aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
18638 # The repository exists but CVSROOT doesn't.
18639 dotest_fail crerepos-2 \
18640 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
18641 "${PROG} \[checkout aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
18642 mkdir crerepos/CVSROOT
18644 # Checkout of nonexistent module
18645 dotest_fail crerepos-3 \
18646 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
18647 "${PROG} checkout: cannot find module .cvs-sanity. - ignored"
18649 # Now test that CVS works correctly without a modules file
18650 # or any of that other stuff. In particular, it *must*
18651 # function if administrative files added to CVS recently (since
18652 # CVS 1.3) do not exist, because the repository might have
18653 # been created with an old version of CVS.
18655 dotest crerepos-4 \
18656 "${testcvs} -q -d ${TESTDIR}/crerepos co CVSROOT" \
18659 ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
18666 # The directory 1 should be empty
18667 dotest crerepos-6 "rmdir 1"
18669 CREREPOS_ROOT=${TESTDIR}/crerepos
18674 # Test that CVS rejects a relative path in CVSROOT.
18676 # Note that having the client reject the pathname (as :fork:
18677 # does), does _not_ test for the bugs we are trying to catch
18678 # here. The point is that malicious clients might send all
18679 # manner of things and the server better protect itself.
18680 dotest_fail crerepos-6a-r \
18681 "${testcvs} -q -d :ext:`hostname`:../crerepos get ." \
18682 "${PROG} [a-z]*: CVSROOT may only specify a positive, non-zero, integer port (not .\.\..)\.
18683 ${PROG} [a-z]*: Perhaps you entered a relative pathname${QUESTION}
18684 ${PROG} \[[a-z]* aborted\]: Bad CVSROOT: .:ext:${hostname}:\.\./crerepos.\."
18689 dotest_fail crerepos-6b-r \
18690 "${testcvs} -d :ext:`hostname`:crerepos init" \
18691 "${PROG} [a-z]*: CVSROOT requires a path spec:
18692 ${PROG} [a-z]*: :(gserver|kserver|pserver):\[\[user\]\[:password\]@\]host\[:\[port\]\]/path
18693 ${PROG} [a-z]*: \[:(ext|server):\]\[\[user\]@\]host\[:\]/path
18694 ${PROG} \[[a-z]* aborted\]: Bad CVSROOT: .:ext:${hostname}:crerepos.\."
18698 # Test that CVS rejects a relative path in CVSROOT.
18701 # Set CVS_RSH=false since ocassionally (e.g. when CVS_RSH=ssh on
18702 # some systems) some rsh implementations will block because they
18703 # can look up '..' and want to ask the user about the unknown host
18704 # key or somesuch. Which error message we get depends on whether
18705 # false finishes running before we try to talk to it or not.
18706 dotest_fail crerepos-6a "CVS_RSH=false ${testcvs} -q -d ../crerepos get ." \
18707 "${PROG} \[checkout aborted\]: end of file from server (consult above messages if any)" \
18708 "${PROG} \[checkout aborted\]: received broken pipe signal"
18713 dotest_fail crerepos-6b "${testcvs} -d crerepos init" \
18714 "${PROG} init: CVSROOT must be an absolute pathname (not .crerepos.)
18715 ${PROG} init: when using local access method\.
18716 ${PROG} \[init aborted\]: Bad CVSROOT: .crerepos.\."
18719 fi # end of tests to be skipped for remote
18721 # CVS better not create a history file--if the administrator
18722 # doesn't need it and wants to save on disk space, they just
18724 dotest_fail crerepos-7 \
18725 "test -f ${TESTDIR}/crerepos/CVSROOT/history" ''
18727 # Now test mixing repositories. This kind of thing tends to
18728 # happen accidentally when people work with several repositories.
18730 dotest crerepos-8 "${testcvs} -q co -l ." ''
18732 dotest crerepos-9 "${testcvs} add first-dir" \
18733 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
18736 dotest crerepos-10 "${testcvs} add file1" \
18737 "${PROG} add: scheduling file .file1. for addition
18738 ${PROG} add: use .${PROG} commit. to add this file permanently"
18739 dotest crerepos-11 "${testcvs} -q ci -m add-it" \
18740 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18743 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18744 initial revision: 1\.1
18750 dotest crerepos-12 "${testcvs} -d ${CREREPOS_ROOT} -q co -l ." ''
18752 dotest crerepos-13 "${testcvs} add crerepos-dir" \
18753 "Directory ${TESTDIR}/crerepos/crerepos-dir added to the repository"
18756 dotest crerepos-14 "${testcvs} add cfile" \
18757 "${PROG} add: scheduling file .cfile. for addition
18758 ${PROG} add: use .${PROG} commit. to add this file permanently"
18759 dotest crerepos-15 "${testcvs} -q ci -m add-it" \
18760 "RCS file: ${TESTDIR}/crerepos/crerepos-dir/cfile,v
18763 ${TESTDIR}/crerepos/crerepos-dir/cfile,v <-- cfile
18764 initial revision: 1\.1
18770 dotest crerepos-16 "${testcvs} co first-dir" \
18771 "${PROG} checkout: Updating first-dir
18773 dotest crerepos-17 "${testcvs} -d ${CREREPOS_ROOT} co crerepos-dir" \
18774 "${PROG} checkout: Updating crerepos-dir
18775 U crerepos-dir/cfile"
18776 dotest crerepos-18 "${testcvs} update" \
18777 "${PROG} update: Updating first-dir
18778 ${PROG} update: Updating crerepos-dir"
18782 CVS_SERVER=$CVS_SERVER_save; export CVS_SERVER
18785 echo Keeping ${TESTDIR} and exiting due to --keep
18789 rm -f $TESTDIR/cvs-setHome
18791 rm -rf ${CVSROOT_DIRNAME}/first-dir ${TESTDIR}/crerepos
18797 # Test ability to import an RCS file. Note that this format
18798 # is fixed--files written by RCS5, and other software which
18799 # implements this format, will be out there "forever" and
18800 # CVS must always be able to import such files.
18802 # See tests admin-13, admin-25 and rcs-8a for exporting RCS files.
18804 mkdir ${CVSROOT_DIRNAME}/first-dir
18806 # Currently the way to import an RCS file is to copy it
18807 # directly into the repository.
18809 # This file was written by RCS 5.7, and then the dates were
18810 # hacked so that we test year 2000 stuff. Note also that
18811 # "author" names are just strings, as far as importing
18812 # RCS files is concerned--they need not correspond to user
18813 # IDs on any particular system.
18815 # I also tried writing a file with the RCS supplied with
18816 # HPUX A.09.05. According to "man rcsintro" this is
18817 # "Revision Number: 3.0; Release Date: 83/05/11". There
18818 # were a few minor differences like whitespace but at least
18819 # in simple cases like this everything else seemed the same
18820 # as the file written by RCS 5.7 (so I won't try to make it
18821 # a separate test case).
18823 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
18832 date 2000.11.24.15.58.37; author kingdon; state Exp;
18837 date 96.11.24.15.57.41; author kingdon; state Exp;
18842 date 96.11.24.15.56.05; author kingdon; state Exp;
18848 @file1 is for testing CVS
18854 @delete second line; modify twelfth line
18857 @This is the first line
18858 This is the third line
18859 This is the fourth line
18860 This is the fifth line
18861 This is the sixth line
18862 This is the seventh line
18863 This is the eighth line
18864 This is the ninth line
18865 This is the tenth line
18866 This is the eleventh line
18867 This is the twelfth line (and what a line it is)
18868 This is the thirteenth line
18878 This is the second line
18881 This is the twelfth line
18893 dotest rcs-1 "${testcvs} -q co first-dir" 'U first-dir/file1'
18895 dotest rcs-2 "${testcvs} -q log" "
18896 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18897 Working file: file1
18903 keyword substitution: kv
18904 total revisions: 3; selected revisions: 3
18906 file1 is for testing CVS
18907 ----------------------------
18909 date: 2000/11/24 15:58:37; author: kingdon; state: Exp; lines: ${PLUS}1 -2
18910 delete second line; modify twelfth line
18911 ----------------------------
18913 date: 1996/11/24 15:57:41; author: kingdon; state: Exp; lines: ${PLUS}12 -0
18915 ----------------------------
18917 date: 1996/11/24 15:56:05; author: kingdon; state: Exp;
18919 ============================================================================="
18921 # Note that the dates here are chosen so that (a) we test
18922 # at least one date after 2000, (b) we will notice if the
18923 # month and day are getting mixed up with each other.
18924 # TODO: also test that year isn't getting mixed up with month
18925 # or day, for example 01-02-03.
18927 # ISO8601 format. There are many, many, other variations
18928 # specified by ISO8601 which we should be testing too.
18929 dotest rcs-3 "${testcvs} -q log -d '1996-12-11<'" "
18930 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18931 Working file: file1
18937 keyword substitution: kv
18938 total revisions: 3; selected revisions: 1
18940 file1 is for testing CVS
18941 ----------------------------
18943 date: 2000/11/24 15:58:37; author: kingdon; state: Exp; lines: ${PLUS}1 -2
18944 delete second line; modify twelfth line
18945 ============================================================================="
18947 # RFC822 format (as amended by RFC1123).
18948 dotest rcs-4 "${testcvs} -q log -d '<3 Apr 2000 00:00'" \
18950 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18951 Working file: file1
18957 keyword substitution: kv
18958 total revisions: 3; selected revisions: 2
18960 file1 is for testing CVS
18961 ----------------------------
18963 date: 1996/11/24 15:57:41; author: kingdon; state: Exp; lines: ${PLUS}12 -0
18965 ----------------------------
18967 date: 1996/11/24 15:56:05; author: kingdon; state: Exp;
18969 ============================================================================="
18971 # Intended behavior for "cvs annotate" is that it displays the
18972 # last two digits of the year. Make sure it does that rather
18973 # than some bogosity like "100".
18974 dotest rcs-4a "${testcvs} annotate file1" \
18976 Annotations for file1
18977 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
18978 1\.1 (kingdon 24-Nov-96): This is the first line
18979 1\.2 (kingdon 24-Nov-96): This is the third line
18980 1\.2 (kingdon 24-Nov-96): This is the fourth line
18981 1\.2 (kingdon 24-Nov-96): This is the fifth line
18982 1\.2 (kingdon 24-Nov-96): This is the sixth line
18983 1\.2 (kingdon 24-Nov-96): This is the seventh line
18984 1\.2 (kingdon 24-Nov-96): This is the eighth line
18985 1\.2 (kingdon 24-Nov-96): This is the ninth line
18986 1\.2 (kingdon 24-Nov-96): This is the tenth line
18987 1\.2 (kingdon 24-Nov-96): This is the eleventh line
18988 1\.3 (kingdon 24-Nov-00): This is the twelfth line (and what a line it is)
18989 1\.2 (kingdon 24-Nov-96): This is the thirteenth line"
18991 # Probably should split this test into two at this point (file1
18992 # above this line and file2 below), as the two share little
18995 # OK, here is another one. This one was written by hand based on
18996 # doc/RCSFILES and friends. One subtle point is that none of
18997 # the lines end with newlines; that is a feature which we
18998 # should be testing.
18999 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file2,v
19003 symbols branch:1.2.6;
19005 testofanewphrase @without newphrase we'd have trouble extending @@ all@ ;
19006 1.5 date 71.01.01.01.00.00; author joe; state bogus; branches; next 1.4;
19007 1.4 date 71.01.01.00.00.05; author joe; state bogus; branches; next 1.3;
19008 1.3 date 70.12.31.15.00.05; author joe; state bogus; branches; next 1.2;
19009 1.2 date 70.12.31.12.15.05; author me; state bogus; branches 1.2.6.1; next 1.1;
19010 1.1 date 70.12.31.11.00.05; author joe; state bogus; branches; next; newph;
19011 1.2.6.1 date 71.01.01.08.00.05; author joe; state Exp; branches; next;
19013 1.5 log @@ newphrase1; newphrase2 42; text @head revision@
19014 1.4 log @@ text @d1 1
19017 1.3 log @@ text @d1 1
19020 1.2 log @@ text @d1 1
19027 1.2.6.1 log @@ text @d1 1
19031 # ' Match the single quote in above here doc -- for font-lock mode.
19033 # First test the default branch.
19034 dotest rcs-5 "${testcvs} -q update file2" "U file2"
19035 dotest rcs-6 "cat file2" "branch revision"
19037 # Check in a revision on the branch to force CVS to
19038 # interpret every revision in the file.
19039 dotest rcs-6a "${testcvs} -q update -r branch file2" ""
19040 echo "next branch revision" > file2
19041 dotest rcs-6b "${testcvs} -q ci -m mod file2" \
19042 "Checking in file2;
19043 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
19044 new revision: 1\.2\.6\.2; previous revision: 1\.2\.6\.1
19047 # Now get rid of the default branch, it will get in the way.
19048 dotest rcs-7 "${testcvs} admin -b file2" \
19049 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
19051 # But we do want to make sure that "cvs admin" leaves the newphrases
19053 # The extra whitespace regexps are for the RCS library, which does
19054 # not preserve whitespace in the dogmatic manner of RCS 5.7. -twp
19056 "grep testofanewphrase ${CVSROOT_DIRNAME}/first-dir/file2,v" \
19057 "testofanewphrase[ ][ ]*@without newphrase we'd have trouble extending @@ all@[ ]*;"
19058 # The easiest way to test for newphrases in deltas and deltatexts
19059 # is to just look at the whole file, I guess.
19060 dotest rcs-8a "cat ${CVSROOT_DIRNAME}/first-dir/file2,v" \
19067 testofanewphrase @without newphrase we'd have trouble extending @@ all@;
19070 date 71\.01\.01\.01\.00\.00; author joe; state bogus;
19075 date 71\.01\.01\.00\.00\.05; author joe; state bogus;
19080 date 70\.12\.31\.15\.00\.05; author joe; state bogus;
19085 date 70\.12\.31\.12\.15\.05; author me; state bogus;
19091 date 70\.12\.31\.11\.00\.05; author joe; state bogus;
19097 date 71\.01\.01\.08\.00\.05; author joe; state Exp;
19102 date [0-9.]*; author ${username}; state Exp;
19172 next branch revision
19175 dotest rcs-9 "${testcvs} -q update -p -D '1970-12-31 11:30 UT' file2" \
19178 dotest rcs-10 "${testcvs} -q update -p -D '1970-12-31 12:30 UT' file2" \
19181 dotest rcs-11 "${testcvs} -q update -p -D '1971-01-01 00:30 UT' file2" \
19182 "new year revision"
19184 # Same test as rcs-10, but with am/pm.
19185 dotest rcs-12 "${testcvs} -q update -p -D 'December 31, 1970 12:30pm UT' file2" \
19188 # Same test as rcs-11, but with am/pm.
19189 dotest rcs-13 "${testcvs} -q update -p -D 'January 1, 1971 12:30am UT' file2" \
19190 "new year revision"
19192 # OK, now make sure cvs log doesn't have any trouble with the
19193 # newphrases and such.
19194 dotest rcs-14 "${testcvs} -q log file2" "
19195 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
19196 Working file: file2
19203 keyword substitution: kv
19204 total revisions: 7; selected revisions: 7
19206 ----------------------------
19208 date: 1971/01/01 01:00:00; author: joe; state: bogus; lines: ${PLUS}1 -1
19209 \*\*\* empty log message \*\*\*
19210 ----------------------------
19212 date: 1971/01/01 00:00:05; author: joe; state: bogus; lines: ${PLUS}1 -1
19213 \*\*\* empty log message \*\*\*
19214 ----------------------------
19216 date: 1970/12/31 15:00:05; author: joe; state: bogus; lines: ${PLUS}1 -1
19217 \*\*\* empty log message \*\*\*
19218 ----------------------------
19220 date: 1970/12/31 12:15:05; author: me; state: bogus; lines: ${PLUS}1 -1
19222 \*\*\* empty log message \*\*\*
19223 ----------------------------
19225 date: 1970/12/31 11:00:05; author: joe; state: bogus;
19226 \*\*\* empty log message \*\*\*
19227 ----------------------------
19228 revision 1\.2\.6\.2
19229 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
19231 ----------------------------
19232 revision 1\.2\.6\.1
19233 date: 1971/01/01 08:00:05; author: joe; state: Exp; lines: ${PLUS}1 -1
19234 \*\*\* empty log message \*\*\*
19235 ============================================================================="
19236 # Now test each date format for "cvs log -d".
19237 # Earlier than 1971-01-01
19238 dotest rcs-15 "${testcvs} -q log -d '<1971-01-01 00:00 GMT' file2 \
19240 "total revisions: 7; selected revisions: 3
19244 # Later than 1971-01-01
19245 dotest rcs-16 "${testcvs} -q log -d '1971-01-01 00:00 GMT<' file2 \
19247 "total revisions: 7; selected revisions: 4
19250 revision 1\.2\.6\.2
19251 revision 1\.2\.6\.1"
19252 # Alternate syntaxes for later and earlier; multiple -d options
19253 dotest rcs-17 "${testcvs} -q log -d '>1971-01-01 00:00 GMT' \
19254 -d '1970-12-31 12:15 GMT>' file2 | grep revision" \
19255 "total revisions: 7; selected revisions: 5
19259 revision 1\.2\.6\.2
19260 revision 1\.2\.6\.1"
19261 # Range, and single date
19262 dotest rcs-18 "${testcvs} -q log -d '1970-12-31 11:30 GMT' \
19263 -d '1971-01-01 00:00:05 GMT<1971-01-01 01:00:01 GMT' \
19264 file2 | grep revision" \
19265 "total revisions: 7; selected revisions: 2
19268 # Alternate range syntax; equality
19269 dotest rcs-19 "${testcvs} -q log \
19270 -d '1971-01-01 01:00:01 GMT>=1971-01-01 00:00:05 GMT' \
19271 file2 | grep revision" \
19272 "total revisions: 7; selected revisions: 2
19279 rm -rf ${CVSROOT_DIRNAME}/first-dir
19283 # More date tests. Might as well do this as a separate
19284 # test from "rcs", so that we don't need to perturb the
19285 # "written by RCS 5.7" RCS file.
19286 mkdir ${CVSROOT_DIRNAME}/first-dir
19287 # Significance of various dates:
19288 # * At least one Y2K standard refers to recognizing 9 Sep 1999
19289 # (as an example of a pre-2000 date, I guess).
19290 # * At least one Y2K standard refers to recognizing 1 Jan 2001
19291 # (as an example of a post-2000 date, I guess).
19292 # * Many Y2K standards refer to 2000 being a leap year.
19293 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
19294 head 1.7; access; symbols; locks; strict;
19295 1.7 date 2004.08.31.01.01.01; author sue; state; branches; next 1.6;
19296 1.6 date 2004.02.29.01.01.01; author sue; state; branches; next 1.5;
19297 1.5 date 2003.02.28.01.01.01; author sue; state; branches; next 1.4;
19298 1.4 date 2001.01.01.01.01.01; author sue; state; branches; next 1.3;
19299 1.3 date 2000.02.29.01.01.01; author sue; state; branches; next 1.2;
19300 1.2 date 99.09.09.01.01.01; author sue; state; branches; next 1.1;
19301 1.1 date 98.09.10.01.01.01; author sue; state; branches; next;
19303 1.7 log @@ text @head revision@
19304 1.6 log @@ text @d1 1
19306 2004 was a great year for leaping@
19307 1.5 log @@ text @d1 1
19310 1.4 log @@ text @d1 1
19313 1.3 log @@ text @d1 1
19315 2000 is also a good year for leaping@
19316 1.2 log @@ text @d1 1
19318 Tonight we're going to party like it's a certain year@
19319 1.1 log @@ text @d1 1
19321 Need to start somewhere@
19323 # ' Match the 3rd single quote in the here doc -- for font-lock mode.
19325 dotest rcs2-1 "${testcvs} -q co first-dir" 'U first-dir/file1'
19329 dotest rcs2-2 "${testcvs} -q update -p -D '1999-09-09 11:30 UT' file1" \
19330 "Tonight we're going to party like it's a certain year"
19332 dotest rcs2-3 "${testcvs} -q update -p -D '2001-01-01 11:30 UT' file1" \
19335 dotest rcs2-4 "${testcvs} -q update -p -D '2000-02-29 11:30 UT' file1" \
19336 "2000 is also a good year for leaping"
19337 # 29 Feb 2003 is invalid
19338 dotest_fail rcs2-5 "${testcvs} -q update -p -D '2003-02-29 11:30 UT' file1" \
19339 "${PROG} \[[a-z]* aborted\]: Can't parse date/time: 2003-02-29 11:30 UT"
19341 dotest rcs2-6 "${testcvs} -q update -p -D 2007-01-07 file1" \
19343 # This assumes that the clock of the machine running the tests
19344 # is set to at least the year 1998 or so. There don't seem
19345 # to be a lot of ways to test the relative date code (short
19346 # of something like LD_LIBRARY_PRELOAD'ing in our own
19347 # getttimeofday, or hacking the CVS source with testing
19348 # features, which always seems to be problematic since then
19349 # someone feels like documenting them and things go downhill
19352 # These tests can be expected to fail 3 times every 400 years
19353 # starting Feb. 29, 2096 (because 8 years from that date would
19354 # be Feb. 29, 2100, which is an invalid date -- 2100 isn't a
19355 # leap year because it's divisible by 100 but not by 400).
19357 dotest rcs2-7 "${testcvs} -q update -p -D '96 months' file1" \
19359 dotest rcs2-8 "${testcvs} -q update -p -D '8 years' file1" \
19364 rm -rf ${CVSROOT_DIRNAME}/first-dir
19368 # More RCS file tests, in particular at least some of the
19369 # error handling issues.
19370 mkdir ${CVSROOT_DIRNAME}/first-dir
19371 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
19372 head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
19373 ; author jeremiah ;state ; branches; next;desc@@1.1log@@text@head@
19376 # CVS requires whitespace between "desc" and its value.
19377 # The rcsfile(5) manpage doesn't really seem to answer the
19378 # question one way or the other (it has a grammar but almost
19379 # nothing about lexical analysis).
19380 dotest_fail rcs3-1 "${testcvs} -q co first-dir" \
19381 "${PROG} \[checkout aborted\]: EOF while looking for value in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
19382 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
19383 head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
19384 ; author jeremiah ;state ; branches; next;desc @@1.1log@@text@head@
19386 # Whitespace issues, likewise.
19387 dotest_fail rcs3-2 "${testcvs} -q co first-dir" \
19388 "${PROG} \[checkout aborted\]: unexpected '.x6c' reading revision number in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
19389 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
19390 head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
19391 ; author jeremiah ;state ; branches; next;desc @@1.1 log@@text@head@
19393 # Charming array of different messages for similar
19394 # whitespace issues (depending on where the whitespace is).
19395 dotest_fail rcs3-3 "${testcvs} -q co first-dir" \
19396 "${PROG} \[checkout aborted\]: EOF while looking for value in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
19397 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
19398 head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
19399 ; author jeremiah ;state ; branches; next;desc @@1.1 log @@text @head@
19401 dotest rcs3-4 "${testcvs} -q co first-dir" 'U first-dir/file1'
19403 # Ouch, didn't expect this one. FIXCVS. Or maybe just remove
19404 # the feature, if this is a -s problem?
19405 dotest_fail rcs3-5 "${testcvs} log -s nostate first-dir/file1" \
19406 "${DOTSTAR}ssertion.*failed${DOTSTAR}" "${DOTSTAR}failed assertion${DOTSTAR}"
19408 dotest_fail rcs3-5a "${testcvs} log -s nostate file1" \
19409 "${DOTSTAR}ssertion.*failed${DOTSTAR}" "${DOTSTAR}failed assertion${DOTSTAR}"
19412 # See remote code above for rationale for cd.
19414 dotest rcs3-6 "${testcvs} log -R file1" \
19415 "${CVSROOT_DIRNAME}/first-dir/file1,v"
19417 # OK, now put an extraneous '\0' at the end.
19418 ${AWK} </dev/null 'BEGIN { printf "@%c", 10 }' | ${TR} '@' '\000' \
19419 >>${CVSROOT_DIRNAME}/first-dir/file1,v
19420 dotest_fail rcs3-7 "${testcvs} log -s nostate file1" \
19421 "${PROG} \[log aborted\]: unexpected '.x0' reading revision number in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
19425 rm -rf ${CVSROOT_DIRNAME}/first-dir
19429 # Fix a bug that shows up when checking out files by date with the
19430 # "-D date" command line option. There is code in the original to
19431 # handle a special case. If the date search finds revision 1.1 it
19432 # is supposed to check whether revision 1.1.1.1 has the same date
19433 # stamp, which would indicate that the file was originally brought
19434 # in with "cvs import". In that case it is supposed to return the
19435 # vendor branch version 1.1.1.1.
19437 # However, there is a bug in the code. It actually compares
19438 # the date of revision 1.1 for equality with the date given
19439 # on the command line -- clearly wrong. This commit fixes
19442 # There is an additional bug which is _not_ fixed yet.
19443 # The date comparison should not be a strict
19444 # equality test. It should allow a fudge factor of, say, 2-3
19445 # seconds. Old versions of CVS created the two revisions
19446 # with two separate invocations of the RCS "ci" command. We
19447 # have many old files in the tree in which the dates of
19448 # revisions 1.1 and 1.1.1.1 differ by 1 second.
19455 echo 'OpenMunger sources' >file1
19457 # choose a time in the past to demonstrate the problem
19458 TZ=GMT touch -t 200012010123 file1
19460 dotest_sort rcs4-1 \
19461 "${testcvs} import -d -m add rcs4-dir openmunger openmunger-1_0" \
19465 No conflicts created by this import'
19466 echo 'OpenMunger sources release 1.1 extras' >>file1
19467 TZ=GMT touch -t 200112011234 file1
19468 dotest_sort rcs4-2 \
19469 "${testcvs} import -d -m add rcs4-dir openmunger openmunger-1_1" \
19472 No conflicts created by this import
19475 # Next checkout the new module
19477 "${testcvs} -q co rcs4-dir" \
19480 echo 'local change' >> file1
19482 # commit a local change
19484 "${testcvs} -q commit -m hack file1" \
19485 "Checking in file1;
19486 ${CVSROOT_DIRNAME}/rcs4-dir/file1,v <-- file1
19487 new revision: 1\.2; previous revision: 1\.1
19489 # now see if we get version 1.1 or 1.1.1.1 when we ask for
19490 # a checkout by time... it really should be 1.1.1.1 as
19491 # that was indeed the version that was visible at the target
19494 "${testcvs} -q update -D 'October 1, 2001 UTC' file1" \
19497 "${testcvs} -q status file1" \
19498 '===================================================================
19499 File: file1 Status: Up-to-date
19501 Working revision: 1\.1\.1\.1.*
19502 Repository revision: 1\.1\.1\.1 '${CVSROOT_DIRNAME}'/rcs4-dir/file1,v
19504 Sticky Date: 2001\.10\.01\.00\.00\.00
19505 Sticky Options: (none)'
19508 echo Keeping ${TESTDIR} and exiting due to --keep
19514 rm -rf ${CVSROOT_DIRNAME}/rcs4-dir
19518 # Tests of CVS lock files.
19519 # TODO-maybe: Add a test where we arrange for a loginfo
19520 # script (or some such) to ensure that locks are in place
19521 # so then we can see how they are behaving.
19526 echo file >sdir/ssdir/file1
19527 dotest lockfiles-1 \
19528 "${testcvs} -Q import -m import-it first-dir bar baz" ""
19532 dotest lockfiles-2 "${testcvs} -q co first-dir" \
19533 "U first-dir/sdir/ssdir/file1"
19534 dotest lockfiles-3 "${testcvs} -Q co CVSROOT" ""
19536 echo "LockDir=${TESTDIR}/locks" >config
19537 dotest lockfiles-4 "${testcvs} -q ci -m config-it" \
19538 "Checking in config;
19539 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
19540 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19542 ${PROG} commit: Rebuilding administrative file database"
19543 cd ../first-dir/sdir/ssdir
19544 # The error message appears twice because Lock_Cleanup only
19545 # stops recursing after the first attempt.
19546 dotest_fail lockfiles-5 "${testcvs} -q update" \
19547 "${PROG} \[update aborted\]: cannot stat ${TESTDIR}/locks: No such file or directory
19548 ${PROG} \[update aborted\]: cannot stat ${TESTDIR}/locks: No such file or directory"
19549 mkdir ${TESTDIR}/locks
19550 # Grumble, mumble. Cygwin.
19551 if test -n "$remotehost"; then
19552 $CVS_RSH $remotehost "chmod u=rwx,g=r,o= ${TESTDIR}/locks"
19554 chmod u=rwx,g=r,o= ${TESTDIR}/locks
19557 CVSUMASK=0077; export CVSUMASK
19558 dotest lockfiles-6 "${testcvs} -q update" ""
19559 # TODO: should also be testing that CVS continues to honor the
19560 # umask and CVSUMASK normally. In the case of the umask, CVS
19561 # doesn't seem to use it for much (although it perhaps should).
19562 dotest lockfiles-7 "ls ${TESTDIR}/locks/first-dir/sdir/ssdir" ""
19564 # The policy is that when CVS creates new lock directories, they
19565 # inherit the permissions from the parent directory. CVSUMASK
19566 # isn't right, because typically the reason for LockDir is to
19567 # use a different set of permissions.
19570 if test -n "$remotehost"; then
19571 dotest lockfiles-7a "$CVS_RSH $remotehost 'ls -ld ${TESTDIR}/locks/first-dir'" \
19572 "drwxr-----.*first-dir"
19573 dotest lockfiles-7b "$CVS_RSH $remotehost 'ls -ld ${TESTDIR}/locks/first-dir/sdir/ssdir'" \
19574 "drwxr-----.*first-dir/sdir/ssdir"
19576 dotest lockfiles-7a "ls -ld ${TESTDIR}/locks/first-dir" \
19577 "drwxr-----.*first-dir"
19578 dotest lockfiles-7b "ls -ld ${TESTDIR}/locks/first-dir/sdir/ssdir" \
19579 "drwxr-----.*first-dir/sdir/ssdir"
19583 dotest lockfiles-8 "${testcvs} -q update" ""
19584 dotest lockfiles-9 "${testcvs} -q co -l ." ""
19587 echo "# nobody here but us comments" >config
19588 dotest lockfiles-cleanup-1 "${testcvs} -q ci -m config-it" \
19589 "Checking in config;
19590 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
19591 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19593 ${PROG} commit: Rebuilding administrative file database"
19595 # Perhaps should restore the umask and CVSUMASK to what they
19596 # were before. But the other tests "should" not care about them...
19599 rm -r ${TESTDIR}/locks
19601 rm -rf ${CVSROOT_DIRNAME}/first-dir
19605 # Tests to make sure we get the expected behavior
19606 # when we recover a repository from an old backup
19609 # Backup will be older than some developer's workspaces
19610 # This means the first attempt at an update will fail
19611 # The workaround for this is to replace the CVS
19612 # directories with those from a "new" checkout from
19613 # the recovered repository. Due to this, multiple
19614 # merges should cause conflicts (the same data
19615 # will be merged more than once).
19616 # A workspace updated before the date of the recovered
19617 # copy will not need any extra attention
19619 # Note that backuprecover-15 is probably a failure case
19620 # If nobody else had a more recent update, the data would be lost
19622 # Granted, the developer should have been notified not to do this
19623 # by now, but still...
19625 mkdir backuprecover; cd backuprecover
19627 dotest backuprecover-1 "${testcvs} -q co -l ." ''
19629 dotest backuprecover-2 "${testcvs} add first-dir" \
19630 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
19633 dotest backuprecover-3 "${testcvs} add dir" \
19634 "Directory ${CVSROOT_DIRNAME}/first-dir/dir added to the repository"
19635 touch file1 dir/file2
19636 dotest backuprecover-4 "${testcvs} -q add file1 dir/file2" \
19637 "${PROG} add: use .${PROG} commit. to add these files permanently"
19638 dotest backuprecover-5 "${testcvs} -q ci -mtest" \
19639 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19642 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19643 initial revision: 1\.1
19645 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
19647 Checking in dir/file2;
19648 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
19649 initial revision: 1\.1
19651 echo "Line one" >>file1
19652 echo " is the place" >>file1
19653 echo " we like to begin" >>file1
19654 echo "Anything else" >>file1
19655 echo " looks like" >>file1
19656 echo " a sin" >>file1
19657 echo "File 2" >>dir/file2
19658 echo " is the place" >>dir/file2
19659 echo " the rest of it goes" >>dir/file2
19660 echo "Why I don't use" >>dir/file2
19661 echo " something like 'foo'" >>dir/file2
19662 echo " God only knows" >>dir/file2
19663 dotest backuprecover-6 "${testcvs} -q ci -mtest" \
19664 "Checking in file1;
19665 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19666 new revision: 1\.2; previous revision: 1\.1
19668 Checking in dir/file2;
19669 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
19670 new revision: 1\.2; previous revision: 1\.1
19673 # Simulate the lazy developer
19674 # (he did some work but didn't check it in...)
19677 dotest backuprecover-7 "${testcvs} -Q co first-dir" ''
19679 sed -e "s/looks like/just looks like/" file1 >tmp; mv tmp file1
19680 sed -e "s/don't use/don't just use/" dir/file2 >tmp; mv tmp dir/file2
19682 # developer 1 is on a roll
19683 cd ../../1/first-dir
19684 echo "I need some more words" >>file1
19685 echo " to fill up this space" >>file1
19686 echo " anything else would be a disgrace" >>file1
19687 echo "My rhymes cross many boundries" >>dir/file2
19688 echo " this time it's files" >>dir/file2
19689 echo " a word that fits here would be something like dials" >>dir/file2
19690 dotest backuprecover-8 "${testcvs} -q ci -mtest" \
19691 "Checking in file1;
19692 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19693 new revision: 1\.3; previous revision: 1\.2
19695 Checking in dir/file2;
19696 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
19697 new revision: 1\.3; previous revision: 1\.2
19700 # Save a backup copy
19701 cp -r ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/backup
19703 # Simulate developer 3
19706 dotest backuprecover-9a "${testcvs} -Q co first-dir" ''
19710 echo "Developer 1 makes very lame rhymes" >>file1
19711 echo " I think he should quit and become a mime" >>file1
19712 echo "What the %*^# kind of rhyme crosses a boundry?" >>dir/file2
19713 echo " I think you should quit and get a job in the foundry" >>dir/file2
19714 dotest backuprecover-9b "${testcvs} -q ci -mtest" \
19715 "Checking in file1;
19716 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19717 new revision: 1\.4; previous revision: 1\.3
19719 Checking in dir/file2;
19720 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
19721 new revision: 1\.4; previous revision: 1\.3
19724 # Developer 4 so we can simulate a conflict later...
19727 dotest backuprecover-10 "${testcvs} -Q co first-dir" ''
19729 sed -e "s/quit and/be fired so he can/" dir/file2 >tmp; mv tmp dir/file2
19731 # And back to developer 1
19732 cd ../../1/first-dir
19733 dotest backuprecover-11 "${testcvs} -Q update" ''
19736 echo "Oh yeah, well rhyme this" >>file1
19737 echo " developer three" >>file1
19738 echo " you want opposition" >>file1
19739 echo " you found some in me!" >>file1
19740 echo "I'll give you mimes" >>dir/file2
19741 echo " and foundries galore!" >>dir/file2
19742 echo " your head will spin" >>dir/file2
19743 echo " once you find what's in store!" >>dir/file2
19744 dotest backuprecover-12 "${testcvs} -q ci -mtest" \
19745 "Checking in file1;
19746 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19747 new revision: 1\.5; previous revision: 1\.4
19749 Checking in dir/file2;
19750 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
19751 new revision: 1\.5; previous revision: 1\.4
19754 # developer 3'll do a bit of work that never gets checked in
19755 cd ../../3/first-dir
19756 dotest backuprecover-13 "${testcvs} -Q update" ''
19757 sed -e "s/very/some extremely/" file1 >tmp; mv tmp file1
19758 dotest backuprecover-14 "${testcvs} -q ci -mtest" \
19759 "Checking in file1;
19760 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19761 new revision: 1\.6; previous revision: 1\.5
19764 echo "Tee hee hee hee" >>file1
19766 echo "Find what's in store?" >>dir/file2
19767 echo " Oh, I'm so sure!" >>dir/file2
19768 echo " You've got an ill, and I have the cure!" >>dir/file2
19770 # Slag the original and restore it a few revisions back
19771 rm -rf ${CVSROOT_DIRNAME}/first-dir
19772 mv ${CVSROOT_DIRNAME}/backup ${CVSROOT_DIRNAME}/first-dir
19774 # Have developer 1 try an update and lose some data
19776 # Feel free to imagine the horrific scream of despair
19777 cd ../../1/first-dir
19778 dotest backuprecover-15 "${testcvs} update" \
19779 "${PROG} update: Updating .
19781 ${PROG} update: Updating dir
19784 # Developer 3 tries the same thing (he has an office)
19785 # but fails without losing data since all of his files have
19786 # uncommitted changes
19787 cd ../../3/first-dir
19788 dotest_fail backuprecover-16 "${testcvs} update" \
19789 "${PROG} update: Updating \.
19790 ${PROG} \[update aborted\]: could not find desired version 1\.6 in ${CVSROOT_DIRNAME}/first-dir/file1,v"
19792 # create our workspace fixin' script
19797 # This script will copy the CVS database dirs from the checked out
19798 # version of a newly recovered repository and replace the CVS
19799 # database dirs in a workspace with later revisions than those in the
19800 # recovered repository
19802 DATADIRS=\`find . -name CVS -print\`
19804 find . -name CVS -print | xargs rm -rf
19805 for file in \${DATADIRS}; do
19806 cp -r ../repos-first-dir/\${file} \${file}
19809 # We only need to fix the workspaces of developers 3 and 4
19810 # (1 lost all her data and 2 has an update date from
19811 # before the date the backup was made)
19813 dotest backuprecover-17 \
19814 "${testcvs} -Q co -d repos-first-dir first-dir" ''
19816 dotest backuprecover-18 \
19817 "${testcvs} -Q co -d repos-first-dir first-dir" ''
19819 cd ../3; sh ../fixit
19821 # (re)commit developer 3's stuff
19823 dotest backuprecover-19 "${testcvs} -q ci -mrecover/merge" \
19824 "Checking in file1;
19825 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19826 new revision: 1\.4; previous revision: 1\.3
19828 Checking in dir/file2;
19829 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
19830 new revision: 1\.4; previous revision: 1\.3
19833 # and we should get a conflict on developer 4's stuff
19834 cd ../../4/first-dir
19835 dotest backuprecover-20 "${testcvs} update" \
19836 "${PROG} update: Updating \.
19837 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19838 retrieving revision 1\.3
19839 retrieving revision 1\.4
19840 Merging differences between 1\.3 and 1\.4 into file1
19841 rcsmerge: warning: conflicts during merge
19842 ${PROG} update: conflicts found in file1
19844 ${PROG} update: Updating dir
19845 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
19846 retrieving revision 1\.3
19847 retrieving revision 1\.4
19848 Merging differences between 1\.3 and 1\.4 into file2
19849 rcsmerge: warning: conflicts during merge
19850 ${PROG} update: conflicts found in dir/file2
19853 "/^<<<<<<</,/^=======/d
19854 /^>>>>>>>/d" file1 >tmp; mv tmp file1
19856 "/^<<<<<<</,/^=======/d
19858 s/quit and/be fired so he can/" dir/file2 >tmp; mv tmp dir/file2
19859 dotest backuprecover-21 "${testcvs} -q ci -mrecover/merge" \
19860 "Checking in dir/file2;
19861 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
19862 new revision: 1\.5; previous revision: 1\.4
19865 # go back and commit developer 2's stuff to prove it can still be done
19866 cd ../../2/first-dir
19867 dotest backuprecover-22 "${testcvs} -Q update" \
19868 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19869 retrieving revision 1\.2
19870 retrieving revision 1\.4
19871 Merging differences between 1\.2 and 1\.4 into file1
19872 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
19873 retrieving revision 1\.2
19874 retrieving revision 1\.5
19875 Merging differences between 1\.2 and 1\.5 into file2"
19876 dotest backuprecover-23 "${testcvs} -q ci -mtest" \
19877 "Checking in file1;
19878 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19879 new revision: 1\.5; previous revision: 1\.4
19881 Checking in dir/file2;
19882 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
19883 new revision: 1\.6; previous revision: 1\.5
19886 # and restore the data to developer 1
19887 cd ../../1/first-dir
19888 dotest backuprecover-24 "${testcvs} -Q update" ''
19891 rm -r backuprecover
19892 rm -rf ${CVSROOT_DIRNAME}/first-dir
19896 # CVSROOT/history tests:
19897 # history: various "cvs history" invocations
19898 # basic2: Generating the CVSROOT/history file via CVS commands.
19900 # Put in some data for the history file (discarding what was
19901 # there before). Note that this file format is fixed; the
19902 # user may wish to analyze data from a previous version of
19903 # CVS. If we phase out this format, it should be done
19904 # slowly and carefully.
19905 cat >${CVSROOT_DIRNAME}/CVSROOT/history <<EOF
19906 O3395c677|anonymous|<remote>/*0|ccvs||ccvs
19907 O3396c677|anonymous|<remote>/src|ccvs||src
19908 O3397c677|kingdon|<remote>/*0|ccvs||ccvs
19909 M339cafae|nk|<remote>|ccvs/src|1.229|sanity.sh
19910 M339cafff|anonymous|<remote>|ccvs/src|1.23|Makefile
19911 M339dc339|kingdon|~/work/*0|ccvs/src|1.231|sanity.sh
19912 W33a6eada|anonymous|<remote>*4|ccvs/emx||Makefile.in
19913 C3b235f50|kingdon|<remote>|ccvs/emx|1.3|README
19914 M3b23af50|kingdon|~/work/*0|ccvs/doc|1.281|cvs.texinfo
19916 dotest history-1 "${testcvs} history -e -a" \
19917 "O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
19918 O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src= <remote>/\*
19919 M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
19920 W 1997-06-17 19:51 ${PLUS}0000 anonymous Makefile\.in ccvs/emx == <remote>/emx
19921 O 1997-06-06 08:12 ${PLUS}0000 kingdon ccvs =ccvs= <remote>/\*
19922 M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
19923 C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
19924 M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc
19925 M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
19927 dotest history-2 "${testcvs} history -e -a -D '10 Jun 1997 13:00 UT'" \
19928 "W 1997-06-17 19:51 ${PLUS}0000 anonymous Makefile\.in ccvs/emx == <remote>/emx
19929 M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
19930 C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
19931 M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc"
19933 dotest history-3 "${testcvs} history -e -a -D '10 Jun 2001 13:00 UT'" \
19934 "M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc"
19936 dotest history-4 "${testcvs} history -ac sanity.sh" \
19937 "M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
19938 M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
19940 dotest history-5 "${testcvs} history -a -xCGUWAMR README sanity.sh" \
19941 "M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
19942 C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
19943 M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
19945 dotest history-6 "${testcvs} history -xCGUWAMR -a -f README -f sanity.sh" \
19946 "M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
19947 C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
19948 M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
19950 dotest history-7 "${testcvs} history -xCGUWAMR -a -f sanity.sh README" \
19951 "M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
19952 C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
19953 M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
19955 dotest history-8 "${testcvs} history -ca -D '1970-01-01 00:00 UT'" \
19956 "M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity.sh ccvs/src == <remote>
19957 M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
19958 M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity.sh ccvs/src == ~/work/ccvs/src
19959 M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc"
19961 dotest history-9 "${testcvs} history -acl" \
19962 "M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc
19963 M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
19964 M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity.sh ccvs/src == ~/work/ccvs/src"
19966 dotest history-10 "${testcvs} history -lca -D '1970-01-01 00:00 UT'" \
19967 "M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc
19968 M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
19969 M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity.sh ccvs/src == ~/work/ccvs/src"
19971 dotest history-11 "${testcvs} history -aw" \
19972 "O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
19973 O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src= <remote>/\*
19974 O 1997-06-06 08:12 ${PLUS}0000 kingdon ccvs =ccvs= <remote>/\*"
19976 dotest history-12 "${testcvs} history -aw -D'1970-01-01 00:00 UT'" \
19977 "O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
19978 O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src= <remote>/\*
19979 O 1997-06-06 08:12 ${PLUS}0000 kingdon ccvs =ccvs= <remote>/\*"
19984 # Test ability to operate on big files. Intention is to
19985 # test various realloc'ing code in RCS_deltas, rcsgetkey,
19986 # etc. "big" is currently defined to be 1000 lines (64000
19987 # bytes), which in terms of files that users will use is not
19988 # large, merely average, but my reasoning is that this
19989 # should be big enough to make sure realloc'ing is going on
19990 # and that raising it a lot would start to stress resources
19991 # on machines which run the tests, without any significant
19994 mkdir ${CVSROOT_DIRNAME}/first-dir
19995 dotest big-1 "${testcvs} -q co first-dir" ''
19997 for i in 0 1 2 3 4 5 6 7 8 9; do
19998 for j in 0 1 2 3 4 5 6 7 8 9; do
19999 for k in 0 1 2 3 4 5 6 7 8 9; do
20001 "This is line ($i,$j,$k) which goes into the file file1 for testing" >>file1
20005 dotest big-2 "${testcvs} add file1" \
20006 "${PROG} add: scheduling file .file1. for addition
20007 ${PROG} add: use .${PROG} commit. to add this file permanently"
20008 dotest big-3 "${testcvs} -q ci -m add" \
20009 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20012 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
20013 initial revision: 1\.1
20018 dotest big-4 "${testcvs} -q get first-dir" "U first-dir/file1"
20020 echo "add a line to the end" >>file1
20021 dotest big-5 "${testcvs} -q ci -m modify" \
20022 "Checking in file1;
20023 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
20024 new revision: 1\.2; previous revision: 1\.1
20027 # The idea here is particularly to test the Rcs-diff response
20028 # and the reallocing thereof, for remote.
20029 dotest big-6 "${testcvs} -q update" "[UP] file1"
20033 echo Keeping ${TESTDIR} and exiting due to --keep
20038 rm -rf ${CVSROOT_DIRNAME}/first-dir
20042 # Test repository permissions (CVSUMASK and so on).
20043 # Although the tests in this section "cheat" by testing
20044 # repository permissions, which are sort of not a user-visible
20045 # sort of thing, the modes do have user-visible consequences,
20046 # such as whether a second user can check out the files. But
20047 # it would be awkward to test the consequences, so we don't.
20049 # Solaris /bin/sh doesn't support export -n. I'm not sure
20050 # what we can do about this, other than hope that whoever
20051 # is running the tests doesn't have CVSUMASK set.
20052 #export -n CVSUMASK # if unset, defaults to 002
20056 dotest modes-1 "${testcvs} -q co -l ." ''
20058 dotest modes-2 "${testcvs} add first-dir" \
20059 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20062 dotest modes-3 "${testcvs} add aa" \
20063 "${PROG} add: scheduling file .aa. for addition
20064 ${PROG} add: use .${PROG} commit. to add this file permanently"
20065 dotest modes-4 "${testcvs} -q ci -m add" \
20066 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
20069 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
20070 initial revision: 1\.1
20073 if test -n "$remotehost"; then
20074 dotest modes-5remotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v'" \
20077 dotest modes-5 "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
20081 # Test for whether we can set the execute bit.
20083 echo change it >>aa
20084 dotest modes-6 "${testcvs} -q ci -m set-execute-bit" \
20086 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
20087 new revision: 1\.2; previous revision: 1\.1
20089 # If CVS let us update the execute bit, it would be set here.
20090 # But it doesn't, and as far as I know that is longstanding
20093 # Yeah, yeah. Search for "Cygwin".
20094 if test -n "$remotehost"; then
20095 dotest modes-7remotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v'" \
20098 dotest modes-7 "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
20102 # OK, now manually change the modes and see what happens.
20105 if test -n "$remotehost"; then
20106 $CVS_RSH $remotehost "chmod g=r,o= ${CVSROOT_DIRNAME}/first-dir/aa,v"
20108 chmod g=r,o= ${CVSROOT_DIRNAME}/first-dir/aa,v
20110 echo second line >>aa
20111 dotest modes-7a "${testcvs} -q ci -m set-execute-bit" \
20113 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
20114 new revision: 1\.3; previous revision: 1\.2
20117 if test -n "$remotehost"; then
20118 dotest modes-7bremotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v'" \
20121 dotest modes-7b "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
20128 # Might as well test the execute bit too.
20130 dotest modes-8 "${testcvs} add ab" \
20131 "${PROG} add: scheduling file .ab. for addition
20132 ${PROG} add: use .${PROG} commit. to add this file permanently"
20133 dotest modes-9 "${testcvs} -q ci -m add" \
20134 "RCS file: ${CVSROOT_DIRNAME}/first-dir/ab,v
20137 ${CVSROOT_DIRNAME}/first-dir/ab,v <-- ab
20138 initial revision: 1\.1
20141 # The problem here is that the CVSUMASK environment variable
20142 # needs to be set on the server (e.g. .bashrc). This is, of
20143 # course, bogus, but that is the way it is currently.
20144 if test -n "$remotehost"; then
20145 dotest modes-10remotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/ab,v'" \
20148 dotest modes-10r "ls -l ${CVSROOT_DIRNAME}/first-dir/ab,v" \
20149 "-r-xr-x---.*" "-r-xr-xr-x.*"
20152 dotest modes-10 "ls -l ${CVSROOT_DIRNAME}/first-dir/ab,v" \
20156 # OK, now add a file on a branch. Check that the mode gets
20157 # set the same way (it is a different code path in CVS).
20158 dotest modes-11 "${testcvs} -q tag -b br" 'T aa
20160 dotest modes-12 "${testcvs} -q update -r br" ''
20162 dotest modes-13 "${testcvs} add ac" \
20163 "${PROG} add: scheduling file .ac. for addition on branch .br.
20164 ${PROG} add: use .${PROG} commit. to add this file permanently"
20165 # Not sure it really makes sense to refer to a "previous revision"
20166 # when we are just now adding the file; as far as I know
20167 # that is longstanding CVS behavior, for what it's worth.
20168 dotest modes-14 "${testcvs} -q ci -m add" \
20169 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v
20172 ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v <-- ac
20173 new revision: 1\.1\.2\.1; previous revision: 1\.1
20176 # The problem here is that the CVSUMASK environment variable
20177 # needs to be set on the server (e.g. .bashrc). This is, of
20178 # course, bogus, but that is the way it is currently. The
20179 # first match is for the :ext: method (where the CVSUMASK
20180 # won't be set), while the second is for the :fork: method
20181 # (where it will be).
20182 if test -n "$remotehost"; then
20184 "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v'" \
20188 "ls -l ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v" \
20189 "-r--r--r--.*" "-r--r-----.*"
20193 "ls -l ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v" \
20199 rm -rf ${CVSROOT_DIRNAME}/first-dir
20200 # Perhaps should restore the umask and CVSUMASK. But the other
20201 # tests "should" not care about them...
20205 # More tests of file permissions in the working directory
20206 # and that sort of thing.
20208 # The usual setup, file first-dir/aa with two revisions.
20210 dotest modes2-1 "${testcvs} -q co -l ." ''
20212 dotest modes2-2 "${testcvs} add first-dir" \
20213 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20216 dotest modes2-3 "${testcvs} add aa" \
20217 "${PROG} add: scheduling file .aa. for addition
20218 ${PROG} add: use .${PROG} commit. to add this file permanently"
20219 dotest modes2-4 "${testcvs} -q ci -m add" \
20220 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
20223 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
20224 initial revision: 1\.1
20226 echo "more money" >> aa
20227 dotest modes2-5 "${testcvs} -q ci -m add" \
20229 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
20230 new revision: 1\.2; previous revision: 1\.1
20233 # OK, here is the test. The idea is to see what
20234 # No_Difference does if it can't open the file.
20235 # If we don't change the st_mtime, CVS doesn't even try to read
20236 # the file. Note that some versions of "touch" require that we
20237 # do this while the file is still writable.
20240 # Don't try this when permissions are broken, as with Cygwin.
20241 if ls ${CVSROOT_DIRNAME}/first-dir >/dev/null 2>&1; then :; else
20242 dotest_fail modes2-6 "${testcvs} -q update -r 1.1 aa" \
20243 "${PROG} \[update aborted\]: cannot open file aa for comparing: Permission denied" \
20244 "${PROG} \[update aborted\]: reading aa: Permission denied"
20250 rm -rf ${CVSROOT_DIRNAME}/first-dir
20254 # Repository permissions. Particularly, what happens if we
20255 # can't read/write in the repository.
20256 # TODO: the case where we can access the repository, just not
20257 # the attic (may that one can remain a fatal error, seems less
20258 # useful for access control).
20260 dotest modes3-1 "${testcvs} -q co -l ." ''
20261 mkdir first-dir second-dir
20262 dotest modes3-2 "${testcvs} add first-dir second-dir" \
20263 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
20264 Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
20265 touch first-dir/aa second-dir/ab
20266 dotest modes3-3 "${testcvs} add first-dir/aa second-dir/ab" \
20267 "${PROG} add: scheduling file .first-dir/aa. for addition
20268 ${PROG} add: scheduling file .second-dir/ab. for addition
20269 ${PROG} add: use .${PROG} commit. to add these files permanently"
20270 dotest modes3-4 "${testcvs} -q ci -m add" \
20271 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
20273 Checking in first-dir/aa;
20274 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
20275 initial revision: 1\.1
20277 RCS file: ${CVSROOT_DIRNAME}/second-dir/ab,v
20279 Checking in second-dir/ab;
20280 ${CVSROOT_DIRNAME}/second-dir/ab,v <-- ab
20281 initial revision: 1\.1
20283 if test -n "$remotehost"; then
20284 $CVS_RSH $remotehost "chmod a= ${CVSROOT_DIRNAME}/first-dir"
20286 chmod a= ${CVSROOT_DIRNAME}/first-dir
20288 if ls ${CVSROOT_DIRNAME}/first-dir >/dev/null 2>&1; then
20289 # Avoid this test under Cygwin since permissions work differently
20292 # This test also gets avoided under Mac OS X since the system `ls'
20293 # is broken and exits with a 0 status despite the permission
20295 if test -n "$remotehost"; then
20305 if $cygwin_hack; then :; else
20306 dotest modes3-5 "${testcvs} update" \
20307 "${PROG} update: Updating \.
20308 ${PROG} update: Updating first-dir
20309 ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/first-dir: Permission denied
20310 ${PROG} update: skipping directory first-dir
20311 ${PROG} update: Updating second-dir"
20314 # OK, I can see why one might say the above case could be a
20315 # fatal error, because normally users without access to first-dir
20316 # won't have it in their working directory. But the next
20317 # one is more of a problem if it is fatal.
20319 # The second text string below is for Cygwin again, and again it
20320 # should really be XFAIL under Cygwin, but for now deal with the
20321 # passing opendir by accepting the alternate string.
20323 dotest modes3-6 "${testcvs} update -dP" \
20324 "${PROG} update: Updating .
20325 ${PROG} update: Updating CVSROOT
20327 ${PROG} update: Updating first-dir
20328 ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/first-dir: Permission denied
20329 ${PROG} update: skipping directory first-dir
20330 ${PROG} update: Updating second-dir" \
20331 "${PROG} update: Updating .
20332 ${PROG} update: Updating CVSROOT
20334 ${PROG} update: Updating first-dir
20335 ${PROG} update: Updating second-dir"
20339 chmod u+rwx ${CVSROOT_DIRNAME}/first-dir
20340 rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
20346 dotest stamps-1 "${testcvs} -q co -l ." ''
20348 dotest stamps-2 "${testcvs} add first-dir" \
20349 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20353 # Cygwin, *cough*, puts the year in the time column until the minute
20354 # is no longer the current minute. Sleep 60 seconds to avoid this
20357 ls -l aa >${TESTDIR}/1/stamp.aa.touch
20358 ls -l kw >${TESTDIR}/1/stamp.kw.touch
20359 # "sleep 1" would suffice if we could assume ls --full-time, but
20360 # that is as far as I know unique to GNU ls. Is there some POSIX.2
20361 # way to get the timestamp of a file, including the seconds?
20363 dotest stamps-3 "${testcvs} add aa kw" \
20364 "${PROG} add: scheduling file .aa. for addition
20365 ${PROG} add: scheduling file .kw. for addition
20366 ${PROG} add: use .${PROG} commit. to add these files permanently"
20367 ls -l aa >${TESTDIR}/1/stamp.aa.add
20368 ls -l kw >${TESTDIR}/1/stamp.kw.add
20369 # "cvs add" should not muck with the timestamp.
20370 dotest stamps-4aa \
20371 "cmp ${TESTDIR}/1/stamp.aa.touch ${TESTDIR}/1/stamp.aa.add" ''
20372 dotest stamps-4kw \
20373 "cmp ${TESTDIR}/1/stamp.kw.touch ${TESTDIR}/1/stamp.kw.add" ''
20375 dotest stamps-5 "${testcvs} -q ci -m add" \
20376 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
20379 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
20380 initial revision: 1\.1
20382 RCS file: ${CVSROOT_DIRNAME}/first-dir/kw,v
20385 ${CVSROOT_DIRNAME}/first-dir/kw,v <-- kw
20386 initial revision: 1\.1
20388 # Cygwin, *cough*, puts the year in the time column until the minute
20389 # is no longer the current minute. Sleep 60 seconds to avoid this
20392 ls -l aa >${TESTDIR}/1/stamp.aa.ci
20393 ls -l kw >${TESTDIR}/1/stamp.kw.ci
20394 # If there are no keywords, "cvs ci" leaves the timestamp alone
20395 # If there are, it sets the timestamp to the date of the commit.
20396 # I'm not sure how logical this is, but it is intentional.
20397 # If we wanted to get fancy we would make sure the time as
20398 # reported in "cvs log kw" matched stamp.kw.ci. But that would
20399 # be a lot of work.
20400 dotest stamps-6aa \
20401 "cmp ${TESTDIR}/1/stamp.aa.add ${TESTDIR}/1/stamp.aa.ci" ''
20402 if cmp ${TESTDIR}/1/stamp.kw.add ${TESTDIR}/1/stamp.kw.ci >/dev/null
20412 dotest stamps-7 "${testcvs} -q get first-dir" "U first-dir/aa
20415 ls -l aa >${TESTDIR}/1/stamp.aa.get
20416 ls -l kw >${TESTDIR}/1/stamp.kw.get
20417 # On checkout, CVS should set the timestamp to the date that the
20418 # file was committed. Could check that the time as reported in
20419 # "cvs log aa" matches stamp.aa.get, but that would be a lot of
20421 if cmp ${TESTDIR}/1/stamp.aa.ci ${TESTDIR}/1/stamp.aa.get >/dev/null
20427 dotest stamps-8kw \
20428 "cmp ${TESTDIR}/1/stamp.kw.ci ${TESTDIR}/1/stamp.kw.get" ''
20430 # Now we want to see what "cvs update" does.
20432 echo add a line >>aa
20433 echo add a line >>kw
20434 dotest stamps-9 "${testcvs} -q ci -m change-them" \
20436 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
20437 new revision: 1\.2; previous revision: 1\.1
20440 ${CVSROOT_DIRNAME}/first-dir/kw,v <-- kw
20441 new revision: 1\.2; previous revision: 1\.1
20444 # Cygwin, *cough*, puts the year in the time column until the minute
20445 # is no longer the current minute. Sleep 60 seconds to avoid this
20448 ls -l aa >${TESTDIR}/1/stamp.aa.ci2
20449 ls -l kw >${TESTDIR}/1/stamp.kw.ci2
20453 dotest stamps-10 "${testcvs} -q update" '[UP] aa
20455 # this doesn't serve any function other than being able to
20456 # look at it manually, as we have no machinery for dates being
20457 # newer or older than other dates.
20458 date >${TESTDIR}/1/stamp.debug.update
20459 ls -l aa >${TESTDIR}/1/stamp.aa.update
20460 ls -l kw >${TESTDIR}/1/stamp.kw.update
20461 # stamp.aa.update and stamp.kw.update should both be approximately
20462 # the same as stamp.debug.update. Perhaps we could be testing
20463 # this in a more fancy fashion by "touch stamp.before" before
20464 # stamps-10, "touch stamp.after" after, and then using ls -t
20465 # to check them. But for now we just make sure that the *.update
20466 # stamps differ from the *.ci2 ones.
20467 # As for the rationale, this is so that if one updates and gets
20468 # a new revision, then "make" will be sure to regard those files
20469 # as newer than .o files which may be sitting around.
20470 if cmp ${TESTDIR}/1/stamp.aa.update ${TESTDIR}/1/stamp.aa.ci2 \
20477 if cmp ${TESTDIR}/1/stamp.kw.update ${TESTDIR}/1/stamp.kw.ci2 \
20488 echo Keeping ${TESTDIR} and exiting due to --keep
20493 rm -rf ${CVSROOT_DIRNAME}/first-dir
20497 # short cut around checking out and committing CVSROOT
20498 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
20499 echo 'PreservePermissions=yes' > ${CVSROOT_DIRNAME}/CVSROOT/config
20500 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
20503 dotest perms-1 "${testcvs} -q co -l ." ''
20505 dotest perms-2 "${testcvs} add first-dir" \
20506 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20511 dotest perms-3 "${testcvs} add foo" \
20512 "${PROG} add: scheduling file .foo. for addition
20513 ${PROG} add: use .${PROG} commit. to add this file permanently"
20514 dotest perms-4 "${testcvs} -q ci -m ''" \
20515 "RCS file: ${CVSROOT_DIRNAME}/first-dir/foo,v
20518 ${CVSROOT_DIRNAME}/first-dir/foo,v <-- foo
20519 initial revision: 1\.1
20522 # Test checking out files with different permissions.
20525 dotest perms-5 "${testcvs} -q co first-dir" "U first-dir/foo"
20527 if $remote; then :; else
20528 # PreservePermissions not yet implemented for remote.
20529 dotest perms-6 "ls -l foo" "-r---wx--x .* foo"
20534 rm -rf ${CVSROOT_DIRNAME}/first-dir
20536 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
20537 touch ${CVSROOT_DIRNAME}/CVSROOT/config
20538 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
20542 # short cut around checking out and committing CVSROOT
20543 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
20544 echo 'PreservePermissions=yes' > ${CVSROOT_DIRNAME}/CVSROOT/config
20545 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
20548 dotest symlinks-1 "${testcvs} -q co -l ." ''
20550 dotest symlinks-2 "${testcvs} add first-dir" \
20551 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20554 dotest symlinks-2.1 "ln -s ${TESTDIR}/fumble slink" ""
20555 dotest symlinks-3 "${testcvs} add slink" \
20556 "${PROG} add: scheduling file .slink. for addition
20557 ${PROG} add: use .${PROG} commit. to add this file permanently"
20559 # Remote doesn't implement PreservePermissions, and in its
20560 # absence the correct behavior is to follow the symlink.
20561 dotest_fail symlinks-4r "${testcvs} -q ci -m ''" \
20562 "${PROG} \[commit aborted\]: reading slink: No such file or directory"
20564 dotest symlinks-4 "${testcvs} -q ci -m ''" \
20565 "RCS file: ${CVSROOT_DIRNAME}/first-dir/slink,v
20568 ${CVSROOT_DIRNAME}/first-dir/slink,v <-- slink
20569 initial revision: 1\.1
20572 # Test checking out symbolic links.
20575 dotest symlinks-5 "${testcvs} -q co first-dir" "U first-dir/slink"
20577 dotest symlinks-6 "ls -l slink" \
20578 "l[rwx\-]* .* slink -> ${TESTDIR}/fumble"
20583 rm -rf ${CVSROOT_DIRNAME}/first-dir
20585 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
20586 touch ${CVSROOT_DIRNAME}/CVSROOT/config
20587 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
20591 # Symlinks in working directory without PreservePermissions.
20592 # Also see: symlinks: with PreservePermissions
20593 # rcslib-symlink-*: symlinks in repository.
20595 dotest symlinks2-1 "${testcvs} -q co -l ." ''
20597 dotest symlinks2-2 "${testcvs} add first-dir" \
20598 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20600 echo nonsymlink > slink
20601 dotest symlinks2-3 "${testcvs} add slink" \
20602 "${PROG} add: scheduling file .slink. for addition
20603 ${PROG} add: use .${PROG} commit. to add this file permanently"
20604 dotest symlinks2-4 "${testcvs} -q ci -m ''" \
20605 "RCS file: ${CVSROOT_DIRNAME}/first-dir/slink,v
20608 ${CVSROOT_DIRNAME}/first-dir/slink,v <-- slink
20609 initial revision: 1\.1
20612 # Choose name cvslog.* so it is in default ignore list.
20613 echo second file >cvslog.file2
20614 dotest symlinks2-5 "ln -s cvslog.file2 slink" ""
20615 dotest symlinks2-6 "${testcvs} -q ci -m linkify" \
20616 "Checking in slink;
20617 ${CVSROOT_DIRNAME}/first-dir/slink,v <-- slink
20618 new revision: 1\.2; previous revision: 1\.1
20620 dotest symlinks2-7 "${testcvs} -q update -r 1.1 slink" "[UP] slink"
20621 dotest symlinks2-8 "cat slink" "nonsymlink"
20622 dotest symlinks2-9 "ls -l slink" "-[-rwx]* .* slink"
20626 rm -rf ${CVSROOT_DIRNAME}/first-dir
20630 # short cut around checking out and committing CVSROOT
20631 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
20632 echo 'PreservePermissions=yes' > ${CVSROOT_DIRNAME}/CVSROOT/config
20633 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
20636 dotest hardlinks-1 "${testcvs} -q co -l ." ''
20638 dotest hardlinks-2 "${testcvs} add first-dir" \
20639 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20642 # Make up some ugly filenames, to test that they get
20643 # encoded properly in the delta nodes. Note that `dotest' screws
20644 # up if some arguments have embedded spaces.
20659 if ln aaaa 'dd dd dd'
20666 dotest hardlinks-3 "${testcvs} add [abd]*" \
20667 "${PROG} add: scheduling file .aaaa. for addition
20668 ${PROG} add: scheduling file .b\.b\.b\.b. for addition
20669 ${PROG} add: scheduling file .dd dd dd. for addition
20670 ${PROG} add: use .${PROG} commit. to add these files permanently"
20671 dotest hardlinks-4 "${testcvs} -q ci -m ''" \
20672 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaaa,v
20675 ${CVSROOT_DIRNAME}/first-dir/aaaa,v <-- aaaa
20676 initial revision: 1\.1
20678 RCS file: ${CVSROOT_DIRNAME}/first-dir/b\.b\.b\.b,v
20680 Checking in b\.b\.b\.b;
20681 ${CVSROOT_DIRNAME}/first-dir/b\.b\.b\.b,v <-- b\.b\.b\.b
20682 initial revision: 1\.1
20684 RCS file: ${CVSROOT_DIRNAME}/first-dir/dd dd dd,v
20686 Checking in dd dd dd;
20687 ${CVSROOT_DIRNAME}/first-dir/dd dd dd,v <-- dd dd dd
20688 initial revision: 1\.1
20690 # Test checking out hardlinked files.
20694 # Remote does not implement PreservePermissions.
20695 dotest hardlinks-5r "${testcvs} -q co first-dir" \
20697 U first-dir/b\.b\.b\.b
20698 U first-dir/dd dd dd"
20700 dotest hardlinks-6r "ls -l [abd]*" \
20701 "-[rwx\-]* *1 .* aaaa
20702 -[rwx\-]* *1 .* b\.b\.b\.b
20703 -[rwx\-]* *1 .* dd dd dd"
20705 dotest hardlinks-5 "${testcvs} -q co first-dir" \
20707 U first-dir/b\.b\.b\.b
20708 U first-dir/dd dd dd"
20710 # To make sure that the files are properly hardlinked, it
20711 # would be nice to do `ls -i' and make sure all the inodes
20712 # match. But I think that would require expr to support
20713 # tagged regexps, and I don't think we can rely on that.
20714 # So instead we just see that each file has the right
20715 # number of links. -twp
20716 dotest hardlinks-6 "ls -l [abd]*" \
20717 "-[rwx\-]* *3 .* aaaa
20718 -[rwx\-]* *3 .* b\.b\.b\.b
20719 -[rwx\-]* *3 .* dd dd dd"
20724 rm -rf ${CVSROOT_DIRNAME}/first-dir
20726 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
20727 touch ${CVSROOT_DIRNAME}/CVSROOT/config
20728 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
20732 # More tests of sticky tags, particularly non-branch sticky tags.
20733 # See many tests (e.g. multibranch) for ordinary sticky tag
20734 # operations such as adding files on branches.
20735 # See "head" test for interaction between stick tags and HEAD.
20737 dotest sticky-1 "${testcvs} -q co -l ." ''
20739 dotest sticky-2 "${testcvs} add first-dir" \
20740 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20744 dotest sticky-3 "${testcvs} add file1" \
20745 "${PROG} add: scheduling file .file1. for addition
20746 ${PROG} add: use .${PROG} commit. to add this file permanently"
20747 dotest sticky-4 "${testcvs} -q ci -m add" \
20748 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20751 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
20752 initial revision: 1\.1
20754 dotest sticky-5 "${testcvs} -q tag tag1" "T file1"
20755 echo add a line >>file1
20756 dotest sticky-6 "${testcvs} -q ci -m modify" \
20757 "Checking in file1;
20758 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
20759 new revision: 1\.2; previous revision: 1\.1
20761 dotest sticky-7 "${testcvs} -q update -r tag1" "[UP] file1"
20762 dotest sticky-8 "cat file1" ''
20763 dotest sticky-9 "${testcvs} -q update" ''
20764 dotest sticky-10 "cat file1" ''
20766 dotest_fail sticky-11 "${testcvs} add file2" \
20767 "${PROG} add: cannot add file on non-branch tag tag1"
20768 dotest sticky-12 "${testcvs} -q update -A" "[UP] file1
20769 ${QUESTION} file2" "${QUESTION} file2
20771 dotest sticky-13 "${testcvs} add file2" \
20772 "${PROG} add: scheduling file .file2. for addition
20773 ${PROG} add: use .${PROG} commit. to add this file permanently"
20774 dotest sticky-14 "${testcvs} -q ci -m add" \
20775 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
20778 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
20779 initial revision: 1\.1
20783 dotest sticky-15 "${testcvs} -q update -r tag1" "[UP] file1
20784 ${PROG} update: file2 is no longer in the repository"
20787 dotest sticky-16 "${testcvs} rm file1" \
20788 "${PROG} remove: scheduling .file1. for removal
20789 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
20790 # Hmm, this command seems to silently remove the tag from
20791 # the file. This appears to be intentional.
20792 # The silently part especially strikes me as odd, though.
20793 dotest sticky-17 "${testcvs} -q ci -m remove-it" ""
20794 dotest sticky-18 "${testcvs} -q update -A" "U file1
20796 dotest sticky-19 "${testcvs} -q update -r tag1" \
20797 "${PROG} update: file1 is no longer in the repository
20798 ${PROG} update: file2 is no longer in the repository"
20799 dotest sticky-20 "${testcvs} -q update -A" "U file1
20802 # Now try with a numeric revision.
20803 dotest sticky-21 "${testcvs} -q update -r 1.1 file1" "U file1"
20804 dotest sticky-22 "${testcvs} rm -f file1" \
20805 "${PROG} remove: cannot remove file .file1. which has a numeric sticky tag of .1\.1."
20806 # The old behavior was that remove allowed this and then commit
20807 # gave an error, which was somewhat hard to clear. I mean, you
20808 # could get into a long elaborate discussion of this being a
20809 # conflict and two ways to resolve it, but I don't really see
20810 # why CVS should have a concept of conflict that arises, not from
20811 # parallel development, but from CVS's own sticky tags.
20813 # Ditto with a sticky date.
20815 # I'm kind of surprised that the "file1 was lost" doesn't crop
20816 # up elsewhere in the testsuite. It is a long-standing
20817 # discrepency between local and remote CVS and should probably
20818 # be cleaned up at some point.
20819 dotest sticky-23 "${testcvs} -q update -Dnow file1" \
20820 "${PROG} update: warning: file1 was lost
20822 dotest sticky-24 "${testcvs} rm -f file1" \
20823 "${PROG} remove: cannot remove file .file1. which has a sticky date of .[0-9.]*."
20825 dotest sticky-25 "${testcvs} -q update -A" \
20826 "${PROG} update: warning: file1 was lost
20831 rm -rf ${CVSROOT_DIRNAME}/first-dir
20835 # Test keyword expansion.
20836 # Various other tests relate to our ability to correctly
20837 # set the keyword expansion mode.
20838 # "binfiles" tests "cvs admin -k".
20839 # "binfiles" and "binfiles2" test "cvs add -k".
20840 # "rdiff" tests "cvs co -k".
20841 # "binfiles" (and this test) test "cvs update -k".
20842 # "binwrap" tests setting the mode from wrappers.
20843 # "keyword2" tests "cvs update -kk -j" with text and binary files
20844 # I don't think any test is testing "cvs import -k".
20845 # Other keyword expansion tests:
20846 # keywordlog - $Log.
20848 dotest keyword-1 "${testcvs} -q co -l ." ''
20850 dotest keyword-2 "${testcvs} add first-dir" \
20851 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20854 echo '$''Author$' > file1
20855 echo '$''Date$' >> file1
20856 echo '$''Header$' >> file1
20857 echo '$''Id$' >> file1
20858 echo '$''Locker$' >> file1
20859 echo '$''Name$' >> file1
20860 echo '$''RCSfile$' >> file1
20861 echo '$''Revision$' >> file1
20862 echo '$''Source$' >> file1
20863 echo '$''State$' >> file1
20864 echo '$''Nonkey$' >> file1
20865 # Omit the trailing dollar sign
20866 echo '$''Date' >> file1
20867 # Put two keywords on one line
20868 echo '$''State$' '$''State$' >> file1
20869 # Use a header for Log
20870 echo 'xx $''Log$' >> file1
20872 dotest keyword-3 "${testcvs} add file1" \
20873 "${PROG} add: scheduling file .file1. for addition
20874 ${PROG} add: use .${PROG} commit. to add this file permanently"
20875 dotest keyword-4 "${testcvs} -q ci -m add" \
20876 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20879 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
20880 initial revision: 1\.1
20882 dotest keyword-5 "cat file1" \
20883 '\$'"Author: ${username} "'\$'"
20884 "'\$'"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] "'\$'"
20885 "'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
20886 "'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
20887 "'\$'"Locker: "'\$'"
20889 "'\$'"RCSfile: file1,v "'\$'"
20890 "'\$'"Revision: 1\.1 "'\$'"
20891 "'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
20892 "'\$'"State: Exp "'\$'"
20895 "'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
20896 xx "'\$'"Log: file1,v "'\$'"
20897 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
20901 # Use cvs admin to lock the RCS file in order to check -kkvl
20902 # vs. -kkv. CVS does not normally lock RCS files, but some
20903 # people use cvs admin to enforce reserved checkouts.
20904 dotest keyword-6 "${testcvs} admin -l file1" \
20905 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20909 dotest keyword-7 "${testcvs} update -kkv file1" "U file1"
20910 dotest keyword-8 "cat file1" \
20911 '\$'"Author: ${username} "'\$'"
20912 "'\$'"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] "'\$'"
20913 "'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
20914 "'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
20915 "'\$'"Locker: "'\$'"
20917 "'\$'"RCSfile: file1,v "'\$'"
20918 "'\$'"Revision: 1\.1 "'\$'"
20919 "'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
20920 "'\$'"State: Exp "'\$'"
20923 "'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
20924 xx "'\$'"Log: file1,v "'\$'"
20925 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
20929 dotest keyword-9 "${testcvs} update -kkvl file1" "U file1"
20930 dotest keyword-10 "cat file1" \
20931 '\$'"Author: ${username} "'\$'"
20932 "'\$'"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] "'\$'"
20933 "'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp ${username} "'\$'"
20934 "'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp ${username} "'\$'"
20935 "'\$'"Locker: ${username} "'\$'"
20937 "'\$'"RCSfile: file1,v "'\$'"
20938 "'\$'"Revision: 1\.1 "'\$'"
20939 "'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
20940 "'\$'"State: Exp "'\$'"
20943 "'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
20944 xx "'\$'"Log: file1,v "'\$'"
20945 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
20949 dotest keyword-11 "${testcvs} update -kk file1" "U file1"
20950 dotest keyword-12 "cat file1" \
20957 "'\$'"RCSfile"'\$'"
20958 "'\$'"Revision"'\$'"
20963 "'\$'"State"'\$'" "'\$'"State"'\$'"
20965 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
20969 dotest keyword-13 "${testcvs} update -kv file1" "U file1"
20970 dotest keyword-14 "cat file1" \
20972 [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]
20973 ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp
20974 file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp
20979 ${CVSROOT_DIRNAME}/first-dir/file1,v
20985 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
20989 dotest keyword-15 "${testcvs} update -ko file1" "U file1"
20990 dotest keyword-16 "cat file1" \
20997 "'\$'"RCSfile"'\$'"
20998 "'\$'"Revision"'\$'"
21003 "'\$'"State"'\$'" "'\$'"State"'\$'"
21006 # Test the Name keyword. First go back to normal expansion.
21008 dotest keyword-17 "${testcvs} update -A file1" "U file1"
21010 echo '$''Name$' > file1
21011 dotest keyword-18 "${testcvs} ci -m modify file1" \
21012 "Checking in file1;
21013 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21014 new revision: 1\.2; previous revision: 1\.1
21016 dotest keyword-19 "${testcvs} -q tag tag1" "T file1"
21017 echo "change" >> file1
21018 dotest keyword-20 "${testcvs} -q ci -m mod2 file1" \
21019 "Checking in file1;
21020 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21021 new revision: 1\.3; previous revision: 1\.2
21023 # FIXCVS - These unpatchable files are happening because the tag
21024 # associated with the current base version of the file in the
21025 # sandbox is not available in these cases. See the note in the
21026 # patch_file function in update.c.
21027 dotest keyword-21 "${testcvs} -q update -r tag1" "U file1" \
21029 ${PROG} update: checksum failure after patch to \./file1; will refetch
21030 ${PROG} client: refetching unpatchable files
21031 ${PROG} update: warning: file1 was lost
21034 dotest keyword-22 "cat file1" '\$'"Name: tag1 "'\$'
21037 # Like serverpatch-8. Not sure there is anything much we
21038 # can or should do about this.
21039 dotest keyword-23r "${testcvs} update -A file1" "P file1
21040 ${PROG} update: checksum failure after patch to \./file1; will refetch
21041 ${PROG} client: refetching unpatchable files
21042 ${PROG} update: warning: file1 was lost
21045 dotest keyword-23 "${testcvs} update -A file1" "[UP] file1"
21047 dotest keyword-24 "cat file1" '\$'"Name: "'\$'"
21052 rm -rf ${CVSROOT_DIRNAME}/first-dir
21056 # Test the Log keyword.
21058 dotest keywordlog-1 "${testcvs} -q co -l ." ''
21060 dotest keywordlog-2 "${testcvs} add first-dir" \
21061 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
21063 echo initial >file1
21064 dotest keywordlog-3 "${testcvs} add file1" \
21065 "${PROG} add: scheduling file .file1. for addition
21066 ${PROG} add: use .${PROG} commit. to add this file permanently"
21068 # See "rmadd" for a list of other tests of cvs ci -r.
21069 dotest keywordlog-4 "${testcvs} -q ci -r 1.3 -m add file1" \
21070 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21073 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21074 initial revision: 1\.3
21079 dotest keywordlog-4a "${testcvs} -q co first-dir" "U first-dir/file1"
21082 echo 'xx $''Log$' >> file1
21083 cat >${TESTDIR}/comment.tmp <<EOF
21087 # As with rmadd-25, "cvs ci -r" sets a sticky tag.
21088 dotest_fail keywordlog-4b \
21089 "${testcvs} ci -F ${TESTDIR}/comment.tmp file1" \
21090 "${PROG} commit: sticky tag .1\.3. for file .file1. is not a branch
21091 ${PROG} \[commit aborted\]: correct above errors first!"
21092 dotest keywordlog-4c "${testcvs} -q update -A" "M file1"
21094 dotest keywordlog-5 "${testcvs} ci -F ${TESTDIR}/comment.tmp file1" \
21095 "Checking in file1;
21096 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21097 new revision: 1\.4; previous revision: 1\.3
21099 rm -f ${TESTDIR}/comment.tmp
21100 dotest keywordlog-6 "${testcvs} -q tag -b br" "T file1"
21101 dotest keywordlog-7 "cat file1" \
21103 xx "'\$'"Log: file1,v "'\$'"
21104 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21109 cd ../../2/first-dir
21110 dotest keywordlog-8 "${testcvs} -q update" "[UP] file1"
21111 dotest keywordlog-9 "cat file1" \
21113 xx "'\$'"Log: file1,v "'\$'"
21114 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21118 cd ../../1/first-dir
21120 echo "change" >> file1
21121 dotest keywordlog-10 "${testcvs} ci -m modify file1" \
21122 "Checking in file1;
21123 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21124 new revision: 1\.5; previous revision: 1\.4
21126 dotest keywordlog-11 "cat file1" \
21128 xx "'\$'"Log: file1,v "'\$'"
21129 xx Revision 1\.5 [0-9/]* [0-9:]* ${username}
21132 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21138 cd ../../2/first-dir
21139 dotest keywordlog-12 "${testcvs} -q update" "[UP] file1"
21140 dotest keywordlog-13 "cat file1" \
21142 xx "'\$'"Log: file1,v "'\$'"
21143 xx Revision 1\.5 [0-9/]* [0-9:]* ${username}
21146 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21152 cd ../../1/first-dir
21153 dotest keywordlog-14 "${testcvs} -q update -r br" "[UP] file1"
21154 echo br-change >>file1
21155 dotest keywordlog-15 "${testcvs} -q ci -m br-modify" \
21156 "Checking in file1;
21157 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21158 new revision: 1\.4\.2\.1; previous revision: 1\.4
21160 dotest keywordlog-16 "cat file1" \
21162 xx "'\$'"Log: file1,v "'\$'"
21163 xx Revision 1\.4\.2\.1 [0-9/]* [0-9:]* ${username}
21166 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21171 cd ../../2/first-dir
21172 dotest keywordlog-17 "${testcvs} -q update -r br" "[UP] file1"
21173 dotest keywordlog-18 "cat file1" \
21175 xx "'\$'"Log: file1,v "'\$'"
21176 xx Revision 1\.4\.2\.1 [0-9/]* [0-9:]* ${username}
21179 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21185 dotest keywordlog-19 "${testcvs} -q co -p -r br first-dir/file1" \
21187 xx "'\$'"Log: file1,v "'\$'"
21188 xx Revision 1\.4\.2\.1 [0-9/]* [0-9:]* ${username}
21191 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21196 dotest keywordlog-20 "${testcvs} -q co -p first-dir/file1" \
21198 xx "'\$'"Log: file1,v "'\$'"
21199 xx Revision 1\.5 [0-9/]* [0-9:]* ${username}
21202 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21207 dotest keywordlog-21 "${testcvs} -q co -p -r 1.4 first-dir/file1" \
21209 xx "'\$'"Log: file1,v "'\$'"
21210 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21216 # OK, the basic rule for keyword expansion is that it
21217 # happens on checkout. And the rule for annotate is that
21218 # it annotates a checked-in revision, rather than a checked-out
21219 # file. So, although it is kind of confusing that the latest
21220 # revision does not appear in the annotated output, and the
21221 # annotated output does not quite match what you'd get with
21222 # update or checkout, the behavior is more or less logical.
21223 # The same issue occurs with annotate and other keywords,
21224 # I think, although it is particularly noticeable for $Log.
21225 dotest keywordlog-22 "${testcvs} ann -r br file1" \
21227 Annotations for file1
21228 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
21229 1\.3 (${username} *[0-9a-zA-Z-]*): initial
21230 1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'"
21231 1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21232 1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx First log line
21233 1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx Second log line
21234 1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx
21235 1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): br-change"
21236 dotest keywordlog-23 "${testcvs} ann -r HEAD file1" \
21238 Annotations for file1
21239 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
21240 1\.3 (${username} *[0-9a-zA-Z-]*): initial
21241 1\.5 (${username} *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'"
21242 1\.5 (${username} *[0-9a-zA-Z-]*): xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21243 1\.5 (${username} *[0-9a-zA-Z-]*): xx First log line
21244 1\.5 (${username} *[0-9a-zA-Z-]*): xx Second log line
21245 1\.5 (${username} *[0-9a-zA-Z-]*): xx
21246 1\.5 (${username} *[0-9a-zA-Z-]*): change"
21250 # test the operation of 'admin -o' in conjunction with keywords
21251 # (especially Log - this used to munge the RCS file for all time)
21254 dotest keywordlog-24 \
21255 "${testcvs} admin -oHEAD 1/first-dir/file1" \
21256 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21257 deleting revision 1\.5
21260 dotest keywordlog-25 \
21261 "${testcvs} -q co -p first-dir/file1" \
21263 xx "'\$'"Log: file1,v "'\$'"
21264 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
21270 echo Keeping ${TESTDIR} and exiting due to --keep
21275 rm -rf ${CVSROOT_DIRNAME}/first-dir
21279 # Test the Name keyword.
21280 # See the keyword test for a descriptions of some other tests that
21281 # test keyword expansion modes.
21282 mkdir keywordname; cd keywordname
21284 dotest keywordname-init-1 "${testcvs} -q co -l ." ''
21286 dotest keywordname-init-2 "${testcvs} add first-dir" \
21287 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
21290 echo '$'"Name$" >file1
21291 echo '$'"Name$" >file2
21292 dotest keywordname-init-3 "${testcvs} add file1 file2" \
21293 "${PROG} add: scheduling file .file1. for addition
21294 ${PROG} add: scheduling file .file2. for addition
21295 ${PROG} add: use .${PROG} commit. to add these files permanently"
21297 # See "rmadd" for a list of other tests of cvs ci -r.
21298 dotest keywordname-init-4 "${testcvs} -q ci -r 1.3 -m add" \
21299 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21302 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21303 initial revision: 1\.3
21305 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
21308 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
21309 initial revision: 1\.3
21312 dotest keywordname-init-6 "${testcvs} -q up -A"
21313 dotest keywordname-init-7 "${testcvs} -q tag -b br" \
21317 echo new data >>file1
21318 dotest keywordname-init-8 "${testcvs} -q ci -mchange" \
21319 "Checking in file1;
21320 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21321 new revision: 1\.4; previous revision: 1\.3
21324 # First check out a branch.
21326 # There used to be a bug where static tags would be substituted for
21327 # Name keywords but not branch tags.
21330 # Why shouldn't the non-update case not cause a substitution?
21331 # An update -kk or -A will unsub and sub keywords without updates
21333 # FIXCVS - see note above keyword-21
21334 dotest keywordname-update-1 "${testcvs} -q up -rbr" "U file1" \
21336 ${PROG} update: checksum failure after patch to \./file1; will refetch
21337 ${PROG} client: refetching unpatchable files
21338 ${PROG} update: warning: file1 was lost
21340 dotest keywordname-update-2 "cat file1" '\$'"Name: br "'\$'
21341 dotest keywordname-update-3 "cat file2" '\$'"Name: "'\$'
21343 # Now verify that updating to the trunk leaves no substitution for
21345 dotest keywordname-update-4 "${testcvs} -q tag firsttag" \
21348 # FIXCVS - see note above keyword-21
21349 dotest keywordname-update-5 "${testcvs} -q up -A" "U file1" \
21351 ${PROG} update: checksum failure after patch to \./file1; will refetch
21352 ${PROG} client: refetching unpatchable files
21353 ${PROG} update: warning: file1 was lost
21355 dotest keywordname-update-6 "cat file1" \
21358 dotest keywordname-update-7 "cat file2" '\$'"Name: "'\$'
21360 # But updating to a static tag does cause a substitution
21361 # FIXCVS - see same note above
21362 dotest keywordname-update-8 "${testcvs} -q up -rfirsttag" "U file1" \
21364 ${PROG} update: checksum failure after patch to \./file1; will refetch
21365 ${PROG} client: refetching unpatchable files
21366 ${PROG} update: warning: file1 was lost
21368 dotest keywordname-update-9 "cat file1" '\$'"Name: firsttag "'\$'
21369 dotest keywordname-update-10 "cat file2" '\$'"Name: "'\$'
21371 # And reverify the trunk update when the change is actually removed.
21372 dotest keywordname-update-11 "${testcvs} -q up -A" "[UP] file1" \
21374 ${PROG} update: checksum failure after patch to ./file1; will refetch
21375 ${PROG} client: refetching unpatchable files
21376 ${PROG} update: warning: file1 was lost
21378 dotest keywordname-update-12 "cat file1" \
21381 dotest keywordname-update-13 "cat file2" '\$'"Name: "'\$'
21385 # now verify that a fresh checkout substitutes all the $Name fields
21387 dotest keywordname-checkout-1 \
21388 "${testcvs} -q co -rfirsttag first-dir" \
21392 dotest keywordname-checkout-2 "cat file1" '\$'"Name: firsttag "'\$'
21393 dotest keywordname-checkout-3 "cat file2" '\$'"Name: firsttag "'\$'
21398 echo Keeping ${TESTDIR} and exiting due to --keep
21404 rm -rf ${CVSROOT_DIRNAME}/first-dir
21408 # Test merging on files with keywords:
21413 # Note: This test assumes that CVS has already passed the binfiles
21415 # Note2: We are testing positive on binary corruption here
21416 # we probably really DON'T want to 'cvs update -kk' a binary file...
21418 dotest keyword2-1 "${testcvs} -q co -l ." ''
21420 dotest keyword2-2 "${testcvs} add first-dir" \
21421 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
21424 echo '$''Revision$' >> file1
21426 echo "like" >>file1
21427 echo "long" >>file1
21428 echo "files!" >>file1
21430 echo "a test line for our times" >>file1
21432 echo "They" >>file1
21433 echo "make" >>file1
21434 echo "diff" >>file1
21435 echo "look like it" >>file1
21436 echo "did a much better" >>file1
21437 echo "job." >>file1
21438 dotest keyword2-3 "${testcvs} add file1" \
21439 "${PROG} add: scheduling file .file1. for addition
21440 ${PROG} add: use .${PROG} commit. to add this file permanently"
21442 ${AWK} 'BEGIN { printf "%c%c%c%sRevision: 1.1 $@%c%c", \
21443 2, 10, 137, "$", 13, 10 }' \
21444 </dev/null | ${TR} '@' '\000' >../binfile.dat
21445 cp ../binfile.dat .
21446 dotest keyword2-5 "${testcvs} add -kb binfile.dat" \
21447 "${PROG} add: scheduling file .binfile\.dat. for addition
21448 ${PROG} add: use .${PROG} commit. to add this file permanently"
21450 dotest keyword2-6 "${testcvs} -q ci -m add" \
21451 "RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v
21453 Checking in binfile\.dat;
21454 ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
21455 initial revision: 1\.1
21457 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21460 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21461 initial revision: 1\.1
21464 dotest keyword2-7 "${testcvs} -q tag -b branch" \
21468 sed -e 's/our/the best of and the worst of/' file1 >f; mv f file1
21469 dotest keyword2-8 "${testcvs} -q ci -m change" \
21470 "Checking in file1;
21471 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21472 new revision: 1\.2; previous revision: 1\.1
21475 dotest keyword2-9 "${testcvs} -q update -r branch" '[UP] file1'
21477 echo "what else do we have?" >>file1
21478 dotest keyword2-10 "${testcvs} -q ci -m change" \
21479 "Checking in file1;
21480 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21481 new revision: 1\.1\.2\.1; previous revision: 1\.1
21484 # Okay, first a conflict in file1 - should be okay with binfile.dat
21485 dotest keyword2-11 "${testcvs} -q update -A -j branch" \
21487 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21488 retrieving revision 1\.1
21489 retrieving revision 1\.1\.2\.1
21490 Merging differences between 1\.1 and 1\.1\.2\.1 into file1
21491 rcsmerge: warning: conflicts during merge"
21493 dotest_fail keyword2-12 "${testcvs} diff file1" \
21495 ===================================================================
21496 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21497 retrieving revision 1\.2
21503 > \\\$""Revision: 1\.1\.2\.1 \\\$
21504 > >>>>>>> 1\.1\.2\.1
21506 > what else do we have${QUESTION}"
21508 # Here's the problem... shouldn't -kk a binary file...
21510 dotest keyword2-13 "${testcvs} -q update -A -kk -j branch" \
21512 ${PROG} update: warning: file1 was lost
21514 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21515 retrieving revision 1\.1
21516 retrieving revision 1\.1\.2\.1
21517 Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
21519 # binfile won't get checked in, but it is now corrupt and could
21520 # have been checked in if it had changed on the branch...
21521 dotest keyword2-14 "${testcvs} -q ci -m change" \
21522 "Checking in file1;
21523 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21524 new revision: 1\.3; previous revision: 1\.2
21527 dotest_fail keyword2-15 "cmp binfile.dat ../binfile.dat" \
21528 "binfile\.dat \.\./binfile\.dat differ: char 13, line 2"
21530 # Okay, restore everything and make CVS try and merge a binary file...
21531 dotest keyword2-16 "${testcvs} -q update -A" \
21534 dotest keyword2-17 "${testcvs} -q tag -b branch2" \
21537 dotest keyword2-18 "${testcvs} -q update -r branch2" ''
21539 ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
21540 </dev/null | ${TR} '@' '\000' >>binfile.dat
21541 dotest keyword2-19 "${testcvs} -q ci -m badbadbad" \
21542 "Checking in binfile\.dat;
21543 ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
21544 new revision: 1\.1\.4\.1; previous revision: 1\.1
21546 dotest keyword2-20 "${testcvs} -q update -A -kk -j branch2" \
21548 RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v
21549 retrieving revision 1\.1
21550 retrieving revision 1\.1\.4\.1
21551 Merging differences between 1\.1 and 1\.1\.4\.1 into binfile\.dat
21554 # Yep, it's broke, 'cept for that gal in Hodunk who uses -kk
21555 # so that some files only merge when she says so. Time to clean up...
21558 rm -rf ${CVSROOT_DIRNAME}/first-dir
21562 # Testing handling of the HEAD special tag.
21563 # There are many cases involving added and removed files
21564 # which we don't yet try to deal with.
21565 # TODO: We also could be paying much closer attention to
21566 # "head of the trunk" versus "head of the default branch".
21567 # That is what "cvs import" is doing here (but I didn't really
21568 # fully follow through on writing the tests for that case).
21571 echo 'imported contents' >file1
21572 # It may seem like we don't do much with file2, but do note that
21573 # the "cvs diff" invocations do also diff file2 (and come up empty).
21574 echo 'imported contents' >file2
21575 dotest_sort head-1 "${testcvs} import -m add first-dir tag1 tag2" \
21580 No conflicts created by this import"
21585 dotest head-2 "${testcvs} -q co first-dir" \
21589 echo 'add a line on trunk' >> file1
21590 dotest head-3 "${testcvs} -q ci -m modify" \
21591 "Checking in file1;
21592 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21593 new revision: 1\.2; previous revision: 1\.1
21595 dotest head-4 "${testcvs} -q tag trunktag" "T file1
21597 echo 'add a line on trunk after trunktag' >> file1
21598 dotest head-5 "${testcvs} -q ci -m modify" \
21599 "Checking in file1;
21600 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21601 new revision: 1\.3; previous revision: 1\.2
21603 dotest head-6 "${testcvs} -q tag -b br1" "T file1
21605 dotest head-7 "${testcvs} -q update -r br1" ""
21606 echo 'modify on branch' >>file1
21607 dotest head-8 "${testcvs} -q ci -m modify" \
21608 "Checking in file1;
21609 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21610 new revision: 1\.3\.2\.1; previous revision: 1\.3
21612 dotest head-9 "${testcvs} -q tag brtag" "T file1
21614 echo 'modify on branch after brtag' >>file1
21615 dotest head-10 "${testcvs} -q ci -m modify" \
21616 "Checking in file1;
21617 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21618 new revision: 1\.3\.2\.2; previous revision: 1\.3\.2\.1
21620 # With no sticky tags, HEAD is the head of the trunk.
21621 dotest head-trunk-setup "${testcvs} -q update -A" "[UP] file1"
21622 dotest head-trunk-update "${testcvs} -q update -r HEAD -p file1" \
21624 add a line on trunk
21625 add a line on trunk after trunktag"
21626 # and diff thinks so too. Case (a) from the comment in
21627 # cvs.texinfo (Common options).
21628 dotest_fail head-trunk-diff "${testcvs} -q diff -c -r HEAD -r br1" \
21630 ===================================================================
21631 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21632 retrieving revision 1\.3
21633 retrieving revision 1\.3\.2\.2
21634 diff -c -r1\.3 -r1\.3\.2\.2
21635 \*\*\* file1 ${RFCDATE} 1\.3
21636 --- file1 ${RFCDATE} 1\.3\.2\.2
21637 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
21638 \*\*\* 1,3 \*\*\*\*
21641 add a line on trunk
21642 add a line on trunk after trunktag
21643 ${PLUS} modify on branch
21644 ${PLUS} modify on branch after brtag"
21646 # With a branch sticky tag, HEAD is the head of the trunk.
21647 dotest head-br1-setup "${testcvs} -q update -r br1" "[UP] file1"
21648 dotest head-br1-update "${testcvs} -q update -r HEAD -p file1" \
21650 add a line on trunk
21651 add a line on trunk after trunktag"
21652 # But diff thinks that HEAD is "br1". Case (b) from cvs.texinfo.
21653 # Probably people are relying on it.
21654 dotest head-br1-diff "${testcvs} -q diff -c -r HEAD -r br1" ""
21656 # With a nonbranch sticky tag on a branch,
21657 # HEAD is the head of the trunk
21658 dotest head-brtag-setup "${testcvs} -q update -r brtag" "[UP] file1"
21659 dotest head-brtag-update "${testcvs} -q update -r HEAD -p file1" \
21661 add a line on trunk
21662 add a line on trunk after trunktag"
21664 # CVS 1.9 and older thought that HEAD is "brtag" (this was
21665 # noted as "strange, maybe accidental"). But "br1" makes a
21666 # whole lot more sense.
21667 dotest head-brtag-diff "${testcvs} -q diff -c -r HEAD -r br1" ""
21669 # With a nonbranch sticky tag on the trunk, HEAD is the head
21670 # of the trunk, I think.
21671 dotest head-trunktag-setup "${testcvs} -q update -r trunktag" \
21673 dotest head-trunktag-check "cat file1" "imported contents
21674 add a line on trunk"
21675 dotest head-trunktag-update "${testcvs} -q update -r HEAD -p file1" \
21677 add a line on trunk
21678 add a line on trunk after trunktag"
21679 # Like head-brtag-diff, there is a non-branch sticky tag.
21680 dotest_fail head-trunktag-diff \
21681 "${testcvs} -q diff -c -r HEAD -r br1" \
21683 ===================================================================
21684 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21685 retrieving revision 1\.3
21686 retrieving revision 1\.3\.2\.2
21687 diff -c -r1\.3 -r1\.3\.2\.2
21688 \*\*\* file1 ${RFCDATE} 1\.3
21689 --- file1 ${RFCDATE} 1\.3\.2\.2
21690 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
21691 \*\*\* 1,3 \*\*\*\*
21694 add a line on trunk
21695 add a line on trunk after trunktag
21696 ${PLUS} modify on branch
21697 ${PLUS} modify on branch after brtag"
21699 # Also might test what happens if we setup with update -r
21700 # HEAD. In general, if sticky tags matter, does the
21701 # behavior of "update -r <foo>" (without -p) depend on the
21702 # sticky tags before or after the update?
21704 # Note that we are testing both the case where this deletes
21705 # a revision (file1) and the case where it does not (file2)
21706 dotest_fail head-o0a "${testcvs} admin -o ::br1" \
21707 "${PROG} admin: Administrating \.
21708 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21709 ${PROG} admin: cannot remove revision 1\.3\.2\.1 because it has tags
21710 ${PROG} admin: RCS file for .file1. not modified\.
21711 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
21713 dotest head-o0b "${testcvs} tag -d brtag" \
21714 "${PROG} tag: Untagging \.
21717 dotest head-o1 "${testcvs} admin -o ::br1" \
21718 "${PROG} admin: Administrating \.
21719 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21720 deleting revision 1\.3\.2\.1
21722 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
21726 rm -rf ${CVSROOT_DIRNAME}/first-dir
21730 # Test combining -r and -D.
21732 # Note that this is not a complete test. It relies on the fact
21733 # that update, checkout and export have a LOT of shared code.
21735 # 1) checkout is never tested at all with -r -D
21736 # 2) update never uses an argument to '-D' besides 'now'
21737 # (this test does not provide enough data to prove
21738 # that 'cvs update' with both a '-r' and a '-D'
21739 # specified does not ignore '-D': a 'cvs up
21740 # -r<branch> -Dnow' and a 'cvs up -r<branch>'
21741 # should specify the same file revision).
21742 # 3) export uses '-r<branch> -D<when there was a different
21743 # revision>', hopefully completing this behavior test
21744 # for checkout and update as well.
21747 dotest tagdate-1 "${testcvs} -q co -l ." ''
21749 dotest tagdate-2 "${testcvs} add first-dir" \
21750 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
21753 echo trunk-1 >file1
21754 dotest tagdate-3 "${testcvs} add file1" \
21755 "${PROG} add: scheduling file .file1. for addition
21756 ${PROG} add: use .${PROG} commit. to add this file permanently"
21757 dotest tagdate-4 "${testcvs} -q ci -m add" \
21758 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21761 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21762 initial revision: 1\.1
21764 dotest tagdate-5 "${testcvs} -q tag -b br1" "T file1"
21765 dotest tagdate-6 "${testcvs} -q tag -b br2" "T file1"
21766 echo trunk-2 >file1
21767 dotest tagdate-7 "${testcvs} -q ci -m modify-on-trunk" \
21768 "Checking in file1;
21769 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21770 new revision: 1\.2; previous revision: 1\.1
21772 # We are testing -r -D where br1 is a (magic) branch without
21773 # any revisions. First the case where br2 doesn't have any
21774 # revisions either:
21775 dotest tagdate-8 "${testcvs} -q update -p -r br1 -D now" "trunk-1"
21776 dotest tagdate-9 "${testcvs} -q update -r br2" "[UP] file1"
21778 dotest tagdate-10 "${testcvs} -q ci -m modify-on-br2" \
21779 "Checking in file1;
21780 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21781 new revision: 1\.1\.4\.1; previous revision: 1\.1
21784 # Then the case where br2 does have revisions:
21785 dotest tagdate-11 "${testcvs} -q update -p -r br1 -D now" "trunk-1"
21787 # For some reason, doing this on a branch seems to be relevant.
21788 dotest_fail tagdate-12 "${testcvs} -q update -j:yesterday" \
21789 "${PROG} \[update aborted\]: argument to join may not contain a date specifier without a tag"
21792 # Wish some shorter sleep interval would suffice, but I need to
21793 # guarantee that the point in time specified by the argument to -D
21794 # in tagdate-14 and tagdate-16
21795 # falls in the space of time between commits to br2 and I
21796 # figure 60 seconds is probably a large enough range to
21797 # account for most network file system delays and such...
21798 # as it stands, it takes between 1 and 2 seconds between
21799 # calling CVS on my machine and the -D argument being used to
21800 # recall the file revision and this timing will certainly vary
21801 # by several seconds between machines - dependant on CPUspeeds,
21802 # I/O speeds, load, etc.
21806 dotest tagdate-13 "${testcvs} -q ci -m modify-2-on-br2" \
21807 "Checking in file1;
21808 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21809 new revision: 1\.1\.4\.2; previous revision: 1\.1\.4\.1
21813 dotest tagdate-14 "${testcvs} -q export -r br2 -D'1 minute ago' first-dir" \
21814 "[UP] first-dir/file1"
21815 dotest tagdate-15 "cat first-dir/file1" "br2-1"
21819 dotest tagdate-16 "${testcvs} annotate -rbr2 -D'1 minute ago'" \
21821 Annotations for file1
21822 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
21823 1\.1\.4\.1 (${username} *[0-9a-zA-Z-]*): br2-1"
21825 dotest tagdate-17 "${testcvs} annotate -rbr2 -Dnow" \
21827 Annotations for file1
21828 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
21829 1\.1\.4\.2 (${username} *[0-9a-zA-Z-]*): br2-2"
21832 echo Keeping ${TESTDIR} and exiting due to --keep
21838 rm -rf ${CVSROOT_DIRNAME}/first-dir
21842 # Commit the first delta on branch A when there is an older
21843 # branch, B, that already has a delta. A and B come from the
21844 # same branch point. Then verify that branches A and B are
21845 # in the right order.
21847 dotest multibranch2-1 "${testcvs} -q co -l ." ''
21849 dotest multibranch2-2 "${testcvs} add first-dir" \
21850 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
21853 echo trunk-1 >file1
21854 echo trunk-1 >file2
21855 dotest multibranch2-3 "${testcvs} add file1 file2" \
21856 "${PROG} add: scheduling file .file1. for addition
21857 ${PROG} add: scheduling file .file2. for addition
21858 ${PROG} add: use .${PROG} commit. to add these files permanently"
21859 dotest multibranch2-4 "${testcvs} -q ci -m add" \
21860 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21863 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21864 initial revision: 1\.1
21866 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
21869 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
21870 initial revision: 1\.1
21872 dotest multibranch2-5 "${testcvs} -q tag -b A" "T file1
21874 dotest multibranch2-6 "${testcvs} -q tag -b B" "T file1
21877 dotest multibranch2-7 "${testcvs} -q update -r B" ''
21878 echo branch-B >file1
21879 echo branch-B >file2
21880 dotest multibranch2-8 "${testcvs} -q ci -m modify-on-B" \
21881 "Checking in file1;
21882 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21883 new revision: 1\.1\.4\.1; previous revision: 1\.1
21886 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
21887 new revision: 1\.1\.4\.1; previous revision: 1\.1
21890 dotest multibranch2-9 "${testcvs} -q update -r A" '[UP] file1
21892 echo branch-A >file1
21893 # When using cvs-1.9.20, this commit gets a failed assertion in rcs.c.
21894 dotest multibranch2-10 "${testcvs} -q ci -m modify-on-A" \
21895 "Checking in file1;
21896 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21897 new revision: 1\.1\.2\.1; previous revision: 1\.1
21900 dotest multibranch2-11 "${testcvs} -q log file1" \
21902 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21903 Working file: file1
21911 keyword substitution: kv
21912 total revisions: 3; selected revisions: 3
21914 ----------------------------
21916 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
21917 branches: 1\.1\.2; 1\.1\.4;
21919 ----------------------------
21920 revision 1\.1\.4\.1
21921 date: [0-9/]* [0-9:]*; author: $username; state: Exp; lines: ${PLUS}1 -1
21923 ----------------------------
21924 revision 1\.1\.2\.1
21925 date: [0-9/]* [0-9:]*; author: $username; state: Exp; lines: ${PLUS}1 -1
21927 ============================================================================="
21929 # This one is more concise.
21930 dotest multibranch2-12 "${testcvs} -q log -r1.1 file1" \
21932 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21933 Working file: file1
21941 keyword substitution: kv
21942 total revisions: 3; selected revisions: 1
21944 ----------------------------
21946 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
21947 branches: 1\.1\.2; 1\.1\.4;
21949 ============================================================================="
21951 # OK, try very much the same thing except we run update -j to
21952 # bring the changes from B to A. Probably tests many of the
21953 # same code paths but might as well keep it separate, I guess.
21955 dotest multibranch2-13 "${testcvs} -q update -r B" "[UP] file1
21957 dotest multibranch2-14 "${testcvs} -q update -r A -j B file2" \
21959 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
21960 retrieving revision 1.1
21961 retrieving revision 1.1.4.1
21962 Merging differences between 1.1 and 1.1.4.1 into file2"
21963 dotest multibranch2-15 "${testcvs} -q ci -m commit-on-A file2" \
21964 "Checking in file2;
21965 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
21966 new revision: 1\.1\.2\.1; previous revision: 1\.1
21970 rm -rf ${CVSROOT_DIRNAME}/first-dir
21974 # In cvs-1.9.27, there is a bug that can cause an abort.
21975 # It happens when you commit a change to a ,v file that has
21976 # just the right amount of tag/branch info to align one of the
21977 # semicolons in the branch info to be on a 8k-byte boundary.
21978 # The result: rcsbuf_getkey got an abort. This failure doesn't
21979 # corrupt the ,v file -- that would be really serious. But it
21980 # does leave stale write locks that have to be removed manually.
21988 dotest tag8k-1 "$testcvs -Q import -m . $module X Y" ''
21989 dotest tag8k-2 "$testcvs -Q co $module" ''
21994 dotest tag8k-3 "$testcvs add $file" \
21995 "${PROG} add: scheduling file .$file. for addition
21996 ${PROG} add: use .${PROG} commit. to add this file permanently"
21997 dotest tag8k-4 "$testcvs -Q ci -m . $file" \
21998 "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
22001 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
22002 initial revision: 1\.1
22005 # It seems there have to be at least two versions.
22007 dotest tag8k-5 "$testcvs -Q ci -m . $file" \
22008 "Checking in $file;
22009 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
22010 new revision: 1\.2; previous revision: 1\.1
22013 # Add just under 8K worth of tags.
22014 t=TAG---------------------------------------------------------------------
22017 # Now $t is 720 bytes long.
22019 # Apply some tags with that long prefix.
22020 dotest tag8k-6 "$testcvs -Q tag $t-0 $file" ''
22021 dotest tag8k-7 "$testcvs -Q tag $t-1 $file" ''
22022 dotest tag8k-8 "$testcvs -Q tag $t-2 $file" ''
22023 dotest tag8k-9 "$testcvs -Q tag $t-3 $file" ''
22024 dotest tag8k-10 "$testcvs -Q tag $t-4 $file" ''
22025 dotest tag8k-11 "$testcvs -Q tag $t-5 $file" ''
22026 dotest tag8k-12 "$testcvs -Q tag $t-6 $file" ''
22027 dotest tag8k-13 "$testcvs -Q tag $t-7 $file" ''
22028 dotest tag8k-14 "$testcvs -Q tag $t-8 $file" ''
22029 dotest tag8k-15 "$testcvs -Q tag $t-9 $file" ''
22030 dotest tag8k-16 "$testcvs -Q tag $t-a $file" ''
22032 # Extract the author value.
22033 name=`sed -n 's/.*; author \([^;]*\);.*/\1/p' ${CVSROOT_DIRNAME}/$module/$file,v|sed 1q`
22035 # Form a suffix string of length (16 - length($name)).
22036 # CAREFUL: this will lose if $name is longer than 16.
22037 sed_pattern=`echo $name|sed s/././g`
22038 suffix=`echo 1234567890123456|sed s/$sed_pattern//`
22040 # Add a final tag with length chosen so that it will push the
22041 # offset of the `;' in the 2nd occurrence of `;\tauthor' in the
22042 # ,v file to exactly 8192.
22043 dotest tag8k-17 "$testcvs -Q tag "x8bytes-$suffix" $file" ''
22045 # This commit would fail with 1.9.27.
22047 dotest tag8k-18 "$testcvs -Q ci -m . $file" \
22048 "Checking in $file;
22049 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
22050 new revision: 1\.3; previous revision: 1\.2
22054 rm -rf ${CVSROOT_DIRNAME}/$module
22059 # More "cvs admin" tests.
22060 # The basicb-21 test tests rejecting an illegal option.
22061 # For -l and -u, see "reserved" and "keyword" tests.
22062 # "binfiles" test has a test of "cvs admin -k".
22063 # "log2" test has tests of -t and -q options to cvs admin.
22064 # "rcs" tests -b option also.
22066 # admin-22-o1 through admin-23 (various cases not involving ::)
22067 # binfiles2-o* (:rev, rev on trunk; rev:, deleting entire branch)
22068 # basicb-o* (attempt to delete all revisions)
22069 # basica-o1 through basica-o3 (basic :: usage)
22070 # head-o1 (::branch, where this deletes a revision or is noop)
22071 # branches-o1 (::branch, similar, with different branch topology)
22072 # log-o1 (1.3.2.1::)
22073 # binfiles-o1 (1.3:: and ::1.3; binary files)
22074 # binfiles3-9 (binary files)
22075 # Also could be testing:
22079 # 1.3::1.3.2.6 (error? or synonym for ::1.3.2.6?)
22080 # -n: admin, tagf tests.
22083 dotest admin-1 "${testcvs} -q co -l ." ''
22085 dotest admin-2 "${testcvs} add first-dir" \
22086 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22089 dotest_fail admin-3 "${testcvs} -q admin -i file1" \
22090 "${PROG} admin: the -i option to admin is not supported
22091 ${PROG} admin: run add or import to create an RCS file
22092 ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information"
22093 dotest_fail admin-4 "${testcvs} -q log file1" \
22094 "${PROG} log: nothing known about file1"
22095 dotest_fail admin-4a "${testcvs} -q admin file1" \
22096 "${PROG} admin: nothing known about file1"
22098 # Set up some files, file2 a plain one and file1 with a revision
22101 dotest admin-5 "${testcvs} add file1 file2" \
22102 "${PROG} add: scheduling file .file1. for addition
22103 ${PROG} add: scheduling file .file2. for addition
22104 ${PROG} add: use .${PROG} commit. to add these files permanently"
22105 dotest admin-6 "${testcvs} -q ci -m add" \
22106 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22109 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
22110 initial revision: 1\.1
22112 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22115 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
22116 initial revision: 1\.1
22118 dotest admin-7 "${testcvs} -q tag -b br" "T file1
22120 dotest admin-8 "${testcvs} -q update -r br" ""
22121 echo 'add a line on the branch' >> file1
22122 echo 'add a file on the branch' >> file3
22123 dotest admin-9a "${testcvs} -q add file3" \
22124 "${PROG} add: use .${PROG} commit. to add this file permanently"
22125 dotest admin-9b "${testcvs} -q ci -m modify-on-branch" \
22126 "Checking in file1;
22127 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
22128 new revision: 1\.1\.2\.1; previous revision: 1\.1
22130 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
22133 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
22134 new revision: 1\.1\.2\.1; previous revision: 1\.1
22136 dotest admin-10 "${testcvs} -q update -A" \
22138 ${PROG} update: file3 is no longer in the repository"
22140 # Check that we can administer files in the repository that
22141 # aren't in the working directory.
22142 dotest admin-10-1 "${testcvs} admin ." \
22143 "${PROG} admin: Administrating .
22144 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22146 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22148 dotest admin-10-2 "${testcvs} -q admin file3" \
22149 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
22152 # Try to recurse with a numeric revision arg.
22153 # If we wanted to comprehensive about this, we would also test
22154 # this for -l, -u, and all the different -o syntaxes.
22155 dotest_fail admin-10a "${testcvs} -q admin -b1.1.2" \
22156 "${PROG} [a-z]*: while processing more than one file:
22157 ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
22158 dotest_fail admin-10b "${testcvs} -q admin -m1.1:bogus file1 file2" \
22159 "${PROG} [a-z]*: while processing more than one file:
22160 ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
22162 # try a bad symbolic revision
22163 dotest_fail admin-10c "${testcvs} -q admin -bBOGUS" \
22164 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22165 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file1,v: Symbolic name BOGUS is undefined.
22166 ${PROG} admin: RCS file for .file1. not modified\.
22167 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22168 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name BOGUS is undefined.
22169 ${PROG} admin: RCS file for .file2. not modified\."
22171 # Note that -s option applies to the new default branch, not
22173 # Also note that the implementation of -a via "rcs" requires
22174 # no space between -a and the argument. However, we expect
22175 # to change that once CVS parses options.
22176 dotest admin-11 "${testcvs} -q admin -afoo,bar -abaz \
22177 -b1.1.2 -cxx -U -sfoo file1" \
22178 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22180 dotest admin-11a "${testcvs} log -N file1" "
22181 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22182 Working file: file1
22190 keyword substitution: kv
22191 total revisions: 2; selected revisions: 2
22193 ----------------------------
22195 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
22198 ----------------------------
22199 revision 1\.1\.2\.1
22200 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
22202 ============================================================================="
22203 dotest admin-12 "${testcvs} -q admin -bbr file1" \
22204 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22206 dotest admin-12a "${testcvs} log -N file1" "
22207 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22208 Working file: file1
22216 keyword substitution: kv
22217 total revisions: 2; selected revisions: 2
22219 ----------------------------
22221 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
22224 ----------------------------
22225 revision 1\.1\.2\.1
22226 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
22228 ============================================================================="
22230 # "cvs log" doesn't print the comment leader. RCS 5.7 will print
22231 # the comment leader only if one specifies "-V4" to rlog. So it
22232 # seems like the only way to test it is by looking at the RCS file
22233 # directly. This also serves as a test of exporting RCS files
22234 # (analogous to the import tests in "rcs").
22235 # Rather than try to write a rigorous check for whether the
22236 # file CVS exports is legal, we just write a simpler
22237 # test for what CVS actually exports, and figure we can revise
22238 # the check as needed (within the confines of the RCS5 format as
22239 # documented in RCSFILES).
22240 # Note that we must accept either 2 or 4 digit year.
22241 dotest admin-13 "cat ${CVSROOT_DIRNAME}/first-dir/file1,v" \
22255 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;
22261 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;
22284 add a line on the branch
22286 dotest_fail admin-14-1 "${testcvs} -q admin \
22287 -m1.1.1.1:changed-bogus-log-message file2" \
22288 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22289 cvs admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: no such revision 1\.1\.1\.1
22290 cvs admin: RCS file for .file2. not modified."
22291 dotest admin-14-2 "${testcvs} -q log file2" "
22292 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22293 Working file: file2
22300 keyword substitution: kv
22301 total revisions: 1; selected revisions: 1
22303 ----------------------------
22305 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
22307 ============================================================================="
22309 dotest admin-14-3 "${testcvs} -q admin -aauth3 -aauth2,foo \
22310 -soneone:1.1 -m1.1:changed-log-message -ntagone: file2" \
22311 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22313 dotest admin-15 "${testcvs} -q log file2" "
22314 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22315 Working file: file2
22326 keyword substitution: kv
22327 total revisions: 1; selected revisions: 1
22329 ----------------------------
22331 date: [0-9/]* [0-9:]*; author: ${username}; state: oneone;
22332 changed-log-message
22333 ============================================================================="
22335 dotest admin-16 "${testcvs} -q admin \
22336 -A${CVSROOT_DIRNAME}/first-dir/file2,v -b -L -Nbr:1.1 file1" \
22337 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22339 dotest admin-17 "${testcvs} -q log file1" "
22340 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22341 Working file: file1
22353 keyword substitution: kv
22354 total revisions: 2; selected revisions: 2
22356 ----------------------------
22358 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
22361 ----------------------------
22362 revision 1\.1\.2\.1
22363 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
22365 ============================================================================="
22367 dotest_fail admin-18 "${testcvs} -q admin -nbr:1.1.2 file1" \
22368 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22369 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file1,v: symbolic name br already bound to 1\.1
22370 ${PROG} admin: RCS file for .file1. not modified\."
22371 dotest admin-19 "${testcvs} -q admin -ebaz -ebar,auth3 -nbr file1" \
22372 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22374 dotest admin-20 "${testcvs} -q log file1" "
22375 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22376 Working file: file1
22384 keyword substitution: kv
22385 total revisions: 2; selected revisions: 2
22387 ----------------------------
22389 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
22392 ----------------------------
22394 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
22396 ============================================================================="
22398 # OK, this is starting to get ridiculous, in terms of
22399 # testing a feature (access lists) which doesn't do anything
22400 # useful, but what about nonexistent files and
22401 # relative pathnames in admin -A?
22402 dotest_fail admin-19a-nonexist \
22403 "${testcvs} -q admin -A${TESTDIR}/foo/bar file1" \
22404 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22405 ${PROG} admin: Couldn't open rcs file .${TESTDIR}/foo/bar.: No such file or directory
22406 ${PROG} \[admin aborted\]: cannot continue"
22408 # In the remote case, we are cd'd off into the temp directory
22409 # and so these tests give "No such file or directory" errors.
22410 if $remote; then :; else
22411 dotest admin-19a-admin "${testcvs} -q admin -A../../cvsroot/first-dir/file2,v file1" \
22412 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22414 dotest admin-19a-log "${testcvs} -q log -h -N file1" "
22415 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22416 Working file: file1
22424 keyword substitution: kv
22426 ============================================================================="
22427 fi # end of tests skipped for remote
22429 # Now test that plain -e works right.
22430 dotest admin-19a-2 "${testcvs} -q admin -e file1" \
22431 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22433 dotest admin-19a-3 "${testcvs} -q log -h -N file1" "
22434 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22435 Working file: file1
22440 keyword substitution: kv
22442 ============================================================================="
22444 # Put the access list back, to avoid special cases later.
22445 dotest admin-19a-4 "${testcvs} -q admin -afoo,auth2 file1" \
22446 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22449 # Add another revision to file2, so we can delete one.
22450 echo 'add a line' >> file2
22451 dotest admin-21 "${testcvs} -q ci -m modify file2" \
22452 "Checking in file2;
22453 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
22454 new revision: 1\.2; previous revision: 1\.1
22456 dotest admin-22 "${testcvs} -q admin -o1.1 file2" \
22457 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22458 deleting revision 1\.1
22460 # Test admin -o. More variants that we could be testing:
22461 # * REV: [on branch]
22462 # * REV1:REV2 [deleting whole branch]
22463 # * high branch numbers (e.g. 1.2.2.3.2.3)
22464 # ... and probably others. See RCS_delete_revs for ideas.
22466 echo first rev > aaa
22467 dotest admin-22-o1 "${testcvs} add aaa" \
22468 "${PROG} add: scheduling file .aaa. for addition
22469 ${PROG} add: use .${PROG} commit. to add this file permanently"
22470 dotest admin-22-o2 "${testcvs} -q ci -m first aaa" \
22471 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22474 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
22475 initial revision: 1\.1
22477 echo second rev >> aaa
22478 dotest admin-22-o3 "${testcvs} -q ci -m second aaa" \
22480 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
22481 new revision: 1\.2; previous revision: 1\.1
22483 echo third rev >> aaa
22484 dotest admin-22-o4 "${testcvs} -q ci -m third aaa" \
22486 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
22487 new revision: 1\.3; previous revision: 1\.2
22489 echo fourth rev >> aaa
22490 dotest admin-22-o5 "${testcvs} -q ci -m fourth aaa" \
22492 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
22493 new revision: 1\.4; previous revision: 1\.3
22495 echo fifth rev >>aaa
22496 dotest admin-22-o6 "${testcvs} -q ci -m fifth aaa" \
22498 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
22499 new revision: 1\.5; previous revision: 1\.4
22501 echo sixth rev >> aaa
22502 dotest admin-22-o7 "${testcvs} -q ci -m sixth aaa" \
22504 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
22505 new revision: 1\.6; previous revision: 1\.5
22507 dotest admin-22-o8 "${testcvs} admin -l1.6 aaa" \
22508 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22511 dotest admin-22-o9 "${testcvs} log -r1.6 aaa" "
22512 RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22520 keyword substitution: kv
22521 total revisions: 6; selected revisions: 1
22523 ----------------------------
22524 revision 1\.6 locked by: ${username};
22525 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
22527 ============================================================================="
22528 dotest_fail admin-22-o10 "${testcvs} admin -o1.5: aaa" \
22529 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22530 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/aaa,v: can't remove locked revision 1\.6
22531 ${PROG} admin: RCS file for .aaa. not modified\."
22532 dotest admin-22-o11 "${testcvs} admin -u aaa" \
22533 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22536 dotest admin-22-o12 "${testcvs} admin -o1.5: aaa" \
22537 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22538 deleting revision 1\.6
22539 deleting revision 1\.5
22541 dotest admin-22-o13 "${testcvs} log aaa" "
22542 RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22549 keyword substitution: kv
22550 total revisions: 4; selected revisions: 4
22552 ----------------------------
22554 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
22556 ----------------------------
22558 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
22560 ----------------------------
22562 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
22564 ----------------------------
22566 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
22568 ============================================================================="
22570 dotest admin-22-o14 "${testcvs} tag -b -r1.3 br1 aaa" "T aaa"
22571 dotest admin-22-o15 "${testcvs} update -rbr1 aaa" "U aaa"
22572 echo new branch rev >> aaa
22573 dotest admin-22-o16 "${testcvs} ci -m new-branch aaa" \
22575 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
22576 new revision: 1\.3\.2\.1; previous revision: 1\.3
22578 dotest_fail admin-22-o17 "${testcvs} admin -o1.2:1.4 aaa" \
22579 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22580 deleting revision 1\.4
22581 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/aaa,v: can't remove branch point 1\.3
22582 ${PROG} admin: RCS file for .aaa. not modified\."
22583 dotest admin-22-o18 "${testcvs} update -p -r1.4 aaa" \
22584 "===================================================================
22586 RCS: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22588 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
22593 echo second branch rev >> aaa
22594 dotest admin-22-o19 "${testcvs} ci -m branch-two aaa" \
22596 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
22597 new revision: 1\.3\.2\.2; previous revision: 1\.3\.2\.1
22599 echo third branch rev >> aaa
22600 dotest admin-22-o20 "${testcvs} ci -m branch-three aaa" \
22602 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
22603 new revision: 1\.3\.2\.3; previous revision: 1\.3\.2\.2
22605 echo fourth branch rev >> aaa
22606 dotest admin-22-o21 "${testcvs} ci -m branch-four aaa" \
22608 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
22609 new revision: 1\.3\.2\.4; previous revision: 1\.3\.2\.3
22611 dotest admin-22-o22 "${testcvs} admin -o:1.3.2.3 aaa" \
22612 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22613 deleting revision 1\.3\.2\.1
22614 deleting revision 1\.3\.2\.2
22615 deleting revision 1\.3\.2\.3
22617 dotest admin-22-o23 "${testcvs} log aaa" "
22618 RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22626 keyword substitution: kv
22627 total revisions: 5; selected revisions: 5
22629 ----------------------------
22631 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
22633 ----------------------------
22635 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
22638 ----------------------------
22640 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
22642 ----------------------------
22644 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
22646 ----------------------------
22647 revision 1\.3\.2\.4
22648 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}4 -0
22650 ============================================================================="
22652 dotest admin-22-o24 "${testcvs} -q update -p -r 1.3.2.4 aaa" \
22661 # The bit here about how there is a "tagone" tag pointing to
22662 # a nonexistent revision is documented by rcs. I dunno, I
22663 # wonder whether the "cvs admin -o" should give a warning in
22665 dotest admin-23 "${testcvs} -q log file2" "
22666 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22667 Working file: file2
22678 keyword substitution: kv
22679 total revisions: 1; selected revisions: 1
22681 ----------------------------
22683 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
22685 ============================================================================="
22687 dotest admin-25 "cat ${CVSROOT_DIRNAME}/first-dir/file1,v" \
22698 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;
22704 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;
22727 add a line on the branch
22730 # Tests of cvs admin -n. Make use of the results of
22731 # admin-1 through admin-25.
22732 # FIXME: We probably shouldn't make use of those results;
22733 # this test is way too long as it is.
22735 # tagtwo should be a revision
22737 dotest admin-26-1 "${testcvs} admin -ntagtwo:tagone file2" \
22738 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22741 # br1 should be a branch
22743 dotest admin-26-2 "${testcvs} admin -nbr1:br file2" \
22744 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22747 # Attach some tags using RCS versions
22749 dotest admin-26-3 "${testcvs} admin -ntagthree:1.1 file2" \
22750 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22753 dotest admin-26-4 "${testcvs} admin -nbr2:1.1.2 file2" \
22754 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22757 dotest admin-26-5 "${testcvs} admin -nbr4:1.1.0.2 file2" \
22758 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22761 # Check results so far
22763 dotest admin-26-6 "${testcvs} status -v file2" \
22764 "===================================================================
22765 File: file2 Status: Up-to-date
22767 Working revision: 1\.2.*
22768 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file2,v
22770 Sticky Date: (none)
22771 Sticky Options: (none)
22774 br4 (branch: 1\.1\.2)
22775 br2 (branch: 1\.1\.2)
22776 tagthree (revision: 1\.1)
22777 br1 (branch: 1\.1\.2)
22778 tagtwo (revision: 1\.1)
22779 tagone (revision: 1\.1)
22780 br (branch: 1\.1\.2)"
22783 # Add a couple more revisions
22785 echo "nuthr_line" >> file2
22786 dotest admin-27-1 "${testcvs} commit -m nuthr_line file2" \
22787 "Checking in file2;
22788 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
22789 new revision: 1\.3; previous revision: 1\.2
22792 echo "yet_another" >> file2
22793 dotest admin-27-2 "${testcvs} commit -m yet_another file2" \
22794 "Checking in file2;
22795 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
22796 new revision: 1\.4; previous revision: 1\.3
22799 # Fail trying to reattach existing tag with -n
22801 dotest admin-27-3 "${testcvs} admin -ntagfour:1.1 file2" \
22802 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22805 dotest_fail admin-27-4 "${testcvs} admin -ntagfour:1.3 file2" \
22806 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22807 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: symbolic name tagfour already bound to 1\.1
22808 ${PROG} admin: RCS file for .file2. not modified\."
22810 # Succeed at reattaching existing tag, using -N
22812 dotest admin-27-5 "${testcvs} admin -Ntagfour:1.3 file2" \
22813 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22816 # Fail on some bogus operations
22817 # Try to attach to nonexistant tag
22819 dotest_fail admin-28-1 "${testcvs} admin -ntagsix:tagfive file2" \
22820 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22821 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name or revision tagfive is undefined\.
22822 ${PROG} admin: RCS file for .file2. not modified\."
22824 # Try a some nonexisting numeric target tags
22826 dotest_fail admin-28-2 "${testcvs} admin -ntagseven:2.1 file2" \
22827 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22828 ${PROG} \[admin aborted\]: revision .2\.1. does not exist"
22830 dotest_fail admin-28-3 "${testcvs} admin -ntageight:2.1.2 file2" \
22831 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22832 ${PROG} \[admin aborted\]: revision .2\.1\.2. does not exist"
22834 # Try some invalid targets
22836 dotest_fail admin-28-4 "${testcvs} admin -ntagnine:1.a.2 file2" \
22837 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22838 ${PROG} \[admin aborted\]: tag .1\.a\.2. must start with a letter"
22840 # Confirm that a missing tag is not a fatal error.
22841 dotest admin-28-5.1 "${testcvs} -Q tag BO+GUS file1" ''
22842 dotest_fail admin-28-5.2 "${testcvs} admin -ntagten:BO+GUS file2 file1" \
22843 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22844 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name or revision BO${PLUS}GUS is undefined\.
22845 ${PROG} admin: RCS file for .file2. not modified\.
22846 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22849 dotest_fail admin-28-6 "${testcvs} admin -nq.werty:tagfour file2" \
22850 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22851 ${PROG} \[admin aborted\]: tag .q\.werty. must not contain the characters ..*"
22853 # Verify the archive
22855 dotest admin-29 "cat ${CVSROOT_DIRNAME}/first-dir/file2,v" \
22875 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;
22880 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;
22885 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;
22922 dotest_fail admin-30 "${testcvs} admin -mbr:another-log-message \
22924 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22925 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: no such revision br: 1\.1
22926 ${PROG} admin: RCS file for .file2. not modified.
22927 RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22928 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/aaa,v: no such revision br
22929 ${PROG} admin: RCS file for .aaa. not modified.
22930 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
22932 dotest admin-31 "${testcvs} log" \
22933 "${PROG} log: Logging \.
22935 RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
22943 keyword substitution: kv
22944 total revisions: 5; selected revisions: 5
22946 ----------------------------
22948 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
22950 ----------------------------
22952 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
22955 ----------------------------
22957 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
22959 ----------------------------
22961 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
22963 ----------------------------
22964 revision 1\.3\.2\.4
22965 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}4 -0
22967 =============================================================================
22969 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22970 Working file: file1
22980 keyword substitution: kv
22981 total revisions: 2; selected revisions: 2
22983 ----------------------------
22985 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
22988 ----------------------------
22989 revision 1\.1\.2\.1
22990 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
22992 =============================================================================
22994 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22995 Working file: file2
23012 keyword substitution: kv
23013 total revisions: 3; selected revisions: 3
23015 ----------------------------
23017 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
23019 ----------------------------
23021 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
23023 ----------------------------
23025 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
23027 =============================================================================
23029 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
23030 Working file: file3
23037 keyword substitution: kv
23038 total revisions: 2; selected revisions: 2
23040 ----------------------------
23042 date: [0-9/]* [0-9:]*; author: ${username}; state: dead;
23044 file file3 was initially added on branch br\.
23045 ----------------------------
23046 revision 1\.1\.2\.1
23047 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
23048 another-log-message
23049 ============================================================================="
23053 echo Keeping ${TESTDIR} and exiting due to --keep
23056 # clean up our after ourselves
23058 rm -rf ${CVSROOT_DIRNAME}/first-dir
23062 # Tests of reserved checkouts. Eventually this will test
23063 # rcslock.pl (or equivalent) and all kinds of stuff. Right
23064 # now it just does some very basic checks on cvs admin -u
23065 # and cvs admin -l.
23066 # Also should test locking on a branch (and making sure that
23067 # locks from one branch don't get mixed up with those from
23068 # another. Both the case where one of the branches is the
23069 # main branch, and in which neither one is).
23070 # See also test keyword, which tests that keywords and -kkvl
23071 # do the right thing in the presence of locks.
23073 # The usual setup, directory first-dir containing file file1.
23075 dotest reserved-1 "${testcvs} -q co -l ." ''
23077 dotest reserved-2 "${testcvs} add first-dir" \
23078 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
23081 dotest reserved-3 "${testcvs} add file1" \
23082 "${PROG} add: scheduling file .file1. for addition
23083 ${PROG} add: use .${PROG} commit. to add this file permanently"
23084 dotest reserved-4 "${testcvs} -q ci -m add" \
23085 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23088 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23089 initial revision: 1\.1
23092 dotest reserved-5 "${testcvs} -q admin -l file1" \
23093 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23096 dotest reserved-6 "${testcvs} log -N file1" "
23097 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23098 Working file: file1
23104 keyword substitution: kv
23105 total revisions: 1; selected revisions: 1
23107 ----------------------------
23108 revision 1\.1 locked by: ${username};
23109 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
23111 ============================================================================="
23113 # Note that this just tests the owner of the lock giving
23114 # it up. It doesn't test breaking a lock.
23115 dotest reserved-7 "${testcvs} -q admin -u file1" \
23116 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23120 dotest reserved-8 "${testcvs} log -N file1" "
23121 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23122 Working file: file1
23127 keyword substitution: kv
23128 total revisions: 1; selected revisions: 1
23130 ----------------------------
23132 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
23134 ============================================================================="
23136 # rcslock.pl tests. Of course, the point isn't to test
23137 # rcslock.pl from the distribution but equivalent
23138 # functionality (for example, many sites may have an old
23139 # rcslock.pl). The functionality of this hook falls
23140 # short of the real rcslock.pl though.
23141 # Note that we can use rlog or look at the RCS file directly,
23142 # but we can't use "cvs log" because "cvs commit" has a lock.
23144 cat >${TESTDIR}/lockme <<EOF
23146 line=\`grep <\$1/\$2,v 'locks ${author}:1\.[0-9];'\`
23147 if test -z "\$line"; then
23151 user=\`echo \$line | sed -e 's/locks \\(${author}\\):[0-9.]*;.*/\\1/'\`
23152 version=\`echo \$line | sed -e 's/locks ${author}:\\([0-9.]*\\);.*/\\1/'\`
23153 echo "\$user has file a-lock locked for version \$version" >&2
23158 if test -n "$remotehost"; then
23159 $CVS_RSH $remotehost "chmod +x ${TESTDIR}/lockme"
23161 chmod +x ${TESTDIR}/lockme
23164 echo stuff > a-lock
23165 dotest reserved-9 "${testcvs} add a-lock" \
23166 "${PROG} add: scheduling file .a-lock. for addition
23167 ${PROG} add: use .${PROG} commit. to add this file permanently"
23168 dotest reserved-10 "${testcvs} -q ci -m new a-lock" \
23169 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
23171 Checking in a-lock;
23172 ${CVSROOT_DIRNAME}/first-dir/a-lock,v <-- a-lock
23173 initial revision: 1\.1
23175 # FIXME: the contents of CVSROOT fluctuate a lot
23176 # here. Maybe the expect pattern should just
23177 # confirm that commitinfo is one of the files checked out,
23178 # but for now we just check that CVS exited with success.
23180 if ${testcvs} -q co CVSROOT >>${LOGFILE} ; then
23186 echo "DEFAULT ${TESTDIR}/lockme" >>commitinfo
23187 dotest reserved-12 "${testcvs} -q ci -m rcslock commitinfo" \
23188 "Checking in commitinfo;
23189 ${CVSROOT_DIRNAME}/CVSROOT/commitinfo,v <-- commitinfo
23190 new revision: 1\.2; previous revision: 1\.1
23192 ${PROG} commit: Rebuilding administrative file database"
23193 cd ..; cd first-dir
23195 # Simulate (approximately) what a-lock would look like
23196 # if someone else had locked revision 1.1.
23197 sed -e 's/locks; strict;/locks fred:1.1; strict;/' ${CVSROOT_DIRNAME}/first-dir/a-lock,v > a-lock,v
23199 if test -n "$remotehost"; then
23200 $CVS_RSH $remotehost "chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v"
23202 chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
23204 dotest reserved-13 "mv a-lock,v ${CVSROOT_DIRNAME}/first-dir/a-lock,v"
23206 if test -n "$remotehost"; then
23207 $CVS_RSH $remotehost "chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v"
23209 chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
23211 echo more stuff >> a-lock
23212 dotest_fail reserved-13b "${testcvs} ci -m '' a-lock" \
23213 "fred has file a-lock locked for version 1\.1
23214 ${PROG} commit: Pre-commit check failed
23215 ${PROG} \[commit aborted\]: correct above errors first!"
23216 # OK, now test "cvs admin -l" in the case where someone
23217 # else has the file locked.
23218 dotest_fail reserved-13c "${testcvs} admin -l a-lock" \
23219 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
23220 ${PROG} \[admin aborted\]: Revision 1\.1 is already locked by fred"
23222 dotest reserved-14 "${testcvs} admin -u1.1 a-lock" \
23223 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
23224 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/a-lock,v: revision 1\.1 locked by fred; breaking lock
23227 dotest reserved-15 "${testcvs} -q ci -m success a-lock" \
23228 "Checking in a-lock;
23229 ${CVSROOT_DIRNAME}/first-dir/a-lock,v <-- a-lock
23230 new revision: 1\.2; previous revision: 1\.1
23233 # Now test for a bug involving branches and locks
23234 sed -e 's/locks; strict;/locks fred:1.2; strict;/' ${CVSROOT_DIRNAME}/first-dir/a-lock,v > a-lock,v
23235 chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
23236 dotest reserved-16 \
23237 "mv a-lock,v ${CVSROOT_DIRNAME}/first-dir/a-lock,v" ""
23238 chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
23239 dotest reserved-17 "${testcvs} -q tag -b br a-lock" "T a-lock"
23240 dotest reserved-18 "${testcvs} -q update -r br a-lock" ""
23241 echo edit it >>a-lock
23242 dotest reserved-19 "${testcvs} -q ci -m modify a-lock" \
23243 "Checking in a-lock;
23244 ${CVSROOT_DIRNAME}/first-dir/a-lock,v <-- a-lock
23245 new revision: 1\.2\.2\.1; previous revision: 1\.2
23248 # undo commitinfo changes
23250 echo '# vanilla commitinfo' >commitinfo
23251 dotest reserved-cleanup-1 "${testcvs} -q ci -m back commitinfo" \
23252 "Checking in commitinfo;
23253 ${CVSROOT_DIRNAME}/CVSROOT/commitinfo,v <-- commitinfo
23254 new revision: 1\.3; previous revision: 1\.2
23256 ${PROG} commit: Rebuilding administrative file database"
23257 cd ..; rm -r CVSROOT; cd first-dir
23261 rm ${TESTDIR}/lockme
23262 rm -rf ${CVSROOT_DIRNAME}/first-dir
23266 # Make sure CVS can merge correctly in circumstances where it
23267 # used to mess up (due to a bug which existed in diffutils 2.7
23268 # and 2.6, but not 2.5, and which has been fixed in CVS's diff
23269 # lib by Paul Eggert, bless his bitty heart).
23271 # This first test involves two working copies, "mine" and
23272 # "yours", checked out from the same repository at the same
23273 # time. In yours, you remove some text from the end of the
23274 # file and check it in; meanwhile, "me" has commented out some
23275 # lines earlier in the file, and I go to check it in right
23276 # after you checked yours in. CVS naturally tells me the file
23277 # is not up-to-date, so I run cvs update, but it updates
23278 # incorrectly, leaving in the lines of text you just deleted.
23279 # Bad! I'm in too much of a hurry to actually look at the
23280 # file, so I check it in and go home, and so your changes have
23281 # been lost. Later you discover this, and you suspect me of
23282 # deliberately sabotaging your work, so you let all the air
23283 # out of my tires. Only after a series of expensive lawsuits
23284 # and countersuits do we discover that this was all CVS's
23287 # Luckily, this problem has been fixed now, as our test will
23288 # handily confirm, no doubt:
23290 # First make a repository containing the original text:
23292 # We should be here anyway, but cd to it just in case:
23298 # These are the files we both start out with:
23301 diffmerge_create_older_files
23303 dotest diffmerge1_import \
23304 "${testcvs} import -m import diffmerge1 tag1 tag2" \
23305 "${DOTSTAR}No conflicts created by this import"
23308 # Check out two working copies, one for "you" and one for
23309 # "me". If no branch is used and cvs detects that only one
23310 # of the two people made changes, then cvs does not run the
23311 # merge algorithm. But if a branch is used, then cvs does run
23312 # the merge algorithm (even in this case of only one of the two
23313 # people having made changes). CVS used to have a bug in this
23314 # case. Therefore, it is important to test this case by
23316 ${testcvs} rtag -b tag diffmerge1 >/dev/null 2>&1
23317 ${testcvs} checkout -r tag diffmerge1 >/dev/null 2>&1
23318 mv diffmerge1 yours
23319 ${testcvs} checkout diffmerge1 >/dev/null 2>&1
23322 # In your working copy, you'll make changes, and
23323 # then check in your changes before I check in mine:
23325 diffmerge_create_your_files
23326 dotest diffmerge1_yours "${testcvs} -q ci -m yours" \
23327 "Checking in testcase01;
23328 ${CVSROOT_DIRNAME}/diffmerge1/testcase01,v <-- testcase01
23329 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
23331 Checking in testcase02;
23332 ${CVSROOT_DIRNAME}/diffmerge1/testcase02,v <-- testcase02
23333 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
23335 Checking in testcase03;
23336 ${CVSROOT_DIRNAME}/diffmerge1/testcase03,v <-- testcase03
23337 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
23339 Checking in testcase04;
23340 ${CVSROOT_DIRNAME}/diffmerge1/testcase04,v <-- testcase04
23341 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
23343 Checking in testcase05;
23344 ${CVSROOT_DIRNAME}/diffmerge1/testcase05,v <-- testcase05
23345 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
23347 Checking in testcase06;
23348 ${CVSROOT_DIRNAME}/diffmerge1/testcase06,v <-- testcase06
23349 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
23351 Checking in testcase07;
23352 ${CVSROOT_DIRNAME}/diffmerge1/testcase07,v <-- testcase07
23353 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
23355 Checking in testcase08;
23356 ${CVSROOT_DIRNAME}/diffmerge1/testcase08,v <-- testcase08
23357 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
23359 Checking in testcase09;
23360 ${CVSROOT_DIRNAME}/diffmerge1/testcase09,v <-- testcase09
23361 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
23363 Checking in testcase10;
23364 ${CVSROOT_DIRNAME}/diffmerge1/testcase10,v <-- testcase10
23365 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
23368 # Change my copy. Then I
23369 # update, after both my modifications and your checkin:
23371 diffmerge_create_my_files
23372 dotest diffmerge1_mine "${testcvs} -q update -j tag" \
23374 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase01,v
23375 retrieving revision 1\.1\.1\.1
23376 retrieving revision 1\.1\.1\.1\.2\.1
23377 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase01
23379 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase02,v
23380 retrieving revision 1\.1\.1\.1
23381 retrieving revision 1\.1\.1\.1\.2\.1
23382 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase02
23384 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase03,v
23385 retrieving revision 1\.1\.1\.1
23386 retrieving revision 1\.1\.1\.1\.2\.1
23387 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase03
23389 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase04,v
23390 retrieving revision 1\.1\.1\.1
23391 retrieving revision 1\.1\.1\.1\.2\.1
23392 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase04
23393 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase05,v
23394 retrieving revision 1\.1\.1\.1
23395 retrieving revision 1\.1\.1\.1\.2\.1
23396 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase05
23397 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase06,v
23398 retrieving revision 1\.1\.1\.1
23399 retrieving revision 1\.1\.1\.1\.2\.1
23400 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase06
23402 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase07,v
23403 retrieving revision 1\.1\.1\.1
23404 retrieving revision 1\.1\.1\.1\.2\.1
23405 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase07
23406 testcase07 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1
23408 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase08,v
23409 retrieving revision 1\.1\.1\.1
23410 retrieving revision 1\.1\.1\.1\.2\.1
23411 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase08
23413 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase09,v
23414 retrieving revision 1\.1\.1\.1
23415 retrieving revision 1\.1\.1\.1\.2\.1
23416 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase09
23418 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase10,v
23419 retrieving revision 1\.1\.1\.1
23420 retrieving revision 1\.1\.1\.1\.2\.1
23421 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase10"
23423 # So if your changes didn't make it into my working copy, or
23424 # in any case if the files do not look like the final text
23425 # in the files in directory comp_me, then the test flunks:
23429 diffmerge_create_expected_files
23433 # If you have GNU's version of diff, you may try
23434 # uncommenting the following line which will give more
23435 # fine-grained information about how cvs differed from the
23437 #dotest diffmerge1_cmp "diff -u --recursive --exclude=CVS comp_me mine" ''
23438 dotest diffmerge1_cmp "directory_cmp comp_me mine"
23440 # Clean up after ourselves:
23442 if $keep; then :; else
23443 rm -rf diffmerge1 ${CVSROOT_DIRNAME}/diffmerge1
23449 # FIXME: This test should be rewritten to be much more concise.
23450 # It currently weighs in at something like 600 lines, but the
23451 # same thing could probably be tested in more like 50-100 lines.
23454 # This tests for another diffmerge bug reported by Martin
23455 # Tomes; actually, his bug was probably caused by an initial
23456 # fix for the bug in test diffmerge1, and likely wasn't ever
23457 # a problem in CVS as long as one was using a normal
23458 # distribution of diff or a version of CVS that has the diff
23461 # Nevertheless, once burned twice cautious, so we test for his
23464 # Here is his report, more or less verbatim:
23465 # ------------------------------------------
23467 # Put the attached file (sgrid.h,v) into your repository
23468 # somewhere, check out the module and do this:
23470 # cvs update -j Review_Phase_2_Enhancements sgrid.h
23471 # cvs diff -r Review_V1p3 sgrid.h
23473 # As there have been no changes made on the trunk there
23474 # should be no differences, however this is output:
23476 # % cvs diff -r Review_V1p3 sgrid.h
23478 # ===================================================================
23479 # RCS file: /usr/local/repository/play/fred/sgrid.h,v
23480 # retrieving revision 1.1.2.1
23481 # diff -r1.1.2.1 sgrid.h
23483 # > /*--------------------------------------------------------------
23484 # > INLINE FUNCTION : HORIZONTALLINES
23485 # > NOTES : Description at the end of the file
23486 # > ----------------------------------------------------------------*/
23487 # > uint16 horizontalLines( void );
23490 # I did a cvs diff -c -r 1.1 -r 1.1.2.1 sgrid.h and patched those
23491 # differences to sgrid.h version 1.1 and got the correct result
23492 # so it looks like the built in patch is faulty.
23493 # -------------------------------------------------------------------
23495 # This is the RCS file, sgrid.h,v, that he sent:
23500 Review_V1p3:1.1.2.1
23501 Review_V1p3C:1.1.2.1
23502 Review_1p3A:1.1.2.1
23503 Review_V1p3A:1.1.2.1
23504 Review_Phase_2_Enhancements:1.1.0.2
23515 date 97.04.02.11.20.05; author colinl; state Exp;
23521 date 97.06.09.10.00.07; author colinl; state Exp;
23534 Tested By: Colin Law
23536 Reason for Change: Initial Revision of all files
23538 Design Change Details:
23543 @/* \$""Header: L:/gpanels/dis/sgrid.h_v 1.1.1.0 24 Jan 1996 14:59:20 PAULT \$ */
23545 * \$""Log: L:/gpanels/dis/sgrid.h_v \$
23547 * Rev 1.1.1.0 24 Jan 1996 14:59:20 PAULT
23550 * Rev 1.1 24 Jan 1996 12:09:52 PAULT
23551 * Consolidated 4100 code merged to trunk
23553 * Rev 1.0.2.0 01 Jun 1995 14:18:58 DAVEH
23556 * Rev 1.0 19 Apr 1995 16:32:48 COLINL
23557 * Initial revision.
23559 /*****************************************************************************
23562 AUTHOR : Dave Hartley
23563 SYSTEM : Borland C++
23564 DESCRIPTION : The declaration of the scrolling grid class
23566 *****************************************************************************/
23567 #if !defined(__SGRID_H)
23570 #if !defined(__SCROLL_H)
23571 #include <scroll.h>
23574 #if !defined(__GKI_H)
23578 #if defined PRINTING_SUPPORT
23582 /*****************************************************************************
23583 CLASS : ScrollingGrid
23584 DESCRIPTION: This class inherits from a grid and a scrollable, and
23585 can therefore use all the PUBLIC services provided by these
23586 classes. A description of these can be found in
23587 GRID.H and SCROLL.H.
23588 A scrolling grid is a set of horizontal and vertical lines
23589 that scroll and continually update to provide a complete grid
23591 *****************************************************************************/
23593 class ScrollingGrid : public Scrollable
23596 #if defined _WINDOWS
23597 /*---------------------------------------------------------------------------
23598 FUNCTION : CONSTRUCTOR
23599 DESCRIPTION : sets up the details of the grid, ready for painting
23600 ARGUMENTS : name : sgColour
23601 - the colour of the grid
23605 - the total number of horizontal grid lines
23607 - the min distance between the vertical grid lines
23608 on the scrolling axis
23610 - timestamp value now
23612 - number of timestamp ticks per second
23614 - number of timestamp ticks per pixel required
23618 ---------------------------------------------------------------------------*/
23619 ScrollingGrid( GkiColour sgColour, GkiLineType sgLineType,
23620 uint16 sgHorizontalTotal,
23621 uint16 verticalSpacingMin, uint32 currentTimestamp,
23622 uint16 ticksPerSecond, uint32 ticksPerPixel );
23624 /*---------------------------------------------------------------------------
23625 FUNCTION : CONSTRUCTOR
23626 DESCRIPTION : sets up the details of the grid, ready for painting
23627 ARGUMENTS : name : sgColour
23628 - the colour of the grid
23631 sgHorizontalTotal ( THE MAX NUMBER OF LINES IS 100 )
23632 - the total number of horizontal grid lines
23634 - the distance between the vertical grid lines
23635 on the scrolling axis
23638 NOTES : If the caller does not get the total grid lines value, synced
23639 with the overall size of the viewport, the spacing between
23640 grid lines will not be consistent.
23642 ---------------------------------------------------------------------------*/
23643 ScrollingGrid( GkiColour sgColour, GkiLineType sgLineType
23644 , uint16 sgHorizontalTotal, uint16 sgVerticalSpacing );
23646 /*---------------------------------------------------------------------------
23647 FUNCTION : DESTRUCTOR
23648 DESCRIPTION : tidies it all up
23653 ---------------------------------------------------------------------------*/
23654 ~ScrollingGrid( void );
23656 /*---------------------------------------------------------------------------
23658 DESCRIPTION : This service overloads the base class service, as it does
23659 additional work at the time of attachment.
23661 ARGUMENTS : name : tDrawingArea
23662 - the scrolled viewport to attach this trend to
23666 ---------------------------------------------------------------------------*/
23667 void attach( SViewport *tDrawingArea );
23669 #if defined _WINDOWS
23670 /*---------------------------------------------------------------------------
23671 FUNCTION : calculateVerticalSpacing
23672 DESCRIPTION : determines optimum spacing along time axis
23676 ---------------------------------------------------------------------------*/
23677 void calculateVerticalSpacing();
23679 /*---------------------------------------------------------------------------
23680 FUNCTION : gridSpacingTicks
23681 DESCRIPTION : Provides the grid spacing in the time axis in ticks
23683 RETURN : Number of ticks
23685 ---------------------------------------------------------------------------*/
23686 uint32 gridSpacingTicks();
23690 /*---------------------------------------------------------------------------
23691 INLINE FUNCTION : HORIZONTALLINES
23692 NOTES : Description at the end of the file
23693 ---------------------------------------------------------------------------*/
23694 uint16 horizontalLines( void );
23696 #if defined _WINDOWS
23697 // In Windows the OnDraw() function replaces paint()
23698 /*---------------------------------------------------------------------------
23699 FUNCTION : ScrollingGrid OnDraw
23700 DESCRIPTION : Paints the given area of the grid.
23702 ARGUMENTS : pDC pointer to the device context to use for display
23703 Note that the device context operates in the coords
23704 of the window owning the viewport
23707 ---------------------------------------------------------------------------*/
23708 virtual void OnDraw( CDC *pDC );
23710 #else // not Windows
23712 /*---------------------------------------------------------------------------
23714 DESCRIPTION : This extends the standard grid paint method to paint the
23715 viewport relative to its current position.
23721 ---------------------------------------------------------------------------*/
23722 void paint( void );
23725 /*---------------------------------------------------------------------------
23726 FUNCTION : P A I N T T E X T M A R K E R S
23727 DESCRIPTION : this service allow the text markers to be painted seperatley
23728 from the grid lines
23734 ---------------------------------------------------------------------------*/
23735 void paintTextMarkers();
23737 #if defined PRINTING_SUPPORT
23738 /*---------------------------------------------------------------------------
23739 FUNCTION : P R I N T
23740 DESCRIPTION : This print service prints a grid marker ( being either a
23741 timestamp or a date, IF there is one at the plot position
23746 - Where in the log to look to see if there is an
23750 the printer to print to
23754 ---------------------------------------------------------------------------*/
23755 void print( uint16 currentPrintPos, Printer *printerPtr );
23758 /*---------------------------------------------------------------------------
23759 FUNCTION : S E T D R I V E D I R E C T I O N
23760 DESCRIPTION : Sets direction for update and scrolling forwards or backwards
23761 ARGUMENTS : direction - required direction
23764 ---------------------------------------------------------------------------*/
23765 void setDriveDirection( ScrollDirection direction );
23767 /*---------------------------------------------------------------------------
23768 FUNCTION : S E T U P
23769 DESCRIPTION : service that will setup the grid prior to a paint
23776 the number of ticks that represent a plot point on
23781 ---------------------------------------------------------------------------*/
23782 void setup( uint32 newTimestamp, uint32 newTimeBase );
23784 #if defined PRINTING_SUPPORT
23785 /*---------------------------------------------------------------------------
23786 FUNCTION : S E T U P F O R P R I N T
23787 DESCRIPTION : This service iis to be called prior to printing. It allows
23788 the grid to prepare its markers ready for the print
23795 ---------------------------------------------------------------------------*/
23796 void setupForPrint();
23799 /*---------------------------------------------------------------------------
23801 DESCRIPTION : When this service is called it will calculate what needs to
23802 be painted and fill in the display again.
23804 ARGUMENTS : name : timeStamp
23805 - the reference time of this update.
23809 ---------------------------------------------------------------------------*/
23810 void update( uint32 timeStamp );
23812 /*---------------------------------------------------------------------------
23813 FUNCTION : U P D A T E B U F F E R
23814 DESCRIPTION : When a display update is not required, use this method. It
23815 updates the internal data ready for a call to paint that
23816 will then show the grid in the right position
23822 ---------------------------------------------------------------------------*/
23823 void updateBuffer( void );
23827 /*---------------------------------------------------------------------------
23828 FUNCTION : M A K E G R I D M A R K E R
23829 DESCRIPTION : service that perpares a string for display. The string will
23830 either be a short date, or short time. this is determined
23831 by the current setting of the dateMarker flag
23833 ARGUMENTS : name : timestampVal
23834 - the value to convert
23837 - the place to put the string
23841 ---------------------------------------------------------------------------*/
23842 void makeGridMarker( uint32 timestampVal, char *storePtr );
23844 /*---------------------------------------------------------------------------
23845 FUNCTION : P A I N T G R I D M A R K E R
23846 DESCRIPTION : given a position will put the string on the display
23850 - were it goes on the Y-axis
23857 ---------------------------------------------------------------------------*/
23858 void paintGridMarker( uint16 yPos, char *gridMarkerPtr );
23860 #if defined _WINDOWS
23861 /*---------------------------------------------------------------------------
23862 FUNCTION : PAINTHORIZONTALLINES
23863 DESCRIPTION : responsible for painting the grids horizontal lines
23864 ARGUMENTS : pRectToDraw pointer to rectangle that needs refreshing.
23866 pDC pointer to device context to use
23870 ---------------------------------------------------------------------------*/
23871 void paintHorizontalLines(RectCoords* pRectToDraw, CDC* pDC );
23873 /*---------------------------------------------------------------------------
23874 FUNCTION : PAINTHORIZONTALLINES
23875 DESCRIPTION : responsible for painting the grids horizontal lines
23876 ARGUMENTS : name: xStart
23877 - the starting X co-ordinate for the horizontal line
23879 - the ending X co-ordinate for the horizontal line
23882 NOTES : Remember lines are drawn from origin. The origin in a
23883 horizontal viewport will be the top.
23884 ---------------------------------------------------------------------------*/
23885 void paintHorizontalLines( uint16 xStart, uint16 xEnd );
23888 #if defined _WINDOWS
23889 /*---------------------------------------------------------------------------
23890 FUNCTION : PAINTVERTICALLINES
23891 DESCRIPTION : responsible for painting the grids vertical lines
23892 ARGUMENTS : pRectToDraw pointer to rectangle that needs refreshing.
23894 offset offset from rhs that rightmost line would be
23895 drawn if rectangle included whole viewport
23896 pDC pointer to device context to use
23899 ---------------------------------------------------------------------------*/
23900 void paintVerticalLines( RectCoords* pRectToDraw, uint16 offset,
23903 /*---------------------------------------------------------------------------
23904 FUNCTION : PAINTVERTICALLINES
23905 DESCRIPTION : responsible for painting the grids vertical lines
23906 ARGUMENTS : name : yStart
23907 - the starting Y co-ordinate for the vertical line
23909 - the ending Y co-ordinate for the vertical line
23911 - a starting point offset that determines at what X
23912 position the first line will be drawn
23917 ---------------------------------------------------------------------------*/
23918 void paintVerticalLines( uint16 yStart, uint16 yEnd, uint16 offset );
23921 #if defined _WINDOWS
23922 /*---------------------------------------------------------------------------
23923 FUNCTION : PAINTVERTICALLINE
23924 DESCRIPTION : paints one line at the position specified, and length
23925 ARGUMENTS : name : yStart
23926 - the starting point on the y axis for the line
23928 - the end point on the y axis for the line
23930 - The horizontal offset from the start of the viewport
23931 pDC pointer to device context to use
23934 NOTES : There is not an equivalent horizontal method as yet. This
23935 is a seperate method because the service is useful to a
23936 derivation of this class
23937 ---------------------------------------------------------------------------*/
23938 void paintVerticalLine( uint16 yStart, uint16 yEnd
23939 , uint16 xPosition, CDC *pDC );
23941 /*---------------------------------------------------------------------------
23942 FUNCTION : PAINTVERTICALLINE
23943 DESCRIPTION : paints one line at the position specified, and length
23944 ARGUMENTS : name : yStart
23945 - the starting point on the y axis for the line
23947 - the end point on the y axis for the line
23949 - The horizontal offset from the start of the viewport
23952 NOTES : There is not an equivalent horizontal method as yet. This
23953 is a seperate method because the service is useful to a
23954 derivation of this class
23955 ---------------------------------------------------------------------------*/
23956 void paintVerticalLine( uint16 yStart, uint16 yEnd
23957 , uint16 xPosition );
23960 /*---------------------------------------------------------------------------
23961 INLINE FUNCTION : VERTICALSPACING
23962 NOTES : Description at the end of the file
23963 ---------------------------------------------------------------------------*/
23964 uint16 verticalSpacing( void );
23967 // Position in viewport that we are now writing to if going forwards
23968 // Note that if this is greater than viewport length then we have
23969 // just scrolled and value must be adjusted before use.
23970 sint16 forwardsOutputPosition;
23972 // Position in viewport that we are now writing to if going backwards
23973 // Note that if this is less than zero then we have
23974 // just scrolled and value must be adjusted before use.
23975 sint16 backwardsOutputPosition;
23977 // position in grid cycle of forwards output position.
23978 // if zero then it is time to output a grid line
23979 sint16 forwardsIntervalCount;
23981 // position in grid cycle of forwards output position.
23982 // if zero then it is time to output a grid line
23983 sint16 backwardsIntervalCount;
23985 uint32 lastUpdateTimestamp;
23986 uint32 timeBase; // ticks per pixel
23987 uint16 currentOutputPosition;
23988 uint16 gridTimestampSpacing;
23989 uint16 intervalCount;
23990 uint16 horizontalTotal;
23992 #if defined PRINTING_SUPPORT
23993 uint16 numberOfGridMarkersPrinted;
23995 bool firstTime; // indicates first time through
23998 GkiLineType lineType;
23999 GkiColour gridColour;
24001 #if defined _WINDOWS
24002 uint16 ticksPerSec; // number of time ticks per second
24003 uint16 vSpacingMin; // minimum pixels per division along time axis
24004 CPen *pPen; // the pen to use for drawing in windows
24010 /*****************************************************************************
24011 I N L I N E F U N C T I O N S
24012 *****************************************************************************/
24014 /*---------------------------------------------------------------------------
24015 FUNCTION : HORIZONTALLINES
24016 DESCRIPTION : supplies the number of horizontal lines in the grid
24021 ---------------------------------------------------------------------------*/
24022 inline uint16 ScrollingGrid::horizontalLines( void )
24024 return( horizontalTotal );
24026 /*---------------------------------------------------------------------------
24027 FUNCTION : VERTICALSPACING
24028 DESCRIPTION : returns the distance between adjacent vertical lines
24033 ---------------------------------------------------------------------------*/
24034 inline uint16 ScrollingGrid::verticalSpacing( void )
24036 return( vSpacing );
24045 @DEV1194:DS4 Provision of major and minor grid lines
24050 /* \$""Header: /usr/local/repository/cmnsrc/review/src/sgrid.h,v 1.1 1997/04/02 11:20:05 colinl Exp \$ */
24053 * \$""Log: sgrid.h,v \$
24054 * Revision 1.1 1997/04/02 11:20:05 colinl
24057 * Tested By: Colin Law
24059 * Reason for Change: Initial Revision of all files
24061 * Design Change Details:
24067 ARGUMENTS : name : majorColour colour for major grid lines
24068 minorColour colour for minor grid lines
24069 sgLineType line type for minor grid lines
24070 yMajorGridLines number of major y lines on grid
24071 yMinorGridLines number of major y lines on grid
24074 ScrollingGrid( GkiColour majorColour, GkiColour minorColour,
24075 GkiLineType sgLineType,
24076 uint16 yMajorGridLines, uint16 yMinorGridLines,
24078 FUNCTION : DrawHorizontalGridLines
24080 DESCRIPTION : Draws major or minor grid lines
24081 ARGUMENTS : pDC device context
24083 numLines total lines required
24084 yLow, yHigh, xLow, xHigh rectangle to draw in
24088 ---------------------------------------------------------------------------*/
24089 void DrawHorizontalGridLines( CDC* pDC, CPen* pPen,
24091 uint16 yLow, uint16 yHigh, uint16 xLow, uint16 xHigh,
24094 /*---------------------------------------------------------------------------
24098 uint16 m_yMajorGridLines;
24099 uint16 m_yMinorGridLines;
24102 GkiLineType lineType; // line type for minor grid lines
24103 GkiColour m_majorColour;
24104 GkiColour m_minorColour;
24107 CPen *pMajorPen; // pen to use for drawing major grid lines
24108 CPen *pMinorPen; // pen to use for drawing minor grid lines
24110 @" > diffmerge2/sgrid.h,v
24112 # We have to put the RCS file in the repository by hand for
24114 mkdir ${CVSROOT_DIRNAME}/diffmerge2
24115 cp diffmerge2/sgrid.h,v ${CVSROOT_DIRNAME}/diffmerge2/sgrid.h,v
24117 dotest diffmerge2_co \
24118 "${testcvs} co diffmerge2" "${DOTSTAR}U ${DOTSTAR}"
24120 dotest diffmerge2_update \
24121 "${testcvs} update -j Review_Phase_2_Enhancements sgrid.h" \
24122 "${DOTSTAR}erging ${DOTSTAR}"
24123 # This is the one that counts -- there should be no output:
24124 dotest diffmerge2_diff \
24125 "${testcvs} diff -r Review_V1p3 sgrid.h" ''
24129 rm -rf ${CVSROOT_DIRNAME}/diffmerge2
24133 # Tests of "cvs release", particularly multiple arguments.
24134 # Other CVS release tests:
24135 # info-cleanup-0 for "cvs -n release".
24136 # ignore-193 for the text of the question that cvs release asks.
24137 # Also for interactions with cvsignore.
24138 # basicc: "-d .", global -Q, no arguments (is a noop),
24139 # "cvs release" without -d, multiple arguments.
24140 # dirs-4: repository directory has been deleted.
24141 # modules2-6: multiple arguments.
24143 # First the usual setup; create a directory first-dir.
24145 dotest release-1 "${testcvs} -q co -l ." ''
24147 dotest release-2 "${testcvs} add first-dir" \
24148 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
24151 dotest release-3 "${testcvs} add dir1" \
24152 "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
24154 dotest release-4 "${testcvs} add dir2" \
24155 "Directory ${CVSROOT_DIRNAME}/first-dir/dir2 added to the repository"
24158 dotest release-5 "${testcvs} add dir3" \
24159 "Directory ${CVSROOT_DIRNAME}/first-dir/dir2/dir3 added to the repository"
24162 dotest release-6 "${testcvs} release -d first-dir/dir2/dir3 first-dir/dir1" \
24163 "You have .0. altered files in this repository.
24164 Are you sure you want to release (and delete) directory .first-dir/dir2/dir3.: \
24165 You have .0. altered files in this repository.
24166 Are you sure you want to release (and delete) directory .first-dir/dir1.: " <<EOF
24170 dotest_fail release-7 "test -d first-dir/dir1" ''
24171 dotest_fail release-8 "test -d first-dir/dir2/dir3" ''
24172 dotest release-9 "${testcvs} update" \
24173 "${PROG} update: Updating \.
24174 ${PROG} update: Updating first-dir
24175 ${PROG} update: Updating first-dir/dir2"
24179 dotest release-10 "${testcvs} add dir1" \
24180 "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
24183 dotest release-11 "${testcvs} add dir3" \
24184 "Directory ${CVSROOT_DIRNAME}/first-dir/dir2/dir3 added to the repository"
24187 dotest release-12 "${testcvs} release first-dir/dir2/dir3 first-dir/dir1" \
24188 "You have .0. altered files in this repository.
24189 Are you sure you want to release directory .first-dir/dir2/dir3.: .. .release. aborted by user choice.
24190 You have .0. altered files in this repository.
24191 Are you sure you want to release directory .first-dir/dir1.: " <<EOF
24195 dotest release-13 "${testcvs} release first-dir/dir2/dir3 first-dir/dir2" \
24196 "You have .0. altered files in this repository.
24197 Are you sure you want to release directory .first-dir/dir2/dir3.: \
24198 You have .0. altered files in this repository.
24199 Are you sure you want to release directory .first-dir/dir2.: " <<EOF
24203 dotest release-14 "test -d first-dir/dir1" ''
24204 dotest release-15 "test -d first-dir/dir2/dir3" ''
24205 rm -rf first-dir/dir1 first-dir/dir2
24207 dotest release-16 "${testcvs} update" \
24208 "${PROG} update: Updating \.
24209 ${PROG} update: Updating first-dir"
24211 # Check to make sure release isn't overwriting a
24212 # CVS/Entries file in the current directory (using data
24213 # from the released directory).
24215 # cvs 1.11 (remote) fails on release-21 (a message about
24216 # chdir into the removed directory), although it seemingly
24217 # unedits and removes the directory correctly. If
24218 # you manually continue, it then fails on release-22 do
24219 # to the messed up CVS/Entries file from release-21.
24222 dotest release-18 "$testcvs add second-dir" \
24223 "Directory $CVSROOT_DIRNAME/first-dir/second-dir added to the repository"
24227 dotest release-19 "$testcvs -Q add file1"
24228 dotest release-20 '$testcvs -q ci -m add' \
24229 "RCS file: $CVSROOT_DIRNAME/first-dir/second-dir/file1,v
24232 $CVSROOT_DIRNAME/first-dir/second-dir/file1,v <-- file1
24233 initial revision: 1\.1
24235 dotest release-21 "$testcvs edit file1"
24237 dotest release-22 "echo yes | $testcvs release -d second-dir" \
24238 "You have \[0\] altered files in this repository.
24239 Are you sure you want to release (and delete) directory \`second-dir': "
24240 dotest release-23 "$testcvs -q update -d" "U second-dir/file1"
24241 dotest release-24 "$testcvs edit"
24244 rm -rf 1 $CVSROOT_DIRNAME/first-dir
24251 # Some tests of behavior which broke at one time or another when run
24252 # from case insensitive clients against case sensitive servers.
24254 # These tests are namned according to the following convention:
24256 # ci Client (sandbox filesystem) case Insensitive
24257 # cs Client (sandbox filesystem) case Sensitive
24258 # si Server (repository filesystem) case Insensitive
24259 # ss Server (repository filesystem) case Sensitive
24264 # First, we will expect different results for a few of these tests
24265 # based on whether the repository is on a case sensitive filesystem
24266 # or not and whether the sandbox is on a case sensitive filesystem or
24267 # not, so determine which cases we are dealing with:
24270 if cmp file FiLe >/dev/null; then
24271 client_sensitive=false
24275 if test -n "$remotehost"; then
24276 $CVS_RSH $remotehost 'echo file >file'
24277 $CVS_RSH $remotehost 'echo FiLe >FiLe'
24278 if $CVS_RSH $remotehost 'cmp file FiLe >/dev/null'; then
24279 server_sensitive=false
24284 server_sensitive=$client_sensitive
24287 # The first test (recase-1 & recase-2) is for a remove of a file then
24288 # a readd in a different case.
24289 mkdir $CVSROOT_DIRNAME/first-dir
24290 dotest recase-init-1 "$testcvs -Q co first-dir"
24293 echo this file has no content >file
24294 dotest recase-init-2 "$testcvs -Q add file"
24295 dotest recase-init-3 "$testcvs -Q ci -madd" \
24296 "RCS file: $CVSROOT_DIRNAME/first-dir/file,v
24299 $CVSROOT_DIRNAME/first-dir/file,v <-- file
24300 initial revision: 1\.1
24302 dotest recase-init-4 "$testcvs -Q tag first"
24304 # Now remove the file.
24305 dotest recase-init-5 "$testcvs -Q rm -f file"
24306 dotest recase-init-6 "$testcvs -Q ci -mrm" \
24308 $CVSROOT_DIRNAME/first-dir/file,v <-- file
24309 new revision: delete; previous revision: 1\.1
24312 # Now the test - readd in a different case.
24313 echo this file needs some content >FiLe
24314 if $server_sensitive; then
24315 dotest recase-1ss "$testcvs add FiLe" \
24316 "$PROG add: scheduling file \`FiLe' for addition
24317 $PROG add: use '$PROG commit' to add this file permanently"
24318 dotest recase-2ss "$testcvs -q ci -mrecase" \
24319 "RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
24322 $CVSROOT_DIRNAME/first-dir/FiLe,v <-- FiLe
24323 initial revision: 1\.1
24325 else # server insensitive
24326 dotest recase-1si "$testcvs add FiLe" \
24327 "$PROG add: Re-adding file \`FiLe' (in place of dead revision 1\.2)\.
24328 $PROG add: use '$PROG commit' to add this file permanently"
24329 dotest recase-2si "$testcvs -q ci -mrecase" \
24331 $CVSROOT_DIRNAME/first-dir/FiLe,v <-- FiLe
24332 new revision: 1\.3; previous revision: 1\.2
24336 # Now verify that a checkout will still work
24339 dotest recase-3 "$testcvs -q co first-dir" \
24343 # Prove that we can still get status and log information on
24344 # conflicting case files (1 in Attic, one in parent).
24346 if $client_sensitive; then
24349 else # client insensitive
24350 # Because FiLe is present on a case insensitive client, it is the
24351 # only one ever found and queried or altered.
24359 if $server_sensitive; then
24360 if $client_sensitive; then
24361 # Client finds Entry only for FiLe. Others returned by server.
24362 dotest recase-4sscs "$testcvs status file" \
24363 "===================================================================
24364 File: no file file Status: Up-to-date
24366 Working revision: No entry for file
24367 Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/Attic/file,v"
24368 dotest recase-5sscs "$testcvs log file" \
24370 RCS file: $CVSROOT_DIRNAME/first-dir/Attic/file,v
24378 keyword substitution: kv
24379 total revisions: 2; selected revisions: 2
24381 ----------------------------
24383 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: +0 -0
24385 ----------------------------
24387 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24389 ============================================================================="
24390 dotest recase-6sscs "$testcvs status FiLe" \
24391 "===================================================================
24392 File: FiLe Status: Up-to-date
24394 Working revision: 1\.1.*
24395 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
24397 Sticky Date: (none)
24398 Sticky Options: (none)"
24399 dotest recase-7sscs "$testcvs log FiLe" \
24401 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
24408 keyword substitution: kv
24409 total revisions: 1; selected revisions: 1
24411 ----------------------------
24413 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24415 ============================================================================="
24416 else # server sensitive && client insensitive
24417 # Client finds same Entry for file & FiLe.
24418 dotest recase-4ssci "$testcvs status file" \
24419 "===================================================================
24420 File: FiLe Status: Up-to-date
24422 Working revision: 1\.1.*
24423 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
24425 Sticky Date: (none)
24426 Sticky Options: (none)"
24427 dotest recase-5ssci "$testcvs log file" \
24429 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
24436 keyword substitution: kv
24437 total revisions: 1; selected revisions: 1
24439 ----------------------------
24441 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24443 ============================================================================="
24444 dotest recase-6ss "$testcvs status FiLe" \
24445 "===================================================================
24446 File: FiLe Status: Up-to-date
24448 Working revision: 1\.1.*
24449 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
24451 Sticky Date: (none)
24452 Sticky Options: (none)"
24453 dotest recase-7ss "$testcvs log FiLe" \
24455 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
24462 keyword substitution: kv
24463 total revisions: 1; selected revisions: 1
24465 ----------------------------
24467 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24469 ============================================================================="
24471 else # server insensitive
24472 # There is only one archive when the server is insensitive, but the
24473 # printed file/archive name can vary.
24474 dotest recase-4si "$testcvs status file" \
24475 "===================================================================
24476 File: $file Status: Up-to-date
24478 Working revision: 1\.3.*
24479 Repository revision: 1\.3 $CVSROOT_DIRNAME/first-dir/$file,v
24481 Sticky Date: (none)
24482 Sticky Options: (none)"
24483 dotest recase-5si "$testcvs log file" \
24485 RCS file: $CVSROOT_DIRNAME/first-dir/$file,v
24486 Working file: $file
24493 keyword substitution: kv
24494 total revisions: 3; selected revisions: 3
24496 ----------------------------
24498 date: [0-9/]* [0-9:]*; author: $username; state: Exp; lines: +1 -1
24500 ----------------------------
24502 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: +0 -0
24504 ----------------------------
24506 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24508 ============================================================================="
24509 dotest recase-6si "$testcvs status FiLe" \
24510 "===================================================================
24511 File: FiLe Status: Up-to-date
24513 Working revision: 1\.3.*
24514 Repository revision: 1\.3 $CVSROOT_DIRNAME/first-dir/FiLe,v
24516 Sticky Date: (none)
24517 Sticky Options: (none)"
24518 dotest recase-7si "$testcvs log FiLe" \
24520 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
24528 keyword substitution: kv
24529 total revisions: 3; selected revisions: 3
24531 ----------------------------
24533 date: [0-9/]* [0-9:]*; author: $username; state: Exp; lines: +1 -1
24535 ----------------------------
24537 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: +0 -0
24539 ----------------------------
24541 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24543 ============================================================================="
24546 # And when the file does not exist on the client, we go with the
24547 # client Entries match.
24548 if $client_sensitive && $server_sensitive; then
24549 dotest recase-8sscs "$testcvs status fIlE" \
24550 "$PROG status: nothing known about fIlE
24551 ===================================================================
24552 File: no file fIlE Status: Unknown
24554 Working revision: No entry for fIlE
24555 Repository revision: No revision control file"
24556 else # !$client_sensitive || !$server_sensitive
24557 dotest recase-8anyi "$testcvs status fIlE" \
24558 "===================================================================
24559 File: $fIlE Status: Up-to-date
24561 Working revision: 1\.[0-9]*.*
24562 Repository revision: 1\.[0-9]* $CVSROOT_DIRNAME/first-dir/$fIlE,v
24564 Sticky Date: (none)
24565 Sticky Options: (none)"
24569 if $server_sensitive; then
24570 dotest recase-9ss "$testcvs -q up -rfirst" \
24571 "$PROG update: FiLe is no longer in the repository
24574 if $client_sensitive; then
24575 dotest recase-10sscs "$testcvs -q up -A" \
24577 $PROG update: file is no longer in the repository"
24578 else # client insensitive
24579 # FIXCVS: This should remove the offending file first.
24580 dotest_fail recase-10ssci "$testcvs -q up -A" \
24581 "$PROG update: move away \./FiLe; it is in the way
24583 $PROG update: file is no longer in the repository"
24587 dotest recase-11ssci "$testcvs -q co first-dir" \
24593 # See what happens when cased names clash.
24597 if test -n "$remotehost"; then
24598 $CVS_RSH $remotehost "cp $CVSROOT_DIRNAME/first-dir/FiLe,v \
24599 $CVSROOT_DIRNAME/first-dir/FILE,v"
24601 cp $CVSROOT_DIRNAME/first-dir/FiLe,v \
24602 $CVSROOT_DIRNAME/first-dir/FILE,v
24605 if $client_sensitive; then
24606 dotest recase-12sscs "$testcvs -q up" "U FILE"
24607 else # client insensitive
24608 dotest_fail recase-12ssci "$testcvs -q up" \
24609 "$PROG update: move away \./FILE; it is in the way
24612 else # server insensitive
24613 dotest recase-9si "$testcvs -q up -rfirst" "U FiLe"
24614 dotest recase-10si "$testcvs -q up -A" "U FiLe"
24617 # Prove that we can still get status and log information on
24618 # conflicting case files (1 in Attic, two in parent).
24619 if $server_sensitive; then
24620 if $client_sensitive; then
24621 # Client finds Entry only for FiLe. Others returned by server.
24622 dotest recase-13sscs "$testcvs status file" \
24623 "===================================================================
24624 File: no file file Status: Up-to-date
24626 Working revision: No entry for file
24627 Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/Attic/file,v"
24628 dotest recase-14sscs "$testcvs log file" \
24630 RCS file: $CVSROOT_DIRNAME/first-dir/Attic/file,v
24638 keyword substitution: kv
24639 total revisions: 2; selected revisions: 2
24641 ----------------------------
24643 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: +0 -0
24645 ----------------------------
24647 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24649 ============================================================================="
24650 dotest recase-15sscs "$testcvs status FiLe" \
24651 "===================================================================
24652 File: FiLe Status: Up-to-date
24654 Working revision: 1\.1.*
24655 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
24657 Sticky Date: (none)
24658 Sticky Options: (none)"
24659 dotest recase-16sscs "$testcvs log FiLe" \
24661 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
24668 keyword substitution: kv
24669 total revisions: 1; selected revisions: 1
24671 ----------------------------
24673 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24675 ============================================================================="
24676 dotest recase-17sscs "$testcvs status FILE" \
24677 "===================================================================
24678 File: FILE Status: Up-to-date
24680 Working revision: 1.1.*
24681 Repository revision: 1.1 ${CVSROOT_DIRNAME}/first-dir/FILE,v
24683 Sticky Date: (none)
24684 Sticky Options: (none)"
24685 dotest recase-18sscs "$testcvs log FILE" \
24687 RCS file: $CVSROOT_DIRNAME/first-dir/FILE,v
24694 keyword substitution: kv
24695 total revisions: 1; selected revisions: 1
24697 ----------------------------
24699 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24701 ============================================================================="
24702 else # $server_sensitive && !$client_sensitive
24703 # Client finds same Entry for file & FiLe.
24704 dotest recase-13ssci "$testcvs status file" \
24705 "===================================================================
24706 File: FiLe Status: Up-to-date
24708 Working revision: 1\.1.*
24709 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
24711 Sticky Date: (none)
24712 Sticky Options: (none)"
24713 dotest recase-16ssci "$testcvs log FiLe" \
24715 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
24722 keyword substitution: kv
24723 total revisions: 1; selected revisions: 1
24725 ----------------------------
24727 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24729 ============================================================================="
24730 dotest recase-17ssci "$testcvs status FILE" \
24731 "===================================================================
24732 File: FiLe Status: Up-to-date
24734 Working revision: 1\.1.*
24735 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
24737 Sticky Date: (none)
24738 Sticky Options: (none)"
24739 dotest recase-18ssci "$testcvs log FILE" \
24741 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
24748 keyword substitution: kv
24749 total revisions: 1; selected revisions: 1
24751 ----------------------------
24753 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24755 ============================================================================="
24757 else # !$server_sensitive
24758 # Skip these when the server is case insensitive - nothing
24759 # has changed since recase-[4-7]si
24763 if $client_sensitive && $server_sensitive; then
24764 dotest recase-19sscs "$testcvs status fIlE" \
24765 "$PROG status: nothing known about fIlE
24766 ===================================================================
24767 File: no file fIlE Status: Unknown
24769 Working revision: No entry for fIlE
24770 Repository revision: No revision control file"
24771 else # !$client_sensitive || !$server_sensitive
24772 dotest recase-19anyi "$testcvs status fIlE" \
24773 "===================================================================
24774 File: $fIlE Status: Up-to-date
24776 Working revision: 1\.[0-9]*.*
24777 Repository revision: 1\.[0-9]* $CVSROOT_DIRNAME/first-dir/$fIlE,v
24779 Sticky Date: (none)
24780 Sticky Options: (none)"
24783 # And last but not least, prove that a checkout is still possible.
24786 if $server_sensitive; then
24787 if $client_sensitive; then
24788 dotest recase-20sscs "$testcvs -q co first-dir" \
24791 else # $server_senstive && !$client_sensitive
24792 dotest_fail recase-20ssci "$testcvs -q co first-dir" \
24794 $PROG checkout: move away first-dir/FiLe; it is in the way
24797 else # !$server_sensitive
24798 # Skip these since nothing has changed.
24803 echo Keeping ${TESTDIR} and exiting due to --keep
24809 if $server_sensitive && test -n "$remotehost"; then
24810 # It is necessary to remove one of the case-conflicted files before
24811 # recursively removing the rest under Cygwin on a Samba share or
24812 # Samba returns a permission denied error due to its case
24814 $CVS_RSH $remotehost "rm -f $CVSROOT_DIRNAME/first-dir/FILE,v"
24816 rm -rf $CVSROOT_DIRNAME/first-dir
24823 # set up two repositories
24826 CVSROOT1_DIRNAME=${TESTDIR}/root1
24827 CVSROOT2_DIRNAME=${TESTDIR}/root2
24828 CVSROOT1=`newroot $CVSROOT1_DIRNAME`
24829 CVSROOT2=`newroot $CVSROOT2_DIRNAME`
24830 testcvs1="${testcvs} -d ${CVSROOT1}"
24831 testcvs2="${testcvs} -d ${CVSROOT2}"
24833 dotest multiroot-setup-1 "mkdir ${CVSROOT1_DIRNAME} ${CVSROOT2_DIRNAME}" ""
24834 dotest multiroot-setup-2 "${testcvs1} init" ""
24835 dotest multiroot-setup-3 "${testcvs2} init" ""
24838 # create some directories in root1
24841 dotest multiroot-setup-4 "${testcvs1} co -l ." \
24842 "${PROG} checkout: Updating ."
24843 mkdir mod1-1 mod1-2
24844 dotest multiroot-setup-5 "${testcvs1} add mod1-1 mod1-2" \
24845 "Directory ${CVSROOT1_DIRNAME}/mod1-1 added to the repository
24846 Directory ${CVSROOT1_DIRNAME}/mod1-2 added to the repository"
24847 echo file1-1 > mod1-1/file1-1
24848 echo file1-2 > mod1-2/file1-2
24849 dotest multiroot-setup-6 "${testcvs1} add mod1-1/file1-1 mod1-2/file1-2" \
24850 "${PROG} add: scheduling file .mod1-1/file1-1. for addition
24851 ${PROG} add: scheduling file .mod1-2/file1-2. for addition
24852 ${PROG} add: use .${PROG} commit. to add these files permanently"
24853 dotest multiroot-setup-7 "${testcvs1} commit -m is" \
24854 "${PROG} [a-z]*: Examining \.
24855 ${PROG} [a-z]*: Examining mod1-1
24856 ${PROG} [a-z]*: Examining mod1-2
24857 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
24859 Checking in mod1-1/file1-1;
24860 ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v <-- file1-1
24861 initial revision: 1.1
24863 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
24865 Checking in mod1-2/file1-2;
24866 ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v <-- file1-2
24867 initial revision: 1.1
24873 # create some directories in root2
24876 dotest multiroot-setup-8 "${testcvs2} co -l ." \
24877 "${PROG} checkout: Updating ."
24878 mkdir mod2-1 mod2-2
24879 dotest multiroot-setup-9 "${testcvs2} add mod2-1 mod2-2" \
24880 "Directory ${CVSROOT2_DIRNAME}/mod2-1 added to the repository
24881 Directory ${CVSROOT2_DIRNAME}/mod2-2 added to the repository"
24882 echo file2-1 > mod2-1/file2-1
24883 echo file2-2 > mod2-2/file2-2
24884 dotest multiroot-setup-6 "${testcvs2} add mod2-1/file2-1 mod2-2/file2-2" \
24885 "${PROG} add: scheduling file .mod2-1/file2-1. for addition
24886 ${PROG} add: scheduling file .mod2-2/file2-2. for addition
24887 ${PROG} add: use .${PROG} commit. to add these files permanently"
24888 dotest multiroot-setup-10 "${testcvs2} commit -m anyone" \
24889 "${PROG} [a-z]*: Examining \.
24890 ${PROG} [a-z]*: Examining mod2-1
24891 ${PROG} [a-z]*: Examining mod2-2
24892 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
24894 Checking in mod2-1/file2-1;
24895 ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v <-- file2-1
24896 initial revision: 1.1
24898 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
24900 Checking in mod2-2/file2-2;
24901 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v <-- file2-2
24902 initial revision: 1.1
24907 # check out a few directories, from simple/shallow to
24911 # OK, this case is kind of weird. If we just run things from
24912 # here, without CVS/Root, then CVS will contact the server
24913 # mentioned in CVSROOT (which is irrelevant) which will print
24914 # some messages. Our workaround is to make sure we have a
24915 # CVS/Root file at top level. In the future, it is possible
24916 # the best behavior will be to extend the existing behavior
24917 # ("being called from a directory without CVS administration
24918 # has always meant to process each of the sub-dirs") to also
24919 # do that if there is no CVSROOT, CVS/Root, or -d at top level.
24921 # The local case could stumble through the tests without creating
24922 # the top-level CVS/Root, but we create it for local and for
24923 # remote to reduce special cases later in the test.
24924 dotest multiroot-workaround "${testcvs1} -q co -l ." ""
24926 dotest multiroot-setup-11 "${testcvs1} co mod1-1 mod1-2" \
24927 "${PROG} checkout: Updating mod1-1
24929 ${PROG} checkout: Updating mod1-2
24931 dotest multiroot-setup-12 "${testcvs2} co mod2-1 mod2-2" \
24932 "${PROG} checkout: Updating mod2-1
24934 ${PROG} checkout: Updating mod2-2
24937 dotest multiroot-setup-13 "${testcvs2} co mod2-2" \
24938 "${PROG} checkout: Updating mod2-2
24942 dotest multiroot-setup-14 "${testcvs1} co mod1-2" \
24943 "${PROG} checkout: Updating mod1-2
24948 # Make sure that the Root and Repository files contain the
24949 # correct information.
24951 dotest multiroot-cvsadm-1a "cat mod1-1/CVS/Root" "${CVSROOT1}"
24952 dotest multiroot-cvsadm-1b "cat mod1-1/CVS/Repository" "mod1-1"
24953 dotest multiroot-cvsadm-2a "cat mod2-1/CVS/Root" "${CVSROOT2}"
24954 dotest multiroot-cvsadm-2b "cat mod2-1/CVS/Repository" "mod2-1"
24955 dotest multiroot-cvsadm-3a "cat mod1-2/CVS/Root" "${CVSROOT1}"
24956 dotest multiroot-cvsadm-3b "cat mod1-2/CVS/Repository" "mod1-2"
24957 dotest multiroot-cvsadm-3c "cat mod1-2/mod2-2/CVS/Root" "${CVSROOT2}"
24958 dotest multiroot-cvsadm-3d "cat mod1-2/mod2-2/CVS/Repository" "mod2-2"
24959 dotest multiroot-cvsadm-4a "cat mod2-2/CVS/Root" "${CVSROOT2}"
24960 dotest multiroot-cvsadm-4b "cat mod2-2/CVS/Repository" "mod2-2"
24961 dotest multiroot-cvsadm-4c "cat mod2-2/mod1-2/CVS/Root" "${CVSROOT1}"
24962 dotest multiroot-cvsadm-4d "cat mod2-2/mod1-2/CVS/Repository" "mod1-2"
24965 # Start testing various cvs commands. Begin with commands
24966 # without extra arguments (e.g. "cvs update", "cvs diff",
24970 # Do at least one command with both CVSROOTs to make sure
24971 # that there's not some kind of unexpected dependency on the
24972 # choice of which CVSROOT is specified on the command line.
24974 dotest multiroot-update-1a "${testcvs1} update" \
24975 "${PROG} update: Updating \.
24976 ${PROG} update: Updating mod1-1
24977 ${PROG} update: Updating mod1-2
24978 ${PROG} update: Updating mod1-2/mod2-2
24979 ${PROG} update: cannot open directory ${CVSROOT1_DIRNAME}/mod2-2: No such file or directory
24980 ${PROG} update: skipping directory mod1-2/mod2-2
24981 ${PROG} update: Updating mod2-1
24982 ${PROG} update: cannot open directory ${CVSROOT1_DIRNAME}/mod2-1: No such file or directory
24983 ${PROG} update: skipping directory mod2-1
24984 ${PROG} update: Updating mod2-2
24985 ${PROG} update: cannot open directory ${CVSROOT1_DIRNAME}/mod2-2: No such file or directory
24986 ${PROG} update: skipping directory mod2-2"
24988 # Same deal but with -d ${CVSROOT2}.
24989 dotest multiroot-update-1b "${testcvs2} update" \
24990 "${PROG} update: Updating \.
24991 ${PROG} update: Updating mod1-1
24992 ${PROG} update: cannot open directory ${CVSROOT2_DIRNAME}/mod1-1: No such file or directory
24993 ${PROG} update: skipping directory mod1-1
24994 ${PROG} update: Updating mod1-2
24995 ${PROG} update: cannot open directory ${CVSROOT2_DIRNAME}/mod1-2: No such file or directory
24996 ${PROG} update: skipping directory mod1-2
24997 ${PROG} update: Updating mod2-1
24998 ${PROG} update: Updating mod2-2
24999 ${PROG} update: Updating mod2-2/mod1-2
25000 ${PROG} update: cannot open directory ${CVSROOT2_DIRNAME}/mod1-2: No such file or directory
25001 ${PROG} update: skipping directory mod2-2/mod1-2"
25003 # modify all files and do a diff
25005 echo bobby >> mod1-1/file1-1
25006 echo brown >> mod1-2/file1-2
25007 echo goes >> mod2-1/file2-1
25008 echo down >> mod2-2/file2-2
25010 dotest_fail multiroot-diff-1 "${testcvs} diff" \
25011 "${PROG} diff: Diffing \.
25012 ${PROG} diff: Diffing mod1-1
25013 Index: mod1-1/file1-1
25014 ===================================================================
25015 RCS file: ${TESTDIR}/root1/mod1-1/file1-1,v
25016 retrieving revision 1\.1
25017 diff -r1\.1 file1-1
25020 ${PROG} diff: Diffing mod1-2
25021 Index: mod1-2/file1-2
25022 ===================================================================
25023 RCS file: ${TESTDIR}/root1/mod1-2/file1-2,v
25024 retrieving revision 1\.1
25025 diff -r1\.1 file1-2
25028 ${PROG} diff: Diffing mod2-2/mod1-2
25029 ${PROG} diff: Diffing mod1-2/mod2-2
25030 ${PROG} diff: Diffing mod2-1
25031 Index: mod2-1/file2-1
25032 ===================================================================
25033 RCS file: ${TESTDIR}/root2/mod2-1/file2-1,v
25034 retrieving revision 1\.1
25035 diff -r1\.1 file2-1
25038 ${PROG} diff: Diffing mod2-2
25039 Index: mod2-2/file2-2
25040 ===================================================================
25041 RCS file: ${TESTDIR}/root2/mod2-2/file2-2,v
25042 retrieving revision 1\.1
25043 diff -r1\.1 file2-2
25046 "${PROG} diff: Diffing \.
25047 ${PROG} diff: Diffing mod1-1
25048 Index: mod1-1/file1-1
25049 ===================================================================
25050 RCS file: ${TESTDIR}/root1/mod1-1/file1-1,v
25051 retrieving revision 1\.1
25052 diff -r1\.1 file1-1
25055 ${PROG} diff: Diffing mod1-2
25056 Index: mod1-2/file1-2
25057 ===================================================================
25058 RCS file: ${TESTDIR}/root1/mod1-2/file1-2,v
25059 retrieving revision 1\.1
25060 diff -r1\.1 file1-2
25063 ${PROG} diff: Diffing mod2-2
25064 ${PROG} diff: Diffing mod2-2/mod1-2
25065 ${PROG} diff: Diffing mod1-2
25066 ${PROG} diff: Diffing mod1-2/mod2-2
25067 ${PROG} diff: Diffing mod2-1
25068 Index: mod2-1/file2-1
25069 ===================================================================
25070 RCS file: ${TESTDIR}/root2/mod2-1/file2-1,v
25071 retrieving revision 1\.1
25072 diff -r1\.1 file2-1
25075 ${PROG} diff: Diffing mod2-2
25076 Index: mod2-2/file2-2
25077 ===================================================================
25078 RCS file: ${TESTDIR}/root2/mod2-2/file2-2,v
25079 retrieving revision 1\.1
25080 diff -r1\.1 file2-2
25084 dotest multiroot-commit-1 "${testcvs} commit -m actually" \
25085 "${PROG} [a-z]*: Examining \.
25086 ${PROG} [a-z]*: Examining mod1-1
25087 ${PROG} [a-z]*: Examining mod1-2
25088 ${PROG} [a-z]*: Examining mod2-2/mod1-2
25089 Checking in mod1-1/file1-1;
25090 ${TESTDIR}/root1/mod1-1/file1-1,v <-- file1-1
25091 new revision: 1.2; previous revision: 1.1
25093 Checking in mod1-2/file1-2;
25094 ${TESTDIR}/root1/mod1-2/file1-2,v <-- file1-2
25095 new revision: 1.2; previous revision: 1.1
25097 ${PROG} [a-z]*: Examining mod1-2/mod2-2
25098 ${PROG} [a-z]*: Examining mod2-1
25099 ${PROG} [a-z]*: Examining mod2-2
25100 Checking in mod2-1/file2-1;
25101 ${TESTDIR}/root2/mod2-1/file2-1,v <-- file2-1
25102 new revision: 1.2; previous revision: 1.1
25104 Checking in mod2-2/file2-2;
25105 ${TESTDIR}/root2/mod2-2/file2-2,v <-- file2-2
25106 new revision: 1.2; previous revision: 1.1
25109 dotest multiroot-update-2 "${testcvs} update" \
25110 "${PROG} update: Updating \.
25111 ${PROG} [a-z]*: Updating mod1-1
25112 ${PROG} [a-z]*: Updating mod1-2
25113 ${PROG} [a-z]*: Updating mod2-2/mod1-2
25114 U mod2-2/mod1-2/file1-2
25115 ${PROG} [a-z]*: Updating mod1-2/mod2-2
25116 U mod1-2/mod2-2/file2-2
25117 ${PROG} update: Updating mod2-1
25118 ${PROG} update: Updating mod2-2" \
25119 "${PROG} update: Updating \.
25120 ${PROG} update: Updating mod1-1
25121 ${PROG} update: Updating mod1-2
25122 ${PROG} update: Updating mod2-2
25123 ${PROG} update: Updating mod2-2/mod1-2
25124 P mod2-2/mod1-2/file1-2
25125 ${PROG} update: Updating mod1-2
25126 ${PROG} update: Updating mod1-2/mod2-2
25127 P mod1-2/mod2-2/file2-2
25128 ${PROG} update: Updating mod2-1
25129 ${PROG} update: Updating mod2-2"
25131 dotest multiroot-tag-1 "${testcvs} tag cattle" \
25132 "${PROG} tag: Tagging \.
25133 ${PROG} tag: Tagging mod1-1
25135 ${PROG} tag: Tagging mod1-2
25137 ${PROG} tag: Tagging mod2-2/mod1-2
25138 ${PROG} tag: Tagging mod1-2/mod2-2
25139 T mod1-2/mod2-2/file2-2
25140 ${PROG} tag: Tagging mod2-1
25142 ${PROG} tag: Tagging mod2-2" \
25143 "${PROG} tag: Tagging \.
25144 ${PROG} tag: Tagging mod1-1
25146 ${PROG} tag: Tagging mod1-2
25148 ${PROG} tag: Tagging mod2-2
25149 ${PROG} tag: Tagging mod2-2/mod1-2
25150 ${PROG} tag: Tagging mod1-2
25151 ${PROG} tag: Tagging mod1-2/mod2-2
25152 T mod1-2/mod2-2/file2-2
25153 ${PROG} tag: Tagging mod2-1
25155 ${PROG} tag: Tagging mod2-2"
25157 echo anotherfile1-1 > mod1-1/anotherfile1-1
25158 echo anotherfile2-1 > mod2-1/anotherfile2-1
25159 echo anotherfile1-2 > mod2-2/mod1-2/anotherfile1-2
25160 echo anotherfile2-2 > mod1-2/mod2-2/anotherfile2-2
25164 dotest multiroot-add-1ar "${testcvs} add anotherfile1-1" \
25165 "${PROG} add: scheduling file .anotherfile1-1. for addition
25166 ${PROG} add: use .${PROG} commit. to add this file permanently"
25168 dotest multiroot-add-1br "${testcvs} add anotherfile2-1" \
25169 "${PROG} add: scheduling file .anotherfile2-1. for addition
25170 ${PROG} add: use .${PROG} commit. to add this file permanently"
25171 cd ../mod2-2/mod1-2
25172 dotest multiroot-add-1cr "${testcvs} add anotherfile1-2" \
25173 "${PROG} add: scheduling file .anotherfile1-2. for addition
25174 ${PROG} add: use .${PROG} commit. to add this file permanently"
25175 cd ../../mod1-2/mod2-2
25176 dotest multiroot-add-1dr "${testcvs} add anotherfile2-2" \
25177 "${PROG} add: scheduling file .anotherfile2-2. for addition
25178 ${PROG} add: use .${PROG} commit. to add this file permanently"
25181 dotest multiroot-add-1 "${testcvs} add mod1-1/anotherfile1-1 mod2-1/anotherfile2-1 mod2-2/mod1-2/anotherfile1-2 mod1-2/mod2-2/anotherfile2-2" \
25182 "${PROG} add: scheduling file .mod1-1/anotherfile1-1. for addition
25183 ${PROG} add: scheduling file .mod2-1/anotherfile2-1. for addition
25184 ${PROG} add: scheduling file .mod2-2/mod1-2/anotherfile1-2. for addition
25185 ${PROG} add: scheduling file .mod1-2/mod2-2/anotherfile2-2. for addition
25186 ${PROG} add: use .${PROG} commit. to add these files permanently"
25189 dotest multiroot-status-1 "${testcvs} status -v" \
25190 "${PROG} status: Examining \.
25191 ${PROG} status: Examining mod1-1
25192 ===================================================================
25193 File: anotherfile1-1 Status: Locally Added
25195 Working revision: New file!
25196 Repository revision: No revision control file
25198 Sticky Date: (none)
25199 Sticky Options: (none)
25201 ===================================================================
25202 File: file1-1 Status: Up-to-date
25204 Working revision: 1\.2.*
25205 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
25207 Sticky Date: (none)
25208 Sticky Options: (none)
25211 cattle (revision: 1\.2)
25213 ${PROG} status: Examining mod1-2
25214 ===================================================================
25215 File: file1-2 Status: Up-to-date
25217 Working revision: 1\.2.*
25218 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
25220 Sticky Date: (none)
25221 Sticky Options: (none)
25224 cattle (revision: 1\.2)
25226 ${PROG} status: Examining mod2-2/mod1-2
25227 ===================================================================
25228 File: anotherfile1-2 Status: Locally Added
25230 Working revision: New file!
25231 Repository revision: No revision control file
25233 Sticky Date: (none)
25234 Sticky Options: (none)
25236 ===================================================================
25237 File: file1-2 Status: Up-to-date
25239 Working revision: 1\.2.*
25240 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
25242 Sticky Date: (none)
25243 Sticky Options: (none)
25246 cattle (revision: 1\.2)
25248 ${PROG} status: Examining mod1-2/mod2-2
25249 ===================================================================
25250 File: anotherfile2-2 Status: Locally Added
25252 Working revision: New file!
25253 Repository revision: No revision control file
25255 Sticky Date: (none)
25256 Sticky Options: (none)
25258 ===================================================================
25259 File: file2-2 Status: Up-to-date
25261 Working revision: 1\.2.*
25262 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
25264 Sticky Date: (none)
25265 Sticky Options: (none)
25268 cattle (revision: 1\.2)
25270 ${PROG} status: Examining mod2-1
25271 ===================================================================
25272 File: anotherfile2-1 Status: Locally Added
25274 Working revision: New file!
25275 Repository revision: No revision control file
25277 Sticky Date: (none)
25278 Sticky Options: (none)
25280 ===================================================================
25281 File: file2-1 Status: Up-to-date
25283 Working revision: 1\.2.*
25284 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
25286 Sticky Date: (none)
25287 Sticky Options: (none)
25290 cattle (revision: 1\.2)
25292 ${PROG} status: Examining mod2-2
25293 ===================================================================
25294 File: file2-2 Status: Up-to-date
25296 Working revision: 1\.2.*
25297 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
25299 Sticky Date: (none)
25300 Sticky Options: (none)
25303 cattle (revision: 1\.2)" \
25304 "${PROG} status: Examining \.
25305 ${PROG} status: Examining mod1-1
25306 ===================================================================
25307 File: anotherfile1-1 Status: Locally Added
25309 Working revision: New file!
25310 Repository revision: No revision control file
25312 Sticky Date: (none)
25313 Sticky Options: (none)
25315 ===================================================================
25316 File: file1-1 Status: Up-to-date
25318 Working revision: 1\.2.*
25319 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
25321 Sticky Date: (none)
25322 Sticky Options: (none)
25325 cattle (revision: 1\.2)
25327 ${PROG} status: Examining mod1-2
25328 ===================================================================
25329 File: file1-2 Status: Up-to-date
25331 Working revision: 1\.2.*
25332 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
25334 Sticky Date: (none)
25335 Sticky Options: (none)
25338 cattle (revision: 1\.2)
25340 ${PROG} status: Examining mod2-2
25341 ${PROG} status: Examining mod2-2/mod1-2
25342 ===================================================================
25343 File: anotherfile1-2 Status: Locally Added
25345 Working revision: New file!
25346 Repository revision: No revision control file
25348 Sticky Date: (none)
25349 Sticky Options: (none)
25351 ===================================================================
25352 File: file1-2 Status: Up-to-date
25354 Working revision: 1\.2.*
25355 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
25357 Sticky Date: (none)
25358 Sticky Options: (none)
25361 cattle (revision: 1\.2)
25363 ${PROG} status: Examining mod1-2
25364 ${PROG} status: Examining mod1-2/mod2-2
25365 ===================================================================
25366 File: anotherfile2-2 Status: Locally Added
25368 Working revision: New file!
25369 Repository revision: No revision control file
25371 Sticky Date: (none)
25372 Sticky Options: (none)
25374 ===================================================================
25375 File: file2-2 Status: Up-to-date
25377 Working revision: 1\.2.*
25378 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
25380 Sticky Date: (none)
25381 Sticky Options: (none)
25384 cattle (revision: 1\.2)
25386 ${PROG} status: Examining mod2-1
25387 ===================================================================
25388 File: anotherfile2-1 Status: Locally Added
25390 Working revision: New file!
25391 Repository revision: No revision control file
25393 Sticky Date: (none)
25394 Sticky Options: (none)
25396 ===================================================================
25397 File: file2-1 Status: Up-to-date
25399 Working revision: 1\.2.*
25400 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
25402 Sticky Date: (none)
25403 Sticky Options: (none)
25406 cattle (revision: 1\.2)
25408 ${PROG} status: Examining mod2-2
25409 ===================================================================
25410 File: file2-2 Status: Up-to-date
25412 Working revision: 1\.2.*
25413 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
25415 Sticky Date: (none)
25416 Sticky Options: (none)
25419 cattle (revision: 1\.2)"
25421 dotest multiroot-commit-2 "${testcvs} commit -m reading" \
25422 "${PROG} [a-z]*: Examining \.
25423 ${PROG} [a-z]*: Examining mod1-1
25424 ${PROG} [a-z]*: Examining mod1-2
25425 ${PROG} [a-z]*: Examining mod2-2/mod1-2
25426 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v
25428 Checking in mod1-1/anotherfile1-1;
25429 ${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v <-- anotherfile1-1
25430 initial revision: 1\.1
25432 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
25434 Checking in mod2-2/mod1-2/anotherfile1-2;
25435 ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v <-- anotherfile1-2
25436 initial revision: 1\.1
25438 ${PROG} [a-z]*: Examining mod1-2/mod2-2
25439 ${PROG} [a-z]*: Examining mod2-1
25440 ${PROG} [a-z]*: Examining mod2-2
25441 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
25443 Checking in mod1-2/mod2-2/anotherfile2-2;
25444 ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v <-- anotherfile2-2
25445 initial revision: 1\.1
25447 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v
25449 Checking in mod2-1/anotherfile2-1;
25450 ${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v <-- anotherfile2-1
25451 initial revision: 1\.1
25454 dotest multiroot-update-3 "${testcvs} update" \
25455 "${PROG} update: Updating \.
25456 ${PROG} [a-z]*: Updating mod1-1
25457 ${PROG} [a-z]*: Updating mod1-2
25458 U mod1-2/anotherfile1-2
25459 ${PROG} [a-z]*: Updating mod2-2/mod1-2
25460 ${PROG} [a-z]*: Updating mod1-2/mod2-2
25461 ${PROG} [a-z]*: Updating mod2-1
25462 ${PROG} [a-z]*: Updating mod2-2
25463 U mod2-2/anotherfile2-2" \
25464 "${PROG} update: Updating \.
25465 ${PROG} update: Updating mod1-1
25466 ${PROG} update: Updating mod1-2
25467 U mod1-2/anotherfile1-2
25468 ${PROG} update: Updating mod2-2
25469 ${PROG} update: Updating mod2-2/mod1-2
25470 ${PROG} update: Updating mod1-2
25471 ${PROG} update: Updating mod1-2/mod2-2
25472 ${PROG} update: Updating mod2-1
25473 ${PROG} update: Updating mod2-2
25474 U mod2-2/anotherfile2-2"
25476 dotest multiroot-log-1 "${testcvs} log" \
25477 "${PROG} log: Logging \.
25478 ${PROG} log: Logging mod1-1
25480 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v
25481 Working file: mod1-1/anotherfile1-1
25487 keyword substitution: kv
25488 total revisions: 1; selected revisions: 1
25490 ----------------------------
25492 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25494 =============================================================================
25496 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
25497 Working file: mod1-1/file1-1
25504 keyword substitution: kv
25505 total revisions: 2; selected revisions: 2
25507 ----------------------------
25509 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25511 ----------------------------
25513 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25515 =============================================================================
25516 ${PROG} log: Logging mod1-2
25518 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
25519 Working file: mod1-2/anotherfile1-2
25525 keyword substitution: kv
25526 total revisions: 1; selected revisions: 1
25528 ----------------------------
25530 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25532 =============================================================================
25534 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
25535 Working file: mod1-2/file1-2
25542 keyword substitution: kv
25543 total revisions: 2; selected revisions: 2
25545 ----------------------------
25547 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25549 ----------------------------
25551 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25553 =============================================================================
25554 ${PROG} log: Logging mod2-2/mod1-2
25556 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
25557 Working file: mod2-2/mod1-2/anotherfile1-2
25563 keyword substitution: kv
25564 total revisions: 1; selected revisions: 1
25566 ----------------------------
25568 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25570 =============================================================================
25572 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
25573 Working file: mod2-2/mod1-2/file1-2
25580 keyword substitution: kv
25581 total revisions: 2; selected revisions: 2
25583 ----------------------------
25585 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25587 ----------------------------
25589 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25591 =============================================================================
25592 ${PROG} log: Logging mod1-2/mod2-2
25594 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
25595 Working file: mod1-2/mod2-2/anotherfile2-2
25601 keyword substitution: kv
25602 total revisions: 1; selected revisions: 1
25604 ----------------------------
25606 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25608 =============================================================================
25610 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
25611 Working file: mod1-2/mod2-2/file2-2
25618 keyword substitution: kv
25619 total revisions: 2; selected revisions: 2
25621 ----------------------------
25623 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25625 ----------------------------
25627 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25629 =============================================================================
25630 ${PROG} log: Logging mod2-1
25632 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v
25633 Working file: mod2-1/anotherfile2-1
25639 keyword substitution: kv
25640 total revisions: 1; selected revisions: 1
25642 ----------------------------
25644 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25646 =============================================================================
25648 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
25649 Working file: mod2-1/file2-1
25656 keyword substitution: kv
25657 total revisions: 2; selected revisions: 2
25659 ----------------------------
25661 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25663 ----------------------------
25665 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25667 =============================================================================
25668 ${PROG} log: Logging mod2-2
25670 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
25671 Working file: mod2-2/anotherfile2-2
25677 keyword substitution: kv
25678 total revisions: 1; selected revisions: 1
25680 ----------------------------
25682 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25684 =============================================================================
25686 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
25687 Working file: mod2-2/file2-2
25694 keyword substitution: kv
25695 total revisions: 2; selected revisions: 2
25697 ----------------------------
25699 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25701 ----------------------------
25703 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25705 =============================================================================" \
25706 "${PROG} log: Logging \.
25707 ${PROG} log: Logging mod1-1
25709 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v
25710 Working file: mod1-1/anotherfile1-1
25716 keyword substitution: kv
25717 total revisions: 1; selected revisions: 1
25719 ----------------------------
25721 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25723 =============================================================================
25725 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
25726 Working file: mod1-1/file1-1
25733 keyword substitution: kv
25734 total revisions: 2; selected revisions: 2
25736 ----------------------------
25738 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25740 ----------------------------
25742 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25744 =============================================================================
25745 ${PROG} log: Logging mod1-2
25747 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
25748 Working file: mod1-2/anotherfile1-2
25754 keyword substitution: kv
25755 total revisions: 1; selected revisions: 1
25757 ----------------------------
25759 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25761 =============================================================================
25763 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
25764 Working file: mod1-2/file1-2
25771 keyword substitution: kv
25772 total revisions: 2; selected revisions: 2
25774 ----------------------------
25776 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25778 ----------------------------
25780 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25782 =============================================================================
25783 ${PROG} log: Logging mod2-2
25784 ${PROG} log: Logging mod2-2/mod1-2
25786 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
25787 Working file: mod2-2/mod1-2/anotherfile1-2
25793 keyword substitution: kv
25794 total revisions: 1; selected revisions: 1
25796 ----------------------------
25798 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25800 =============================================================================
25802 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
25803 Working file: mod2-2/mod1-2/file1-2
25810 keyword substitution: kv
25811 total revisions: 2; selected revisions: 2
25813 ----------------------------
25815 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25817 ----------------------------
25819 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25821 =============================================================================
25822 ${PROG} log: Logging mod1-2
25823 ${PROG} log: Logging mod1-2/mod2-2
25825 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
25826 Working file: mod1-2/mod2-2/anotherfile2-2
25832 keyword substitution: kv
25833 total revisions: 1; selected revisions: 1
25835 ----------------------------
25837 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25839 =============================================================================
25841 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
25842 Working file: mod1-2/mod2-2/file2-2
25849 keyword substitution: kv
25850 total revisions: 2; selected revisions: 2
25852 ----------------------------
25854 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25856 ----------------------------
25858 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25860 =============================================================================
25861 ${PROG} log: Logging mod2-1
25863 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v
25864 Working file: mod2-1/anotherfile2-1
25870 keyword substitution: kv
25871 total revisions: 1; selected revisions: 1
25873 ----------------------------
25875 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25877 =============================================================================
25879 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
25880 Working file: mod2-1/file2-1
25887 keyword substitution: kv
25888 total revisions: 2; selected revisions: 2
25890 ----------------------------
25892 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25894 ----------------------------
25896 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25898 =============================================================================
25899 ${PROG} log: Logging mod2-2
25901 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
25902 Working file: mod2-2/anotherfile2-2
25908 keyword substitution: kv
25909 total revisions: 1; selected revisions: 1
25911 ----------------------------
25913 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25915 =============================================================================
25917 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
25918 Working file: mod2-2/file2-2
25925 keyword substitution: kv
25926 total revisions: 2; selected revisions: 2
25928 ----------------------------
25930 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25932 ----------------------------
25934 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25936 ============================================================================="
25939 # After the simple cases, let's execute some commands which
25940 # refer to parts of our checked-out tree (e.g. "cvs update
25944 echo Keeping ${TESTDIR} and exiting due to --keep
25948 # clean up after ourselves
25952 # clean up our repositories
25957 # More multiroot tests. In particular, nested directories.
25959 CVSROOT1_DIRNAME=${TESTDIR}/root1
25960 CVSROOT2_DIRNAME=${TESTDIR}/root2
25961 CVSROOT1=`newroot $CVSROOT1_DIRNAME`
25962 CVSROOT2=`newroot $CVSROOT2_DIRNAME`
25964 dotest multiroot2-1 "${testcvs} -d ${CVSROOT1} init" ""
25965 dotest multiroot2-2 "${testcvs} -d ${CVSROOT2} init" ""
25967 mkdir imp-dir; cd imp-dir
25970 echo sfile >sdir/sfile
25972 echo ssfile >sdir/ssdir/ssfile
25973 dotest_sort multiroot2-3 \
25974 "${testcvs} -d ${CVSROOT1} import -m import-to-root1 dir1 vend rel" "
25978 N dir1/sdir/ssdir/ssfile
25979 No conflicts created by this import
25980 ${PROG} import: Importing ${TESTDIR}/root1/dir1/sdir
25981 ${PROG} import: Importing ${TESTDIR}/root1/dir1/sdir/ssdir"
25983 dotest_sort multiroot2-4 \
25984 "${testcvs} -d ${CVSROOT2} import -m import-to-root2 sdir vend2 rel2" "
25987 N sdir/ssdir/ssfile
25988 No conflicts created by this import
25989 ${PROG} import: Importing ${TESTDIR}/root2/sdir/ssdir"
25993 # Get TopLevelAdmin-like behavior.
25994 dotest multiroot2-5 "${testcvs} -d ${CVSROOT1} -q co -l ."
25995 dotest multiroot2-5 "${testcvs} -d ${CVSROOT1} -q co dir1" \
25998 U dir1/sdir/ssdir/ssfile"
26000 dotest multiroot2-6 "${testcvs} -Q release -d sdir" ""
26001 dotest multiroot2-7 "${testcvs} -d ${CVSROOT2} -q co sdir" \
26003 U sdir/ssdir/ssfile"
26005 # This has one subtle effect - it deals with Entries.Log
26006 # so that the next test doesn't get trace messages for
26008 dotest multiroot2-8 "${testcvs} update" \
26009 "${PROG} update: Updating \.
26010 ${PROG} update: Updating dir1
26011 ${PROG} update: Updating dir1/sdir
26012 ${PROG} update: Updating dir1/sdir/ssdir" \
26013 "${PROG} update: Updating \.
26014 ${PROG} update: Updating dir1
26015 ${PROG} update: Updating dir1
26016 ${PROG} update: Updating dir1/sdir
26017 ${PROG} update: Updating dir1/sdir/ssdir"
26018 # Two reasons we don't run this on the server: (1) the server
26019 # also prints some trace messages, and (2) the server trace
26020 # messages are subject to out-of-order bugs (this one is hard
26022 if $remote; then :; else
26023 dotest multiroot2-9a "${testcvs} -t update" \
26024 " *-> main loop with CVSROOT=${TESTDIR}/root1
26025 ${PROG} update: Updating \.
26026 *-> Reader_Lock(${TESTDIR}/root1)
26028 ${PROG} update: Updating dir1
26029 *-> Reader_Lock(${TESTDIR}/root1/dir1)
26031 *-> main loop with CVSROOT=${TESTDIR}/root2
26032 ${PROG} update: Updating dir1/sdir
26033 *-> Reader_Lock(${TESTDIR}/root2/sdir)
26035 ${PROG} update: Updating dir1/sdir/ssdir
26036 *-> Reader_Lock(${TESTDIR}/root2/sdir/ssdir)
26038 *-> Lock_Cleanup()"
26041 dotest multiroot2-9 "${testcvs} -q tag tag1" \
26044 T dir1/sdir/ssdir/ssfile"
26045 echo "change it" >>dir1/file1
26046 echo "change him too" >>dir1/sdir/sfile
26047 dotest multiroot2-10 "${testcvs} -q ci -m modify" \
26048 "Checking in dir1/file1;
26049 ${TESTDIR}/root1/dir1/file1,v <-- file1
26050 new revision: 1\.2; previous revision: 1\.1
26052 Checking in dir1/sdir/sfile;
26053 ${TESTDIR}/root2/sdir/sfile,v <-- sfile
26054 new revision: 1\.2; previous revision: 1\.1
26056 dotest multiroot2-11 "${testcvs} -q tag tag2" \
26059 T dir1/sdir/ssdir/ssfile"
26060 dotest_fail multiroot2-12 \
26061 "${testcvs} -q diff -u -r tag1 -r tag2" \
26063 ===================================================================
26064 RCS file: ${TESTDIR}/root1/dir1/file1,v
26065 retrieving revision 1\.1\.1\.1
26066 retrieving revision 1\.2
26067 diff -u -r1\.1\.1\.1 -r1\.2
26068 --- dir1/file1 ${RFCDATE} 1\.1\.1\.1
26069 ${PLUS}${PLUS}${PLUS} dir1/file1 ${RFCDATE} 1\.2
26070 @@ -1 ${PLUS}1,2 @@
26073 Index: dir1/sdir/sfile
26074 ===================================================================
26075 RCS file: ${TESTDIR}/root2/sdir/sfile,v
26076 retrieving revision 1\.1\.1\.1
26077 retrieving revision 1\.2
26078 diff -u -r1\.1\.1\.1 -r1\.2
26079 --- dir1/sdir/sfile ${RFCDATE} 1\.1\.1\.1
26080 ${PLUS}${PLUS}${PLUS} dir1/sdir/sfile ${RFCDATE} 1\.2
26081 @@ -1 ${PLUS}1,2 @@
26083 ${PLUS}change him too"
26086 echo Keeping ${TESTDIR} and exiting due to --keep
26090 # clean up after ourselves
26094 # clean up our repositories
26099 # More multiroot tests. Directories are side-by-side, not nested.
26100 # Not drastically different from multiroot but it covers somewhat
26103 CVSROOT1=`newroot ${TESTDIR}/root1`
26104 CVSROOT2=`newroot ${TESTDIR}/root2`
26107 dotest multiroot3-1 "${testcvs} -d ${CVSROOT1} init" ""
26108 dotest multiroot3-2 "${testcvs} -d ${CVSROOT1} -q co -l ." ""
26110 dotest multiroot3-3 "${testcvs} add dir1" \
26111 "Directory ${TESTDIR}/root1/dir1 added to the repository"
26112 dotest multiroot3-4 "${testcvs} -d ${CVSROOT2} init" ""
26114 dotest multiroot3-5 "${testcvs} -d ${CVSROOT2} -q co -l ." ""
26117 # OK, the problem is that CVS/Entries doesn't look quite right,
26118 # I suppose because of the "rm -r".
26119 # For local this fixes it up.
26120 dotest multiroot3-6 "${testcvs} -d ${CVSROOT1} -q co dir1" ""
26122 # For remote that doesn't do it. Use the quick and dirty fix.
26123 echo "D/dir1////" >CVS/Entries
26124 echo "D/dir2////" >>CVS/Entries
26127 dotest multiroot3-7 "${testcvs} add dir2" \
26128 "Directory ${TESTDIR}/root2/dir2 added to the repository"
26130 touch dir1/file1 dir2/file2
26132 # Trying to add them both in one command doesn't work,
26133 # because add.c doesn't do multiroot (it doesn't use recurse.c).
26134 # Furthermore, it can't deal with the parent directory
26135 # having a different root from the child, hence the cd.
26137 dotest multiroot3-8 "${testcvs} add file1" \
26138 "${PROG} add: scheduling file .file1. for addition
26139 ${PROG} add: use .${PROG} commit. to add this file permanently"
26141 dotest multiroot3-8a "${testcvs} add dir2/file2" \
26142 "${PROG} add: scheduling file .dir2/file2. for addition
26143 ${PROG} add: use .${PROG} commit. to add this file permanently"
26145 dotest multiroot3-8 "${testcvs} add dir1/file1 dir2/file2" \
26146 "${PROG} add: scheduling file .dir1/file1. for addition
26147 ${PROG} add: scheduling file .dir2/file2. for addition
26148 ${PROG} add: use .${PROG} commit. to add these files permanently"
26151 dotest multiroot3-9 "${testcvs} -q ci -m add-them" \
26152 "RCS file: ${TESTDIR}/root2/dir2/file2,v
26154 Checking in dir2/file2;
26155 ${TESTDIR}/root2/dir2/file2,v <-- file2
26156 initial revision: 1\.1
26158 RCS file: ${TESTDIR}/root1/dir1/file1,v
26160 Checking in dir1/file1;
26161 ${TESTDIR}/root1/dir1/file1,v <-- file1
26162 initial revision: 1\.1
26165 # That this is an error is good - we are asking CVS to do
26166 # something which doesn't make sense.
26167 dotest_fail multiroot3-10 \
26168 "${testcvs} -q -d ${CVSROOT1} diff dir1/file1 dir2/file2" \
26169 "${PROG} diff: failed to create lock directory for .${TESTDIR}/root1/dir2' (${TESTDIR}/root1/dir2/#cvs.lock): No such file or directory
26170 ${PROG} diff: failed to obtain dir lock in repository .${TESTDIR}/root1/dir2'
26171 ${PROG} \[diff aborted\]: read lock failed - giving up"
26173 # This one is supposed to work.
26174 dotest multiroot3-11 "${testcvs} -q diff dir1/file1 dir2/file2" ""
26176 # make sure we can't access across repositories
26179 dotest_fail multiroot3-12 \
26180 "$testcvs -d $CVSROOT1 -q co ../root2/dir2" \
26181 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\." \
26182 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\.
26183 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
26184 dotest_fail multiroot3-13 \
26185 "$testcvs -d $CVSROOT2 -q co ../root1/dir1" \
26186 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\.\./root1/dir1'\." \
26187 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\.\./root1/dir1'\.
26188 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
26189 dotest_fail multiroot3-14 \
26190 "$testcvs -d $CVSROOT1 -q co ./../root2/dir2" \
26191 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root2/dir2'\." \
26192 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root2/dir2'\.
26193 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
26194 dotest_fail multiroot3-15 \
26195 "$testcvs -d $CVSROOT2 -q co ./../root1/dir1" \
26196 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\." \
26197 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\.
26198 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
26199 dotest_fail multiroot3-16 \
26200 "$testcvs -d $CVSROOT1 -q co -p ../root2/dir2" \
26201 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\." \
26202 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\.
26203 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
26204 dotest_fail multiroot3-17 \
26205 "$testcvs -d $CVSROOT1 -q co -p ./../root1/dir1" \
26206 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\." \
26207 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\.
26208 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
26211 echo Keeping $TESTDIR and exiting due to --keep
26218 rm -rf ${TESTDIR}/root1 ${TESTDIR}/root2
26224 # More multiroot tests, in particular we have two roots with
26225 # similarly-named directories and we try to see that CVS can
26226 # keep them separate.
26228 CVSROOT1=`newroot ${TESTDIR}/root1`
26229 CVSROOT2=`newroot ${TESTDIR}/root2`
26232 dotest multiroot4-1 "${testcvs} -d ${CVSROOT1} init" ""
26233 dotest multiroot4-2 "${testcvs} -d ${CVSROOT1} -q co -l ." ""
26235 dotest multiroot4-3 "${testcvs} add dircom" \
26236 "Directory ${TESTDIR}/root1/dircom added to the repository"
26239 dotest multiroot4-4 "${testcvs} add file1" \
26240 "${PROG} add: scheduling file .file1. for addition
26241 ${PROG} add: use .${PROG} commit. to add this file permanently"
26242 dotest multiroot4-5 "${testcvs} -q ci -m add" \
26243 "RCS file: ${TESTDIR}/root1/dircom/file1,v
26246 ${TESTDIR}/root1/dircom/file1,v <-- file1
26247 initial revision: 1\.1
26251 dotest multiroot4-6 "${testcvs} -d ${CVSROOT2} init" ""
26252 dotest multiroot4-7 "${testcvs} -d ${CVSROOT2} -q co -l ." ""
26254 dotest multiroot4-8 "${testcvs} add dircom" \
26255 "Directory ${TESTDIR}/root2/dircom added to the repository"
26258 dotest multiroot4-9 "${testcvs} add file2" \
26259 "${PROG} add: scheduling file .file2. for addition
26260 ${PROG} add: use .${PROG} commit. to add this file permanently"
26261 dotest multiroot4-10 "${testcvs} -q ci -m add" \
26262 "RCS file: ${TESTDIR}/root2/dircom/file2,v
26265 ${TESTDIR}/root2/dircom/file2,v <-- file2
26266 initial revision: 1\.1
26271 # This may look contrived; the real world example which inspired
26272 # it was that a user was changing from local to remote. Cases
26273 # like switching servers (among those mounting the same
26274 # repository) and so on would also look the same.
26276 dotest multiroot4-11 "${testcvs} -d ${CVSROOT2} add sdir2" \
26277 "Directory ${TESTDIR}/root2/dircom/sdir2 added to the repository"
26279 dotest multiroot4-12 "${testcvs} -q update" ""
26281 dotest multiroot4-13 "${testcvs} -q update dircom" ""
26285 rm -rf ${TESTDIR}/root1 ${TESTDIR}/root2
26291 # When the Entries/Root file is removed from an existing
26292 # workspace, CVS should assume $CVSROOT instead
26294 # Right now only checking that CVS exits normally on an
26295 # update once CVS/Root is deleted
26297 # There was a time when this would core dump when run in
26298 # client/server mode
26301 dotest rmroot-setup-1 "${testcvs} -q co -l ." ''
26303 dotest rmroot-setup-2 "${testcvs} add first-dir" \
26304 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
26307 dotest rmroot-setup-3 "${testcvs} add file1 file2" \
26308 "${PROG} add: scheduling file .file1. for addition
26309 ${PROG} add: scheduling file .file2. for addition
26310 ${PROG} add: use .${PROG} commit. to add these files permanently"
26311 dotest rmroot-setup-4 "${testcvs} -q commit -minit" \
26312 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26315 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
26316 initial revision: 1\.1
26318 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26321 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
26322 initial revision: 1\.1
26325 dotest rmroot-1 "${testcvs} -q update" ''
26332 # More tests of repositories and specifying them.
26333 # Similar to crerepos but that test is probably getting big
26335 CVSROOT1=`newroot ${TESTDIR}/root1`
26336 CVSROOT_MOVED=`newroot ${TESTDIR}/root-moved`
26338 dotest reposmv-setup-1 "${testcvs} -d ${CVSROOT1} init" ""
26339 mkdir imp-dir; cd imp-dir
26341 dotest reposmv-setup-2 \
26342 "${testcvs} -d ${CVSROOT1} import -m add dir1 vendor release" \
26345 No conflicts created by this import"
26349 dotest reposmv-1 "${testcvs} -d ${CVSROOT1} -Q co dir1" ""
26350 mv ${TESTDIR}/root1 ${TESTDIR}/root-moved
26353 # If we didn't have a relative repository, get one now.
26354 dotest reposmv-1a "cat CVS/Repository" \
26355 "${TESTDIR}/root1/dir1" "dir1"
26356 echo dir1 >CVS/Repository
26358 # There were some duplicated warnings and such; only test
26359 # for the part of the error message which makes sense.
26360 # Bug: "skipping directory " without filename.
26362 dotest_fail reposmv-2r "${testcvs} update" \
26363 "Cannot access ${TESTDIR}/root1/CVSROOT
26364 No such file or directory"
26366 dotest reposmv-2 "${testcvs} update" "${DOTSTAR}
26367 ${PROG} update: ignoring CVS/Root because it specifies a non-existent repository ${TESTDIR}/root1
26368 ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1: No such file or directory
26369 ${PROG} update: skipping directory "
26372 # CVS/Root overrides $CVSROOT
26374 CVSROOT_save=${CVSROOT}
26375 CVSROOT=:fork:${TESTDIR}/root-moved; export CVSROOT
26376 dotest_fail reposmv-3r "${testcvs} update" \
26377 "Cannot access ${TESTDIR}/root1/CVSROOT
26378 No such file or directory"
26379 CVSROOT=${CVSROOT_save}; export CVSROOT
26381 CVSROOT_save=${CVSROOT}
26382 CVSROOT=${TESTDIR}/root-moved; export CVSROOT
26383 dotest reposmv-3 "${testcvs} update" \
26385 ${PROG} update: ignoring CVS/Root because it specifies a non-existent repository ${TESTDIR}/root1
26386 ${PROG} update: Updating \.
26388 CVSROOT=${CVSROOT_save}; export CVSROOT
26392 CVSROOT_save=${CVSROOT}
26393 CVSROOT=:fork:${TESTDIR}/root-none; export CVSROOT
26394 dotest_fail reposmv-4 "${testcvs} update" \
26395 "Cannot access ${TESTDIR}/root1/CVSROOT
26396 No such file or directory"
26397 CVSROOT=${CVSROOT_save}; export CVSROOT
26399 # CVS/Root doesn't seem to quite completely override $CVSROOT
26400 # Bug? Not necessarily a big deal if it only affects error
26402 CVSROOT_save=${CVSROOT}
26403 CVSROOT=${TESTDIR}/root-none; export CVSROOT
26404 dotest_fail reposmv-4 "${testcvs} update" \
26405 "${PROG} update: in directory \.:
26406 ${PROG} update: ignoring CVS/Root because it specifies a non-existent repository ${TESTDIR}/root1
26407 ${PROG} \[update aborted\]: ${TESTDIR}/root-none/CVSROOT: No such file or directory"
26408 CVSROOT=${CVSROOT_save}; export CVSROOT
26411 # -d overrides CVS/Root
26413 # Oddly enough, with CVS 1.10 I think this didn't work for
26414 # local (that is, it would appear that CVS/Root would not
26415 # get used, but would produce an error if it didn't exist).
26416 dotest reposmv-5 "${testcvs} -d ${CVSROOT_MOVED} update" \
26417 "${PROG} update: Updating \."
26419 # TODO: could also test various other things, like what if the
26420 # user removes CVS/Root (which is legit). Or another set of
26421 # tests would be if both repositories exist but we want to make
26422 # sure that CVS is using the correct one.
26431 # Test basic pserver functionality.
26433 # First set SystemAuth=no. Not really necessary, I don't
26434 # think, but somehow it seems like the clean thing for
26437 dotest pserver-1 "${testcvs} -Q co CVSROOT" ""
26439 echo "SystemAuth=no" >config
26440 dotest pserver-2 "${testcvs} -q ci -m config-it" \
26441 "Checking in config;
26442 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
26443 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
26445 ${PROG} commit: Rebuilding administrative file database"
26446 cat >${CVSROOT_DIRNAME}/CVSROOT/passwd <<EOF
26447 testme:q6WV9d2t848B2:$username
26448 dontroot:q6WV9d2t848B2:root
26449 anonymous::$username
26451 willfail: :whocares
26453 dotest_fail pserver-3 "${testcvs} pserver" \
26454 "error 0 Server configuration missing --allow-root in inetd.conf" <<EOF
26462 # Confirm that not sending a newline during auth cannot constitute
26463 # a denial-of-service attack. This assumes that PATH_MAX is less
26464 # than 65536 bytes. If PATH_MAX is larger than 65535 bytes, this
26465 # test could hang indefinitely.
26466 ${AWK} 'BEGIN { printf "0123456789abcdef" }' </dev/null >garbageseg
26467 echo "BEGIN AUTH REQUEST" >garbageinput
26469 while test $i -lt 64; do
26470 cat <garbageseg >>garbageseg2
26474 while test $i -lt 64; do
26475 cat <garbageseg2 >>garbageinput
26478 dotest_fail pserver-auth-no-dos \
26479 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26480 "${PROG} \\[pserver aborted\\]: Maximum line length exceeded during authentication\." <garbageinput
26482 rm garbageseg garbageseg2 garbageinput
26484 # Sending the Root and noop before waiting for the
26485 # "I LOVE YOU" is bogus, but hopefully we can get
26487 dotest pserver-4 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26488 "${DOTSTAR} LOVE YOU
26495 Root ${CVSROOT_DIRNAME}
26499 dotest_fail pserver-4.2 \
26500 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26501 "error 0: root not allowed" <<EOF
26509 dotest pserver-5 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26510 "${DOTSTAR} LOVE YOU
26511 E Protocol error: Root says \"${TESTDIR}/1\" but pserver says \"${CVSROOT_DIRNAME}\"
26522 dotest pserver-5a "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26523 "${DOTSTAR} LOVE YOU
26524 E Protocol error: init says \"${TESTDIR}/2\" but pserver says \"${CVSROOT_DIRNAME}\"
26533 dotest_fail pserver-5b "test -d ${TESTDIR}/2" ''
26535 dotest pserver-5c "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26536 "${DOTSTAR} LOVE YOU
26537 E init xxx must be an absolute pathname
26546 dotest_fail pserver-5d "test -d xxx" ''
26548 dotest_fail pserver-6 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26557 dotest_fail pserver-7 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26559 BEGIN VERIFICATION REQUEST
26563 END VERIFICATION REQUEST
26566 dotest pserver-8 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26567 "${DOTSTAR} LOVE YOU" <<EOF
26568 BEGIN VERIFICATION REQUEST
26572 END VERIFICATION REQUEST
26575 # Tests pserver-9 through pserver-13 are about empty passwords
26577 # Test empty password (both sides) for aliased user
26578 dotest pserver-9 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26579 "${DOTSTAR} LOVE YOU" <<EOF
26587 # Test empty password (server side only) for aliased user
26588 dotest pserver-10 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26589 "${DOTSTAR} LOVE YOU" <<EOF
26593 Aanythingwouldworkhereittrulydoesnotmatter
26597 # Test empty (both sides) password for non-aliased user
26598 dotest pserver-11 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26599 "${DOTSTAR} LOVE YOU" <<EOF
26607 # Test empty (server side only) password for non-aliased user
26608 dotest pserver-12 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26609 "${DOTSTAR} LOVE YOU" <<EOF
26613 Anypasswordwouldworkwhynotthisonethen
26617 # Test failure of whitespace password
26618 dotest_fail pserver-13 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26619 "${DOTSTAR} HATE YOU" <<EOF
26623 Amquiteunabletocomeupwithinterestingpasswordsanymore
26627 # The following tests are for read-only access
26629 # Check that readers can only read, everyone else can write
26631 cat >${CVSROOT_DIRNAME}/CVSROOT/readers <<EOF
26635 dotest pserver-14 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26636 "${DOTSTAR} LOVE YOU
26637 M Concurrent Versions System (CVS) .*
26644 Root ${CVSROOT_DIRNAME}
26648 dotest pserver-15 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26649 "${DOTSTAR} LOVE YOU
26650 E ${PROG} \\[server aborted\\]: .init. requires write access to the repository
26657 init ${CVSROOT_DIRNAME}
26660 dotest pserver-16 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26661 "${DOTSTAR} LOVE YOU
26662 M Concurrent Versions System (CVS) .*
26669 Root ${CVSROOT_DIRNAME}
26673 dotest pserver-17 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26674 "${DOTSTAR} LOVE YOU
26681 init ${CVSROOT_DIRNAME}
26684 dotest pserver-18 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26685 "${DOTSTAR} LOVE YOU
26686 M Concurrent Versions System (CVS) .*
26693 Root ${CVSROOT_DIRNAME}
26697 dotest pserver-19 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26698 "${DOTSTAR} LOVE YOU
26705 init ${CVSROOT_DIRNAME}
26708 # Check that writers can write, everyone else can only read
26709 # even if not listed in readers
26711 cat >${CVSROOT_DIRNAME}/CVSROOT/writers <<EOF
26715 dotest pserver-20 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26716 "${DOTSTAR} LOVE YOU
26717 M Concurrent Versions System (CVS) .*
26724 Root ${CVSROOT_DIRNAME}
26728 dotest pserver-21 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26729 "${DOTSTAR} LOVE YOU
26730 E ${PROG} \\[server aborted\\]: .init. requires write access to the repository
26737 init ${CVSROOT_DIRNAME}
26740 dotest pserver-22 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26741 "${DOTSTAR} LOVE YOU
26742 M Concurrent Versions System (CVS) .*
26749 Root ${CVSROOT_DIRNAME}
26753 dotest pserver-23 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26754 "${DOTSTAR} LOVE YOU
26761 init ${CVSROOT_DIRNAME}
26764 dotest pserver-24 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26765 "${DOTSTAR} LOVE YOU
26766 M Concurrent Versions System (CVS) .*
26773 Root ${CVSROOT_DIRNAME}
26777 dotest pserver-25 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26778 "${DOTSTAR} LOVE YOU
26779 E ${PROG} \\[server aborted\\]: .init. requires write access to the repository
26786 init ${CVSROOT_DIRNAME}
26789 # Should work the same without readers
26791 rm ${CVSROOT_DIRNAME}/CVSROOT/readers
26793 dotest pserver-26 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26794 "${DOTSTAR} LOVE YOU
26795 M Concurrent Versions System (CVS) .*
26802 Root ${CVSROOT_DIRNAME}
26806 dotest pserver-27 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26807 "${DOTSTAR} LOVE YOU
26808 E ${PROG} \\[server aborted\\]: .init. requires write access to the repository
26815 init ${CVSROOT_DIRNAME}
26818 dotest pserver-28 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26819 "${DOTSTAR} LOVE YOU
26820 M Concurrent Versions System (CVS) .*
26827 Root ${CVSROOT_DIRNAME}
26831 dotest pserver-29 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26832 "${DOTSTAR} LOVE YOU
26839 init ${CVSROOT_DIRNAME}
26842 dotest pserver-30 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26843 "${DOTSTAR} LOVE YOU
26844 M Concurrent Versions System (CVS) .*
26851 Root ${CVSROOT_DIRNAME}
26855 dotest pserver-31 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
26856 "${DOTSTAR} LOVE YOU
26857 E ${PROG} \\[server aborted\\]: .init. requires write access to the repository
26864 init ${CVSROOT_DIRNAME}
26867 # pserver used to try and print from the NULL pointer
26868 # in this error message in this case
26869 dotest_fail pserver-bufinit "${testcvs} pserver" \
26870 "${PROG} \[pserver aborted\]: bad auth protocol start: EOF" </dev/null
26873 echo "# comments only" >config
26874 dotest pserver-cleanup-1 "${testcvs} -q ci -m config-it" \
26875 "Checking in config;
26876 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
26877 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
26879 ${PROG} commit: Rebuilding administrative file database"
26882 rm ${CVSROOT_DIRNAME}/CVSROOT/passwd ${CVSROOT_DIRNAME}/CVSROOT/writers
26883 fi # skip the whole thing for local
26887 # Some tests of the server (independent of the client).
26889 dotest server-1 "${testcvs} server" \
26890 "E Protocol error: Root request missing
26897 # Could also test for relative pathnames here (so that crerepos-6a
26898 # and crerepos-6b can use :fork:).
26899 dotest server-2 "${testcvs} server" "ok" <<EOF
26901 Set MYENV=env-value
26902 init ${TESTDIR}/crerepos
26904 dotest server-3 "test -d ${TESTDIR}/crerepos/CVSROOT" ""
26906 # Now some tests of gzip-file-contents (used by jCVS).
26908 printf "%c%c%c%c%c%c.6%c%c+I-.%c%c%c%c5%c;%c%c%c%c", \
26909 31, 139, 8, 64, 5, 7, 64, 3, 225, 2, 64, 198, 185, 5, 64, 64, 64}' \
26910 </dev/null | ${TR} '\100' '\000' >gzipped.dat
26911 # Note that the CVS client sends "-b 1.1.1", and this
26912 # test doesn't. But the server also defaults to that.
26913 cat <<EOF >session.dat
26914 Root ${TESTDIR}/crerepos
26916 gzip-file-contents 3
26924 ${TESTDIR}/crerepos
26929 cat gzipped.dat >>session.dat
26930 echo import >>session.dat
26931 dotest server-4 "${testcvs} server" \
26934 M No conflicts created by this import
26938 "${testcvs} -q -d ${TESTDIR}/crerepos co -p dir1/file1" "test"
26940 # OK, here are some notify tests.
26941 dotest server-6 "${testcvs} server" \
26943 ${TESTDIR}/crerepos/dir1/file1
26945 Root ${TESTDIR}/crerepos
26947 ${TESTDIR}/crerepos/dir1
26949 E Fri May 7 13:21:09 1999 GMT myhost some-work-dir EUC
26952 # Sending the second "noop" before waiting for the output
26953 # from the first is bogus but hopefully we can get away
26955 dotest server-7 "${testcvs} server" \
26957 ${TESTDIR}/crerepos/dir1/file1
26960 ${TESTDIR}/crerepos/dir1/file1
26962 Root ${TESTDIR}/crerepos
26964 ${TESTDIR}/crerepos/dir1
26966 E Fri May 7 13:21:09 1999 GMT myhost some-work-dir EUC
26969 E The 57th day of Discord in the YOLD 3165 myhost some-work-dir EUC
26973 # OK, now test a few error conditions.
26974 # FIXCVS: should give "error" and no "Notified", like server-9
26975 dotest server-8 "${testcvs} server" \
26976 "E ${PROG} server: invalid character in editor value
26978 ${TESTDIR}/crerepos/dir1/file1
26980 Root ${TESTDIR}/crerepos
26982 ${TESTDIR}/crerepos/dir1
26984 E Setting Orange, the 52th day of Discord in the YOLD 3165 myhost some-work-dir EUC
26988 dotest server-9 "${testcvs} server" \
26989 "E Protocol error; misformed Notify request
26991 Root ${TESTDIR}/crerepos
26993 ${TESTDIR}/crerepos/dir1
26995 E Setting Orange+57th day of Discord myhost some-work-dir EUC
26999 # First demonstrate an interesting quirk in the protocol.
27000 # The "watchers" request selects the files to operate based
27001 # on files which exist in the working directory. So if we
27002 # don't send "Entry" or the like, it won't do anything.
27003 # Wants to be documented in cvsclient.texi...
27004 dotest server-10 "${testcvs} server" "ok" <<EOF
27005 Root ${TESTDIR}/crerepos
27007 ${TESTDIR}/crerepos/dir1
27010 # See if "watchers" and "editors" display the right thing.
27011 dotest server-11 "${testcvs} server" \
27012 "M file1 ${username} tedit tunedit tcommit
27014 Root ${TESTDIR}/crerepos
27016 ${TESTDIR}/crerepos/dir1
27017 Entry /file1/1.1////
27020 dotest server-12 "${testcvs} server" \
27021 "M file1 ${username} The 57th day of Discord in the YOLD 3165 myhost some-work-dir
27023 Root ${TESTDIR}/crerepos
27025 ${TESTDIR}/crerepos/dir1
27026 Entry /file1/1.1////
27030 # Now do an unedit.
27031 dotest server-13 "${testcvs} server" \
27033 ${TESTDIR}/crerepos/dir1/file1
27035 Root ${TESTDIR}/crerepos
27037 ${TESTDIR}/crerepos/dir1
27039 U 7 May 1999 15:00 GMT myhost some-work-dir EUC
27043 # Now try "watchers" and "editors" again.
27044 dotest server-14 "${testcvs} server" "ok" <<EOF
27045 Root ${TESTDIR}/crerepos
27047 ${TESTDIR}/crerepos/dir1
27050 dotest server-15 "${testcvs} server" "ok" <<EOF
27051 Root ${TESTDIR}/crerepos
27053 ${TESTDIR}/crerepos/dir1
27057 # Test that the global `-l' option is ignored nonfatally.
27058 dotest server-16 "${testcvs} server" \
27059 "E cvs server: WARNING: global \`-l' option ignored\.
27065 # There used to be some exploits based on malformed Entry requests
27066 dotest server-17 "$testcvs server" \
27067 "E protocol error: Malformed Entry
27069 Root $TESTDIR/crerepos
27071 $TESTDIR/crerepos/dir1
27072 Entry X/file1/1.1////
27076 dotest server-18 "$testcvs server" \
27077 "E protocol error: Malformed Entry
27079 Root $TESTDIR/crerepos
27081 $TESTDIR/crerepos/dir1
27087 echo Keeping ${TESTDIR} and exiting due to --keep
27091 rm -rf ${TESTDIR}/crerepos
27092 rm gzipped.dat session.dat
27093 fi # skip the whole thing for local
27097 # More server tests, in particular testing that various
27098 # possible security holes are plugged.
27100 dotest server2-1 "${testcvs} server" \
27101 "E protocol error: directory '${CVSROOT_DIRNAME}/\.\./dir1' not within root '${CVSROOT_DIRNAME}'
27103 Root ${CVSROOT_DIRNAME}
27105 ${CVSROOT_DIRNAME}/../dir1
27109 dotest server2-2 "${testcvs} server" \
27110 "E protocol error: directory '${CVSROOT_DIRNAME}dir1' not within root '${CVSROOT_DIRNAME}'
27112 Root ${CVSROOT_DIRNAME}
27114 ${CVSROOT_DIRNAME}dir1
27118 dotest 2-3 "${testcvs} server" \
27119 "E protocol error: directory '${TESTDIR}' not within root '${CVSROOT_DIRNAME}'
27121 Root ${CVSROOT_DIRNAME}
27127 # OK, now a few tests for the rule that one cannot pass a
27128 # filename containing a slash to Modified, Is-modified,
27129 # Notify, Questionable, or Unchanged. For completeness
27130 # we'd try them all. For lazyness/conciseness we don't.
27131 dotest server2-4 "${testcvs} server" \
27132 "E protocol error: directory 'foo/bar' not within current directory
27134 Root ${CVSROOT_DIRNAME}
27144 # Some tests of the client (independent of the server).
27146 cat >${TESTDIR}/serveme <<EOF
27148 # This is admittedly a bit cheezy, in the sense that we make lots
27149 # of assumptions about what the client is going to send us.
27150 # We don't mention Repository, because current clients don't require it.
27151 # Sending these at our own pace, rather than waiting for the client to
27152 # make the requests, is bogus, but hopefully we can get away with it.
27153 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27155 echo "M special message"
27156 echo "Created first-dir/"
27157 echo "${CVSROOT_DIRNAME}/first-dir/file1"
27158 echo "/file1/1.1///"
27159 echo "u=rw,g=rw,o=rw"
27165 # Cygwin. Pthffffffffft!
27166 if test -n "$remotehost"; then
27167 $CVS_RSH $remotehost "chmod +x ${TESTDIR}/serveme"
27169 chmod +x ${TESTDIR}/serveme
27171 save_CVS_SERVER=$CVS_SERVER
27172 CVS_SERVER=${TESTDIR}/serveme; export CVS_SERVER
27174 dotest_fail client-1 "${testcvs} -q co first-dir" \
27175 "${PROG} \[checkout aborted\]: This server does not support the global -q option${DOTSTAR}"
27176 dotest client-2 "${testcvs} co first-dir" "special message"
27178 cat >${TESTDIR}/serveme <<EOF
27180 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27183 echo "Copy-file ./"
27184 echo "${CVSROOT_DIRNAME}/first-dir/file1"
27185 echo "${TESTDIR}/bogus/.#file1.1.1"
27187 echo "${CVSROOT_DIRNAME}/first-dir/file1"
27188 echo "/file1/1.2///"
27189 echo "u=rw,g=rw,o=rw"
27196 mkdir ${TESTDIR}/bogus
27197 # The ${DOTSTAR} is to match a potential "broken pipe" if the
27198 # client exits before the server script sends everything
27199 dotest_fail client-3 "${testcvs} update" "merge-it
27200 ${PROG} \[update aborted\]: protocol error: Copy-file tried to specify director${DOTSTAR}"
27201 cat >${TESTDIR}/serveme <<EOF
27203 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27206 echo "Copy-file ./"
27207 echo "${CVSROOT_DIRNAME}/first-dir/file1"
27210 echo "${CVSROOT_DIRNAME}/first-dir/file1"
27211 echo "/file1/1.2///"
27212 echo "u=rw,g=rw,o=rw"
27218 dotest client-4 "${testcvs} update" "merge-it"
27219 dotest client-5 "cat .#file1.1.1" "xyz"
27220 dotest client-6 "cat CVS/Entries" "/file1/1.2/[A-Za-z0-9 :]*//
27222 dotest client-7 "cat file1" "abc"
27224 cat >${TESTDIR}/serveme <<EOF
27226 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27228 echo "M OK, whatever"
27230 cat >${TESTDIR}/client.tmp
27232 chmod u=rw,go= file1
27233 # By specifying the time zone in local time, we don't
27234 # know exactly how that will translate to GMT.
27235 dotest client-8 "${testcvs} update -D 99-10-04" "OK, whatever"
27236 # String 2 below is Cygwin again - ptoooey.
27237 dotest client-9 "cat ${TESTDIR}/client.tmp" \
27238 "Root ${CVSROOT_DIRNAME}
27239 Valid-responses [-a-zA-Z ]*
27242 Argument [34] Oct 1999 [0-9][0-9]:00:00 -0000
27245 ${CVSROOT_DIRNAME}/first-dir
27246 Entry /file1/1\.2///
27252 "Root ${CVSROOT_DIRNAME}
27253 Valid-responses [-a-zA-Z ]*
27256 Argument [34] Oct 1999 [0-9][0-9]:00:00 -0000
27259 ${CVSROOT_DIRNAME}/first-dir
27260 Entry /file1/1\.2///
27267 # The following test tests what was a potential client update in
27268 # CVS versions 1.11.14 and CVS versions 1.12.6 and earlier. This
27269 # exploit would allow a trojan server to create arbitrary files,
27270 # anywhere the user had write permissions, even outside of the
27272 cat >$HOME/.bashrc <<EOF
27274 # This is where login scripts would usually be
27277 cat >$TESTDIR/serveme <<EOF
27279 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27281 echo "Rcs-diff $HOME/"
27282 echo "$HOME/.bashrc"
27283 echo "/.bashrc/73.50///"
27284 echo "u=rw,g=rw,o=rw"
27287 echo "echo 'gotcha!'"
27292 # If I don't run the following sleep between the above cat and
27293 # the following calls to dotest, sometimes the serveme file isn't
27294 # completely written yet by the time CVS tries to execute it,
27295 # causing the shell to intermittantly report syntax errors (usually
27296 # early EOF). There's probably a new race condition here, but this
27299 # Incidentally, I can reproduce this behavior with Linux 2.4.20 and
27300 # Bash 2.05 or Bash 2.05b.
27302 dotest_fail client-10 "$testcvs update" \
27303 "$PROG update: Server attempted to update a file via an invalid pathname:
27304 $PROG \[update aborted\]: \`$HOME/.bashrc'\."
27306 # A second try at a client exploit. This one never actually
27307 # failed in the past, but I thought it wouldn't hurt to add a test.
27308 cat >$TESTDIR/serveme <<EOF
27310 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27313 echo "$HOME/.bashrc"
27314 echo "/.bashrc/73.50///"
27315 echo "u=rw,g=rw,o=rw"
27318 echo "echo 'gotcha!'"
27323 dotest_fail client-11 "$testcvs update" \
27324 "$PROG \[update aborted\]: patch original file \./\.bashrc does not exist"
27326 # A third try at a client exploit. This one did used to fail like
27328 cat >$TESTDIR/serveme <<EOF
27330 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27332 echo "Rcs-diff ../../home/"
27333 echo "../../.bashrc"
27334 echo "/.bashrc/73.50///"
27335 echo "u=rw,g=rw,o=rw"
27338 echo "echo 'gotcha!'"
27343 dotest_fail client-12 "$testcvs update" \
27344 "$PROG update: Server attempted to update a file via an invalid pathname:
27345 $PROG \[update aborted\]: \`\.\./\.\./home/.bashrc'\."
27347 # Try the same exploit using the Created response.
27348 cat >$TESTDIR/serveme <<EOF
27350 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27352 echo "Created $HOME/"
27353 echo "$HOME/.bashrc"
27354 echo "/.bashrc/73.50///"
27355 echo "u=rw,g=rw,o=rw"
27358 echo "echo 'gotcha!'"
27363 dotest_fail client-13 "$testcvs update" \
27364 "$PROG update: Server attempted to update a file via an invalid pathname:
27365 $PROG \[update aborted\]: \`$HOME/.bashrc'\."
27367 # Now try using the Update-existing response
27368 cat >$TESTDIR/serveme <<EOF
27370 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27372 echo "Update-existing ../../home/"
27373 echo "../../home/.bashrc"
27374 echo "/.bashrc/73.50///"
27375 echo "u=rw,g=rw,o=rw"
27378 echo "echo 'gotcha!'"
27383 dotest_fail client-14 "$testcvs update" \
27384 "$PROG update: Server attempted to update a file via an invalid pathname:
27385 $PROG \[update aborted\]: \`\.\./\.\./home/.bashrc'\."
27387 # Try the same exploit using the Merged response.
27388 cat >$TESTDIR/serveme <<EOF
27390 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27392 echo "Merged $HOME/"
27393 echo "$HOME/.bashrc"
27394 echo "/.bashrc/73.50///"
27395 echo "u=rw,g=rw,o=rw"
27398 echo "echo 'gotcha!'"
27403 dotest_fail client-15 "$testcvs update" \
27404 "$PROG update: Server attempted to update a file via an invalid pathname:
27405 $PROG \[update aborted\]: \`$HOME/.bashrc'\."
27407 # Now try using the Updated response
27408 cat >$TESTDIR/serveme <<EOF
27410 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27412 echo "Updated ../../home/"
27413 echo "../../home/.bashrc"
27414 echo "/.bashrc/73.50///"
27415 echo "u=rw,g=rw,o=rw"
27418 echo "echo 'gotcha!'"
27423 dotest_fail client-16 "$testcvs update" \
27424 "$PROG update: Server attempted to update a file via an invalid pathname:
27425 $PROG \[update aborted\]: \`\.\./\.\./home/.bashrc'\."
27427 # Try the same exploit using the Copy-file response.
27428 # As far as I know, Copy-file was never exploitable either.
27429 cat >$TESTDIR/serveme <<EOF
27431 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
27435 echo "/innocuous/73.50///"
27436 echo "u=rw,g=rw,o=rw"
27439 echo "echo 'gotcha!'"
27442 echo "$HOME/innocuous"
27447 dotest_fail client-18 "$testcvs update" \
27448 "$PROG \[update aborted\]: protocol error: Copy-file tried to specify directory"
27450 # And verify that none of the exploits was successful.
27451 dotest client-19 "cat $HOME/.bashrc" \
27453 # This is where login scripts would usually be
27457 echo Keeping ${TESTDIR} and exiting due to --keep
27463 rmdir ${TESTDIR}/bogus
27464 rm $TESTDIR/serveme $HOME/.bashrc
27465 CVS_SERVER=${save_CVS_SERVER}; export CVS_SERVER
27466 fi # skip the whole thing for local
27470 # Check that a CVSROOT with a "." in the name will work.
27471 CVSROOT_save=${CVSROOT}
27472 CVSROOT_DIRNAME_save=${CVSROOT_DIRNAME}
27473 CVSROOT_DIRNAME=${TESTDIR}/cvs.root
27474 CVSROOT=`newroot ${CVSROOT_DIRNAME}`
27476 dotest dottedroot-init-1 "${testcvs} init" ""
27479 echo version1 >dir1/dir2/file1
27481 dotest dottedroot-1 "${testcvs} import -m '' module1 AUTHOR INITIAL" \
27482 "${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/module1/dir2
27483 N module1/dir2/file1
27485 No conflicts created by this import"
27488 # This is the test that used to cause an assertion failure
27489 # in recurse.c:do_recursion().
27490 dotest dottedroot-2 "${testcvs} co -rINITIAL module1" \
27491 "${PROG} [a-z]*: Updating module1
27492 ${PROG} [a-z]*: Updating module1/dir2
27493 U module1/dir2/file1"
27496 echo Keeping ${TESTDIR} and exiting due to --keep
27500 rm -rf ${CVSROOT_DIRNAME}
27502 CVSROOT_DIRNAME=${CVSROOT_DIRNAME_save}
27503 CVSROOT=${CVSROOT_save}
27507 # Test that the server defaults to the correct executable in :fork:
27508 # mode. See the note in the TODO at the end of this file about this.
27510 # This test and client should be left after all other references to
27511 # CVS_SERVER are removed from this script.
27513 # The client series of tests already tests that CVS_SERVER is
27514 # working, but that test might be better here.
27516 mkdir fork; cd fork
27517 save_CVS_SERVER=$CVS_SERVER
27519 # So looking through $PATH for cvs won't work...
27520 echo "echo junk" >cvs
27522 save_PATH=$PATH; PATH=.:$PATH
27523 dotest fork-1 "$testcvs -d:fork:$CVSROOT_DIRNAME version" \
27526 CVS_SERVER=${save_CVS_SERVER}; export CVS_SERVER
27527 unset save_CVS_SERVER
27528 PATH=$save_PATH; unset save_PATH
27532 echo Keeping ${TESTDIR} and exiting due to --keep
27538 commit-add-missing)
27539 # Make sure that a commit fails when a `cvs add'ed file has
27540 # been removed from the working directory.
27545 dotest commit-add-missing-1 \
27546 "$testcvs -Q import -m. $module X Y" ''
27549 # Check it out and tag it.
27550 dotest commit-add-missing-2 "$testcvs -Q co $module" ''
27552 dotest commit-add-missing-3 "$testcvs -Q tag -b B" ''
27554 dotest commit-add-missing-4 "$testcvs -Q add $file" ''
27556 dotest_fail commit-add-missing-5 "$testcvs -Q ci -m. $file" \
27557 "${PROG} commit: Up-to-date check failed for .$file'
27558 ${PROG} \[commit aborted\]: correct above errors first!"
27562 rm -rf ${CVSROOT_DIRNAME}/$module
27566 # Check that top-level commits work when CVS/Root
27567 # is overridden by cvs -d.
27569 mkdir -p 1/subdir; cd 1
27570 touch file1 subdir/file2
27571 dotest commit-d-1 "$testcvs -Q import -m. c-d-c X Y" ""
27572 dotest commit-d-2 "$testcvs -Q co c-d-c" ""
27574 echo change >>file1; echo another change >>subdir/file2
27575 # Changing working root, then override with -d
27576 echo nosuchhost:/cvs > CVS/Root
27577 dotest commit-d-3 "$testcvs -Q -d $CVSROOT commit -m." \
27578 "Checking in file1;
27579 ${CVSROOT_DIRNAME}/c-d-c/file1,v <-- file1
27580 new revision: 1.2; previous revision: 1.1
27582 Checking in subdir/file2;
27583 ${CVSROOT_DIRNAME}/c-d-c/subdir/file2,v <-- file2
27584 new revision: 1.2; previous revision: 1.1
27587 rm -rf 1 cvsroot/c-d-c
27591 echo $what is not the name of a test -- ignored
27595 # Sanity check sanity.sh. :)
27597 # Test our exit directory so that tests that exit in an incorrect directory
27598 # are noticed during single test runs.
27599 if test "x$TESTDIR" != "x`pwd`"; then
27600 fail "cleanup: PWD != TESTDIR (\``pwd`' != \`$TESTDIR')"
27603 # Test our temp directory for cvs-serv* directories and cvsXXXXXX temp
27604 # files. We would like to not leave any behind.
27605 if $remote && ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
27606 # A true value means ls found files/directories with these names.
27607 # Give the server some time to finish, then retry.
27609 if ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
27610 fail "Found cvs-serv* directories in $TMPDIR."
27613 if ls $TMPDIR/cvs?????? >/dev/null 2>&1; then
27614 # A true value means ls found files/directories with these names.
27615 fail "Found cvsXXXXXX temp files in $TMPDIR."
27618 done # The big loop
27620 echo "OK, all tests completed."
27623 # * Test `cvs update -d foo' (where foo does not exist).
27624 # * Test `cvs update foo bar' (where foo and bar are both from the
27625 # same directory in the repository). Suppose one is a branch--make
27626 # sure that both directories get updated with the respective correct
27628 # * `cvs update ../foo'. Also ../../foo ./../foo foo/../../bar /foo/bar
27629 # foo/.././../bar foo/../bar etc.
27630 # * Test all flags in modules file.
27631 # Test that ciprog gets run both on checkin in that directory, or a
27632 # higher-level checkin which recurses into it.
27633 # * Test operations on a directory that contains other directories but has
27634 # no files of its own.
27635 # * -t global option
27636 # * cvs rm followed by cvs add or vice versa (with no checkin in between).
27637 # * cvs rm twice (should be a nice error message).
27638 # * -P option to checkout--(a) refrains from checking out new empty dirs,
27639 # (b) prunes empty dirs already there.
27640 # * Test that cvs -d `hostname`:${TESTDIR}/non/existent co foo
27641 # gives an appropriate error (e.g.
27642 # Cannot access ${TESTDIR}/non-existent/CVSROOT
27643 # No such file or directory).
27644 # (like basica-9, but for remote).
27645 # * Test ability to send notifications in response to watches. (currently
27646 # hard to test because CVS doesn't send notifications if username is the
27648 # * Test the contents of adm files other than Root and Repository.
27649 # Entries seems the next most important thing.
27650 # * Test the following compatibility issues:
27651 # - The filler fields in "D" entries in CVS/Entries get preserved
27652 # (per cvs.texinfo).
27653 # - Unrecognized entry types in CVS/Entries get ignored (looks like
27654 # this needs to be documented in cvs.texinfo, but is not)
27655 # - Test that unrecognized files in CVS directories (e.g. CVS/Foobar)
27656 # are ignored (per cvs.texinfo).
27657 # - Test 'cvs history' with symlinks in the path to the working directory.
27658 # - Remove most of the CVS_SERVER stuff after a reasonable amount of time.
27659 # The "fork" & "client" series of tests should be left. 4/2/00, CVS
27660 # 1.11.0.1 was altered so that it would default to program_name (set from
27661 # argv[0]) rather than "cvs", but I'd like this script to work on legacy
27662 # versions of CVS for awhile.
27663 # - Testsuite doesn't work with usernames over eight characters in length.
27665 # End of TODO list.
27669 echo "Keeping ${TESTDIR} and exiting due to -k (keep) option."
27673 # Remove the test directory, but first change out of it.
27674 cd `dirname ${TESTDIR}`