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` [-eklrv] [-f FROM-TEST] [-h HOSTNAME] CVS-TO-TEST [TESTS-TO-RUN...]"
38 echo "-H|--help Display this text."
39 echo "-e|--skipfail Treat tests that would otherwise be nonfatally skipped"
40 echo " for reasons like missing tools as failures, exiting"
41 echo " with an error message. Also treat warnings as"
43 echo "-f FROM-TEST Run TESTS-TO-RUN, skipping all tests in the list before"
45 echo "-h HOSTNAME Use :ext:HOSTNAME to run remote tests rather than"
46 echo " :fork:. Implies --remote and assumes that \$TESTDIR"
47 echo " resolves to the same directory on both the client and"
49 echo "-k|--keep Try to keep directories created by individual tests"
50 echo " around, exiting after the first test which supports"
53 echo " Test CVS using a symlink to a real CVSROOT."
54 echo "-r|--remote Test remote instead of local cvs."
55 echo "-v|--verbose List test names as they are executed."
57 echo "CVS-TO-TEST The path to the CVS executable to be tested."
58 echo "TESTS-TO-RUN The names of the tests to run (defaults to all tests)."
62 # See TODO list at end of file.
64 # required to make this script work properly.
67 # This will cause malloc to run slower but should also catch some common errors
68 # when CVS is linked with glibc 2.x.
69 MALLOC_CHECK_=2; export MALLOC_CHECK_
71 # We want to invoke a predictable set of i18n behaviors, not whatever
72 # the user running this script might have set.
74 # 'sort' and tabs and spaces (LC_COLLATE).
75 # Messages from getopt (LC_MESSAGES) (in the future, CVS itself might
76 # also alter its messages based on LC_MESSAGES).
84 # Initialize the test counts.
102 while getopts ef:h:Hklrv-: option ; do
103 # convert the long opts to short opts
104 if test x$option = x-; then
106 [hH]|[hH][eE]|[hH][eE][lL]|[hH][eE][lL][pP])
110 [kK]|[kK][eE]|[kK][eE][eE]|[kK][eE][eE][pP])
114 l|li|lin|link|link-|link-r]|link-ro|link-roo|link-root)
118 [rR]|[rR][eE]|[rR][eE][mM]|[rR][eE][mM][oO]|[rR][eE][mM][oO][tT]|[rR][eE][mM][oO][tT][eE])
122 s|sk|ski|skip|skipf|skipfa|skipfai|skipfail)
126 v|ve|ver|verb|verbo|verbos|verbose)
143 # Set a remotehost to run the remote tests on via :ext:
144 # Implies `-r' and assumes that $TESTDIR resolves to the same
145 # directory on the client and the server.
153 # The -k (keep) option will eventually cause all the tests to
154 # leave around the contents of the /tmp directory; right now only
155 # some implement it. Not originally intended to be useful with
156 # more than one test, but this should work if each test uses a
157 # uniquely named dir (use the name of the test).
175 # boot the arguments we used above
176 while test $OPTIND -gt 1 ; do
178 OPTIND=`expr $OPTIND - 1`
181 # Use full path for CVS executable, so that CVS_SERVER gets set properly
196 # If $remotehost is set, warn if $TESTDIR isn't since we are pretty sure
197 # that its default value of `/tmp/cvs-sanity' will not resolve to the same
198 # directory on two different machines.
199 if test -n "$remotehost" && test -z "$TESTDIR"; then
200 echo "WARNING: CVS server hostname is set and \$TESTDIR is not. If" >&2
201 echo "$remotehost is not the local machine, then it is unlikely that" >&2
202 echo "the default value assigned to \$TESTDIR will resolve to the same" >&2
203 echo "directory on both this client and the CVS server." >&2
215 echo 'This test should produce no other output than this message, and a final "OK".'
216 echo '(Note that the test can take an hour or more to run and periodically stops'
217 echo 'for as long as one minute. Do not assume there is a problem just because'
218 echo 'nothing seems to happen for a long time. If you cannot live without'
219 echo 'running status, use the -v option or try the command:'
220 echo "\`tail -f check.log' from another window.)"
222 # Regexp to match what CVS will call itself in output that it prints.
223 # FIXME: we don't properly quote this--if the name contains . we'll
224 # just spuriously match a few things; if the name contains other regexp
225 # special characters we are probably in big trouble.
226 PROG=`basename ${testcvs}`
229 hostname="[-_.a-zA-Z0-9]*"
231 # Regexp to match the name of a temporary file (from cvs_temp_name).
232 # This appears in certain diff output.
233 tempname="[-a-zA-Z0-9/.%_]*"
235 # Regexp to match a date in RFC822 format (as amended by RFC1123).
236 RFCDATE="[a-zA-Z0-9 ][a-zA-Z0-9 ]* [0-9:][0-9:]* -0000"
237 RFCDATE_EPOCH="1 Jan 1970 00:00:00 -0000"
239 # Regexp to match a date in standard Unix format as used by rdiff
240 # FIXCVS: There's no reason for rdiff to use a different date format
242 DATE="[a-zA-Z]* [a-zA-Z]* [ 1-3][0-9] [0-9:]* [0-9]*"
244 # Which directories should Which and find_tool search for executables?
245 SEARCHPATH=$PATH:/usr/local/bin:/usr/contrib/bin:/usr/contrib:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin:/sw/bin:/usr/pkg/bin
247 # Do not assume that `type -p cmd` is portable
248 # Usage: Which [-a] [-x|-f|-r] prog [$SEARCHPATH:/with/directories:/to/search]
250 # Optional first argument for file type, defaults to -x.
251 # Second argument is the file or directory to be found.
252 # Third argument is the PATH to search.
253 # By default, print only the first file that matches,
254 # -a will cause all matches to be printed.
256 if [ "x$1" = "x-a" ]; then notevery=false; shift; fi
262 # FIXME: Someday this may need to be fixed
263 # to deal better with C:\some\path\to\ssh values...
264 /*) test $t $1 && echo $1 ;;
265 *) for d in `IFS=:; echo ${2-$SEARCHPATH}`
267 test $t $d/$1 && { echo $d/$1; if $notevery; then break; fi; }
274 # On cygwin32, we may not have /bin/sh.
275 if test -r /bin/sh; then
278 TESTSHELL=`Which -f sh`
279 if test ! -r "$TESTSHELL"; then
284 # FIXME: try things (what things? checkins?) without -m.
286 # Some of these tests are written to expect -Q. But testing with
287 # -Q is kind of bogus, it is not the way users actually use CVS (usually).
288 # So new tests probably should invoke ${testcvs} directly, rather than ${CVS}.
289 # and then they've obviously got to do something with the output....
293 LOGFILE=`pwd`/check.log
295 # Save the previous log in case the person running the tests decides
296 # they want to look at it. The extension ".plog" is chosen for consistency
298 if test -f check.log; then
299 mv check.log check.plog
302 # Create the log file so check.log can be tailed almost immediately after
303 # this script is started. Otherwise it can take up to a minute or two before
304 # the log file gets created when $remotehost is specified on some systems,
305 # which makes for a lot of failed `tail -f' attempts.
308 # Workaround any X11Forwarding by ssh. Otherwise this text:
309 # Warning: No xauth data; using fake authentication data for X11 forwarding.
310 # has been known to end up in the test results below
311 # causing the test to fail.
312 [ -n "$DISPLAY" ] && unset DISPLAY
314 # The default value of /tmp/cvs-sanity for TESTDIR is dubious,
315 # because it loses if two people/scripts try to run the tests
316 # at the same time. Some possible solutions:
317 # 1. Use /tmp/cvs-test$$. One disadvantage is that the old
318 # cvs-test* directories would pile up, because they wouldn't
319 # necessarily get removed.
320 # 2. Have everyone/everything running the testsuite set
321 # TESTDIR to some appropriate directory.
322 # 3. Have the default value of TESTDIR be some variation of
323 # `pwd`/cvs-sanity. The biggest problem here is that we have
324 # been fairly careful to test that CVS prints in messages the
325 # actual pathnames that we pass to it, rather than a different
326 # pathname for the same directory, as may come out of `pwd`.
327 # So this would be lost if everything was `pwd`-based. I suppose
328 # if we wanted to get baroque we could start making symlinks
329 # to ensure the two are different.
330 : ${CVS_RSH=rsh}; export CVS_RSH
331 if test -n "$remotehost"; then
332 # We need to set $tmp on the server since $TMPDIR is compared against
333 # messages generated by the server.
334 tmp=`$CVS_RSH $remotehost 'cd /tmp; /bin/pwd || pwd' 2>/dev/null`
335 if test $? != 0; then
336 echo "$CVS_RSH $remotehost failed." >&2
340 tmp=`(cd /tmp; /bin/pwd || pwd) 2>/dev/null`
344 # 1) Set TESTDIR if it's not set already
345 # 2) Remove any old test remnants
347 # 4) Normalize TESTDIR with `cd && (/bin/pwd || pwd)`
348 # (This will match CVS output later)
349 : ${TESTDIR=$tmp/cvs-sanity}
350 # clean any old remnants (we need the chmod because some tests make
351 # directories read-only)
352 if test -d ${TESTDIR}; then
353 chmod -R a+wx ${TESTDIR}
356 # These exits are important. The first time I tried this, if the `mkdir && cd`
357 # failed then the build directory would get blown away. Some people probably
358 # wouldn't appreciate that.
359 mkdir ${TESTDIR} || exit 1
360 cd ${TESTDIR} || exit 1
361 # Ensure $TESTDIR is absolute
362 if echo "${TESTDIR}" |grep '^[^/]'; then
363 # Don't resolve this unless we have to. This keeps symlinks intact. This
364 # is important at least when testing using -h $remotehost, because the same
365 # value for $TESTDIR must resolve to the same directory on the client and
366 # the server and we likely used Samba, and possibly symlinks, to do this.
367 TESTDIR=`(/bin/pwd || pwd) 2>/dev/null`
370 if test -z "${TESTDIR}" || echo "${TESTDIR}" |grep '^[^/]'; then
371 echo "Unable to resolve TESTDIR to an absolute directory." >&2
376 # Now set $TMPDIR if the user hasn't overridden it.
378 # We use a $TMPDIR under $TESTDIR by default so that two tests may be run at
379 # the same time without bumping heads without requiring the user to specify
380 # more than $TESTDIR. See the test for leftover cvs-serv* directories near the
381 # end of this script at the end of "The big loop".
382 : ${TMPDIR=$TESTDIR/tmp}
384 if test -d $TMPDIR; then :; else
388 # Make sure various tools work the way we expect, or try to find
395 # Keep track of tools that are found, but do NOT work as we hope
396 # in order to avoid them in future
400 badtools=$badtools:$1
404 case ":$badtools:" in *:$1:*) return 0 ;; *) return 1 ; esac
411 if RES=`$vercmd --version </dev/null 2>&1`; then
412 if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
418 echo "The command \`$vercmd' does not support the --version option."
420 # It does not really matter that --version is not supported
424 # Try to find a tool that satisfies all of the tests.
425 # Usage: list:of:colon:separated:alternatives test1 test2 test3 test4...
426 # Example: find_tool awk:gawk:nawk awk_tooltest1 awk_tooltest2
430 echo find_tool: ${1+"$@"} >>$LOGFILE
431 cmds="`IFS=:; echo $1`"; shift; tooltests="${1+$@}"
432 if test -z "$tooltests"; then tooltests=version_test; fi
433 clist=; for cmd in $cmds; do clist="$clist `Which -a $cmd`"; done
434 # Make sure the default tool is just the first real command name
435 for default_TOOL in $clist `IFS=:; echo $default_TOOL`; do break; done
437 for trytool in $clist ; do
439 for tooltest in $tooltests; do
440 result=`eval $tooltest $trytool`
442 echo "Running $tooltest $trytool" >>$LOGFILE
443 if test -n "$result"; then
444 echo "$result" >>$LOGFILE
446 if test "$rc" = "0"; then
447 echo "PASS: $tooltest $trytool" >>$LOGFILE
448 elif test "$rc" = "77"; then
449 echo "MARGINAL: $tooltest $trytool; rc=$rc" >>$LOGFILE
453 set_bad_tool $trytool
454 echo "FAIL: $tooltest $trytool; rc=$rc" >>$LOGFILE
463 if test -n "$TOOL"; then
464 echo "Notice: The default version of \`$default_TOOL' is defective." >>$LOGFILE
465 echo "using \`$TOOL' and hoping for the best." >>$LOGFILE
466 echo "Notice: The default version of \`$default_TOOL' is defective." >&2
467 echo "using \`$TOOL' and hoping for the best." >&2
477 if $id -u >/dev/null 2>&1 && $id -un >/dev/null 2>&1; then
480 echo "Running these tests requires an \`id' program that understands the"
481 echo "-u and -n flags. Make sure that such an id (GNU, or many but not"
482 echo "all vendor-supplied versions) is in your path."
487 ID=`find_tool id version_test id_tool_test`
488 echo "Using ID=$ID" >>$LOGFILE
490 # You can't run CVS as root; print a nice error message here instead
491 # of somewhere later, after making a mess.
492 for pass in false :; do
493 case "`$ID -u 2>/dev/null`" in
495 echo "Test suite does not work correctly when run as root" >&2
505 # Cause NextStep 3.3 users to lose in a more graceful fashion.
511 def' >/dev/null; then
515 echo 'Running these tests requires an "expr" program that can handle'
516 echo 'multi-line patterns. Make sure that such an expr (GNU, or many but'
517 echo 'not all vendor-supplied versions) is in your path.'
522 # Warn SunOS, SysVr3.2, etc., users that they may be partially losing
523 # if we can't find a GNU expr to ease their troubles...
530 echo 'WARNING: you are using a version of expr that does not correctly'
531 echo 'match multi-line patterns. Some tests may spuriously pass or fail.'
532 echo 'You may wish to make sure GNU expr is in your path.'
541 echo 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >${TESTDIR}/foo
542 cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
543 cat ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar >${TESTDIR}/foo
544 cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
551 # More SunOS lossage...
552 test ! -f ${TESTDIR}/bar && expr_create_bar
553 if $expr "`cat ${TESTDIR}/bar`" : "`cat ${TESTDIR}/bar`" >/dev/null; then
556 echo 'WARNING: you are using a version of expr that does not correctly'
557 echo 'match large patterns. Some tests may spuriously pass or fail.'
558 echo 'You may wish to make sure GNU expr is in your path.'
561 if $expr "`cat ${TESTDIR}/bar`x" : "`cat ${TESTDIR}/bar`y" >/dev/null; then
562 echo 'WARNING: you are using a version of expr that does not correctly'
563 echo 'match large patterns. Some tests may spuriously pass or fail.'
564 echo 'You may wish to make sure GNU expr is in your path.'
571 # That we should have to do this is total bogosity, but GNU expr
572 # version 1.9.4-1.12 uses the emacs definition of "$" instead of the unix
573 # (e.g. SunOS 4.1.3 expr) one. Rumor has it this will be fixed in the
574 # next release of GNU expr after 1.12 (but we still have to cater to the old
575 # ones for some time because they are in many linux distributions).
577 expr_set_ENDANCHOR ()
582 def' : 'abc$' >/dev/null; then
584 echo "Notice: An ENDANCHOR of dollar does not work."
585 echo "Using a workaround for GNU expr versions 1.9.4 thru 1.12"
590 # Work around another GNU expr (version 1.10-1.12) bug/incompatibility.
591 # "." doesn't appear to match a newline (it does with SunOS 4.1.3 expr).
592 # Note that the workaround is not a complete equivalent of .* because
593 # the first parenthesized expression in the regexp must match something
594 # in order for expr to return a successful exit status.
595 # Rumor has it this will be fixed in the
596 # next release of GNU expr after 1.12 (but we still have to cater to the old
597 # ones for some time because they are in many linux distributions).
604 def' : "a${DOTSTAR}f" >/dev/null; then
609 echo "Notice: DOTSTAR changed from sane \`.*' value to \`$DOTSTAR\`"
610 echo "to workaround GNU expr version 1.10 thru 1.12 bug where \`.'"
611 echo "does not match a newline."
616 # Now that we have DOTSTAR, make sure it works with big matches
617 expr_tooltest_DOTSTAR ()
620 test ! -f ${TESTDIR}/bar && expr_create_bar
621 if $expr "`cat ${TESTDIR}/bar`" : "${DOTSTAR}xyzABC${DOTSTAR}$" >/dev/null; then
625 echo 'WARNING: you are using a version of expr that does not correctly'
626 echo 'match large patterns. Some tests may spuriously pass or fail.'
627 echo 'You may wish to make sure GNU expr is in your path.'
632 # FreeBSD 5.2 and 6.1 support 'expr [-e] expression'
633 # They get confused unless '--' is used before the expressions
634 # when those expressions begin with a '-' character, such as the
635 # output of an ls -l command. The EXPR_COMPAT environment variable may
636 # be used to go back to the non-POSIX behavior as an alternative.
637 # (GNU expr appears to accept the '--' argument and work correctly or
638 # not have it and still get the results we want.)
644 # Not POSIX, but works on a lot of expr versions.
645 if $expr "-rw-rw-r--" : "-rw-rw-r--" >/dev/null 2>&1; then
649 # Do things in the POSIX manner.
650 if $expr -- "-rw-rw-r--" : "-rw-rw-r--" >/dev/null 2>&1; then
654 echo 'WARNING: Your $expr does not correctly handle'
655 echo 'leading "-" characters in regular expressions to'
656 echo 'be matched. You may wish to see if there is an'
657 echo 'environment variable or other setting to allow'
658 echo 'POSIX functionality to be enabled.'
665 EXPR=`find_tool ${EXPR}:gexpr \
666 version_test expr_tooltest1 expr_tooltest2 expr_tooltest3 \
667 expr_set_ENDANCHOR expr_set_DOTSTAR expr_tooltest_DOTSTAR`
669 # Set the ENDANCHOR and DOTSTAR for the chosen expr version.
670 expr_set_ENDANCHOR ${EXPR} >/dev/null
671 expr_tooltest_DOTSTAR ${EXPR} >/dev/null
673 # Is $EXPR a POSIX or non-POSIX implementation
674 # with regard to command-line arguments?
675 expr_set_DASHDASH ${EXPR}
676 $exprDASHDASH && EXPR="$EXPR --"
678 echo "Using EXPR=$EXPR" >>$LOGFILE
679 echo "Using ENDANCHOR=$ENDANCHOR" >>$LOGFILE
680 echo "Using DOTSTAR=$DOTSTAR" >>$LOGFILE
685 # Work around yet another GNU expr (version 1.10) bug/incompatibility.
686 # "+" is a special character, yet for unix expr (e.g. SunOS 4.1.3)
687 # it is not. I doubt that POSIX allows us to use \+ and assume it means
688 # (non-special) +, so here is another workaround
689 # Rumor has it this will be fixed in the
690 # next release of GNU expr after 1.12 (but we still have to cater to the old
691 # ones for some time because they are in many linux distributions).
693 if $EXPR 'a +b' : "a ${PLUS}b" >/dev/null; then
701 if $EXPR 'a?b' : "a${QUESTION}b" >/dev/null; then
707 # Now test the username to make sure it contains only valid characters
709 if $EXPR "${username}" : "${username}" >/dev/null; then
712 echo "Test suite does not work correctly when run by a username" >&2
713 echo "containing regular expression meta-characters." >&2
717 # Only 8 characters of $username appear in some output.
718 if test `echo $username |wc -c` -gt 8; then
719 username8=`echo $username |sed 's/^\(........\).*/\1/'`
724 # Rarely, we need to match any username, not just the name of the user
727 # I'm not really sure what characters should be here. a-zA-Z obviously.
728 # People complained when 0-9 were not allowed in usernames. Other than that
730 anyusername="[-a-zA-Z0-9][-a-zA-Z0-9]*"
732 # now make sure that tr works on NULs
736 if $EXPR `echo "123" | $tr '2' '\0'` : "123" >/dev/null 2>&1; then
737 echo 'Warning: you are using a version of tr which does not correctly'
738 echo 'handle NUL bytes. Some tests may spuriously pass or fail.'
739 echo 'You may wish to make sure GNU tr is in your path.'
746 TR=`find_tool ${TR}:gtr version_test tr_tooltest1`
747 echo "Using TR=$TR" >>$LOGFILE
754 $awk 'BEGIN {printf("one\ntwo\nthree\nfour\nfive\nsix")}' </dev/null >abc
755 if $EXPR "`cat abc`" : \
766 echo "Notice: awk BEGIN clause or printf is not be working properly."
771 # Format item %c check
775 $awk 'BEGIN { printf "%c%c%c", 2, 3, 4 }' </dev/null \
776 | ${TR} '\002\003\004' '123' >abc
777 if $EXPR "`cat abc`" : "123" ; then
780 echo "Notice: awk format %c string may not be working properly."
788 AWK=`find_tool gawk:nawk:awk version_test awk_tooltest1 awk_tooltest2`
789 echo "Using AWK=$AWK" >>$LOGFILE
791 # Test that $1 works as a remote shell. If so, set $host, $CVS_RSH, &
792 # $save_CVS_RSH to match and return 0. Otherwise, set $skipreason and return
796 host=${remotehost-"`hostname`"}
797 result=`$1 $host 'echo test'`
799 if test $? != 0 || test "x$result" != "xtest"; then
800 skipreason="\`$1 $host' failed rc=$rc result=$result"
804 save_CVS_RSH=$CVS_RSH
805 CVS_RSH=$1; export CVS_RSH
809 # Find a usable SSH. When a usable ssh is found, set $host, $CVS_RSH, and
810 # $save_CVS_RSH and return 0. Otherwise, set $skipreason and return 77.
815 tryssh=`Which $CVS_RSH`
816 if [ ! -n "$tryssh" ]; then
817 skipreason="Unable to find CVS_RSH=$CVS_RSH executable"
819 elif [ ! -x "$tryssh" ]; then
820 skipreason="Unable to execute $tryssh program"
825 # Look in the user's PATH for "ssh"
827 if test ! -r "$tryssh"; then
828 skipreason="Unable to find ssh program"
834 depends_on_rsh "$tryssh"
840 echo "PASS: $1" >>${LOGFILE}
841 passed=`expr $passed + 1`
844 # Like skip(), but don't fail when $skipfail is set.
847 echo "SKIP: $1${2+ ($2)}" >>$LOGFILE
848 skipped=`expr $skipped + 1`
856 echo "SKIP: $1${2+ ($2)}" >>$LOGFILE
858 skipped=`expr $skipped + 1`
866 echo "WARNING: $1${2+ ($2)}" >>$LOGFILE
868 warnings=`expr $warnings + 1`
871 # Convenience function for skipping tests run only in local mode.
874 skip_always $1 "only tested in local mode"
879 echo "FAIL: $1" | tee -a ${LOGFILE}
880 echo "*** Please see the \`TESTS' and \`check.log' files for more information." >&2
881 # This way the tester can go and see what remnants were left
887 # Test our temp directory for cvs-serv* directories and cvsXXXXXX temp
888 # files. We would like to not leave any behind.
889 if $remote && ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
890 # A true value means ls found files/directories with these names.
891 # Give the server some time to finish, then retry.
893 if ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
894 warn "$1" "Found cvs-serv* directories in $TMPDIR."
895 # The above will exit if $skipfail
896 rm -rf $TMPDIR/cvs-serv*
899 if ls $TMPDIR/cvs?????? >/dev/null 2>&1; then
900 # A true value means ls found files/directories with these names.
901 warn "$1" "Found cvsXXXXXX temp files in $TMPDIR."
902 # The above will exit if $skipfail
903 rm -f ls $TMPDIR/cvs??????
907 # Restore changes to CVSROOT admin files.
910 rm -rf $CVSROOT_DIRNAME/CVSROOT
911 cp -Rp $TESTDIR/CVSROOT.save $CVSROOT_DIRNAME/CVSROOT
914 # See dotest and dotest_fail for explanation (this is the parts
915 # of the implementation common to the two).
918 if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$3${ENDANCHOR}" >/dev/null; then
919 # Why, I hear you ask, do we write this to the logfile
920 # even when the test passes? The reason is that the test
921 # may give us the regexp which we were supposed to match,
922 # but sometimes it may be useful to look at the exact
923 # text which was output. For example, suppose one wants
924 # to grep for a particular warning, and make _sure_ that
925 # CVS never hits it (even in cases where the tests might
926 # match it with .*). Or suppose one wants to see the exact
927 # date format output in a certain case (where the test will
928 # surely use a somewhat non-specific pattern).
929 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
931 verify_tmp_empty "$1"
932 # expr can't distinguish between "zero characters matched" and "no match",
933 # so special-case it.
934 elif test -z "$3" && test ! -s ${TESTDIR}/dotest.tmp; then
936 verify_tmp_empty "$1"
937 elif test x"$4" != x; then
938 if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$4${ENDANCHOR}" >/dev/null; then
939 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
941 verify_tmp_empty "$1"
943 echo "** expected: " >>${LOGFILE}
944 echo "$3" >>${LOGFILE}
945 echo "$3" > ${TESTDIR}/dotest.ex1
946 echo "** or: " >>${LOGFILE}
947 echo "$4" >>${LOGFILE}
948 echo "$4" > ${TESTDIR}/dotest.ex2
949 echo "** got: " >>${LOGFILE}
950 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
954 echo "** expected: " >>${LOGFILE}
955 echo "$3" >>${LOGFILE}
956 echo "$3" > ${TESTDIR}/dotest.exp
957 echo "** got: " >>${LOGFILE}
958 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
965 if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : \
966 "`cat ${TESTDIR}/dotest.exp`" >/dev/null; then
972 # WARNING: this won't work with REs that match newlines....
974 dotest_line_by_line ()
977 while [ $line -le `wc -l <${TESTDIR}/dotest.tmp` ] ; do
978 if $EXPR "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" : \
979 "`sed -n ${line}p ${TESTDIR}/dotest.exp`" >/dev/null; then
981 elif test -z "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" &&
982 test -z "`sed -n ${line}p ${TESTDIR}/dotest.exp`"; then
985 echo "Line $line:" >> ${LOGFILE}
986 echo "**** expected: " >>${LOGFILE}
987 sed -n ${line}p ${TESTDIR}/dotest.exp >>${LOGFILE}
988 echo "**** got: " >>${LOGFILE}
989 sed -n ${line}p ${TESTDIR}/dotest.tmp >>${LOGFILE}
993 line=`expr $line + 1`
999 # If you are having trouble telling which line of a multi-line
1000 # expression is not being matched, replace calls to dotest_internal()
1001 # with calls to this function:
1003 dotest_internal_debug ()
1005 if test -z "$3"; then
1006 if test -s ${TESTDIR}/dotest.tmp; then
1007 echo "** expected: " >>${LOGFILE}
1008 echo "$3" >>${LOGFILE}
1009 echo "$3" > ${TESTDIR}/dotest.exp
1010 rm -f ${TESTDIR}/dotest.ex2
1011 echo "** got: " >>${LOGFILE}
1012 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1016 verify_tmp_empty "$1"
1019 echo "$3" > ${TESTDIR}/dotest.exp
1020 if dotest_line_by_line "$1" "$2"; then
1022 verify_tmp_empty "$1"
1024 if test x"$4" != x; then
1025 mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex1
1026 echo "$4" > ${TESTDIR}/dotest.exp
1027 if dotest_line_by_line "$1" "$2"; then
1029 verify_tmp_empty "$1"
1031 mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex2
1032 echo "** expected: " >>${LOGFILE}
1033 echo "$3" >>${LOGFILE}
1034 echo "** or: " >>${LOGFILE}
1035 echo "$4" >>${LOGFILE}
1036 echo "** got: " >>${LOGFILE}
1037 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1041 echo "** expected: " >>${LOGFILE}
1042 echo "$3" >>${LOGFILE}
1043 echo "** got: " >>${LOGFILE}
1044 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1052 # dotest TESTNAME COMMAND OUTPUT [OUTPUT2]
1053 # TESTNAME is the name used in the log to identify the test.
1054 # COMMAND is the command to run; for the test to pass, it exits with
1056 # OUTPUT is a regexp which is compared against the output (stdout and
1057 # stderr combined) from the test. It is anchored to the start and end
1058 # of the output, so should start or end with ".*" if that is what is desired.
1059 # Trailing newlines are stripped from the command's actual output before
1060 # matching against OUTPUT.
1061 # If OUTPUT2 is specified and the output matches it, then it is also
1062 # a pass (partial workaround for the fact that some versions of expr
1066 rm -f ${TESTDIR}/dotest.ex? 2>&1
1067 eval "$2" >${TESTDIR}/dotest.tmp 2>&1
1069 if test "$status" != 0; then
1070 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1071 echo "exit status was $status" >>${LOGFILE}
1074 dotest_internal "$@"
1077 # Like dotest except only 2 args and result must exactly match stdin
1080 rm -f ${TESTDIR}/dotest.ex? 2>&1
1081 eval "$2" >${TESTDIR}/dotest.tmp 2>&1
1083 if test "$status" != 0; then
1084 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1085 echo "exit status was $status" >>${LOGFILE}
1088 cat >${TESTDIR}/dotest.exp
1089 if cmp ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.tmp >/dev/null 2>&1; then
1091 verify_tmp_empty "$1"
1093 echo "** expected: " >>${LOGFILE}
1094 cat ${TESTDIR}/dotest.exp >>${LOGFILE}
1095 echo "** got: " >>${LOGFILE}
1096 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1101 # Like dotest except exitstatus should be nonzero.
1104 rm -f ${TESTDIR}/dotest.ex? 2>&1
1105 eval "$2" >${TESTDIR}/dotest.tmp 2>&1
1107 if test "$status" = 0; then
1108 cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1109 echo "exit status was $status" >>${LOGFILE}
1112 dotest_internal "$@"
1115 # Like dotest except output is sorted.
1118 rm -f ${TESTDIR}/dotest.ex? 2>&1
1119 eval "$2" >${TESTDIR}/dotest.tmp1 2>&1
1121 if test "$status" != 0; then
1122 cat ${TESTDIR}/dotest.tmp1 >>${LOGFILE}
1123 echo "exit status was $status" >>${LOGFILE}
1126 ${TR} ' ' ' ' < ${TESTDIR}/dotest.tmp1 | sort > ${TESTDIR}/dotest.tmp
1127 dotest_internal "$@"
1130 # A function for fetching the timestamp of a revison of a file
1132 ${testcvs} -n rlog -N ${1+"$@"} |
1133 while read token value; do
1136 echo $value | sed "s,;.*,,"
1143 # Avoid picking up any stray .cvsrc, etc., from the user running the tests
1145 HOME=${TESTDIR}/home; export HOME
1147 # Make sure this variable is not defined to anything that would
1148 # change the format of rcs dates. Otherwise people using e.g.,
1149 # RCSINIT=-zLT get lots of spurious failures.
1150 RCSINIT=; export RCSINIT
1152 # Remaining arguments are the names of tests to run.
1154 # The testsuite is broken up into (hopefully manageably-sized)
1155 # independently runnable tests, so that one can quickly get a result
1156 # from a cvs or testsuite change, and to facilitate understanding the
1159 if test x"$*" = x; then
1160 # Basic/miscellaneous functionality
1161 tests="version basica basicb basicc basic1 deep basic2"
1162 tests="${tests} parseroot parseroot2 files spacefiles commit-readonly"
1163 tests="${tests} commit-add-missing"
1164 tests="$tests add-restricted"
1165 tests="${tests} status"
1166 # Branching, tagging, removing, adding, multiple directories
1167 tests="${tests} rdiff rdiff-short"
1168 tests="${tests} rdiff2 diff diffnl death death2 death-rtag"
1169 tests="${tests} rm-update-message rmadd rmadd2 rmadd3 resurrection"
1170 tests="${tests} dirs dirs2 branches branches2 tagc tagf "
1171 tests="${tests} tag-log tag-space"
1172 tests="${tests} rcslib multibranch import importb importc import-CVS"
1173 tests="$tests import-quirks"
1174 tests="${tests} update-p import-after-initial branch-after-import"
1175 tests="${tests} join join2 join3 join4 join5 join6 join7 join8 join9"
1176 tests="${tests} join-readonly-conflict join-admin join-admin-2"
1177 tests="${tests} join-rm"
1178 tests="${tests} new newb conflicts conflicts2 conflicts3 conflicts4"
1179 tests="${tests} clean"
1180 # Checking out various places (modules, checkout -d, &c)
1181 tests="${tests} modules modules2 modules3 modules4 modules5 modules6"
1182 tests="${tests} modules7 mkmodules co-d"
1183 tests="${tests} cvsadm emptydir abspath abspath2 toplevel toplevel2"
1184 tests="${tests} rstar-toplevel trailingslashes checkout_repository"
1185 # Log messages, error messages.
1186 tests="${tests} mflag editor errmsg1 errmsg2 adderrmsg opterrmsg"
1187 # Watches, binary files, history browsing, &c.
1188 tests="${tests} devcom devcom2 devcom3 watch4 watch5 watch6"
1189 tests="${tests} unedit-without-baserev"
1190 tests="${tests} ignore ignore-on-branch binfiles binfiles2 binfiles3"
1191 tests="${tests} mcopy binwrap binwrap2"
1192 tests="${tests} binwrap3 mwrap info taginfo config"
1193 tests="${tests} serverpatch log log2 logopt ann ann-id"
1194 # Repository Storage (RCS file format, CVS lock files, creating
1195 # a repository without "cvs init", &c).
1196 tests="${tests} crerepos crerepos-extssh rcs rcs2 rcs3 rcs4 rcs5 rcs6"
1197 tests="$tests lockfiles backuprecover"
1198 tests="${tests} sshstdio"
1199 # More history browsing, &c.
1200 tests="${tests} history"
1201 tests="${tests} big modes modes2 modes3 stamps"
1202 # PreservePermissions stuff: permissions, symlinks et al.
1203 # tests="${tests} perms symlinks symlinks2 hardlinks"
1204 # More tag and branch tests, keywords.
1205 tests="${tests} sticky keyword keywordlog keywordname keyword2"
1206 tests="${tests} head tagdate multibranch2 tag8k"
1207 # "cvs admin", reserved checkouts.
1208 tests="${tests} admin reserved"
1209 # Nuts and bolts of diffing/merging (diff library, &c)
1210 tests="${tests} diffmerge1 diffmerge2"
1211 # Release of multiple directories
1212 tests="${tests} release"
1213 tests="${tests} recase"
1214 # Multiple root directories and low-level protocol tests.
1215 tests="${tests} multiroot multiroot2 multiroot3 multiroot4"
1216 tests="$tests rmroot reposmv pserver server server2 server3"
1217 tests="$tests client client2"
1218 tests="${tests} dottedroot fork commit-d"
1223 # Now check the -f argument for validity.
1224 if test -n "$fromtest"; then
1225 # Don't allow spaces - they are our delimiters in tests
1227 for sub in $fromtest; do
1228 count=`expr $count + 1`
1230 if test $count != 1; then
1231 echo "No such test \`$fromtest'." >&2
1234 # make sure it is in $tests
1239 echo "No such test \`$fromtest'." >&2
1247 # a simple function to compare directory contents
1249 # Returns: 0 for same, 1 for different
1258 find . -print | fgrep -v /CVS | sort > $TESTDIR/dc$$d1
1260 # go back where we were to avoid symlink hell...
1263 find . -print | fgrep -v /CVS | sort > $TESTDIR/dc$$d2
1265 if diff $TESTDIR/dc$$d1 $TESTDIR/dc$$d2 >/dev/null 2>&1
1274 if test -f $DIR_1/"$a" ; then
1275 cmp -s $DIR_1/"$a" $DIR_2/"$a"
1276 if test $? -ne 0 ; then
1280 done < $TESTDIR/dc$$d1
1281 rm -f $TESTDIR/dc$$*
1288 # The following 4 functions are used by the diffmerge1 test case. They set up,
1289 # respectively, the four versions of the files necessary:
1291 # 1. Ancestor revisions.
1292 # 2. "Your" changes.
1294 # 4. Expected merge result.
1297 # Create ancestor revisions for diffmerge1
1298 diffmerge_create_older_files() {
1299 # This test case was supplied by Noah Friedman:
1300 cat >testcase01 <<EOF
1303 package random.application;
1305 import random.util.*;
1309 /* Instantiates a Button with origin (0, 0) and zero width and height.
1310 * You must call an initializer method to properly initialize the Button.
1316 _titleColor = Color.black;
1317 _disabledTitleColor = Color.gray;
1318 _titleFont = Font.defaultFont ();
1321 /* Convenience constructor for instantiating a Button with
1322 * bounds x, y, width, and height. Equivalent to
1323 * foo = new Button ();
1324 * foo.init (x, y, width, height);
1326 public Button (int x, int y, int width, int height)
1329 init (x, y, width, height);
1334 # This test case was supplied by Jacob Burckhardt:
1335 cat >testcase02 <<EOF
1343 # This test case was supplied by Karl Tomlinson who also wrote the
1344 # patch which lets CVS correctly handle this and several other cases:
1345 cat >testcase03 <<EOF
1354 # This test case was supplied by Karl Tomlinson:
1355 cat >testcase04 <<EOF
1371 # This test case was supplied by Karl Tomlinson:
1372 cat >testcase05 <<EOF
1400 # This test case was supplied by Jacob Burckhardt:
1401 cat >testcase06 <<EOF
1417 # This test is supposed to verify that the horizon lines are the same
1418 # for both 2-way diffs, but unfortunately, it does not fail with the
1419 # old version of cvs. However, Karl Tomlinson still thought it would
1420 # be good to test it anyway:
1421 cat >testcase07 <<EOF
1452 # This test case was supplied by Jacob Burckhardt:
1453 cat >testcase08 <<EOF
1454 Both changes move this line to the end of the file.
1460 First change will delete this line.
1462 First change will also delete this line.
1468 Second change will change it here.
1475 # This test case was supplied by Jacob Burckhardt. Note that I do not
1476 # think cvs has ever failed with this case, but I include it anyway,
1477 # since I think it is a hard case. It is hard because Peter Miller's
1478 # fmerge utility fails on it:
1479 cat >testcase09 <<EOF
1489 # This test case was supplied by Martin Dorey and simplified by Jacob
1491 cat >testcase10 <<EOF
1494 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1496 MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
1497 OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
1499 Bloke_GttpfIRte_MtpeaL ( &acI );
1500 MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
1504 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1505 Y * jfle_Uecopd_MfJe_fY_Mectopk,
1506 jfle_Uecopd_MfJe_fY_Mectopk,
1511 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1512 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
1513 jfle_Uecopd_MfJe_fY_Mectopk,
1520 /****************************************************************************
1522 * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
1524 ****************************************************************************/
1526 MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
1530 MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
1535 HfkQipfte ( waYdle, /* waYdle */
1536 waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
1537 (coYkt RfYt8*) nRVVep, /* nRVVep */
1538 0, /* MRrepVlRoRk KfxoYfkL */
1539 beYgtz /* nEtek to Apfte */
1547 # Create "your" revisions for diffmerge1
1548 diffmerge_create_your_files() {
1549 # remove the Button() method
1550 cat >testcase01 <<\EOF
1553 package random.application;
1555 import random.util.*;
1559 /* Instantiates a Button with origin (0, 0) and zero width and height.
1560 * You must call an initializer method to properly initialize the Button.
1566 _titleColor = Color.black;
1567 _disabledTitleColor = Color.gray;
1568 _titleFont = Font.defaultFont ();
1573 cat >testcase02 <<\EOF
1581 cat >testcase03 <<\EOF
1592 cat >testcase04 <<\EOF
1602 cat >testcase05 <<\EOF
1619 # Test case 6 and test case 7 both use the same input files, but they
1620 # order the input files differently. In one case, a certain file is
1621 # used as the older file, but in the other test case, that same file
1622 # is used as the file which has changes. I could have put echo
1623 # commands here, but since the echo lines would be the same as those
1624 # in the previous function, I decided to save space and avoid repeating
1625 # several lines of code. Instead, I merely swap the files:
1627 mv testcase06 testcase07
1630 # Make the date newer so that cvs thinks that the files are changed:
1631 touch testcase06 testcase07
1633 cat >testcase08 <<\EOF
1638 First change has now added this in.
1644 Second change will change it here.
1650 Both changes move this line to the end of the file.
1653 cat >testcase09 <<\EOF
1667 cat >testcase10 <<\EOF
1669 fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
1672 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1674 fV ( jfle_Uecopd_KRLIep < 16 )
1676 MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
1680 MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
1681 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1683 MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
1684 OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
1686 Bloke_GttpfIRte_MtpeaL ( &acI );
1687 MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
1693 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1694 Y * jfle_Uecopd_MfJe_fY_Mectopk,
1695 jfle_Uecopd_MfJe_fY_Mectopk,
1700 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1701 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
1702 jfle_Uecopd_MfJe_fY_Mectopk,
1711 /****************************************************************************
1713 * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
1715 ****************************************************************************/
1717 MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
1721 MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
1726 HfkQipfte ( waYdle, /* waYdle */
1727 waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
1728 (coYkt RfYt8*) nRVVep, /* nRVVep */
1729 0, /* MRrepVlRoRk KfxoYfkL */
1730 beYgtz /* nEtek to Apfte */
1739 # Create "my" revisions for diffmerge1
1740 diffmerge_create_my_files() {
1741 # My working copy still has the Button() method, but I
1742 # comment out some code at the top of the class.
1743 cat >testcase01 <<\EOF
1746 package random.application;
1748 import random.util.*;
1752 /* Instantiates a Button with origin (0, 0) and zero width and height.
1753 * You must call an initializer method to properly initialize the Button.
1759 // _titleColor = Color.black;
1760 // _disabledTitleColor = Color.gray;
1761 // _titleFont = Font.defaultFont ();
1764 /* Convenience constructor for instantiating a Button with
1765 * bounds x, y, width, and height. Equivalent to
1766 * foo = new Button ();
1767 * foo.init (x, y, width, height);
1769 public Button (int x, int y, int width, int height)
1772 init (x, y, width, height);
1777 cat >testcase02 <<\EOF
1785 cat >testcase03 <<\EOF
1795 cat >testcase04 <<\EOF
1813 # Note that in test case 5, there are no changes in the "mine"
1814 # section, which explains why there is no command here which writes to
1817 # no changes for testcase06
1819 # The two branches make the same changes:
1820 cp ../yours/testcase07 .
1822 cat >testcase08 <<\EOF
1827 First change will delete this line.
1829 First change will also delete this line.
1835 Second change has now changed it here.
1841 Both changes move this line to the end of the file.
1844 cat >testcase09 <<\EOF
1857 cat >testcase10 <<\EOF
1860 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1862 MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
1863 OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
1865 Bloke_GttpfIRte_MtpeaL ( &acI );
1866 MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
1870 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1871 Y * jfle_Uecopd_MfJe_fY_Mectopk,
1872 jfle_Uecopd_MfJe_fY_Mectopk,
1877 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
1878 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
1879 jfle_Uecopd_MfJe_fY_Mectopk,
1886 /****************************************************************************
1888 * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
1890 ****************************************************************************/
1892 MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
1896 MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
1901 HfkQipfte ( waYdle, /* waYdle */
1902 waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
1903 (coYkt RfYt8*) nRVVep, /* nRVVep */
1904 beYgtz /* nEtek to Apfte */
1913 # Create expected results of merge for diffmerge1
1914 diffmerge_create_expected_files() {
1915 cat >testcase01 <<\EOF
1918 package random.application;
1920 import random.util.*;
1924 /* Instantiates a Button with origin (0, 0) and zero width and height.
1925 * You must call an initializer method to properly initialize the Button.
1931 // _titleColor = Color.black;
1932 // _disabledTitleColor = Color.gray;
1933 // _titleFont = Font.defaultFont ();
1938 cat >testcase02 <<\EOF
1946 cat >testcase03 <<\EOF
1958 cat >testcase04 <<\EOF
1970 # Since there are no changes in the "mine" section, just take exactly
1971 # the version in the "yours" section:
1972 cp ../yours/testcase05 .
1974 cp ../yours/testcase06 .
1976 # Since the two branches make the same changes, the result should be
1977 # the same as both branches. Here, I happen to pick yours to copy from,
1978 # but I could have also picked mine, since the source of the copy is
1979 # the same in either case. However, the mine has already been
1980 # altered by the update command, so don't use it. Instead, use the
1981 # yours section which has not had an update on it and so is unchanged:
1982 cp ../yours/testcase07 .
1984 cat >testcase08 <<\EOF
1989 First change has now added this in.
1995 Second change has now changed it here.
2001 Both changes move this line to the end of the file.
2004 cat >testcase09 <<\EOF
2018 cat >testcase10 <<\EOF
2020 fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
2023 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
2025 fV ( jfle_Uecopd_KRLIep < 16 )
2027 MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
2031 MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
2032 fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
2034 MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
2035 OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
2037 Bloke_GttpfIRte_MtpeaL ( &acI );
2038 MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
2044 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
2045 Y * jfle_Uecopd_MfJe_fY_Mectopk,
2046 jfle_Uecopd_MfJe_fY_Mectopk,
2051 petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
2052 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
2053 jfle_Uecopd_MfJe_fY_Mectopk,
2062 /****************************************************************************
2064 * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
2066 ****************************************************************************/
2068 MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
2072 MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
2077 HfkQipfte ( waYdle, /* waYdle */
2078 waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
2079 (coYkt RfYt8*) nRVVep, /* nRVVep */
2080 beYgtz /* nEtek to Apfte */
2091 # Echo a new CVSROOT based on $1, $remote, and $remotehost
2094 if test -n "$remotehost"; then
2095 echo :ext:$remotehost$1
2106 # Set up CVSROOT (the crerepos tests will test operating without CVSROOT set).
2108 # Currently we test :fork: and :ext: (see crerepos test). There is a
2109 # known difference between the two in modes-15 (see comments there).
2111 # :ext: can be tested against a remote machine if:
2113 # 1. $remotehost is set using the `-h' option to this script.
2114 # 2. ${CVS_RSH=rsh} $remotehost works.
2115 # 3. The path to $TESTDIR is the same on both machines (symlinks are okay)
2116 # 4. The path to $testcvs is the same on both machines (symlinks are okay)
2117 # or $CVS_SERVER is overridden in this script's environment to point to
2118 # a working CVS exectuable on the remote machine.
2120 # Testing :pserver: would be hard (inetd issues). (How about using tcpserver
2121 # and some high port number? DRP)
2123 # Allow CVS_SERVER to be overridden. This facilitates constructs like
2124 # testing a local case-insensitive client against a remote case
2125 # sensitive server and visa versa.
2126 : ${CVS_SERVER=$testcvs}; export CVS_SERVER
2128 # Use a name which will be different than CVSROOT on case insensitive
2129 # filesystems (e.g., HFS+)
2130 CVSROOTDIR=cvsrootdir
2132 mkdir ${TESTDIR}/realcvsroot
2133 ln -s realcvsroot ${TESTDIR}/${CVSROOTDIR}
2135 CVSROOT_DIRNAME=${TESTDIR}/${CVSROOTDIR}
2136 CVSROOT=`newroot $CVSROOT_DIRNAME`; export CVSROOT
2141 ### Init the repository.
2143 dotest init-1 "$testcvs -d$CVSROOT_DIRNAME init"
2145 # Copy the admin files for restore_adm.
2146 cp -Rp $CVSROOT_DIRNAME/CVSROOT $TESTDIR/CVSROOT.save
2157 dotest init-2 "$testcvs init"
2158 dotest_fail init-3 "$testcvs -d $CVSROOT/sdir init" \
2159 "$PROG \[init aborted\]: Cannot initialize repository under existing CVSROOT: \`$CVSROOT_DIRNAME'"
2165 for what in $tests; do
2166 if test -n "$fromtest" ; then
2167 if test $fromtest = $what ; then
2181 # We've had cases where the version command started dumping core,
2182 # so we might as well test it
2183 dotest version-1 "${testcvs} --version" \
2185 Concurrent Versions System (CVS) [0-9.]*.*
2187 Copyright (C) [0-9]* Free Software Foundation, Inc.
2189 Senior active maintainers include Larry Jones, Derek R. Price,
2190 and Mark D. Baushke. Please see the AUTHORS and README files from the CVS
2191 distribution kit for a complete list of contributors and copyrights.
2193 CVS may be copied only under the terms of the GNU General Public License,
2194 a copy of which can be found with the CVS distribution kit.
2196 Specify the --help option for further information about CVS'
2199 dotest version-2r "${testcvs} version" \
2200 'Client: Concurrent Versions System (CVS) [0-9p.]* (client/server)
2201 Server: Concurrent Versions System (CVS) [0-9p.]* (client/server)'
2203 dotest version-2 "${testcvs} version" \
2204 'Concurrent Versions System (CVS) [0-9.]*.*'
2209 # Similar in spirit to some of the basic1, and basic2
2210 # tests, but hopefully a lot faster. Also tests operating on
2211 # files two directories down *without* operating on the parent dirs.
2213 # Tests basica-0a and basica-0b provide the equivalent of the:
2214 # mkdir ${CVSROOT_DIRNAME}/first-dir
2215 # used by many of the tests. It is "more official" in the sense
2216 # that is does everything through CVS; the reason most of the
2217 # tests don't use it is mostly historical.
2219 dotest basica-0a "${testcvs} -q co -l ." ''
2221 dotest basica-0b "${testcvs} add first-dir" \
2222 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
2226 dotest basica-1 "${testcvs} -q co first-dir" ''
2229 # Test a few operations, to ensure they gracefully do
2230 # nothing in an empty directory.
2231 dotest basica-1a0 "${testcvs} -q update" ''
2232 dotest basica-1a1 "${testcvs} -q diff -c" ''
2233 dotest basica-1a2 "${testcvs} -q status" ''
2234 dotest basica-1a3 "${testcvs} -q update ." ''
2235 dotest basica-1a4 "${testcvs} -q update ./" ''
2238 # Remote CVS gives the "cannot open CVS/Entries" error, which is
2239 # clearly a bug, but not a simple one to fix.
2240 dotest basica-1a10 "${testcvs} -n add sdir" \
2241 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository" \
2242 "${PROG} add: cannot open CVS/Entries for reading: No such file or directory
2243 Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
2244 dotest_fail basica-1a11 \
2245 "test -d ${CVSROOT_DIRNAME}/first-dir/sdir" ''
2246 dotest basica-2 "${testcvs} add sdir" \
2247 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
2250 dotest basica-3 "${testcvs} add ssdir" \
2251 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir added to the repository"
2255 # Trying to commit it without a "cvs add" should be an error.
2256 # The "use `cvs add' to create an entry" message is the one
2257 # that I consider to be more correct, but local cvs prints the
2258 # "nothing known" message and noone has gotten around to fixing it.
2259 dotest_fail basica-notadded "${testcvs} -q ci ssfile" \
2260 "${PROG} [a-z]*: use .${PROG} add. to create an entry for ssfile
2261 ${PROG}"' \[[a-z]* aborted\]: correct above errors first!' \
2262 "${PROG}"' [a-z]*: nothing known about `ssfile'\''
2263 '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
2265 dotest basica-4 "${testcvs} add ssfile" \
2266 "${PROG}"' add: scheduling file `ssfile'\'' for addition
2267 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
2268 dotest_fail basica-4a "${testcvs} tag tag0 ssfile" \
2269 "${PROG} tag: nothing known about ssfile
2270 ${PROG} "'\[tag aborted\]: correct the above errors first!'
2272 dotest basica-5 "${testcvs} -q ci -m add-it" \
2273 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2275 Checking in sdir/ssdir/ssfile;
2276 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2277 initial revision: 1\.1
2279 dotest_fail basica-5a \
2280 "${testcvs} -q tag BASE sdir/ssdir/ssfile" \
2281 "${PROG} tag: Attempt to add reserved tag name BASE
2282 ${PROG} \[tag aborted\]: failed to set tag BASE to revision 1\.1 in ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v"
2283 dotest basica-5b "${testcvs} -q tag NOT_RESERVED" \
2284 'T sdir/ssdir/ssfile'
2286 dotest basica-6 "${testcvs} -q update" ''
2287 echo "ssfile line 2" >>sdir/ssdir/ssfile
2288 dotest_fail basica-6.2 "${testcvs} -q diff -c" \
2289 "Index: sdir/ssdir/ssfile
2290 ===================================================================
2291 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2292 retrieving revision 1\.1
2293 diff -c -r1\.1 ssfile
2294 \*\*\* sdir/ssdir/ssfile ${RFCDATE} 1\.1
2295 --- sdir/ssdir/ssfile ${RFCDATE}
2296 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2300 ${PLUS} ssfile line 2"
2301 dotest_fail basica-6.3 "${testcvs} -q diff -c -rBASE" \
2302 "Index: sdir/ssdir/ssfile
2303 ===================================================================
2304 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2305 retrieving revision 1\.1
2306 diff -c -r1\.1 ssfile
2307 \*\*\* sdir/ssdir/ssfile ${RFCDATE} 1\.1
2308 --- sdir/ssdir/ssfile ${RFCDATE}
2309 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2313 ${PLUS} ssfile line 2"
2314 dotest_fail basica-6.4 "${testcvs} -q diff -c -rBASE -C3isacrowd" \
2315 "Index: sdir/ssdir/ssfile
2316 ===================================================================
2317 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2318 retrieving revision 1\.1
2319 diff -c -C 3isacrowd -r1\.1 ssfile
2320 ${PROG} diff: invalid context length argument"
2321 dotest basica-7 "${testcvs} -q ci -m modify-it" \
2322 "Checking in sdir/ssdir/ssfile;
2323 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2324 new revision: 1\.2; previous revision: 1\.1
2326 dotest_fail basica-nonexist "${testcvs} -q ci nonexist" \
2327 "${PROG}"' [a-z]*: nothing known about `nonexist'\''
2328 '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
2329 dotest basica-8 "${testcvs} -q update ." ''
2331 # Test the -f option to ci
2333 dotest basica-8a0 "${testcvs} -q ci -m not-modified ssfile" ''
2334 dotest basica-8a "${testcvs} -q ci -f -m force-it" \
2335 "Checking in ssfile;
2336 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2337 new revision: 1\.3; previous revision: 1\.2
2339 dotest basica-8a1 "${testcvs} -q ci -m bump-it -r 2.0" \
2340 "Checking in ssfile;
2341 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2342 new revision: 2\.0; previous revision: 1\.3
2344 dotest basica-8a1a "${testcvs} -q ci -m bump-it -r 2.9" \
2345 "Checking in ssfile;
2346 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2347 new revision: 2\.9; previous revision: 2\.0
2349 # Test string-based revion number increment rollover
2350 dotest basica-8a1b "${testcvs} -q ci -m bump-it -f -r 2" \
2351 "Checking in ssfile;
2352 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2353 new revision: 2\.10; previous revision: 2\.9
2355 dotest basica-8a1c "${testcvs} -q ci -m bump-it -r 2.99" \
2356 "Checking in ssfile;
2357 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2358 new revision: 2\.99; previous revision: 2\.10
2360 # Test string-based revion number increment rollover
2361 dotest basica-8a1d "${testcvs} -q ci -m bump-it -f -r 2" \
2362 "Checking in ssfile;
2363 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2364 new revision: 2\.100; previous revision: 2\.99
2366 dotest basica-8a1e "${testcvs} -q ci -m bump-it -r 2.1099" \
2367 "Checking in ssfile;
2368 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2369 new revision: 2\.1099; previous revision: 2\.100
2371 # Test string-based revion number increment rollover
2372 dotest basica-8a1f "${testcvs} -q ci -m bump-it -f -r 2" \
2373 "Checking in ssfile;
2374 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2375 new revision: 2\.1100; previous revision: 2\.1099
2377 # -f should not be necessary, but it should be harmless.
2378 # Also test the "-r 3" (rather than "-r 3.0") usage.
2379 dotest basica-8a2 "${testcvs} -q ci -m bump-it -f -r 3" \
2380 "Checking in ssfile;
2381 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2382 new revision: 3\.1; previous revision: 2\.1100
2385 # Test using -r to create a branch
2386 dotest_fail basica-8a3 "${testcvs} -q ci -m bogus -r 3.0.0" \
2387 "Checking in ssfile;
2388 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2389 ${PROG} commit: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: can't find branch point 3\.0
2390 ${PROG} commit: could not check in ssfile"
2391 dotest basica-8a4 "${testcvs} -q ci -m valid -r 3.1.2" \
2392 "Checking in ssfile;
2393 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2394 new revision: 3\.1\.2\.1; previous revision: 3\.1
2397 # Verify that this file remains unchanged since up -A should not
2398 # change the contents here.
2399 cp ssfile $TESTDIR/ssfile.sav
2400 # now get rid of the sticky tag and go back to the trunk
2401 dotest basica-8a5 "$testcvs -q up -A ./" '[UP] ssfile'
2402 dotest basica-8a6 "cmp ssfile $TESTDIR/ssfile.sav"
2403 rm $TESTDIR/ssfile.sav
2406 dotest basica-8b "${testcvs} -q diff -r1.2 -r1.3"
2407 dotest basica-8b1 "${testcvs} -q diff -r1.2 -r1.3 -C 3isacrowd"
2409 # The .* here will normally be "No such file or directory",
2410 # but if memory serves some systems (AIX?) have a different message.
2411 : dotest_fail basica-9 \
2412 "${testcvs} -q -d ${TESTDIR}/nonexist update" \
2413 "${PROG}: cannot access cvs root ${TESTDIR}/nonexist: .*"
2414 dotest_fail basica-9 \
2415 "${testcvs} -q -d ${TESTDIR}/nonexist update" \
2416 "${PROG} \[[a-z]* aborted\]: ${TESTDIR}/nonexist/CVSROOT: .*"
2418 dotest basica-10 "${testcvs} annotate" \
2420 Annotations for sdir/ssdir/ssfile
2421 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2422 1\.1 .'"$username8"' *[0-9a-zA-Z-]*.: ssfile
2423 1\.2 .'"$username8"' *[0-9a-zA-Z-]*.: ssfile line 2'
2425 # Test resurrecting with strange revision numbers
2427 dotest basica-r1 "${testcvs} rm -f ssfile" \
2428 "${PROG} remove: scheduling .ssfile. for removal
2429 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
2430 dotest basica-r2 "${testcvs} -q ci -m remove" \
2432 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2433 new revision: delete; previous revision: 3\.1
2435 dotest basica-r3 "${testcvs} -q up -p -r 3.1 ./ssfile >ssfile" ""
2436 dotest basica-r4 "${testcvs} add ssfile" \
2437 "${PROG} add: Re-adding file .ssfile. (in place of dead revision 3\.2)\.
2438 ${PROG} add: use .${PROG} commit. to add this file permanently"
2439 dotest basica-r5 "${testcvs} -q ci -m resurrect" \
2440 "Checking in ssfile;
2441 ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
2442 new revision: 3\.3; previous revision: 3\.2
2446 # As long as we have a file with a few revisions, test
2447 # a few "cvs admin -o" invocations.
2449 dotest_fail basica-o1 "${testcvs} admin -o 1.2::1.2" \
2450 "${PROG} [a-z]*: while processing more than one file:
2451 ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
2452 dotest basica-o2 "${testcvs} admin -o 1.2::1.2 ssfile" \
2453 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2455 dotest basica-o2a "${testcvs} admin -o 1.1::NOT_RESERVED ssfile" \
2456 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2458 dotest_fail basica-o2b "${testcvs} admin -o 1.1::NOT_EXIST ssfile" \
2459 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2460 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: Revision NOT_EXIST doesn't exist.
2461 ${PROG} admin: RCS file for .ssfile. not modified\."
2462 dotest basica-o3 "${testcvs} admin -o 1.2::1.3 ssfile" \
2463 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2465 dotest basica-o4 "${testcvs} admin -o 3.1:: ssfile" \
2466 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2467 deleting revision 3\.3
2468 deleting revision 3\.2
2470 dotest basica-o5 "${testcvs} admin -o ::1.1 ssfile" \
2471 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2473 dotest basica-o5a "${testcvs} -n admin -o 1.2::3.1 ssfile" \
2474 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2475 deleting revision 2\.1100
2476 deleting revision 2\.1099
2477 deleting revision 2\.100
2478 deleting revision 2\.99
2479 deleting revision 2\.10
2480 deleting revision 2\.9
2481 deleting revision 2\.0
2482 deleting revision 1\.3
2484 dotest basica-o6 "${testcvs} admin -o 1.2::3.1 ssfile" \
2485 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2486 deleting revision 2\.1100
2487 deleting revision 2\.1099
2488 deleting revision 2\.100
2489 deleting revision 2\.99
2490 deleting revision 2\.10
2491 deleting revision 2\.9
2492 deleting revision 2\.0
2493 deleting revision 1\.3
2495 dotest basica-o6a "${testcvs} admin -o 3.1.2: ssfile" \
2496 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2497 deleting revision 3\.1\.2\.1
2499 dotest basica-o7 "${testcvs} log -N ssfile" "
2500 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2501 Working file: ssfile
2506 keyword substitution: kv
2507 total revisions: 3; selected revisions: 3
2509 ----------------------------
2511 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
2513 ----------------------------
2515 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
2517 ----------------------------
2519 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
2521 ============================================================================="
2522 dotest basica-o8 "${testcvs} -q update -p -r 1.1 ./ssfile" "ssfile"
2527 rm -rf ${CVSROOT_DIRNAME}/first-dir
2532 # More basic tests, including non-branch tags and co -d.
2534 dotest basicb-0a "${testcvs} -q co -l ." ''
2536 dotest basicb-0b "${testcvs} add topfile" \
2537 "${PROG} add: scheduling file .topfile. for addition
2538 ${PROG} add: use .${PROG} commit. to add this file permanently"
2539 dotest basicb-0c "${testcvs} -q ci -m add-it topfile" \
2540 "RCS file: ${CVSROOT_DIRNAME}/topfile,v
2542 Checking in topfile;
2543 ${CVSROOT_DIRNAME}/topfile,v <-- topfile
2544 initial revision: 1\.1
2549 dotest basicb-0d "${testcvs} -q co -l ." "U topfile"
2550 # Now test the ability to run checkout on an existing working
2551 # directory without having it lose its mind. I don't know
2552 # whether this is tested elsewhere in sanity.sh. A more elaborate
2553 # test might also have modified files, make sure it works if
2554 # the modules file was modified to add new directories to the
2556 dotest basicb-0d0 "${testcvs} -q co -l ." ""
2558 dotest basicb-0e "${testcvs} add first-dir" \
2559 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
2563 dotest basicb-1 "${testcvs} -q co first-dir" ''
2565 # The top-level CVS directory is not created by default.
2566 # I'm leaving basicb-1a and basicb-1b untouched, mostly, in
2567 # case we decide that the default should be reversed...
2569 dotest_fail basicb-1a "test -d CVS" ''
2571 dotest basicb-1c "cat first-dir/CVS/Repository" "first-dir"
2574 # Note that the name Emptydir is chosen to test that CVS just
2575 # treats it like any other directory name. It should be
2576 # special only when it is directly in $CVSROOT/CVSROOT.
2577 mkdir Emptydir sdir2
2578 dotest basicb-2 "${testcvs} add Emptydir sdir2" \
2579 "Directory ${CVSROOT_DIRNAME}/first-dir/Emptydir added to the repository
2580 Directory ${CVSROOT_DIRNAME}/first-dir/sdir2 added to the repository"
2582 echo sfile1 starts >sfile1
2583 dotest basicb-2a10 "${testcvs} -n add sfile1" \
2584 "${PROG} add: scheduling file .sfile1. for addition
2585 ${PROG} add: use .${PROG} commit. to add this file permanently"
2586 dotest basicb-2a11 "${testcvs} status sfile1" \
2587 "${PROG} status: use .${PROG} add. to create an entry for sfile1
2588 ===================================================================
2589 File: sfile1 Status: Unknown
2591 Working revision: No entry for sfile1
2592 Repository revision: No revision control file"
2593 dotest basicb-3 "${testcvs} add sfile1" \
2594 "${PROG} add: scheduling file .sfile1. for addition
2595 ${PROG} add: use .${PROG} commit. to add this file permanently"
2596 dotest basicb-3a1 "${testcvs} status sfile1" \
2597 "===================================================================
2598 File: sfile1 Status: Locally Added
2600 Working revision: New file!
2601 Repository revision: No revision control file
2604 Sticky Options: (none)"
2607 echo sfile2 starts >sfile2
2608 dotest basicb-4 "${testcvs} add sfile2" \
2609 "${PROG} add: scheduling file .sfile2. for addition
2610 ${PROG} add: use .${PROG} commit. to add this file permanently"
2611 dotest basicb-4a "${testcvs} -q ci CVS" \
2612 "${PROG} [a-z]*: warning: directory CVS specified in argument
2613 ${PROG} [a-z]*: but CVS uses CVS for its own purposes; skipping CVS directory"
2615 dotest basicb-5 "${testcvs} -q ci -m add" \
2616 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v
2618 Checking in Emptydir/sfile1;
2619 ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v <-- sfile1
2620 initial revision: 1\.1
2622 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
2624 Checking in sdir2/sfile2;
2625 ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v <-- sfile2
2626 initial revision: 1\.1
2628 echo sfile1 develops >Emptydir/sfile1
2629 dotest basicb-6 "${testcvs} -q ci -m modify" \
2630 "Checking in Emptydir/sfile1;
2631 ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v <-- sfile1
2632 new revision: 1\.2; previous revision: 1\.1
2634 dotest basicb-7 "${testcvs} -q tag release-1" 'T Emptydir/sfile1
2636 echo not in time for release-1 >sdir2/sfile2
2637 dotest basicb-8 "${testcvs} -q ci -m modify-2" \
2638 "Checking in sdir2/sfile2;
2639 ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v <-- sfile2
2640 new revision: 1\.2; previous revision: 1\.1
2642 # See if CVS can correctly notice when an invalid numeric
2643 # revision is specified.
2644 # Commented out until we get around to fixing CVS
2645 : dotest basicb-8a0 "${testcvs} diff -r 1.5 -r 1.7 sfile2" 'error msg'
2648 # Test that we recurse into the correct directory when checking
2649 # for existing files, even if co -d is in use.
2650 touch first-dir/extra
2651 dotest basicb-cod-1 "${testcvs} -q co -d first-dir1 first-dir" \
2652 'U first-dir1/Emptydir/sfile1
2653 U first-dir1/sdir2/sfile2'
2658 # FIXME? basicb-9 used to check things out like this:
2659 # U newdir/Emptydir/sfile1
2660 # U newdir/sdir2/sfile2
2661 # but that's difficult to do. The whole "shorten" thing
2662 # is pretty bogus, because it will break on things
2663 # like "cvs co foo/bar baz/quux". Unless there's some
2664 # pretty detailed expansion and analysis of the command-line
2665 # arguments, we shouldn't do "shorten" stuff at all.
2668 "${testcvs} -q co -d newdir -r release-1 first-dir/Emptydir first-dir/sdir2" \
2669 'U newdir/first-dir/Emptydir/sfile1
2670 U newdir/first-dir/sdir2/sfile2'
2672 # basicb-9a and basicb-9b: see note about basicb-1a
2674 dotest_fail basicb-9a "test -d CVS" ''
2676 dotest basicb-9c "cat newdir/CVS/Repository" "\."
2677 dotest basicb-9d "cat newdir/first-dir/CVS/Repository" \
2678 "${CVSROOT_DIRNAME}/first-dir" \
2680 dotest basicb-9e "cat newdir/first-dir/Emptydir/CVS/Repository" \
2681 "${CVSROOT_DIRNAME}/first-dir/Emptydir" \
2682 "first-dir/Emptydir"
2683 dotest basicb-9f "cat newdir/first-dir/sdir2/CVS/Repository" \
2684 "${CVSROOT_DIRNAME}/first-dir/sdir2" \
2687 dotest basicb-10 "cat newdir/first-dir/Emptydir/sfile1 newdir/first-dir/sdir2/sfile2" \
2693 # Hmm, this might be a case for CVSNULLREPOS, but CVS doesn't
2694 # seem to deal with it...
2696 dotest basicb-11 "${testcvs} -q co -d sub1/sub2 first-dir" \
2697 "U sub1/sub2/Emptydir/sfile1
2698 U sub1/sub2/sdir2/sfile2"
2700 dotest basicb-12 "${testcvs} -q update ./." ''
2702 dotest basicb-13 "${testcvs} add xx" fixme
2705 # to test: sub1/sub2/sub3
2706 fi # end of tests commented out.
2708 # Create a second directory.
2711 dotest basicb-14 "${testcvs} -q co -l ." 'U topfile'
2713 dotest basicb-15 "${testcvs} add second-dir" \
2714 "Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
2717 dotest basicb-16 "${testcvs} add aa" \
2718 "${PROG} add: scheduling file .aa. for addition
2719 ${PROG} add: use .${PROG} commit. to add this file permanently"
2720 dotest basicb-17 "${testcvs} -q ci -m add" \
2721 "RCS file: ${CVSROOT_DIRNAME}/second-dir/aa,v
2724 ${CVSROOT_DIRNAME}/second-dir/aa,v <-- aa
2725 initial revision: 1\.1
2729 # Try to remove all revisions in a file.
2730 dotest_fail basicb-o1 "${testcvs} admin -o1.1 topfile" \
2731 "RCS file: ${CVSROOT_DIRNAME}/topfile,v
2732 deleting revision 1\.1
2733 ${PROG} \[admin aborted\]: attempt to delete all revisions"
2734 dotest basicb-o2 "${testcvs} -q update -d first-dir" \
2735 "U first-dir/Emptydir/sfile1
2736 U first-dir/sdir2/sfile2"
2737 dotest_fail basicb-o3 \
2738 "${testcvs} admin -o1.1:1.2 first-dir/sdir2/sfile2" \
2739 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
2740 deleting revision 1\.2
2741 deleting revision 1\.1
2742 ${PROG} \[admin aborted\]: attempt to delete all revisions"
2747 # Note that -H is an illegal option.
2748 # I suspect that the choice between "illegal" and "invalid"
2749 # depends on the user's environment variables, the phase
2750 # of the moon (weirdness with optind), and who knows what else.
2751 # I've been seeing "illegal"...
2752 dotest_fail basicb-21 "${testcvs} -q admin -H" \
2753 "admin: illegal option -- H
2754 ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information" \
2755 "admin: invalid option -- H
2756 ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information"
2761 echo Keeping ${TESTDIR} and exiting due to --keep
2765 rm -rf ${CVSROOT_DIRNAME}/first-dir
2766 rm -rf ${CVSROOT_DIRNAME}/second-dir
2767 rm -f ${CVSROOT_DIRNAME}/topfile,v
2771 # More tests of basic/miscellaneous functionality.
2773 dotest_fail basicc-1 "${testcvs} diff" \
2774 "${PROG} [a-z]*: in directory \.:
2775 ${PROG} \[[a-z]* aborted\]: there is no version here; run .${PROG} checkout. first"
2776 dotest basicc-2 "${testcvs} -q co -l ." ''
2777 mkdir first-dir second-dir
2778 dotest basicc-3 "${testcvs} add first-dir second-dir" \
2779 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
2780 Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
2781 # Old versions of CVS often didn't create this top-level CVS
2782 # directory in the first place. I think that maybe the only
2783 # way to get it to work currently is to let CVS create it,
2784 # and then blow it away (don't complain if it does not
2785 # exist). But that is perfectly legal; people who are used
2786 # to the old behavior especially may be interested.
2787 # FIXME: this test is intended for the TopLevelAdmin=yes case;
2788 # should adjust/move it accordingly.
2790 dotest basicc-4 "echo *" "first-dir second-dir"
2791 dotest basicc-5 "${testcvs} update" \
2792 "${PROG} update: Updating first-dir
2793 ${PROG} update: Updating second-dir" \
2794 "${PROG} update: Updating \.
2795 ${PROG} update: Updating first-dir
2796 ${PROG} update: Updating second-dir"
2799 dotest basicc-6 "${testcvs} release -d" ""
2800 dotest basicc-7 "test -d ../first-dir" ""
2801 # The Linux 2.2 kernel lets you delete ".". That's OK either way,
2802 # the point is that CVS must not mess with anything *outside* "."
2803 # the way that CVS 1.10 and older tried to.
2804 dotest basicc-8 "${testcvs} -Q release -d ." \
2805 "" "${PROG} release: deletion of directory \. failed: .*"
2806 dotest basicc-9 "test -d ../second-dir" ""
2807 # For CVS to make a syntactic check for "." wouldn't suffice.
2808 # On Linux 2.2 systems, the cwd may be gone, so we recreate it
2809 # to allow basicc-11 to actually happen
2810 if test ! -d ../first-dir; then
2811 # Apparently `cd ..' doesn't work with Linux 2.2 & Bash 2.05b.
2816 dotest basicc-11 "${testcvs} -Q release -d ./." \
2817 "" "${PROG} release: deletion of directory \./\. failed: .*"
2818 dotest basicc-11a "test -d ../second-dir" ""
2823 dotest basicc-12 "${testcvs} -Q co ." ""
2824 # actual entries can be in either Entries or Entries.log, do
2825 # an update to get them consolidated into Entries
2826 dotest basicc-12a "${testcvs} -Q up" ""
2827 dotest basicc-12b "cat CVS/Entries" \
2831 dotest basicc-13 "echo *" "CVS CVSROOT first-dir second-dir"
2832 dotest basicc-14 "${testcvs} -Q release first-dir second-dir" ""
2833 # a normal release shouldn't affect the Entries file
2834 dotest basicc-14b "cat CVS/Entries" \
2838 # FIXCVS: but release -d probably should
2839 dotest basicc-15 "${testcvs} -Q release -d first-dir second-dir" ""
2840 dotest basicc-16 "echo *" "CVS CVSROOT"
2841 dotest basicc-17 "cat CVS/Entries" \
2845 # FIXCVS: if not, update should notice the missing directories
2846 # and update Entries accordingly
2847 dotest basicc-18 "${testcvs} -Q up" ""
2848 dotest basicc-19 "cat CVS/Entries" \
2855 rm -rf ${CVSROOT_DIRNAME}/first-dir
2859 # first dive - add a files, first singly, then in a group.
2860 mkdir ${CVSROOT_DIRNAME}/first-dir
2861 mkdir basic1; cd basic1
2862 # check out an empty directory
2863 dotest basic1-1 "${testcvs} -q co first-dir" ''
2871 dotest basic1-14-add-add "${testcvs} add file2 file3 file4 file5" \
2872 "${PROG} add: scheduling file \`file2' for addition
2873 ${PROG} add: scheduling file \`file3' for addition
2874 ${PROG} add: scheduling file \`file4' for addition
2875 ${PROG} add: scheduling file \`file5' for addition
2876 ${PROG} add: use .${PROG} commit. to add these files permanently"
2877 dotest basic1-15-add-add \
2878 "${testcvs} -q update file2 file3 file4 file5" \
2883 dotest basic1-16-add-add "${testcvs} -q update" \
2888 dotest basic1-17-add-add "${testcvs} -q status" \
2889 "===================================================================
2890 File: file2 Status: Locally Added
2892 Working revision: New file!
2893 Repository revision: No revision control file
2896 Sticky Options: (none)
2898 ===================================================================
2899 File: file3 Status: Locally Added
2901 Working revision: New file!
2902 Repository revision: No revision control file
2905 Sticky Options: (none)
2907 ===================================================================
2908 File: file4 Status: Locally Added
2910 Working revision: New file!
2911 Repository revision: No revision control file
2914 Sticky Options: (none)
2916 ===================================================================
2917 File: file5 Status: Locally Added
2919 Working revision: New file!
2920 Repository revision: No revision control file
2923 Sticky Options: (none)"
2924 dotest basic1-18-add-add "${testcvs} -q log" \
2925 "${PROG} log: file2 has been added, but not committed
2926 ${PROG} log: file3 has been added, but not committed
2927 ${PROG} log: file4 has been added, but not committed
2928 ${PROG} log: file5 has been added, but not committed"
2930 dotest basic1-21-add-add "${testcvs} -q update" \
2935 # FIXCVS? Shouldn't this read first-dir/file2 instead of file2?
2936 dotest basic1-22-add-add "${testcvs} log first-dir" \
2937 "${PROG} log: Logging first-dir
2938 ${PROG} log: file2 has been added, but not committed
2939 ${PROG} log: file3 has been added, but not committed
2940 ${PROG} log: file4 has been added, but not committed
2941 ${PROG} log: file5 has been added, but not committed"
2942 dotest basic1-23-add-add "${testcvs} status first-dir" \
2943 "${PROG} status: Examining first-dir
2944 ===================================================================
2945 File: file2 Status: Locally Added
2947 Working revision: New file!
2948 Repository revision: No revision control file
2951 Sticky Options: (none)
2953 ===================================================================
2954 File: file3 Status: Locally Added
2956 Working revision: New file!
2957 Repository revision: No revision control file
2960 Sticky Options: (none)
2962 ===================================================================
2963 File: file4 Status: Locally Added
2965 Working revision: New file!
2966 Repository revision: No revision control file
2969 Sticky Options: (none)
2971 ===================================================================
2972 File: file5 Status: Locally Added
2974 Working revision: New file!
2975 Repository revision: No revision control file
2978 Sticky Options: (none)"
2979 dotest basic1-24-add-add "${testcvs} update first-dir" \
2980 "${PROG} update: Updating first-dir
2985 dotest basic1-27-add-add "${testcvs} co first-dir" \
2986 "${PROG} checkout: Updating first-dir
2992 dotest basic1-14-add-ci \
2993 "${testcvs} commit -m test file2 file3 file4 file5" \
2994 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
2997 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
2998 initial revision: 1\.1
3000 RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
3003 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
3004 initial revision: 1\.1
3006 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
3009 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
3010 initial revision: 1\.1
3012 RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
3015 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
3016 initial revision: 1\.1
3018 dotest basic1-15-add-ci \
3019 "${testcvs} -q update file2 file3 file4 file5" ''
3020 dotest basic1-16-add-ci "${testcvs} -q update" ''
3021 dotest basic1-17-add-ci "${testcvs} -q status" \
3022 "===================================================================
3023 File: file2 Status: Up-to-date
3025 Working revision: 1\.1.*
3026 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
3029 Sticky Options: (none)
3031 ===================================================================
3032 File: file3 Status: Up-to-date
3034 Working revision: 1\.1.*
3035 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file3,v
3038 Sticky Options: (none)
3040 ===================================================================
3041 File: file4 Status: Up-to-date
3043 Working revision: 1\.1.*
3044 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file4,v
3047 Sticky Options: (none)
3049 ===================================================================
3050 File: file5 Status: Up-to-date
3052 Working revision: 1\.1.*
3053 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file5,v
3056 Sticky Options: (none)"
3057 # The "log" tests and friends probably already test the output
3058 # from log quite adequately.
3059 # Note: using dotest fails here. It seems to be related
3060 # to the output being sufficiently large (Red Hat 4.1).
3061 # dotest basic1-18-add-ci "${testcvs} log" "${DOTSTAR}"
3062 if ${testcvs} -q log >>${LOGFILE}; then
3063 pass basic1-18-add-ci
3065 pass basic1-18-add-ci
3068 dotest basic1-21-add-ci "${testcvs} -q update" ''
3069 # See test basic1-18-add-ci for explanation of non-use of dotest.
3070 if ${testcvs} -q log first-dir >>${LOGFILE}; then
3071 pass basic1-22-add-ci
3073 pass basic1-22-add-ci
3075 # At least for the moment I am going to consider 17-add-ci
3076 # an adequate test of the output here.
3077 # See test basic1-18-add-ci for explanation of non-use of dotest.
3078 if ${testcvs} -q status first-dir >>${LOGFILE}; then
3079 pass basic1-23-add-ci
3081 pass basic1-23-add-ci
3083 dotest basic1-24-add-ci "${testcvs} -q update first-dir" ''
3084 dotest basic1-27-add-ci "${testcvs} -q co first-dir" ''
3087 rm file2 file3 file4 file5
3088 dotest basic1-14-rm-rm "${testcvs} rm file2 file3 file4 file5" \
3089 "${PROG} remove: scheduling .file2. for removal
3090 ${PROG} remove: scheduling .file3. for removal
3091 ${PROG} remove: scheduling .file4. for removal
3092 ${PROG} remove: scheduling .file5. for removal
3093 ${PROG} remove: use .${PROG} commit. to remove these files permanently"
3094 # 15-rm-rm was commented out. Why?
3095 dotest basic1-15-rm-rm \
3096 "${testcvs} -q update file2 file3 file4 file5" \
3101 dotest basic1-16-rm-rm "${testcvs} -q update" \
3106 dotest basic1-17-rm-rm "${testcvs} -q status" \
3107 "===================================================================
3108 File: no file file2 Status: Locally Removed
3110 Working revision: -1\.1.*
3111 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
3114 Sticky Options: (none)
3116 ===================================================================
3117 File: no file file3 Status: Locally Removed
3119 Working revision: -1\.1.*
3120 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file3,v
3123 Sticky Options: (none)
3125 ===================================================================
3126 File: no file file4 Status: Locally Removed
3128 Working revision: -1\.1.*
3129 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file4,v
3132 Sticky Options: (none)
3134 ===================================================================
3135 File: no file file5 Status: Locally Removed
3137 Working revision: -1\.1.*
3138 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file5,v
3141 Sticky Options: (none)"
3142 # Would be nice to test that real logs appear (with dead state
3143 # and all), either here or someplace like log2 tests.
3144 if ${testcvs} -q log >>${LOGFILE}; then
3145 pass basic1-18-rm-rm
3147 fail basic1-18-rm-rm
3150 dotest basic1-21-rm-rm "${testcvs} -q update" \
3155 if ${testcvs} -q log first-dir >>${LOGFILE}; then
3156 pass basic1-22-rm-rm
3158 fail basic1-22-rm-rm
3160 if ${testcvs} -q status first-dir >>${LOGFILE}; then
3161 pass basic1-23-rm-rm
3163 fail basic1-23-rm-rm
3165 dotest basic1-24-rm-rm "${testcvs} -q update first-dir" \
3170 dotest basic1-27-rm-rm "${testcvs} -q co first-dir" \
3176 dotest basic1-14-rm-ci "${testcvs} -q commit -m test" \
3178 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
3179 new revision: delete; previous revision: 1\.1
3182 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
3183 new revision: delete; previous revision: 1\.1
3186 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
3187 new revision: delete; previous revision: 1\.1
3190 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
3191 new revision: delete; previous revision: 1\.1
3193 dotest basic1-15-rm-ci \
3194 "${testcvs} -q update file2 file3 file4 file5" ''
3195 dotest basic1-16-rm-ci "${testcvs} -q update" ''
3196 dotest basic1-17-rm-ci "${testcvs} -q status" ''
3197 # Would be nice to test that real logs appear (with dead state
3198 # and all), either here or someplace like log2 tests.
3199 if ${testcvs} -q log >>${LOGFILE}; then
3200 pass basic1-18-rm-ci
3202 fail basic1-18-rm-ci
3205 dotest basic1-21-rm-ci "${testcvs} -q update" ''
3206 if ${testcvs} -q log first-dir >>${LOGFILE}; then
3207 pass basic1-22-rm-ci
3209 fail basic1-22-rm-ci
3211 if ${testcvs} -q status first-dir >>${LOGFILE}; then
3212 pass basic1-23-rm-ci
3214 fail basic1-23-rm-ci
3216 dotest basic1-24-rm-ci "${testcvs} -q update first-dir" ''
3217 dotest basic1-27-rm-ci "${testcvs} -q co first-dir" ''
3219 # All the files are removed, so nothing gets tagged.
3220 dotest basic1-28 "${testcvs} -q tag first-dive" ''
3225 echo Keeping ${TESTDIR} and exiting due to --keep
3230 rm -rf ${CVSROOT_DIRNAME}/first-dir
3234 # Test the ability to operate on directories nested rather deeply.
3235 mkdir ${CVSROOT_DIRNAME}/first-dir
3236 dotest deep-1 "${testcvs} -q co first-dir" ''
3238 for i in dir1 dir2 dir3 dir4 dir5 dir6 dir7 dir8; do
3240 dotest deep-2-$i "${testcvs} add $i" \
3241 "Directory ${CVSROOT_DIRNAME}/first-dir/dir1[/dir0-9]* added to the repository"
3244 dotest deep-3-$i "${testcvs} add file1" \
3245 "${PROG}"' add: scheduling file `file1'\'' for addition
3246 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
3248 cd ../../../../../../../../..
3249 dotest_lit deep-4 "${testcvs} -q ci -m add-them first-dir" <<HERE
3250 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file1,v
3252 Checking in first-dir/dir1/file1;
3253 ${CVSROOT_DIRNAME}/first-dir/dir1/file1,v <-- file1
3254 initial revision: 1.1
3256 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file1,v
3258 Checking in first-dir/dir1/dir2/file1;
3259 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file1,v <-- file1
3260 initial revision: 1.1
3262 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/file1,v
3264 Checking in first-dir/dir1/dir2/dir3/file1;
3265 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/file1,v <-- file1
3266 initial revision: 1.1
3268 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/file1,v
3270 Checking in first-dir/dir1/dir2/dir3/dir4/file1;
3271 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/file1,v <-- file1
3272 initial revision: 1.1
3274 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v
3276 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/file1;
3277 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
3278 initial revision: 1.1
3280 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v
3282 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1;
3283 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
3284 initial revision: 1.1
3286 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v
3288 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1;
3289 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
3290 initial revision: 1.1
3292 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v
3294 Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1;
3295 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
3296 initial revision: 1.1
3300 cd first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
3302 dotest deep-4a0 "${testcvs} rm file1" \
3303 "${PROG} remove: scheduling .file1. for removal
3304 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
3305 dotest deep-4a1 "${testcvs} -q ci -m rm-it" "Removing file1;
3306 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
3307 new revision: delete; previous revision: 1\.1
3310 dotest deep-4a2 "${testcvs} -q update -P dir6/dir7" ''
3311 # Should be using "test -e" if that is portable enough.
3312 dotest_fail deep-4a3 "test -d dir6/dir7/dir8" ''
3314 # Test that if we remove the working directory, CVS does not
3315 # recreate it. (I realize that this behavior is what the
3316 # users expect, but in the longer run we might want to
3317 # re-think it. The corresponding behavior for a file is that
3318 # CVS *will* recreate it, and we might want to make it so
3319 # that "cvs release -d" is the way to delete the directory
3320 # and have it stay gone -kingdon, Oct1996).
3322 dotest deep-4b0a "${testcvs} -q diff" ''
3323 dotest deep-4b0b "${testcvs} -q ci" ''
3324 dotest deep-4b1 "${testcvs} -q update" ''
3325 dotest deep-4b2 "${testcvs} -q update -d -P" \
3329 # Test what happens if one uses -P when there are files removed
3330 # but not committed.
3332 dotest deep-rm1 "${testcvs} rm -f file1" \
3333 "${PROG} remove: scheduling .file1. for removal
3334 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
3336 dotest deep-rm2 "${testcvs} -q update -d -P" 'R dir7/file1'
3337 dotest deep-rm3 "test -d dir7" ''
3338 dotest deep-rm4 "${testcvs} -q ci -m rm-it" "Removing dir7/file1;
3339 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
3340 new revision: delete; previous revision: 1\.1
3342 dotest deep-rm5 "${testcvs} -q update -d -P" ''
3343 dotest_fail deep-rm6 "test -d dir7" ''
3347 dotest deep-rm7 "${testcvs} rm -f -R dir5" \
3348 "${PROG} remove: Removing dir5
3349 ${PROG} remove: scheduling .dir5/file1. for removal
3350 ${PROG} remove: Removing dir5/dir6
3351 ${PROG} remove: scheduling .dir5/dir6/file1. for removal
3352 ${PROG} remove: use .${PROG} commit. to remove these files permanently"
3353 dotest deep-rm8 "${testcvs} -q ci -m rm-it" \
3354 "Removing dir5/file1;
3355 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
3356 new revision: delete; previous revision: 1\.1
3358 Removing dir5/dir6/file1;
3359 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
3360 new revision: delete; previous revision: 1\.1
3362 dotest deep-rm9 "${testcvs} -q update -d -P" ''
3363 dotest_fail deep-rm10 "test -d dir5"
3367 if echo "yes" | ${testcvs} release -d first-dir >>${LOGFILE}; then
3372 rm -rf ${CVSROOT_DIRNAME}/first-dir
3376 # Test rtag, import, history, various miscellaneous operations
3378 # NOTE: this section has reached the size and
3379 # complexity where it is getting to be a good idea to
3380 # add new tests to a new section rather than
3381 # continuing to piggyback them onto the tests here.
3383 # First empty the history file
3384 rm ${CVSROOT_DIRNAME}/CVSROOT/history
3385 touch ${CVSROOT_DIRNAME}/CVSROOT/history
3387 ### XXX maybe should use 'cvs imprt -b1 -m new-module first-dir F F1' in an
3388 ### empty directory to do this instead of hacking directly into $CVSROOT
3389 mkdir ${CVSROOT_DIRNAME}/first-dir
3390 dotest basic2-1 "${testcvs} -q co first-dir" ''
3391 for i in first-dir dir1 dir2 ; do
3392 if test ! -d $i ; then
3394 dotest basic2-2-$i "${testcvs} add $i" \
3395 "Directory ${CVSROOT_DIRNAME}/.*/$i added to the repository"
3400 for j in file6 file7; do
3404 dotest basic2-3-$i "${testcvs} add file6 file7" \
3405 "${PROG} add: scheduling file .file6. for addition
3406 ${PROG} add: scheduling file .file7. for addition
3407 ${PROG} add: use .${PROG} commit. to add these files permanently"
3411 dotest basic2-4 "${testcvs} update first-dir" \
3412 "${PROG} update: Updating first-dir
3415 ${PROG} update: Updating first-dir/dir1
3416 A first-dir/dir1/file6
3417 A first-dir/dir1/file7
3418 ${PROG} update: Updating first-dir/dir1/dir2
3419 A first-dir/dir1/dir2/file6
3420 A first-dir/dir1/dir2/file7"
3422 # fixme: doesn't work right for added files.
3423 dotest basic2-5 "${testcvs} log first-dir" \
3424 "${PROG} log: Logging first-dir
3425 ${PROG} log: file6 has been added, but not committed
3426 ${PROG} log: file7 has been added, but not committed
3427 ${PROG} log: Logging first-dir/dir1
3428 ${PROG} log: file6 has been added, but not committed
3429 ${PROG} log: file7 has been added, but not committed
3430 ${PROG} log: Logging first-dir/dir1/dir2
3431 ${PROG} log: file6 has been added, but not committed
3432 ${PROG} log: file7 has been added, but not committed"
3434 dotest basic2-6 "${testcvs} status first-dir" \
3435 "${PROG} status: Examining first-dir
3436 ===================================================================
3437 File: file6 Status: Locally Added
3439 Working revision: New file!
3440 Repository revision: No revision control file
3443 Sticky Options: (none)
3445 ===================================================================
3446 File: file7 Status: Locally Added
3448 Working revision: New file!
3449 Repository revision: No revision control file
3452 Sticky Options: (none)
3454 ${PROG} status: Examining first-dir/dir1
3455 ===================================================================
3456 File: file6 Status: Locally Added
3458 Working revision: New file!
3459 Repository revision: No revision control file
3462 Sticky Options: (none)
3464 ===================================================================
3465 File: file7 Status: Locally Added
3467 Working revision: New file!
3468 Repository revision: No revision control file
3471 Sticky Options: (none)
3473 ${PROG} status: Examining first-dir/dir1/dir2
3474 ===================================================================
3475 File: file6 Status: Locally Added
3477 Working revision: New file!
3478 Repository revision: No revision control file
3481 Sticky Options: (none)
3483 ===================================================================
3484 File: file7 Status: Locally Added
3486 Working revision: New file!
3487 Repository revision: No revision control file
3490 Sticky Options: (none)"
3492 # XXX why is this commented out???
3493 # if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
3499 dotest basic2-8 "${testcvs} -q ci -m 'second dive' first-dir" \
3500 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
3502 Checking in first-dir/file6;
3503 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
3504 initial revision: 1\.1
3506 RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
3508 Checking in first-dir/file7;
3509 ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
3510 initial revision: 1\.1
3512 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
3514 Checking in first-dir/dir1/file6;
3515 ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v <-- file6
3516 initial revision: 1\.1
3518 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
3520 Checking in first-dir/dir1/file7;
3521 ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v <-- file7
3522 initial revision: 1\.1
3524 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
3526 Checking in first-dir/dir1/dir2/file6;
3527 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v <-- file6
3528 initial revision: 1\.1
3530 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
3532 Checking in first-dir/dir1/dir2/file7;
3533 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v <-- file7
3534 initial revision: 1\.1
3537 dotest basic2-9 "${testcvs} tag second-dive first-dir" \
3538 "${PROG} tag: Tagging first-dir
3541 ${PROG} tag: Tagging first-dir/dir1
3542 T first-dir/dir1/file6
3543 T first-dir/dir1/file7
3544 ${PROG} tag: Tagging first-dir/dir1/dir2
3545 T first-dir/dir1/dir2/file6
3546 T first-dir/dir1/dir2/file7"
3548 # third dive - in bunch o' directories, add bunch o' files,
3549 # delete some, change some.
3551 for i in first-dir dir1 dir2 ; do
3560 dotest basic2-10-$i "${testcvs} rm file7" \
3561 "${PROG} remove: scheduling .file7. for removal
3562 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
3564 # and add a new file
3567 dotest basic2-11-$i "${testcvs} add file14" \
3568 "${PROG} add: scheduling file .file14. for addition
3569 ${PROG} add: use .${PROG} commit. to add this file permanently"
3573 dotest basic2-12 "${testcvs} update first-dir" \
3574 "${PROG} update: Updating first-dir
3578 ${PROG} update: Updating first-dir/dir1
3579 A first-dir/dir1/file14
3580 M first-dir/dir1/file6
3581 R first-dir/dir1/file7
3582 ${PROG} update: Updating first-dir/dir1/dir2
3583 A first-dir/dir1/dir2/file14
3584 M first-dir/dir1/dir2/file6
3585 R first-dir/dir1/dir2/file7"
3587 # FIXME: doesn't work right for added files
3588 dotest basic2-13 "${testcvs} log first-dir" \
3589 "${PROG} log: Logging first-dir
3590 ${PROG} log: file14 has been added, but not committed
3592 RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
3593 Working file: first-dir/file6
3600 keyword substitution: kv
3601 total revisions: 1; selected revisions: 1
3603 ----------------------------
3605 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3607 =============================================================================
3609 RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
3610 Working file: first-dir/file7
3617 keyword substitution: kv
3618 total revisions: 1; selected revisions: 1
3620 ----------------------------
3622 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3624 =============================================================================
3625 ${PROG} log: Logging first-dir/dir1
3626 ${PROG} log: file14 has been added, but not committed
3628 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
3629 Working file: first-dir/dir1/file6
3636 keyword substitution: kv
3637 total revisions: 1; selected revisions: 1
3639 ----------------------------
3641 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3643 =============================================================================
3645 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
3646 Working file: first-dir/dir1/file7
3653 keyword substitution: kv
3654 total revisions: 1; selected revisions: 1
3656 ----------------------------
3658 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3660 =============================================================================
3661 ${PROG} log: Logging first-dir/dir1/dir2
3662 ${PROG} log: file14 has been added, but not committed
3664 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
3665 Working file: first-dir/dir1/dir2/file6
3672 keyword substitution: kv
3673 total revisions: 1; selected revisions: 1
3675 ----------------------------
3677 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3679 =============================================================================
3681 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
3682 Working file: first-dir/dir1/dir2/file7
3689 keyword substitution: kv
3690 total revisions: 1; selected revisions: 1
3692 ----------------------------
3694 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
3696 ============================================================================="
3698 dotest basic2-14 "${testcvs} status first-dir" \
3699 "${PROG} status: Examining first-dir
3700 ===================================================================
3701 File: file14 Status: Locally Added
3703 Working revision: New file!
3704 Repository revision: No revision control file
3707 Sticky Options: (none)
3709 ===================================================================
3710 File: file6 Status: Locally Modified
3712 Working revision: 1\.1.*
3713 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file6,v
3716 Sticky Options: (none)
3718 ===================================================================
3719 File: no file file7 Status: Locally Removed
3721 Working revision: -1\.1.*
3722 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file7,v
3725 Sticky Options: (none)
3727 ${PROG} status: Examining first-dir/dir1
3728 ===================================================================
3729 File: file14 Status: Locally Added
3731 Working revision: New file!
3732 Repository revision: No revision control file
3735 Sticky Options: (none)
3737 ===================================================================
3738 File: file6 Status: Locally Modified
3740 Working revision: 1\.1.*
3741 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
3744 Sticky Options: (none)
3746 ===================================================================
3747 File: no file file7 Status: Locally Removed
3749 Working revision: -1\.1.*
3750 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
3753 Sticky Options: (none)
3755 ${PROG} status: Examining first-dir/dir1/dir2
3756 ===================================================================
3757 File: file14 Status: Locally Added
3759 Working revision: New file!
3760 Repository revision: No revision control file
3763 Sticky Options: (none)
3765 ===================================================================
3766 File: file6 Status: Locally Modified
3768 Working revision: 1\.1.*
3769 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
3772 Sticky Options: (none)
3774 ===================================================================
3775 File: no file file7 Status: Locally Removed
3777 Working revision: -1\.1.*
3778 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
3781 Sticky Options: (none)"
3783 # XXX why is this commented out?
3784 # if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
3790 dotest basic2-16 "${testcvs} ci -m 'third dive' first-dir" \
3791 "${PROG} [a-z]*: Examining first-dir
3792 ${PROG} [a-z]*: Examining first-dir/dir1
3793 ${PROG} [a-z]*: Examining first-dir/dir1/dir2
3794 RCS file: ${CVSROOT_DIRNAME}/first-dir/file14,v
3796 Checking in first-dir/file14;
3797 ${CVSROOT_DIRNAME}/first-dir/file14,v <-- file14
3798 initial revision: 1\.1
3800 Checking in first-dir/file6;
3801 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
3802 new revision: 1\.2; previous revision: 1\.1
3804 Removing first-dir/file7;
3805 ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
3806 new revision: delete; previous revision: 1\.1
3808 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file14,v
3810 Checking in first-dir/dir1/file14;
3811 ${CVSROOT_DIRNAME}/first-dir/dir1/file14,v <-- file14
3812 initial revision: 1\.1
3814 Checking in first-dir/dir1/file6;
3815 ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v <-- file6
3816 new revision: 1\.2; previous revision: 1\.1
3818 Removing first-dir/dir1/file7;
3819 ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v <-- file7
3820 new revision: delete; previous revision: 1\.1
3822 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v
3824 Checking in first-dir/dir1/dir2/file14;
3825 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v <-- file14
3826 initial revision: 1\.1
3828 Checking in first-dir/dir1/dir2/file6;
3829 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v <-- file6
3830 new revision: 1\.2; previous revision: 1\.1
3832 Removing first-dir/dir1/dir2/file7;
3833 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v <-- file7
3834 new revision: delete; previous revision: 1\.1
3836 dotest basic2-17 "${testcvs} -q update first-dir" ''
3838 dotest basic2-18 "${testcvs} tag third-dive first-dir" \
3839 "${PROG} tag: Tagging first-dir
3842 ${PROG} tag: Tagging first-dir/dir1
3843 T first-dir/dir1/file14
3844 T first-dir/dir1/file6
3845 ${PROG} tag: Tagging first-dir/dir1/dir2
3846 T first-dir/dir1/dir2/file14
3847 T first-dir/dir1/dir2/file6"
3849 dotest basic2-19 "echo yes | ${testcvs} release -d first-dir" \
3850 "You have \[0\] altered files in this repository\.
3851 Are you sure you want to release (and delete) directory .first-dir.: "
3854 dotest_fail basic2-20 "test -d first-dir" ""
3856 # now try some rtags
3859 dotest basic2-21 "${testcvs} rtag rtagged-by-head first-dir" \
3860 "${PROG} rtag: Tagging first-dir
3861 ${PROG} rtag: Tagging first-dir/dir1
3862 ${PROG} rtag: Tagging first-dir/dir1/dir2"
3863 # The next test used to cause an assert failure
3865 # cvs: ./recurse.c:667: do_recursion: Assertion `repository != ((void *)0)' failed.
3866 dotest basic2-21b "${testcvs} co -p -r rtagged-by-head first-dir/file6" \
3867 "===================================================================
3868 Checking out first-dir/file6
3869 RCS: $CVSROOT_DIRNAME/first-dir/file6,v
3871 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3875 dotest basic2-22 "${testcvs} rtag -r rtagged-by-head rtagged-by-tag first-dir" \
3876 "${PROG} rtag: Tagging first-dir
3877 ${PROG} rtag: Tagging first-dir/dir1
3878 ${PROG} rtag: Tagging first-dir/dir1/dir2"
3881 dotest basic2-23 "${testcvs} rtag -r1.1 rtagged-by-revision first-dir" \
3882 "${PROG} rtag: Tagging first-dir
3883 ${PROG} rtag: Tagging first-dir/dir1
3884 ${PROG} rtag: Tagging first-dir/dir1/dir2"
3887 dotest basic2-24 "${testcvs} rdiff -r1.1 -rrtagged-by-head first-dir" \
3888 "${PROG} rdiff: Diffing first-dir
3889 Index: first-dir/file6
3890 diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
3891 \*\*\* first-dir/file6:1\.1 ${DATE}
3892 --- first-dir/file6 ${DATE}
3893 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3898 Index: first-dir/file7
3899 diff -c first-dir/file7:1\.1 first-dir/file7:removed
3900 \*\*\* first-dir/file7:1.1 ${DATE}
3901 --- first-dir/file7 ${DATE}
3902 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3906 ${PROG} rdiff: Diffing first-dir/dir1
3907 Index: first-dir/dir1/file6
3908 diff -c first-dir/dir1/file6:1\.1 first-dir/dir1/file6:1\.2
3909 \*\*\* first-dir/dir1/file6:1\.1 ${DATE}
3910 --- first-dir/dir1/file6 ${DATE}
3911 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3916 Index: first-dir/dir1/file7
3917 diff -c first-dir/dir1/file7:1\.1 first-dir/dir1/file7:removed
3918 \*\*\* first-dir/dir1/file7:1\.1 ${DATE}
3919 --- first-dir/dir1/file7 ${DATE}
3920 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3924 ${PROG} rdiff: Diffing first-dir/dir1/dir2
3925 Index: first-dir/dir1/dir2/file6
3926 diff -c first-dir/dir1/dir2/file6:1\.1 first-dir/dir1/dir2/file6:1\.2
3927 \*\*\* first-dir/dir1/dir2/file6:1\.1 ${DATE}
3928 --- first-dir/dir1/dir2/file6 ${DATE}
3929 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3934 Index: first-dir/dir1/dir2/file7
3935 diff -c first-dir/dir1/dir2/file7:1\.1 first-dir/dir1/dir2/file7:removed
3936 \*\*\* first-dir/dir1/dir2/file7:1\.1 ${DATE}
3937 --- first-dir/dir1/dir2/file7 ${DATE}
3938 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3942 dotest basic2-24a "${testcvs} rdiff -l -r1.1 -rrtagged-by-head first-dir" \
3943 "${PROG} rdiff: Diffing first-dir
3944 Index: first-dir/file6
3945 diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
3946 \*\*\* first-dir/file6:1\.1 ${DATE}
3947 --- first-dir/file6 ${DATE}
3948 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3953 Index: first-dir/file7
3954 diff -c first-dir/file7:1\.1 first-dir/file7:removed
3955 \*\*\* first-dir/file7:1.1 ${DATE}
3956 --- first-dir/file7 ${DATE}
3957 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
3961 # now export by rtagged-by-head and rtagged-by-tag and compare.
3962 dotest basic2-25 "${testcvs} export -r rtagged-by-head -d 1dir first-dir" \
3963 "${PROG} export: Updating 1dir
3966 ${PROG} export: Updating 1dir/dir1
3969 ${PROG} export: Updating 1dir/dir1/dir2
3970 U 1dir/dir1/dir2/file14
3971 U 1dir/dir1/dir2/file6"
3972 dotest_fail basic2-25a "test -d 1dir/CVS"
3973 dotest_fail basic2-25b "test -d 1dir/dir1/CVS"
3974 dotest_fail basic2-25c "test -d 1dir/dir1/dir2/CVS"
3976 dotest basic2-26 "${testcvs} export -r rtagged-by-tag first-dir" \
3977 "${PROG} export: Updating first-dir
3980 ${PROG} export: Updating first-dir/dir1
3981 U first-dir/dir1/file14
3982 U first-dir/dir1/file6
3983 ${PROG} export: Updating first-dir/dir1/dir2
3984 U first-dir/dir1/dir2/file14
3985 U first-dir/dir1/dir2/file6"
3986 dotest_fail basic2-26a "test -d first-dir/CVS"
3987 dotest_fail basic2-26b "test -d first-dir/dir1/CVS"
3988 dotest_fail basic2-26c "test -d first-dir/dir1/dir2/CVS"
3990 dotest basic2-27 "directory_cmp 1dir first-dir"
3991 rm -r 1dir first-dir
3993 # checkout by revision vs export by rtagged-by-revision and compare.
3995 dotest basic2-28 "${testcvs} export -rrtagged-by-revision -d export-dir first-dir" \
3996 "${PROG} export: Updating export-dir
4000 ${PROG} export: Updating export-dir/dir1
4001 U export-dir/dir1/file14
4002 U export-dir/dir1/file6
4003 U export-dir/dir1/file7
4004 ${PROG} export: Updating export-dir/dir1/dir2
4005 U export-dir/dir1/dir2/file14
4006 U export-dir/dir1/dir2/file6
4007 U export-dir/dir1/dir2/file7"
4008 dotest_fail basic2-28a "test -d export-dir/CVS"
4009 dotest_fail basic2-28b "test -d export-dir/dir1/CVS"
4010 dotest_fail basic2-28c "test -d export-dir/dir1/dir2/CVS"
4012 dotest basic2-29 "${testcvs} co -r1.1 first-dir" \
4013 "${PROG} checkout: Updating first-dir
4017 ${PROG} checkout: Updating first-dir/dir1
4018 U first-dir/dir1/file14
4019 U first-dir/dir1/file6
4020 U first-dir/dir1/file7
4021 ${PROG} checkout: Updating first-dir/dir1/dir2
4022 U first-dir/dir1/dir2/file14
4023 U first-dir/dir1/dir2/file6
4024 U first-dir/dir1/dir2/file7"
4026 # directory copies are done in an oblique way in order to avoid a bug in sun's tmp filesystem.
4027 mkdir first-dir.cpy ; (cd first-dir ; tar cf - . | (cd ../first-dir.cpy ; tar xf -))
4029 dotest basic2-30 "directory_cmp first-dir export-dir"
4031 # interrupt, while we've got a clean 1.1 here, let's import it
4032 # into a couple of other modules.
4034 dotest_sort basic2-31 "${testcvs} import -m first-import second-dir first-immigration immigration1 immigration1_0" \
4037 N second-dir/dir1/dir2/file14
4038 N second-dir/dir1/dir2/file6
4039 N second-dir/dir1/dir2/file7
4040 N second-dir/dir1/file14
4041 N second-dir/dir1/file6
4042 N second-dir/dir1/file7
4046 No conflicts created by this import
4047 ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/dir1
4048 ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/dir1/dir2"
4051 dotest basic2-32 "${testcvs} export -r HEAD second-dir" \
4052 "${PROG} export: Updating second-dir
4056 ${PROG} export: Updating second-dir/dir1
4057 U second-dir/dir1/file14
4058 U second-dir/dir1/file6
4059 U second-dir/dir1/file7
4060 ${PROG} export: Updating second-dir/dir1/dir2
4061 U second-dir/dir1/dir2/file14
4062 U second-dir/dir1/dir2/file6
4063 U second-dir/dir1/dir2/file7"
4065 dotest basic2-33 "directory_cmp first-dir second-dir"
4069 rm -r export-dir first-dir
4071 (cd first-dir.cpy ; tar cf - . | (cd ../first-dir ; tar xf -))
4073 # update the top, cancelling sticky tags, retag, update other copy, compare.
4075 dotest basic2-34 "${testcvs} update -A -l *file*" \
4077 ${PROG} update: file7 is no longer in the repository"
4079 # If we don't delete the tag first, cvs won't retag it.
4080 # This would appear to be a feature.
4081 dotest basic2-35 "${testcvs} tag -l -d rtagged-by-revision" \
4082 "${PROG} tag: Untagging \.
4085 dotest basic2-36 "${testcvs} tag -l rtagged-by-revision" \
4086 "${PROG} tag: Tagging \.
4092 mv first-dir.cpy first-dir
4095 dotest basic2-37 "${testcvs} -q diff -u" ''
4097 dotest basic2-38 "${testcvs} update" \
4098 "${PROG} update: Updating .
4099 ${PROG} update: Updating dir1
4100 ${PROG} update: Updating dir1/dir2"
4104 #### FIXME: is this expected to work??? Need to investigate
4105 #### and fix or remove the test.
4106 # dotest basic2-39 "directory_cmp 1dir first-dir"
4108 rm -r 1dir first-dir
4110 # Test the cvs history command.
4112 # The reason that there are two patterns rather than using
4113 # \(${TESTDIR}\|<remote>\) is that we are trying to
4114 # make this portable. Perhaps at some point we should
4115 # ditch that notion and require GNU expr (or dejagnu or....)
4116 # since it seems to be so painful.
4118 # why are there two lines at the end of the local output
4119 # which don't exist in the remote output? would seem to be
4121 dotest basic2-64 "${testcvs} his -x TOFWUPCGMAR -a" \
4122 "O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= ${TESTDIR}/\*
4123 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == ${TESTDIR}
4124 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == ${TESTDIR}
4125 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == ${TESTDIR}
4126 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == ${TESTDIR}
4127 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == ${TESTDIR}
4128 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == ${TESTDIR}
4129 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == ${TESTDIR}
4130 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TESTDIR}
4131 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TESTDIR}
4132 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == ${TESTDIR}
4133 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == ${TESTDIR}
4134 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == ${TESTDIR}
4135 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == ${TESTDIR}
4136 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == ${TESTDIR}
4137 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == ${TESTDIR}
4138 F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= ${TESTDIR}/\*
4139 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
4140 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
4141 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
4142 O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= ${TESTDIR}/\*
4143 U [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TESTDIR}/first-dir
4144 W [0-9-]* [0-9:]* ${PLUS}0000 ${username} file7 first-dir == ${TESTDIR}/first-dir" \
4145 "O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= <remote>/\*
4146 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == <remote>
4147 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == <remote>
4148 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == <remote>
4149 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == <remote>
4150 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == <remote>
4151 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == <remote>
4152 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == <remote>
4153 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
4154 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == <remote>
4155 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == <remote>
4156 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == <remote>
4157 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == <remote>
4158 A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == <remote>
4159 M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == <remote>
4160 R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == <remote>
4161 F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= <remote>/\*
4162 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
4163 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
4164 T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
4165 O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= <remote>/\*
4166 P [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
4167 W [0-9-]* [0-9:]* ${PLUS}0000 ${username} file7 first-dir == <remote>"
4169 rm -rf ${CVSROOT_DIRNAME}/first-dir
4170 rm -rf ${CVSROOT_DIRNAME}/second-dir
4175 # Test odd cases involving CVSROOT. At the moment, that means we
4176 # are testing roots with '/'s on the end, which CVS should parse off.
4177 CVSROOT_save=${CVSROOT}
4178 CVSROOT="${CVSROOT}/////"
4179 dotest parseroot-1 "${testcvs} -q co CVSROOT/modules" \
4181 dotest parseroot-2 "${testcvs} -q ci -fmnull-change CVSROOT/modules" \
4182 "Checking in CVSROOT/modules;
4183 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
4184 new revision: 1\.2; previous revision: 1\.1
4186 ${PROG} commit: Rebuilding administrative file database"
4189 # I only test these when testing remote in case CVS was compiled
4190 # without client support.
4192 # logout does not try to contact the server.
4193 CVSROOT=":pserver;proxy=localhost;proxyport=8080:localhost/dev/null"
4194 dotest parseroot-3r "$testcvs -d'$CVSROOT' logout" \
4195 "$PROG logout: WARNING: Ignoring method options found in CVSROOT: \`proxy=localhost;proxyport=8080'\.
4196 $PROG logout: Use CVS version 1\.12\.7 or later to handle method options\.
4197 Logging out of :pserver:$username@localhost:2401/dev/null
4198 $PROG logout: warning: failed to open $HOME/\.cvspass for reading: No such file or directory
4199 $PROG logout: Entry not found\."
4203 echo Keeping $TESTDIR and exiting due to --keep
4207 CVSROOT=$CVSROOT_save
4215 # Test of how we specify files on the command line
4216 # (recurse.c and that sort of thing). Vaguely similar to
4217 # tests like basic* and deep. See modules and such tests
4218 # for what happens when we throw in modules and co -d, &c.
4220 # This particular test is fairly carefully crafted, to spot
4221 # one particular issue with remote.
4223 dotest files-1 "${testcvs} -q co -l ." ""
4225 dotest files-2 "${testcvs} add first-dir" \
4226 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
4229 dotest files-3 "${testcvs} add tfile" \
4230 "${PROG} add: scheduling file .tfile. for addition
4231 ${PROG} add: use .${PROG} commit. to add this file permanently"
4232 dotest files-4 "${testcvs} -q ci -m add" \
4233 "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
4236 ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
4237 initial revision: 1\.1
4239 dotest files-5 "${testcvs} -q tag -b C" "T tfile"
4240 dotest files-6 "$testcvs -q update -r C" "U tfile"
4242 dotest files-7 "${testcvs} add dir" \
4243 "Directory ${CVSROOT_DIRNAME}/first-dir/dir added to the repository
4244 --> Using per-directory sticky tag .C'"
4247 dotest files-6 "${testcvs} add .file" \
4248 "${PROG} add: scheduling file .\.file' for addition on branch .C.
4249 ${PROG} add: use .${PROG} commit. to add this file permanently"
4251 dotest files-7 "${testcvs} add sdir" \
4252 "Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir added to the repository
4253 --> Using per-directory sticky tag .C'"
4256 dotest files-8 "${testcvs} add ssdir" \
4257 "Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir added to the repository
4258 --> Using per-directory sticky tag .C'"
4261 dotest files-9 "${testcvs} add .file" \
4262 "${PROG} add: scheduling file .\.file' for addition on branch .C.
4263 ${PROG} add: use .${PROG} commit. to add this file permanently"
4265 dotest files-10 "${testcvs} -q ci -m test" \
4266 "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v
4269 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
4270 new revision: 1\.1\.2\.1; previous revision: 1\.1
4272 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v
4274 Checking in sdir/ssdir/\.file;
4275 ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
4276 new revision: 1\.1\.2\.1; previous revision: 1\.1
4279 "${testcvs} commit -m test -f ./.file ./sdir/ssdir/.file" \
4280 "Checking in \.file;
4281 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
4282 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
4284 Checking in \./sdir/ssdir/\.file;
4285 ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
4286 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
4290 # This is a bug, looks like that toplevel_repos cruft in
4291 # client.c is coming back to haunt us.
4292 # May want to think about the whole issue, toplevel_repos
4293 # has always been crufty and trying to patch it up again
4294 # might be a mistake.
4296 "${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
4297 "Checking in \./sdir/ssdir/\.file;
4298 ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
4299 new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
4302 # Sync up the version numbers so that the rest of the
4303 # tests don't need to expect different numbers based
4305 dotest files-12-workaround \
4306 "${testcvs} commit -f -m test .file" \
4307 "Checking in \.file;
4308 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
4309 new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
4313 "${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
4314 "Checking in \./sdir/ssdir/\.file;
4315 ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
4316 new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
4319 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
4320 new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
4324 "${testcvs} commit -fmtest ./sdir/../sdir/ssdir/..///ssdir/.file" \
4325 "Checking in \./sdir/\.\./sdir/ssdir/\.\.///ssdir/\.file;
4326 ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
4327 new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
4331 "${testcvs} commit -fmtest ../../first-dir/dir/.file" \
4332 "Checking in \.\./\.\./first-dir/dir/\.file;
4333 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- .file
4334 new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
4338 "${testcvs} commit -fmtest ../../first-dir/dir/.file" \
4339 "Checking in \.\./\.\./first-dir/dir/\.file;
4340 ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
4341 new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
4347 rm -rf ${CVSROOT_DIRNAME}/first-dir
4351 # More filename tests, in particular spaces in file names.
4352 # (it might be better to just change a few of the names in
4353 # basica or some other test instead, always good to keep the
4354 # testsuite concise).
4357 dotest spacefiles-1 "${testcvs} -q co -l ." ""
4359 dotest spacefiles-2 "${testcvs} add -- -c" \
4360 "${PROG} add: scheduling file .-c. for addition
4361 ${PROG} add: use .${PROG} commit. to add this file permanently"
4362 dotest spacefiles-3 "${testcvs} -q ci -m add" \
4363 "RCS file: ${CVSROOT_DIRNAME}/-c,v
4366 ${CVSROOT_DIRNAME}/-c,v <-- -c
4367 initial revision: 1\.1
4370 dotest spacefiles-4 "${testcvs} add 'first dir'" \
4371 "Directory ${CVSROOT_DIRNAME}/first dir added to the repository"
4373 dotest spacefiles-5 "${testcvs} add -- -b" \
4374 "Directory ${CVSROOT_DIRNAME}/-b added to the repository"
4377 dotest spacefiles-6 "${testcvs} add 'a file'" \
4378 "${PROG} add: scheduling file .a file. for addition
4379 ${PROG} add: use .${PROG} commit. to add this file permanently"
4380 dotest spacefiles-7 "${testcvs} -q ci -m add" \
4381 "RCS file: ${CVSROOT_DIRNAME}/first dir/a file,v
4384 ${CVSROOT_DIRNAME}/first dir/a file,v <-- a file
4385 initial revision: 1\.1
4387 dotest spacefiles-8 "${testcvs} -q tag new-tag" "T a file"
4391 dotest spacefiles-10 "${testcvs} co -- -b" \
4392 "${PROG} checkout: Updating -b"
4393 dotest spacefiles-11 "${testcvs} -q co -- -c" "U \./-c"
4395 dotest spacefiles-13 "${testcvs} -q co 'first dir'" \
4396 "U first dir/a file"
4400 dotest spacefiles-14 "${testcvs} -q co 'first dir/a file'" \
4401 "U first dir/a file"
4405 rm -rf "${CVSROOT_DIRNAME}/first dir"
4406 rm -r ${CVSROOT_DIRNAME}/-b
4407 rm -f ${CVSROOT_DIRNAME}/-c,v
4415 dotest commit-readonly-1 "$testcvs -Q import -m . $module X Y" ''
4416 dotest commit-readonly-2 "$testcvs -Q co $module" ''
4421 # Include an rcs keyword to be expanded.
4422 echo '$Id''$' > $file
4424 dotest commit-readonly-3 "$testcvs add $file" \
4425 "${PROG} add: scheduling file .$file. for addition
4426 ${PROG} add: use .${PROG} commit. to add this file permanently"
4427 dotest commit-readonly-4 "$testcvs -Q ci -m . $file" \
4428 "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
4431 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
4432 initial revision: 1\.1
4436 # Make the file read-only.
4439 dotest commit-readonly-5 "$testcvs -Q ci -m . $file" \
4441 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
4442 new revision: 1\.2; previous revision: 1\.1
4447 rm -rf ${CVSROOT_DIRNAME}/$module
4451 # This tests for a bug in the status command which failed to
4452 # notice resolved conflicts.
4453 mkdir status; cd status
4454 dotest status-init-1 "${testcvs} -q co -l ." ""
4456 dotest status-init-2 "${testcvs} add first-dir" \
4457 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
4460 dotest status-init-3 "${testcvs} add tfile" \
4461 "${PROG} add: scheduling file .tfile. for addition
4462 ${PROG} add: use .${PROG} commit. to add this file permanently"
4463 dotest status-init-4 "${testcvs} -q ci -m add" \
4464 "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
4467 ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
4468 initial revision: 1\.1
4471 dotest status-init-5 "${testcvs} -q co -dsecond-dir first-dir" \
4472 "U second-dir/tfile"
4474 echo some junk >>tfile
4475 dotest status-init-6 "${testcvs} -q ci -maline" \
4477 ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
4478 new revision: 1\.2; previous revision: 1\.1
4481 echo force a conflict >>tfile
4482 dotest status-init-7 "${testcvs} -q up" \
4483 "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
4484 retrieving revision 1\.1
4485 retrieving revision 1\.2
4486 Merging differences between 1\.1 and 1\.2 into tfile
4487 rcsmerge: warning: conflicts during merge
4488 ${PROG} update: conflicts found in tfile
4491 # Now note our status
4492 dotest status-1 "${testcvs} status tfile" \
4493 "===================================================================
4494 File: tfile Status: Unresolved Conflict
4496 Working revision: 1\.2.*
4497 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
4500 Sticky Options: (none)"
4502 # touch the file, leaving conflict markers in place
4503 # and note our status
4505 dotest status-2 "${testcvs} status tfile" \
4506 "===================================================================
4507 File: tfile Status: File had conflicts on merge
4509 Working revision: 1\.2.*
4510 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
4513 Sticky Options: (none)"
4515 # resolve the conflict
4516 echo resolution >tfile
4517 dotest status-3 "${testcvs} status tfile" \
4518 "===================================================================
4519 File: tfile Status: Locally Modified
4521 Working revision: 1\.2.*
4522 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
4525 Sticky Options: (none)"
4527 # Check that there are no problems just using CVS/Root too.
4528 save_CVSROOT=$CVSROOT
4530 dotest status-3a "${testcvs} status tfile" \
4531 "===================================================================
4532 File: tfile Status: Locally Modified
4534 Working revision: 1\.2.*
4535 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
4538 Sticky Options: (none)"
4539 CVSROOT=$save_CVSROOT
4543 # Update is supposed to re-Register() the file when it
4544 # finds resolved conflicts:
4545 dotest status-4 "grep 'Result of merge' CVS/Entries" \
4546 "/tfile/1\.2/Result of merge${PLUS}[a-zA-Z0-9 :]*//"
4550 dotest status-init-8 "$testcvs add fourth-dir" \
4551 "Directory $CVSROOT_DIRNAME/fourth-dir added to the repository"
4553 echo yet another line >t3file
4554 dotest status-init-9 "$testcvs add t3file" \
4555 "$PROG add: scheduling file .t3file. for addition
4556 $PROG add: use .$PROG commit. to add this file permanently"
4557 dotest status-init-10 "$testcvs -q ci -m add" \
4558 "RCS file: $CVSROOT_DIRNAME/fourth-dir/t3file,v
4561 $CVSROOT_DIRNAME/fourth-dir/t3file,v <-- t3file
4562 initial revision: 1\.1
4566 dotest status-init-11 "$testcvs add third-dir" \
4567 "Directory $CVSROOT_DIRNAME/first-dir/third-dir added to the repository"
4569 echo another line >t2file
4570 dotest status-init-12 "$testcvs add t2file" \
4571 "$PROG add: scheduling file .t2file. for addition
4572 $PROG add: use .$PROG commit. to add this file permanently"
4573 dotest status-init-13 "$testcvs -q ci -m add" \
4574 "RCS file: $CVSROOT_DIRNAME/first-dir/third-dir/t2file,v
4577 $CVSROOT_DIRNAME/first-dir/third-dir/t2file,v <-- t2file
4578 initial revision: 1\.1
4580 dotest status-5 "$testcvs status ../tfile" \
4581 "===================================================================
4582 File: tfile Status: Locally Modified
4584 Working revision: 1\.2.*
4585 Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/tfile,v
4588 Sticky Options: (none)"
4589 dotest status-6 "$testcvs status ../../fourth-dir/t3file" \
4590 "===================================================================
4591 File: t3file Status: Up-to-date
4593 Working revision: 1\.1.*
4594 Repository revision: 1\.1 $CVSROOT_DIRNAME/fourth-dir/t3file,v
4597 Sticky Options: (none)"
4600 echo Keeping $TESTDIR and exiting due to --keep
4606 rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/fourth-dir
4611 # XXX for now this is just the most essential test...
4617 echo '$''Name$' >> foo
4619 echo '$''Name$' >> bar
4620 dotest_sort rdiff-1 \
4621 "${testcvs} import -I ! -m test-import-with-keyword trdiff TRDIFF T1" \
4626 No conflicts created by this import'
4628 "${testcvs} co -ko trdiff" \
4629 "${PROG} checkout: Updating trdiff
4633 echo something >> foo
4635 "${testcvs} ci -m added-something foo" \
4637 ${CVSROOT_DIRNAME}/trdiff/foo,v <-- foo
4638 new revision: 1\.2; previous revision: 1\.1
4640 echo '#ident "@(#)trdiff:$''Name$:$''Id$"' > new
4641 echo "new file" >> new
4643 "${testcvs} add -m new-file-description new" \
4644 "${PROG} add: scheduling file \`new' for addition
4645 ${PROG} add: use .${PROG} commit. to add this file permanently"
4647 "${testcvs} commit -m added-new-file new" \
4648 "RCS file: ${CVSROOT_DIRNAME}/trdiff/new,v
4651 ${CVSROOT_DIRNAME}/trdiff/new,v <-- new
4652 initial revision: 1\.1
4655 "${testcvs} tag local-v0" \
4656 "${PROG} tag: Tagging .
4661 "${testcvs} status -v foo" \
4662 "===================================================================
4663 File: foo Status: Up-to-date
4665 Working revision: 1\.2.*
4666 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/trdiff/foo,v
4672 local-v0 (revision: 1\.2)
4673 T1 (revision: 1\.1\.1\.1)
4674 TRDIFF (branch: 1\.1\.1)"
4680 "${testcvs} rdiff -r T1 -r local-v0 trdiff" \
4681 "${PROG}"' rdiff: Diffing trdiff
4683 diff -c trdiff/foo:1\.1\.1\.1 trdiff/foo:1\.2
4684 \*\*\* trdiff/foo:1\.1\.1\.1 '"${DATE}"'
4685 --- trdiff/foo '"${DATE}"'
4686 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4688 ! \$''Id: foo,v 1\.1\.1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$
4691 ! \$''Id: foo,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
4692 ! \$''Name: local-v0 \$
4695 diff -c /dev/null trdiff/new:1\.1
4696 \*\*\* /dev/null '"${DATE}"'
4697 --- trdiff/new '"${DATE}"'
4698 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4701 '"${PLUS}"' #ident "@(#)trdiff:\$''Name: local-v0 \$:\$''Id: new,v 1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$"
4702 '"${PLUS}"' new file'
4705 echo Keeping ${TESTDIR} and exiting due to --keep
4711 rm -rf ${CVSROOT_DIRNAME}/trdiff
4715 # Test that the short patch behaves as expected
4718 # 3) Different revision number with no difference.
4719 # 4) Different revision number with changes.
4721 # 6) Same revision number (no difference).
4722 mkdir rdiff-short; cd rdiff-short
4724 dotest rdiff-short-init-1 \
4725 "${testcvs} -q import -I ! -m initial-import abc vendor initial" \
4727 No conflicts created by this import'
4729 dotest rdiff-short-init-2 "${testcvs} -q get abc" ''
4731 echo "abc" >file1.txt
4732 dotest rdiff-short-init-3 "${testcvs} add file1.txt" \
4733 "${PROG} add: scheduling file .file1\.txt' for addition
4734 ${PROG} add: use .${PROG} commit. to add this file permanently"
4735 dotest rdiff-short-init-4 \
4736 "${testcvs} commit -madd-file1 file1.txt" \
4737 "RCS file: ${CVSROOT_DIRNAME}/abc/file1\.txt,v
4739 Checking in file1\.txt;
4740 ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
4741 initial revision: 1\.1
4743 echo def >>file1.txt
4744 dotest rdiff-short-init-5 \
4745 "${testcvs} commit -mchange-file1 file1.txt" \
4746 "Checking in file1\.txt;
4747 ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
4748 new revision: 1\.2; previous revision: 1\.1
4750 echo "abc" >file1.txt
4751 dotest rdiff-short-init-6 \
4752 "${testcvs} commit -mrestore-file1-rev1 file1.txt" \
4753 "Checking in file1\.txt;
4754 ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
4755 new revision: 1\.3; previous revision: 1\.2
4757 dotest rdiff-short-init-7 \
4758 "${testcvs} tag -r 1.1 tag1 file1.txt" \
4760 dotest rdiff-short-init-8 \
4761 "${testcvs} tag -r 1.2 tag2 file1.txt" \
4763 dotest rdiff-short-init-9 \
4764 "${testcvs} tag -r 1.3 tag3 file1.txt" \
4766 echo "abc" >file2.txt
4767 dotest rdiff-short-init-10 \
4768 "${testcvs} add file2.txt" \
4769 "${PROG} add: scheduling file .file2\.txt' for addition
4770 ${PROG} add: use .${PROG} commit. to add this file permanently"
4771 dotest rdiff-add-remove-nodiff-init-11 \
4772 "${testcvs} commit -madd-file2 file2.txt" \
4773 "RCS file: ${CVSROOT_DIRNAME}/abc/file2\.txt,v
4775 Checking in file2\.txt;
4776 ${CVSROOT_DIRNAME}/abc/file2\.txt,v <-- file2\.txt
4777 initial revision: 1\.1
4779 dotest rdiff-short-init-12 \
4780 "${testcvs} tag -r 1.1 tag4 file2.txt" \
4782 dotest rdiff-short-init-13 \
4783 "${testcvs} tag -r 1.1 tag5 file2.txt" \
4788 # 3) Different revision number with no difference.
4789 dotest rdiff-short-no-real-change \
4790 "${testcvs} -q rdiff -s -r tag1 -r tag3 abc"
4792 # 4) Different revision number with changes.
4793 dotest rdiff-short-real-change \
4794 "${testcvs} -q rdiff -s -r tag1 -r tag2 abc" \
4795 'File abc/file1.txt changed from revision 1\.1 to 1\.2'
4799 dotest_sort rdiff-short-remove-add \
4800 "${testcvs} -q rdiff -s -r tag2 -r tag4 abc" \
4801 'File abc/file1\.txt is removed; tag2 revision 1\.2
4802 File abc/file2\.txt is new; tag4 revision 1\.1'
4804 # 6) Same revision number (no difference).
4805 dotest rdiff-short-no-change \
4806 "${testcvs} -q rdiff -s -r tag4 -r tag5 abc"
4809 # Check that the messages change when we diff against the trunk
4810 # rather than a tag or date.
4811 dotest rdiff-short-against-trunk-1 \
4812 "${testcvs} -q rdiff -s -rtag4 abc" \
4813 "File abc/file1\.txt is new; current revision 1\.3"
4815 dotest rdiff-short-against-trunk-2 \
4816 "${testcvs} -q rdiff -s -rtag2 abc" \
4817 "File abc/file1\.txt changed from revision 1\.2 to 1\.3
4818 File abc/file2\.txt is new; current revision 1\.1"
4820 rm -rf ${CVSROOT_DIRNAME}/abc
4824 # Test for the segv problem reported by James Cribb
4826 mkdir rdiff2; cd rdiff2
4827 # Create a module "m" with files "foo" and "d/bar"
4832 dotest_sort rdiff2-1 \
4833 "${testcvs} -q import -I ! -m initial-import m vendor initial" \
4838 No conflicts created by this import'
4844 dotest rdiff2-2 "${testcvs} get m" \
4845 "${PROG} checkout: Updating m
4847 ${PROG} checkout: Updating m/d
4850 dotest rdiff2-3 "${testcvs} rm -f foo" \
4851 "${PROG} remove: scheduling .foo. for removal
4852 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
4854 dotest rdiff2-4 "${testcvs} commit -m Removed foo" \
4856 ${CVSROOT_DIRNAME}/m/foo,v <-- foo
4857 new revision: delete; previous revision: 1\.1\.1\.1
4862 dotest rdiff2-5 "${testcvs} commit -m Changed d/bar" \
4864 ${CVSROOT_DIRNAME}/m/d/bar,v <-- bar
4865 new revision: 1\.2; previous revision: 1\.1
4868 # Crash before showing d/bar diffs
4869 dotest_fail rdiff2-6 "${testcvs} rdiff -t m" \
4870 "${PROG} rdiff: Diffing m
4871 ${PROG} rdiff: Diffing m/d
4873 diff -c m/d/bar:1\.1\.1\.1 m/d/bar:1\.2
4874 \*\*\* m/d/bar:1\.1\.1\.1 ${DATE}
4876 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4882 echo Keeping ${TESTDIR} and exiting due to --keep
4887 rm -rf ${CVSROOT_DIRNAME}/m
4891 # Various tests specific to the "cvs diff" command.
4894 # rcslib: cvs diff and $Name.
4896 # diffmerge*: nuts and bolts (stuff within diff library)
4898 dotest diff-1 "${testcvs} -q co -l ." ''
4900 dotest diff-2 "${testcvs} add first-dir" \
4901 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
4904 # diff is anomalous. Most CVS commands print the "nothing
4905 # known" message (or worse yet, no message in some cases) but
4906 # diff says "I know nothing". Shrug.
4907 dotest_fail diff-3 "${testcvs} diff xyzpdq" \
4908 "${PROG} diff: I know nothing about xyzpdq"
4910 dotest diff-4 "${testcvs} add abc" \
4911 "${PROG} add: scheduling file .abc. for addition
4912 ${PROG} add: use .${PROG} commit. to add this file permanently"
4913 dotest diff-5 "${testcvs} -q ci -mtest" \
4914 "RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4917 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
4918 initial revision: 1\.1
4920 echo "extern int gethostname ();" >abc
4921 dotest diff-6 "${testcvs} -q ci -mtest" \
4923 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
4924 new revision: 1\.2; previous revision: 1\.1
4926 echo "#include <winsock.h>" >abc
4927 # check the behavior of the --ifdef=MACRO option
4928 dotest_fail diff-7 "${testcvs} -q diff --ifdef=HAVE_WINSOCK_H" \
4930 ===================================================================
4931 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4932 retrieving revision 1\.2
4933 diff --ifdef HAVE_WINSOCK_H -r1\.2 abc
4934 #ifndef HAVE_WINSOCK_H
4935 extern int gethostname ();
4936 #else /\* HAVE_WINSOCK_H \*/
4937 #include <winsock\.h>
4938 #endif /\* HAVE_WINSOCK_H \*/"
4941 echo Keeping ${TESTDIR} and exiting due to --keep
4946 rm -rf ${CVSROOT_DIRNAME}/first-dir
4951 # Test handling of 'cvs diff' of files without newlines
4953 dotest diffnl-000 "${testcvs} -q co -l ." ''
4955 dotest diffnl-001 "${testcvs} add first-dir" \
4956 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
4959 ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nfive\nsix")}' </dev/null >abc
4960 dotest diffnl-002 "${testcvs} add abc" \
4961 "${PROG} add: scheduling file .abc. for addition
4962 ${PROG} add: use .${PROG} commit. to add this file permanently"
4963 dotest diffnl-003 "${testcvs} -q ci -mtest" \
4964 "RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4967 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
4968 initial revision: 1\.1
4971 # change to line near EOF
4972 ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nsix")}' </dev/null >abc
4973 dotest_fail diffnl-100 "${testcvs} diff abc" \
4975 ===================================================================
4976 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4977 retrieving revision 1\.1
4981 dotest_fail diffnl-101 "${testcvs} diff -u abc" \
4983 ===================================================================
4984 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
4985 retrieving revision 1\.1
4987 --- abc ${RFCDATE} 1\.1
4995 \\\\ No newline at end of file"
4996 dotest diffnl-102 "${testcvs} -q ci -mtest abc" \
4998 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
4999 new revision: 1\.2; previous revision: 1\.1
5002 # Change to last line
5003 ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nseven")}' </dev/null >abc
5004 dotest_fail diffnl-200 "${testcvs} diff abc" \
5006 ===================================================================
5007 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5008 retrieving revision 1\.2
5012 \\\\ No newline at end of file
5015 \\\\ No newline at end of file"
5016 dotest_fail diffnl-201 "${testcvs} diff -u abc" \
5018 ===================================================================
5019 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5020 retrieving revision 1\.2
5022 --- abc ${RFCDATE} 1\.2
5029 \\\\ No newline at end of file
5031 \\\\ No newline at end of file"
5032 dotest diffnl-202 "${testcvs} ci -mtest abc" \
5034 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
5035 new revision: 1\.3; previous revision: 1\.2
5038 # Addition of newline
5044 dotest_fail diffnl-300 "${testcvs} diff abc" \
5046 ===================================================================
5047 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5048 retrieving revision 1\.3
5052 \\\\ No newline at end of file
5055 dotest_fail diffnl-301 "${testcvs} diff -u abc" \
5057 ===================================================================
5058 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5059 retrieving revision 1\.3
5061 --- abc ${RFCDATE} 1\.3
5068 \\\\ No newline at end of file
5070 dotest diffnl-302 "${testcvs} ci -mtest abc" \
5072 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
5073 new revision: 1\.4; previous revision: 1\.3
5076 # Removal of newline
5077 ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nseven")}' </dev/null >abc
5078 dotest_fail diffnl-400 "${testcvs} diff abc" \
5080 ===================================================================
5081 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5082 retrieving revision 1\.4
5088 \\\\ No newline at end of file"
5089 dotest_fail diffnl-401 "${testcvs} diff -u abc" \
5091 ===================================================================
5092 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5093 retrieving revision 1\.4
5095 --- abc ${RFCDATE} 1\.4
5103 \\\\ No newline at end of file"
5107 rm -rf ${CVSROOT_DIRNAME}/first-dir
5111 # next dive. test death support.
5113 # NOTE: this section has reached the size and
5114 # complexity where it is getting to be a good idea to
5115 # add new death support tests to a new section rather
5116 # than continuing to piggyback them onto the tests here.
5118 mkdir ${CVSROOT_DIRNAME}/first-dir
5119 if ${CVS} co first-dir ; then
5127 # Create a directory with only dead files, to make sure CVS
5128 # doesn't get confused by it.
5130 dotest 65a0 "${testcvs} add subdir" \
5131 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
5133 echo file in subdir >sfile
5134 dotest 65a1 "${testcvs} add sfile" \
5135 "${PROG}"' add: scheduling file `sfile'\'' for addition
5136 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
5137 dotest 65a2 "${testcvs} -q ci -m add-it" \
5138 "RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v
5141 ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
5142 initial revision: 1\.1
5145 dotest 65a3 "${testcvs} rm sfile" \
5146 "${PROG}"' remove: scheduling `sfile'\'' for removal
5147 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
5148 dotest 65a4 "${testcvs} -q ci -m remove-it" \
5150 ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
5151 new revision: delete; previous revision: 1\.1
5154 dotest 65a5 "${testcvs} -q update -P" ''
5155 dotest_fail 65a6 "test -d subdir" ''
5159 if ${CVS} add file1 2>> ${LOGFILE}; then
5166 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
5174 if ${CVS} rm file1 2>> ${LOGFILE}; then
5181 if ${CVS} ci -m test >>${LOGFILE} ; then
5187 dotest_fail 69a0 "test -f file1" ''
5188 # get the old contents of file1 back
5189 if ${testcvs} update -p -r 1.1 file1 >file1 2>>${LOGFILE}; then
5194 dotest 69a2 "cat file1" ''
5196 # create second file
5198 if ${CVS} add file1 file2 2>> ${LOGFILE}; then
5205 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
5212 if ${CVS} log file1 >> ${LOGFILE}; then
5218 # file4 will be dead at the time of branching and stay dead.
5220 dotest death-file4-add "${testcvs} add file4" \
5221 "${PROG}"' add: scheduling file `file4'\'' for addition
5222 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
5223 dotest death-file4-ciadd "${testcvs} -q ci -m add file4" \
5224 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
5227 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
5228 initial revision: 1\.1
5231 dotest death-file4-rm "${testcvs} remove file4" \
5232 "${PROG}"' remove: scheduling `file4'\'' for removal
5233 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
5234 dotest death-file4-cirm "${testcvs} -q ci -m remove file4" \
5236 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
5237 new revision: delete; previous revision: 1\.1
5240 # Tag the branchpoint.
5241 dotest death-72a "${testcvs} -q tag bp_branch1" 'T file1
5245 if ${CVS} tag -b branch1 ; then
5251 # and move to the branch.
5252 if ${CVS} update -r branch1 ; then
5258 dotest_fail death-file4-3 "test -f file4" ''
5260 # add a file in the branch
5261 echo line1 from branch1 >> file3
5262 if ${CVS} add file3 2>> ${LOGFILE}; then
5269 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
5276 "${testcvs} -q rdiff -r bp_branch1 -r branch1 first-dir" \
5277 "Index: first-dir/file3
5278 diff -c /dev/null first-dir/file3:1\.1\.2\.1
5279 \*\*\* /dev/null ${DATE}
5280 --- first-dir/file3 ${DATE}
5281 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5284 ${PLUS} line1 from branch1"
5286 "${testcvs} -q rdiff -r branch1 -r bp_branch1 first-dir" \
5287 "Index: first-dir/file3
5288 diff -c first-dir/file3:1\.1\.2\.1 first-dir/file3:removed
5289 \*\*\* first-dir/file3:1\.1\.2\.1 ${DATE}
5290 --- first-dir/file3 ${DATE}
5291 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5293 - line1 from branch1
5298 if ${CVS} rm file3 2>> ${LOGFILE}; then
5305 if ${CVS} ci -m test >>${LOGFILE} ; then
5312 echo line1 from branch1 >> file3
5313 if ${CVS} add file3 2>> ${LOGFILE}; then
5320 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
5326 # change the first file
5327 echo line2 from branch1 >> file1
5330 if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
5338 if ${CVS} rm file2 2>> ${LOGFILE}; then
5345 if ${CVS} ci -m test >>${LOGFILE}; then
5351 # back to the trunk.
5352 if ${CVS} update -A 2>> ${LOGFILE}; then
5358 dotest_fail death-file4-4 "test -f file4" ''
5360 if test -f file3 ; then
5367 dotest 86 "${testcvs} -q update -j branch1" \
5368 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5369 retrieving revision 1\.3
5370 retrieving revision 1\.3\.2\.1
5371 Merging differences between 1\.3 and 1\.3\.2\.1 into file1
5372 ${PROG} update: scheduling file2 for removal
5375 dotest_fail death-file4-5 "test -f file4" ''
5377 if test -f file3 ; then
5383 # Make sure that we joined the correct change to file1
5384 if echo line2 from branch1 | cmp - file1 >/dev/null; then
5391 if ${CVS} update ; then
5398 dotest 89 "${testcvs} -q ci -m test" \
5400 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5401 new revision: 1\.4; previous revision: 1\.3
5404 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
5405 new revision: delete; previous revision: 1\.1
5408 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
5409 new revision: 1\.2; previous revision: 1\.1
5414 dotest 89a "${testcvs} -q co first-dir" 'U first-dir/file1
5420 # remove first file.
5422 if ${CVS} rm file1 2>> ${LOGFILE}; then
5429 if ${CVS} ci -m test >>${LOGFILE}; then
5435 if test -f file1 ; then
5441 # typo; try to get to the branch and fail
5442 dotest_fail 92.1a "${testcvs} update -r brnach1" \
5443 "${PROG}"' \[update aborted\]: no such tag brnach1'
5444 # Make sure we are still on the trunk
5445 if test -f file1 ; then
5450 if test -f file3 ; then
5457 if ${CVS} update -r branch1 2>> ${LOGFILE}; then
5463 dotest_fail death-file4-6 "test -f file4" ''
5465 if test -f file1 ; then
5472 dotest 95 "$testcvs -q update -j HEAD" \
5473 "$PROG update: file file1 has been removed in revision HEAD, but the destination is incompatibly modified
5475 $PROG update: file file3 exists, but has been added in revision HEAD"
5477 dotest_fail death-file4-7 "test -f file4" ''
5479 # file2 should not have been recreated. It was
5480 # deleted on the branch, and has not been modified on
5481 # the trunk. That means that there have been no
5482 # changes between the greatest common ancestor (the
5483 # trunk version) and HEAD.
5484 dotest_fail death-file2-1 "test -f file2" ''
5486 cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
5490 # More tests of death support.
5491 mkdir ${CVSROOT_DIRNAME}/first-dir
5492 dotest death2-1 "${testcvs} -q co first-dir" ''
5496 # Add two files on the trunk.
5497 echo "first revision" > file1
5498 echo "file4 first revision" > file4
5499 dotest death2-2 "${testcvs} add file1 file4" \
5500 "${PROG}"' add: scheduling file `file1'\'' for addition
5501 '"${PROG}"' add: scheduling file `file4'\'' for addition
5502 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
5504 dotest death2-3 "${testcvs} -q commit -m add" \
5505 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5508 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5509 initial revision: 1\.1
5511 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
5514 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
5515 initial revision: 1\.1
5518 # Make a branch and a non-branch tag.
5519 dotest death2-4 "${testcvs} -q tag -b branch" \
5522 dotest death2-5 "${testcvs} -q tag tag" \
5526 # Switch over to the branch.
5527 dotest death2-6 "$testcvs -q update -r branch" \
5531 # Delete the file on the branch.
5533 dotest death2-7 "${testcvs} rm file1" \
5534 "${PROG} remove: scheduling .file1. for removal
5535 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
5537 # Test diff of the removed file before it is committed.
5538 dotest_fail death2-diff-1 "${testcvs} -q diff file1" \
5539 "${PROG} diff: file1 was removed, no comparison available"
5541 dotest_fail death2-diff-2 "${testcvs} -q diff -N -c file1" \
5543 ===================================================================
5546 \*\*\* file1 ${RFCDATE} [0-9.]*
5547 --- /dev/null ${RFCDATE_EPOCH}
5548 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5553 dotest death2-8 "${testcvs} -q ci -m removed" \
5555 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5556 new revision: delete; previous revision: 1\.1
5559 # Test diff of a dead file.
5560 dotest_fail death2-diff-3 \
5561 "${testcvs} -q diff -r1.1 -rbranch -c file1" \
5562 "${PROG} diff: Tag branch refers to a dead (removed) revision in file .file1.\.
5563 ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
5565 dotest_fail death2-diff-3a \
5566 "${testcvs} -q diff -rbranch -r1.1 -c file1" \
5567 "${PROG} diff: Tag branch refers to a dead (removed) revision in file .file1.\.
5568 ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
5570 dotest_fail death2-diff-4 \
5571 "${testcvs} -q diff -r1.1 -rbranch -N -c file1" \
5573 ===================================================================
5576 \*\*\* file1 ${RFCDATE} [0-9.]*
5577 --- /dev/null ${RFCDATE_EPOCH}
5578 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5583 dotest_fail death2-diff-4a \
5584 "${testcvs} -q diff -rbranch -r1.1 -N -c file1" \
5586 ===================================================================
5589 \*\*\* /dev/null ${RFCDATE_EPOCH}
5590 --- file1 ${RFCDATE} [0-9.]*
5591 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5597 dotest_fail death2-diff-5 "${testcvs} -q diff -rtag -c ." \
5598 "${PROG} diff: file1 no longer exists, no comparison available"
5600 dotest_fail death2-diff-6 "${testcvs} -q diff -rtag -N -c ." \
5602 ===================================================================
5605 \*\*\* file1 [-a-zA-Z0-9: ]* [0-9.]*
5606 --- /dev/null ${RFCDATE_EPOCH}
5607 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5612 # Test rdiff of a dead file.
5613 dotest death2-rdiff-1 \
5614 "${testcvs} -q rtag -rbranch rdiff-tag first-dir" ''
5616 dotest death2-rdiff-2 "${testcvs} -q rdiff -rtag -rbranch first-dir" \
5617 "Index: first-dir/file1
5618 diff -c first-dir/file1:1\.1 first-dir/file1:removed
5619 \*\*\* first-dir/file1:1\.1 [a-zA-Z0-9: ]*
5620 --- first-dir/file1 [a-zA-Z0-9: ]*
5621 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5626 # Readd the file to the branch.
5627 echo "second revision" > file1
5628 dotest death2-9 "${testcvs} add file1" \
5629 "${PROG}"' add: file `file1'\'' will be added on branch `branch'\'' from version 1\.1\.2\.1
5630 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
5632 # Test diff of the added file before it is committed.
5633 dotest_fail death2-diff-7 "${testcvs} -q diff file1" \
5634 "${PROG} diff: file1 is a new entry, no comparison available"
5636 dotest_fail death2-diff-8 "${testcvs} -q diff -N -c file1" \
5638 ===================================================================
5641 \*\*\* /dev/null ${RFCDATE_EPOCH}
5642 --- file1 ${RFCDATE}
5643 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5646 ${PLUS} second revision"
5648 dotest death2-10 "${testcvs} -q commit -m add" \
5650 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
5651 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
5654 # Delete file4 from the branch
5655 dotest death2-10a "${testcvs} rm -f file4" \
5656 "${PROG} remove: scheduling .file4. for removal
5657 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
5658 dotest death2-10b "${testcvs} -q ci -m removed" \
5660 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
5661 new revision: delete; previous revision: 1\.1
5664 # Back to the trunk.
5665 dotest death2-11 "${testcvs} -q update -A" \
5669 # Add another file on the trunk.
5670 echo "first revision" > file2
5671 dotest death2-12 "${testcvs} add file2" \
5672 "${PROG}"' add: scheduling file `file2'\'' for addition
5673 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
5674 dotest death2-13 "${testcvs} -q commit -m add" \
5675 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
5678 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
5679 initial revision: 1\.1
5682 # Modify file4 on the trunk.
5683 echo "new file4 revision" > file4
5684 dotest death2-13a "${testcvs} -q commit -m mod" \
5686 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
5687 new revision: 1\.2; previous revision: 1\.1
5690 # Back to the branch.
5691 # The ``no longer in the repository'' message doesn't really
5692 # look right to me, but that's what CVS currently prints for
5694 dotest death2-14 "${testcvs} -q update -r branch" \
5696 ${PROG} update: file2 is no longer in the repository
5697 ${PROG} update: file4 is no longer in the repository"
5699 # Add a file on the branch with the same name.
5700 echo "branch revision" > file2
5701 dotest death2-15 "${testcvs} add file2" \
5702 "${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
5703 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
5704 dotest death2-16 "${testcvs} -q commit -m add" \
5706 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
5707 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
5710 # Add a new file on the branch.
5711 echo "first revision" > file3
5712 dotest death2-17 "${testcvs} add file3" \
5713 "${PROG}"' add: scheduling file `file3'\'' for addition on branch `branch'\''
5714 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
5715 dotest death2-18 "${testcvs} -q commit -m add" \
5716 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
5719 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
5720 new revision: 1\.1\.2\.1; previous revision: 1\.1
5723 # Test diff of a nonexistent tag
5724 dotest_fail death2-diff-9 "${testcvs} -q diff -rtag -c file3" \
5725 "${PROG} diff: tag tag is not in file file3"
5727 dotest_fail death2-diff-10 "${testcvs} -q diff -rtag -N -c file3" \
5729 ===================================================================
5732 \*\*\* /dev/null ${RFCDATE_EPOCH}
5733 --- file3 ${RFCDATE} [0-9.]*
5734 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5737 ${PLUS} first revision"
5739 dotest_fail death2-diff-11 "${testcvs} -q diff -rtag -c ." \
5741 ===================================================================
5742 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5743 retrieving revision 1\.1
5744 retrieving revision 1\.1\.2\.2
5745 diff -c -r1\.1 -r1\.1\.2\.2
5746 \*\*\* file1 ${RFCDATE} [0-9.]*
5747 --- file1 ${RFCDATE} [0-9.]*
5748 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5753 ${PROG} diff: tag tag is not in file file2
5754 ${PROG} diff: tag tag is not in file file3
5755 ${PROG} diff: file4 no longer exists, no comparison available"
5757 dotest_fail death2-diff-12 "${testcvs} -q diff -rtag -c -N ." \
5759 ===================================================================
5760 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
5761 retrieving revision 1\.1
5762 retrieving revision 1\.1\.2\.2
5763 diff -c -r1\.1 -r1\.1\.2\.2
5764 \*\*\* file1 ${RFCDATE} [0-9.]*
5765 --- file1 ${RFCDATE} [0-9.]*
5766 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5772 ===================================================================
5775 \*\*\* /dev/null ${RFCDATE_EPOCH}
5776 --- file2 ${RFCDATE} [0-9.]*
5777 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5780 ${PLUS} branch revision
5782 ===================================================================
5785 \*\*\* /dev/null ${RFCDATE_EPOCH}
5786 --- file3 ${RFCDATE} [0-9.]*
5787 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5790 ${PLUS} first revision
5792 ===================================================================
5795 \*\*\* file4 ${RFCDATE} [0-9.]*
5796 --- /dev/null ${RFCDATE_EPOCH}
5797 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5799 - file4 first revision
5802 # Switch to the nonbranch tag.
5803 dotest death2-19 "${testcvs} -q update -r tag" \
5805 ${PROG} update: file2 is no longer in the repository
5806 ${PROG} update: file3 is no longer in the repository
5809 dotest_fail death2-20 "test -f file2"
5811 # Make sure diff only reports appropriate files.
5812 dotest_fail death2-diff-13 "${testcvs} -q diff -r rdiff-tag" \
5813 "${PROG} diff: Tag rdiff-tag refers to a dead (removed) revision in file .file1.\.
5814 ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
5816 dotest_fail death2-diff-14 "${testcvs} -q diff -r rdiff-tag -c -N" \
5818 ===================================================================
5821 \*\*\* /dev/null ${RFCDATE_EPOCH}
5822 --- file1 ${RFCDATE} [0-9.]*
5823 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5826 ${PLUS} first revision"
5828 # now back to the trunk
5829 dotest death2-21 "$testcvs -q update -A" \
5834 # test merging with a dead file
5835 dotest death2-22 "${testcvs} -q co first-dir" \
5841 dotest death2-23 "${testcvs} rm -f file4" \
5842 "${PROG} remove: scheduling .file4. for removal
5843 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
5844 dotest death2-24 "${testcvs} -q ci -m removed file4" \
5846 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
5847 new revision: delete; previous revision: 1\.2
5850 echo "new stuff" >file4
5851 dotest_fail death2-25 "${testcvs} up file4" \
5852 "${PROG} update: conflict: file4 is modified but no longer in the repository
5855 cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
5861 # This documents a bug in CVS that prevents rtag from tagging files
5863 mkdir $CVSROOT_DIRNAME/death-rtag
5864 dotest death-rtag-init-1 "$testcvs -Q co death-rtag"
5866 echo "This is the file foo" > foo
5867 echo "This is the file bar" > bar
5868 dotest death-rtag-init-2 "$testcvs -Q add foo bar"
5869 dotest death-rtag-init-3 "$testcvs -Q ci -m 'Add foo and bar.'" \
5870 "RCS file: $CVSROOT_DIRNAME/death-rtag/bar,v
5873 $CVSROOT_DIRNAME/death-rtag/bar,v <-- bar
5874 initial revision: 1\.[0-9]*
5876 RCS file: $CVSROOT_DIRNAME/death-rtag/foo,v
5879 $CVSROOT_DIRNAME/death-rtag/foo,v <-- foo
5880 initial revision: 1\.[0-9]*
5882 dotest death-rtag-init-5 "$testcvs -Q tag -b mybranch"
5884 dotest death-rtag-1 "$testcvs -q rtag -rmybranch willtag death-rtag"
5885 dotest death-rtag-2 "$testcvs -Q rm -f foo"
5886 dotest death-rtag-3 "$testcvs -Q ci -m 'Remove foo.'" \
5888 $CVSROOT_DIRNAME/death-rtag/foo,v <-- foo
5889 new revision: delete; previous revision: 1\.[0-9]*
5891 # commit something on the branch so that the moving tag is visible.
5892 dotest death-rtag-3.2 "$testcvs -Q up -rmybranch"
5893 echo some branch content >>foo
5894 echo some branch content >>bar
5895 dotest death-rtag-3.3 "$testcvs -Q ci -m 'Change foo.'" \
5897 $CVSROOT_DIRNAME/death-rtag/bar,v <-- bar
5898 new revision: 1\.1\.2\.1; previous revision: 1\.1
5901 $CVSROOT_DIRNAME/death-rtag/Attic/foo,v <-- foo
5902 new revision: 1\.1\.2\.1; previous revision: 1\.1
5904 dotest death-rtag-3.4 \
5905 "$testcvs -q rtag -rmybranch wontmove death-rtag"
5906 dotest death-rtag-3.5 "$testcvs -q rtag -F wontmove death-rtag"
5909 # Removing -f below avoids this bug.
5910 dotest death-rtag-4 "$testcvs -q rtag -frmybranch wonttag death-rtag"
5912 # When the bug existed, `wonttag' would not have been present in
5915 # A second bug prevented `wontmove' from moving from the branch to
5916 # the dead revision on the trunk (death-rtag-3.4 & death-rtag-3.5).
5917 dotest death-rtag-5 "$testcvs -q rlog death-rtag" \
5919 RCS file: $CVSROOT_DIRNAME/death-rtag/bar,v
5929 keyword substitution: kv
5931 RCS file: $CVSROOT_DIRNAME/death-rtag/Attic/foo,v
5941 keyword substitution: kv
5945 echo Keeping $TESTDIR and exiting due to --keep
5950 rm -rf $CVSROOT_DIRNAME/death-rtag
5957 # local CVS prints a warning message when update notices a missing
5958 # file and client/server CVS doesn't. These should be identical.
5959 mkdir rm-update-message; cd rm-update-message
5960 mkdir $CVSROOT_DIRNAME/rm-update-message
5961 dotest rm-update-message-setup-1 "$testcvs -q co rm-update-message" ''
5962 cd rm-update-message
5965 dotest rm-update-message-setup-2 "$testcvs -q add $file" \
5966 "${PROG} add: use .${PROG} commit. to add this file permanently"
5967 dotest rm-update-message-setup-3 "$testcvs -q ci -mcreate $file" \
5968 "RCS file: $CVSROOT_DIRNAME/rm-update-message/$file,v
5971 $CVSROOT_DIRNAME/rm-update-message/$file,v <-- $file
5972 initial revision: 1\.1
5976 dotest rm-update-message-1 "$testcvs up $file" \
5977 "${PROG} update: warning: $file was lost
5981 if $keep; then :; else
5982 rm -rf rm-update-message
5983 rm -rf $CVSROOT_DIRNAME/rm-update-message
5988 # More tests of adding and removing files.
5989 # In particular ci -r.
5990 # Other ci -r tests:
5991 # * editor-9: checking in a modified file,
5992 # where "ci -r" means a branch.
5993 # * basica-8a1: checking in a modified file with numeric revision.
5994 # * basica-8a2: likewise.
5995 # * keywordlog-4: adding a new file with numeric revision.
5997 dotest rmadd-1 "${testcvs} -q co -l ." ''
5999 dotest rmadd-2 "${testcvs} add first-dir" \
6000 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
6002 echo first file1 >file1
6003 dotest rmadd-3 "${testcvs} add file1" \
6004 "${PROG} add: scheduling file .file1. for addition
6005 ${PROG} add: use .${PROG} commit. to add this file permanently"
6007 dotest_fail rmadd-4 "${testcvs} -q ci -r 1.2.2.4 -m add" \
6008 "${PROG} commit: cannot add file .file1' with revision .1\.2\.2\.4'; must be on trunk
6009 ${PROG} \[commit aborted\]: correct above errors first!"
6010 dotest_fail rmadd-5 "${testcvs} -q ci -r 1.2.2 -m add" \
6011 "${PROG} commit: cannot add file .file1' with revision .1\.2\.2'; must be on trunk
6012 ${PROG} \[commit aborted\]: correct above errors first!"
6013 dotest_fail rmadd-6 "${testcvs} -q ci -r mybranch -m add" \
6014 "${PROG} \[commit aborted\]: no such tag mybranch"
6016 # The thing with the trailing periods strikes me as a very
6017 # bizarre behavior, but it would seem to be intentional
6018 # (see commit.c). It probably could go away....
6019 dotest rmadd-7 "${testcvs} -q ci -r 7.... -m add" \
6020 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6023 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6024 initial revision: 7\.1
6027 # I guess remote doesn't set a sticky tag in this case.
6028 # Kind of odd, in the sense that rmadd-24a does set one
6029 # both local and remote.
6030 dotest_fail rmadd-7a "test -f CVS/Tag"
6033 dotest rmadd-7a "cat CVS/Tag" "T7"
6036 dotest rmadd-8 "${testcvs} -q tag -b mybranch" "T file1"
6037 dotest rmadd-9 "${testcvs} -q tag mynonbranch" "T file1"
6040 # The previous "cvs ci -r" set a sticky tag of '7'. Seems a
6041 # bit odd, and I guess commit.c (findmaxrev) makes '7' sticky
6042 # tags unnecessary (?). I kind of suspect that it should be
6043 # saying "sticky tag is not a branch" like keywordlog-4b.
6045 dotest rmadd-10 "${testcvs} add file2" \
6046 "${PROG} add: scheduling file .file2. for addition on branch .7'
6047 ${PROG} add: use .${PROG} commit. to add this file permanently"
6048 # As in the previous example, CVS is confused....
6049 dotest rmadd-11 "${testcvs} -q ci -m add" \
6050 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
6053 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6054 initial revision: 7\.1
6057 dotest rmadd-12 "${testcvs} -q update -A" ""
6059 dotest rmadd-13 "${testcvs} add file3" \
6060 "${PROG} add: scheduling file .file3. for addition
6061 ${PROG} add: use .${PROG} commit. to add this file permanently"
6062 # Huh? file2 is not up to date? Seems buggy to me....
6063 dotest_fail rmadd-14 "${testcvs} -q ci -r mybranch -m add" \
6064 "${PROG} commit: Up-to-date check failed for .file2'
6065 ${PROG} \[commit aborted\]: correct above errors first!"
6066 # Whatever, let's not let file2 distract us....
6067 dotest rmadd-15 "${testcvs} -q ci -r mybranch -m add file3" \
6068 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
6071 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
6072 new revision: 1\.1\.2\.1; previous revision: 1\.1
6076 dotest rmadd-16 "${testcvs} add file4" \
6077 "${PROG} add: scheduling file .file4. for addition
6078 ${PROG} add: use .${PROG} commit. to add this file permanently"
6079 # Same "Up-to-date check" issues as in rmadd-14.
6080 # The "no such tag" thing is due to the fact that we only
6081 # update val-tags when the tag is used (might be more of a
6082 # bug than a feature, I dunno).
6083 dotest_fail rmadd-17 \
6084 "${testcvs} -q ci -r mynonbranch -m add file4" \
6085 "${PROG} \[commit aborted\]: no such tag mynonbranch"
6086 # Try to make CVS write val-tags.
6087 dotest rmadd-18 "${testcvs} -q update -p -r mynonbranch file1" \
6089 # Oops, -p suppresses writing val-tags (probably a questionable
6091 dotest_fail rmadd-19 \
6092 "${testcvs} -q ci -r mynonbranch -m add file4" \
6093 "${PROG} \[commit aborted\]: no such tag mynonbranch"
6094 # Now make CVS write val-tags for real.
6095 dotest rmadd-20 "$testcvs -q update -r mynonbranch file1" '[UP] file1'
6096 # Oops - CVS isn't distinguishing between a branch tag and
6099 "${testcvs} -q ci -r mynonbranch -m add file4" \
6100 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file4,v
6103 ${CVSROOT_DIRNAME}/first-dir/Attic/file4,v <-- file4
6104 new revision: 1\.1\.2\.1; previous revision: 1\.1
6107 # OK, we add this one in a vanilla way, but then check in
6108 # a modification with ci -r and sniff around for sticky tags.
6110 dotest rmadd-22 "${testcvs} add file5" \
6111 "${PROG} add: scheduling file .file5. for addition
6112 ${PROG} add: use .${PROG} commit. to add this file permanently"
6114 # Interesting bug (or missing feature) here. findmaxrev
6115 # gets the major revision from the Entries. Well, remote
6116 # doesn't send the entries for files which are not involved.
6117 dotest rmadd-23r "${testcvs} -q ci -m add" \
6118 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
6121 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
6122 initial revision: 1\.1
6124 dotest rmadd-23-workaroundr \
6125 "${testcvs} -q ci -r 7 -m bump-it file5" \
6127 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
6128 new revision: 7\.1; previous revision: 1\.1
6131 dotest rmadd-23 "${testcvs} -q ci -m add" \
6132 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
6135 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
6136 initial revision: 7\.1
6139 echo change it >file5
6140 dotest_fail rmadd-24 "${testcvs} -q ci -r 4.8 -m change file5" \
6142 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
6143 ${PROG} commit: ${CVSROOT_DIRNAME}/first-dir/file5,v: revision 4\.8 too low; must be higher than 7\.1
6144 ${PROG} commit: could not check in file5"
6145 dotest rmadd-24a "${testcvs} -q ci -r 8.4 -m change file5" \
6147 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
6148 new revision: 8\.4; previous revision: 7\.1
6150 # I'm not really sure that a sticky tag make sense here.
6151 # It seems to be longstanding behavior for what that is worth.
6152 dotest rmadd-25 "${testcvs} status file5" \
6153 "===================================================================
6154 File: file5 Status: Up-to-date
6156 Working revision: 8\.4.*
6157 Repository revision: 8\.4 ${CVSROOT_DIRNAME}/first-dir/file5,v
6160 Sticky Options: (none)"
6162 # now try forced revision with recursion
6164 dotest rmadd-26 "${testcvs} -q add sub" \
6165 "Directory ${CVSROOT_DIRNAME}/first-dir/sub added to the repository"
6166 echo hello >sub/subfile
6167 dotest rmadd-27 "${testcvs} -q add sub/subfile" \
6168 "${PROG} add: use .${PROG} commit. to add this file permanently"
6170 dotest rmadd-28 "${testcvs} -q ci -m. sub" \
6171 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v
6173 Checking in sub/subfile;
6174 ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v <-- subfile
6175 initial revision: 1\.1
6179 dotest rmadd-29 "$testcvs -q up -A" \
6181 $PROG update: file3 is no longer in the repository
6182 $PROG update: file4 is no longer in the repository"
6184 # -f disables recursion
6185 dotest rmadd-30 "${testcvs} -q ci -f -r9 -m." \
6187 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6188 new revision: 9\.1; previous revision: 7\.1
6191 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6192 new revision: 9\.1; previous revision: 7\.1
6195 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
6196 new revision: 9\.1; previous revision: 8\.4
6199 # add -R to force recursion
6200 dotest rmadd-31 "${testcvs} -q ci -f -r9 -R -m." \
6202 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6203 new revision: 9\.2; previous revision: 9\.1
6206 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6207 new revision: 9\.2; previous revision: 9\.1
6210 ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
6211 new revision: 9\.2; previous revision: 9\.1
6213 Checking in sub/subfile;
6214 ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v <-- subfile
6215 new revision: 9\.1; previous revision: 1\.1
6219 # as noted above, remote doesn't set a sticky tag
6222 dotest rmadd-32 "cat CVS/Tag" "T9"
6223 dotest rmadd-33 "cat sub/CVS/Tag" "T9"
6228 rm -rf ${CVSROOT_DIRNAME}/first-dir
6232 # Tests of undoing commits, including in the presence of
6233 # adding and removing files. See join for a list of -j tests.
6235 dotest rmadd2-1 "${testcvs} -q co -l ." ''
6237 dotest rmadd2-2 "${testcvs} add first-dir" \
6238 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
6240 echo 'initial contents' >file1
6241 dotest rmadd2-3 "${testcvs} add file1" \
6242 "${PROG} add: scheduling file .file1. for addition
6243 ${PROG} add: use .${PROG} commit. to add this file permanently"
6244 dotest rmadd2-4 "${testcvs} -q ci -m add" \
6245 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6248 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6249 initial revision: 1\.1
6251 dotest rmadd2-4a "${testcvs} -Q tag tagone" ""
6252 dotest rmadd2-5 "${testcvs} rm -f file1" \
6253 "${PROG} remove: scheduling .file1. for removal
6254 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
6255 dotest rmadd2-6 "${testcvs} -q ci -m remove" \
6257 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6258 new revision: delete; previous revision: 1\.1
6260 dotest rmadd2-7 "${testcvs} -q update -j 1.2 -j 1.1 file1" "U file1"
6261 dotest rmadd2-8 "${testcvs} -q ci -m readd" \
6263 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6264 new revision: 1\.3; previous revision: 1\.2
6266 echo 'new contents' >file1
6267 dotest rmadd2-9 "${testcvs} -q ci -m modify" \
6269 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6270 new revision: 1\.4; previous revision: 1\.3
6272 dotest rmadd2-10 "${testcvs} -q update -j 1.4 -j 1.3 file1" \
6273 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6274 retrieving revision 1\.4
6275 retrieving revision 1\.3
6276 Merging differences between 1\.4 and 1\.3 into file1"
6277 dotest rmadd2-11 "${testcvs} -q ci -m undo" \
6279 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6280 new revision: 1\.5; previous revision: 1\.4
6282 dotest rmadd2-12 "cat file1" "initial contents"
6283 dotest rmadd2-13 "${testcvs} -q update -p -r 1.3" "initial contents"
6285 # Hmm, might be a bit odd that this works even if 1.3 is not
6287 dotest rmadd2-14 "${testcvs} -q update -j 1.3 -j 1.2 file1" \
6288 "${PROG} update: scheduling file1 for removal"
6290 # Check that -p can get arbitrary revisions of a removed file
6291 dotest rmadd2-14a "${testcvs} -q update -p" "initial contents"
6292 dotest rmadd2-14b "${testcvs} -q update -p -r 1.5" "initial contents"
6293 dotest rmadd2-14c "${testcvs} -q update -p -r 1.3" "initial contents"
6295 dotest rmadd2-15 "${testcvs} -q ci -m re-remove" \
6297 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6298 new revision: delete; previous revision: 1\.5
6300 dotest rmadd2-16 "${testcvs} log -h file1" "
6301 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
6309 keyword substitution: kv
6311 ============================================================================="
6312 dotest rmadd2-17 "${testcvs} status -v file1" \
6313 "===================================================================
6314 File: no file file1 Status: Up-to-date
6316 Working revision: No entry for file1
6317 Repository revision: 1\.6 ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
6320 tagone (revision: 1.1)"
6325 rm -rf ${CVSROOT_DIRNAME}/first-dir
6329 # This test demonstrates that CVS notices that file1 exists rather
6330 # that deleting or writing over it after:
6332 # cvs remove -f file1; touch file1; cvs add file1.
6334 # According to the manual, this should work for:
6336 # rm file1; cvs remove file1; cvs add file1
6338 # but in past version of CVS, new content in file1 would be
6339 # erroneously deleted when file1 reappeared between the remove and
6342 # Later versions of CVS would refuse to perform the add, but still
6343 # allow a subsequent local commit to erase the file from the
6344 # workspace, possibly losing data.
6346 dotest rmadd3-init1 "${testcvs} -q co -l ." ''
6348 dotest rmadd3-init2 "${testcvs} add first-dir" \
6349 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
6352 echo initial content for file1 >file1
6353 dotest rmadd3-init3 "${testcvs} add file1" \
6354 "${PROG} add: scheduling file \`file1' for addition
6355 ${PROG} add: use '${PROG} commit' to add this file permanently"
6356 dotest rmadd3-init4 "${testcvs} -q ci -m add" \
6357 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6360 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6361 initial revision: 1\.1
6364 # Here begins the guts of this test, as detailed above.
6365 dotest rmadd3-1 "${testcvs} rm -f file1" \
6366 "${PROG} remove: scheduling \`file1' for removal
6367 ${PROG} remove: use '${PROG} commit' to remove this file permanently"
6369 # Now recreate the file:
6370 echo desired future contents for file1 >file1
6372 # And attempt to resurrect it at the same time:
6373 dotest_fail rmadd3-2 "${testcvs} add file1" \
6374 "${PROG} add: file1 should be removed and is still there (or is back again)"
6376 # Now prove that commit knows that it shouldn't erase files.
6377 dotest_fail rmadd3-3 "${testcvs} -q ci -m." \
6378 "$PROG commit: \`file1' should be removed and is still there (or is back again)
6379 $PROG \[commit aborted\]: correct above errors first!"
6381 # Then these should pass too:
6382 dotest rmadd3-4 "test -f file1"
6383 dotest rmadd3-5 "cat file1" "desired future contents for file1"
6386 echo Keeping ${TESTDIR} and exiting due to --keep
6392 rm -rf ${CVSROOT_DIRNAME}/first-dir
6396 # This test tests a few file resurrection scenarios.
6398 dotest resurrection-init1 "$testcvs -q co -l ." ''
6400 dotest resurrection-init2 "$testcvs add first-dir" \
6401 "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
6404 echo initial content for file1 >file1
6405 dotest resurrection-init3 "$testcvs add file1" \
6406 "$PROG add: scheduling file \`file1' for addition
6407 $PROG add: use '$PROG commit' to add this file permanently"
6408 dotest resurrection-init4 "$testcvs -q ci -m add" \
6409 "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
6412 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
6413 initial revision: 1\.1
6416 dotest resurrection-init5 "$testcvs -Q rm -f file1"
6418 # The first test is that `cvs add' will resurrect a file before its
6419 # removal has been committed.
6420 dotest_sort resurrection-1 "$testcvs add file1" \
6422 $PROG add: file1, version 1\.1, resurrected"
6423 dotest resurrection-2 "$testcvs -Q diff file1" ""
6425 dotest resurrection-init6 "$testcvs -Q tag -b resurrection"
6426 dotest resurrection-init7 "$testcvs -Q rm -f file1"
6427 dotest resurrection-init8 "$testcvs -Q ci -mrm" \
6429 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
6430 new revision: delete; previous revision: 1\.1
6433 # The next test is that CVS will resurrect a committed removal.
6434 dotest_sort resurrection-3 "$testcvs add file1" \
6436 $PROG add: Re-adding file \`file1' (in place of dead revision 1\.2)\.
6437 $PROG add: Resurrecting file \`file1' from revision 1\.1\.
6438 $PROG add: use 'cvs commit' to add this file permanently"
6439 dotest resurrection-4 "$testcvs -q diff -r1.1 file1" ""
6440 dotest resurrection-5 "$testcvs -q ci -mreadd" \
6442 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
6443 new revision: 1\.3; previous revision: 1\.2
6446 dotest resurrection-init9 "$testcvs -Q up -rresurrection"
6447 dotest resurrection-init10 "$testcvs -Q rm -f file1"
6448 dotest resurrection-init11 "$testcvs -Q ci -mrm-on-resurrection" \
6450 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
6451 new revision: delete; previous revision: 1\.1
6454 # The next test is that CVS will resurrect a committed removal to a
6456 dotest_sort resurrection-6 "$testcvs add file1" \
6458 $PROG add: Resurrecting file \`file1' from revision 1\.1\.
6459 $PROG add: file \`file1' will be added on branch \`resurrection' from version 1\.1\.2\.1
6460 $PROG add: use 'cvs commit' to add this file permanently"
6461 dotest resurrection-7 "$testcvs -Q diff -r1.1 file1" ""
6462 dotest resurrection-8 "$testcvs -q ci -mreadd" \
6464 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
6465 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
6468 # The next few tests verify that an attempted resurrection of a file
6469 # with no previous revision on the trunk fails.
6471 dotest resurrection-9 "$testcvs -Q add file2"
6472 dotest resurrection-10 "$testcvs -Q ci -mnew-file2" \
6473 "RCS file: $CVSROOT_DIRNAME/first-dir/Attic/file2,v
6476 $CVSROOT_DIRNAME/first-dir/Attic/file2,v <-- file2
6477 new revision: 1\.1\.2\.1; previous revision: 1\.1
6479 dotest resurrection-11 "$testcvs -Q up -A"
6481 # This command once caused an assertion failure.
6482 dotest resurrection-12 "$testcvs add file2" \
6483 "$PROG add: File \`file2' has no previous revision to resurrect\."
6486 echo Keeping $TESTDIR and exiting due to --keep
6492 rm -rf $CVSROOT_DIRNAME/first-dir
6496 # Tests related to removing and adding directories.
6498 # conflicts (especially dir1 in conflicts-130): What happens if
6499 # directory exists in repository and a non-CVS-controlled
6500 # directory in the working directory?
6501 # conflicts3-15. More cases, especially where CVS directory
6502 # exists but without CVS/Repository and friends.
6503 # conflicts3-22. Similar to conflicts-130 but there is a file
6505 # dirs2. Sort of similar to conflicts3-22 but somewhat different.
6506 mkdir imp-dir; cd imp-dir
6509 echo sfile >sdir/sfile
6510 dotest_sort dirs-1 \
6511 "${testcvs} import -m import-it dir1 vend rel" "
6515 No conflicts created by this import
6516 ${PROG} import: Importing ${CVSROOT_DIRNAME}/dir1/sdir"
6520 dotest dirs-2 "${testcvs} -Q co dir1" ""
6522 # Various CVS administrators are in the habit of removing
6523 # the repository directory for things they don't want any
6524 # more. I've even been known to do it myself (on rare
6525 # occasions). Not the usual recommended practice, but we want
6526 # to try to come up with some kind of reasonable/documented/sensible
6528 rm -rf ${CVSROOT_DIRNAME}/dir1/sdir
6530 dotest dirs-3 "${testcvs} update" \
6531 "${PROG} update: Updating dir1
6532 ${PROG} update: Updating dir1/sdir
6533 ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
6534 ${PROG} update: skipping directory dir1/sdir"
6535 dotest dirs-3a "${testcvs} update -d" \
6536 "${PROG} update*: Updating dir1
6537 ${PROG} update: Updating dir1/sdir
6538 ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
6539 ${PROG} update: skipping directory dir1/sdir"
6541 # If we say "yes", then CVS gives errors about not being able to
6542 # create lock files.
6543 # The fact that it says "skipping directory " rather than
6544 # "skipping directory dir1/sdir" is some kind of bug.
6545 dotest dirs-4 "echo no | ${testcvs} release -d dir1/sdir" \
6546 "${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
6547 ${PROG} update: skipping directory
6548 You have \[0\] altered files in this repository\.
6549 Are you sure you want to release (and delete) directory .dir1/sdir': .. .release' aborted by user choice."
6551 # OK, if "cvs release" won't help, we'll try it the other way...
6554 dotest dirs-5 "cat dir1/CVS/Entries" \
6555 "/file1/1.1.1.1/[a-zA-Z0-9 :]*//
6557 dotest dirs-6 "${testcvs} update" "${PROG} update: Updating dir1"
6558 dotest dirs-7 "cat dir1/CVS/Entries" \
6559 "/file1/1.1.1.1/[a-zA-Z0-9 :]*//
6561 dotest dirs-8 "${testcvs} update -d dir1" \
6562 "${PROG} update: Updating dir1"
6568 # clean up our repositories
6569 rm -rf ${CVSROOT_DIRNAME}/dir1
6573 # See "dirs" for a list of tests involving adding and
6574 # removing directories.
6576 dotest dirs2-1 "${testcvs} -q co -l ." ''
6578 dotest dirs2-2 "${testcvs} add first-dir" \
6579 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
6582 dotest dirs2-3 "${testcvs} add sdir" \
6583 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
6585 dotest dirs2-4 "${testcvs} add sdir/file1" \
6586 "${PROG} add: scheduling file .sdir/file1. for addition
6587 ${PROG} add: use .${PROG} commit. to add this file permanently"
6588 dotest dirs2-5 "${testcvs} -q ci -m add" \
6589 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v
6591 Checking in sdir/file1;
6592 ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v <-- file1
6593 initial revision: 1\.1
6597 # This is just like conflicts3-23
6598 dotest_fail dirs2-6 "${testcvs} update -d" \
6600 ${PROG} update: Updating \.
6601 ${PROG} update: Updating sdir
6602 ${PROG} update: move away sdir/file1; it is in the way
6607 # This is where things are not just like conflicts3-23
6608 dotest dirs2-7 "${testcvs} update -d" \
6610 ${PROG} update: Updating \.
6611 ${PROG} update: Updating sdir
6614 dotest dirs2-6 "${testcvs} update -d" \
6615 "${PROG} update: Updating \.
6618 dotest dirs2-7 "${testcvs} update -d" \
6619 "${PROG} update: Updating \.
6624 # Now, the same thing (more or less) on a branch.
6626 dotest dirs2-8 "${testcvs} -q co first-dir" 'U first-dir/sdir/file1'
6628 dotest dirs2-9 "${testcvs} -q tag -b br" "T sdir/file1"
6631 # Cute little quirk of val-tags; if we don't recurse into
6632 # the directories where the tag is defined, val-tags won't
6634 dotest_fail dirs2-10 "${testcvs} update -d -r br" \
6636 ${PROG} \[update aborted\]: no such tag br"
6638 "${testcvs} -q rdiff -u -r 1.1 -r br first-dir/sdir/file1"
6639 dotest_fail dirs2-10-again "${testcvs} update -d -r br" \
6641 ${PROG} update: Updating \.
6642 ${PROG} update: Updating sdir
6643 ${PROG} update: move away sdir/file1; it is in the way
6646 dotest_fail dirs2-10 "${testcvs} update -d -r br" \
6647 "${PROG} update: in directory sdir:
6648 ${PROG} \[update aborted\]: there is no version here; do '${PROG} checkout' first"
6652 # OK, the above tests make the situation somewhat harder
6653 # than it might be, in the sense that they actually have a
6654 # file which is alive on the branch we are updating. Let's
6655 # try it where it is just a directory where all the files
6656 # have been removed.
6658 dotest dirs2-11 "${testcvs} -q co -r br first-dir" \
6659 "U first-dir/sdir/file1"
6661 # Hmm, this doesn't mention the branch like add does. That's
6662 # an odd non-orthogonality.
6663 dotest dirs2-12 "${testcvs} rm -f sdir/file1" \
6664 "${PROG} remove: scheduling .sdir/file1. for removal
6665 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
6666 dotest dirs2-13 "${testcvs} -q ci -m remove" \
6667 "Removing sdir/file1;
6668 ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v <-- file1
6669 new revision: delete; previous revision: 1\.1
6671 cd ../../2/first-dir
6673 dotest dirs2-14 "${testcvs} update -d -r br" \
6674 "${QUESTION} sdir/file1
6675 ${PROG} update: Updating \.
6676 ${PROG} update: Updating sdir"
6678 dotest dirs2-14 "${testcvs} update -d -r br" \
6679 "${PROG} update: Updating \.
6685 rm -rf ${CVSROOT_DIRNAME}/first-dir
6689 # More branch tests, including branches off of branches
6690 mkdir ${CVSROOT_DIRNAME}/first-dir
6691 dotest branches-1 "${testcvs} -q co first-dir" ''
6693 echo 1:ancest >file1
6694 echo 2:ancest >file2
6695 echo 3:ancest >file3
6696 echo 4:trunk-1 >file4
6697 dotest branches-2 "${testcvs} add file1 file2 file3 file4" \
6698 "${PROG}"' add: scheduling file `file1'\'' for addition
6699 '"${PROG}"' add: scheduling file `file2'\'' for addition
6700 '"${PROG}"' add: scheduling file `file3'\'' for addition
6701 '"${PROG}"' add: scheduling file `file4'\'' for addition
6702 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
6703 dotest branches-2a "${testcvs} -n -q ci -m dont-commit" ""
6704 dotest_lit branches-3 "${testcvs} -q ci -m add-it" <<HERE
6705 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6708 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6709 initial revision: 1.1
6711 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
6714 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6715 initial revision: 1.1
6717 RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
6720 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
6721 initial revision: 1.1
6723 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
6726 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6727 initial revision: 1.1
6730 echo 4:trunk-2 >file4
6731 dotest branches-3.2 "${testcvs} -q ci -m trunk-before-branch" \
6733 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6734 new revision: 1\.2; previous revision: 1\.1
6736 # The "cvs log file4" in test branches-14.3 will test that we
6737 # didn't really add the tag.
6738 dotest branches-3.3 "${testcvs} -qn tag dont-tag" \
6743 # Modify this file before branching, to deal with the case where
6744 # someone is hacking along, says "oops, I should be doing this on
6745 # a branch", and only then creates the branch.
6747 dotest branches-4 "${testcvs} tag -b br1" "${PROG}"' tag: Tagging \.
6752 dotest branches-5 "$testcvs update -r br1" \
6753 "$PROG update: Updating \.
6760 dotest branches-6 "${testcvs} -q ci -m modify" \
6762 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6763 new revision: 1\.1\.2\.1; previous revision: 1\.1
6766 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
6767 new revision: 1\.1\.2\.1; previous revision: 1\.1
6770 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6771 new revision: 1\.2\.2\.1; previous revision: 1\.2
6773 dotest branches-7 "${testcvs} -q tag -b brbr" 'T file1
6777 dotest branches-8 "$testcvs -q update -r brbr" \
6784 dotest branches-9 "${testcvs} -q ci -m modify" \
6786 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6787 new revision: 1\.1\.2\.1\.2\.1; previous revision: 1\.1\.2\.1
6790 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6791 new revision: 1\.2\.2\.1\.2\.1; previous revision: 1\.2\.2\.1
6793 dotest branches-10 "cat file1 file2 file3 file4" '1:brbr
6797 dotest branches-11 "$testcvs -q update -r br1" \
6802 dotest branches-12 "cat file1 file2 file3 file4" '1:br1
6807 dotest branches-12.2 "${testcvs} -q ci -m change-on-br1" \
6809 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6810 new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
6812 dotest branches-13 "${testcvs} -q update -A" \
6817 dotest branches-14 "cat file1 file2 file3 file4" '1:ancest
6821 echo 4:trunk-3 >file4
6822 dotest branches-14.2 \
6823 "${testcvs} -q ci -m trunk-change-after-branch" \
6825 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
6826 new revision: 1\.3; previous revision: 1\.2
6828 dotest branches-14.3 "${testcvs} log file4" \
6830 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
6837 brbr: 1\.2\.2\.1\.0\.2
6839 keyword substitution: kv
6840 total revisions: 6; selected revisions: 6
6842 ----------------------------
6844 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
6845 trunk-change-after-branch
6846 ----------------------------
6848 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
6851 ----------------------------
6853 date: [0-9/: ]*; author: ${username}; state: Exp;
6855 ----------------------------
6857 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
6859 ----------------------------
6861 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
6862 branches: 1\.2\.2\.1\.2;
6864 ----------------------------
6865 revision 1\.2\.2\.1\.2\.1
6866 date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
6868 ============================================================================="
6869 dotest_fail branches-14.4 \
6870 "${testcvs} diff -c -r 1.1 -r 1.3 file4" \
6872 ===================================================================
6873 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
6874 retrieving revision 1\.1
6875 retrieving revision 1\.3
6876 diff -c -r1\.1 -r1\.3
6877 \*\*\* file4 ${RFCDATE} 1\.1
6878 --- file4 ${RFCDATE} 1\.3
6879 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6884 dotest_fail branches-14.5 \
6885 "${testcvs} diff -c -r 1.1 -r 1.2.2.1 file4" \
6887 ===================================================================
6888 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
6889 retrieving revision 1\.1
6890 retrieving revision 1\.2\.2\.1
6891 diff -c -r1\.1 -r1\.2\.2\.1
6892 \*\*\* file4 ${RFCDATE} 1\.1
6893 --- file4 ${RFCDATE} 1\.2\.2\.1
6894 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6899 dotest branches-15 \
6900 "${testcvs} update -j 1.1.2.1 -j 1.1.2.1.2.1 file1" \
6901 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6902 retrieving revision 1\.1\.2\.1
6903 retrieving revision 1\.1\.2\.1\.2\.1
6904 Merging differences between 1\.1\.2\.1 and 1\.1\.2\.1\.2\.1 into file1
6905 rcsmerge: warning: conflicts during merge"
6906 dotest branches-16 "cat file1" '<<<<<<< file1
6910 [>]>>>>>> 1\.1\.2\.1\.2\.1'
6912 dotest branches-o1 "${testcvs} -q admin -o ::brbr" \
6913 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6915 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
6917 RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
6919 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
6924 echo Keeping ${TESTDIR} and exiting due to --keep
6928 rm -rf ${CVSROOT_DIRNAME}/first-dir
6933 # More branch tests.
6934 # Test that when updating a new subdirectory in a directory
6935 # which was checked out on a branch, the new subdirectory is
6936 # created on the appropriate branch. Test this when joining
6939 mkdir ${CVSROOT_DIRNAME}/first-dir
6940 mkdir trunk; cd trunk
6943 dotest branches2-1 "${testcvs} -q co first-dir"
6945 echo "file1 first revision" > file1
6946 dotest branches2-2 "${testcvs} add file1" \
6947 "${PROG} add: scheduling file .file1. for addition
6948 ${PROG} add: use .${PROG} commit. to add this file permanently"
6949 dotest branches2-3 "${testcvs} commit -m add file1" \
6950 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6953 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
6954 initial revision: 1\.1
6958 dotest branches2-4 "${testcvs} -q tag tag1" 'T file1'
6960 # Make two branches.
6961 dotest branches2-5 "${testcvs} -q rtag -b -r tag1 b1 first-dir" ''
6962 dotest branches2-6 "${testcvs} -q rtag -b -r tag1 b2 first-dir" ''
6964 # Create some files and a subdirectory on branch b1.
6967 dotest branches2-7 "${testcvs} -q co -r b1 first-dir" \
6970 echo "file2 first revision" > file2
6971 dotest branches2-8 "${testcvs} add file2" \
6972 "${PROG}"' add: scheduling file `file2'\'' for addition on branch `b1'\''
6973 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
6975 dotest branches2-9 "${testcvs} add dir1" \
6976 "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository
6977 --> Using per-directory sticky tag "'`'"b1'"
6978 echo "file3 first revision" > dir1/file3
6979 dotest branches2-10 "${testcvs} add dir1/file3" \
6980 "${PROG}"' add: scheduling file `dir1/file3'\'' for addition on branch `b1'\''
6981 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
6982 dotest branches2-11 "${testcvs} -q ci -madd ." \
6983 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v
6986 ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v <-- file2
6987 new revision: 1\.1\.2\.1; previous revision: 1\.1
6989 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
6991 Checking in dir1/file3;
6992 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v <-- file3
6993 new revision: 1\.1\.2\.1; previous revision: 1\.1
6996 # Check out the second branch, and update the working
6997 # directory to the first branch, to make sure the right
6998 # happens with dir1.
7001 dotest branches2-12 "${testcvs} -q co -r b2 first-dir" \
7004 dotest branches2-13 "${testcvs} update -d -r b1 dir1" \
7005 "${PROG} update: Updating dir1
7007 dotest branches2-14 "${testcvs} -q status" \
7008 "===================================================================
7009 File: file1 Status: Up-to-date
7011 Working revision: 1\.1.*
7012 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
7013 Sticky Tag: b2 (branch: 1\.1\.4)
7015 Sticky Options: (none)
7017 ===================================================================
7018 File: file3 Status: Up-to-date
7020 Working revision: 1\.1\.2\.1.*
7021 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
7022 Sticky Tag: b1 (branch: 1\.1\.2)
7024 Sticky Options: (none)"
7026 # FIXME: Just clobbering the directory like this is a bit
7027 # tacky, although people generally expect it to work. Maybe
7028 # we should release it instead. We do it a few other places
7031 dotest branches2-15 "${testcvs} update -d -j b1 dir1" \
7032 "${PROG} update: Updating dir1
7034 # FIXCVS: The `No revision control file' stuff seems to be
7035 # CVS's way of telling us that we're adding the file on a
7036 # branch, and the file is not on that branch yet. This
7038 dotest branches2-16 "${testcvs} -q status" \
7039 "===================================================================
7040 File: file1 Status: Up-to-date
7042 Working revision: 1\.1.*
7043 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
7044 Sticky Tag: b2 (branch: 1\.1\.4)
7046 Sticky Options: (none)
7048 ===================================================================
7049 File: file3 Status: Locally Added
7051 Working revision: New file!
7052 Repository revision: No revision control file
7053 Sticky Tag: b2 - MISSING from RCS file!
7055 Sticky Options: (none)"
7057 cd ../../trunk/first-dir
7058 dotest branches2-17 "${testcvs} update -d -P dir1" \
7059 "${PROG} update: Updating dir1"
7060 dotest_fail branches2-18 "test -d dir1"
7061 dotest branches2-19 "${testcvs} update -d -P -r b1 dir1" \
7062 "${PROG} update: Updating dir1
7064 dotest branches2-20 "${testcvs} -q status" \
7065 "===================================================================
7066 File: file1 Status: Up-to-date
7068 Working revision: 1\.1.*
7069 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
7072 Sticky Options: (none)
7074 ===================================================================
7075 File: file3 Status: Up-to-date
7077 Working revision: 1\.1\.2\.1.*
7078 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
7079 Sticky Tag: b1 (branch: 1\.1\.2)
7081 Sticky Options: (none)"
7084 dotest branches2-21 "${testcvs} update -d -P -j b1 dir1" \
7085 "${PROG} update: Updating dir1
7087 dotest branches2-22 "${testcvs} -q status" \
7088 "===================================================================
7089 File: file1 Status: Up-to-date
7091 Working revision: 1\.1.*
7092 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
7095 Sticky Options: (none)
7097 ===================================================================
7098 File: file3 Status: Locally Added
7100 Working revision: New file!
7101 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
7104 Sticky Options: (none)"
7109 # Check out branch b1 twice. Crate a new directory in one
7110 # working directory, then do a cvs update in the other
7111 # working directory and see if the tags are right.
7115 dotest branches2-23 "${testcvs} -q co -r b1 first-dir" \
7118 U first-dir/dir1/file3'
7120 dotest branches2-24 "${testcvs} -q co -r b1 first-dir" \
7123 U first-dir/dir1/file3'
7126 dotest branches2-25 "${testcvs} add dir2" \
7127 "Directory ${CVSROOT_DIRNAME}/first-dir/dir2 added to the repository
7128 --> Using per-directory sticky tag "'`'"b1'"
7129 echo "file4 first revision" > dir2/file4
7130 dotest branches2-26 "${testcvs} add dir2/file4" \
7131 "${PROG}"' add: scheduling file `dir2/file4'\'' for addition on branch `b1'\''
7132 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
7133 dotest branches2-27 "${testcvs} -q commit -madd" \
7134 "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
7136 Checking in dir2/file4;
7137 ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v <-- file4
7138 new revision: 1\.1\.2\.1; previous revision: 1\.1
7141 cd ../../b1b/first-dir
7142 dotest branches2-28 "${testcvs} update -d dir2" \
7143 "${PROG} update: Updating dir2
7146 dotest branches2-29 "${testcvs} -q status" \
7147 "===================================================================
7148 File: file4 Status: Up-to-date
7150 Working revision: 1\.1\.2\.1.*
7151 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
7152 Sticky Tag: b1 (branch: 1\.1\.2)
7154 Sticky Options: (none)"
7155 dotest branches2-30 "cat CVS/Tag" 'Tb1'
7157 # Test update -A on a subdirectory
7160 dotest branches2-31 "${testcvs} update -A -d dir2" \
7161 "${PROG} update: Updating dir2"
7163 dotest branches2-32 "${testcvs} -q status" ''
7164 dotest_fail branches2-33 "test -f CVS/Tag"
7166 # Add a file on the trunk.
7167 echo "file5 first revision" > file5
7168 dotest branches2-34 "${testcvs} add file5" \
7169 "${PROG}"' add: scheduling file `file5'\'' for addition
7170 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
7171 dotest branches2-35 "${testcvs} -q commit -madd" \
7172 "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
7175 ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v <-- file5
7176 initial revision: 1\.1
7179 cd ../../../trunk/first-dir
7180 dotest branches2-36 "${testcvs} -q update -d dir2" 'U dir2/file5'
7182 dotest branches2-37 "${testcvs} -q status" \
7183 "===================================================================
7184 File: file5 Status: Up-to-date
7186 Working revision: 1\.1.*
7187 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
7190 Sticky Options: (none)"
7191 dotest_fail branches2-38 "test -f CVS/status"
7194 rm -rf ${CVSROOT_DIRNAME}/first-dir
7199 # Test the tag -c option.
7201 dotest tagc-1 "${testcvs} -q co -l ." ''
7203 dotest tagc-2 "${testcvs} add first-dir" \
7204 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
7207 dotest tagc-3 "${testcvs} add file1 file2" \
7208 "${PROG} add: scheduling file .file1. for addition
7209 ${PROG} add: scheduling file .file2. for addition
7210 ${PROG} add: use .${PROG} commit. to add these files permanently"
7211 dotest tagc-4 "${testcvs} -q ci -m add" \
7212 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7215 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7216 initial revision: 1\.1
7218 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
7221 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
7222 initial revision: 1\.1
7224 dotest tagc-5 "${testcvs} -q tag -c tag1" \
7228 dotest tagc-6 "${testcvs} -q tag -c tag2" \
7231 # Avoid timestamp granularity bugs (FIXME: CVS should be
7232 # doing the sleep, right?).
7235 dotest tagc-6a "${testcvs} rm -f file2" \
7236 "${PROG} remove: scheduling .file2. for removal
7237 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
7239 dotest tagc-6b "${testcvs} add file3" \
7240 "${PROG} add: scheduling file .file3. for addition
7241 ${PROG} add: use .${PROG} commit. to add this file permanently"
7242 dotest_fail tagc-7 "${testcvs} -q tag -c tag3" \
7243 "${PROG} tag: file1 is locally modified
7244 ${PROG} tag: file2 is locally modified
7245 ${PROG} tag: file3 is locally modified
7246 ${PROG} \[tag aborted\]: correct the above errors first!"
7250 dotest tagc-8 "${testcvs} -q co first-dir" \
7254 dotest tagc-9 "${testcvs} -q ci -m modify" \
7256 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7257 new revision: 1\.2; previous revision: 1\.1
7260 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
7261 new revision: delete; previous revision: 1\.1
7263 RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
7266 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
7267 initial revision: 1\.1
7269 cd ../../2/first-dir
7270 dotest tagc-10 "${testcvs} -q tag -c tag4" \
7271 "${PROG} tag: file2 is no longer in the repository
7277 rm -rf ${CVSROOT_DIRNAME}/first-dir
7281 # Make sure `cvs update -p -rT FILE' works from a branch when
7282 # FILE is already on the trunk and is being added to that branch.
7289 # Create the module.
7291 "$testcvs -Q import -m. $module X Y" ''
7294 # Check it out and tag it.
7295 dotest update-p-2 "$testcvs -Q co $module" ''
7297 dotest update-p-3 "$testcvs -Q tag -b B" ''
7299 dotest update-p-4 "$testcvs -Q add $file" ''
7300 dotest update-p-5 "$testcvs -Q ci -m. $file" \
7301 "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
7304 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
7305 initial revision: 1\.1
7307 dotest update-p-6 "$testcvs -Q tag T $file" ''
7308 dotest update-p-7 "$testcvs -Q update -rB" ''
7310 # This merge effectively adds file F on branch B.
7311 dotest update-p-8 "$testcvs -Q update -jT" ''
7313 # Before the fix that prompted the addition of this test,
7314 # the following command would fail with this diagnostic:
7315 # cvs update: conflict: F created independently by second party
7316 dotest update-p-9 "$testcvs update -p -rT $file" \
7317 "===================================================================
7319 RCS: ${CVSROOT_DIRNAME}/$module/$file,v
7321 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
7324 # Repeat the above, but with $file removed.
7325 # This exercises a slightly different code path.
7327 # Before the fix that prompted the addition of this test,
7328 # the following command would fail with this diagnostic:
7329 # cvs update: warning: new-born F has disappeared
7330 dotest update-p-10 "$testcvs update -p -rT $file" \
7331 "===================================================================
7333 RCS: ${CVSROOT_DIRNAME}/$module/$file,v
7335 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
7338 # Exercise yet another code path:
7339 # the one that involves reviving a `dead' file.
7340 # And a little more, for good measure...
7342 dotest update-p-a1 "$testcvs -Q add new" ''
7343 dotest update-p-a2 "$testcvs -Q update -p new" ''
7344 dotest update-p-a3 "$testcvs -Q rm -f new" ''
7346 # Both an update -A, *and* the following update are required
7347 # to return to the state of being on the trunk with a $file
7348 # that we can then remove.
7349 dotest update-p-undead-0 "$testcvs update -A" \
7350 "$PROG update: Updating \.
7351 $PROG update: warning: new-born $file has disappeared
7353 dotest update-p-undead-1 "$testcvs update" \
7354 "${PROG} update: Updating \.
7356 dotest update-p-undead-2 "$testcvs -Q update -p -rT $file" v1
7357 dotest update-p-undead-3 "$testcvs -Q rm -f $file" ''
7358 dotest update-p-undead-4 "$testcvs -Q update -p -rT $file" v1
7359 dotest update-p-undead-5 "$testcvs -Q ci -m. $file" \
7361 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
7362 new revision: delete; previous revision: 1\.1
7364 dotest update-p-undead-6 "$testcvs -Q update -p -rT $file" v1
7366 dotest update-p-undead-7 "$testcvs -Q update -p -rT $file" v1
7367 dotest update-p-undead-8 "$testcvs add $file" \
7368 "${PROG} add: Re-adding file .$file. (in place of dead revision 1\.2)\.
7369 ${PROG} add: use .${PROG} commit. to add this file permanently"
7371 dotest update-p-undead-9 "$testcvs -Q update -p -rT $file" v1
7375 rm -rf ${CVSROOT_DIRNAME}/$module
7379 # More tagging tests, including using tag -F -B to convert a
7380 # branch tag to a regular tag and recovering thereof.
7382 # Setup; check in first-dir/file1
7384 dotest tagf-1 "${testcvs} -q co -l ." ''
7386 dotest tagf-2 "${testcvs} add first-dir" \
7387 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
7390 dotest tagf-3 "${testcvs} add file1 file2" \
7391 "${PROG} add: scheduling file .file1. for addition
7392 ${PROG} add: scheduling file .file2. for addition
7393 ${PROG} add: use .${PROG} commit. to add these files permanently"
7394 dotest tagf-4 "${testcvs} -q ci -m add" \
7395 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7398 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7399 initial revision: 1\.1
7401 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
7404 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
7405 initial revision: 1\.1
7408 # Now create a branch and commit a revision there.
7409 dotest tagf-5 "${testcvs} -q tag -b br" "T file1
7411 dotest tagf-6 "$testcvs -q update -r br" \
7416 dotest tagf-7 "${testcvs} -q ci -m modify" \
7418 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7419 new revision: 1\.1\.2\.1; previous revision: 1\.1
7422 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
7423 new revision: 1\.1\.2\.1; previous revision: 1\.1
7425 # Here we try to make it a non-branch tag, but will
7426 # succeed in getting only warnings, even with -F
7427 # because converting a branch tag to non-branch
7428 # is potentially catastrophic.
7429 dotest tagf-8a "${testcvs} -q tag -F br" \
7430 "${PROG} tag: file1: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\\.2\.1\.
7431 ${PROG} tag: file2: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\.2\.1\."
7432 # however, if we *really* are sure we want to move a branch tag,
7433 # "-F -B" will do the trick
7434 dotest tagf-8 "${testcvs} -q tag -F -B br" "T file1
7436 echo moremod >> file1
7437 echo moremod >> file2
7438 dotest tagf-9 "${testcvs} -q status -v file1" \
7439 "===================================================================
7440 File: file1 Status: Locally Modified
7442 Working revision: 1\.1\.2\.1.*
7443 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
7444 Sticky Tag: br (revision: 1\.1\.2\.1)
7446 Sticky Options: (none)
7449 br (revision: 1\.1\.2\.1)"
7451 # Now, how do we recover?
7452 dotest tagf-10 "${testcvs} -q tag -d br" "D file1
7454 # This creates a new branch, 1.1.4. See the code in RCS_magicrev
7455 # which will notice that there is a (non-magic) 1.1.2 and thus
7457 dotest tagf-11 "${testcvs} -q tag -r 1.1 -b br file1" "T file1"
7458 # Fix it with admin -n (cf admin-18, admin-26-4).
7459 dotest tagf-12 "${testcvs} -q admin -nbr:1.1.2 file2" \
7460 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
7462 # Another variation on the file2 test would be to use two working
7463 # directories so that the update -r br would need to
7464 # a merge to get from 1.1.2.1 to the head of the 1.1.2 branch.
7465 dotest tagf-13 "${testcvs} -q update -r br" \
7466 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7467 retrieving revision 1\.1\.2\.1
7468 retrieving revision 1\.1
7469 Merging differences between 1\.1\.2\.1 and 1\.1 into file1
7470 rcsmerge: warning: conflicts during merge
7471 ${PROG} update: conflicts found in file1
7474 # CVS is giving a conflict because we are trying to get back to
7475 # 1.1.4. I'm not sure why it is a conflict rather than just
7477 dotest tagf-14 "cat file1" \
7484 dotest tagf-15 "${testcvs} -q ci -m recovered" \
7486 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7487 new revision: 1\.1\.4\.1; previous revision: 1\.1
7490 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
7491 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
7493 # try accidentally deleting branch tag, "tag -d"
7494 dotest_fail tagf-16 "${testcvs} tag -d br" \
7495 "${PROG} tag: Untagging \.
7496 ${PROG} tag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\.
7497 ${PROG} tag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\."
7498 # try accidentally deleting branch tag, "rtag -d"
7499 dotest_fail tagf-17 "${testcvs} rtag -d br first-dir" \
7500 "${PROG} rtag: Untagging first-dir
7501 ${PROG} rtag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\.
7502 ${PROG} rtag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\."
7503 # try accidentally converting branch tag to non-branch tag "tag -F"
7504 dotest tagf-18 "${testcvs} tag -r1.1 -F br file1" \
7505 "${PROG} tag: file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\."
7506 # try accidentally converting branch tag to non-branch tag "rtag -F"
7507 dotest tagf-19 "${testcvs} rtag -r1.1 -F br first-dir" \
7508 "${PROG} rtag: Tagging first-dir
7509 ${PROG} rtag: first-dir/file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\.
7510 ${PROG} rtag: first-dir/file2: Not moving branch tag .br. from 1\.1\.2\.2 to 1\.1\."
7511 # create a non-branch tag
7512 dotest tagf-20 "${testcvs} rtag regulartag first-dir" \
7513 "${PROG} rtag: Tagging first-dir"
7514 # try accidentally converting non-branch tag to branch tag (tag -F -B -b)
7515 dotest tagf-21 "${testcvs} tag -F -B -b regulartag file1" \
7516 "${PROG} tag: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1\.0\.2 due to .-B. option\."
7517 # try accidentally converting non-branch tag to branch rtag (rtag -F -B -b)
7518 dotest tagf-22 "${testcvs} rtag -F -B -b regulartag first-dir" \
7519 "${PROG} rtag: Tagging first-dir
7520 ${PROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.6 due to .-B. option\.
7521 ${PROG} rtag: first-dir/file2: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.4 due to .-B. option\."
7522 # Try accidentally deleting non-branch: (tag -d -B)
7523 dotest_fail tagf-23 "${testcvs} tag -d -B regulartag file1" \
7524 "${PROG} tag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\."
7525 # Try accidentally deleting non-branch: (rtag -d -B)
7526 dotest_fail tagf-24 \
7527 "${testcvs} rtag -d -B regulartag first-dir" \
7528 "${PROG} rtag: Untagging first-dir
7529 ${PROG} rtag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\.
7530 ${PROG} rtag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file2,v. due to .-B. option\."
7532 # the following tests (throught the next commit) keep moving the same
7533 # tag back and forth between 1.1.6 & 1.1.8 in file1 and between
7534 # 1.1.4 and 1.1.6 in file2 since nothing was checked in on some of
7535 # these branches and CVS only tracks branches via tags unless they contain data.
7537 # try intentionally converting non-branch tag to branch tag (tag -F -b)
7538 dotest tagf-25a "${testcvs} tag -F -b regulartag file1" "T file1"
7539 # try intentionally moving a branch tag to a newly created branch (tag -F -b -B)
7540 dotest tagf-25b "${testcvs} tag -F -B -b -r1.1 regulartag file1" \
7542 # try intentionally converting mixed tags to branch tags (rtag -F -b)
7543 dotest tagf-26a "${testcvs} rtag -F -b regulartag first-dir" \
7544 "${PROG} rtag: Tagging first-dir
7545 ${PROG} rtag: first-dir/file1: Not moving branch tag .regulartag. from 1\.1 to 1\.1\.0\.8\."
7546 # try intentionally converting a branch to a new branch tag (rtag -F -b -B)
7547 dotest tagf-26b "${testcvs} rtag -F -B -b -r1.1 regulartag first-dir" \
7548 "${PROG} rtag: Tagging first-dir"
7549 # update to our new branch
7550 dotest tagf-27 "${testcvs} update -r regulartag" \
7551 "${PROG} update: Updating \.
7554 # commit some changes and see that all rev numbers look right
7555 echo changes >> file1
7556 echo changes >> file2
7557 dotest tagf-28 "${testcvs} ci -m changes" \
7558 "${PROG} [a-z]*: Examining \.
7560 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7561 new revision: 1\.1\.8\.1; previous revision: 1\.1
7564 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
7565 new revision: 1\.1\.6\.1; previous revision: 1\.1
7567 # try intentional branch to non-branch (tag -F -B)
7568 dotest tagf-29 "${testcvs} tag -F -B -r1.1 regulartag file1" \
7570 # try non-branch to non-branch (tag -F -B)
7571 dotest tagf-29a "${testcvs} tag -F -B -r br regulartag file1" \
7572 "${PROG} tag: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\."
7573 # try mixed-branch to non-branch (rtag -F -B )
7574 dotest tagf-29b "${testcvs} rtag -F -B -r br regulartag first-dir" \
7575 "${PROG} rtag: Tagging first-dir
7576 ${PROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\."
7577 # at this point, regulartag is a regular tag within
7580 # try intentional branch to non-branch (rtag -F -B)
7581 dotest tagf-30 "${testcvs} rtag -F -B -r1.1 br first-dir" \
7582 "${PROG} rtag: Tagging first-dir"
7583 # create a branch tag so we can try to delete it.
7584 dotest tagf-31 "${testcvs} rtag -b brtag first-dir" \
7585 "${PROG} rtag: Tagging first-dir"
7587 # try intentinal deletion of branch tag (tag -d -B)
7588 dotest tagf-32 "${testcvs} tag -d -B brtag file1" "D file1"
7589 # try intentinal deletion of branch tag (rtag -d -B)
7590 dotest tagf-33 "${testcvs} rtag -d -B brtag first-dir" \
7591 "${PROG} rtag: Untagging first-dir"
7596 rm -rf ${CVSROOT_DIRNAME}/first-dir
7600 # Test log output for tags
7602 dotest tag-log-init-1 "$testcvs -q co -l ."
7604 dotest tag-log-init-2 "$testcvs add first-dir" \
7605 "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
7608 dotest tag-log-init-3 "$testcvs add file1" \
7609 "${PROG}"' add: scheduling file `file1'\'' for addition
7610 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
7611 dotest tag-log-init-4 "$testcvs -Q ci -m add" \
7612 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7615 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
7616 initial revision: 1\.1
7619 dotest tag-log-1 "$testcvs -Q tag mytag file1" ''
7620 dotest tag-log-2 "$testcvs log -N file1" \
7622 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7628 keyword substitution: kv
7629 total revisions: 1; selected revisions: 1
7631 ----------------------------
7633 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
7635 ============================================================================="
7636 dotest tag-log-3 "$testcvs log -N -n file1" \
7638 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7646 keyword substitution: kv
7647 total revisions: 1; selected revisions: 1
7649 ----------------------------
7651 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
7653 ============================================================================="
7654 dotest tag-log-4 "$testcvs log file1" \
7656 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7664 keyword substitution: kv
7665 total revisions: 1; selected revisions: 1
7667 ----------------------------
7669 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
7671 ============================================================================="
7672 dotest tag-log-5 "$testcvs log -n file1" \
7674 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7682 keyword substitution: kv
7683 total revisions: 1; selected revisions: 1
7685 ----------------------------
7687 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
7689 ============================================================================="
7693 rm -rf ${CVSROOT_DIRNAME}/first-dir
7697 # Test tags with spaces in the names.
7699 # Prior to releases 1.11.18 & 1.12.10, some commands used with
7700 # tags with spaces in the names could hang CVS.
7702 # Setup; check in first-dir/file1
7704 dotest tag-space-init-1 "$testcvs -q co -l ."
7706 dotest tag-space-init-2 "$testcvs add first-dir" \
7707 "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
7710 dotest tag-space-init-3 "$testcvs add file1" \
7711 "$PROG add: scheduling file \`file1' for addition
7712 $PROG add: use '$PROG commit' to add this file permanently"
7713 dotest tag-space-init-4 "$testcvs -Q ci -m add" \
7714 "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
7717 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
7718 initial revision: 1\.1
7721 # Reportedly, the following two tags make it past WinCVS.
7722 dotest_fail tag-space-1 "$testcvs tag ' spacetag '" \
7723 "$PROG \[tag aborted\]: tag \` spacetag ' must start with a letter"
7724 dotest_fail tag-space-2 "$testcvs tag 'spacetag '" \
7725 "$PROG \[tag aborted\]: tag \`spacetag ' has non-visible graphic characters"
7728 # Verify that this isn't a client check.
7729 dotest tag-space-3 "$testcvs server" \
7730 "E $PROG \[tag aborted\]: tag \` spacetag ' must start with a letter
7732 Root $CVSROOT_DIRNAME
7737 $CVSROOT_DIRNAME/first-dir
7743 dotest tag-space-4 "$testcvs server" \
7744 "E $PROG \[tag aborted\]: tag \`spacetag ' has non-visible graphic characters
7746 Root $CVSROOT_DIRNAME
7751 $CVSROOT_DIRNAME/first-dir
7758 # Any number of normal tags and branches were handled correctly.
7759 dotest tag-space-5 "$testcvs -Q tag t1"
7760 dotest tag-space-5b "$testcvs -Q tag t2"
7761 dotest tag-space-5c "$testcvs -Q tag -b b1"
7766 # But once a vendor branch exists, it's all over.
7767 mkdir project; cd project
7769 dotest tag-space-init-4 \
7770 "$testcvs -Q import -mimport second-dir VENDOR RELEASE"
7774 dotest_fail tag-space-6 "$testcvs -Q co -r ' spacetag ' first-dir" \
7775 "$PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter"
7777 # But when any files were imported, this test hung prior to CVS
7778 # versions 1.11.18 & 1.12.10.
7779 dotest_fail tag-space-7 "$testcvs -Q co -r ' spacetag ' second-dir" \
7780 "$PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter"
7783 # I based the client input in the next two tests on actual input
7785 dotest tag-space-8 "$testcvs server" \
7786 "E $PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter
7788 Root $CVSROOT_DIRNAME
7798 # Verify the test is not on the client side.
7799 dotest tag-space-9 "$testcvs server" \
7800 "E $PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter
7802 Root $CVSROOT_DIRNAME
7813 dotest tag-space-10 "$testcvs -Q co second-dir"
7816 # This test would also hang.
7817 dotest_fail tag-space-11 "$testcvs -Q up -r ' spacetag '" \
7818 "$PROG \[update aborted\]: tag \` spacetag ' must start with a letter"
7821 dotest tag-space-12 "$testcvs server" \
7822 "E $PROG \[update aborted\]: tag \` spacetag ' must start with a letter
7824 Root $CVSROOT_DIRNAME
7836 # I'm skipping tests for other commands that may have had the same
7837 # problem. Hopefully, if a new issue arises, one of the above tests
7838 # will catch the problem.
7841 echo Keeping $TESTDIR and exiting due to --keep
7847 rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/second-dir
7851 # Test librarification of RCS.
7852 # First: test whether `cvs diff' handles $Name expansion
7853 # correctly. We diff two revisions with their symbolic tags;
7854 # neither tag should be expanded in the output. Also diff
7855 # one revision with the working copy.
7857 mkdir ${CVSROOT_DIRNAME}/first-dir
7858 dotest rcsdiff-1 "${testcvs} -q co first-dir" ''
7860 echo "I am the first foo, and my name is $""Name$." > foo.c
7861 dotest rcsdiff-2 "${testcvs} add -m new-file foo.c" \
7862 "${PROG} add: scheduling file .foo\.c. for addition
7863 ${PROG} add: use .${PROG} commit. to add this file permanently"
7864 dotest rcsdiff-3 "${testcvs} commit -m rev1 foo.c" \
7865 "RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
7868 ${CVSROOT_DIRNAME}/first-dir/foo.c,v <-- foo\.c
7869 initial revision: 1\.1
7871 dotest rcsdiff-4 "${testcvs} tag first foo.c" "T foo\.c"
7872 dotest rcsdiff-5 "${testcvs} update -p -r first foo.c" \
7873 "===================================================================
7875 RCS: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
7877 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
7878 I am the first foo, and my name is \$""Name: first \$\."
7880 echo "I am the second foo, and my name is $""Name$." > foo.c
7881 dotest rcsdiff-6 "${testcvs} commit -m rev2 foo.c" \
7882 "Checking in foo\.c;
7883 ${CVSROOT_DIRNAME}/first-dir/foo\.c,v <-- foo\.c
7884 new revision: 1\.2; previous revision: 1\.1
7886 dotest rcsdiff-7 "${testcvs} tag second foo.c" "T foo\.c"
7887 dotest rcsdiff-8 "${testcvs} update -p -r second foo.c" \
7888 "===================================================================
7890 RCS: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
7892 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
7893 I am the second foo, and my name is \$""Name: second \$\."
7895 dotest_fail rcsdiff-9 "${testcvs} diff -r first -r second" \
7896 "${PROG} diff: Diffing \.
7898 ===================================================================
7899 RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
7900 retrieving revision 1\.1
7901 retrieving revision 1\.2
7904 < I am the first foo, and my name is \$""Name: \$\.
7906 > I am the second foo, and my name is \$""Name: \$\."
7908 echo "I am the once and future foo, and my name is $""Name$." > foo.c
7909 dotest_fail rcsdiff-10 "${testcvs} diff -r first" \
7910 "${PROG} diff: Diffing \.
7912 ===================================================================
7913 RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
7914 retrieving revision 1\.1
7917 < I am the first foo, and my name is \$""Name: \$\.
7919 > I am the once and future foo, and my name is \$""Name\$\."
7921 # Test handling of libdiff options. diff gets quite enough
7922 # of a workout elsewhere in sanity.sh, so we assume that it's
7923 # mostly working properly if it passes all the other tests.
7924 # The main one we want to try is regex handling, since we are
7925 # using CVS's regex matcher and not diff's.
7928 test_regex (whiz, bang)
7937 dotest rcslib-diffrgx-1 "${testcvs} -q add -m '' rgx.c" \
7938 "${PROG} add: use .${PROG} commit. to add this file permanently"
7939 dotest rcslib-diffrgx-2 "${testcvs} -q ci -m '' rgx.c" \
7940 "RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
7943 ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v <-- rgx\.c
7944 initial revision: 1\.1
7947 test_regex (whiz, bang)
7955 # Use dotest_fail because exit status from `cvs diff' must be 1.
7956 dotest_fail rcslib-diffrgx-3 "${testcvs} diff -c -F'.* (' rgx.c" \
7958 ===================================================================
7959 RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
7960 retrieving revision 1\.1
7961 diff -c -F \.\* ( -r1\.1 rgx\.c
7962 \*\*\* rgx\.c ${RFCDATE} 1\.1
7963 --- rgx\.c ${RFCDATE}
7964 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* test_regex (whiz, bang)
7978 # Tests of rcsmerge/diff3. Merge operations get a good general
7979 # workout elsewhere; we want to make sure that options are still
7980 # handled properly. Try merging two branches with -kv, to test
7981 # both -j and -k switches.
7985 rm -rf ${CVSROOT_DIRNAME}/first-dir
7989 dotest rcslib-merge-1 "${testcvs} -q co -l ." ""
7991 dotest rcslib-merge-2 "${testcvs} -q add first-dir" \
7992 "Directory ${CVSROOT_DIRNAME}.*/first-dir added to the repository"
7995 dotest rcslib-merge-3 "${testcvs} -q co first-dir" ""
7998 echo '$''Revision$' > file1
8001 dotest rcslib-merge-4 "${testcvs} -q add file1" \
8002 "${PROG} add: use .${PROG} commit. to add this file permanently"
8003 dotest rcslib-merge-5 "${testcvs} -q commit -m '' file1" \
8004 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8007 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8008 initial revision: 1\.1
8010 sed -e 's/2/two/' file1 > f; mv f file1
8011 dotest rcslib-merge-6 "${testcvs} -q commit -m '' file1" \
8013 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8014 new revision: 1\.2; previous revision: 1\.1
8016 dotest rcslib-merge-7 "${testcvs} -q tag -b -r 1.1 patch1" "T file1"
8017 dotest rcslib-merge-8 "${testcvs} -q update -r patch1" "[UP] file1"
8018 dotest rcslib-merge-9 "${testcvs} -q status" \
8019 "===================================================================
8020 File: file1 Status: Up-to-date
8022 Working revision: 1\.1.*
8023 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
8024 Sticky Tag: patch1 (branch: 1\.1\.2)
8026 Sticky Options: (none)"
8027 dotest rcslib-merge-10 "cat file1" \
8028 '$''Revision: 1\.1 $
8031 sed -e 's/3/three/' file1 > f; mv f file1
8032 dotest rcslib-merge-11 "${testcvs} -q commit -m '' file1" \
8034 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8035 new revision: 1\.1\.2\.1; previous revision: 1\.1
8037 dotest rcslib-merge-12 "${testcvs} -q update -kv -j1.2" \
8039 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8040 retrieving revision 1\.1
8041 retrieving revision 1\.2
8042 Merging differences between 1\.1 and 1\.2 into file1
8043 rcsmerge: warning: conflicts during merge"
8044 dotest rcslib-merge-13 "cat file1" \
8055 # Test behavior of symlinks in the repository.
8056 if test -n "$remotehost"; then
8057 # Create the link on the remote system. This is because Cygwin's
8058 # Windows support creates *.lnk files for Windows. When creating
8059 # these in an SMB share from UNIX, these links won't work from the
8061 dotest rcslib-symlink-1remotehost "${CVS_RSH} $remotehost 'ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
8063 dotest rcslib-symlink-1 "ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
8065 dotest rcslib-symlink-2 "${testcvs} update file2" "U file2"
8066 echo "This is a change" >> file2
8067 dotest rcslib-symlink-3 "${testcvs} ci -m because file2" \
8069 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file2
8070 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
8073 # Switch as for rcslib-symlink-1
8074 if test -n "$remotehost"; then
8075 dotest rcslib-symlink-4 "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/file2,v'" \
8076 ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
8078 dotest rcslib-symlink-4 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
8079 ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
8082 # CVS was failing to check both the symlink and the file
8083 # for timestamp changes for a while. Test that.
8085 dotest rcslib-symlink-3a "${testcvs} -q up file1" \
8086 "${PROG} update: warning: file1 was lost
8088 echo "This is a change" >> file1
8089 dotest rcslib-symlink-3b "${testcvs} ci -m because file1" \
8091 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8092 new revision: 1\.1\.2\.[0-9]*; previous revision: 1\.1\.2\.[0-9]*
8094 dotest rcslib-symlink-3c "${testcvs} update file2" "[UP] file2"
8096 echo some new text >file3
8097 dotest rcslib-symlink-3d "${testcvs} -Q add file3" ''
8098 dotest rcslib-symlink-3e "${testcvs} -Q ci -mtest file3" \
8099 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
8102 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
8103 new revision: 1\.1\.2\.1; previous revision: 1\.1
8106 rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v
8107 # As for rcslib-symlink-1
8108 if test -n "$remotehost"; then
8109 dotest rcslib-symlink-3f "$CVS_RSH $remotehost 'ln -s Attic/file3,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
8111 dotest rcslib-symlink-3f "ln -s Attic/file3,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
8114 dotest rcslib-symlink-3g "${testcvs} update file2" "U file2"
8116 # restore the link to file1 for the following tests
8117 dotest rcslib-symlink-3i "${testcvs} -Q rm -f file3" ''
8118 dotest rcslib-symlink-3j "${testcvs} -Q ci -mwhatever file3" \
8120 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
8121 new revision: delete; previous revision: 1\.1\.2\.1
8123 rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v
8124 rm -f ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
8125 # As for rcslib-symlink-1
8126 if test -n "$remotehost"; then
8127 dotest rcslib-symlink-3h "$CVS_RSH $remotehost 'ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
8129 dotest rcslib-symlink-3h "ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
8132 # Test 5 reveals a problem with having symlinks in the
8133 # repository. CVS will try to tag both of the files
8134 # separately. After processing one, it will do the same
8135 # operation to the other, which is actually the same file,
8136 # so the tag will already be there. FIXME: do we bother
8137 # changing operations to notice cases like this? This
8138 # strikes me as a difficult problem. -Noel
8139 dotest rcslib-symlink-5 "${testcvs} tag the_tag" \
8140 "${PROG} tag: Tagging .
8142 W file2 : the_tag already exists on version 1.1.2.3 : NOT MOVING tag to version 1.1.2.1"
8143 # As for rcslib-symlink-1
8144 if test -n "$remotehost"; then
8145 dotest rcslib-symlink-6 "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/file2,v'" \
8146 ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
8148 dotest rcslib-symlink-6 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
8149 ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
8152 # Symlinks tend to interact poorly with the Attic.
8155 dotest rcslib-symlink-7 "${testcvs} -q co first-dir" \
8159 dotest rcslib-symlink-8 "${testcvs} rm -f file2" \
8160 "${PROG} remove: scheduling .file2. for removal
8161 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
8162 dotest rcslib-symlink-9 "${testcvs} -q ci -m rm-it" \
8164 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file2
8165 new revision: delete; previous revision: 1\.2
8167 # OK, why this message happens twice is relatively clear
8168 # (the check_* and rtag_* calls to start_recursion).
8169 # Why it happens a third time I didn't try to find out.
8170 dotest rcslib-symlink-10 \
8171 "${testcvs} -q rtag -b -r the_tag brtag first-dir" \
8172 "${PROG} rtag: could not read RCS file for file2
8173 ${PROG} rtag: could not read RCS file for first-dir/file2
8174 ${PROG} rtag: could not read RCS file for first-dir/file2"
8176 # Restore file1 for the next test.
8177 dotest rcslib-long-symlink-init-1 "$testcvs -Q up -A"
8178 dotest rcslib-long-symlink-init-2 "$testcvs -Q add file1"
8179 dotest rcslib-long-symlink-init-3 "$testcvs -Q ci -mback" \
8181 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
8182 new revision: 1\.4; previous revision: 1\.3
8187 # CVS has a hard-coded default link path size of 127 characters.
8188 # Make sure it knows how to exceed that.
8189 longpath=$CVSROOT_DIRNAME
8191 while test $count -lt 10; do
8192 count=`expr $count + 1`
8193 longpath=$longpath/123456789012345678901234567890
8196 cp $CVSROOT_DIRNAME/first-dir/file1,v $longpath
8197 mkdir $CVSROOT_DIRNAME/second-dir
8199 # Switch as for rcslib-symlink-1
8200 if test -n "$remotehost"; then
8201 dotest rcslib-long-symlink-1rh \
8202 "$CVS_RSH $remotehost 'ln -s $longpath/file1,v $CVSROOT_DIRNAME/second-dir/fileX,v'"
8204 dotest rcslib-long-symlink-1 \
8205 "ln -s $longpath/file1,v $CVSROOT_DIRNAME/second-dir/fileX,v"
8208 dotest rcslib-long-symlink-2 "$testcvs co second-dir" \
8209 "$PROG checkout: Updating second-dir
8213 echo change-it >>fileX
8215 # Writes actually cause symlinks to be resolved.
8216 dotest rcslib-long-symlink-3 "$testcvs -q ci -mwrite-it" \
8218 $CVSROOT_DIRNAME/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/file1,v <-- fileX
8219 new revision: 1\.5; previous revision: 1\.4
8223 echo Keeping ${TESTDIR} and exiting due to --keep
8228 # Must remove the symlink first. Samba doesn't appear to show
8229 # broken symlink across the SMB share, and rm -rf by itself
8230 # will remove file1,v first and leave file2,v a broken link and the
8231 # rm -rf will fail since it doesn't find file2,v and it still gets
8232 # directory not empty errors removing cvsroot/first-dir.
8234 # I'm not sure why I need to do this on $remotehost. The rm above
8235 # rcslib-symlink-3j works fine, but the next one doesn't unless run
8236 # remotely under Cygwin and using a TESTDIR on a Samba share.
8237 if test -n "$remotehost"; then
8238 $CVS_RSH $remotehost \
8239 "rm -f $CVSROOT_DIRNAME/first-dir/file2,v $CVSROOT_DIRNAME/second-dir/fileX,v"
8241 rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/second-dir \
8242 $CVSROOT_DIRNAME/123456789012345678901234567890
8243 rm -r first-dir second-dir 2
8247 # Test the ability to have several branchpoints coming off the
8249 mkdir ${CVSROOT_DIRNAME}/first-dir
8250 dotest multibranch-1 "${testcvs} -q co first-dir" ''
8252 echo 1:trunk-1 >file1
8253 dotest multibranch-2 "${testcvs} add file1" \
8254 "${PROG}"' add: scheduling file `file1'\'' for addition
8255 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
8256 dotest_lit multibranch-3 "${testcvs} -q ci -m add-it" <<HERE
8257 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8260 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8261 initial revision: 1.1
8264 dotest multibranch-4 "${testcvs} tag -b br1" \
8265 "${PROG} tag: Tagging \.
8267 dotest multibranch-5 "${testcvs} tag -b br2" \
8268 "${PROG} tag: Tagging \.
8270 dotest multibranch-6 "$testcvs -q update -r br1" '[UP] file1'
8272 dotest multibranch-7 "${testcvs} -q ci -m modify-on-br1" \
8274 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8275 new revision: 1\.1\.2\.1; previous revision: 1\.1
8277 dotest multibranch-8 "${testcvs} -q update -r br2" '[UP] file1'
8278 echo br2 adds a line >>file1
8279 dotest multibranch-9 "${testcvs} -q ci -m modify-on-br2" \
8281 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
8282 new revision: 1\.1\.4\.1; previous revision: 1\.1
8284 dotest multibranch-10 "${testcvs} -q update -r br1" '[UP] file1'
8285 dotest multibranch-11 "cat file1" 'on-br1'
8286 dotest multibranch-12 "${testcvs} -q update -r br2" '[UP] file1'
8287 dotest multibranch-13 "cat file1" '1:trunk-1
8290 dotest multibranch-14 "${testcvs} log file1" \
8292 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8301 keyword substitution: kv
8302 total revisions: 3; selected revisions: 3
8304 ----------------------------
8306 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
8307 branches: 1\.1\.2; 1\.1\.4;
8309 ----------------------------
8311 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
8313 ----------------------------
8315 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
8317 ============================================================================="
8321 echo Keeping ${TESTDIR} and exiting due to --keep
8325 rm -rf ${CVSROOT_DIRNAME}/first-dir
8329 import) # test death after import
8330 # Tests of "cvs import":
8332 # rdiff -- imports with keywords
8333 # import -- more tests of imports with keywords
8334 # importb -- -b option.
8335 # importc -- bunch o' files in bunch o' directories
8337 # mflag -- various -m messages
8338 # ignore -- import and cvsignore
8339 # binwrap -- import and -k wrappers
8340 # info -- imports which are rejected by verifymsg
8341 # head -- intended to test vendor branches and HEAD,
8342 # although it doesn't really do it yet.
8343 # import-CVS -- refuse to import directories named "CVS".
8344 # import-quirks -- short tests of import quirks.
8347 mkdir import-dir ; cd import-dir
8349 for i in 1 2 3 4 ; do
8350 echo imported file"$i" > imported-f"$i"
8353 # This directory should be on the default ignore list,
8354 # so it shouldn't get imported.
8356 echo ignore.me >RCS/ignore.me
8358 echo 'import should not expand $''Id$' >>imported-f2
8359 cp imported-f2 ../imported-f2-orig.tmp
8361 dotest_sort import-96 \
8362 "${testcvs} import -m first-import first-dir vendor-branch junk-1_0" \
8366 N first-dir/imported-f1
8367 N first-dir/imported-f2
8368 N first-dir/imported-f3
8369 N first-dir/imported-f4
8370 No conflicts created by this import"
8372 dotest import-96.5 "cmp ../imported-f2-orig.tmp imported-f2" ''
8377 dotest import-97 "${testcvs} -q co first-dir" \
8378 "U first-dir/imported-f1
8379 U first-dir/imported-f2
8380 U first-dir/imported-f3
8381 U first-dir/imported-f4"
8385 for i in 1 2 3 4 ; do
8386 dotest import-98-$i "test -f imported-f$i" ''
8388 dotest_fail import-98.5 "test -d RCS" ''
8392 dotest import-99 "${testcvs} rm imported-f1" \
8393 "${PROG}"' remove: scheduling `imported-f1'\'' for removal
8394 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
8397 echo local-change >> imported-f2
8400 dotest import-100 "${testcvs} ci -m local-changes" \
8401 "${PROG} [a-z]*: Examining .
8402 Removing imported-f1;
8403 ${CVSROOT_DIRNAME}/first-dir/imported-f1,v <-- imported-f1
8404 new revision: delete; previous revision: 1\.1\.1\.1
8406 Checking in imported-f2;
8407 ${CVSROOT_DIRNAME}/first-dir/imported-f2,v <-- imported-f2
8408 new revision: 1\.2; previous revision: 1\.1
8412 dotest import-101 "${testcvs} log imported-f1" \
8414 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/imported-f1,v
8415 Working file: imported-f1
8421 junk-1_0: 1\.1\.1\.1
8422 vendor-branch: 1\.1\.1
8423 keyword substitution: kv
8424 total revisions: 3; selected revisions: 3
8426 ----------------------------
8428 date: [0-9/]* [0-9:]*; author: ${username}; state: dead; lines: ${PLUS}0 -0
8430 ----------------------------
8432 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
8435 ----------------------------
8437 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
8439 ============================================================================="
8441 # update into the vendor branch.
8442 dotest import-102 "$testcvs update -rvendor-branch" \
8443 "$PROG update: Updating .
8449 # remove file4 on the vendor branch
8451 dotest import-103 "${testcvs} rm imported-f4" \
8452 "${PROG}"' remove: scheduling `imported-f4'\'' for removal
8453 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
8457 "${testcvs} ci -m vendor-removed imported-f4" \
8458 "Removing imported-f4;
8459 ${CVSROOT_DIRNAME}/first-dir/imported-f4,v <-- imported-f4
8460 new revision: delete; previous revision: 1\.1\.1\.1
8463 # update to main line
8464 dotest import-105 "$testcvs -q update -A" \
8465 "$PROG update: imported-f1 is no longer in the repository
8469 # second import - file4 deliberately unchanged
8472 echo rev 2 of file $i >> imported-f"$i"
8474 cp imported-f2 ../imported-f2-orig.tmp
8476 dotest_sort import-106 \
8477 "${testcvs} import -m second-import first-dir vendor-branch junk-2_0" \
8481 ${PROG} checkout -j<prev_rel_tag> -jjunk-2_0 first-dir
8482 2 conflicts created by this import.
8483 C first-dir/imported-f1
8484 C first-dir/imported-f2
8486 U first-dir/imported-f3
8487 U first-dir/imported-f4
8488 Use the following command to help the merge:"
8490 dotest import-106.5 "cmp ../imported-f2-orig.tmp imported-f2" \
8495 rm imported-f2-orig.tmp
8498 dotest import-107 "${testcvs} co first-dir" \
8499 "${PROG} checkout: Updating first-dir
8500 [UP] first-dir/imported-f3
8501 [UP] first-dir/imported-f4"
8505 dotest_fail import-108 "test -f imported-f1" ''
8508 dotest import-109-$i "test -f imported-f$i" ''
8511 # check vendor branch for file4
8512 dotest import-110 "$testcvs -q update -rvendor-branch" \
8518 dotest import-111 "test -f imported-f4" ''
8520 # update to main line
8521 dotest import-112 "$testcvs -q update -A" \
8522 "$PROG update: imported-f1 is no longer in the repository
8530 "${testcvs} -q co -jjunk-1_0 -jjunk-2_0 first-dir" \
8531 "${PROG} checkout: file first-dir/imported-f1 does not exist, but is present in revision junk-2_0
8532 RCS file: ${CVSROOT_DIRNAME}/first-dir/imported-f2,v
8533 retrieving revision 1\.1\.1\.1
8534 retrieving revision 1\.1\.1\.2
8535 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into imported-f2
8536 rcsmerge: warning: conflicts during merge
8537 first-dir/imported-f3 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.2
8538 first-dir/imported-f4 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.3"
8542 dotest_fail import-114 "test -f imported-f1" ''
8545 dotest import-115-$i "test -f imported-f$i" ''
8548 dotest import-116 'cat imported-f2' \
8550 [<]<<<<<< imported-f2
8551 import should not expand \$''Id: imported-f2,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
8554 import should not expand \$''Id: imported-f2,v 1\.1\.1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
8556 [>]>>>>>> 1\.1\.1\.2'
8560 rm -rf ${CVSROOT_DIRNAME}/first-dir
8565 # More cvs import tests, especially -b option.
8567 # OK, first we get some sources from the NetMunger project, and
8568 # import them into the 1.1.1 vendor branch.
8571 echo 'OpenMunger sources' >file1
8572 echo 'OpenMunger sources' >file2
8573 dotest_sort importb-1 \
8574 "${testcvs} import -m add first-dir openmunger openmunger-1_0" \
8579 No conflicts created by this import"
8583 # Now we put the sources we get from FreeMunger into 1.1.3
8586 echo 'FreeMunger sources' >file1
8587 echo 'FreeMunger sources' >file2
8588 # Not completely sure how the conflict detection is supposed to
8589 # be working here (haven't really thought about it).
8590 # We use an explicit -d option to test that it is reflected
8591 # in the suggested checkout.
8592 dotest_sort importb-2 \
8593 "${testcvs} -d ${CVSROOT} import -m add -b 1.1.3 first-dir freemunger freemunger-1_0" \
8597 ${PROG} -d ${CVSROOT} checkout -j<prev_rel_tag> -jfreemunger-1_0 first-dir
8598 2 conflicts created by this import.
8601 Use the following command to help the merge:"
8605 # Now a test of main branch import (into second-dir, not first-dir).
8608 echo 'my own stuff' >mine1.c
8609 echo 'my own stuff' >mine2.c
8610 dotest_fail importb-3 \
8611 "${testcvs} import -m add -b 1 second-dir dummy really_dumb_y" \
8612 "$PROG \[import aborted\]: Only numeric branch specifications with two dots are
8613 supported by import, not \`1'\. For example: \`1\.1\.1'\."
8614 : when we implement main-branch import, should be \
8615 "N second-dir/mine1\.c
8616 N second-dir/mine2\.c
8618 No conflicts created by this import"
8624 # when we implement main branch import, will want to
8625 # add "second-dir" here.
8626 dotest importb-4 "${testcvs} -q co first-dir" \
8630 dotest importb-5 "${testcvs} -q log file1" "
8631 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8638 freemunger-1_0: 1\.1\.3\.1
8640 openmunger-1_0: 1\.1\.1\.1
8642 keyword substitution: kv
8643 total revisions: 3; selected revisions: 3
8645 ----------------------------
8647 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
8648 branches: 1\.1\.1; 1\.1\.3;
8650 ----------------------------
8652 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
8654 ----------------------------
8656 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
8658 ============================================================================="
8662 rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
8666 # Test importing a bunch o' files in a bunch o' directories.
8667 # Also the -d option.
8669 mkdir adir bdir cdir
8670 mkdir adir/sub1 adir/sub2
8671 mkdir adir/sub1/ssdir
8673 touch adir/sub1/file1 adir/sub2/file2 adir/sub1/ssdir/ssfile
8674 touch -t 197107040343 bdir/subdir/file1
8675 touch -t 203412251801 cdir/cfile
8676 dotest_sort importc-1 \
8677 "${testcvs} import -d -m import-it first-dir vendor release" \
8680 N first-dir/adir/sub1/file1
8681 N first-dir/adir/sub1/ssdir/ssfile
8682 N first-dir/adir/sub2/file2
8683 N first-dir/bdir/subdir/file1
8684 N first-dir/cdir/cfile
8685 No conflicts created by this import
8686 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir
8687 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1
8688 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1/ssdir
8689 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub2
8690 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/bdir
8691 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/bdir/subdir
8692 ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/cdir"
8695 dotest importc-2 "${testcvs} -q co first-dir" \
8696 "U first-dir/adir/sub1/file1
8697 U first-dir/adir/sub1/ssdir/ssfile
8698 U first-dir/adir/sub2/file2
8699 U first-dir/bdir/subdir/file1
8700 U first-dir/cdir/cfile"
8702 dotest importc-3 "${testcvs} update adir/sub1" \
8703 "${PROG} update: Updating adir/sub1
8704 ${PROG} update: Updating adir/sub1/ssdir"
8705 dotest importc-4 "${testcvs} update adir/sub1 bdir/subdir" \
8706 "${PROG} update: Updating adir/sub1
8707 ${PROG} update: Updating adir/sub1/ssdir
8708 ${PROG} update: Updating bdir/subdir"
8710 echo modify >>cdir/cfile
8712 "${testcvs} -q rtag -b -r release wip_test first-dir" ""
8713 dotest importc-6 "$testcvs -q update -r wip_test" \
8715 U adir/sub1/ssdir/ssfile
8720 # This used to fail in local mode
8721 dotest importc-7 "${testcvs} -q ci -m modify -r wip_test" \
8722 "Checking in cdir/cfile;
8723 ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v <-- cfile
8724 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
8727 # TODO: should also be testing "import -d" when we update
8729 dotest importc-8 "${testcvs} -q log cdir/cfile" "
8730 RCS file: ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v
8731 Working file: cdir/cfile
8737 wip_test: 1\.1\.1\.1\.0\.2
8740 keyword substitution: kv
8741 total revisions: 3; selected revisions: 3
8743 ----------------------------
8745 date: 2034/12/2[4-6] [0-9][0-9]:01:[0-9][0-9]; author: ${username}; state: Exp;
8748 ----------------------------
8750 date: 2034/12/2[4-6] [0-9][0-9]:01:[0-9][0-9]; author: ${username}; state: Exp; lines: ${PLUS}0 -0
8751 branches: 1\.1\.1\.1\.2;
8753 ----------------------------
8754 revision 1\.1\.1\.1\.2\.1
8755 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
8757 ============================================================================="
8759 dotest importc-9 "${testcvs} -q log bdir/subdir/file1" "
8760 RCS file: ${CVSROOT_DIRNAME}/first-dir/bdir/subdir/file1,v
8761 Working file: bdir/subdir/file1
8767 wip_test: 1\.1\.1\.1\.0\.2
8770 keyword substitution: kv
8771 total revisions: 2; selected revisions: 2
8773 ----------------------------
8775 date: 1971/07/0[3-5] [0-9][0-9]:43:[0-9][0-9]; author: ${username}; state: Exp;
8778 ----------------------------
8780 date: 1971/07/0[3-5] [0-9][0-9]:43:[0-9][0-9]; author: ${username}; state: Exp; lines: ${PLUS}0 -0
8782 ============================================================================="
8785 # Now tests of absolute pathnames and .. as repository directory.
8787 dotest_fail importc-10 \
8788 "${testcvs} import -m imp ../other vendor release2" \
8789 "${PROG} \[[a-z]* aborted\]: directory \.\./other not relative within the repository"
8790 dotest_fail importc-11 \
8791 "${testcvs} import -m imp ${TESTDIR}/other vendor release3" \
8792 "${PROG} \[[a-z]* aborted\]: directory ${TESTDIR}/other not relative within the repository"
8793 dotest_fail importc-12 "test -d ${TESTDIR}/other" ""
8797 rm -rf ${CVSROOT_DIRNAME}/first-dir
8803 touch file1 file2 file3
8804 dotest_fail import-CVS-1 "$testcvs import -mimport CVS vtag rtag" \
8805 "$PROG import: The word \`CVS' is reserved by CVS and may not be used
8806 $PROG \[import aborted\]: as a directory in a path or as a file name\."
8807 dotest_fail import-CVS-1b \
8808 "$testcvs import -mimport CVS-/CVS vtag rtag" \
8809 "$PROG import: The word \`CVS' is reserved by CVS and may not be used
8810 $PROG \[import aborted\]: as a directory in a path or as a file name\."
8813 touch CVS sdir/CVS/file4 sdir/CVS/file5 sdir/file6 sdir/file7
8814 # Calling the imported directory import-CVS is dual purpose in the
8815 # following test. It makes sure the path test which matched above
8816 # wasn't too strict.
8817 dotest_sort import-CVS-2 \
8818 "$testcvs import -I! -mimport import-CVS vtag rtag" \
8822 I import-CVS/sdir/CVS
8826 N import-CVS/sdir/file6
8827 N import-CVS/sdir/file7
8828 No conflicts created by this import
8829 $PROG import: Importing $CVSROOT_DIRNAME/import-CVS/sdir"
8832 echo Keeping ${TESTDIR} and exiting due to --keep
8838 rm -rf $CVSROOT_DIRNAME/import-CVS
8844 # Short tests of quirky import behavior.
8846 # For a list of other import tests with short descriptions, see the
8847 # comment header of the "import" test.
8850 touch file1 file2 file3
8852 # CVS prior to 1.11.18 and 1.12.10 used to happily import to
8853 # "branch 1.1", creating RCS archives with revisions like,
8854 # "1.1..1". That double-dot is *not* a typo.
8855 dotest_fail import-quirks-1 \
8856 "$testcvs import -b1.1. -mbad-bad-bad import-quirks VB RT" \
8857 "$PROG \[import aborted\]: Only numeric branch specifications with two dots are
8858 supported by import, not \`1\.1\.'\. For example: \`1\.1\.1'\."
8860 dotest_fail import-quirks-2 \
8861 "$testcvs import -b1.1.1.. -mbad-bad-bad import-quirks VB RT" \
8862 "$PROG \[import aborted\]: Only numeric branch specifications with two dots are
8863 supported by import, not \`1\.1\.1\.\.'\. For example: \`1\.1\.1'\."
8865 # Try a few odd numbers. This is hardly comprehensive.
8866 dotest_sort import-quirks-2 \
8867 "$testcvs import -b10.10.101 -mthis-ones-ok import-quirks-2 VB RT" \
8870 N import-quirks-2/file1
8871 N import-quirks-2/file2
8872 N import-quirks-2/file3
8873 No conflicts created by this import"
8875 dotest_sort import-quirks-3 \
8876 "$testcvs import -b2345678901.2345678901.2345678901 -mthis-ones-ok import-quirks-3 VB RT" \
8879 N import-quirks-3/file1
8880 N import-quirks-3/file2
8881 N import-quirks-3/file3
8882 No conflicts created by this import"
8884 dotest_sort import-quirks-4 \
8885 "$testcvs import -b1.1.2 -mthis-ones-ok import-quirks-4 VB RT" \
8888 N import-quirks-4/file1
8889 N import-quirks-4/file2
8890 N import-quirks-4/file3
8891 No conflicts created by this import"
8894 echo Keeping $TESTDIR and exiting due to --keep
8900 rm -rf $CVSROOT_DIRNAME/import-quirks-2 \
8901 $CVSROOT_DIRNAME/import-quirks-3 \
8902 $CVSROOT_DIRNAME/import-quirks-4
8907 import-after-initial)
8908 # Properly handle the case in which the first version of a
8909 # file is created by a regular cvs add and commit, and there
8910 # is a subsequent cvs import of the same file. cvs update with
8911 # a date tag must resort to searching the vendor branch only if
8912 # the initial version of the file was created at the same time
8913 # as the initial version on the vendor branch.
8920 # Create the module.
8921 dotest import-after-initial-1 \
8922 "$testcvs -Q import -m. $module X Y" ''
8925 # Check it out and add a file.
8926 dotest import-after-initial-2 "$testcvs -Q co $module" ''
8928 echo original > $file
8929 dotest import-after-initial-3 "${testcvs} -Q add $file" ""
8930 dotest import-after-initial-4 "${testcvs} -Q ci -m. $file" \
8931 "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
8934 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
8935 initial revision: 1\.1
8938 # Delay a little so the following import isn't done in the same
8939 # second as the preceding commit.
8942 # Do the first import of $file *after* $file already has an
8946 echo newer-via-import > $file
8947 dotest import-after-initial-5 \
8948 "$testcvs -Q import -m. $module X Y2" ''
8951 # Sleep a second so we're sure to be after the second of the import.
8954 dotest import-after-initial-6 \
8955 "$testcvs -Q update -p -D now $file" 'original'
8959 rm -rf ${CVSROOT_DIRNAME}/$module
8962 branch-after-import)
8963 # Test branching after an import via both cvs tag -b and
8964 # cvs add to verify that the HEAD remains at 1.1.1.1
8965 # This was a FreeBSD bug documented at the URL:
8966 # http://www.freebsd.org/cgi/query-pr.cgi?pr=4033
8968 mkdir branch-after-import
8969 cd branch-after-import
8971 # OK, first we get some sources from the NetMunger project,
8972 # and import them into the 1.1.1 vendor branch.
8975 echo 'OpenMunger sources' >file1
8976 echo 'OpenMunger sources' >file2
8977 dotest_sort branch-after-import-1 \
8978 "${testcvs} import -m add first-dir openmunger openmunger-1_0" \
8983 No conflicts created by this import'
8986 # Next checkout the new module
8987 dotest branch-after-import-2 \
8988 "${testcvs} -q co first-dir" \
8992 # Branch tag the file1 and cvs add file2,
8993 # the branch should remain the same in both cases
8994 # such that a new import will not require a conflict
8996 dotest branch-after-import-3 \
8997 "${testcvs} tag -b TESTTOTRON file1" \
8999 dotest branch-after-import-4 \
9000 "$testcvs -q update -r TESTTOTRON" \
9002 $PROG update: file2 is no longer in the repository"
9004 cp ../imp-dir/file2 .
9005 dotest branch-after-import-5 \
9006 "${testcvs} add file2" \
9007 "${PROG} add: scheduling file .file2. for addition on branch .TESTTOTRON.
9008 ${PROG} add: use .${PROG} commit. to add this file permanently"
9010 dotest branch-after-import-6 \
9011 "${testcvs} commit -m cvs-add file2" \
9013 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
9014 new revision: 1\.1\.1\.1\.2\.2; previous revision: 1\.1\.1\.1\.2\.1
9018 echo Keeping ${TESTDIR} and exiting due to --keep
9023 rm -r branch-after-import
9024 rm -rf ${CVSROOT_DIRNAME}/first-dir
9028 # Test doing joins which involve adding and removing files.
9029 # Variety of scenarios (see list below), in the context of:
9030 # * merge changes from T1 to T2 into the main line
9031 # * merge changes from branch 'branch' into the main line
9032 # * merge changes from branch 'branch' into branch 'br2'.
9033 # See also binfile2, which does similar things with binary files.
9034 # See also join2, which tests joining (and update -A) on only
9035 # a single file, rather than a directory.
9036 # See also rmadd2, which tests -j cases not involving branches
9037 # (e.g. undoing a commit)
9038 # See also join3, which tests some cases involving the greatest
9039 # common ancestor. Here is a list of tests according to branch
9042 # --->bp---->trunk too many to mention
9046 # --->bp---->trunk multibranch, multibranch2
9049 # --->bp1----->bp2---->trunk join3
9052 # --->bp1----->trunk
9053 # \----bp2---->branch branches
9054 # \------>branch-of-branch
9056 # We check merging changes from T1 to T2 into the main line.
9057 # Here are the interesting cases I can think of:
9058 # 1) File added between T1 and T2, not on main line.
9059 # File should be marked for addition.
9060 # 2) File added between T1 and T2, also added on main line.
9062 # 3) File removed between T1 and T2, unchanged on main line.
9063 # File should be marked for removal.
9064 # 4) File removed between T1 and T2, modified on main line.
9065 # If mod checked in, file should be marked for removal.
9066 # If mod still in working directory, conflict.
9067 # 5) File removed between T1 and T2, was never on main line.
9068 # Nothing should happen.
9069 # 6) File removed between T1 and T2, also removed on main line.
9070 # Nothing should happen.
9071 # 7) File not added between T1 and T2, added on main line.
9072 # Nothing should happen.
9073 # 8) File not modified between T1 and T2, removed on main line.
9074 # Nothing should happen.
9075 # 9) File modified between T1 and T2, removed on main line.
9077 # 10) File was never on branch, removed on main line.
9078 # Nothing should happen.
9080 # We also check merging changes from a branch into the main
9081 # line. Here are the interesting cases:
9082 # 1) File added on branch, not on main line.
9083 # File should be marked for addition.
9084 # 2) File added on branch, also added on main line.
9086 # 3) File removed on branch, unchanged on main line.
9087 # File should be marked for removal.
9088 # 4) File removed on branch, modified on main line.
9090 # 5) File removed on branch, was never on main line.
9091 # Nothing should happen.
9092 # 6) File removed on branch, also removed on main line.
9093 # Nothing should happen.
9094 # 7) File added on main line, not added on branch.
9095 # Nothing should happen.
9096 # 8) File removed on main line, not modified on branch.
9097 # Nothing should happen.
9098 # 9) File modified on branch, removed on main line.
9100 # 10) File was never on branch, removed on main line.
9101 # Nothing should happen.
9103 # In the tests below, fileN represents case N in the above
9106 mkdir ${CVSROOT_DIRNAME}/first-dir
9109 dotest join-1 "${testcvs} -q co first-dir" ''
9114 echo 'first revision of file3' > file3
9115 echo 'first revision of file4' > file4
9116 echo 'first revision of file6' > file6
9117 echo 'first revision of file8' > file8
9118 echo 'first revision of file9' > file9
9119 dotest join-2 "${testcvs} add file3 file4 file6 file8 file9" \
9120 "${PROG}"' add: scheduling file `file3'\'' for addition
9121 '"${PROG}"' add: scheduling file `file4'\'' for addition
9122 '"${PROG}"' add: scheduling file `file6'\'' for addition
9123 '"${PROG}"' add: scheduling file `file8'\'' for addition
9124 '"${PROG}"' add: scheduling file `file9'\'' for addition
9125 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
9127 dotest join-3 "${testcvs} -q commit -m add" \
9128 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
9131 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
9132 initial revision: 1\.1
9134 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
9137 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
9138 initial revision: 1\.1
9140 RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
9143 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
9144 initial revision: 1\.1
9146 RCS file: ${CVSROOT_DIRNAME}/first-dir/file8,v
9149 ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
9150 initial revision: 1\.1
9152 RCS file: ${CVSROOT_DIRNAME}/first-dir/file9,v
9155 ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
9156 initial revision: 1\.1
9160 dotest join-4 "${testcvs} -q tag -b branch ." \
9167 # Add file2, file7, and file10, modify file4, and remove
9168 # file6, file8, and file9.
9169 echo 'first revision of file2' > file2
9170 echo 'second revision of file4' > file4
9171 echo 'first revision of file7' > file7
9172 rm file6 file8 file9
9173 echo 'first revision of file10' > file10
9174 dotest join-5 "${testcvs} add file2 file7 file10" \
9175 "${PROG}"' add: scheduling file `file2'\'' for addition
9176 '"${PROG}"' add: scheduling file `file7'\'' for addition
9177 '"${PROG}"' add: scheduling file `file10'\'' for addition
9178 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
9179 dotest join-6 "${testcvs} rm file6 file8 file9" \
9180 "${PROG}"' remove: scheduling `file6'\'' for removal
9181 '"${PROG}"' remove: scheduling `file8'\'' for removal
9182 '"${PROG}"' remove: scheduling `file9'\'' for removal
9183 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
9184 dotest join-7 "${testcvs} -q ci -mx ." \
9185 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
9188 ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
9189 initial revision: 1\.1
9191 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
9194 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
9195 initial revision: 1\.1
9198 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
9199 new revision: 1\.2; previous revision: 1\.1
9202 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
9203 new revision: delete; previous revision: 1\.1
9205 RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
9208 ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
9209 initial revision: 1\.1
9212 ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
9213 new revision: delete; previous revision: 1\.1
9216 ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
9217 new revision: delete; previous revision: 1\.1
9221 dotest join-7a "${testcvs} rm -f file10" \
9222 "${PROG}"' remove: scheduling `file10'\'' for removal
9223 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
9224 dotest join-7b "${testcvs} -q ci -mx ." \
9226 ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
9227 new revision: delete; previous revision: 1\.1
9230 # Check out the branch.
9234 dotest join-8 "${testcvs} -q co -r branch first-dir" \
9243 # Modify the files on the branch, so that T1 is not an
9244 # ancestor of the main line, and add file5
9245 echo 'first branch revision of file3' > file3
9246 echo 'first branch revision of file4' > file4
9247 echo 'first branch revision of file5' > file5
9248 echo 'first branch revision of file6' > file6
9249 echo 'first branch revision of file9' > file9
9250 dotest join-9 "${testcvs} add file5" \
9251 "${PROG}"' add: scheduling file `file5'\'' for addition on branch `branch'\''
9252 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
9253 dotest join-10 "${testcvs} -q ci -mx ." \
9255 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
9256 new revision: 1\.1\.2\.1; previous revision: 1\.1
9259 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
9260 new revision: 1\.1\.2\.1; previous revision: 1\.1
9262 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v
9265 ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
9266 new revision: 1\.1\.2\.1; previous revision: 1\.1
9269 ${CVSROOT_DIRNAME}/first-dir/Attic/file6,v <-- file6
9270 new revision: 1\.1\.2\.1; previous revision: 1\.1
9273 ${CVSROOT_DIRNAME}/first-dir/Attic/file9,v <-- file9
9274 new revision: 1\.1\.2\.1; previous revision: 1\.1
9277 # Tag the current revisions on the branch.
9278 dotest join-11 "${testcvs} -q tag T1 ." \
9286 # Add file1 and file2, modify file9, and remove the other files.
9287 echo 'first branch revision of file1' > file1
9288 echo 'first branch revision of file2' > file2
9289 echo 'second branch revision of file9' > file9
9290 rm file3 file4 file5 file6
9291 dotest join-12 "${testcvs} add file1 file2" \
9292 "${PROG}"' add: scheduling file `file1'\'' for addition on branch `branch'\''
9293 '"${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
9294 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
9295 dotest join-13 "${testcvs} rm file3 file4 file5 file6" \
9296 "${PROG}"' remove: scheduling `file3'\'' for removal
9297 '"${PROG}"' remove: scheduling `file4'\'' for removal
9298 '"${PROG}"' remove: scheduling `file5'\'' for removal
9299 '"${PROG}"' remove: scheduling `file6'\'' for removal
9300 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
9301 dotest join-14 "${testcvs} -q ci -mx ." \
9302 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
9305 ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v <-- file1
9306 new revision: 1\.1\.2\.1; previous revision: 1\.1
9309 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
9310 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
9313 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
9314 new revision: delete; previous revision: 1\.1\.2\.1
9317 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
9318 new revision: delete; previous revision: 1\.1\.2\.1
9321 ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
9322 new revision: delete; previous revision: 1\.1\.2\.1
9325 ${CVSROOT_DIRNAME}/first-dir/Attic/file6,v <-- file6
9326 new revision: delete; previous revision: 1\.1\.2\.1
9329 ${CVSROOT_DIRNAME}/first-dir/Attic/file9,v <-- file9
9330 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
9333 # Tag the current revisions on the branch.
9334 dotest join-15 "${testcvs} -q tag T2 ." \
9340 # Do a checkout with a merge.
9344 dotest join-16 "$testcvs -q co -jT1 -jT2 first-dir" \
9347 $PROG checkout: file first-dir/file2 exists, but has been added in revision T2
9349 $PROG checkout: scheduling first-dir/file3 for removal
9351 $PROG checkout: file first-dir/file4 has been removed in revision T2, but the destination is incompatibly modified
9354 $PROG checkout: file first-dir/file9 does not exist, but is present in revision T2"
9356 # Verify that the right changes have been scheduled.
9358 dotest_fail join-17 "$testcvs -q update" \
9363 # Modify file4 locally, and do an update with a merge.
9364 cd ../../1/first-dir
9365 echo 'third revision of file4' > file4
9366 dotest join-18 "$testcvs -q update -jT1 -jT2 ." \
9368 $PROG update: file file2 exists, but has been added in revision T2
9369 $PROG update: scheduling file3 for removal
9371 $PROG update: file file4 has been removed in revision T2, but the destination is incompatibly modified
9373 $PROG update: file file9 does not exist, but is present in revision T2"
9375 # Verify that the right changes have been scheduled.
9376 dotest_fail join-19 "$testcvs -q update" \
9381 # Do a checkout with a merge from a single revision.
9383 # FIXME: CVS currently gets this wrong. file2 has been
9384 # added on both the branch and the main line, and so should
9385 # be regarded as a conflict. However, given the way that
9386 # CVS sets up the RCS file, there is no way to distinguish
9387 # this case from the case of file2 having existed before the
9388 # branch was made. This could be fixed by reserving
9389 # a revision somewhere, perhaps 1.1, as an always dead
9390 # revision which can be used as the source for files added
9394 dotest join-20 "$testcvs -q co -jbranch first-dir" \
9397 RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
9398 retrieving revision 1\.1
9399 retrieving revision 1\.1\.2\.2
9400 Merging differences between 1\.1 and 1\.1\.2\.2 into file2
9402 $PROG checkout: scheduling first-dir/file3 for removal
9404 $PROG checkout: file first-dir/file4 has been removed in revision branch, but the destination is incompatibly modified
9407 $PROG checkout: file first-dir/file9 does not exist, but is present in revision branch"
9409 # Verify that the right changes have been scheduled.
9410 # The M file2 line is a bug; see above join-20.
9412 dotest_fail join-21 "$testcvs -q update" \
9418 # Checkout the main line again.
9421 dotest join-22 "${testcvs} -q co first-dir" \
9427 # Modify file4 locally, and do an update with a merge from a
9429 # The file2 handling is a bug; see above join-20.
9431 echo 'third revision of file4' > file4
9432 dotest join-23 "$testcvs -q update -jbranch ." \
9434 RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
9435 retrieving revision 1\.1
9436 retrieving revision 1\.1\.2\.2
9437 Merging differences between 1\.1 and 1\.1\.2\.2 into file2
9438 $PROG update: scheduling file3 for removal
9440 $PROG update: file file4 has been removed in revision branch, but the destination is incompatibly modified
9442 $PROG update: file file9 does not exist, but is present in revision branch"
9444 # Verify that the right changes have been scheduled.
9445 # The M file2 line is a bug; see above join-20
9446 dotest_fail join-24 "$testcvs -q update" \
9454 # Checkout the main line again and make a new branch which we
9457 dotest join-25 "${testcvs} -q co first-dir" \
9463 dotest join-26 "${testcvs} -q tag -b br2" \
9468 dotest join-27 "$testcvs -q update -r br2" \
9473 # The handling of file8 and file9 here look fishy to me. I don't
9474 # see why it should be different from the case where we merge to
9475 # the trunk (e.g. join-23).
9476 dotest join-28 "$testcvs -q update -j branch" \
9478 RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
9479 retrieving revision 1\.1
9480 retrieving revision 1\.1\.2\.2
9481 Merging differences between 1\.1 and 1\.1\.2\.2 into file2
9482 $PROG update: scheduling file3 for removal
9483 $PROG update: file file4 has been removed in revision branch, but the destination is incompatibly modified
9487 # Verify that the right changes have been scheduled.
9488 dotest_fail join-29 "$testcvs -q update" \
9496 # Checkout the mainline again to try updating and merging between two
9497 # branches in the same step
9498 # this seems a likely scenario - the user finishes up on branch and
9499 # updates to br2 and merges in the same step - and there was a bug
9500 # once that if the file was removed in the update then it wouldn't be
9501 # readded in the merge
9504 dotest join-twobranch-1 "${testcvs} -q co -rbranch first-dir" \
9510 dotest join-twobranch-2 "$testcvs -q update -rbr2 -jbranch" \
9511 "$PROG update: file1 is no longer in the repository
9514 RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
9515 retrieving revision 1\.1
9516 retrieving revision 1\.1\.2\.2
9517 Merging differences between 1\.1 and 1\.1\.2\.2 into file2
9519 $PROG update: scheduling file3 for removal
9521 $PROG update: file file4 has been removed in revision branch, but the destination is incompatibly modified
9524 $PROG update: file8 is no longer in the repository
9526 $PROG update: file9 is no longer in the repository
9528 # Verify that the right changes have been scheduled.
9529 dotest_fail join-twobranch-3 "$testcvs -q update" \
9537 # Checkout the mainline again to try merging from the trunk
9541 dotest join-30 "${testcvs} -q co first-dir" \
9548 # Tag the current revisions on the trunk.
9549 dotest join-31 "${testcvs} -q tag T3 ." \
9556 echo 'second revision of file7' > file7
9557 dotest join-32 "${testcvs} -q ci -mx ." \
9559 ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
9560 new revision: 1\.2; previous revision: 1\.1
9564 dotest join-33 "${testcvs} -q tag T4 ." \
9570 # Now update branch to T3.
9571 cd ../../2/first-dir
9572 dotest join-34 "${testcvs} -q up -jT3" \
9573 "${PROG} update: file file4 does not exist, but is present in revision T3
9576 # Verify that the right changes have been scheduled.
9577 dotest join-35 "${testcvs} -q update" \
9581 # This is probably a bug, although in this particular case it just
9582 # happens to do the right thing; see above join-20.
9583 dotest join-36 "${testcvs} -q up -j T3 -j T4" \
9585 RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
9586 retrieving revision 1\.1
9587 retrieving revision 1\.2
9588 Merging differences between 1\.1 and 1\.2 into file7"
9590 # Verify that the right changes have been scheduled.
9591 dotest join-37 "${testcvs} -q update" \
9597 rm -rf ${CVSROOT_DIRNAME}/first-dir
9601 # More joining tests.
9603 # First the usual setup; create a directory first-dir, a file
9604 # first-dir/file1, and a branch br1.
9606 dotest join2-1 "${testcvs} -q co -l ." ''
9608 dotest join2-2 "${testcvs} add first-dir" \
9609 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
9611 echo 'initial contents of file1' >file1
9612 dotest join2-3 "${testcvs} add file1" \
9613 "${PROG} add: scheduling file .file1. for addition
9614 ${PROG} add: use .${PROG} commit. to add this file permanently"
9615 dotest join2-4 "${testcvs} -q ci -m add" \
9616 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
9619 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
9620 initial revision: 1\.1
9622 dotest join2-5 "${testcvs} -q tag -b br1" "T file1"
9623 dotest join2-6 "$testcvs -q update -r br1" '[UP] file1'
9624 echo 'modify on branch' >>file1
9626 dotest join2-6a "${testcvs} add bradd" \
9627 "${PROG} add: scheduling file .bradd. for addition on branch .br1.
9628 ${PROG} add: use .${PROG} commit. to add this file permanently"
9629 dotest join2-7 "${testcvs} -q ci -m modify" \
9630 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
9633 ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v <-- bradd
9634 new revision: 1\.1\.2\.1; previous revision: 1\.1
9637 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
9638 new revision: 1\.1\.2\.1; previous revision: 1\.1
9641 # Here is the unusual/pathological part. We switch back to
9642 # the trunk *for file1 only*, not for the whole directory.
9643 dotest join2-8 "${testcvs} -q update -A file1" '[UP] file1'
9644 dotest join2-9 "${testcvs} -q status file1" \
9645 "===================================================================
9646 File: file1 Status: Up-to-date
9648 Working revision: 1\.1.*
9649 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
9652 Sticky Options: (none)"
9653 dotest join2-10 "cat CVS/Tag" "Tbr1"
9655 dotest join2-11 "${testcvs} -q update -j br1 file1" \
9656 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
9657 retrieving revision 1\.1
9658 retrieving revision 1\.1\.2\.1
9659 Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
9660 dotest join2-12 "cat file1" "initial contents of file1
9662 # We should have no sticky tag on file1
9663 dotest join2-13 "${testcvs} -q status file1" \
9664 "===================================================================
9665 File: file1 Status: Locally Modified
9667 Working revision: 1\.1.*
9668 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
9671 Sticky Options: (none)"
9672 dotest join2-14 "cat CVS/Tag" "Tbr1"
9673 # And the checkin should go to the trunk
9674 dotest join2-15 "${testcvs} -q ci -m modify file1" \
9676 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
9677 new revision: 1\.2; previous revision: 1\.1
9680 # OK, the above is all well and good and has worked for some
9681 # time. Now try the case where the file had been added on
9683 dotest join2-16 "${testcvs} -q update -r br1" "[UP] file1"
9684 # The workaround is to update the whole directory.
9685 # The non-circumvented version won't work. The reason is that
9686 # update removes the entry from CVS/Entries, so of course we get
9687 # the tag from CVS/Tag and not Entries. I suppose maybe
9688 # we could invent some new format in Entries which would handle
9689 # this, but doing so, and handling it properly throughout
9690 # CVS, would be a lot of work and I'm not sure this case justifies
9692 dotest join2-17-circumvent "${testcvs} -q update -A" \
9693 "${PROG} update: bradd is no longer in the repository
9695 : dotest join2-17 "${testcvs} -q update -A bradd" \
9696 "${PROG} update: warning: bradd is not (any longer) pertinent"
9697 dotest join2-18 "${testcvs} -q update -j br1 bradd" "U bradd"
9698 dotest join2-19 "${testcvs} -q status bradd" \
9699 "===================================================================
9700 File: bradd Status: Locally Added
9702 Working revision: New file!
9703 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
9706 Sticky Options: (none)"
9707 dotest join2-20 "${testcvs} -q ci -m modify bradd" \
9709 ${CVSROOT_DIRNAME}/first-dir/bradd,v <-- bradd
9710 new revision: 1\.2; previous revision: 1\.1
9715 rm -rf ${CVSROOT_DIRNAME}/first-dir
9719 # See "join" for a list of other joining/branching tests.
9720 # First the usual setup; create a directory first-dir, a file
9721 # first-dir/file1, and a branch br1.
9723 dotest join3-1 "${testcvs} -q co -l ." ''
9725 dotest join3-2 "${testcvs} add first-dir" \
9726 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
9728 echo 'initial contents of file1' >file1
9729 dotest join3-3 "${testcvs} add file1" \
9730 "${PROG} add: scheduling file .file1. for addition
9731 ${PROG} add: use .${PROG} commit. to add this file permanently"
9732 dotest join3-4 "${testcvs} -q ci -m add" \
9733 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
9736 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
9737 initial revision: 1\.1
9739 dotest join3-5 "${testcvs} -q tag -b br1" "T file1"
9740 dotest join3-6 "$testcvs -q update -r br1" '[UP] file1'
9741 echo 'br1:line1' >>file1
9742 dotest join3-7 "${testcvs} -q ci -m modify" \
9744 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
9745 new revision: 1\.1\.2\.1; previous revision: 1\.1
9748 # Now back to the trunk for:
9749 # another revision and another branch for file1.
9750 # add file2, which will exist on trunk and br2 but not br1.
9751 dotest join3-8 "${testcvs} -q update -A" "[UP] file1"
9752 echo 'trunk:line1' > file2
9753 dotest join3-8a "${testcvs} add file2" \
9754 "${PROG} add: scheduling file .file2. for addition
9755 ${PROG} add: use .${PROG} commit. to add this file permanently"
9756 echo 'trunk:line1' >>file1
9757 dotest join3-9 "${testcvs} -q ci -m modify" \
9759 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
9760 new revision: 1\.2; previous revision: 1\.1
9762 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
9765 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
9766 initial revision: 1\.1
9768 dotest join3-10 "${testcvs} -q tag -b br2" "T file1
9771 # Before we actually have any revision on br2, let's try a join
9772 dotest join3-11 "${testcvs} -q update -r br1" "[UP] file1
9773 ${PROG} update: file2 is no longer in the repository"
9774 dotest join3-12 "${testcvs} -q update -j br2" \
9775 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
9776 retrieving revision 1\.1
9777 retrieving revision 1\.2
9778 Merging differences between 1\.1 and 1\.2 into file1
9779 rcsmerge: warning: conflicts during merge
9781 dotest join3-13 "cat file1" \
9782 "initial contents of file1
9790 # OK, we'll try the same thing with a revision on br2.
9791 dotest join3-14 "${testcvs} -q update -r br2 file1" \
9792 "${PROG} update: warning: file1 was lost
9794 echo 'br2:line1' >>file1
9795 dotest join3-15 "${testcvs} -q ci -m modify file1" \
9797 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
9798 new revision: 1\.2\.2\.1; previous revision: 1\.2
9801 # OK, now we can join br2 to br1
9802 dotest join3-16 "${testcvs} -q update -r br1 file1" "[UP] file1"
9803 # It may seem odd, to merge a higher branch into a lower
9804 # branch, but in fact CVS defines the ancestor as 1.1
9805 # and so it merges both the 1.1->1.2 and 1.2->1.2.2.1 changes.
9806 # This seems like a reasonably plausible behavior.
9807 dotest join3-17 "${testcvs} -q update -j br2 file1" \
9808 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
9809 retrieving revision 1\.1
9810 retrieving revision 1\.2\.2\.1
9811 Merging differences between 1\.1 and 1\.2\.2\.1 into file1
9812 rcsmerge: warning: conflicts during merge"
9813 dotest join3-18 "cat file1" \
9814 "initial contents of file1
9820 [>]>>>>>> 1\.2\.2\.1"
9824 rm -rf ${CVSROOT_DIRNAME}/first-dir
9828 # Like join, but with local (uncommitted) modifications.
9830 mkdir ${CVSROOT_DIRNAME}/first-dir
9833 dotest join4-1 "${testcvs} -q co first-dir" ''
9838 echo 'first revision of file3' > file3
9839 echo 'first revision of file4' > file4
9840 echo 'first revision of file6' > file6
9841 echo 'first revision of file8' > file8
9842 echo 'first revision of file9' > file9
9843 dotest join4-2 "${testcvs} add file3 file4 file6 file8 file9" \
9844 "${PROG}"' add: scheduling file `file3'\'' for addition
9845 '"${PROG}"' add: scheduling file `file4'\'' for addition
9846 '"${PROG}"' add: scheduling file `file6'\'' for addition
9847 '"${PROG}"' add: scheduling file `file8'\'' for addition
9848 '"${PROG}"' add: scheduling file `file9'\'' for addition
9849 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
9851 dotest join4-3 "${testcvs} -q commit -m add" \
9852 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
9855 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
9856 initial revision: 1\.1
9858 RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
9861 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
9862 initial revision: 1\.1
9864 RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
9867 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
9868 initial revision: 1\.1
9870 RCS file: ${CVSROOT_DIRNAME}/first-dir/file8,v
9873 ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
9874 initial revision: 1\.1
9876 RCS file: ${CVSROOT_DIRNAME}/first-dir/file9,v
9879 ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
9880 initial revision: 1\.1
9884 dotest join4-4 "${testcvs} -q tag -b branch ." \
9892 echo 'first revision of file10' > file10
9893 dotest join4-7a "${testcvs} add file10" \
9894 "${PROG}"' add: scheduling file `file10'\'' for addition
9895 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
9896 dotest join4-7b "${testcvs} -q ci -mx ." \
9897 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
9900 ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
9901 initial revision: 1\.1
9904 # Add file2 and file7, modify file4, and remove
9905 # file6, file8, file9, and file10.
9906 echo 'first revision of file2' > file2
9907 echo 'second revision of file4' > file4
9908 echo 'first revision of file7' > file7
9909 rm file6 file8 file9 file10
9910 dotest join4-5 "${testcvs} add file2 file7" \
9911 "${PROG}"' add: scheduling file `file2'\'' for addition
9912 '"${PROG}"' add: scheduling file `file7'\'' for addition
9913 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
9914 dotest join4-6 "${testcvs} rm file6 file8 file9 file10" \
9915 "${PROG}"' remove: scheduling `file6'\'' for removal
9916 '"${PROG}"' remove: scheduling `file8'\'' for removal
9917 '"${PROG}"' remove: scheduling `file9'\'' for removal
9918 '"${PROG}"' remove: scheduling `file10'\'' for removal
9919 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
9921 # Check out the branch.
9925 dotest join4-8 "${testcvs} -q co -r branch first-dir" \
9934 # Modify the files on the branch, so that T1 is not an
9935 # ancestor of the main line, and add file5
9936 echo 'first branch revision of file3' > file3
9937 echo 'first branch revision of file4' > file4
9938 echo 'first branch revision of file5' > file5
9939 echo 'first branch revision of file6' > file6
9940 echo 'first branch revision of file9' > file9
9941 dotest join4-9 "${testcvs} add file5" \
9942 "${PROG}"' add: scheduling file `file5'\'' for addition on branch `branch'\''
9943 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
9944 dotest join4-10 "${testcvs} -q ci -mx ." \
9946 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
9947 new revision: 1\.1\.2\.1; previous revision: 1\.1
9950 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
9951 new revision: 1\.1\.2\.1; previous revision: 1\.1
9953 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v
9956 ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
9957 new revision: 1\.1\.2\.1; previous revision: 1\.1
9960 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
9961 new revision: 1\.1\.2\.1; previous revision: 1\.1
9964 ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
9965 new revision: 1\.1\.2\.1; previous revision: 1\.1
9968 # Tag the current revisions on the branch.
9969 dotest join4-11 "${testcvs} -q tag T1 ." \
9977 # Add file1 and file2, modify file9, and remove the other files.
9978 echo 'first branch revision of file1' > file1
9979 echo 'first branch revision of file2' > file2
9980 echo 'second branch revision of file9' > file9
9981 rm file3 file4 file5 file6
9982 dotest join4-12 "${testcvs} add file1 file2" \
9983 "${PROG}"' add: scheduling file `file1'\'' for addition on branch `branch'\''
9984 '"${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
9985 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
9986 dotest join4-13 "${testcvs} rm file3 file4 file5 file6" \
9987 "${PROG}"' remove: scheduling `file3'\'' for removal
9988 '"${PROG}"' remove: scheduling `file4'\'' for removal
9989 '"${PROG}"' remove: scheduling `file5'\'' for removal
9990 '"${PROG}"' remove: scheduling `file6'\'' for removal
9991 '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
9992 dotest join4-14 "${testcvs} -q ci -mx ." \
9993 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
9996 ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v <-- file1
9997 new revision: 1\.1\.2\.1; previous revision: 1\.1
9999 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v
10002 ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v <-- file2
10003 new revision: 1\.1\.2\.1; previous revision: 1\.1
10006 ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
10007 new revision: delete; previous revision: 1\.1\.2\.1
10010 ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
10011 new revision: delete; previous revision: 1\.1\.2\.1
10014 ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
10015 new revision: delete; previous revision: 1\.1\.2\.1
10018 ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
10019 new revision: delete; previous revision: 1\.1\.2\.1
10022 ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
10023 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
10026 # Tag the current revisions on the branch.
10027 dotest join4-15 "${testcvs} -q tag T2 ." \
10033 # Modify file4 locally, and do an update with a merge.
10034 cd ../../1/first-dir
10035 echo 'third revision of file4' > file4
10036 dotest join4-18 "$testcvs -q update -jT1 -jT2 ." \
10040 $PROG update: file file2 exists, but has been added in revision T2
10041 $PROG update: scheduling file3 for removal
10043 $PROG update: file file4 has been removed in revision T2, but the destination is incompatibly modified
10049 $PROG update: file file9 does not exist, but is present in revision T2"
10051 # Verify that the right changes have been scheduled.
10052 dotest_fail join4-19 "${testcvs} -q update" \
10066 rm -rf ${CVSROOT_DIRNAME}/first-dir
10070 # This test verifies that CVS can handle filenames starting with a
10071 # dash (`-') properly. What used to happen was that CVS handled it
10072 # just fine, until it went to pass them as arguments to the diff
10073 # library, at which point it neglected to pass `--' before the file
10074 # list, causing the diff library to attempt to interpret the file
10075 # name as an argument.
10076 mkdir join5; cd join5
10078 dotest join5-init-1 "${testcvs} -Q co -l ."
10080 dotest join5-init-2 "${testcvs} -Q add join5"
10082 echo "there once was a file from harrisburg" >-file
10083 echo "who's existance it seems was quiteabsurd" >>-file
10084 dotest join5-init-3 "${testcvs} -Q add -- -file"
10085 dotest join5-init-4 "${testcvs} -q ci -minitial" \
10086 "RCS file: ${CVSROOT_DIRNAME}/join5/-file,v
10089 ${CVSROOT_DIRNAME}/join5/-file,v <-- -file
10090 initial revision: 1\.1
10095 dotest join5-init-5 "${testcvs} -Q co join5"
10097 echo "it tested for free" >>-file
10098 echo "when paid it should be" >>-file
10099 dotest join5-init-4 "${testcvs} -q ci -msecond" \
10100 "Checking in -file;
10101 ${CVSROOT_DIRNAME}/join5/-file,v <-- -file
10102 new revision: 1\.2; previous revision: 1\.1
10107 echo "but maybe it could charge bytheword" >>-file
10108 # This is the test that used to spew complaints from diff3:
10109 dotest join5 "${testcvs} up" \
10110 "${PROG} update: Updating \.
10111 RCS file: ${CVSROOT_DIRNAME}/join5/-file,v
10112 retrieving revision 1\.1
10113 retrieving revision 1\.2
10114 Merging differences between 1\.1 and 1\.2 into -file
10115 rcsmerge: warning: conflicts during merge
10116 ${PROG} update: conflicts found in -file
10121 echo Keeping ${TESTDIR} and exiting due to --keep
10127 rm -rf ${CVSROOT_DIRNAME}/join5
10131 mkdir join6; cd join6
10133 dotest join6-init-1 "${testcvs} -Q co -l ."
10135 dotest join6-init-2 "${testcvs} -Q add join6"
10138 echo bbb >>temp.txt
10139 echo ccc >>temp.txt
10140 dotest join6-1 "${testcvs} -Q add temp.txt"
10141 dotest join6-2 "${testcvs} -q commit -minitial temp.txt" \
10142 "RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10144 Checking in temp\.txt;
10145 ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
10146 initial revision: 1\.1
10148 cp temp.txt temp2.txt
10149 echo ddd >>temp.txt
10150 dotest join6-3 "${testcvs} -q commit -madd temp.txt" \
10151 "Checking in temp\.txt;
10152 ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
10153 new revision: 1\.2; previous revision: 1\.1
10156 # The case where the merge target is up-to-date and its base revision
10157 # matches the second argument to -j: CVS doesn't bother attempting
10158 # the merge since it already knows that the target contains the
10160 dotest join6-3.3 "${testcvs} update -j1.1 -j1.2 temp.txt" \
10161 "temp\.txt already contains the differences between 1\.1 and 1\.2"
10162 dotest join6-3.4 "${testcvs} diff temp.txt" ""
10164 # The case where the merge target is modified but already contains
10167 echo ccc >>temp.txt
10168 echo ddd >>temp.txt
10169 dotest join6-3.5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
10171 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10172 retrieving revision 1\.1
10173 retrieving revision 1\.2
10174 Merging differences between 1\.1 and 1\.2 into temp\.txt
10175 temp\.txt already contains the differences between 1\.1 and 1\.2"
10176 dotest_fail join6-3.6 "${testcvs} diff temp.txt" \
10178 ===================================================================
10179 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10180 retrieving revision 1\.2
10181 diff -r1\.2 temp.txt
10185 cp temp2.txt temp.txt
10186 dotest_fail join6-4 "${testcvs} diff temp.txt" \
10188 ===================================================================
10189 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10190 retrieving revision 1\.2
10191 diff -r1\.2 temp\.txt
10195 dotest join6-5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
10197 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10198 retrieving revision 1\.1
10199 retrieving revision 1\.2
10200 Merging differences between 1\.1 and 1\.2 into temp\.txt"
10201 dotest join6-6 "${testcvs} diff temp.txt" ""
10202 mv temp.txt temp3.txt
10203 dotest join6-7 "sed 's/ddd/dddd/' < temp3.txt > temp.txt" ""
10204 dotest join6-8 "${testcvs} update -j1.1 -j1.2 temp.txt" \
10206 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10207 retrieving revision 1\.1
10208 retrieving revision 1\.2
10209 Merging differences between 1\.1 and 1\.2 into temp\.txt
10210 rcsmerge: warning: conflicts during merge"
10211 dotest_fail join6-9 "${testcvs} diff temp.txt" \
10213 ===================================================================
10214 RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
10215 retrieving revision 1\.2
10216 diff -r1\.2 temp\.txt
10218 > <<<<<<< temp\.txt
10223 cp temp2.txt temp.txt
10224 dotest join6-10 "${testcvs} -q ci -m del temp.txt" \
10225 "Checking in temp\.txt;
10226 ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
10227 new revision: 1\.3; previous revision: 1\.2
10229 cp temp3.txt temp.txt
10230 dotest_fail join6-11 "${testcvs} diff temp.txt" \
10232 ===================================================================
10233 RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
10234 retrieving revision 1\.3
10235 diff -r1\.3 temp\.txt
10238 dotest join6-12 "${testcvs} update -j1.2 -j1.3 temp.txt" \
10240 RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10241 retrieving revision 1\.2
10242 retrieving revision 1\.3
10243 Merging differences between 1\.2 and 1\.3 into temp\.txt"
10244 dotest join6-13 "${testcvs} diff temp.txt" ""
10246 # The case where the merge target wasn't created until after the
10247 # first tag was applied
10248 rm temp2.txt temp3.txt
10249 dotest join6-20 "${testcvs} -q tag -r1.1 t1" \
10251 echo xxx >temp2.txt
10252 dotest join6-21 "${testcvs} -Q add temp2.txt"
10253 dotest join6-22 "${testcvs} -q ci -m." \
10254 "RCS file: ${CVSROOT_DIRNAME}/join6/temp2.txt,v
10256 Checking in temp2\.txt;
10257 ${CVSROOT_DIRNAME}/join6/temp2\.txt,v <-- temp2\.txt
10258 initial revision: 1\.1
10260 dotest join6-23 "${testcvs} -q tag t2" \
10263 echo xxx >>temp.txt
10264 dotest join6-24 "${testcvs} -q ci -m." \
10265 "Checking in temp\.txt;
10266 ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
10267 new revision: 1\.4; previous revision: 1\.3
10269 dotest join6-25 "${testcvs} -q up -jt1 -jt2" \
10270 "RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
10271 retrieving revision 1\.1
10272 retrieving revision 1\.3
10273 Merging differences between 1\.1 and 1\.3 into temp.txt
10274 temp.txt already contains the differences between 1\.1 and 1\.3
10275 temp2.txt already contains the differences between creation and 1\.1"
10277 # Now for my next trick: delete the file, recreate it, and
10279 dotest join6-30 "${testcvs} -q rm -f temp2.txt" \
10280 "${PROG} remove: use .${PROG} commit. to remove this file permanently"
10281 dotest join6-31 "${testcvs} -q ci -m. temp2.txt" \
10282 "Removing temp2\.txt;
10283 ${CVSROOT_DIRNAME}/join6/temp2\.txt,v <-- temp2\.txt
10284 new revision: delete; previous revision: 1\.1
10286 echo new >temp2.txt
10287 # FIXCVS: Local and remote really shouldn't be different and there
10288 # really shouldn't be two different status lines for temp2.txt
10290 dotest_fail join6-32 "${testcvs} -q up -jt1 -jt2" \
10292 RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
10293 retrieving revision 1\.1
10294 retrieving revision 1\.3
10295 Merging differences between 1\.1 and 1\.3 into temp.txt
10296 temp.txt already contains the differences between 1\.1 and 1\.3
10297 ${PROG} update: move away \./temp2\.txt; it is in the way
10300 dotest join6-32 "${testcvs} -q up -jt1 -jt2" \
10301 "RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
10302 retrieving revision 1\.1
10303 retrieving revision 1\.3
10304 Merging differences between 1\.1 and 1\.3 into temp.txt
10305 temp.txt already contains the differences between 1\.1 and 1\.3
10306 ${PROG} update: use .${PROG} add. to create an entry for temp2\.txt
10314 echo Keeping ${TESTDIR} and exiting due to --keep
10319 rm -rf ${CVSROOT_DIRNAME}/join6
10323 # This test deals with joins that happen with the -n switch
10324 mkdir join7; cd join7
10325 mkdir impdir; cd impdir
10327 echo bbb >>temp.txt
10328 echo ccc >>temp.txt
10330 "${testcvs} -Q import -minitial join7 vendor vers-1" \
10333 dotest join7-2 "${testcvs} -Q co join7" ""
10335 echo ddd >> temp.txt
10336 dotest join7-3 "${testcvs} -Q ci -madded-line temp.txt" \
10337 "Checking in temp.txt;
10338 $CVSROOT_DIRNAME/join7/temp.txt,v <-- temp.txt
10339 new revision: 1\.2; previous revision: 1\.1
10342 echo aaaa >temp.txt
10343 echo bbbb >>temp.txt
10344 echo ccc >>temp.txt
10345 echo eee >>temp.txt
10347 "${testcvs} -Q import -minitial join7 vendor vers-2" \
10351 "${testcvs} -n update -jvers-1 -jvers-2 temp.txt" \
10352 "RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
10353 retrieving revision 1\.1\.1\.1
10354 retrieving revision 1\.1\.1\.2
10355 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
10356 rcsmerge: warning: conflicts during merge"
10358 dotest join7-6 "${testcvs} -n update -jvers-1 -jvers-2 temp.txt" \
10359 "RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
10360 retrieving revision 1\.1\.1\.1
10361 retrieving revision 1\.1\.1\.2
10362 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
10363 rcsmerge: warning: conflicts during merge" \
10364 "RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
10365 retrieving revision 1\.1\.1\.1
10366 retrieving revision 1\.1\.1\.2
10367 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
10368 rcsmerge: warning: conflicts during merge"
10371 echo Keeping ${TESTDIR} and exiting due to --keep
10377 rm -rf $CVSROOT_DIRNAME/join7
10383 # In this test case, we have 2 projects, one called "pvcs" and one
10384 # called "project". The "pvcs" project has modified the file, while
10385 # the "project" project has caused a deletion. When "project" is
10386 # merged into "pvcs", we expect CVS to detect a conflict.
10387 mkdir join8; cd join8
10393 echo "aaa" >base/file.txt
10394 echo "bbb" >pvcs/file.txt
10395 echo "ccc" >project/xxx.txt
10399 "$testcvs import -b 1.1.101 -ko -m 'base import' join8 base base-1" \
10402 No conflicts created by this import"
10406 "$testcvs import -b 1.1.201 -ko -m 'pvcs import' join8 pvcs pvcs-1" \
10409 1 conflicts created by this import.
10410 Use the following command to help the merge:
10412 $PROG checkout -j<prev_rel_tag> -jpvcs-1 join8"
10416 "$testcvs import -b 1.1.301 -ko -m 'project import' join8 project project-1" \
10419 No conflicts created by this import"
10423 "$testcvs checkout -r pvcs-1 -j base-1 -j project-1 -d combine join8" \
10424 "$PROG checkout: Updating combine
10425 U combine/file\.txt
10426 $PROG checkout: file combine/file\.txt has been removed in revision project-1, but the destination is incompatibly modified
10428 U combine/xxx\.txt"
10431 "$testcvs -Q up -pr base-1 combine/file.txt >combine/file.txt"
10434 "$testcvs up -j base-1 -j project-1 combine" \
10435 "$PROG update: Updating combine
10436 M combine/file\.txt
10437 $PROG update: scheduling combine/file\.txt for removal
10439 $PROG update: file combine/xxx\.txt exists, but has been added in revision project-1"
10443 echo Keeping $TESTDIR and exiting due to --keep
10448 rm -rf $CVSROOT_DIRNAME/join8
10454 # In this test case, we have 2 projects, one called "pvcs" and one
10455 # called "project". The "pvcs" project has not modified the file,
10456 # while the "project" project has caused a deletion. When "project"
10457 # is merged into "pvcs", we expect CVS to remove the file without
10458 # fuss, as there is no conflict.
10459 mkdir join9; cd join9
10465 echo "aaa" >base/file.txt
10466 echo "aaa" >pvcs/file.txt
10467 echo "ccc" >project/xxx.txt
10471 "$testcvs import -b 1.1.101 -ko -m 'base import' join9 base base-1" \
10474 No conflicts created by this import"
10478 "$testcvs import -b 1.1.201 -ko -m 'pvcs import' join9 pvcs pvcs-1" \
10481 1 conflicts created by this import.
10482 Use the following command to help the merge:
10484 $PROG checkout -j<prev_rel_tag> -jpvcs-1 join9"
10488 "$testcvs import -b 1.1.301 -ko -m 'project import' join9 project project-1" \
10491 No conflicts created by this import"
10495 "$testcvs checkout -r pvcs-1 -j base-1 -j project-1 -d combine join9" \
10496 "$PROG checkout: Updating combine
10497 U combine/file\.txt
10498 $PROG checkout: scheduling combine/file\.txt for removal
10499 U combine/xxx\.txt"
10504 echo Keeping $TESTDIR and exiting due to --keep
10509 rm -rf $CVSROOT_DIRNAME/join9
10514 join-readonly-conflict)
10515 # Previously, only tests 1 & 11 were being tested. I added the
10516 # intermediate dotest's to try and diagnose a different failure
10518 # Demonstrate that cvs-1.9.29 can fail on 2nd and subsequent
10519 # conflict-evoking join attempts.
10520 # Even with that version of CVS, This test failed only in
10521 # client-server mode, and would have been noticed in normal
10522 # operation only for files that were read-only (either due to
10523 # use of cvs' global -r option, setting the CVSREAD envvar,
10524 # or use of watch lists).
10525 mkdir join-readonly-conflict; cd join-readonly-conflict
10526 dotest join-readonly-conflict-1 "$testcvs -q co -l ." ''
10527 module=join-readonly-conflict
10529 $testcvs -q add $module >>$LOGFILE 2>&1
10534 dotest join-readonly-conflict-2 "$testcvs -Q add $file" ''
10536 dotest join-readonly-conflict-3 "$testcvs -q ci -m . $file" \
10537 "RCS file: $CVSROOT_DIRNAME/$module/$file,v
10540 $CVSROOT_DIRNAME/$module/$file,v <-- $file
10541 initial revision: 1\.1
10544 dotest join-readonly-conflict-4 "$testcvs tag -b B $file" "T $file"
10545 dotest join-readonly-conflict-5 "$testcvs -q update -rB $file" \
10547 echo branch B > $file
10548 dotest join-readonly-conflict-6 "$testcvs -q ci -m . $file" \
10549 "Checking in $file;
10550 $CVSROOT_DIRNAME/$module/$file,v <-- $file
10551 new revision: 1\.1\.2\.1; previous revision: 1\.1
10555 dotest join-readonly-conflict-7 "$testcvs -Q update -A $file" ''
10556 # Make sure $file is read-only. This can happen more realistically
10557 # via patch -- which could be used to apply a delta, yet would
10558 # preserve a file's read-only permissions.
10559 echo conflict > $file; chmod u-w $file
10560 dotest join-readonly-conflict-8 "$testcvs update -r B $file" \
10561 "RCS file: $CVSROOT_DIRNAME/$module/$file,v
10562 retrieving revision 1\.1
10563 retrieving revision 1\.1\.2\.1
10564 Merging differences between 1\.1 and 1\.1\.2\.1 into $file
10565 rcsmerge: warning: conflicts during merge
10566 ${PROG} update: conflicts found in $file
10569 # restore to the trunk
10571 dotest join-readonly-conflict-9 "$testcvs -Q update -A $file" ''
10573 # This one would fail because cvs couldn't open the existing
10574 # (and read-only) .# file for writing.
10575 echo conflict > $file
10577 # verify that the backup file is not writable
10578 if test -w ".#$file.1.1"; then
10579 fail "join-readonly-conflict-10 : .#$file.1.1 is writable"
10581 pass "join-readonly-conflict-10"
10583 dotest join-readonly-conflict-11 "$testcvs update -r B $file" \
10584 "RCS file: $CVSROOT_DIRNAME/$module/$file,v
10585 retrieving revision 1\.1
10586 retrieving revision 1\.1\.2\.1
10587 Merging differences between 1\.1 and 1\.1\.2\.1 into $file
10588 rcsmerge: warning: conflicts during merge
10589 ${PROG} update: conflicts found in $file
10593 if $keep; then :; else
10594 rm -rf join-readonly-conflict
10595 rm -rf $CVSROOT_DIRNAME/$module
10601 dotest join-admin-1 "$testcvs -q co -l ." ''
10604 $testcvs -q add $module >>$LOGFILE 2>&1
10607 # Create a file so applying the first tag works.
10609 $testcvs -Q add a > /dev/null 2>&1
10610 $testcvs -Q ci -m. a > /dev/null 2>&1
10612 $testcvs -Q tag -b B
10613 $testcvs -Q tag -b M1
10615 $testcvs -Q add b > /dev/null 2>&1
10616 $testcvs -Q ci -m. b > /dev/null 2>&1
10617 $testcvs -Q tag -b M2
10619 $testcvs -Q update -r B
10620 $testcvs -Q update -kk -jM1 -jM2
10621 $testcvs -Q ci -m. b >/dev/null 2>&1
10623 $testcvs -Q update -A
10625 # Verify that the -kk flag from the update did not
10626 # propagate to the repository.
10627 dotest join-admin-1 "$testcvs status b" \
10628 "===================================================================
10629 File: b Status: Up-to-date
10631 Working revision: 1\.1.*
10632 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/x/b,v
10634 Sticky Date: (none)
10635 Sticky Options: (none)"
10639 rm -rf ${CVSROOT_DIRNAME}/$module
10643 # Show that when a merge (via update -kk -jtag1 -jtag2) first
10644 # removes a file, then modifies another containing an $Id...$ line,
10645 # the resulting file contains the unexpanded `$Id.$' string, as
10648 dotest join-admin-2-1 "$testcvs -q co -l ." ''
10651 dotest join-admin-2-2 "$testcvs -q add $module" \
10652 "Directory ${CVSROOT_DIRNAME}/x added to the repository"
10655 # Create a file so applying the first tag works.
10658 dotest join-admin-2-3 "$testcvs -Q add e" ''
10659 dotest join-admin-2-4 "$testcvs -Q ci -m. e" \
10660 "RCS file: ${CVSROOT_DIRNAME}/x/e,v
10663 ${CVSROOT_DIRNAME}/x/e,v <-- e
10664 initial revision: 1\.1
10667 dotest join-admin-2-5 "$testcvs -Q tag -b T" '' "${QUESTION} e0"
10668 dotest join-admin-2-6 "$testcvs -Q update -r T" '' "${QUESTION} e0"
10670 dotest join-admin-2-7 "$testcvs -Q ci -m. e" \
10672 ${CVSROOT_DIRNAME}/x/e,v <-- e
10673 new revision: 1\.1\.2\.1; previous revision: 1\.1
10676 dotest join-admin-2-8 "$testcvs -Q update -A" '' "${QUESTION} e0"
10677 dotest join-admin-2-9 "$testcvs -Q tag -b M1" '' "${QUESTION} e0"
10680 dotest join-admin-2-10 "$testcvs -Q add b" ''
10682 dotest join-admin-2-11 "$testcvs -Q ci -m. b e" \
10683 "RCS file: ${CVSROOT_DIRNAME}/x/b,v
10686 ${CVSROOT_DIRNAME}/x/b,v <-- b
10687 initial revision: 1\.1
10690 ${CVSROOT_DIRNAME}/x/e,v <-- e
10691 new revision: 1\.2; previous revision: 1\.1
10694 dotest join-admin-2-12 "$testcvs -Q tag -b M2" '' "${QUESTION} e0"
10696 dotest join-admin-2-13 "$testcvs -Q update -r T" '' "${QUESTION} e0"
10697 dotest join-admin-2-14 "$testcvs update -kk -jM1 -jM2" \
10698 "${PROG} update: Updating .
10701 RCS file: ${CVSROOT_DIRNAME}/x/e,v
10702 retrieving revision 1\.1
10703 retrieving revision 1\.2
10704 Merging differences between 1\.1 and 1\.2 into e
10705 e already contains the differences between 1\.1 and 1\.2
10708 ${PROG} update: Updating .
10711 RCS file: ${CVSROOT_DIRNAME}/x/e,v
10712 retrieving revision 1\.1
10713 retrieving revision 1\.2
10714 Merging differences between 1\.1 and 1\.2 into e
10715 e already contains the differences between 1\.1 and 1\.2"
10717 # Verify that the $Id.$ string is not expanded.
10718 dotest join-admin-2-15 "cat e" '$''Id$'
10722 rm -rf ${CVSROOT_DIRNAME}/$module
10726 # This first half of this test checks that a single-argument merge
10727 # from a branch is capable of removing files.
10729 # The second half verifies that an update to another location with an
10730 # uncommitted removal will transfer the destination branch of the
10734 mkdir $module; cd $module
10736 dotest join-rm-init-1 "$testcvs -q co -l ." ''
10738 dotest join-rm-init-2 "$testcvs -q add $module" \
10739 "Directory $CVSROOT_DIRNAME/$module added to the repository"
10743 touch a b c d e f g
10744 dotest join-rm-init-3 "$testcvs -Q add a b c d e f g"
10745 dotest join-rm-init-4 "$testcvs -Q ci -m add-em" \
10746 "RCS file: $CVSROOT_DIRNAME/join-rm/a,v
10749 $CVSROOT_DIRNAME/join-rm/a,v <-- a
10750 initial revision: 1\.1
10752 RCS file: $CVSROOT_DIRNAME/join-rm/b,v
10755 $CVSROOT_DIRNAME/join-rm/b,v <-- b
10756 initial revision: 1\.1
10758 RCS file: $CVSROOT_DIRNAME/join-rm/c,v
10761 $CVSROOT_DIRNAME/join-rm/c,v <-- c
10762 initial revision: 1\.1
10764 RCS file: $CVSROOT_DIRNAME/join-rm/d,v
10767 $CVSROOT_DIRNAME/join-rm/d,v <-- d
10768 initial revision: 1\.1
10770 RCS file: $CVSROOT_DIRNAME/join-rm/e,v
10773 $CVSROOT_DIRNAME/join-rm/e,v <-- e
10774 initial revision: 1\.1
10776 RCS file: $CVSROOT_DIRNAME/join-rm/f,v
10779 $CVSROOT_DIRNAME/join-rm/f,v <-- f
10780 initial revision: 1\.1
10782 RCS file: $CVSROOT_DIRNAME/join-rm/g,v
10785 $CVSROOT_DIRNAME/join-rm/g,v <-- g
10786 initial revision: 1\.1
10789 # create the branch and update to it
10790 dotest join-rm-init-5 "$testcvs -Q tag -b br"
10791 dotest join-rm-init-6 "$testcvs -Q up -rbr"
10793 # remove a few files from the branch
10794 dotest join-rm-init-7 "$testcvs -Q rm -f b d g"
10795 dotest join-rm-init-8 "$testcvs -Q ci -mrm" \
10797 $CVSROOT_DIRNAME/join-rm/b,v <-- b
10798 new revision: delete; previous revision: 1\.1
10801 $CVSROOT_DIRNAME/join-rm/d,v <-- d
10802 new revision: delete; previous revision: 1\.1
10805 $CVSROOT_DIRNAME/join-rm/g,v <-- g
10806 new revision: delete; previous revision: 1\.1
10809 # update to the trunk
10810 dotest join-rm-init-9 "$testcvs -Q up -A"
10812 # now for the test - try and merge the removals.
10813 dotest join-rm-1 "$testcvs -q up -jbr" \
10814 "$PROG update: scheduling b for removal
10815 $PROG update: scheduling d for removal
10816 $PROG update: scheduling g for removal"
10818 # And make sure the merge took
10819 dotest join-rm-2 "$testcvs -qn up" \
10824 dotest join-rm-3 "$testcvs -q ci -m 'save the merge'" \
10826 $CVSROOT_DIRNAME/join-rm/b,v <-- b
10827 new revision: delete; previous revision: 1\.1
10830 $CVSROOT_DIRNAME/join-rm/d,v <-- d
10831 new revision: delete; previous revision: 1\.1
10834 $CVSROOT_DIRNAME/join-rm/g,v <-- g
10835 new revision: delete; previous revision: 1\.1
10838 # and verify that it was the head revision which was removed.
10839 dotest join-rm-4 "$testcvs -q log b" "
10840 RCS file: $CVSROOT_DIRNAME/join-rm/Attic/b,v
10848 keyword substitution: kv
10849 total revisions: 3; selected revisions: 3
10851 ----------------------------
10853 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: ${PLUS}0 -0
10855 ----------------------------
10857 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
10860 ----------------------------
10861 revision 1\.1\.2\.1
10862 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: ${PLUS}0 -0
10864 ============================================================================="
10866 # go back to the branch to set up for the second set of tests
10867 dotest join-rm-init-10 "$testcvs -Q up -rbr"
10868 dotest join-rm-init-11 "$testcvs -Q rm -f a"
10869 dotest join-rm-init-12 "$testcvs -Q ci -m rma" \
10871 $CVSROOT_DIRNAME/join-rm/a,v <-- a
10872 new revision: delete; previous revision: 1\.1
10875 # now the test: update to the trunk
10877 # FIXCVS: This update should merge the removal to the trunk. It does
10879 dotest join-rm-5 "$testcvs -q up -A" \
10885 # and verify that there is no sticky tag
10886 dotest join-rm-6 "$testcvs status a" \
10887 "===================================================================
10888 File: a Status: Up-to-date
10890 Working revision: 1\.1.*
10891 Repository revision: 1\.1 $CVSROOT_DIRNAME/join-rm/a,v
10893 Sticky Date: (none)
10894 Sticky Options: (none)"
10897 echo Keeping $TESTDIR and exiting due to --keep
10902 rm -rf $CVSROOT_DIRNAME/$module
10906 new) # look for stray "no longer pertinent" messages.
10907 mkdir ${CVSROOT_DIRNAME}/first-dir
10909 if ${CVS} co first-dir ; then
10918 if ${CVS} add a 2>>${LOGFILE}; then
10924 if ${CVS} ci -m added >>${LOGFILE} 2>&1; then
10932 if ${CVS} rm a 2>>${LOGFILE}; then
10938 if ${CVS} ci -m removed >>${LOGFILE} ; then
10944 if ${CVS} update -A 2>&1 | grep longer ; then
10950 if ${CVS} update -rHEAD 2>&1 | grep longer ; then
10958 rm -rf ${CVSROOT_DIRNAME}/first-dir
10962 # Test removing a file on a branch and then checking it out.
10964 # We call this "newb" only because it, like the "new" tests,
10965 # has something to do with "no longer pertinent" messages.
10966 # Not necessarily the most brilliant nomenclature.
10969 mkdir ${CVSROOT_DIRNAME}/first-dir
10970 dotest newb-123a "${testcvs} -q co first-dir" ''
10973 dotest newb-123b "${testcvs} add a" \
10974 "${PROG} add: scheduling file .a. for addition
10975 ${PROG} add: use .${PROG} commit. to add this file permanently"
10976 dotest newb-123c "${testcvs} -q ci -m added" \
10977 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
10980 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
10981 initial revision: 1\.1
10985 dotest newb-123d "${testcvs} -q tag -b branch" "T a"
10987 # Check out the branch.
10992 dotest newb-123e "${testcvs} -q co -r branch first-dir" \
10995 # Remove 'a' on another copy of the branch.
10999 dotest newb-123f "${testcvs} -q co -r branch first-dir" \
11003 dotest newb-123g "${testcvs} rm a" \
11004 "${PROG} remove: scheduling .a. for removal
11005 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
11006 dotest newb-123h "${testcvs} -q ci -m removed" \
11008 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
11009 new revision: delete; previous revision: 1\.1
11012 # Check out the file on the branch. This should report
11013 # that the file is not pertinent, but it should not
11014 # say anything else.
11017 dotest newb-123i "${testcvs} -q co -r branch first-dir/a" \
11018 "${PROG} checkout: warning: first-dir/a is not (any longer) pertinent"
11020 # Update the other copy, and make sure that a is removed.
11022 # "Entry Invalid" is a rather strange output here. Something like
11023 # "Removed in Repository" would make more sense.
11024 dotest newb-123j0 "${testcvs} status a" \
11025 "${PROG} status: a is no longer in the repository
11026 ===================================================================
11027 File: a Status: Entry Invalid
11029 Working revision: 1\.1.*
11030 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/a,v
11031 Sticky Tag: branch (branch: 1\.1\.2)
11032 Sticky Date: (none)
11033 Sticky Options: (none)"
11034 dotest newb-123j "${testcvs} -q update" \
11035 "${PROG} update: a is no longer in the repository"
11045 rm -rf ${CVSROOT_DIRNAME}/first-dir
11049 mkdir ${CVSROOT_DIRNAME}/first-dir
11054 dotest conflicts-124 "${testcvs} -q co first-dir" ''
11059 dotest conflicts-125 "${testcvs} add a" \
11060 "${PROG} add: scheduling file .a. for addition
11061 ${PROG} add: use .${PROG} commit. to add this file permanently"
11062 dotest conflicts-126 "${testcvs} -q ci -m added" \
11063 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
11066 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
11067 initial revision: 1\.1
11074 dotest conflicts-126.5 "${testcvs} co -p first-dir" \
11075 "${PROG} checkout: Updating first-dir
11076 ===================================================================
11077 Checking out first-dir/a
11078 RCS: ${CVSROOT_DIRNAME}/first-dir/a,v
11080 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
11081 if ${CVS} co first-dir ; then
11093 cd ../../1/first-dir
11094 echo add a line >>a
11096 dotest conflicts-127b "${testcvs} add dir1" \
11097 "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
11098 dotest conflicts-128 "${testcvs} -q ci -m changed" \
11100 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
11101 new revision: 1\.2; previous revision: 1\.1
11105 # Similar to conflicts-126.5, but now the file has nonempty
11109 dotest conflicts-128.5 "${testcvs} co -p -l first-dir" \
11110 "${PROG} checkout: Updating first-dir
11111 ===================================================================
11112 Checking out first-dir/a
11113 RCS: ${CVSROOT_DIRNAME}/first-dir/a,v
11115 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
11120 # Now go over the to the other working directory and
11121 # start testing conflicts
11123 echo add a conflicting line >>a
11124 dotest_fail conflicts-129 "${testcvs} -q ci -m changed" \
11125 "${PROG}"' commit: Up-to-date check failed for `a'\''
11126 '"${PROG}"' \[commit aborted\]: correct above errors first!'
11129 dotest conflicts-status-0 "${testcvs} status a" \
11130 "===================================================================
11131 File: a Status: Needs Merge
11133 Working revision: 1\.1.*
11134 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
11136 Sticky Date: (none)
11137 Sticky Options: (none)"
11138 dotest conflicts-129a "${testcvs} -nq update a" \
11139 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
11140 retrieving revision 1\.1
11141 retrieving revision 1\.2
11142 Merging differences between 1\.1 and 1\.2 into a
11143 rcsmerge: warning: conflicts during merge
11144 ${PROG} update: conflicts found in a
11146 dotest conflicts-130 "${testcvs} -q update" \
11147 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
11148 retrieving revision 1\.1
11149 retrieving revision 1\.2
11150 Merging differences between 1\.1 and 1\.2 into a
11151 rcsmerge: warning: conflicts during merge
11152 ${PROG} update: conflicts found in a
11155 ${QUESTION} sdir" \
11158 RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
11159 retrieving revision 1\.1
11160 retrieving revision 1\.2
11161 Merging differences between 1\.1 and 1\.2 into a
11162 rcsmerge: warning: conflicts during merge
11163 ${PROG} update: conflicts found in a
11167 dotest conflicts-status-1 "${testcvs} status a" \
11168 "===================================================================
11169 File: a Status: Unresolved Conflict
11171 Working revision: 1\.2.*
11172 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
11174 Sticky Date: (none)
11175 Sticky Options: (none)"
11176 dotest_fail conflicts-131 "${testcvs} -q ci -m try" \
11177 "${PROG} commit: file .a. had a conflict and has not been modified
11178 ${PROG} \[commit aborted\]: correct above errors first!"
11180 # Try to check in the file with the conflict markers in it.
11181 # Make sure we detect any one of the three conflict markers
11183 grep '^<<<<<<<' aa >a
11184 dotest conflicts-status-2 "${testcvs} -nq ci -m try a" \
11185 "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
11187 grep '^=======' aa >a
11188 dotest conflicts-status-3 "${testcvs} -nq ci -m try a" \
11189 "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
11191 grep '^>>>>>>>' aa >a
11192 dotest conflicts-status-4 "${testcvs} -qn ci -m try a" \
11193 "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
11196 echo lame attempt at resolving it >>a
11197 dotest conflicts-status-5 "${testcvs} status a" \
11198 "===================================================================
11199 File: a Status: File had conflicts on merge
11201 Working revision: 1\.2.*
11202 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
11204 Sticky Date: (none)
11205 Sticky Options: (none)"
11206 dotest conflicts-132 "${testcvs} -q ci -m try" \
11207 "${PROG} commit: warning: file .a. seems to still contain conflict indicators
11209 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
11210 new revision: 1\.3; previous revision: 1\.2
11213 # OK, the user saw the warning (good user), and now
11214 # resolves it for real.
11215 echo resolve conflict >a
11216 dotest conflicts-status-6 "${testcvs} status a" \
11217 "===================================================================
11218 File: a Status: Locally Modified
11220 Working revision: 1\.3.*
11221 Repository revision: 1\.3 ${CVSROOT_DIRNAME}/first-dir/a,v
11223 Sticky Date: (none)
11224 Sticky Options: (none)"
11225 dotest conflicts-133 "${testcvs} -q ci -m resolved" \
11227 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
11228 new revision: 1\.4; previous revision: 1\.3
11230 dotest conflicts-status-7 "${testcvs} status a" \
11231 "===================================================================
11232 File: a Status: Up-to-date
11234 Working revision: 1\.4.*
11235 Repository revision: 1\.4 ${CVSROOT_DIRNAME}/first-dir/a,v
11237 Sticky Date: (none)
11238 Sticky Options: (none)"
11240 # Now test that we can add a file in one working directory
11241 # and have an update in another get it.
11242 cd ../../1/first-dir
11244 if ${testcvs} add abc >>${LOGFILE} 2>&1; then
11249 if ${testcvs} ci -m 'add abc' abc >>${LOGFILE} 2>&1; then
11255 mkdir first-dir/dir1 first-dir/sdir
11256 dotest conflicts-136 "${testcvs} -q update first-dir" \
11257 '[UP] first-dir/abc
11258 '"${QUESTION}"' first-dir/dir1
11259 '"${QUESTION}"' first-dir/sdir' \
11260 ''"${QUESTION}"' first-dir/dir1
11261 '"${QUESTION}"' first-dir/sdir
11262 [UP] first-dir/abc'
11263 dotest conflicts-137 'test -f first-dir/abc' ''
11264 rmdir first-dir/dir1 first-dir/sdir
11266 # Now test something similar, but in which the parent directory
11267 # (not the directory in question) has the Entries.Static flag
11271 if ${testcvs} add subdir >>${LOGFILE}; then
11279 if ${testcvs} -q co first-dir/abc first-dir/subdir \
11285 cd ../1/first-dir/subdir
11287 if ${testcvs} add sss >>${LOGFILE} 2>&1; then
11292 if ${testcvs} ci -m adding sss >>${LOGFILE} 2>&1; then
11297 cd ../../../3/first-dir
11298 if ${testcvs} -q update >>${LOGFILE}; then
11303 if test -f subdir/sss; then
11309 rm -r 1 2 3 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
11313 # More conflicts tests; separate from conflicts to keep each
11314 # test a manageable size.
11315 mkdir ${CVSROOT_DIRNAME}/first-dir
11320 dotest conflicts2-142a1 "${testcvs} -q co first-dir" ''
11325 dotest conflicts2-142a2 "${testcvs} add a abc" \
11326 "${PROG} add: scheduling file .a. for addition
11327 ${PROG} add: scheduling file .abc. for addition
11328 ${PROG} add: use .${PROG} commit. to add these files permanently"
11329 dotest conflicts2-142a3 "${testcvs} -q ci -m added" \
11330 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
11333 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
11334 initial revision: 1\.1
11336 RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
11339 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
11340 initial revision: 1\.1
11347 dotest conflicts2-142a4 "${testcvs} -q co first-dir" 'U first-dir/a
11351 # BEGIN TESTS USING THE FILE A
11352 # FIXME: would be cleaner to separate them out into their own
11353 # tests; conflicts2 is getting long.
11354 # Now test that if one person modifies and commits a
11355 # file and a second person removes it, it is a
11359 dotest conflicts2-142b2 "${testcvs} -q ci -m modify-a" \
11361 ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
11362 new revision: 1\.2; previous revision: 1\.1
11364 cd ../../2/first-dir
11366 dotest conflicts2-142b3 "${testcvs} rm a" \
11367 "${PROG} remove: scheduling .a. for removal
11368 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
11369 dotest_fail conflicts2-142b4 "${testcvs} -q update" \
11370 "${PROG} update: conflict: removed a was modified by second party
11372 # Resolve the conflict by deciding not to remove the file
11374 dotest_sort conflicts2-142b5 "${testcvs} add a" "U a
11375 ${PROG} add: a, version 1\.1, resurrected"
11376 dotest conflicts2-142b5b1 "$testcvs status a" \
11377 "===================================================================
11378 File: a Status: Needs Patch
11380 Working revision: 1\.1.*
11381 Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/a,v
11383 Sticky Date: (none)
11384 Sticky Options: (none)"
11385 dotest conflicts2-142b6 "${testcvs} -q update" 'U a'
11387 # Now one level up.
11389 dotest conflicts2-142b7 "${testcvs} rm -f first-dir/a" \
11390 "${PROG} remove: scheduling .first-dir/a. for removal
11391 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
11394 # Haven't investigated this one.
11395 dotest_fail conflicts2-142b8r "$testcvs add first-dir/a" \
11396 "${PROG} add: in directory \.:
11397 ${PROG} \[add aborted\]: there is no version here; do '${PROG} checkout' first"
11400 dotest conflicts2-142b8 "${testcvs} add first-dir/a" \
11402 ${PROG} add: first-dir/a, version 1\.2, resurrected"
11404 # Now recover from the damage that the 142b8 test did.
11405 dotest conflicts2-142b9 "${testcvs} rm -f a" \
11406 "${PROG} remove: scheduling .a. for removal
11407 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
11410 dotest_sort conflicts2-142b10 "${testcvs} add a" "U a
11411 ${PROG} add: a, version 1\.2, resurrected"
11412 # As with conflicts2-142b6, check that things are normal again.
11413 dotest conflicts2-142b11 "${testcvs} -q update" ''
11415 # END TESTS USING THE FILE A
11417 # Now test that if one person removes a file and
11418 # commits it, and a second person removes it, is it
11422 dotest conflicts2-142c0 "${testcvs} rm abc" \
11423 "${PROG} remove: scheduling .abc. for removal
11424 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
11425 dotest conflicts2-142c1 "${testcvs} -q ci -m remove-abc" \
11427 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
11428 new revision: delete; previous revision: 1\.1
11430 cd ../../2/first-dir
11432 dotest conflicts2-142c2 "${testcvs} rm abc" \
11433 "${PROG} remove: scheduling .abc. for removal
11434 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
11435 dotest conflicts2-142c3 "${testcvs} update" \
11436 "${PROG} update: Updating \."
11439 # conflicts2-142d*: test that if one party adds a file, and another
11440 # party has a file of the same name, cvs notices
11443 echo 'contents unchanged' >same.c
11444 dotest conflicts2-142d0 "${testcvs} add aa.c same.c" \
11445 "${PROG} add: scheduling file .aa\.c. for addition
11446 ${PROG} add: scheduling file .same\.c. for addition
11447 ${PROG} add: use .${PROG} commit. to add these files permanently"
11448 dotest conflicts2-142d1 "${testcvs} -q ci -m added" \
11449 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa\.c,v
11452 ${CVSROOT_DIRNAME}/first-dir/aa\.c,v <-- aa\.c
11453 initial revision: 1\.1
11455 RCS file: ${CVSROOT_DIRNAME}/first-dir/same\.c,v
11457 Checking in same\.c;
11458 ${CVSROOT_DIRNAME}/first-dir/same\.c,v <-- same\.c
11459 initial revision: 1\.1
11461 cd ../../2/first-dir
11462 echo "don't you dare obliterate this text" >aa.c
11463 echo 'contents unchanged' >same.c
11464 # Note the discrepancy between local and remote in the handling
11465 # of same.c. I kind
11466 # of suspect that the local CVS behavior is the more useful one
11467 # although I do sort of wonder whether we should make people run
11468 # cvs add just to get them in that habit (also, trying to implement
11469 # the local CVS behavior for remote without the cvs add seems
11470 # pretty difficult).
11472 dotest_fail conflicts2-142d2 "${testcvs} -q update" \
11474 ${QUESTION} same\.c
11475 ${PROG} update: move away \./aa\.c; it is in the way
11477 ${PROG} update: move away \./same\.c; it is in the way
11480 dotest_fail conflicts2-142d2 "${testcvs} -q update" \
11481 "${PROG} [a-z]*: move away aa\.c; it is in the way
11485 dotest conflicts2-142d3 "${testcvs} -q status aa.c" \
11486 "${PROG} status: move away aa\.c; it is in the way
11487 ===================================================================
11488 File: aa\.c Status: Unresolved Conflict
11490 Working revision: No entry for aa\.c
11491 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/aa\.c,v"
11493 # Could also be testing the case in which the cvs add happened
11494 # before the commit by the other user.
11495 # This message seems somewhat bogus. I mean, parallel development
11496 # means that we get to work in parallel if we choose, right? And
11497 # then at commit time it would be a conflict.
11498 dotest_fail conflicts2-142d4 "${testcvs} -q add aa.c" \
11499 "${PROG} add: aa.c added independently by second party"
11501 # The user might want to see just what the conflict is.
11502 # Don't bother, diff seems to kind of lose its mind, with or
11503 # without -N. This is a CVS bug(s).
11504 #dotest conflicts2-142d5 "${testcvs} -q diff -r HEAD -N aa.c" fixme
11506 # Now: "how can the user resolve this conflict", I hear you cry.
11507 # Well, one way is to forget about the file in the working
11509 # Since it didn't let us do the add in conflicts2-142d4, there
11510 # is no need to run cvs rm here.
11511 #dotest conflicts2-142d6 "${testcvs} -q rm -f aa.c" fixme
11512 dotest conflicts2-142d6 "rm aa.c" ''
11513 dotest conflicts2-142d7 "${testcvs} -q update aa.c" "U aa\.c"
11514 dotest conflicts2-142d8 "cat aa.c" ''
11516 # The other way is to use the version from the working directory
11517 # instead of the version from the repository. Unfortunately,
11518 # there doesn't seem to be any particularly clear way to do
11523 rm -r 1 2; rm -rf ${CVSROOT_DIRNAME}/first-dir
11527 # More tests of conflicts and/or multiple working directories
11531 dotest conflicts3-1 "${testcvs} -q co -l ." ''
11533 dotest conflicts3-2 "${testcvs} add first-dir" \
11534 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
11537 dotest conflicts3-3 "${testcvs} -q co -l first-dir" ''
11540 dotest conflicts3-4 "${testcvs} add file1 file2" \
11541 "${PROG} add: scheduling file .file1. for addition
11542 ${PROG} add: scheduling file .file2. for addition
11543 ${PROG} add: use .${PROG} commit. to add these files permanently"
11544 dotest conflicts3-5 "${testcvs} -q ci -m add-them" \
11545 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
11548 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
11549 initial revision: 1\.1
11551 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
11554 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
11555 initial revision: 1\.1
11557 cd ../../2/first-dir
11558 # Check that -n doesn't make CVS lose its mind as it creates
11559 # (or rather, doesn't) a new file.
11560 dotest conflicts3-6 "${testcvs} -nq update" \
11563 dotest_fail conflicts3-7 "test -f file1" ''
11564 dotest conflicts3-8 "${testcvs} -q update" \
11567 dotest conflicts3-9 "test -f file2" ''
11569 # OK, now remove two files at once
11570 dotest conflicts3-10 "${testcvs} rm -f file1 file2" \
11571 "${PROG} remove: scheduling .file1. for removal
11572 ${PROG} remove: scheduling .file2. for removal
11573 ${PROG} remove: use .${PROG} commit. to remove these files permanently"
11574 dotest conflicts3-11 "${testcvs} -q ci -m remove-them" \
11576 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
11577 new revision: delete; previous revision: 1\.1
11580 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
11581 new revision: delete; previous revision: 1\.1
11583 cd ../../1/first-dir
11584 dotest conflicts3-12 "${testcvs} -n -q update" \
11585 "${PROG} update: file1 is no longer in the repository
11586 ${PROG} update: file2 is no longer in the repository"
11587 dotest conflicts3-13 "${testcvs} -q update" \
11588 "${PROG} update: file1 is no longer in the repository
11589 ${PROG} update: file2 is no longer in the repository"
11591 # OK, now add a directory to both working directories
11592 # and see that CVS doesn't lose its mind.
11594 dotest conflicts3-14 "${testcvs} add sdir" \
11595 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
11597 dotest conflicts3-14a "${testcvs} add sdir/sfile" \
11598 "${PROG} add: scheduling file .sdir/sfile. for addition
11599 ${PROG} add: use .${PROG} commit. to add this file permanently"
11600 dotest conflicts3-14b "${testcvs} -q ci -m add" \
11601 "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v
11603 Checking in sdir/sfile;
11604 ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v <-- sfile
11605 initial revision: 1\.1
11608 cd ../../2/first-dir
11610 # Create a CVS directory without the proper administrative
11611 # files in it. This can happen for example if you hit ^C
11612 # in the middle of a checkout.
11615 # OK, in the local case CVS sees that the directory exists
11616 # in the repository and recurses into it. In the remote case
11617 # CVS can't see the repository and has no way of knowing
11618 # that sdir is even a directory (stat'ing everything would be
11619 # too slow). The remote behavior makes more sense to me (but
11620 # would this affect other cases?).
11622 dotest conflicts3-15 "${testcvs} -q update" \
11625 dotest conflicts3-15 "${testcvs} -q update" \
11627 ${PROG} update: ignoring sdir (CVS/Repository missing)"
11628 touch sdir/CVS/Repository
11629 dotest conflicts3-16 "${testcvs} -q update" \
11631 ${PROG} update: ignoring sdir (CVS/Entries missing)"
11633 dotest conflicts3-16a "${testcvs} -q update first-dir" \
11634 "${QUESTION} first-dir/sdir
11635 ${PROG} update: ignoring first-dir/sdir (CVS/Entries missing)"
11640 # OK, now the same thing, but the directory doesn't exist
11641 # in the repository.
11644 dotest conflicts3-17 "${testcvs} -q update" "${QUESTION} newdir"
11645 echo "D/newdir////" >> CVS/Entries
11646 dotest conflicts3-18 "${testcvs} -q update" \
11647 "${PROG} [a-z]*: ignoring newdir (CVS/Repository missing)"
11648 touch newdir/CVS/Repository
11649 dotest conflicts3-19 "${testcvs} -q update" \
11650 "${PROG} [a-z]*: ignoring newdir (CVS/Entries missing)"
11652 dotest conflicts3-20 "${testcvs} -q update first-dir" \
11653 "${PROG} [a-z]*: ignoring first-dir/newdir (CVS/Entries missing)"
11657 # The previous tests have left CVS/Entries in something of a mess.
11658 # While we "should" be able to deal with that (maybe), for now
11659 # we just start over.
11662 dotest conflicts3-20a "${testcvs} -q co -l first-dir" ''
11665 dotest conflicts3-21 "${testcvs} -q update -d sdir" "U sdir/sfile"
11667 dotest conflicts3-22 "${testcvs} -q update" "${QUESTION} sdir"
11669 dotest_fail conflicts3-23 "${testcvs} -q update -PdA" \
11671 ${PROG} update: move away sdir/sfile; it is in the way
11674 dotest conflicts3-23 "${testcvs} -q update -PdA" \
11678 # Not that it should really affect much, but let's do the case
11679 # where sfile has been removed. For example, suppose that sdir
11680 # had been a CVS-controlled directory which was then removed
11681 # by removing each file (and using update -P or some such). Then
11682 # suppose that the build process creates an sdir directory which
11683 # is not supposed to be under CVS.
11685 dotest conflicts3-24 "${testcvs} -q update -d sdir" "U sdir/sfile"
11687 dotest conflicts3-25 "${testcvs} rm sdir/sfile" \
11688 "${PROG} remove: scheduling .sdir/sfile. for removal
11689 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
11690 dotest conflicts3-26 "${testcvs} ci -m remove sdir/sfile" \
11691 "Removing sdir/sfile;
11692 ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v <-- sfile
11693 new revision: delete; previous revision: 1\.1
11696 dotest conflicts3-27 "${testcvs} -q update" "${QUESTION} sdir"
11697 dotest conflicts3-28 "${testcvs} -q update -PdA" \
11703 rm -rf ${CVSROOT_DIRNAME}/first-dir
11707 mkdir conflicts4; cd conflicts4
11709 dotest conflicts4-1 "$testcvs -q co -l ."
11711 dotest conflicts4-2 "${testcvs} add first-dir" \
11712 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
11715 dotest conflicts4-3 "${testcvs} -q co -l first-dir" ''
11717 echo baseline >file1
11718 dotest conflicts4-4 "${testcvs} -q add file1" \
11719 "$PROG add: use .$PROG commit. to add this file permanently"
11720 dotest conflicts4-5 "${testcvs} -q ci -m add-it" \
11721 "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
11724 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
11725 initial revision: 1\.1
11727 cd ../../2/first-dir
11728 dotest conflicts4-6 "${testcvs} -q update" "U file1"
11729 # Make a local change
11730 echo wibble2 >> file1
11731 dotest conflicts4-7 "${testcvs} -q ci -m update2" \
11732 "Checking in file1;
11733 $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
11734 new revision: 1\.2; previous revision: 1\.1
11736 cd ../../1/first-dir
11737 echo wibble1 >>file1
11738 dotest conflicts4-8 "${testcvs} -Q update" \
11739 "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
11740 retrieving revision 1\.1
11741 retrieving revision 1\.2
11742 Merging differences between 1\.1 and 1\.2 into file1
11743 rcsmerge: warning: conflicts during merge
11744 cvs update: conflicts found in file1"
11745 dotest_fail conflicts4-9 "${testcvs} -q update" \
11749 cat >$TESTDIR/conflicts4/serveme <<EOF
11751 # This is admittedly a bit cheezy, in the sense that we make lots
11752 # of assumptions about what the client is going to send us.
11753 # We don't mention Repository, because current clients don't require it.
11754 # Sending these at our own pace, rather than waiting for the client to
11755 # make the requests, is bogus, but hopefully we can get away with it.
11756 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update Global_option"
11759 echo "MT fname file1"
11762 cat >$TESTDIR/conflicts4/client.out
11764 # Cygwin. Pthffffffffft!
11765 if test -n "$remotehost"; then
11766 $CVS_RSH $remotehost "chmod +x $TESTDIR/conflicts4/serveme"
11768 chmod +x $TESTDIR/conflicts4/serveme
11770 save_CVS_SERVER=$CVS_SERVER
11771 CVS_SERVER=$TESTDIR/conflicts4/serveme; export CVS_SERVER
11772 dotest_fail conflicts4-10r "$testcvs -q up" "C file1"
11773 dotest conflicts4-11r "cat $TESTDIR/conflicts4/client.out" \
11777 $CVSROOT_DIRNAME/first-dir
11778 Entry /file1/1.2/$PLUS=//
11790 cat >$TESTDIR/conflicts4/serveme <<EOF
11792 # This is admittedly a bit cheezy, in the sense that we make lots
11793 # of assumptions about what the client is going to send us.
11794 # We don't mention Repository, because current clients don't require it.
11795 # Sending these at our own pace, rather than waiting for the client to
11796 # make the requests, is bogus, but hopefully we can get away with it.
11797 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update Global_option Empty-conflicts"
11800 echo "MT fname file1"
11803 cat >$TESTDIR/conflicts4/client.out
11806 dotest_fail conflicts4-12r "$testcvs -q up" "C file1"
11807 dotest conflicts4-13r "cat $TESTDIR/conflicts4/client.out" \
11811 $CVSROOT_DIRNAME/first-dir
11812 Entry /file1/1.2/$PLUS=//
11816 CVS_SERVER=$save_CVS_SERVER; export CVS_SERVER
11820 echo Keeping $TESTDIR and exiting due to --keep
11826 rm -rf $CVSROOT_DIRNAME/first-dir
11830 # Test update -C (overwrite local mods w/ repository copies)
11832 dotest clean-1 "${testcvs} -q co -l ." ''
11834 dotest clean-2 "${testcvs} add first-dir" \
11835 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
11837 echo "The usual boring test text." > cleanme.txt
11838 dotest clean-3 "${testcvs} add cleanme.txt" \
11839 "${PROG} add: scheduling file .cleanme\.txt. for addition
11840 ${PROG} add: use .${PROG} commit. to add this file permanently"
11841 dotest clean-4 "${testcvs} -q ci -m clean-3" \
11842 "RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
11844 Checking in cleanme\.txt;
11845 ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v <-- cleanme\.txt
11846 initial revision: 1\.1
11848 # Okay, preparation is done, now test.
11849 # Check that updating an unmodified copy works.
11850 dotest clean-5 "${testcvs} -q update" ''
11851 # Check that updating -C an unmodified copy works.
11852 dotest clean-6 "${testcvs} -q update -C" ''
11853 # Check that updating a modified copy works.
11854 echo "fish" >> cleanme.txt
11855 dotest clean-7 "${testcvs} -q update" 'M cleanme\.txt'
11856 # Check that updating -C a modified copy works.
11857 dotest clean-8 "${testcvs} -q update -C" \
11858 "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
11860 # And check that the backup copy really was made.
11861 dotest clean-9 "cat .#cleanme.txt.1.1" \
11862 "The usual boring test text\.
11865 # Do it all again, this time naming the file explicitly.
11866 rm .#cleanme.txt.1.1
11867 dotest clean-10 "${testcvs} -q update cleanme.txt" ''
11868 dotest clean-11 "${testcvs} -q update -C cleanme.txt" ''
11869 echo "bluegill" >> cleanme.txt
11870 dotest clean-12 "${testcvs} -q update cleanme.txt" 'M cleanme\.txt'
11871 dotest clean-13 "${testcvs} -q update -C cleanme.txt" \
11872 "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
11874 # And check that the backup copy really was made.
11875 dotest clean-14 "cat .#cleanme.txt.1.1" \
11876 "The usual boring test text\.
11879 # Now try with conflicts
11881 dotest clean-15 "${testcvs} -q co -d second-dir first-dir" \
11882 'U second-dir/cleanme\.txt'
11884 echo "conflict test" >> cleanme.txt
11885 dotest clean-16 "${testcvs} -q ci -m." \
11886 "Checking in cleanme\.txt;
11887 ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v <-- cleanme\.txt
11888 new revision: 1\.2; previous revision: 1\.1
11891 echo "fish" >> cleanme.txt
11892 dotest clean-17 "${testcvs} -nq update" \
11893 "RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
11894 retrieving revision 1\.1
11895 retrieving revision 1\.2
11896 Merging differences between 1\.1 and 1\.2 into cleanme\.txt
11897 rcsmerge: warning: conflicts during merge
11898 ${PROG} update: conflicts found in cleanme\.txt
11900 dotest clean-18 "${testcvs} -q update -C" \
11901 "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
11903 dotest clean-19 "cat .#cleanme.txt.1.1" \
11904 "The usual boring test text\.
11910 rm -rf ${CVSROOT_DIRNAME}/first-dir
11914 # Tests of various ways to define and use modules.
11915 # Roadmap to various modules tests:
11917 # error on incorrect placement: modules
11918 # error combining with other options: modules2-a*
11919 # infinite loops: modules148a1.1 - modules148a1.2
11920 # use to specify a file more than once: modules3
11921 # use with ! feature: modules4
11922 # regular modules: modules, modules2, cvsadm
11923 # ampersand modules: modules2
11925 # -d: modules, modules3, cvsadm
11926 # -i, -o, -u, -e, -t: modules5
11927 # slashes in module names: modules3
11928 # invalid module definitions: modules6
11930 ############################################################
11931 # These tests are to make sure that administrative files get
11932 # rebuilt, regardless of how and where files are checked
11934 ############################################################
11935 # Check out the whole repository
11937 dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/checkoutlist
11938 U CVSROOT/commitinfo
11940 U CVSROOT/cvswrappers
11947 U CVSROOT/verifymsg'
11948 echo "# made a change" >>CVSROOT/modules
11949 dotest modules-1d "${testcvs} -q ci -m add-modules" \
11950 "Checking in CVSROOT/modules;
11951 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
11952 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
11954 ${PROG} commit: Rebuilding administrative file database"
11958 ############################################################
11959 # Check out CVSROOT
11961 dotest modules-2 "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist
11962 U CVSROOT/commitinfo
11964 U CVSROOT/cvswrappers
11971 U CVSROOT/verifymsg'
11972 echo "# made a change" >>CVSROOT/modules
11973 dotest modules-2d "${testcvs} -q ci -m add-modules" \
11974 "Checking in CVSROOT/modules;
11975 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
11976 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
11978 ${PROG} commit: Rebuilding administrative file database"
11982 ############################################################
11983 # Check out CVSROOT in some other directory
11984 mkdir ${CVSROOT_DIRNAME}/somedir
11986 dotest modules-3 "${testcvs} -q co somedir" ''
11988 dotest modules-3d "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist
11989 U CVSROOT/commitinfo
11991 U CVSROOT/cvswrappers
11998 U CVSROOT/verifymsg'
11999 echo "# made a change" >>CVSROOT/modules
12000 dotest modules-3g "${testcvs} -q ci -m add-modules" \
12001 "Checking in CVSROOT/modules;
12002 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
12003 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12005 ${PROG} commit: Rebuilding administrative file database"
12008 rm -rf ${CVSROOT_DIRNAME}/somedir
12009 ############################################################
12010 # end rebuild tests
12011 ############################################################
12014 mkdir ${CVSROOT_DIRNAME}/first-dir
12019 dotest modules-143 "${testcvs} -q co first-dir" ""
12023 dotest modules-143a "${testcvs} add subdir" \
12024 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
12028 dotest modules-143b "${testcvs} add ssdir" \
12029 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
12033 dotest modules-144 "${testcvs} add a b" \
12034 "${PROG} add: scheduling file .a. for addition
12035 ${PROG} add: scheduling file .b. for addition
12036 ${PROG} add: use .${PROG} commit. to add these files permanently"
12038 dotest modules-145 "${testcvs} ci -m added" \
12039 "${PROG} [a-z]*: Examining .
12040 ${PROG} [a-z]*: Examining ssdir
12041 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/a,v
12044 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
12045 initial revision: 1\.1
12047 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/b,v
12050 ${CVSROOT_DIRNAME}/first-dir/subdir/b,v <-- b
12051 initial revision: 1\.1
12055 dotest modules-146 "${testcvs} -q co CVSROOT" \
12056 "U CVSROOT/checkoutlist
12057 U CVSROOT/commitinfo
12059 U CVSROOT/cvswrappers
12066 U CVSROOT/verifymsg"
12068 # Here we test that CVS can deal with CVSROOT (whose repository
12069 # is at top level) in the same directory as subdir (whose repository
12070 # is a subdirectory of first-dir). TODO: Might want to check that
12071 # files can actually get updated in this state.
12072 dotest modules-147 "${testcvs} -q update" ""
12074 cat >CVSROOT/modules <<EOF
12075 realmodule first-dir/subdir a
12076 dirmodule first-dir/subdir
12077 namedmodule -d nameddir first-dir/subdir
12078 aliasmodule -a first-dir/subdir/a
12079 aliasnested -a first-dir/subdir/ssdir
12080 topfiles -a first-dir/file1 first-dir/file2
12082 statusmod -s Mungeable
12083 # Check for ability to block infinite loops.
12084 infinitealias -a infinitealias
12085 # Prior to 1.11.12 & 1.12.6, the infinite alias loop check didn't strip
12086 # slashes or work if a module called a module which then called itself
12087 # (A -> A was blocked, but not A -> B -> A or deeper).
12088 infinitealias2 -a infinitealias2/
12089 infinitealias3 -a infinitealias4/
12090 infinitealias4 -a aliasmodule infinitealias5
12091 infinitealias5 -a infinitealias3/
12092 # Options must come before arguments. It is possible this should
12093 # be relaxed at some point (though the result would be bizarre for
12094 # -a); for now test the current behavior.
12095 bogusalias first-dir/subdir/a -a
12097 dotest modules-148 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
12098 "Checking in CVSROOT/modules;
12099 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
12100 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12102 ${PROG} commit: Rebuilding administrative file database"
12105 # The "statusmod" module contains an error; trying to use it
12106 # will produce "modules file missing directory" I think.
12107 # However, that shouldn't affect the ability of "cvs co -c" or
12108 # "cvs co -s" to do something reasonable with it.
12109 dotest modules-148a0 "${testcvs} co -c" 'aliasmodule -a first-dir/subdir/a
12110 aliasnested -a first-dir/subdir/ssdir
12111 bogusalias first-dir/subdir/a -a
12112 dirmodule first-dir/subdir
12113 infinitealias -a infinitealias
12114 infinitealias2 -a infinitealias2/
12115 infinitealias3 -a infinitealias4/
12116 infinitealias4 -a aliasmodule infinitealias5
12117 infinitealias5 -a infinitealias3/
12118 namedmodule -d nameddir first-dir/subdir
12119 realmodule first-dir/subdir a
12120 statusmod -s Mungeable
12121 topfiles -a first-dir/file1 first-dir/file2
12123 # There is code in modules.c:save_d which explicitly skips
12124 # modules defined with -a, which is why aliasmodule is not
12126 dotest modules-148a1 "${testcvs} co -s" \
12127 'statusmod Mungeable
12128 bogusalias NONE first-dir/subdir/a -a
12129 dirmodule NONE first-dir/subdir
12130 namedmodule NONE first-dir/subdir
12131 realmodule NONE first-dir/subdir a'
12133 # Check that infinite loops are avoided
12134 dotest modules-148a1.1 "${testcvs} co infinitealias" \
12135 "$PROG checkout: module \`infinitealias' in modules file contains infinite loop" \
12136 "$PROG server: module \`infinitealias' in modules file contains infinite loop
12137 $PROG checkout: module \`infinitealias' in modules file contains infinite loop"
12138 # Prior to 1.11.12 & 1.12.6, the inifinte alias loop check did not
12140 dotest modules-148a1.2 "${testcvs} co infinitealias2" \
12141 "$PROG checkout: module \`infinitealias2' in modules file contains infinite loop" \
12142 "$PROG server: module \`infinitealias2' in modules file contains infinite loop
12143 $PROG checkout: module \`infinitealias2' in modules file contains infinite loop"
12144 # Prior to 1.11.12 & 1.12.6, the inifinte alias loop check did not
12145 # notice when A -> B -> A, it only noticed A -> A.
12146 dotest modules-148a1.3 "${testcvs} co infinitealias3/" \
12147 "$PROG checkout: module \`infinitealias3' in modules file contains infinite loop" \
12148 "$PROG server: module \`infinitealias3' in modules file contains infinite loop
12149 $PROG checkout: module \`infinitealias3' in modules file contains infinite loop"
12151 # Test that real modules check out to realmodule/a, not subdir/a.
12152 dotest modules-149a1 "${testcvs} co realmodule" "U realmodule/a"
12153 dotest modules-149a2 "test -d realmodule && test -f realmodule/a" ""
12154 dotest_fail modules-149a3 "test -f realmodule/b" ""
12155 dotest modules-149a4 "${testcvs} -q co realmodule" ""
12156 dotest modules-149a5 "echo yes | ${testcvs} release -d realmodule" \
12157 "You have \[0\] altered files in this repository\.
12158 Are you sure you want to release (and delete) directory .realmodule.: "
12160 dotest_fail modules-149b1 "${testcvs} co realmodule/a" \
12161 "${PROG}"' checkout: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
12162 "${PROG}"' server: module `realmodule/a'\'' is a request for a file in a module which is not a directory
12163 '"${PROG}"' \[checkout aborted\]: cannot expand modules'
12165 # Now test the ability to check out a single file from a directory
12166 dotest modules-150c "${testcvs} co dirmodule/a" "U dirmodule/a"
12167 dotest modules-150d "test -d dirmodule && test -f dirmodule/a" ""
12168 dotest_fail modules-150e "test -f dirmodule/b" ""
12169 dotest modules-150f "echo yes | ${testcvs} release -d dirmodule" \
12170 "You have \[0\] altered files in this repository\.
12171 Are you sure you want to release (and delete) directory .dirmodule.: "
12172 # Now test the ability to correctly reject a non-existent filename.
12173 # For maximum studliness we would check that an error message is
12175 # We accept a zero exit status because it is what CVS does
12176 # (Dec 95). Probably the exit status should be nonzero,
12178 dotest modules-150g1 "${testcvs} co dirmodule/nonexist" \
12179 "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared"
12180 # We tolerate the creation of the dirmodule directory, since that
12181 # is what CVS does, not because we view that as preferable to not
12183 dotest_fail modules-150g2 "test -f dirmodule/a || test -f dirmodule/b" ""
12186 # Now test that a module using -d checks out to the specified
12188 dotest modules-150h1 "${testcvs} -q co namedmodule" \
12191 dotest modules-150h2 "test -f nameddir/a && test -f nameddir/b" ""
12192 echo add line >>nameddir/a
12193 dotest modules-150h3 "${testcvs} -q co namedmodule" 'M nameddir/a'
12195 dotest modules-150h4 "${testcvs} -q co namedmodule" 'U nameddir/a'
12196 dotest modules-150h99 "echo yes | ${testcvs} release -d nameddir" \
12197 "You have \[0\] altered files in this repository\.
12198 Are you sure you want to release (and delete) directory .nameddir.: "
12200 # Now test that alias modules check out to subdir/a, not
12202 dotest modules-151 "${testcvs} co aliasmodule" ""
12203 dotest_fail modules-152 "test -d aliasmodule" ""
12204 echo abc >>first-dir/subdir/a
12205 dotest modules-153 "${testcvs} -q co aliasmodule" "M first-dir/subdir/a"
12212 dotest modules-155a0 "${testcvs} co aliasnested" \
12213 "${PROG} checkout: Updating first-dir/subdir/ssdir"
12214 dotest modules-155a1 "test -d first-dir" ''
12215 dotest modules-155a2 "test -d first-dir/subdir" ''
12216 dotest modules-155a3 "test -d first-dir/subdir/ssdir" ''
12217 # Test that nothing extraneous got created.
12218 dotest modules-155a4 "ls" "first-dir" \
12224 # Test checking out everything.
12227 dotest modules-155b "${testcvs} -q co world" \
12228 "U CVSROOT/${DOTSTAR}
12229 U first-dir/subdir/a
12230 U first-dir/subdir/b"
12234 # Test checking out a module which lists at least two
12235 # specific files twice. At one time, this failed over
12239 dotest modules-155c1 "${testcvs} -q co first-dir" \
12240 "U first-dir/subdir/a
12241 U first-dir/subdir/b"
12244 echo 'first revision' > file1
12245 echo 'first revision' > file2
12246 dotest modules-155c2 "${testcvs} add file1 file2" \
12247 "${PROG}"' add: scheduling file `file1'\'' for addition
12248 '"${PROG}"' add: scheduling file `file2'\'' for addition
12249 '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
12250 dotest modules-155c3 "${testcvs} -q ci -m add-it" \
12251 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
12254 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
12255 initial revision: 1\.1
12257 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
12260 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
12261 initial revision: 1\.1
12266 dotest modules-155c4 "${testcvs} -q co topfiles" \
12269 dotest modules-155c5 "${testcvs} -q co topfiles" ""
12271 # Make sure the right thing happens if we remove a file.
12273 dotest modules-155c6 "${testcvs} -q rm -f file1" \
12274 "${PROG} remove: use .${PROG} commit. to remove this file permanently"
12275 dotest modules-155c7 "${testcvs} -q ci -m remove-it" \
12277 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
12278 new revision: delete; previous revision: 1\.1
12282 dotest modules-155c8 "${testcvs} -q co topfiles" \
12283 "${PROG} checkout: warning: first-dir/file1 is not (any longer) pertinent
12289 rm -rf ${CVSROOT_DIRNAME}/first-dir
12293 # More tests of modules, in particular the & feature.
12295 dotest modules2-setup-1 "${testcvs} -q co -l ." ''
12296 mkdir first-dir second-dir third-dir
12297 dotest modules2-setup-2 \
12298 "${testcvs} add first-dir second-dir third-dir" \
12299 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
12300 Directory ${CVSROOT_DIRNAME}/second-dir added to the repository
12301 Directory ${CVSROOT_DIRNAME}/third-dir added to the repository"
12304 dotest modules2-setup-3 "${testcvs} add file3" \
12305 "${PROG} add: scheduling file .file3. for addition
12306 ${PROG} add: use .${PROG} commit. to add this file permanently"
12307 dotest modules2-setup-4 "${testcvs} -q ci -m add file3" \
12308 "RCS file: ${CVSROOT_DIRNAME}/third-dir/file3,v
12311 ${CVSROOT_DIRNAME}/third-dir/file3,v <-- file3
12312 initial revision: 1\.1
12320 dotest modules2-1 "${testcvs} -q co CVSROOT/modules" \
12321 'U CVSROOT/modules'
12323 cat >> modules << EOF
12324 ampermodule &first-dir &second-dir
12325 combmodule third-dir file3 &first-dir
12326 ampdirmod -d newdir &first-dir &second-dir
12328 messymod first-dir &messymodchild
12329 messymodchild -d sdir/child second-dir
12331 # Depending on whether the user also ran the modules test
12332 # we will be checking in revision 1.2 or 1.3.
12333 dotest modules2-2 "${testcvs} -q ci -m add-modules" \
12334 "Checking in modules;
12335 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
12336 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12338 ${PROG} commit: Rebuilding administrative file database"
12342 dotest modules2-3 "${testcvs} -q co ampermodule" ''
12343 dotest modules2-4 "test -d ampermodule/first-dir" ''
12344 dotest modules2-5 "test -d ampermodule/second-dir" ''
12346 # Test ability of cvs release to handle multiple arguments
12347 # See comment at "release" for list of other cvs release tests.
12349 if ${testcvs} release -d first-dir second-dir <<EOF >>${LOGFILE}
12358 dotest_fail modules2-7 "test -d first-dir" ''
12359 dotest_fail modules2-8 "test -d second-dir" ''
12363 # There used to be a nasty-hack that made CVS skip creation of the
12364 # module dir (in this case ampermodule) when -n was specified
12365 dotest modules2-ampermod-1 "${testcvs} -q co -n ampermodule" ''
12366 dotest modules2-ampermod-2 "test -d ampermodule/first-dir" ''
12367 dotest modules2-ampermod-3 "test -d ampermodule/second-dir" ''
12369 # Test release of a module
12370 if echo yes |${testcvs} release -d ampermodule >>${LOGFILE}; then
12371 pass modules2-ampermod-release-1
12373 fail modules2-ampermod-release-1
12375 dotest_fail modules2-ampermod-release-2 "test -d ampermodule" ''
12377 # and the '-n' test again, but in conjunction with '-d'
12378 dotest modules2-ampermod-4 "${testcvs} -q co -n -d newname ampermodule" ''
12379 dotest modules2-ampermod-5 "test -d newname/first-dir" ''
12380 dotest modules2-ampermod-6 "test -d newname/second-dir" ''
12383 # Now we create another directory named first-dir and make
12384 # sure that CVS doesn't get them mixed up.
12386 # Note that this message should say "Updating ampermodule/first-dir"
12387 # I suspect. This is a long-standing behavior/bug....
12388 dotest modules2-9 "${testcvs} co ampermodule" \
12389 "${PROG} checkout: Updating first-dir
12390 ${PROG} checkout: Updating second-dir"
12391 touch ampermodule/first-dir/amper1
12393 dotest modules2-10 "${testcvs} add first-dir/amper1" \
12394 "${PROG} add: scheduling file .first-dir/amper1. for addition
12395 ${PROG} add: use .${PROG} commit. to add this file permanently"
12398 # As with the "Updating xxx" message, the "U first-dir/amper1"
12399 # message (instead of "U ampermodule/first-dir/amper1") is
12401 dotest modules2-12 "${testcvs} co ampermodule" \
12402 "${PROG} checkout: Updating first-dir
12404 ${PROG} checkout: Updating second-dir"
12407 dotest modules2-13 "${testcvs} -q ci -m add-it ampermodule" \
12408 "RCS file: ${CVSROOT_DIRNAME}/first-dir/amper1,v
12410 Checking in ampermodule/first-dir/amper1;
12411 ${CVSROOT_DIRNAME}/first-dir/amper1,v <-- amper1
12412 initial revision: 1\.1
12415 # Trying this as above led to a "protocol error" message.
12416 # Work around this bug.
12418 dotest modules2-13 "${testcvs} -q ci -m add-it" \
12419 "RCS file: ${CVSROOT_DIRNAME}/first-dir/amper1,v
12421 Checking in first-dir/amper1;
12422 ${CVSROOT_DIRNAME}/first-dir/amper1,v <-- amper1
12423 initial revision: 1\.1
12430 # Now test the "combmodule" module (combining regular modules
12431 # and ampersand modules in the same module definition).
12433 dotest modules2-14 "${testcvs} co combmodule" \
12434 "U combmodule/file3
12435 ${PROG} checkout: Updating first-dir
12436 U first-dir/amper1"
12437 dotest modules2-15 "test -f combmodule/file3" ""
12438 dotest modules2-16 "test -f combmodule/first-dir/amper1" ""
12441 # At least for now there is no way to tell CVS that
12442 # some files/subdirectories come from one repository directory,
12443 # and others from another.
12444 # This seems like a pretty sensible behavior to me, in the
12445 # sense that first-dir doesn't "really" exist within
12446 # third-dir, so CVS just acts as if there is nothing there
12448 dotest modules2-17 "${testcvs} update -d" \
12449 "${PROG} update: Updating \."
12452 dotest modules2-18 "${testcvs} -q co combmodule" \
12453 "U first-dir/amper1"
12454 dotest modules2-19 "test -f combmodule/first-dir/amper1" ""
12458 # Now test the "ampdirmod" and "badmod" modules to be sure that
12459 # options work with ampersand modules but don't prevent the
12460 # "missing directory" error message.
12462 dotest modules2-20 "${testcvs} co ampdirmod" \
12463 "${PROG} checkout: Updating first-dir
12465 ${PROG} checkout: Updating second-dir"
12466 dotest modules2-21 "test -f newdir/first-dir/amper1" ""
12467 dotest modules2-22 "test -d newdir/second-dir" ""
12468 dotest_fail modules2-23 "${testcvs} co badmod" \
12469 "${PROG} checkout: modules file missing directory for module badmod" \
12470 "${PROG} server: modules file missing directory for module badmod
12471 ${PROG} \[checkout aborted\]: cannot expand modules"
12475 # Confirm that a rename with added depth nested in an ampersand
12478 dotest modules2-nestedrename-1 "${testcvs} -q co messymod" \
12479 "U messymod/amper1"
12480 dotest modules2-nestedrename-2 "test -d messymod/sdir" ''
12481 dotest modules2-nestedrename-3 "test -d messymod/sdir/CVS" ''
12482 dotest modules2-nestedrename-4 "test -d messymod/sdir/child" ''
12483 dotest modules2-nestedrename-5 "test -d messymod/sdir/child/CVS" ''
12486 # FIXME: client/server has a bug. It should be working like a local
12487 # repository in this case, but fails to check out the second module
12488 # in the list when a branch is specified.
12490 dotest modules2-ampertag-setup-1 \
12491 "${testcvs} -Q rtag tag first-dir second-dir third-dir" \
12493 dotest modules2-ampertag-1 "${testcvs} -q co -rtag ampermodule" \
12494 "U first-dir/amper1"
12496 dotest_fail modules2-ampertag-2 "test -d ampermodule/second-dir" ''
12497 dotest_fail modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
12499 dotest modules2-ampertag-2 "test -d ampermodule/second-dir" ''
12500 dotest modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
12504 # Test for tag files when an ampermod is renamed with more path
12505 # elements than it started with.
12507 # FIXME: This is currently broken in the remote case, possibly only
12508 # because the messymodchild isn't being checked out at all.
12510 # dotest modules2-tagfiles-setup-1 \
12511 #"${testcvs} -Q rtag -b branch first-dir second-dir" \
12513 dotest modules2-tagfiles-1 "${testcvs} -q co -rtag messymod" \
12514 "U messymod/amper1"
12516 dotest_fail modules2-tagfiles-2r "test -d messymod/sdir" ''
12518 dotest modules2-tagfiles-2 "cat messymod/sdir/CVS/Tag" 'Ttag'
12522 # Test that CVS gives an error if one combines -a with
12524 # Probably would be better to break this out into a separate
12525 # test. Although it is short, it shares no files/state with
12526 # the rest of the modules2 tests.
12528 dotest modules2-a0.5 "${testcvs} -q co CVSROOT/modules" \
12529 'U CVSROOT/modules'
12531 echo 'aliasopt -a -d onedir first-dir' >modules
12532 dotest modules2-a0 "${testcvs} -q ci -m add-modules" \
12533 "Checking in modules;
12534 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
12535 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12537 ${PROG} commit: Rebuilding administrative file database"
12539 dotest_fail modules2-a1 "${testcvs} -q co aliasopt" \
12540 "${PROG} checkout: -a cannot be specified in the modules file along with other options" \
12541 "${PROG} server: -a cannot be specified in the modules file along with other options
12542 ${PROG} \[checkout aborted\]: cannot expand modules"
12546 rm -rf ${CVSROOT_DIRNAME}/first-dir
12547 rm -rf ${CVSROOT_DIRNAME}/second-dir
12548 rm -rf ${CVSROOT_DIRNAME}/third-dir
12552 # More tests of modules, in particular what happens if several
12553 # modules point to the same file.
12555 # First just set up a directory first-dir and a file file1 in it.
12558 dotest modules3-0 "${testcvs} -q co -l ." ''
12560 dotest modules3-1 "${testcvs} add first-dir" \
12561 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
12565 dotest modules3-2 "${testcvs} add file1" \
12566 "${PROG} add: scheduling file \`file1' for addition
12567 ${PROG} add: use '${PROG} commit' to add this file permanently"
12568 dotest modules3-3 "${testcvs} -q ci -m add-it" \
12569 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
12572 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
12573 initial revision: 1\.1
12577 dotest modules3-4 "${testcvs} -q update -d CVSROOT" \
12578 "U CVSROOT${DOTSTAR}"
12581 mod1 -a first-dir/file1
12582 bigmod -a mod1 first-dir/file1
12583 namednest -d src/sub/dir first-dir
12584 nestdeeper -d src/sub1/sub2/sub3/dir first-dir
12585 nestshallow -d src/dir second-dir/suba/subb
12586 path/in/modules &mod1
12587 another/path/test -d another/path/test first-dir
12589 dotest modules3-5 "${testcvs} -q ci -m add-modules" \
12590 "Checking in modules;
12591 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
12592 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12594 ${PROG} commit: Rebuilding administrative file database"
12597 dotest modules3-6 "${testcvs} -q co bigmod" ''
12599 dotest modules3-7 "${testcvs} -q co bigmod" 'U first-dir/file1'
12606 # This fails to work remote (it doesn't notice the directories,
12607 # I suppose because they contain no files). Bummer, especially
12608 # considering this is a documented technique and everything.
12609 dotest modules3-7a \
12610 "${testcvs} import -m add-dirs second-dir tag1 tag2" \
12611 "${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/suba
12612 ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/suba/subb
12614 No conflicts created by this import" "
12615 No conflicts created by this import"
12618 dotest modules3-7b "${testcvs} co second-dir" \
12619 "${PROG} checkout: Updating second-dir
12620 ${PROG} checkout: Updating second-dir/suba
12621 ${PROG} checkout: Updating second-dir/suba/subb" \
12622 "${PROG} checkout: Updating second-dir"
12627 dotest modules3-7-workaround1 "${testcvs} add suba" \
12628 "Directory ${CVSROOT_DIRNAME}/second-dir/suba added to the repository"
12631 dotest modules3-7-workaround2 "${testcvs} add subb" \
12632 "Directory ${CVSROOT_DIRNAME}/second-dir/suba/subb added to the repository"
12636 cd second-dir/suba/subb
12638 dotest modules3-7c "${testcvs} add fileb" \
12639 "${PROG} add: scheduling file .fileb. for addition
12640 ${PROG} add: use .${PROG} commit. to add this file permanently"
12641 dotest modules3-7d "${testcvs} -q ci -m add-it" \
12642 "RCS file: ${CVSROOT_DIRNAME}/second-dir/suba/subb/fileb,v
12645 ${CVSROOT_DIRNAME}/second-dir/suba/subb/fileb,v <-- fileb
12646 initial revision: 1\.1
12653 dotest modules3-8 "${testcvs} -q co namednest" \
12654 'U src/sub/dir/file1'
12655 dotest modules3-9 "test -f src/sub/dir/file1" ''
12659 # Try the same thing, but with the directories nested even
12660 # deeper (deeply enough so they are nested more deeply than
12661 # the number of directories from / to ${TESTDIR}).
12664 dotest modules3-10 "${testcvs} -q co nestdeeper" \
12665 'U src/sub1/sub2/sub3/dir/file1'
12666 dotest modules3-11 "test -f src/sub1/sub2/sub3/dir/file1" ''
12668 # While we are doing things like twisted uses of '/' (e.g.
12669 # modules3-12), try this one.
12671 dotest_fail modules3-11b \
12672 "${testcvs} -q update ${TESTDIR}/1/src/sub1/sub2/sub3/dir/file1" \
12673 "absolute pathname .${TESTDIR}/1/src/sub1/sub2/sub3/dir. illegal for server"
12674 fi # end of remote-only tests
12679 # This one is almost too twisted for words. The pathname output
12680 # in the message from "co" doesn't include the "path/in/modules",
12681 # but those directories do get created (with no CVSADM except
12682 # in "modules" which has a CVSNULLREPOS).
12683 # I'm not sure anyone is relying on this nonsense or whether we
12684 # need to keep doing it, but it is what CVS currently does...
12685 # Skip it for remote; the remote code has the good sense to
12686 # not deal with it (on the minus side it gives
12687 # "internal error: repository string too short." (CVS 1.9) or
12688 # "warning: server is not creating directories one at a time" (now)
12689 # instead of a real error).
12690 # I'm tempted to just make it a fatal error to have '/' in a
12691 # module name. But see comments at modules3-16.
12692 if $remote; then :; else
12694 dotest modules3-12 "${testcvs} -q co path/in/modules" \
12695 "U first-dir/file1"
12696 dotest modules3-13 "test -f path/in/modules/first-dir/file1" ''
12698 fi # end of tests skipped for remote
12700 # Now here is where it used to get seriously bogus.
12702 dotest modules3-14 \
12703 "${testcvs} -q rtag tag1 path/in/modules" ''
12704 # CVS used to create this even though rtag should *never* affect
12705 # the directory current when it is called!
12706 dotest_fail modules3-15 "test -d path/in/modules" ''
12707 # Just for trivia's sake, rdiff was not similarly vulnerable
12708 # because it passed 0 for run_module_prog to do_module.
12711 # Some people seem to want this to work. I still suspect there
12712 # are dark corners in slashes in module names. This probably wants
12713 # more thought before we start hacking on CVS (one way or the other)
12714 # or documenting this.
12716 dotest modules3-16 "${testcvs} -q co another/path/test" \
12717 "U another/path/test/file1"
12718 dotest modules3-17 "cat another/path/test/file1" 'file1'
12721 rm -rf ${CVSROOT_DIRNAME}/first-dir
12722 rm -rf ${CVSROOT_DIRNAME}/second-dir
12726 # Some tests using the modules file with aliases that
12727 # exclude particular directories.
12731 dotest modules4-1 "${testcvs} -q co -l ." ''
12733 dotest modules4-2 "${testcvs} add first-dir" \
12734 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
12737 mkdir subdir subdir_long
12738 dotest modules4-3 "${testcvs} add subdir subdir_long" \
12739 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository
12740 Directory ${CVSROOT_DIRNAME}/first-dir/subdir_long added to the repository"
12743 dotest modules4-4 "${testcvs} add file1" \
12744 "${PROG}"' add: scheduling file `file1'\'' for addition
12745 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
12747 echo file2 > subdir/file2
12748 dotest modules4-5 "${testcvs} add subdir/file2" \
12749 "${PROG}"' add: scheduling file `subdir/file2'\'' for addition
12750 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
12752 echo file3 > subdir_long/file3
12753 dotest modules4-6 "${testcvs} add subdir_long/file3" \
12754 "${PROG}"' add: scheduling file `subdir_long/file3'\'' for addition
12755 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
12757 dotest modules4-7 "${testcvs} -q ci -m add-it" \
12758 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
12761 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
12762 initial revision: 1\.1
12764 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
12766 Checking in subdir/file2;
12767 ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v <-- file2
12768 initial revision: 1\.1
12770 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir_long/file3,v
12772 Checking in subdir_long/file3;
12773 ${CVSROOT_DIRNAME}/first-dir/subdir_long/file3,v <-- file3
12774 initial revision: 1\.1
12779 dotest modules4-8 "${testcvs} -q update -d CVSROOT" \
12780 "U CVSROOT${DOTSTAR}"
12784 some -a !first-dir/subdir first-dir
12785 other -a !first-dir/subdir !first-dir/subdir_long first-dir
12786 somewhat -a first-dir !first-dir/subdir
12788 dotest modules4-9 "${testcvs} -q ci -m add-modules" \
12789 "Checking in modules;
12790 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
12791 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12793 ${PROG} commit: Rebuilding administrative file database"
12799 dotest modules4-10 "${testcvs} -q co all" \
12801 U first-dir/subdir/file2
12802 U first-dir/subdir_long/file3"
12805 dotest modules4-11 "${testcvs} -q co some" \
12807 U first-dir/subdir_long/file3"
12808 dotest_fail modules4-12 "test -d first-dir/subdir" ''
12809 dotest modules4-13 "test -d first-dir/subdir_long" ''
12813 # But remote seems to do it the other way.
12814 dotest modules4-14r-1 "${testcvs} -q co somewhat" \
12816 U first-dir/subdir_long/file3"
12817 dotest_fail modules4-14r-2 "test -d first-dir/subdir" ''
12818 dotest modules4-14r-3 "test -d first-dir/subdir_long" ''
12820 # This is strange behavior, in that the order of the
12821 # "!first-dir/subdir" and "first-dir" matter, and it isn't
12822 # clear that they should. I suspect it is long-standing
12823 # strange behavior but I haven't verified that.
12824 dotest modules4-14-1 "${testcvs} -q co somewhat" \
12826 U first-dir/subdir/file2
12827 U first-dir/subdir_long/file3"
12828 dotest modules4-14-2 "test -d first-dir/subdir" ''
12829 dotest modules4-14-3 "test -d first-dir/subdir_long" ''
12833 dotest modules4-15 "${testcvs} -q co other" \
12834 "U first-dir/file1"
12835 dotest_fail modules4-16 "test -d first-dir/subdir" ''
12836 dotest_fail modules4-17 "test -d first-dir/subdir_long" ''
12842 dotest modules4-18 "${testcvs} rtag tag some" \
12843 "${PROG} rtag: Tagging first-dir
12844 ${PROG} rtag: Ignoring first-dir/subdir
12845 ${PROG} rtag: Tagging first-dir/subdir_long"
12847 cd 1/first-dir/subdir
12848 dotest modules4-19 "${testcvs} log file2" "
12849 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
12850 Working file: file2
12856 keyword substitution: kv
12857 total revisions: 1; selected revisions: 1
12859 ----------------------------
12861 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
12863 ============================================================================="
12866 echo Keeping $TESTDIR and exiting due to --keep
12873 rm -rf ${CVSROOT_DIRNAME}/first-dir
12877 # Test module programs
12879 mkdir ${CVSROOT_DIRNAME}/first-dir
12882 dotest modules5-1 "${testcvs} -q co first-dir" ""
12885 dotest modules5-2 "${testcvs} add subdir" \
12886 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
12889 dotest modules5-3 "${testcvs} add ssdir" \
12890 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
12892 dotest modules5-4 "${testcvs} add a b" \
12893 "${PROG} add: scheduling file .a. for addition
12894 ${PROG} add: scheduling file .b. for addition
12895 ${PROG} add: use .${PROG} commit. to add these files permanently"
12897 dotest modules5-5 "${testcvs} ci -m added" \
12898 "${PROG} [a-z]*: Examining .
12899 ${PROG} [a-z]*: Examining ssdir
12900 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/a,v
12903 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
12904 initial revision: 1\.1
12906 RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/b,v
12909 ${CVSROOT_DIRNAME}/first-dir/subdir/b,v <-- b
12910 initial revision: 1\.1
12914 dotest modules5-6 "${testcvs} -q co CVSROOT" \
12915 "U CVSROOT/checkoutlist
12916 U CVSROOT/commitinfo
12918 U CVSROOT/cvswrappers
12925 U CVSROOT/verifymsg"
12927 # FIXCVS: The sleep in the following script helps avoid out of
12928 # order messages, but we really need to figure out how to fix
12929 # cvs to prevent them in the first place.
12930 for i in checkout export tag; do
12931 cat >> ${CVSROOT_DIRNAME}/$i.sh <<EOF
12934 echo "$i script invoked in \`pwd\`"
12937 # Cygwin doesn't set premissions correctly over the Samba share.
12938 if test -n "$remotehost"; then
12939 $CVS_RSH $remotehost "chmod +x ${CVSROOT_DIRNAME}/$i.sh"
12941 chmod +x ${CVSROOT_DIRNAME}/$i.sh
12945 OPTS="-o${CVSROOT_DIRNAME}/checkout.sh -e ${CVSROOT_DIRNAME}/export.sh -t${CVSROOT_DIRNAME}/tag.sh"
12946 cat >CVSROOT/modules <<EOF
12947 realmodule ${OPTS} first-dir/subdir a
12948 dirmodule ${OPTS} first-dir/subdir
12949 namedmodule -d nameddir ${OPTS} first-dir/subdir
12952 dotest modules5-7 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
12954 "Checking in CVSROOT/modules;
12955 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
12956 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12958 ${PROG} commit: Rebuilding administrative file database"
12963 # Test that real modules check out to realmodule/a, not subdir/a.
12966 # Mac OSX 10.3 (Darwin ppc-osx1 5.5) fails here when $TMPDIR
12967 # contains a symlink (it does not fail the local modules5-8).
12968 # Since no other platforms are exhibiting the same problem, I
12969 # suspect an issue with OSX and fork() or the like dereferencing
12970 # the symlink, but it is possible it is something that could be
12971 # fixed or worked around in CVS.
12972 dotest modules5-8r "$testcvs co realmodule" \
12974 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
12975 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
12978 dotest modules5-8 "${testcvs} co realmodule" \
12980 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
12981 checkout script invoked in ${TESTDIR}/1
12984 dotest modules5-9 "test -d realmodule && test -f realmodule/a" ""
12985 dotest_fail modules5-10 "test -f realmodule/b" ""
12987 dotest modules5-11 "${testcvs} -q co realmodule" \
12988 "checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
12990 dotest modules5-12 "${testcvs} -q update" ''
12991 echo "change" >>realmodule/a
12992 dotest modules5-13 "${testcvs} -q ci -m." \
12993 "Checking in realmodule/a;
12994 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
12995 new revision: 1\.2; previous revision: 1\.1
12998 dotest modules5-11 "${testcvs} -q co realmodule" \
12999 "checkout script invoked in ${TESTDIR}/1
13001 dotest modules5-12 "${testcvs} -q update" ''
13002 echo "change" >>realmodule/a
13003 dotest modules5-13 "${testcvs} -q ci -m." \
13004 "Checking in realmodule/a;
13005 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
13006 new revision: 1\.2; previous revision: 1\.1
13009 dotest modules5-14 "echo yes | ${testcvs} release -d realmodule" \
13010 "You have \[0\] altered files in this repository\.
13011 Are you sure you want to release (and delete) directory .realmodule.: "
13012 dotest modules5-15 "${testcvs} -q rtag -Dnow MYTAG realmodule" \
13013 "tag script invoked in ${TESTDIR}/1
13014 args: realmodule MYTAG" \
13015 "tag script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13016 args: realmodule MYTAG"
13018 dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
13020 export script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13023 dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
13025 export script invoked in ${TESTDIR}/1
13030 dotest_fail modules5-17 "${testcvs} co realmodule/a" \
13031 "${PROG}"' checkout: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
13032 "${PROG}"' server: module `realmodule/a'\'' is a request for a file in a module which is not a directory
13033 '"${PROG}"' \[checkout aborted\]: cannot expand modules'
13035 # Now test the ability to check out a single file from a directory
13037 dotest modules5-18 "${testcvs} co dirmodule/a" \
13039 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
13040 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13043 dotest modules5-18 "${testcvs} co dirmodule/a" \
13045 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
13046 checkout script invoked in ${TESTDIR}/1
13049 dotest modules5-19 "test -d dirmodule && test -f dirmodule/a" ""
13050 dotest_fail modules5-20 "test -f dirmodule/b" ""
13051 dotest modules5-21 "echo yes | ${testcvs} release -d dirmodule" \
13052 "You have \[0\] altered files in this repository\.
13053 Are you sure you want to release (and delete) directory .dirmodule.: "
13055 # Now test the ability to correctly reject a non-existent filename.
13056 # For maximum studliness we would check that an error message is
13058 # We accept a zero exit status because it is what CVS does
13059 # (Dec 95). Probably the exit status should be nonzero,
13062 dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
13063 "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared
13064 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
13065 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13068 dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
13069 "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared
13070 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
13071 checkout script invoked in ${TESTDIR}/1
13074 # We tolerate the creation of the dirmodule directory, since that
13075 # is what CVS does, not because we view that as preferable to not
13077 dotest_fail modules5-23 "test -f dirmodule/a || test -f dirmodule/b" ""
13080 # Now test that a module using -d checks out to the specified
13083 dotest modules5-24 "${testcvs} -q co namedmodule" \
13086 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13089 dotest modules5-24 "${testcvs} -q co namedmodule" \
13092 checkout script invoked in ${TESTDIR}/1
13095 dotest modules5-25 "test -f nameddir/a && test -f nameddir/b" ""
13096 echo add line >>nameddir/a
13097 # This seems suspicious: when we checkout an existing directory,
13098 # the checkout script gets executed in addition to the update
13099 # script. Is that by design or accident?
13101 dotest modules5-26 "${testcvs} -q co namedmodule" \
13103 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13106 dotest modules5-26 "${testcvs} -q co namedmodule" \
13108 checkout script invoked in ${TESTDIR}/1
13114 dotest modules5-27 "${testcvs} -q co namedmodule" \
13116 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13119 dotest modules5-27 "${testcvs} -q co namedmodule" \
13121 checkout script invoked in ${TESTDIR}/1
13124 dotest modules5-28 "echo yes | ${testcvs} release -d nameddir" \
13125 "You have \[0\] altered files in this repository\.
13126 Are you sure you want to release (and delete) directory .nameddir.: "
13128 # Now try the same tests with -d on command line
13129 # FIXCVS? The manual says the modules programs get the module name,
13130 # but they really get the directory name.
13132 dotest modules5-29 "${testcvs} co -d mydir realmodule" \
13134 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13135 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13138 dotest modules5-29 "${testcvs} co -d mydir realmodule" \
13140 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13141 checkout script invoked in ${TESTDIR}/1
13144 dotest modules5-30 "test -d mydir && test -f mydir/a" ""
13145 dotest_fail modules5-31 "test -d realmodule || test -f mydir/b" ""
13147 dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \
13148 "checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13150 dotest modules5-33 "${testcvs} -q update" ''
13151 echo "change" >>mydir/a
13152 dotest modules5-34 "${testcvs} -q ci -m." \
13153 "Checking in mydir/a;
13154 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
13155 new revision: 1\.3; previous revision: 1\.2
13158 dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \
13159 "checkout script invoked in ${TESTDIR}/1
13161 dotest modules5-33 "${testcvs} -q update" ''
13162 echo "change" >>mydir/a
13163 dotest modules5-34 "${testcvs} -q ci -m." \
13164 "Checking in mydir/a;
13165 ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
13166 new revision: 1\.3; previous revision: 1\.2
13169 dotest modules5-35 "echo yes | ${testcvs} release -d mydir" \
13170 "You have \[0\] altered files in this repository\.
13171 Are you sure you want to release (and delete) directory .mydir.: "
13173 dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \
13174 "tag script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13175 args: realmodule MYTAG2"
13176 dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \
13178 export script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13181 dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \
13182 "tag script invoked in ${TESTDIR}/1
13183 args: realmodule MYTAG2"
13184 dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \
13186 export script invoked in ${TESTDIR}/1
13191 # Now test the ability to check out a single file from a directory
13193 dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \
13195 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13196 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13199 dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \
13201 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13202 checkout script invoked in ${TESTDIR}/1
13205 dotest modules5-39 "test -d mydir && test -f mydir/a" ""
13206 dotest_fail modules5-40 "test -d dirmodule || test -f mydir/b" ""
13207 dotest modules5-41 "echo yes | ${testcvs} release -d mydir" \
13208 "You have \[0\] altered files in this repository\.
13209 Are you sure you want to release (and delete) directory .mydir.: "
13211 # Now test the ability to correctly reject a non-existent filename.
13212 # For maximum studliness we would check that an error message is
13214 # We accept a zero exit status because it is what CVS does
13215 # (Dec 95). Probably the exit status should be nonzero,
13218 dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \
13219 "${PROG} checkout: warning: new-born mydir/nonexist has disappeared
13220 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13221 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13224 dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \
13225 "${PROG} checkout: warning: new-born mydir/nonexist has disappeared
13226 ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13227 checkout script invoked in ${TESTDIR}/1
13230 # We tolerate the creation of the mydir directory, since that
13231 # is what CVS does, not because we view that as preferable to not
13233 dotest_fail modules5-43 "test -f mydir/a || test -f mydir/b" ""
13237 dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \
13240 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13243 dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \
13246 checkout script invoked in ${TESTDIR}/1
13249 dotest modules5-45 "test -f mydir/a && test -f mydir/b" ""
13250 dotest_fail modules5-46 "test -d namedir"
13251 echo add line >>mydir/a
13252 # This seems suspicious: when we checkout an existing directory,
13253 # the checkout script gets executed in addition to the update
13254 # script. Is that by design or accident?
13256 dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \
13258 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13261 dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \
13263 checkout script invoked in ${TESTDIR}/1
13269 dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \
13271 checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13274 dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \
13276 checkout script invoked in ${TESTDIR}/1
13279 dotest modules5-49 "echo yes | ${testcvs} release -d mydir" \
13280 "You have \[0\] altered files in this repository\.
13281 Are you sure you want to release (and delete) directory .mydir.: "
13284 rm -rf 1 ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/*.sh
13289 # Test invalid module definitions
13291 # See the header comment for the `modules' test for an index of
13292 # the complete suite of modules tests.
13296 # There was a bug in CVS through 1.11.1p1 where a bad module name
13297 # would cause the previous line to be parsed as the module
13298 # definition. This test proves this doesn't happen anymore.
13302 dotest module6-setup-1 "${testcvs} -Q co CVSROOT" ""
13304 echo "longmodulename who cares" >modules
13305 echo "badname" >>modules
13306 # This test almost isn't setup since it generates the error message
13307 # we are looking for if `-Q' isn't specified, but I want to test the
13308 # filename in the message later.
13309 dotest modules6-setup-2 "${testcvs} -Q ci -mbad-modules" \
13310 "Checking in modules;
13311 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
13312 new revision: [0-9.]*; previous revision: [0-9.]*
13314 ${PROG} commit: Rebuilding administrative file database"
13316 # Here's where CVS would report not being able to find `lename'
13318 dotest_fail modules6-1 "${testcvs} -q co badname" \
13319 "${PROG} checkout: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules.
13320 ${PROG} checkout: cannot find module .badname. - ignored" \
13321 "${PROG} server: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules.
13322 ${PROG} server: cannot find module .badname. - ignored
13323 ${PROG} \[checkout aborted\]: cannot expand modules"
13327 echo "# empty modules file" >modules
13328 dotest modules6-cleanup-1 "${testcvs} -Q ci -mempty-modules" \
13329 "Checking in modules;
13330 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
13331 new revision: [0-9.]*; previous revision: [0-9.]*
13333 ${PROG} commit: Rebuilding administrative file database"
13336 if $keep; then :; else
13345 # Test tag problems vs an empty CVSROOT/val-tags file
13347 # See the header comment for the `modules' test for an index of
13348 # the complete suite of modules tests.
13352 dotest modules7-1 "$testcvs -Q co -d top ."
13355 dotest modules7-2 "$testcvs -Q add zero one"
13357 echo 'file1 contents' > file1
13358 dotest modules7-2 "$testcvs -Q add file1"
13359 dotest modules7-3 "$testcvs -Q ci -mnew file1" \
13360 "RCS file: $CVSROOT_DIRNAME/one/file1,v
13363 $CVSROOT_DIRNAME/one/file1,v <-- file1
13364 initial revision: 1\.1
13366 dotest modules7-4 "$testcvs -Q tag mytag file1"
13368 echo 'all -a zero one' > modules
13369 dotest modules7-5 "$testcvs -Q ci -mall-module" \
13370 "Checking in modules;
13371 $CVSROOT_DIRNAME/CVSROOT/modules,v <-- modules
13372 new revision: [0-9.]*; previous revision: [0-9.]*
13374 $PROG commit: Rebuilding administrative file database"
13378 # FIXCVS: The export should NOT be aborted here
13379 dotest_fail modules7-6 "$testcvs export -rmytag all" \
13380 "$PROG \[export aborted\]: no such tag mytag"
13385 # FIXCVS: Workaround is to have mytag listed in val-tags
13386 echo 'mytag y' > $CVSROOT_DIRNAME/CVSROOT/val-tags
13387 dotest modules7-7 "$testcvs export -rmytag all" \
13388 "$PROG export: Updating zero
13389 $PROG export: Updating one
13391 dotest modules7-8 'cat one/file1' 'file1 contents'
13394 echo Keeping $TESTDIR and exiting due to --keep
13400 echo "# empty modules file" >modules
13401 dotest modules7-cleanup-1 "$testcvs -Q ci -mempty-modules" \
13402 "Checking in modules;
13403 $CVSROOT_DIRNAME/CVSROOT/modules,v <-- modules
13404 new revision: [0-9.]*; previous revision: [0-9.]*
13406 $PROG commit: Rebuilding administrative file database"
13409 rm -rf $CVSROOT_DIRNAME/zero $CVSROOT_DIRNAME/one
13414 # When a file listed in checkoutlist doesn't exist, cvs-1.10.4
13415 # would fail to remove the CVSROOT/.#[0-9]* temporary file it
13416 # creates while mkmodules is in the process of trying to check
13417 # out the missing file.
13420 dotest mkmodules-temp-file-removal-1 "${testcvs} -Q co CVSROOT" ''
13422 echo no-such-file >> checkoutlist
13423 dotest mkmodules-temp-file-removal-2 "${testcvs} -Q ci -m. checkoutlist" \
13424 "Checking in checkoutlist;
13425 $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
13426 new revision: 1\.2; previous revision: 1\.1
13428 ${PROG} commit: Rebuilding administrative file database"
13430 dotest mkmodules-temp-file-removal-3 "echo $CVSROOT_DIRNAME/CVSROOT/.#[0-9]*" \
13431 "$CVSROOT_DIRNAME/CVSROOT/\.#\[0-9\]\*"
13433 # Versions 1.11.6 & 1.12.1 and earlier of CVS printed most of the
13434 # white space included before error messages in checkoutlist.
13435 echo "no-such-file Failed to update no-such-file." >checkoutlist
13436 dotest mkmodules-error-message-1 "${testcvs} -Q ci -m. checkoutlist" \
13437 "Checking in checkoutlist;
13438 $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
13439 new revision: 1\.3; previous revision: 1\.2
13441 ${PROG} commit: Rebuilding administrative file database
13442 ${PROG} commit: Failed to update no-such-file\."
13444 # Versions 1.11.6 & 1.12.1 and earlier of CVS used the error string
13445 # from the checkoutlist file as the format string passed to error()'s
13446 # printf. Check that this is no longer the case by verifying that
13447 # printf format patterns remain unchanged.
13448 echo "no-such-file Failed to update %s %lx times because %s happened %d times." >checkoutlist
13449 dotest mkmodules-error-message-2 "${testcvs} -Q ci -m. checkoutlist" \
13450 "Checking in checkoutlist;
13451 $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
13452 new revision: 1\.4; previous revision: 1\.3
13454 ${PROG} commit: Rebuilding administrative file database
13455 ${PROG} commit: Failed to update %s %lx times because %s happened %d times\."
13457 dotest mkmodules-cleanup-1 "${testcvs} -Q up -pr1.1 checkoutlist >checkoutlist"
13458 dotest mkmodules-cleanup-2 "${testcvs} -Q ci -m. checkoutlist" \
13459 "Checking in checkoutlist;
13460 $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
13461 new revision: 1\.5; previous revision: 1\.4
13463 ${PROG} commit: Rebuilding administrative file database"
13470 # Some tests of various permutations of co-d when directories exist
13471 # and checkouts lengthen.
13473 # Interestingly enough, these same tests pass when the directory
13474 # lengthening happens via the modules file. Go figure.
13476 mkdir $module; cd $module
13478 dotest co-d-init-1 "$testcvs -Q co -l ."
13480 dotest co-d-init-2 "$testcvs -Q add $module"
13482 echo content >file1
13483 echo different content >file2
13484 dotest co-d-init-3 "$testcvs -Q add file1 file2"
13485 dotest co-d-init-4 "$testcvs -Q ci -madd-em" \
13486 "RCS file: $CVSROOT_DIRNAME/co-d/file1,v
13489 $CVSROOT_DIRNAME/co-d/file1,v <-- file1
13490 initial revision: 1\.1
13492 RCS file: $CVSROOT_DIRNAME/co-d/file2,v
13495 $CVSROOT_DIRNAME/co-d/file2,v <-- file2
13496 initial revision: 1\.1
13501 dotest co-d-1 "$testcvs -q co -d dir $module" \
13504 dotest co-d-1.2 "cat dir/CVS/Repository" "$module"
13506 # FIXCVS: This should work. Correct expected result:
13508 #"U dir2/sdir/file1
13509 #U dir2/sdir/file2"
13510 dotest_fail co-d-2 "$testcvs -q co -d dir2/sdir $module" \
13511 "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir2': No such file or directory"
13513 # dotest co-d-2.2 "cat dir4/CVS/Repository" "CVSROOT/Emptydir"
13514 # dotest co-d-2.3 "cat dir5/CVS/Repository" "$module"
13517 dotest co-d-3 "$testcvs -q co -d dir3 $module" \
13520 dotest co-d-3.2 "cat dir3/CVS/Repository" "$module"
13523 # FIXCVS: As for co-d-2.
13525 dotest_fail co-d-4r "$testcvs -q co -d dir4/sdir $module" \
13526 "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir4': No such file or directory"
13528 # FIXCVS: As for co-d-2.
13531 dotest_fail co-d-5r "$testcvs -q co -d dir5/sdir $module" \
13532 "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir5': No such file or directory"
13535 dotest co-d-4 "$testcvs -q co -d dir4/sdir $module" \
13538 # CVS only creates administration directories for directories it
13539 # creates, and the last portion of the path passed to -d
13541 dotest_fail co-d-4.2 "test -d dir4/CVS"
13542 dotest co-d-4.3 "cat dir4/sdir/CVS/Repository" "$module"
13546 dotest co-d-5 "$testcvs -q co -d dir5/sdir $module" \
13549 # CVS only creates administration directories for directories it
13550 # creates, and the last portion of the path passed to -d
13552 dotest_fail co-d-5.2 "test -d dir5/CVS"
13553 dotest co-d-5.3 "cat dir5/sdir/CVS/Repository" "$module"
13558 echo Keeping ${TESTDIR} and exiting due to --keep
13563 rm -rf $CVSROOT_DIRNAME/$module
13568 # These test check the content of CVS' administrative
13569 # files as they are checked out in various configurations.
13570 # (As a side note, I'm not using the "-q" flag in any of
13571 # this code, which should provide some extra checking for
13572 # those messages which don't seem to be checked thoroughly
13573 # anywhere else.) To do a thorough test, we need to make
13574 # a bunch of modules in various configurations.
13576 # <1mod> is a directory at the top level of cvsroot
13578 # <2mod> is a directory at the second level of cvsroot
13580 # <1d1mod> is a directory at the top level which is
13581 # checked out into another directory
13582 # ``foo -d bar baz''
13583 # <1d2mod> is a directory at the second level which is
13584 # checked out into another directory
13585 # ``foo -d bar baz/quux''
13586 # <2d1mod> is a directory at the top level which is
13587 # checked out into a directory that is two deep
13588 # ``foo -d bar/baz quux''
13589 # <2d2mod> is a directory at the second level which is
13590 # checked out into a directory that is two deep
13591 # ``foo -d bar/baz quux''
13593 # The tests do each of these types separately and in twos.
13594 # We also repeat each test -d flag for 1-deep and 2-deep
13597 # Each test should check the output for the Repository
13598 # file, since that is the one which varies depending on
13599 # the directory and how it was checked out.
13601 # Yes, this is verbose, but at least it's very thorough.
13603 # convenience variables
13606 # First, set TopLevelAdmin=yes so we're sure to get
13607 # top-level CVS directories.
13609 dotest cvsadm-setup-1 "${testcvs} -q co CVSROOT/config" \
13612 echo "TopLevelAdmin=yes" >config
13613 dotest cvsadm-setup-2 "${testcvs} -q ci -m yes-top-level" \
13614 "Checking in config;
13615 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
13616 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13618 ${PROG} commit: Rebuilding administrative file database"
13622 # Second, check out the modules file and edit it.
13624 dotest cvsadm-1 "${testcvs} co CVSROOT/modules" \
13625 "U CVSROOT/modules"
13627 # Test CVS/Root once. Since there is only one part of
13628 # the code which writes CVS/Root files (Create_Admin),
13629 # there is no point in testing this every time.
13630 dotest cvsadm-1a "cat CVS/Root" ${REP}
13631 dotest cvsadm-1b "cat CVS/Repository" "\."
13632 dotest cvsadm-1c "cat CVSROOT/CVS/Root" ${REP}
13633 dotest cvsadm-1d "cat CVSROOT/CVS/Repository" "CVSROOT"
13634 # All of the defined module names begin with a number.
13635 # All of the top-level directory names begin with "dir".
13636 # All of the subdirectory names begin with "sub".
13637 # All of the top-level modules begin with "mod".
13638 echo "# Module defs for cvsadm tests" > CVSROOT/modules
13639 echo "1mod mod1" >> CVSROOT/modules
13640 echo "1mod-2 mod1-2" >> CVSROOT/modules
13641 echo "2mod mod2/sub2" >> CVSROOT/modules
13642 echo "2mod-2 mod2-2/sub2-2" >> CVSROOT/modules
13643 echo "1d1mod -d dir1d1 mod1" >> CVSROOT/modules
13644 echo "1d1mod-2 -d dir1d1-2 mod1-2" >> CVSROOT/modules
13645 echo "1d2mod -d dir1d2 mod2/sub2" >> CVSROOT/modules
13646 echo "1d2mod-2 -d dir1d2-2 mod2-2/sub2-2" >> CVSROOT/modules
13647 echo "2d1mod -d dir2d1/sub2d1 mod1" >> CVSROOT/modules
13648 echo "2d1mod-2 -d dir2d1-2/sub2d1-2 mod1-2" >> CVSROOT/modules
13649 echo "2d2mod -d dir2d2/sub2d2 mod2/sub2" >> CVSROOT/modules
13650 echo "2d2mod-2 -d dir2d2-2/sub2d2-2 mod2-2/sub2-2" >> CVSROOT/modules
13651 dotest cvsadm-1e "${testcvs} ci -m add-modules" \
13652 "${PROG} [a-z]*: Examining .
13653 ${PROG} [a-z]*: Examining CVSROOT
13654 Checking in CVSROOT/modules;
13655 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
13656 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13658 ${PROG} commit: Rebuilding administrative file database" \
13659 "${PROG} commit: Examining .
13660 ${PROG} commit: Examining CVSROOT"
13661 rm -rf CVS CVSROOT;
13663 # Create the various modules
13664 dotest cvsadm-2 "${testcvs} -q co -l ." ''
13670 mkdir mod2-2/sub2-2
13671 dotest cvsadm-2a "${testcvs} add mod1 mod1-2 mod2 mod2/sub2 mod2-2 mod2-2/sub2-2" \
13672 "Directory ${CVSROOT_DIRNAME}/mod1 added to the repository
13673 Directory ${CVSROOT_DIRNAME}/mod1-2 added to the repository
13674 Directory ${CVSROOT_DIRNAME}/mod2 added to the repository
13675 Directory ${CVSROOT_DIRNAME}/mod2/sub2 added to the repository
13676 Directory ${CVSROOT_DIRNAME}/mod2-2 added to the repository
13677 Directory ${CVSROOT_DIRNAME}/mod2-2/sub2-2 added to the repository"
13679 # Populate the directories for the halibut
13680 echo "file1" > mod1/file1
13681 echo "file1-2" > mod1-2/file1-2
13682 echo "file2" > mod2/sub2/file2
13683 echo "file2-2" > mod2-2/sub2-2/file2-2
13684 dotest cvsadm-2aa "${testcvs} add mod1/file1 mod1-2/file1-2 mod2/sub2/file2 mod2-2/sub2-2/file2-2" \
13685 "${PROG} add: scheduling file .mod1/file1. for addition
13686 ${PROG} add: scheduling file .mod1-2/file1-2. for addition
13687 ${PROG} add: scheduling file .mod2/sub2/file2. for addition
13688 ${PROG} add: scheduling file .mod2-2/sub2-2/file2-2. for addition
13689 ${PROG} add: use .${PROG} commit. to add these files permanently"
13691 dotest cvsadm-2b "${testcvs} ci -m yup mod1 mod1-2 mod2 mod2-2" \
13692 "${PROG} [a-z]*: Examining mod1
13693 ${PROG} [a-z]*: Examining mod1-2
13694 ${PROG} [a-z]*: Examining mod2
13695 ${PROG} [a-z]*: Examining mod2/sub2
13696 ${PROG} [a-z]*: Examining mod2-2
13697 ${PROG} [a-z]*: Examining mod2-2/sub2-2
13698 RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
13700 Checking in mod1/file1;
13701 ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
13702 initial revision: 1.1
13704 RCS file: ${CVSROOT_DIRNAME}/mod1-2/file1-2,v
13706 Checking in mod1-2/file1-2;
13707 ${CVSROOT_DIRNAME}/mod1-2/file1-2,v <-- file1-2
13708 initial revision: 1.1
13710 RCS file: ${CVSROOT_DIRNAME}/mod2/sub2/file2,v
13712 Checking in mod2/sub2/file2;
13713 ${CVSROOT_DIRNAME}/mod2/sub2/file2,v <-- file2
13714 initial revision: 1.1
13716 RCS file: ${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v
13718 Checking in mod2-2/sub2-2/file2-2;
13719 ${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v <-- file2-2
13720 initial revision: 1.1
13722 # Finished creating the modules -- clean up.
13723 rm -rf CVS mod1 mod1-2 mod2 mod2-2
13726 ##################################################
13727 ## Start the dizzying array of possibilities.
13728 ## Begin with each module type separately.
13729 ##################################################
13731 # Pattern -- after each checkout, first check the top-level
13732 # CVS directory. Then, check the directories in numerical
13735 dotest cvsadm-3 "${testcvs} co 1mod" \
13736 "${PROG} checkout: Updating 1mod
13738 dotest cvsadm-3b "cat CVS/Repository" "\."
13739 dotest cvsadm-3d "cat 1mod/CVS/Repository" "mod1"
13742 dotest cvsadm-4 "${testcvs} co 2mod" \
13743 "${PROG} checkout: Updating 2mod
13745 dotest cvsadm-4b "cat CVS/Repository" "\."
13746 dotest cvsadm-4d "cat 2mod/CVS/Repository" "mod2/sub2"
13749 dotest cvsadm-5 "${testcvs} co 1d1mod" \
13750 "${PROG} checkout: Updating dir1d1
13752 dotest cvsadm-5b "cat CVS/Repository" "\."
13753 dotest cvsadm-5d "cat dir1d1/CVS/Repository" "mod1"
13756 dotest cvsadm-6 "${testcvs} co 1d2mod" \
13757 "${PROG} checkout: Updating dir1d2
13759 dotest cvsadm-6b "cat CVS/Repository" "\."
13760 dotest cvsadm-6d "cat dir1d2/CVS/Repository" "mod2/sub2"
13763 dotest cvsadm-7 "${testcvs} co 2d1mod" \
13764 "${PROG} checkout: Updating dir2d1/sub2d1
13765 U dir2d1/sub2d1/file1"
13766 dotest cvsadm-7b "cat CVS/Repository" "\."
13767 dotest cvsadm-7d "cat dir2d1/CVS/Repository" "\."
13768 dotest cvsadm-7f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
13771 dotest cvsadm-8 "${testcvs} co 2d2mod" \
13772 "${PROG} checkout: Updating dir2d2/sub2d2
13773 U dir2d2/sub2d2/file2"
13774 dotest cvsadm-8b "cat CVS/Repository" "\."
13775 dotest cvsadm-8d "cat dir2d2/CVS/Repository" "mod2"
13776 dotest cvsadm-8f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
13779 ##################################################
13780 ## You are in a shell script of twisted little
13781 ## module combination statements, all alike.
13782 ##################################################
13786 dotest cvsadm-9 "${testcvs} co 1mod 1mod-2" \
13787 "${PROG} checkout: Updating 1mod
13789 ${PROG} checkout: Updating 1mod-2
13791 # the usual for the top level
13792 dotest cvsadm-9b "cat CVS/Repository" "\."
13793 # the usual for 1mod
13794 dotest cvsadm-9d "cat 1mod/CVS/Repository" "mod1"
13795 # the usual for 1mod copy
13796 dotest cvsadm-9f "cat 1mod-2/CVS/Repository" "mod1-2"
13797 rm -rf CVS 1mod 1mod-2
13799 # 1mod 2mod redmod bluemod
13800 dotest cvsadm-10 "${testcvs} co 1mod 2mod" \
13801 "${PROG} checkout: Updating 1mod
13803 ${PROG} checkout: Updating 2mod
13805 # the usual for the top level
13806 dotest cvsadm-10b "cat CVS/Repository" "\."
13807 # the usual for 1mod
13808 dotest cvsadm-10d "cat 1mod/CVS/Repository" "mod1"
13809 # the usual for 2dmod
13810 dotest cvsadm-10f "cat 2mod/CVS/Repository" "mod2/sub2"
13811 rm -rf CVS 1mod 2mod
13813 dotest cvsadm-11 "${testcvs} co 1mod 1d1mod" \
13814 "${PROG} checkout: Updating 1mod
13816 ${PROG} checkout: Updating dir1d1
13818 # the usual for the top level
13819 dotest cvsadm-11b "cat CVS/Repository" "\."
13820 # the usual for 1mod
13821 dotest cvsadm-11d "cat 1mod/CVS/Repository" "mod1"
13822 # the usual for 1d1mod
13823 dotest cvsadm-11f "cat dir1d1/CVS/Repository" "mod1"
13824 rm -rf CVS 1mod dir1d1
13826 dotest cvsadm-12 "${testcvs} co 1mod 1d2mod" \
13827 "${PROG} checkout: Updating 1mod
13829 ${PROG} checkout: Updating dir1d2
13831 # the usual for the top level
13832 dotest cvsadm-12b "cat CVS/Repository" "\."
13833 # the usual for 1mod
13834 dotest cvsadm-12d "cat 1mod/CVS/Repository" "mod1"
13835 # the usual for 1d2mod
13836 dotest cvsadm-12f "cat dir1d2/CVS/Repository" "mod2/sub2"
13837 rm -rf CVS 1mod dir1d2
13839 dotest cvsadm-13 "${testcvs} co 1mod 2d1mod" \
13840 "${PROG} checkout: Updating 1mod
13842 ${PROG} checkout: Updating dir2d1/sub2d1
13843 U dir2d1/sub2d1/file1"
13844 # the usual for the top level
13845 dotest cvsadm-13b "cat CVS/Repository" "\."
13846 # the usual for 1mod
13847 dotest cvsadm-13d "cat 1mod/CVS/Repository" "mod1"
13848 # the usual for 2d1mod
13849 dotest cvsadm-13f "cat dir2d1/CVS/Repository" "\."
13850 dotest cvsadm-13h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
13851 rm -rf CVS 1mod dir2d1
13853 dotest cvsadm-14 "${testcvs} co 1mod 2d2mod" \
13854 "${PROG} checkout: Updating 1mod
13856 ${PROG} checkout: Updating dir2d2/sub2d2
13857 U dir2d2/sub2d2/file2"
13858 # the usual for the top level
13859 dotest cvsadm-14b "cat CVS/Repository" "\."
13860 # the usual for 1mod
13861 dotest cvsadm-14d "cat 1mod/CVS/Repository" "mod1"
13862 # the usual for 2d2mod
13863 dotest cvsadm-14f "cat dir2d2/CVS/Repository" "mod2"
13864 dotest cvsadm-14h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
13865 rm -rf CVS 1mod dir2d2
13870 dotest cvsadm-15 "${testcvs} co 2mod 2mod-2" \
13871 "${PROG} checkout: Updating 2mod
13873 ${PROG} checkout: Updating 2mod-2
13875 # the usual for the top level
13876 dotest cvsadm-15b "cat CVS/Repository" "\."
13877 # the usual for 2mod
13878 dotest cvsadm-15d "cat 2mod/CVS/Repository" "mod2/sub2"
13879 # the usual for 2mod copy
13880 dotest cvsadm-15f "cat 2mod-2/CVS/Repository" "mod2-2/sub2-2"
13881 rm -rf CVS 2mod 2mod-2
13884 dotest cvsadm-16 "${testcvs} co 2mod 1d1mod" \
13885 "${PROG} checkout: Updating 2mod
13887 ${PROG} checkout: Updating dir1d1
13889 # the usual for the top level
13890 dotest cvsadm-16b "cat CVS/Repository" "\."
13891 # the usual for 2mod
13892 dotest cvsadm-16d "cat 2mod/CVS/Repository" "mod2/sub2"
13893 # the usual for 1d1mod
13894 dotest cvsadm-16f "cat dir1d1/CVS/Repository" "mod1"
13895 rm -rf CVS 2mod dir1d1
13897 dotest cvsadm-17 "${testcvs} co 2mod 1d2mod" \
13898 "${PROG} checkout: Updating 2mod
13900 ${PROG} checkout: Updating dir1d2
13902 # the usual for the top level
13903 dotest cvsadm-17b "cat CVS/Repository" "\."
13904 # the usual for 2mod
13905 dotest cvsadm-17d "cat 2mod/CVS/Repository" "mod2/sub2"
13906 # the usual for 1d2mod
13907 dotest cvsadm-17f "cat dir1d2/CVS/Repository" "mod2/sub2"
13908 rm -rf CVS 2mod dir1d2
13910 dotest cvsadm-18 "${testcvs} co 2mod 2d1mod" \
13911 "${PROG} checkout: Updating 2mod
13913 ${PROG} checkout: Updating dir2d1/sub2d1
13914 U dir2d1/sub2d1/file1"
13915 # the usual for the top level
13916 dotest cvsadm-18b "cat CVS/Repository" "\."
13917 # the usual for 2mod
13918 dotest cvsadm-18d "cat 2mod/CVS/Repository" "mod2/sub2"
13919 # the usual for 2d1mod
13920 dotest cvsadm-18f "cat dir2d1/CVS/Repository" "\."
13921 dotest cvsadm-18h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
13922 rm -rf CVS 2mod dir2d1
13924 dotest cvsadm-19 "${testcvs} co 2mod 2d2mod" \
13925 "${PROG} checkout: Updating 2mod
13927 ${PROG} checkout: Updating dir2d2/sub2d2
13928 U dir2d2/sub2d2/file2"
13929 # the usual for the top level
13930 dotest cvsadm-19b "cat CVS/Repository" "\."
13931 # the usual for 2mod
13932 dotest cvsadm-19d "cat 2mod/CVS/Repository" "mod2/sub2"
13933 # the usual for 2d2mod
13934 dotest cvsadm-19f "cat dir2d2/CVS/Repository" "mod2"
13935 dotest cvsadm-19h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
13936 rm -rf CVS 2mod dir2d2
13941 dotest cvsadm-20 "${testcvs} co 1d1mod 1d1mod-2" \
13942 "${PROG} checkout: Updating dir1d1
13944 ${PROG} checkout: Updating dir1d1-2
13945 U dir1d1-2/file1-2"
13946 # the usual for the top level
13947 dotest cvsadm-20b "cat CVS/Repository" "\."
13948 # the usual for 1d1mod
13949 dotest cvsadm-20d "cat dir1d1/CVS/Repository" "mod1"
13950 # the usual for 1d1mod copy
13951 dotest cvsadm-20f "cat dir1d1-2/CVS/Repository" "mod1-2"
13952 rm -rf CVS dir1d1 dir1d1-2
13954 dotest cvsadm-21 "${testcvs} co 1d1mod 1d2mod" \
13955 "${PROG} checkout: Updating dir1d1
13957 ${PROG} checkout: Updating dir1d2
13959 # the usual for the top level
13960 dotest cvsadm-21b "cat CVS/Repository" "\."
13961 # the usual for 1d1mod
13962 dotest cvsadm-21d "cat dir1d1/CVS/Repository" "mod1"
13963 # the usual for 1d2mod
13964 dotest cvsadm-21f "cat dir1d2/CVS/Repository" "mod2/sub2"
13965 rm -rf CVS dir1d1 dir1d2
13967 dotest cvsadm-22 "${testcvs} co 1d1mod 2d1mod" \
13968 "${PROG} checkout: Updating dir1d1
13970 ${PROG} checkout: Updating dir2d1/sub2d1
13971 U dir2d1/sub2d1/file1"
13972 # the usual for the top level
13973 dotest cvsadm-22b "cat CVS/Repository" "\."
13974 # the usual for 1d1mod
13975 dotest cvsadm-22d "cat dir1d1/CVS/Repository" "mod1"
13976 # the usual for 2d1mod
13977 dotest cvsadm-22f "cat dir2d1/CVS/Repository" "\."
13978 dotest cvsadm-22h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
13979 rm -rf CVS dir1d1 dir2d1
13981 dotest cvsadm-23 "${testcvs} co 1d1mod 2d2mod" \
13982 "${PROG} checkout: Updating dir1d1
13984 ${PROG} checkout: Updating dir2d2/sub2d2
13985 U dir2d2/sub2d2/file2"
13986 # the usual for the top level
13987 dotest cvsadm-23b "cat CVS/Repository" "\."
13988 # the usual for 1d1mod
13989 dotest cvsadm-23d "cat dir1d1/CVS/Repository" "mod1"
13990 # the usual for 2d2mod
13991 dotest cvsadm-23f "cat dir2d2/CVS/Repository" "mod2"
13992 dotest cvsadm-23h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
13993 rm -rf CVS dir1d1 dir2d2
13998 dotest cvsadm-24 "${testcvs} co 1d2mod 1d2mod-2" \
13999 "${PROG} checkout: Updating dir1d2
14001 ${PROG} checkout: Updating dir1d2-2
14002 U dir1d2-2/file2-2"
14003 # the usual for the top level
14004 dotest cvsadm-24b "cat CVS/Repository" "\."
14005 # the usual for 1d2mod
14006 dotest cvsadm-24d "cat dir1d2/CVS/Repository" "mod2/sub2"
14007 # the usual for 1d2mod copy
14008 dotest cvsadm-24f "cat dir1d2-2/CVS/Repository" "mod2-2/sub2-2"
14009 rm -rf CVS dir1d2 dir1d2-2
14011 dotest cvsadm-25 "${testcvs} co 1d2mod 2d1mod" \
14012 "${PROG} checkout: Updating dir1d2
14014 ${PROG} checkout: Updating dir2d1/sub2d1
14015 U dir2d1/sub2d1/file1"
14016 # the usual for the top level
14017 dotest cvsadm-25b "cat CVS/Repository" "\."
14018 # the usual for 1d2mod
14019 dotest cvsadm-25d "cat dir1d2/CVS/Repository" "mod2/sub2"
14020 # the usual for 2d1mod
14021 dotest cvsadm-25f "cat dir2d1/CVS/Repository" "\."
14022 dotest cvsadm-25h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14023 rm -rf CVS dir1d2 dir2d1
14025 dotest cvsadm-26 "${testcvs} co 1d2mod 2d2mod" \
14026 "${PROG} checkout: Updating dir1d2
14028 ${PROG} checkout: Updating dir2d2/sub2d2
14029 U dir2d2/sub2d2/file2"
14030 # the usual for the top level
14031 dotest cvsadm-26b "cat CVS/Repository" "\."
14032 # the usual for 1d2mod
14033 dotest cvsadm-26d "cat dir1d2/CVS/Repository" "mod2/sub2"
14034 # the usual for 2d2mod
14035 dotest cvsadm-26f "cat dir2d2/CVS/Repository" "mod2"
14036 dotest cvsadm-26h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14037 rm -rf CVS dir1d2 dir2d2
14042 dotest cvsadm-27 "${testcvs} co 2d1mod 2d1mod-2" \
14043 "${PROG} checkout: Updating dir2d1/sub2d1
14044 U dir2d1/sub2d1/file1
14045 ${PROG} checkout: Updating dir2d1-2/sub2d1-2
14046 U dir2d1-2/sub2d1-2/file1-2"
14047 # the usual for the top level
14048 dotest cvsadm-27b "cat CVS/Repository" "\."
14049 # the usual for 2d1mod
14050 dotest cvsadm-27d "cat dir2d1/CVS/Repository" "\."
14051 dotest cvsadm-27f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14052 # the usual for 2d1mod
14053 dotest cvsadm-27h "cat dir2d1-2/CVS/Repository" "\."
14054 dotest cvsadm-27j "cat dir2d1-2/sub2d1-2/CVS/Repository" "mod1-2"
14055 rm -rf CVS dir2d1 dir2d1-2
14057 dotest cvsadm-28 "${testcvs} co 2d1mod 2d2mod" \
14058 "${PROG} checkout: Updating dir2d1/sub2d1
14059 U dir2d1/sub2d1/file1
14060 ${PROG} checkout: Updating dir2d2/sub2d2
14061 U dir2d2/sub2d2/file2"
14062 # the usual for the top level
14063 dotest cvsadm-28b "cat CVS/Repository" "\."
14064 # the usual for 2d1mod
14065 dotest cvsadm-28d "cat dir2d1/CVS/Repository" "\."
14066 dotest cvsadm-28f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14067 # the usual for 2d2mod
14068 dotest cvsadm-28h "cat dir2d2/CVS/Repository" "mod2"
14069 dotest cvsadm-28j "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14070 rm -rf CVS dir2d1 dir2d2
14075 dotest cvsadm-29 "${testcvs} co 2d2mod 2d2mod-2" \
14076 "${PROG} checkout: Updating dir2d2/sub2d2
14077 U dir2d2/sub2d2/file2
14078 ${PROG} checkout: Updating dir2d2-2/sub2d2-2
14079 U dir2d2-2/sub2d2-2/file2-2"
14080 # the usual for the top level
14081 dotest cvsadm-29b "cat CVS/Repository" "\."
14082 # the usual for 2d2mod
14083 dotest cvsadm-29d "cat dir2d2/CVS/Repository" "mod2"
14084 dotest cvsadm-29f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14085 # the usual for 2d2mod
14086 dotest cvsadm-29h "cat dir2d2-2/CVS/Repository" "mod2-2"
14087 dotest cvsadm-29j "cat dir2d2-2/sub2d2-2/CVS/Repository" \
14089 rm -rf CVS dir2d2 dir2d2-2
14091 ##################################################
14092 ## And now, all of that again using the "-d" flag
14093 ## on the command line.
14094 ##################################################
14096 dotest cvsadm-1d3 "${testcvs} co -d dir 1mod" \
14097 "${PROG} checkout: Updating dir
14099 dotest cvsadm-1d3b "cat CVS/Repository" "\."
14100 dotest cvsadm-1d3d "cat dir/CVS/Repository" "mod1"
14103 dotest cvsadm-1d4 "${testcvs} co -d dir 2mod" \
14104 "${PROG} checkout: Updating dir
14106 dotest cvsadm-1d4b "cat CVS/Repository" "\."
14107 dotest cvsadm-1d4d "cat dir/CVS/Repository" "mod2/sub2"
14110 dotest cvsadm-1d5 "${testcvs} co -d dir 1d1mod" \
14111 "${PROG} checkout: Updating dir
14113 dotest cvsadm-1d5b "cat CVS/Repository" "\."
14114 dotest cvsadm-1d5d "cat dir/CVS/Repository" "mod1"
14117 dotest cvsadm-1d6 "${testcvs} co -d dir 1d2mod" \
14118 "${PROG} checkout: Updating dir
14120 dotest cvsadm-1d6b "cat CVS/Repository" "\."
14121 dotest cvsadm-1d6d "cat dir/CVS/Repository" "mod2/sub2"
14124 dotest cvsadm-1d7 "${testcvs} co -d dir 2d1mod" \
14125 "${PROG} checkout: Updating dir
14127 dotest cvsadm-1d7b "cat CVS/Repository" "\."
14128 dotest cvsadm-1d7d "cat dir/CVS/Repository" "mod1"
14131 dotest cvsadm-1d8 "${testcvs} co -d dir 2d2mod" \
14132 "${PROG} checkout: Updating dir
14134 dotest cvsadm-1d8b "cat CVS/Repository" "\."
14135 dotest cvsadm-1d8d "cat dir/CVS/Repository" "mod2/sub2"
14138 ##################################################
14139 ## Los Combonaciones
14140 ##################################################
14144 dotest cvsadm-1d9 "${testcvs} co -d dir 1mod 1mod-2" \
14145 "${PROG} checkout: Updating dir/1mod
14147 ${PROG} checkout: Updating dir/1mod-2
14148 U dir/1mod-2/file1-2"
14149 # the usual for the top level
14150 dotest cvsadm-1d9b "cat CVS/Repository" "\."
14151 # the usual for the dir level
14152 dotest cvsadm-1d9d "cat dir/CVS/Repository" "\."
14153 # the usual for 1mod
14154 dotest cvsadm-1d9f "cat dir/1mod/CVS/Repository" "mod1"
14155 # the usual for 1mod copy
14156 dotest cvsadm-1d9h "cat dir/1mod-2/CVS/Repository" "mod1-2"
14159 # 1mod 2mod redmod bluemod
14160 dotest cvsadm-1d10 "${testcvs} co -d dir 1mod 2mod" \
14161 "${PROG} checkout: Updating dir/1mod
14163 ${PROG} checkout: Updating dir/2mod
14165 dotest cvsadm-1d10b "cat CVS/Repository" "\."
14166 # the usual for the dir level
14167 dotest cvsadm-1d10d "cat dir/CVS/Repository" "\."
14168 # the usual for 1mod
14169 dotest cvsadm-1d10f "cat dir/1mod/CVS/Repository" "mod1"
14170 # the usual for 2dmod
14171 dotest cvsadm-1d10h "cat dir/2mod/CVS/Repository" "mod2/sub2"
14174 dotest cvsadm-1d11 "${testcvs} co -d dir 1mod 1d1mod" \
14175 "${PROG} checkout: Updating dir/1mod
14177 ${PROG} checkout: Updating dir/dir1d1
14178 U dir/dir1d1/file1"
14179 dotest cvsadm-1d11b "cat CVS/Repository" "\."
14180 # the usual for the dir level
14181 dotest cvsadm-1d11d "cat dir/CVS/Repository" "\."
14182 # the usual for 1mod
14183 dotest cvsadm-1d11f "cat dir/1mod/CVS/Repository" "mod1"
14184 # the usual for 1d1mod
14185 dotest cvsadm-1d11h "cat dir/dir1d1/CVS/Repository" "mod1"
14188 dotest cvsadm-1d12 "${testcvs} co -d dir 1mod 1d2mod" \
14189 "${PROG} checkout: Updating dir/1mod
14191 ${PROG} checkout: Updating dir/dir1d2
14192 U dir/dir1d2/file2"
14193 dotest cvsadm-1d12b "cat CVS/Repository" "\."
14194 # the usual for the dir level
14195 dotest cvsadm-1d12d "cat dir/CVS/Repository" "\."
14196 # the usual for 1mod
14197 dotest cvsadm-1d12f "cat dir/1mod/CVS/Repository" "mod1"
14198 # the usual for 1d2mod
14199 dotest cvsadm-1d12h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14202 dotest cvsadm-1d13 "${testcvs} co -d dir 1mod 2d1mod" \
14203 "${PROG} checkout: Updating dir/1mod
14205 ${PROG} checkout: Updating dir/dir2d1/sub2d1
14206 U dir/dir2d1/sub2d1/file1"
14207 dotest cvsadm-1d13b "cat CVS/Repository" "\."
14208 # the usual for the dir level
14209 dotest cvsadm-1d13d "cat dir/CVS/Repository" "\."
14210 # the usual for 1mod
14211 dotest cvsadm-1d13f "cat dir/1mod/CVS/Repository" "mod1"
14212 # the usual for 2d1mod
14213 dotest cvsadm-1d13h "cat dir/dir2d1/CVS/Repository" "\."
14214 dotest cvsadm-1d13j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14217 dotest cvsadm-1d14 "${testcvs} co -d dir 1mod 2d2mod" \
14218 "${PROG} checkout: Updating dir/1mod
14220 ${PROG} checkout: Updating dir/dir2d2/sub2d2
14221 U dir/dir2d2/sub2d2/file2"
14222 dotest cvsadm-1d14b "cat CVS/Repository" "\."
14223 # the usual for the dir level
14224 dotest cvsadm-1d14d "cat dir/CVS/Repository" "\."
14225 # the usual for 1mod
14226 dotest cvsadm-1d14f "cat dir/1mod/CVS/Repository" "mod1"
14227 # the usual for 2d2mod
14228 dotest cvsadm-1d14h "cat dir/dir2d2/CVS/Repository" "mod2"
14229 dotest cvsadm-1d14j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14235 dotest cvsadm-1d15 "${testcvs} co -d dir 2mod 2mod-2" \
14236 "${PROG} checkout: Updating dir/2mod
14238 ${PROG} checkout: Updating dir/2mod-2
14239 U dir/2mod-2/file2-2"
14240 dotest cvsadm-1d15b "cat CVS/Repository" "\."
14241 # the usual for the dir level
14242 dotest cvsadm-1d15d "cat dir/CVS/Repository" "mod2"
14243 # the usual for 2mod
14244 dotest cvsadm-1d15f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14245 # the usual for 2mod copy
14246 dotest cvsadm-1d15h "cat dir/2mod-2/CVS/Repository" "mod2-2/sub2-2"
14249 dotest cvsadm-1d16 "${testcvs} co -d dir 2mod 1d1mod" \
14250 "${PROG} checkout: Updating dir/2mod
14252 ${PROG} checkout: Updating dir/dir1d1
14253 U dir/dir1d1/file1"
14254 dotest cvsadm-1d16b "cat CVS/Repository" "\."
14255 # the usual for the dir level
14256 dotest cvsadm-1d16d "cat dir/CVS/Repository" "mod2"
14257 # the usual for 2mod
14258 dotest cvsadm-1d16f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14259 # the usual for 1d1mod
14260 dotest cvsadm-1d16h "cat dir/dir1d1/CVS/Repository" "mod1"
14263 dotest cvsadm-1d17 "${testcvs} co -d dir 2mod 1d2mod" \
14264 "${PROG} checkout: Updating dir/2mod
14266 ${PROG} checkout: Updating dir/dir1d2
14267 U dir/dir1d2/file2"
14268 dotest cvsadm-1d17b "cat CVS/Repository" "\."
14269 # the usual for the dir level
14270 dotest cvsadm-1d17d "cat dir/CVS/Repository" "mod2"
14271 # the usual for 2mod
14272 dotest cvsadm-1d17f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14273 # the usual for 1d2mod
14274 dotest cvsadm-1d17h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14277 dotest cvsadm-1d18 "${testcvs} co -d dir 2mod 2d1mod" \
14278 "${PROG} checkout: Updating dir/2mod
14280 ${PROG} checkout: Updating dir/dir2d1/sub2d1
14281 U dir/dir2d1/sub2d1/file1"
14282 dotest cvsadm-1d18b "cat CVS/Repository" "\."
14283 # the usual for the dir level
14284 dotest cvsadm-1d18d "cat dir/CVS/Repository" "mod2"
14285 # the usual for 2mod
14286 dotest cvsadm-1d18f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14287 # the usual for 2d1mod
14288 dotest cvsadm-1d18h "cat dir/dir2d1/CVS/Repository" "\."
14289 dotest cvsadm-1d18j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14292 dotest cvsadm-1d19 "${testcvs} co -d dir 2mod 2d2mod" \
14293 "${PROG} checkout: Updating dir/2mod
14295 ${PROG} checkout: Updating dir/dir2d2/sub2d2
14296 U dir/dir2d2/sub2d2/file2"
14297 dotest cvsadm-1d19b "cat CVS/Repository" "\."
14298 # the usual for the dir level
14299 dotest cvsadm-1d19d "cat dir/CVS/Repository" "mod2"
14300 # the usual for 2mod
14301 dotest cvsadm-1d19f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14302 # the usual for 2d2mod
14303 dotest cvsadm-1d19h "cat dir/dir2d2/CVS/Repository" "mod2"
14304 dotest cvsadm-1d19j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14310 dotest cvsadm-1d20 "${testcvs} co -d dir 1d1mod 1d1mod-2" \
14311 "${PROG} checkout: Updating dir/dir1d1
14313 ${PROG} checkout: Updating dir/dir1d1-2
14314 U dir/dir1d1-2/file1-2"
14315 dotest cvsadm-1d20b "cat CVS/Repository" "\."
14316 # the usual for the dir level
14317 dotest cvsadm-1d20d "cat dir/CVS/Repository" "\."
14318 # the usual for 1d1mod
14319 dotest cvsadm-1d20f "cat dir/dir1d1/CVS/Repository" "mod1"
14320 # the usual for 1d1mod copy
14321 dotest cvsadm-1d20h "cat dir/dir1d1-2/CVS/Repository" "mod1-2"
14324 dotest cvsadm-1d21 "${testcvs} co -d dir 1d1mod 1d2mod" \
14325 "${PROG} checkout: Updating dir/dir1d1
14327 ${PROG} checkout: Updating dir/dir1d2
14328 U dir/dir1d2/file2"
14329 dotest cvsadm-1d21b "cat CVS/Repository" "\."
14330 # the usual for the dir level
14331 dotest cvsadm-1d21d "cat dir/CVS/Repository" "\."
14332 # the usual for 1d1mod
14333 dotest cvsadm-1d21f "cat dir/dir1d1/CVS/Repository" "mod1"
14334 # the usual for 1d2mod
14335 dotest cvsadm-1d21h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14338 dotest cvsadm-1d22 "${testcvs} co -d dir 1d1mod 2d1mod" \
14339 "${PROG} checkout: Updating dir/dir1d1
14341 ${PROG} checkout: Updating dir/dir2d1/sub2d1
14342 U dir/dir2d1/sub2d1/file1"
14343 dotest cvsadm-1d22b "cat CVS/Repository" "\."
14344 # the usual for the dir level
14345 dotest cvsadm-1d22d "cat dir/CVS/Repository" "\."
14346 # the usual for 1d1mod
14347 dotest cvsadm-1d22f "cat dir/dir1d1/CVS/Repository" "mod1"
14348 # the usual for 2d1mod
14349 dotest cvsadm-1d22h "cat dir/dir2d1/CVS/Repository" "\."
14350 dotest cvsadm-1d22j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14353 dotest cvsadm-1d23 "${testcvs} co -d dir 1d1mod 2d2mod" \
14354 "${PROG} checkout: Updating dir/dir1d1
14356 ${PROG} checkout: Updating dir/dir2d2/sub2d2
14357 U dir/dir2d2/sub2d2/file2"
14358 dotest cvsadm-1d23b "cat CVS/Repository" "\."
14359 # the usual for the dir level
14360 dotest cvsadm-1d23d "cat dir/CVS/Repository" "\."
14361 # the usual for 1d1mod
14362 dotest cvsadm-1d23f "cat dir/dir1d1/CVS/Repository" "mod1"
14363 # the usual for 2d2mod
14364 dotest cvsadm-1d23h "cat dir/dir2d2/CVS/Repository" "mod2"
14365 dotest cvsadm-1d23j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14371 dotest cvsadm-1d24 "${testcvs} co -d dir 1d2mod 1d2mod-2" \
14372 "${PROG} checkout: Updating dir/dir1d2
14374 ${PROG} checkout: Updating dir/dir1d2-2
14375 U dir/dir1d2-2/file2-2"
14376 dotest cvsadm-1d24b "cat CVS/Repository" "\."
14377 # the usual for the dir level
14378 dotest cvsadm-1d24d "cat dir/CVS/Repository" "mod2"
14379 # the usual for 1d2mod
14380 dotest cvsadm-1d24f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14381 # the usual for 1d2mod copy
14382 dotest cvsadm-1d24h "cat dir/dir1d2-2/CVS/Repository" "mod2-2/sub2-2"
14385 dotest cvsadm-1d25 "${testcvs} co -d dir 1d2mod 2d1mod" \
14386 "${PROG} checkout: Updating dir/dir1d2
14388 ${PROG} checkout: Updating dir/dir2d1/sub2d1
14389 U dir/dir2d1/sub2d1/file1"
14390 dotest cvsadm-1d25b "cat CVS/Repository" "\."
14391 # the usual for the dir level
14392 dotest cvsadm-1d25d "cat dir/CVS/Repository" "mod2"
14393 # the usual for 1d2mod
14394 dotest cvsadm-1d25f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14395 # the usual for 2d1mod
14396 dotest cvsadm-1d25h "cat dir/dir2d1/CVS/Repository" "\."
14397 dotest cvsadm-1d25j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14400 dotest cvsadm-1d26 "${testcvs} co -d dir 1d2mod 2d2mod" \
14401 "${PROG} checkout: Updating dir/dir1d2
14403 ${PROG} checkout: Updating dir/dir2d2/sub2d2
14404 U dir/dir2d2/sub2d2/file2"
14405 dotest cvsadm-1d26b "cat CVS/Repository" "\."
14406 # the usual for the dir level
14407 dotest cvsadm-1d26d "cat dir/CVS/Repository" "mod2"
14408 # the usual for 1d2mod
14409 dotest cvsadm-1d26f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14410 # the usual for 2d2mod
14411 dotest cvsadm-1d26h "cat dir/dir2d2/CVS/Repository" "mod2"
14412 dotest cvsadm-1d26j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14418 dotest cvsadm-1d27 "${testcvs} co -d dir 2d1mod 2d1mod-2" \
14419 "${PROG} checkout: Updating dir/dir2d1/sub2d1
14420 U dir/dir2d1/sub2d1/file1
14421 ${PROG} checkout: Updating dir/dir2d1-2/sub2d1-2
14422 U dir/dir2d1-2/sub2d1-2/file1-2"
14423 dotest cvsadm-1d27b "cat CVS/Repository" "\."
14424 # the usual for the dir level
14425 dotest cvsadm-1d27d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
14426 # the usual for 2d1mod
14427 dotest cvsadm-1d27f "cat dir/dir2d1/CVS/Repository" "\."
14428 dotest cvsadm-1d27h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14429 # the usual for 2d1mod
14430 dotest cvsadm-1d27j "cat dir/dir2d1-2/CVS/Repository" "\."
14431 dotest cvsadm-1d27l "cat dir/dir2d1-2/sub2d1-2/CVS/Repository" \
14435 dotest cvsadm-1d28 "${testcvs} co -d dir 2d1mod 2d2mod" \
14436 "${PROG} checkout: Updating dir/dir2d1/sub2d1
14437 U dir/dir2d1/sub2d1/file1
14438 ${PROG} checkout: Updating dir/dir2d2/sub2d2
14439 U dir/dir2d2/sub2d2/file2"
14440 dotest cvsadm-1d28b "cat CVS/Repository" "\."
14441 # the usual for the dir level
14442 dotest cvsadm-1d28d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
14443 # the usual for 2d1mod
14444 dotest cvsadm-1d28f "cat dir/dir2d1/CVS/Repository" "\."
14445 dotest cvsadm-1d28h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14446 # the usual for 2d2mod
14447 dotest cvsadm-1d28j "cat dir/dir2d2/CVS/Repository" "mod2"
14448 dotest cvsadm-1d28l "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14454 dotest cvsadm-1d29 "${testcvs} co -d dir 2d2mod 2d2mod-2" \
14455 "${PROG} checkout: Updating dir/dir2d2/sub2d2
14456 U dir/dir2d2/sub2d2/file2
14457 ${PROG} checkout: Updating dir/dir2d2-2/sub2d2-2
14458 U dir/dir2d2-2/sub2d2-2/file2-2"
14459 dotest cvsadm-1d29b "cat CVS/Repository" "\."
14460 # the usual for the dir level
14461 dotest cvsadm-1d29d "cat dir/CVS/Repository" "\."
14462 # the usual for 2d2mod
14463 dotest cvsadm-1d29f "cat dir/dir2d2/CVS/Repository" "mod2"
14464 dotest cvsadm-1d29h "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14465 # the usual for 2d2mod
14466 dotest cvsadm-1d29j "cat dir/dir2d2-2/CVS/Repository" "mod2-2"
14467 dotest cvsadm-1d29l "cat dir/dir2d2-2/sub2d2-2/CVS/Repository" \
14471 ##################################################
14472 ## And now, some of that again using the "-d" flag
14473 ## on the command line, but use a longer path.
14474 ##################################################
14476 dotest_fail cvsadm-2d3-1 "${testcvs} co -d dir/dir2 1mod" \
14477 "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .dir.: No such file or directory"
14479 if $remote; then :; else
14480 # Remote can't handle this, even with the "mkdir dir".
14481 # This was also true of CVS 1.9.
14484 dotest cvsadm-2d3 "${testcvs} co -d dir/dir2 1mod" \
14485 "${PROG} checkout: Updating dir/dir2
14487 dotest cvsadm-2d3b "cat CVS/Repository" "\."
14488 dotest_fail cvsadm-2d3d "test -f dir/CVS/Repository" ""
14489 dotest cvsadm-2d3f "cat dir/dir2/CVS/Repository" "mod1"
14493 dotest cvsadm-2d4 "${testcvs} co -d dir/dir2 2mod" \
14494 "${PROG} checkout: Updating dir/dir2
14496 dotest cvsadm-2d4b "cat CVS/Repository" "\."
14497 dotest cvsadm-2d4f "cat dir/dir2/CVS/Repository" "mod2/sub2"
14501 dotest cvsadm-2d5 "${testcvs} co -d dir/dir2 1d1mod" \
14502 "${PROG} checkout: Updating dir/dir2
14504 dotest cvsadm-2d5b "cat CVS/Repository" "\."
14505 dotest cvsadm-2d5f "cat dir/dir2/CVS/Repository" "mod1"
14509 dotest cvsadm-2d6 "${testcvs} co -d dir/dir2 1d2mod" \
14510 "${PROG} checkout: Updating dir/dir2
14512 dotest cvsadm-2d6b "cat CVS/Repository" "\."
14513 dotest cvsadm-2d6f "cat dir/dir2/CVS/Repository" "mod2/sub2"
14517 dotest cvsadm-2d7 "${testcvs} co -d dir/dir2 2d1mod" \
14518 "${PROG} checkout: Updating dir/dir2
14520 dotest cvsadm-2d7b "cat CVS/Repository" "\."
14521 dotest cvsadm-2d7f "cat dir/dir2/CVS/Repository" "mod1"
14525 dotest cvsadm-2d8 "${testcvs} co -d dir/dir2 2d2mod" \
14526 "${PROG} checkout: Updating dir/dir2
14528 dotest cvsadm-2d8b "cat CVS/Repository" "\."
14529 dotest cvsadm-2d8f "cat dir/dir2/CVS/Repository" "mod2/sub2"
14532 ##################################################
14533 ## And now, a few of those tests revisited to
14534 ## test the behavior of the -N flag.
14535 ##################################################
14537 dotest cvsadm-N3 "${testcvs} co -N 1mod" \
14538 "${PROG} checkout: Updating 1mod
14540 dotest cvsadm-N3b "cat CVS/Repository" "\."
14541 dotest cvsadm-N3d "cat 1mod/CVS/Repository" "mod1"
14544 dotest cvsadm-N4 "${testcvs} co -N 2mod" \
14545 "${PROG} checkout: Updating 2mod
14547 dotest cvsadm-N4b "cat CVS/Repository" "\."
14548 dotest cvsadm-N4d "cat 2mod/CVS/Repository" "mod2/sub2"
14551 dotest cvsadm-N5 "${testcvs} co -N 1d1mod" \
14552 "${PROG} checkout: Updating dir1d1
14554 dotest cvsadm-N5b "cat CVS/Repository" "\."
14555 dotest cvsadm-N5d "cat dir1d1/CVS/Repository" "mod1"
14558 dotest cvsadm-N6 "${testcvs} co -N 1d2mod" \
14559 "${PROG} checkout: Updating dir1d2
14561 dotest cvsadm-N6b "cat CVS/Repository" "\."
14562 dotest cvsadm-N6d "cat dir1d2/CVS/Repository" "mod2/sub2"
14565 dotest cvsadm-N7 "${testcvs} co -N 2d1mod" \
14566 "${PROG} checkout: Updating dir2d1/sub2d1
14567 U dir2d1/sub2d1/file1"
14568 dotest cvsadm-N7b "cat CVS/Repository" "\."
14569 dotest cvsadm-N7d "cat dir2d1/CVS/Repository" "\."
14570 dotest cvsadm-N7f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14573 dotest cvsadm-N8 "${testcvs} co -N 2d2mod" \
14574 "${PROG} checkout: Updating dir2d2/sub2d2
14575 U dir2d2/sub2d2/file2"
14576 dotest cvsadm-N8b "cat CVS/Repository" "\."
14577 dotest cvsadm-N8d "cat dir2d2/CVS/Repository" "mod2"
14578 dotest cvsadm-N8f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14581 ## the ones in one-deep directories
14583 dotest cvsadm-N1d3 "${testcvs} co -N -d dir 1mod" \
14584 "${PROG} checkout: Updating dir/1mod
14586 dotest cvsadm-N1d3b "cat CVS/Repository" "\."
14587 dotest cvsadm-N1d3d "cat dir/CVS/Repository" "\."
14588 dotest cvsadm-N1d3f "cat dir/1mod/CVS/Repository" "mod1"
14591 dotest cvsadm-N1d4 "${testcvs} co -N -d dir 2mod" \
14592 "${PROG} checkout: Updating dir/2mod
14594 dotest cvsadm-N1d4b "cat CVS/Repository" "\."
14595 dotest cvsadm-N1d4d "cat dir/CVS/Repository" "mod2"
14596 dotest cvsadm-N1d4f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14599 dotest cvsadm-N1d5 "${testcvs} co -N -d dir 1d1mod" \
14600 "${PROG} checkout: Updating dir/dir1d1
14601 U dir/dir1d1/file1"
14602 dotest cvsadm-N1d5b "cat CVS/Repository" "\."
14603 dotest cvsadm-N1d5d "cat dir/CVS/Repository" "\."
14604 dotest cvsadm-N1d5d "cat dir/dir1d1/CVS/Repository" "mod1"
14607 dotest cvsadm-N1d6 "${testcvs} co -N -d dir 1d2mod" \
14608 "${PROG} checkout: Updating dir/dir1d2
14609 U dir/dir1d2/file2"
14610 dotest cvsadm-N1d6b "cat CVS/Repository" "\."
14611 dotest cvsadm-N1d6d "cat dir/CVS/Repository" "mod2"
14612 dotest cvsadm-N1d6f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14615 dotest cvsadm-N1d7 "${testcvs} co -N -d dir 2d1mod" \
14616 "${PROG} checkout: Updating dir/dir2d1/sub2d1
14617 U dir/dir2d1/sub2d1/file1"
14618 dotest cvsadm-N1d7b "cat CVS/Repository" "\."
14619 dotest cvsadm-N1d7d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
14620 dotest cvsadm-N1d7f "cat dir/dir2d1/CVS/Repository" "\."
14621 dotest cvsadm-N1d7h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14624 dotest cvsadm-N1d8 "${testcvs} co -N -d dir 2d2mod" \
14625 "${PROG} checkout: Updating dir/dir2d2/sub2d2
14626 U dir/dir2d2/sub2d2/file2"
14627 dotest cvsadm-N1d8b "cat CVS/Repository" "\."
14628 dotest cvsadm-N1d8d "cat dir/CVS/Repository" "\."
14629 dotest cvsadm-N1d8d "cat dir/dir2d2/CVS/Repository" "mod2"
14630 dotest cvsadm-N1d8d "cat dir/dir2d2/sub2d2/CVS/Repository" \
14634 ## the ones in two-deep directories
14637 dotest cvsadm-N2d3 "${testcvs} co -N -d dir/dir2 1mod" \
14638 "${PROG} checkout: Updating dir/dir2/1mod
14639 U dir/dir2/1mod/file1"
14640 dotest cvsadm-N2d3b "cat CVS/Repository" "\."
14641 dotest cvsadm-N2d3f "cat dir/dir2/CVS/Repository" "\."
14642 dotest cvsadm-N2d3h "cat dir/dir2/1mod/CVS/Repository" "mod1"
14646 dotest cvsadm-N2d4 "${testcvs} co -N -d dir/dir2 2mod" \
14647 "${PROG} checkout: Updating dir/dir2/2mod
14648 U dir/dir2/2mod/file2"
14649 dotest cvsadm-N2d4b "cat CVS/Repository" "\."
14650 dotest cvsadm-N2d4f "cat dir/dir2/CVS/Repository" "mod2"
14651 dotest cvsadm-N2d4h "cat dir/dir2/2mod/CVS/Repository" "mod2/sub2"
14655 dotest cvsadm-N2d5 "${testcvs} co -N -d dir/dir2 1d1mod" \
14656 "${PROG} checkout: Updating dir/dir2/dir1d1
14657 U dir/dir2/dir1d1/file1"
14658 dotest cvsadm-N2d5b "cat CVS/Repository" "\."
14659 dotest cvsadm-N2d5f "cat dir/dir2/CVS/Repository" "\."
14660 dotest cvsadm-N2d5h "cat dir/dir2/dir1d1/CVS/Repository" "mod1"
14664 dotest cvsadm-N2d6 "${testcvs} co -N -d dir/dir2 1d2mod" \
14665 "${PROG} checkout: Updating dir/dir2/dir1d2
14666 U dir/dir2/dir1d2/file2"
14667 dotest cvsadm-N2d6b "cat CVS/Repository" "\."
14668 dotest cvsadm-N2d6f "cat dir/dir2/CVS/Repository" "mod2"
14669 dotest cvsadm-N2d6h "cat dir/dir2/dir1d2/CVS/Repository" "mod2/sub2"
14673 dotest cvsadm-N2d7 "${testcvs} co -N -d dir/dir2 2d1mod" \
14674 "${PROG} checkout: Updating dir/dir2/dir2d1/sub2d1
14675 U dir/dir2/dir2d1/sub2d1/file1"
14676 dotest cvsadm-N2d7b "cat CVS/Repository" "\."
14677 dotest cvsadm-N2d7f "cat dir/dir2/CVS/Repository" "CVSROOT/Emptydir"
14678 dotest cvsadm-N2d7g "cat dir/dir2/dir2d1/CVS/Repository" "\."
14679 dotest cvsadm-N2d7h "cat dir/dir2/dir2d1/sub2d1/CVS/Repository" \
14684 dotest cvsadm-N2d8 "${testcvs} co -N -d dir/dir2 2d2mod" \
14685 "${PROG} checkout: Updating dir/dir2/dir2d2/sub2d2
14686 U dir/dir2/dir2d2/sub2d2/file2"
14687 dotest cvsadm-N2d8b "cat CVS/Repository" "\."
14688 dotest cvsadm-N2d8f "cat dir/dir2/CVS/Repository" "\."
14689 dotest cvsadm-N2d8h "cat dir/dir2/dir2d2/CVS/Repository" "mod2"
14690 dotest cvsadm-N2d8j "cat dir/dir2/dir2d2/sub2d2/CVS/Repository" \
14694 fi # end of tests to be skipped for remote
14696 ##################################################
14697 ## That's enough of that, thank you very much.
14698 ##################################################
14700 dotest cvsadm-cleanup-1 "${testcvs} -q co CVSROOT/config" \
14703 echo "# empty file" >config
14704 dotest cvsadm-cleanup-2 "${testcvs} -q ci -m cvsadm-cleanup" \
14705 "Checking in config;
14706 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
14707 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
14709 ${PROG} commit: Rebuilding administrative file database"
14716 rm -rf ${CVSROOT_DIRNAME}/1mod
14717 rm -rf ${CVSROOT_DIRNAME}/1mod-2
14718 rm -rf ${CVSROOT_DIRNAME}/2mod
14719 rm -rf ${CVSROOT_DIRNAME}/2mod-2
14720 rm -rf ${CVSROOT_DIRNAME}/mod1
14721 rm -rf ${CVSROOT_DIRNAME}/mod1-2
14722 rm -rf ${CVSROOT_DIRNAME}/mod2
14723 rm -rf ${CVSROOT_DIRNAME}/mod2-2
14727 # Various tests of the Emptydir (CVSNULLREPOS) code. See also:
14728 # cvsadm: tests of Emptydir in various module definitions
14729 # basicb: Test that "Emptydir" is non-special in ordinary contexts
14732 dotest emptydir-1 "${testcvs} co CVSROOT/modules" \
14733 "U CVSROOT/modules"
14734 echo "# Module defs for emptydir tests" > CVSROOT/modules
14735 echo "2d1mod -d dir2d1/sub/sub2d1 mod1" >> CVSROOT/modules
14736 echo "2d1moda -d dir2d1/suba moda/modasub" >> CVSROOT/modules
14737 echo "2d1modb -d dir2d1/suba mod1" >> CVSROOT/modules
14738 echo "comb -a 2d1modb 2d1moda" >> CVSROOT/modules
14740 dotest emptydir-2 "${testcvs} ci -m add-modules" \
14741 "${PROG} [a-z]*: Examining CVSROOT
14742 Checking in CVSROOT/modules;
14743 ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
14744 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
14746 ${PROG} commit: Rebuilding administrative file database" \
14747 "${PROG} commit: Examining CVSROOT"
14750 mkdir ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda
14751 # Populate. Not sure we really need to do this.
14752 dotest emptydir-3 "${testcvs} -q co -l ." ""
14753 dotest emptydir-3a "${testcvs} co mod1 moda" \
14754 "${PROG} checkout: Updating mod1
14755 ${PROG} checkout: Updating moda"
14756 echo "file1" > mod1/file1
14758 dotest emptydir-3b "${testcvs} add moda/modasub" \
14759 "Directory ${CVSROOT_DIRNAME}/moda/modasub added to the repository"
14760 echo "filea" > moda/modasub/filea
14761 dotest emptydir-4 "${testcvs} add mod1/file1 moda/modasub/filea" \
14762 "${PROG} add: scheduling file .mod1/file1. for addition
14763 ${PROG} add: scheduling file .moda/modasub/filea. for addition
14764 ${PROG} add: use .${PROG} commit. to add these files permanently"
14765 dotest emptydir-5 "${testcvs} -q ci -m yup" \
14766 "RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
14768 Checking in mod1/file1;
14769 ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
14770 initial revision: 1\.1
14772 RCS file: ${CVSROOT_DIRNAME}/moda/modasub/filea,v
14774 Checking in moda/modasub/filea;
14775 ${CVSROOT_DIRNAME}/moda/modasub/filea,v <-- filea
14776 initial revision: 1\.1
14778 rm -rf mod1 moda CVS
14781 dotest emptydir-6 "${testcvs} co 2d1mod" \
14782 "${PROG} checkout: Updating dir2d1/sub/sub2d1
14783 U dir2d1/sub/sub2d1/file1"
14786 # It doesn't make any sense to add a file (or do much of anything
14787 # else) in Emptydir; Emptydir is a placeholder indicating that
14788 # the working directory doesn't correspond to anything in
14790 dotest_fail emptydir-7 "${testcvs} add emptyfile" \
14791 "${PROG} \[add aborted\]: cannot add to ${CVSROOT_DIRNAME}/CVSROOT/Emptydir"
14793 dotest_fail emptydir-8 "${testcvs} add emptydir" \
14794 "${PROG} \[[a-z]* aborted\]: cannot add to ${CVSROOT_DIRNAME}/CVSROOT/Emptydir"
14798 # OK, while we have an Emptydir around, test a few obscure
14800 mkdir edir; cd edir
14801 dotest emptydir-9 "${testcvs} -q co -l CVSROOT" \
14802 "U CVSROOT${DOTSTAR}"
14804 dotest_fail emptydir-10 "test -d Emptydir" ''
14805 # This tests the code in find_dirs which skips Emptydir.
14806 dotest emptydir-11 "${testcvs} -q -n update -d -P" ''
14811 # Now start playing with moda.
14813 dotest emptydir-12 "${testcvs} -q co 2d1moda" \
14814 "U dir2d1/suba/filea"
14815 # OK, this is the crux of the matter. This used to show "Emptydir",
14816 # but everyone seemed to think it should show "moda". This
14817 # usually works better, but not always as shown by the following
14819 dotest emptydir-13 "cat dir2d1/CVS/Repository" "moda"
14820 dotest_fail emptydir-14 "${testcvs} co comb" \
14821 "${PROG} checkout: existing repository ${CVSROOT_DIRNAME}/moda/modasub does not match ${CVSROOT_DIRNAME}/mod1
14822 ${PROG} checkout: ignoring module 2d1modb
14823 ${PROG} checkout: Updating dir2d1/suba"
14824 dotest emptydir-15 "cat dir2d1/CVS/Repository" "moda"
14827 # Test the effect of a non-cvs directory already existing with the
14828 # same name as one in the modules file.
14831 dotest emptydir-16 "${testcvs} co 2d1mod" \
14832 "${PROG} checkout: Updating dir2d1/sub/sub2d1
14833 U dir2d1/sub/sub2d1/file1"
14834 dotest emptydir-17 "test -d dir2d1/CVS"
14838 echo Keeping ${TESTDIR} and exiting due to --keep
14844 rm -rf ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda
14845 # I guess for the moment the convention is going to be
14846 # that we don't need to remove ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
14851 # These tests test the thituations thin thwitch thoo theck
14852 # things thout twith thabsolute thaths. Threally.
14858 # Create a few modules to use
14859 mkdir ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/mod2
14860 dotest abspath-1a "${testcvs} co mod1 mod2" \
14861 "${PROG} checkout: Updating mod1
14862 ${PROG} checkout: Updating mod2"
14864 # Populate the module
14865 echo "file1" > mod1/file1
14866 echo "file2" > mod2/file2
14868 dotest abspath-1ba "${testcvs} add file1" \
14869 "${PROG} add: scheduling file .file1. for addition
14870 ${PROG} add: use .${PROG} commit. to add this file permanently"
14873 dotest abspath-1bb "${testcvs} add file2" \
14874 "${PROG} add: scheduling file .file2. for addition
14875 ${PROG} add: use .${PROG} commit. to add this file permanently"
14878 dotest abspath-1c "${testcvs} ci -m yup mod1 mod2" \
14879 "${PROG} [a-z]*: Examining mod1
14880 ${PROG} [a-z]*: Examining mod2
14881 RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
14883 Checking in mod1/file1;
14884 ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
14885 initial revision: 1.1
14887 RCS file: ${CVSROOT_DIRNAME}/mod2/file2,v
14889 Checking in mod2/file2;
14890 ${CVSROOT_DIRNAME}/mod2/file2,v <-- file2
14891 initial revision: 1.1
14893 # Finished creating the module -- clean up.
14894 rm -rf CVS mod1 mod2
14897 # Try checking out the module in a local directory
14899 dotest_fail abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
14900 "${PROG} \[checkout aborted\]: absolute pathname .${TESTDIR}/1. illegal for server"
14901 dotest abspath-2a-try2 "${testcvs} co -d 1 mod1" \
14902 "${PROG} checkout: Updating 1
14905 dotest abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
14906 "${PROG} checkout: Updating ${TESTDIR}/1
14907 U ${TESTDIR}/1/file1"
14908 fi # remote workaround
14910 dotest abspath-2b "cat ${TESTDIR}/1/CVS/Repository" "mod1"
14913 rm -rf ${TESTDIR}/1
14916 # Now try in a subdirectory. We're not covering any more
14917 # code here, but we might catch a future error if someone
14918 # changes the checkout code.
14920 # Note that for the same reason that the shell command
14921 # "touch 1/2/3" requires directories 1 and 1/2 to already
14922 # exist, we expect ${TESTDIR}/1 to already exist. I believe
14923 # this is the behavior of CVS 1.9 and earlier.
14924 if $remote; then :; else
14925 dotest_fail abspath-3.1 "${testcvs} co -d ${TESTDIR}/1/2 mod1" \
14926 "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .${TESTDIR}/1.: No such file or directory"
14928 dotest_fail abspath-3.2 "${testcvs} co -d 1/2 mod1" \
14929 "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .1.: No such file or directory"
14934 # The server wants the directory to exist, but that is
14935 # a bug, it should only need to exist on the client side.
14936 # See also cvsadm-2d3.
14937 dotest_fail abspath-3a "${testcvs} co -d 1/2 mod1" \
14938 "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .1.: No such file or directory"
14940 dotest abspath-3a-try2 "${testcvs} co -d 2 mod1" \
14941 "${PROG} checkout: Updating 2
14946 dotest abspath-3a "${testcvs} co -d ${TESTDIR}/1/2 mod1" \
14947 "${PROG} checkout: Updating ${TESTDIR}/1/2
14948 U ${TESTDIR}/1/2/file1"
14949 fi # remote workaround
14950 dotest abspath-3b "cat ${TESTDIR}/1/2/CVS/Repository" "mod1"
14952 # For all the same reasons that we want "1" to already
14953 # exist, we don't to mess with it to traverse it, for
14954 # example by creating a CVS directory.
14956 dotest_fail abspath-3c "test -d ${TESTDIR}/1/CVS" ''
14958 rm -rf ${TESTDIR}/1
14961 # Now try someplace where we don't have permission.
14962 mkdir ${TESTDIR}/barf
14963 chmod -w ${TESTDIR}/barf
14964 dotest_fail abspath-4r "${testcvs} co -d ${TESTDIR}/barf/sub mod1" \
14965 "${PROG} \[checkout aborted\]: absolute pathname .${TESTDIR}/barf/sub. illegal for server" \
14966 "${PROG} \[checkout aborted\]: cannot make directory sub: Permission denied"
14967 chmod +w ${TESTDIR}/barf
14968 rmdir ${TESTDIR}/barf
14969 # Done. Nothing to clean up.
14972 # Try checking out two modules into the same directory.
14974 dotest abspath-5ar "${testcvs} co -d 1 mod1 mod2" \
14975 "${PROG} checkout: Updating 1/mod1
14977 ${PROG} checkout: Updating 1/mod2
14980 dotest abspath-5a "${testcvs} co -d ${TESTDIR}/1 mod1 mod2" \
14981 "${PROG} checkout: Updating ${TESTDIR}/1/mod1
14982 U ${TESTDIR}/1/mod1/file1
14983 ${PROG} checkout: Updating ${TESTDIR}/1/mod2
14984 U ${TESTDIR}/1/mod2/file2"
14985 fi # end remote workaround
14986 dotest abspath-5b "cat ${TESTDIR}/1/CVS/Repository" "\."
14987 dotest abspath-5c "cat ${TESTDIR}/1/mod1/CVS/Repository" "mod1"
14988 dotest abspath-5d "cat ${TESTDIR}/1/mod2/CVS/Repository" "mod2"
14990 rm -rf ${TESTDIR}/1
14993 # Try checking out the top-level module.
14995 dotest abspath-6ar "${testcvs} co -d 1 ." \
14996 "${PROG} checkout: Updating 1
14997 ${PROG} checkout: Updating 1/CVSROOT
14999 ${PROG} checkout: Updating 1/mod1
15001 ${PROG} checkout: Updating 1/mod2
15004 dotest abspath-6a "${testcvs} co -d ${TESTDIR}/1 ." \
15005 "${PROG} checkout: Updating ${TESTDIR}/1
15006 ${PROG} checkout: Updating ${TESTDIR}/1/CVSROOT
15008 ${PROG} checkout: Updating ${TESTDIR}/1/mod1
15009 U ${TESTDIR}/1/mod1/file1
15010 ${PROG} checkout: Updating ${TESTDIR}/1/mod2
15011 U ${TESTDIR}/1/mod2/file2"
15012 fi # end of remote workaround
15013 dotest abspath-6b "cat ${TESTDIR}/1/CVS/Repository" "\."
15014 dotest abspath-6c "cat ${TESTDIR}/1/CVSROOT/CVS/Repository" "CVSROOT"
15015 dotest abspath-6c "cat ${TESTDIR}/1/mod1/CVS/Repository" "mod1"
15016 dotest abspath-6d "cat ${TESTDIR}/1/mod2/CVS/Repository" "mod2"
15018 rm -rf ${TESTDIR}/1
15020 # Test that an absolute pathname to some other directory
15021 # doesn't mess with the current working directory.
15025 dotest_fail abspath-7ar "${testcvs} -q co -d ../2 mod2" \
15026 "${PROG} checkout: protocol error: .\.\./2. contains more leading \.\.
15027 ${PROG} \[checkout aborted\]: than the 0 which Max-dotdot specified"
15029 dotest abspath-7a-try2r "${testcvs} -q co -d 2 mod2" \
15033 dotest abspath-7a "${testcvs} -q co -d ${TESTDIR}/2 mod2" \
15034 "U ${TESTDIR}/2/file2"
15035 fi # remote workaround
15036 dotest abspath-7b "ls" ""
15037 dotest abspath-7c "${testcvs} -q co mod1" \
15042 dotest abspath-7dr "${testcvs} -q co -d 3 mod2" \
15046 dotest abspath-7d "${testcvs} -q co -d ${TESTDIR}/3 mod2" \
15047 "U ${TESTDIR}/3/file2"
15048 fi # remote workaround
15049 dotest abspath-7e "${testcvs} -q update -d" ""
15054 # FIXME: do other functions here (e.g. update /tmp/foo)
15057 # Finished with all tests. Remove the module.
15058 rm -rf ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/mod2
15065 # More absolute path checks. The following used to attempt to create
15066 # directories in /:
15068 # $ cvs -d:fork:/cvsroot co /foo
15069 # cvs checkout: warning: cannot make directory CVS in /: Permission denied
15070 # cvs [checkout aborted]: cannot make directory /foo: Permission denied
15073 # The -z9 in this test also checks for an old server bug where the
15074 # server would block indefinitely attempting to read an EOF from the
15075 # client in the compression buffer shutdown routine.
15076 dotest_fail abspath2-1 "$testcvs -z9 co /foo" \
15077 "$PROG \[checkout aborted\]: Absolute module reference invalid: \`/foo'" \
15078 "$PROG \[server aborted\]: Absolute module reference invalid: \`/foo'
15079 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
15085 # test the feature that cvs creates a CVS subdir also for
15086 # the toplevel directory
15088 # First set the TopLevelAdmin setting.
15090 dotest toplevel-1a "${testcvs} -q co CVSROOT/config" \
15093 echo "TopLevelAdmin=yes" >config
15094 dotest toplevel-1b "${testcvs} -q ci -m yes-top-level" \
15095 "Checking in config;
15096 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
15097 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
15099 ${PROG} commit: Rebuilding administrative file database"
15104 dotest toplevel-1 "${testcvs} -q co -l ." ''
15105 mkdir top-dir second-dir
15106 dotest toplevel-2 "${testcvs} add top-dir second-dir" \
15107 "Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
15108 Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
15112 dotest toplevel-3 "${testcvs} add file1" \
15113 "${PROG} add: scheduling file .file1. for addition
15114 ${PROG} add: use .${PROG} commit. to add this file permanently"
15115 dotest toplevel-4 "${testcvs} -q ci -m add" \
15116 "RCS file: ${CVSROOT_DIRNAME}/top-dir/file1,v
15119 ${CVSROOT_DIRNAME}/top-dir/file1,v <-- file1
15120 initial revision: 1\.1
15126 dotest toplevel-3s "${testcvs} add file2" \
15127 "${PROG} add: scheduling file .file2. for addition
15128 ${PROG} add: use .${PROG} commit. to add this file permanently"
15129 dotest toplevel-4s "${testcvs} -q ci -m add" \
15130 "RCS file: ${CVSROOT_DIRNAME}/second-dir/file2,v
15133 ${CVSROOT_DIRNAME}/second-dir/file2,v <-- file2
15134 initial revision: 1\.1
15138 rm -r 1; mkdir 1; cd 1
15139 dotest toplevel-5 "${testcvs} co top-dir" \
15140 "${PROG} checkout: Updating top-dir
15143 dotest toplevel-6 "${testcvs} update top-dir" \
15144 "${PROG} update: Updating top-dir"
15145 dotest toplevel-7 "${testcvs} update" \
15146 "${PROG} update: Updating \.
15147 ${PROG} update: Updating top-dir"
15149 dotest toplevel-8 "${testcvs} update -d top-dir" \
15150 "${PROG} update: Updating top-dir"
15151 # There is some sentiment that
15152 # "${PROG} update: Updating \.
15153 # ${PROG} update: Updating top-dir"
15154 # is correct but it isn't clear why that would be correct instead
15155 # of the remote CVS behavior (which also updates CVSROOT).
15157 # The DOTSTAR matches of a bunch of lines like
15158 # "U CVSROOT/checkoutlist". Trying to match them more precisely
15159 # seemed to cause trouble. For example CVSROOT/cvsignore will
15160 # be present or absent depending on whether we ran the "ignore"
15162 dotest toplevel-9 "${testcvs} update -d" \
15163 "${PROG} update: Updating \.
15164 ${PROG} update: Updating CVSROOT
15166 ${PROG} update: Updating top-dir"
15169 rm -r 1; mkdir 1; cd 1
15170 dotest toplevel-10 "${testcvs} co top-dir" \
15171 "${PROG} checkout: Updating top-dir
15174 # This tests more or less the same thing, in a particularly
15175 # "real life" example.
15176 dotest toplevel-11 "${testcvs} -q update -d second-dir" \
15177 "U second-dir/file2"
15179 # Now remove the CVS directory (people may do this manually,
15180 # especially if they formed their habits with CVS
15181 # 1.9 and older, which didn't create it. Or perhaps the working
15182 # directory itself was created with 1.9 or older).
15184 # Now set the permissions so we can't recreate it.
15185 if test -n "$remotehost"; then
15187 $CVS_RSH $remotehost "chmod -w $TESTDIR/1"
15191 # Now see whether CVS has trouble because it can't create CVS.
15192 # First string is for local, second is for remote.
15193 dotest toplevel-12 "${testcvs} co top-dir" \
15194 "${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
15195 ${PROG} checkout: Updating top-dir" \
15196 "${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
15197 ${PROG} checkout: in directory \.:
15198 ${PROG} checkout: cannot open CVS/Entries for reading: No such file or directory
15199 ${PROG} checkout: Updating top-dir"
15203 dotest toplevel-cleanup-1 "${testcvs} -q co CVSROOT/config" \
15206 echo "# empty file" >config
15207 dotest toplevel-cleanup-2 "${testcvs} -q ci -m toplevel-cleanup" \
15208 "Checking in config;
15209 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
15210 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
15212 ${PROG} commit: Rebuilding administrative file database"
15216 rm -rf ${CVSROOT_DIRNAME}/top-dir ${CVSROOT_DIRNAME}/second-dir
15220 # Similar to toplevel, but test the case where TopLevelAdmin=no.
15222 # First set the TopLevelAdmin setting.
15224 dotest toplevel2-1a "${testcvs} -q co CVSROOT/config" \
15227 echo "TopLevelAdmin=no" >config
15228 dotest toplevel2-1b "${testcvs} -q ci -m no-top-level" \
15229 "Checking in config;
15230 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
15231 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
15233 ${PROG} commit: Rebuilding administrative file database"
15237 # Now set up some directories and subdirectories
15239 dotest toplevel2-1 "${testcvs} -q co -l ." ''
15240 mkdir top-dir second-dir
15241 dotest toplevel2-2 "${testcvs} add top-dir second-dir" \
15242 "Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
15243 Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
15247 dotest toplevel2-3 "${testcvs} add file1" \
15248 "${PROG} add: scheduling file .file1. for addition
15249 ${PROG} add: use .${PROG} commit. to add this file permanently"
15250 dotest toplevel2-4 "${testcvs} -q ci -m add" \
15251 "RCS file: ${CVSROOT_DIRNAME}/top-dir/file1,v
15254 ${CVSROOT_DIRNAME}/top-dir/file1,v <-- file1
15255 initial revision: 1\.1
15261 dotest toplevel2-3s "${testcvs} add file2" \
15262 "${PROG} add: scheduling file .file2. for addition
15263 ${PROG} add: use .${PROG} commit. to add this file permanently"
15264 dotest toplevel2-4s "${testcvs} -q ci -m add" \
15265 "RCS file: ${CVSROOT_DIRNAME}/second-dir/file2,v
15268 ${CVSROOT_DIRNAME}/second-dir/file2,v <-- file2
15269 initial revision: 1\.1
15273 rm -r 1; mkdir 1; cd 1
15274 dotest toplevel2-5 "${testcvs} co top-dir" \
15275 "${PROG} checkout: Updating top-dir
15278 dotest toplevel2-6 "${testcvs} update top-dir" \
15279 "${PROG} update: Updating top-dir"
15280 dotest toplevel2-7 "${testcvs} update" \
15281 "${PROG} update: Updating top-dir"
15283 dotest toplevel2-8 "${testcvs} update -d top-dir" \
15284 "${PROG} update: Updating top-dir"
15285 # Contrast this with toplevel-9, which has TopLevelAdmin=yes.
15286 dotest toplevel2-9 "${testcvs} update -d" \
15287 "${PROG} update: Updating top-dir"
15290 rm -r 1; mkdir 1; cd 1
15291 dotest toplevel2-10 "${testcvs} co top-dir" \
15292 "${PROG} checkout: Updating top-dir
15294 # This tests more or less the same thing, in a particularly
15295 # "real life" example. With TopLevelAdmin=yes, this command
15296 # would give us second-dir and CVSROOT directories too.
15297 dotest toplevel2-11 "${testcvs} -q update -d" ""
15299 dotest toplevel2-cleanup-1 "${testcvs} -q co CVSROOT/config" \
15302 echo "# empty file" >config
15303 dotest toplevel2-cleanup-2 "${testcvs} -q ci -m toplevel2-cleanup" \
15304 "Checking in config;
15305 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
15306 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
15308 ${PROG} commit: Rebuilding administrative file database"
15311 rm -rf ${CVSROOT_DIRNAME}/top-dir ${CVSROOT_DIRNAME}/second-dir
15317 # This test used to confirm a bug that existed in the r* commands
15318 # run against the top-level project prior to CVS 1.11.18 & 1.12.10.
15320 # The assertion failure was something like:
15321 # do_recursion: Assertion \`strstr (repository, \"/\./\") == ((void \*)0)' failed\..*"
15322 dotest rstar-toplevel-1 "$testcvs -q rlog ." \
15324 RCS file: $CVSROOT_DIRNAME/CVSROOT$DOTSTAR"
15327 echo Keeping ${TESTDIR} and exiting due to --keep
15335 # Some tests of CVS's reactions to path specifications containing
15336 # trailing slashes.
15337 mkdir trailingslashes; cd trailingslashes
15338 dotest trailingslashes-init-1 "$testcvs -Q co -ldt ."
15339 dotest trailingslashes-init-2 "$testcvs -Q co -dt2 ."
15341 echo "Ahh'll be baaack." >topfile
15342 dotest trailingslashes-init-3 "$testcvs -Q add topfile"
15343 dotest trailingslashes-init-4 "$testcvs -Q ci -mto-top" \
15344 "RCS file: $CVSROOT_DIRNAME/topfile,v
15346 Checking in topfile;
15347 $CVSROOT_DIRNAME/topfile,v <-- topfile
15348 initial revision: 1\.1
15351 # First, demonstrate the usual case.
15353 dotest trailingslashes-1 "$testcvs -q up CVSROOT"
15354 dotest_fail trailingslashes-1a "test -f topfile"
15356 # Now the one that used to fail in remote mode prior to 1.11.24
15357 # & 1.12.14. Formerly TODO item #205.
15358 dotest trailingslashes-2 "$testcvs -q up CVSROOT/"
15359 dotest_fail trailingslashes-2a "test -f topfile"
15362 echo Keeping $TESTDIR and exiting due to --keep
15367 rm -rf trailingslashes $CVSROOT_DIRNAME/topfile,v
15372 checkout_repository)
15373 dotest_fail checkout_repository-1 \
15374 "${testcvs} co -d ${CVSROOT_DIRNAME} CVSROOT" \
15375 "${PROG} \[checkout aborted\]: Cannot check out files into the repository itself" \
15376 "${PROG} \[checkout aborted\]: absolute pathname \`${CVSROOT_DIRNAME}' illegal for server"
15378 # The behavior of the client/server test below should be correct.
15379 # The CVS client currently has no way of knowing that the client and
15380 # server are the same machine and thus skips the $CVSROOT checks.
15381 # I think checking for this case in CVS would be bloat since this
15382 # should be a fairly rare occurance.
15383 cd ${CVSROOT_DIRNAME}
15384 dotest_fail checkout_repository-2 "${testcvs} co CVSROOT" \
15385 "${PROG} \[checkout aborted\]: Cannot check out files into the repository itself" \
15386 "${PROG} checkout: Updating CVSROOT
15387 ${PROG} checkout: move away CVSROOT/checkoutlist; it is in the way
15388 C CVSROOT/checkoutlist
15389 ${PROG} checkout: move away CVSROOT/commitinfo; it is in the way
15390 C CVSROOT/commitinfo
15391 ${PROG} checkout: move away CVSROOT/config; it is in the way
15393 ${PROG} checkout: move away CVSROOT/cvswrappers; it is in the way
15394 C CVSROOT/cvswrappers
15395 ${PROG} checkout: move away CVSROOT/editinfo; it is in the way
15397 ${PROG} checkout: move away CVSROOT/loginfo; it is in the way
15399 ${PROG} checkout: move away CVSROOT/modules; it is in the way
15401 ${PROG} checkout: move away CVSROOT/notify; it is in the way
15403 ${PROG} checkout: move away CVSROOT/rcsinfo; it is in the way
15405 ${PROG} checkout: move away CVSROOT/taginfo; it is in the way
15407 ${PROG} checkout: move away CVSROOT/verifymsg; it is in the way
15408 C CVSROOT/verifymsg"
15410 dotest checkout_repository-3 \
15411 "${testcvs} co -p CVSROOT/modules >/dev/null" \
15412 "===================================================================
15413 Checking out CVSROOT/modules
15414 RCS: ${CVSROOT_DIRNAME}/CVSROOT/modules,v
15416 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
15421 for message in '' ' ' '
15424 mkdir a-dir; cd a-dir
15425 # Test handling of -m during import
15427 if ${testcvs} import -m "$message" a-dir A A1 >>${LOGFILE} 2>&1;then
15432 # Must import twice since the first time uses inline code that
15435 if ${testcvs} import -m "$message" a-dir A A2 >>${LOGFILE} 2>&1;then
15440 # Test handling of -m during ci
15442 if ${testcvs} co a-dir >>${LOGFILE} 2>&1; then
15449 if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
15454 # Test handling of -m during rm/ci
15456 if ${testcvs} rm test >>${LOGFILE} 2>&1; then
15461 if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
15469 rm -rf ${CVSROOT_DIRNAME}/a-dir
15474 # More tests of log messages, in this case the ability to
15475 # run an external editor.
15477 # * also test $EDITOR, $CVSEDITOR, &c.
15478 # * test what happens if up-to-date check fails.
15480 # Our "editor" puts "x" at the start of each line, so we
15481 # can see the "CVS:" lines.
15482 cat >${TESTDIR}/editme <<EOF
15485 sed <\$1 -e 's/^/x/' >${TESTDIR}/edit.new
15486 mv ${TESTDIR}/edit.new \$1
15489 chmod +x ${TESTDIR}/editme
15492 dotest editor-1 "${testcvs} -q co -l ." ''
15494 dotest editor-2 "${testcvs} add first-dir" \
15495 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
15498 dotest editor-3 "${testcvs} add file1 file2" \
15499 "${PROG} add: scheduling file .file1. for addition
15500 ${PROG} add: scheduling file .file2. for addition
15501 ${PROG} add: use .${PROG} commit. to add these files permanently"
15502 dotest editor-4 "${testcvs} -e ${TESTDIR}/editme -q ci" \
15503 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
15506 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15507 initial revision: 1\.1
15509 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
15512 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
15513 initial revision: 1\.1
15515 dotest editor-5 "${testcvs} -q tag -b br" "T file1
15517 dotest editor-6 "$testcvs -q update -r br" \
15520 echo modify >>file1
15521 dotest editor-7 "${testcvs} -e ${TESTDIR}/editme -q ci" \
15522 "Checking in file1;
15523 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15524 new revision: 1\.1\.2\.1; previous revision: 1\.1
15526 # OK, now we want to make sure "ci -r" puts in the branch
15527 # where appropriate. Note that we can check in on the branch
15528 # without being on the branch, because there is not a revision
15529 # already on the branch. If there were a revision on the branch,
15530 # CVS would correctly give an up-to-date check failed.
15531 dotest editor-8 "$testcvs -q update -A" \
15534 echo add a line >>file2
15535 dotest editor-9 "${testcvs} -q -e ${TESTDIR}/editme ci -rbr file2" \
15536 "Checking in file2;
15537 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
15538 new revision: 1\.1\.2\.1; previous revision: 1\.1
15541 dotest editor-log-file1 "${testcvs} log -N file1" "
15542 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
15543 Working file: file1
15548 keyword substitution: kv
15549 total revisions: 2; selected revisions: 2
15551 ----------------------------
15553 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
15555 xCVS: ----------------------------------------------------------------------
15556 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
15558 xCVS: Committing in .
15562 xCVS: ----------------------------------------------------------------------
15563 ----------------------------
15564 revision 1\.1\.2\.1
15565 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
15566 xCVS: ----------------------------------------------------------------------
15567 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
15569 xCVS: Committing in .
15571 xCVS: Modified Files:
15574 xCVS: ----------------------------------------------------------------------
15575 ============================================================================="
15577 # The only difference between the two expect strings is the
15578 # presence or absence of "Committing in ." for 1.1.2.1.
15579 dotest editor-log-file2 "${testcvs} log -N file2" "
15580 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
15581 Working file: file2
15586 keyword substitution: kv
15587 total revisions: 2; selected revisions: 2
15589 ----------------------------
15591 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
15593 xCVS: ----------------------------------------------------------------------
15594 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
15596 xCVS: Committing in .
15600 xCVS: ----------------------------------------------------------------------
15601 ----------------------------
15602 revision 1\.1\.2\.1
15603 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
15604 xCVS: ----------------------------------------------------------------------
15605 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
15607 xCVS: Modified Files:
15610 xCVS: ----------------------------------------------------------------------
15611 =============================================================================" "
15612 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
15613 Working file: file2
15618 keyword substitution: kv
15619 total revisions: 2; selected revisions: 2
15621 ----------------------------
15623 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
15625 xCVS: ----------------------------------------------------------------------
15626 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
15628 xCVS: Committing in .
15632 xCVS: ----------------------------------------------------------------------
15633 ----------------------------
15634 revision 1\.1\.2\.1
15635 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
15636 xCVS: ----------------------------------------------------------------------
15637 xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
15639 xCVS: Committing in .
15641 xCVS: Modified Files:
15644 xCVS: ----------------------------------------------------------------------
15645 ============================================================================="
15647 # Test CVS's response to an unchanged log message
15648 cat >${TESTDIR}/editme <<EOF
15653 chmod +x ${TESTDIR}/editme
15654 dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
15656 Log message unchanged or not specified
15657 a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
15658 Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
15660 # Test CVS's response to an empty log message
15661 cat >${TESTDIR}/editme <<EOF
15667 chmod +x ${TESTDIR}/editme
15668 dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
15670 Log message unchanged or not specified
15671 a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
15672 Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
15674 # Test CVS's response to a log message with one blank line
15675 cat >${TESTDIR}/editme <<EOF
15681 chmod +x ${TESTDIR}/editme
15682 dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
15684 Log message unchanged or not specified
15685 a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
15686 Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
15688 # Test CVS's response to a log message with only comments
15689 cat >${TESTDIR}/editme <<EOF
15692 cat \$1 >${TESTDIR}/edit.new
15693 mv ${TESTDIR}/edit.new \$1
15696 chmod +x ${TESTDIR}/editme
15697 dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
15699 Log message unchanged or not specified
15700 a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
15701 Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
15703 # Test CVS's response to a log message that is zero bytes
15704 # in length. This caused core dumps in cvs 1.11.5 on Solaris
15707 dotest editor-emptylog-continue-1 "${testcvs} -q co CVSROOT/loginfo" \
15708 "U CVSROOT/loginfo"
15711 echo 'DEFAULT (echo Start-Log;cat;echo End-Log) >> \$CVSROOT/CVSROOT/commitlog' > loginfo
15712 dotest editor-emptylog-continue-2 "${testcvs} commit -m add loginfo" \
15713 "Checking in loginfo;
15714 ${CVSROOT_DIRNAME}/CVSROOT/loginfo,v <-- loginfo
15715 new revision: 1\.2; previous revision: 1\.1
15717 ${PROG} commit: Rebuilding administrative file database"
15720 cat >${TESTDIR}/editme <<EOF
15726 chmod +x ${TESTDIR}/editme
15727 dotest editor-emptylog-continue-3 "echo c |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
15728 "${PROG} [a-z]*: warning: editor session failed
15730 Log message unchanged or not specified
15731 a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
15732 Action: (continue) Checking in file1;
15733 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15734 new revision: 1\.2; previous revision: 1\.1
15736 # The loginfo Log message should be an empty line and not "(null)"
15737 # which is what some fprintf() implementations do with "%s"
15738 # format and a NULL pointer...
15740 dotest editor-emptylog-continue-4r \
15741 "cat ${CVSROOT_DIRNAME}/CVSROOT/commitlog" \
15743 Update of ${CVSROOT_DIRNAME}/first-dir
15744 In directory ${hostname}:${TMPDIR}/cvs-serv[0-9a-z]*
15752 dotest editor-emptylog-continue-4 \
15753 "cat ${CVSROOT_DIRNAME}/CVSROOT/commitlog" \
15755 Update of ${CVSROOT_DIRNAME}/first-dir
15756 In directory ${hostname}:${TESTDIR}/1/first-dir
15764 # There should have an empty log message at this point
15765 dotest editor-emptylog-continue-5 "${testcvs} log -N -r1.2 file1" \
15767 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
15768 Working file: file1
15773 keyword substitution: kv
15774 total revisions: 3; selected revisions: 1
15776 ----------------------------
15778 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: +0 -0
15779 \*\*\* empty log message \*\*\*
15780 ============================================================================="
15784 echo Keeping ${TESTDIR} and exiting due to --keep
15791 rm ${TESTDIR}/editme
15792 rm -rf ${CVSROOT_DIRNAME}/first-dir
15796 mkdir ${CVSROOT_DIRNAME}/1dir
15799 if ${testcvs} -q co 1dir; then
15806 if ${testcvs} add foo 2>>${LOGFILE}; then
15811 if ${testcvs} ci -m added >>${LOGFILE} 2>&1; then
15819 if ${testcvs} -q co 1dir >>${LOGFILE}; then
15827 if ${testcvs} rm foo >>${LOGFILE} 2>&1; then
15832 if ${testcvs} ci -m removed >>${LOGFILE} 2>&1; then
15839 # The second case in the local and remote versions of errmsg1-168
15840 # below happens on Cygwin under Windows, where write privileges
15841 # aren't enforced properly.
15843 dotest errmsg1-168r "${testcvs} -q update" \
15844 "${PROG} update: foo is no longer in the repository
15845 ${PROG} update: unable to remove \./foo: Permission denied" \
15846 "${PROG} update: foo is no longer in the repository"
15848 dotest errmsg1-168 "${testcvs} -q update" \
15849 "${PROG} update: foo is no longer in the repository
15850 ${PROG} update: unable to remove foo: Permission denied" \
15851 "${PROG} update: foo is no longer in the repository"
15858 rm -rf ${CVSROOT_DIRNAME}/1dir
15862 # More tests of various miscellaneous error handling,
15863 # and cvs add behavior in general.
15864 # See also test basicb-4a, concerning "cvs ci CVS".
15865 # Too many tests to mention test the simple cases of
15866 # adding files and directories.
15867 # Test basicb-2a10 tests cvs -n add.
15869 # First the usual setup; create a directory first-dir.
15871 dotest errmsg2-1 "${testcvs} -q co -l ." ''
15873 dotest errmsg2-2 "${testcvs} add first-dir" \
15874 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
15876 dotest_fail errmsg2-3 "${testcvs} add CVS" \
15877 "${PROG} [a-z]*: cannot add special file .CVS.; skipping"
15879 # For the most part add returns a failure exitstatus if
15880 # there are any errors, even if the remaining files are
15881 # processed without incident. The "cannot add
15882 # special file" message fits this pattern, at
15884 dotest_fail errmsg2-4 "${testcvs} add CVS file1" \
15885 "${PROG} add: cannot add special file .CVS.; skipping
15886 ${PROG} add: scheduling file .file1. for addition
15887 ${PROG} add: use .${PROG} commit. to add this file permanently"
15888 # I'm not sure these tests completely convey the various strange
15889 # behaviors that CVS had before it specially checked for "." and
15890 # "..". Suffice it to say that these are unlikely to work right
15891 # without a special case.
15892 dotest_fail errmsg2-5 "${testcvs} add ." \
15893 "${PROG} [a-z]*: cannot add special file .\..; skipping"
15894 dotest_fail errmsg2-6 "${testcvs} add .." \
15895 "${PROG} [a-z]*: cannot add special file .\.\..; skipping"
15896 # Make sure that none of the error messages left droppings
15897 # which interfere with normal operation.
15898 dotest errmsg2-7 "${testcvs} -q ci -m add-file1" \
15899 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
15902 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
15903 initial revision: 1\.1
15907 dotest errmsg2-8 "${testcvs} add first-dir/sdir" \
15908 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
15909 # while we're here... check commit with no CVS directory
15910 dotest_fail errmsg2-8a "${testcvs} -q ci first-dir nonexistant" \
15911 "${PROG} [a-z]*: nothing known about .nonexistant'
15912 ${PROG} \[[a-z]* aborted\]: correct above errors first!"
15913 dotest_fail errmsg2-8b "${testcvs} -q ci nonexistant first-dir" \
15914 "${PROG} [a-z]*: nothing known about .nonexistant'
15915 ${PROG} \[[a-z]* aborted\]: correct above errors first!"
15916 dotest errmsg2-8c "${testcvs} -q ci first-dir" ""
15922 dotest errmsg2-10 "${testcvs} add file10 sdir10" \
15923 "${PROG} add: scheduling file .file10. for addition
15924 Directory ${CVSROOT_DIRNAME}/first-dir/sdir10 added to the repository
15925 ${PROG} add: use .${PROG} commit. to add this file permanently"
15926 dotest errmsg2-11 "${testcvs} -q ci -m add-file10" \
15927 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
15929 Checking in file10;
15930 ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
15931 initial revision: 1\.1
15933 # Try to see that there are no droppings left by
15934 # any of the previous tests.
15935 dotest errmsg2-12 "${testcvs} -q update" ""
15937 # Now test adding files with '/' in the name, both one level
15938 # down and more than one level down.
15940 mkdir first-dir/sdir10/ssdir
15941 dotest errmsg2-13 "${testcvs} add first-dir/sdir10/ssdir" \
15942 "Directory ${CVSROOT_DIRNAME}/first-dir/sdir10/ssdir added to the repository"
15944 touch first-dir/sdir10/ssdir/ssfile
15945 dotest errmsg2-14 \
15946 "${testcvs} add first-dir/sdir10/ssdir/ssfile" \
15947 "${PROG} add: scheduling file .first-dir/sdir10/ssdir/ssfile. for addition
15948 ${PROG} add: use .${PROG} commit. to add this file permanently"
15949 touch first-dir/file15
15950 dotest errmsg2-15 "${testcvs} add first-dir/file15" \
15951 "${PROG} add: scheduling file .first-dir/file15. for addition
15952 ${PROG} add: use .${PROG} commit. to add this file permanently"
15954 # Now the case where we try to give it a directory which is not
15955 # under CVS control.
15957 touch bogus-dir/file16
15958 # The first message, from local CVS, is nice. The second one
15959 # is not nice; would be good to fix remote CVS to give a clearer
15960 # message (e.g. the one from local CVS). But at least it is an
15962 dotest_fail errmsg2-16 "${testcvs} add bogus-dir/file16" \
15963 "${PROG} add: in directory bogus-dir:
15964 ${PROG} \[add aborted\]: there is no version here; do .${PROG} checkout. first" \
15965 "${PROG} add: cannot open CVS/Entries for reading: No such file or directory
15966 ${PROG} \[add aborted\]: no repository"
15969 # One error condition we don't test for is trying to add a file
15970 # or directory which already is there.
15972 dotest errmsg2-17 "${testcvs} -q ci -m checkin" \
15973 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file15,v
15975 Checking in first-dir/file15;
15976 ${CVSROOT_DIRNAME}/first-dir/file15,v <-- file15
15977 initial revision: 1\.1
15979 RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir10/ssdir/ssfile,v
15981 Checking in first-dir/sdir10/ssdir/ssfile;
15982 ${CVSROOT_DIRNAME}/first-dir/sdir10/ssdir/ssfile,v <-- ssfile
15983 initial revision: 1\.1
15985 dotest errmsg2-18 "${testcvs} -Q tag test" ''
15987 # trying to import the repository
15989 if $remote; then :; else
15990 cd ${CVSROOT_DIRNAME}
15991 dotest_fail errmsg2-20 "${testcvs} import -mtest . A B" \
15992 "${PROG} \[import aborted\]: attempt to import the repository"
15993 dotest_fail errmsg2-21 "${testcvs} import -mtest first-dir A B" \
15994 "${PROG} \[import aborted\]: attempt to import the repository"
15999 rm -rf ${CVSROOT_DIRNAME}/first-dir
16003 # Test some of the error messages the 'add' command can return and
16004 # their reactions to '-q'.
16006 # First the usual setup; create a directory first-dir.
16008 dotest adderrmsg-init1 "${testcvs} -q co -l ." ''
16009 mkdir adderrmsg-dir
16010 dotest adderrmsg-init2 "${testcvs} add adderrmsg-dir" \
16011 "Directory ${CVSROOT_DIRNAME}/adderrmsg-dir added to the repository"
16014 # try to add the admin dir
16015 dotest_fail adderrmsg-1 "${testcvs} add CVS" \
16016 "${PROG} [a-z]*: cannot add special file .CVS.; skipping"
16017 # might not want to see this message when you 'cvs add *'
16018 dotest_fail adderrmsg-2 "${testcvs} -q add CVS" ""
16020 # to test some other messages
16022 dotest adderrmsg-3 "${testcvs} add file1" \
16023 "${PROG} add: scheduling file .file1. for addition
16024 ${PROG} add: use .${PROG} commit. to add this file permanently"
16027 dotest_fail adderrmsg-4 "${testcvs} add file1" \
16028 "${PROG} add: file1 has already been entered"
16029 dotest_fail adderrmsg-5 "${testcvs} -q add file1" ""
16031 dotest adderrmsg-6 "${testcvs} -q ci -madd" \
16032 "RCS file: ${CVSROOT_DIRNAME}/adderrmsg-dir/file1,v
16035 ${CVSROOT_DIRNAME}/adderrmsg-dir/file1,v <-- file1
16036 initial revision: 1\.1
16039 # file in Entries & repository
16040 dotest_fail adderrmsg-7 "${testcvs} add file1" \
16041 "${PROG} add: file1 already exists, with version number 1\.1"
16042 dotest_fail adderrmsg-8 "${testcvs} -q add file1" ""
16046 if $keep; then :; else
16048 rm -rf ${CVSROOT_DIRNAME}/adderrmsg-dir
16053 # Test some option parsing error messages
16055 # No init is necessary since these error messages are printed b4
16056 # CVS looks for a sandbox or repository
16058 # -z used to accept non-numeric arguments. This bit someone who
16059 # attempted `cvs -z -n up' when the -n was read as the argument to
16061 dotest_fail opterrmsg-1 "${testcvs} -z -n up" \
16062 "${PROG}: gzip compression level must be between 0 and 9"
16064 # Some general -z checks
16065 dotest_fail opterrmsg-2 "${testcvs} -z -1 up" \
16066 "${PROG}: gzip compression level must be between 0 and 9"
16067 dotest_fail opterrmsg-3 "${testcvs} -z10 up" \
16068 "${PROG}: gzip compression level must be between 0 and 9"
16072 mkdir ${CVSROOT_DIRNAME}/first-dir
16075 dotest devcom-1 "${testcvs} -q co first-dir"
16079 dotest devcom-2 "${testcvs} add abb" \
16080 "$PROG add: scheduling file \`abb' for addition
16081 $PROG add: use '$PROG commit' to add this file permanently"
16083 dotest devcom-3 "${testcvs} -q ci -m added" \
16084 "RCS file: ${CVSROOT_DIRNAME}/first-dir/abb,v
16087 ${CVSROOT_DIRNAME}/first-dir/abb,v <-- abb
16088 initial revision: 1\.1
16091 dotest_fail devcom-4 "${testcvs} watch" "Usage${DOTSTAR}"
16093 dotest devcom-5 "${testcvs} watch on"
16096 dotest devcom-6 "${testcvs} add abc" \
16097 "$PROG add: scheduling file \`abc' for addition
16098 $PROG add: use '$PROG commit' to add this file permanently"
16100 dotest devcom-7 "${testcvs} -q ci -m added" \
16101 "RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
16104 ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
16105 initial revision: 1\.1
16112 dotest devcom-8 "${testcvs} -q co first-dir" \
16117 dotest_fail devcom-9 "test -w abb"
16118 dotest_fail devcom-9 "test -w abc"
16120 dotest devcom-10 "${testcvs} editors" ""
16122 dotest devcom-11 "${testcvs} edit abb"
16124 # Here we test for the traditional ISO C ctime() date format.
16125 # We assume the C locale; I guess that works provided we set
16126 # LC_ALL at the start of this script but whether these
16127 # strings should vary based on locale does not strike me as
16129 dotest devcom-12 "${testcvs} editors" \
16130 "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"
16133 dotest devcom-13 "${testcvs} ci -m modify abb" \
16135 ${CVSROOT_DIRNAME}/first-dir/abb,v <-- abb
16136 new revision: 1\.2; previous revision: 1\.1
16139 # Unedit of a file not being edited should be a noop.
16140 dotest devcom-14 "${testcvs} unedit abb" ''
16142 dotest devcom-15 "${testcvs} editors" ""
16144 dotest_fail devcom-16 "test -w abb"
16146 dotest devcom-17 "${testcvs} edit abc"
16148 # Unedit of an unmodified file.
16149 dotest devcom-18 "${testcvs} unedit abc"
16150 dotest devcom-19 "${testcvs} edit abc"
16152 echo changedabc >abc
16153 # Try to unedit a modified file; cvs should ask for confirmation
16154 dotest devcom-20 "echo no | ${testcvs} unedit abc" \
16155 "abc has been modified; revert changes? "
16157 dotest devcom-21 "echo changedabc | cmp - abc"
16159 # OK, now confirm the unedit
16160 dotest devcom-22 "echo yes | ${testcvs} unedit abc" \
16161 "abc has been modified; revert changes? "
16163 dotest devcom-23 "echo abc | cmp - abc"
16165 dotest devcom-24 "${testcvs} watchers" ''
16167 # FIXME: This probably should be an error message instead
16168 # of silently succeeding and printing nothing.
16169 dotest devcom-a-nonexist "${testcvs} watchers nonexist" ''
16171 dotest devcom-a1 "${testcvs} watch add" ''
16172 dotest devcom-a2 "${testcvs} watchers" \
16173 "abb ${username} edit unedit commit
16174 abc ${username} edit unedit commit"
16175 dotest devcom-a3 "${testcvs} watch remove -a unedit abb" ''
16176 dotest devcom-a4 "${testcvs} watchers abb" \
16177 "abb ${username} edit commit"
16179 # Check tagging and checking out while we have a CVS
16180 # directory in the repository.
16181 dotest devcom-t0 "${testcvs} -q tag tag" \
16188 # Test commented out because the bug it tests for is not fixed
16190 # cvs watchers: cannot open CVS/Entries for reading: No such file or directory
16191 # cvs: ../../work/ccvs/src/fileattr.c:75: fileattr_read: Assertion `fileattr_stored_repos != ((void *)0)' failed.
16192 : dotest devcom-t-nonexist "${testcvs} watchers nonexist" fixme
16194 dotest devcom-t1 "${testcvs} -q co -rtag first-dir/abb" \
16197 # Since first-dir/abb is readonly, use -f.
16200 # Test checking out the directory rather than the file.
16203 dotest devcom-t2 "${testcvs} -q co -rtag first-dir" \
16207 # Since the files are readonly, use -f.
16210 # Now do it again, after removing the val-tags file created
16211 # by devcom-t1 to force CVS to search the repository
16212 # containing CVS directories.
16213 rm -f ${CVSROOT_DIRNAME}/CVSROOT/val-tags
16216 dotest devcom-t3 "${testcvs} -q co -rtag first-dir" \
16220 # Since the files are readonly, use -f.
16223 # Now remove all the file attributes
16225 dotest devcom-b0 "${testcvs} watch off" ''
16226 dotest devcom-b1 "${testcvs} watch remove" ''
16227 # Test that CVS 1.6 and earlier can handle the repository.
16228 dotest_fail devcom-b2 "test -d ${CVSROOT_DIRNAME}/first-dir/CVS"
16230 # Now test watching just some, not all, files.
16231 dotest devcom-some0 "${testcvs} watch on abc" ''
16235 dotest devcom-some1 "${testcvs} -q co first-dir" 'U first-dir/abb
16237 dotest devcom-some2 "test -w first-dir/abb" ''
16238 dotest_fail devcom-some3 "test -w first-dir/abc" ''
16242 echo Keeping ${TESTDIR} and exiting due to --keep
16246 # Use -f because of the readonly files.
16248 rm -rf ${CVSROOT_DIRNAME}/first-dir
16252 # More watch tests, most notably setting watches on
16253 # files in various different states.
16254 mkdir ${CVSROOT_DIRNAME}/first-dir
16257 dotest devcom2-1 "${testcvs} -q co first-dir" ''
16260 # This should probably be an error; setting a watch on a totally
16261 # unknown file is more likely to be a typo than intentional.
16262 # But that isn't the currently implemented behavior.
16263 dotest devcom2-2 "${testcvs} watch on w1" ''
16266 dotest devcom2-3 "${testcvs} add w1 w2 w3 nw1" "${DOTSTAR}"
16267 # Letting the user set the watch here probably can be considered
16268 # a feature--although it leads to a few potentially strange
16269 # consequences like one user can set the watch and another actually
16271 dotest devcom2-4 "${testcvs} watch on w2" ''
16272 dotest devcom2-5 "${testcvs} -q ci -m add-them" "${DOTSTAR}"
16274 # Note that this test differs in a subtle way from devcom-some0;
16275 # in devcom-some0 the watch is creating a new fileattr file, and
16276 # here we are modifying an existing one.
16277 dotest devcom2-6 "${testcvs} watch on w3" ''
16279 # Now test that all the watches got set on the correct files
16280 # FIXME: CVS should have a way to report whether watches are
16281 # set, I think. The "check it out and see if it read-only" is
16282 # sort of OK, but is complicated by CVSREAD and doesn't help
16283 # if the file is added and not yet committed or some such.
16284 # Probably "cvs status" should report "watch: on" if watch is on
16285 # (and nothing if watch is off, so existing behavior is preserved).
16289 dotest devcom2-7 "${testcvs} -q co first-dir" 'U first-dir/nw1
16293 dotest devcom2-8 "test -w first-dir/nw1" ''
16294 dotest_fail devcom2-9 "test -w first-dir/w1" ''
16295 dotest_fail devcom2-10 "test -w first-dir/w2" ''
16296 dotest_fail devcom2-11 "test -w first-dir/w3" ''
16299 # OK, now we want to try files in various states with cvs edit.
16300 dotest devcom2-12 "${testcvs} edit w4" \
16301 "${PROG} edit: no such file w4; ignored"
16302 # Try the same thing with a per-directory watch set.
16303 dotest devcom2-13 "${testcvs} watch on" ''
16304 dotest devcom2-14 "${testcvs} edit w5" \
16305 "${PROG} edit: no such file w5; ignored"
16306 dotest devcom2-15 "${testcvs} editors" ''
16307 dotest devcom2-16 "${testcvs} editors w4" ''
16308 # Make sure there are no droppings lying around
16309 dotest devcom2-17 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
16317 # Do a little error testing
16318 dotest devcom2-18 "${testcvs} -q co -d first+dir first-dir" \
16319 "U first${PLUS}dir/nw1
16320 U first${PLUS}dir/w1
16321 U first${PLUS}dir/w2
16322 U first${PLUS}dir/w3"
16324 dotest_fail devcom2-19 "${testcvs} edit" \
16325 "${PROG} \[[a-z]* aborted\]: current directory (${TESTDIR}/2/first${PLUS}dir) contains an invalid character (${PLUS},>;=\\\\t\\\\n)"
16327 # Make sure there are no droppings lying around
16328 dotest devcom2-20 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
16337 # Use -f because of the readonly files.
16339 rm -rf ${CVSROOT_DIRNAME}/first-dir
16343 # More watch tests, most notably handling of features designed
16344 # for future expansion.
16345 mkdir ${CVSROOT_DIRNAME}/first-dir
16348 dotest devcom3-1 "${testcvs} -q co first-dir" ''
16352 dotest devcom3-2 "${testcvs} add w1 w2" "${DOTSTAR}"
16353 dotest devcom3-3 "${testcvs} watch on w1 w2" ''
16354 dotest devcom3-4 "${testcvs} -q ci -m add-them" "${DOTSTAR}"
16356 # OK, since we are about to delve into CVS's internals, make
16357 # sure that we seem to be correct about how they work.
16358 dotest devcom3-5 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
16361 # Now write a few more lines, just as if we were a newer version
16362 # of CVS implementing some new feature.
16363 cat <<'EOF' >>${CVSROOT_DIRNAME}/first-dir/CVS/fileattr
16367 # Now get CVS to write to the fileattr file....
16368 dotest devcom3-6 "${testcvs} watch off w1" ''
16369 # ...and make sure that it hasn't clobbered our new lines.
16370 # Note that writing these lines in another order would be OK
16372 dotest devcom3-7 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
16377 # See what CVS does when a file name is duplicated. The
16378 # behavior of all versions of CVS since file attributes were
16379 # implemented is that it nukes the duplications. This seems
16380 # reasonable enough, although it means it isn't clear how
16381 # useful duplicates would be for purposes of future
16382 # expansion. But in the interests of keeping behaviors
16383 # predictable, might as well test for it, I guess.
16384 echo 'Fw2 duplicate=' >>${CVSROOT_DIRNAME}/first-dir/CVS/fileattr
16385 dotest devcom3-8 "${testcvs} watch on w1" ''
16386 dotest devcom3-9 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
16392 # Now test disconnected "cvs edit" and the format of the
16395 CVS_SERVER_save=${CVS_SERVER}
16396 CVS_SERVER=${TESTDIR}/cvs-none; export CVS_SERVER
16398 # The ${DOTSTAR} below matches the exact CVS server error message,
16399 # which in :fork: mode is:
16400 # "$PROG \[edit aborted\]: cannot exec $TESTDIR/cvs-none: ${DOTSTAR}",
16402 # "bash2: line 1: $TESTDIR/cvs-none: No such file or directory"
16403 # when testing across an :ext:/ssh link to my Linux 2.4 box.
16405 # I can't even test for the second part of the error message,
16406 # from the client, which varies more consistently, usually either
16407 # "end of file from server" (if the process doing the exec exits
16408 # before the parent gets around to sending data to it) or
16409 # "received broken pipe signal" (if it is the other way around),
16410 # since HP-UX fails to output it.
16411 dotest_fail devcom3-9ar "${testcvs} edit w1 2>/dev/null"
16412 dotest devcom3-9br "test -w w1" ""
16413 dotest devcom3-9cr "cat CVS/Notify" \
16414 "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"
16415 CVS_SERVER=${CVS_SERVER_save}; export CVS_SERVER
16416 dotest devcom3-9dr "${testcvs} -q update" ""
16417 dotest_fail devcom3-9er "test -f CVS/Notify" ""
16418 dotest devcom3-9fr "${testcvs} watchers w1" \
16419 "w1 ${username} tedit tunedit tcommit"
16420 dotest devcom3-9gr "${testcvs} unedit w1" ""
16421 dotest devcom3-9hr "${testcvs} watchers w1" ""
16425 # OK, now change the tab to a space, and see that CVS gives
16426 # a reasonable error (this is database corruption but CVS should
16427 # not lose its mind).
16428 sed -e 's/Fw2 /Fw2 /' <${CVSROOT_DIRNAME}/first-dir/CVS/fileattr \
16429 >${CVSROOT_DIRNAME}/first-dir/CVS/fileattr.new
16430 mv ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr.new \
16431 ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr
16433 dotest_fail devcom3-10 "${testcvs} -Q co ." \
16434 "${PROG} \[checkout aborted\]: file attribute database corruption: tab missing in ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr"
16437 # Use -f because of the readonly files.
16439 rm -rf ${CVSROOT_DIRNAME}/first-dir
16443 # More watch tests, including adding directories.
16445 dotest watch4-0a "${testcvs} -q co -l ." ''
16447 dotest watch4-0b "${testcvs} add first-dir" \
16448 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
16451 dotest watch4-1 "${testcvs} watch on" ''
16452 # This is just like the 173 test
16454 dotest watch4-2 "${testcvs} add file1" \
16455 "${PROG} add: scheduling file .file1. for addition
16456 ${PROG} add: use .${PROG} commit. to add this file permanently"
16457 dotest watch4-3 "${testcvs} -q ci -m add" \
16458 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
16461 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
16462 initial revision: 1\.1
16464 # Now test the analogous behavior for directories.
16466 dotest watch4-4 "${testcvs} add subdir" \
16467 "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
16470 dotest watch4-5 "${testcvs} add sfile" \
16471 "${PROG} add: scheduling file .sfile. for addition
16472 ${PROG} add: use .${PROG} commit. to add this file permanently"
16473 dotest watch4-6 "${testcvs} -q ci -m add" \
16474 "RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v
16477 ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
16478 initial revision: 1\.1
16482 dotest watch4-7 "${testcvs} -q co first-dir" "U first-dir/file1
16483 U first-dir/subdir/sfile"
16484 dotest_fail watch4-8 "test -w first-dir/file1" ''
16485 dotest_fail watch4-9 "test -w first-dir/subdir/sfile" ''
16487 dotest watch4-10 "${testcvs} edit file1" ''
16488 echo 'edited in 2' >file1
16492 dotest watch4-11 "${testcvs} edit file1" ''
16493 echo 'edited in 1' >file1
16494 dotest watch4-12 "${testcvs} -q ci -m edit-in-1" \
16495 "Checking in file1;
16496 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
16497 new revision: 1\.2; previous revision: 1\.1
16501 dotest watch4-13 "${testcvs} -q update" \
16502 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
16503 retrieving revision 1\.1
16504 retrieving revision 1\.2
16505 Merging differences between 1\.1 and 1\.2 into file1
16506 rcsmerge: warning: conflicts during merge
16507 ${PROG} update: conflicts found in file1
16509 if (echo yes | ${testcvs} unedit file1) >>${LOGFILE}; then
16514 # This could plausibly be defined to either go back to the revision
16515 # which was cvs edit'd (the status quo), or back to revision 1.2
16516 # (that is, the merge could update CVS/Base/file1). We pick the
16517 # former because it is easier to implement, not because we have
16518 # thought much about which is better.
16519 dotest watch4-16 "cat file1" ''
16520 # Make sure CVS really thinks we are at 1.1.
16521 dotest watch4-17 "${testcvs} -q update" "U file1"
16522 dotest watch4-18 "cat file1" "edited in 1"
16525 # As a sanity check, make sure we are in the right place.
16526 dotest watch4-cleanup-1 "test -d 1" ''
16527 dotest watch4-cleanup-1 "test -d 2" ''
16528 # Specify -f because of the readonly files.
16530 rm -rf ${CVSROOT_DIRNAME}/first-dir
16534 # This test was designed to catch a problem in server
16535 # mode where an 'cvs edit'd file disappeared from the
16536 # CVS/Base directory when 'cvs status' or 'cvs update'
16537 # was called on the file after the file was touched.
16539 # This test is still here to prevent the bug from
16540 # being reintroduced.
16542 # The rationale for having CVS/Base stay around is that
16543 # CVS/Base should be there if "cvs edit" has been run (this
16544 # may be helpful as a "cvs editors" analogue, it is
16545 # client-side and based on working directory not username;
16546 # but more importantly, it isn't clear why a "cvs status"
16547 # would act like an unedit, and even if it does, it would
16548 # need to make the file read-only again).
16550 mkdir watch5; cd watch5
16551 dotest watch5-0a "${testcvs} -q co -l ." ''
16553 dotest watch5-0b "${testcvs} add first-dir" \
16554 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
16557 dotest watch5-1 "${testcvs} watch on" ''
16558 # This is just like the 173 test
16560 dotest watch5-2 "${testcvs} add file1" \
16561 "${PROG} add: scheduling file .file1. for addition
16562 ${PROG} add: use .${PROG} commit. to add this file permanently"
16563 dotest watch5-3 "${testcvs} -q ci -m add" \
16564 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
16567 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
16568 initial revision: 1\.1
16570 dotest watch5-4 "${testcvs} edit file1" ''
16571 dotest watch5-5 "test -f CVS/Base/file1" ''
16572 if ${testcvs} status file1 >>${LOGFILE} 2>&1; then
16577 dotest watch5-7 "test -f CVS/Base/file1" ''
16579 # Here's where the file used to dissappear
16581 if ${testcvs} status file1 >>${LOGFILE} 2>&1; then
16586 dotest watch5-10 "test -f CVS/Base/file1" ''
16588 # Make sure update won't remove the file either
16590 dotest watch5-11 "${testcvs} -q up" ''
16591 dotest watch5-12 "test -f CVS/Base/file1" ''
16595 rm -rf ${CVSROOT_DIRNAME}/first-dir
16601 # Check that `cvs watch on' does not reset the fileattr file.
16602 mkdir watch6; cd watch6
16604 dotest watch6-setup-1 "$testcvs -Q co -ldtop ."
16607 dotest watch6-setup-2 "$testcvs -Q add watch6"
16610 dotest watch6-setup-3 "$testcvs -Q co watch6"
16614 dotest watch6-setup-4 "$testcvs -Q add subdir"
16617 # START watch add/remove sequence
16618 dotest watch6-1 "$testcvs -Q watch add"
16620 "grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
16622 dotest watch6-3 "$testcvs watch on"
16624 "grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
16626 "grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
16628 dotest watch6-6 "$testcvs watch off"
16630 "grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
16631 dotest_fail watch6-8 \
16632 "grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
16634 dotest watch6-9 "$testcvs watch remove"
16635 dotest_fail watch6-10 \
16636 "test -d $CVSROOT_DIRNAME/test-directory/subdir/CVS"
16637 dotest_fail watch6-11 \
16638 "test -f $CVSROOT_DIRNAME/test-directory/subdir/CVS/fileattr"
16639 # END watch add/remove sequence
16641 echo Hi there >afile
16642 dotest watch6-12 "$testcvs -Q add afile"
16643 dotest watch6-13 "$testcvs ci -m 'A file' afile" \
16644 "RCS file: $CVSROOT_DIRNAME/watch6/subdir/afile,v
16647 $CVSROOT_DIRNAME/watch6/subdir/afile,v <-- afile
16648 initial revision: 1\.1
16651 # START watch add/remove sequence
16652 dotest watch6-14 "$testcvs -Q watch add"
16654 "grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
16656 dotest watch6-16 "$testcvs watch on"
16658 "grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
16660 "grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
16662 dotest watch6-19 "$testcvs watch off"
16664 "grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
16665 dotest_fail watch6-21 \
16666 "grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
16668 dotest watch6-22 "$testcvs watch remove"
16669 dotest_fail watch6-23 \
16670 "test -d $CVSROOT_DIRNAME/test-directory/subdir/CVS"
16671 dotest_fail watch6-24 \
16672 "test -f $CVSROOT_DIRNAME/test-directory/subdir/CVS/fileattr"
16673 # END watch add/remove sequence
16676 echo Keeping $TESTDIR and exiting due to --keep
16681 rm -rf $CVSROOT_DIRNAME/watch6
16686 unedit-without-baserev)
16692 dotest unedit-without-baserev-1 \
16693 "$testcvs -Q import -m . $module X Y" ''
16694 dotest unedit-without-baserev-2 "$testcvs -Q co $module" ''
16697 dotest unedit-without-baserev-3 "$testcvs -Q edit $file" ''
16699 echo add a line >> $file
16702 # This will fail on most systems.
16703 echo "yes" | dotest unedit-without-baserev-4 "${testcvs} -Q unedit $file" \
16704 "m has been modified; revert changes${QUESTION} ${PROG} unedit: m not mentioned in CVS/Baserev
16705 ${PROG} unedit: run update to complete the unedit"
16707 # SunOS4.1.4 systems make it this far, but with a corrupted
16708 # CVS/Entries file. Demonstrate the corruption!
16709 dotest unedit-without-baserev-5 "cat CVS/Entries" \
16710 "/$file/1\.1\.1\.1/${DOTSTAR}"
16712 dotest unedit-without-baserev-6 "${testcvs} -q update" \
16713 "${PROG} update: warning: m was lost
16716 # OK, those were the easy cases. Now tackle the hard one
16717 # (the reason that CVS/Baserev was invented rather than just
16718 # getting the revision from CVS/Entries). This is very
16719 # similar to watch4-10 through watch4-18 but with Baserev
16723 dotest unedit-without-baserev-7 "${testcvs} -Q co x" ''
16726 dotest unedit-without-baserev-10 "${testcvs} edit m" ''
16727 echo 'edited in 2' >m
16731 dotest unedit-without-baserev-11 "${testcvs} edit m" ''
16732 echo 'edited in 1' >m
16733 dotest unedit-without-baserev-12 "${testcvs} -q ci -m edit-in-1" \
16735 ${CVSROOT_DIRNAME}/x/m,v <-- m
16736 new revision: 1\.2; previous revision: 1\.1
16740 dotest unedit-without-baserev-13 "${testcvs} -q update" \
16741 "RCS file: ${CVSROOT_DIRNAME}/x/m,v
16742 retrieving revision 1\.1\.1\.1
16743 retrieving revision 1\.2
16744 Merging differences between 1\.1\.1\.1 and 1\.2 into m
16745 rcsmerge: warning: conflicts during merge
16746 ${PROG} update: conflicts found in m
16749 dotest unedit-without-baserev-14 "echo yes | ${testcvs} unedit m" \
16750 "m has been modified; revert changes${QUESTION} ${PROG} unedit: m not mentioned in CVS/Baserev
16751 ${PROG} unedit: run update to complete the unedit"
16752 dotest unedit-without-baserev-15 "${testcvs} -q update" \
16753 "${PROG} update: warning: m was lost
16755 # The following tests are kind of degenerate compared with
16756 # watch4-16 through watch4-18 but might as well make sure that
16757 # nothing seriously wrong has happened to the working directory.
16758 dotest unedit-without-baserev-16 "cat m" 'edited in 1'
16759 # Make sure CVS really thinks we are at 1.2.
16760 dotest unedit-without-baserev-17 "${testcvs} -q update" ""
16761 dotest unedit-without-baserev-18 "cat m" "edited in 1"
16766 rm -rf ${CVSROOT_DIRNAME}/$module
16770 # On Windows, we can't check out CVSROOT, because the case
16771 # insensitivity means that this conflicts with cvsroot.
16775 dotest ignore-1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
16777 echo rootig.c >cvsignore
16778 dotest ignore-2 "${testcvs} add cvsignore" \
16779 "${PROG}"' add: scheduling file `cvsignore'"'"' for addition
16780 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
16782 # As of Jan 96, local CVS prints "Examining ." and remote doesn't.
16784 dotest ignore-3 " ${testcvs} ci -m added" \
16785 "${PROG} [a-z]*: Examining \.
16786 RCS file: ${CVSROOT_DIRNAME}/CVSROOT/cvsignore,v
16788 Checking in cvsignore;
16789 ${CVSROOT_DIRNAME}/CVSROOT/cvsignore,v <-- cvsignore
16790 initial revision: 1\.1
16792 ${PROG} commit: Rebuilding administrative file database"
16795 if echo "yes" | ${testcvs} release -d CVSROOT >>${LOGFILE} ; then
16801 # CVS looks at the home dir from getpwuid, not HOME (is that correct
16802 # behavior?), so this is hard to test and we won't try.
16803 # echo foobar.c >${HOME}/.cvsignore
16804 CVSIGNORE=envig.c; export CVSIGNORE
16805 mkdir dir-to-import
16807 touch foobar.c bar.c rootig.c defig.o envig.c optig.c
16808 # We use sort because we can't predict the order in which
16809 # the files will be listed.
16810 dotest_sort ignore-5 "${testcvs} import -m m -I optig.c ignore/first-dir tag1 tag2" \
16813 I ignore/first-dir/defig.o
16814 I ignore/first-dir/envig.c
16815 I ignore/first-dir/optig.c
16816 I ignore/first-dir/rootig.c
16817 N ignore/first-dir/bar.c
16818 N ignore/first-dir/foobar.c
16819 No conflicts created by this import'
16820 dotest_sort ignore-6 "${testcvs} import -m m -I ! ignore/second-dir tag3 tag4" \
16823 N ignore/second-dir/bar.c
16824 N ignore/second-dir/defig.o
16825 N ignore/second-dir/envig.c
16826 N ignore/second-dir/foobar.c
16827 N ignore/second-dir/optig.c
16828 N ignore/second-dir/rootig.c
16829 No conflicts created by this import'
16831 rm -r dir-to-import
16835 dotest ignore-7 "${testcvs} -q co -dsecond-dir ignore/second-dir" \
16836 'U second-dir/bar.c
16837 U second-dir/defig.o
16838 U second-dir/envig.c
16839 U second-dir/foobar.c
16840 U second-dir/optig.c
16841 U second-dir/rootig.c'
16842 dotest ignore-8 "${testcvs} -q co -dfirst-dir ignore/first-dir" 'U first-dir/bar.c
16843 U first-dir/foobar.c'
16845 touch rootig.c defig.o envig.c optig.c notig.c
16846 dotest ignore-9 "${testcvs} -q update -I optig.c" "${QUESTION} notig.c"
16847 # The fact that CVS requires us to specify -I CVS here strikes me
16849 dotest_sort ignore-10 "${testcvs} -q update -I ! -I CVS" \
16850 "${QUESTION} defig.o
16851 ${QUESTION} envig.c
16852 ${QUESTION} notig.c
16853 ${QUESTION} optig.c
16854 ${QUESTION} rootig.c"
16856 # Now test that commands other than update also print "? notig.c"
16857 # where appropriate. Only test this for remote, because local
16858 # CVS only prints it on update.
16861 dotest ignore-11r "${testcvs} -q diff" "${QUESTION} notig.c"
16863 # Force the server to be contacted. Ugh. Having CVS
16864 # contact the server for the sole purpose of checking
16865 # the CVSROOT/cvsignore file does not seem like such a
16866 # good idea, so I imagine this will continue to be
16867 # necessary. Oh well, at least we test CVS's ablity to
16868 # handle a file with a modified timestamp but unmodified
16872 dotest ignore-11r "${testcvs} -q ci -m commit-it" "${QUESTION} notig.c"
16875 # now test .cvsignore files
16877 echo notig.c >first-dir/.cvsignore
16878 echo foobar.c >second-dir/.cvsignore
16879 touch first-dir/notig.c second-dir/notig.c second-dir/foobar.c
16880 dotest_sort ignore-12 "${testcvs} -qn update" \
16881 "${QUESTION} first-dir/.cvsignore
16882 ${QUESTION} second-dir/.cvsignore
16883 ${QUESTION} second-dir/notig.c"
16884 dotest_sort ignore-13 "${testcvs} -qn update -I! -I CVS" \
16885 "${QUESTION} first-dir/.cvsignore
16886 ${QUESTION} first-dir/defig.o
16887 ${QUESTION} first-dir/envig.c
16888 ${QUESTION} first-dir/rootig.c
16889 ${QUESTION} second-dir/.cvsignore
16890 ${QUESTION} second-dir/notig.c"
16892 echo yes | dotest ignore-14 "${testcvs} release -d first-dir" \
16893 "${QUESTION} \.cvsignore
16894 You have \[0\] altered files in this repository.
16895 Are you sure you want to release (and delete) directory .first-dir': "
16897 echo add a line >>second-dir/foobar.c
16898 rm second-dir/notig.c second-dir/.cvsignore
16899 echo yes | dotest ignore-15 "${testcvs} release -d second-dir" \
16901 You have \[1\] altered files in this repository.
16902 Are you sure you want to release (and delete) directory .second-dir': "
16905 if $keep; then :; else
16907 rm -rf ${CVSROOT_DIRNAME}/ignore
16912 # Test that CVS _doesn't_ ignore files on branches because they were
16913 # added to the trunk.
16914 mkdir ignore-on-branch; cd ignore-on-branch
16915 mkdir $CVSROOT_DIRNAME/ignore-on-branch
16917 # create file1 & file2 on trunk
16918 dotest ignore-on-branch-setup-1 "$testcvs -q co -dsetup ignore-on-branch" ''
16921 dotest ignore-on-branch-setup-2 "$testcvs -q add file1" \
16922 "${PROG} add: use .${PROG} commit. to add this file permanently"
16923 dotest ignore-on-branch-setup-3 "$testcvs -q ci -mfile1 file1" \
16924 "RCS file: $CVSROOT_DIRNAME/ignore-on-branch/file1,v
16927 $CVSROOT_DIRNAME/ignore-on-branch/file1,v <-- file1
16928 initial revision: 1\.1
16930 dotest ignore-on-branch-setup-4 "$testcvs -q tag -b branch" 'T file1'
16932 dotest ignore-on-branch-setup-5 "$testcvs -q add file2" \
16933 "${PROG} add: use .${PROG} commit. to add this file permanently"
16934 dotest ignore-on-branch-setup-6 "$testcvs -q ci -mtrunk file2" \
16935 "RCS file: $CVSROOT_DIRNAME/ignore-on-branch/file2,v
16938 $CVSROOT_DIRNAME/ignore-on-branch/file2,v <-- file2
16939 initial revision: 1\.1
16944 # Check out branch.
16946 # - This was the original failure case - file2 would not be flagged
16948 dotest ignore-on-branch-1 "$testcvs -q co -rbranch ignore-on-branch" \
16949 'U ignore-on-branch/file1'
16950 cd ignore-on-branch
16951 echo file2 on branch >file2
16952 dotest ignore-on-branch-2 "$testcvs -nq update" '? file2'
16954 # Now set up for a join. One of the original fixes for this would
16955 # print out a 'U' and a '?' during a join which added a file.
16957 dotest ignore-on-branch-3 "$testcvs -q tag -b branch2" \
16961 dotest ignore-on-branch-3 "$testcvs -q tag -b branch2" 'T file1'
16963 dotest ignore-on-branch-4 "$testcvs -q add file2" \
16964 "${PROG} add: use .${PROG} commit. to add this file permanently"
16965 dotest ignore-on-branch-5 "$testcvs -q ci -mbranch file2" \
16966 "Checking in file2;
16967 $CVSROOT_DIRNAME/ignore-on-branch/file2,v <-- file2
16968 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
16970 dotest ignore-on-branch-6 "$testcvs -q up -rbranch2" \
16972 $PROG update: file2 is no longer in the repository"
16973 dotest ignore-on-branch-7 "$testcvs -q up -jbranch" 'U file2'
16976 if $keep; then :; else
16977 rm -r ignore-on-branch
16978 rm -rf $CVSROOT_DIRNAME/ignore-on-branch
16983 # Test cvs's ability to handle binary files.
16984 # List of binary file tests:
16985 # * conflicts, "cvs admin": binfiles
16986 # * branching and joining: binfiles2
16987 # * adding and removing files: binfiles3
16988 # * -k wrappers: binwrap, binwrap2, binwrap3
16989 # * "cvs import" and wrappers: binwrap, binwrap2, binwrap3
16990 # * -k option to "cvs import": none yet, as far as I know.
16991 mkdir ${CVSROOT_DIRNAME}/first-dir
16993 dotest binfiles-1 "${testcvs} -q co first-dir" ''
16994 ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
16995 </dev/null | ${TR} '@' '\000' >binfile.dat
16996 cat binfile.dat binfile.dat >binfile2.dat
16998 cp ../binfile.dat binfile
16999 dotest binfiles-2 "${testcvs} add -kb binfile" \
17000 "${PROG}"' add: scheduling file `binfile'\'' for addition
17001 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
17002 dotest binfiles-3 "${testcvs} -q ci -m add-it" \
17003 "RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
17005 Checking in binfile;
17006 ${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
17007 initial revision: 1\.1
17011 dotest binfiles-4 "${testcvs} -q co first-dir" 'U first-dir/binfile'
17013 dotest binfiles-5 "cmp ../../1/binfile.dat binfile" ''
17014 # Testing that sticky options is -kb is the closest thing we have
17015 # to testing that binary files work right on non-unix machines
17016 # (until there is automated testing for such machines, of course).
17017 dotest binfiles-5.5 "${testcvs} status binfile" \
17018 "===================================================================
17019 File: binfile Status: Up-to-date
17021 Working revision: 1\.1.*
17022 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
17024 Sticky Date: (none)
17025 Sticky Options: -kb"
17027 # Test that "-kk" does not override "-kb"
17030 dotest binfiles-5.5a0 "${testcvs} -q co -kk first-dir" 'U first-dir/binfile'
17032 # Testing that sticky options is -kb is the closest thing we have
17033 # to testing that binary files work right on non-unix machines
17034 # (until there is automated testing for such machines, of course).
17035 dotest binfiles-5.5a1 "${testcvs} status binfile" \
17036 "===================================================================
17037 File: binfile Status: Up-to-date
17039 Working revision: 1\.1.*
17040 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
17042 Sticky Date: (none)
17043 Sticky Options: -kb"
17045 # Test whether the default options from the RCS file are
17046 # also used when operating on files instead of whole
17050 dotest binfiles-5.5b0 "${testcvs} -q co first-dir/binfile" \
17051 'U first-dir/binfile'
17053 dotest binfiles-5.5b1 "${testcvs} status binfile" \
17054 "===================================================================
17055 File: binfile Status: Up-to-date
17057 Working revision: 1\.1.*
17058 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
17060 Sticky Date: (none)
17061 Sticky Options: -kb"
17064 # test that "-kk" does not override "-kb"
17066 dotest binfiles-5.5c0 "${testcvs} -q co -kk first-dir/binfile" \
17067 'U first-dir/binfile'
17069 dotest binfiles-5.5c1 "${testcvs} status binfile" \
17070 "===================================================================
17071 File: binfile Status: Up-to-date
17073 Working revision: 1\.1.*
17074 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
17076 Sticky Date: (none)
17077 Sticky Options: -kb"
17082 cp ../../1/binfile2.dat binfile
17083 dotest binfiles-6 "${testcvs} -q ci -m modify-it" \
17084 "Checking in binfile;
17085 ${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
17086 new revision: 1\.2; previous revision: 1\.1
17088 cd ../../1/first-dir
17089 dotest binfiles-7 "${testcvs} -q update" '[UP] binfile'
17090 dotest binfiles-8 "cmp ../binfile2.dat binfile" ''
17092 # Now test handling of conflicts with binary files.
17093 cp ../binfile.dat binfile
17094 dotest binfiles-con0 "${testcvs} -q ci -m modify-it" \
17095 "Checking in binfile;
17096 ${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
17097 new revision: 1\.3; previous revision: 1\.2
17099 cd ../../2/first-dir
17100 echo 'edits in dir 2' >binfile
17101 dotest binfiles-con1 "${testcvs} -q update" \
17102 "$PROG update: nonmergeable file needs merge
17103 ${PROG} update: revision 1\.3 from repository is now in binfile
17104 ${PROG} update: file from working directory is now in \.#binfile\.1\.2
17107 dotest_fail binfiles-con1b "$testcvs -q up" "C binfile"
17109 dotest binfiles-con2 "cmp binfile ../../1/binfile.dat" ''
17110 dotest binfiles-con3 "cat .#binfile.1.2" 'edits in dir 2'
17112 cp ../../1/binfile2.dat binfile
17113 dotest binfiles-con4 "${testcvs} -q ci -m resolve-it" \
17114 "Checking in binfile;
17115 ${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
17116 new revision: 1\.4; previous revision: 1\.3
17118 cd ../../1/first-dir
17119 dotest binfiles-con5 "${testcvs} -q update" '[UP] binfile'
17121 dotest binfiles-9 "${testcvs} -q update -A" ''
17122 # "-kk" no longer does anything with "-kb"
17123 dotest binfiles-10 "${testcvs} -q update -kk" ''
17124 dotest binfiles-11 "${testcvs} -q update" ''
17125 # "-kk" no longer does anything with "-kb"
17126 dotest binfiles-12 "${testcvs} -q update -A" ''
17127 dotest binfiles-13 "${testcvs} -q update -A" ''
17133 dotest binfiles-13a0 "${testcvs} -q co -r HEAD first-dir" \
17134 'U first-dir/binfile'
17136 dotest binfiles-13a1 "${testcvs} status binfile" \
17137 "===================================================================
17138 File: binfile Status: Up-to-date
17140 Working revision: 1\.4.*
17141 Repository revision: 1\.4 ${CVSROOT_DIRNAME}/first-dir/binfile,v
17142 Sticky Tag: HEAD (revision: 1\.4)
17143 Sticky Date: (none)
17144 Sticky Options: -kb"
17149 echo 'this file is $''RCSfile$' >binfile
17150 dotest binfiles-14a "${testcvs} -q ci -m modify-it" \
17151 "Checking in binfile;
17152 ${CVSROOT_DIRNAME}/first-dir/binfile,v <-- binfile
17153 new revision: 1\.5; previous revision: 1\.4
17155 dotest binfiles-14b "cat binfile" 'this file is $''RCSfile$'
17156 # See binfiles-5.5 for discussion of -kb.
17157 dotest binfiles-14c "${testcvs} status binfile" \
17158 "===================================================================
17159 File: binfile Status: Up-to-date
17161 Working revision: 1\.5.*
17162 Repository revision: 1\.5 ${CVSROOT_DIRNAME}/first-dir/binfile,v
17164 Sticky Date: (none)
17165 Sticky Options: -kb"
17166 dotest binfiles-14d "${testcvs} admin -kv binfile" \
17167 "RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
17169 # cvs admin doesn't change the checked-out file or its sticky
17170 # kopts. There probably should be a way which does (but
17171 # what if the file is modified? And do we try to version
17172 # control the kopt setting?)
17173 dotest binfiles-14e "cat binfile" 'this file is $''RCSfile$'
17174 dotest binfiles-14f "${testcvs} status binfile" \
17175 "===================================================================
17176 File: binfile Status: Up-to-date
17178 Working revision: 1\.5.*
17179 Repository revision: 1\.5 ${CVSROOT_DIRNAME}/first-dir/binfile,v
17181 Sticky Date: (none)
17182 Sticky Options: -kb"
17183 dotest binfiles-14g "${testcvs} -q update -A" '[UP] binfile'
17184 dotest binfiles-14h "cat binfile" 'this file is binfile,v'
17185 dotest binfiles-14i "${testcvs} status binfile" \
17186 "===================================================================
17187 File: binfile Status: Up-to-date
17189 Working revision: 1\.5.*
17190 Repository revision: 1\.5 ${CVSROOT_DIRNAME}/first-dir/binfile,v
17192 Sticky Date: (none)
17193 Sticky Options: -kv"
17195 # Do sticky options work when used with 'cvs update'?
17196 echo "Not a binary file." > nibfile
17197 dotest binfiles-sticky1 "${testcvs} -q add nibfile" \
17198 "${PROG} add: use .${PROG} commit. to add this file permanently"
17199 dotest binfiles-sticky2 "${testcvs} -q ci -m add-it nibfile" \
17200 "RCS file: ${CVSROOT_DIRNAME}/first-dir/nibfile,v
17202 Checking in nibfile;
17203 ${CVSROOT_DIRNAME}/first-dir/nibfile,v <-- nibfile
17204 initial revision: 1\.1
17206 dotest binfiles-sticky3 "${testcvs} -q update -kb nibfile" \
17208 dotest binfiles-sticky4 "${testcvs} -q status nibfile" \
17209 "===================================================================
17210 File: nibfile Status: Up-to-date
17212 Working revision: 1\.1.*
17213 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/nibfile,v
17215 Sticky Date: (none)
17216 Sticky Options: -kb"
17218 # Now test that -A can clear the sticky option.
17219 dotest binfiles-sticky5 "${testcvs} -q update -A nibfile" \
17221 dotest binfiles-sticky6 "${testcvs} -q status nibfile" \
17222 "===================================================================
17223 File: nibfile Status: Up-to-date
17225 Working revision: 1\.1.*
17226 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/nibfile,v
17228 Sticky Date: (none)
17229 Sticky Options: (none)"
17230 dotest binfiles-15 "${testcvs} -q admin -kb nibfile" \
17231 "RCS file: ${CVSROOT_DIRNAME}/first-dir/nibfile,v
17233 dotest binfiles-16 "${testcvs} -q update nibfile" "[UP] nibfile"
17234 dotest binfiles-17 "${testcvs} -q status nibfile" \
17235 "===================================================================
17236 File: nibfile Status: Up-to-date
17238 Working revision: 1\.1.*
17239 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/nibfile,v
17241 Sticky Date: (none)
17242 Sticky Options: -kb"
17244 dotest binfiles-o1 "${testcvs} admin -o1.3:: binfile" \
17245 "RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
17246 deleting revision 1\.5
17247 deleting revision 1\.4
17249 dotest binfiles-o2 "${testcvs} admin -o::1.3 binfile" \
17250 "RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
17251 deleting revision 1\.2
17252 deleting revision 1\.1
17254 dotest binfiles-o3 "${testcvs} -q log -h -N binfile" "
17255 RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
17256 Working file: binfile
17261 keyword substitution: v
17263 ============================================================================="
17265 # Check that the contents were right. This isn't the hard case
17266 # (in which RCS_delete_revs does a diff), but might as well.
17267 dotest binfiles-o4 "${testcvs} -q update binfile" "U binfile"
17268 dotest binfiles-o5 "cmp binfile ../../1/binfile.dat" ""
17271 rm -rf ${CVSROOT_DIRNAME}/first-dir
17277 # Test cvs's ability to handle binary files, particularly branching
17278 # and joining. The key thing we are worrying about is that CVS
17279 # doesn't print "cannot merge binary files" or some such, in
17280 # situations where no merging is required.
17281 # See also "join" which does this with non-binary files.
17283 # Cases (we are merging from the branch to the trunk):
17284 # binfile.dat) File added on branch, not on trunk.
17285 # File should be marked for addition.
17286 # brmod) File modified on branch, not on trunk.
17287 # File should be copied over to trunk (no merging is needed).
17288 # brmod-trmod) File modified on branch, also on trunk.
17289 # This is a conflict. Present the user with both files and
17290 # let them figure it out.
17291 # brmod-wdmod) File modified on branch, not modified in the trunk
17292 # repository, but modified in the (trunk) working directory.
17293 # This is also a conflict.
17295 mkdir ${CVSROOT_DIRNAME}/first-dir
17297 dotest binfiles2-1 "${testcvs} -q co first-dir" ''
17300 # The most important thing here is that binfile, binfile2, &c
17301 # each be distinct from each other. We also make sure to include
17302 # a few likely end-of-line patterns to make sure nothing is
17303 # being munged as if in text mode.
17304 ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
17305 </dev/null | ${TR} '@' '\000' >../binfile
17306 cat ../binfile ../binfile >../binfile2
17307 cat ../binfile2 ../binfile >../binfile3
17309 # FIXCVS: unless a branch has at least one file on it,
17310 # tag_check_valid won't know it exists. So if brmod didn't
17311 # exist, we would have to invent it.
17312 cp ../binfile brmod
17313 cp ../binfile brmod-trmod
17314 cp ../binfile brmod-wdmod
17315 dotest binfiles2-1a \
17316 "${testcvs} add -kb brmod brmod-trmod brmod-wdmod" \
17317 "${PROG} add: scheduling file .brmod. for addition
17318 ${PROG} add: scheduling file .brmod-trmod. for addition
17319 ${PROG} add: scheduling file .brmod-wdmod. for addition
17320 ${PROG} add: use .${PROG} commit. to add these files permanently"
17321 dotest binfiles2-1b "${testcvs} -q ci -m add" \
17322 "RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod,v
17325 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
17326 initial revision: 1\.1
17328 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
17330 Checking in brmod-trmod;
17331 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
17332 initial revision: 1\.1
17334 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v
17336 Checking in brmod-wdmod;
17337 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
17338 initial revision: 1\.1
17340 dotest binfiles2-2 "${testcvs} -q tag -b br" 'T brmod
17343 dotest binfiles2-3 "$testcvs -q update -r br" \
17347 cp ../binfile binfile.dat
17348 dotest binfiles2-4 "${testcvs} add -kb binfile.dat" \
17349 "${PROG} add: scheduling file .binfile\.dat. for addition on branch .br.
17350 ${PROG} add: use .${PROG} commit. to add this file permanently"
17351 cp ../binfile2 brmod
17352 cp ../binfile2 brmod-trmod
17353 cp ../binfile2 brmod-wdmod
17354 dotest binfiles2-5 "${testcvs} -q ci -m br-changes" \
17355 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/binfile\.dat,v
17357 Checking in binfile\.dat;
17358 ${CVSROOT_DIRNAME}/first-dir/Attic/binfile\.dat,v <-- binfile\.dat
17359 new revision: 1\.1\.2\.1; previous revision: 1\.1
17362 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
17363 new revision: 1\.1\.2\.1; previous revision: 1\.1
17365 Checking in brmod-trmod;
17366 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
17367 new revision: 1\.1\.2\.1; previous revision: 1\.1
17369 Checking in brmod-wdmod;
17370 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
17371 new revision: 1\.1\.2\.1; previous revision: 1\.1
17373 dotest binfiles2-6 "${testcvs} -q update -A" \
17374 "${PROG} update: binfile\.dat is no longer in the repository
17378 dotest_fail binfiles2-7 "test -f binfile.dat" ''
17379 dotest binfiles2-7-brmod "cmp ../binfile brmod"
17380 cp ../binfile3 brmod-trmod
17381 dotest binfiles2-7a "${testcvs} -q ci -m tr-modify" \
17382 "Checking in brmod-trmod;
17383 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
17384 new revision: 1\.2; previous revision: 1\.1
17386 cp ../binfile3 brmod-wdmod
17388 dotest binfiles2-8 "${testcvs} -q update -j br" \
17391 ${PROG} update: nonmergeable file needs merge
17392 ${PROG} update: revision 1.1.2.1 from repository is now in brmod-trmod
17393 ${PROG} update: file from working directory is now in .#brmod-trmod.1.2
17396 ${PROG} update: nonmergeable file needs merge
17397 ${PROG} update: revision 1.1.2.1 from repository is now in brmod-wdmod
17398 ${PROG} update: file from working directory is now in .#brmod-wdmod.1.1
17401 dotest binfiles2-9 "cmp ../binfile binfile.dat"
17402 dotest binfiles2-9-brmod "cmp ../binfile2 brmod"
17403 dotest binfiles2-9-brmod-trmod "cmp ../binfile2 brmod-trmod"
17404 dotest binfiles2-9-brmod-trmod "cmp ../binfile2 brmod-wdmod"
17405 dotest binfiles2-9a-brmod-trmod "cmp ../binfile3 .#brmod-trmod.1.2"
17406 dotest binfiles2-9a-brmod-wdmod "cmp ../binfile3 .#brmod-wdmod.1.1"
17408 # Test that everything was properly scheduled.
17409 dotest binfiles2-10 "${testcvs} -q ci -m checkin" \
17410 "Checking in binfile\.dat;
17411 ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
17412 new revision: 1\.2; previous revision: 1\.1
17415 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
17416 new revision: 1\.2; previous revision: 1\.1
17418 Checking in brmod-trmod;
17419 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
17420 new revision: 1\.3; previous revision: 1\.2
17422 Checking in brmod-wdmod;
17423 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
17424 new revision: 1\.2; previous revision: 1\.1
17427 dotest_fail binfiles2-o1 "${testcvs} -q admin -o :1.2 brmod-trmod" \
17428 "RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
17429 deleting revision 1\.2
17430 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v: can't remove branch point 1\.1
17431 ${PROG} admin: RCS file for .brmod-trmod. not modified\."
17432 dotest binfiles2-o2 "${testcvs} -q admin -o 1.1.2.1: brmod-trmod" \
17433 "RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
17434 deleting revision 1\.1\.2\.1
17436 dotest binfiles2-o3 "${testcvs} -q admin -o :1.2 brmod-trmod" \
17437 "RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
17438 deleting revision 1\.2
17439 deleting revision 1\.1
17441 dotest binfiles2-o4 "${testcvs} -q log -N brmod-trmod" "
17442 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
17443 Working file: brmod-trmod
17448 keyword substitution: b
17449 total revisions: 1; selected revisions: 1
17451 ----------------------------
17453 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
17455 ============================================================================="
17459 rm -rf ${CVSROOT_DIRNAME}/first-dir
17464 # More binary file tests, especially removing, adding, &c.
17465 # See "binfiles" for a list of binary file tests.
17466 mkdir ${CVSROOT_DIRNAME}/first-dir
17468 dotest binfiles3-1 "${testcvs} -q co first-dir" ''
17469 ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
17470 </dev/null | ${TR} '@' '\000' >binfile.dat
17473 dotest binfiles3-2 "${testcvs} add file1" \
17474 "${PROG} add: scheduling file .file1. for addition
17475 ${PROG} add: use .${PROG} commit. to add this file permanently"
17476 dotest binfiles3-3 "${testcvs} -q ci -m add-it" \
17477 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
17480 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17481 initial revision: 1\.1
17484 dotest binfiles3-4 "${testcvs} rm file1" \
17485 "${PROG} remove: scheduling .file1. for removal
17486 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
17487 dotest binfiles3-5 "${testcvs} -q ci -m remove-it" \
17489 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17490 new revision: delete; previous revision: 1\.1
17492 cp ../binfile.dat file1
17493 dotest binfiles3-6 "${testcvs} add -kb file1" \
17494 "${PROG} add: Re-adding file .file1. (in place of dead revision 1\.2)\.
17495 ${PROG} add: use .${PROG} commit. to add this file permanently"
17496 # The idea behind this test is to make sure that the file
17497 # gets opened in binary mode to send to "cvs ci".
17498 dotest binfiles3-6a "cat CVS/Entries" \
17499 "/file1/0/[A-Za-z0-9 :]*/-kb/
17501 # TODO: This just tests the case where the old keyword
17502 # expansion mode is the default (RCS_getexpand == NULL
17503 # in checkaddfile()); should also test the case in which
17504 # we are changing it from one non-default value to another.
17505 dotest binfiles3-7 "${testcvs} -q ci -m readd-it" \
17506 "${PROG} commit: changing keyword expansion mode to -kb
17508 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17509 new revision: 1\.3; previous revision: 1\.2
17511 dotest binfiles3-8 "${testcvs} -q log -h -N file1" "
17512 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
17513 Working file: file1
17518 keyword substitution: b
17520 ============================================================================="
17522 # OK, now test admin -o on a binary file. See "admin"
17523 # test for a more complete list of admin -o tests.
17524 cp ${TESTDIR}/1/binfile.dat ${TESTDIR}/1/binfile4.dat
17525 echo '%%$$##@@!!jjiiuull' | ${TR} j '\000' >>${TESTDIR}/1/binfile4.dat
17526 cp ${TESTDIR}/1/binfile4.dat ${TESTDIR}/1/binfile5.dat
17527 echo 'aawwee%$$##@@!!jjil' | ${TR} w '\000' >>${TESTDIR}/1/binfile5.dat
17529 cp ../binfile4.dat file1
17530 dotest binfiles3-9 "${testcvs} -q ci -m change" \
17531 "Checking in file1;
17532 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17533 new revision: 1\.4; previous revision: 1\.3
17535 cp ../binfile5.dat file1
17536 dotest binfiles3-10 "${testcvs} -q ci -m change" \
17537 "Checking in file1;
17538 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
17539 new revision: 1\.5; previous revision: 1\.4
17541 dotest binfiles3-11 "${testcvs} admin -o 1.3::1.5 file1" \
17542 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
17543 deleting revision 1\.4
17545 dotest binfiles3-12 "${testcvs} -q update -r 1.3 file1" "U file1"
17546 dotest binfiles3-13 "cmp file1 ${TESTDIR}/1/binfile.dat" ""
17550 rm -rf ${CVSROOT_DIRNAME}/first-dir
17554 # See comment at "mwrap" test for list of other wrappers tests.
17555 # Test cvs's ability to handle nonmergeable files specified with
17556 # -m 'COPY' in wrappers. Similar to the binfiles2 test,
17557 # which tests the same thing for binary files
17558 # (which are non-mergeable in the same sense).
17560 # Cases (we are merging from the branch to the trunk):
17561 # brmod) File modified on branch, not on trunk.
17562 # File should be copied over to trunk (no merging is needed).
17563 # brmod-trmod) File modified on branch, also on trunk.
17564 # This is a conflict. Present the user with both files and
17565 # let them figure it out.
17566 # brmod-wdmod) File modified on branch, not modified in the trunk
17567 # repository, but modified in the (trunk) working directory.
17568 # This is also a conflict.
17570 # For the moment, remote CVS can't pass wrappers from CVSWRAPPERS
17571 # (see wrap_send). So skip these tests for remote.
17572 if $remote; then :; else
17574 mkdir ${CVSROOT_DIRNAME}/first-dir
17576 dotest mcopy-1 "${testcvs} -q co first-dir" ''
17579 # FIXCVS: unless a branch has at least one file on it,
17580 # tag_check_valid won't know it exists. So if brmod didn't
17581 # exist, we would have to invent it.
17582 echo 'brmod initial contents' >brmod
17583 echo 'brmod-trmod initial contents' >brmod-trmod
17584 echo 'brmod-wdmod initial contents' >brmod-wdmod
17585 echo "* -m 'COPY'" >.cvswrappers
17587 "${testcvs} add .cvswrappers brmod brmod-trmod brmod-wdmod" \
17588 "${PROG} add: scheduling file .\.cvswrappers. for addition
17589 ${PROG} add: scheduling file .brmod. for addition
17590 ${PROG} add: scheduling file .brmod-trmod. for addition
17591 ${PROG} add: scheduling file .brmod-wdmod. for addition
17592 ${PROG} add: use .${PROG} commit. to add these files permanently"
17593 dotest mcopy-1b "${testcvs} -q ci -m add" \
17594 "RCS file: ${CVSROOT_DIRNAME}/first-dir/\.cvswrappers,v
17596 Checking in \.cvswrappers;
17597 ${CVSROOT_DIRNAME}/first-dir/\.cvswrappers,v <-- \.cvswrappers
17598 initial revision: 1\.1
17600 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod,v
17603 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
17604 initial revision: 1\.1
17606 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
17608 Checking in brmod-trmod;
17609 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
17610 initial revision: 1\.1
17612 RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v
17614 Checking in brmod-wdmod;
17615 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
17616 initial revision: 1\.1
17619 # NOTE: .cvswrappers files are broken (see comment in
17620 # src/wrapper.c). So doing everything via the environment
17621 # variable is a workaround. Better would be to test them
17623 CVSWRAPPERS="* -m 'COPY'"
17625 dotest mcopy-2 "${testcvs} -q tag -b br" 'T \.cvswrappers
17629 dotest mcopy-3 "$testcvs -q update -r br" \
17634 echo 'modify brmod on br' >brmod
17635 echo 'modify brmod-trmod on br' >brmod-trmod
17636 echo 'modify brmod-wdmod on br' >brmod-wdmod
17637 dotest mcopy-5 "${testcvs} -q ci -m br-changes" \
17638 "Checking in brmod;
17639 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
17640 new revision: 1\.1\.2\.1; previous revision: 1\.1
17642 Checking in brmod-trmod;
17643 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
17644 new revision: 1\.1\.2\.1; previous revision: 1\.1
17646 Checking in brmod-wdmod;
17647 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
17648 new revision: 1\.1\.2\.1; previous revision: 1\.1
17650 dotest mcopy-6 "$testcvs -q update -A" \
17655 dotest mcopy-7 "cat brmod brmod-trmod brmod-wdmod" \
17656 "brmod initial contents
17657 brmod-trmod initial contents
17658 brmod-wdmod initial contents"
17660 echo 'modify brmod-trmod again on trunk' >brmod-trmod
17661 dotest mcopy-7a "${testcvs} -q ci -m tr-modify" \
17662 "Checking in brmod-trmod;
17663 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
17664 new revision: 1\.2; previous revision: 1\.1
17666 echo 'modify brmod-wdmod in working dir' >brmod-wdmod
17668 dotest mcopy-8 "${testcvs} -q update -j br" \
17670 ${PROG} update: nonmergeable file needs merge
17671 ${PROG} update: revision 1.1.2.1 from repository is now in brmod-trmod
17672 ${PROG} update: file from working directory is now in .#brmod-trmod.1.2
17675 ${PROG} update: nonmergeable file needs merge
17676 ${PROG} update: revision 1.1.2.1 from repository is now in brmod-wdmod
17677 ${PROG} update: file from working directory is now in .#brmod-wdmod.1.1
17680 dotest mcopy-9 "cat brmod brmod-trmod brmod-wdmod" \
17681 "modify brmod on br
17682 modify brmod-trmod on br
17683 modify brmod-wdmod on br"
17684 dotest mcopy-9a "cat .#brmod-trmod.1.2 .#brmod-wdmod.1.1" \
17685 "modify brmod-trmod again on trunk
17686 modify brmod-wdmod in working dir"
17688 # Test that everything was properly scheduled.
17689 dotest mcopy-10 "${testcvs} -q ci -m checkin" \
17690 "Checking in brmod;
17691 ${CVSROOT_DIRNAME}/first-dir/brmod,v <-- brmod
17692 new revision: 1\.2; previous revision: 1\.1
17694 Checking in brmod-trmod;
17695 ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v <-- brmod-trmod
17696 new revision: 1\.3; previous revision: 1\.2
17698 Checking in brmod-wdmod;
17699 ${CVSROOT_DIRNAME}/first-dir/brmod-wdmod,v <-- brmod-wdmod
17700 new revision: 1\.2; previous revision: 1\.1
17705 rm -rf ${CVSROOT_DIRNAME}/first-dir
17709 fi # end of tests to be skipped for remote
17714 # Test the ability to specify binary-ness based on file name.
17715 # See "mwrap" for a list of other wrappers tests.
17717 mkdir dir-to-import
17719 touch foo.c foo.exe
17721 # While we're here, test for rejection of duplicate tag names.
17722 dotest_fail binwrap-0 \
17723 "${testcvs} import -m msg -I ! first-dir dup dup" \
17724 "${PROG} \[[a-z]* aborted\]: tag .dup. was specified more than once"
17726 if ${testcvs} import -m message -I ! -W "*.exe -k 'b'" \
17727 first-dir tag1 tag2 >>${LOGFILE}; then
17733 rm -r dir-to-import
17734 dotest binwrap-2 "${testcvs} -q co first-dir" 'U first-dir/foo.c
17735 U first-dir/foo.exe'
17736 dotest binwrap-3 "${testcvs} -q status first-dir" \
17737 "===================================================================
17738 File: foo\.c Status: Up-to-date
17740 Working revision: 1\.1\.1\.1.*
17741 Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
17743 Sticky Date: (none)
17744 Sticky Options: (none)
17746 ===================================================================
17747 File: foo\.exe Status: Up-to-date
17749 Working revision: 1\.1\.1\.1.*
17750 Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.exe,v
17752 Sticky Date: (none)
17753 Sticky Options: -kb"
17755 rm -rf ${CVSROOT_DIRNAME}/first-dir
17759 # Test the ability to specify binary-ness based on file name.
17760 # See "mwrap" for a list of other wrappers tests.
17762 mkdir dir-to-import
17764 touch foo.c foo.exe
17766 # Specify that all files are binary except *.c.
17767 # The order seems to matter, with the earlier rules taking
17768 # precedence. I'm not sure whether that is good or not,
17769 # but it is the current behavior.
17770 if ${testcvs} import -m message -I ! \
17771 -W "*.c -k 'o'" -W "* -k 'b'" \
17772 first-dir tag1 tag2 >>${LOGFILE}; then
17778 rm -r dir-to-import
17779 dotest binwrap2-2 "${testcvs} -q co first-dir" 'U first-dir/foo.c
17780 U first-dir/foo.exe'
17781 dotest binwrap2-3 "${testcvs} -q status first-dir" \
17782 "===================================================================
17783 File: foo\.c Status: Up-to-date
17785 Working revision: 1\.1\.1\.1.*
17786 Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
17788 Sticky Date: (none)
17789 Sticky Options: -ko
17791 ===================================================================
17792 File: foo\.exe Status: Up-to-date
17794 Working revision: 1\.1\.1\.1.*
17795 Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/first-dir/foo\.exe,v
17797 Sticky Date: (none)
17798 Sticky Options: -kb"
17800 rm -rf ${CVSROOT_DIRNAME}/first-dir
17804 # Test communication of file-specified -k wrappers between
17805 # client and server, in `import':
17807 # 1. Set up a directory tree, populate it with files.
17808 # 2. Give each directory a different .cvswrappers file.
17809 # 3. Give the server its own .cvswrappers file.
17810 # 4. Import the whole tree, see if the right files got set
17813 # The tree has a top ("0th") level, and two subdirs, sub1/
17814 # and sub2/; sub2/ contains directory subsub/. Every
17815 # directory has a .cvswrappers file as well as regular
17818 # In the file names, "foo-b.*" should end up binary, and
17819 # "foo-t.*" should end up text. Don't worry about the two
17820 # letter extensions; they're just there to help me keep
17823 # Here's the directory tree:
17833 # .cvswrappers .cvswrappers
17834 # foo-b.c1 foo-b.sb
17835 # foo-b.sb foo-b.st
17836 # foo-t.c0 foo-t.c0
17837 # foo-t.st foo-t.c1
17850 binwrap3_line1="This is a test file "
17851 binwrap3_line2="containing little of use "
17852 binwrap3_line3="except this non-haiku"
17854 binwrap3_text="${binwrap3_line1}${binwrap3_line2}${binwrap3_line3}"
17858 # On Windows, we can't check out CVSROOT, because the case
17859 # insensitivity means that this conflicts with cvsroot.
17863 mkdir binwrap3 # the 0th dir
17864 mkdir binwrap3/sub1
17865 mkdir binwrap3/sub2
17866 mkdir binwrap3/sub2/subsub
17868 echo "bar*" > binwrap3/.cvswrappers
17869 echo "*.c0 -k 'b'" >> binwrap3/.cvswrappers
17870 echo "whatever -k 'b'" >> binwrap3/.cvswrappers
17871 echo ${binwrap3_text} > binwrap3/foo-b.c0
17872 echo ${binwrap3_text} > binwrap3/bar-t.c0
17873 echo ${binwrap3_text} > binwrap3/foo-b.sb
17874 echo ${binwrap3_text} > binwrap3/foo-t.sb
17875 echo ${binwrap3_text} > binwrap3/foo-t.c1
17876 echo ${binwrap3_text} > binwrap3/foo-t.st
17878 echo "bar* -k 'kv'" > binwrap3/sub1/.cvswrappers
17879 echo "*.c1 -k 'b'" >> binwrap3/sub1/.cvswrappers
17880 echo "whatever -k 'b'" >> binwrap3/sub1/.cvswrappers
17881 echo ${binwrap3_text} > binwrap3/sub1/foo-b.c1
17882 echo ${binwrap3_text} > binwrap3/sub1/bar-t.c1
17883 echo ${binwrap3_text} > binwrap3/sub1/foo-b.sb
17884 echo ${binwrap3_text} > binwrap3/sub1/foo-t.sb
17885 echo ${binwrap3_text} > binwrap3/sub1/foo-t.c0
17886 echo ${binwrap3_text} > binwrap3/sub1/foo-t.st
17888 echo "bar*" > binwrap3/sub2/.cvswrappers
17889 echo "*.st -k 'b'" >> binwrap3/sub2/.cvswrappers
17890 echo ${binwrap3_text} > binwrap3/sub2/foo-b.sb
17891 echo ${binwrap3_text} > binwrap3/sub2/foo-t.sb
17892 echo ${binwrap3_text} > binwrap3/sub2/foo-b.st
17893 echo ${binwrap3_text} > binwrap3/sub2/bar-t.st
17894 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c0
17895 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c1
17896 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c2
17897 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c3
17899 echo "bar* -k 'kv'" > binwrap3/sub2/subsub/.cvswrappers
17900 echo "*.c3 -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
17901 echo "foo -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
17902 echo "c0* -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
17903 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-b.c3
17904 echo ${binwrap3_text} > binwrap3/sub2/subsub/bar-t.c3
17905 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-b.sb
17906 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.sb
17907 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c0
17908 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c1
17909 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c2
17910 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.st
17912 # Now set up CVSROOT/cvswrappers, the easy way:
17913 dotest binwrap3-1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
17915 # This destroys anything currently in cvswrappers, but
17916 # presumably other tests will take care of it themselves if
17917 # they use cvswrappers:
17918 echo "foo-t.sb" > cvswrappers
17919 echo "foo*.sb -k 'b'" >> cvswrappers
17920 dotest binwrap3-2 "${testcvs} -q ci -m cvswrappers-mod" \
17921 "Checking in cvswrappers;
17922 ${CVSROOT_DIRNAME}/CVSROOT/cvswrappers,v <-- cvswrappers
17923 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
17925 ${PROG} commit: Rebuilding administrative file database"
17928 # Avoid environmental interference
17929 CVSWRAPPERS_save=${CVSWRAPPERS}
17934 # Not importing .cvswrappers tests whether the client is really
17935 # letting the server know "honestly" whether the file is binary,
17936 # rather than just letting the server see the .cvswrappers file.
17937 dotest binwrap3-2a \
17938 "${testcvs} import -m . -I .cvswrappers binwrap3 tag1 tag2" \
17941 # OK, now test "cvs add".
17944 dotest binwrap3-2b "${testcvs} co binwrap3" "${DOTSTAR}"
17947 echo "*.newbin -k 'b'" > .cvswrappers
17948 echo .cvswrappers >.cvsignore
17949 echo .cvsignore >>.cvsignore
17950 touch file1.newbin file1.txt
17951 dotest binwrap3-2c "${testcvs} add file1.newbin file1.txt" \
17952 "${PROG} add: scheduling file .file1\.newbin. for addition
17953 ${PROG} add: scheduling file .file1\.txt. for addition
17954 ${PROG} add: use .${PROG} commit. to add these files permanently"
17955 dotest binwrap3-2d "${testcvs} -q ci -m add" \
17956 "RCS file: ${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.newbin,v
17958 Checking in file1\.newbin;
17959 ${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.newbin,v <-- file1\.newbin
17960 initial revision: 1\.1
17962 RCS file: ${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.txt,v
17964 Checking in file1\.txt;
17965 ${CVSROOT_DIRNAME}/binwrap3/sub2/file1\.txt,v <-- file1\.txt
17966 initial revision: 1\.1
17970 # Now check out the module and see which files are binary.
17973 dotest binwrap3-3 "${testcvs} co binwrap3" "${DOTSTAR}"
17976 # Running "cvs status" and matching output is too
17977 # error-prone, too likely to falsely fail. Instead, we'll
17978 # just grep the Entries lines:
17980 dotest binwrap3-top1 "grep foo-b.c0 ./CVS/Entries" \
17981 "/foo-b.c0/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
17983 dotest binwrap3-top2 "grep foo-b.sb ./CVS/Entries" \
17984 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
17986 dotest binwrap3-top3 "grep foo-t.c1 ./CVS/Entries" \
17987 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
17989 dotest binwrap3-top4 "grep foo-t.st ./CVS/Entries" \
17990 "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
17992 dotest binwrap3-top5 "grep foo-t.sb ./CVS/Entries" \
17993 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//"
17995 dotest binwrap3-top6 "grep bar-t.c0 ./CVS/Entries" \
17996 "/bar-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
17998 dotest binwrap3-sub1-1 "grep foo-b.c1 sub1/CVS/Entries" \
17999 "/foo-b.c1/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
18001 dotest binwrap3-sub1-2 "grep foo-b.sb sub1/CVS/Entries" \
18002 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
18004 dotest binwrap3-sub1-3 "grep foo-t.c0 sub1/CVS/Entries" \
18005 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
18007 dotest binwrap3-sub1-4 "grep foo-t.st sub1/CVS/Entries" \
18008 "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
18010 dotest binwrap3-sub1-5 "grep foo-t.sb sub1/CVS/Entries" \
18011 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//"
18013 dotest binwrap3-sub1-6 "grep bar-t.c1 sub1/CVS/Entries" \
18014 "/bar-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
18016 dotest binwrap3-sub2-1 "grep foo-b.sb sub2/CVS/Entries" \
18017 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
18019 dotest binwrap3-sub2-2 "grep foo-b.st sub2/CVS/Entries" \
18020 "/foo-b.st/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
18022 dotest binwrap3-sub2-3 "grep foo-t.c0 sub2/CVS/Entries" \
18023 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
18025 dotest binwrap3-sub2-4 "grep foo-t.c1 sub2/CVS/Entries" \
18026 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
18028 dotest binwrap3-sub2-5 "grep foo-t.c2 sub2/CVS/Entries" \
18029 "/foo-t.c2/1.1.1.1/[A-Za-z0-9 :]*//"
18031 dotest binwrap3-sub2-6 "grep foo-t.c3 sub2/CVS/Entries" \
18032 "/foo-t.c3/1.1.1.1/[A-Za-z0-9 :]*//"
18034 dotest binwrap3-sub2-7 "grep foo-t.sb sub2/CVS/Entries" \
18035 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//"
18037 dotest binwrap3-sub2-8 "grep bar-t.st sub2/CVS/Entries" \
18038 "/bar-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
18040 dotest binwrap3-subsub1 "grep foo-b.c3 sub2/subsub/CVS/Entries" \
18041 "/foo-b.c3/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
18043 dotest binwrap3-subsub2 "grep foo-b.sb sub2/subsub/CVS/Entries" \
18044 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/"
18046 dotest binwrap3-subsub3 "grep foo-t.c0 sub2/subsub/CVS/Entries" \
18047 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 :]*//"
18049 dotest binwrap3-subsub4 "grep foo-t.c1 sub2/subsub/CVS/Entries" \
18050 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 :]*//"
18052 dotest binwrap3-subsub5 "grep foo-t.c2 sub2/subsub/CVS/Entries" \
18053 "/foo-t.c2/1.1.1.1/[A-Za-z0-9 :]*//"
18055 dotest binwrap3-subsub6 "grep foo-t.st sub2/subsub/CVS/Entries" \
18056 "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//"
18058 dotest binwrap3-subsub7 "grep foo-t.sb sub2/subsub/CVS/Entries" \
18059 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//"
18061 dotest binwrap3-subsub8 "grep bar-t.c3 sub2/subsub/CVS/Entries" \
18062 "/bar-t.c3/1.1.1.1/[A-Za-z0-9 :]*//"
18064 dotest binwrap3-sub2-add1 "grep file1.newbin sub2/CVS/Entries" \
18065 "/file1.newbin/1.1/[A-Za-z0-9 :]*/-kb/"
18066 dotest binwrap3-sub2-add2 "grep file1.txt sub2/CVS/Entries" \
18067 "/file1.txt/1.1/[A-Za-z0-9 :]*//"
18069 # Restore and clean up
18071 rm -r binwrap3 CVSROOT
18074 rm -rf ${CVSROOT_DIRNAME}/binwrap3
18075 CVSWRAPPERS=${CVSWRAPPERS_save}
18079 # Tests of various wrappers features:
18080 # -m 'COPY' and cvs update: mwrap
18081 # -m 'COPY' and joining: mcopy
18082 # -k: binwrap, binwrap2
18083 # -t/-f: hasn't been written yet.
18085 # Tests of different ways of specifying wrappers:
18086 # CVSROOT/cvswrappers: mwrap
18087 # -W: binwrap, binwrap2
18088 # .cvswrappers in working directory, local: mcopy
18089 # CVSROOT/cvswrappers, .cvswrappers remote: binwrap3
18090 # CVSWRAPPERS environment variable: mcopy
18092 # This test is similar to binfiles-con1; -m 'COPY' specifies
18093 # non-mergeableness the same way that -kb does.
18095 # On Windows, we can't check out CVSROOT, because the case
18096 # insensitivity means that this conflicts with cvsroot.
18100 dotest mwrap-c1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
18102 echo "* -m 'COPY'" >>cvswrappers
18103 dotest mwrap-c2 "${testcvs} -q ci -m wrapper-mod" \
18104 "Checking in cvswrappers;
18105 ${CVSROOT_DIRNAME}/CVSROOT/cvswrappers,v <-- cvswrappers
18106 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18108 ${PROG} commit: Rebuilding administrative file database"
18111 dotest mwrap-1 "${testcvs} -q co -l ." ''
18113 dotest mwrap-2 "${testcvs} add first-dir" \
18114 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
18117 dotest mwrap-3 "${testcvs} add aa" \
18118 "${PROG} add: scheduling file .aa. for addition
18119 ${PROG} add: use .${PROG} commit. to add this file permanently"
18120 dotest mwrap-4 "${testcvs} -q ci -m add" \
18121 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
18124 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
18125 initial revision: 1\.1
18129 dotest mwrap-5 "${testcvs} -q co first-dir" "U first-dir/aa"
18131 echo "changed in m2" >aa
18132 dotest mwrap-6 "${testcvs} -q ci -m m2-mod" \
18134 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
18135 new revision: 1\.2; previous revision: 1\.1
18139 echo "changed in m1" >aa
18140 dotest mwrap-7 "$testcvs -nq update" \
18141 "${PROG} update: nonmergeable file needs merge
18142 ${PROG} update: revision 1\.2 from repository is now in aa
18143 ${PROG} update: file from working directory is now in \.#aa\.1\.1
18145 dotest mwrap-8 "${testcvs} -q update" \
18146 "$PROG update: nonmergeable file needs merge
18147 ${PROG} update: revision 1\.2 from repository is now in aa
18148 ${PROG} update: file from working directory is now in \.#aa\.1\.1
18150 dotest mwrap-9 "cat aa" "changed in m2"
18151 dotest mwrap-10 "cat .#aa.1.1" "changed in m1"
18154 echo '# comment out' >cvswrappers
18155 dotest mwrap-ce "${testcvs} -q ci -m wrapper-mod" \
18156 "Checking in cvswrappers;
18157 ${CVSROOT_DIRNAME}/CVSROOT/cvswrappers,v <-- cvswrappers
18158 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18160 ${PROG} commit: Rebuilding administrative file database"
18166 rm -rf ${CVSROOT_DIRNAME}/first-dir
18170 # Administrative file tests.
18171 # Here is a list of where each administrative file is tested:
18173 # modules: modules, modules2, modules3
18174 # cvsignore: ignore
18176 # cvswrappers: mwrap
18180 # On Windows, we can't check out CVSROOT, because the case
18181 # insensitivity means that this conflicts with cvsroot.
18185 dotest info-1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
18187 rm -f $TESTDIR/testlog $TESTDIR/testlog2
18188 echo "ALL sh -c \"echo x\${=MYENV}\${=OTHER}y\${=ZEE}=\$USER=\$CVSROOT= >>$TESTDIR/testlog; cat >/dev/null\"" > loginfo
18189 # The following cases test the format string substitution
18190 echo "ALL echo %{sVv} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18191 echo "ALL echo %{v} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18192 echo "ALL echo %s >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18193 echo "ALL echo %{V}AX >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18194 echo "first-dir echo %sux >>$TESTDIR/testlog2; cat >/dev/null" \
18197 # Might be nice to move this to crerepos tests; it should
18198 # work to create a loginfo file if you didn't create one
18200 : dotest info-2 "${testcvs} add loginfo" \
18201 "${PROG}"' add: scheduling file `loginfo'"'"' for addition
18202 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
18204 dotest info-3 "${testcvs} -q ci -m new-loginfo" \
18205 "Checking in loginfo;
18206 ${CVSROOT_DIRNAME}/CVSROOT/loginfo,v <-- loginfo
18207 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18209 ${PROG} commit: Rebuilding administrative file database"
18212 mkdir ${CVSROOT_DIRNAME}/first-dir
18213 dotest info-5 "${testcvs} -q co first-dir" ''
18216 dotest info-6 "${testcvs} add file1" \
18217 "${PROG}"' add: scheduling file `file1'\'' for addition
18218 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
18219 echo "cvs -s OTHER=not-this -s MYENV=env-" >>$HOME/.cvsrc
18220 dotest info-6a "${testcvs} -q -s OTHER=value ci -m add-it" \
18221 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18224 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18225 initial revision: 1\.1
18227 ${PROG} commit: loginfo:1: no such user variable \${=ZEE}"
18229 dotest info-6b "${testcvs} -q -sOTHER=foo ci -m mod-it" \
18230 "Checking in file1;
18231 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18232 new revision: 1\.2; previous revision: 1\.1
18234 ${PROG} commit: loginfo:1: no such user variable \${=ZEE}"
18236 dotest info-7 "${testcvs} -q -s OTHER=value -s ZEE=z ci -m mod-it" \
18237 "Checking in file1;
18238 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18239 new revision: 1\.3; previous revision: 1\.2
18242 dotest info-9 "cat $TESTDIR/testlog" "xenv-valueyz=${username}=${CVSROOT_DIRNAME}="
18243 dotest info-10 "cat $TESTDIR/testlog2" \
18244 'first-dir file1,NONE,1.1
18249 first-dir file1,1.1,1.2
18254 first-dir file1,1.2,1.3
18261 echo '# do nothing' >loginfo
18262 dotest info-11 "${testcvs} -q -s ZEE=garbage ci -m nuke-loginfo" \
18263 "Checking in loginfo;
18264 ${CVSROOT_DIRNAME}/CVSROOT/loginfo,v <-- loginfo
18265 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18267 ${PROG} commit: Rebuilding administrative file database"
18269 # Now test verifymsg
18270 cat >${TESTDIR}/vscript <<EOF
18272 if sed 1q < \$1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
18274 elif sed 1q < \$1 | grep '^BugId:[ ]*new$' > /dev/null; then
18275 echo A new bugid was found. >> \$1
18278 echo "No BugId found."
18283 cat >${TESTDIR}/vscript2 <<EOF
18285 if test -f CVS/Repository; then
18286 repo=\`cat CVS/Repository\`
18291 if echo "\$repo" |grep yet-another/ >/dev/null 2>&1; then
18297 # Grumble, grumble, mumble, search for "Cygwin".
18298 if test -n "$remotehost"; then
18299 $CVS_RSH $remotehost "chmod +x ${TESTDIR}/vscript*"
18301 chmod +x ${TESTDIR}/vscript*
18303 echo "^first-dir/yet-another\\(/\\|\$\\) ${TESTDIR}/vscript2" >>verifymsg
18304 echo "^first-dir\\(/\\|\$\\) ${TESTDIR}/vscript" >>verifymsg
18305 echo "^missing-script\$ ${TESTDIR}/bogus" >>verifymsg
18306 echo "^missing-var\$ ${TESTDIR}/vscript \${=Bogus}" >>verifymsg
18307 # first test the directory independant verifymsg
18308 dotest info-v1 "${testcvs} -q ci -m add-verification" \
18309 "Checking in verifymsg;
18310 ${CVSROOT_DIRNAME}/CVSROOT/verifymsg,v <-- verifymsg
18311 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18313 ${PROG} commit: Rebuilding administrative file database"
18317 dotest_fail info-v2 "${testcvs} -q ci -m bogus" \
18319 ${PROG} \[commit aborted\]: Message verification failed"
18321 cat >${TESTDIR}/comment.tmp <<EOF
18323 and many more lines after it
18325 dotest info-v3 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
18326 "Checking in file1;
18327 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18328 new revision: 1\.4; previous revision: 1\.3
18330 rm ${TESTDIR}/comment.tmp
18336 dotest_fail info-v4 \
18337 "${testcvs} import -m bogus first-dir/another x y" \
18339 ${PROG} \[import aborted\]: Message verification failed"
18341 # now verify that directory dependent verifymsgs work
18343 "${testcvs} import -m bogus first-dir/yet-another x y" \
18344 "${TESTDIR}/wnt/another-dir
18345 N first-dir/yet-another/file2
18347 No conflicts created by this import" \
18348 "${CVSROOT_DIRNAME}/first-dir/yet-another
18349 N first-dir/yet-another/file2
18351 No conflicts created by this import"
18355 # note that in the local case the error message is the same as
18358 # This means that the verifymsg scripts cannot reliably and
18359 # consistantly obtain information on which directory is being
18360 # committed to. Thus it is currently useless for them to be
18361 # running in every dir. They should either be run once or
18362 # directory information should be passed.
18364 dotest_fail info-v6r \
18365 "${testcvs} import -m bogus first-dir/yet-another/and-another x y" \
18366 "${CVSROOT_DIRNAME}/first-dir/yet-another/and-another
18367 ${PROG} \[import aborted\]: Message verification failed"
18370 "${testcvs} import -m bogus first-dir/yet-another/and-another x y" \
18371 "${TESTDIR}/wnt/another-dir
18372 N first-dir/yet-another/and-another/file2
18374 No conflicts created by this import"
18377 # check that errors invoking the script cause verification failure
18379 # The second text below occurs on Cygwin, where I assume execvp
18380 # does not return to let CVS print the error message when its
18381 # argument does not exist.
18382 dotest_fail info-v7 "${testcvs} import -m bogus missing-script x y" \
18383 "${PROG} import: cannot exec ${TESTDIR}/bogus: No such file or directory
18384 ${PROG} \[import aborted\]: Message verification failed" \
18385 "${PROG} \[import aborted\]: Message verification failed"
18387 dotest_fail info-v8 "${testcvs} import -m bogus missing-var x y" \
18388 "${PROG} import: verifymsg:25: no such user variable \${=Bogus}
18389 ${PROG} \[import aborted\]: Message verification failed"
18396 echo "RereadLogAfterVerify=always" >>config
18397 dotest info-rereadlog-1 "${testcvs} -q ci -m add-RereadLogAfterVerify=always" \
18398 "Checking in config;
18399 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
18400 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18402 ${PROG} commit: Rebuilding administrative file database"
18405 cat >${TESTDIR}/comment.tmp <<EOF
18407 See what happens next.
18409 dotest info-reread-2 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
18410 "Checking in file1;
18411 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18412 new revision: 1\.5; previous revision: 1\.4
18414 dotest info-reread-3 "${testcvs} -q log -N -r1.5 file1" "
18417 See what happens next.
18418 A new bugid was found.
18419 ============================================================================="
18422 grep -v "RereadLogAfterVerify" config > config.new
18423 mv config.new config
18424 echo "RereadLogAfterVerify=stat" >>config
18425 dotest info-reread-4 "${testcvs} -q ci -m add-RereadLogAfterVerify=stat" \
18426 "Checking in config;
18427 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
18428 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18430 ${PROG} commit: Rebuilding administrative file database"
18433 cat >${TESTDIR}/comment.tmp <<EOF
18435 See what happens next with stat.
18437 dotest info-reread-5 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
18438 "Checking in file1;
18439 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18440 new revision: 1\.6; previous revision: 1\.5
18442 dotest info-reread-6 "${testcvs} -q log -N -r1.6 file1" "
18445 See what happens next with stat.
18446 A new bugid was found.
18447 ============================================================================="
18450 grep -v "RereadLogAfterVerify" config > config.new
18451 mv config.new config
18452 echo "RereadLogAfterVerify=never" >>config
18453 dotest info-reread-7 "${testcvs} -q ci -m add-RereadLogAfterVerify=never" \
18454 "Checking in config;
18455 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
18456 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18458 ${PROG} commit: Rebuilding administrative file database"
18461 cat >${TESTDIR}/comment.tmp <<EOF
18463 See what happens next.
18465 dotest info-reread-8 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
18466 "Checking in file1;
18467 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18468 new revision: 1\.7; previous revision: 1\.6
18470 dotest info-reread-6 "${testcvs} -q log -N -r1.7 file1" "
18473 See what happens next.
18474 ============================================================================="
18477 echo 'DEFAULT false' >verifymsg
18478 echo 'DEFAULT true' >>verifymsg
18479 echo '# defaults' >config
18480 dotest info-multdef "${testcvs} -q ci -m multdef" \
18481 "Checking in config;
18482 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
18483 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18485 Checking in verifymsg;
18486 ${CVSROOT_DIRNAME}/CVSROOT/verifymsg,v <-- verifymsg
18487 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18489 ${PROG} commit: Rebuilding administrative file database"
18492 echo '# do nothing' >verifymsg
18493 dotest info-cleanup-verifymsg "${testcvs} -q ci -m nuke-verifymsg" \
18494 "${PROG} commit: Multiple .DEFAULT. lines (1 and 2) in verifymsg file
18495 Checking in verifymsg;
18496 ${CVSROOT_DIRNAME}/CVSROOT/verifymsg,v <-- verifymsg
18497 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18499 ${PROG} commit: Rebuilding administrative file database"
18500 rm ${TESTDIR}/vscript*
18503 dotest_fail info-cleanup-0 "${testcvs} -n release -d CVSROOT" \
18504 "${PROG} \[release aborted\]: cannot run command ${DOTSTAR}"
18506 if echo "yes" | ${testcvs} release -d CVSROOT >>${LOGFILE} ; then
18511 if echo "yes" | ${testcvs} release -d first-dir >>${LOGFILE} ; then
18512 pass info-cleanup-2
18514 fail info-cleanup-2
18519 rm -rf ${CVSROOT_DIRNAME}/first-dir
18523 # Tests of the CVSROOT/taginfo file. See the comment at the
18524 # "info" tests for a full list of administrative file tests.
18530 dotest taginfo-1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
18532 cat >${TESTDIR}/1/loggit <<EOF
18534 if test "\$1" = rejectme; then
18537 echo "\$@" >>${TESTDIR}/1/taglog
18542 if test -n "$remotehost"; then
18543 $CVS_RSH $remotehost "chmod +x ${TESTDIR}/1/loggit"
18545 chmod +x ${TESTDIR}/1/loggit
18547 echo "ALL ${TESTDIR}/1/loggit" >taginfo
18548 dotest taginfo-2 "${testcvs} -q ci -m check-in-taginfo" \
18549 "Checking in taginfo;
18550 ${CVSROOT_DIRNAME}/CVSROOT/taginfo,v <-- taginfo
18551 new revision: 1\.2; previous revision: 1\.1
18553 ${PROG} commit: Rebuilding administrative file database"
18556 # taginfo-3 used to rely on the top-level CVS directory
18557 # being created to add "first-dir" to the repository. Since
18558 # that won't happen anymore, we create the directory in the
18560 mkdir ${CVSROOT_DIRNAME}/first-dir
18561 dotest taginfo-3 "${testcvs} -q co first-dir" ''
18565 dotest taginfo-4 "${testcvs} add file1" \
18566 "${PROG} add: scheduling file .file1. for addition
18567 ${PROG} add: use .${PROG} commit. to add this file permanently"
18568 dotest taginfo-5 "${testcvs} -q ci -m add-it" \
18569 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18572 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18573 initial revision: 1\.1
18575 dotest taginfo-6 "${testcvs} -q tag tag1" "T file1"
18576 dotest taginfo-7 "${testcvs} -q tag -b br" "T file1"
18577 dotest taginfo-8 "$testcvs -q update -r br" '[UP] file1'
18578 echo add text on branch >>file1
18579 dotest taginfo-9 "${testcvs} -q ci -m modify-on-br" \
18580 "Checking in file1;
18581 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18582 new revision: 1\.1\.2\.1; previous revision: 1\.1
18584 dotest taginfo-10 "${testcvs} -q tag -F -c brtag" "T file1"
18586 dotest_fail taginfo-11 "${testcvs} -q tag rejectme" \
18587 "${PROG} tag: Pre-tag check failed
18588 ${PROG} \[tag aborted\]: correct the above errors first!"
18590 # When we are using taginfo to allow/disallow, it would be
18591 # convenient to be able to use "cvs -n tag" to test whether
18592 # the allow/disallow functionality is working as expected.
18593 dotest taginfo-12 "${testcvs} -nq tag rejectme" "T file1"
18595 # But when taginfo is used for logging, it is a pain for -n
18596 # to call taginfo, since taginfo doesn't know whether -n was
18597 # specified or not.
18598 dotest taginfo-13 "${testcvs} -nq tag would-be-tag" "T file1"
18600 # Deleting: the cases are basically either the tag existed,
18601 # or it didn't exist.
18602 dotest taginfo-14 "${testcvs} -q tag -d tag1" "D file1"
18603 dotest taginfo-15 "${testcvs} -q tag -d tag1" ""
18605 # Likewise with rtag.
18606 dotest taginfo-16 "${testcvs} -q rtag tag1 first-dir" ""
18607 dotest taginfo-17 "${testcvs} -q rtag -d tag1 first-dir" ""
18608 dotest taginfo-18 "${testcvs} -q rtag -d tag1 first-dir" ""
18610 # The "br" example should be passing 1.1.2 or 1.1.0.2.
18611 # But it turns out that is very hard to implement, since
18612 # check_fileproc doesn't know what branch number it will
18613 # get. Probably the whole thing should be re-architected
18614 # so that taginfo only allows/denies tagging, and a new
18615 # hook, which is done from tag_fileproc, does logging.
18616 # That would solve this, some more subtle races, and also
18617 # the fact that it is nice for users to run "-n tag foo" to
18618 # see whether a tag would be allowed. Failing that,
18619 # I suppose passing "1.1.branch" or "branch" for "br"
18620 # would be an improvement.
18621 dotest taginfo-examine "cat ${TESTDIR}/1/taglog" \
18622 "tag1 add ${CVSROOT_DIRNAME}/first-dir file1 1.1
18623 br add ${CVSROOT_DIRNAME}/first-dir file1 1.1
18624 brtag mov ${CVSROOT_DIRNAME}/first-dir file1 1.1.2.1
18625 tag1 del ${CVSROOT_DIRNAME}/first-dir file1 1.1
18626 tag1 del ${CVSROOT_DIRNAME}/first-dir
18627 tag1 add ${CVSROOT_DIRNAME}/first-dir file1 1.1
18628 tag1 del ${CVSROOT_DIRNAME}/first-dir file1 1.1
18629 tag1 del ${CVSROOT_DIRNAME}/first-dir"
18633 echo '# Keep life simple' > taginfo
18634 dotest taginfo-cleanup-1 "${testcvs} -q ci -m check-in-taginfo" \
18635 "Checking in taginfo;
18636 ${CVSROOT_DIRNAME}/CVSROOT/taginfo,v <-- taginfo
18637 new revision: 1\.3; previous revision: 1\.2
18639 ${PROG} commit: Rebuilding administrative file database"
18643 rm -rf ${CVSROOT_DIRNAME}/first-dir
18647 # Tests of the CVSROOT/config file. See the comment at the
18648 # "info" tests for a full list of administrative file tests.
18650 # On Windows, we can't check out CVSROOT, because the case
18651 # insensitivity means that this conflicts with cvsroot.
18655 dotest config-1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
18657 echo 'bogus line' >config
18658 # We can't rely on specific revisions, since other tests
18659 # might need to modify CVSROOT/config
18660 dotest config-3 "${testcvs} -q ci -m change-to-bogus-line" \
18661 "Checking in config;
18662 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
18663 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18665 ${PROG} commit: Rebuilding administrative file database"
18666 echo 'BogusOption=yes' >config
18667 dotest config-4 "${testcvs} -q ci -m change-to-bogus-opt" \
18668 "${PROG} [a-z]*: syntax error in ${CVSROOT_DIRNAME}/CVSROOT/config: line 'bogus line' is missing '='
18669 Checking in config;
18670 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
18671 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18673 ${PROG} commit: Rebuilding administrative file database"
18674 echo '# No config is a good config' > config
18675 dotest config-5 "${testcvs} -q ci -m change-to-comment" \
18676 "${PROG} [a-z]*: ${CVSROOT_DIRNAME}/CVSROOT/config: unrecognized keyword 'BogusOption'
18677 Checking in config;
18678 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
18679 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18681 ${PROG} commit: Rebuilding administrative file database"
18682 dotest config-6 "${testcvs} -q update" ''
18683 echo 'IgnoreUnknownConfigKeys=yes' > config
18684 echo 'BogusOption=yes' >> config
18685 dotest config-7 "${testcvs} -q ci -m change-to-comment" \
18686 "Checking in config;
18687 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
18688 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18690 ${PROG} commit: Rebuilding administrative file database"
18691 dotest config-8 "${testcvs} -q update" ''
18692 echo '# No config is a good config' > config
18693 dotest config-9 "${testcvs} -q ci -m change-to-comment" \
18694 "Checking in config;
18695 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
18696 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18698 ${PROG} commit: Rebuilding administrative file database"
18699 dotest config-10 "${testcvs} -q update" ''
18708 # Test remote CVS handling of unpatchable files. This isn't
18709 # much of a test for local CVS.
18710 # We test this with some keyword expansion games, but the situation
18711 # also arises if the user modifies the file while CVS is running.
18712 mkdir ${CVSROOT_DIRNAME}/first-dir
18715 dotest serverpatch-1 "${testcvs} -q co first-dir" ''
18719 # Add a file with an RCS keyword.
18720 echo '$''Name$' > file1
18722 dotest serverpatch-2 "${testcvs} add file1" \
18723 "${PROG}"' add: scheduling file `file1'\'' for addition
18724 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
18726 dotest serverpatch-3 "${testcvs} -q commit -m add" \
18727 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18730 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18731 initial revision: 1\.1
18735 dotest serverpatch-4 "${testcvs} -q tag tag file1" 'T file1'
18737 # Check out a tagged copy of the file.
18741 dotest serverpatch-5 "${testcvs} -q co -r tag first-dir" \
18742 'U first-dir/file1'
18744 # Remove the tag. Prior to 1.11.23, this left the tag string in the
18745 # expansion of the Name keyword.
18746 dotest serverpatch-6 "$testcvs -q update -A first-dir" \
18747 'U first-dir/file1'
18749 # Modify and check in the first copy.
18752 dotest serverpatch-7 "${testcvs} -q ci -mx file1" \
18753 "Checking in file1;
18754 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18755 new revision: 1\.2; previous revision: 1\.1
18758 # Now update the second copy. Prior to 1.11.23, the patch would fail
18759 # using remote CVS, forcing the file to be refetched.
18760 cd ../../2/first-dir
18761 dotest serverpatch-8 "${testcvs} -q update" \
18766 rm -rf ${CVSROOT_DIRNAME}/first-dir
18770 # Test selecting revisions with cvs log.
18771 # See also log2 tests for more tests.
18772 # See also branches-14.3 for logging with a branch off of a branch.
18773 # See also multibranch-14 for logging with several branches off the
18774 # same branchpoint.
18775 # Tests of each option to cvs log:
18776 # -h: admin-19a-log
18777 # -N: log, log2, admin-19a-log
18782 # -w, -t: not tested yet (TODO)
18784 # Check in a file with a few revisions and branches.
18785 mkdir ${CVSROOT_DIRNAME}/first-dir
18786 dotest log-1 "${testcvs} -q co first-dir" ''
18788 echo 'first revision' > file1
18789 echo 'first revision' > file2
18790 dotest log-2 "${testcvs} add file1 file2" \
18791 "${PROG} add: scheduling file .file1. for addition
18792 ${PROG} add: scheduling file .file2. for addition
18793 ${PROG} add: use .${PROG} commit. to add these files permanently"
18795 # While we're at it, check multi-line comments, input from file,
18796 # and trailing whitespace trimming
18797 echo 'line 1 ' >${TESTDIR}/comment.tmp
18798 echo ' ' >>${TESTDIR}/comment.tmp
18799 echo 'line 2 ' >>${TESTDIR}/comment.tmp
18800 echo ' ' >>${TESTDIR}/comment.tmp
18801 echo ' ' >>${TESTDIR}/comment.tmp
18802 dotest log-3 "${testcvs} -q commit -F ${TESTDIR}/comment.tmp" \
18803 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18806 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18807 initial revision: 1\.1
18809 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
18812 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
18813 initial revision: 1\.1
18815 rm -f ${TESTDIR}/comment.tmp
18817 echo 'second revision' > file1
18818 echo 'second revision' > file2
18819 dotest log-4 "${testcvs} -q ci -m2 file1 file2" \
18820 "Checking in file1;
18821 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18822 new revision: 1\.2; previous revision: 1\.1
18825 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
18826 new revision: 1\.2; previous revision: 1\.1
18829 dotest log-5 "${testcvs} -q tag -b branch file1" 'T file1'
18830 dotest log-5a "${testcvs} -q tag tag1 file2" 'T file2'
18832 echo 'third revision' > file1
18833 echo 'third revision' > file2
18834 dotest log-6 "${testcvs} -q ci -m3 file1 file2" \
18835 "Checking in file1;
18836 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18837 new revision: 1\.3; previous revision: 1\.2
18840 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
18841 new revision: 1\.3; previous revision: 1\.2
18844 dotest log-6a "${testcvs} -q tag tag2 file2" 'T file2'
18846 dotest log-7 "${testcvs} -q update -r branch" \
18848 ${PROG} update: file2 is no longer in the repository"
18850 echo 'first branch revision' > file1
18851 dotest log-8 "${testcvs} -q ci -m1b file1" \
18852 "Checking in file1;
18853 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18854 new revision: 1\.2\.2\.1; previous revision: 1\.2
18857 dotest log-9 "${testcvs} -q tag tag file1" 'T file1'
18859 echo 'second branch revision' > file1
18860 dotest log-10 "${testcvs} -q ci -m2b file1" \
18861 "Checking in file1;
18862 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
18863 new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
18866 # Set up a bunch of shell variables to make the later tests
18867 # easier to describe.=
18869 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18870 Working file: file1
18876 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18881 log_tags1='symbolic names:
18883 branch: 1\.2\.0\.2'
18884 log_keyword='keyword substitution: kv'
18885 log_dash='----------------------------
18887 log_date="date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;"
18888 log_lines=" lines: ${PLUS}1 -1"
18889 log_rev1="${log_dash} 1\.1
18894 log_rev2="${log_dash} 1\.2
18895 ${log_date}${log_lines}
18898 log_rev3="${log_dash} 1\.3
18899 ${log_date}${log_lines}
18901 log_rev1b="${log_dash} 1\.2\.2\.1
18902 ${log_date}${log_lines}
18904 log_rev2b="${log_dash} 1\.2\.2\.2
18905 ${log_date}${log_lines}
18907 log_trailer='============================================================================='
18909 # Now, finally, test the log output.
18911 dotest log-11 "${testcvs} log file1" \
18915 total revisions: 5; selected revisions: 5
18924 dotest log-12 "${testcvs} log -N file1" \
18927 total revisions: 5; selected revisions: 5
18936 dotest log-13 "${testcvs} log -b file1" \
18940 total revisions: 5; selected revisions: 3
18947 dotest log-14 "${testcvs} log -r file1" \
18951 total revisions: 5; selected revisions: 1
18956 dotest log-14a "${testcvs} log -rHEAD file1" \
18960 total revisions: 5; selected revisions: 1
18965 # The user might not realize that "-r" must not take a space.
18966 # In the error message, HEAD is a file name, not a tag name (which
18967 # might be confusing itself).
18968 dotest_fail log-14b "${testcvs} log -r HEAD file1" \
18969 "${PROG} log: nothing known about HEAD
18973 total revisions: 5; selected revisions: 1
18978 # Check that unusual syntax works correctly.
18980 dotest log-14c "${testcvs} log -r: file1" \
18984 total revisions: 5; selected revisions: 1
18988 dotest log-14d "${testcvs} log -r, file1" \
18992 total revisions: 5; selected revisions: 1
18996 dotest log-14e "${testcvs} log -r. file1" \
19000 total revisions: 5; selected revisions: 1
19004 dotest log-14f "${testcvs} log -r:: file1" \
19008 total revisions: 5; selected revisions: 0
19012 dotest log-15 "${testcvs} log -r1.2 file1" \
19016 total revisions: 5; selected revisions: 1
19021 dotest log-16 "${testcvs} log -r1.2.2 file1" \
19025 total revisions: 5; selected revisions: 2
19031 # This test would fail with the old invocation of rlog, but it
19032 # works with the builtin log support.
19033 dotest log-17 "${testcvs} log -rbranch file1" \
19037 total revisions: 5; selected revisions: 2
19043 dotest log-18 "${testcvs} log -r1.2.2. file1" \
19047 total revisions: 5; selected revisions: 1
19052 # Multiple -r options are undocumented; see comments in
19053 # cvs.texinfo about whether they should be deprecated.
19054 dotest log-18a "${testcvs} log -r1.2.2.2 -r1.3:1.3 file1" \
19058 total revisions: 5; selected revisions: 2
19064 # This test would fail with the old invocation of rlog, but it
19065 # works with the builtin log support.
19066 dotest log-19 "${testcvs} log -rbranch. file1" \
19070 total revisions: 5; selected revisions: 1
19075 dotest log-20 "${testcvs} log -r1.2: file1" \
19079 total revisions: 5; selected revisions: 2
19085 dotest log-20a "${testcvs} log -r1.2:: file1" \
19089 total revisions: 5; selected revisions: 1
19094 dotest log-21 "${testcvs} log -r:1.2 file1" \
19098 total revisions: 5; selected revisions: 2
19104 dotest log-21a "${testcvs} log -r::1.2 file1" \
19108 total revisions: 5; selected revisions: 2
19114 dotest log-22 "${testcvs} log -r1.1:1.2 file1" \
19118 total revisions: 5; selected revisions: 2
19124 dotest log-22a "${testcvs} log -r1.1::1.2 file1" \
19128 total revisions: 5; selected revisions: 1
19133 dotest log-22b "${testcvs} log -r1.1::1.3 file1" \
19137 total revisions: 5; selected revisions: 2
19143 # Test BASE pseudotag
19144 dotest log-23 "${testcvs} log -rBASE file1" \
19148 total revisions: 5; selected revisions: 1
19153 dotest log-24 "${testcvs} -q up -r1.2 file1" "[UP] file1"
19154 dotest log-25 "${testcvs} log -rBASE file1" \
19158 total revisions: 5; selected revisions: 1
19163 dotest log-26 "${testcvs} -q up -rbranch file1" "[UP] file1"
19165 # Now the same tests but with rlog
19167 dotest log-r11 "${testcvs} rlog first-dir/file1" \
19171 total revisions: 5; selected revisions: 5
19180 dotest log-r12 "${testcvs} rlog -N first-dir/file1" \
19183 total revisions: 5; selected revisions: 5
19192 dotest log-r13 "${testcvs} rlog -b first-dir/file1" \
19196 total revisions: 5; selected revisions: 3
19203 dotest log-r14 "${testcvs} rlog -r first-dir/file1" \
19207 total revisions: 5; selected revisions: 1
19212 dotest log-r14a "${testcvs} rlog -rHEAD first-dir/file1" \
19216 total revisions: 5; selected revisions: 1
19221 dotest_fail log-r14b "${testcvs} rlog -r HEAD first-dir/file1" \
19222 "${PROG} rlog: cannot find module .HEAD. - ignored
19226 total revisions: 5; selected revisions: 1
19231 dotest log-r14c "${testcvs} rlog -r: first-dir/file1" \
19235 total revisions: 5; selected revisions: 1
19239 dotest log-r14d "${testcvs} rlog -r, first-dir/file1" \
19243 total revisions: 5; selected revisions: 1
19247 dotest log-r14e "${testcvs} rlog -r. first-dir/file1" \
19251 total revisions: 5; selected revisions: 1
19255 dotest log-r14f "${testcvs} rlog -r:: first-dir/file1" \
19259 total revisions: 5; selected revisions: 0
19263 dotest log-r15 "${testcvs} rlog -r1.2 first-dir/file1" \
19267 total revisions: 5; selected revisions: 1
19272 dotest log-r16 "${testcvs} rlog -r1.2.2 first-dir/file1" \
19276 total revisions: 5; selected revisions: 2
19282 dotest log-r17 "${testcvs} rlog -rbranch first-dir/file1" \
19286 total revisions: 5; selected revisions: 2
19292 dotest log-r18 "${testcvs} rlog -r1.2.2. first-dir/file1" \
19296 total revisions: 5; selected revisions: 1
19301 dotest log-r18a "${testcvs} rlog -r1.2.2.2 -r1.3:1.3 first-dir/file1" \
19305 total revisions: 5; selected revisions: 2
19311 dotest log-r19 "${testcvs} rlog -rbranch. first-dir/file1" \
19315 total revisions: 5; selected revisions: 1
19320 dotest log-r20 "${testcvs} rlog -r1.2: first-dir/file1" \
19324 total revisions: 5; selected revisions: 2
19330 dotest log-r20a "${testcvs} rlog -r1.2:: first-dir/file1" \
19334 total revisions: 5; selected revisions: 1
19339 dotest log-r21 "${testcvs} rlog -r:1.2 first-dir/file1" \
19343 total revisions: 5; selected revisions: 2
19349 dotest log-r21a "${testcvs} rlog -r::1.2 first-dir/file1" \
19353 total revisions: 5; selected revisions: 2
19359 dotest log-r22 "${testcvs} rlog -r1.1:1.2 first-dir/file1" \
19363 total revisions: 5; selected revisions: 2
19369 dotest log-r22a "${testcvs} rlog -r1.1::1.2 first-dir/file1" \
19373 total revisions: 5; selected revisions: 1
19378 dotest log-r22b "${testcvs} rlog -r1.1::1.3 first-dir/file1" \
19382 total revisions: 5; selected revisions: 2
19388 # Test BASE pseudotag
19389 dotest log-r23 "${testcvs} rlog -rBASE first-dir/file1" \
19390 "${PROG} rlog: warning: no revision .BASE. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
19394 total revisions: 5; selected revisions: 0
19398 dotest log-r24 "${testcvs} -q up -r1.2 file1" "[UP] file1"
19399 dotest log-r25 "${testcvs} rlog -rBASE first-dir/file1" \
19400 "${PROG} rlog: warning: no revision .BASE. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
19404 total revisions: 5; selected revisions: 0
19408 # Test when head is dead
19410 dotest log-d0 "${testcvs} -q up -A" \
19413 dotest log-d1 "${testcvs} -q rm -f file1" \
19414 "${PROG} remove: use .${PROG} commit. to remove this file permanently"
19415 dotest log-d2 "${testcvs} -q ci -m4" \
19417 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19418 new revision: delete; previous revision: 1\.3
19422 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
19423 Working file: file1
19429 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
19435 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
19436 Working file: file2
19442 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
19447 log_tags2='symbolic names:
19450 log_rev4="${log_dash} 1\.4
19451 date: [0-9/]* [0-9:]*; author: ${username}; state: dead; lines: ${PLUS}0 -0
19453 log_rev22="${log_dash} 1\.2
19454 ${log_date}${log_lines}
19457 dotest log-d3 "${testcvs} log -rbranch file1" \
19461 total revisions: 6; selected revisions: 2
19466 dotest log-rd3 "${testcvs} rlog -rbranch first-dir/file1" \
19470 total revisions: 6; selected revisions: 2
19475 dotest log-d4 "${testcvs} -q log -rbranch" \
19479 total revisions: 6; selected revisions: 2
19484 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
19488 total revisions: 3; selected revisions: 0
19491 dotest log-d4a "${testcvs} -q log -t -rbranch" \
19498 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
19505 dotest log-d4b "${testcvs} -q log -tS -rbranch" \
19509 total revisions: 6; selected revisions: 2
19512 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
19513 dotest log-d4c "${testcvs} -q log -h -rbranch" \
19519 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
19525 dotest log-d4d "${testcvs} -q log -hS -rbranch" \
19529 total revisions: 6; selected revisions: 2
19531 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
19532 dotest log-d4e "${testcvs} -q log -R -rbranch" \
19533 "${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
19534 ${CVSROOT_DIRNAME}/first-dir/file2,v"
19535 dotest log-d4f "${testcvs} -q log -R -S -rbranch" \
19536 "${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
19537 ${PROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
19538 dotest log-rd4 "${testcvs} -q rlog -rbranch first-dir" \
19542 total revisions: 6; selected revisions: 2
19547 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
19551 total revisions: 3; selected revisions: 0
19554 dotest log-rd4a "${testcvs} -q rlog -t -rbranch first-dir" \
19561 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
19568 dotest log-rd4b "${testcvs} -q rlog -St -rbranch first-dir" \
19572 total revisions: 6; selected revisions: 2
19575 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
19576 dotest log-rd4c "${testcvs} -q rlog -h -rbranch first-dir" \
19582 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
19588 dotest log-rd4d "${testcvs} -q rlog -Sh -rbranch first-dir" \
19592 total revisions: 6; selected revisions: 2
19594 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
19595 dotest log-rd4e "${testcvs} -q rlog -R -rbranch first-dir" \
19596 "${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
19597 ${CVSROOT_DIRNAME}/first-dir/file2,v"
19598 dotest log-rd4f "${testcvs} -q rlog -R -S -rbranch first-dir" \
19599 "${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
19600 ${PROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
19601 dotest log-d5 "${testcvs} log -r1.2.2.1:1.2.2.2 file1" \
19605 total revisions: 6; selected revisions: 2
19610 dotest log-rd5 "${testcvs} rlog -r1.2.2.1:1.2.2.2 first-dir/file1" \
19614 total revisions: 6; selected revisions: 2
19619 dotest log-d6 "${testcvs} -q log -r1.2.2.1:1.2.2.2" \
19623 total revisions: 6; selected revisions: 2
19631 total revisions: 3; selected revisions: 0
19634 dotest log-rd6 "${testcvs} -q rlog -r1.2.2.1:1.2.2.2 first-dir" \
19638 total revisions: 6; selected revisions: 2
19646 total revisions: 3; selected revisions: 0
19649 dotest log-d7 "${testcvs} log -r1.2:1.3 file1" \
19653 total revisions: 6; selected revisions: 2
19658 dotest log-rd7 "${testcvs} -q rlog -r1.2:1.3 first-dir/file1" \
19662 total revisions: 6; selected revisions: 2
19667 dotest log-d8 "${testcvs} -q log -rtag1:tag2" \
19668 "${PROG} log: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
19669 ${PROG} log: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
19673 total revisions: 6; selected revisions: 0
19679 total revisions: 3; selected revisions: 2
19684 dotest log-d8a "${testcvs} -q log -rtag1:tag2 -S" \
19685 "${PROG} log: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
19686 ${PROG} log: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
19690 total revisions: 3; selected revisions: 2
19695 dotest log-rd8 "${testcvs} -q rlog -rtag1:tag2 first-dir" \
19696 "${PROG} rlog: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
19697 ${PROG} rlog: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
19701 total revisions: 6; selected revisions: 0
19707 total revisions: 3; selected revisions: 2
19712 dotest log-rd8a "${testcvs} -q rlog -rtag1:tag2 -S first-dir" \
19713 "${PROG} rlog: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
19714 ${PROG} rlog: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
19718 total revisions: 3; selected revisions: 2
19724 dotest log-d99 "${testcvs} -q up -rbranch" \
19726 ${PROG} update: file2 is no longer in the repository"
19728 # Now test outdating revisions
19730 dotest log-o0 "${testcvs} admin -o 1.2.2.2:: file1" \
19731 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
19733 dotest log-o1 "${testcvs} admin -o ::1.2.2.1 file1" \
19734 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
19736 dotest log-o2 "${testcvs} admin -o 1.2.2.1:: file1" \
19737 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
19738 deleting revision 1\.2\.2\.2
19740 dotest log-o3 "${testcvs} log file1" \
19744 total revisions: 5; selected revisions: 5
19752 dotest log-ro3 "${testcvs} rlog first-dir/file1" \
19756 total revisions: 5; selected revisions: 5
19764 dotest log-o4 "${testcvs} -q update -p -r 1.2.2.1 file1" \
19765 "first branch revision"
19769 rm -rf ${CVSROOT_DIRNAME}/first-dir
19773 # More "cvs log" tests, for example the file description.
19776 mkdir ${CVSROOT_DIRNAME}/first-dir
19777 dotest log2-1 "${testcvs} -q co first-dir" ''
19779 echo 'first revision' > file1
19780 dotest log2-2 "${testcvs} add -m file1-is-for-testing file1" \
19781 "${PROG}"' add: scheduling file `file1'\'' for addition
19782 '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
19783 dotest log2-3 "${testcvs} -q commit -m 1" \
19784 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19787 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19788 initial revision: 1\.1
19790 # Setting the file description with add -m doesn't yet work
19791 # client/server, so skip log2-4 for remote.
19792 if $remote; then :; else
19794 dotest log2-4 "${testcvs} log -N file1" "
19795 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19796 Working file: file1
19801 keyword substitution: kv
19802 total revisions: 1; selected revisions: 1
19804 file1-is-for-testing
19805 ----------------------------
19807 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
19809 ============================================================================="
19811 fi # end of tests skipped for remote
19813 dotest log2-5 "${testcvs} admin -t-change-description file1" \
19814 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19816 dotest log2-6 "${testcvs} log -N file1" "
19817 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19818 Working file: file1
19823 keyword substitution: kv
19824 total revisions: 1; selected revisions: 1
19827 ----------------------------
19829 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
19831 ============================================================================="
19833 echo 'longer description' >${TESTDIR}/descrip
19834 echo 'with two lines' >>${TESTDIR}/descrip
19835 dotest log2-7 "${testcvs} admin -t${TESTDIR}/descrip file1" \
19836 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19838 dotest_fail log2-7a "${testcvs} admin -t${TESTDIR}/nonexist file1" \
19839 "${PROG} \[[a-z]* aborted\]: can't stat ${TESTDIR}/nonexist: No such file or directory"
19840 dotest log2-8 "${testcvs} log -N file1" "
19841 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19842 Working file: file1
19847 keyword substitution: kv
19848 total revisions: 1; selected revisions: 1
19852 ----------------------------
19854 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
19856 ============================================================================="
19858 # TODO: `cvs admin -t "my message" file1' is a request to
19859 # read the message from stdin and to operate on two files.
19860 # Should test that there is an error because "my message"
19863 dotest log2-9 "echo change from stdin | ${testcvs} admin -t -q file1" ""
19864 dotest log2-10 "${testcvs} log -N file1" "
19865 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19866 Working file: file1
19871 keyword substitution: kv
19872 total revisions: 1; selected revisions: 1
19875 ----------------------------
19877 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
19879 ============================================================================="
19882 rm ${TESTDIR}/descrip
19884 rm -rf ${CVSROOT_DIRNAME}/first-dir
19889 # Some tests of log.c's option parsing and such things.
19891 dotest logopt-1 "${testcvs} -q co -l ." ''
19893 dotest logopt-2 "${testcvs} add first-dir" \
19894 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
19897 dotest logopt-3 "${testcvs} add file1" \
19898 "${PROG} add: scheduling file .file1. for addition
19899 ${PROG} add: use .${PROG} commit. to add this file permanently"
19900 dotest logopt-4 "${testcvs} -q ci -m add file1" \
19901 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19904 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19905 initial revision: 1\.1
19909 dotest logopt-5 "${testcvs} log -R -d 2038-01-01" \
19910 "${PROG} log: Logging \.
19911 ${PROG} log: Logging first-dir
19912 ${CVSROOT_DIRNAME}/first-dir/file1,v"
19913 dotest logopt-6 "${testcvs} log -d 2038-01-01 -R" \
19914 "${PROG} log: Logging \.
19915 ${PROG} log: Logging first-dir
19916 ${CVSROOT_DIRNAME}/first-dir/file1,v"
19917 dotest logopt-6a "${testcvs} log -Rd 2038-01-01" \
19918 "${PROG} log: Logging \.
19919 ${PROG} log: Logging first-dir
19920 ${CVSROOT_DIRNAME}/first-dir/file1,v"
19921 dotest logopt-7 "${testcvs} log -s Exp -R" \
19922 "${PROG} log: Logging \.
19923 ${PROG} log: Logging first-dir
19924 ${CVSROOT_DIRNAME}/first-dir/file1,v"
19928 rm -rf ${CVSROOT_DIRNAME}/first-dir
19932 # Tests of "cvs annotate". See also:
19933 # basica-10 A simple annotate test
19934 # rcs Annotate and the year 2000
19935 # keywordlog Annotate and $Log.
19937 dotest ann-1 "${testcvs} -q co -l ." ''
19939 dotest ann-2 "${testcvs} add first-dir" \
19940 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
19949 dotest ann-3 "${testcvs} add file1" \
19950 "${PROG} add: scheduling file .file1. for addition
19951 ${PROG} add: use .${PROG} commit. to add this file permanently"
19952 dotest ann-4 "${testcvs} -q ci -m add file1" \
19953 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
19956 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19957 initial revision: 1\.1
19970 dotest ann-5 "${testcvs} -q ci -m modify file1" \
19971 "Checking in file1;
19972 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19973 new revision: 1\.2; previous revision: 1\.1
19975 dotest ann-6 "${testcvs} -q tag -b br" "T file1"
19987 dotest ann-7 "${testcvs} -q ci -m modify file1" \
19988 "Checking in file1;
19989 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
19990 new revision: 1\.3; previous revision: 1\.2
19992 dotest ann-8 "${testcvs} -q update -r br" "[UP] file1"
20006 dotest ann-9 "${testcvs} -q ci -m modify" \
20007 "Checking in file1;
20008 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
20009 new revision: 1\.2\.2\.1; previous revision: 1\.2
20011 # Note that this annotates the trunk despite the presence
20012 # of a sticky tag in the current directory. This is
20013 # fairly bogus, but it is the longstanding behavior for
20014 # whatever that is worth.
20015 dotest ann-10 "${testcvs} ann" \
20017 Annotations for file1
20018 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
20019 1\.1 ($username8 *[0-9a-zA-Z-]*): this
20020 1\.1 ($username8 *[0-9a-zA-Z-]*): is
20021 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20022 1\.3 ($username8 *[0-9a-zA-Z-]*): trunk file
20023 1\.2 ($username8 *[0-9a-zA-Z-]*):
20024 1\.2 ($username8 *[0-9a-zA-Z-]*): with
20025 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20026 1\.2 ($username8 *[0-9a-zA-Z-]*): blank
20027 1\.2 ($username8 *[0-9a-zA-Z-]*): line"
20028 dotest ann-10blame "${testcvs} blame" \
20030 Annotations for file1
20031 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
20032 1\.1 ($username8 *[0-9a-zA-Z-]*): this
20033 1\.1 ($username8 *[0-9a-zA-Z-]*): is
20034 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20035 1\.3 ($username8 *[0-9a-zA-Z-]*): trunk file
20036 1\.2 ($username8 *[0-9a-zA-Z-]*):
20037 1\.2 ($username8 *[0-9a-zA-Z-]*): with
20038 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20039 1\.2 ($username8 *[0-9a-zA-Z-]*): blank
20040 1\.2 ($username8 *[0-9a-zA-Z-]*): line"
20041 dotest ann-11 "${testcvs} ann -r br" \
20043 Annotations for file1
20044 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
20045 1\.1 ($username8 *[0-9a-zA-Z-]*): this
20046 1\.1 ($username8 *[0-9a-zA-Z-]*): is
20047 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20048 1\.1 ($username8 *[0-9a-zA-Z-]*): file
20049 1\.2 ($username8 *[0-9a-zA-Z-]*):
20050 1\.2 ($username8 *[0-9a-zA-Z-]*): with
20051 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20052 1\.2 ($username8 *[0-9a-zA-Z-]*): blank
20053 1\.2 ($username8 *[0-9a-zA-Z-]*): line
20054 1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): and some
20055 1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): branched content"
20056 # FIXCVS: shouldn't "-r 1.2.0.2" be the same as "-r br"?
20057 dotest ann-12 "${testcvs} ann -r 1.2.0.2 file1" ""
20058 dotest ann-13 "${testcvs} ann -r 1.2.2 file1" \
20060 Annotations for file1
20061 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
20062 1\.1 ($username8 *[0-9a-zA-Z-]*): this
20063 1\.1 ($username8 *[0-9a-zA-Z-]*): is
20064 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20065 1\.1 ($username8 *[0-9a-zA-Z-]*): file
20066 1\.2 ($username8 *[0-9a-zA-Z-]*):
20067 1\.2 ($username8 *[0-9a-zA-Z-]*): with
20068 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20069 1\.2 ($username8 *[0-9a-zA-Z-]*): blank
20070 1\.2 ($username8 *[0-9a-zA-Z-]*): line
20071 1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): and some
20072 1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): branched content"
20073 dotest_fail ann-14 "${testcvs} ann -r bill-clintons-chastity file1" \
20074 "${PROG} \[annotate aborted\]: no such tag bill-clintons-chastity"
20076 # Now get rid of the working directory and test rannotate
20080 dotest ann-r10 "${testcvs} rann first-dir" \
20082 Annotations for first-dir/file1
20083 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
20084 1\.1 ($username8 *[0-9a-zA-Z-]*): this
20085 1\.1 ($username8 *[0-9a-zA-Z-]*): is
20086 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20087 1\.3 ($username8 *[0-9a-zA-Z-]*): trunk file
20088 1\.2 ($username8 *[0-9a-zA-Z-]*):
20089 1\.2 ($username8 *[0-9a-zA-Z-]*): with
20090 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20091 1\.2 ($username8 *[0-9a-zA-Z-]*): blank
20092 1\.2 ($username8 *[0-9a-zA-Z-]*): line"
20093 dotest ann-r11 "${testcvs} rann -r br first-dir" \
20095 Annotations for first-dir/file1
20096 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
20097 1\.1 ($username8 *[0-9a-zA-Z-]*): this
20098 1\.1 ($username8 *[0-9a-zA-Z-]*): is
20099 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20100 1\.1 ($username8 *[0-9a-zA-Z-]*): file
20101 1\.2 ($username8 *[0-9a-zA-Z-]*):
20102 1\.2 ($username8 *[0-9a-zA-Z-]*): with
20103 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20104 1\.2 ($username8 *[0-9a-zA-Z-]*): blank
20105 1\.2 ($username8 *[0-9a-zA-Z-]*): line
20106 1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): and some
20107 1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): branched content"
20108 dotest ann-r12 "${testcvs} rann -r 1.2.0.2 first-dir/file1" ""
20109 dotest ann-r13 "${testcvs} rann -r 1.2.2 first-dir/file1" \
20111 Annotations for first-dir/file1
20112 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
20113 1\.1 ($username8 *[0-9a-zA-Z-]*): this
20114 1\.1 ($username8 *[0-9a-zA-Z-]*): is
20115 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20116 1\.1 ($username8 *[0-9a-zA-Z-]*): file
20117 1\.2 ($username8 *[0-9a-zA-Z-]*):
20118 1\.2 ($username8 *[0-9a-zA-Z-]*): with
20119 1\.2 ($username8 *[0-9a-zA-Z-]*): a
20120 1\.2 ($username8 *[0-9a-zA-Z-]*): blank
20121 1\.2 ($username8 *[0-9a-zA-Z-]*): line
20122 1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): and some
20123 1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): branched content"
20124 dotest_fail ann-r14 "${testcvs} rann -r bill-clintons-chastity first-dir/file1" \
20125 "${PROG} \[rannotate aborted\]: no such tag bill-clintons-chastity"
20127 rm -rf ${CVSROOT_DIRNAME}/first-dir
20131 # Demonstrate that cvs-1.9.28.1 improperly expands rcs keywords in
20132 # the output of `cvs annotate' -- it uses values from the previous
20133 # delta. In this case, `1.1' instead of `1.2', even though it puts
20134 # the proper version number on the prefix to each line of output.
20136 dotest ann-id-1 "${testcvs} -q co -l ." ''
20139 dotest ann-id-2 "${testcvs} add $module" \
20140 "Directory ${CVSROOT_DIRNAME}/$module added to the repository"
20144 echo '$Id''$' > $file
20146 dotest ann-id-3 "$testcvs add $file" \
20147 "${PROG} add: scheduling file .$file. for addition
20148 ${PROG} add: use .${PROG} commit. to add this file permanently"
20149 dotest ann-id-4 "$testcvs -Q ci -m . $file" \
20150 "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
20153 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
20154 initial revision: 1\.1
20157 echo line2 >> $file
20158 dotest ann-id-5 "$testcvs -Q ci -m . $file" \
20159 "Checking in $file;
20160 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
20161 new revision: 1\.2; previous revision: 1\.1
20164 # The version number after $file,v should be `1.2'.
20165 # 1.9.28.1 puts `1.1' there.
20166 dotest ann-id-6 "$testcvs -Q ann $file" \
20168 Annotations for $file
20169 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
20170 1.2 ($username8 *[0-9a-zA-Z-]*): "'\$'"Id: $file,v 1.1 [0-9/]* [0-9:]* $username Exp "'\$'"
20171 1.2 ($username8 *[0-9a-zA-Z-]*): line2"
20175 rm -rf ${CVSROOT_DIRNAME}/$module
20179 # Various tests relating to creating repositories, operating
20180 # on repositories created with old versions of CVS, etc.
20182 CVS_SERVER_save=$CVS_SERVER
20184 # Because this test is all about -d options and such, it
20185 # at least to some extent needs to be different for remote vs.
20189 # Use :ext: rather than :fork:. Most of the tests use :fork:,
20190 # so we want to make sure that we test :ext: _somewhere_.
20191 # Make sure 'rsh' works first.
20192 depends_on_rsh "$CVS_RSH"
20193 if test $? -eq 77; then
20194 skip crerepos "$skipreason"
20198 # For remote, just create the repository. We don't yet do
20199 # the various other tests above for remote but that should be
20202 mkdir crerepos/CVSROOT
20204 # Make sure server ignores real ${HOME}/.cvsrc:
20205 cat >$TESTDIR/cvs-setHome <<EOF
20209 exec $CVS_SERVER_save "\$@"
20211 chmod a+x $TESTDIR/cvs-setHome
20213 # Note that we set CVS_SERVER at the beginning.
20214 CVS_SERVER=$TESTDIR/cvs-setHome; export CVS_SERVER
20215 CREREPOS_ROOT=:ext:$host$TESTDIR/crerepos
20218 # First, if the repository doesn't exist at all...
20219 dotest_fail crerepos-1 \
20220 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
20221 "${PROG} \[checkout aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
20224 # The repository exists but CVSROOT doesn't.
20225 dotest_fail crerepos-2 \
20226 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
20227 "${PROG} \[checkout aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
20228 mkdir crerepos/CVSROOT
20230 # Checkout of nonexistent module
20231 dotest_fail crerepos-3 \
20232 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
20233 "${PROG} checkout: cannot find module .cvs-sanity. - ignored"
20235 # Now test that CVS works correctly without a modules file
20236 # or any of that other stuff. In particular, it *must*
20237 # function if administrative files added to CVS recently (since
20238 # CVS 1.3) do not exist, because the repository might have
20239 # been created with an old version of CVS.
20241 dotest crerepos-4 \
20242 "${testcvs} -q -d ${TESTDIR}/crerepos co CVSROOT" \
20245 ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
20252 # The directory 1 should be empty
20253 dotest crerepos-6 "rmdir 1"
20255 CREREPOS_ROOT=${TESTDIR}/crerepos
20260 # Test that CVS rejects a relative path in CVSROOT.
20262 # Note that having the client reject the pathname (as :fork:
20263 # does), does _not_ test for the bugs we are trying to catch
20264 # here. The point is that malicious clients might send all
20265 # manner of things and the server better protect itself.
20266 dotest_fail crerepos-6a-r \
20267 "${testcvs} -q -d :ext:`hostname`:../crerepos get ." \
20268 "${PROG} [a-z]*: CVSROOT may only specify a positive, non-zero, integer port (not .\.\..)\.
20269 ${PROG} [a-z]*: Perhaps you entered a relative pathname${QUESTION}
20270 ${PROG} \[[a-z]* aborted\]: Bad CVSROOT: .:ext:${hostname}:\.\./crerepos.\."
20274 # Test that CVS rejects a relative path in CVSROOT.
20277 # Set CVS_RSH=false since ocassionally (e.g. when CVS_RSH=ssh on
20278 # some systems) some rsh implementations will block because they
20279 # can look up '..' and want to ask the user about the unknown host
20280 # key or somesuch. Which error message we get depends on whether
20281 # false finishes running before we try to talk to it or not.
20282 dotest_fail crerepos-6a "CVS_RSH=false ${testcvs} -q -d ../crerepos get ." \
20283 "${PROG} \[checkout aborted\]: .*" \
20284 "${PROG} checkout: CVSROOT is set for a remote access method but your
20285 ${PROG} checkout: CVS executable doesn't support it\.
20286 ${PROG} \[checkout aborted\]: Bad CVSROOT: .\.\./crerepos.\."
20291 dotest_fail crerepos-6b "${testcvs} -d crerepos init" \
20292 "${PROG} init: CVSROOT must be an absolute pathname (not .crerepos.)
20293 ${PROG} init: when using local access method\.
20294 ${PROG} \[init aborted\]: Bad CVSROOT: .crerepos.\."
20297 fi # end of tests to be skipped for remote
20299 # CVS better not create a history file--if the administrator
20300 # doesn't need it and wants to save on disk space, they just
20302 dotest_fail crerepos-7 \
20303 "test -f ${TESTDIR}/crerepos/CVSROOT/history" ''
20305 # Now test mixing repositories. This kind of thing tends to
20306 # happen accidentally when people work with several repositories.
20308 dotest crerepos-8 "${testcvs} -q co -l ." ''
20310 dotest crerepos-9 "${testcvs} add first-dir" \
20311 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20314 dotest crerepos-10 "${testcvs} add file1" \
20315 "${PROG} add: scheduling file .file1. for addition
20316 ${PROG} add: use .${PROG} commit. to add this file permanently"
20317 dotest crerepos-11 "${testcvs} -q ci -m add-it" \
20318 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20321 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
20322 initial revision: 1\.1
20328 dotest crerepos-12 "${testcvs} -d ${CREREPOS_ROOT} -q co -l ." ''
20330 dotest crerepos-13 "${testcvs} add crerepos-dir" \
20331 "Directory ${TESTDIR}/crerepos/crerepos-dir added to the repository"
20334 dotest crerepos-14 "${testcvs} add cfile" \
20335 "${PROG} add: scheduling file .cfile. for addition
20336 ${PROG} add: use .${PROG} commit. to add this file permanently"
20337 dotest crerepos-15 "${testcvs} -q ci -m add-it" \
20338 "RCS file: ${TESTDIR}/crerepos/crerepos-dir/cfile,v
20341 ${TESTDIR}/crerepos/crerepos-dir/cfile,v <-- cfile
20342 initial revision: 1\.1
20348 dotest crerepos-16 "${testcvs} co first-dir" \
20349 "${PROG} checkout: Updating first-dir
20351 dotest crerepos-17 "${testcvs} -d ${CREREPOS_ROOT} co crerepos-dir" \
20352 "${PROG} checkout: Updating crerepos-dir
20353 U crerepos-dir/cfile"
20354 dotest crerepos-18 "${testcvs} update" \
20355 "${PROG} update: Updating first-dir
20356 ${PROG} update: Updating crerepos-dir"
20360 CVS_SERVER=$CVS_SERVER_save; export CVS_SERVER
20363 echo Keeping ${TESTDIR} and exiting due to --keep
20367 rm -f $TESTDIR/cvs-setHome
20369 rm -rf ${CVSROOT_DIRNAME}/first-dir ${TESTDIR}/crerepos
20375 # Various tests relating to creating repositories, operating
20376 # on repositories created with old versions of CVS, etc.
20378 CVS_SERVER_save=$CVS_SERVER
20380 # Because this test is all about -d options and such, it
20381 # at least to some extent needs to be different for remote vs.
20385 # Use :extssh: rather than :fork:. Most of the tests use :fork:,
20386 # so we want to make sure that we test :extssh: _somewhere_.
20387 # Make sure 'ssh' works first.
20388 depends_on_rsh "$CVS_RSH"
20389 if test $? -eq 77; then
20390 skip crerepos "$skipreason"
20394 # For remote, just create the repository. We don't yet do
20395 # the various other tests above for remote but that should be
20398 mkdir crerepos/CVSROOT
20400 # Make sure server ignores real ${HOME}/.cvsrc:
20401 cat >$TESTDIR/cvs-setHome <<EOF
20405 exec $CVS_SERVER_save "\$@"
20407 chmod a+x $TESTDIR/cvs-setHome
20409 # Note that we set CVS_SERVER at the beginning.
20410 CVS_SERVER=$TESTDIR/cvs-setHome; export CVS_SERVER
20411 CREREPOS_ROOT=:extssh:$host$TESTDIR/crerepos
20414 # First, if the repository doesn't exist at all...
20415 dotest_fail crerepos-extssh-1 \
20416 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
20417 "${PROG} \[checkout aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
20420 # The repository exists but CVSROOT doesn't.
20421 dotest_fail crerepos-extssh-2 \
20422 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
20423 "${PROG} \[checkout aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
20424 mkdir crerepos/CVSROOT
20426 # Checkout of nonexistent module
20427 dotest_fail crerepos-extssh-3 \
20428 "${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
20429 "${PROG} checkout: cannot find module .cvs-sanity. - ignored"
20431 # Now test that CVS works correctly without a modules file
20432 # or any of that other stuff. In particular, it *must*
20433 # function if administrative files added to CVS recently (since
20434 # CVS 1.3) do not exist, because the repository might have
20435 # been created with an old version of CVS.
20437 dotest crerepos-extssh-4 \
20438 "${testcvs} -q -d ${TESTDIR}/crerepos co CVSROOT" \
20441 ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
20442 pass crerepos-extssh-5
20444 fail crerepos-extssh-5
20448 # The directory 1 should be empty
20449 dotest crerepos-extssh-6 "rmdir 1"
20451 CREREPOS_ROOT=${TESTDIR}/crerepos
20456 # Test that CVS rejects a relative path in CVSROOT.
20458 # Note that having the client reject the pathname (as :fork:
20459 # does), does _not_ test for the bugs we are trying to catch
20460 # here. The point is that malicious clients might send all
20461 # manner of things and the server better protect itself.
20462 dotest_fail crerepos-extssh-6a-r \
20463 "${testcvs} -q -d :extssh:`hostname`:../crerepos get ." \
20464 "${PROG} [a-z]*: CVSROOT may only specify a positive, non-zero, integer port (not .\.\..)\.
20465 ${PROG} [a-z]*: Perhaps you entered a relative pathname${QUESTION}
20466 ${PROG} \[[a-z]* aborted\]: Bad CVSROOT: .:extssh:${hostname}:\.\./crerepos.\."
20470 # Test that CVS rejects a relative path in CVSROOT.
20473 # Set CVS_RSH=false since ocassionally (e.g. when CVS_RSH=ssh on
20474 # some systems) some rsh implementations will block because they
20475 # can look up '..' and want to ask the user about the unknown host
20476 # key or somesuch. Which error message we get depends on whether
20477 # false finishes running before we try to talk to it or not.
20478 dotest_fail crerepos-extssh-6a "CVS_RSH=false ${testcvs} -q -d ../crerepos get ." \
20479 "${PROG} \[checkout aborted\]: .*" \
20480 "${PROG} checkout: CVSROOT is set for a remote access method but your
20481 ${PROG} checkout: CVS executable doesn't support it\.
20482 ${PROG} \[checkout aborted\]: Bad CVSROOT: .\.\./crerepos.\."
20487 dotest_fail crerepos-extssh-6b "${testcvs} -d crerepos init" \
20488 "${PROG} init: CVSROOT must be an absolute pathname (not .crerepos.)
20489 ${PROG} init: when using local access method\.
20490 ${PROG} \[init aborted\]: Bad CVSROOT: .crerepos.\."
20493 fi # end of tests to be skipped for remote
20495 # CVS better not create a history file--if the administrator
20496 # doesn't need it and wants to save on disk space, they just
20498 dotest_fail crerepos-extssh-7 \
20499 "test -f ${TESTDIR}/crerepos/CVSROOT/history" ''
20501 # Now test mixing repositories. This kind of thing tends to
20502 # happen accidentally when people work with several repositories.
20504 dotest crerepos-extssh-8 "${testcvs} -q co -l ." ''
20506 dotest crerepos-extssh-9 "${testcvs} add first-dir" \
20507 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
20510 dotest crerepos-extssh-10 "${testcvs} add file1" \
20511 "${PROG} add: scheduling file .file1. for addition
20512 ${PROG} add: use .${PROG} commit. to add this file permanently"
20513 dotest crerepos-extssh-11 "${testcvs} -q ci -m add-it" \
20514 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20517 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
20518 initial revision: 1\.1
20524 dotest crerepos-extssh-12 "${testcvs} -d ${CREREPOS_ROOT} -q co -l ." ''
20526 dotest crerepos-extssh-13 "${testcvs} add crerepos-dir" \
20527 "Directory ${TESTDIR}/crerepos/crerepos-dir added to the repository"
20530 dotest crerepos-extssh-14 "${testcvs} add cfile" \
20531 "${PROG} add: scheduling file .cfile. for addition
20532 ${PROG} add: use .${PROG} commit. to add this file permanently"
20533 dotest crerepos-extssh-15 "${testcvs} -q ci -m add-it" \
20534 "RCS file: ${TESTDIR}/crerepos/crerepos-dir/cfile,v
20537 ${TESTDIR}/crerepos/crerepos-dir/cfile,v <-- cfile
20538 initial revision: 1\.1
20544 dotest crerepos-extssh-16 "${testcvs} co first-dir" \
20545 "${PROG} checkout: Updating first-dir
20547 dotest crerepos-extssh-17 "${testcvs} -d ${CREREPOS_ROOT} co crerepos-dir" \
20548 "${PROG} checkout: Updating crerepos-dir
20549 U crerepos-dir/cfile"
20550 dotest crerepos-extssh-18 "${testcvs} update" \
20551 "${PROG} update: Updating first-dir
20552 ${PROG} update: Updating crerepos-dir"
20556 CVS_SERVER=$CVS_SERVER_save; export CVS_SERVER
20559 echo Keeping ${TESTDIR} and exiting due to --keep
20563 rm -f $TESTDIR/cvs-setHome
20565 rm -rf ${CVSROOT_DIRNAME}/first-dir ${TESTDIR}/crerepos
20571 # Test ability to import an RCS file. Note that this format
20572 # is fixed--files written by RCS5, and other software which
20573 # implements this format, will be out there "forever" and
20574 # CVS must always be able to import such files.
20576 # See tests admin-13, admin-25 and rcs-8a for exporting RCS files.
20578 mkdir ${CVSROOT_DIRNAME}/first-dir
20580 # Currently the way to import an RCS file is to copy it
20581 # directly into the repository.
20583 # This file was written by RCS 5.7, and then the dates were
20584 # hacked so that we test year 2000 stuff. Note also that
20585 # "author" names are just strings, as far as importing
20586 # RCS files is concerned--they need not correspond to user
20587 # IDs on any particular system.
20589 # I also tried writing a file with the RCS supplied with
20590 # HPUX A.09.05. According to "man rcsintro" this is
20591 # "Revision Number: 3.0; Release Date: 83/05/11". There
20592 # were a few minor differences like whitespace but at least
20593 # in simple cases like this everything else seemed the same
20594 # as the file written by RCS 5.7 (so I won't try to make it
20595 # a separate test case).
20597 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
20606 date 2000.11.24.15.58.37; author kingdon; state Exp;
20611 date 96.11.24.15.57.41; author kingdon; state Exp;
20616 date 96.11.24.15.56.05; author kingdon; state Exp;
20622 @file1 is for testing CVS
20628 @delete second line; modify twelfth line
20631 @This is the first line
20632 This is the third line
20633 This is the fourth line
20634 This is the fifth line
20635 This is the sixth line
20636 This is the seventh line
20637 This is the eighth line
20638 This is the ninth line
20639 This is the tenth line
20640 This is the eleventh line
20641 This is the twelfth line (and what a line it is)
20642 This is the thirteenth line
20652 This is the second line
20655 This is the twelfth line
20667 dotest rcs-1 "${testcvs} -q co first-dir" 'U first-dir/file1'
20669 dotest rcs-2 "${testcvs} -q log" "
20670 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20671 Working file: file1
20677 keyword substitution: kv
20678 total revisions: 3; selected revisions: 3
20680 file1 is for testing CVS
20681 ----------------------------
20683 date: 2000/11/24 15:58:37; author: kingdon; state: Exp; lines: ${PLUS}1 -2
20684 delete second line; modify twelfth line
20685 ----------------------------
20687 date: 1996/11/24 15:57:41; author: kingdon; state: Exp; lines: ${PLUS}12 -0
20689 ----------------------------
20691 date: 1996/11/24 15:56:05; author: kingdon; state: Exp;
20693 ============================================================================="
20695 # Note that the dates here are chosen so that (a) we test
20696 # at least one date after 2000, (b) we will notice if the
20697 # month and day are getting mixed up with each other.
20698 # TODO: also test that year isn't getting mixed up with month
20699 # or day, for example 01-02-03.
20701 # ISO8601 format. There are many, many, other variations
20702 # specified by ISO8601 which we should be testing too.
20703 dotest rcs-3 "${testcvs} -q log -d '1996-12-11<'" "
20704 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20705 Working file: file1
20711 keyword substitution: kv
20712 total revisions: 3; selected revisions: 1
20714 file1 is for testing CVS
20715 ----------------------------
20717 date: 2000/11/24 15:58:37; author: kingdon; state: Exp; lines: ${PLUS}1 -2
20718 delete second line; modify twelfth line
20719 ============================================================================="
20721 # RFC822 format (as amended by RFC1123).
20722 dotest rcs-4 "${testcvs} -q log -d '<3 Apr 2000 00:00'" \
20724 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20725 Working file: file1
20731 keyword substitution: kv
20732 total revisions: 3; selected revisions: 2
20734 file1 is for testing CVS
20735 ----------------------------
20737 date: 1996/11/24 15:57:41; author: kingdon; state: Exp; lines: ${PLUS}12 -0
20739 ----------------------------
20741 date: 1996/11/24 15:56:05; author: kingdon; state: Exp;
20743 ============================================================================="
20745 # Intended behavior for "cvs annotate" is that it displays the
20746 # last two digits of the year. Make sure it does that rather
20747 # than some bogosity like "100".
20748 dotest rcs-4a "${testcvs} annotate file1" \
20750 Annotations for file1
20751 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
20752 1\.1 (kingdon 24-Nov-96): This is the first line
20753 1\.2 (kingdon 24-Nov-96): This is the third line
20754 1\.2 (kingdon 24-Nov-96): This is the fourth line
20755 1\.2 (kingdon 24-Nov-96): This is the fifth line
20756 1\.2 (kingdon 24-Nov-96): This is the sixth line
20757 1\.2 (kingdon 24-Nov-96): This is the seventh line
20758 1\.2 (kingdon 24-Nov-96): This is the eighth line
20759 1\.2 (kingdon 24-Nov-96): This is the ninth line
20760 1\.2 (kingdon 24-Nov-96): This is the tenth line
20761 1\.2 (kingdon 24-Nov-96): This is the eleventh line
20762 1\.3 (kingdon 24-Nov-00): This is the twelfth line (and what a line it is)
20763 1\.2 (kingdon 24-Nov-96): This is the thirteenth line"
20765 # Probably should split this test into two at this point (file1
20766 # above this line and file2 below), as the two share little
20769 # OK, here is another one. This one was written by hand based on
20770 # doc/RCSFILES and friends. One subtle point is that none of
20771 # the lines end with newlines; that is a feature which we
20772 # should be testing.
20773 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file2,v
20777 symbols branch:1.2.6;
20779 testofanewphrase @without newphrase we'd have trouble extending @@ all@ ;
20780 1.5 date 71.01.01.01.00.00; author joe; state bogus; branches; next 1.4;
20781 1.4 date 71.01.01.00.00.05; author joe; state bogus; branches; next 1.3;
20782 1.3 date 70.12.31.15.00.05; author joe; state bogus; branches; next 1.2;
20783 1.2 date 70.12.31.12.15.05; author me; state bogus; branches 1.2.6.1; next 1.1;
20784 1.1 date 70.12.31.11.00.05; author joe; state bogus; branches; next; newph;
20785 1.2.6.1 date 71.01.01.08.00.05; author joe; state Exp; branches; next;
20787 1.5 log @@ newphrase1; newphrase2 42; text @head revision@
20788 1.4 log @@ text @d1 1
20791 1.3 log @@ text @d1 1
20794 1.2 log @@ text @d1 1
20801 1.2.6.1 log @@ text @d1 1
20805 # ' Match the single quote in above here doc -- for font-lock mode.
20807 # First test the default branch.
20808 dotest rcs-5 "${testcvs} -q update file2" "U file2"
20809 dotest rcs-6 "cat file2" "branch revision"
20811 # Check in a revision on the branch to force CVS to
20812 # interpret every revision in the file.
20813 dotest rcs-6a "$testcvs -q update -r branch file2" 'U file2'
20814 echo "next branch revision" > file2
20815 dotest rcs-6b "${testcvs} -q ci -m mod file2" \
20816 "Checking in file2;
20817 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
20818 new revision: 1\.2\.6\.2; previous revision: 1\.2\.6\.1
20821 # Now get rid of the default branch, it will get in the way.
20822 dotest rcs-7 "${testcvs} admin -b file2" \
20823 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
20825 # But we do want to make sure that "cvs admin" leaves the newphrases
20827 # The extra whitespace regexps are for the RCS library, which does
20828 # not preserve whitespace in the dogmatic manner of RCS 5.7. -twp
20830 "grep testofanewphrase ${CVSROOT_DIRNAME}/first-dir/file2,v" \
20831 "testofanewphrase[ ][ ]*@without newphrase we'd have trouble extending @@ all@[ ]*;"
20832 # The easiest way to test for newphrases in deltas and deltatexts
20833 # is to just look at the whole file, I guess.
20834 dotest rcs-8a "cat ${CVSROOT_DIRNAME}/first-dir/file2,v" \
20841 testofanewphrase @without newphrase we'd have trouble extending @@ all@;
20844 date 71\.01\.01\.01\.00\.00; author joe; state bogus;
20849 date 71\.01\.01\.00\.00\.05; author joe; state bogus;
20854 date 70\.12\.31\.15\.00\.05; author joe; state bogus;
20859 date 70\.12\.31\.12\.15\.05; author me; state bogus;
20865 date 70\.12\.31\.11\.00\.05; author joe; state bogus;
20871 date 71\.01\.01\.08\.00\.05; author joe; state Exp;
20876 date [0-9.]*; author ${username}; state Exp;
20946 next branch revision
20949 dotest rcs-9 "${testcvs} -q update -p -D '1970-12-31 11:30 UT' file2" \
20952 dotest rcs-10 "${testcvs} -q update -p -D '1970-12-31 12:30 UT' file2" \
20955 dotest rcs-11 "${testcvs} -q update -p -D '1971-01-01 00:30 UT' file2" \
20956 "new year revision"
20958 # Same test as rcs-10, but with am/pm.
20959 dotest rcs-12 "${testcvs} -q update -p -D 'December 31, 1970 12:30pm UT' file2" \
20962 # Same test as rcs-11, but with am/pm.
20963 dotest rcs-13 "${testcvs} -q update -p -D 'January 1, 1971 12:30am UT' file2" \
20964 "new year revision"
20966 # OK, now make sure cvs log doesn't have any trouble with the
20967 # newphrases and such.
20968 dotest rcs-14 "${testcvs} -q log file2" "
20969 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
20970 Working file: file2
20977 keyword substitution: kv
20978 total revisions: 7; selected revisions: 7
20980 ----------------------------
20982 date: 1971/01/01 01:00:00; author: joe; state: bogus; lines: ${PLUS}1 -1
20983 \*\*\* empty log message \*\*\*
20984 ----------------------------
20986 date: 1971/01/01 00:00:05; author: joe; state: bogus; lines: ${PLUS}1 -1
20987 \*\*\* empty log message \*\*\*
20988 ----------------------------
20990 date: 1970/12/31 15:00:05; author: joe; state: bogus; lines: ${PLUS}1 -1
20991 \*\*\* empty log message \*\*\*
20992 ----------------------------
20994 date: 1970/12/31 12:15:05; author: me; state: bogus; lines: ${PLUS}1 -1
20996 \*\*\* empty log message \*\*\*
20997 ----------------------------
20999 date: 1970/12/31 11:00:05; author: joe; state: bogus;
21000 \*\*\* empty log message \*\*\*
21001 ----------------------------
21002 revision 1\.2\.6\.2
21003 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
21005 ----------------------------
21006 revision 1\.2\.6\.1
21007 date: 1971/01/01 08:00:05; author: joe; state: Exp; lines: ${PLUS}1 -1
21008 \*\*\* empty log message \*\*\*
21009 ============================================================================="
21010 # Now test each date format for "cvs log -d".
21011 # Earlier than 1971-01-01
21012 dotest rcs-15 "${testcvs} -q log -d '<1971-01-01 00:00 GMT' file2 \
21014 "total revisions: 7; selected revisions: 3
21018 # Later than 1971-01-01
21019 dotest rcs-16 "${testcvs} -q log -d '1971-01-01 00:00 GMT<' file2 \
21021 "total revisions: 7; selected revisions: 4
21024 revision 1\.2\.6\.2
21025 revision 1\.2\.6\.1"
21026 # Alternate syntaxes for later and earlier; multiple -d options
21027 dotest rcs-17 "${testcvs} -q log -d '>1971-01-01 00:00 GMT' \
21028 -d '1970-12-31 12:15 GMT>' file2 | grep revision" \
21029 "total revisions: 7; selected revisions: 5
21033 revision 1\.2\.6\.2
21034 revision 1\.2\.6\.1"
21035 # Range, and single date
21036 dotest rcs-18 "${testcvs} -q log -d '1970-12-31 11:30 GMT' \
21037 -d '1971-01-01 00:00:05 GMT<1971-01-01 01:00:01 GMT' \
21038 file2 | grep revision" \
21039 "total revisions: 7; selected revisions: 2
21042 # Alternate range syntax; equality
21043 dotest rcs-19 "${testcvs} -q log \
21044 -d '1971-01-01 01:00:01 GMT>=1971-01-01 00:00:05 GMT' \
21045 file2 | grep revision" \
21046 "total revisions: 7; selected revisions: 2
21053 rm -rf ${CVSROOT_DIRNAME}/first-dir
21057 # More date tests. Might as well do this as a separate
21058 # test from "rcs", so that we don't need to perturb the
21059 # "written by RCS 5.7" RCS file.
21060 mkdir ${CVSROOT_DIRNAME}/first-dir
21061 # Significance of various dates:
21062 # * At least one Y2K standard refers to recognizing 9 Sep 1999
21063 # (as an example of a pre-2000 date, I guess).
21064 # * At least one Y2K standard refers to recognizing 1 Jan 2001
21065 # (as an example of a post-2000 date, I guess).
21066 # * Many Y2K standards refer to 2000 being a leap year.
21067 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
21068 head 1.7; access; symbols; locks; strict;
21069 1.7 date 2004.08.31.01.01.01; author sue; state; branches; next 1.6;
21070 1.6 date 2004.02.29.01.01.01; author sue; state; branches; next 1.5;
21071 1.5 date 2003.02.28.01.01.01; author sue; state; branches; next 1.4;
21072 1.4 date 2001.01.01.01.01.01; author sue; state; branches; next 1.3;
21073 1.3 date 2000.02.29.01.01.01; author sue; state; branches; next 1.2;
21074 1.2 date 99.09.09.01.01.01; author sue; state; branches; next 1.1;
21075 1.1 date 98.09.10.01.01.01; author sue; state; branches; next;
21077 1.7 log @@ text @head revision@
21078 1.6 log @@ text @d1 1
21080 2004 was a great year for leaping@
21081 1.5 log @@ text @d1 1
21084 1.4 log @@ text @d1 1
21087 1.3 log @@ text @d1 1
21089 2000 is also a good year for leaping@
21090 1.2 log @@ text @d1 1
21092 Tonight we're going to party like it's a certain year@
21093 1.1 log @@ text @d1 1
21095 Need to start somewhere@
21097 # ' Match the 3rd single quote in the here doc -- for font-lock mode.
21099 dotest rcs2-1 "${testcvs} -q co first-dir" 'U first-dir/file1'
21103 dotest rcs2-2 "${testcvs} -q update -p -D '1999-09-09 11:30 UT' file1" \
21104 "Tonight we're going to party like it's a certain year"
21106 dotest rcs2-3 "${testcvs} -q update -p -D '2001-01-01 11:30 UT' file1" \
21109 dotest rcs2-4 "${testcvs} -q update -p -D '2000-02-29 11:30 UT' file1" \
21110 "2000 is also a good year for leaping"
21111 # 29 Feb 2003 is invalid
21112 dotest_fail rcs2-5 "${testcvs} -q update -p -D '2003-02-29 11:30 UT' file1" \
21113 "${PROG} \[[a-z]* aborted\]: Can't parse date/time: 2003-02-29 11:30 UT"
21115 dotest rcs2-6 "${testcvs} -q update -p -D 2007-01-07 file1" \
21117 # This assumes that the clock of the machine running the tests
21118 # is set to at least the year 1998 or so. There don't seem
21119 # to be a lot of ways to test the relative date code (short
21120 # of something like LD_LIBRARY_PRELOAD'ing in our own
21121 # getttimeofday, or hacking the CVS source with testing
21122 # features, which always seems to be problematic since then
21123 # someone feels like documenting them and things go downhill
21126 # These tests can be expected to fail 3 times every 400 years
21127 # starting Feb. 29, 2096 (because 8 years from that date would
21128 # be Feb. 29, 2100, which is an invalid date -- 2100 isn't a
21129 # leap year because it's divisible by 100 but not by 400).
21131 dotest rcs2-7 "${testcvs} -q update -p -D '96 months' file1" \
21133 dotest rcs2-8 "${testcvs} -q update -p -D '8 years' file1" \
21138 rm -rf ${CVSROOT_DIRNAME}/first-dir
21142 # More RCS file tests, in particular at least some of the
21143 # error handling issues.
21144 mkdir ${CVSROOT_DIRNAME}/first-dir
21145 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
21146 head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
21147 ; author jeremiah ;state ; branches; next;desc@@1.1log@@text@head@
21150 # CVS requires whitespace between "desc" and its value.
21151 # The rcsfile(5) manpage doesn't really seem to answer the
21152 # question one way or the other (it has a grammar but almost
21153 # nothing about lexical analysis).
21154 dotest_fail rcs3-1 "${testcvs} -q co first-dir" \
21155 "${PROG} \[checkout aborted\]: EOF while looking for value in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
21156 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
21157 head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
21158 ; author jeremiah ;state ; branches; next;desc @@1.1log@@text@head@
21160 # Whitespace issues, likewise.
21161 dotest_fail rcs3-2 "${testcvs} -q co first-dir" \
21162 "${PROG} \[checkout aborted\]: unexpected '.x6c' reading revision number in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
21163 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
21164 head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
21165 ; author jeremiah ;state ; branches; next;desc @@1.1 log@@text@head@
21167 # Charming array of different messages for similar
21168 # whitespace issues (depending on where the whitespace is).
21169 dotest_fail rcs3-3 "${testcvs} -q co first-dir" \
21170 "${PROG} \[checkout aborted\]: EOF while looking for value in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
21171 cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
21172 head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
21173 ; author jeremiah ;state ; branches; next;desc @@1.1 log @@text @head@
21175 dotest rcs3-4 "${testcvs} -q co first-dir" 'U first-dir/file1'
21177 # Ouch, didn't expect this one. FIXCVS. Or maybe just remove
21178 # the feature, if this is a -s problem?
21179 dotest_fail rcs3-5 "${testcvs} log -s nostate first-dir/file1" \
21180 "${DOTSTAR}ssertion.*failed${DOTSTAR}" "${DOTSTAR}failed assertion${DOTSTAR}"
21182 dotest_fail rcs3-5a "${testcvs} log -s nostate file1" \
21183 "${DOTSTAR}ssertion.*failed${DOTSTAR}" "${DOTSTAR}failed assertion${DOTSTAR}"
21186 # See remote code above for rationale for cd.
21188 dotest rcs3-6 "${testcvs} log -R file1" \
21189 "${CVSROOT_DIRNAME}/first-dir/file1,v"
21191 # OK, now put an extraneous '\0' at the end.
21192 ${AWK} </dev/null 'BEGIN { printf "@%c", 10 }' | ${TR} '@' '\000' \
21193 >>${CVSROOT_DIRNAME}/first-dir/file1,v
21194 dotest_fail rcs3-7 "${testcvs} log -s nostate file1" \
21195 "${PROG} \[log aborted\]: unexpected '.x0' reading revision number in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
21199 rm -rf ${CVSROOT_DIRNAME}/first-dir
21203 # Fix a bug that shows up when checking out files by date with the
21204 # "-D date" command line option. There is code in the original to
21205 # handle a special case. If the date search finds revision 1.1 it
21206 # is supposed to check whether revision 1.1.1.1 has the same date
21207 # stamp, which would indicate that the file was originally brought
21208 # in with "cvs import". In that case it is supposed to return the
21209 # vendor branch version 1.1.1.1.
21211 # However, there is a bug in the code. It actually compares
21212 # the date of revision 1.1 for equality with the date given
21213 # on the command line -- clearly wrong. This commit fixes
21216 # There is an additional bug which is _not_ fixed yet.
21217 # The date comparison should not be a strict
21218 # equality test. It should allow a fudge factor of, say, 2-3
21219 # seconds. Old versions of CVS created the two revisions
21220 # with two separate invocations of the RCS "ci" command. We
21221 # have many old files in the tree in which the dates of
21222 # revisions 1.1 and 1.1.1.1 differ by 1 second.
21229 echo 'OpenMunger sources' >file1
21231 # choose a time in the past to demonstrate the problem
21232 TZ=GMT touch -t 200012010123 file1
21234 dotest_sort rcs4-1 \
21235 "${testcvs} import -d -m add rcs4-dir openmunger openmunger-1_0" \
21239 No conflicts created by this import'
21240 echo 'OpenMunger sources release 1.1 extras' >>file1
21241 TZ=GMT touch -t 200112011234 file1
21242 dotest_sort rcs4-2 \
21243 "${testcvs} import -d -m add rcs4-dir openmunger openmunger-1_1" \
21246 No conflicts created by this import
21249 # Next checkout the new module
21251 "${testcvs} -q co rcs4-dir" \
21254 echo 'local change' >> file1
21256 # commit a local change
21258 "${testcvs} -q commit -m hack file1" \
21259 "Checking in file1;
21260 ${CVSROOT_DIRNAME}/rcs4-dir/file1,v <-- file1
21261 new revision: 1\.2; previous revision: 1\.1
21263 # now see if we get version 1.1 or 1.1.1.1 when we ask for
21264 # a checkout by time... it really should be 1.1.1.1 as
21265 # that was indeed the version that was visible at the target
21268 "${testcvs} -q update -D 'October 1, 2001 UTC' file1" \
21271 "${testcvs} -q status file1" \
21272 '===================================================================
21273 File: file1 Status: Up-to-date
21275 Working revision: 1\.1\.1\.1.*
21276 Repository revision: 1\.1\.1\.1 '${CVSROOT_DIRNAME}'/rcs4-dir/file1,v
21278 Sticky Date: 2001\.10\.01\.00\.00\.00
21279 Sticky Options: (none)'
21282 echo Keeping ${TESTDIR} and exiting due to --keep
21288 rm -rf ${CVSROOT_DIRNAME}/rcs4-dir
21294 # Some tests of the $Log keyword and log message without a trailing
21295 # EOL. This used to look ugly and, in the worst case, could cause
21296 # a seg fault due to a buffer overflow.
21298 # Note that it should not be possible to create this situation via a
21299 # CVS server (and any client), since the server itself inserts the
21300 # trailing EOL onto log messages that are missing one. Still, we
21301 # shouldn't segfault due to a corrupt RCS file and I think that a log
21302 # message without the trailing EOL doesn't actually violate the RCS
21303 # spec, though it doesn't appear to be possible to create such a log
21304 # message using RCS 5.7.
21306 mkdir $CVSROOT_DIRNAME/rcs5
21307 cat <<\EOF >$CVSROOT_DIRNAME/rcs5/file1,v
21314 1.1 date 2007.03.20.04.03.02; author jeremiah; state Ext; branches; next;
21321 @he always had very fine wine@
21326 echo ' * Revision history: $''Log$' >>$CVSROOT_DIRNAME/rcs5/file1,v
21327 cat <<\EOF >>$CVSROOT_DIRNAME/rcs5/file1,v
21335 dotest rcs5-1 "$testcvs -Q co rcs5"
21336 dotest rcs5-2 "cat rcs5/file1" \
21339 \\* Revision history: "'\$'"Log: file1,v "'\$'"
21340 \\* Revision history: Revision 1\.1 2007/03/20 04:03:02 jeremiah
21341 \\* Revision history: he always had very fine wine
21342 \\* Revision history:
21348 rm -rf $CVSROOT_DIRNAME/rcs5
21354 # Test that CVS notices a specific type of corruption in the RCS
21355 # archive. In the past, this type of corruption had turned up after
21356 # a user ineptly attempted to delete a revision from an arcvhive
21358 mkdir rcs6; cd rcs6
21360 # Make the project.
21361 dotest rcs6-init-1 "$testcvs -Q co -ld top .; cd top"
21363 dotest rcs6-init-2 "$testcvs -Q add rcs6"
21367 echo some words >afile
21368 dotest rcs6-init-3 "$testcvs -Q add afile"
21369 dotest rcs6-init-4 "$testcvs -Q ci -mnewfile afile" \
21370 "RCS file: $CVSROOT_DIRNAME/rcs6/afile,v
21373 $CVSROOT_DIRNAME/rcs6/afile,v <-- afile
21374 initial revision: 1\.1
21376 echo more words >>afile
21377 dotest rcs6-init-5 "$testcvs -Q ci -mrev2 afile" \
21378 "Checking in afile;
21379 $CVSROOT_DIRNAME/rcs6/afile,v <-- afile
21380 new revision: 1\.2; previous revision: 1\.1
21383 # Corrupt the archive.
21385 -e 's/^head 1\.2/head 1.1/' \
21386 <$CVSROOT_DIRNAME/rcs6/afile,v \
21387 >$CVSROOT_DIRNAME/rcs6/cfile,v
21389 # Update used to work.
21390 dotest_fail rcs6-1 "$testcvs -q up" \
21391 "$PROG \[update aborted\]: Expected head revision 1\.1, found 1\.2\."
21393 # Then a commit hosed the archive further without any warnings.
21394 # Updating to an old revision (e.g. 1.1) would have reported the
21395 # corruption. A second commit would have deleted data from the
21399 echo Keeping $TESTDIR and exiting due to --keep
21405 rm -rf $CVSROOT_DIRNAME/rcs6
21411 # Tests of CVS lock files.
21412 # TODO-maybe: Add a test where we arrange for a loginfo
21413 # script (or some such) to ensure that locks are in place
21414 # so then we can see how they are behaving.
21419 echo file >sdir/ssdir/file1
21420 dotest lockfiles-1 \
21421 "${testcvs} -Q import -m import-it first-dir bar baz" ""
21425 dotest lockfiles-2 "${testcvs} -q co first-dir" \
21426 "U first-dir/sdir/ssdir/file1"
21427 dotest lockfiles-3 "${testcvs} -Q co CVSROOT" ""
21429 echo "LockDir=${TESTDIR}/locks" >config
21430 dotest lockfiles-4 "${testcvs} -q ci -m config-it" \
21431 "Checking in config;
21432 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
21433 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
21435 ${PROG} commit: Rebuilding administrative file database"
21436 cd ../first-dir/sdir/ssdir
21437 # The error message appears twice because Lock_Cleanup only
21438 # stops recursing after the first attempt.
21439 dotest_fail lockfiles-5 "${testcvs} -q update" \
21440 "${PROG} \[update aborted\]: cannot stat ${TESTDIR}/locks: No such file or directory
21441 ${PROG} \[update aborted\]: cannot stat ${TESTDIR}/locks: No such file or directory"
21442 mkdir ${TESTDIR}/locks
21443 # Grumble, mumble. Cygwin.
21444 if test -n "$remotehost"; then
21445 $CVS_RSH $remotehost "chmod u=rwx,g=r,o= ${TESTDIR}/locks"
21447 chmod u=rwx,g=r,o= ${TESTDIR}/locks
21450 CVSUMASK=0077; export CVSUMASK
21451 dotest lockfiles-6 "${testcvs} -q update" ""
21452 # TODO: should also be testing that CVS continues to honor the
21453 # umask and CVSUMASK normally. In the case of the umask, CVS
21454 # doesn't seem to use it for much (although it perhaps should).
21455 dotest lockfiles-7 "ls ${TESTDIR}/locks/first-dir/sdir/ssdir" ""
21457 # The policy is that when CVS creates new lock directories, they
21458 # inherit the permissions from the parent directory. CVSUMASK
21459 # isn't right, because typically the reason for LockDir is to
21460 # use a different set of permissions.
21463 if test -n "$remotehost"; then
21464 dotest lockfiles-7a "$CVS_RSH $remotehost 'ls -ld ${TESTDIR}/locks/first-dir'" \
21465 "drwxr-----.*first-dir"
21466 dotest lockfiles-7b "$CVS_RSH $remotehost 'ls -ld ${TESTDIR}/locks/first-dir/sdir/ssdir'" \
21467 "drwxr-----.*first-dir/sdir/ssdir"
21469 dotest lockfiles-7a "ls -ld ${TESTDIR}/locks/first-dir" \
21470 "drwxr-----.*first-dir"
21471 dotest lockfiles-7b "ls -ld ${TESTDIR}/locks/first-dir/sdir/ssdir" \
21472 "drwxr-----.*first-dir/sdir/ssdir"
21476 dotest lockfiles-8 "${testcvs} -q update" ""
21477 dotest lockfiles-9 "${testcvs} -q co -l ." ""
21480 ### There are race conditions in the following tests, but hopefully
21481 ### the 5 seconds the first process waits to remove the lockdir and
21482 ### the 30 seconds CVS waits betweens checks will be significant
21483 ### enough to render the case moot.
21485 # Considers the following cases:
21488 # Operation Allowed (case #)
21492 # Read |Yes (1) No (3)
21493 # Write |No (7) No (9)
21495 # Tests do not appear in same ordering as table. The odd numbering
21496 # scheme maintains correspondance with a larger table on 1.12.x:
21497 # 1. Read when read locks are present...
21498 # 3. Don't read when write locks present...
21499 # 7. Don't write when read locks are present...
21500 # 9. Don't write when write locks are present...
21502 # 3. Don't read when write locks present...
21503 mkdir "$TESTDIR/locks/first-dir/#cvs.lock"
21504 (sleep 5; rmdir "$TESTDIR/locks/first-dir/#cvs.lock")&
21505 dotest lockfiles-10 "$testcvs -q co -l first-dir" \
21506 "$PROG checkout: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir
21507 $PROG checkout: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir"
21509 # 1. Read when read locks are present...
21510 touch "$TESTDIR/locks/first-dir/#cvs.rfl.test.lock"
21511 dotest lockfiles-11 "$testcvs -q co -l first-dir"
21512 rm "$TESTDIR/locks/first-dir/#cvs.rfl.test.lock"
21514 # 7. Don't write when read locks are present...
21515 echo I always have trouble coming up with witty text for the test files >>first-dir/sdir/ssdir/file1
21516 touch "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.rfl.test.lock"
21517 (sleep 5; rm "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.rfl.test.lock")&
21518 dotest lockfiles-13 "$testcvs -q ci -mconflict first-dir" \
21519 "$PROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
21520 $PROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
21521 Checking in first-dir/sdir/ssdir/file1;
21522 $CVSROOT_DIRNAME/first-dir/sdir/ssdir/file1,v <-- file1
21523 new revision: 1\.2; previous revision: 1\.1
21526 # 9. Don't write when write locks are present...
21527 echo yet this poem would probably only give longfellow bile >>first-dir/sdir/ssdir/file1
21528 mkdir "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.lock"
21529 (sleep 5; rmdir "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.lock")&
21530 dotest lockfiles-19 "$testcvs -q ci -mnot-up-to-date first-dir" \
21531 "$PROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
21532 $PROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
21533 Checking in first-dir/sdir/ssdir/file1;
21534 $CVSROOT_DIRNAME/first-dir/sdir/ssdir/file1,v <-- file1
21535 new revision: 1\.3; previous revision: 1\.2
21538 # 10. Don't write when history locks are present...
21539 echo have you ever heard a poem quite so vile\? >>first-dir/sdir/ssdir/file1
21540 mkdir "$TESTDIR/locks/CVSROOT/#cvs.history.lock"
21541 (sleep 5; rmdir "$TESTDIR/locks/CVSROOT/#cvs.history.lock")&
21542 dotest lockfiles-20 "$testcvs -q ci -mnot-up-to-date first-dir" \
21543 "Checking in first-dir/sdir/ssdir/file1;
21544 $CVSROOT_DIRNAME/first-dir/sdir/ssdir/file1,v <-- file1
21545 new revision: 1\.4; previous revision: 1\.3
21547 $PROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/CVSROOT
21548 $PROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/CVSROOT"
21550 dotest lockfiles-21 "$testcvs -Q tag newtag first-dir"
21552 rm -f $CVSROOT_DIRNAME/CVSROOT/val-tags
21553 mkdir "$TESTDIR/locks/CVSROOT/#cvs.val-tags.lock"
21554 (sleep 5; rmdir "$TESTDIR/locks/CVSROOT/#cvs.val-tags.lock")&
21555 dotest lockfiles-22 "$testcvs -q up -r newtag first-dir" \
21556 "$PROG update: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/CVSROOT
21557 $PROG update: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/CVSROOT
21558 [UP] first-dir/sdir/ssdir/file1"
21561 echo "# nobody here but us comments" >config
21562 dotest lockfiles-cleanup-1 "${testcvs} -q ci -m config-it" \
21563 "Checking in config;
21564 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
21565 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
21567 ${PROG} commit: Rebuilding administrative file database"
21569 # Perhaps should restore the umask and CVSUMASK to what they
21570 # were before. But the other tests "should" not care about them...
21573 rm -r ${TESTDIR}/locks
21575 rm -rf ${CVSROOT_DIRNAME}/first-dir
21579 # Tests to make sure we get the expected behavior
21580 # when we recover a repository from an old backup
21583 # Backup will be older than some developer's workspaces
21584 # This means the first attempt at an update will fail
21585 # The workaround for this is to replace the CVS
21586 # directories with those from a "new" checkout from
21587 # the recovered repository. Due to this, multiple
21588 # merges should cause conflicts (the same data
21589 # will be merged more than once).
21590 # A workspace updated before the date of the recovered
21591 # copy will not need any extra attention
21593 # Note that backuprecover-15 is probably a failure case
21594 # If nobody else had a more recent update, the data would be lost
21596 # Granted, the developer should have been notified not to do this
21597 # by now, but still...
21599 mkdir backuprecover; cd backuprecover
21601 dotest backuprecover-1 "${testcvs} -q co -l ." ''
21603 dotest backuprecover-2 "${testcvs} add first-dir" \
21604 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
21607 dotest backuprecover-3 "${testcvs} add dir" \
21608 "Directory ${CVSROOT_DIRNAME}/first-dir/dir added to the repository"
21609 touch file1 dir/file2
21610 dotest backuprecover-4 "${testcvs} -q add file1 dir/file2" \
21611 "${PROG} add: use .${PROG} commit. to add these files permanently"
21612 dotest backuprecover-5 "${testcvs} -q ci -mtest" \
21613 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21616 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21617 initial revision: 1\.1
21619 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
21621 Checking in dir/file2;
21622 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
21623 initial revision: 1\.1
21625 echo "Line one" >>file1
21626 echo " is the place" >>file1
21627 echo " we like to begin" >>file1
21628 echo "Anything else" >>file1
21629 echo " looks like" >>file1
21630 echo " a sin" >>file1
21631 echo "File 2" >>dir/file2
21632 echo " is the place" >>dir/file2
21633 echo " the rest of it goes" >>dir/file2
21634 echo "Why I don't use" >>dir/file2
21635 echo " something like 'foo'" >>dir/file2
21636 echo " God only knows" >>dir/file2
21637 dotest backuprecover-6 "${testcvs} -q ci -mtest" \
21638 "Checking in file1;
21639 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21640 new revision: 1\.2; previous revision: 1\.1
21642 Checking in dir/file2;
21643 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
21644 new revision: 1\.2; previous revision: 1\.1
21647 # Simulate the lazy developer
21648 # (he did some work but didn't check it in...)
21651 dotest backuprecover-7 "${testcvs} -Q co first-dir" ''
21653 sed -e "s/looks like/just looks like/" file1 >tmp; mv tmp file1
21654 sed -e "s/don't use/don't just use/" dir/file2 >tmp; mv tmp dir/file2
21656 # developer 1 is on a roll
21657 cd ../../1/first-dir
21658 echo "I need some more words" >>file1
21659 echo " to fill up this space" >>file1
21660 echo " anything else would be a disgrace" >>file1
21661 echo "My rhymes cross many boundries" >>dir/file2
21662 echo " this time it's files" >>dir/file2
21663 echo " a word that fits here would be something like dials" >>dir/file2
21664 dotest backuprecover-8 "${testcvs} -q ci -mtest" \
21665 "Checking in file1;
21666 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21667 new revision: 1\.3; previous revision: 1\.2
21669 Checking in dir/file2;
21670 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
21671 new revision: 1\.3; previous revision: 1\.2
21674 # Save a backup copy
21675 cp -r ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/backup
21677 # Simulate developer 3
21680 dotest backuprecover-9a "${testcvs} -Q co first-dir" ''
21684 echo "Developer 1 makes very lame rhymes" >>file1
21685 echo " I think he should quit and become a mime" >>file1
21686 echo "What the %*^# kind of rhyme crosses a boundry?" >>dir/file2
21687 echo " I think you should quit and get a job in the foundry" >>dir/file2
21688 dotest backuprecover-9b "${testcvs} -q ci -mtest" \
21689 "Checking in file1;
21690 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21691 new revision: 1\.4; previous revision: 1\.3
21693 Checking in dir/file2;
21694 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
21695 new revision: 1\.4; previous revision: 1\.3
21698 # Developer 4 so we can simulate a conflict later...
21701 dotest backuprecover-10 "${testcvs} -Q co first-dir" ''
21703 sed -e "s/quit and/be fired so he can/" dir/file2 >tmp; mv tmp dir/file2
21705 # And back to developer 1
21706 cd ../../1/first-dir
21707 dotest backuprecover-11 "${testcvs} -Q update" ''
21710 echo "Oh yeah, well rhyme this" >>file1
21711 echo " developer three" >>file1
21712 echo " you want opposition" >>file1
21713 echo " you found some in me!" >>file1
21714 echo "I'll give you mimes" >>dir/file2
21715 echo " and foundries galore!" >>dir/file2
21716 echo " your head will spin" >>dir/file2
21717 echo " once you find what's in store!" >>dir/file2
21718 dotest backuprecover-12 "${testcvs} -q ci -mtest" \
21719 "Checking in file1;
21720 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21721 new revision: 1\.5; previous revision: 1\.4
21723 Checking in dir/file2;
21724 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
21725 new revision: 1\.5; previous revision: 1\.4
21728 # developer 3'll do a bit of work that never gets checked in
21729 cd ../../3/first-dir
21730 dotest backuprecover-13 "${testcvs} -Q update" ''
21731 sed -e "s/very/some extremely/" file1 >tmp; mv tmp file1
21732 dotest backuprecover-14 "${testcvs} -q ci -mtest" \
21733 "Checking in file1;
21734 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21735 new revision: 1\.6; previous revision: 1\.5
21738 echo "Tee hee hee hee" >>file1
21740 echo "Find what's in store?" >>dir/file2
21741 echo " Oh, I'm so sure!" >>dir/file2
21742 echo " You've got an ill, and I have the cure!" >>dir/file2
21744 # Slag the original and restore it a few revisions back
21745 rm -rf ${CVSROOT_DIRNAME}/first-dir
21746 mv ${CVSROOT_DIRNAME}/backup ${CVSROOT_DIRNAME}/first-dir
21748 # Have developer 1 try an update and lose some data
21750 # Feel free to imagine the horrific scream of despair
21751 cd ../../1/first-dir
21752 dotest backuprecover-15 "${testcvs} update" \
21753 "${PROG} update: Updating .
21755 ${PROG} update: Updating dir
21758 # Developer 3 tries the same thing (he has an office)
21759 # but fails without losing data since all of his files have
21760 # uncommitted changes
21761 cd ../../3/first-dir
21762 dotest_fail backuprecover-16 "${testcvs} update" \
21763 "${PROG} update: Updating \.
21764 ${PROG} \[update aborted\]: could not find desired version 1\.6 in ${CVSROOT_DIRNAME}/first-dir/file1,v"
21766 # create our workspace fixin' script
21771 # This script will copy the CVS database dirs from the checked out
21772 # version of a newly recovered repository and replace the CVS
21773 # database dirs in a workspace with later revisions than those in the
21774 # recovered repository
21776 DATADIRS=\`find . -name CVS -print\`
21778 find . -name CVS -print | xargs rm -rf
21779 for file in \${DATADIRS}; do
21780 cp -r ../repos-first-dir/\${file} \${file}
21783 # We only need to fix the workspaces of developers 3 and 4
21784 # (1 lost all her data and 2 has an update date from
21785 # before the date the backup was made)
21787 dotest backuprecover-17 \
21788 "${testcvs} -Q co -d repos-first-dir first-dir" ''
21790 dotest backuprecover-18 \
21791 "${testcvs} -Q co -d repos-first-dir first-dir" ''
21793 cd ../3; sh ../fixit
21795 # (re)commit developer 3's stuff
21797 dotest backuprecover-19 "${testcvs} -q ci -mrecover/merge" \
21798 "Checking in file1;
21799 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21800 new revision: 1\.4; previous revision: 1\.3
21802 Checking in dir/file2;
21803 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
21804 new revision: 1\.4; previous revision: 1\.3
21807 # and we should get a conflict on developer 4's stuff
21808 cd ../../4/first-dir
21809 dotest backuprecover-20 "${testcvs} update" \
21810 "${PROG} update: Updating \.
21811 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21812 retrieving revision 1\.3
21813 retrieving revision 1\.4
21814 Merging differences between 1\.3 and 1\.4 into file1
21815 rcsmerge: warning: conflicts during merge
21816 ${PROG} update: conflicts found in file1
21818 ${PROG} update: Updating dir
21819 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
21820 retrieving revision 1\.3
21821 retrieving revision 1\.4
21822 Merging differences between 1\.3 and 1\.4 into file2
21823 rcsmerge: warning: conflicts during merge
21824 ${PROG} update: conflicts found in dir/file2
21827 "/^<<<<<<</,/^=======/d
21828 /^>>>>>>>/d" file1 >tmp; mv tmp file1
21830 "/^<<<<<<</,/^=======/d
21832 s/quit and/be fired so he can/" dir/file2 >tmp; mv tmp dir/file2
21833 dotest backuprecover-21 "${testcvs} -q ci -mrecover/merge" \
21834 "Checking in dir/file2;
21835 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
21836 new revision: 1\.5; previous revision: 1\.4
21839 # go back and commit developer 2's stuff to prove it can still be done
21840 cd ../../2/first-dir
21841 dotest backuprecover-22 "${testcvs} -Q update" \
21842 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21843 retrieving revision 1\.2
21844 retrieving revision 1\.4
21845 Merging differences between 1\.2 and 1\.4 into file1
21846 RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
21847 retrieving revision 1\.2
21848 retrieving revision 1\.5
21849 Merging differences between 1\.2 and 1\.5 into file2"
21850 dotest backuprecover-23 "${testcvs} -q ci -mtest" \
21851 "Checking in file1;
21852 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
21853 new revision: 1\.5; previous revision: 1\.4
21855 Checking in dir/file2;
21856 ${CVSROOT_DIRNAME}/first-dir/dir/file2,v <-- file2
21857 new revision: 1\.6; previous revision: 1\.5
21860 # and restore the data to developer 1
21861 cd ../../1/first-dir
21862 dotest backuprecover-24 "${testcvs} -Q update" ''
21865 rm -r backuprecover
21866 rm -rf ${CVSROOT_DIRNAME}/first-dir
21872 # CVS_RSH=ssh can have a problem with a non-blocking stdio
21873 # in some cases. So, this test is all about testing :ext:
21874 # with CVS_RSH=ssh. The problem is that not all machines
21875 # will necessarily have ssh available, so be prepared to
21878 # Are we able to run find and use an ssh?
21879 if $remote; then :; else
21884 if test $? -eq 77; then
21885 skip sshstdio "$skipreason"
21889 SSHSTDIO_ROOT=:ext:$host$CVSROOT_DIRNAME
21891 mkdir sshstdio; cd sshstdio
21892 dotest sshstdio-1 "$testcvs -d $SSHSTDIO_ROOT -q co -l ."
21894 dotest sshstdio-2 "$testcvs add first-dir" \
21895 "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
21897 a='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
21898 c='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
21899 # Generate 1024 lines of $a
21902 while [ $cnt -lt 5 ] ; do
21903 cnt=`expr $cnt + 1` ;
21905 cat aaa.old aaa.old aaa.old aaa.old > aaa
21907 dotest sshstdio-3 "$testcvs -q add aaa" \
21908 "$PROG add: use .$PROG commit. to add this file permanently"
21909 dotest sshstdio-4 "$testcvs -q ci -mcreate aaa" \
21910 "RCS file: $CVSROOT_DIRNAME/first-dir/aaa,v
21913 $CVSROOT_DIRNAME/first-dir/aaa,v <-- aaa
21914 initial revision: 1\.1
21916 # replace lines 1, 512, 513, 1024 with $c
21917 sed 510q < aaa > aaa.old
21918 (echo $c; cat aaa.old; echo $c; \
21919 echo $c; cat aaa.old; echo $c) > aaa
21920 dotest sshstdio-5 "$testcvs -q ci -mmodify-it aaa" \
21922 $CVSROOT_DIRNAME/first-dir/aaa,v <-- aaa
21923 new revision: 1\.2; previous revision: 1\.1
21925 cat > wrapper.sh <<EOF
21927 exec "\$@" 2>&1 < /dev/null | cat
21929 chmod +x wrapper.sh
21931 $testcvs -z5 -Q diff --side-by-side -W 500 -r 1.1 -r 1.2 \
21934 '/^Write failed flushing stdout buffer\.
\r$/d;
21935 /^write stdout: Broken pipe
\r$/d;
21937 /Write failed flushing stdout buffer\.
\r$/{
21939 s/Write failed flushing stdout buffer\.
\r\n//;
21942 /write stdout: Broken pipe
\r$/{
21944 s/write stdout: Broken pipe
\r\n//;
21949 $testcvs -z5 -Q diff --side-by-side -W 500 -r 1.1 -r 1.2 \
21952 dotest sshstdio-6 "cmp wrapper.dif good.dif"
21955 echo Keeping $TESTDIR and exiting due to --keep
21960 CVS_RSH=$save_CVS_RSH; export CVS_RSH
21962 rm -rf $CVSROOT_DIRNAME/first-dir
21968 # Test some :ext: roots for consistancy.
21969 if $remote; then :; else
21973 depends_on_rsh "$CVS_RSH"
21974 if test $? -eq 77; then
21975 skip parseroot2 "$skipreason"
21979 # Test checking out and subsequently updating with some different
21982 # A standard case, hostname:dirname.
21983 mkdir parseroot2; cd parseroot2
21984 save_CVSROOT=$CVSROOT
21985 CVSROOT=$host:$CVSROOT_DIRNAME
21986 dotest parseroot2-1 "$testcvs -Q co CVSROOT"
21988 dotest parseroot2-2 "$testcvs -Q up"
21991 # A degenerate remote case, just the server name and the directory
21992 # name, with no :'s to help parsing. It can be mistaken for a
21993 # relative directory name.
21995 CVSROOT=$host$CVSROOT_DIRNAME
21996 dotest parseroot2-3 "$testcvs -Q co CVSROOT"
21998 dotest parseroot2-4 "$testcvs -Q up"
22001 echo Keeping $TESTDIR and exiting due to --keep
22006 CVSROOT=$save_CVSROOT
22013 # CVSROOT/history tests:
22014 # history: various "cvs history" invocations
22015 # basic2: Generating the CVSROOT/history file via CVS commands.
22017 # Put in some data for the history file (discarding what was
22018 # there before). Note that this file format is fixed; the
22019 # user may wish to analyze data from a previous version of
22020 # CVS. If we phase out this format, it should be done
22021 # slowly and carefully.
22022 cat >${CVSROOT_DIRNAME}/CVSROOT/history <<EOF
22023 O3395c677|anonymous|<remote>/*0|ccvs||ccvs
22024 O3396c677|anonymous|<remote>/src|ccvs||src
22025 O3397c677|kingdon|<remote>/*0|ccvs||ccvs
22026 M339cafae|nk|<remote>|ccvs/src|1.229|sanity.sh
22027 M339cafff|anonymous|<remote>|ccvs/src|1.23|Makefile
22028 M339dc339|kingdon|~/work/*0|ccvs/src|1.231|sanity.sh
22029 W33a6eada|anonymous|<remote>*4|ccvs/emx||Makefile.in
22030 C3b235f50|kingdon|<remote>|ccvs/emx|1.3|README
22031 M3b23af50|kingdon|~/work/*0|ccvs/doc|1.281|cvs.texinfo
22033 dotest history-1 "${testcvs} history -e -a" \
22034 "O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
22035 O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src= <remote>/\*
22036 M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
22037 W 1997-06-17 19:51 ${PLUS}0000 anonymous Makefile\.in ccvs/emx == <remote>/emx
22038 O 1997-06-06 08:12 ${PLUS}0000 kingdon ccvs =ccvs= <remote>/\*
22039 M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
22040 C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
22041 M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc
22042 M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
22044 dotest history-2 "${testcvs} history -e -a -D '10 Jun 1997 13:00 UT'" \
22045 "W 1997-06-17 19:51 ${PLUS}0000 anonymous Makefile\.in ccvs/emx == <remote>/emx
22046 M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
22047 C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
22048 M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc"
22050 dotest history-3 "${testcvs} history -e -a -D '10 Jun 2001 13:00 UT'" \
22051 "M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc"
22053 dotest history-4 "${testcvs} history -ac sanity.sh" \
22054 "M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
22055 M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
22057 dotest history-5 "${testcvs} history -a -xCGUWAMR README sanity.sh" \
22058 "M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
22059 C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
22060 M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
22062 dotest history-6 "${testcvs} history -xCGUWAMR -a -f README -f sanity.sh" \
22063 "M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
22064 C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
22065 M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
22067 dotest history-7 "${testcvs} history -xCGUWAMR -a -f sanity.sh README" \
22068 "M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
22069 C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
22070 M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
22072 dotest history-8 "${testcvs} history -ca -D '1970-01-01 00:00 UT'" \
22073 "M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity.sh ccvs/src == <remote>
22074 M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
22075 M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity.sh ccvs/src == ~/work/ccvs/src
22076 M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc"
22078 dotest history-9 "${testcvs} history -acl" \
22079 "M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc
22080 M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
22081 M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity.sh ccvs/src == ~/work/ccvs/src"
22083 dotest history-10 "${testcvs} history -lca -D '1970-01-01 00:00 UT'" \
22084 "M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc
22085 M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
22086 M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity.sh ccvs/src == ~/work/ccvs/src"
22088 dotest history-11 "${testcvs} history -aw" \
22089 "O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
22090 O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src= <remote>/\*
22091 O 1997-06-06 08:12 ${PLUS}0000 kingdon ccvs =ccvs= <remote>/\*"
22093 dotest history-12 "${testcvs} history -aw -D'1970-01-01 00:00 UT'" \
22094 "O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
22095 O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src= <remote>/\*
22096 O 1997-06-06 08:12 ${PLUS}0000 kingdon ccvs =ccvs= <remote>/\*"
22101 # Test ability to operate on big files. Intention is to
22102 # test various realloc'ing code in RCS_deltas, rcsgetkey,
22103 # etc. "big" is currently defined to be 1000 lines (64000
22104 # bytes), which in terms of files that users will use is not
22105 # large, merely average, but my reasoning is that this
22106 # should be big enough to make sure realloc'ing is going on
22107 # and that raising it a lot would start to stress resources
22108 # on machines which run the tests, without any significant
22111 mkdir ${CVSROOT_DIRNAME}/first-dir
22112 dotest big-1 "${testcvs} -q co first-dir" ''
22114 for i in 0 1 2 3 4 5 6 7 8 9; do
22115 for j in 0 1 2 3 4 5 6 7 8 9; do
22116 for k in 0 1 2 3 4 5 6 7 8 9; do
22118 "This is line ($i,$j,$k) which goes into the file file1 for testing" >>file1
22122 dotest big-2 "${testcvs} add file1" \
22123 "${PROG} add: scheduling file .file1. for addition
22124 ${PROG} add: use .${PROG} commit. to add this file permanently"
22125 dotest big-3 "${testcvs} -q ci -m add" \
22126 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22129 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
22130 initial revision: 1\.1
22135 dotest big-4 "${testcvs} -q get first-dir" "U first-dir/file1"
22137 echo "add a line to the end" >>file1
22138 dotest big-5 "${testcvs} -q ci -m modify" \
22139 "Checking in file1;
22140 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
22141 new revision: 1\.2; previous revision: 1\.1
22144 # The idea here is particularly to test the Rcs-diff response
22145 # and the reallocing thereof, for remote.
22146 dotest big-6 "${testcvs} -q update" "[UP] file1"
22150 echo Keeping ${TESTDIR} and exiting due to --keep
22155 rm -rf ${CVSROOT_DIRNAME}/first-dir
22159 # Test repository permissions (CVSUMASK and so on).
22160 # Although the tests in this section "cheat" by testing
22161 # repository permissions, which are sort of not a user-visible
22162 # sort of thing, the modes do have user-visible consequences,
22163 # such as whether a second user can check out the files. But
22164 # it would be awkward to test the consequences, so we don't.
22166 # Solaris /bin/sh doesn't support export -n. I'm not sure
22167 # what we can do about this, other than hope that whoever
22168 # is running the tests doesn't have CVSUMASK set.
22169 #export -n CVSUMASK # if unset, defaults to 002
22173 dotest modes-1 "${testcvs} -q co -l ." ''
22175 dotest modes-2 "${testcvs} add first-dir" \
22176 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22179 dotest modes-3 "${testcvs} add aa" \
22180 "${PROG} add: scheduling file .aa. for addition
22181 ${PROG} add: use .${PROG} commit. to add this file permanently"
22182 dotest modes-4 "${testcvs} -q ci -m add" \
22183 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
22186 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
22187 initial revision: 1\.1
22190 if test -n "$remotehost"; then
22191 dotest modes-5remotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v'" \
22194 dotest modes-5 "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
22198 # Test for whether we can set the execute bit.
22200 echo change it >>aa
22201 dotest modes-6 "${testcvs} -q ci -m set-execute-bit" \
22203 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
22204 new revision: 1\.2; previous revision: 1\.1
22206 # If CVS let us update the execute bit, it would be set here.
22207 # But it doesn't, and as far as I know that is longstanding
22210 # Yeah, yeah. Search for "Cygwin".
22211 if test -n "$remotehost"; then
22212 dotest modes-7remotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v'" \
22215 dotest modes-7 "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
22219 # OK, now manually change the modes and see what happens.
22222 if test -n "$remotehost"; then
22223 $CVS_RSH $remotehost "chmod g=r,o= ${CVSROOT_DIRNAME}/first-dir/aa,v"
22225 chmod g=r,o= ${CVSROOT_DIRNAME}/first-dir/aa,v
22227 echo second line >>aa
22228 dotest modes-7a "${testcvs} -q ci -m set-execute-bit" \
22230 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
22231 new revision: 1\.3; previous revision: 1\.2
22234 if test -n "$remotehost"; then
22235 dotest modes-7bremotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v'" \
22238 dotest modes-7b "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
22245 # Might as well test the execute bit too.
22247 dotest modes-8 "${testcvs} add ab" \
22248 "${PROG} add: scheduling file .ab. for addition
22249 ${PROG} add: use .${PROG} commit. to add this file permanently"
22250 dotest modes-9 "${testcvs} -q ci -m add" \
22251 "RCS file: ${CVSROOT_DIRNAME}/first-dir/ab,v
22254 ${CVSROOT_DIRNAME}/first-dir/ab,v <-- ab
22255 initial revision: 1\.1
22258 # The problem here is that the CVSUMASK environment variable
22259 # needs to be set on the server (e.g. .bashrc). This is, of
22260 # course, bogus, but that is the way it is currently.
22261 if test -n "$remotehost"; then
22262 dotest modes-10remotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/ab,v'" \
22265 dotest modes-10r "ls -l ${CVSROOT_DIRNAME}/first-dir/ab,v" \
22266 "-r-xr-x---.*" "-r-xr-xr-x.*"
22269 dotest modes-10 "ls -l ${CVSROOT_DIRNAME}/first-dir/ab,v" \
22273 # OK, now add a file on a branch. Check that the mode gets
22274 # set the same way (it is a different code path in CVS).
22275 dotest modes-11 "${testcvs} -q tag -b br" 'T aa
22277 dotest modes-12 "$testcvs -q update -r br" \
22281 dotest modes-13 "${testcvs} add ac" \
22282 "${PROG} add: scheduling file .ac. for addition on branch .br.
22283 ${PROG} add: use .${PROG} commit. to add this file permanently"
22284 # Not sure it really makes sense to refer to a "previous revision"
22285 # when we are just now adding the file; as far as I know
22286 # that is longstanding CVS behavior, for what it's worth.
22287 dotest modes-14 "${testcvs} -q ci -m add" \
22288 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v
22291 ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v <-- ac
22292 new revision: 1\.1\.2\.1; previous revision: 1\.1
22295 # The problem here is that the CVSUMASK environment variable
22296 # needs to be set on the server (e.g. .bashrc). This is, of
22297 # course, bogus, but that is the way it is currently. The
22298 # first match is for the :ext: method (where the CVSUMASK
22299 # won't be set), while the second is for the :fork: method
22300 # (where it will be).
22301 if test -n "$remotehost"; then
22303 "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v'" \
22307 "ls -l ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v" \
22308 "-r--r--r--.*" "-r--r-----.*"
22312 "ls -l ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v" \
22318 rm -rf ${CVSROOT_DIRNAME}/first-dir
22319 # Perhaps should restore the umask and CVSUMASK. But the other
22320 # tests "should" not care about them...
22324 # More tests of file permissions in the working directory
22325 # and that sort of thing.
22327 # The usual setup, file first-dir/aa with two revisions.
22329 dotest modes2-1 "${testcvs} -q co -l ." ''
22331 dotest modes2-2 "${testcvs} add first-dir" \
22332 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22335 dotest modes2-3 "${testcvs} add aa" \
22336 "${PROG} add: scheduling file .aa. for addition
22337 ${PROG} add: use .${PROG} commit. to add this file permanently"
22338 dotest modes2-4 "${testcvs} -q ci -m add" \
22339 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
22342 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
22343 initial revision: 1\.1
22345 echo "more money" >> aa
22346 dotest modes2-5 "${testcvs} -q ci -m add" \
22348 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
22349 new revision: 1\.2; previous revision: 1\.1
22352 # OK, here is the test. The idea is to see what
22353 # No_Difference does if it can't open the file.
22354 # If we don't change the st_mtime, CVS doesn't even try to read
22355 # the file. Note that some versions of "touch" require that we
22356 # do this while the file is still writable.
22359 # Don't try this when permissions are broken, as with Cygwin.
22360 if ls ${CVSROOT_DIRNAME}/first-dir >/dev/null 2>&1; then :; else
22361 dotest_fail modes2-6 "${testcvs} -q update -r 1.1 aa" \
22362 "${PROG} \[update aborted\]: cannot open file aa for comparing: Permission denied" \
22363 "${PROG} \[update aborted\]: reading aa: Permission denied"
22369 rm -rf ${CVSROOT_DIRNAME}/first-dir
22373 # Repository permissions. Particularly, what happens if we
22374 # can't read/write in the repository.
22375 # TODO: the case where we can access the repository, just not
22376 # the attic (may that one can remain a fatal error, seems less
22377 # useful for access control).
22379 dotest modes3-1 "${testcvs} -q co -l ." ''
22380 mkdir first-dir second-dir
22381 dotest modes3-2 "${testcvs} add first-dir second-dir" \
22382 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
22383 Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
22384 touch first-dir/aa second-dir/ab
22385 dotest modes3-3 "${testcvs} add first-dir/aa second-dir/ab" \
22386 "${PROG} add: scheduling file .first-dir/aa. for addition
22387 ${PROG} add: scheduling file .second-dir/ab. for addition
22388 ${PROG} add: use .${PROG} commit. to add these files permanently"
22389 dotest modes3-4 "${testcvs} -q ci -m add" \
22390 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
22392 Checking in first-dir/aa;
22393 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
22394 initial revision: 1\.1
22396 RCS file: ${CVSROOT_DIRNAME}/second-dir/ab,v
22398 Checking in second-dir/ab;
22399 ${CVSROOT_DIRNAME}/second-dir/ab,v <-- ab
22400 initial revision: 1\.1
22402 if test -n "$remotehost"; then
22403 $CVS_RSH $remotehost "chmod a= ${CVSROOT_DIRNAME}/first-dir"
22405 chmod a= ${CVSROOT_DIRNAME}/first-dir
22407 if ls ${CVSROOT_DIRNAME}/first-dir >/dev/null 2>&1; then
22408 # Avoid this test under Cygwin since permissions work differently
22411 # This test also gets avoided under Mac OS X since the system `ls'
22412 # is broken and exits with a 0 status despite the permission
22414 if test -n "$remotehost"; then
22424 if $cygwin_hack; then :; else
22425 dotest modes3-5 "${testcvs} update" \
22426 "${PROG} update: Updating \.
22427 ${PROG} update: Updating first-dir
22428 ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/first-dir: Permission denied
22429 ${PROG} update: skipping directory first-dir
22430 ${PROG} update: Updating second-dir"
22433 # OK, I can see why one might say the above case could be a
22434 # fatal error, because normally users without access to first-dir
22435 # won't have it in their working directory. But the next
22436 # one is more of a problem if it is fatal.
22438 # The second text string below is for Cygwin again, and again it
22439 # should really be XFAIL under Cygwin, but for now deal with the
22440 # passing opendir by accepting the alternate string.
22442 dotest modes3-6 "${testcvs} update -dP" \
22443 "${PROG} update: Updating .
22444 ${PROG} update: Updating CVSROOT
22446 ${PROG} update: Updating first-dir
22447 ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/first-dir: Permission denied
22448 ${PROG} update: skipping directory first-dir
22449 ${PROG} update: Updating second-dir" \
22450 "${PROG} update: Updating .
22451 ${PROG} update: Updating CVSROOT
22453 ${PROG} update: Updating first-dir
22454 ${PROG} update: Updating second-dir"
22458 chmod u+rwx ${CVSROOT_DIRNAME}/first-dir
22459 rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
22465 dotest stamps-1 "${testcvs} -q co -l ." ''
22467 dotest stamps-2 "${testcvs} add first-dir" \
22468 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22472 # Cygwin, *cough*, puts the year in the time column until the minute
22473 # is no longer the current minute. Sleep 60 seconds to avoid this
22476 ls -l aa >${TESTDIR}/1/stamp.aa.touch
22477 ls -l kw >${TESTDIR}/1/stamp.kw.touch
22478 # "sleep 1" would suffice if we could assume ls --full-time, but
22479 # that is as far as I know unique to GNU ls. Is there some POSIX.2
22480 # way to get the timestamp of a file, including the seconds?
22482 dotest stamps-3 "${testcvs} add aa kw" \
22483 "${PROG} add: scheduling file .aa. for addition
22484 ${PROG} add: scheduling file .kw. for addition
22485 ${PROG} add: use .${PROG} commit. to add these files permanently"
22486 ls -l aa >${TESTDIR}/1/stamp.aa.add
22487 ls -l kw >${TESTDIR}/1/stamp.kw.add
22488 # "cvs add" should not muck with the timestamp.
22489 dotest stamps-4aa \
22490 "cmp ${TESTDIR}/1/stamp.aa.touch ${TESTDIR}/1/stamp.aa.add" ''
22491 dotest stamps-4kw \
22492 "cmp ${TESTDIR}/1/stamp.kw.touch ${TESTDIR}/1/stamp.kw.add" ''
22494 dotest stamps-5 "${testcvs} -q ci -m add" \
22495 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa,v
22498 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
22499 initial revision: 1\.1
22501 RCS file: ${CVSROOT_DIRNAME}/first-dir/kw,v
22504 ${CVSROOT_DIRNAME}/first-dir/kw,v <-- kw
22505 initial revision: 1\.1
22507 # Cygwin, *cough*, puts the year in the time column until the minute
22508 # is no longer the current minute. Sleep 60 seconds to avoid this
22511 ls -l aa >${TESTDIR}/1/stamp.aa.ci
22512 ls -l kw >${TESTDIR}/1/stamp.kw.ci
22513 # If there are no keywords, "cvs ci" leaves the timestamp alone
22514 # If there are, it sets the timestamp to the date of the commit.
22515 # I'm not sure how logical this is, but it is intentional.
22516 # If we wanted to get fancy we would make sure the time as
22517 # reported in "cvs log kw" matched stamp.kw.ci. But that would
22518 # be a lot of work.
22519 dotest stamps-6aa \
22520 "cmp ${TESTDIR}/1/stamp.aa.add ${TESTDIR}/1/stamp.aa.ci" ''
22521 if cmp ${TESTDIR}/1/stamp.kw.add ${TESTDIR}/1/stamp.kw.ci >/dev/null
22531 dotest stamps-7 "${testcvs} -q get first-dir" "U first-dir/aa
22534 ls -l aa >${TESTDIR}/1/stamp.aa.get
22535 ls -l kw >${TESTDIR}/1/stamp.kw.get
22536 # On checkout, CVS should set the timestamp to the date that the
22537 # file was committed. Could check that the time as reported in
22538 # "cvs log aa" matches stamp.aa.get, but that would be a lot of
22540 if cmp ${TESTDIR}/1/stamp.aa.ci ${TESTDIR}/1/stamp.aa.get >/dev/null
22546 dotest stamps-8kw \
22547 "cmp ${TESTDIR}/1/stamp.kw.ci ${TESTDIR}/1/stamp.kw.get" ''
22549 # Now we want to see what "cvs update" does.
22551 echo add a line >>aa
22552 echo add a line >>kw
22553 dotest stamps-9 "${testcvs} -q ci -m change-them" \
22555 ${CVSROOT_DIRNAME}/first-dir/aa,v <-- aa
22556 new revision: 1\.2; previous revision: 1\.1
22559 ${CVSROOT_DIRNAME}/first-dir/kw,v <-- kw
22560 new revision: 1\.2; previous revision: 1\.1
22563 # Cygwin, *cough*, puts the year in the time column until the minute
22564 # is no longer the current minute. Sleep 60 seconds to avoid this
22567 ls -l aa >${TESTDIR}/1/stamp.aa.ci2
22568 ls -l kw >${TESTDIR}/1/stamp.kw.ci2
22572 dotest stamps-10 "${testcvs} -q update" '[UP] aa
22574 # this doesn't serve any function other than being able to
22575 # look at it manually, as we have no machinery for dates being
22576 # newer or older than other dates.
22577 date >${TESTDIR}/1/stamp.debug.update
22578 ls -l aa >${TESTDIR}/1/stamp.aa.update
22579 ls -l kw >${TESTDIR}/1/stamp.kw.update
22580 # stamp.aa.update and stamp.kw.update should both be approximately
22581 # the same as stamp.debug.update. Perhaps we could be testing
22582 # this in a more fancy fashion by "touch stamp.before" before
22583 # stamps-10, "touch stamp.after" after, and then using ls -t
22584 # to check them. But for now we just make sure that the *.update
22585 # stamps differ from the *.ci2 ones.
22586 # As for the rationale, this is so that if one updates and gets
22587 # a new revision, then "make" will be sure to regard those files
22588 # as newer than .o files which may be sitting around.
22589 if cmp ${TESTDIR}/1/stamp.aa.update ${TESTDIR}/1/stamp.aa.ci2 \
22596 if cmp ${TESTDIR}/1/stamp.kw.update ${TESTDIR}/1/stamp.kw.ci2 \
22607 echo Keeping ${TESTDIR} and exiting due to --keep
22612 rm -rf ${CVSROOT_DIRNAME}/first-dir
22616 # short cut around checking out and committing CVSROOT
22617 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
22618 echo 'PreservePermissions=yes' > ${CVSROOT_DIRNAME}/CVSROOT/config
22619 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
22622 dotest perms-1 "${testcvs} -q co -l ." ''
22624 dotest perms-2 "${testcvs} add first-dir" \
22625 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22630 dotest perms-3 "${testcvs} add foo" \
22631 "${PROG} add: scheduling file .foo. for addition
22632 ${PROG} add: use .${PROG} commit. to add this file permanently"
22633 dotest perms-4 "${testcvs} -q ci -m ''" \
22634 "RCS file: ${CVSROOT_DIRNAME}/first-dir/foo,v
22637 ${CVSROOT_DIRNAME}/first-dir/foo,v <-- foo
22638 initial revision: 1\.1
22641 # Test checking out files with different permissions.
22644 dotest perms-5 "${testcvs} -q co first-dir" "U first-dir/foo"
22646 if $remote; then :; else
22647 # PreservePermissions not yet implemented for remote.
22648 dotest perms-6 "ls -l foo" "-r---wx--x .* foo"
22653 rm -rf ${CVSROOT_DIRNAME}/first-dir
22655 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
22656 touch ${CVSROOT_DIRNAME}/CVSROOT/config
22657 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
22661 # short cut around checking out and committing CVSROOT
22662 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
22663 echo 'PreservePermissions=yes' > ${CVSROOT_DIRNAME}/CVSROOT/config
22664 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
22667 dotest symlinks-1 "${testcvs} -q co -l ." ''
22669 dotest symlinks-2 "${testcvs} add first-dir" \
22670 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22673 dotest symlinks-2.1 "ln -s ${TESTDIR}/fumble slink" ""
22674 dotest symlinks-3 "${testcvs} add slink" \
22675 "${PROG} add: scheduling file .slink. for addition
22676 ${PROG} add: use .${PROG} commit. to add this file permanently"
22678 # Remote doesn't implement PreservePermissions, and in its
22679 # absence the correct behavior is to follow the symlink.
22680 dotest_fail symlinks-4r "${testcvs} -q ci -m ''" \
22681 "${PROG} \[commit aborted\]: reading slink: No such file or directory"
22683 dotest symlinks-4 "${testcvs} -q ci -m ''" \
22684 "RCS file: ${CVSROOT_DIRNAME}/first-dir/slink,v
22687 ${CVSROOT_DIRNAME}/first-dir/slink,v <-- slink
22688 initial revision: 1\.1
22691 # Test checking out symbolic links.
22694 dotest symlinks-5 "${testcvs} -q co first-dir" "U first-dir/slink"
22696 dotest symlinks-6 "ls -l slink" \
22697 "l[rwx\-]* .* slink -> ${TESTDIR}/fumble"
22702 rm -rf ${CVSROOT_DIRNAME}/first-dir
22704 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
22705 touch ${CVSROOT_DIRNAME}/CVSROOT/config
22706 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
22710 # Symlinks in working directory without PreservePermissions.
22711 # Also see: symlinks: with PreservePermissions
22712 # rcslib-symlink-*: symlinks in repository.
22714 dotest symlinks2-1 "${testcvs} -q co -l ." ''
22716 dotest symlinks2-2 "${testcvs} add first-dir" \
22717 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22719 echo nonsymlink > slink
22720 dotest symlinks2-3 "${testcvs} add slink" \
22721 "${PROG} add: scheduling file .slink. for addition
22722 ${PROG} add: use .${PROG} commit. to add this file permanently"
22723 dotest symlinks2-4 "${testcvs} -q ci -m ''" \
22724 "RCS file: ${CVSROOT_DIRNAME}/first-dir/slink,v
22727 ${CVSROOT_DIRNAME}/first-dir/slink,v <-- slink
22728 initial revision: 1\.1
22731 # Choose name cvslog.* so it is in default ignore list.
22732 echo second file >cvslog.file2
22733 dotest symlinks2-5 "ln -s cvslog.file2 slink" ""
22734 dotest symlinks2-6 "${testcvs} -q ci -m linkify" \
22735 "Checking in slink;
22736 ${CVSROOT_DIRNAME}/first-dir/slink,v <-- slink
22737 new revision: 1\.2; previous revision: 1\.1
22739 dotest symlinks2-7 "${testcvs} -q update -r 1.1 slink" "[UP] slink"
22740 dotest symlinks2-8 "cat slink" "nonsymlink"
22741 dotest symlinks2-9 "ls -l slink" "-[-rwx]* .* slink"
22745 rm -rf ${CVSROOT_DIRNAME}/first-dir
22749 # short cut around checking out and committing CVSROOT
22750 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
22751 echo 'PreservePermissions=yes' > ${CVSROOT_DIRNAME}/CVSROOT/config
22752 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
22755 dotest hardlinks-1 "${testcvs} -q co -l ." ''
22757 dotest hardlinks-2 "${testcvs} add first-dir" \
22758 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22761 # Make up some ugly filenames, to test that they get
22762 # encoded properly in the delta nodes. Note that `dotest' screws
22763 # up if some arguments have embedded spaces.
22778 if ln aaaa 'dd dd dd'
22785 dotest hardlinks-3 "${testcvs} add [abd]*" \
22786 "${PROG} add: scheduling file .aaaa. for addition
22787 ${PROG} add: scheduling file .b\.b\.b\.b. for addition
22788 ${PROG} add: scheduling file .dd dd dd. for addition
22789 ${PROG} add: use .${PROG} commit. to add these files permanently"
22790 dotest hardlinks-4 "${testcvs} -q ci -m ''" \
22791 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaaa,v
22794 ${CVSROOT_DIRNAME}/first-dir/aaaa,v <-- aaaa
22795 initial revision: 1\.1
22797 RCS file: ${CVSROOT_DIRNAME}/first-dir/b\.b\.b\.b,v
22799 Checking in b\.b\.b\.b;
22800 ${CVSROOT_DIRNAME}/first-dir/b\.b\.b\.b,v <-- b\.b\.b\.b
22801 initial revision: 1\.1
22803 RCS file: ${CVSROOT_DIRNAME}/first-dir/dd dd dd,v
22805 Checking in dd dd dd;
22806 ${CVSROOT_DIRNAME}/first-dir/dd dd dd,v <-- dd dd dd
22807 initial revision: 1\.1
22809 # Test checking out hardlinked files.
22813 # Remote does not implement PreservePermissions.
22814 dotest hardlinks-5r "${testcvs} -q co first-dir" \
22816 U first-dir/b\.b\.b\.b
22817 U first-dir/dd dd dd"
22819 dotest hardlinks-6r "ls -l [abd]*" \
22820 "-[rwx\-]* *1 .* aaaa
22821 -[rwx\-]* *1 .* b\.b\.b\.b
22822 -[rwx\-]* *1 .* dd dd dd"
22824 dotest hardlinks-5 "${testcvs} -q co first-dir" \
22826 U first-dir/b\.b\.b\.b
22827 U first-dir/dd dd dd"
22829 # To make sure that the files are properly hardlinked, it
22830 # would be nice to do `ls -i' and make sure all the inodes
22831 # match. But I think that would require expr to support
22832 # tagged regexps, and I don't think we can rely on that.
22833 # So instead we just see that each file has the right
22834 # number of links. -twp
22835 dotest hardlinks-6 "ls -l [abd]*" \
22836 "-[rwx\-]* *3 .* aaaa
22837 -[rwx\-]* *3 .* b\.b\.b\.b
22838 -[rwx\-]* *3 .* dd dd dd"
22843 rm -rf ${CVSROOT_DIRNAME}/first-dir
22845 rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
22846 touch ${CVSROOT_DIRNAME}/CVSROOT/config
22847 chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
22851 # More tests of sticky tags, particularly non-branch sticky tags.
22852 # See many tests (e.g. multibranch) for ordinary sticky tag
22853 # operations such as adding files on branches.
22854 # See "head" test for interaction between stick tags and HEAD.
22856 dotest sticky-1 "${testcvs} -q co -l ." ''
22858 dotest sticky-2 "${testcvs} add first-dir" \
22859 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22863 dotest sticky-3 "${testcvs} add file1" \
22864 "${PROG} add: scheduling file .file1. for addition
22865 ${PROG} add: use .${PROG} commit. to add this file permanently"
22866 dotest sticky-4 "${testcvs} -q ci -m add" \
22867 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22870 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
22871 initial revision: 1\.1
22873 dotest sticky-5 "${testcvs} -q tag tag1" "T file1"
22874 echo add a line >>file1
22875 dotest sticky-6 "${testcvs} -q ci -m modify" \
22876 "Checking in file1;
22877 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
22878 new revision: 1\.2; previous revision: 1\.1
22880 dotest sticky-7 "${testcvs} -q update -r tag1" "[UP] file1"
22881 dotest sticky-8 "cat file1" ''
22882 dotest sticky-9 "${testcvs} -q update" ''
22883 dotest sticky-10 "cat file1" ''
22885 dotest_fail sticky-11 "${testcvs} add file2" \
22886 "${PROG} add: cannot add file on non-branch tag tag1"
22887 dotest sticky-12 "${testcvs} -q update -A" "[UP] file1
22888 ${QUESTION} file2" "${QUESTION} file2
22890 dotest sticky-13 "${testcvs} add file2" \
22891 "${PROG} add: scheduling file .file2. for addition
22892 ${PROG} add: use .${PROG} commit. to add this file permanently"
22893 dotest sticky-14 "${testcvs} -q ci -m add" \
22894 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22897 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
22898 initial revision: 1\.1
22902 dotest sticky-15 "${testcvs} -q update -r tag1" "[UP] file1
22903 ${PROG} update: file2 is no longer in the repository"
22906 dotest sticky-16 "${testcvs} rm file1" \
22907 "${PROG} remove: scheduling .file1. for removal
22908 ${PROG} remove: use .${PROG} commit. to remove this file permanently"
22909 # Hmm, this command seems to silently remove the tag from
22910 # the file. This appears to be intentional.
22911 # The silently part especially strikes me as odd, though.
22912 dotest sticky-17 "${testcvs} -q ci -m remove-it" ""
22913 dotest sticky-18 "${testcvs} -q update -A" "U file1
22915 dotest sticky-19 "${testcvs} -q update -r tag1" \
22916 "${PROG} update: file1 is no longer in the repository
22917 ${PROG} update: file2 is no longer in the repository"
22918 dotest sticky-20 "${testcvs} -q update -A" "U file1
22921 # Now try with a numeric revision.
22922 dotest sticky-21 "${testcvs} -q update -r 1.1 file1" "U file1"
22923 dotest sticky-22 "${testcvs} rm -f file1" \
22924 "${PROG} remove: cannot remove file .file1. which has a numeric sticky tag of .1\.1."
22925 # The old behavior was that remove allowed this and then commit
22926 # gave an error, which was somewhat hard to clear. I mean, you
22927 # could get into a long elaborate discussion of this being a
22928 # conflict and two ways to resolve it, but I don't really see
22929 # why CVS should have a concept of conflict that arises, not from
22930 # parallel development, but from CVS's own sticky tags.
22932 # Ditto with a sticky date.
22934 # I'm kind of surprised that the "file1 was lost" doesn't crop
22935 # up elsewhere in the testsuite. It is a long-standing
22936 # discrepency between local and remote CVS and should probably
22937 # be cleaned up at some point.
22938 dotest sticky-23 "${testcvs} -q update -Dnow file1" \
22939 "${PROG} update: warning: file1 was lost
22941 dotest sticky-24 "${testcvs} rm -f file1" \
22942 "${PROG} remove: cannot remove file .file1. which has a sticky date of .[0-9.]*."
22944 dotest sticky-25 "${testcvs} -q update -A" \
22945 "${PROG} update: warning: file1 was lost
22950 rm -rf ${CVSROOT_DIRNAME}/first-dir
22954 # Test keyword expansion.
22955 # Various other tests relate to our ability to correctly
22956 # set the keyword expansion mode.
22957 # "binfiles" tests "cvs admin -k".
22958 # "binfiles" and "binfiles2" test "cvs add -k".
22959 # "rdiff" tests "cvs co -k".
22960 # "binfiles" (and this test) test "cvs update -k".
22961 # "binwrap" tests setting the mode from wrappers.
22962 # "keyword2" tests "cvs update -kk -j" with text and binary files
22963 # I don't think any test is testing "cvs import -k".
22964 # Other keyword expansion tests:
22965 # keywordlog - $Log.
22967 dotest keyword-1 "${testcvs} -q co -l ." ''
22969 dotest keyword-2 "${testcvs} add first-dir" \
22970 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22973 echo '$''Author$' > file1
22974 echo '$''Date$' >> file1
22975 echo '$''Header$' >> file1
22976 echo '$''Id$' >> file1
22977 echo '$''Locker$' >> file1
22978 echo '$''Name$' >> file1
22979 echo '$''RCSfile$' >> file1
22980 echo '$''Revision$' >> file1
22981 echo '$''Source$' >> file1
22982 echo '$''State$' >> file1
22983 echo '$''Nonkey$' >> file1
22984 # Omit the trailing dollar sign
22985 echo '$''Date' >> file1
22986 # Put two keywords on one line
22987 echo '$''State$' '$''State$' >> file1
22988 # Use a header for Log
22989 echo 'xx $''Log$' >> file1
22991 dotest keyword-3 "${testcvs} add file1" \
22992 "${PROG} add: scheduling file .file1. for addition
22993 ${PROG} add: use .${PROG} commit. to add this file permanently"
22994 dotest keyword-4 "${testcvs} -q ci -m add" \
22995 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22998 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
22999 initial revision: 1\.1
23001 dotest keyword-5 "cat file1" \
23002 '\$'"Author: ${username} "'\$'"
23003 "'\$'"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] "'\$'"
23004 "'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
23005 "'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
23006 "'\$'"Locker: "'\$'"
23008 "'\$'"RCSfile: file1,v "'\$'"
23009 "'\$'"Revision: 1\.1 "'\$'"
23010 "'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
23011 "'\$'"State: Exp "'\$'"
23014 "'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
23015 xx "'\$'"Log: file1,v "'\$'"
23016 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
23020 # Use cvs admin to lock the RCS file in order to check -kkvl
23021 # vs. -kkv. CVS does not normally lock RCS files, but some
23022 # people use cvs admin to enforce reserved checkouts.
23023 dotest keyword-6 "${testcvs} admin -l file1" \
23024 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23028 dotest keyword-7 "$testcvs update -kkv file1" '[UP] file1'
23029 dotest keyword-8 "cat file1" \
23030 '\$'"Author: ${username} "'\$'"
23031 "'\$'"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] "'\$'"
23032 "'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
23033 "'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
23034 "'\$'"Locker: "'\$'"
23036 "'\$'"RCSfile: file1,v "'\$'"
23037 "'\$'"Revision: 1\.1 "'\$'"
23038 "'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
23039 "'\$'"State: Exp "'\$'"
23042 "'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
23043 xx "'\$'"Log: file1,v "'\$'"
23044 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
23048 dotest keyword-9 "$testcvs update -kkvl file1" '[UP] file1'
23049 dotest keyword-10 "cat file1" \
23050 '\$'"Author: ${username} "'\$'"
23051 "'\$'"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] "'\$'"
23052 "'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp ${username} "'\$'"
23053 "'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp ${username} "'\$'"
23054 "'\$'"Locker: ${username} "'\$'"
23056 "'\$'"RCSfile: file1,v "'\$'"
23057 "'\$'"Revision: 1\.1 "'\$'"
23058 "'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
23059 "'\$'"State: Exp "'\$'"
23062 "'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
23063 xx "'\$'"Log: file1,v "'\$'"
23064 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
23068 dotest keyword-11 "${testcvs} update -kk file1" '[UP] file1'
23069 dotest keyword-12 "cat file1" \
23076 "'\$'"RCSfile"'\$'"
23077 "'\$'"Revision"'\$'"
23082 "'\$'"State"'\$'" "'\$'"State"'\$'"
23084 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
23088 dotest keyword-13 "$testcvs update -kv file1" '[UP] file1'
23089 dotest keyword-14 "cat file1" \
23091 [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]
23092 ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp
23093 file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp
23098 ${CVSROOT_DIRNAME}/first-dir/file1,v
23104 xx Revision 1\.1 [0-9/]* [0-9:]* ${username}
23108 dotest keyword-15 "${testcvs} update -ko file1" "U file1"
23109 dotest keyword-16 "cat file1" \
23116 "'\$'"RCSfile"'\$'"
23117 "'\$'"Revision"'\$'"
23122 "'\$'"State"'\$'" "'\$'"State"'\$'"
23125 # Test the Name keyword. First go back to normal expansion.
23127 dotest keyword-17 "${testcvs} update -A file1" "U file1"
23129 echo '$''Name$' > file1
23130 dotest keyword-18 "${testcvs} ci -m modify file1" \
23131 "Checking in file1;
23132 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23133 new revision: 1\.2; previous revision: 1\.1
23135 dotest keyword-19 "${testcvs} -q tag tag1" "T file1"
23136 echo "change" >> file1
23137 dotest keyword-20 "${testcvs} -q ci -m mod2 file1" \
23138 "Checking in file1;
23139 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23140 new revision: 1\.3; previous revision: 1\.2
23143 # Prior to 1.11.23, remote CVS would fail the patch checksum test
23144 # and refetch the file here, failing this test.
23145 dotest keyword-21 "$testcvs -q update -r tag1" 'U file1'
23147 dotest keyword-22 "cat file1" '\$'"Name: tag1 "'\$'
23149 # The update used to fail the first time with a checksum failure
23150 # here, then the server would send the whole failure. This was fixed
23152 dotest keyword-23 "$testcvs update -A file1" "U file1"
23153 dotest keyword-24 "cat file1" '\$'"Name: "'\$'"
23158 rm -rf ${CVSROOT_DIRNAME}/first-dir
23162 # Test the Log keyword.
23164 dotest keywordlog-1 "${testcvs} -q co -l ." ''
23166 dotest keywordlog-2 "${testcvs} add first-dir" \
23167 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
23169 echo initial >file1
23170 dotest keywordlog-3 "${testcvs} add file1" \
23171 "${PROG} add: scheduling file .file1. for addition
23172 ${PROG} add: use .${PROG} commit. to add this file permanently"
23174 # See "rmadd" for a list of other tests of cvs ci -r.
23175 dotest keywordlog-4 "${testcvs} -q ci -r 1.3 -m add file1" \
23176 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23179 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23180 initial revision: 1\.3
23185 dotest keywordlog-4a "${testcvs} -q co first-dir" "U first-dir/file1"
23188 echo 'xx $''Log$' >> file1
23189 cat >${TESTDIR}/comment.tmp <<EOF
23193 # As with rmadd-25, "cvs ci -r" sets a sticky tag.
23194 dotest_fail keywordlog-4b \
23195 "${testcvs} ci -F ${TESTDIR}/comment.tmp file1" \
23196 "${PROG} commit: sticky tag .1\.3. for file .file1. is not a branch
23197 ${PROG} \[commit aborted\]: correct above errors first!"
23198 dotest keywordlog-4c "${testcvs} -q update -A" "M file1"
23200 dotest keywordlog-5 "${testcvs} ci -F ${TESTDIR}/comment.tmp file1" \
23201 "Checking in file1;
23202 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23203 new revision: 1\.4; previous revision: 1\.3
23205 rm -f ${TESTDIR}/comment.tmp
23206 dotest keywordlog-6 "${testcvs} -q tag -b br" "T file1"
23207 dotest keywordlog-7 "cat file1" \
23209 xx "'\$'"Log: file1,v "'\$'"
23210 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
23215 cd ../../2/first-dir
23216 dotest keywordlog-8 "${testcvs} -q update" "[UP] file1"
23217 dotest keywordlog-9 "cat file1" \
23219 xx "'\$'"Log: file1,v "'\$'"
23220 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
23224 cd ../../1/first-dir
23226 echo "change" >> file1
23227 dotest keywordlog-10 "${testcvs} ci -m modify file1" \
23228 "Checking in file1;
23229 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23230 new revision: 1\.5; previous revision: 1\.4
23232 dotest keywordlog-11 "cat file1" \
23234 xx "'\$'"Log: file1,v "'\$'"
23235 xx Revision 1\.5 [0-9/]* [0-9:]* ${username}
23238 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
23244 cd ../../2/first-dir
23245 dotest keywordlog-12 "${testcvs} -q update" "[UP] file1"
23246 dotest keywordlog-13 "cat file1" \
23248 xx "'\$'"Log: file1,v "'\$'"
23249 xx Revision 1\.5 [0-9/]* [0-9:]* ${username}
23252 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
23258 cd ../../1/first-dir
23259 dotest keywordlog-14 "${testcvs} -q update -r br" "[UP] file1"
23260 echo br-change >>file1
23261 dotest keywordlog-15 "${testcvs} -q ci -m br-modify" \
23262 "Checking in file1;
23263 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23264 new revision: 1\.4\.2\.1; previous revision: 1\.4
23266 dotest keywordlog-16 "cat file1" \
23268 xx "'\$'"Log: file1,v "'\$'"
23269 xx Revision 1\.4\.2\.1 [0-9/]* [0-9:]* ${username}
23272 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
23277 cd ../../2/first-dir
23278 dotest keywordlog-17 "${testcvs} -q update -r br" "[UP] file1"
23279 dotest keywordlog-18 "cat file1" \
23281 xx "'\$'"Log: file1,v "'\$'"
23282 xx Revision 1\.4\.2\.1 [0-9/]* [0-9:]* ${username}
23285 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
23291 dotest keywordlog-19 "${testcvs} -q co -p -r br first-dir/file1" \
23293 xx "'\$'"Log: file1,v "'\$'"
23294 xx Revision 1\.4\.2\.1 [0-9/]* [0-9:]* ${username}
23297 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
23302 dotest keywordlog-20 "${testcvs} -q co -p first-dir/file1" \
23304 xx "'\$'"Log: file1,v "'\$'"
23305 xx Revision 1\.5 [0-9/]* [0-9:]* ${username}
23308 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
23313 dotest keywordlog-21 "${testcvs} -q co -p -r 1.4 first-dir/file1" \
23315 xx "'\$'"Log: file1,v "'\$'"
23316 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
23322 # OK, the basic rule for keyword expansion is that it
23323 # happens on checkout. And the rule for annotate is that
23324 # it annotates a checked-in revision, rather than a checked-out
23325 # file. So, although it is kind of confusing that the latest
23326 # revision does not appear in the annotated output, and the
23327 # annotated output does not quite match what you'd get with
23328 # update or checkout, the behavior is more or less logical.
23329 # The same issue occurs with annotate and other keywords,
23330 # I think, although it is particularly noticeable for $Log.
23331 dotest keywordlog-22 "${testcvs} ann -r br file1" \
23333 Annotations for file1
23334 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
23335 1\.3 ($username8 *[0-9a-zA-Z-]*): initial
23336 1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'"
23337 1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): xx Revision 1\.4 [0-9/]* [0-9:]* $username
23338 1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): xx First log line
23339 1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): xx Second log line
23340 1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): xx
23341 1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): br-change"
23342 dotest keywordlog-23 "${testcvs} ann -r HEAD file1" \
23344 Annotations for file1
23345 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
23346 1\.3 ($username8 *[0-9a-zA-Z-]*): initial
23347 1\.5 ($username8 *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'"
23348 1\.5 ($username8 *[0-9a-zA-Z-]*): xx Revision 1\.4 [0-9/]* [0-9:]* $username
23349 1\.5 ($username8 *[0-9a-zA-Z-]*): xx First log line
23350 1\.5 ($username8 *[0-9a-zA-Z-]*): xx Second log line
23351 1\.5 ($username8 *[0-9a-zA-Z-]*): xx
23352 1\.5 ($username8 *[0-9a-zA-Z-]*): change"
23356 # test the operation of 'admin -o' in conjunction with keywords
23357 # (especially Log - this used to munge the RCS file for all time)
23360 dotest keywordlog-24 \
23361 "${testcvs} admin -oHEAD 1/first-dir/file1" \
23362 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23363 deleting revision 1\.5
23366 dotest keywordlog-25 \
23367 "${testcvs} -q co -p first-dir/file1" \
23369 xx "'\$'"Log: file1,v "'\$'"
23370 xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
23376 echo Keeping ${TESTDIR} and exiting due to --keep
23381 rm -rf ${CVSROOT_DIRNAME}/first-dir
23385 # Test the Name keyword.
23386 # See the keyword test for a descriptions of some other tests that
23387 # test keyword expansion modes.
23388 mkdir keywordname; cd keywordname
23390 dotest keywordname-init-1 "${testcvs} -q co -l ." ''
23392 dotest keywordname-init-2 "${testcvs} add first-dir" \
23393 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
23396 echo '$'"Name$" >file1
23397 echo '$'"Name$" >file2
23398 dotest keywordname-init-3 "${testcvs} add file1 file2" \
23399 "${PROG} add: scheduling file .file1. for addition
23400 ${PROG} add: scheduling file .file2. for addition
23401 ${PROG} add: use .${PROG} commit. to add these files permanently"
23403 # See "rmadd" for a list of other tests of cvs ci -r.
23404 dotest keywordname-init-4 "${testcvs} -q ci -r 1.3 -m add" \
23405 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23408 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23409 initial revision: 1\.3
23411 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
23414 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
23415 initial revision: 1\.3
23417 dotest keywordname-init-5b "cat file1" \
23419 dotest keywordname-init-5c "cat file2" \
23422 dotest keywordname-init-6 "$testcvs -q up -A"
23423 dotest keywordname-init-6b "cat file1" \
23425 dotest keywordname-init-6c "cat file2" \
23428 dotest keywordname-init-7 "${testcvs} -q tag -b br" \
23432 echo new data >>file1
23433 dotest keywordname-init-8 "${testcvs} -q ci -mchange" \
23434 "Checking in file1;
23435 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23436 new revision: 1\.4; previous revision: 1\.3
23439 # First check out a branch.
23441 # There used to be a bug where static tags would be substituted for
23442 # Name keywords but not branch tags.
23444 # Prior to 1.11.23, there also used to be a bug where keyword
23445 # substitutions were not performed unless the file was otherwise
23446 # updated. When this bug was present, keywordname-update-1 would
23447 # report a patch checksum failure and refetch file1 in client/server
23448 # mode and no `br' would have been substituted into Name's value for
23449 # file2, meaning keywordname-update-3 would also fail.
23450 dotest keywordname-update-1 "$testcvs -q up -rbr" \
23453 dotest keywordname-update-2 "cat file1" '\$''Name: br \$'
23455 # For the same reason keywordname-update-1 would fail above, no `br'
23456 # would have been substituted into Name's value here prior to
23458 dotest keywordname-update-3 "cat file2" '\$''Name: br \$'
23460 # Now verify that updating to the trunk leaves no substitution for
23462 dotest keywordname-update-4 "${testcvs} -q tag firsttag" \
23465 # This used to fail in the same manner as keywordname-update-1.
23466 dotest keywordname-update-5 "$testcvs -q up -A" \
23469 dotest keywordname-update-6 "cat file1" \
23472 dotest keywordname-update-7 "cat file2" '\$''Name: \$'
23474 # This used to fail in the same manner as keywordname-update-1.
23475 dotest keywordname-update-8 "$testcvs -q up -rfirsttag" \
23478 dotest keywordname-update-9 "cat file1" '\$''Name: firsttag \$'
23480 # This used to fail in the same manner as keywordname-update-3.
23481 dotest keywordname-update-10 "cat file2" '\$''Name: firsttag \$'
23483 # And reverify the trunk update when the change is actually removed.
23484 dotest keywordname-update-11 "$testcvs -q up -A" \
23487 dotest keywordname-update-12 "cat file1" \
23490 dotest keywordname-update-13 "cat file2" '\$''Name: \$'
23494 # now verify that a fresh checkout substitutes all the $Name fields
23496 dotest keywordname-checkout-1 \
23497 "${testcvs} -q co -rfirsttag first-dir" \
23501 dotest keywordname-checkout-2 "cat file1" '\$'"Name: firsttag "'\$'
23502 dotest keywordname-checkout-3 "cat file2" '\$'"Name: firsttag "'\$'
23507 echo Keeping ${TESTDIR} and exiting due to --keep
23513 rm -rf ${CVSROOT_DIRNAME}/first-dir
23517 # Test merging on files with keywords:
23522 # Note: This test assumes that CVS has already passed the binfiles
23524 # Note2: We are testing positive on binary corruption here
23525 # we probably really DON'T want to 'cvs update -kk' a binary file...
23527 dotest keyword2-1 "${testcvs} -q co -l ." ''
23529 dotest keyword2-2 "${testcvs} add first-dir" \
23530 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
23533 echo '$''Revision$' >> file1
23535 echo "like" >>file1
23536 echo "long" >>file1
23537 echo "files!" >>file1
23539 echo "a test line for our times" >>file1
23541 echo "They" >>file1
23542 echo "make" >>file1
23543 echo "diff" >>file1
23544 echo "look like it" >>file1
23545 echo "did a much better" >>file1
23546 echo "job." >>file1
23547 dotest keyword2-3 "${testcvs} add file1" \
23548 "${PROG} add: scheduling file .file1. for addition
23549 ${PROG} add: use .${PROG} commit. to add this file permanently"
23551 ${AWK} 'BEGIN { printf "%c%c%c%sRevision: 1.1 $@%c%c", \
23552 2, 10, 137, "$", 13, 10 }' \
23553 </dev/null | ${TR} '@' '\000' >../binfile.dat
23554 cp ../binfile.dat .
23555 dotest keyword2-5 "${testcvs} add -kb binfile.dat" \
23556 "${PROG} add: scheduling file .binfile\.dat. for addition
23557 ${PROG} add: use .${PROG} commit. to add this file permanently"
23559 dotest keyword2-6 "${testcvs} -q ci -m add" \
23560 "RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v
23562 Checking in binfile\.dat;
23563 ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
23564 initial revision: 1\.1
23566 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23569 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23570 initial revision: 1\.1
23573 dotest keyword2-7 "${testcvs} -q tag -b branch" \
23577 sed -e 's/our/the best of and the worst of/' file1 >f; mv f file1
23578 dotest keyword2-8 "${testcvs} -q ci -m change" \
23579 "Checking in file1;
23580 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23581 new revision: 1\.2; previous revision: 1\.1
23584 dotest keyword2-9 "$testcvs -q update -r branch" \
23588 echo "what else do we have?" >>file1
23589 dotest keyword2-10 "${testcvs} -q ci -m change" \
23590 "Checking in file1;
23591 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23592 new revision: 1\.1\.2\.1; previous revision: 1\.1
23595 # Okay, first a conflict in file1 - should be okay with binfile.dat
23596 dotest keyword2-11 "$testcvs -q update -A -j branch" \
23599 RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
23600 retrieving revision 1\.1
23601 retrieving revision 1\.1\.2\.1
23602 Merging differences between 1\.1 and 1\.1\.2\.1 into file1
23603 rcsmerge: warning: conflicts during merge"
23605 dotest_fail keyword2-12 "${testcvs} diff file1" \
23607 ===================================================================
23608 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23609 retrieving revision 1\.2
23615 > \\\$""Revision: 1\.1\.2\.1 \\\$
23616 > >>>>>>> 1\.1\.2\.1
23618 > what else do we have${QUESTION}"
23620 # Here's the problem... shouldn't -kk a binary file...
23622 dotest keyword2-13 "${testcvs} -q update -A -kk -j branch" \
23623 "${PROG} update: warning: file1 was lost
23625 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23626 retrieving revision 1\.1
23627 retrieving revision 1\.1\.2\.1
23628 Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
23630 # binfile won't get checked in, but it is now corrupt and could
23631 # have been checked in if it had changed on the branch...
23632 dotest keyword2-14 "${testcvs} -q ci -m change" \
23633 "Checking in file1;
23634 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23635 new revision: 1\.3; previous revision: 1\.2
23638 # "-kk" no longer corrupts binary files
23639 dotest keyword2-15 "cmp binfile.dat ../binfile.dat" ''
23641 # Okay, restore everything and make CVS try and merge a binary file...
23642 # "-kk" no longer affects binary files
23643 dotest keyword2-16 "${testcvs} -q update -A" \
23645 dotest keyword2-17 "${testcvs} -q tag -b branch2" \
23648 dotest keyword2-18 "$testcvs -q update -r branch2" \
23652 ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
23653 </dev/null | ${TR} '@' '\000' >>binfile.dat
23654 dotest keyword2-19 "${testcvs} -q ci -m badbadbad" \
23655 "Checking in binfile\.dat;
23656 ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
23657 new revision: 1\.1\.4\.1; previous revision: 1\.1
23659 # "-kk" no longer affects binary files
23661 # XXXX: do not ask, why we get the "U binfile.dat" line twice
23662 # looks like a bug!
23663 dotest keyword2-20 "${testcvs} -q update -A -kk -j branch2" \
23670 rm -rf ${CVSROOT_DIRNAME}/first-dir
23674 # Testing handling of the HEAD special tag.
23675 # There are many cases involving added and removed files
23676 # which we don't yet try to deal with.
23677 # TODO: We also could be paying much closer attention to
23678 # "head of the trunk" versus "head of the default branch".
23679 # That is what "cvs import" is doing here (but I didn't really
23680 # fully follow through on writing the tests for that case).
23683 echo 'imported contents' >file1
23684 # It may seem like we don't do much with file2, but do note that
23685 # the "cvs diff" invocations do also diff file2 (and come up empty).
23686 echo 'imported contents' >file2
23687 dotest_sort head-1 "${testcvs} import -m add first-dir tag1 tag2" \
23692 No conflicts created by this import"
23697 dotest head-2 "${testcvs} -q co first-dir" \
23701 echo 'add a line on trunk' >> file1
23702 dotest head-3 "${testcvs} -q ci -m modify" \
23703 "Checking in file1;
23704 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23705 new revision: 1\.2; previous revision: 1\.1
23707 dotest head-4 "${testcvs} -q tag trunktag" "T file1
23709 echo 'add a line on trunk after trunktag' >> file1
23710 dotest head-5 "${testcvs} -q ci -m modify" \
23711 "Checking in file1;
23712 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23713 new revision: 1\.3; previous revision: 1\.2
23715 dotest head-6 "${testcvs} -q tag -b br1" "T file1
23717 dotest head-7 "$testcvs -q update -r br1" \
23720 echo 'modify on branch' >>file1
23721 dotest head-8 "${testcvs} -q ci -m modify" \
23722 "Checking in file1;
23723 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23724 new revision: 1\.3\.2\.1; previous revision: 1\.3
23726 dotest head-9 "${testcvs} -q tag brtag" "T file1
23728 echo 'modify on branch after brtag' >>file1
23729 dotest head-10 "${testcvs} -q ci -m modify" \
23730 "Checking in file1;
23731 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23732 new revision: 1\.3\.2\.2; previous revision: 1\.3\.2\.1
23734 # With no sticky tags, HEAD is the head of the trunk.
23735 dotest head-trunk-setup "$testcvs -q update -A" \
23738 dotest head-trunk-update "${testcvs} -q update -r HEAD -p file1" \
23740 add a line on trunk
23741 add a line on trunk after trunktag"
23742 # and diff thinks so too. Case (a) from the comment in
23743 # cvs.texinfo (Common options).
23744 dotest_fail head-trunk-diff "${testcvs} -q diff -c -r HEAD -r br1" \
23746 ===================================================================
23747 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23748 retrieving revision 1\.3
23749 retrieving revision 1\.3\.2\.2
23750 diff -c -r1\.3 -r1\.3\.2\.2
23751 \*\*\* file1 ${RFCDATE} 1\.3
23752 --- file1 ${RFCDATE} 1\.3\.2\.2
23753 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
23754 \*\*\* 1,3 \*\*\*\*
23757 add a line on trunk
23758 add a line on trunk after trunktag
23759 ${PLUS} modify on branch
23760 ${PLUS} modify on branch after brtag"
23762 # With a branch sticky tag, HEAD is the head of the trunk.
23763 dotest head-br1-setup "$testcvs -q update -r br1" \
23766 dotest head-br1-update "${testcvs} -q update -r HEAD -p file1" \
23768 add a line on trunk
23769 add a line on trunk after trunktag"
23770 # But diff thinks that HEAD is "br1". Case (b) from cvs.texinfo.
23771 # Probably people are relying on it.
23772 dotest head-br1-diff "${testcvs} -q diff -c -r HEAD -r br1" ""
23774 # With a nonbranch sticky tag on a branch,
23775 # HEAD is the head of the trunk
23776 dotest head-brtag-setup "$testcvs -q update -r brtag" \
23779 dotest head-brtag-update "${testcvs} -q update -r HEAD -p file1" \
23781 add a line on trunk
23782 add a line on trunk after trunktag"
23784 # CVS 1.9 and older thought that HEAD is "brtag" (this was
23785 # noted as "strange, maybe accidental"). But "br1" makes a
23786 # whole lot more sense.
23787 dotest head-brtag-diff "${testcvs} -q diff -c -r HEAD -r br1" ""
23789 # With a nonbranch sticky tag on the trunk, HEAD is the head
23790 # of the trunk, I think.
23791 dotest head-trunktag-setup "$testcvs -q update -r trunktag" \
23794 dotest head-trunktag-check "cat file1" "imported contents
23795 add a line on trunk"
23796 dotest head-trunktag-update "${testcvs} -q update -r HEAD -p file1" \
23798 add a line on trunk
23799 add a line on trunk after trunktag"
23800 # Like head-brtag-diff, there is a non-branch sticky tag.
23801 dotest_fail head-trunktag-diff \
23802 "${testcvs} -q diff -c -r HEAD -r br1" \
23804 ===================================================================
23805 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23806 retrieving revision 1\.3
23807 retrieving revision 1\.3\.2\.2
23808 diff -c -r1\.3 -r1\.3\.2\.2
23809 \*\*\* file1 ${RFCDATE} 1\.3
23810 --- file1 ${RFCDATE} 1\.3\.2\.2
23811 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
23812 \*\*\* 1,3 \*\*\*\*
23815 add a line on trunk
23816 add a line on trunk after trunktag
23817 ${PLUS} modify on branch
23818 ${PLUS} modify on branch after brtag"
23820 # Also might test what happens if we setup with update -r
23821 # HEAD. In general, if sticky tags matter, does the
23822 # behavior of "update -r <foo>" (without -p) depend on the
23823 # sticky tags before or after the update?
23825 # Note that we are testing both the case where this deletes
23826 # a revision (file1) and the case where it does not (file2)
23827 dotest_fail head-o0a "${testcvs} admin -o ::br1" \
23828 "${PROG} admin: Administrating \.
23829 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23830 ${PROG} admin: cannot remove revision 1\.3\.2\.1 because it has tags
23831 ${PROG} admin: RCS file for .file1. not modified\.
23832 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
23834 dotest head-o0b "${testcvs} tag -d brtag" \
23835 "${PROG} tag: Untagging \.
23838 dotest head-o1 "${testcvs} admin -o ::br1" \
23839 "${PROG} admin: Administrating \.
23840 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23841 deleting revision 1\.3\.2\.1
23843 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
23847 rm -rf ${CVSROOT_DIRNAME}/first-dir
23851 # Test combining -r and -D.
23853 # Note that this is not a complete test. It relies on the fact
23854 # that update, checkout and export have a LOT of shared code.
23856 # 1) checkout is never tested at all with -r -D
23857 # 2) update never uses an argument to '-D' besides 'now'
23858 # (this test does not provide enough data to prove
23859 # that 'cvs update' with both a '-r' and a '-D'
23860 # specified does not ignore '-D': a 'cvs up
23861 # -r<branch> -Dnow' and a 'cvs up -r<branch>'
23862 # should specify the same file revision).
23863 # 3) export uses '-r<branch> -D<when there was a different
23864 # revision>', hopefully completing this behavior test
23865 # for checkout and update as well.
23870 dotest tagdate-1 "${testcvs} -q co -l ." ''
23872 dotest tagdate-2 "${testcvs} add first-dir" \
23873 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
23876 echo trunk-1 >file1
23877 dotest tagdate-3 "${testcvs} add file1" \
23878 "${PROG} add: scheduling file .file1. for addition
23879 ${PROG} add: use .${PROG} commit. to add this file permanently"
23880 dotest tagdate-4 "${testcvs} -q ci -m add" \
23881 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23884 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23885 initial revision: 1\.1
23887 date_T1=`getrlogdate -r1.1 first-dir/file1`
23889 dotest tagdate-5 "${testcvs} -q tag -b br1" "T file1"
23890 dotest tagdate-6 "${testcvs} -q tag -b br2" "T file1"
23891 echo trunk-2 >file1
23892 dotest tagdate-7 "${testcvs} -q ci -m modify-on-trunk" \
23893 "Checking in file1;
23894 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23895 new revision: 1\.2; previous revision: 1\.1
23897 date_T2=`getrlogdate -r1.2 first-dir/file1`
23899 # We are testing -r -D where br1 is a (magic) branch without
23900 # any revisions. First the case where br2 doesn't have any
23901 # revisions either:
23902 dotest tagdate-8 "${testcvs} -q update -p -r br1 -D now" "trunk-1"
23903 dotest tagdate-9 "${testcvs} -q update -r br2" "[UP] file1"
23905 dotest tagdate-10 "${testcvs} -q ci -m modify-on-br2" \
23906 "Checking in file1;
23907 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23908 new revision: 1\.1\.4\.1; previous revision: 1\.1
23910 date_T3=`getrlogdate -r1.1.4.1 first-dir/file1`
23912 # Then the case where br2 does have revisions:
23913 dotest tagdate-11 "${testcvs} -q update -p -r br1 -D now" "trunk-1"
23915 # For some reason, doing this on a branch seems to be relevant.
23916 dotest_fail tagdate-12 "${testcvs} -q update -j:yesterday" \
23917 "${PROG} \[update aborted\]: argument to join may not contain a date specifier without a tag"
23921 dotest tagdate-13 "${testcvs} -q ci -m modify-2-on-br2" \
23922 "Checking in file1;
23923 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
23924 new revision: 1\.1\.4\.2; previous revision: 1\.1\.4\.1
23926 date_T4=`getrlogdate -r1.1.4.2 first-dir/file1`
23930 dotest tagdate-14 "${testcvs} -q export -r br2 -D'$date_T3' first-dir" \
23931 "[UP] first-dir/file1"
23932 dotest tagdate-15 "cat first-dir/file1" "br2-1"
23936 dotest tagdate-16 "${testcvs} annotate -rbr2 -D'$date_T3'" \
23938 Annotations for file1
23939 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
23940 1\.1\.4\.1 ($username8 *[0-9a-zA-Z-]*): br2-1"
23942 dotest tagdate-17 "${testcvs} annotate -rbr2 -Dnow" \
23944 Annotations for file1
23945 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
23946 1\.1\.4\.2 ($username8 *[0-9a-zA-Z-]*): br2-2"
23948 # Now check to see what happens when we add files to br2 and trunk
23950 dotest tagdate-18 "${testcvs} add file3" \
23951 "${PROG} add: scheduling file \`file3' for addition on branch \`br2'
23952 ${PROG} add: use .${PROG} commit. to add this file permanently"
23953 dotest tagdate-19 "${testcvs} -q ci -m add file3" \
23954 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
23957 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
23958 new revision: 1\.1\.2\.1; previous revision: 1\.1
23960 date_T5=`getrlogdate -r1.1 first-dir/file3`
23961 date_T6=`getrlogdate -r1.1.2.1 first-dir/file3`
23965 dotest tagdate-20 "${testcvs} -Q co first-dir" ''
23967 echo trunk-1 > file2
23968 dotest tagdate-21 "${testcvs} add file2" \
23969 "${PROG} add: scheduling file .file2. for addition
23970 ${PROG} add: use .${PROG} commit. to add this file permanently"
23971 dotest tagdate-22 "${testcvs} -q ci -m add file2" \
23972 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
23975 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
23976 initial revision: 1\.1
23978 date_T7=`getrlogdate -r1.1 first-dir/file2`
23979 echo "trunk-2" >file2
23980 dotest tagdate-23 "${testcvs} -q ci -m update file2" \
23981 "Checking in file2;
23982 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
23983 new revision: 1\.2; previous revision: 1\.1
23985 date_T8=`getrlogdate -r1.2 first-dir/file2`
23987 cd ../../1/first-dir
23989 dotest tagdate-24 "${testcvs} add file2" \
23990 "${PROG} add: scheduling file \`file2' for addition on branch \`br2'
23991 ${PROG} add: use .${PROG} commit. to add this file permanently"
23992 dotest tagdate-25 "${testcvs} -q ci -m add file2" \
23993 "Checking in file2;
23994 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
23995 new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
23997 date_T9=`getrlogdate -r1.2.2.2 first-dir/file2`
24000 # Time Rev Branch Comments
24001 # T0 trunk first-dir created
24002 # T1 1.1 trunk first-dir/file1 committed "trunk-1"
24003 # br1 branch created
24004 # br2 branch created
24005 # T2 1.2 trunk first-dir/file1 committed "trunk-2"
24006 # T3 1.1.4.1 br2 first-dir/file1 committed "br2-1"
24008 # T4 1.1.4.2 br2 first-dir/file1 committed "br2-2"
24009 # T5 1.1 trunk first-dir/file3 dead
24010 # T6 1.1.2.1 br2 first-dir/file3 committed "br2-1"
24011 # T7 1.1 trunk first-dir/file2 committed "trunk-1"
24012 # T8 1.2 trunk first-dir/file2 committed "trunk-2"
24013 # T8 1.2.2.1 br2 first-dir/file2 dead
24014 # T9 1.2.2.2 br2 first-dir/file2 committed "br2-1"
24018 (echo Dates for tagdate-26-* are:;\
24019 echo " date_T1='$date_T1'";\
24020 echo " date_T2='$date_T2'";\
24021 echo " date_T3='$date_T3'";\
24022 echo " date_T4='$date_T4'";\
24023 echo " date_T5='$date_T5'";\
24024 echo " date_T6='$date_T6'";\
24025 echo " date_T7='$date_T7'";\
24026 echo " date_T8='$date_T8'";\
24027 echo " date_T9='$date_T9'") >>$LOGFILE
24028 dotest tagdate-26-trunk-t1 \
24029 "${testcvs} co -D'$date_T1' -d first-dir-trunk-t1 first-dir" \
24030 "${PROG} checkout: Updating first-dir-trunk-t1
24031 U first-dir-trunk-t1/file1"
24032 dotest tagdate-26-br2-t1 \
24033 "${testcvs} co -r br2 -D'$date_T1' -d first-dir-br2-t1 first-dir" \
24034 "${PROG} checkout: Updating first-dir-br2-t1
24035 U first-dir-br2-t1/file1"
24036 dotest tagdate-26-trunk-t2 \
24037 "${testcvs} co -D'$date_T2' -d first-dir-trunk-t2 first-dir" \
24038 "${PROG} checkout: Updating first-dir-trunk-t2
24039 U first-dir-trunk-t2/file1"
24040 dotest tagdate-26-br2-t2 \
24041 "${testcvs} co -r br2 -D'$date_T2' -d first-dir-br2-t2 first-dir" \
24042 "${PROG} checkout: Updating first-dir-br2-t2
24043 U first-dir-br2-t2/file1"
24044 dotest tagdate-26-br2-t3 \
24045 "${testcvs} co -r br2 -D'$date_T3' -d first-dir-br2-t3 first-dir" \
24046 "${PROG} checkout: Updating first-dir-br2-t3
24047 U first-dir-br2-t3/file1"
24048 dotest tagdate-26-br2-t4 \
24049 "${testcvs} co -r br2 -D'$date_T4' -d first-dir-br2-t4 first-dir" \
24050 "${PROG} checkout: Updating first-dir-br2-t4
24051 U first-dir-br2-t4/file1"
24052 dotest tagdate-26-br2-t6 \
24053 "${testcvs} co -r br2 -D'$date_T6' -d first-dir-br2-t6 first-dir" \
24054 "${PROG} checkout: Updating first-dir-br2-t6
24055 U first-dir-br2-t6/file1
24056 U first-dir-br2-t6/file3"
24057 dotest tagdate-26-trunk-t7 \
24058 "${testcvs} co -D'$date_T7' -d first-dir-trunk-t7 first-dir" \
24059 "${PROG} checkout: Updating first-dir-trunk-t7
24060 U first-dir-trunk-t7/file1
24061 U first-dir-trunk-t7/file2"
24062 dotest tagdate-26-br2-t7 \
24063 "${testcvs} co -r br2 -D'$date_T7' -d first-dir-br2-t7 first-dir" \
24064 "${PROG} checkout: Updating first-dir-br2-t7
24065 U first-dir-br2-t7/file1
24066 U first-dir-br2-t7/file3"
24067 dotest tagdate-26-trunk-t8 \
24068 "${testcvs} co -D'$date_T8' -d first-dir-trunk-t8 first-dir" \
24069 "${PROG} checkout: Updating first-dir-trunk-t8
24070 U first-dir-trunk-t8/file1
24071 U first-dir-trunk-t8/file2"
24072 dotest tagdate-26-br2-t8 \
24073 "${testcvs} co -r br2 -D'$date_T8' -d first-dir-br2-t8 first-dir" \
24074 "${PROG} checkout: Updating first-dir-br2-t8
24075 U first-dir-br2-t8/file1
24076 U first-dir-br2-t8/file3"
24077 dotest tagdate-26-br2-t9 \
24078 "${testcvs} co -r br2 -D'$date_T9' -d first-dir-br2-t9 first-dir" \
24079 "${PROG} checkout: Updating first-dir-br2-t9
24080 U first-dir-br2-t9/file1
24081 U first-dir-br2-t9/file2
24082 U first-dir-br2-t9/file3"
24083 dotest tagdate-27-trunk-t1 \
24084 "${testcvs} status first-dir-trunk-t1" \
24085 "${PROG} status: Examining first-dir-trunk-t1
24086 ===================================================================
24087 File: file1 Status: Up-to-date
24089 Working revision: 1\.1[^.]*
24090 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
24092 Sticky Date: [0-9.]*
24093 Sticky Options: (none)"
24094 dotest tagdate-27-br2-t1 \
24095 "${testcvs} status first-dir-br2-t1" \
24096 "${PROG} status: Examining first-dir-br2-t1
24097 ===================================================================
24098 File: file1 Status: Needs Patch
24100 Working revision: 1\.1[^.]*
24101 Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24102 Sticky Tag: br2 (branch: 1\.1\.4)
24103 Sticky Date: (none)
24104 Sticky Options: (none)"
24105 dotest tagdate-27-trunk-t2 \
24106 "${testcvs} status first-dir-trunk-t2" \
24107 "${PROG} status: Examining first-dir-trunk-t2
24108 ===================================================================
24109 File: file1 Status: Up-to-date
24111 Working revision: 1\.2[^.]*
24112 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24114 Sticky Date: [0-9.]*
24115 Sticky Options: (none)"
24116 dotest tagdate-27-br2-t2 \
24117 "${testcvs} status first-dir-br2-t2" \
24118 "${PROG} status: Examining first-dir-br2-t2
24119 ===================================================================
24120 File: file1 Status: Needs Patch
24122 Working revision: 1\.1[^.]*
24123 Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24124 Sticky Tag: br2 (branch: 1\.1\.4)
24125 Sticky Date: (none)
24126 Sticky Options: (none)"
24127 dotest tagdate-27-br2-t3 \
24128 "${testcvs} status first-dir-br2-t3" \
24129 "${PROG} status: Examining first-dir-br2-t3
24130 ===================================================================
24131 File: file1 Status: Needs Patch
24133 Working revision: 1\.1\.4\.1[^.]*
24134 Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24135 Sticky Tag: br2 (branch: 1\.1\.4)
24136 Sticky Date: (none)
24137 Sticky Options: (none)"
24138 dotest tagdate-27-br2-t4 \
24139 "${testcvs} status first-dir-br2-t4" \
24140 "${PROG} status: Examining first-dir-br2-t4
24141 ===================================================================
24142 File: file1 Status: Up-to-date
24144 Working revision: 1\.1\.4\.2[^.]*
24145 Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24146 Sticky Tag: br2 (branch: 1\.1\.4)
24147 Sticky Date: (none)
24148 Sticky Options: (none)"
24149 dotest tagdate-27-br2-t6 \
24150 "${testcvs} status first-dir-br2-t6" \
24151 "${PROG} status: Examining first-dir-br2-t6
24152 ===================================================================
24153 File: file1 Status: Up-to-date
24155 Working revision: 1\.1\.4\.2[^.]*
24156 Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24157 Sticky Tag: br2 (branch: 1\.1\.4)
24158 Sticky Date: (none)
24159 Sticky Options: (none)
24161 ===================================================================
24162 File: file3 Status: Up-to-date
24164 Working revision: 1\.1\.2\.1[^.]*
24165 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
24166 Sticky Tag: br2 (branch: 1\.1\.2)
24167 Sticky Date: (none)
24168 Sticky Options: (none)"
24169 dotest tagdate-27-trunk-t7 \
24170 "${testcvs} status first-dir-trunk-t7" \
24171 "${PROG} status: Examining first-dir-trunk-t7
24172 ===================================================================
24173 File: file1 Status: Up-to-date
24175 Working revision: 1\.2[^.]*
24176 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24178 Sticky Date: [0-9.]*
24179 Sticky Options: (none)
24181 ===================================================================
24182 File: file2 Status: Up-to-date
24184 Working revision: 1\.1[^.]*
24185 Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
24187 Sticky Date: [0-9.]*
24188 Sticky Options: (none)"
24189 dotest tagdate-27-br2-t7 \
24190 "${testcvs} status first-dir-br2-t7" \
24191 "${PROG} status: Examining first-dir-br2-t7
24192 ===================================================================
24193 File: file1 Status: Up-to-date
24195 Working revision: 1\.1\.4\.2[^.]*
24196 Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24197 Sticky Tag: br2 (branch: 1\.1\.4)
24198 Sticky Date: (none)
24199 Sticky Options: (none)
24201 ===================================================================
24202 File: file3 Status: Up-to-date
24204 Working revision: 1\.1\.2\.1[^.]*
24205 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
24206 Sticky Tag: br2 (branch: 1\.1\.2)
24207 Sticky Date: (none)
24208 Sticky Options: (none)"
24209 dotest tagdate-27-trunk-t8 \
24210 "${testcvs} status first-dir-trunk-t8" \
24211 "${PROG} status: Examining first-dir-trunk-t8
24212 ===================================================================
24213 File: file1 Status: Up-to-date
24215 Working revision: 1\.2[^.]*
24216 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24218 Sticky Date: [0-9.]*
24219 Sticky Options: (none)
24221 ===================================================================
24222 File: file2 Status: Up-to-date
24224 Working revision: 1\.2[^.]*
24225 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file2,v
24227 Sticky Date: [0-9.]*
24228 Sticky Options: (none)"
24229 dotest tagdate-27-br2-t8 \
24230 "${testcvs} status first-dir-br2-t8" \
24231 "${PROG} status: Examining first-dir-br2-t8
24232 ===================================================================
24233 File: file1 Status: Up-to-date
24235 Working revision: 1\.1\.4\.2[^.]*
24236 Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24237 Sticky Tag: br2 (branch: 1\.1\.4)
24238 Sticky Date: (none)
24239 Sticky Options: (none)
24241 ===================================================================
24242 File: file3 Status: Up-to-date
24244 Working revision: 1\.1\.2\.1[^.]*
24245 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
24246 Sticky Tag: br2 (branch: 1\.1\.2)
24247 Sticky Date: (none)
24248 Sticky Options: (none)"
24249 dotest tagdate-27-br2-t9 \
24250 "${testcvs} status first-dir-br2-t9" \
24251 "${PROG} status: Examining first-dir-br2-t9
24252 ===================================================================
24253 File: file1 Status: Up-to-date
24255 Working revision: 1\.1\.4\.2[^.]*
24256 Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
24257 Sticky Tag: br2 (branch: 1\.1\.4)
24258 Sticky Date: (none)
24259 Sticky Options: (none)
24261 ===================================================================
24262 File: file2 Status: Up-to-date
24264 Working revision: 1\.2\.2\.2[^.]*
24265 Repository revision: 1\.2\.2\.2 ${CVSROOT_DIRNAME}/first-dir/file2,v
24266 Sticky Tag: br2 (branch: 1\.2\.2)
24267 Sticky Date: (none)
24268 Sticky Options: (none)
24270 ===================================================================
24271 File: file3 Status: Up-to-date
24273 Working revision: 1\.1\.2\.1[^.]*
24274 Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
24275 Sticky Tag: br2 (branch: 1\.1\.2)
24276 Sticky Date: (none)
24277 Sticky Options: (none)"
24279 # Now check the contents of the files
24280 dotest tagdate-28-trunk-t1 'cat first-dir-trunk-t1/file1' 'trunk-1'
24281 dotest tagdate-28-br2-t1 'cat first-dir-br2-t1/file1' 'trunk-1'
24282 dotest tagdate-28-trunk-t2 'cat first-dir-trunk-t2/file1' 'trunk-2'
24283 dotest tagdate-28-br2-t2 'cat first-dir-br2-t2/file1' 'trunk-1'
24284 dotest tagdate-28-br2-t3 'cat first-dir-br2-t3/file1' 'br2-1'
24285 dotest tagdate-28-br2-t4 'cat first-dir-br2-t4/file1' 'br2-2'
24286 dotest tagdate-28-br2-t6a 'cat first-dir-br2-t6/file1' "br2-2"
24287 dotest tagdate-28-br2-t6b 'cat first-dir-br2-t6/file3' "br2-1"
24288 dotest tagdate-28-trunk-t7a 'cat first-dir-trunk-t7/file1' "trunk-2"
24289 dotest tagdate-28-trunk-t7b 'cat first-dir-trunk-t7/file2' "trunk-1"
24290 dotest tagdate-28-br2-t7a 'cat first-dir-br2-t7/file1' "br2-2"
24291 dotest tagdate-28-br2-t7b 'cat first-dir-br2-t7/file3' "br2-1"
24292 dotest tagdate-28-trunk-t8a 'cat first-dir-trunk-t8/file1' "trunk-2"
24293 dotest tagdate-28-trunk-t8b 'cat first-dir-trunk-t8/file2' "trunk-2"
24294 dotest tagdate-28-br2-t8a 'cat first-dir-br2-t8/file1' "br2-2"
24295 dotest tagdate-28-br2-t8c 'cat first-dir-br2-t8/file3' "br2-1"
24296 dotest tagdate-28-br2-t9a 'cat first-dir-br2-t9/file1' "br2-2"
24297 dotest tagdate-28-br2-t9b 'cat first-dir-br2-t9/file2' "br2-1"
24298 dotest tagdate-28-br2-t9c 'cat first-dir-br2-t9/file3' "br2-1"
24301 unset date_T1 date_T2 date_T3 date_T4 date_T5
24302 unset date_T6 date_T7 date_T8 date_T9
24306 echo Keeping ${TESTDIR} and exiting due to --keep
24311 rm -rf ${CVSROOT_DIRNAME}/first-dir
24315 # Commit the first delta on branch A when there is an older
24316 # branch, B, that already has a delta. A and B come from the
24317 # same branch point. Then verify that branches A and B are
24318 # in the right order.
24320 dotest multibranch2-1 "${testcvs} -q co -l ." ''
24322 dotest multibranch2-2 "${testcvs} add first-dir" \
24323 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
24326 echo trunk-1 >file1
24327 echo trunk-1 >file2
24328 dotest multibranch2-3 "${testcvs} add file1 file2" \
24329 "${PROG} add: scheduling file .file1. for addition
24330 ${PROG} add: scheduling file .file2. for addition
24331 ${PROG} add: use .${PROG} commit. to add these files permanently"
24332 dotest multibranch2-4 "${testcvs} -q ci -m add" \
24333 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24336 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
24337 initial revision: 1\.1
24339 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
24342 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
24343 initial revision: 1\.1
24345 dotest multibranch2-5 "${testcvs} -q tag -b A" "T file1
24347 dotest multibranch2-6 "${testcvs} -q tag -b B" "T file1
24350 dotest multibranch2-7 "$testcvs -q update -r B" \
24353 echo branch-B >file1
24354 echo branch-B >file2
24355 dotest multibranch2-8 "${testcvs} -q ci -m modify-on-B" \
24356 "Checking in file1;
24357 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
24358 new revision: 1\.1\.4\.1; previous revision: 1\.1
24361 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
24362 new revision: 1\.1\.4\.1; previous revision: 1\.1
24365 dotest multibranch2-9 "${testcvs} -q update -r A" '[UP] file1
24367 echo branch-A >file1
24368 # When using cvs-1.9.20, this commit gets a failed assertion in rcs.c.
24369 dotest multibranch2-10 "${testcvs} -q ci -m modify-on-A" \
24370 "Checking in file1;
24371 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
24372 new revision: 1\.1\.2\.1; previous revision: 1\.1
24375 dotest multibranch2-11 "${testcvs} -q log file1" \
24377 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24378 Working file: file1
24386 keyword substitution: kv
24387 total revisions: 3; selected revisions: 3
24389 ----------------------------
24391 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24392 branches: 1\.1\.2; 1\.1\.4;
24394 ----------------------------
24395 revision 1\.1\.4\.1
24396 date: [0-9/]* [0-9:]*; author: $username; state: Exp; lines: ${PLUS}1 -1
24398 ----------------------------
24399 revision 1\.1\.2\.1
24400 date: [0-9/]* [0-9:]*; author: $username; state: Exp; lines: ${PLUS}1 -1
24402 ============================================================================="
24404 # This one is more concise.
24405 dotest multibranch2-12 "${testcvs} -q log -r1.1 file1" \
24407 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24408 Working file: file1
24416 keyword substitution: kv
24417 total revisions: 3; selected revisions: 1
24419 ----------------------------
24421 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
24422 branches: 1\.1\.2; 1\.1\.4;
24424 ============================================================================="
24426 # OK, try very much the same thing except we run update -j to
24427 # bring the changes from B to A. Probably tests many of the
24428 # same code paths but might as well keep it separate, I guess.
24430 dotest multibranch2-13 "${testcvs} -q update -r B" "[UP] file1
24432 dotest multibranch2-14 "${testcvs} -q update -r A -j B file2" \
24434 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
24435 retrieving revision 1.1
24436 retrieving revision 1.1.4.1
24437 Merging differences between 1.1 and 1.1.4.1 into file2"
24438 dotest multibranch2-15 "${testcvs} -q ci -m commit-on-A file2" \
24439 "Checking in file2;
24440 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
24441 new revision: 1\.1\.2\.1; previous revision: 1\.1
24445 rm -rf ${CVSROOT_DIRNAME}/first-dir
24449 # In cvs-1.9.27, there is a bug that can cause an abort.
24450 # It happens when you commit a change to a ,v file that has
24451 # just the right amount of tag/branch info to align one of the
24452 # semicolons in the branch info to be on a 8k-byte boundary.
24453 # The result: rcsbuf_getkey got an abort. This failure doesn't
24454 # corrupt the ,v file -- that would be really serious. But it
24455 # does leave stale write locks that have to be removed manually.
24463 dotest tag8k-1 "$testcvs -Q import -m . $module X Y" ''
24464 dotest tag8k-2 "$testcvs -Q co $module" ''
24469 dotest tag8k-3 "$testcvs add $file" \
24470 "${PROG} add: scheduling file .$file. for addition
24471 ${PROG} add: use .${PROG} commit. to add this file permanently"
24472 dotest tag8k-4 "$testcvs -Q ci -m . $file" \
24473 "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
24476 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
24477 initial revision: 1\.1
24480 # It seems there have to be at least two versions.
24482 dotest tag8k-5 "$testcvs -Q ci -m . $file" \
24483 "Checking in $file;
24484 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
24485 new revision: 1\.2; previous revision: 1\.1
24488 # Add just under 8K worth of tags.
24489 t=TAG---------------------------------------------------------------------
24492 # Now $t is 720 bytes long.
24494 # Apply some tags with that long prefix.
24495 dotest tag8k-6 "$testcvs -Q tag $t-0 $file" ''
24496 dotest tag8k-7 "$testcvs -Q tag $t-1 $file" ''
24497 dotest tag8k-8 "$testcvs -Q tag $t-2 $file" ''
24498 dotest tag8k-9 "$testcvs -Q tag $t-3 $file" ''
24499 dotest tag8k-10 "$testcvs -Q tag $t-4 $file" ''
24500 dotest tag8k-11 "$testcvs -Q tag $t-5 $file" ''
24501 dotest tag8k-12 "$testcvs -Q tag $t-6 $file" ''
24502 dotest tag8k-13 "$testcvs -Q tag $t-7 $file" ''
24503 dotest tag8k-14 "$testcvs -Q tag $t-8 $file" ''
24504 dotest tag8k-15 "$testcvs -Q tag $t-9 $file" ''
24505 dotest tag8k-16 "$testcvs -Q tag $t-a $file" ''
24507 # Extract the author value.
24508 name=`sed -n 's/.*; author \([^;]*\);.*/\1/p' ${CVSROOT_DIRNAME}/$module/$file,v|sed 1q`
24510 # Form a suffix string of length (16 - length($name)).
24511 # CAREFUL: this will lose if $name is longer than 16.
24512 sed_pattern=`echo $name|sed s/././g`
24513 suffix=`echo 1234567890123456|sed s/$sed_pattern//`
24515 # Add a final tag with length chosen so that it will push the
24516 # offset of the `;' in the 2nd occurrence of `;\tauthor' in the
24517 # ,v file to exactly 8192.
24518 dotest tag8k-17 "$testcvs -Q tag "x8bytes-$suffix" $file" ''
24520 # This commit would fail with 1.9.27.
24522 dotest tag8k-18 "$testcvs -Q ci -m . $file" \
24523 "Checking in $file;
24524 ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
24525 new revision: 1\.3; previous revision: 1\.2
24529 rm -rf ${CVSROOT_DIRNAME}/$module
24534 # More "cvs admin" tests.
24535 # The basicb-21 test tests rejecting an illegal option.
24536 # For -l and -u, see "reserved" and "keyword" tests.
24537 # "binfiles" test has a test of "cvs admin -k".
24538 # "log2" test has tests of -t and -q options to cvs admin.
24539 # "rcs" tests -b option also.
24541 # admin-22-o1 through admin-23 (various cases not involving ::)
24542 # binfiles2-o* (:rev, rev on trunk; rev:, deleting entire branch)
24543 # basicb-o* (attempt to delete all revisions)
24544 # basica-o1 through basica-o3 (basic :: usage)
24545 # head-o1 (::branch, where this deletes a revision or is noop)
24546 # branches-o1 (::branch, similar, with different branch topology)
24547 # log-o1 (1.3.2.1::)
24548 # binfiles-o1 (1.3:: and ::1.3; binary files)
24549 # binfiles3-9 (binary files)
24550 # Also could be testing:
24554 # 1.3::1.3.2.6 (error? or synonym for ::1.3.2.6?)
24555 # -n: admin, tagf tests.
24558 dotest admin-1 "${testcvs} -q co -l ." ''
24560 dotest admin-2 "${testcvs} add first-dir" \
24561 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
24564 dotest_fail admin-3 "${testcvs} -q admin -i file1" \
24565 "${PROG} admin: the -i option to admin is not supported
24566 ${PROG} admin: run add or import to create an RCS file
24567 ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information"
24568 dotest_fail admin-4 "${testcvs} -q log file1" \
24569 "${PROG} log: nothing known about file1"
24570 dotest_fail admin-4a "${testcvs} -q admin file1" \
24571 "${PROG} admin: nothing known about file1"
24573 # Set up some files, file2 a plain one and file1 with a revision
24576 dotest admin-5 "${testcvs} add file1 file2" \
24577 "${PROG} add: scheduling file .file1. for addition
24578 ${PROG} add: scheduling file .file2. for addition
24579 ${PROG} add: use .${PROG} commit. to add these files permanently"
24580 dotest admin-6 "${testcvs} -q ci -m add" \
24581 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24584 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
24585 initial revision: 1\.1
24587 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
24590 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
24591 initial revision: 1\.1
24593 dotest admin-7 "${testcvs} -q tag -b br" "T file1
24595 dotest admin-8 "$testcvs -q update -r br" \
24598 echo 'add a line on the branch' >> file1
24599 echo 'add a file on the branch' >> file3
24600 dotest admin-9a "${testcvs} -q add file3" \
24601 "${PROG} add: use .${PROG} commit. to add this file permanently"
24602 dotest admin-9b "${testcvs} -q ci -m modify-on-branch" \
24603 "Checking in file1;
24604 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
24605 new revision: 1\.1\.2\.1; previous revision: 1\.1
24607 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
24610 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
24611 new revision: 1\.1\.2\.1; previous revision: 1\.1
24613 dotest admin-10 "$testcvs -q update -A" \
24616 $PROG update: file3 is no longer in the repository"
24618 # Check that we can administer files in the repository that
24619 # aren't in the working directory.
24620 dotest admin-10-1 "${testcvs} admin ." \
24621 "${PROG} admin: Administrating .
24622 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24624 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
24626 dotest admin-10-2 "${testcvs} -q admin file3" \
24627 "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
24630 # Try to recurse with a numeric revision arg.
24631 # If we wanted to comprehensive about this, we would also test
24632 # this for -l, -u, and all the different -o syntaxes.
24633 dotest_fail admin-10a "${testcvs} -q admin -b1.1.2" \
24634 "${PROG} [a-z]*: while processing more than one file:
24635 ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
24636 dotest_fail admin-10b "${testcvs} -q admin -m1.1:bogus file1 file2" \
24637 "${PROG} [a-z]*: while processing more than one file:
24638 ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
24640 # try a bad symbolic revision
24641 dotest_fail admin-10c "${testcvs} -q admin -bBOGUS" \
24642 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24643 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file1,v: Symbolic name BOGUS is undefined.
24644 ${PROG} admin: RCS file for .file1. not modified\.
24645 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
24646 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name BOGUS is undefined.
24647 ${PROG} admin: RCS file for .file2. not modified\."
24649 # Note that -s option applies to the new default branch, not
24651 # Also note that the implementation of -a via "rcs" requires
24652 # no space between -a and the argument. However, we expect
24653 # to change that once CVS parses options.
24654 dotest admin-11 "${testcvs} -q admin -afoo,bar -abaz \
24655 -b1.1.2 -cxx -U -sfoo file1" \
24656 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24658 dotest admin-11a "${testcvs} log -N file1" "
24659 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24660 Working file: file1
24668 keyword substitution: kv
24669 total revisions: 2; selected revisions: 2
24671 ----------------------------
24673 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
24676 ----------------------------
24677 revision 1\.1\.2\.1
24678 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
24680 ============================================================================="
24681 dotest admin-12 "${testcvs} -q admin -bbr file1" \
24682 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24684 dotest admin-12a "${testcvs} log -N file1" "
24685 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24686 Working file: file1
24694 keyword substitution: kv
24695 total revisions: 2; selected revisions: 2
24697 ----------------------------
24699 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
24702 ----------------------------
24703 revision 1\.1\.2\.1
24704 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
24706 ============================================================================="
24708 # "cvs log" doesn't print the comment leader. RCS 5.7 will print
24709 # the comment leader only if one specifies "-V4" to rlog. So it
24710 # seems like the only way to test it is by looking at the RCS file
24711 # directly. This also serves as a test of exporting RCS files
24712 # (analogous to the import tests in "rcs").
24713 # Rather than try to write a rigorous check for whether the
24714 # file CVS exports is legal, we just write a simpler
24715 # test for what CVS actually exports, and figure we can revise
24716 # the check as needed (within the confines of the RCS5 format as
24717 # documented in RCSFILES).
24718 # Note that we must accept either 2 or 4 digit year.
24719 dotest admin-13 "cat ${CVSROOT_DIRNAME}/first-dir/file1,v" \
24733 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;
24739 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;
24762 add a line on the branch
24764 dotest_fail admin-14-1 "${testcvs} -q admin \
24765 -m1.1.1.1:changed-bogus-log-message file2" \
24766 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
24767 cvs admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: no such revision 1\.1\.1\.1
24768 cvs admin: RCS file for .file2. not modified."
24769 dotest admin-14-2 "${testcvs} -q log file2" "
24770 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
24771 Working file: file2
24778 keyword substitution: kv
24779 total revisions: 1; selected revisions: 1
24781 ----------------------------
24783 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
24785 ============================================================================="
24787 dotest admin-14-3 "${testcvs} -q admin -aauth3 -aauth2,foo \
24788 -soneone:1.1 -m1.1:changed-log-message -ntagone: file2" \
24789 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
24791 dotest admin-15 "${testcvs} -q log file2" "
24792 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
24793 Working file: file2
24804 keyword substitution: kv
24805 total revisions: 1; selected revisions: 1
24807 ----------------------------
24809 date: [0-9/]* [0-9:]*; author: ${username}; state: oneone;
24810 changed-log-message
24811 ============================================================================="
24813 dotest admin-16 "${testcvs} -q admin \
24814 -A${CVSROOT_DIRNAME}/first-dir/file2,v -b -L -Nbr:1.1 file1" \
24815 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24817 dotest admin-17 "${testcvs} -q log file1" "
24818 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24819 Working file: file1
24831 keyword substitution: kv
24832 total revisions: 2; selected revisions: 2
24834 ----------------------------
24836 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
24839 ----------------------------
24840 revision 1\.1\.2\.1
24841 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
24843 ============================================================================="
24845 dotest_fail admin-18 "${testcvs} -q admin -nbr:1.1.2 file1" \
24846 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24847 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file1,v: symbolic name br already bound to 1\.1
24848 ${PROG} admin: RCS file for .file1. not modified\."
24849 dotest admin-19 "${testcvs} -q admin -ebaz -ebar,auth3 -nbr file1" \
24850 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24852 dotest admin-20 "${testcvs} -q log file1" "
24853 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24854 Working file: file1
24862 keyword substitution: kv
24863 total revisions: 2; selected revisions: 2
24865 ----------------------------
24867 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
24870 ----------------------------
24872 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
24874 ============================================================================="
24876 # OK, this is starting to get ridiculous, in terms of
24877 # testing a feature (access lists) which doesn't do anything
24878 # useful, but what about nonexistent files and
24879 # relative pathnames in admin -A?
24880 dotest_fail admin-19a-nonexist \
24881 "${testcvs} -q admin -A${TESTDIR}/foo/bar file1" \
24882 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24883 ${PROG} admin: Couldn't open rcs file .${TESTDIR}/foo/bar.: No such file or directory
24884 ${PROG} \[admin aborted\]: cannot continue"
24886 # In the remote case, we are cd'd off into the temp directory
24887 # and so these tests give "No such file or directory" errors.
24888 if $remote; then :; else
24889 dotest admin-19a-admin "${testcvs} -q admin -A../../${CVSROOTDIR}/first-dir/file2,v file1" \
24890 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24892 dotest admin-19a-log "${testcvs} -q log -h -N file1" "
24893 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24894 Working file: file1
24902 keyword substitution: kv
24904 ============================================================================="
24905 fi # end of tests skipped for remote
24907 # Now test that plain -e works right.
24908 dotest admin-19a-2 "${testcvs} -q admin -e file1" \
24909 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24911 dotest admin-19a-3 "${testcvs} -q log -h -N file1" "
24912 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24913 Working file: file1
24918 keyword substitution: kv
24920 ============================================================================="
24922 # Put the access list back, to avoid special cases later.
24923 dotest admin-19a-4 "${testcvs} -q admin -afoo,auth2 file1" \
24924 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24927 # Add another revision to file2, so we can delete one.
24928 echo 'add a line' >> file2
24929 dotest admin-21 "${testcvs} -q ci -m modify file2" \
24930 "Checking in file2;
24931 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
24932 new revision: 1\.2; previous revision: 1\.1
24934 dotest admin-22 "${testcvs} -q admin -o1.1 file2" \
24935 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
24936 deleting revision 1\.1
24938 # Test admin -o. More variants that we could be testing:
24939 # * REV: [on branch]
24940 # * REV1:REV2 [deleting whole branch]
24941 # * high branch numbers (e.g. 1.2.2.3.2.3)
24942 # ... and probably others. See RCS_delete_revs for ideas.
24944 echo first rev > aaa
24945 dotest admin-22-o1 "${testcvs} add aaa" \
24946 "${PROG} add: scheduling file .aaa. for addition
24947 ${PROG} add: use .${PROG} commit. to add this file permanently"
24948 dotest admin-22-o2 "${testcvs} -q ci -m first aaa" \
24949 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
24952 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
24953 initial revision: 1\.1
24955 echo second rev >> aaa
24956 dotest admin-22-o3 "${testcvs} -q ci -m second aaa" \
24958 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
24959 new revision: 1\.2; previous revision: 1\.1
24961 echo third rev >> aaa
24962 dotest admin-22-o4 "${testcvs} -q ci -m third aaa" \
24964 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
24965 new revision: 1\.3; previous revision: 1\.2
24967 echo fourth rev >> aaa
24968 dotest admin-22-o5 "${testcvs} -q ci -m fourth aaa" \
24970 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
24971 new revision: 1\.4; previous revision: 1\.3
24973 echo fifth rev >>aaa
24974 dotest admin-22-o6 "${testcvs} -q ci -m fifth aaa" \
24976 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
24977 new revision: 1\.5; previous revision: 1\.4
24979 echo sixth rev >> aaa
24980 dotest admin-22-o7 "${testcvs} -q ci -m sixth aaa" \
24982 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
24983 new revision: 1\.6; previous revision: 1\.5
24985 dotest admin-22-o8 "${testcvs} admin -l1.6 aaa" \
24986 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
24989 dotest admin-22-o9 "${testcvs} log -r1.6 aaa" "
24990 RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
24998 keyword substitution: kv
24999 total revisions: 6; selected revisions: 1
25001 ----------------------------
25002 revision 1\.6 locked by: ${username};
25003 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25005 ============================================================================="
25006 dotest_fail admin-22-o10 "${testcvs} admin -o1.5: aaa" \
25007 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
25008 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/aaa,v: can't remove locked revision 1\.6
25009 ${PROG} admin: RCS file for .aaa. not modified\."
25010 dotest admin-22-o11 "${testcvs} admin -u aaa" \
25011 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
25014 dotest admin-22-o12 "${testcvs} admin -o1.5: aaa" \
25015 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
25016 deleting revision 1\.6
25017 deleting revision 1\.5
25019 dotest admin-22-o13 "${testcvs} log aaa" "
25020 RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
25027 keyword substitution: kv
25028 total revisions: 4; selected revisions: 4
25030 ----------------------------
25032 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25034 ----------------------------
25036 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25038 ----------------------------
25040 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25042 ----------------------------
25044 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25046 ============================================================================="
25048 dotest admin-22-o14 "${testcvs} tag -b -r1.3 br1 aaa" "T aaa"
25049 dotest admin-22-o15 "${testcvs} update -rbr1 aaa" "U aaa"
25050 echo new branch rev >> aaa
25051 dotest admin-22-o16 "${testcvs} ci -m new-branch aaa" \
25053 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
25054 new revision: 1\.3\.2\.1; previous revision: 1\.3
25056 dotest_fail admin-22-o17 "${testcvs} admin -o1.2:1.4 aaa" \
25057 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
25058 deleting revision 1\.4
25059 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/aaa,v: can't remove branch point 1\.3
25060 ${PROG} admin: RCS file for .aaa. not modified\."
25061 dotest admin-22-o18 "${testcvs} update -p -r1.4 aaa" \
25062 "===================================================================
25064 RCS: ${CVSROOT_DIRNAME}/first-dir/aaa,v
25066 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
25071 echo second branch rev >> aaa
25072 dotest admin-22-o19 "${testcvs} ci -m branch-two aaa" \
25074 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
25075 new revision: 1\.3\.2\.2; previous revision: 1\.3\.2\.1
25077 echo third branch rev >> aaa
25078 dotest admin-22-o20 "${testcvs} ci -m branch-three aaa" \
25080 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
25081 new revision: 1\.3\.2\.3; previous revision: 1\.3\.2\.2
25083 echo fourth branch rev >> aaa
25084 dotest admin-22-o21 "${testcvs} ci -m branch-four aaa" \
25086 ${CVSROOT_DIRNAME}/first-dir/aaa,v <-- aaa
25087 new revision: 1\.3\.2\.4; previous revision: 1\.3\.2\.3
25089 dotest admin-22-o22 "${testcvs} admin -o:1.3.2.3 aaa" \
25090 "RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
25091 deleting revision 1\.3\.2\.1
25092 deleting revision 1\.3\.2\.2
25093 deleting revision 1\.3\.2\.3
25095 dotest admin-22-o23 "${testcvs} log aaa" "
25096 RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
25104 keyword substitution: kv
25105 total revisions: 5; selected revisions: 5
25107 ----------------------------
25109 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25111 ----------------------------
25113 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25116 ----------------------------
25118 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25120 ----------------------------
25122 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25124 ----------------------------
25125 revision 1\.3\.2\.4
25126 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}4 -0
25128 ============================================================================="
25130 dotest admin-22-o24 "${testcvs} -q update -p -r 1.3.2.4 aaa" \
25139 # The bit here about how there is a "tagone" tag pointing to
25140 # a nonexistent revision is documented by rcs. I dunno, I
25141 # wonder whether the "cvs admin -o" should give a warning in
25143 dotest admin-23 "${testcvs} -q log file2" "
25144 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25145 Working file: file2
25156 keyword substitution: kv
25157 total revisions: 1; selected revisions: 1
25159 ----------------------------
25161 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25163 ============================================================================="
25165 dotest admin-25 "cat ${CVSROOT_DIRNAME}/first-dir/file1,v" \
25176 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;
25182 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;
25205 add a line on the branch
25208 # Tests of cvs admin -n. Make use of the results of
25209 # admin-1 through admin-25.
25210 # FIXME: We probably shouldn't make use of those results;
25211 # this test is way too long as it is.
25213 # tagtwo should be a revision
25215 dotest admin-26-1 "${testcvs} admin -ntagtwo:tagone file2" \
25216 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25219 # br1 should be a branch
25221 dotest admin-26-2 "${testcvs} admin -nbr1:br file2" \
25222 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25225 # Attach some tags using RCS versions
25227 dotest admin-26-3 "${testcvs} admin -ntagthree:1.1 file2" \
25228 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25231 dotest admin-26-4 "${testcvs} admin -nbr2:1.1.2 file2" \
25232 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25235 dotest admin-26-5 "${testcvs} admin -nbr4:1.1.0.2 file2" \
25236 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25239 # Check results so far
25241 dotest admin-26-6 "${testcvs} status -v file2" \
25242 "===================================================================
25243 File: file2 Status: Up-to-date
25245 Working revision: 1\.2.*
25246 Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file2,v
25248 Sticky Date: (none)
25249 Sticky Options: (none)
25252 br4 (branch: 1\.1\.2)
25253 br2 (branch: 1\.1\.2)
25254 tagthree (revision: 1\.1)
25255 br1 (branch: 1\.1\.2)
25256 tagtwo (revision: 1\.1)
25257 tagone (revision: 1\.1)
25258 br (branch: 1\.1\.2)"
25261 # Add a couple more revisions
25263 echo "nuthr_line" >> file2
25264 dotest admin-27-1 "${testcvs} commit -m nuthr_line file2" \
25265 "Checking in file2;
25266 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
25267 new revision: 1\.3; previous revision: 1\.2
25270 echo "yet_another" >> file2
25271 dotest admin-27-2 "${testcvs} commit -m yet_another file2" \
25272 "Checking in file2;
25273 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
25274 new revision: 1\.4; previous revision: 1\.3
25277 # Fail trying to reattach existing tag with -n
25279 dotest admin-27-3 "${testcvs} admin -ntagfour:1.1 file2" \
25280 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25283 dotest_fail admin-27-4 "${testcvs} admin -ntagfour:1.3 file2" \
25284 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25285 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: symbolic name tagfour already bound to 1\.1
25286 ${PROG} admin: RCS file for .file2. not modified\."
25288 # Succeed at reattaching existing tag, using -N
25290 dotest admin-27-5 "${testcvs} admin -Ntagfour:1.3 file2" \
25291 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25294 # Fail on some bogus operations
25295 # Try to attach to nonexistant tag
25297 dotest_fail admin-28-1 "${testcvs} admin -ntagsix:tagfive file2" \
25298 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25299 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name or revision tagfive is undefined\.
25300 ${PROG} admin: RCS file for .file2. not modified\."
25302 # Try a some nonexisting numeric target tags
25304 dotest_fail admin-28-2 "${testcvs} admin -ntagseven:2.1 file2" \
25305 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25306 ${PROG} \[admin aborted\]: revision .2\.1. does not exist"
25308 dotest_fail admin-28-3 "${testcvs} admin -ntageight:2.1.2 file2" \
25309 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25310 ${PROG} \[admin aborted\]: revision .2\.1\.2. does not exist"
25312 # Try some invalid targets
25314 dotest_fail admin-28-4 "${testcvs} admin -ntagnine:1.a.2 file2" \
25315 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25316 ${PROG} \[admin aborted\]: tag .1\.a\.2. must start with a letter"
25318 # Confirm that a missing tag is not a fatal error.
25319 dotest admin-28-5.1 "${testcvs} -Q tag BO+GUS file1" ''
25320 dotest_fail admin-28-5.2 "${testcvs} admin -ntagten:BO+GUS file2 file1" \
25321 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25322 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name or revision BO${PLUS}GUS is undefined\.
25323 ${PROG} admin: RCS file for .file2. not modified\.
25324 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25327 dotest_fail admin-28-6 "${testcvs} admin -nq.werty:tagfour file2" \
25328 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25329 ${PROG} \[admin aborted\]: tag .q\.werty. must not contain the characters ..*"
25331 # Verify the archive
25333 dotest admin-29 "cat ${CVSROOT_DIRNAME}/first-dir/file2,v" \
25353 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;
25358 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;
25363 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;
25400 dotest_fail admin-30 "${testcvs} admin -mbr:another-log-message \
25402 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25403 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: no such revision br: 1\.1
25404 ${PROG} admin: RCS file for .file2. not modified.
25405 RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
25406 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/aaa,v: no such revision br
25407 ${PROG} admin: RCS file for .aaa. not modified.
25408 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
25410 dotest admin-31 "${testcvs} log" \
25411 "${PROG} log: Logging \.
25413 RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
25421 keyword substitution: kv
25422 total revisions: 5; selected revisions: 5
25424 ----------------------------
25426 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25428 ----------------------------
25430 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25433 ----------------------------
25435 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25437 ----------------------------
25439 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25441 ----------------------------
25442 revision 1\.3\.2\.4
25443 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}4 -0
25445 =============================================================================
25447 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25448 Working file: file1
25458 keyword substitution: kv
25459 total revisions: 2; selected revisions: 2
25461 ----------------------------
25463 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25466 ----------------------------
25467 revision 1\.1\.2\.1
25468 date: [0-9/]* [0-9:]*; author: ${username}; state: foo; lines: ${PLUS}1 -0
25470 =============================================================================
25472 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25473 Working file: file2
25490 keyword substitution: kv
25491 total revisions: 3; selected revisions: 3
25493 ----------------------------
25495 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25497 ----------------------------
25499 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25501 ----------------------------
25503 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25505 =============================================================================
25507 RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
25508 Working file: file3
25515 keyword substitution: kv
25516 total revisions: 2; selected revisions: 2
25518 ----------------------------
25520 date: [0-9/]* [0-9:]*; author: ${username}; state: dead;
25522 file file3 was initially added on branch br\.
25523 ----------------------------
25524 revision 1\.1\.2\.1
25525 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
25526 another-log-message
25527 ============================================================================="
25531 echo Keeping ${TESTDIR} and exiting due to --keep
25534 # clean up our after ourselves
25536 rm -rf ${CVSROOT_DIRNAME}/first-dir
25540 # Tests of reserved checkouts. Eventually this will test
25541 # rcslock.pl (or equivalent) and all kinds of stuff. Right
25542 # now it just does some very basic checks on cvs admin -u
25543 # and cvs admin -l.
25544 # Also should test locking on a branch (and making sure that
25545 # locks from one branch don't get mixed up with those from
25546 # another. Both the case where one of the branches is the
25547 # main branch, and in which neither one is).
25548 # See also test keyword, which tests that keywords and -kkvl
25549 # do the right thing in the presence of locks.
25551 # The usual setup, directory first-dir containing file file1.
25553 dotest reserved-1 "${testcvs} -q co -l ." ''
25555 dotest reserved-2 "${testcvs} add first-dir" \
25556 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
25559 dotest reserved-3 "${testcvs} add file1" \
25560 "${PROG} add: scheduling file .file1. for addition
25561 ${PROG} add: use .${PROG} commit. to add this file permanently"
25562 dotest reserved-4 "${testcvs} -q ci -m add" \
25563 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25566 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
25567 initial revision: 1\.1
25570 dotest reserved-5 "${testcvs} -q admin -l file1" \
25571 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25574 dotest reserved-6 "${testcvs} log -N file1" "
25575 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25576 Working file: file1
25582 keyword substitution: kv
25583 total revisions: 1; selected revisions: 1
25585 ----------------------------
25586 revision 1\.1 locked by: ${username};
25587 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25589 ============================================================================="
25591 # Note that this just tests the owner of the lock giving
25592 # it up. It doesn't test breaking a lock.
25593 dotest reserved-7 "${testcvs} -q admin -u file1" \
25594 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25598 dotest reserved-8 "${testcvs} log -N file1" "
25599 RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25600 Working file: file1
25605 keyword substitution: kv
25606 total revisions: 1; selected revisions: 1
25608 ----------------------------
25610 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
25612 ============================================================================="
25614 # rcslock.pl tests. Of course, the point isn't to test
25615 # rcslock.pl from the distribution but equivalent
25616 # functionality (for example, many sites may have an old
25617 # rcslock.pl). The functionality of this hook falls
25618 # short of the real rcslock.pl though.
25619 # Note that we can use rlog or look at the RCS file directly,
25620 # but we can't use "cvs log" because "cvs commit" has a lock.
25622 cat >${TESTDIR}/lockme <<EOF
25624 line=\`grep <\$1/\$2,v 'locks $anyusername:1\.[0-9];'\`
25625 if test -z "\$line"; then
25629 user=\`echo \$line | sed -e 's/locks \\($anyusername\\):[0-9.]*;.*/\\1/'\`
25630 version=\`echo \$line | sed -e 's/locks $anyusername:\\([0-9.]*\\);.*/\\1/'\`
25631 echo "\$user has file a-lock locked for version \$version" >&2
25636 if test -n "$remotehost"; then
25637 $CVS_RSH $remotehost "chmod +x ${TESTDIR}/lockme"
25639 chmod +x ${TESTDIR}/lockme
25642 echo stuff > a-lock
25643 dotest reserved-9 "${testcvs} add a-lock" \
25644 "${PROG} add: scheduling file .a-lock. for addition
25645 ${PROG} add: use .${PROG} commit. to add this file permanently"
25646 dotest reserved-10 "${testcvs} -q ci -m new a-lock" \
25647 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
25649 Checking in a-lock;
25650 ${CVSROOT_DIRNAME}/first-dir/a-lock,v <-- a-lock
25651 initial revision: 1\.1
25653 # FIXME: the contents of CVSROOT fluctuate a lot
25654 # here. Maybe the expect pattern should just
25655 # confirm that commitinfo is one of the files checked out,
25656 # but for now we just check that CVS exited with success.
25658 if ${testcvs} -q co CVSROOT >>${LOGFILE} ; then
25664 echo "DEFAULT ${TESTDIR}/lockme" >>commitinfo
25665 dotest reserved-12 "${testcvs} -q ci -m rcslock commitinfo" \
25666 "Checking in commitinfo;
25667 ${CVSROOT_DIRNAME}/CVSROOT/commitinfo,v <-- commitinfo
25668 new revision: 1\.2; previous revision: 1\.1
25670 ${PROG} commit: Rebuilding administrative file database"
25671 cd ..; cd first-dir
25673 # Simulate (approximately) what a-lock would look like
25674 # if someone else had locked revision 1.1.
25675 sed -e 's/locks; strict;/locks fred:1.1; strict;/' ${CVSROOT_DIRNAME}/first-dir/a-lock,v > a-lock,v
25677 if test -n "$remotehost"; then
25678 $CVS_RSH $remotehost "chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v"
25680 chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
25682 dotest reserved-13 "mv a-lock,v ${CVSROOT_DIRNAME}/first-dir/a-lock,v"
25684 if test -n "$remotehost"; then
25685 $CVS_RSH $remotehost "chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v"
25687 chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
25689 echo more stuff >> a-lock
25690 dotest_fail reserved-13b "${testcvs} ci -m '' a-lock" \
25691 "fred has file a-lock locked for version 1\.1
25692 ${PROG} commit: Pre-commit check failed
25693 ${PROG} \[commit aborted\]: correct above errors first!"
25694 # OK, now test "cvs admin -l" in the case where someone
25695 # else has the file locked.
25696 dotest_fail reserved-13c "${testcvs} admin -l a-lock" \
25697 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
25698 ${PROG} \[admin aborted\]: Revision 1\.1 is already locked by fred"
25700 dotest reserved-14 "${testcvs} admin -u1.1 a-lock" \
25701 "RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
25702 ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/a-lock,v: revision 1\.1 locked by fred; breaking lock
25705 dotest reserved-15 "${testcvs} -q ci -m success a-lock" \
25706 "Checking in a-lock;
25707 ${CVSROOT_DIRNAME}/first-dir/a-lock,v <-- a-lock
25708 new revision: 1\.2; previous revision: 1\.1
25711 # Now test for a bug involving branches and locks
25712 sed -e 's/locks; strict;/locks fred:1.2; strict;/' ${CVSROOT_DIRNAME}/first-dir/a-lock,v > a-lock,v
25713 chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
25714 dotest reserved-16 \
25715 "mv a-lock,v ${CVSROOT_DIRNAME}/first-dir/a-lock,v" ""
25716 chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
25717 dotest reserved-17 "${testcvs} -q tag -b br a-lock" "T a-lock"
25718 dotest reserved-18 "$testcvs -q update -r br a-lock" '[UP] a-lock'
25719 echo edit it >>a-lock
25720 dotest reserved-19 "${testcvs} -q ci -m modify a-lock" \
25721 "Checking in a-lock;
25722 ${CVSROOT_DIRNAME}/first-dir/a-lock,v <-- a-lock
25723 new revision: 1\.2\.2\.1; previous revision: 1\.2
25726 # undo commitinfo changes
25728 echo '# vanilla commitinfo' >commitinfo
25729 dotest reserved-cleanup-1 "${testcvs} -q ci -m back commitinfo" \
25730 "Checking in commitinfo;
25731 ${CVSROOT_DIRNAME}/CVSROOT/commitinfo,v <-- commitinfo
25732 new revision: 1\.3; previous revision: 1\.2
25734 ${PROG} commit: Rebuilding administrative file database"
25735 cd ..; rm -r CVSROOT; cd first-dir
25739 rm ${TESTDIR}/lockme
25740 rm -rf ${CVSROOT_DIRNAME}/first-dir
25744 # Make sure CVS can merge correctly in circumstances where it
25745 # used to mess up (due to a bug which existed in diffutils 2.7
25746 # and 2.6, but not 2.5, and which has been fixed in CVS's diff
25747 # lib by Paul Eggert, bless his bitty heart).
25749 # This first test involves two working copies, "mine" and
25750 # "yours", checked out from the same repository at the same
25751 # time. In yours, you remove some text from the end of the
25752 # file and check it in; meanwhile, "me" has commented out some
25753 # lines earlier in the file, and I go to check it in right
25754 # after you checked yours in. CVS naturally tells me the file
25755 # is not up-to-date, so I run cvs update, but it updates
25756 # incorrectly, leaving in the lines of text you just deleted.
25757 # Bad! I'm in too much of a hurry to actually look at the
25758 # file, so I check it in and go home, and so your changes have
25759 # been lost. Later you discover this, and you suspect me of
25760 # deliberately sabotaging your work, so you let all the air
25761 # out of my tires. Only after a series of expensive lawsuits
25762 # and countersuits do we discover that this was all CVS's
25765 # Luckily, this problem has been fixed now, as our test will
25766 # handily confirm, no doubt:
25768 # First make a repository containing the original text:
25770 # We should be here anyway, but cd to it just in case:
25776 # These are the files we both start out with:
25779 diffmerge_create_older_files
25781 dotest diffmerge1_import \
25782 "${testcvs} import -m import diffmerge1 tag1 tag2" \
25783 "${DOTSTAR}No conflicts created by this import"
25786 # Check out two working copies, one for "you" and one for
25787 # "me". If no branch is used and cvs detects that only one
25788 # of the two people made changes, then cvs does not run the
25789 # merge algorithm. But if a branch is used, then cvs does run
25790 # the merge algorithm (even in this case of only one of the two
25791 # people having made changes). CVS used to have a bug in this
25792 # case. Therefore, it is important to test this case by
25794 ${testcvs} rtag -b tag diffmerge1 >/dev/null 2>&1
25795 ${testcvs} checkout -r tag diffmerge1 >/dev/null 2>&1
25796 mv diffmerge1 yours
25797 ${testcvs} checkout diffmerge1 >/dev/null 2>&1
25800 # In your working copy, you'll make changes, and
25801 # then check in your changes before I check in mine:
25803 diffmerge_create_your_files
25804 dotest diffmerge1_yours "${testcvs} -q ci -m yours" \
25805 "Checking in testcase01;
25806 ${CVSROOT_DIRNAME}/diffmerge1/testcase01,v <-- testcase01
25807 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
25809 Checking in testcase02;
25810 ${CVSROOT_DIRNAME}/diffmerge1/testcase02,v <-- testcase02
25811 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
25813 Checking in testcase03;
25814 ${CVSROOT_DIRNAME}/diffmerge1/testcase03,v <-- testcase03
25815 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
25817 Checking in testcase04;
25818 ${CVSROOT_DIRNAME}/diffmerge1/testcase04,v <-- testcase04
25819 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
25821 Checking in testcase05;
25822 ${CVSROOT_DIRNAME}/diffmerge1/testcase05,v <-- testcase05
25823 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
25825 Checking in testcase06;
25826 ${CVSROOT_DIRNAME}/diffmerge1/testcase06,v <-- testcase06
25827 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
25829 Checking in testcase07;
25830 ${CVSROOT_DIRNAME}/diffmerge1/testcase07,v <-- testcase07
25831 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
25833 Checking in testcase08;
25834 ${CVSROOT_DIRNAME}/diffmerge1/testcase08,v <-- testcase08
25835 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
25837 Checking in testcase09;
25838 ${CVSROOT_DIRNAME}/diffmerge1/testcase09,v <-- testcase09
25839 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
25841 Checking in testcase10;
25842 ${CVSROOT_DIRNAME}/diffmerge1/testcase10,v <-- testcase10
25843 new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
25846 # Change my copy. Then I
25847 # update, after both my modifications and your checkin:
25849 diffmerge_create_my_files
25850 dotest diffmerge1_mine "${testcvs} -q update -j tag" \
25852 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase01,v
25853 retrieving revision 1\.1\.1\.1
25854 retrieving revision 1\.1\.1\.1\.2\.1
25855 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase01
25857 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase02,v
25858 retrieving revision 1\.1\.1\.1
25859 retrieving revision 1\.1\.1\.1\.2\.1
25860 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase02
25862 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase03,v
25863 retrieving revision 1\.1\.1\.1
25864 retrieving revision 1\.1\.1\.1\.2\.1
25865 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase03
25867 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase04,v
25868 retrieving revision 1\.1\.1\.1
25869 retrieving revision 1\.1\.1\.1\.2\.1
25870 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase04
25871 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase05,v
25872 retrieving revision 1\.1\.1\.1
25873 retrieving revision 1\.1\.1\.1\.2\.1
25874 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase05
25875 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase06,v
25876 retrieving revision 1\.1\.1\.1
25877 retrieving revision 1\.1\.1\.1\.2\.1
25878 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase06
25880 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase07,v
25881 retrieving revision 1\.1\.1\.1
25882 retrieving revision 1\.1\.1\.1\.2\.1
25883 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase07
25884 testcase07 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1
25886 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase08,v
25887 retrieving revision 1\.1\.1\.1
25888 retrieving revision 1\.1\.1\.1\.2\.1
25889 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase08
25891 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase09,v
25892 retrieving revision 1\.1\.1\.1
25893 retrieving revision 1\.1\.1\.1\.2\.1
25894 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase09
25896 RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase10,v
25897 retrieving revision 1\.1\.1\.1
25898 retrieving revision 1\.1\.1\.1\.2\.1
25899 Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase10"
25901 # So if your changes didn't make it into my working copy, or
25902 # in any case if the files do not look like the final text
25903 # in the files in directory comp_me, then the test flunks:
25907 diffmerge_create_expected_files
25911 # If you have GNU's version of diff, you may try
25912 # uncommenting the following line which will give more
25913 # fine-grained information about how cvs differed from the
25915 #dotest diffmerge1_cmp "diff -u --recursive --exclude=CVS comp_me mine" ''
25916 dotest diffmerge1_cmp "directory_cmp comp_me mine"
25918 # Clean up after ourselves:
25920 if $keep; then :; else
25921 rm -rf diffmerge1 ${CVSROOT_DIRNAME}/diffmerge1
25927 # FIXME: This test should be rewritten to be much more concise.
25928 # It currently weighs in at something like 600 lines, but the
25929 # same thing could probably be tested in more like 50-100 lines.
25932 # This tests for another diffmerge bug reported by Martin
25933 # Tomes; actually, his bug was probably caused by an initial
25934 # fix for the bug in test diffmerge1, and likely wasn't ever
25935 # a problem in CVS as long as one was using a normal
25936 # distribution of diff or a version of CVS that has the diff
25939 # Nevertheless, once burned twice cautious, so we test for his
25942 # Here is his report, more or less verbatim:
25943 # ------------------------------------------
25945 # Put the attached file (sgrid.h,v) into your repository
25946 # somewhere, check out the module and do this:
25948 # cvs update -j Review_Phase_2_Enhancements sgrid.h
25949 # cvs diff -r Review_V1p3 sgrid.h
25951 # As there have been no changes made on the trunk there
25952 # should be no differences, however this is output:
25954 # % cvs diff -r Review_V1p3 sgrid.h
25956 # ===================================================================
25957 # RCS file: /usr/local/repository/play/fred/sgrid.h,v
25958 # retrieving revision 1.1.2.1
25959 # diff -r1.1.2.1 sgrid.h
25961 # > /*--------------------------------------------------------------
25962 # > INLINE FUNCTION : HORIZONTALLINES
25963 # > NOTES : Description at the end of the file
25964 # > ----------------------------------------------------------------*/
25965 # > uint16 horizontalLines( void );
25968 # I did a cvs diff -c -r 1.1 -r 1.1.2.1 sgrid.h and patched those
25969 # differences to sgrid.h version 1.1 and got the correct result
25970 # so it looks like the built in patch is faulty.
25971 # -------------------------------------------------------------------
25973 # This is the RCS file, sgrid.h,v, that he sent:
25978 Review_V1p3:1.1.2.1
25979 Review_V1p3C:1.1.2.1
25980 Review_1p3A:1.1.2.1
25981 Review_V1p3A:1.1.2.1
25982 Review_Phase_2_Enhancements:1.1.0.2
25993 date 97.04.02.11.20.05; author colinl; state Exp;
25999 date 97.06.09.10.00.07; author colinl; state Exp;
26012 Tested By: Colin Law
26014 Reason for Change: Initial Revision of all files
26016 Design Change Details:
26021 @/* \$""Header: L:/gpanels/dis/sgrid.h_v 1.1.1.0 24 Jan 1996 14:59:20 PAULT \$ */
26023 * \$""Log: L:/gpanels/dis/sgrid.h_v \$
26025 * Rev 1.1.1.0 24 Jan 1996 14:59:20 PAULT
26028 * Rev 1.1 24 Jan 1996 12:09:52 PAULT
26029 * Consolidated 4100 code merged to trunk
26031 * Rev 1.0.2.0 01 Jun 1995 14:18:58 DAVEH
26034 * Rev 1.0 19 Apr 1995 16:32:48 COLINL
26035 * Initial revision.
26037 /*****************************************************************************
26040 AUTHOR : Dave Hartley
26041 SYSTEM : Borland C++
26042 DESCRIPTION : The declaration of the scrolling grid class
26044 *****************************************************************************/
26045 #if !defined(__SGRID_H)
26048 #if !defined(__SCROLL_H)
26049 #include <scroll.h>
26052 #if !defined(__GKI_H)
26056 #if defined PRINTING_SUPPORT
26060 /*****************************************************************************
26061 CLASS : ScrollingGrid
26062 DESCRIPTION: This class inherits from a grid and a scrollable, and
26063 can therefore use all the PUBLIC services provided by these
26064 classes. A description of these can be found in
26065 GRID.H and SCROLL.H.
26066 A scrolling grid is a set of horizontal and vertical lines
26067 that scroll and continually update to provide a complete grid
26069 *****************************************************************************/
26071 class ScrollingGrid : public Scrollable
26074 #if defined _WINDOWS
26075 /*---------------------------------------------------------------------------
26076 FUNCTION : CONSTRUCTOR
26077 DESCRIPTION : sets up the details of the grid, ready for painting
26078 ARGUMENTS : name : sgColour
26079 - the colour of the grid
26083 - the total number of horizontal grid lines
26085 - the min distance between the vertical grid lines
26086 on the scrolling axis
26088 - timestamp value now
26090 - number of timestamp ticks per second
26092 - number of timestamp ticks per pixel required
26096 ---------------------------------------------------------------------------*/
26097 ScrollingGrid( GkiColour sgColour, GkiLineType sgLineType,
26098 uint16 sgHorizontalTotal,
26099 uint16 verticalSpacingMin, uint32 currentTimestamp,
26100 uint16 ticksPerSecond, uint32 ticksPerPixel );
26102 /*---------------------------------------------------------------------------
26103 FUNCTION : CONSTRUCTOR
26104 DESCRIPTION : sets up the details of the grid, ready for painting
26105 ARGUMENTS : name : sgColour
26106 - the colour of the grid
26109 sgHorizontalTotal ( THE MAX NUMBER OF LINES IS 100 )
26110 - the total number of horizontal grid lines
26112 - the distance between the vertical grid lines
26113 on the scrolling axis
26116 NOTES : If the caller does not get the total grid lines value, synced
26117 with the overall size of the viewport, the spacing between
26118 grid lines will not be consistent.
26120 ---------------------------------------------------------------------------*/
26121 ScrollingGrid( GkiColour sgColour, GkiLineType sgLineType
26122 , uint16 sgHorizontalTotal, uint16 sgVerticalSpacing );
26124 /*---------------------------------------------------------------------------
26125 FUNCTION : DESTRUCTOR
26126 DESCRIPTION : tidies it all up
26131 ---------------------------------------------------------------------------*/
26132 ~ScrollingGrid( void );
26134 /*---------------------------------------------------------------------------
26136 DESCRIPTION : This service overloads the base class service, as it does
26137 additional work at the time of attachment.
26139 ARGUMENTS : name : tDrawingArea
26140 - the scrolled viewport to attach this trend to
26144 ---------------------------------------------------------------------------*/
26145 void attach( SViewport *tDrawingArea );
26147 #if defined _WINDOWS
26148 /*---------------------------------------------------------------------------
26149 FUNCTION : calculateVerticalSpacing
26150 DESCRIPTION : determines optimum spacing along time axis
26154 ---------------------------------------------------------------------------*/
26155 void calculateVerticalSpacing();
26157 /*---------------------------------------------------------------------------
26158 FUNCTION : gridSpacingTicks
26159 DESCRIPTION : Provides the grid spacing in the time axis in ticks
26161 RETURN : Number of ticks
26163 ---------------------------------------------------------------------------*/
26164 uint32 gridSpacingTicks();
26168 /*---------------------------------------------------------------------------
26169 INLINE FUNCTION : HORIZONTALLINES
26170 NOTES : Description at the end of the file
26171 ---------------------------------------------------------------------------*/
26172 uint16 horizontalLines( void );
26174 #if defined _WINDOWS
26175 // In Windows the OnDraw() function replaces paint()
26176 /*---------------------------------------------------------------------------
26177 FUNCTION : ScrollingGrid OnDraw
26178 DESCRIPTION : Paints the given area of the grid.
26180 ARGUMENTS : pDC pointer to the device context to use for display
26181 Note that the device context operates in the coords
26182 of the window owning the viewport
26185 ---------------------------------------------------------------------------*/
26186 virtual void OnDraw( CDC *pDC );
26188 #else // not Windows
26190 /*---------------------------------------------------------------------------
26192 DESCRIPTION : This extends the standard grid paint method to paint the
26193 viewport relative to its current position.
26199 ---------------------------------------------------------------------------*/
26200 void paint( void );
26203 /*---------------------------------------------------------------------------
26204 FUNCTION : P A I N T T E X T M A R K E R S
26205 DESCRIPTION : this service allow the text markers to be painted seperatley
26206 from the grid lines
26212 ---------------------------------------------------------------------------*/
26213 void paintTextMarkers();
26215 #if defined PRINTING_SUPPORT
26216 /*---------------------------------------------------------------------------
26217 FUNCTION : P R I N T
26218 DESCRIPTION : This print service prints a grid marker ( being either a
26219 timestamp or a date, IF there is one at the plot position
26224 - Where in the log to look to see if there is an
26228 the printer to print to
26232 ---------------------------------------------------------------------------*/
26233 void print( uint16 currentPrintPos, Printer *printerPtr );
26236 /*---------------------------------------------------------------------------
26237 FUNCTION : S E T D R I V E D I R E C T I O N
26238 DESCRIPTION : Sets direction for update and scrolling forwards or backwards
26239 ARGUMENTS : direction - required direction
26242 ---------------------------------------------------------------------------*/
26243 void setDriveDirection( ScrollDirection direction );
26245 /*---------------------------------------------------------------------------
26246 FUNCTION : S E T U P
26247 DESCRIPTION : service that will setup the grid prior to a paint
26254 the number of ticks that represent a plot point on
26259 ---------------------------------------------------------------------------*/
26260 void setup( uint32 newTimestamp, uint32 newTimeBase );
26262 #if defined PRINTING_SUPPORT
26263 /*---------------------------------------------------------------------------
26264 FUNCTION : S E T U P F O R P R I N T
26265 DESCRIPTION : This service iis to be called prior to printing. It allows
26266 the grid to prepare its markers ready for the print
26273 ---------------------------------------------------------------------------*/
26274 void setupForPrint();
26277 /*---------------------------------------------------------------------------
26279 DESCRIPTION : When this service is called it will calculate what needs to
26280 be painted and fill in the display again.
26282 ARGUMENTS : name : timeStamp
26283 - the reference time of this update.
26287 ---------------------------------------------------------------------------*/
26288 void update( uint32 timeStamp );
26290 /*---------------------------------------------------------------------------
26291 FUNCTION : U P D A T E B U F F E R
26292 DESCRIPTION : When a display update is not required, use this method. It
26293 updates the internal data ready for a call to paint that
26294 will then show the grid in the right position
26300 ---------------------------------------------------------------------------*/
26301 void updateBuffer( void );
26305 /*---------------------------------------------------------------------------
26306 FUNCTION : M A K E G R I D M A R K E R
26307 DESCRIPTION : service that perpares a string for display. The string will
26308 either be a short date, or short time. this is determined
26309 by the current setting of the dateMarker flag
26311 ARGUMENTS : name : timestampVal
26312 - the value to convert
26315 - the place to put the string
26319 ---------------------------------------------------------------------------*/
26320 void makeGridMarker( uint32 timestampVal, char *storePtr );
26322 /*---------------------------------------------------------------------------
26323 FUNCTION : P A I N T G R I D M A R K E R
26324 DESCRIPTION : given a position will put the string on the display
26328 - were it goes on the Y-axis
26335 ---------------------------------------------------------------------------*/
26336 void paintGridMarker( uint16 yPos, char *gridMarkerPtr );
26338 #if defined _WINDOWS
26339 /*---------------------------------------------------------------------------
26340 FUNCTION : PAINTHORIZONTALLINES
26341 DESCRIPTION : responsible for painting the grids horizontal lines
26342 ARGUMENTS : pRectToDraw pointer to rectangle that needs refreshing.
26344 pDC pointer to device context to use
26348 ---------------------------------------------------------------------------*/
26349 void paintHorizontalLines(RectCoords* pRectToDraw, CDC* pDC );
26351 /*---------------------------------------------------------------------------
26352 FUNCTION : PAINTHORIZONTALLINES
26353 DESCRIPTION : responsible for painting the grids horizontal lines
26354 ARGUMENTS : name: xStart
26355 - the starting X co-ordinate for the horizontal line
26357 - the ending X co-ordinate for the horizontal line
26360 NOTES : Remember lines are drawn from origin. The origin in a
26361 horizontal viewport will be the top.
26362 ---------------------------------------------------------------------------*/
26363 void paintHorizontalLines( uint16 xStart, uint16 xEnd );
26366 #if defined _WINDOWS
26367 /*---------------------------------------------------------------------------
26368 FUNCTION : PAINTVERTICALLINES
26369 DESCRIPTION : responsible for painting the grids vertical lines
26370 ARGUMENTS : pRectToDraw pointer to rectangle that needs refreshing.
26372 offset offset from rhs that rightmost line would be
26373 drawn if rectangle included whole viewport
26374 pDC pointer to device context to use
26377 ---------------------------------------------------------------------------*/
26378 void paintVerticalLines( RectCoords* pRectToDraw, uint16 offset,
26381 /*---------------------------------------------------------------------------
26382 FUNCTION : PAINTVERTICALLINES
26383 DESCRIPTION : responsible for painting the grids vertical lines
26384 ARGUMENTS : name : yStart
26385 - the starting Y co-ordinate for the vertical line
26387 - the ending Y co-ordinate for the vertical line
26389 - a starting point offset that determines at what X
26390 position the first line will be drawn
26395 ---------------------------------------------------------------------------*/
26396 void paintVerticalLines( uint16 yStart, uint16 yEnd, uint16 offset );
26399 #if defined _WINDOWS
26400 /*---------------------------------------------------------------------------
26401 FUNCTION : PAINTVERTICALLINE
26402 DESCRIPTION : paints one line at the position specified, and length
26403 ARGUMENTS : name : yStart
26404 - the starting point on the y axis for the line
26406 - the end point on the y axis for the line
26408 - The horizontal offset from the start of the viewport
26409 pDC pointer to device context to use
26412 NOTES : There is not an equivalent horizontal method as yet. This
26413 is a seperate method because the service is useful to a
26414 derivation of this class
26415 ---------------------------------------------------------------------------*/
26416 void paintVerticalLine( uint16 yStart, uint16 yEnd
26417 , uint16 xPosition, CDC *pDC );
26419 /*---------------------------------------------------------------------------
26420 FUNCTION : PAINTVERTICALLINE
26421 DESCRIPTION : paints one line at the position specified, and length
26422 ARGUMENTS : name : yStart
26423 - the starting point on the y axis for the line
26425 - the end point on the y axis for the line
26427 - The horizontal offset from the start of the viewport
26430 NOTES : There is not an equivalent horizontal method as yet. This
26431 is a seperate method because the service is useful to a
26432 derivation of this class
26433 ---------------------------------------------------------------------------*/
26434 void paintVerticalLine( uint16 yStart, uint16 yEnd
26435 , uint16 xPosition );
26438 /*---------------------------------------------------------------------------
26439 INLINE FUNCTION : VERTICALSPACING
26440 NOTES : Description at the end of the file
26441 ---------------------------------------------------------------------------*/
26442 uint16 verticalSpacing( void );
26445 // Position in viewport that we are now writing to if going forwards
26446 // Note that if this is greater than viewport length then we have
26447 // just scrolled and value must be adjusted before use.
26448 sint16 forwardsOutputPosition;
26450 // Position in viewport that we are now writing to if going backwards
26451 // Note that if this is less than zero then we have
26452 // just scrolled and value must be adjusted before use.
26453 sint16 backwardsOutputPosition;
26455 // position in grid cycle of forwards output position.
26456 // if zero then it is time to output a grid line
26457 sint16 forwardsIntervalCount;
26459 // position in grid cycle of forwards output position.
26460 // if zero then it is time to output a grid line
26461 sint16 backwardsIntervalCount;
26463 uint32 lastUpdateTimestamp;
26464 uint32 timeBase; // ticks per pixel
26465 uint16 currentOutputPosition;
26466 uint16 gridTimestampSpacing;
26467 uint16 intervalCount;
26468 uint16 horizontalTotal;
26470 #if defined PRINTING_SUPPORT
26471 uint16 numberOfGridMarkersPrinted;
26473 bool firstTime; // indicates first time through
26476 GkiLineType lineType;
26477 GkiColour gridColour;
26479 #if defined _WINDOWS
26480 uint16 ticksPerSec; // number of time ticks per second
26481 uint16 vSpacingMin; // minimum pixels per division along time axis
26482 CPen *pPen; // the pen to use for drawing in windows
26488 /*****************************************************************************
26489 I N L I N E F U N C T I O N S
26490 *****************************************************************************/
26492 /*---------------------------------------------------------------------------
26493 FUNCTION : HORIZONTALLINES
26494 DESCRIPTION : supplies the number of horizontal lines in the grid
26499 ---------------------------------------------------------------------------*/
26500 inline uint16 ScrollingGrid::horizontalLines( void )
26502 return( horizontalTotal );
26504 /*---------------------------------------------------------------------------
26505 FUNCTION : VERTICALSPACING
26506 DESCRIPTION : returns the distance between adjacent vertical lines
26511 ---------------------------------------------------------------------------*/
26512 inline uint16 ScrollingGrid::verticalSpacing( void )
26514 return( vSpacing );
26523 @DEV1194:DS4 Provision of major and minor grid lines
26528 /* \$""Header: /usr/local/repository/cmnsrc/review/src/sgrid.h,v 1.1 1997/04/02 11:20:05 colinl Exp \$ */
26531 * \$""Log: sgrid.h,v \$
26532 * Revision 1.1 1997/04/02 11:20:05 colinl
26535 * Tested By: Colin Law
26537 * Reason for Change: Initial Revision of all files
26539 * Design Change Details:
26545 ARGUMENTS : name : majorColour colour for major grid lines
26546 minorColour colour for minor grid lines
26547 sgLineType line type for minor grid lines
26548 yMajorGridLines number of major y lines on grid
26549 yMinorGridLines number of major y lines on grid
26552 ScrollingGrid( GkiColour majorColour, GkiColour minorColour,
26553 GkiLineType sgLineType,
26554 uint16 yMajorGridLines, uint16 yMinorGridLines,
26556 FUNCTION : DrawHorizontalGridLines
26558 DESCRIPTION : Draws major or minor grid lines
26559 ARGUMENTS : pDC device context
26561 numLines total lines required
26562 yLow, yHigh, xLow, xHigh rectangle to draw in
26566 ---------------------------------------------------------------------------*/
26567 void DrawHorizontalGridLines( CDC* pDC, CPen* pPen,
26569 uint16 yLow, uint16 yHigh, uint16 xLow, uint16 xHigh,
26572 /*---------------------------------------------------------------------------
26576 uint16 m_yMajorGridLines;
26577 uint16 m_yMinorGridLines;
26580 GkiLineType lineType; // line type for minor grid lines
26581 GkiColour m_majorColour;
26582 GkiColour m_minorColour;
26585 CPen *pMajorPen; // pen to use for drawing major grid lines
26586 CPen *pMinorPen; // pen to use for drawing minor grid lines
26588 @" > diffmerge2/sgrid.h,v
26590 # We have to put the RCS file in the repository by hand for
26592 mkdir ${CVSROOT_DIRNAME}/diffmerge2
26593 cp diffmerge2/sgrid.h,v ${CVSROOT_DIRNAME}/diffmerge2/sgrid.h,v
26595 dotest diffmerge2_co \
26596 "${testcvs} co diffmerge2" "${DOTSTAR}U ${DOTSTAR}"
26598 dotest diffmerge2_update \
26599 "${testcvs} update -j Review_Phase_2_Enhancements sgrid.h" \
26600 "${DOTSTAR}erging ${DOTSTAR}"
26601 # This is the one that counts -- there should be no output:
26602 dotest diffmerge2_diff \
26603 "${testcvs} diff -r Review_V1p3 sgrid.h" ''
26607 rm -rf ${CVSROOT_DIRNAME}/diffmerge2
26611 # Tests of "cvs release", particularly multiple arguments.
26612 # Other CVS release tests:
26613 # info-cleanup-0 for "cvs -n release".
26614 # ignore-193 for the text of the question that cvs release asks.
26615 # Also for interactions with cvsignore.
26616 # basicc: "-d .", global -Q, no arguments (is a noop),
26617 # "cvs release" without -d, multiple arguments.
26618 # dirs-4: repository directory has been deleted.
26619 # modules2-6: multiple arguments.
26621 # First the usual setup; create a directory first-dir.
26623 dotest release-1 "${testcvs} -q co -l ." ''
26625 dotest release-2 "${testcvs} add first-dir" \
26626 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
26629 dotest release-3 "${testcvs} add dir1" \
26630 "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
26632 dotest release-4 "${testcvs} add dir2" \
26633 "Directory ${CVSROOT_DIRNAME}/first-dir/dir2 added to the repository"
26636 dotest release-5 "${testcvs} add dir3" \
26637 "Directory ${CVSROOT_DIRNAME}/first-dir/dir2/dir3 added to the repository"
26640 dotest release-6 "${testcvs} release -d first-dir/dir2/dir3 first-dir/dir1" \
26641 "You have .0. altered files in this repository.
26642 Are you sure you want to release (and delete) directory .first-dir/dir2/dir3.: \
26643 You have .0. altered files in this repository.
26644 Are you sure you want to release (and delete) directory .first-dir/dir1.: " <<EOF
26648 dotest_fail release-7 "test -d first-dir/dir1" ''
26649 dotest_fail release-8 "test -d first-dir/dir2/dir3" ''
26650 dotest release-9 "${testcvs} update" \
26651 "${PROG} update: Updating \.
26652 ${PROG} update: Updating first-dir
26653 ${PROG} update: Updating first-dir/dir2"
26657 dotest release-10 "${testcvs} add dir1" \
26658 "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
26661 dotest release-11 "${testcvs} add dir3" \
26662 "Directory ${CVSROOT_DIRNAME}/first-dir/dir2/dir3 added to the repository"
26665 dotest release-12 "${testcvs} release first-dir/dir2/dir3 first-dir/dir1" \
26666 "You have .0. altered files in this repository.
26667 Are you sure you want to release directory .first-dir/dir2/dir3.: .. .release. aborted by user choice.
26668 You have .0. altered files in this repository.
26669 Are you sure you want to release directory .first-dir/dir1.: " <<EOF
26673 dotest release-13 "${testcvs} release first-dir/dir2/dir3 first-dir/dir2" \
26674 "You have .0. altered files in this repository.
26675 Are you sure you want to release directory .first-dir/dir2/dir3.: \
26676 You have .0. altered files in this repository.
26677 Are you sure you want to release directory .first-dir/dir2.: " <<EOF
26681 dotest release-14 "test -d first-dir/dir1" ''
26682 dotest release-15 "test -d first-dir/dir2/dir3" ''
26683 rm -rf first-dir/dir1 first-dir/dir2
26685 dotest release-16 "${testcvs} update" \
26686 "${PROG} update: Updating \.
26687 ${PROG} update: Updating first-dir"
26689 # Check to make sure release isn't overwriting a
26690 # CVS/Entries file in the current directory (using data
26691 # from the released directory).
26693 # cvs 1.11 (remote) fails on release-21 (a message about
26694 # chdir into the removed directory), although it seemingly
26695 # unedits and removes the directory correctly. If
26696 # you manually continue, it then fails on release-22 do
26697 # to the messed up CVS/Entries file from release-21.
26700 dotest release-18 "$testcvs add second-dir" \
26701 "Directory $CVSROOT_DIRNAME/first-dir/second-dir added to the repository"
26705 dotest release-19 "$testcvs -Q add file1"
26706 dotest release-20 '$testcvs -q ci -m add' \
26707 "RCS file: $CVSROOT_DIRNAME/first-dir/second-dir/file1,v
26710 $CVSROOT_DIRNAME/first-dir/second-dir/file1,v <-- file1
26711 initial revision: 1\.1
26713 dotest release-21 "$testcvs edit file1"
26715 dotest release-22 "echo yes | $testcvs release -d second-dir" \
26716 "You have \[0\] altered files in this repository.
26717 Are you sure you want to release (and delete) directory \`second-dir': "
26718 dotest release-23 "$testcvs -q update -d" "U second-dir/file1"
26719 dotest release-24 "$testcvs edit"
26722 rm -rf 1 $CVSROOT_DIRNAME/first-dir
26729 # Some tests of behavior which broke at one time or another when run
26730 # from case insensitive clients against case sensitive servers.
26732 # These tests are namned according to the following convention:
26734 # ci Client (sandbox filesystem) case Insensitive
26735 # cs Client (sandbox filesystem) case Sensitive
26736 # si Server (repository filesystem) case Insensitive
26737 # ss Server (repository filesystem) case Sensitive
26742 # First, we will expect different results for a few of these tests
26743 # based on whether the repository is on a case sensitive filesystem
26744 # or not and whether the sandbox is on a case sensitive filesystem or
26745 # not, so determine which cases we are dealing with:
26748 if cmp file FiLe >/dev/null; then
26749 client_sensitive=false
26753 if test -n "$remotehost"; then
26754 $CVS_RSH $remotehost 'echo file >file'
26755 $CVS_RSH $remotehost 'echo FiLe >FiLe'
26756 if $CVS_RSH $remotehost 'cmp file FiLe >/dev/null'; then
26757 server_sensitive=false
26762 server_sensitive=$client_sensitive
26765 # The first test (recase-1 & recase-2) is for a remove of a file then
26766 # a readd in a different case.
26767 mkdir $CVSROOT_DIRNAME/first-dir
26768 dotest recase-init-1 "$testcvs -Q co first-dir"
26771 echo this file has no content >file
26772 dotest recase-init-2 "$testcvs -Q add file"
26773 dotest recase-init-3 "$testcvs -Q ci -madd" \
26774 "RCS file: $CVSROOT_DIRNAME/first-dir/file,v
26777 $CVSROOT_DIRNAME/first-dir/file,v <-- file
26778 initial revision: 1\.1
26780 dotest recase-init-4 "$testcvs -Q tag first"
26782 # Now remove the file.
26783 dotest recase-init-5 "$testcvs -Q rm -f file"
26784 dotest recase-init-6 "$testcvs -Q ci -mrm" \
26786 $CVSROOT_DIRNAME/first-dir/file,v <-- file
26787 new revision: delete; previous revision: 1\.1
26790 # Now the test - readd in a different case.
26791 echo this file needs some content >FiLe
26792 if $server_sensitive; then
26793 dotest recase-1ss "$testcvs add FiLe" \
26794 "$PROG add: scheduling file \`FiLe' for addition
26795 $PROG add: use '$PROG commit' to add this file permanently"
26796 dotest recase-2ss "$testcvs -q ci -mrecase" \
26797 "RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
26800 $CVSROOT_DIRNAME/first-dir/FiLe,v <-- FiLe
26801 initial revision: 1\.1
26803 else # server insensitive
26804 dotest recase-1si "$testcvs add FiLe" \
26805 "$PROG add: Re-adding file \`FiLe' (in place of dead revision 1\.2)\.
26806 $PROG add: use '$PROG commit' to add this file permanently"
26807 dotest recase-2si "$testcvs -q ci -mrecase" \
26809 $CVSROOT_DIRNAME/first-dir/FiLe,v <-- FiLe
26810 new revision: 1\.3; previous revision: 1\.2
26814 # Now verify that a checkout will still work
26817 dotest recase-3 "$testcvs -q co first-dir" \
26821 # Prove that we can still get status and log information on
26822 # conflicting case files (1 in Attic, one in parent).
26824 if $client_sensitive; then
26827 else # client insensitive
26828 # Because FiLe is present on a case insensitive client, it is the
26829 # only one ever found and queried or altered.
26837 if $server_sensitive; then
26838 if $client_sensitive; then
26839 # Client finds Entry only for FiLe. Others returned by server.
26840 dotest recase-4sscs "$testcvs status file" \
26841 "===================================================================
26842 File: no file file Status: Up-to-date
26844 Working revision: No entry for file
26845 Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/Attic/file,v"
26846 dotest recase-5sscs "$testcvs log file" \
26848 RCS file: $CVSROOT_DIRNAME/first-dir/Attic/file,v
26856 keyword substitution: kv
26857 total revisions: 2; selected revisions: 2
26859 ----------------------------
26861 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: +0 -0
26863 ----------------------------
26865 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
26867 ============================================================================="
26868 dotest recase-6sscs "$testcvs status FiLe" \
26869 "===================================================================
26870 File: FiLe Status: Up-to-date
26872 Working revision: 1\.1.*
26873 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
26875 Sticky Date: (none)
26876 Sticky Options: (none)"
26877 dotest recase-7sscs "$testcvs log FiLe" \
26879 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
26886 keyword substitution: kv
26887 total revisions: 1; selected revisions: 1
26889 ----------------------------
26891 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
26893 ============================================================================="
26894 else # server sensitive && client insensitive
26895 # Client finds same Entry for file & FiLe.
26896 dotest recase-4ssci "$testcvs status file" \
26897 "===================================================================
26898 File: FiLe Status: Up-to-date
26900 Working revision: 1\.1.*
26901 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
26903 Sticky Date: (none)
26904 Sticky Options: (none)"
26905 dotest recase-5ssci "$testcvs log file" \
26907 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
26914 keyword substitution: kv
26915 total revisions: 1; selected revisions: 1
26917 ----------------------------
26919 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
26921 ============================================================================="
26922 dotest recase-6ss "$testcvs status FiLe" \
26923 "===================================================================
26924 File: FiLe Status: Up-to-date
26926 Working revision: 1\.1.*
26927 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
26929 Sticky Date: (none)
26930 Sticky Options: (none)"
26931 dotest recase-7ss "$testcvs log FiLe" \
26933 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
26940 keyword substitution: kv
26941 total revisions: 1; selected revisions: 1
26943 ----------------------------
26945 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
26947 ============================================================================="
26949 else # server insensitive
26950 # There is only one archive when the server is insensitive, but the
26951 # printed file/archive name can vary.
26952 dotest recase-4si "$testcvs status file" \
26953 "===================================================================
26954 File: $file Status: Up-to-date
26956 Working revision: 1\.3.*
26957 Repository revision: 1\.3 $CVSROOT_DIRNAME/first-dir/$file,v
26959 Sticky Date: (none)
26960 Sticky Options: (none)"
26961 dotest recase-5si "$testcvs log file" \
26963 RCS file: $CVSROOT_DIRNAME/first-dir/$file,v
26964 Working file: $file
26971 keyword substitution: kv
26972 total revisions: 3; selected revisions: 3
26974 ----------------------------
26976 date: [0-9/]* [0-9:]*; author: $username; state: Exp; lines: +1 -1
26978 ----------------------------
26980 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: +0 -0
26982 ----------------------------
26984 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
26986 ============================================================================="
26987 dotest recase-6si "$testcvs status FiLe" \
26988 "===================================================================
26989 File: FiLe Status: Up-to-date
26991 Working revision: 1\.3.*
26992 Repository revision: 1\.3 $CVSROOT_DIRNAME/first-dir/FiLe,v
26994 Sticky Date: (none)
26995 Sticky Options: (none)"
26996 dotest recase-7si "$testcvs log FiLe" \
26998 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
27006 keyword substitution: kv
27007 total revisions: 3; selected revisions: 3
27009 ----------------------------
27011 date: [0-9/]* [0-9:]*; author: $username; state: Exp; lines: +1 -1
27013 ----------------------------
27015 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: +0 -0
27017 ----------------------------
27019 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
27021 ============================================================================="
27024 # And when the file does not exist on the client, we go with the
27025 # client Entries match.
27026 if $client_sensitive && $server_sensitive; then
27027 dotest recase-8sscs "$testcvs status fIlE" \
27028 "$PROG status: nothing known about fIlE
27029 ===================================================================
27030 File: no file fIlE Status: Unknown
27032 Working revision: No entry for fIlE
27033 Repository revision: No revision control file"
27034 else # !$client_sensitive || !$server_sensitive
27035 dotest recase-8anyi "$testcvs status fIlE" \
27036 "===================================================================
27037 File: $fIlE Status: Up-to-date
27039 Working revision: 1\.[0-9]*.*
27040 Repository revision: 1\.[0-9]* $CVSROOT_DIRNAME/first-dir/$fIlE,v
27042 Sticky Date: (none)
27043 Sticky Options: (none)"
27047 if $server_sensitive; then
27048 dotest recase-9ss "$testcvs -q up -rfirst" \
27049 "$PROG update: FiLe is no longer in the repository
27052 if $client_sensitive; then
27053 dotest recase-10sscs "$testcvs -q up -A" \
27055 $PROG update: file is no longer in the repository"
27056 else # client insensitive
27057 # FIXCVS: This should remove the offending file first.
27058 dotest_fail recase-10ssci "$testcvs -q up -A" \
27059 "$PROG update: move away \./FiLe; it is in the way
27061 $PROG update: file is no longer in the repository"
27065 dotest recase-11ssci "$testcvs -q co first-dir" \
27071 # See what happens when cased names clash.
27075 if test -n "$remotehost"; then
27076 $CVS_RSH $remotehost "cp $CVSROOT_DIRNAME/first-dir/FiLe,v \
27077 $CVSROOT_DIRNAME/first-dir/FILE,v"
27079 cp $CVSROOT_DIRNAME/first-dir/FiLe,v \
27080 $CVSROOT_DIRNAME/first-dir/FILE,v
27083 if $client_sensitive; then
27084 dotest recase-12sscs "$testcvs -q up" "U FILE"
27085 else # client insensitive
27086 dotest_fail recase-12ssci "$testcvs -q up" \
27087 "$PROG update: move away \./FILE; it is in the way
27090 else # server insensitive
27091 dotest recase-9si "$testcvs -q up -rfirst" "U FiLe"
27092 dotest recase-10si "$testcvs -q up -A" "U FiLe"
27095 # Prove that we can still get status and log information on
27096 # conflicting case files (1 in Attic, two in parent).
27097 if $server_sensitive; then
27098 if $client_sensitive; then
27099 # Client finds Entry only for FiLe. Others returned by server.
27100 dotest recase-13sscs "$testcvs status file" \
27101 "===================================================================
27102 File: no file file Status: Up-to-date
27104 Working revision: No entry for file
27105 Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/Attic/file,v"
27106 dotest recase-14sscs "$testcvs log file" \
27108 RCS file: $CVSROOT_DIRNAME/first-dir/Attic/file,v
27116 keyword substitution: kv
27117 total revisions: 2; selected revisions: 2
27119 ----------------------------
27121 date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: +0 -0
27123 ----------------------------
27125 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
27127 ============================================================================="
27128 dotest recase-15sscs "$testcvs status FiLe" \
27129 "===================================================================
27130 File: FiLe Status: Up-to-date
27132 Working revision: 1\.1.*
27133 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
27135 Sticky Date: (none)
27136 Sticky Options: (none)"
27137 dotest recase-16sscs "$testcvs log FiLe" \
27139 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
27146 keyword substitution: kv
27147 total revisions: 1; selected revisions: 1
27149 ----------------------------
27151 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
27153 ============================================================================="
27154 dotest recase-17sscs "$testcvs status FILE" \
27155 "===================================================================
27156 File: FILE Status: Up-to-date
27158 Working revision: 1.1.*
27159 Repository revision: 1.1 ${CVSROOT_DIRNAME}/first-dir/FILE,v
27161 Sticky Date: (none)
27162 Sticky Options: (none)"
27163 dotest recase-18sscs "$testcvs log FILE" \
27165 RCS file: $CVSROOT_DIRNAME/first-dir/FILE,v
27172 keyword substitution: kv
27173 total revisions: 1; selected revisions: 1
27175 ----------------------------
27177 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
27179 ============================================================================="
27180 else # $server_sensitive && !$client_sensitive
27181 # Client finds same Entry for file & FiLe.
27182 dotest recase-13ssci "$testcvs status file" \
27183 "===================================================================
27184 File: FiLe Status: Up-to-date
27186 Working revision: 1\.1.*
27187 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
27189 Sticky Date: (none)
27190 Sticky Options: (none)"
27191 dotest recase-16ssci "$testcvs log FiLe" \
27193 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
27200 keyword substitution: kv
27201 total revisions: 1; selected revisions: 1
27203 ----------------------------
27205 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
27207 ============================================================================="
27208 dotest recase-17ssci "$testcvs status FILE" \
27209 "===================================================================
27210 File: FiLe Status: Up-to-date
27212 Working revision: 1\.1.*
27213 Repository revision: 1\.1 $CVSROOT_DIRNAME/first-dir/FiLe,v
27215 Sticky Date: (none)
27216 Sticky Options: (none)"
27217 dotest recase-18ssci "$testcvs log FILE" \
27219 RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
27226 keyword substitution: kv
27227 total revisions: 1; selected revisions: 1
27229 ----------------------------
27231 date: [0-9/]* [0-9:]*; author: $username; state: Exp;
27233 ============================================================================="
27235 else # !$server_sensitive
27236 # Skip these when the server is case insensitive - nothing
27237 # has changed since recase-[4-7]si
27241 if $client_sensitive && $server_sensitive; then
27242 dotest recase-19sscs "$testcvs status fIlE" \
27243 "$PROG status: nothing known about fIlE
27244 ===================================================================
27245 File: no file fIlE Status: Unknown
27247 Working revision: No entry for fIlE
27248 Repository revision: No revision control file"
27249 else # !$client_sensitive || !$server_sensitive
27250 dotest recase-19anyi "$testcvs status fIlE" \
27251 "===================================================================
27252 File: $fIlE Status: Up-to-date
27254 Working revision: 1\.[0-9]*.*
27255 Repository revision: 1\.[0-9]* $CVSROOT_DIRNAME/first-dir/$fIlE,v
27257 Sticky Date: (none)
27258 Sticky Options: (none)"
27261 # And last but not least, prove that a checkout is still possible.
27264 if $server_sensitive; then
27265 if $client_sensitive; then
27266 dotest recase-20sscs "$testcvs -q co first-dir" \
27269 else # $server_senstive && !$client_sensitive
27270 dotest_fail recase-20ssci "$testcvs -q co first-dir" \
27272 $PROG checkout: move away first-dir/FiLe; it is in the way
27275 else # !$server_sensitive
27276 # Skip these since nothing has changed.
27281 echo Keeping ${TESTDIR} and exiting due to --keep
27287 if $server_sensitive && test -n "$remotehost"; then
27288 # It is necessary to remove one of the case-conflicted files before
27289 # recursively removing the rest under Cygwin on a Samba share or
27290 # Samba returns a permission denied error due to its case
27292 $CVS_RSH $remotehost "rm -f $CVSROOT_DIRNAME/first-dir/FILE,v"
27294 rm -rf $CVSROOT_DIRNAME/first-dir
27301 # set up two repositories
27304 CVSROOT1_DIRNAME=${TESTDIR}/root1
27305 CVSROOT2_DIRNAME=${TESTDIR}/root2
27306 CVSROOT1=`newroot $CVSROOT1_DIRNAME`
27307 CVSROOT2=`newroot $CVSROOT2_DIRNAME`
27308 testcvs1="${testcvs} -d ${CVSROOT1}"
27309 testcvs2="${testcvs} -d ${CVSROOT2}"
27311 dotest multiroot-setup-1 "mkdir $CVSROOT1_DIRNAME $CVSROOT2_DIRNAME"
27312 dotest multiroot-setup-2 "$testcvs -d$CVSROOT1_DIRNAME init"
27313 dotest multiroot-setup-3 "$testcvs -d$CVSROOT2_DIRNAME init"
27316 # create some directories in root1
27319 dotest multiroot-setup-4 "${testcvs1} co -l ." \
27320 "${PROG} checkout: Updating ."
27321 mkdir mod1-1 mod1-2
27322 dotest multiroot-setup-5 "${testcvs1} add mod1-1 mod1-2" \
27323 "Directory ${CVSROOT1_DIRNAME}/mod1-1 added to the repository
27324 Directory ${CVSROOT1_DIRNAME}/mod1-2 added to the repository"
27325 echo file1-1 > mod1-1/file1-1
27326 echo file1-2 > mod1-2/file1-2
27327 dotest multiroot-setup-6 "${testcvs1} add mod1-1/file1-1 mod1-2/file1-2" \
27328 "${PROG} add: scheduling file .mod1-1/file1-1. for addition
27329 ${PROG} add: scheduling file .mod1-2/file1-2. for addition
27330 ${PROG} add: use .${PROG} commit. to add these files permanently"
27331 dotest multiroot-setup-7 "${testcvs1} commit -m is" \
27332 "${PROG} [a-z]*: Examining \.
27333 ${PROG} [a-z]*: Examining mod1-1
27334 ${PROG} [a-z]*: Examining mod1-2
27335 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
27337 Checking in mod1-1/file1-1;
27338 ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v <-- file1-1
27339 initial revision: 1.1
27341 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
27343 Checking in mod1-2/file1-2;
27344 ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v <-- file1-2
27345 initial revision: 1.1
27351 # create some directories in root2
27354 dotest multiroot-setup-8 "${testcvs2} co -l ." \
27355 "${PROG} checkout: Updating ."
27356 mkdir mod2-1 mod2-2
27357 dotest multiroot-setup-9 "${testcvs2} add mod2-1 mod2-2" \
27358 "Directory ${CVSROOT2_DIRNAME}/mod2-1 added to the repository
27359 Directory ${CVSROOT2_DIRNAME}/mod2-2 added to the repository"
27360 echo file2-1 > mod2-1/file2-1
27361 echo file2-2 > mod2-2/file2-2
27362 dotest multiroot-setup-6 "${testcvs2} add mod2-1/file2-1 mod2-2/file2-2" \
27363 "${PROG} add: scheduling file .mod2-1/file2-1. for addition
27364 ${PROG} add: scheduling file .mod2-2/file2-2. for addition
27365 ${PROG} add: use .${PROG} commit. to add these files permanently"
27366 dotest multiroot-setup-10 "${testcvs2} commit -m anyone" \
27367 "${PROG} [a-z]*: Examining \.
27368 ${PROG} [a-z]*: Examining mod2-1
27369 ${PROG} [a-z]*: Examining mod2-2
27370 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
27372 Checking in mod2-1/file2-1;
27373 ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v <-- file2-1
27374 initial revision: 1.1
27376 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
27378 Checking in mod2-2/file2-2;
27379 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v <-- file2-2
27380 initial revision: 1.1
27385 # check out a few directories, from simple/shallow to
27389 # OK, this case is kind of weird. If we just run things from
27390 # here, without CVS/Root, then CVS will contact the server
27391 # mentioned in CVSROOT (which is irrelevant) which will print
27392 # some messages. Our workaround is to make sure we have a
27393 # CVS/Root file at top level. In the future, it is possible
27394 # the best behavior will be to extend the existing behavior
27395 # ("being called from a directory without CVS administration
27396 # has always meant to process each of the sub-dirs") to also
27397 # do that if there is no CVSROOT, CVS/Root, or -d at top level.
27399 # The local case could stumble through the tests without creating
27400 # the top-level CVS/Root, but we create it for local and for
27401 # remote to reduce special cases later in the test.
27402 dotest multiroot-workaround "${testcvs1} -q co -l ." ""
27404 dotest multiroot-setup-11 "${testcvs1} co mod1-1 mod1-2" \
27405 "${PROG} checkout: Updating mod1-1
27407 ${PROG} checkout: Updating mod1-2
27409 dotest multiroot-setup-12 "${testcvs2} co mod2-1 mod2-2" \
27410 "${PROG} checkout: Updating mod2-1
27412 ${PROG} checkout: Updating mod2-2
27415 dotest multiroot-setup-13 "${testcvs2} co mod2-2" \
27416 "${PROG} checkout: Updating mod2-2
27420 dotest multiroot-setup-14 "${testcvs1} co mod1-2" \
27421 "${PROG} checkout: Updating mod1-2
27426 # Make sure that the Root and Repository files contain the
27427 # correct information.
27429 dotest multiroot-cvsadm-1a "cat mod1-1/CVS/Root" "${CVSROOT1}"
27430 dotest multiroot-cvsadm-1b "cat mod1-1/CVS/Repository" "mod1-1"
27431 dotest multiroot-cvsadm-2a "cat mod2-1/CVS/Root" "${CVSROOT2}"
27432 dotest multiroot-cvsadm-2b "cat mod2-1/CVS/Repository" "mod2-1"
27433 dotest multiroot-cvsadm-3a "cat mod1-2/CVS/Root" "${CVSROOT1}"
27434 dotest multiroot-cvsadm-3b "cat mod1-2/CVS/Repository" "mod1-2"
27435 dotest multiroot-cvsadm-3c "cat mod1-2/mod2-2/CVS/Root" "${CVSROOT2}"
27436 dotest multiroot-cvsadm-3d "cat mod1-2/mod2-2/CVS/Repository" "mod2-2"
27437 dotest multiroot-cvsadm-4a "cat mod2-2/CVS/Root" "${CVSROOT2}"
27438 dotest multiroot-cvsadm-4b "cat mod2-2/CVS/Repository" "mod2-2"
27439 dotest multiroot-cvsadm-4c "cat mod2-2/mod1-2/CVS/Root" "${CVSROOT1}"
27440 dotest multiroot-cvsadm-4d "cat mod2-2/mod1-2/CVS/Repository" "mod1-2"
27443 # Start testing various cvs commands. Begin with commands
27444 # without extra arguments (e.g. "cvs update", "cvs diff",
27448 # Do at least one command with both CVSROOTs to make sure
27449 # that there's not some kind of unexpected dependency on the
27450 # choice of which CVSROOT is specified on the command line.
27452 dotest multiroot-update-1a "${testcvs1} update" \
27453 "${PROG} update: Updating \.
27454 ${PROG} update: Updating mod1-1
27455 ${PROG} update: Updating mod1-2
27456 ${PROG} update: Updating mod1-2/mod2-2
27457 ${PROG} update: cannot open directory ${CVSROOT1_DIRNAME}/mod2-2: No such file or directory
27458 ${PROG} update: skipping directory mod1-2/mod2-2
27459 ${PROG} update: Updating mod2-1
27460 ${PROG} update: cannot open directory ${CVSROOT1_DIRNAME}/mod2-1: No such file or directory
27461 ${PROG} update: skipping directory mod2-1
27462 ${PROG} update: Updating mod2-2
27463 ${PROG} update: cannot open directory ${CVSROOT1_DIRNAME}/mod2-2: No such file or directory
27464 ${PROG} update: skipping directory mod2-2"
27466 # Same deal but with -d ${CVSROOT2}.
27467 dotest multiroot-update-1b "${testcvs2} update" \
27468 "${PROG} update: Updating \.
27469 ${PROG} update: Updating mod1-1
27470 ${PROG} update: cannot open directory ${CVSROOT2_DIRNAME}/mod1-1: No such file or directory
27471 ${PROG} update: skipping directory mod1-1
27472 ${PROG} update: Updating mod1-2
27473 ${PROG} update: cannot open directory ${CVSROOT2_DIRNAME}/mod1-2: No such file or directory
27474 ${PROG} update: skipping directory mod1-2
27475 ${PROG} update: Updating mod2-1
27476 ${PROG} update: Updating mod2-2
27477 ${PROG} update: Updating mod2-2/mod1-2
27478 ${PROG} update: cannot open directory ${CVSROOT2_DIRNAME}/mod1-2: No such file or directory
27479 ${PROG} update: skipping directory mod2-2/mod1-2"
27481 # modify all files and do a diff
27483 echo bobby >> mod1-1/file1-1
27484 echo brown >> mod1-2/file1-2
27485 echo goes >> mod2-1/file2-1
27486 echo down >> mod2-2/file2-2
27488 dotest_fail multiroot-diff-1 "${testcvs} diff" \
27489 "${PROG} diff: Diffing \.
27490 ${PROG} diff: Diffing mod1-1
27491 Index: mod1-1/file1-1
27492 ===================================================================
27493 RCS file: ${TESTDIR}/root1/mod1-1/file1-1,v
27494 retrieving revision 1\.1
27495 diff -r1\.1 file1-1
27498 ${PROG} diff: Diffing mod1-2
27499 Index: mod1-2/file1-2
27500 ===================================================================
27501 RCS file: ${TESTDIR}/root1/mod1-2/file1-2,v
27502 retrieving revision 1\.1
27503 diff -r1\.1 file1-2
27506 ${PROG} diff: Diffing mod2-2/mod1-2
27507 ${PROG} diff: Diffing mod1-2/mod2-2
27508 ${PROG} diff: Diffing mod2-1
27509 Index: mod2-1/file2-1
27510 ===================================================================
27511 RCS file: ${TESTDIR}/root2/mod2-1/file2-1,v
27512 retrieving revision 1\.1
27513 diff -r1\.1 file2-1
27516 ${PROG} diff: Diffing mod2-2
27517 Index: mod2-2/file2-2
27518 ===================================================================
27519 RCS file: ${TESTDIR}/root2/mod2-2/file2-2,v
27520 retrieving revision 1\.1
27521 diff -r1\.1 file2-2
27524 "${PROG} diff: Diffing \.
27525 ${PROG} diff: Diffing mod1-1
27526 Index: mod1-1/file1-1
27527 ===================================================================
27528 RCS file: ${TESTDIR}/root1/mod1-1/file1-1,v
27529 retrieving revision 1\.1
27530 diff -r1\.1 file1-1
27533 ${PROG} diff: Diffing mod1-2
27534 Index: mod1-2/file1-2
27535 ===================================================================
27536 RCS file: ${TESTDIR}/root1/mod1-2/file1-2,v
27537 retrieving revision 1\.1
27538 diff -r1\.1 file1-2
27541 ${PROG} diff: Diffing mod2-2
27542 ${PROG} diff: Diffing mod2-2/mod1-2
27543 ${PROG} diff: Diffing mod1-2
27544 ${PROG} diff: Diffing mod1-2/mod2-2
27545 ${PROG} diff: Diffing mod2-1
27546 Index: mod2-1/file2-1
27547 ===================================================================
27548 RCS file: ${TESTDIR}/root2/mod2-1/file2-1,v
27549 retrieving revision 1\.1
27550 diff -r1\.1 file2-1
27553 ${PROG} diff: Diffing mod2-2
27554 Index: mod2-2/file2-2
27555 ===================================================================
27556 RCS file: ${TESTDIR}/root2/mod2-2/file2-2,v
27557 retrieving revision 1\.1
27558 diff -r1\.1 file2-2
27562 dotest multiroot-commit-1 "${testcvs} commit -m actually" \
27563 "${PROG} [a-z]*: Examining \.
27564 ${PROG} [a-z]*: Examining mod1-1
27565 ${PROG} [a-z]*: Examining mod1-2
27566 ${PROG} [a-z]*: Examining mod2-2/mod1-2
27567 Checking in mod1-1/file1-1;
27568 ${TESTDIR}/root1/mod1-1/file1-1,v <-- file1-1
27569 new revision: 1.2; previous revision: 1.1
27571 Checking in mod1-2/file1-2;
27572 ${TESTDIR}/root1/mod1-2/file1-2,v <-- file1-2
27573 new revision: 1.2; previous revision: 1.1
27575 ${PROG} [a-z]*: Examining mod1-2/mod2-2
27576 ${PROG} [a-z]*: Examining mod2-1
27577 ${PROG} [a-z]*: Examining mod2-2
27578 Checking in mod2-1/file2-1;
27579 ${TESTDIR}/root2/mod2-1/file2-1,v <-- file2-1
27580 new revision: 1.2; previous revision: 1.1
27582 Checking in mod2-2/file2-2;
27583 ${TESTDIR}/root2/mod2-2/file2-2,v <-- file2-2
27584 new revision: 1.2; previous revision: 1.1
27587 dotest multiroot-update-2 "${testcvs} update" \
27588 "${PROG} update: Updating \.
27589 ${PROG} [a-z]*: Updating mod1-1
27590 ${PROG} [a-z]*: Updating mod1-2
27591 ${PROG} [a-z]*: Updating mod2-2/mod1-2
27592 U mod2-2/mod1-2/file1-2
27593 ${PROG} [a-z]*: Updating mod1-2/mod2-2
27594 U mod1-2/mod2-2/file2-2
27595 ${PROG} update: Updating mod2-1
27596 ${PROG} update: Updating mod2-2" \
27597 "${PROG} update: Updating \.
27598 ${PROG} update: Updating mod1-1
27599 ${PROG} update: Updating mod1-2
27600 ${PROG} update: Updating mod2-2
27601 ${PROG} update: Updating mod2-2/mod1-2
27602 P mod2-2/mod1-2/file1-2
27603 ${PROG} update: Updating mod1-2
27604 ${PROG} update: Updating mod1-2/mod2-2
27605 P mod1-2/mod2-2/file2-2
27606 ${PROG} update: Updating mod2-1
27607 ${PROG} update: Updating mod2-2"
27609 dotest multiroot-tag-1 "${testcvs} tag cattle" \
27610 "${PROG} tag: Tagging \.
27611 ${PROG} tag: Tagging mod1-1
27613 ${PROG} tag: Tagging mod1-2
27615 ${PROG} tag: Tagging mod2-2/mod1-2
27616 ${PROG} tag: Tagging mod1-2/mod2-2
27617 T mod1-2/mod2-2/file2-2
27618 ${PROG} tag: Tagging mod2-1
27620 ${PROG} tag: Tagging mod2-2" \
27621 "${PROG} tag: Tagging \.
27622 ${PROG} tag: Tagging mod1-1
27624 ${PROG} tag: Tagging mod1-2
27626 ${PROG} tag: Tagging mod2-2
27627 ${PROG} tag: Tagging mod2-2/mod1-2
27628 ${PROG} tag: Tagging mod1-2
27629 ${PROG} tag: Tagging mod1-2/mod2-2
27630 T mod1-2/mod2-2/file2-2
27631 ${PROG} tag: Tagging mod2-1
27633 ${PROG} tag: Tagging mod2-2"
27635 echo anotherfile1-1 > mod1-1/anotherfile1-1
27636 echo anotherfile2-1 > mod2-1/anotherfile2-1
27637 echo anotherfile1-2 > mod2-2/mod1-2/anotherfile1-2
27638 echo anotherfile2-2 > mod1-2/mod2-2/anotherfile2-2
27642 dotest multiroot-add-1ar "${testcvs} add anotherfile1-1" \
27643 "${PROG} add: scheduling file .anotherfile1-1. for addition
27644 ${PROG} add: use .${PROG} commit. to add this file permanently"
27646 dotest multiroot-add-1br "${testcvs} add anotherfile2-1" \
27647 "${PROG} add: scheduling file .anotherfile2-1. for addition
27648 ${PROG} add: use .${PROG} commit. to add this file permanently"
27649 cd ../mod2-2/mod1-2
27650 dotest multiroot-add-1cr "${testcvs} add anotherfile1-2" \
27651 "${PROG} add: scheduling file .anotherfile1-2. for addition
27652 ${PROG} add: use .${PROG} commit. to add this file permanently"
27653 cd ../../mod1-2/mod2-2
27654 dotest multiroot-add-1dr "${testcvs} add anotherfile2-2" \
27655 "${PROG} add: scheduling file .anotherfile2-2. for addition
27656 ${PROG} add: use .${PROG} commit. to add this file permanently"
27659 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" \
27660 "${PROG} add: scheduling file .mod1-1/anotherfile1-1. for addition
27661 ${PROG} add: scheduling file .mod2-1/anotherfile2-1. for addition
27662 ${PROG} add: scheduling file .mod2-2/mod1-2/anotherfile1-2. for addition
27663 ${PROG} add: scheduling file .mod1-2/mod2-2/anotherfile2-2. for addition
27664 ${PROG} add: use .${PROG} commit. to add these files permanently"
27667 dotest multiroot-status-1 "${testcvs} status -v" \
27668 "${PROG} status: Examining \.
27669 ${PROG} status: Examining mod1-1
27670 ===================================================================
27671 File: anotherfile1-1 Status: Locally Added
27673 Working revision: New file!
27674 Repository revision: No revision control file
27676 Sticky Date: (none)
27677 Sticky Options: (none)
27679 ===================================================================
27680 File: file1-1 Status: Up-to-date
27682 Working revision: 1\.2.*
27683 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
27685 Sticky Date: (none)
27686 Sticky Options: (none)
27689 cattle (revision: 1\.2)
27691 ${PROG} status: Examining mod1-2
27692 ===================================================================
27693 File: file1-2 Status: Up-to-date
27695 Working revision: 1\.2.*
27696 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
27698 Sticky Date: (none)
27699 Sticky Options: (none)
27702 cattle (revision: 1\.2)
27704 ${PROG} status: Examining mod2-2/mod1-2
27705 ===================================================================
27706 File: anotherfile1-2 Status: Locally Added
27708 Working revision: New file!
27709 Repository revision: No revision control file
27711 Sticky Date: (none)
27712 Sticky Options: (none)
27714 ===================================================================
27715 File: file1-2 Status: Up-to-date
27717 Working revision: 1\.2.*
27718 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
27720 Sticky Date: (none)
27721 Sticky Options: (none)
27724 cattle (revision: 1\.2)
27726 ${PROG} status: Examining mod1-2/mod2-2
27727 ===================================================================
27728 File: anotherfile2-2 Status: Locally Added
27730 Working revision: New file!
27731 Repository revision: No revision control file
27733 Sticky Date: (none)
27734 Sticky Options: (none)
27736 ===================================================================
27737 File: file2-2 Status: Up-to-date
27739 Working revision: 1\.2.*
27740 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
27742 Sticky Date: (none)
27743 Sticky Options: (none)
27746 cattle (revision: 1\.2)
27748 ${PROG} status: Examining mod2-1
27749 ===================================================================
27750 File: anotherfile2-1 Status: Locally Added
27752 Working revision: New file!
27753 Repository revision: No revision control file
27755 Sticky Date: (none)
27756 Sticky Options: (none)
27758 ===================================================================
27759 File: file2-1 Status: Up-to-date
27761 Working revision: 1\.2.*
27762 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
27764 Sticky Date: (none)
27765 Sticky Options: (none)
27768 cattle (revision: 1\.2)
27770 ${PROG} status: Examining mod2-2
27771 ===================================================================
27772 File: file2-2 Status: Up-to-date
27774 Working revision: 1\.2.*
27775 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
27777 Sticky Date: (none)
27778 Sticky Options: (none)
27781 cattle (revision: 1\.2)" \
27782 "${PROG} status: Examining \.
27783 ${PROG} status: Examining mod1-1
27784 ===================================================================
27785 File: anotherfile1-1 Status: Locally Added
27787 Working revision: New file!
27788 Repository revision: No revision control file
27790 Sticky Date: (none)
27791 Sticky Options: (none)
27793 ===================================================================
27794 File: file1-1 Status: Up-to-date
27796 Working revision: 1\.2.*
27797 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
27799 Sticky Date: (none)
27800 Sticky Options: (none)
27803 cattle (revision: 1\.2)
27805 ${PROG} status: Examining mod1-2
27806 ===================================================================
27807 File: file1-2 Status: Up-to-date
27809 Working revision: 1\.2.*
27810 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
27812 Sticky Date: (none)
27813 Sticky Options: (none)
27816 cattle (revision: 1\.2)
27818 ${PROG} status: Examining mod2-2
27819 ${PROG} status: Examining mod2-2/mod1-2
27820 ===================================================================
27821 File: anotherfile1-2 Status: Locally Added
27823 Working revision: New file!
27824 Repository revision: No revision control file
27826 Sticky Date: (none)
27827 Sticky Options: (none)
27829 ===================================================================
27830 File: file1-2 Status: Up-to-date
27832 Working revision: 1\.2.*
27833 Repository revision: 1\.2 ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
27835 Sticky Date: (none)
27836 Sticky Options: (none)
27839 cattle (revision: 1\.2)
27841 ${PROG} status: Examining mod1-2
27842 ${PROG} status: Examining mod1-2/mod2-2
27843 ===================================================================
27844 File: anotherfile2-2 Status: Locally Added
27846 Working revision: New file!
27847 Repository revision: No revision control file
27849 Sticky Date: (none)
27850 Sticky Options: (none)
27852 ===================================================================
27853 File: file2-2 Status: Up-to-date
27855 Working revision: 1\.2.*
27856 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
27858 Sticky Date: (none)
27859 Sticky Options: (none)
27862 cattle (revision: 1\.2)
27864 ${PROG} status: Examining mod2-1
27865 ===================================================================
27866 File: anotherfile2-1 Status: Locally Added
27868 Working revision: New file!
27869 Repository revision: No revision control file
27871 Sticky Date: (none)
27872 Sticky Options: (none)
27874 ===================================================================
27875 File: file2-1 Status: Up-to-date
27877 Working revision: 1\.2.*
27878 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
27880 Sticky Date: (none)
27881 Sticky Options: (none)
27884 cattle (revision: 1\.2)
27886 ${PROG} status: Examining mod2-2
27887 ===================================================================
27888 File: file2-2 Status: Up-to-date
27890 Working revision: 1\.2.*
27891 Repository revision: 1\.2 ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
27893 Sticky Date: (none)
27894 Sticky Options: (none)
27897 cattle (revision: 1\.2)"
27899 dotest multiroot-commit-2 "${testcvs} commit -m reading" \
27900 "${PROG} [a-z]*: Examining \.
27901 ${PROG} [a-z]*: Examining mod1-1
27902 ${PROG} [a-z]*: Examining mod1-2
27903 ${PROG} [a-z]*: Examining mod2-2/mod1-2
27904 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v
27906 Checking in mod1-1/anotherfile1-1;
27907 ${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v <-- anotherfile1-1
27908 initial revision: 1\.1
27910 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
27912 Checking in mod2-2/mod1-2/anotherfile1-2;
27913 ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v <-- anotherfile1-2
27914 initial revision: 1\.1
27916 ${PROG} [a-z]*: Examining mod1-2/mod2-2
27917 ${PROG} [a-z]*: Examining mod2-1
27918 ${PROG} [a-z]*: Examining mod2-2
27919 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
27921 Checking in mod1-2/mod2-2/anotherfile2-2;
27922 ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v <-- anotherfile2-2
27923 initial revision: 1\.1
27925 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v
27927 Checking in mod2-1/anotherfile2-1;
27928 ${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v <-- anotherfile2-1
27929 initial revision: 1\.1
27932 dotest multiroot-update-3 "${testcvs} update" \
27933 "${PROG} update: Updating \.
27934 ${PROG} [a-z]*: Updating mod1-1
27935 ${PROG} [a-z]*: Updating mod1-2
27936 U mod1-2/anotherfile1-2
27937 ${PROG} [a-z]*: Updating mod2-2/mod1-2
27938 ${PROG} [a-z]*: Updating mod1-2/mod2-2
27939 ${PROG} [a-z]*: Updating mod2-1
27940 ${PROG} [a-z]*: Updating mod2-2
27941 U mod2-2/anotherfile2-2" \
27942 "${PROG} update: Updating \.
27943 ${PROG} update: Updating mod1-1
27944 ${PROG} update: Updating mod1-2
27945 U mod1-2/anotherfile1-2
27946 ${PROG} update: Updating mod2-2
27947 ${PROG} update: Updating mod2-2/mod1-2
27948 ${PROG} update: Updating mod1-2
27949 ${PROG} update: Updating mod1-2/mod2-2
27950 ${PROG} update: Updating mod2-1
27951 ${PROG} update: Updating mod2-2
27952 U mod2-2/anotherfile2-2"
27954 dotest multiroot-log-1 "${testcvs} log" \
27955 "${PROG} log: Logging \.
27956 ${PROG} log: Logging mod1-1
27958 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v
27959 Working file: mod1-1/anotherfile1-1
27965 keyword substitution: kv
27966 total revisions: 1; selected revisions: 1
27968 ----------------------------
27970 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
27972 =============================================================================
27974 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
27975 Working file: mod1-1/file1-1
27982 keyword substitution: kv
27983 total revisions: 2; selected revisions: 2
27985 ----------------------------
27987 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
27989 ----------------------------
27991 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
27993 =============================================================================
27994 ${PROG} log: Logging mod1-2
27996 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
27997 Working file: mod1-2/anotherfile1-2
28003 keyword substitution: kv
28004 total revisions: 1; selected revisions: 1
28006 ----------------------------
28008 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28010 =============================================================================
28012 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
28013 Working file: mod1-2/file1-2
28020 keyword substitution: kv
28021 total revisions: 2; selected revisions: 2
28023 ----------------------------
28025 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28027 ----------------------------
28029 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28031 =============================================================================
28032 ${PROG} log: Logging mod2-2/mod1-2
28034 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
28035 Working file: mod2-2/mod1-2/anotherfile1-2
28041 keyword substitution: kv
28042 total revisions: 1; selected revisions: 1
28044 ----------------------------
28046 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28048 =============================================================================
28050 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
28051 Working file: mod2-2/mod1-2/file1-2
28058 keyword substitution: kv
28059 total revisions: 2; selected revisions: 2
28061 ----------------------------
28063 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28065 ----------------------------
28067 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28069 =============================================================================
28070 ${PROG} log: Logging mod1-2/mod2-2
28072 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
28073 Working file: mod1-2/mod2-2/anotherfile2-2
28079 keyword substitution: kv
28080 total revisions: 1; selected revisions: 1
28082 ----------------------------
28084 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28086 =============================================================================
28088 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
28089 Working file: mod1-2/mod2-2/file2-2
28096 keyword substitution: kv
28097 total revisions: 2; selected revisions: 2
28099 ----------------------------
28101 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28103 ----------------------------
28105 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28107 =============================================================================
28108 ${PROG} log: Logging mod2-1
28110 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v
28111 Working file: mod2-1/anotherfile2-1
28117 keyword substitution: kv
28118 total revisions: 1; selected revisions: 1
28120 ----------------------------
28122 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28124 =============================================================================
28126 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
28127 Working file: mod2-1/file2-1
28134 keyword substitution: kv
28135 total revisions: 2; selected revisions: 2
28137 ----------------------------
28139 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28141 ----------------------------
28143 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28145 =============================================================================
28146 ${PROG} log: Logging mod2-2
28148 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
28149 Working file: mod2-2/anotherfile2-2
28155 keyword substitution: kv
28156 total revisions: 1; selected revisions: 1
28158 ----------------------------
28160 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28162 =============================================================================
28164 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
28165 Working file: mod2-2/file2-2
28172 keyword substitution: kv
28173 total revisions: 2; selected revisions: 2
28175 ----------------------------
28177 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28179 ----------------------------
28181 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28183 =============================================================================" \
28184 "${PROG} log: Logging \.
28185 ${PROG} log: Logging mod1-1
28187 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v
28188 Working file: mod1-1/anotherfile1-1
28194 keyword substitution: kv
28195 total revisions: 1; selected revisions: 1
28197 ----------------------------
28199 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28201 =============================================================================
28203 RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
28204 Working file: mod1-1/file1-1
28211 keyword substitution: kv
28212 total revisions: 2; selected revisions: 2
28214 ----------------------------
28216 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28218 ----------------------------
28220 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28222 =============================================================================
28223 ${PROG} log: Logging mod1-2
28225 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
28226 Working file: mod1-2/anotherfile1-2
28232 keyword substitution: kv
28233 total revisions: 1; selected revisions: 1
28235 ----------------------------
28237 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28239 =============================================================================
28241 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
28242 Working file: mod1-2/file1-2
28249 keyword substitution: kv
28250 total revisions: 2; selected revisions: 2
28252 ----------------------------
28254 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28256 ----------------------------
28258 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28260 =============================================================================
28261 ${PROG} log: Logging mod2-2
28262 ${PROG} log: Logging mod2-2/mod1-2
28264 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
28265 Working file: mod2-2/mod1-2/anotherfile1-2
28271 keyword substitution: kv
28272 total revisions: 1; selected revisions: 1
28274 ----------------------------
28276 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28278 =============================================================================
28280 RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
28281 Working file: mod2-2/mod1-2/file1-2
28288 keyword substitution: kv
28289 total revisions: 2; selected revisions: 2
28291 ----------------------------
28293 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28295 ----------------------------
28297 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28299 =============================================================================
28300 ${PROG} log: Logging mod1-2
28301 ${PROG} log: Logging mod1-2/mod2-2
28303 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
28304 Working file: mod1-2/mod2-2/anotherfile2-2
28310 keyword substitution: kv
28311 total revisions: 1; selected revisions: 1
28313 ----------------------------
28315 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28317 =============================================================================
28319 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
28320 Working file: mod1-2/mod2-2/file2-2
28327 keyword substitution: kv
28328 total revisions: 2; selected revisions: 2
28330 ----------------------------
28332 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28334 ----------------------------
28336 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28338 =============================================================================
28339 ${PROG} log: Logging mod2-1
28341 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v
28342 Working file: mod2-1/anotherfile2-1
28348 keyword substitution: kv
28349 total revisions: 1; selected revisions: 1
28351 ----------------------------
28353 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28355 =============================================================================
28357 RCS file: ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
28358 Working file: mod2-1/file2-1
28365 keyword substitution: kv
28366 total revisions: 2; selected revisions: 2
28368 ----------------------------
28370 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28372 ----------------------------
28374 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28376 =============================================================================
28377 ${PROG} log: Logging mod2-2
28379 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
28380 Working file: mod2-2/anotherfile2-2
28386 keyword substitution: kv
28387 total revisions: 1; selected revisions: 1
28389 ----------------------------
28391 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28393 =============================================================================
28395 RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
28396 Working file: mod2-2/file2-2
28403 keyword substitution: kv
28404 total revisions: 2; selected revisions: 2
28406 ----------------------------
28408 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
28410 ----------------------------
28412 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
28414 ============================================================================="
28417 # After the simple cases, let's execute some commands which
28418 # refer to parts of our checked-out tree (e.g. "cvs update
28422 echo Keeping ${TESTDIR} and exiting due to --keep
28426 # clean up after ourselves
28430 # clean up our repositories
28435 # More multiroot tests. In particular, nested directories.
28437 CVSROOT1_DIRNAME=${TESTDIR}/root1
28438 CVSROOT2_DIRNAME=${TESTDIR}/root2
28439 CVSROOT1=`newroot $CVSROOT1_DIRNAME`
28440 CVSROOT2=`newroot $CVSROOT2_DIRNAME`
28442 dotest multiroot2-1 "$testcvs -d$CVSROOT1_DIRNAME init"
28443 dotest multiroot2-2 "$testcvs -d$CVSROOT2_DIRNAME init"
28445 mkdir imp-dir; cd imp-dir
28448 echo sfile >sdir/sfile
28450 echo ssfile >sdir/ssdir/ssfile
28451 dotest_sort multiroot2-3 \
28452 "${testcvs} -d ${CVSROOT1} import -m import-to-root1 dir1 vend rel" "
28456 N dir1/sdir/ssdir/ssfile
28457 No conflicts created by this import
28458 ${PROG} import: Importing ${TESTDIR}/root1/dir1/sdir
28459 ${PROG} import: Importing ${TESTDIR}/root1/dir1/sdir/ssdir"
28461 dotest_sort multiroot2-4 \
28462 "${testcvs} -d ${CVSROOT2} import -m import-to-root2 sdir vend2 rel2" "
28465 N sdir/ssdir/ssfile
28466 No conflicts created by this import
28467 ${PROG} import: Importing ${TESTDIR}/root2/sdir/ssdir"
28471 # Get TopLevelAdmin-like behavior.
28472 dotest multiroot2-5 "${testcvs} -d ${CVSROOT1} -q co -l ."
28473 dotest multiroot2-5 "${testcvs} -d ${CVSROOT1} -q co dir1" \
28476 U dir1/sdir/ssdir/ssfile"
28478 dotest multiroot2-6 "${testcvs} -Q release -d sdir" ""
28479 dotest multiroot2-7 "${testcvs} -d ${CVSROOT2} -q co sdir" \
28481 U sdir/ssdir/ssfile"
28483 # This has one subtle effect - it deals with Entries.Log
28484 # so that the next test doesn't get trace messages for
28486 dotest multiroot2-8 "${testcvs} update" \
28487 "${PROG} update: Updating \.
28488 ${PROG} update: Updating dir1
28489 ${PROG} update: Updating dir1/sdir
28490 ${PROG} update: Updating dir1/sdir/ssdir" \
28491 "${PROG} update: Updating \.
28492 ${PROG} update: Updating dir1
28493 ${PROG} update: Updating dir1
28494 ${PROG} update: Updating dir1/sdir
28495 ${PROG} update: Updating dir1/sdir/ssdir"
28496 # Two reasons we don't run this on the server: (1) the server
28497 # also prints some trace messages, and (2) the server trace
28498 # messages are subject to out-of-order bugs (this one is hard
28500 if $remote; then :; else
28501 dotest multiroot2-9a "${testcvs} -t update" \
28502 " *-> main loop with CVSROOT=${TESTDIR}/root1
28503 ${PROG} update: Updating \.
28504 *-> Reader_Lock(${TESTDIR}/root1)
28506 ${PROG} update: Updating dir1
28507 *-> Reader_Lock(${TESTDIR}/root1/dir1)
28509 *-> main loop with CVSROOT=${TESTDIR}/root2
28510 ${PROG} update: Updating dir1/sdir
28511 *-> Reader_Lock(${TESTDIR}/root2/sdir)
28513 ${PROG} update: Updating dir1/sdir/ssdir
28514 *-> Reader_Lock(${TESTDIR}/root2/sdir/ssdir)
28516 *-> Lock_Cleanup()"
28519 dotest multiroot2-9 "${testcvs} -q tag tag1" \
28522 T dir1/sdir/ssdir/ssfile"
28523 echo "change it" >>dir1/file1
28524 echo "change him too" >>dir1/sdir/sfile
28525 dotest multiroot2-10 "${testcvs} -q ci -m modify" \
28526 "Checking in dir1/file1;
28527 ${TESTDIR}/root1/dir1/file1,v <-- file1
28528 new revision: 1\.2; previous revision: 1\.1
28530 Checking in dir1/sdir/sfile;
28531 ${TESTDIR}/root2/sdir/sfile,v <-- sfile
28532 new revision: 1\.2; previous revision: 1\.1
28534 dotest multiroot2-11 "${testcvs} -q tag tag2" \
28537 T dir1/sdir/ssdir/ssfile"
28538 dotest_fail multiroot2-12 \
28539 "${testcvs} -q diff -u -r tag1 -r tag2" \
28541 ===================================================================
28542 RCS file: ${TESTDIR}/root1/dir1/file1,v
28543 retrieving revision 1\.1\.1\.1
28544 retrieving revision 1\.2
28545 diff -u -r1\.1\.1\.1 -r1\.2
28546 --- dir1/file1 ${RFCDATE} 1\.1\.1\.1
28547 ${PLUS}${PLUS}${PLUS} dir1/file1 ${RFCDATE} 1\.2
28548 @@ -1 ${PLUS}1,2 @@
28551 Index: dir1/sdir/sfile
28552 ===================================================================
28553 RCS file: ${TESTDIR}/root2/sdir/sfile,v
28554 retrieving revision 1\.1\.1\.1
28555 retrieving revision 1\.2
28556 diff -u -r1\.1\.1\.1 -r1\.2
28557 --- dir1/sdir/sfile ${RFCDATE} 1\.1\.1\.1
28558 ${PLUS}${PLUS}${PLUS} dir1/sdir/sfile ${RFCDATE} 1\.2
28559 @@ -1 ${PLUS}1,2 @@
28561 ${PLUS}change him too"
28564 echo Keeping ${TESTDIR} and exiting due to --keep
28568 # clean up after ourselves
28572 # clean up our repositories
28577 # More multiroot tests. Directories are side-by-side, not nested.
28578 # Not drastically different from multiroot but it covers somewhat
28581 CVSROOT1=`newroot ${TESTDIR}/root1`
28582 CVSROOT2=`newroot ${TESTDIR}/root2`
28585 dotest multiroot3-1 "$testcvs -d$TESTDIR/root1 init"
28586 dotest multiroot3-2 "${testcvs} -d ${CVSROOT1} -q co -l ." ""
28588 dotest multiroot3-3 "${testcvs} add dir1" \
28589 "Directory ${TESTDIR}/root1/dir1 added to the repository"
28590 dotest multiroot3-4 "$testcvs -d$TESTDIR/root2 init"
28592 dotest multiroot3-5 "${testcvs} -d ${CVSROOT2} -q co -l ." ""
28595 # OK, the problem is that CVS/Entries doesn't look quite right,
28596 # I suppose because of the "rm -r".
28597 # For local this fixes it up.
28598 dotest multiroot3-6 "${testcvs} -d ${CVSROOT1} -q co dir1" ""
28600 # For remote that doesn't do it. Use the quick and dirty fix.
28601 echo "D/dir1////" >CVS/Entries
28602 echo "D/dir2////" >>CVS/Entries
28605 dotest multiroot3-7 "${testcvs} add dir2" \
28606 "Directory ${TESTDIR}/root2/dir2 added to the repository"
28608 touch dir1/file1 dir2/file2
28610 # Trying to add them both in one command doesn't work,
28611 # because add.c doesn't do multiroot (it doesn't use recurse.c).
28612 # Furthermore, it can't deal with the parent directory
28613 # having a different root from the child, hence the cd.
28615 dotest multiroot3-8 "${testcvs} add file1" \
28616 "${PROG} add: scheduling file .file1. for addition
28617 ${PROG} add: use .${PROG} commit. to add this file permanently"
28619 dotest multiroot3-8a "${testcvs} add dir2/file2" \
28620 "${PROG} add: scheduling file .dir2/file2. for addition
28621 ${PROG} add: use .${PROG} commit. to add this file permanently"
28623 dotest multiroot3-8 "${testcvs} add dir1/file1 dir2/file2" \
28624 "${PROG} add: scheduling file .dir1/file1. for addition
28625 ${PROG} add: scheduling file .dir2/file2. for addition
28626 ${PROG} add: use .${PROG} commit. to add these files permanently"
28629 dotest multiroot3-9 "${testcvs} -q ci -m add-them" \
28630 "RCS file: ${TESTDIR}/root2/dir2/file2,v
28632 Checking in dir2/file2;
28633 ${TESTDIR}/root2/dir2/file2,v <-- file2
28634 initial revision: 1\.1
28636 RCS file: ${TESTDIR}/root1/dir1/file1,v
28638 Checking in dir1/file1;
28639 ${TESTDIR}/root1/dir1/file1,v <-- file1
28640 initial revision: 1\.1
28643 # That this is an error is good - we are asking CVS to do
28644 # something which doesn't make sense.
28645 dotest_fail multiroot3-10 \
28646 "${testcvs} -q -d ${CVSROOT1} diff dir1/file1 dir2/file2" \
28647 "${PROG} diff: failed to create lock directory for .${TESTDIR}/root1/dir2' (${TESTDIR}/root1/dir2/#cvs.lock): No such file or directory
28648 ${PROG} diff: failed to obtain dir lock in repository .${TESTDIR}/root1/dir2'
28649 ${PROG} \[diff aborted\]: read lock failed - giving up"
28651 # This one is supposed to work.
28652 dotest multiroot3-11 "${testcvs} -q diff dir1/file1 dir2/file2" ""
28654 # make sure we can't access across repositories
28657 dotest_fail multiroot3-12 \
28658 "$testcvs -d $CVSROOT1 -q co ../root2/dir2" \
28659 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\." \
28660 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\.
28661 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
28662 dotest_fail multiroot3-13 \
28663 "$testcvs -d $CVSROOT2 -q co ../root1/dir1" \
28664 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\.\./root1/dir1'\." \
28665 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\.\./root1/dir1'\.
28666 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
28667 dotest_fail multiroot3-14 \
28668 "$testcvs -d $CVSROOT1 -q co ./../root2/dir2" \
28669 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root2/dir2'\." \
28670 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root2/dir2'\.
28671 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
28672 dotest_fail multiroot3-15 \
28673 "$testcvs -d $CVSROOT2 -q co ./../root1/dir1" \
28674 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\." \
28675 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\.
28676 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
28677 dotest_fail multiroot3-16 \
28678 "$testcvs -d $CVSROOT1 -q co -p ../root2/dir2" \
28679 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\." \
28680 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\.
28681 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
28682 dotest_fail multiroot3-17 \
28683 "$testcvs -d $CVSROOT1 -q co -p ./../root1/dir1" \
28684 "$PROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\." \
28685 "$PROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\.
28686 $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
28689 echo Keeping $TESTDIR and exiting due to --keep
28696 rm -rf ${TESTDIR}/root1 ${TESTDIR}/root2
28702 # More multiroot tests, in particular we have two roots with
28703 # similarly-named directories and we try to see that CVS can
28704 # keep them separate.
28706 CVSROOT1=`newroot ${TESTDIR}/root1`
28707 CVSROOT2=`newroot ${TESTDIR}/root2`
28710 dotest multiroot4-1 "$testcvs -d$TESTDIR/root1 init"
28711 dotest multiroot4-2 "${testcvs} -d ${CVSROOT1} -q co -l ." ""
28713 dotest multiroot4-3 "${testcvs} add dircom" \
28714 "Directory ${TESTDIR}/root1/dircom added to the repository"
28717 dotest multiroot4-4 "${testcvs} add file1" \
28718 "${PROG} add: scheduling file .file1. for addition
28719 ${PROG} add: use .${PROG} commit. to add this file permanently"
28720 dotest multiroot4-5 "${testcvs} -q ci -m add" \
28721 "RCS file: ${TESTDIR}/root1/dircom/file1,v
28724 ${TESTDIR}/root1/dircom/file1,v <-- file1
28725 initial revision: 1\.1
28729 dotest multiroot4-6 "$testcvs -d$TESTDIR/root2 init"
28730 dotest multiroot4-7 "${testcvs} -d ${CVSROOT2} -q co -l ." ""
28732 dotest multiroot4-8 "${testcvs} add dircom" \
28733 "Directory ${TESTDIR}/root2/dircom added to the repository"
28736 dotest multiroot4-9 "${testcvs} add file2" \
28737 "${PROG} add: scheduling file .file2. for addition
28738 ${PROG} add: use .${PROG} commit. to add this file permanently"
28739 dotest multiroot4-10 "${testcvs} -q ci -m add" \
28740 "RCS file: ${TESTDIR}/root2/dircom/file2,v
28743 ${TESTDIR}/root2/dircom/file2,v <-- file2
28744 initial revision: 1\.1
28749 # This may look contrived; the real world example which inspired
28750 # it was that a user was changing from local to remote. Cases
28751 # like switching servers (among those mounting the same
28752 # repository) and so on would also look the same.
28754 dotest multiroot4-11 "${testcvs} -d ${CVSROOT2} add sdir2" \
28755 "Directory ${TESTDIR}/root2/dircom/sdir2 added to the repository"
28757 dotest multiroot4-12 "${testcvs} -q update" ""
28759 dotest multiroot4-13 "${testcvs} -q update dircom" ""
28763 rm -rf ${TESTDIR}/root1 ${TESTDIR}/root2
28769 # When the Entries/Root file is removed from an existing
28770 # workspace, CVS should assume $CVSROOT instead
28772 # Right now only checking that CVS exits normally on an
28773 # update once CVS/Root is deleted
28775 # There was a time when this would core dump when run in
28776 # client/server mode
28779 dotest rmroot-setup-1 "${testcvs} -q co -l ." ''
28781 dotest rmroot-setup-2 "${testcvs} add first-dir" \
28782 "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
28785 dotest rmroot-setup-3 "${testcvs} add file1 file2" \
28786 "${PROG} add: scheduling file .file1. for addition
28787 ${PROG} add: scheduling file .file2. for addition
28788 ${PROG} add: use .${PROG} commit. to add these files permanently"
28789 dotest rmroot-setup-4 "${testcvs} -q commit -minit" \
28790 "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
28793 ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
28794 initial revision: 1\.1
28796 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
28799 ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
28800 initial revision: 1\.1
28803 dotest rmroot-1 "${testcvs} -q update" ''
28810 # More tests of repositories and specifying them.
28811 # Similar to crerepos but that test is probably getting big
28813 CVSROOT1=`newroot ${TESTDIR}/root1`
28814 CVSROOT_MOVED=`newroot ${TESTDIR}/root-moved`
28816 dotest reposmv-setup-1 "$testcvs -d$TESTDIR/root1 init"
28817 mkdir imp-dir; cd imp-dir
28819 dotest reposmv-setup-2 \
28820 "${testcvs} -d ${CVSROOT1} import -m add dir1 vendor release" \
28823 No conflicts created by this import"
28827 dotest reposmv-1 "${testcvs} -d ${CVSROOT1} -Q co dir1" ""
28828 mv ${TESTDIR}/root1 ${TESTDIR}/root-moved
28831 # If we didn't have a relative repository, get one now.
28832 dotest reposmv-1a "cat CVS/Repository" \
28833 "${TESTDIR}/root1/dir1" "dir1"
28834 echo dir1 >CVS/Repository
28836 # There were some duplicated warnings and such; only test
28837 # for the part of the error message which makes sense.
28838 # Bug: "skipping directory " without filename.
28840 dotest_fail reposmv-2r "${testcvs} update" \
28841 "Cannot access ${TESTDIR}/root1/CVSROOT
28842 No such file or directory"
28844 dotest reposmv-2 "${testcvs} update" "${DOTSTAR}
28845 ${PROG} update: ignoring CVS/Root because it specifies a non-existent repository ${TESTDIR}/root1
28846 ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1: No such file or directory
28847 ${PROG} update: skipping directory "
28850 # CVS/Root overrides $CVSROOT
28852 CVSROOT_save=${CVSROOT}
28853 CVSROOT=:fork:${TESTDIR}/root-moved; export CVSROOT
28854 dotest_fail reposmv-3r "${testcvs} update" \
28855 "Cannot access ${TESTDIR}/root1/CVSROOT
28856 No such file or directory"
28857 CVSROOT=${CVSROOT_save}; export CVSROOT
28859 CVSROOT_save=${CVSROOT}
28860 CVSROOT=${TESTDIR}/root-moved; export CVSROOT
28861 dotest reposmv-3 "${testcvs} update" \
28863 ${PROG} update: ignoring CVS/Root because it specifies a non-existent repository ${TESTDIR}/root1
28864 ${PROG} update: Updating \.
28866 CVSROOT=${CVSROOT_save}; export CVSROOT
28870 CVSROOT_save=${CVSROOT}
28871 CVSROOT=:fork:${TESTDIR}/root-none; export CVSROOT
28872 dotest_fail reposmv-4 "${testcvs} update" \
28873 "Cannot access ${TESTDIR}/root1/CVSROOT
28874 No such file or directory"
28875 CVSROOT=${CVSROOT_save}; export CVSROOT
28877 # CVS/Root doesn't seem to quite completely override $CVSROOT
28878 # Bug? Not necessarily a big deal if it only affects error
28880 CVSROOT_save=${CVSROOT}
28881 CVSROOT=${TESTDIR}/root-none; export CVSROOT
28882 dotest_fail reposmv-4 "${testcvs} update" \
28883 "${PROG} update: in directory \.:
28884 ${PROG} update: ignoring CVS/Root because it specifies a non-existent repository ${TESTDIR}/root1
28885 ${PROG} \[update aborted\]: ${TESTDIR}/root-none/CVSROOT: No such file or directory"
28886 CVSROOT=${CVSROOT_save}; export CVSROOT
28889 # -d overrides CVS/Root
28891 # Oddly enough, with CVS 1.10 I think this didn't work for
28892 # local (that is, it would appear that CVS/Root would not
28893 # get used, but would produce an error if it didn't exist).
28894 dotest reposmv-5 "${testcvs} -d ${CVSROOT_MOVED} update" \
28895 "${PROG} update: Updating \."
28897 # TODO: could also test various other things, like what if the
28898 # user removes CVS/Root (which is legit). Or another set of
28899 # tests would be if both repositories exist but we want to make
28900 # sure that CVS is using the correct one.
28909 # Test basic pserver functionality.
28911 # First set SystemAuth=no. Not really necessary, I don't
28912 # think, but somehow it seems like the clean thing for
28915 dotest pserver-1 "${testcvs} -Q co CVSROOT" ""
28917 echo "SystemAuth=no" >config
28918 dotest pserver-2 "${testcvs} -q ci -m config-it" \
28919 "Checking in config;
28920 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
28921 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
28923 ${PROG} commit: Rebuilding administrative file database"
28924 cat >${CVSROOT_DIRNAME}/CVSROOT/passwd <<EOF
28925 testme:q6WV9d2t848B2:$username
28926 dontroot:q6WV9d2t848B2:root
28927 anonymous::$username
28929 willfail: :whocares
28931 dotest_fail pserver-3 "${testcvs} pserver" \
28932 "error 0 Server configuration missing --allow-root in inetd.conf" <<EOF
28940 dotest_fail pserver-3a "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
28941 "error 0 ${CVSROOT_DIRNAME}XXX: no such repository
28944 ${CVSROOT_DIRNAME}XXX
28950 # Confirm that not sending a newline during auth cannot constitute
28951 # a denial-of-service attack. This assumes that PATH_MAX is less
28952 # than 65536 bytes. If PATH_MAX is larger than 65535 bytes, this
28953 # test could hang indefinitely.
28954 ${AWK} 'BEGIN { printf "0123456789abcdef" }' </dev/null >garbageseg
28955 echo "BEGIN AUTH REQUEST" >garbageinput
28957 while test $i -lt 64; do
28958 cat <garbageseg >>garbageseg2
28962 while test $i -lt 64; do
28963 cat <garbageseg2 >>garbageinput
28966 dotest_fail pserver-auth-no-dos \
28967 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
28968 "${PROG} \\[pserver aborted\\]: Maximum line length exceeded during authentication\." <garbageinput
28970 rm garbageseg garbageseg2 garbageinput
28972 # Sending the Root and noop before waiting for the
28973 # "I LOVE YOU" is bogus, but hopefully we can get
28975 dotest pserver-4 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
28976 "${DOTSTAR} LOVE YOU
28983 Root ${CVSROOT_DIRNAME}
28987 # The "no such system user" error is occurring on at least one of
28988 # our BSD 2.0.2 nightly test platforms.
28989 dotest_fail pserver-4.2 \
28990 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
28991 "error 0: root not allowed" \
28992 "E Fatal error, aborting\.
28993 error 0 root: no such system user" <<EOF
29001 dotest pserver-5 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29002 "${DOTSTAR} LOVE YOU
29003 E Protocol error: Root says \"${TESTDIR}/1\" but pserver says \"${CVSROOT_DIRNAME}\"
29014 dotest pserver-5a "$testcvs --allow-root=$CVSROOT_DIRNAME pserver" \
29016 E init may not be run remotely
29025 dotest_fail pserver-5b "test -d $TESTDIR/2"
29027 dotest_fail pserver-6 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29036 dotest_fail pserver-7 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29038 BEGIN VERIFICATION REQUEST
29042 END VERIFICATION REQUEST
29045 dotest pserver-8 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29046 "${DOTSTAR} LOVE YOU" <<EOF
29047 BEGIN VERIFICATION REQUEST
29051 END VERIFICATION REQUEST
29054 # Tests pserver-9 through pserver-13 are about empty passwords
29056 # Test empty password (both sides) for aliased user
29057 dotest pserver-9 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29058 "${DOTSTAR} LOVE YOU" <<EOF
29066 # Test empty password (server side only) for aliased user
29067 dotest pserver-10 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29068 "${DOTSTAR} LOVE YOU" <<EOF
29072 Aanythingwouldworkhereittrulydoesnotmatter
29076 # Test empty (both sides) password for non-aliased user
29077 dotest pserver-11 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29078 "${DOTSTAR} LOVE YOU" <<EOF
29086 # Test empty (server side only) password for non-aliased user
29087 dotest pserver-12 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29088 "${DOTSTAR} LOVE YOU" <<EOF
29092 Anypasswordwouldworkwhynotthisonethen
29096 # Test failure of whitespace password
29097 dotest_fail pserver-13 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29098 "${DOTSTAR} HATE YOU" <<EOF
29102 Amquiteunabletocomeupwithinterestingpasswordsanymore
29106 # The following tests are for read-only access
29108 # Check that readers can only read, everyone else can write
29110 cat >${CVSROOT_DIRNAME}/CVSROOT/readers <<EOF
29114 dotest pserver-14 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29115 "${DOTSTAR} LOVE YOU
29116 M Concurrent Versions System (CVS) .*
29123 Root ${CVSROOT_DIRNAME}
29127 dotest pserver-16 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29128 "${DOTSTAR} LOVE YOU
29129 M Concurrent Versions System (CVS) .*
29136 Root ${CVSROOT_DIRNAME}
29140 dotest pserver-18 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29141 "${DOTSTAR} LOVE YOU
29142 M Concurrent Versions System (CVS) .*
29149 Root ${CVSROOT_DIRNAME}
29153 # Check that writers can write, everyone else can only read
29154 # even if not listed in readers
29156 cat >${CVSROOT_DIRNAME}/CVSROOT/writers <<EOF
29160 dotest pserver-20 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29161 "${DOTSTAR} LOVE YOU
29162 M Concurrent Versions System (CVS) .*
29169 Root ${CVSROOT_DIRNAME}
29173 dotest pserver-22 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29174 "${DOTSTAR} LOVE YOU
29175 M Concurrent Versions System (CVS) .*
29182 Root ${CVSROOT_DIRNAME}
29186 dotest pserver-24 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29187 "${DOTSTAR} LOVE YOU
29188 M Concurrent Versions System (CVS) .*
29195 Root ${CVSROOT_DIRNAME}
29199 # Should work the same without readers
29201 rm ${CVSROOT_DIRNAME}/CVSROOT/readers
29203 dotest pserver-26 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29204 "${DOTSTAR} LOVE YOU
29205 M Concurrent Versions System (CVS) .*
29212 Root ${CVSROOT_DIRNAME}
29216 dotest pserver-28 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29217 "${DOTSTAR} LOVE YOU
29218 M Concurrent Versions System (CVS) .*
29225 Root ${CVSROOT_DIRNAME}
29229 dotest pserver-30 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
29230 "${DOTSTAR} LOVE YOU
29231 M Concurrent Versions System (CVS) .*
29238 Root ${CVSROOT_DIRNAME}
29242 # pserver used to try and print from the NULL pointer
29243 # in this error message in this case
29244 dotest_fail pserver-bufinit "${testcvs} pserver" \
29245 "${PROG} \[pserver aborted\]: bad auth protocol start: EOF" </dev/null
29248 echo "# comments only" >config
29249 dotest pserver-cleanup-1 "${testcvs} -q ci -m config-it" \
29250 "Checking in config;
29251 ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
29252 new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
29254 ${PROG} commit: Rebuilding administrative file database"
29257 rm ${CVSROOT_DIRNAME}/CVSROOT/passwd ${CVSROOT_DIRNAME}/CVSROOT/writers
29258 fi # skip the whole thing for local
29262 # Some tests of the server (independent of the client).
29264 dotest server-1 "${testcvs} server" \
29265 "E Protocol error: Root request missing
29272 # Could also test for relative pathnames here (so that crerepos-6a
29273 # and crerepos-6b can use :fork:).
29274 dotest server-2 "$testcvs server" \
29275 "E init may not be run remotely
29278 Set MYENV=env-value
29279 init ${TESTDIR}/crerepos
29281 dotest_fail server-3 "test -d $TESTDIR/crerepos/CVSROOT"
29283 dotest server-3a "$testcvs -d$TESTDIR/crerepos init"
29285 # Now some tests of gzip-file-contents (used by jCVS).
29287 printf "%c%c%c%c%c%c.6%c%c+I-.%c%c%c%c5%c;%c%c%c%c", \
29288 31, 139, 8, 64, 5, 7, 64, 3, 225, 2, 64, 198, 185, 5, 64, 64, 64}' \
29289 </dev/null | ${TR} '\100' '\000' >gzipped.dat
29290 # Note that the CVS client sends "-b 1.1.1", and this
29291 # test doesn't. But the server also defaults to that.
29292 cat <<EOF >session.dat
29293 Root ${TESTDIR}/crerepos
29295 gzip-file-contents 3
29303 ${TESTDIR}/crerepos
29308 cat gzipped.dat >>session.dat
29309 echo import >>session.dat
29310 dotest server-4 "${testcvs} server" \
29313 M No conflicts created by this import
29317 "${testcvs} -q -d ${TESTDIR}/crerepos co -p dir1/file1" "test"
29319 # OK, here are some notify tests.
29320 dotest server-6 "${testcvs} server" \
29322 ${TESTDIR}/crerepos/dir1/file1
29324 Root ${TESTDIR}/crerepos
29326 ${TESTDIR}/crerepos/dir1
29328 E Fri May 7 13:21:09 1999 GMT myhost some-work-dir EUC
29331 # Sending the second "noop" before waiting for the output
29332 # from the first is bogus but hopefully we can get away
29334 dotest server-7 "${testcvs} server" \
29336 ${TESTDIR}/crerepos/dir1/file1
29339 ${TESTDIR}/crerepos/dir1/file1
29341 Root ${TESTDIR}/crerepos
29343 ${TESTDIR}/crerepos/dir1
29345 E Fri May 7 13:21:09 1999 GMT myhost some-work-dir EUC
29348 E The 57th day of Discord in the YOLD 3165 myhost some-work-dir EUC
29352 # OK, now test a few error conditions.
29353 # FIXCVS: should give "error" and no "Notified", like server-9
29354 dotest server-8 "${testcvs} server" \
29355 "E ${PROG} server: invalid character in editor value
29357 ${TESTDIR}/crerepos/dir1/file1
29359 Root ${TESTDIR}/crerepos
29361 ${TESTDIR}/crerepos/dir1
29363 E Setting Orange, the 52th day of Discord in the YOLD 3165 myhost some-work-dir EUC
29367 dotest server-9 "${testcvs} server" \
29368 "E Protocol error; misformed Notify request
29370 Root ${TESTDIR}/crerepos
29372 ${TESTDIR}/crerepos/dir1
29374 E Setting Orange+57th day of Discord myhost some-work-dir EUC
29378 # First demonstrate an interesting quirk in the protocol.
29379 # The "watchers" request selects the files to operate based
29380 # on files which exist in the working directory. So if we
29381 # don't send "Entry" or the like, it won't do anything.
29382 # Wants to be documented in cvsclient.texi...
29383 dotest server-10 "${testcvs} server" "ok" <<EOF
29384 Root ${TESTDIR}/crerepos
29386 ${TESTDIR}/crerepos/dir1
29389 # See if "watchers" and "editors" display the right thing.
29390 dotest server-11 "${testcvs} server" \
29391 "M file1 ${username} tedit tunedit tcommit
29393 Root ${TESTDIR}/crerepos
29395 ${TESTDIR}/crerepos/dir1
29396 Entry /file1/1.1////
29399 dotest server-12 "${testcvs} server" \
29400 "M file1 ${username} The 57th day of Discord in the YOLD 3165 myhost some-work-dir
29402 Root ${TESTDIR}/crerepos
29404 ${TESTDIR}/crerepos/dir1
29405 Entry /file1/1.1////
29409 # Now do an unedit.
29410 dotest server-13 "${testcvs} server" \
29412 ${TESTDIR}/crerepos/dir1/file1
29414 Root ${TESTDIR}/crerepos
29416 ${TESTDIR}/crerepos/dir1
29418 U 7 May 1999 15:00 GMT myhost some-work-dir EUC
29422 # Now try "watchers" and "editors" again.
29423 dotest server-14 "${testcvs} server" "ok" <<EOF
29424 Root ${TESTDIR}/crerepos
29426 ${TESTDIR}/crerepos/dir1
29429 dotest server-15 "${testcvs} server" "ok" <<EOF
29430 Root ${TESTDIR}/crerepos
29432 ${TESTDIR}/crerepos/dir1
29436 # Test that the global `-l' option is ignored nonfatally.
29437 dotest server-16 "${testcvs} server" \
29438 "E cvs server: WARNING: global \`-l' option ignored\.
29444 # There used to be some exploits based on malformed Entry requests
29445 dotest server-17 "$testcvs server" \
29446 "E protocol error: Malformed Entry
29448 Root $TESTDIR/crerepos
29450 $TESTDIR/crerepos/dir1
29451 Entry X/file1/1.1////
29455 dotest server-18 "$testcvs server" \
29456 "E protocol error: Malformed Entry
29458 Root $TESTDIR/crerepos
29460 $TESTDIR/crerepos/dir1
29466 echo Keeping ${TESTDIR} and exiting due to --keep
29470 rm -rf ${TESTDIR}/crerepos
29471 rm gzipped.dat session.dat
29472 fi # skip the whole thing for local
29476 # More server tests, in particular testing that various
29477 # possible security holes are plugged.
29479 dotest server2-1 "${testcvs} server" \
29480 "E protocol error: directory '${CVSROOT_DIRNAME}/\.\./dir1' not within root '${CVSROOT_DIRNAME}'
29482 Root ${CVSROOT_DIRNAME}
29484 ${CVSROOT_DIRNAME}/../dir1
29488 dotest server2-2 "${testcvs} server" \
29489 "E protocol error: directory '${CVSROOT_DIRNAME}dir1' not within root '${CVSROOT_DIRNAME}'
29491 Root ${CVSROOT_DIRNAME}
29493 ${CVSROOT_DIRNAME}dir1
29497 dotest server2-3 "${testcvs} server" \
29498 "E protocol error: directory '${TESTDIR}' not within root '${CVSROOT_DIRNAME}'
29500 Root ${CVSROOT_DIRNAME}
29506 # OK, now a few tests for the rule that one cannot pass a
29507 # filename containing a slash to Modified, Is-modified,
29508 # Notify, Questionable, or Unchanged. For completeness
29509 # we'd try them all. For lazyness/conciseness we don't.
29510 dotest server2-4 "${testcvs} server" \
29511 "E protocol error: directory 'foo/bar' not within current directory
29513 Root ${CVSROOT_DIRNAME}
29520 "$testcvs --allow-root=$CVSROOT_DIRNAME.bad server" \
29521 "E Bad root $CVSROOT_DIRNAME
29523 Root $CVSROOT_DIRNAME
29527 "$testcvs --allow-root=$CVSROOT_DIRNAME server" \
29529 Root $CVSROOT_DIRNAME
29538 # Test that various checks on the Root request generate the correct
29541 # As a control, a valid request.
29542 dotest server3-1 "$testcvs server" 'ok' <<EOF
29543 Root $CVSROOT_DIRNAME
29550 dotest server3-2 "$testcvs server" \
29551 "E Root somewhere/over/the/rainbow must be an absolute pathname
29553 Root somewhere/over/the/rainbow
29557 dotest server3-3 "$testcvs server" \
29558 "E Protocol error: Duplicate Root request, for $CVSROOT_DIRNAME
29560 Root $CVSROOT_DIRNAME
29561 Root $CVSROOT_DIRNAME
29565 dotest server3-4 "$testcvs server" \
29566 "E Protocol error: Duplicate Root request, for $CVSROOT_DIRNAME
29568 Root $CVSROOT_DIRNAME
29569 Root $CVSROOT_DIRNAME
29576 # These cascading errors seem odd, but the client should have hung
29577 # up after the first.
29578 dotest server3-5 "$testcvs server" \
29579 "E Root somewhere/over/the/rainbow must be an absolute pathname
29581 E Protocol error: Root request missing
29583 Root somewhere/over/the/rainbow
29585 somewhere/over/the/rainbow
29595 # Some tests of the client (independent of the server).
29597 cat >${TESTDIR}/serveme <<EOF
29599 # This is admittedly a bit cheezy, in the sense that we make lots
29600 # of assumptions about what the client is going to send us.
29601 # We don't mention Repository, because current clients don't require it.
29602 # Sending these at our own pace, rather than waiting for the client to
29603 # make the requests, is bogus, but hopefully we can get away with it.
29604 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29606 echo "M special message"
29607 echo "Created first-dir/"
29608 echo "${CVSROOT_DIRNAME}/first-dir/file1"
29609 echo "/file1/1.1///"
29610 echo "u=rw,g=rw,o=rw"
29616 # Cygwin. Pthffffffffft!
29617 if test -n "$remotehost"; then
29618 $CVS_RSH $remotehost "chmod +x ${TESTDIR}/serveme"
29620 chmod +x ${TESTDIR}/serveme
29622 save_CVS_SERVER=$CVS_SERVER
29623 CVS_SERVER=${TESTDIR}/serveme; export CVS_SERVER
29625 dotest_fail client-1 "${testcvs} -q co first-dir" \
29626 "${PROG} \[checkout aborted\]: This server does not support the global -q option${DOTSTAR}"
29627 dotest client-2 "${testcvs} co first-dir" "special message"
29629 cat >${TESTDIR}/serveme <<EOF
29631 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29634 echo "Copy-file ./"
29635 echo "${CVSROOT_DIRNAME}/first-dir/file1"
29636 echo "${TESTDIR}/bogus/.#file1.1.1"
29638 echo "${CVSROOT_DIRNAME}/first-dir/file1"
29639 echo "/file1/1.2///"
29640 echo "u=rw,g=rw,o=rw"
29647 mkdir ${TESTDIR}/bogus
29648 # The ${DOTSTAR} is to match a potential "broken pipe" if the
29649 # client exits before the server script sends everything
29650 dotest_fail client-3 "${testcvs} update" "merge-it
29651 ${PROG} \[update aborted\]: protocol error: Copy-file tried to specify director${DOTSTAR}"
29652 cat >${TESTDIR}/serveme <<EOF
29654 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29657 echo "Copy-file ./"
29658 echo "${CVSROOT_DIRNAME}/first-dir/file1"
29661 echo "${CVSROOT_DIRNAME}/first-dir/file1"
29662 echo "/file1/1.2///"
29663 echo "u=rw,g=rw,o=rw"
29669 dotest client-4 "${testcvs} update" "merge-it"
29670 dotest client-5 "cat .#file1.1.1" "xyz"
29671 dotest client-6 "cat CVS/Entries" "/file1/1.2/[A-Za-z0-9 :]*//
29673 dotest client-7 "cat file1" "abc"
29675 cat >${TESTDIR}/serveme <<EOF
29677 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29679 echo "M OK, whatever"
29681 cat >${TESTDIR}/client.tmp
29683 chmod u=rw,go= file1
29684 # By specifying the time zone in local time, we don't
29685 # know exactly how that will translate to GMT.
29686 dotest client-8 "${testcvs} update -D 99-10-04" "OK, whatever"
29687 # String 2 below is Cygwin again - ptoooey.
29688 dotest client-9 "cat ${TESTDIR}/client.tmp" \
29689 "Root ${CVSROOT_DIRNAME}
29690 Valid-responses [-a-zA-Z ]*
29693 Argument [34] Oct 1999 [0-9][0-9]:00:00 -0000
29696 ${CVSROOT_DIRNAME}/first-dir
29697 Entry /file1/1\.2///
29703 "Root ${CVSROOT_DIRNAME}
29704 Valid-responses [-a-zA-Z ]*
29707 Argument [34] Oct 1999 [0-9][0-9]:00:00 -0000
29710 ${CVSROOT_DIRNAME}/first-dir
29711 Entry /file1/1\.2///
29718 # The following test tests what was a potential client update in
29719 # CVS versions 1.11.14 and CVS versions 1.12.6 and earlier. This
29720 # exploit would allow a trojan server to create arbitrary files,
29721 # anywhere the user had write permissions, even outside of the
29723 cat >$HOME/.bashrc <<EOF
29725 # This is where login scripts would usually be
29728 cat >$TESTDIR/serveme <<EOF
29730 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29732 echo "Rcs-diff $HOME/"
29733 echo "$HOME/.bashrc"
29734 echo "/.bashrc/73.50///"
29735 echo "u=rw,g=rw,o=rw"
29738 echo "echo 'gotcha!'"
29743 # If I don't run the following sleep between the above cat and
29744 # the following calls to dotest, sometimes the serveme file isn't
29745 # completely written yet by the time CVS tries to execute it,
29746 # causing the shell to intermittantly report syntax errors (usually
29747 # early EOF). There's probably a new race condition here, but this
29750 # Incidentally, I can reproduce this behavior with Linux 2.4.20 and
29751 # Bash 2.05 or Bash 2.05b.
29753 dotest_fail client-10 "$testcvs update" \
29754 "$PROG update: Server attempted to update a file via an invalid pathname:
29755 $PROG \[update aborted\]: \`$HOME/.bashrc'\."
29757 # A second try at a client exploit. This one never actually
29758 # failed in the past, but I thought it wouldn't hurt to add a test.
29759 cat >$TESTDIR/serveme <<EOF
29761 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29764 echo "$HOME/.bashrc"
29765 echo "/.bashrc/73.50///"
29766 echo "u=rw,g=rw,o=rw"
29769 echo "echo 'gotcha!'"
29774 dotest_fail client-11 "$testcvs update" \
29775 "$PROG \[update aborted\]: patch original file \./\.bashrc does not exist"
29777 # A third try at a client exploit. This one did used to fail like
29779 cat >$TESTDIR/serveme <<EOF
29781 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29783 echo "Rcs-diff ../../home/"
29784 echo "../../.bashrc"
29785 echo "/.bashrc/73.50///"
29786 echo "u=rw,g=rw,o=rw"
29789 echo "echo 'gotcha!'"
29794 dotest_fail client-12 "$testcvs update" \
29795 "$PROG update: Server attempted to update a file via an invalid pathname:
29796 $PROG \[update aborted\]: \`\.\./\.\./home/.bashrc'\."
29798 # Try the same exploit using the Created response.
29799 cat >$TESTDIR/serveme <<EOF
29801 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29803 echo "Created $HOME/"
29804 echo "$HOME/.bashrc"
29805 echo "/.bashrc/73.50///"
29806 echo "u=rw,g=rw,o=rw"
29809 echo "echo 'gotcha!'"
29814 dotest_fail client-13 "$testcvs update" \
29815 "$PROG update: Server attempted to update a file via an invalid pathname:
29816 $PROG \[update aborted\]: \`$HOME/.bashrc'\."
29818 # Now try using the Update-existing response
29819 cat >$TESTDIR/serveme <<EOF
29821 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29823 echo "Update-existing ../../home/"
29824 echo "../../home/.bashrc"
29825 echo "/.bashrc/73.50///"
29826 echo "u=rw,g=rw,o=rw"
29829 echo "echo 'gotcha!'"
29834 dotest_fail client-14 "$testcvs update" \
29835 "$PROG update: Server attempted to update a file via an invalid pathname:
29836 $PROG \[update aborted\]: \`\.\./\.\./home/.bashrc'\."
29838 # Try the same exploit using the Merged response.
29839 cat >$TESTDIR/serveme <<EOF
29841 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29843 echo "Merged $HOME/"
29844 echo "$HOME/.bashrc"
29845 echo "/.bashrc/73.50///"
29846 echo "u=rw,g=rw,o=rw"
29849 echo "echo 'gotcha!'"
29854 dotest_fail client-15 "$testcvs update" \
29855 "$PROG update: Server attempted to update a file via an invalid pathname:
29856 $PROG \[update aborted\]: \`$HOME/.bashrc'\."
29858 # Now try using the Updated response
29859 cat >$TESTDIR/serveme <<EOF
29861 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29863 echo "Updated ../../home/"
29864 echo "../../home/.bashrc"
29865 echo "/.bashrc/73.50///"
29866 echo "u=rw,g=rw,o=rw"
29869 echo "echo 'gotcha!'"
29874 dotest_fail client-16 "$testcvs update" \
29875 "$PROG update: Server attempted to update a file via an invalid pathname:
29876 $PROG \[update aborted\]: \`\.\./\.\./home/.bashrc'\."
29878 # Try the same exploit using the Copy-file response.
29879 # As far as I know, Copy-file was never exploitable either.
29880 cat >$TESTDIR/serveme <<EOF
29882 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29886 echo "/innocuous/73.50///"
29887 echo "u=rw,g=rw,o=rw"
29890 echo "echo 'gotcha!'"
29893 echo "$HOME/innocuous"
29898 dotest_fail client-18 "$testcvs update" \
29899 "$PROG \[update aborted\]: protocol error: Copy-file tried to specify directory"
29901 # And verify that none of the exploits was successful.
29902 dotest client-19 "cat $HOME/.bashrc" \
29904 # This is where login scripts would usually be
29908 echo Keeping ${TESTDIR} and exiting due to --keep
29914 rmdir ${TESTDIR}/bogus
29915 rm $TESTDIR/serveme $HOME/.bashrc
29916 CVS_SERVER=${save_CVS_SERVER}; export CVS_SERVER
29917 fi # skip the whole thing for local
29923 # Test how the client handles error messages from the server.
29925 cat >$TESTDIR/serveme <<EOF
29927 # This is just as cheesy as the "client" tests made it out to be.
29928 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29929 echo "E Root somewhere/over/the/rainbow must be an absolute pathname"
29931 echo "E Protocol error: Root request missing"
29935 # Cygwin. Pthffffffffft!
29936 if test -n "$remotehost"; then
29937 $CVS_RSH $remotehost "chmod +x $TESTDIR/serveme"
29939 chmod +x $TESTDIR/serveme
29941 save_CVS_SERVER=$CVS_SERVER
29942 CVS_SERVER=$TESTDIR/serveme; export CVS_SERVER
29943 mkdir client2; cd client2
29944 dotest_fail client2-1 "$testcvs co first-dir" \
29945 "Root somewhere/over/the/rainbow must be an absolute pathname"
29947 cat >$TESTDIR/serveme <<EOF
29949 # This is just as cheesy as the "client" tests made it out to be.
29950 echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
29951 echo "E Root somewhere/over/the/rainbow must be an absolute pathname"
29954 echo "E Protocol error: Root request missing"
29958 # Cygwin. Pthffffffffft!
29959 if test -n "$remotehost"; then
29960 $CVS_RSH $remotehost "chmod +x $TESTDIR/serveme"
29962 chmod +x $TESTDIR/serveme
29964 dotest_fail client2-2 "$testcvs co first-dir" \
29965 "Root somewhere/over/the/rainbow must be an absolute pathname
29966 $PROG checkout: warning: unrecognized response \`' from cvs server"
29969 echo Keeping $TESTDIR and exiting due to --keep
29975 rm $TESTDIR/serveme
29976 CVS_SERVER=$save_CVS_SERVER; export CVS_SERVER
29977 fi # skip the whole thing for local
29983 # Check that a CVSROOT with a "." in the name will work.
29984 CVSROOT_save=${CVSROOT}
29985 CVSROOT_DIRNAME_save=${CVSROOT_DIRNAME}
29986 CVSROOT_DIRNAME=${TESTDIR}/cvs.root
29987 CVSROOT=`newroot ${CVSROOT_DIRNAME}`
29989 dotest dottedroot-init-1 "$testcvs -d$CVSROOT_DIRNAME init"
29992 echo version1 >dir1/dir2/file1
29994 dotest dottedroot-1 "${testcvs} import -m '' module1 AUTHOR INITIAL" \
29995 "${PROG} [a-z]*: Importing ${CVSROOT_DIRNAME}/module1/dir2
29996 N module1/dir2/file1
29998 No conflicts created by this import"
30001 # This is the test that used to cause an assertion failure
30002 # in recurse.c:do_recursion().
30003 dotest dottedroot-2 "${testcvs} co -rINITIAL module1" \
30004 "${PROG} [a-z]*: Updating module1
30005 ${PROG} [a-z]*: Updating module1/dir2
30006 U module1/dir2/file1"
30008 # This also triggered the assertion failure above prior to 1.11.23.
30009 dotest dottedroot-3 \
30010 "$testcvs -q co -prINITIAL module1/./dir2/file1" \
30014 echo Keeping $TESTDIR and exiting due to --keep
30018 rm -rf ${CVSROOT_DIRNAME}
30020 CVSROOT_DIRNAME=${CVSROOT_DIRNAME_save}
30021 CVSROOT=${CVSROOT_save}
30025 # Test that the server defaults to the correct executable in :fork:
30026 # mode. See the note in the TODO at the end of this file about this.
30028 # This test and client should be left after all other references to
30029 # CVS_SERVER are removed from this script.
30031 # The client series of tests already tests that CVS_SERVER is
30032 # working, but that test might be better here.
30034 mkdir fork; cd fork
30035 save_CVS_SERVER=$CVS_SERVER
30037 # So looking through $PATH for cvs won't work...
30038 echo "echo junk" >cvs
30040 save_PATH=$PATH; PATH=.:$PATH
30041 dotest fork-1 "$testcvs -d:fork:$CVSROOT_DIRNAME version" \
30044 CVS_SERVER=${save_CVS_SERVER}; export CVS_SERVER
30045 unset save_CVS_SERVER
30046 PATH=$save_PATH; unset save_PATH
30050 echo Keeping ${TESTDIR} and exiting due to --keep
30056 commit-add-missing)
30057 # Make sure that a commit fails when a `cvs add'ed file has
30058 # been removed from the working directory.
30063 dotest commit-add-missing-1 \
30064 "$testcvs -Q import -m. $module X Y" ''
30067 # Check it out and tag it.
30068 dotest commit-add-missing-2 "$testcvs -Q co $module" ''
30070 dotest commit-add-missing-3 "$testcvs -Q tag -b B" ''
30072 dotest commit-add-missing-4 "$testcvs -Q add $file" ''
30074 dotest_fail commit-add-missing-5 "$testcvs -Q ci -m. $file" \
30075 "${PROG} commit: Up-to-date check failed for .$file'
30076 ${PROG} \[commit aborted\]: correct above errors first!"
30080 rm -rf ${CVSROOT_DIRNAME}/$module
30084 # Verify that `sdir/CVS' may not be explicitly added.
30085 mkdir add-restricted; cd add-restricted
30087 mkdir import; cd import
30089 dotest add-restricted-init-1 \
30090 "$testcvs -Q import -m. add-restricted X Y"
30093 dotest add-restricted-init-2 "$testcvs -Q co add-restricted"
30096 # errmsg2-3 tests the specific message here.
30097 dotest_fail add-restricted-1 "$testcvs -Q add CVS"
30100 dotest add-restricted-2 "$testcvs -Q add sdir"
30101 dotest_fail add-restricted-3 "$testcvs add sdir/CVS" \
30102 "$PROG add: cannot add special file \`sdir/CVS'; skipping"
30105 echo Keeping $TESTDIR and exiting due to --keep
30109 rm -rf add-restricted $CVSROOT_DIRNAME/add-restricted
30115 # Check that top-level commits work when CVS/Root
30116 # is overridden by cvs -d.
30118 mkdir -p 1/subdir; cd 1
30119 touch file1 subdir/file2
30120 dotest commit-d-1 "$testcvs -Q import -m. c-d-c X Y" ""
30121 dotest commit-d-2 "$testcvs -Q co c-d-c" ""
30123 echo change >>file1; echo another change >>subdir/file2
30124 # Changing working root, then override with -d
30125 echo nosuchhost:/cvs > CVS/Root
30126 dotest commit-d-3 "$testcvs -Q -d $CVSROOT commit -m." \
30127 "Checking in file1;
30128 ${CVSROOT_DIRNAME}/c-d-c/file1,v <-- file1
30129 new revision: 1.2; previous revision: 1.1
30131 Checking in subdir/file2;
30132 ${CVSROOT_DIRNAME}/c-d-c/subdir/file2,v <-- file2
30133 new revision: 1.2; previous revision: 1.1
30136 rm -rf 1 cvsroot/c-d-c
30140 echo $what is not the name of a test -- ignored
30144 # Sanity check sanity.sh. :)
30146 # Test our exit directory so that tests that exit in an incorrect directory
30147 # are noticed during single test runs.
30150 # Sparc Solaris 9 is dereferencing paths here as if /bin/pwd were
30151 # called when /tmp is a symlink. This might be a new problem with this
30152 # test, but since this was recently tested I think it more likely to be
30154 if test "x$TESTDIR" != "x`pwd`"; then
30155 fail "cleanup: PWD != TESTDIR (\``pwd`' != \`$TESTDIR')"
30158 # Reset val-tags to a pristine state.
30159 rm -f $CVSROOT_DIRNAME/CVSROOT/val-tags
30161 verify_tmp_empty "post $what"
30163 done # The big loop
30165 # Set up summary data for output.
30169 if test $skipped -ne 0; then
30170 skippedoutput="$skipped test group"
30171 if test $skipped -ne 1; then
30172 skippedoutput="${skippedoutput}s"
30174 skippedoutput="$skippedoutput skipped"
30176 if test $warnings -ne 0; then
30177 warningsoutput="$warnings test"
30178 if test $warnings -ne 1; then
30179 warningsoutput="${warningsoutput}s"
30181 warningsoutput="$warningsoutput passed with warnings"
30183 if test -n "$skippedoutput" || test -n "$warningsoutput"; then
30185 if test -n "$skippedoutput"; then
30186 extendedinfo="$extendedinfo$skippedoutput"
30188 if test -n "$skippedoutput" && test -n "$warningsoutput"; then
30189 extendedinfo="$extendedinfo and "
30191 if test -n "$warningsoutput"; then
30192 extendedinfo="$extendedinfo$warningsoutput"
30194 extendedinfo="$extendedinfo)"
30197 echo "OK, all $passed tests passed$extendedinfo."
30200 # * Test `cvs update -d foo' (where foo does not exist).
30201 # * Test `cvs update foo bar' (where foo and bar are both from the
30202 # same directory in the repository). Suppose one is a branch--make
30203 # sure that both directories get updated with the respective correct
30205 # * `cvs update ../foo'. Also ../../foo ./../foo foo/../../bar /foo/bar
30206 # foo/.././../bar foo/../bar etc.
30207 # * Test all flags in modules file.
30208 # Test that ciprog gets run both on checkin in that directory, or a
30209 # higher-level checkin which recurses into it.
30210 # * Test operations on a directory that contains other directories but has
30211 # no files of its own.
30212 # * -t global option
30213 # * cvs rm followed by cvs add or vice versa (with no checkin in between).
30214 # * cvs rm twice (should be a nice error message).
30215 # * -P option to checkout--(a) refrains from checking out new empty dirs,
30216 # (b) prunes empty dirs already there.
30217 # * Test that cvs -d `hostname`:${TESTDIR}/non/existent co foo
30218 # gives an appropriate error (e.g.
30219 # Cannot access ${TESTDIR}/non-existent/CVSROOT
30220 # No such file or directory).
30221 # (like basica-9, but for remote).
30222 # * Test ability to send notifications in response to watches. (currently
30223 # hard to test because CVS doesn't send notifications if username is the
30225 # * Test the contents of adm files other than Root and Repository.
30226 # Entries seems the next most important thing.
30227 # * Test the following compatibility issues:
30228 # - The filler fields in "D" entries in CVS/Entries get preserved
30229 # (per cvs.texinfo).
30230 # - Unrecognized entry types in CVS/Entries get ignored (looks like
30231 # this needs to be documented in cvs.texinfo, but is not)
30232 # - Test that unrecognized files in CVS directories (e.g. CVS/Foobar)
30233 # are ignored (per cvs.texinfo).
30234 # - Test 'cvs history' with symlinks in the path to the working directory.
30235 # - Remove most of the CVS_SERVER stuff after a reasonable amount of time.
30236 # The "fork" & "client" series of tests should be left. 4/2/00, CVS
30237 # 1.11.0.1 was altered so that it would default to program_name (set from
30238 # argv[0]) rather than "cvs", but I'd like this script to work on legacy
30239 # versions of CVS for awhile.
30240 # - Testsuite doesn't work with usernames over eight characters in length.
30242 # End of TODO list.
30246 echo "Keeping ${TESTDIR} and exiting due to -k (keep) option."
30250 # Remove the test directory, but first change out of it.
30251 cd `dirname ${TESTDIR}`