/contrib/cvs/src/sanity.sh
Shell | 15696 lines | 12386 code | 1394 blank | 1916 comment | 457 complexity | cceaf0e0b88c0126424fe2fefc488af9 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, BSD-3-Clause, LGPL-2.0, LGPL-2.1, BSD-2-Clause, 0BSD, JSON, AGPL-1.0, GPL-2.0
- #! /bin/sh
- :
- # sanity.sh -- a growing testsuite for cvs.
- #
- # The copyright notice said: "Copyright (C) 1992, 1993 Cygnus Support"
- # I'm not adding new copyright notices for new years as our recent
- # practice has been to include copying terms without copyright notices.
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2, or (at your option)
- # any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # Original Author: K. Richard Pixley
- # usage:
- usage ()
- {
- echo "Usage: `basename $0` --help"
- echo "Usage: `basename $0` [-eklrv] [-f FROM-TEST] [-h HOSTNAME] CVS-TO-TEST [TESTS-TO-RUN...]"
- }
- exit_usage ()
- {
- usage 1>&2
- exit 2
- }
- exit_help ()
- {
- usage
- echo
- echo "-H|--help Display this text."
- echo "-e|--skipfail Treat tests that would otherwise be nonfatally skipped"
- echo " for reasons like missing tools as failures, exiting"
- echo " with an error message. Also treat warnings as"
- echo " failures."
- echo "-f FROM-TEST Run TESTS-TO-RUN, skipping all tests in the list before"
- echo " FROM-TEST."
- echo "-h HOSTNAME Use :ext:HOSTNAME to run remote tests rather than"
- echo " :fork:. Implies --remote and assumes that \$TESTDIR"
- echo " resolves to the same directory on both the client and"
- echo " the server."
- echo "-k|--keep Try to keep directories created by individual tests"
- echo " around, exiting after the first test which supports"
- echo " --keep."
- echo "-l|--link-root"
- echo " Test CVS using a symlink to a real CVSROOT."
- echo "-r|--remote Test remote instead of local cvs."
- echo "-v|--verbose List test names as they are executed."
- echo
- echo "CVS-TO-TEST The path to the CVS executable to be tested."
- echo "TESTS-TO-RUN The names of the tests to run (defaults to all tests)."
- exit 2
- }
- # See TODO list at end of file.
- # required to make this script work properly.
- unset CVSREAD
- # This will cause malloc to run slower but should also catch some common errors
- # when CVS is linked with glibc 2.x.
- MALLOC_CHECK_=2; export MALLOC_CHECK_
- # We want to invoke a predictable set of i18n behaviors, not whatever
- # the user running this script might have set.
- # In particular:
- # 'sort' and tabs and spaces (LC_COLLATE).
- # Messages from getopt (LC_MESSAGES) (in the future, CVS itself might
- # also alter its messages based on LC_MESSAGES).
- LANG=C
- export LANG
- LC_ALL=C
- export LC_ALL
- #
- # Initialize the test counts.
- #
- passed=0
- skipped=0
- warnings=0
- #
- # read our options
- #
- unset fromtest
- unset remotehost
- keep=false
- linkroot=false
- remote=false
- skipfail=false
- verbose=false
- while getopts ef:h:Hklrv-: option ; do
- # convert the long opts to short opts
- if test x$option = x-; then
- case "$OPTARG" in
- [hH]|[hH][eE]|[hH][eE][lL]|[hH][eE][lL][pP])
- option=H;
- OPTARG=
- ;;
- [kK]|[kK][eE]|[kK][eE][eE]|[kK][eE][eE][pP])
- option=k;
- OPTARG=
- ;;
- l|li|lin|link|link-|link-r]|link-ro|link-roo|link-root)
- option=l;
- OPTARG=
- ;;
- [rR]|[rR][eE]|[rR][eE][mM]|[rR][eE][mM][oO]|[rR][eE][mM][oO][tT]|[rR][eE][mM][oO][tT][eE])
- option=k;
- OPTARG=
- ;;
- s|sk|ski|skip|skipf|skipfa|skipfai|skipfail)
- option=e
- OPTARG=
- ;;
- v|ve|ver|verb|verbo|verbos|verbose)
- option=v
- OPTARG=
- ;;
- *)
- option=\?
- OPTARG=
- esac
- fi
- case "$option" in
- e)
- skipfail=:
- ;;
- f)
- fromtest="$OPTARG"
- ;;
- h)
- # Set a remotehost to run the remote tests on via :ext:
- # Implies `-r' and assumes that $TESTDIR resolves to the same
- # directory on the client and the server.
- remotehost="$OPTARG"
- remote=:
- ;;
- H)
- exit_help
- ;;
- k)
- # The -k (keep) option will eventually cause all the tests to
- # leave around the contents of the /tmp directory; right now only
- # some implement it. Not originally intended to be useful with
- # more than one test, but this should work if each test uses a
- # uniquely named dir (use the name of the test).
- keep=:
- ;;
- l)
- linkroot=:
- ;;
- r)
- remote=:
- ;;
- v)
- verbose=:
- ;;
- \?)
- exit_usage
- ;;
- esac
- done
- # boot the arguments we used above
- while test $OPTIND -gt 1 ; do
- shift
- OPTIND=`expr $OPTIND - 1`
- done
- # Use full path for CVS executable, so that CVS_SERVER gets set properly
- # for remote.
- case $1 in
- "")
- exit_usage
- ;;
- /*)
- testcvs=$1
- ;;
- *)
- testcvs=`pwd`/$1
- ;;
- esac
- shift
- # If $remotehost is set, warn if $TESTDIR isn't since we are pretty sure
- # that its default value of `/tmp/cvs-sanity' will not resolve to the same
- # directory on two different machines.
- if test -n "$remotehost" && test -z "$TESTDIR"; then
- echo "WARNING: CVS server hostname is set and \$TESTDIR is not. If" >&2
- echo "$remotehost is not the local machine, then it is unlikely that" >&2
- echo "the default value assigned to \$TESTDIR will resolve to the same" >&2
- echo "directory on both this client and the CVS server." >&2
- fi
- ###
- ### GUTS
- ###
- # "debugger"
- #set -x
- echo 'This test should produce no other output than this message, and a final "OK".'
- echo '(Note that the test can take an hour or more to run and periodically stops'
- echo 'for as long as one minute. Do not assume there is a problem just because'
- echo 'nothing seems to happen for a long time. If you cannot live without'
- echo 'running status, use the -v option or try the command:'
- echo "\`tail -f check.log' from another window.)"
- # Regexp to match what CVS will call itself in output that it prints.
- # FIXME: we don't properly quote this--if the name contains . we'll
- # just spuriously match a few things; if the name contains other regexp
- # special characters we are probably in big trouble.
- PROG=`basename ${testcvs}`
- # Match the hostname
- hostname="[-_.a-zA-Z0-9]*"
- # Regexp to match the name of a temporary file (from cvs_temp_name).
- # This appears in certain diff output.
- tempname="[-a-zA-Z0-9/.%_]*"
- # Regexp to match a date in RFC822 format (as amended by RFC1123).
- RFCDATE="[a-zA-Z0-9 ][a-zA-Z0-9 ]* [0-9:][0-9:]* -0000"
- RFCDATE_EPOCH="1 Jan 1970 00:00:00 -0000"
- # Regexp to match a date in standard Unix format as used by rdiff
- # FIXCVS: There's no reason for rdiff to use a different date format
- # than diff does
- DATE="[a-zA-Z]* [a-zA-Z]* [ 1-3][0-9] [0-9:]* [0-9]*"
- # Which directories should Which and find_tool search for executables?
- 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
- # Do not assume that `type -p cmd` is portable
- # Usage: Which [-a] [-x|-f|-r] prog [$SEARCHPATH:/with/directories:/to/search]
- Which() {
- # Optional first argument for file type, defaults to -x.
- # Second argument is the file or directory to be found.
- # Third argument is the PATH to search.
- # By default, print only the first file that matches,
- # -a will cause all matches to be printed.
- notevery=:
- if [ "x$1" = "x-a" ]; then notevery=false; shift; fi
- case "$1" in
- -*) t=$1; shift ;;
- *) t=-x ;;
- esac
- case "$1" in
- # FIXME: Someday this may need to be fixed
- # to deal better with C:\some\path\to\ssh values...
- /*) test $t $1 && echo $1 ;;
- *) for d in `IFS=:; echo ${2-$SEARCHPATH}`
- do
- test $t $d/$1 && { echo $d/$1; if $notevery; then break; fi; }
- done
- ;;
- esac
- }
- # On cygwin32, we may not have /bin/sh.
- if test -r /bin/sh; then
- TESTSHELL="/bin/sh"
- else
- TESTSHELL=`Which -f sh`
- if test ! -r "$TESTSHELL"; then
- TESTSHELL="/bin/sh"
- fi
- fi
- # FIXME: try things (what things? checkins?) without -m.
- #
- # Some of these tests are written to expect -Q. But testing with
- # -Q is kind of bogus, it is not the way users actually use CVS (usually).
- # So new tests probably should invoke ${testcvs} directly, rather than ${CVS}.
- # and then they've obviously got to do something with the output....
- #
- CVS="${testcvs} -Q"
- LOGFILE=`pwd`/check.log
- # Save the previous log in case the person running the tests decides
- # they want to look at it. The extension ".plog" is chosen for consistency
- # with dejagnu.
- if test -f check.log; then
- mv check.log check.plog
- fi
- # Create the log file so check.log can be tailed almost immediately after
- # this script is started. Otherwise it can take up to a minute or two before
- # the log file gets created when $remotehost is specified on some systems,
- # which makes for a lot of failed `tail -f' attempts.
- touch check.log
- # Workaround any X11Forwarding by ssh. Otherwise this text:
- # Warning: No xauth data; using fake authentication data for X11 forwarding.
- # has been known to end up in the test results below
- # causing the test to fail.
- [ -n "$DISPLAY" ] && unset DISPLAY
-
- # The default value of /tmp/cvs-sanity for TESTDIR is dubious,
- # because it loses if two people/scripts try to run the tests
- # at the same time. Some possible solutions:
- # 1. Use /tmp/cvs-test$$. One disadvantage is that the old
- # cvs-test* directories would pile up, because they wouldn't
- # necessarily get removed.
- # 2. Have everyone/everything running the testsuite set
- # TESTDIR to some appropriate directory.
- # 3. Have the default value of TESTDIR be some variation of
- # `pwd`/cvs-sanity. The biggest problem here is that we have
- # been fairly careful to test that CVS prints in messages the
- # actual pathnames that we pass to it, rather than a different
- # pathname for the same directory, as may come out of `pwd`.
- # So this would be lost if everything was `pwd`-based. I suppose
- # if we wanted to get baroque we could start making symlinks
- # to ensure the two are different.
- : ${CVS_RSH=rsh}; export CVS_RSH
- if test -n "$remotehost"; then
- # We need to set $tmp on the server since $TMPDIR is compared against
- # messages generated by the server.
- tmp=`$CVS_RSH $remotehost 'cd /tmp; /bin/pwd || pwd' 2>/dev/null`
- if test $? != 0; then
- echo "$CVS_RSH $remotehost failed." >&2
- exit 1
- fi
- else
- tmp=`(cd /tmp; /bin/pwd || pwd) 2>/dev/null`
- fi
- # Now:
- # 1) Set TESTDIR if it's not set already
- # 2) Remove any old test remnants
- # 3) Create $TESTDIR
- # 4) Normalize TESTDIR with `cd && (/bin/pwd || pwd)`
- # (This will match CVS output later)
- : ${TESTDIR=$tmp/cvs-sanity}
- # clean any old remnants (we need the chmod because some tests make
- # directories read-only)
- if test -d ${TESTDIR}; then
- chmod -R a+wx ${TESTDIR}
- rm -rf ${TESTDIR}
- fi
- # These exits are important. The first time I tried this, if the `mkdir && cd`
- # failed then the build directory would get blown away. Some people probably
- # wouldn't appreciate that.
- mkdir ${TESTDIR} || exit 1
- cd ${TESTDIR} || exit 1
- # Ensure $TESTDIR is absolute
- if echo "${TESTDIR}" |grep '^[^/]'; then
- # Don't resolve this unless we have to. This keeps symlinks intact. This
- # is important at least when testing using -h $remotehost, because the same
- # value for $TESTDIR must resolve to the same directory on the client and
- # the server and we likely used Samba, and possibly symlinks, to do this.
- TESTDIR=`(/bin/pwd || pwd) 2>/dev/null`
- fi
- if test -z "${TESTDIR}" || echo "${TESTDIR}" |grep '^[^/]'; then
- echo "Unable to resolve TESTDIR to an absolute directory." >&2
- exit 1
- fi
- cd ${TESTDIR}
- # Now set $TMPDIR if the user hasn't overridden it.
- #
- # We use a $TMPDIR under $TESTDIR by default so that two tests may be run at
- # the same time without bumping heads without requiring the user to specify
- # more than $TESTDIR. See the test for leftover cvs-serv* directories near the
- # end of this script at the end of "The big loop".
- : ${TMPDIR=$TESTDIR/tmp}
- export TMPDIR
- if test -d $TMPDIR; then :; else
- mkdir $TMPDIR
- fi
- # Make sure various tools work the way we expect, or try to find
- # versions that do.
- : ${AWK=awk}
- : ${EXPR=expr}
- : ${ID=id}
- : ${TR=tr}
- # Keep track of tools that are found, but do NOT work as we hope
- # in order to avoid them in future
- badtools=
- set_bad_tool ()
- {
- badtools=$badtools:$1
- }
- is_bad_tool ()
- {
- case ":$badtools:" in *:$1:*) return 0 ;; *) return 1 ; esac
- }
- version_test ()
- {
- vercmd=$1
- verbad=:
- if RES=`$vercmd --version </dev/null 2>&1`; then
- if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
- echo "$RES"
- verbad=false
- fi
- fi
- if $verbad; then
- echo "The command \`$vercmd' does not support the --version option."
- fi
- # It does not really matter that --version is not supported
- return 0
- }
- # Try to find a tool that satisfies all of the tests.
- # Usage: list:of:colon:separated:alternatives test1 test2 test3 test4...
- # Example: find_tool awk:gawk:nawk awk_tooltest1 awk_tooltest2
- find_tool ()
- {
- default_TOOL=$1
- echo find_tool: ${1+"$@"} >>$LOGFILE
- cmds="`IFS=:; echo $1`"; shift; tooltests="${1+$@}"
- if test -z "$tooltests"; then tooltests=version_test; fi
- clist=; for cmd in $cmds; do clist="$clist `Which -a $cmd`"; done
- # Make sure the default tool is just the first real command name
- for default_TOOL in $clist `IFS=:; echo $default_TOOL`; do break; done
- TOOL=""
- for trytool in $clist ; do
- pass=:
- for tooltest in $tooltests; do
- result=`eval $tooltest $trytool`
- rc=$?
- echo "Running $tooltest $trytool" >>$LOGFILE
- if test -n "$result"; then
- echo "$result" >>$LOGFILE
- fi
- if test "$rc" = "0"; then
- echo "PASS: $tooltest $trytool" >>$LOGFILE
- elif test "$rc" = "77"; then
- echo "MARGINAL: $tooltest $trytool; rc=$rc" >>$LOGFILE
- TOOL=$trytool
- pass=false
- else
- set_bad_tool $trytool
- echo "FAIL: $tooltest $trytool; rc=$rc" >>$LOGFILE
- pass=false
- fi
- done
- if $pass; then
- echo $trytool
- return 0
- fi
- done
- if test -n "$TOOL"; then
- echo "Notice: The default version of \`$default_TOOL' is defective." >>$LOGFILE
- echo "using \`$TOOL' and hoping for the best." >>$LOGFILE
- echo "Notice: The default version of \`$default_TOOL' is defective." >&2
- echo "using \`$TOOL' and hoping for the best." >&2
- echo $TOOL
- else
- echo $default_TOOL
- fi
- }
- id_tool_test ()
- {
- id=$1
- if $id -u >/dev/null 2>&1 && $id -un >/dev/null 2>&1; then
- return 0
- else
- echo "Running these tests requires an \`id' program that understands the"
- echo "-u and -n flags. Make sure that such an id (GNU, or many but not"
- echo "all vendor-supplied versions) is in your path."
- return 1
- fi
- }
- ID=`find_tool id version_test id_tool_test`
- echo "Using ID=$ID" >>$LOGFILE
- # You can't run CVS as root; print a nice error message here instead
- # of somewhere later, after making a mess.
- for pass in false :; do
- case "`$ID -u 2>/dev/null`" in
- "0")
- echo "Test suite does not work correctly when run as root" >&2
- exit 1
- ;;
- *)
- break
- ;;
- esac
- done
- # Cause NextStep 3.3 users to lose in a more graceful fashion.
- expr_tooltest1 ()
- {
- expr=$1
- if $expr 'abc
- def' : 'abc
- def' >/dev/null; then
- # good, it works
- return 0
- else
- echo 'Running these tests requires an "expr" program that can handle'
- echo 'multi-line patterns. Make sure that such an expr (GNU, or many but'
- echo 'not all vendor-supplied versions) is in your path.'
- return 1
- fi
- }
- # Warn SunOS, SysVr3.2, etc., users that they may be partially losing
- # if we can't find a GNU expr to ease their troubles...
- expr_tooltest2 ()
- {
- expr=$1
- if $expr 'a
- b' : 'a
- c' >/dev/null; then
- echo 'WARNING: you are using a version of expr that does not correctly'
- echo 'match multi-line patterns. Some tests may spuriously pass or fail.'
- echo 'You may wish to make sure GNU expr is in your path.'
- return 1
- else
- return 0
- fi
- }
- expr_create_bar ()
- {
- echo 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >${TESTDIR}/foo
- cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
- cat ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar >${TESTDIR}/foo
- cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
- rm -f ${TESTDIR}/foo
- }
- expr_tooltest3 ()
- {
- expr=$1
- # More SunOS lossage...
- test ! -f ${TESTDIR}/bar && expr_create_bar
- if $expr "`cat ${TESTDIR}/bar`" : "`cat ${TESTDIR}/bar`" >/dev/null; then
- : good, it works
- else
- echo 'WARNING: you are using a version of expr that does not correctly'
- echo 'match large patterns. Some tests may spuriously pass or fail.'
- echo 'You may wish to make sure GNU expr is in your path.'
- return 1
- fi
- if $expr "`cat ${TESTDIR}/bar`x" : "`cat ${TESTDIR}/bar`y" >/dev/null; then
- echo 'WARNING: you are using a version of expr that does not correctly'
- echo 'match large patterns. Some tests may spuriously pass or fail.'
- echo 'You may wish to make sure GNU expr is in your path.'
- return 1
- fi
- # good, it works
- return 0
- }
- # That we should have to do this is total bogosity, but GNU expr
- # version 1.9.4-1.12 uses the emacs definition of "$" instead of the unix
- # (e.g. SunOS 4.1.3 expr) one. Rumor has it this will be fixed in the
- # next release of GNU expr after 1.12 (but we still have to cater to the old
- # ones for some time because they are in many linux distributions).
- ENDANCHOR="$"
- expr_set_ENDANCHOR ()
- {
- expr=$1
- ENDANCHOR="$"
- if $expr 'abc
- def' : 'abc$' >/dev/null; then
- ENDANCHOR='\'\'
- echo "Notice: An ENDANCHOR of dollar does not work."
- echo "Using a workaround for GNU expr versions 1.9.4 thru 1.12"
- fi
- return 0
- }
- # Work around another GNU expr (version 1.10-1.12) bug/incompatibility.
- # "." doesn't appear to match a newline (it does with SunOS 4.1.3 expr).
- # Note that the workaround is not a complete equivalent of .* because
- # the first parenthesized expression in the regexp must match something
- # in order for expr to return a successful exit status.
- # Rumor has it this will be fixed in the
- # next release of GNU expr after 1.12 (but we still have to cater to the old
- # ones for some time because they are in many linux distributions).
- DOTSTAR='.*'
- expr_set_DOTSTAR ()
- {
- expr=$1
- DOTSTAR='.*'
- if $expr 'abc
- def' : "a${DOTSTAR}f" >/dev/null; then
- : good, it works
- else
- DOTSTAR='\(.\|
- \)*'
- echo "Notice: DOTSTAR changed from sane \`.*' value to \`$DOTSTAR\`"
- echo "to workaround GNU expr version 1.10 thru 1.12 bug where \`.'"
- echo "does not match a newline."
- fi
- return 0
- }
- # Now that we have DOTSTAR, make sure it works with big matches
- expr_tooltest_DOTSTAR ()
- {
- expr=$1
- test ! -f ${TESTDIR}/bar && expr_create_bar
- if $expr "`cat ${TESTDIR}/bar`" : "${DOTSTAR}xyzABC${DOTSTAR}$" >/dev/null; then
- # good, it works
- return 0
- else
- echo 'WARNING: you are using a version of expr that does not correctly'
- echo 'match large patterns. Some tests may spuriously pass or fail.'
- echo 'You may wish to make sure GNU expr is in your path.'
- return 77
- fi
- }
- # FreeBSD 5.2 and 6.1 support 'expr [-e] expression'
- # They get confused unless '--' is used before the expressions
- # when those expressions begin with a '-' character, such as the
- # output of an ls -l command. The EXPR_COMPAT environment variable may
- # be used to go back to the non-POSIX behavior as an alternative.
- # (GNU expr appears to accept the '--' argument and work correctly or
- # not have it and still get the results we want.)
- exprDASHDASH='false'
- expr_set_DASHDASH ()
- {
- expr=$1
- exprDASHDASH='false'
- # Not POSIX, but works on a lot of expr versions.
- if $expr "-rw-rw-r--" : "-rw-rw-r--" >/dev/null 2>&1; then
- # good, it works
- return 0
- else
- # Do things in the POSIX manner.
- if $expr -- "-rw-rw-r--" : "-rw-rw-r--" >/dev/null 2>&1; then
- exprDASHDASH=':'
- return 0
- else
- echo 'WARNING: Your $expr does not correctly handle'
- echo 'leading "-" characters in regular expressions to'
- echo 'be matched. You may wish to see if there is an'
- echo 'environment variable or other setting to allow'
- echo 'POSIX functionality to be enabled.'
- return 77
- fi
- fi
- }
- EXPR=`find_tool ${EXPR}:gexpr \
- version_test expr_tooltest1 expr_tooltest2 expr_tooltest3 \
- expr_set_ENDANCHOR expr_set_DOTSTAR expr_tooltest_DOTSTAR`
- # Set the ENDANCHOR and DOTSTAR for the chosen expr version.
- expr_set_ENDANCHOR ${EXPR} >/dev/null
- expr_tooltest_DOTSTAR ${EXPR} >/dev/null
- # Is $EXPR a POSIX or non-POSIX implementation
- # with regard to command-line arguments?
- expr_set_DASHDASH ${EXPR}
- $exprDASHDASH && EXPR="$EXPR --"
- echo "Using EXPR=$EXPR" >>$LOGFILE
- echo "Using ENDANCHOR=$ENDANCHOR" >>$LOGFILE
- echo "Using DOTSTAR=$DOTSTAR" >>$LOGFILE
- # Cleanup
- rm -f ${TESTDIR}/bar
- # Work around yet another GNU expr (version 1.10) bug/incompatibility.
- # "+" is a special character, yet for unix expr (e.g. SunOS 4.1.3)
- # it is not. I doubt that POSIX allows us to use \+ and assume it means
- # (non-special) +, so here is another workaround
- # Rumor has it this will be fixed in the
- # next release of GNU expr after 1.12 (but we still have to cater to the old
- # ones for some time because they are in many linux distributions).
- PLUS='+'
- if $EXPR 'a +b' : "a ${PLUS}b" >/dev/null; then
- : good, it works
- else
- PLUS='\+'
- fi
- # Likewise, for ?
- QUESTION='?'
- if $EXPR 'a?b' : "a${QUESTION}b" >/dev/null; then
- : good, it works
- else
- QUESTION='\?'
- fi
- # Now test the username to make sure it contains only valid characters
- username=`$ID -un`
- if $EXPR "${username}" : "${username}" >/dev/null; then
- : good, it works
- else
- echo "Test suite does not work correctly when run by a username" >&2
- echo "containing regular expression meta-characters." >&2
- exit 1
- fi
- # Only 8 characters of $username appear in some output.
- if test `echo $username |wc -c` -gt 8; then
- username8=`echo $username |sed 's/^\(........\).*/\1/'`
- else
- username8=$username
- fi
- # Rarely, we need to match any username, not just the name of the user
- # running this test.
- #
- # I'm not really sure what characters should be here. a-zA-Z obviously.
- # People complained when 0-9 were not allowed in usernames. Other than that
- # I'm not sure.
- anyusername="[-a-zA-Z0-9][-a-zA-Z0-9]*"
- # now make sure that tr works on NULs
- tr_tooltest1 ()
- {
- tr=$1
- if $EXPR `echo "123" | $tr '2' '\0'` : "123" >/dev/null 2>&1; then
- echo 'Warning: you are using a version of tr which does not correctly'
- echo 'handle NUL bytes. Some tests may spuriously pass or fail.'
- echo 'You may wish to make sure GNU tr is in your path.'
- return 77
- fi
- # good, it works
- return 0
- }
- TR=`find_tool ${TR}:gtr version_test tr_tooltest1`
- echo "Using TR=$TR" >>$LOGFILE
- # Awk testing
- awk_tooltest1 ()
- {
- awk=$1
- $awk 'BEGIN {printf("one\ntwo\nthree\nfour\nfive\nsix")}' </dev/null >abc
- if $EXPR "`cat abc`" : \
- 'one
- two
- three
- four
- five
- six'; then
- rm abc
- return 0
- else
- rm abc
- echo "Notice: awk BEGIN clause or printf is not be working properly."
- return 1
- fi
- }
- # Format item %c check
- awk_tooltest2 ()
- {
- awk=$1
- $awk 'BEGIN { printf "%c%c%c", 2, 3, 4 }' </dev/null \
- | ${TR} '\002\003\004' '123' >abc
- if $EXPR "`cat abc`" : "123" ; then
- : good, found it
- else
- echo "Notice: awk format %c string may not be working properly."
- rm abc
- return 77
- fi
- rm abc
- return 0
- }
- AWK=`find_tool gawk:nawk:awk version_test awk_tooltest1 awk_tooltest2`
- echo "Using AWK=$AWK" >>$LOGFILE
- # Test that $1 works as a remote shell. If so, set $host, $CVS_RSH, &
- # $save_CVS_RSH to match and return 0. Otherwise, set $skipreason and return
- # 77.
- depends_on_rsh ()
- {
- host=${remotehost-"`hostname`"}
- result=`$1 $host 'echo test'`
- rc=$?
- if test $? != 0 || test "x$result" != "xtest"; then
- skipreason="\`$1 $host' failed rc=$rc result=$result"
- return 77
- fi
- save_CVS_RSH=$CVS_RSH
- CVS_RSH=$1; export CVS_RSH
- return 0
- }
- # Find a usable SSH. When a usable ssh is found, set $host, $CVS_RSH, and
- # $save_CVS_RSH and return 0. Otherwise, set $skipreason and return 77.
- depends_on_ssh ()
- {
- case "$CVS_RSH" in
- *ssh*|*putty*)
- tryssh=`Which $CVS_RSH`
- if [ ! -n "$tryssh" ]; then
- skipreason="Unable to find CVS_RSH=$CVS_RSH executable"
- return 77
- elif [ ! -x "$tryssh" ]; then
- skipreason="Unable to execute $tryssh program"
- return 77
- fi
- ;;
- *)
- # Look in the user's PATH for "ssh"
- tryssh=`Which ssh`
- if test ! -r "$tryssh"; then
- skipreason="Unable to find ssh program"
- return 77
- fi
- ;;
- esac
- depends_on_rsh "$tryssh"
- return $?
- }
- pass ()
- {
- echo "PASS: $1" >>${LOGFILE}
- passed=`expr $passed + 1`
- }
- # Like skip(), but don't fail when $skipfail is set.
- skip_always ()
- {
- echo "SKIP: $1${2+ ($2)}" >>$LOGFILE
- skipped=`expr $skipped + 1`
- }
- skip ()
- {
- if $skipfail; then
- fail "$1${2+ ($2)}"
- else
- echo "SKIP: $1${2+ ($2)}" >>$LOGFILE
- fi
- skipped=`expr $skipped + 1`
- }
- warn ()
- {
- if $skipfail; then
- fail "$1${2+ ($2)}"
- else
- echo "WARNING: $1${2+ ($2)}" >>$LOGFILE
- fi
- warnings=`expr $warnings + 1`
- }
- # Convenience function for skipping tests run only in local mode.
- localonly ()
- {
- skip_always $1 "only tested in local mode"
- }
- fail ()
- {
- echo "FAIL: $1" | tee -a ${LOGFILE}
- echo "*** Please see the \`TESTS' and \`check.log' files for more information." >&2
- # This way the tester can go and see what remnants were left
- exit 1
- }
- verify_tmp_empty ()
- {
- # Test our temp directory for cvs-serv* directories and cvsXXXXXX temp
- # files. We would like to not leave any behind.
- if $remote && ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
- # A true value means ls found files/directories with these names.
- # Give the server some time to finish, then retry.
- sleep 1
- if ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
- warn "$1" "Found cvs-serv* directories in $TMPDIR."
- # The above will exit if $skipfail
- rm -rf $TMPDIR/cvs-serv*
- fi
- fi
- if ls $TMPDIR/cvs?????? >/dev/null 2>&1; then
- # A true value means ls found files/directories with these names.
- warn "$1" "Found cvsXXXXXX temp files in $TMPDIR."
- # The above will exit if $skipfail
- rm -f ls $TMPDIR/cvs??????
- fi
- }
- # Restore changes to CVSROOT admin files.
- restore_adm ()
- {
- rm -rf $CVSROOT_DIRNAME/CVSROOT
- cp -Rp $TESTDIR/CVSROOT.save $CVSROOT_DIRNAME/CVSROOT
- }
- # See dotest and dotest_fail for explanation (this is the parts
- # of the implementation common to the two).
- dotest_internal ()
- {
- if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$3${ENDANCHOR}" >/dev/null; then
- # Why, I hear you ask, do we write this to the logfile
- # even when the test passes? The reason is that the test
- # may give us the regexp which we were supposed to match,
- # but sometimes it may be useful to look at the exact
- # text which was output. For example, suppose one wants
- # to grep for a particular warning, and make _sure_ that
- # CVS never hits it (even in cases where the tests might
- # match it with .*). Or suppose one wants to see the exact
- # date format output in a certain case (where the test will
- # surely use a somewhat non-specific pattern).
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- pass "$1"
- verify_tmp_empty "$1"
- # expr can't distinguish between "zero characters matched" and "no match",
- # so special-case it.
- elif test -z "$3" && test ! -s ${TESTDIR}/dotest.tmp; then
- pass "$1"
- verify_tmp_empty "$1"
- elif test x"$4" != x; then
- if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$4${ENDANCHOR}" >/dev/null; then
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- pass "$1"
- verify_tmp_empty "$1"
- else
- echo "** expected: " >>${LOGFILE}
- echo "$3" >>${LOGFILE}
- echo "$3" > ${TESTDIR}/dotest.ex1
- echo "** or: " >>${LOGFILE}
- echo "$4" >>${LOGFILE}
- echo "$4" > ${TESTDIR}/dotest.ex2
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- fail "$1"
- fi
- else
- echo "** expected: " >>${LOGFILE}
- echo "$3" >>${LOGFILE}
- echo "$3" > ${TESTDIR}/dotest.exp
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- fail "$1"
- fi
- }
- dotest_all_in_one ()
- {
- if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : \
- "`cat ${TESTDIR}/dotest.exp`" >/dev/null; then
- return 0
- fi
- return 1
- }
- # WARNING: this won't work with REs that match newlines....
- #
- dotest_line_by_line ()
- {
- line=1
- while [ $line -le `wc -l <${TESTDIR}/dotest.tmp` ] ; do
- if $EXPR "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" : \
- "`sed -n ${line}p ${TESTDIR}/dotest.exp`" >/dev/null; then
- :
- elif test -z "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" &&
- test -z "`sed -n ${line}p ${TESTDIR}/dotest.exp`"; then
- :
- else
- echo "Line $line:" >> ${LOGFILE}
- echo "**** expected: " >>${LOGFILE}
- sed -n ${line}p ${TESTDIR}/dotest.exp >>${LOGFILE}
- echo "**** got: " >>${LOGFILE}
- sed -n ${line}p ${TESTDIR}/dotest.tmp >>${LOGFILE}
- unset line
- return 1
- fi
- line=`expr $line + 1`
- done
- unset line
- return 0
- }
- # If you are having trouble telling which line of a multi-line
- # expression is not being matched, replace calls to dotest_internal()
- # with calls to this function:
- #
- dotest_internal_debug ()
- {
- if test -z "$3"; then
- if test -s ${TESTDIR}/dotest.tmp; then
- echo "** expected: " >>${LOGFILE}
- echo "$3" >>${LOGFILE}
- echo "$3" > ${TESTDIR}/dotest.exp
- rm -f ${TESTDIR}/dotest.ex2
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- fail "$1"
- else
- pass "$1"
- verify_tmp_empty "$1"
- fi
- else
- echo "$3" > ${TESTDIR}/dotest.exp
- if dotest_line_by_line "$1" "$2"; then
- pass "$1"
- verify_tmp_empty "$1"
- else
- if test x"$4" != x; then
- mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex1
- echo "$4" > ${TESTDIR}/dotest.exp
- if dotest_line_by_line "$1" "$2"; then
- pass "$1"
- verify_tmp_empty "$1"
- else
- mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex2
- echo "** expected: " >>${LOGFILE}
- echo "$3" >>${LOGFILE}
- echo "** or: " >>${LOGFILE}
- echo "$4" >>${LOGFILE}
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- fail "$1"
- fi
- else
- echo "** expected: " >>${LOGFILE}
- echo "$3" >>${LOGFILE}
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- fail "$1"
- fi
- fi
- fi
- }
- # Usage:
- # dotest TESTNAME COMMAND OUTPUT [OUTPUT2]
- # TESTNAME is the name used in the log to identify the test.
- # COMMAND is the command to run; for the test to pass, it exits with
- # exitstatus zero.
- # OUTPUT is a regexp which is compared against the output (stdout and
- # stderr combined) from the test. It is anchored to the start and end
- # of the output, so should start or end with ".*" if that is what is desired.
- # Trailing newlines are stripped from the command's actual output before
- # matching against OUTPUT.
- # If OUTPUT2 is specified and the output matches it, then it is also
- # a pass (partial workaround for the fact that some versions of expr
- # lack \|).
- dotest ()
- {
- rm -f ${TESTDIR}/dotest.ex? 2>&1
- eval "$2" >${TESTDIR}/dotest.tmp 2>&1
- status=$?
- if test "$status" != 0; then
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- echo "exit status was $status" >>${LOGFILE}
- fail "$1"
- fi
- dotest_internal "$@"
- }
- # Like dotest except only 2 args and result must exactly match stdin
- dotest_lit ()
- {
- rm -f ${TESTDIR}/dotest.ex? 2>&1
- eval "$2" >${TESTDIR}/dotest.tmp 2>&1
- status=$?
- if test "$status" != 0; then
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- echo "exit status was $status" >>${LOGFILE}
- fail "$1"
- fi
- cat >${TESTDIR}/dotest.exp
- if cmp ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.tmp >/dev/null 2>&1; then
- pass "$1"
- verify_tmp_empty "$1"
- else
- echo "** expected: " >>${LOGFILE}
- cat ${TESTDIR}/dotest.exp >>${LOGFILE}
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- fail "$1"
- fi
- }
- # Like dotest except exitstatus should be nonzero.
- dotest_fail ()
- {
- rm -f ${TESTDIR}/dotest.ex? 2>&1
- eval "$2" >${TESTDIR}/dotest.tmp 2>&1
- status=$?
- if test "$status" = 0; then
- cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
- echo "exit status was $status" >>${LOGFILE}
- fail "$1"
- fi
- dotest_internal "$@"
- }
- # Like dotest except output is sorted.
- dotest_sort ()
- {
- rm -f ${TESTDIR}/dotest.ex? 2>&1
- eval "$2" >${TESTDIR}/dotest.tmp1 2>&1
- status=$?
- if test "$status" != 0; then
- cat ${TESTDIR}/dotest.tmp1 >>${LOGFILE}
- echo "exit status was $status" >>${LOGFILE}
- fail "$1"
- fi
- ${TR} ' ' ' ' < ${TESTDIR}/dotest.tmp1 | sort > ${TESTDIR}/dotest.tmp
- dotest_internal "$@"
- }
- # A function for fetching the timestamp of a revison of a file
- getrlogdate () {
- ${testcvs} -n rlog -N ${1+"$@"} |
- while read token value; do
- case "$token" in
- date:)
- echo $value | sed "s,;.*,,"
- break;
- ;;
- esac
- done
- }
- # Avoid picking up any stray .cvsrc, etc., from the user running the tests
- mkdir home
- HOME=${TESTDIR}/home; export HOME
- # Make sure this variable is not defined to anything that would
- # change the format of rcs dates. Otherwise people using e.g.,
- # RCSINIT=-zLT get lots of spurious failures.
- RCSINIT=; export RCSINIT
- # Remaining arguments are the names of tests to run.
- #
- # The testsuite is broken up into (hopefully manageably-sized)
- # independently runnable tests, so that one can quickly get a result
- # from a cvs or testsuite change, and to facilitate understanding the
- # tests.
- if test x"$*" = x; then
- # Basic/miscellaneous functionality
- tests="version basica basicb basicc basic1 deep basic2"
- tests="${tests} parseroot parseroot2 files spacefiles commit-readonly"
- tests="${tests} commit-add-missing"
- tests="$tests add-restricted"
- tests="${tests} status"
- # Branching, tagging, removing, adding, multiple directories
- tests="${tests} rdiff rdiff-short"
- tests="${tests} rdiff2 diff diffnl death death2 death-rtag"
- tests="${tests} rm-update-message rmadd rmadd2 rmadd3 resurrection"
- tests="${tests} dirs dirs2 branches branches2 tagc tagf "
- tests="${tests} tag-log tag-space"
- tests="${tests} rcslib multibranch import importb importc import-CVS"
- tests="$tests import-quirks"
- tests="${tests} update-p import-after-initial branch-after-import"
- tests="${tests} join join2 join3 join4 join5 join6 join7 join8 join9"
- tests="${tests} join-readonly-conflict join-admin join-admin-2"
- tests="${tests} join-rm"
- tests="${tests} new newb conflicts conflicts2 conflicts3 conflicts4"
- tests="${tests} clean"
- # Checking out various places (modules, checkout -d, &c)
- tests="${tests} modules modules2 modules3 modules4 modules5 modules6"
- tests="${tests} modules7 mkmodules co-d"
- tests="${tests} cvsadm emptydir abspath abspath2 toplevel toplevel2"
- tests="${tests} rstar-toplevel trailingslashes checkout_repository"
- # Log messages, error messages.
- tests="${tests} mflag editor errmsg1 errmsg2 adderrmsg opterrmsg"
- # Watches, binary files, history browsing, &c.
- tests="${tests} devcom devcom2 devcom3 watch4 watch5 watch6"
- tests="${tests} unedit-without-baserev"
- tests="${tests} ignore ignore-on-branch binfiles binfiles2 binfiles3"
- tests="${tests} mcopy binwrap binwrap2"
- tests="${tests} binwrap3 mwrap info taginfo config"
- tests="${tests} serverpatch log log2 logopt ann ann-id"
- # Repository Storage (RCS file format, CVS lock files, creating
- # a repository without "cvs init", &c).
- tests="${tests} crerepos crerepos-extssh rcs rcs2 rcs3 rcs4 rcs5 rcs6"
- tests="$tests lockfiles backuprecover"
- tests="${tests} sshstdio"
- # More history browsing, &c.
- tests="${tests} history"
- tests="${tests} big modes modes2 modes3 stamps"
- # PreservePermissions stuff: permissions, symlinks et al.
- # tests="${tests} perms symlinks symlinks2 hardlinks"
- # More tag and branch tests, keywords.
- tests="${tests} sticky keyword keywordlog keywordname keyword2"
- tests="${tests} head tagdate multibranch2 tag8k"
- # "cvs admin", reserved checkouts.
- tests="${tests} admin reserved"
- # Nuts and bolts of diffing/merging (diff library, &c)
- tests="${tests} diffmerge1 diffmerge2"
- # Release of multiple directories
- tests="${tests} release"
- tests="${tests} recase"
- # Multiple root directories and low-level protocol tests.
- tests="${tests} multiroot multiroot2 multiroot3 multiroot4"
- tests="$tests rmroot reposmv pserver server server2 server3"
- tests="$tests client client2"
- tests="${tests} dottedroot fork commit-d"
- else
- tests="$*"
- fi
- # Now check the -f argument for validity.
- if test -n "$fromtest"; then
- # Don't allow spaces - they are our delimiters in tests
- count=0
- for sub in $fromtest; do
- count=`expr $count + 1`
- done
- if test $count != 1; then
- echo "No such test \`$fromtest'." >&2
- exit 2
- fi
- # make sure it is in $tests
- case " $tests " in
- *" $fromtest "*)
- ;;
- *)
- echo "No such test \`$fromtest'." >&2
- exit 2
- ;;
- esac
- fi
- # a simple function to compare directory contents
- #
- # Returns: 0 for same, 1 for different
- #
- directory_cmp ()
- {
- OLDPWD=`pwd`
- DIR_1=$1
- DIR_2=$2
- cd $DIR_1
- find . -print | fgrep -v /CVS | sort > $TESTDIR/dc$$d1
- # go back where we were to avoid symlink hell...
- cd $OLDPWD
- cd $DIR_2
- find . -print | fgrep -v /CVS | sort > $TESTDIR/dc$$d2
- if diff $TESTDIR/dc$$d1 $TESTDIR/dc$$d2 >/dev/null 2>&1
- then
- :
- else
- return 1
- fi
- cd $OLDPWD
- while read a
- do
- if test -f $DIR_1/"$a" ; then
- cmp -s $DIR_1/"$a" $DIR_2/"$a"
- if test $? -ne 0 ; then
- return 1
- fi
- fi
- done < $TESTDIR/dc$$d1
- rm -f $TESTDIR/dc$$*
- return 0
- }
- #
- # The following 4 functions are used by the diffmerge1 test case. They set up,
- # respectively, the four versions of the files necessary:
- #
- # 1. Ancestor revisions.
- # 2. "Your" changes.
- # 3. "My" changes.
- # 4. Expected merge result.
- #
- # Create ancestor revisions for diffmerge1
- diffmerge_create_older_files() {
- # This test case was supplied by Noah Friedman:
- cat >testcase01 <<EOF
- // Button.java
- package random.application;
- import random.util.*;
- public class Button
- {
- /* Instantiates a Button with origin (0, 0) and zero width and height.
- * You must call an initializer method to properly initialize the Button.
- */
- public Button ()
- {
- super ();
- _titleColor = Color.black;
- _disabledTitleColor = Color.gray;
- _titleFont = Font.defaultFont ();
- }
- /* Convenience constructor for instantiating a Button with
- * bounds x, y, width, and height. Equivalent to
- * foo = new Button ();
- * foo.init (x, y, width, height);
- */
- public Button (int x, int y, int width, int height)
- {
- this ();
- init (x, y, width, height);
- }
- }
- EOF
- # This test case was supplied by Jacob Burckhardt:
- cat >testcase02 <<EOF
- a
- a
- a
- a
- a
- EOF
- # This test case was supplied by Karl Tomlinson who also wrote the
- # patch which lets CVS correctly handle this and several other cases:
- cat >testcase03 <<EOF
- x
- s
- a
- b
- s
- y
- EOF
- # This test case was supplied by Karl Tomlinson:
- cat >testcase04 <<EOF
- s
- x
- m
- m
- x
- s
- v
- s
- x
- m
- m
- x
- s
- EOF
- # This test case was supplied by Karl Tomlinson:
- cat >testcase05 <<EOF
- s
- x
- m
- m
- x
- x
- x
- x
- x
- x
- x
- x
- x
- x
- s
- s
- s
- s
- s
- s
- s
- s
- s
- s
- v
- EOF
- # This test case was supplied by Jacob Burckhardt:
- cat >testcase06 <<EOF
- g
- i
- EOF
- # This test is supposed to verify that the horizon lines are the same
- # for both 2-way diffs, but unfortunately, it does not fail with the
- # old version of cvs. However, Karl Tomlinson still thought it would
- # be good to test it anyway:
- cat >testcase07 <<EOF
- h
- f
- g
- r
- i
- i
- EOF
- # This test case was supplied by Jacob Burckhardt:
- cat >testcase08 <<EOF
- Both changes move this line to the end of the file.
- no
- changes
- here
- First change will delete this line.
- First change will also delete this line.
- no
- changes
- here
- Second change will change it here.
- no
- changes
- here
- EOF
- # This test case was supplied by Jacob Burckhardt. Note that I do not
- # think cvs has ever failed with this case, but I include it anyway,
- # since I think it is a hard case. It is hard because Peter Miller's
- # fmerge utility fails on it:
- cat >testcase09 <<EOF
- m
- a
- {
- }
- b
- {
- }
- EOF
- # This test case was supplied by Martin Dorey and simplified by Jacob
- # Burckhardt:
- cat >testcase10 <<EOF
- petRpY ( MtatRk );
- fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
- MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
- OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
- Bloke_GttpfIRte_MtpeaL ( &acI );
- MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
- {
- fV ( Y < 16 )
- {
- petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
- Y * jfle_Uecopd_MfJe_fY_Mectopk,
- jfle_Uecopd_MfJe_fY_Mectopk,
- nRVVep ) );
- }
- elke
- {
- petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
- ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
- jfle_Uecopd_MfJe_fY_Mectopk,
- nRVVep ) );
- }
- }
- /****************************************************************************
- * *
- * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
- * *
- ****************************************************************************/
- MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
- {
- MTGTXM MtatRk = Zy;
- MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
- petRpY ( MtatRk );
- }
- HfkQipfte ( waYdle, /* waYdle */
- waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
- (coYkt RfYt8*) nRVVep, /* nRVVep */
- 0, /* MRrepVlRoRk KfxoYfkL */
- beYgtz /* nEtek to Apfte */
- );
- petRpY ( Zy );
- }
- EOF
- }
- # Create "your" revisions for diffmerge1
- diffmerge_create_your_files() {
- # remove the Button() method
- cat >testcase01 <<\EOF
- // Button.java
- package random.application;
- import random.util.*;
- public class Button
- {
- /* Instantiates a Button with origin (0, 0) and zero width and height.
- * You must call an initializer method to properly initialize the Button.
- */
- public Button ()
- {
- super ();
- _titleColor = Color.black;
- _disabledTitleColor = Color.gray;
- _titleFont = Font.defaultFont ();
- }
- }
- EOF
- cat >testcase02 <<\EOF
- y
- a
- a
- a
- a
- EOF
- cat >testcase03 <<\EOF
- x
- s
- a
- b
- s
- b
- s
- y
- EOF
- cat >testcase04 <<\EOF
- s
- m
- s
- v
- s
- m
- s
- EOF
- cat >testcase05 <<\EOF
- v
- s
- m
- s
- s
- s
- s
- s
- s
- s
- s
- s
- s
- v
- EOF
- # Test case 6 and test case 7 both use the same input files, but they
- # order the input files differently. In one case, a certain file is
- # used as the older file, but in the other test case, that same file
- # is used as the file which has changes. I could have put echo
- # commands here, but since the echo lines would be the same as those
- # in the previous function, I decided to save space and avoid repeating
- # several lines of code. Instead, I merely swap the files:
- mv testcase07 tmp
- mv testcase06 testcase07
- mv tmp testcase06
- # Make the date newer so that cvs thinks that the files are changed:
- touch testcase06 testcase07
- cat >testcase08 <<\EOF
- no
- changes
- here
- First change has now added this in.
- no
- changes
- here
- Second change will change it here.
- no
- changes
- here
- Both changes move this line to the end of the file.
- EOF
- cat >testcase09 <<\EOF
- m
- a
- {
- }
- b
- {
- }
- c
- {
- }
- EOF
- cat >testcase10 <<\EOF
- fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
- petRpY ( MtatRk );
- fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
- fV ( jfle_Uecopd_KRLIep < 16 )
- {
- MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
- }
- elke
- {
- MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
- fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
- MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
- OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
- Bloke_GttpfIRte_MtpeaL ( &acI );
- MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
- {
- MTGTXM MtatRk = Zy;
- fV ( Y < 16 )
- {
- petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
- Y * jfle_Uecopd_MfJe_fY_Mectopk,
- jfle_Uecopd_MfJe_fY_Mectopk,
- nRVVep ) );
- }
- elke
- {
- petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
- ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
- jfle_Uecopd_MfJe_fY_Mectopk,
- nRVVep ) );
- }
- petRpY ( MtatRk );
- }
- /****************************************************************************
- * *
- * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
- * *
- ****************************************************************************/
- MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
- {
- MTGTXM MtatRk = Zy;
- MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
- petRpY ( MtatRk );
- }
- HfkQipfte ( waYdle, /* waYdle */
- waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
- (coYkt RfYt8*) nRVVep, /* nRVVep */
- 0, /* MRrepVlRoRk KfxoYfkL */
- beYgtz /* nEtek to Apfte */
- );
- petRpY ( Zy );
- }
- EOF
- }
- # Create "my" revisions for diffmerge1
- diffmerge_create_my_files() {
- # My working copy still has the Button() method, but I
- # comment out some code at the top of the class.
- cat >testcase01 <<\EOF
- // Button.java
- package random.application;
- import random.util.*;
- public class Button
- {
- /* Instantiates a Button with origin (0, 0) and zero width and height.
- * You must call an initializer method to properly initialize the Button.
- */
- public Button ()
- {
- super ();
- // _titleColor = Color.black;
- // _disabledTitleColor = Color.gray;
- // _titleFont = Font.defaultFont ();
- }
- /* Convenience constructor for instantiating a Button with
- * bounds x, y, width, and height. Equivalent to
- * foo = new Button ();
- * foo.init (x, y, width, height);
- */
- public Button (int x, int y, int width, int height)
- {
- this ();
- init (x, y, width, height);
- }
- }
- EOF
- cat >testcase02 <<\EOF
- a
- a
- a
- a
- m
- EOF
- cat >testcase03 <<\EOF
- x
- s
- c
- s
- b
- s
- y
- EOF
- cat >testcase04 <<\EOF
- v
- s
- x
- m
- m
- x
- s
- v
- s
- x
- m
- m
- x
- s
- v
- EOF
- # Note that in test case 5, there are no changes in the "mine"
- # section, which explains why there is no command here which writes to
- # file testcase05.
- # no changes for testcase06
- # The two branches make the same changes:
- cp ../yours/testcase07 .
- cat >testcase08 <<\EOF
- no
- changes
- here
- First change will delete this line.
- First change will also delete this line.
- no
- changes
- here
- Second change has now changed it here.
- no
- changes
- here
- Both changes move this line to the end of the file.
- EOF
- cat >testcase09 <<\EOF
- m
- a
- {
- }
- b
- {
- }
- c
- {
- }
- EOF
- cat >testcase10 <<\EOF
- petRpY ( MtatRk );
- fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
- MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
- OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
- Bloke_GttpfIRte_MtpeaL ( &acI );
- MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
- {
- fV ( Y < 16 )
- {
- petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
- Y * jfle_Uecopd_MfJe_fY_Mectopk,
- jfle_Uecopd_MfJe_fY_Mectopk,
- nRVVep ) );
- }
- elke
- {
- petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
- ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
- jfle_Uecopd_MfJe_fY_Mectopk,
- nRVVep ) );
- }
- }
- /****************************************************************************
- * *
- * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
- * *
- ****************************************************************************/
- MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
- {
- MTGTXM MtatRk = Zy;
- MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
- petRpY ( MtatRk );
- }
- HfkQipfte ( waYdle, /* waYdle */
- waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
- (coYkt RfYt8*) nRVVep, /* nRVVep */
- beYgtz /* nEtek to Apfte */
- );
- petRpY ( Zy );
- }
- EOF
- }
- # Create expected results of merge for diffmerge1
- diffmerge_create_expected_files() {
- cat >testcase01 <<\EOF
- // Button.java
- package random.application;
- import random.util.*;
- public class Button
- {
- /* Instantiates a Button with origin (0, 0) and zero width and height.
- * You must call an initializer method to properly initialize the Button.
- */
- public Button ()
- {
- super ();
- // _titleColor = Color.black;
- // _disabledTitleColor = Color.gray;
- // _titleFont = Font.defaultFont ();
- }
- }
- EOF
- cat >testcase02 <<\EOF
- y
- a
- a
- a
- m
- EOF
- cat >testcase03 <<\EOF
- x
- s
- c
- s
- b
- s
- b
- s
- y
- EOF
- cat >testcase04 <<\EOF
- v
- s
- m
- s
- v
- s
- m
- s
- v
- EOF
- # Since there are no changes in the "mine" section, just take exactly
- # the version in the "yours" section:
- cp ../yours/testcase05 .
- cp ../yours/testcase06 .
- # Since the two branches make the same changes, the result should be
- # the same as both branches. Here, I happen to pick yours to copy from,
- # but I could have also picked mine, since the source of the copy is
- # the same in either case. However, the mine has already been
- # altered by the update command, so don't use it. Instead, use the
- # yours section which has not had an update on it and so is unchanged:
- cp ../yours/testcase07 .
- cat >testcase08 <<\EOF
- no
- changes
- here
- First change has now added this in.
- no
- changes
- here
- Second change has now changed it here.
- no
- changes
- here
- Both changes move this line to the end of the file.
- EOF
- cat >testcase09 <<\EOF
- m
- a
- {
- }
- b
- {
- }
- c
- {
- }
- EOF
- cat >testcase10 <<\EOF
- fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
- petRpY ( MtatRk );
- fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
- fV ( jfle_Uecopd_KRLIep < 16 )
- {
- MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
- }
- elke
- {
- MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
- fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
- MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
- OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
- Bloke_GttpfIRte_MtpeaL ( &acI );
- MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
- {
- MTGTXM MtatRk = Zy;
- fV ( Y < 16 )
- {
- petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
- Y * jfle_Uecopd_MfJe_fY_Mectopk,
- jfle_Uecopd_MfJe_fY_Mectopk,
- nRVVep ) );
- }
- elke
- {
- petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
- ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
- jfle_Uecopd_MfJe_fY_Mectopk,
- nRVVep ) );
- }
- petRpY ( MtatRk );
- }
- /****************************************************************************
- * *
- * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
- * *
- ****************************************************************************/
- MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
- {
- MTGTXM MtatRk = Zy;
- MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
- petRpY ( MtatRk );
- }
- HfkQipfte ( waYdle, /* waYdle */
- waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
- (coYkt RfYt8*) nRVVep, /* nRVVep */
- beYgtz /* nEtek to Apfte */
- );
- petRpY ( Zy );
- }
- EOF
- }
- # Echo a new CVSROOT based on $1, $remote, and $remotehost
- newroot() {
- if $remote; then
- if test -n "$remotehost"; then
- echo :ext:$remotehost$1
- else
- echo :fork:$1
- fi
- else
- echo $1
- fi
- }
- # Set up CVSROOT (the crerepos tests will test operating without CVSROOT set).
- #
- # Currently we test :fork: and :ext: (see crerepos test). There is a
- # known difference between the two in modes-15 (see comments there).
- #
- # :ext: can be tested against a remote machine if:
- #
- # 1. $remotehost is set using the `-h' option to this script.
- # 2. ${CVS_RSH=rsh} $remotehost works.
- # 3. The path to $TESTDIR is the same on both machines (symlinks are okay)
- # 4. The path to $testcvs is the same on both machines (symlinks are okay)
- # or $CVS_SERVER is overridden in this script's environment to point to
- # a working CVS exectuable on the remote machine.
- #
- # Testing :pserver: would be hard (inetd issues). (How about using tcpserver
- # and some high port number? DRP)
- # Allow CVS_SERVER to be overridden. This facilitates constructs like
- # testing a local case-insensitive client against a remote case
- # sensitive server and visa versa.
- : ${CVS_SERVER=$testcvs}; export CVS_SERVER
- # Use a name which will be different than CVSROOT on case insensitive
- # filesystems (e.g., HFS+)
- CVSROOTDIR=cvsrootdir
- if $linkroot; then
- mkdir ${TESTDIR}/realcvsroot
- ln -s realcvsroot ${TESTDIR}/${CVSROOTDIR}
- fi
- CVSROOT_DIRNAME=${TESTDIR}/${CVSROOTDIR}
- CVSROOT=`newroot $CVSROOT_DIRNAME`; export CVSROOT
- ###
- ### Init the repository.
- ###
- dotest init-1 "$testcvs -d$CVSROOT_DIRNAME init"
- # Copy the admin files for restore_adm.
- cp -Rp $CVSROOT_DIRNAME/CVSROOT $TESTDIR/CVSROOT.save
- ###
- ### The tests
- ###
- if $remote; then
- localonly init-2
- localonly init-3
- else
- dotest init-2 "$testcvs init"
- dotest_fail init-3 "$testcvs -d $CVSROOT/sdir init" \
- "$PROG \[init aborted\]: Cannot initialize repository under existing CVSROOT: \`$CVSROOT_DIRNAME'"
- fi
- ### The big loop
- for what in $tests; do
- if test -n "$fromtest" ; then
- if test $fromtest = $what ; then
- unset fromtest
- else
- continue
- fi
- fi
- if $verbose; then
- echo "$what:"
- fi
- case $what in
- version)
- # We've had cases where the version command started dumping core,
- # so we might as well test it
- dotest version-1 "${testcvs} --version" \
- '
- Concurrent Versions System (CVS) [0-9.]*.*
- Copyright (C) [0-9]* Free Software Foundation, Inc.
- Senior active maintainers include Larry Jones, Derek R. Price,
- and Mark D. Baushke. Please see the AUTHORS and README files from the CVS
- distribution kit for a complete list of contributors and copyrights.
- CVS may be copied only under the terms of the GNU General Public License,
- a copy of which can be found with the CVS distribution kit.
- Specify the --help option for further information about CVS'
- if $remote; then
- dotest version-2r "${testcvs} version" \
- 'Client: Concurrent Versions System (CVS) [0-9p.]* (client/server)
- Server: Concurrent Versions System (CVS) [0-9p.]* (client/server)'
- else
- dotest version-2 "${testcvs} version" \
- 'Concurrent Versions System (CVS) [0-9.]*.*'
- fi
- ;;
- basica)
- # Similar in spirit to some of the basic1, and basic2
- # tests, but hopefully a lot faster. Also tests operating on
- # files two directories down *without* operating on the parent dirs.
- # Tests basica-0a and basica-0b provide the equivalent of the:
- # mkdir ${CVSROOT_DIRNAME}/first-dir
- # used by many of the tests. It is "more official" in the sense
- # that is does everything through CVS; the reason most of the
- # tests don't use it is mostly historical.
- mkdir 1; cd 1
- dotest basica-0a "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest basica-0b "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd ..
- rm -r 1
- dotest basica-1 "${testcvs} -q co first-dir" ''
- cd first-dir
- # Test a few operations, to ensure they gracefully do
- # nothing in an empty directory.
- dotest basica-1a0 "${testcvs} -q update" ''
- dotest basica-1a1 "${testcvs} -q diff -c" ''
- dotest basica-1a2 "${testcvs} -q status" ''
- dotest basica-1a3 "${testcvs} -q update ." ''
- dotest basica-1a4 "${testcvs} -q update ./" ''
- mkdir sdir
- # Remote CVS gives the "cannot open CVS/Entries" error, which is
- # clearly a bug, but not a simple one to fix.
- dotest basica-1a10 "${testcvs} -n add sdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository" \
- "${PROG} add: cannot open CVS/Entries for reading: No such file or directory
- Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
- dotest_fail basica-1a11 \
- "test -d ${CVSROOT_DIRNAME}/first-dir/sdir" ''
- dotest basica-2 "${testcvs} add sdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
- cd sdir
- mkdir ssdir
- dotest basica-3 "${testcvs} add ssdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir added to the repository"
- cd ssdir
- echo ssfile >ssfile
- # Trying to commit it without a "cvs add" should be an error.
- # The "use `cvs add' to create an entry" message is the one
- # that I consider to be more correct, but local cvs prints the
- # "nothing known" message and noone has gotten around to fixing it.
- dotest_fail basica-notadded "${testcvs} -q ci ssfile" \
- "${PROG} [a-z]*: use .${PROG} add. to create an entry for ssfile
- ${PROG}"' \[[a-z]* aborted\]: correct above errors first!' \
- "${PROG}"' [a-z]*: nothing known about `ssfile'\''
- '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
- dotest basica-4 "${testcvs} add ssfile" \
- "${PROG}"' add: scheduling file `ssfile'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest_fail basica-4a "${testcvs} tag tag0 ssfile" \
- "${PROG} tag: nothing known about ssfile
- ${PROG} "'\[tag aborted\]: correct the above errors first!'
- cd ../..
- dotest basica-5 "${testcvs} -q ci -m add-it" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- done
- Checking in sdir/ssdir/ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- initial revision: 1\.1
- done"
- dotest_fail basica-5a \
- "${testcvs} -q tag BASE sdir/ssdir/ssfile" \
- "${PROG} tag: Attempt to add reserved tag name BASE
- ${PROG} \[tag aborted\]: failed to set tag BASE to revision 1\.1 in ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v"
- dotest basica-5b "${testcvs} -q tag NOT_RESERVED" \
- 'T sdir/ssdir/ssfile'
- dotest basica-6 "${testcvs} -q update" ''
- echo "ssfile line 2" >>sdir/ssdir/ssfile
- dotest_fail basica-6.2 "${testcvs} -q diff -c" \
- "Index: sdir/ssdir/ssfile
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- retrieving revision 1\.1
- diff -c -r1\.1 ssfile
- \*\*\* sdir/ssdir/ssfile ${RFCDATE} 1\.1
- --- sdir/ssdir/ssfile ${RFCDATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- --- 1,2 ----
- ssfile
- ${PLUS} ssfile line 2"
- dotest_fail basica-6.3 "${testcvs} -q diff -c -rBASE" \
- "Index: sdir/ssdir/ssfile
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- retrieving revision 1\.1
- diff -c -r1\.1 ssfile
- \*\*\* sdir/ssdir/ssfile ${RFCDATE} 1\.1
- --- sdir/ssdir/ssfile ${RFCDATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- --- 1,2 ----
- ssfile
- ${PLUS} ssfile line 2"
- dotest_fail basica-6.4 "${testcvs} -q diff -c -rBASE -C3isacrowd" \
- "Index: sdir/ssdir/ssfile
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- retrieving revision 1\.1
- diff -c -C 3isacrowd -r1\.1 ssfile
- ${PROG} diff: invalid context length argument"
- dotest basica-7 "${testcvs} -q ci -m modify-it" \
- "Checking in sdir/ssdir/ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 1\.2; previous revision: 1\.1
- done"
- dotest_fail basica-nonexist "${testcvs} -q ci nonexist" \
- "${PROG}"' [a-z]*: nothing known about `nonexist'\''
- '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
- dotest basica-8 "${testcvs} -q update ." ''
- # Test the -f option to ci
- cd sdir/ssdir
- dotest basica-8a0 "${testcvs} -q ci -m not-modified ssfile" ''
- dotest basica-8a "${testcvs} -q ci -f -m force-it" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 1\.3; previous revision: 1\.2
- done"
- dotest basica-8a1 "${testcvs} -q ci -m bump-it -r 2.0" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 2\.0; previous revision: 1\.3
- done"
- dotest basica-8a1a "${testcvs} -q ci -m bump-it -r 2.9" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 2\.9; previous revision: 2\.0
- done"
- # Test string-based revion number increment rollover
- dotest basica-8a1b "${testcvs} -q ci -m bump-it -f -r 2" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 2\.10; previous revision: 2\.9
- done"
- dotest basica-8a1c "${testcvs} -q ci -m bump-it -r 2.99" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 2\.99; previous revision: 2\.10
- done"
- # Test string-based revion number increment rollover
- dotest basica-8a1d "${testcvs} -q ci -m bump-it -f -r 2" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 2\.100; previous revision: 2\.99
- done"
- dotest basica-8a1e "${testcvs} -q ci -m bump-it -r 2.1099" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 2\.1099; previous revision: 2\.100
- done"
- # Test string-based revion number increment rollover
- dotest basica-8a1f "${testcvs} -q ci -m bump-it -f -r 2" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 2\.1100; previous revision: 2\.1099
- done"
- # -f should not be necessary, but it should be harmless.
- # Also test the "-r 3" (rather than "-r 3.0") usage.
- dotest basica-8a2 "${testcvs} -q ci -m bump-it -f -r 3" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 3\.1; previous revision: 2\.1100
- done"
- # Test using -r to create a branch
- dotest_fail basica-8a3 "${testcvs} -q ci -m bogus -r 3.0.0" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- ${PROG} commit: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: can't find branch point 3\.0
- ${PROG} commit: could not check in ssfile"
- dotest basica-8a4 "${testcvs} -q ci -m valid -r 3.1.2" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 3\.1\.2\.1; previous revision: 3\.1
- done"
- # Verify that this file remains unchanged since up -A should not
- # change the contents here.
- cp ssfile $TESTDIR/ssfile.sav
- # now get rid of the sticky tag and go back to the trunk
- dotest basica-8a5 "$testcvs -q up -A ./" '[UP] ssfile'
- dotest basica-8a6 "cmp ssfile $TESTDIR/ssfile.sav"
- rm $TESTDIR/ssfile.sav
- cd ../..
- dotest basica-8b "${testcvs} -q diff -r1.2 -r1.3"
- dotest basica-8b1 "${testcvs} -q diff -r1.2 -r1.3 -C 3isacrowd"
- # The .* here will normally be "No such file or directory",
- # but if memory serves some systems (AIX?) have a different message.
- : dotest_fail basica-9 \
- "${testcvs} -q -d ${TESTDIR}/nonexist update" \
- "${PROG}: cannot access cvs root ${TESTDIR}/nonexist: .*"
- dotest_fail basica-9 \
- "${testcvs} -q -d ${TESTDIR}/nonexist update" \
- "${PROG} \[[a-z]* aborted\]: ${TESTDIR}/nonexist/CVSROOT: .*"
- dotest basica-10 "${testcvs} annotate" \
- '
- Annotations for sdir/ssdir/ssfile
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- 1\.1 .'"$username8"' *[0-9a-zA-Z-]*.: ssfile
- 1\.2 .'"$username8"' *[0-9a-zA-Z-]*.: ssfile line 2'
- # Test resurrecting with strange revision numbers
- cd sdir/ssdir
- dotest basica-r1 "${testcvs} rm -f ssfile" \
- "${PROG} remove: scheduling .ssfile. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest basica-r2 "${testcvs} -q ci -m remove" \
- "Removing ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: delete; previous revision: 3\.1
- done"
- dotest basica-r3 "${testcvs} -q up -p -r 3.1 ./ssfile >ssfile" ""
- dotest basica-r4 "${testcvs} add ssfile" \
- "${PROG} add: Re-adding file .ssfile. (in place of dead revision 3\.2)\.
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest basica-r5 "${testcvs} -q ci -m resurrect" \
- "Checking in ssfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
- new revision: 3\.3; previous revision: 3\.2
- done"
- cd ../..
- # As long as we have a file with a few revisions, test
- # a few "cvs admin -o" invocations.
- cd sdir/ssdir
- dotest_fail basica-o1 "${testcvs} admin -o 1.2::1.2" \
- "${PROG} [a-z]*: while processing more than one file:
- ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
- dotest basica-o2 "${testcvs} admin -o 1.2::1.2 ssfile" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- done"
- dotest basica-o2a "${testcvs} admin -o 1.1::NOT_RESERVED ssfile" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- done"
- dotest_fail basica-o2b "${testcvs} admin -o 1.1::NOT_EXIST ssfile" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: Revision NOT_EXIST doesn't exist.
- ${PROG} admin: RCS file for .ssfile. not modified\."
- dotest basica-o3 "${testcvs} admin -o 1.2::1.3 ssfile" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- done"
- dotest basica-o4 "${testcvs} admin -o 3.1:: ssfile" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- deleting revision 3\.3
- deleting revision 3\.2
- done"
- dotest basica-o5 "${testcvs} admin -o ::1.1 ssfile" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- done"
- dotest basica-o5a "${testcvs} -n admin -o 1.2::3.1 ssfile" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- deleting revision 2\.1100
- deleting revision 2\.1099
- deleting revision 2\.100
- deleting revision 2\.99
- deleting revision 2\.10
- deleting revision 2\.9
- deleting revision 2\.0
- deleting revision 1\.3
- done"
- dotest basica-o6 "${testcvs} admin -o 1.2::3.1 ssfile" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- deleting revision 2\.1100
- deleting revision 2\.1099
- deleting revision 2\.100
- deleting revision 2\.99
- deleting revision 2\.10
- deleting revision 2\.9
- deleting revision 2\.0
- deleting revision 1\.3
- done"
- dotest basica-o6a "${testcvs} admin -o 3.1.2: ssfile" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- deleting revision 3\.1\.2\.1
- done"
- dotest basica-o7 "${testcvs} log -N ssfile" "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
- Working file: ssfile
- head: 3\.1
- branch:
- locks: strict
- access list:
- keyword substitution: kv
- total revisions: 3; selected revisions: 3
- description:
- ----------------------------
- revision 3\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
- bump-it
- ----------------------------
- revision 1\.2
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
- modify-it
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- add-it
- ============================================================================="
- dotest basica-o8 "${testcvs} -q update -p -r 1.1 ./ssfile" "ssfile"
- cd ../..
- cd ..
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -r first-dir
- ;;
- basicb)
- # More basic tests, including non-branch tags and co -d.
- mkdir 1; cd 1
- dotest basicb-0a "${testcvs} -q co -l ." ''
- touch topfile
- dotest basicb-0b "${testcvs} add topfile" \
- "${PROG} add: scheduling file .topfile. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest basicb-0c "${testcvs} -q ci -m add-it topfile" \
- "RCS file: ${CVSROOT_DIRNAME}/topfile,v
- done
- Checking in topfile;
- ${CVSROOT_DIRNAME}/topfile,v <-- topfile
- initial revision: 1\.1
- done"
- cd ..
- rm -r 1
- mkdir 2; cd 2
- dotest basicb-0d "${testcvs} -q co -l ." "U topfile"
- # Now test the ability to run checkout on an existing working
- # directory without having it lose its mind. I don't know
- # whether this is tested elsewhere in sanity.sh. A more elaborate
- # test might also have modified files, make sure it works if
- # the modules file was modified to add new directories to the
- # module, and such.
- dotest basicb-0d0 "${testcvs} -q co -l ." ""
- mkdir first-dir
- dotest basicb-0e "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd ..
- rm -r 2
- dotest basicb-1 "${testcvs} -q co first-dir" ''
- # The top-level CVS directory is not created by default.
- # I'm leaving basicb-1a and basicb-1b untouched, mostly, in
- # case we decide that the default should be reversed...
- dotest_fail basicb-1a "test -d CVS" ''
- dotest basicb-1c "cat first-dir/CVS/Repository" "first-dir"
- cd first-dir
- # Note that the name Emptydir is chosen to test that CVS just
- # treats it like any other directory name. It should be
- # special only when it is directly in $CVSROOT/CVSROOT.
- mkdir Emptydir sdir2
- dotest basicb-2 "${testcvs} add Emptydir sdir2" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/Emptydir added to the repository
- Directory ${CVSROOT_DIRNAME}/first-dir/sdir2 added to the repository"
- cd Emptydir
- echo sfile1 starts >sfile1
- dotest basicb-2a10 "${testcvs} -n add sfile1" \
- "${PROG} add: scheduling file .sfile1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest basicb-2a11 "${testcvs} status sfile1" \
- "${PROG} status: use .${PROG} add. to create an entry for sfile1
- ===================================================================
- File: sfile1 Status: Unknown
- Working revision: No entry for sfile1
- Repository revision: No revision control file"
- dotest basicb-3 "${testcvs} add sfile1" \
- "${PROG} add: scheduling file .sfile1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest basicb-3a1 "${testcvs} status sfile1" \
- "===================================================================
- File: sfile1 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- cd ../sdir2
- echo sfile2 starts >sfile2
- dotest basicb-4 "${testcvs} add sfile2" \
- "${PROG} add: scheduling file .sfile2. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest basicb-4a "${testcvs} -q ci CVS" \
- "${PROG} [a-z]*: warning: directory CVS specified in argument
- ${PROG} [a-z]*: but CVS uses CVS for its own purposes; skipping CVS directory"
- cd ..
- dotest basicb-5 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v
- done
- Checking in Emptydir/sfile1;
- ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v <-- sfile1
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
- done
- Checking in sdir2/sfile2;
- ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v <-- sfile2
- initial revision: 1\.1
- done"
- echo sfile1 develops >Emptydir/sfile1
- dotest basicb-6 "${testcvs} -q ci -m modify" \
- "Checking in Emptydir/sfile1;
- ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v <-- sfile1
- new revision: 1\.2; previous revision: 1\.1
- done"
- dotest basicb-7 "${testcvs} -q tag release-1" 'T Emptydir/sfile1
- T sdir2/sfile2'
- echo not in time for release-1 >sdir2/sfile2
- dotest basicb-8 "${testcvs} -q ci -m modify-2" \
- "Checking in sdir2/sfile2;
- ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v <-- sfile2
- new revision: 1\.2; previous revision: 1\.1
- done"
- # See if CVS can correctly notice when an invalid numeric
- # revision is specified.
- # Commented out until we get around to fixing CVS
- : dotest basicb-8a0 "${testcvs} diff -r 1.5 -r 1.7 sfile2" 'error msg'
- cd ..
- # Test that we recurse into the correct directory when checking
- # for existing files, even if co -d is in use.
- touch first-dir/extra
- dotest basicb-cod-1 "${testcvs} -q co -d first-dir1 first-dir" \
- 'U first-dir1/Emptydir/sfile1
- U first-dir1/sdir2/sfile2'
- rm -r first-dir1
- rm -r first-dir
- # FIXME? basicb-9 used to check things out like this:
- # U newdir/Emptydir/sfile1
- # U newdir/sdir2/sfile2
- # but that's difficult to do. The whole "shorten" thing
- # is pretty bogus, because it will break on things
- # like "cvs co foo/bar baz/quux". Unless there's some
- # pretty detailed expansion and analysis of the command-line
- # arguments, we shouldn't do "shorten" stuff at all.
- dotest basicb-9 \
- "${testcvs} -q co -d newdir -r release-1 first-dir/Emptydir first-dir/sdir2" \
- 'U newdir/first-dir/Emptydir/sfile1
- U newdir/first-dir/sdir2/sfile2'
- # basicb-9a and basicb-9b: see note about basicb-1a
- dotest_fail basicb-9a "test -d CVS" ''
- dotest basicb-9c "cat newdir/CVS/Repository" "\."
- dotest basicb-9d "cat newdir/first-dir/CVS/Repository" \
- "${CVSROOT_DIRNAME}/first-dir" \
- "first-dir"
- dotest basicb-9e "cat newdir/first-dir/Emptydir/CVS/Repository" \
- "${CVSROOT_DIRNAME}/first-dir/Emptydir" \
- "first-dir/Emptydir"
- dotest basicb-9f "cat newdir/first-dir/sdir2/CVS/Repository" \
- "${CVSROOT_DIRNAME}/first-dir/sdir2" \
- "first-dir/sdir2"
- dotest basicb-10 "cat newdir/first-dir/Emptydir/sfile1 newdir/first-dir/sdir2/sfile2" \
- "sfile1 develops
- sfile2 starts"
- rm -r newdir
- # Hmm, this might be a case for CVSNULLREPOS, but CVS doesn't
- # seem to deal with it...
- if false; then
- dotest basicb-11 "${testcvs} -q co -d sub1/sub2 first-dir" \
- "U sub1/sub2/Emptydir/sfile1
- U sub1/sub2/sdir2/sfile2"
- cd sub1
- dotest basicb-12 "${testcvs} -q update ./." ''
- touch xx
- dotest basicb-13 "${testcvs} add xx" fixme
- cd ..
- rm -r sub1
- # to test: sub1/sub2/sub3
- fi # end of tests commented out.
- # Create a second directory.
- mkdir 1
- cd 1
- dotest basicb-14 "${testcvs} -q co -l ." 'U topfile'
- mkdir second-dir
- dotest basicb-15 "${testcvs} add second-dir" \
- "Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
- cd second-dir
- touch aa
- dotest basicb-16 "${testcvs} add aa" \
- "${PROG} add: scheduling file .aa. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest basicb-17 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/second-dir/aa,v
- done
- Checking in aa;
- ${CVSROOT_DIRNAME}/second-dir/aa,v <-- aa
- initial revision: 1\.1
- done"
- cd ..
- # Try to remove all revisions in a file.
- dotest_fail basicb-o1 "${testcvs} admin -o1.1 topfile" \
- "RCS file: ${CVSROOT_DIRNAME}/topfile,v
- deleting revision 1\.1
- ${PROG} \[admin aborted\]: attempt to delete all revisions"
- dotest basicb-o2 "${testcvs} -q update -d first-dir" \
- "U first-dir/Emptydir/sfile1
- U first-dir/sdir2/sfile2"
- dotest_fail basicb-o3 \
- "${testcvs} admin -o1.1:1.2 first-dir/sdir2/sfile2" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
- deleting revision 1\.2
- deleting revision 1\.1
- ${PROG} \[admin aborted\]: attempt to delete all revisions"
- cd ..
- rm -r 1
- mkdir 1; cd 1
- # Note that -H is an illegal option.
- # I suspect that the choice between "illegal" and "invalid"
- # depends on the user's environment variables, the phase
- # of the moon (weirdness with optind), and who knows what else.
- # I've been seeing "illegal"...
- dotest_fail basicb-21 "${testcvs} -q admin -H" \
- "admin: illegal option -- H
- ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information" \
- "admin: invalid option -- H
- ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information"
- cd ..
- rmdir 1
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -rf ${CVSROOT_DIRNAME}/second-dir
- rm -f ${CVSROOT_DIRNAME}/topfile,v
- ;;
- basicc)
- # More tests of basic/miscellaneous functionality.
- mkdir 1; cd 1
- dotest_fail basicc-1 "${testcvs} diff" \
- "${PROG} [a-z]*: in directory \.:
- ${PROG} \[[a-z]* aborted\]: there is no version here; run .${PROG} checkout. first"
- dotest basicc-2 "${testcvs} -q co -l ." ''
- mkdir first-dir second-dir
- dotest basicc-3 "${testcvs} add first-dir second-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
- Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
- # Old versions of CVS often didn't create this top-level CVS
- # directory in the first place. I think that maybe the only
- # way to get it to work currently is to let CVS create it,
- # and then blow it away (don't complain if it does not
- # exist). But that is perfectly legal; people who are used
- # to the old behavior especially may be interested.
- # FIXME: this test is intended for the TopLevelAdmin=yes case;
- # should adjust/move it accordingly.
- rm -rf CVS
- dotest basicc-4 "echo *" "first-dir second-dir"
- dotest basicc-5 "${testcvs} update" \
- "${PROG} update: Updating first-dir
- ${PROG} update: Updating second-dir" \
- "${PROG} update: Updating \.
- ${PROG} update: Updating first-dir
- ${PROG} update: Updating second-dir"
- cd first-dir
- dotest basicc-6 "${testcvs} release -d" ""
- dotest basicc-7 "test -d ../first-dir" ""
- # The Linux 2.2 kernel lets you delete ".". That's OK either way,
- # the point is that CVS must not mess with anything *outside* "."
- # the way that CVS 1.10 and older tried to.
- dotest basicc-8 "${testcvs} -Q release -d ." \
- "" "${PROG} release: deletion of directory \. failed: .*"
- dotest basicc-9 "test -d ../second-dir" ""
- # For CVS to make a syntactic check for "." wouldn't suffice.
- # On Linux 2.2 systems, the cwd may be gone, so we recreate it
- # to allow basicc-11 to actually happen
- if test ! -d ../first-dir; then
- # Apparently `cd ..' doesn't work with Linux 2.2 & Bash 2.05b.
- cd $TESTDIR/1
- mkdir ./first-dir
- cd ./first-dir
- fi
- dotest basicc-11 "${testcvs} -Q release -d ./." \
- "" "${PROG} release: deletion of directory \./\. failed: .*"
- dotest basicc-11a "test -d ../second-dir" ""
- cd ../..
- mkdir 2; cd 2
- dotest basicc-12 "${testcvs} -Q co ." ""
- # actual entries can be in either Entries or Entries.log, do
- # an update to get them consolidated into Entries
- dotest basicc-12a "${testcvs} -Q up" ""
- dotest basicc-12b "cat CVS/Entries" \
- "D/CVSROOT////
- D/first-dir////
- D/second-dir////"
- dotest basicc-13 "echo *" "CVS CVSROOT first-dir second-dir"
- dotest basicc-14 "${testcvs} -Q release first-dir second-dir" ""
- # a normal release shouldn't affect the Entries file
- dotest basicc-14b "cat CVS/Entries" \
- "D/CVSROOT////
- D/first-dir////
- D/second-dir////"
- # FIXCVS: but release -d probably should
- dotest basicc-15 "${testcvs} -Q release -d first-dir second-dir" ""
- dotest basicc-16 "echo *" "CVS CVSROOT"
- dotest basicc-17 "cat CVS/Entries" \
- "D/CVSROOT////
- D/first-dir////
- D/second-dir////"
- # FIXCVS: if not, update should notice the missing directories
- # and update Entries accordingly
- dotest basicc-18 "${testcvs} -Q up" ""
- dotest basicc-19 "cat CVS/Entries" \
- "D/CVSROOT////
- D/first-dir////
- D/second-dir////"
- cd ..
- rm -r 1 2
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- basic1)
- # first dive - add a files, first singly, then in a group.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir basic1; cd basic1
- # check out an empty directory
- dotest basic1-1 "${testcvs} -q co first-dir" ''
- cd first-dir
- echo file2 >file2
- echo file3 >file3
- echo file4 >file4
- echo file5 >file5
- dotest basic1-14-add-add "${testcvs} add file2 file3 file4 file5" \
- "${PROG} add: scheduling file \`file2' for addition
- ${PROG} add: scheduling file \`file3' for addition
- ${PROG} add: scheduling file \`file4' for addition
- ${PROG} add: scheduling file \`file5' for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest basic1-15-add-add \
- "${testcvs} -q update file2 file3 file4 file5" \
- "A file2
- A file3
- A file4
- A file5"
- dotest basic1-16-add-add "${testcvs} -q update" \
- "A file2
- A file3
- A file4
- A file5"
- dotest basic1-17-add-add "${testcvs} -q status" \
- "===================================================================
- File: file2 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file3 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file4 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file5 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest basic1-18-add-add "${testcvs} -q log" \
- "${PROG} log: file2 has been added, but not committed
- ${PROG} log: file3 has been added, but not committed
- ${PROG} log: file4 has been added, but not committed
- ${PROG} log: file5 has been added, but not committed"
- cd ..
- dotest basic1-21-add-add "${testcvs} -q update" \
- "A first-dir/file2
- A first-dir/file3
- A first-dir/file4
- A first-dir/file5"
- # FIXCVS? Shouldn't this read first-dir/file2 instead of file2?
- dotest basic1-22-add-add "${testcvs} log first-dir" \
- "${PROG} log: Logging first-dir
- ${PROG} log: file2 has been added, but not committed
- ${PROG} log: file3 has been added, but not committed
- ${PROG} log: file4 has been added, but not committed
- ${PROG} log: file5 has been added, but not committed"
- dotest basic1-23-add-add "${testcvs} status first-dir" \
- "${PROG} status: Examining first-dir
- ===================================================================
- File: file2 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file3 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file4 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file5 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest basic1-24-add-add "${testcvs} update first-dir" \
- "${PROG} update: Updating first-dir
- A first-dir/file2
- A first-dir/file3
- A first-dir/file4
- A first-dir/file5"
- dotest basic1-27-add-add "${testcvs} co first-dir" \
- "${PROG} checkout: Updating first-dir
- A first-dir/file2
- A first-dir/file3
- A first-dir/file4
- A first-dir/file5"
- cd first-dir
- dotest basic1-14-add-ci \
- "${testcvs} commit -m test file2 file3 file4 file5" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
- done
- Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
- done
- Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
- initial revision: 1\.1
- done"
- dotest basic1-15-add-ci \
- "${testcvs} -q update file2 file3 file4 file5" ''
- dotest basic1-16-add-ci "${testcvs} -q update" ''
- dotest basic1-17-add-ci "${testcvs} -q status" \
- "===================================================================
- File: file2 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file3 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file3,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file4 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file4,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file5 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file5,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- # The "log" tests and friends probably already test the output
- # from log quite adequately.
- # Note: using dotest fails here. It seems to be related
- # to the output being sufficiently large (Red Hat 4.1).
- # dotest basic1-18-add-ci "${testcvs} log" "${DOTSTAR}"
- if ${testcvs} -q log >>${LOGFILE}; then
- pass basic1-18-add-ci
- else
- pass basic1-18-add-ci
- fi
- cd ..
- dotest basic1-21-add-ci "${testcvs} -q update" ''
- # See test basic1-18-add-ci for explanation of non-use of dotest.
- if ${testcvs} -q log first-dir >>${LOGFILE}; then
- pass basic1-22-add-ci
- else
- pass basic1-22-add-ci
- fi
- # At least for the moment I am going to consider 17-add-ci
- # an adequate test of the output here.
- # See test basic1-18-add-ci for explanation of non-use of dotest.
- if ${testcvs} -q status first-dir >>${LOGFILE}; then
- pass basic1-23-add-ci
- else
- pass basic1-23-add-ci
- fi
- dotest basic1-24-add-ci "${testcvs} -q update first-dir" ''
- dotest basic1-27-add-ci "${testcvs} -q co first-dir" ''
- cd first-dir
- rm file2 file3 file4 file5
- dotest basic1-14-rm-rm "${testcvs} rm file2 file3 file4 file5" \
- "${PROG} remove: scheduling .file2. for removal
- ${PROG} remove: scheduling .file3. for removal
- ${PROG} remove: scheduling .file4. for removal
- ${PROG} remove: scheduling .file5. for removal
- ${PROG} remove: use .${PROG} commit. to remove these files permanently"
- # 15-rm-rm was commented out. Why?
- dotest basic1-15-rm-rm \
- "${testcvs} -q update file2 file3 file4 file5" \
- "R file2
- R file3
- R file4
- R file5"
- dotest basic1-16-rm-rm "${testcvs} -q update" \
- "R file2
- R file3
- R file4
- R file5"
- dotest basic1-17-rm-rm "${testcvs} -q status" \
- "===================================================================
- File: no file file2 Status: Locally Removed
- Working revision: -1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: no file file3 Status: Locally Removed
- Working revision: -1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file3,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: no file file4 Status: Locally Removed
- Working revision: -1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file4,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: no file file5 Status: Locally Removed
- Working revision: -1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file5,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- # Would be nice to test that real logs appear (with dead state
- # and all), either here or someplace like log2 tests.
- if ${testcvs} -q log >>${LOGFILE}; then
- pass basic1-18-rm-rm
- else
- fail basic1-18-rm-rm
- fi
- cd ..
- dotest basic1-21-rm-rm "${testcvs} -q update" \
- "R first-dir/file2
- R first-dir/file3
- R first-dir/file4
- R first-dir/file5"
- if ${testcvs} -q log first-dir >>${LOGFILE}; then
- pass basic1-22-rm-rm
- else
- fail basic1-22-rm-rm
- fi
- if ${testcvs} -q status first-dir >>${LOGFILE}; then
- pass basic1-23-rm-rm
- else
- fail basic1-23-rm-rm
- fi
- dotest basic1-24-rm-rm "${testcvs} -q update first-dir" \
- "R first-dir/file2
- R first-dir/file3
- R first-dir/file4
- R first-dir/file5"
- dotest basic1-27-rm-rm "${testcvs} -q co first-dir" \
- "R first-dir/file2
- R first-dir/file3
- R first-dir/file4
- R first-dir/file5"
- cd first-dir
- dotest basic1-14-rm-ci "${testcvs} -q commit -m test" \
- "Removing file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: delete; previous revision: 1\.1
- done
- Removing file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- new revision: delete; previous revision: 1\.1
- done
- Removing file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: delete; previous revision: 1\.1
- done
- Removing file5;
- ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
- new revision: delete; previous revision: 1\.1
- done"
- dotest basic1-15-rm-ci \
- "${testcvs} -q update file2 file3 file4 file5" ''
- dotest basic1-16-rm-ci "${testcvs} -q update" ''
- dotest basic1-17-rm-ci "${testcvs} -q status" ''
- # Would be nice to test that real logs appear (with dead state
- # and all), either here or someplace like log2 tests.
- if ${testcvs} -q log >>${LOGFILE}; then
- pass basic1-18-rm-ci
- else
- fail basic1-18-rm-ci
- fi
- cd ..
- dotest basic1-21-rm-ci "${testcvs} -q update" ''
- if ${testcvs} -q log first-dir >>${LOGFILE}; then
- pass basic1-22-rm-ci
- else
- fail basic1-22-rm-ci
- fi
- if ${testcvs} -q status first-dir >>${LOGFILE}; then
- pass basic1-23-rm-ci
- else
- fail basic1-23-rm-ci
- fi
- dotest basic1-24-rm-ci "${testcvs} -q update first-dir" ''
- dotest basic1-27-rm-ci "${testcvs} -q co first-dir" ''
- cd first-dir
- # All the files are removed, so nothing gets tagged.
- dotest basic1-28 "${testcvs} -q tag first-dive" ''
- cd ..
- cd ..
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- rm -r basic1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- deep)
- # Test the ability to operate on directories nested rather deeply.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- dotest deep-1 "${testcvs} -q co first-dir" ''
- cd first-dir
- for i in dir1 dir2 dir3 dir4 dir5 dir6 dir7 dir8; do
- mkdir $i
- dotest deep-2-$i "${testcvs} add $i" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/dir1[/dir0-9]* added to the repository"
- cd $i
- echo file1 >file1
- dotest deep-3-$i "${testcvs} add file1" \
- "${PROG}"' add: scheduling file `file1'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- done
- cd ../../../../../../../../..
- dotest_lit deep-4 "${testcvs} -q ci -m add-them first-dir" <<HERE
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file1,v
- done
- Checking in first-dir/dir1/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/file1,v <-- file1
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file1,v
- done
- Checking in first-dir/dir1/dir2/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file1,v <-- file1
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/file1,v
- done
- Checking in first-dir/dir1/dir2/dir3/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/file1,v <-- file1
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/file1,v
- done
- Checking in first-dir/dir1/dir2/dir3/dir4/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/file1,v <-- file1
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v
- done
- Checking in first-dir/dir1/dir2/dir3/dir4/dir5/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v
- done
- Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v
- done
- Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v
- done
- Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
- initial revision: 1.1
- done
- HERE
- cd first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
- rm file1
- dotest deep-4a0 "${testcvs} rm file1" \
- "${PROG} remove: scheduling .file1. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest deep-4a1 "${testcvs} -q ci -m rm-it" "Removing file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done"
- cd ../../..
- dotest deep-4a2 "${testcvs} -q update -P dir6/dir7" ''
- # Should be using "test -e" if that is portable enough.
- dotest_fail deep-4a3 "test -d dir6/dir7/dir8" ''
- # Test that if we remove the working directory, CVS does not
- # recreate it. (I realize that this behavior is what the
- # users expect, but in the longer run we might want to
- # re-think it. The corresponding behavior for a file is that
- # CVS *will* recreate it, and we might want to make it so
- # that "cvs release -d" is the way to delete the directory
- # and have it stay gone -kingdon, Oct1996).
- rm -r dir6
- dotest deep-4b0a "${testcvs} -q diff" ''
- dotest deep-4b0b "${testcvs} -q ci" ''
- dotest deep-4b1 "${testcvs} -q update" ''
- dotest deep-4b2 "${testcvs} -q update -d -P" \
- 'U dir6/file1
- U dir6/dir7/file1'
- # Test what happens if one uses -P when there are files removed
- # but not committed.
- cd dir6/dir7
- dotest deep-rm1 "${testcvs} rm -f file1" \
- "${PROG} remove: scheduling .file1. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- cd ..
- dotest deep-rm2 "${testcvs} -q update -d -P" 'R dir7/file1'
- dotest deep-rm3 "test -d dir7" ''
- dotest deep-rm4 "${testcvs} -q ci -m rm-it" "Removing dir7/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done"
- dotest deep-rm5 "${testcvs} -q update -d -P" ''
- dotest_fail deep-rm6 "test -d dir7" ''
- # Test rm -f -R.
- cd ../..
- dotest deep-rm7 "${testcvs} rm -f -R dir5" \
- "${PROG} remove: Removing dir5
- ${PROG} remove: scheduling .dir5/file1. for removal
- ${PROG} remove: Removing dir5/dir6
- ${PROG} remove: scheduling .dir5/dir6/file1. for removal
- ${PROG} remove: use .${PROG} commit. to remove these files permanently"
- dotest deep-rm8 "${testcvs} -q ci -m rm-it" \
- "Removing dir5/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done
- Removing dir5/dir6/file1;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done"
- dotest deep-rm9 "${testcvs} -q update -d -P" ''
- dotest_fail deep-rm10 "test -d dir5"
- cd ../../../../..
- if echo "yes" | ${testcvs} release -d first-dir >>${LOGFILE}; then
- pass deep-5
- else
- fail deep-5
- fi
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- basic2)
- # Test rtag, import, history, various miscellaneous operations
- # NOTE: this section has reached the size and
- # complexity where it is getting to be a good idea to
- # add new tests to a new section rather than
- # continuing to piggyback them onto the tests here.
- # First empty the history file
- rm ${CVSROOT_DIRNAME}/CVSROOT/history
- touch ${CVSROOT_DIRNAME}/CVSROOT/history
- ### XXX maybe should use 'cvs imprt -b1 -m new-module first-dir F F1' in an
- ### empty directory to do this instead of hacking directly into $CVSROOT
- mkdir ${CVSROOT_DIRNAME}/first-dir
- dotest basic2-1 "${testcvs} -q co first-dir" ''
- for i in first-dir dir1 dir2 ; do
- if test ! -d $i ; then
- mkdir $i
- dotest basic2-2-$i "${testcvs} add $i" \
- "Directory ${CVSROOT_DIRNAME}/.*/$i added to the repository"
- fi
- cd $i
- for j in file6 file7; do
- echo $j > $j
- done
- dotest basic2-3-$i "${testcvs} add file6 file7" \
- "${PROG} add: scheduling file .file6. for addition
- ${PROG} add: scheduling file .file7. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- done
- cd ../../..
- dotest basic2-4 "${testcvs} update first-dir" \
- "${PROG} update: Updating first-dir
- A first-dir/file6
- A first-dir/file7
- ${PROG} update: Updating first-dir/dir1
- A first-dir/dir1/file6
- A first-dir/dir1/file7
- ${PROG} update: Updating first-dir/dir1/dir2
- A first-dir/dir1/dir2/file6
- A first-dir/dir1/dir2/file7"
- # fixme: doesn't work right for added files.
- dotest basic2-5 "${testcvs} log first-dir" \
- "${PROG} log: Logging first-dir
- ${PROG} log: file6 has been added, but not committed
- ${PROG} log: file7 has been added, but not committed
- ${PROG} log: Logging first-dir/dir1
- ${PROG} log: file6 has been added, but not committed
- ${PROG} log: file7 has been added, but not committed
- ${PROG} log: Logging first-dir/dir1/dir2
- ${PROG} log: file6 has been added, but not committed
- ${PROG} log: file7 has been added, but not committed"
- dotest basic2-6 "${testcvs} status first-dir" \
- "${PROG} status: Examining first-dir
- ===================================================================
- File: file6 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file7 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ${PROG} status: Examining first-dir/dir1
- ===================================================================
- File: file6 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file7 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ${PROG} status: Examining first-dir/dir1/dir2
- ===================================================================
- File: file6 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file7 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- # XXX why is this commented out???
- # if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
- # pass 34
- # else
- # fail 34
- # fi
- dotest basic2-8 "${testcvs} -q ci -m 'second dive' first-dir" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
- done
- Checking in first-dir/file6;
- ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
- done
- Checking in first-dir/file7;
- ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
- done
- Checking in first-dir/dir1/file6;
- ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v <-- file6
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
- done
- Checking in first-dir/dir1/file7;
- ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v <-- file7
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
- done
- Checking in first-dir/dir1/dir2/file6;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v <-- file6
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
- done
- Checking in first-dir/dir1/dir2/file7;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v <-- file7
- initial revision: 1\.1
- done"
- dotest basic2-9 "${testcvs} tag second-dive first-dir" \
- "${PROG} tag: Tagging first-dir
- T first-dir/file6
- T first-dir/file7
- ${PROG} tag: Tagging first-dir/dir1
- T first-dir/dir1/file6
- T first-dir/dir1/file7
- ${PROG} tag: Tagging first-dir/dir1/dir2
- T first-dir/dir1/dir2/file6
- T first-dir/dir1/dir2/file7"
- # third dive - in bunch o' directories, add bunch o' files,
- # delete some, change some.
- for i in first-dir dir1 dir2 ; do
- cd $i
- # modify a file
- echo file6 >>file6
- # delete a file
- rm file7
- dotest basic2-10-$i "${testcvs} rm file7" \
- "${PROG} remove: scheduling .file7. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- # and add a new file
- echo file14 >file14
- dotest basic2-11-$i "${testcvs} add file14" \
- "${PROG} add: scheduling file .file14. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- done
- cd ../../..
- dotest basic2-12 "${testcvs} update first-dir" \
- "${PROG} update: Updating first-dir
- A first-dir/file14
- M first-dir/file6
- R first-dir/file7
- ${PROG} update: Updating first-dir/dir1
- A first-dir/dir1/file14
- M first-dir/dir1/file6
- R first-dir/dir1/file7
- ${PROG} update: Updating first-dir/dir1/dir2
- A first-dir/dir1/dir2/file14
- M first-dir/dir1/dir2/file6
- R first-dir/dir1/dir2/file7"
- # FIXME: doesn't work right for added files
- dotest basic2-13 "${testcvs} log first-dir" \
- "${PROG} log: Logging first-dir
- ${PROG} log: file14 has been added, but not committed
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
- Working file: first-dir/file6
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- second-dive: 1\.1
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- second dive
- =============================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
- Working file: first-dir/file7
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- second-dive: 1\.1
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- second dive
- =============================================================================
- ${PROG} log: Logging first-dir/dir1
- ${PROG} log: file14 has been added, but not committed
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
- Working file: first-dir/dir1/file6
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- second-dive: 1\.1
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- second dive
- =============================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
- Working file: first-dir/dir1/file7
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- second-dive: 1\.1
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- second dive
- =============================================================================
- ${PROG} log: Logging first-dir/dir1/dir2
- ${PROG} log: file14 has been added, but not committed
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
- Working file: first-dir/dir1/dir2/file6
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- second-dive: 1\.1
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- second dive
- =============================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
- Working file: first-dir/dir1/dir2/file7
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- second-dive: 1\.1
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- second dive
- ============================================================================="
- dotest basic2-14 "${testcvs} status first-dir" \
- "${PROG} status: Examining first-dir
- ===================================================================
- File: file14 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file6 Status: Locally Modified
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file6,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: no file file7 Status: Locally Removed
- Working revision: -1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file7,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ${PROG} status: Examining first-dir/dir1
- ===================================================================
- File: file14 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file6 Status: Locally Modified
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: no file file7 Status: Locally Removed
- Working revision: -1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ${PROG} status: Examining first-dir/dir1/dir2
- ===================================================================
- File: file14 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file6 Status: Locally Modified
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: no file file7 Status: Locally Removed
- Working revision: -1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- # XXX why is this commented out?
- # if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
- # pass 42
- # else
- # fail 42
- # fi
- dotest basic2-16 "${testcvs} ci -m 'third dive' first-dir" \
- "${PROG} [a-z]*: Examining first-dir
- ${PROG} [a-z]*: Examining first-dir/dir1
- ${PROG} [a-z]*: Examining first-dir/dir1/dir2
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file14,v
- done
- Checking in first-dir/file14;
- ${CVSROOT_DIRNAME}/first-dir/file14,v <-- file14
- initial revision: 1\.1
- done
- Checking in first-dir/file6;
- ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
- new revision: 1\.2; previous revision: 1\.1
- done
- Removing first-dir/file7;
- ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
- new revision: delete; previous revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file14,v
- done
- Checking in first-dir/dir1/file14;
- ${CVSROOT_DIRNAME}/first-dir/dir1/file14,v <-- file14
- initial revision: 1\.1
- done
- Checking in first-dir/dir1/file6;
- ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v <-- file6
- new revision: 1\.2; previous revision: 1\.1
- done
- Removing first-dir/dir1/file7;
- ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v <-- file7
- new revision: delete; previous revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v
- done
- Checking in first-dir/dir1/dir2/file14;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v <-- file14
- initial revision: 1\.1
- done
- Checking in first-dir/dir1/dir2/file6;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v <-- file6
- new revision: 1\.2; previous revision: 1\.1
- done
- Removing first-dir/dir1/dir2/file7;
- ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v <-- file7
- new revision: delete; previous revision: 1\.1
- done"
- dotest basic2-17 "${testcvs} -q update first-dir" ''
- dotest basic2-18 "${testcvs} tag third-dive first-dir" \
- "${PROG} tag: Tagging first-dir
- T first-dir/file14
- T first-dir/file6
- ${PROG} tag: Tagging first-dir/dir1
- T first-dir/dir1/file14
- T first-dir/dir1/file6
- ${PROG} tag: Tagging first-dir/dir1/dir2
- T first-dir/dir1/dir2/file14
- T first-dir/dir1/dir2/file6"
- dotest basic2-19 "echo yes | ${testcvs} release -d first-dir" \
- "You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .first-dir.: "
- # end of third dive
- dotest_fail basic2-20 "test -d first-dir" ""
- # now try some rtags
- # rtag HEADS
- dotest basic2-21 "${testcvs} rtag rtagged-by-head first-dir" \
- "${PROG} rtag: Tagging first-dir
- ${PROG} rtag: Tagging first-dir/dir1
- ${PROG} rtag: Tagging first-dir/dir1/dir2"
- # The next test used to cause an assert failure
- # something like:
- # cvs: ./recurse.c:667: do_recursion: Assertion `repository != ((void *)0)' failed.
- dotest basic2-21b "${testcvs} co -p -r rtagged-by-head first-dir/file6" \
- "===================================================================
- Checking out first-dir/file6
- RCS: $CVSROOT_DIRNAME/first-dir/file6,v
- VERS: 1\.2
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- file6
- file6"
- # tag by tag
- dotest basic2-22 "${testcvs} rtag -r rtagged-by-head rtagged-by-tag first-dir" \
- "${PROG} rtag: Tagging first-dir
- ${PROG} rtag: Tagging first-dir/dir1
- ${PROG} rtag: Tagging first-dir/dir1/dir2"
- # tag by revision
- dotest basic2-23 "${testcvs} rtag -r1.1 rtagged-by-revision first-dir" \
- "${PROG} rtag: Tagging first-dir
- ${PROG} rtag: Tagging first-dir/dir1
- ${PROG} rtag: Tagging first-dir/dir1/dir2"
- # rdiff by revision
- dotest basic2-24 "${testcvs} rdiff -r1.1 -rrtagged-by-head first-dir" \
- "${PROG} rdiff: Diffing first-dir
- Index: first-dir/file6
- diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
- \*\*\* first-dir/file6:1\.1 ${DATE}
- --- first-dir/file6 ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- --- 1,2 ----
- file6
- ${PLUS} file6
- Index: first-dir/file7
- diff -c first-dir/file7:1\.1 first-dir/file7:removed
- \*\*\* first-dir/file7:1.1 ${DATE}
- --- first-dir/file7 ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- - file7
- --- 0 ----
- ${PROG} rdiff: Diffing first-dir/dir1
- Index: first-dir/dir1/file6
- diff -c first-dir/dir1/file6:1\.1 first-dir/dir1/file6:1\.2
- \*\*\* first-dir/dir1/file6:1\.1 ${DATE}
- --- first-dir/dir1/file6 ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- --- 1,2 ----
- file6
- ${PLUS} file6
- Index: first-dir/dir1/file7
- diff -c first-dir/dir1/file7:1\.1 first-dir/dir1/file7:removed
- \*\*\* first-dir/dir1/file7:1\.1 ${DATE}
- --- first-dir/dir1/file7 ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- - file7
- --- 0 ----
- ${PROG} rdiff: Diffing first-dir/dir1/dir2
- Index: first-dir/dir1/dir2/file6
- diff -c first-dir/dir1/dir2/file6:1\.1 first-dir/dir1/dir2/file6:1\.2
- \*\*\* first-dir/dir1/dir2/file6:1\.1 ${DATE}
- --- first-dir/dir1/dir2/file6 ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- --- 1,2 ----
- file6
- ${PLUS} file6
- Index: first-dir/dir1/dir2/file7
- diff -c first-dir/dir1/dir2/file7:1\.1 first-dir/dir1/dir2/file7:removed
- \*\*\* first-dir/dir1/dir2/file7:1\.1 ${DATE}
- --- first-dir/dir1/dir2/file7 ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- - file7
- --- 0 ----"
- dotest basic2-24a "${testcvs} rdiff -l -r1.1 -rrtagged-by-head first-dir" \
- "${PROG} rdiff: Diffing first-dir
- Index: first-dir/file6
- diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
- \*\*\* first-dir/file6:1\.1 ${DATE}
- --- first-dir/file6 ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- --- 1,2 ----
- file6
- ${PLUS} file6
- Index: first-dir/file7
- diff -c first-dir/file7:1\.1 first-dir/file7:removed
- \*\*\* first-dir/file7:1.1 ${DATE}
- --- first-dir/file7 ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- - file7
- --- 0 ----"
- # now export by rtagged-by-head and rtagged-by-tag and compare.
- dotest basic2-25 "${testcvs} export -r rtagged-by-head -d 1dir first-dir" \
- "${PROG} export: Updating 1dir
- U 1dir/file14
- U 1dir/file6
- ${PROG} export: Updating 1dir/dir1
- U 1dir/dir1/file14
- U 1dir/dir1/file6
- ${PROG} export: Updating 1dir/dir1/dir2
- U 1dir/dir1/dir2/file14
- U 1dir/dir1/dir2/file6"
- dotest_fail basic2-25a "test -d 1dir/CVS"
- dotest_fail basic2-25b "test -d 1dir/dir1/CVS"
- dotest_fail basic2-25c "test -d 1dir/dir1/dir2/CVS"
- dotest basic2-26 "${testcvs} export -r rtagged-by-tag first-dir" \
- "${PROG} export: Updating first-dir
- U first-dir/file14
- U first-dir/file6
- ${PROG} export: Updating first-dir/dir1
- U first-dir/dir1/file14
- U first-dir/dir1/file6
- ${PROG} export: Updating first-dir/dir1/dir2
- U first-dir/dir1/dir2/file14
- U first-dir/dir1/dir2/file6"
- dotest_fail basic2-26a "test -d first-dir/CVS"
- dotest_fail basic2-26b "test -d first-dir/dir1/CVS"
- dotest_fail basic2-26c "test -d first-dir/dir1/dir2/CVS"
- dotest basic2-27 "directory_cmp 1dir first-dir"
- rm -r 1dir first-dir
- # checkout by revision vs export by rtagged-by-revision and compare.
- mkdir export-dir
- dotest basic2-28 "${testcvs} export -rrtagged-by-revision -d export-dir first-dir" \
- "${PROG} export: Updating export-dir
- U export-dir/file14
- U export-dir/file6
- U export-dir/file7
- ${PROG} export: Updating export-dir/dir1
- U export-dir/dir1/file14
- U export-dir/dir1/file6
- U export-dir/dir1/file7
- ${PROG} export: Updating export-dir/dir1/dir2
- U export-dir/dir1/dir2/file14
- U export-dir/dir1/dir2/file6
- U export-dir/dir1/dir2/file7"
- dotest_fail basic2-28a "test -d export-dir/CVS"
- dotest_fail basic2-28b "test -d export-dir/dir1/CVS"
- dotest_fail basic2-28c "test -d export-dir/dir1/dir2/CVS"
- dotest basic2-29 "${testcvs} co -r1.1 first-dir" \
- "${PROG} checkout: Updating first-dir
- U first-dir/file14
- U first-dir/file6
- U first-dir/file7
- ${PROG} checkout: Updating first-dir/dir1
- U first-dir/dir1/file14
- U first-dir/dir1/file6
- U first-dir/dir1/file7
- ${PROG} checkout: Updating first-dir/dir1/dir2
- U first-dir/dir1/dir2/file14
- U first-dir/dir1/dir2/file6
- U first-dir/dir1/dir2/file7"
- # directory copies are done in an oblique way in order to avoid a bug in sun's tmp filesystem.
- mkdir first-dir.cpy ; (cd first-dir ; tar cf - . | (cd ../first-dir.cpy ; tar xf -))
- dotest basic2-30 "directory_cmp first-dir export-dir"
- # interrupt, while we've got a clean 1.1 here, let's import it
- # into a couple of other modules.
- cd export-dir
- dotest_sort basic2-31 "${testcvs} import -m first-import second-dir first-immigration immigration1 immigration1_0" \
- "
- N second-dir/dir1/dir2/file14
- N second-dir/dir1/dir2/file6
- N second-dir/dir1/dir2/file7
- N second-dir/dir1/file14
- N second-dir/dir1/file6
- N second-dir/dir1/file7
- N second-dir/file14
- N second-dir/file6
- N second-dir/file7
- No conflicts created by this import
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/dir1
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/dir1/dir2"
- cd ..
- dotest basic2-32 "${testcvs} export -r HEAD second-dir" \
- "${PROG} export: Updating second-dir
- U second-dir/file14
- U second-dir/file6
- U second-dir/file7
- ${PROG} export: Updating second-dir/dir1
- U second-dir/dir1/file14
- U second-dir/dir1/file6
- U second-dir/dir1/file7
- ${PROG} export: Updating second-dir/dir1/dir2
- U second-dir/dir1/dir2/file14
- U second-dir/dir1/dir2/file6
- U second-dir/dir1/dir2/file7"
- dotest basic2-33 "directory_cmp first-dir second-dir"
- rm -r second-dir
- rm -r export-dir first-dir
- mkdir first-dir
- (cd first-dir.cpy ; tar cf - . | (cd ../first-dir ; tar xf -))
- # update the top, cancelling sticky tags, retag, update other copy, compare.
- cd first-dir
- dotest basic2-34 "${testcvs} update -A -l *file*" \
- "[UP] file6
- ${PROG} update: file7 is no longer in the repository"
- # If we don't delete the tag first, cvs won't retag it.
- # This would appear to be a feature.
- dotest basic2-35 "${testcvs} tag -l -d rtagged-by-revision" \
- "${PROG} tag: Untagging \.
- D file14
- D file6"
- dotest basic2-36 "${testcvs} tag -l rtagged-by-revision" \
- "${PROG} tag: Tagging \.
- T file14
- T file6"
- cd ..
- mv first-dir 1dir
- mv first-dir.cpy first-dir
- cd first-dir
- dotest basic2-37 "${testcvs} -q diff -u" ''
- dotest basic2-38 "${testcvs} update" \
- "${PROG} update: Updating .
- ${PROG} update: Updating dir1
- ${PROG} update: Updating dir1/dir2"
- cd ..
- #### FIXME: is this expected to work??? Need to investigate
- #### and fix or remove the test.
- # dotest basic2-39 "directory_cmp 1dir first-dir"
- rm -r 1dir first-dir
- # Test the cvs history command.
- # The reason that there are two patterns rather than using
- # \(${TESTDIR}\|<remote>\) is that we are trying to
- # make this portable. Perhaps at some point we should
- # ditch that notion and require GNU expr (or dejagnu or....)
- # since it seems to be so painful.
- # why are there two lines at the end of the local output
- # which don't exist in the remote output? would seem to be
- # a CVS bug.
- dotest basic2-64 "${testcvs} his -x TOFWUPCGMAR -a" \
- "O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= ${TESTDIR}/\*
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == ${TESTDIR}
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == ${TESTDIR}
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == ${TESTDIR}
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == ${TESTDIR}
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == ${TESTDIR}
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == ${TESTDIR}
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == ${TESTDIR}
- M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TESTDIR}
- R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TESTDIR}
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == ${TESTDIR}
- M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == ${TESTDIR}
- R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == ${TESTDIR}
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == ${TESTDIR}
- M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == ${TESTDIR}
- R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == ${TESTDIR}
- F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= ${TESTDIR}/\*
- T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
- T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
- T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
- O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= ${TESTDIR}/\*
- U [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TESTDIR}/first-dir
- W [0-9-]* [0-9:]* ${PLUS}0000 ${username} file7 first-dir == ${TESTDIR}/first-dir" \
- "O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= <remote>/\*
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == <remote>
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == <remote>
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == <remote>
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == <remote>
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == <remote>
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == <remote>
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == <remote>
- M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
- R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == <remote>
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == <remote>
- M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == <remote>
- R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == <remote>
- A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == <remote>
- M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == <remote>
- R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == <remote>
- F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= <remote>/\*
- T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
- T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
- T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
- O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= <remote>/\*
- P [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
- W [0-9-]* [0-9:]* ${PLUS}0000 ${username} file7 first-dir == <remote>"
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -rf ${CVSROOT_DIRNAME}/second-dir
- ;;
- parseroot)
- mkdir 1; cd 1
- # Test odd cases involving CVSROOT. At the moment, that means we
- # are testing roots with '/'s on the end, which CVS should parse off.
- CVSROOT_save=${CVSROOT}
- CVSROOT="${CVSROOT}/////"
- dotest parseroot-1 "${testcvs} -q co CVSROOT/modules" \
- "U CVSROOT/modules"
- dotest parseroot-2 "${testcvs} -q ci -fmnull-change CVSROOT/modules" \
- "Checking in CVSROOT/modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.2; previous revision: 1\.1
- done
- ${PROG} commit: Rebuilding administrative file database"
- if $remote; then
- # I only test these when testing remote in case CVS was compiled
- # without client support.
- # logout does not try to contact the server.
- CVSROOT=":pserver;proxy=localhost;proxyport=8080:localhost/dev/null"
- dotest parseroot-3r "$testcvs -d'$CVSROOT' logout" \
- "$PROG logout: WARNING: Ignoring method options found in CVSROOT: \`proxy=localhost;proxyport=8080'\.
- $PROG logout: Use CVS version 1\.12\.7 or later to handle method options\.
- Logging out of :pserver:$username@localhost:2401/dev/null
- $PROG logout: warning: failed to open $HOME/\.cvspass for reading: No such file or directory
- $PROG logout: Entry not found\."
- fi
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- CVSROOT=$CVSROOT_save
- cd ..
- rm -r 1
- ;;
- files)
- # Test of how we specify files on the command line
- # (recurse.c and that sort of thing). Vaguely similar to
- # tests like basic* and deep. See modules and such tests
- # for what happens when we throw in modules and co -d, &c.
- # This particular test is fairly carefully crafted, to spot
- # one particular issue with remote.
- mkdir 1; cd 1
- dotest files-1 "${testcvs} -q co -l ." ""
- mkdir first-dir
- dotest files-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- touch tfile
- dotest files-3 "${testcvs} add tfile" \
- "${PROG} add: scheduling file .tfile. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest files-4 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
- done
- Checking in tfile;
- ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
- initial revision: 1\.1
- done"
- dotest files-5 "${testcvs} -q tag -b C" "T tfile"
- dotest files-6 "$testcvs -q update -r C" "U tfile"
- mkdir dir
- dotest files-7 "${testcvs} add dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/dir added to the repository
- --> Using per-directory sticky tag .C'"
- cd dir
- touch .file
- dotest files-6 "${testcvs} add .file" \
- "${PROG} add: scheduling file .\.file' for addition on branch .C.
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- mkdir sdir
- dotest files-7 "${testcvs} add sdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir added to the repository
- --> Using per-directory sticky tag .C'"
- cd sdir
- mkdir ssdir
- dotest files-8 "${testcvs} add ssdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir added to the repository
- --> Using per-directory sticky tag .C'"
- cd ssdir
- touch .file
- dotest files-9 "${testcvs} add .file" \
- "${PROG} add: scheduling file .\.file' for addition on branch .C.
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- cd ../..
- dotest files-10 "${testcvs} -q ci -m test" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v
- done
- Checking in \.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v
- done
- Checking in sdir/ssdir/\.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- dotest files-11 \
- "${testcvs} commit -m test -f ./.file ./sdir/ssdir/.file" \
- "Checking in \.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
- new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
- done
- Checking in \./sdir/ssdir/\.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
- new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
- done"
- if $remote; then
- # FIXCVS:
- # This is a bug, looks like that toplevel_repos cruft in
- # client.c is coming back to haunt us.
- # May want to think about the whole issue, toplevel_repos
- # has always been crufty and trying to patch it up again
- # might be a mistake.
- dotest files-12 \
- "${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
- "Checking in \./sdir/ssdir/\.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
- new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
- done"
- # Sync up the version numbers so that the rest of the
- # tests don't need to expect different numbers based
- # local or remote.
- dotest files-12-workaround \
- "${testcvs} commit -f -m test .file" \
- "Checking in \.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
- new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
- done"
- else
- dotest files-12 \
- "${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
- "Checking in \./sdir/ssdir/\.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
- new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
- done
- Checking in \.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
- new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
- done"
- fi
- dotest files-13 \
- "${testcvs} commit -fmtest ./sdir/../sdir/ssdir/..///ssdir/.file" \
- "Checking in \./sdir/\.\./sdir/ssdir/\.\.///ssdir/\.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
- new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
- done"
- if $remote; then
- dotest files-14 \
- "${testcvs} commit -fmtest ../../first-dir/dir/.file" \
- "Checking in \.\./\.\./first-dir/dir/\.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- .file
- new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
- done"
- else
- dotest files-14 \
- "${testcvs} commit -fmtest ../../first-dir/dir/.file" \
- "Checking in \.\./\.\./first-dir/dir/\.file;
- ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
- new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
- done"
- fi
- cd ../../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- spacefiles)
- # More filename tests, in particular spaces in file names.
- # (it might be better to just change a few of the names in
- # basica or some other test instead, always good to keep the
- # testsuite concise).
- mkdir 1; cd 1
- dotest spacefiles-1 "${testcvs} -q co -l ." ""
- touch ./-c
- dotest spacefiles-2 "${testcvs} add -- -c" \
- "${PROG} add: scheduling file .-c. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest spacefiles-3 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/-c,v
- done
- Checking in -c;
- ${CVSROOT_DIRNAME}/-c,v <-- -c
- initial revision: 1\.1
- done"
- mkdir 'first dir'
- dotest spacefiles-4 "${testcvs} add 'first dir'" \
- "Directory ${CVSROOT_DIRNAME}/first dir added to the repository"
- mkdir ./-b
- dotest spacefiles-5 "${testcvs} add -- -b" \
- "Directory ${CVSROOT_DIRNAME}/-b added to the repository"
- cd 'first dir'
- touch 'a file'
- dotest spacefiles-6 "${testcvs} add 'a file'" \
- "${PROG} add: scheduling file .a file. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest spacefiles-7 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first dir/a file,v
- done
- Checking in a file;
- ${CVSROOT_DIRNAME}/first dir/a file,v <-- a file
- initial revision: 1\.1
- done"
- dotest spacefiles-8 "${testcvs} -q tag new-tag" "T a file"
- cd ../..
- mkdir 2; cd 2
- dotest spacefiles-10 "${testcvs} co -- -b" \
- "${PROG} checkout: Updating -b"
- dotest spacefiles-11 "${testcvs} -q co -- -c" "U \./-c"
- rm ./-c
- dotest spacefiles-13 "${testcvs} -q co 'first dir'" \
- "U first dir/a file"
- cd ..
- mkdir 3; cd 3
- dotest spacefiles-14 "${testcvs} -q co 'first dir/a file'" \
- "U first dir/a file"
- cd ..
- rm -r 1 2 3
- rm -rf "${CVSROOT_DIRNAME}/first dir"
- rm -r ${CVSROOT_DIRNAME}/-b
- rm -f ${CVSROOT_DIRNAME}/-c,v
- ;;
- commit-readonly)
- mkdir 1; cd 1
- module=x
- : > junk
- dotest commit-readonly-1 "$testcvs -Q import -m . $module X Y" ''
- dotest commit-readonly-2 "$testcvs -Q co $module" ''
- cd $module
- file=m
- # Include an rcs keyword to be expanded.
- echo '$Id''$' > $file
- dotest commit-readonly-3 "$testcvs add $file" \
- "${PROG} add: scheduling file .$file. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest commit-readonly-4 "$testcvs -Q ci -m . $file" \
- "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
- done
- Checking in $file;
- ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
- initial revision: 1\.1
- done"
- echo line2 >> $file
- # Make the file read-only.
- chmod a-w $file
- dotest commit-readonly-5 "$testcvs -Q ci -m . $file" \
- "Checking in $file;
- ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
- new revision: 1\.2; previous revision: 1\.1
- done"
- cd ../..
- rm -rf 1
- rm -rf ${CVSROOT_DIRNAME}/$module
- ;;
- status)
- # This tests for a bug in the status command which failed to
- # notice resolved conflicts.
- mkdir status; cd status
- dotest status-init-1 "${testcvs} -q co -l ." ""
- mkdir first-dir
- dotest status-init-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- echo a line >tfile
- dotest status-init-3 "${testcvs} add tfile" \
- "${PROG} add: scheduling file .tfile. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest status-init-4 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
- done
- Checking in tfile;
- ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
- initial revision: 1\.1
- done"
- cd ..
- dotest status-init-5 "${testcvs} -q co -dsecond-dir first-dir" \
- "U second-dir/tfile"
- cd second-dir
- echo some junk >>tfile
- dotest status-init-6 "${testcvs} -q ci -maline" \
- "Checking in tfile;
- ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
- new revision: 1\.2; previous revision: 1\.1
- done"
- cd ../first-dir
- echo force a conflict >>tfile
- dotest status-init-7 "${testcvs} -q up" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into tfile
- rcsmerge: warning: conflicts during merge
- ${PROG} update: conflicts found in tfile
- C tfile"
- # Now note our status
- dotest status-1 "${testcvs} status tfile" \
- "===================================================================
- File: tfile Status: Unresolved Conflict
- Working revision: 1\.2.*
- Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- # touch the file, leaving conflict markers in place
- # and note our status
- touch tfile
- dotest status-2 "${testcvs} status tfile" \
- "===================================================================
- File: tfile Status: File had conflicts on merge
- Working revision: 1\.2.*
- Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- # resolve the conflict
- echo resolution >tfile
- dotest status-3 "${testcvs} status tfile" \
- "===================================================================
- File: tfile Status: Locally Modified
- Working revision: 1\.2.*
- Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- # Check that there are no problems just using CVS/Root too.
- save_CVSROOT=$CVSROOT
- unset CVSROOT
- dotest status-3a "${testcvs} status tfile" \
- "===================================================================
- File: tfile Status: Locally Modified
- Working revision: 1\.2.*
- Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- CVSROOT=$save_CVSROOT
- export CVSROOT
- # FIXCVS:
- # Update is supposed to re-Register() the file when it
- # finds resolved conflicts:
- dotest status-4 "grep 'Result of merge' CVS/Entries" \
- "/tfile/1\.2/Result of merge${PLUS}[a-zA-Z0-9 :]*//"
- cd ..
- mkdir fourth-dir
- dotest status-init-8 "$testcvs add fourth-dir" \
- "Directory $CVSROOT_DIRNAME/fourth-dir added to the repository"
- cd fourth-dir
- echo yet another line >t3file
- dotest status-init-9 "$testcvs add t3file" \
- "$PROG add: scheduling file .t3file. for addition
- $PROG add: use .$PROG commit. to add this file permanently"
- dotest status-init-10 "$testcvs -q ci -m add" \
- "RCS file: $CVSROOT_DIRNAME/fourth-dir/t3file,v
- done
- Checking in t3file;
- $CVSROOT_DIRNAME/fourth-dir/t3file,v <-- t3file
- initial revision: 1\.1
- done"
- cd ../first-dir
- mkdir third-dir
- dotest status-init-11 "$testcvs add third-dir" \
- "Directory $CVSROOT_DIRNAME/first-dir/third-dir added to the repository"
- cd third-dir
- echo another line >t2file
- dotest status-init-12 "$testcvs add t2file" \
- "$PROG add: scheduling file .t2file. for addition
- $PROG add: use .$PROG commit. to add this file permanently"
- dotest status-init-13 "$testcvs -q ci -m add" \
- "RCS file: $CVSROOT_DIRNAME/first-dir/third-dir/t2file,v
- done
- Checking in t2file;
- $CVSROOT_DIRNAME/first-dir/third-dir/t2file,v <-- t2file
- initial revision: 1\.1
- done"
- dotest status-5 "$testcvs status ../tfile" \
- "===================================================================
- File: tfile Status: Locally Modified
- Working revision: 1\.2.*
- Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/tfile,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest status-6 "$testcvs status ../../fourth-dir/t3file" \
- "===================================================================
- File: t3file Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 $CVSROOT_DIRNAME/fourth-dir/t3file,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- cd ../../..
- rm -rf status
- rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/fourth-dir
- ;;
- rdiff)
- # Test rdiff
- # XXX for now this is just the most essential test...
- cd ${TESTDIR}
- mkdir testimport
- cd testimport
- echo '$''Id$' > foo
- echo '$''Name$' >> foo
- echo '$''Id$' > bar
- echo '$''Name$' >> bar
- dotest_sort rdiff-1 \
- "${testcvs} import -I ! -m test-import-with-keyword trdiff TRDIFF T1" \
- '
- N trdiff/bar
- N trdiff/foo
- No conflicts created by this import'
- dotest rdiff-2 \
- "${testcvs} co -ko trdiff" \
- "${PROG} checkout: Updating trdiff
- U trdiff/bar
- U trdiff/foo"
- cd trdiff
- echo something >> foo
- dotest rdiff-3 \
- "${testcvs} ci -m added-something foo" \
- "Checking in foo;
- ${CVSROOT_DIRNAME}/trdiff/foo,v <-- foo
- new revision: 1\.2; previous revision: 1\.1
- done"
- echo '#ident "@(#)trdiff:$''Name$:$''Id$"' > new
- echo "new file" >> new
- dotest rdiff-4 \
- "${testcvs} add -m new-file-description new" \
- "${PROG} add: scheduling file \`new' for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest rdiff-5 \
- "${testcvs} commit -m added-new-file new" \
- "RCS file: ${CVSROOT_DIRNAME}/trdiff/new,v
- done
- Checking in new;
- ${CVSROOT_DIRNAME}/trdiff/new,v <-- new
- initial revision: 1\.1
- done"
- dotest rdiff-6 \
- "${testcvs} tag local-v0" \
- "${PROG} tag: Tagging .
- T bar
- T foo
- T new"
- dotest rdiff-7 \
- "${testcvs} status -v foo" \
- "===================================================================
- File: foo Status: Up-to-date
- Working revision: 1\.2.*
- Repository revision: 1\.2 ${CVSROOT_DIRNAME}/trdiff/foo,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: -ko
- Existing Tags:
- local-v0 (revision: 1\.2)
- T1 (revision: 1\.1\.1\.1)
- TRDIFF (branch: 1\.1\.1)"
- cd ..
- rm -r trdiff
- dotest rdiff-8 \
- "${testcvs} rdiff -r T1 -r local-v0 trdiff" \
- "${PROG}"' rdiff: Diffing trdiff
- Index: trdiff/foo
- diff -c trdiff/foo:1\.1\.1\.1 trdiff/foo:1\.2
- \*\*\* trdiff/foo:1\.1\.1\.1 '"${DATE}"'
- --- trdiff/foo '"${DATE}"'
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1,2 \*\*\*\*
- ! \$''Id: foo,v 1\.1\.1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$
- ! \$''Name: T1 \$
- --- 1,3 ----
- ! \$''Id: foo,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
- ! \$''Name: local-v0 \$
- ! something
- Index: trdiff/new
- diff -c /dev/null trdiff/new:1\.1
- \*\*\* /dev/null '"${DATE}"'
- --- trdiff/new '"${DATE}"'
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 0 \*\*\*\*
- --- 1,2 ----
- '"${PLUS}"' #ident "@(#)trdiff:\$''Name: local-v0 \$:\$''Id: new,v 1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$"
- '"${PLUS}"' new file'
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ..
- rm -r testimport
- rm -rf ${CVSROOT_DIRNAME}/trdiff
- ;;
- rdiff-short)
- # Test that the short patch behaves as expected
- # 1) Added file.
- # 2) Removed file.
- # 3) Different revision number with no difference.
- # 4) Different revision number with changes.
- # 5) Against trunk.
- # 6) Same revision number (no difference).
- mkdir rdiff-short; cd rdiff-short
- mkdir abc
- dotest rdiff-short-init-1 \
- "${testcvs} -q import -I ! -m initial-import abc vendor initial" \
- '
- No conflicts created by this import'
- dotest rdiff-short-init-2 "${testcvs} -q get abc" ''
- cd abc
- echo "abc" >file1.txt
- dotest rdiff-short-init-3 "${testcvs} add file1.txt" \
- "${PROG} add: scheduling file .file1\.txt' for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest rdiff-short-init-4 \
- "${testcvs} commit -madd-file1 file1.txt" \
- "RCS file: ${CVSROOT_DIRNAME}/abc/file1\.txt,v
- done
- Checking in file1\.txt;
- ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
- initial revision: 1\.1
- done"
- echo def >>file1.txt
- dotest rdiff-short-init-5 \
- "${testcvs} commit -mchange-file1 file1.txt" \
- "Checking in file1\.txt;
- ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
- new revision: 1\.2; previous revision: 1\.1
- done"
- echo "abc" >file1.txt
- dotest rdiff-short-init-6 \
- "${testcvs} commit -mrestore-file1-rev1 file1.txt" \
- "Checking in file1\.txt;
- ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
- new revision: 1\.3; previous revision: 1\.2
- done"
- dotest rdiff-short-init-7 \
- "${testcvs} tag -r 1.1 tag1 file1.txt" \
- "T file1\.txt"
- dotest rdiff-short-init-8 \
- "${testcvs} tag -r 1.2 tag2 file1.txt" \
- "T file1\.txt"
- dotest rdiff-short-init-9 \
- "${testcvs} tag -r 1.3 tag3 file1.txt" \
- "T file1\.txt"
- echo "abc" >file2.txt
- dotest rdiff-short-init-10 \
- "${testcvs} add file2.txt" \
- "${PROG} add: scheduling file .file2\.txt' for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest rdiff-add-remove-nodiff-init-11 \
- "${testcvs} commit -madd-file2 file2.txt" \
- "RCS file: ${CVSROOT_DIRNAME}/abc/file2\.txt,v
- done
- Checking in file2\.txt;
- ${CVSROOT_DIRNAME}/abc/file2\.txt,v <-- file2\.txt
- initial revision: 1\.1
- done"
- dotest rdiff-short-init-12 \
- "${testcvs} tag -r 1.1 tag4 file2.txt" \
- "T file2\.txt"
- dotest rdiff-short-init-13 \
- "${testcvs} tag -r 1.1 tag5 file2.txt" \
- "T file2\.txt"
- cd ../..
- rm -fr rdiff-short
- # 3) Different revision number with no difference.
- dotest rdiff-short-no-real-change \
- "${testcvs} -q rdiff -s -r tag1 -r tag3 abc"
- # 4) Different revision number with changes.
- dotest rdiff-short-real-change \
- "${testcvs} -q rdiff -s -r tag1 -r tag2 abc" \
- 'File abc/file1.txt changed from revision 1\.1 to 1\.2'
- # 1) Added file.
- # 2) Removed file.
- dotest_sort rdiff-short-remove-add \
- "${testcvs} -q rdiff -s -r tag2 -r tag4 abc" \
- 'File abc/file1\.txt is removed; tag2 revision 1\.2
- File abc/file2\.txt is new; tag4 revision 1\.1'
- # 6) Same revision number (no difference).
- dotest rdiff-short-no-change \
- "${testcvs} -q rdiff -s -r tag4 -r tag5 abc"
- # 5) Against trunk.
- # Check that the messages change when we diff against the trunk
- # rather than a tag or date.
- dotest rdiff-short-against-trunk-1 \
- "${testcvs} -q rdiff -s -rtag4 abc" \
- "File abc/file1\.txt is new; current revision 1\.3"
- dotest rdiff-short-against-trunk-2 \
- "${testcvs} -q rdiff -s -rtag2 abc" \
- "File abc/file1\.txt changed from revision 1\.2 to 1\.3
- File abc/file2\.txt is new; current revision 1\.1"
- rm -rf ${CVSROOT_DIRNAME}/abc
- ;;
- rdiff2)
- # Test for the segv problem reported by James Cribb
- # Somewhere to work
- mkdir rdiff2; cd rdiff2
- # Create a module "m" with files "foo" and "d/bar"
- mkdir m; cd m
- echo foo >foo
- mkdir d
- echo bar >d/bar
- dotest_sort rdiff2-1 \
- "${testcvs} -q import -I ! -m initial-import m vendor initial" \
- '
- N m/d/bar
- N m/foo
- No conflicts created by this import'
- cd ..
- rm -r m
-
- # Remove "foo"
- dotest rdiff2-2 "${testcvs} get m" \
- "${PROG} checkout: Updating m
- U m/foo
- ${PROG} checkout: Updating m/d
- U m/d/bar"
- cd m
- dotest rdiff2-3 "${testcvs} rm -f foo" \
- "${PROG} remove: scheduling .foo. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest rdiff2-4 "${testcvs} commit -m Removed foo" \
- "Removing foo;
- ${CVSROOT_DIRNAME}/m/foo,v <-- foo
- new revision: delete; previous revision: 1\.1\.1\.1
- done"
-
- # Modify "d/bar"
- echo foo >d/bar
- dotest rdiff2-5 "${testcvs} commit -m Changed d/bar" \
- "Checking in d/bar;
- ${CVSROOT_DIRNAME}/m/d/bar,v <-- bar
- new revision: 1\.2; previous revision: 1\.1
- done"
-
- # Crash before showing d/bar diffs
- dotest_fail rdiff2-6 "${testcvs} rdiff -t m" \
- "${PROG} rdiff: Diffing m
- ${PROG} rdiff: Diffing m/d
- Index: m/d/bar
- diff -c m/d/bar:1\.1\.1\.1 m/d/bar:1\.2
- \*\*\* m/d/bar:1\.1\.1\.1 ${DATE}
- --- m/d/bar ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- ! bar
- --- 1 ----
- ! foo"
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ../..
- rm -rf rdiff2
- rm -rf ${CVSROOT_DIRNAME}/m
- ;;
- diff)
- # Various tests specific to the "cvs diff" command.
- # Related tests:
- # death2: -N
- # rcslib: cvs diff and $Name.
- # rdiff: cvs rdiff.
- # diffmerge*: nuts and bolts (stuff within diff library)
- mkdir 1; cd 1
- dotest diff-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest diff-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- # diff is anomalous. Most CVS commands print the "nothing
- # known" message (or worse yet, no message in some cases) but
- # diff says "I know nothing". Shrug.
- dotest_fail diff-3 "${testcvs} diff xyzpdq" \
- "${PROG} diff: I know nothing about xyzpdq"
- touch abc
- dotest diff-4 "${testcvs} add abc" \
- "${PROG} add: scheduling file .abc. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest diff-5 "${testcvs} -q ci -mtest" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- done
- Checking in abc;
- ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
- initial revision: 1\.1
- done"
- echo "extern int gethostname ();" >abc
- dotest diff-6 "${testcvs} -q ci -mtest" \
- "Checking in abc;
- ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
- new revision: 1\.2; previous revision: 1\.1
- done"
- echo "#include <winsock.h>" >abc
- # check the behavior of the --ifdef=MACRO option
- dotest_fail diff-7 "${testcvs} -q diff --ifdef=HAVE_WINSOCK_H" \
- "Index: abc
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- retrieving revision 1\.2
- diff --ifdef HAVE_WINSOCK_H -r1\.2 abc
- #ifndef HAVE_WINSOCK_H
- extern int gethostname ();
- #else /\* HAVE_WINSOCK_H \*/
- #include <winsock\.h>
- #endif /\* HAVE_WINSOCK_H \*/"
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ../..
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -r 1
- ;;
- diffnl)
- # Test handling of 'cvs diff' of files without newlines
- mkdir 1; cd 1
- dotest diffnl-000 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest diffnl-001 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nfive\nsix")}' </dev/null >abc
- dotest diffnl-002 "${testcvs} add abc" \
- "${PROG} add: scheduling file .abc. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest diffnl-003 "${testcvs} -q ci -mtest" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- done
- Checking in abc;
- ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
- initial revision: 1\.1
- done"
- # change to line near EOF
- ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nsix")}' </dev/null >abc
- dotest_fail diffnl-100 "${testcvs} diff abc" \
- "Index: abc
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- retrieving revision 1\.1
- diff -r1\.1 abc
- 5d4
- < five"
- dotest_fail diffnl-101 "${testcvs} diff -u abc" \
- "Index: abc
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- retrieving revision 1\.1
- diff -u -r1\.1 abc
- --- abc ${RFCDATE} 1\.1
- +++ abc ${RFCDATE}
- @@ -2,5 +2,4 @@
- two
- three
- four
- -five
- six
- \\\\ No newline at end of file"
- dotest diffnl-102 "${testcvs} -q ci -mtest abc" \
- "Checking in abc;
- ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
- new revision: 1\.2; previous revision: 1\.1
- done"
- # Change to last line
- ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nseven")}' </dev/null >abc
- dotest_fail diffnl-200 "${testcvs} diff abc" \
- "Index: abc
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- retrieving revision 1\.2
- diff -r1\.2 abc
- 5c5
- < six
- \\\\ No newline at end of file
- ---
- > seven
- \\\\ No newline at end of file"
- dotest_fail diffnl-201 "${testcvs} diff -u abc" \
- "Index: abc
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- retrieving revision 1\.2
- diff -u -r1\.2 abc
- --- abc ${RFCDATE} 1\.2
- +++ abc ${RFCDATE}
- @@ -2,4 +2,4 @@
- two
- three
- four
- -six
- \\\\ No newline at end of file
- +seven
- \\\\ No newline at end of file"
- dotest diffnl-202 "${testcvs} ci -mtest abc" \
- "Checking in abc;
- ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
- new revision: 1\.3; previous revision: 1\.2
- done"
- # Addition of newline
- echo "one
- two
- three
- four
- seven" > abc
- dotest_fail diffnl-300 "${testcvs} diff abc" \
- "Index: abc
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- retrieving revision 1\.3
- diff -r1\.3 abc
- 5c5
- < seven
- \\\\ No newline at end of file
- ---
- > seven"
- dotest_fail diffnl-301 "${testcvs} diff -u abc" \
- "Index: abc
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- retrieving revision 1\.3
- diff -u -r1\.3 abc
- --- abc ${RFCDATE} 1\.3
- +++ abc ${RFCDATE}
- @@ -2,4 +2,4 @@
- two
- three
- four
- -seven
- \\\\ No newline at end of file
- +seven"
- dotest diffnl-302 "${testcvs} ci -mtest abc" \
- "Checking in abc;
- ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
- new revision: 1\.4; previous revision: 1\.3
- done"
- # Removal of newline
- ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nseven")}' </dev/null >abc
- dotest_fail diffnl-400 "${testcvs} diff abc" \
- "Index: abc
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- retrieving revision 1\.4
- diff -r1\.4 abc
- 5c5
- < seven
- ---
- > seven
- \\\\ No newline at end of file"
- dotest_fail diffnl-401 "${testcvs} diff -u abc" \
- "Index: abc
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- retrieving revision 1\.4
- diff -u -r1\.4 abc
- --- abc ${RFCDATE} 1\.4
- +++ abc ${RFCDATE}
- @@ -2,4 +2,4 @@
- two
- three
- four
- -seven
- +seven
- \\\\ No newline at end of file"
-
- cd ../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- death)
- # next dive. test death support.
- # NOTE: this section has reached the size and
- # complexity where it is getting to be a good idea to
- # add new death support tests to a new section rather
- # than continuing to piggyback them onto the tests here.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- if ${CVS} co first-dir ; then
- pass 65
- else
- fail 65
- fi
- cd first-dir
- # Create a directory with only dead files, to make sure CVS
- # doesn't get confused by it.
- mkdir subdir
- dotest 65a0 "${testcvs} add subdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
- cd subdir
- echo file in subdir >sfile
- dotest 65a1 "${testcvs} add sfile" \
- "${PROG}"' add: scheduling file `sfile'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest 65a2 "${testcvs} -q ci -m add-it" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v
- done
- Checking in sfile;
- ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
- initial revision: 1\.1
- done"
- rm sfile
- dotest 65a3 "${testcvs} rm sfile" \
- "${PROG}"' remove: scheduling `sfile'\'' for removal
- '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
- dotest 65a4 "${testcvs} -q ci -m remove-it" \
- "Removing sfile;
- ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
- new revision: delete; previous revision: 1\.1
- done"
- cd ..
- dotest 65a5 "${testcvs} -q update -P" ''
- dotest_fail 65a6 "test -d subdir" ''
- # add a file.
- touch file1
- if ${CVS} add file1 2>> ${LOGFILE}; then
- pass 66
- else
- fail 66
- fi
- # commit
- if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
- pass 67
- else
- fail 67
- fi
- # remove
- rm file1
- if ${CVS} rm file1 2>> ${LOGFILE}; then
- pass 68
- else
- fail 68
- fi
- # commit
- if ${CVS} ci -m test >>${LOGFILE} ; then
- pass 69
- else
- fail 69
- fi
- dotest_fail 69a0 "test -f file1" ''
- # get the old contents of file1 back
- if ${testcvs} update -p -r 1.1 file1 >file1 2>>${LOGFILE}; then
- pass 69a1
- else
- fail 69a1
- fi
- dotest 69a2 "cat file1" ''
- # create second file
- touch file2
- if ${CVS} add file1 file2 2>> ${LOGFILE}; then
- pass 70
- else
- fail 70
- fi
- # commit
- if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
- pass 71
- else
- fail 71
- fi
- # log
- if ${CVS} log file1 >> ${LOGFILE}; then
- pass 72
- else
- fail 72
- fi
- # file4 will be dead at the time of branching and stay dead.
- echo file4 > file4
- dotest death-file4-add "${testcvs} add file4" \
- "${PROG}"' add: scheduling file `file4'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest death-file4-ciadd "${testcvs} -q ci -m add file4" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- initial revision: 1\.1
- done"
- rm file4
- dotest death-file4-rm "${testcvs} remove file4" \
- "${PROG}"' remove: scheduling `file4'\'' for removal
- '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
- dotest death-file4-cirm "${testcvs} -q ci -m remove file4" \
- "Removing file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: delete; previous revision: 1\.1
- done"
- # Tag the branchpoint.
- dotest death-72a "${testcvs} -q tag bp_branch1" 'T file1
- T file2'
- # branch1
- if ${CVS} tag -b branch1 ; then
- pass 73
- else
- fail 73
- fi
- # and move to the branch.
- if ${CVS} update -r branch1 ; then
- pass 74
- else
- fail 74
- fi
- dotest_fail death-file4-3 "test -f file4" ''
- # add a file in the branch
- echo line1 from branch1 >> file3
- if ${CVS} add file3 2>> ${LOGFILE}; then
- pass 75
- else
- fail 75
- fi
- # commit
- if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
- pass 76
- else
- fail 76
- fi
- dotest death-76a0 \
- "${testcvs} -q rdiff -r bp_branch1 -r branch1 first-dir" \
- "Index: first-dir/file3
- diff -c /dev/null first-dir/file3:1\.1\.2\.1
- \*\*\* /dev/null ${DATE}
- --- first-dir/file3 ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 0 \*\*\*\*
- --- 1 ----
- ${PLUS} line1 from branch1"
- dotest death-76a1 \
- "${testcvs} -q rdiff -r branch1 -r bp_branch1 first-dir" \
- "Index: first-dir/file3
- diff -c first-dir/file3:1\.1\.2\.1 first-dir/file3:removed
- \*\*\* first-dir/file3:1\.1\.2\.1 ${DATE}
- --- first-dir/file3 ${DATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- - line1 from branch1
- --- 0 ----"
- # remove
- rm file3
- if ${CVS} rm file3 2>> ${LOGFILE}; then
- pass 77
- else
- fail 77
- fi
- # commit
- if ${CVS} ci -m test >>${LOGFILE} ; then
- pass 78
- else
- fail 78
- fi
- # add again
- echo line1 from branch1 >> file3
- if ${CVS} add file3 2>> ${LOGFILE}; then
- pass 79
- else
- fail 79
- fi
- # commit
- if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
- pass 80
- else
- fail 80
- fi
- # change the first file
- echo line2 from branch1 >> file1
- # commit
- if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
- pass 81
- else
- fail 81
- fi
- # remove the second
- rm file2
- if ${CVS} rm file2 2>> ${LOGFILE}; then
- pass 82
- else
- fail 82
- fi
- # commit
- if ${CVS} ci -m test >>${LOGFILE}; then
- pass 83
- else
- fail 83
- fi
- # back to the trunk.
- if ${CVS} update -A 2>> ${LOGFILE}; then
- pass 84
- else
- fail 84
- fi
- dotest_fail death-file4-4 "test -f file4" ''
- if test -f file3 ; then
- fail 85
- else
- pass 85
- fi
- # join
- dotest 86 "${testcvs} -q update -j branch1" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- retrieving revision 1\.3
- retrieving revision 1\.3\.2\.1
- Merging differences between 1\.3 and 1\.3\.2\.1 into file1
- ${PROG} update: scheduling file2 for removal
- U file3"
- dotest_fail death-file4-5 "test -f file4" ''
- if test -f file3 ; then
- pass 87
- else
- fail 87
- fi
- # Make sure that we joined the correct change to file1
- if echo line2 from branch1 | cmp - file1 >/dev/null; then
- pass 87a
- else
- fail 87a
- fi
- # update
- if ${CVS} update ; then
- pass 88
- else
- fail 88
- fi
- # commit
- dotest 89 "${testcvs} -q ci -m test" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.4; previous revision: 1\.3
- done
- Removing file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: delete; previous revision: 1\.1
- done
- Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- new revision: 1\.2; previous revision: 1\.1
- done"
- cd ..
- mkdir 2
- cd 2
- dotest 89a "${testcvs} -q co first-dir" 'U first-dir/file1
- U first-dir/file3'
- cd ..
- rm -r 2
- cd first-dir
- # remove first file.
- rm file1
- if ${CVS} rm file1 2>> ${LOGFILE}; then
- pass 90
- else
- fail 90
- fi
- # commit
- if ${CVS} ci -m test >>${LOGFILE}; then
- pass 91
- else
- fail 91
- fi
- if test -f file1 ; then
- fail 92
- else
- pass 92
- fi
- # typo; try to get to the branch and fail
- dotest_fail 92.1a "${testcvs} update -r brnach1" \
- "${PROG}"' \[update aborted\]: no such tag brnach1'
- # Make sure we are still on the trunk
- if test -f file1 ; then
- fail 92.1b
- else
- pass 92.1b
- fi
- if test -f file3 ; then
- pass 92.1c
- else
- fail 92.1c
- fi
- # back to branch1
- if ${CVS} update -r branch1 2>> ${LOGFILE}; then
- pass 93
- else
- fail 93
- fi
- dotest_fail death-file4-6 "test -f file4" ''
- if test -f file1 ; then
- pass 94
- else
- fail 94
- fi
- # and join
- dotest 95 "$testcvs -q update -j HEAD" \
- "$PROG update: file file1 has been removed in revision HEAD, but the destination is incompatibly modified
- C file1
- $PROG update: file file3 exists, but has been added in revision HEAD"
- dotest_fail death-file4-7 "test -f file4" ''
- # file2 should not have been recreated. It was
- # deleted on the branch, and has not been modified on
- # the trunk. That means that there have been no
- # changes between the greatest common ancestor (the
- # trunk version) and HEAD.
- dotest_fail death-file2-1 "test -f file2" ''
- cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
- ;;
- death2)
- # More tests of death support.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- dotest death2-1 "${testcvs} -q co first-dir" ''
- cd first-dir
- # Add two files on the trunk.
- echo "first revision" > file1
- echo "file4 first revision" > file4
- dotest death2-2 "${testcvs} add file1 file4" \
- "${PROG}"' add: scheduling file `file1'\'' for addition
- '"${PROG}"' add: scheduling file `file4'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
- dotest death2-3 "${testcvs} -q commit -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- initial revision: 1\.1
- done"
- # Make a branch and a non-branch tag.
- dotest death2-4 "${testcvs} -q tag -b branch" \
- 'T file1
- T file4'
- dotest death2-5 "${testcvs} -q tag tag" \
- 'T file1
- T file4'
- # Switch over to the branch.
- dotest death2-6 "$testcvs -q update -r branch" \
- '[UP] file1
- [UP] file4'
- # Delete the file on the branch.
- rm file1
- dotest death2-7 "${testcvs} rm file1" \
- "${PROG} remove: scheduling .file1. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- # Test diff of the removed file before it is committed.
- dotest_fail death2-diff-1 "${testcvs} -q diff file1" \
- "${PROG} diff: file1 was removed, no comparison available"
- dotest_fail death2-diff-2 "${testcvs} -q diff -N -c file1" \
- "Index: file1
- ===================================================================
- RCS file: file1
- diff -N file1
- \*\*\* file1 ${RFCDATE} [0-9.]*
- --- /dev/null ${RFCDATE_EPOCH}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- - first revision
- --- 0 ----"
- dotest death2-8 "${testcvs} -q ci -m removed" \
- "Removing file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done"
- # Test diff of a dead file.
- dotest_fail death2-diff-3 \
- "${testcvs} -q diff -r1.1 -rbranch -c file1" \
- "${PROG} diff: Tag branch refers to a dead (removed) revision in file .file1.\.
- ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
- # and in reverse
- dotest_fail death2-diff-3a \
- "${testcvs} -q diff -rbranch -r1.1 -c file1" \
- "${PROG} diff: Tag branch refers to a dead (removed) revision in file .file1.\.
- ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
- dotest_fail death2-diff-4 \
- "${testcvs} -q diff -r1.1 -rbranch -N -c file1" \
- "Index: file1
- ===================================================================
- RCS file: file1
- diff -N file1
- \*\*\* file1 ${RFCDATE} [0-9.]*
- --- /dev/null ${RFCDATE_EPOCH}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- - first revision
- --- 0 ----"
- # and in reverse
- dotest_fail death2-diff-4a \
- "${testcvs} -q diff -rbranch -r1.1 -N -c file1" \
- "Index: file1
- ===================================================================
- RCS file: file1
- diff -N file1
- \*\*\* /dev/null ${RFCDATE_EPOCH}
- --- file1 ${RFCDATE} [0-9.]*
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 0 \*\*\*\*
- --- 1 ----
- + first revision"
- dotest_fail death2-diff-5 "${testcvs} -q diff -rtag -c ." \
- "${PROG} diff: file1 no longer exists, no comparison available"
- dotest_fail death2-diff-6 "${testcvs} -q diff -rtag -N -c ." \
- "Index: file1
- ===================================================================
- RCS file: file1
- diff -N file1
- \*\*\* file1 [-a-zA-Z0-9: ]* [0-9.]*
- --- /dev/null ${RFCDATE_EPOCH}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- - first revision
- --- 0 ----"
- # Test rdiff of a dead file.
- dotest death2-rdiff-1 \
- "${testcvs} -q rtag -rbranch rdiff-tag first-dir" ''
- dotest death2-rdiff-2 "${testcvs} -q rdiff -rtag -rbranch first-dir" \
- "Index: first-dir/file1
- diff -c first-dir/file1:1\.1 first-dir/file1:removed
- \*\*\* first-dir/file1:1\.1 [a-zA-Z0-9: ]*
- --- first-dir/file1 [a-zA-Z0-9: ]*
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- - first revision
- --- 0 ----"
- # Readd the file to the branch.
- echo "second revision" > file1
- dotest death2-9 "${testcvs} add file1" \
- "${PROG}"' add: file `file1'\'' will be added on branch `branch'\'' from version 1\.1\.2\.1
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- # Test diff of the added file before it is committed.
- dotest_fail death2-diff-7 "${testcvs} -q diff file1" \
- "${PROG} diff: file1 is a new entry, no comparison available"
- dotest_fail death2-diff-8 "${testcvs} -q diff -N -c file1" \
- "Index: file1
- ===================================================================
- RCS file: file1
- diff -N file1
- \*\*\* /dev/null ${RFCDATE_EPOCH}
- --- file1 ${RFCDATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 0 \*\*\*\*
- --- 1 ----
- ${PLUS} second revision"
- dotest death2-10 "${testcvs} -q commit -m add" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
- done"
- # Delete file4 from the branch
- dotest death2-10a "${testcvs} rm -f file4" \
- "${PROG} remove: scheduling .file4. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest death2-10b "${testcvs} -q ci -m removed" \
- "Removing file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: delete; previous revision: 1\.1
- done"
- # Back to the trunk.
- dotest death2-11 "${testcvs} -q update -A" \
- "[UP] file1
- U file4"
- # Add another file on the trunk.
- echo "first revision" > file2
- dotest death2-12 "${testcvs} add file2" \
- "${PROG}"' add: scheduling file `file2'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest death2-13 "${testcvs} -q commit -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 1\.1
- done"
- # Modify file4 on the trunk.
- echo "new file4 revision" > file4
- dotest death2-13a "${testcvs} -q commit -m mod" \
- "Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: 1\.2; previous revision: 1\.1
- done"
- # Back to the branch.
- # The ``no longer in the repository'' message doesn't really
- # look right to me, but that's what CVS currently prints for
- # this case.
- dotest death2-14 "${testcvs} -q update -r branch" \
- "[UP] file1
- ${PROG} update: file2 is no longer in the repository
- ${PROG} update: file4 is no longer in the repository"
- # Add a file on the branch with the same name.
- echo "branch revision" > file2
- dotest death2-15 "${testcvs} add file2" \
- "${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest death2-16 "${testcvs} -q commit -m add" \
- "Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
- done"
- # Add a new file on the branch.
- echo "first revision" > file3
- dotest death2-17 "${testcvs} add file3" \
- "${PROG}"' add: scheduling file `file3'\'' for addition on branch `branch'\''
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest death2-18 "${testcvs} -q commit -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
- done
- Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- # Test diff of a nonexistent tag
- dotest_fail death2-diff-9 "${testcvs} -q diff -rtag -c file3" \
- "${PROG} diff: tag tag is not in file file3"
- dotest_fail death2-diff-10 "${testcvs} -q diff -rtag -N -c file3" \
- "Index: file3
- ===================================================================
- RCS file: file3
- diff -N file3
- \*\*\* /dev/null ${RFCDATE_EPOCH}
- --- file3 ${RFCDATE} [0-9.]*
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 0 \*\*\*\*
- --- 1 ----
- ${PLUS} first revision"
- dotest_fail death2-diff-11 "${testcvs} -q diff -rtag -c ." \
- "Index: file1
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- retrieving revision 1\.1
- retrieving revision 1\.1\.2\.2
- diff -c -r1\.1 -r1\.1\.2\.2
- \*\*\* file1 ${RFCDATE} [0-9.]*
- --- file1 ${RFCDATE} [0-9.]*
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- ! first revision
- --- 1 ----
- ! second revision
- ${PROG} diff: tag tag is not in file file2
- ${PROG} diff: tag tag is not in file file3
- ${PROG} diff: file4 no longer exists, no comparison available"
- dotest_fail death2-diff-12 "${testcvs} -q diff -rtag -c -N ." \
- "Index: file1
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- retrieving revision 1\.1
- retrieving revision 1\.1\.2\.2
- diff -c -r1\.1 -r1\.1\.2\.2
- \*\*\* file1 ${RFCDATE} [0-9.]*
- --- file1 ${RFCDATE} [0-9.]*
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- ! first revision
- --- 1 ----
- ! second revision
- Index: file2
- ===================================================================
- RCS file: file2
- diff -N file2
- \*\*\* /dev/null ${RFCDATE_EPOCH}
- --- file2 ${RFCDATE} [0-9.]*
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 0 \*\*\*\*
- --- 1 ----
- ${PLUS} branch revision
- Index: file3
- ===================================================================
- RCS file: file3
- diff -N file3
- \*\*\* /dev/null ${RFCDATE_EPOCH}
- --- file3 ${RFCDATE} [0-9.]*
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 0 \*\*\*\*
- --- 1 ----
- ${PLUS} first revision
- Index: file4
- ===================================================================
- RCS file: file4
- diff -N file4
- \*\*\* file4 ${RFCDATE} [0-9.]*
- --- /dev/null ${RFCDATE_EPOCH}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- - file4 first revision
- --- 0 ----"
- # Switch to the nonbranch tag.
- dotest death2-19 "${testcvs} -q update -r tag" \
- "[UP] file1
- ${PROG} update: file2 is no longer in the repository
- ${PROG} update: file3 is no longer in the repository
- U file4"
- dotest_fail death2-20 "test -f file2"
- # Make sure diff only reports appropriate files.
- dotest_fail death2-diff-13 "${testcvs} -q diff -r rdiff-tag" \
- "${PROG} diff: Tag rdiff-tag refers to a dead (removed) revision in file .file1.\.
- ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
- dotest_fail death2-diff-14 "${testcvs} -q diff -r rdiff-tag -c -N" \
- "Index: file1
- ===================================================================
- RCS file: file1
- diff -N file1
- \*\*\* /dev/null ${RFCDATE_EPOCH}
- --- file1 ${RFCDATE} [0-9.]*
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 0 \*\*\*\*
- --- 1 ----
- ${PLUS} first revision"
- # now back to the trunk
- dotest death2-21 "$testcvs -q update -A" \
- '[UP] file1
- U file2
- U file4'
- # test merging with a dead file
- dotest death2-22 "${testcvs} -q co first-dir" \
- "U first-dir/file1
- U first-dir/file2
- U first-dir/file4"
- cd first-dir
- dotest death2-23 "${testcvs} rm -f file4" \
- "${PROG} remove: scheduling .file4. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest death2-24 "${testcvs} -q ci -m removed file4" \
- "Removing file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: delete; previous revision: 1\.2
- done"
- cd ..
- echo "new stuff" >file4
- dotest_fail death2-25 "${testcvs} up file4" \
- "${PROG} update: conflict: file4 is modified but no longer in the repository
- C file4"
- cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
- ;;
- death-rtag)
- # This documents a bug in CVS that prevents rtag from tagging files
- # in the Attic.
- mkdir $CVSROOT_DIRNAME/death-rtag
- dotest death-rtag-init-1 "$testcvs -Q co death-rtag"
- cd death-rtag
- echo "This is the file foo" > foo
- echo "This is the file bar" > bar
- dotest death-rtag-init-2 "$testcvs -Q add foo bar"
- dotest death-rtag-init-3 "$testcvs -Q ci -m 'Add foo and bar.'" \
- "RCS file: $CVSROOT_DIRNAME/death-rtag/bar,v
- done
- Checking in bar;
- $CVSROOT_DIRNAME/death-rtag/bar,v <-- bar
- initial revision: 1\.[0-9]*
- done
- RCS file: $CVSROOT_DIRNAME/death-rtag/foo,v
- done
- Checking in foo;
- $CVSROOT_DIRNAME/death-rtag/foo,v <-- foo
- initial revision: 1\.[0-9]*
- done"
- dotest death-rtag-init-5 "$testcvs -Q tag -b mybranch"
- dotest death-rtag-1 "$testcvs -q rtag -rmybranch willtag death-rtag"
- dotest death-rtag-2 "$testcvs -Q rm -f foo"
- dotest death-rtag-3 "$testcvs -Q ci -m 'Remove foo.'" \
- "Removing foo;
- $CVSROOT_DIRNAME/death-rtag/foo,v <-- foo
- new revision: delete; previous revision: 1\.[0-9]*
- done"
- # commit something on the branch so that the moving tag is visible.
- dotest death-rtag-3.2 "$testcvs -Q up -rmybranch"
- echo some branch content >>foo
- echo some branch content >>bar
- dotest death-rtag-3.3 "$testcvs -Q ci -m 'Change foo.'" \
- "Checking in bar;
- $CVSROOT_DIRNAME/death-rtag/bar,v <-- bar
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in foo;
- $CVSROOT_DIRNAME/death-rtag/Attic/foo,v <-- foo
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- dotest death-rtag-3.4 \
- "$testcvs -q rtag -rmybranch wontmove death-rtag"
- dotest death-rtag-3.5 "$testcvs -q rtag -F wontmove death-rtag"
- cd ..
- # Removing -f below avoids this bug.
- dotest death-rtag-4 "$testcvs -q rtag -frmybranch wonttag death-rtag"
- # When the bug existed, `wonttag' would not have been present in
- # foo,v.
- #
- # A second bug prevented `wontmove' from moving from the branch to
- # the dead revision on the trunk (death-rtag-3.4 & death-rtag-3.5).
- dotest death-rtag-5 "$testcvs -q rlog death-rtag" \
- "
- RCS file: $CVSROOT_DIRNAME/death-rtag/bar,v
- head: 1.[0-9]*
- branch:
- locks: strict
- access list:
- symbolic names:
- wonttag: 1\.1\.2\.1
- wontmove: 1\.1
- willtag: 1\.1
- mybranch: 1\.1.0\.2
- keyword substitution: kv
- $DOTSTAR
- RCS file: $CVSROOT_DIRNAME/death-rtag/Attic/foo,v
- head: 1.[0-9]*
- branch:
- locks: strict
- access list:
- symbolic names:
- wonttag: 1\.1\.2\.1
- wontmove: 1\.2
- willtag: 1\.1
- mybranch: 1\.1.0\.2
- keyword substitution: kv
- $DOTSTAR"
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- rm -r death-rtag
- rm -rf $CVSROOT_DIRNAME/death-rtag
- ;;
- rm-update-message)
- # FIXME
- # local CVS prints a warning message when update notices a missing
- # file and client/server CVS doesn't. These should be identical.
- mkdir rm-update-message; cd rm-update-message
- mkdir $CVSROOT_DIRNAME/rm-update-message
- dotest rm-update-message-setup-1 "$testcvs -q co rm-update-message" ''
- cd rm-update-message
- file=x
- echo >$file
- dotest rm-update-message-setup-2 "$testcvs -q add $file" \
- "${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest rm-update-message-setup-3 "$testcvs -q ci -mcreate $file" \
- "RCS file: $CVSROOT_DIRNAME/rm-update-message/$file,v
- done
- Checking in $file;
- $CVSROOT_DIRNAME/rm-update-message/$file,v <-- $file
- initial revision: 1\.1
- done"
- rm $file
- dotest rm-update-message-1 "$testcvs up $file" \
- "${PROG} update: warning: $file was lost
- U $file"
- cd ../..
- if $keep; then :; else
- rm -rf rm-update-message
- rm -rf $CVSROOT_DIRNAME/rm-update-message
- fi
- ;;
- rmadd)
- # More tests of adding and removing files.
- # In particular ci -r.
- # Other ci -r tests:
- # * editor-9: checking in a modified file,
- # where "ci -r" means a branch.
- # * basica-8a1: checking in a modified file with numeric revision.
- # * basica-8a2: likewise.
- # * keywordlog-4: adding a new file with numeric revision.
- mkdir 1; cd 1
- dotest rmadd-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest rmadd-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- echo first file1 >file1
- dotest rmadd-3 "${testcvs} add file1" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest_fail rmadd-4 "${testcvs} -q ci -r 1.2.2.4 -m add" \
- "${PROG} commit: cannot add file .file1' with revision .1\.2\.2\.4'; must be on trunk
- ${PROG} \[commit aborted\]: correct above errors first!"
- dotest_fail rmadd-5 "${testcvs} -q ci -r 1.2.2 -m add" \
- "${PROG} commit: cannot add file .file1' with revision .1\.2\.2'; must be on trunk
- ${PROG} \[commit aborted\]: correct above errors first!"
- dotest_fail rmadd-6 "${testcvs} -q ci -r mybranch -m add" \
- "${PROG} \[commit aborted\]: no such tag mybranch"
- # The thing with the trailing periods strikes me as a very
- # bizarre behavior, but it would seem to be intentional
- # (see commit.c). It probably could go away....
- dotest rmadd-7 "${testcvs} -q ci -r 7.... -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 7\.1
- done"
- if $remote; then
- # I guess remote doesn't set a sticky tag in this case.
- # Kind of odd, in the sense that rmadd-24a does set one
- # both local and remote.
- dotest_fail rmadd-7a "test -f CVS/Tag"
- echo T7 >CVS/Tag
- else
- dotest rmadd-7a "cat CVS/Tag" "T7"
- fi
- dotest rmadd-8 "${testcvs} -q tag -b mybranch" "T file1"
- dotest rmadd-9 "${testcvs} -q tag mynonbranch" "T file1"
- touch file2
- # The previous "cvs ci -r" set a sticky tag of '7'. Seems a
- # bit odd, and I guess commit.c (findmaxrev) makes '7' sticky
- # tags unnecessary (?). I kind of suspect that it should be
- # saying "sticky tag is not a branch" like keywordlog-4b.
- # Or something.
- dotest rmadd-10 "${testcvs} add file2" \
- "${PROG} add: scheduling file .file2. for addition on branch .7'
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- # As in the previous example, CVS is confused....
- dotest rmadd-11 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 7\.1
- done"
- dotest rmadd-12 "${testcvs} -q update -A" ""
- touch file3
- dotest rmadd-13 "${testcvs} add file3" \
- "${PROG} add: scheduling file .file3. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- # Huh? file2 is not up to date? Seems buggy to me....
- dotest_fail rmadd-14 "${testcvs} -q ci -r mybranch -m add" \
- "${PROG} commit: Up-to-date check failed for .file2'
- ${PROG} \[commit aborted\]: correct above errors first!"
- # Whatever, let's not let file2 distract us....
- dotest rmadd-15 "${testcvs} -q ci -r mybranch -m add file3" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
- done
- Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- touch file4
- dotest rmadd-16 "${testcvs} add file4" \
- "${PROG} add: scheduling file .file4. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- # Same "Up-to-date check" issues as in rmadd-14.
- # The "no such tag" thing is due to the fact that we only
- # update val-tags when the tag is used (might be more of a
- # bug than a feature, I dunno).
- dotest_fail rmadd-17 \
- "${testcvs} -q ci -r mynonbranch -m add file4" \
- "${PROG} \[commit aborted\]: no such tag mynonbranch"
- # Try to make CVS write val-tags.
- dotest rmadd-18 "${testcvs} -q update -p -r mynonbranch file1" \
- "first file1"
- # Oops, -p suppresses writing val-tags (probably a questionable
- # behavior).
- dotest_fail rmadd-19 \
- "${testcvs} -q ci -r mynonbranch -m add file4" \
- "${PROG} \[commit aborted\]: no such tag mynonbranch"
- # Now make CVS write val-tags for real.
- dotest rmadd-20 "$testcvs -q update -r mynonbranch file1" '[UP] file1'
- # Oops - CVS isn't distinguishing between a branch tag and
- # a non-branch tag.
- dotest rmadd-21 \
- "${testcvs} -q ci -r mynonbranch -m add file4" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file4,v
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file4,v <-- file4
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- # OK, we add this one in a vanilla way, but then check in
- # a modification with ci -r and sniff around for sticky tags.
- echo file5 >file5
- dotest rmadd-22 "${testcvs} add file5" \
- "${PROG} add: scheduling file .file5. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- if $remote; then
- # Interesting bug (or missing feature) here. findmaxrev
- # gets the major revision from the Entries. Well, remote
- # doesn't send the entries for files which are not involved.
- dotest rmadd-23r "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
- done
- Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
- initial revision: 1\.1
- done"
- dotest rmadd-23-workaroundr \
- "${testcvs} -q ci -r 7 -m bump-it file5" \
- "Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
- new revision: 7\.1; previous revision: 1\.1
- done"
- else
- dotest rmadd-23 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
- done
- Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
- initial revision: 7\.1
- done"
- fi
- echo change it >file5
- dotest_fail rmadd-24 "${testcvs} -q ci -r 4.8 -m change file5" \
- "Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
- ${PROG} commit: ${CVSROOT_DIRNAME}/first-dir/file5,v: revision 4\.8 too low; must be higher than 7\.1
- ${PROG} commit: could not check in file5"
- dotest rmadd-24a "${testcvs} -q ci -r 8.4 -m change file5" \
- "Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
- new revision: 8\.4; previous revision: 7\.1
- done"
- # I'm not really sure that a sticky tag make sense here.
- # It seems to be longstanding behavior for what that is worth.
- dotest rmadd-25 "${testcvs} status file5" \
- "===================================================================
- File: file5 Status: Up-to-date
- Working revision: 8\.4.*
- Repository revision: 8\.4 ${CVSROOT_DIRNAME}/first-dir/file5,v
- Sticky Tag: 8\.4
- Sticky Date: (none)
- Sticky Options: (none)"
- # now try forced revision with recursion
- mkdir sub
- dotest rmadd-26 "${testcvs} -q add sub" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/sub added to the repository"
- echo hello >sub/subfile
- dotest rmadd-27 "${testcvs} -q add sub/subfile" \
- "${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest rmadd-28 "${testcvs} -q ci -m. sub" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v
- done
- Checking in sub/subfile;
- ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v <-- subfile
- initial revision: 1\.1
- done"
- # lose the branch
- dotest rmadd-29 "$testcvs -q up -A" \
- "[UP] file1
- $PROG update: file3 is no longer in the repository
- $PROG update: file4 is no longer in the repository"
- # -f disables recursion
- dotest rmadd-30 "${testcvs} -q ci -f -r9 -m." \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 9\.1; previous revision: 7\.1
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: 9\.1; previous revision: 7\.1
- done
- Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
- new revision: 9\.1; previous revision: 8\.4
- done"
- # add -R to force recursion
- dotest rmadd-31 "${testcvs} -q ci -f -r9 -R -m." \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 9\.2; previous revision: 9\.1
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: 9\.2; previous revision: 9\.1
- done
- Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
- new revision: 9\.2; previous revision: 9\.1
- done
- Checking in sub/subfile;
- ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v <-- subfile
- new revision: 9\.1; previous revision: 1\.1
- done"
- if $remote; then
- # as noted above, remote doesn't set a sticky tag
- :
- else
- dotest rmadd-32 "cat CVS/Tag" "T9"
- dotest rmadd-33 "cat sub/CVS/Tag" "T9"
- fi
- cd ../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- rmadd2)
- # Tests of undoing commits, including in the presence of
- # adding and removing files. See join for a list of -j tests.
- mkdir 1; cd 1
- dotest rmadd2-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest rmadd2-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- echo 'initial contents' >file1
- dotest rmadd2-3 "${testcvs} add file1" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest rmadd2-4 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- dotest rmadd2-4a "${testcvs} -Q tag tagone" ""
- dotest rmadd2-5 "${testcvs} rm -f file1" \
- "${PROG} remove: scheduling .file1. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest rmadd2-6 "${testcvs} -q ci -m remove" \
- "Removing file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done"
- dotest rmadd2-7 "${testcvs} -q update -j 1.2 -j 1.1 file1" "U file1"
- dotest rmadd2-8 "${testcvs} -q ci -m readd" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.3; previous revision: 1\.2
- done"
- echo 'new contents' >file1
- dotest rmadd2-9 "${testcvs} -q ci -m modify" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.4; previous revision: 1\.3
- done"
- dotest rmadd2-10 "${testcvs} -q update -j 1.4 -j 1.3 file1" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- retrieving revision 1\.4
- retrieving revision 1\.3
- Merging differences between 1\.4 and 1\.3 into file1"
- dotest rmadd2-11 "${testcvs} -q ci -m undo" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.5; previous revision: 1\.4
- done"
- dotest rmadd2-12 "cat file1" "initial contents"
- dotest rmadd2-13 "${testcvs} -q update -p -r 1.3" "initial contents"
- # Hmm, might be a bit odd that this works even if 1.3 is not
- # the head.
- dotest rmadd2-14 "${testcvs} -q update -j 1.3 -j 1.2 file1" \
- "${PROG} update: scheduling file1 for removal"
- # Check that -p can get arbitrary revisions of a removed file
- dotest rmadd2-14a "${testcvs} -q update -p" "initial contents"
- dotest rmadd2-14b "${testcvs} -q update -p -r 1.5" "initial contents"
- dotest rmadd2-14c "${testcvs} -q update -p -r 1.3" "initial contents"
- dotest rmadd2-15 "${testcvs} -q ci -m re-remove" \
- "Removing file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: delete; previous revision: 1\.5
- done"
- dotest rmadd2-16 "${testcvs} log -h file1" "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
- Working file: file1
- head: 1\.6
- branch:
- locks: strict
- access list:
- symbolic names:
- tagone: 1\.1
- keyword substitution: kv
- total revisions: 6
- ============================================================================="
- dotest rmadd2-17 "${testcvs} status -v file1" \
- "===================================================================
- File: no file file1 Status: Up-to-date
- Working revision: No entry for file1
- Repository revision: 1\.6 ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
- Existing Tags:
- tagone (revision: 1.1)"
- cd ../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- rmadd3)
- # This test demonstrates that CVS notices that file1 exists rather
- # that deleting or writing over it after:
- #
- # cvs remove -f file1; touch file1; cvs add file1.
- #
- # According to the manual, this should work for:
- #
- # rm file1; cvs remove file1; cvs add file1
- #
- # but in past version of CVS, new content in file1 would be
- # erroneously deleted when file1 reappeared between the remove and
- # the add.
- #
- # Later versions of CVS would refuse to perform the add, but still
- # allow a subsequent local commit to erase the file from the
- # workspace, possibly losing data.
- mkdir 1; cd 1
- dotest rmadd3-init1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest rmadd3-init2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- echo initial content for file1 >file1
- dotest rmadd3-init3 "${testcvs} add file1" \
- "${PROG} add: scheduling file \`file1' for addition
- ${PROG} add: use '${PROG} commit' to add this file permanently"
- dotest rmadd3-init4 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- # Here begins the guts of this test, as detailed above.
- dotest rmadd3-1 "${testcvs} rm -f file1" \
- "${PROG} remove: scheduling \`file1' for removal
- ${PROG} remove: use '${PROG} commit' to remove this file permanently"
- # Now recreate the file:
- echo desired future contents for file1 >file1
- # And attempt to resurrect it at the same time:
- dotest_fail rmadd3-2 "${testcvs} add file1" \
- "${PROG} add: file1 should be removed and is still there (or is back again)"
- # Now prove that commit knows that it shouldn't erase files.
- dotest_fail rmadd3-3 "${testcvs} -q ci -m." \
- "$PROG commit: \`file1' should be removed and is still there (or is back again)
- $PROG \[commit aborted\]: correct above errors first!"
- # Then these should pass too:
- dotest rmadd3-4 "test -f file1"
- dotest rmadd3-5 "cat file1" "desired future contents for file1"
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- resurrection)
- # This test tests a few file resurrection scenarios.
- mkdir 1; cd 1
- dotest resurrection-init1 "$testcvs -q co -l ." ''
- mkdir first-dir
- dotest resurrection-init2 "$testcvs add first-dir" \
- "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
- cd first-dir
- echo initial content for file1 >file1
- dotest resurrection-init3 "$testcvs add file1" \
- "$PROG add: scheduling file \`file1' for addition
- $PROG add: use '$PROG commit' to add this file permanently"
- dotest resurrection-init4 "$testcvs -q ci -m add" \
- "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
- done
- Checking in file1;
- $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- dotest resurrection-init5 "$testcvs -Q rm -f file1"
- # The first test is that `cvs add' will resurrect a file before its
- # removal has been committed.
- dotest_sort resurrection-1 "$testcvs add file1" \
- "U file1
- $PROG add: file1, version 1\.1, resurrected"
- dotest resurrection-2 "$testcvs -Q diff file1" ""
- dotest resurrection-init6 "$testcvs -Q tag -b resurrection"
- dotest resurrection-init7 "$testcvs -Q rm -f file1"
- dotest resurrection-init8 "$testcvs -Q ci -mrm" \
- "Removing file1;
- $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done"
- # The next test is that CVS will resurrect a committed removal.
- dotest_sort resurrection-3 "$testcvs add file1" \
- "U file1
- $PROG add: Re-adding file \`file1' (in place of dead revision 1\.2)\.
- $PROG add: Resurrecting file \`file1' from revision 1\.1\.
- $PROG add: use 'cvs commit' to add this file permanently"
- dotest resurrection-4 "$testcvs -q diff -r1.1 file1" ""
- dotest resurrection-5 "$testcvs -q ci -mreadd" \
- "Checking in file1;
- $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
- new revision: 1\.3; previous revision: 1\.2
- done"
- dotest resurrection-init9 "$testcvs -Q up -rresurrection"
- dotest resurrection-init10 "$testcvs -Q rm -f file1"
- dotest resurrection-init11 "$testcvs -Q ci -mrm-on-resurrection" \
- "Removing file1;
- $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done"
- # The next test is that CVS will resurrect a committed removal to a
- # branch.
- dotest_sort resurrection-6 "$testcvs add file1" \
- "U file1
- $PROG add: Resurrecting file \`file1' from revision 1\.1\.
- $PROG add: file \`file1' will be added on branch \`resurrection' from version 1\.1\.2\.1
- $PROG add: use 'cvs commit' to add this file permanently"
- dotest resurrection-7 "$testcvs -Q diff -r1.1 file1" ""
- dotest resurrection-8 "$testcvs -q ci -mreadd" \
- "Checking in file1;
- $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
- done"
- # The next few tests verify that an attempted resurrection of a file
- # with no previous revision on the trunk fails.
- touch file2
- dotest resurrection-9 "$testcvs -Q add file2"
- dotest resurrection-10 "$testcvs -Q ci -mnew-file2" \
- "RCS file: $CVSROOT_DIRNAME/first-dir/Attic/file2,v
- done
- Checking in file2;
- $CVSROOT_DIRNAME/first-dir/Attic/file2,v <-- file2
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- dotest resurrection-11 "$testcvs -Q up -A"
- # This command once caused an assertion failure.
- dotest resurrection-12 "$testcvs add file2" \
- "$PROG add: File \`file2' has no previous revision to resurrect\."
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- cd ../..
- rm -r 1
- rm -rf $CVSROOT_DIRNAME/first-dir
- ;;
- dirs)
- # Tests related to removing and adding directories.
- # See also:
- # conflicts (especially dir1 in conflicts-130): What happens if
- # directory exists in repository and a non-CVS-controlled
- # directory in the working directory?
- # conflicts3-15. More cases, especially where CVS directory
- # exists but without CVS/Repository and friends.
- # conflicts3-22. Similar to conflicts-130 but there is a file
- # in the directory.
- # dirs2. Sort of similar to conflicts3-22 but somewhat different.
- mkdir imp-dir; cd imp-dir
- echo file1 >file1
- mkdir sdir
- echo sfile >sdir/sfile
- dotest_sort dirs-1 \
- "${testcvs} import -m import-it dir1 vend rel" "
- N dir1/file1
- N dir1/sdir/sfile
- No conflicts created by this import
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/dir1/sdir"
- cd ..
- mkdir 1; cd 1
- dotest dirs-2 "${testcvs} -Q co dir1" ""
- # Various CVS administrators are in the habit of removing
- # the repository directory for things they don't want any
- # more. I've even been known to do it myself (on rare
- # occasions). Not the usual recommended practice, but we want
- # to try to come up with some kind of reasonable/documented/sensible
- # behavior.
- rm -rf ${CVSROOT_DIRNAME}/dir1/sdir
- dotest dirs-3 "${testcvs} update" \
- "${PROG} update: Updating dir1
- ${PROG} update: Updating dir1/sdir
- ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
- ${PROG} update: skipping directory dir1/sdir"
- dotest dirs-3a "${testcvs} update -d" \
- "${PROG} update*: Updating dir1
- ${PROG} update: Updating dir1/sdir
- ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
- ${PROG} update: skipping directory dir1/sdir"
- # If we say "yes", then CVS gives errors about not being able to
- # create lock files.
- # The fact that it says "skipping directory " rather than
- # "skipping directory dir1/sdir" is some kind of bug.
- dotest dirs-4 "echo no | ${testcvs} release -d dir1/sdir" \
- "${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
- ${PROG} update: skipping directory
- You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .dir1/sdir': .. .release' aborted by user choice."
- # OK, if "cvs release" won't help, we'll try it the other way...
- rm -r dir1/sdir
- dotest dirs-5 "cat dir1/CVS/Entries" \
- "/file1/1.1.1.1/[a-zA-Z0-9 :]*//
- D/sdir////"
- dotest dirs-6 "${testcvs} update" "${PROG} update: Updating dir1"
- dotest dirs-7 "cat dir1/CVS/Entries" \
- "/file1/1.1.1.1/[a-zA-Z0-9 :]*//
- D/sdir////"
- dotest dirs-8 "${testcvs} update -d dir1" \
- "${PROG} update: Updating dir1"
- cd ..
- rm -r imp-dir 1
- # clean up our repositories
- rm -rf ${CVSROOT_DIRNAME}/dir1
- ;;
- dirs2)
- # See "dirs" for a list of tests involving adding and
- # removing directories.
- mkdir 1; cd 1
- dotest dirs2-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest dirs2-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- mkdir sdir
- dotest dirs2-3 "${testcvs} add sdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
- touch sdir/file1
- dotest dirs2-4 "${testcvs} add sdir/file1" \
- "${PROG} add: scheduling file .sdir/file1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest dirs2-5 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v
- done
- Checking in sdir/file1;
- ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v <-- file1
- initial revision: 1\.1
- done"
- rm -r sdir/CVS
- if $remote; then
- # This is just like conflicts3-23
- dotest_fail dirs2-6 "${testcvs} update -d" \
- "${QUESTION} sdir
- ${PROG} update: Updating \.
- ${PROG} update: Updating sdir
- ${PROG} update: move away sdir/file1; it is in the way
- C sdir/file1"
- rm sdir/file1
- rm -r sdir/CVS
- # This is where things are not just like conflicts3-23
- dotest dirs2-7 "${testcvs} update -d" \
- "${QUESTION} sdir
- ${PROG} update: Updating \.
- ${PROG} update: Updating sdir
- U sdir/file1"
- else
- dotest dirs2-6 "${testcvs} update -d" \
- "${PROG} update: Updating \.
- ${QUESTION} sdir"
- rm sdir/file1
- dotest dirs2-7 "${testcvs} update -d" \
- "${PROG} update: Updating \.
- ${QUESTION} sdir"
- fi
- cd ../..
- # Now, the same thing (more or less) on a branch.
- mkdir 2; cd 2
- dotest dirs2-8 "${testcvs} -q co first-dir" 'U first-dir/sdir/file1'
- cd first-dir
- dotest dirs2-9 "${testcvs} -q tag -b br" "T sdir/file1"
- rm -r sdir/CVS
- if $remote; then
- # Cute little quirk of val-tags; if we don't recurse into
- # the directories where the tag is defined, val-tags won't
- # get updated.
- dotest_fail dirs2-10 "${testcvs} update -d -r br" \
- "${QUESTION} sdir
- ${PROG} \[update aborted\]: no such tag br"
- dotest dirs2-10ar \
- "${testcvs} -q rdiff -u -r 1.1 -r br first-dir/sdir/file1"
- dotest_fail dirs2-10-again "${testcvs} update -d -r br" \
- "${QUESTION} sdir
- ${PROG} update: Updating \.
- ${PROG} update: Updating sdir
- ${PROG} update: move away sdir/file1; it is in the way
- C sdir/file1"
- else
- dotest_fail dirs2-10 "${testcvs} update -d -r br" \
- "${PROG} update: in directory sdir:
- ${PROG} \[update aborted\]: there is no version here; do '${PROG} checkout' first"
- fi
- cd ../..
- # OK, the above tests make the situation somewhat harder
- # than it might be, in the sense that they actually have a
- # file which is alive on the branch we are updating. Let's
- # try it where it is just a directory where all the files
- # have been removed.
- mkdir 3; cd 3
- dotest dirs2-11 "${testcvs} -q co -r br first-dir" \
- "U first-dir/sdir/file1"
- cd first-dir
- # Hmm, this doesn't mention the branch like add does. That's
- # an odd non-orthogonality.
- dotest dirs2-12 "${testcvs} rm -f sdir/file1" \
- "${PROG} remove: scheduling .sdir/file1. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest dirs2-13 "${testcvs} -q ci -m remove" \
- "Removing sdir/file1;
- ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done"
- cd ../../2/first-dir
- if $remote; then
- dotest dirs2-14 "${testcvs} update -d -r br" \
- "${QUESTION} sdir/file1
- ${PROG} update: Updating \.
- ${PROG} update: Updating sdir"
- else
- dotest dirs2-14 "${testcvs} update -d -r br" \
- "${PROG} update: Updating \.
- ${QUESTION} sdir"
- fi
- cd ../..
- rm -r 1 2 3
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- branches)
- # More branch tests, including branches off of branches
- mkdir ${CVSROOT_DIRNAME}/first-dir
- dotest branches-1 "${testcvs} -q co first-dir" ''
- cd first-dir
- echo 1:ancest >file1
- echo 2:ancest >file2
- echo 3:ancest >file3
- echo 4:trunk-1 >file4
- dotest branches-2 "${testcvs} add file1 file2 file3 file4" \
- "${PROG}"' add: scheduling file `file1'\'' for addition
- '"${PROG}"' add: scheduling file `file2'\'' for addition
- '"${PROG}"' add: scheduling file `file3'\'' for addition
- '"${PROG}"' add: scheduling file `file4'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
- dotest branches-2a "${testcvs} -n -q ci -m dont-commit" ""
- dotest_lit branches-3 "${testcvs} -q ci -m add-it" <<HERE
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
- done
- Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- initial revision: 1.1
- done
- HERE
- echo 4:trunk-2 >file4
- dotest branches-3.2 "${testcvs} -q ci -m trunk-before-branch" \
- "Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: 1\.2; previous revision: 1\.1
- done"
- # The "cvs log file4" in test branches-14.3 will test that we
- # didn't really add the tag.
- dotest branches-3.3 "${testcvs} -qn tag dont-tag" \
- "T file1
- T file2
- T file3
- T file4"
- # Modify this file before branching, to deal with the case where
- # someone is hacking along, says "oops, I should be doing this on
- # a branch", and only then creates the branch.
- echo 1:br1 >file1
- dotest branches-4 "${testcvs} tag -b br1" "${PROG}"' tag: Tagging \.
- T file1
- T file2
- T file3
- T file4'
- dotest branches-5 "$testcvs update -r br1" \
- "$PROG update: Updating \.
- M file1
- [UP] file2
- [UP] file3
- [UP] file4"
- echo 2:br1 >file2
- echo 4:br1 >file4
- dotest branches-6 "${testcvs} -q ci -m modify" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: 1\.2\.2\.1; previous revision: 1\.2
- done"
- dotest branches-7 "${testcvs} -q tag -b brbr" 'T file1
- T file2
- T file3
- T file4'
- dotest branches-8 "$testcvs -q update -r brbr" \
- '[UP] file1
- [UP] file2
- [UP] file3
- [UP] file4'
- echo 1:brbr >file1
- echo 4:brbr >file4
- dotest branches-9 "${testcvs} -q ci -m modify" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.1\.2\.1; previous revision: 1\.1\.2\.1
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: 1\.2\.2\.1\.2\.1; previous revision: 1\.2\.2\.1
- done"
- dotest branches-10 "cat file1 file2 file3 file4" '1:brbr
- 2:br1
- 3:ancest
- 4:brbr'
- dotest branches-11 "$testcvs -q update -r br1" \
- 'U file1
- [UP] file2
- [UP] file3
- U file4'
- dotest branches-12 "cat file1 file2 file3 file4" '1:br1
- 2:br1
- 3:ancest
- 4:br1'
- echo 4:br1-2 >file4
- dotest branches-12.2 "${testcvs} -q ci -m change-on-br1" \
- "Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
- done"
- dotest branches-13 "${testcvs} -q update -A" \
- 'U file1
- U file2
- [UP] file3
- U file4'
- dotest branches-14 "cat file1 file2 file3 file4" '1:ancest
- 2:ancest
- 3:ancest
- 4:trunk-2'
- echo 4:trunk-3 >file4
- dotest branches-14.2 \
- "${testcvs} -q ci -m trunk-change-after-branch" \
- "Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: 1\.3; previous revision: 1\.2
- done"
- dotest branches-14.3 "${testcvs} log file4" \
- "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
- Working file: file4
- head: 1\.3
- branch:
- locks: strict
- access list:
- symbolic names:
- brbr: 1\.2\.2\.1\.0\.2
- br1: 1\.2\.0\.2
- keyword substitution: kv
- total revisions: 6; selected revisions: 6
- description:
- ----------------------------
- revision 1\.3
- date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
- trunk-change-after-branch
- ----------------------------
- revision 1\.2
- date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
- branches: 1\.2\.2;
- trunk-before-branch
- ----------------------------
- revision 1\.1
- date: [0-9/: ]*; author: ${username}; state: Exp;
- add-it
- ----------------------------
- revision 1\.2\.2\.2
- date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
- change-on-br1
- ----------------------------
- revision 1\.2\.2\.1
- date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
- branches: 1\.2\.2\.1\.2;
- modify
- ----------------------------
- revision 1\.2\.2\.1\.2\.1
- date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
- modify
- ============================================================================="
- dotest_fail branches-14.4 \
- "${testcvs} diff -c -r 1.1 -r 1.3 file4" \
- "Index: file4
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
- retrieving revision 1\.1
- retrieving revision 1\.3
- diff -c -r1\.1 -r1\.3
- \*\*\* file4 ${RFCDATE} 1\.1
- --- file4 ${RFCDATE} 1\.3
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- ! 4:trunk-1
- --- 1 ----
- ! 4:trunk-3"
- dotest_fail branches-14.5 \
- "${testcvs} diff -c -r 1.1 -r 1.2.2.1 file4" \
- "Index: file4
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
- retrieving revision 1\.1
- retrieving revision 1\.2\.2\.1
- diff -c -r1\.1 -r1\.2\.2\.1
- \*\*\* file4 ${RFCDATE} 1\.1
- --- file4 ${RFCDATE} 1\.2\.2\.1
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- \*\*\* 1 \*\*\*\*
- ! 4:trunk-1
- --- 1 ----
- ! 4:br1"
- dotest branches-15 \
- "${testcvs} update -j 1.1.2.1 -j 1.1.2.1.2.1 file1" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- retrieving revision 1\.1\.2\.1
- retrieving revision 1\.1\.2\.1\.2\.1
- Merging differences between 1\.1\.2\.1 and 1\.1\.2\.1\.2\.1 into file1
- rcsmerge: warning: conflicts during merge"
- dotest branches-16 "cat file1" '<<<<<<< file1
- 1:ancest
- [=]======
- 1:brbr
- [>]>>>>>> 1\.1\.2\.1\.2\.1'
- dotest branches-o1 "${testcvs} -q admin -o ::brbr" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
- done"
- cd ..
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -r first-dir
- ;;
- branches2)
- # More branch tests.
- # Test that when updating a new subdirectory in a directory
- # which was checked out on a branch, the new subdirectory is
- # created on the appropriate branch. Test this when joining
- # as well.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir trunk; cd trunk
- # Create a file.
- dotest branches2-1 "${testcvs} -q co first-dir"
- cd first-dir
- echo "file1 first revision" > file1
- dotest branches2-2 "${testcvs} add file1" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest branches2-3 "${testcvs} commit -m add file1" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- # Tag the file.
- dotest branches2-4 "${testcvs} -q tag tag1" 'T file1'
- # Make two branches.
- dotest branches2-5 "${testcvs} -q rtag -b -r tag1 b1 first-dir" ''
- dotest branches2-6 "${testcvs} -q rtag -b -r tag1 b2 first-dir" ''
- # Create some files and a subdirectory on branch b1.
- cd ../..
- mkdir b1; cd b1
- dotest branches2-7 "${testcvs} -q co -r b1 first-dir" \
- "U first-dir/file1"
- cd first-dir
- echo "file2 first revision" > file2
- dotest branches2-8 "${testcvs} add file2" \
- "${PROG}"' add: scheduling file `file2'\'' for addition on branch `b1'\''
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- mkdir dir1
- dotest branches2-9 "${testcvs} add dir1" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository
- --> Using per-directory sticky tag "'`'"b1'"
- echo "file3 first revision" > dir1/file3
- dotest branches2-10 "${testcvs} add dir1/file3" \
- "${PROG}"' add: scheduling file `dir1/file3'\'' for addition on branch `b1'\''
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest branches2-11 "${testcvs} -q ci -madd ." \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v <-- file2
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
- done
- Checking in dir1/file3;
- ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v <-- file3
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- # Check out the second branch, and update the working
- # directory to the first branch, to make sure the right
- # happens with dir1.
- cd ../..
- mkdir b2; cd b2
- dotest branches2-12 "${testcvs} -q co -r b2 first-dir" \
- 'U first-dir/file1'
- cd first-dir
- dotest branches2-13 "${testcvs} update -d -r b1 dir1" \
- "${PROG} update: Updating dir1
- U dir1/file3"
- dotest branches2-14 "${testcvs} -q status" \
- "===================================================================
- File: file1 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
- Sticky Tag: b2 (branch: 1\.1\.4)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file3 Status: Up-to-date
- Working revision: 1\.1\.2\.1.*
- Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
- Sticky Tag: b1 (branch: 1\.1\.2)
- Sticky Date: (none)
- Sticky Options: (none)"
- # FIXME: Just clobbering the directory like this is a bit
- # tacky, although people generally expect it to work. Maybe
- # we should release it instead. We do it a few other places
- # below as well.
- rm -r dir1
- dotest branches2-15 "${testcvs} update -d -j b1 dir1" \
- "${PROG} update: Updating dir1
- U dir1/file3"
- # FIXCVS: The `No revision control file' stuff seems to be
- # CVS's way of telling us that we're adding the file on a
- # branch, and the file is not on that branch yet. This
- # should be nicer.
- dotest branches2-16 "${testcvs} -q status" \
- "===================================================================
- File: file1 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
- Sticky Tag: b2 (branch: 1\.1\.4)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file3 Status: Locally Added
- Working revision: New file!
- Repository revision: No revision control file
- Sticky Tag: b2 - MISSING from RCS file!
- Sticky Date: (none)
- Sticky Options: (none)"
- cd ../../trunk/first-dir
- dotest branches2-17 "${testcvs} update -d -P dir1" \
- "${PROG} update: Updating dir1"
- dotest_fail branches2-18 "test -d dir1"
- dotest branches2-19 "${testcvs} update -d -P -r b1 dir1" \
- "${PROG} update: Updating dir1
- U dir1/file3"
- dotest branches2-20 "${testcvs} -q status" \
- "===================================================================
- File: file1 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file3 Status: Up-to-date
- Working revision: 1\.1\.2\.1.*
- Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
- Sticky Tag: b1 (branch: 1\.1\.2)
- Sticky Date: (none)
- Sticky Options: (none)"
- rm -r dir1
- dotest branches2-21 "${testcvs} update -d -P -j b1 dir1" \
- "${PROG} update: Updating dir1
- U dir1/file3"
- dotest branches2-22 "${testcvs} -q status" \
- "===================================================================
- File: file1 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)
- ===================================================================
- File: file3 Status: Locally Added
- Working revision: New file!
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- cd ../..
- rm -r b1 b2
- # Check out branch b1 twice. Crate a new directory in one
- # working directory, then do a cvs update in the other
- # working directory and see if the tags are right.
- mkdir b1a
- mkdir b1b
- cd b1b
- dotest branches2-23 "${testcvs} -q co -r b1 first-dir" \
- 'U first-dir/file1
- U first-dir/file2
- U first-dir/dir1/file3'
- cd ../b1a
- dotest branches2-24 "${testcvs} -q co -r b1 first-dir" \
- 'U first-dir/file1
- U first-dir/file2
- U first-dir/dir1/file3'
- cd first-dir
- mkdir dir2
- dotest branches2-25 "${testcvs} add dir2" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/dir2 added to the repository
- --> Using per-directory sticky tag "'`'"b1'"
- echo "file4 first revision" > dir2/file4
- dotest branches2-26 "${testcvs} add dir2/file4" \
- "${PROG}"' add: scheduling file `dir2/file4'\'' for addition on branch `b1'\''
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest branches2-27 "${testcvs} -q commit -madd" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
- done
- Checking in dir2/file4;
- ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v <-- file4
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- cd ../../b1b/first-dir
- dotest branches2-28 "${testcvs} update -d dir2" \
- "${PROG} update: Updating dir2
- U dir2/file4"
- cd dir2
- dotest branches2-29 "${testcvs} -q status" \
- "===================================================================
- File: file4 Status: Up-to-date
- Working revision: 1\.1\.2\.1.*
- Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
- Sticky Tag: b1 (branch: 1\.1\.2)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest branches2-30 "cat CVS/Tag" 'Tb1'
- # Test update -A on a subdirectory
- cd ..
- rm -r dir2
- dotest branches2-31 "${testcvs} update -A -d dir2" \
- "${PROG} update: Updating dir2"
- cd dir2
- dotest branches2-32 "${testcvs} -q status" ''
- dotest_fail branches2-33 "test -f CVS/Tag"
- # Add a file on the trunk.
- echo "file5 first revision" > file5
- dotest branches2-34 "${testcvs} add file5" \
- "${PROG}"' add: scheduling file `file5'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest branches2-35 "${testcvs} -q commit -madd" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
- done
- Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v <-- file5
- initial revision: 1\.1
- done"
- cd ../../../trunk/first-dir
- dotest branches2-36 "${testcvs} -q update -d dir2" 'U dir2/file5'
- cd dir2
- dotest branches2-37 "${testcvs} -q status" \
- "===================================================================
- File: file5 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest_fail branches2-38 "test -f CVS/status"
- cd ../../..
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -r trunk b1a b1b
- ;;
- tagc)
- # Test the tag -c option.
- mkdir 1; cd 1
- dotest tagc-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest tagc-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- touch file1 file2
- dotest tagc-3 "${testcvs} add file1 file2" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: scheduling file .file2. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest tagc-4 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 1\.1
- done"
- dotest tagc-5 "${testcvs} -q tag -c tag1" \
- "T file1
- T file2"
- touch file1 file2
- dotest tagc-6 "${testcvs} -q tag -c tag2" \
- "T file1
- T file2"
- # Avoid timestamp granularity bugs (FIXME: CVS should be
- # doing the sleep, right?).
- sleep 1
- echo myedit >>file1
- dotest tagc-6a "${testcvs} rm -f file2" \
- "${PROG} remove: scheduling .file2. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- touch file3
- dotest tagc-6b "${testcvs} add file3" \
- "${PROG} add: scheduling file .file3. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest_fail tagc-7 "${testcvs} -q tag -c tag3" \
- "${PROG} tag: file1 is locally modified
- ${PROG} tag: file2 is locally modified
- ${PROG} tag: file3 is locally modified
- ${PROG} \[tag aborted\]: correct the above errors first!"
- cd ../..
- mkdir 2
- cd 2
- dotest tagc-8 "${testcvs} -q co first-dir" \
- "U first-dir/file1
- U first-dir/file2"
- cd ../1/first-dir
- dotest tagc-9 "${testcvs} -q ci -m modify" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.2; previous revision: 1\.1
- done
- Removing file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: delete; previous revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
- done
- Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- initial revision: 1\.1
- done"
- cd ../../2/first-dir
- dotest tagc-10 "${testcvs} -q tag -c tag4" \
- "${PROG} tag: file2 is no longer in the repository
- T file1
- T file2"
- cd ../..
- rm -r 1 2
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- update-p)
- # Make sure `cvs update -p -rT FILE' works from a branch when
- # FILE is already on the trunk and is being added to that branch.
- mkdir 1; cd 1
- module=x
- echo > unused-file
- # Create the module.
- dotest update-p-1 \
- "$testcvs -Q import -m. $module X Y" ''
- file=F
- # Check it out and tag it.
- dotest update-p-2 "$testcvs -Q co $module" ''
- cd $module
- dotest update-p-3 "$testcvs -Q tag -b B" ''
- echo v1 > $file
- dotest update-p-4 "$testcvs -Q add $file" ''
- dotest update-p-5 "$testcvs -Q ci -m. $file" \
- "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
- done
- Checking in $file;
- ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
- initial revision: 1\.1
- done"
- dotest update-p-6 "$testcvs -Q tag T $file" ''
- dotest update-p-7 "$testcvs -Q update -rB" ''
- # This merge effectively adds file F on branch B.
- dotest update-p-8 "$testcvs -Q update -jT" ''
- # Before the fix that prompted the addition of this test,
- # the following command would fail with this diagnostic:
- # cvs update: conflict: F created independently by second party
- dotest update-p-9 "$testcvs update -p -rT $file" \
- "===================================================================
- Checking out $file
- RCS: ${CVSROOT_DIRNAME}/$module/$file,v
- VERS: 1\.1
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- v1"
- # Repeat the above, but with $file removed.
- # This exercises a slightly different code path.
- rm $file
- # Before the fix that prompted the addition of this test,
- # the following command would fail with this diagnostic:
- # cvs update: warning: new-born F has disappeared
- dotest update-p-10 "$testcvs update -p -rT $file" \
- "===================================================================
- Checking out $file
- RCS: ${CVSROOT_DIRNAME}/$module/$file,v
- VERS: 1\.1
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- v1"
- # Exercise yet another code path:
- # the one that involves reviving a `dead' file.
- # And a little more, for good measure...
- touch new
- dotest update-p-a1 "$testcvs -Q add new" ''
- dotest update-p-a2 "$testcvs -Q update -p new" ''
- dotest update-p-a3 "$testcvs -Q rm -f new" ''
- # Both an update -A, *and* the following update are required
- # to return to the state of being on the trunk with a $file
- # that we can then remove.
- dotest update-p-undead-0 "$testcvs update -A" \
- "$PROG update: Updating \.
- $PROG update: warning: new-born $file has disappeared
- [UP] unused-file"
- dotest update-p-undead-1 "$testcvs update" \
- "${PROG} update: Updating \.
- U $file"
- dotest update-p-undead-2 "$testcvs -Q update -p -rT $file" v1
- dotest update-p-undead-3 "$testcvs -Q rm -f $file" ''
- dotest update-p-undead-4 "$testcvs -Q update -p -rT $file" v1
- dotest update-p-undead-5 "$testcvs -Q ci -m. $file" \
- "Removing $file;
- ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
- new revision: delete; previous revision: 1\.1
- done"
- dotest update-p-undead-6 "$testcvs -Q update -p -rT $file" v1
- echo v2 > $file
- dotest update-p-undead-7 "$testcvs -Q update -p -rT $file" v1
- dotest update-p-undead-8 "$testcvs add $file" \
- "${PROG} add: Re-adding file .$file. (in place of dead revision 1\.2)\.
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest update-p-undead-9 "$testcvs -Q update -p -rT $file" v1
- cd ../..
- rm -rf 1
- rm -rf ${CVSROOT_DIRNAME}/$module
- ;;
- tagf)
- # More tagging tests, including using tag -F -B to convert a
- # branch tag to a regular tag and recovering thereof.
- # Setup; check in first-dir/file1
- mkdir 1; cd 1
- dotest tagf-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest tagf-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- touch file1 file2
- dotest tagf-3 "${testcvs} add file1 file2" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: scheduling file .file2. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest tagf-4 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 1\.1
- done"
- # Now create a branch and commit a revision there.
- dotest tagf-5 "${testcvs} -q tag -b br" "T file1
- T file2"
- dotest tagf-6 "$testcvs -q update -r br" \
- 'U file1
- U file2'
- echo brmod >> file1
- echo brmod >> file2
- dotest tagf-7 "${testcvs} -q ci -m modify" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- # Here we try to make it a non-branch tag, but will
- # succeed in getting only warnings, even with -F
- # because converting a branch tag to non-branch
- # is potentially catastrophic.
- dotest tagf-8a "${testcvs} -q tag -F br" \
- "${PROG} tag: file1: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\\.2\.1\.
- ${PROG} tag: file2: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\.2\.1\."
- # however, if we *really* are sure we want to move a branch tag,
- # "-F -B" will do the trick
- dotest tagf-8 "${testcvs} -q tag -F -B br" "T file1
- T file2"
- echo moremod >> file1
- echo moremod >> file2
- dotest tagf-9 "${testcvs} -q status -v file1" \
- "===================================================================
- File: file1 Status: Locally Modified
- Working revision: 1\.1\.2\.1.*
- Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
- Sticky Tag: br (revision: 1\.1\.2\.1)
- Sticky Date: (none)
- Sticky Options: (none)
- Existing Tags:
- br (revision: 1\.1\.2\.1)"
- # Now, how do we recover?
- dotest tagf-10 "${testcvs} -q tag -d br" "D file1
- D file2"
- # This creates a new branch, 1.1.4. See the code in RCS_magicrev
- # which will notice that there is a (non-magic) 1.1.2 and thus
- # skip that number.
- dotest tagf-11 "${testcvs} -q tag -r 1.1 -b br file1" "T file1"
- # Fix it with admin -n (cf admin-18, admin-26-4).
- dotest tagf-12 "${testcvs} -q admin -nbr:1.1.2 file2" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done"
- # Another variation on the file2 test would be to use two working
- # directories so that the update -r br would need to
- # a merge to get from 1.1.2.1 to the head of the 1.1.2 branch.
- dotest tagf-13 "${testcvs} -q update -r br" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- retrieving revision 1\.1\.2\.1
- retrieving revision 1\.1
- Merging differences between 1\.1\.2\.1 and 1\.1 into file1
- rcsmerge: warning: conflicts during merge
- ${PROG} update: conflicts found in file1
- C file1
- M file2"
- # CVS is giving a conflict because we are trying to get back to
- # 1.1.4. I'm not sure why it is a conflict rather than just
- # "M file1".
- dotest tagf-14 "cat file1" \
- "<<<<<<< file1
- brmod
- moremod
- [=]======
- [>]>>>>>> 1\.1"
- echo resolve >file1
- dotest tagf-15 "${testcvs} -q ci -m recovered" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.4\.1; previous revision: 1\.1
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
- done"
- # try accidentally deleting branch tag, "tag -d"
- dotest_fail tagf-16 "${testcvs} tag -d br" \
- "${PROG} tag: Untagging \.
- ${PROG} tag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\.
- ${PROG} tag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\."
- # try accidentally deleting branch tag, "rtag -d"
- dotest_fail tagf-17 "${testcvs} rtag -d br first-dir" \
- "${PROG} rtag: Untagging first-dir
- ${PROG} rtag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\.
- ${PROG} rtag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\."
- # try accidentally converting branch tag to non-branch tag "tag -F"
- dotest tagf-18 "${testcvs} tag -r1.1 -F br file1" \
- "${PROG} tag: file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\."
- # try accidentally converting branch tag to non-branch tag "rtag -F"
- dotest tagf-19 "${testcvs} rtag -r1.1 -F br first-dir" \
- "${PROG} rtag: Tagging first-dir
- ${PROG} rtag: first-dir/file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\.
- ${PROG} rtag: first-dir/file2: Not moving branch tag .br. from 1\.1\.2\.2 to 1\.1\."
- # create a non-branch tag
- dotest tagf-20 "${testcvs} rtag regulartag first-dir" \
- "${PROG} rtag: Tagging first-dir"
- # try accidentally converting non-branch tag to branch tag (tag -F -B -b)
- dotest tagf-21 "${testcvs} tag -F -B -b regulartag file1" \
- "${PROG} tag: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1\.0\.2 due to .-B. option\."
- # try accidentally converting non-branch tag to branch rtag (rtag -F -B -b)
- dotest tagf-22 "${testcvs} rtag -F -B -b regulartag first-dir" \
- "${PROG} rtag: Tagging first-dir
- ${PROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.6 due to .-B. option\.
- ${PROG} rtag: first-dir/file2: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.4 due to .-B. option\."
- # Try accidentally deleting non-branch: (tag -d -B)
- dotest_fail tagf-23 "${testcvs} tag -d -B regulartag file1" \
- "${PROG} tag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\."
- # Try accidentally deleting non-branch: (rtag -d -B)
- dotest_fail tagf-24 \
- "${testcvs} rtag -d -B regulartag first-dir" \
- "${PROG} rtag: Untagging first-dir
- ${PROG} rtag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\.
- ${PROG} rtag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file2,v. due to .-B. option\."
- # the following tests (throught the next commit) keep moving the same
- # tag back and forth between 1.1.6 & 1.1.8 in file1 and between
- # 1.1.4 and 1.1.6 in file2 since nothing was checked in on some of
- # these branches and CVS only tracks branches via tags unless they contain data.
- # try intentionally converting non-branch tag to branch tag (tag -F -b)
- dotest tagf-25a "${testcvs} tag -F -b regulartag file1" "T file1"
- # try intentionally moving a branch tag to a newly created branch (tag -F -b -B)
- dotest tagf-25b "${testcvs} tag -F -B -b -r1.1 regulartag file1" \
- "T file1"
- # try intentionally converting mixed tags to branch tags (rtag -F -b)
- dotest tagf-26a "${testcvs} rtag -F -b regulartag first-dir" \
- "${PROG} rtag: Tagging first-dir
- ${PROG} rtag: first-dir/file1: Not moving branch tag .regulartag. from 1\.1 to 1\.1\.0\.8\."
- # try intentionally converting a branch to a new branch tag (rtag -F -b -B)
- dotest tagf-26b "${testcvs} rtag -F -B -b -r1.1 regulartag first-dir" \
- "${PROG} rtag: Tagging first-dir"
- # update to our new branch
- dotest tagf-27 "${testcvs} update -r regulartag" \
- "${PROG} update: Updating \.
- U file1
- U file2"
- # commit some changes and see that all rev numbers look right
- echo changes >> file1
- echo changes >> file2
- dotest tagf-28 "${testcvs} ci -m changes" \
- "${PROG} [a-z]*: Examining \.
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.8\.1; previous revision: 1\.1
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: 1\.1\.6\.1; previous revision: 1\.1
- done"
- # try intentional branch to non-branch (tag -F -B)
- dotest tagf-29 "${testcvs} tag -F -B -r1.1 regulartag file1" \
- "T file1"
- # try non-branch to non-branch (tag -F -B)
- dotest tagf-29a "${testcvs} tag -F -B -r br regulartag file1" \
- "${PROG} tag: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\."
- # try mixed-branch to non-branch (rtag -F -B )
- dotest tagf-29b "${testcvs} rtag -F -B -r br regulartag first-dir" \
- "${PROG} rtag: Tagging first-dir
- ${PROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\."
- # at this point, regulartag is a regular tag within
- # file1 and file2
- # try intentional branch to non-branch (rtag -F -B)
- dotest tagf-30 "${testcvs} rtag -F -B -r1.1 br first-dir" \
- "${PROG} rtag: Tagging first-dir"
- # create a branch tag so we can try to delete it.
- dotest tagf-31 "${testcvs} rtag -b brtag first-dir" \
- "${PROG} rtag: Tagging first-dir"
-
- # try intentinal deletion of branch tag (tag -d -B)
- dotest tagf-32 "${testcvs} tag -d -B brtag file1" "D file1"
- # try intentinal deletion of branch tag (rtag -d -B)
- dotest tagf-33 "${testcvs} rtag -d -B brtag first-dir" \
- "${PROG} rtag: Untagging first-dir"
- cd ../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- tag-log)
- # Test log output for tags
- mkdir 1; cd 1
- dotest tag-log-init-1 "$testcvs -q co -l ."
- mkdir first-dir
- dotest tag-log-init-2 "$testcvs add first-dir" \
- "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
- cd first-dir
- touch file1
- dotest tag-log-init-3 "$testcvs add file1" \
- "${PROG}"' add: scheduling file `file1'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest tag-log-init-4 "$testcvs -Q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- dotest tag-log-1 "$testcvs -Q tag mytag file1" ''
- dotest tag-log-2 "$testcvs log -N file1" \
- "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- Working file: file1
- head: 1\.1
- branch:
- locks: strict
- access list:
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- add
- ============================================================================="
- dotest tag-log-3 "$testcvs log -N -n file1" \
- "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- Working file: file1
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- mytag: 1\.1
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- add
- ============================================================================="
- dotest tag-log-4 "$testcvs log file1" \
- "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- Working file: file1
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- mytag: 1\.1
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- add
- ============================================================================="
- dotest tag-log-5 "$testcvs log -n file1" \
- "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- Working file: file1
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- mytag: 1\.1
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- add
- ============================================================================="
- cd ../..
- rm -fr 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- tag-space)
- # Test tags with spaces in the names.
- #
- # Prior to releases 1.11.18 & 1.12.10, some commands used with
- # tags with spaces in the names could hang CVS.
- # Setup; check in first-dir/file1
- mkdir 1; cd 1
- dotest tag-space-init-1 "$testcvs -q co -l ."
- mkdir first-dir
- dotest tag-space-init-2 "$testcvs add first-dir" \
- "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
- cd first-dir
- touch file1
- dotest tag-space-init-3 "$testcvs add file1" \
- "$PROG add: scheduling file \`file1' for addition
- $PROG add: use '$PROG commit' to add this file permanently"
- dotest tag-space-init-4 "$testcvs -Q ci -m add" \
- "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
- done
- Checking in file1;
- $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- # Reportedly, the following two tags make it past WinCVS.
- dotest_fail tag-space-1 "$testcvs tag ' spacetag '" \
- "$PROG \[tag aborted\]: tag \` spacetag ' must start with a letter"
- dotest_fail tag-space-2 "$testcvs tag 'spacetag '" \
- "$PROG \[tag aborted\]: tag \`spacetag ' has non-visible graphic characters"
- if $remote; then
- # Verify that this isn't a client check.
- dotest tag-space-3 "$testcvs server" \
- "E $PROG \[tag aborted\]: tag \` spacetag ' must start with a letter
- error " <<EOF
- Root $CVSROOT_DIRNAME
- UseUnchanged
- Argument --
- Argument spacetag
- Directory .
- $CVSROOT_DIRNAME/first-dir
- Entry /file1/1.1///
- Unchanged file1
- tag
- EOF
- dotest tag-space-4 "$testcvs server" \
- "E $PROG \[tag aborted\]: tag \`spacetag ' has non-visible graphic characters
- error " <<EOF
- Root $CVSROOT_DIRNAME
- UseUnchanged
- Argument --
- Argument spacetag
- Directory .
- $CVSROOT_DIRNAME/first-dir
- Entry /file1/1.1///
- Unchanged file1
- tag
- EOF
- fi # $remote
- # Any number of normal tags and branches were handled correctly.
- dotest tag-space-5 "$testcvs -Q tag t1"
- dotest tag-space-5b "$testcvs -Q tag t2"
- dotest tag-space-5c "$testcvs -Q tag -b b1"
- cd ../..
- mkdir 2; cd 2
- # But once a vendor branch exists, it's all over.
- mkdir project; cd project
- touch file1
- dotest tag-space-init-4 \
- "$testcvs -Q import -mimport second-dir VENDOR RELEASE"
- cd ..
- dotest_fail tag-space-6 "$testcvs -Q co -r ' spacetag ' first-dir" \
- "$PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter"
- # But when any files were imported, this test hung prior to CVS
- # versions 1.11.18 & 1.12.10.
- dotest_fail tag-space-7 "$testcvs -Q co -r ' spacetag ' second-dir" \
- "$PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter"
- if $remote; then
- # I based the client input in the next two tests on actual input
- # from WinCVS 1.2.
- dotest tag-space-8 "$testcvs server" \
- "E $PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter
- error " <<EOF
- Root $CVSROOT_DIRNAME
- Argument -P
- Argument -r
- Argument spacetag
- Argument first-dir
- Directory .
- $CVSROOT_DIRNAME
- co
- EOF
- # Verify the test is not on the client side.
- dotest tag-space-9 "$testcvs server" \
- "E $PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter
- error " <<EOF
- Root $CVSROOT_DIRNAME
- Argument -P
- Argument -r
- Argument spacetag
- Argument second-dir
- Directory .
- $CVSROOT_DIRNAME
- co
- EOF
- fi # $remote
- dotest tag-space-10 "$testcvs -Q co second-dir"
- cd second-dir
- # This test would also hang.
- dotest_fail tag-space-11 "$testcvs -Q up -r ' spacetag '" \
- "$PROG \[update aborted\]: tag \` spacetag ' must start with a letter"
- if $remote; then
- dotest tag-space-12 "$testcvs server" \
- "E $PROG \[update aborted\]: tag \` spacetag ' must start with a letter
- error " <<EOF
- Root $CVSROOT_DIRNAME
- Argument -r
- Argument spacetag
- Argument -u
- Argument --
- Directory .
- $CVSROOT_DIRNAME
- Unchanged file1
- update
- EOF
- fi # $remote
- # I'm skipping tests for other commands that may have had the same
- # problem. Hopefully, if a new issue arises, one of the above tests
- # will catch the problem.
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- cd ../..
- rm -r 1 2
- rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/second-dir
- ;;
- rcslib)
- # Test librarification of RCS.
- # First: test whether `cvs diff' handles $Name expansion
- # correctly. We diff two revisions with their symbolic tags;
- # neither tag should be expanded in the output. Also diff
- # one revision with the working copy.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- dotest rcsdiff-1 "${testcvs} -q co first-dir" ''
- cd first-dir
- echo "I am the first foo, and my name is $""Name$." > foo.c
- dotest rcsdiff-2 "${testcvs} add -m new-file foo.c" \
- "${PROG} add: scheduling file .foo\.c. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest rcsdiff-3 "${testcvs} commit -m rev1 foo.c" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
- done
- Checking in foo\.c;
- ${CVSROOT_DIRNAME}/first-dir/foo.c,v <-- foo\.c
- initial revision: 1\.1
- done"
- dotest rcsdiff-4 "${testcvs} tag first foo.c" "T foo\.c"
- dotest rcsdiff-5 "${testcvs} update -p -r first foo.c" \
- "===================================================================
- Checking out foo\.c
- RCS: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
- VERS: 1\.1
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- I am the first foo, and my name is \$""Name: first \$\."
- echo "I am the second foo, and my name is $""Name$." > foo.c
- dotest rcsdiff-6 "${testcvs} commit -m rev2 foo.c" \
- "Checking in foo\.c;
- ${CVSROOT_DIRNAME}/first-dir/foo\.c,v <-- foo\.c
- new revision: 1\.2; previous revision: 1\.1
- done"
- dotest rcsdiff-7 "${testcvs} tag second foo.c" "T foo\.c"
- dotest rcsdiff-8 "${testcvs} update -p -r second foo.c" \
- "===================================================================
- Checking out foo\.c
- RCS: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
- VERS: 1\.2
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- I am the second foo, and my name is \$""Name: second \$\."
- dotest_fail rcsdiff-9 "${testcvs} diff -r first -r second" \
- "${PROG} diff: Diffing \.
- Index: foo\.c
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- diff -r1\.1 -r1\.2
- 1c1
- < I am the first foo, and my name is \$""Name: \$\.
- ---
- > I am the second foo, and my name is \$""Name: \$\."
- echo "I am the once and future foo, and my name is $""Name$." > foo.c
- dotest_fail rcsdiff-10 "${testcvs} diff -r first" \
- "${PROG} diff: Diffing \.
- Index: foo\.c
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
- retrieving revision 1\.1
- diff -r1\.1 foo\.c
- 1c1
- < I am the first foo, and my name is \$""Name: \$\.
- ---
- > I am the once and future foo, and my name is \$""Name\$\."
- # Test handling of libdiff options. diff gets quite enough
- # of a workout elsewhere in sanity.sh, so we assume that it's
- # mostly working properly if it passes all the other tests.
- # The main one we want to try is regex handling, since we are
- # using CVS's regex matcher and not diff's.
- cat >rgx.c <<EOF
- test_regex (whiz, bang)
- {
- foo;
- bar;
- baz;
- grumble;
- }
- EOF
- dotest rcslib-diffrgx-1 "${testcvs} -q add -m '' rgx.c" \
- "${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest rcslib-diffrgx-2 "${testcvs} -q ci -m '' rgx.c" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
- done
- Checking in rgx\.c;
- ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v <-- rgx\.c
- initial revision: 1\.1
- done"
- cat >rgx.c <<EOF
- test_regex (whiz, bang)
- {
- foo;
- bar;
- baz;
- mumble;
- }
- EOF
- # Use dotest_fail because exit status from `cvs diff' must be 1.
- dotest_fail rcslib-diffrgx-3 "${testcvs} diff -c -F'.* (' rgx.c" \
- "Index: rgx\.c
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
- retrieving revision 1\.1
- diff -c -F \.\* ( -r1\.1 rgx\.c
- \*\*\* rgx\.c ${RFCDATE} 1\.1
- --- rgx\.c ${RFCDATE}
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* test_regex (whiz, bang)
- \*\*\* 3,7 \*\*\*\*
- foo;
- bar;
- baz;
- ! grumble;
- }
- --- 3,7 ----
- foo;
- bar;
- baz;
- ! mumble;
- }"
- # Tests of rcsmerge/diff3. Merge operations get a good general
- # workout elsewhere; we want to make sure that options are still
- # handled properly. Try merging two branches with -kv, to test
- # both -j and -k switches.
- cd ..
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -r first-dir
- mkdir 1; cd 1
- dotest rcslib-merge-1 "${testcvs} -q co -l ." ""
- mkdir first-dir
- dotest rcslib-merge-2 "${testcvs} -q add first-dir" \
- "Directory ${CVSROOT_DIRNAME}.*/first-dir added to the repository"
- cd ..; rm -r 1
- dotest rcslib-merge-3 "${testcvs} -q co first-dir" ""
- cd first-dir
- echo '$''Revision$' > file1
- echo '2' >> file1
- echo '3' >> file1
- dotest rcslib-merge-4 "${testcvs} -q add file1" \
- "${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest rcslib-merge-5 "${testcvs} -q commit -m '' file1" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- sed -e 's/2/two/' file1 > f; mv f file1
- dotest rcslib-merge-6 "${testcvs} -q commit -m '' file1" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.2; previous revision: 1\.1
- done"
- dotest rcslib-merge-7 "${testcvs} -q tag -b -r 1.1 patch1" "T file1"
- dotest rcslib-merge-8 "${testcvs} -q update -r patch1" "[UP] file1"
- dotest rcslib-merge-9 "${testcvs} -q status" \
- "===================================================================
- File: file1 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
- Sticky Tag: patch1 (branch: 1\.1\.2)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest rcslib-merge-10 "cat file1" \
- '$''Revision: 1\.1 $
- 2
- 3'
- sed -e 's/3/three/' file1 > f; mv f file1
- dotest rcslib-merge-11 "${testcvs} -q commit -m '' file1" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- dotest rcslib-merge-12 "${testcvs} -q update -kv -j1.2" \
- "U file1
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into file1
- rcsmerge: warning: conflicts during merge"
- dotest rcslib-merge-13 "cat file1" \
- "<<<<<<< file1
- 1\.1\.2\.1
- 2
- three
- [=]======
- 1\.2
- two
- 3
- [>]>>>>>> 1\.2"
- # Test behavior of symlinks in the repository.
- if test -n "$remotehost"; then
- # Create the link on the remote system. This is because Cygwin's
- # Windows support creates *.lnk files for Windows. When creating
- # these in an SMB share from UNIX, these links won't work from the
- # UNIX side.
- dotest rcslib-symlink-1remotehost "${CVS_RSH} $remotehost 'ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
- else
- dotest rcslib-symlink-1 "ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
- fi
- dotest rcslib-symlink-2 "${testcvs} update file2" "U file2"
- echo "This is a change" >> file2
- dotest rcslib-symlink-3 "${testcvs} ci -m because file2" \
- "Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file2
- new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
- done"
- # Switch as for rcslib-symlink-1
- if test -n "$remotehost"; then
- dotest rcslib-symlink-4 "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/file2,v'" \
- ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
- else
- dotest rcslib-symlink-4 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
- ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
- fi
- # CVS was failing to check both the symlink and the file
- # for timestamp changes for a while. Test that.
- rm file1
- dotest rcslib-symlink-3a "${testcvs} -q up file1" \
- "${PROG} update: warning: file1 was lost
- U file1"
- echo "This is a change" >> file1
- dotest rcslib-symlink-3b "${testcvs} ci -m because file1" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.[0-9]*; previous revision: 1\.1\.2\.[0-9]*
- done"
- dotest rcslib-symlink-3c "${testcvs} update file2" "[UP] file2"
- echo some new text >file3
- dotest rcslib-symlink-3d "${testcvs} -Q add file3" ''
- dotest rcslib-symlink-3e "${testcvs} -Q ci -mtest file3" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
- done
- Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v
- # As for rcslib-symlink-1
- if test -n "$remotehost"; then
- dotest rcslib-symlink-3f "$CVS_RSH $remotehost 'ln -s Attic/file3,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
- else
- dotest rcslib-symlink-3f "ln -s Attic/file3,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
- fi
- dotest rcslib-symlink-3g "${testcvs} update file2" "U file2"
- # restore the link to file1 for the following tests
- dotest rcslib-symlink-3i "${testcvs} -Q rm -f file3" ''
- dotest rcslib-symlink-3j "${testcvs} -Q ci -mwhatever file3" \
- "Removing file3;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
- new revision: delete; previous revision: 1\.1\.2\.1
- done"
- rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v
- rm -f ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
- # As for rcslib-symlink-1
- if test -n "$remotehost"; then
- dotest rcslib-symlink-3h "$CVS_RSH $remotehost 'ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
- else
- dotest rcslib-symlink-3h "ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
- fi
- # Test 5 reveals a problem with having symlinks in the
- # repository. CVS will try to tag both of the files
- # separately. After processing one, it will do the same
- # operation to the other, which is actually the same file,
- # so the tag will already be there. FIXME: do we bother
- # changing operations to notice cases like this? This
- # strikes me as a difficult problem. -Noel
- dotest rcslib-symlink-5 "${testcvs} tag the_tag" \
- "${PROG} tag: Tagging .
- T file1
- W file2 : the_tag already exists on version 1.1.2.3 : NOT MOVING tag to version 1.1.2.1"
- # As for rcslib-symlink-1
- if test -n "$remotehost"; then
- dotest rcslib-symlink-6 "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/file2,v'" \
- ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
- else
- dotest rcslib-symlink-6 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
- ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
- fi
- # Symlinks tend to interact poorly with the Attic.
- cd ..
- mkdir 2; cd 2
- dotest rcslib-symlink-7 "${testcvs} -q co first-dir" \
- "U first-dir/file1
- U first-dir/file2"
- cd first-dir
- dotest rcslib-symlink-8 "${testcvs} rm -f file2" \
- "${PROG} remove: scheduling .file2. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest rcslib-symlink-9 "${testcvs} -q ci -m rm-it" \
- "Removing file2;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file2
- new revision: delete; previous revision: 1\.2
- done"
- # OK, why this message happens twice is relatively clear
- # (the check_* and rtag_* calls to start_recursion).
- # Why it happens a third time I didn't try to find out.
- dotest rcslib-symlink-10 \
- "${testcvs} -q rtag -b -r the_tag brtag first-dir" \
- "${PROG} rtag: could not read RCS file for file2
- ${PROG} rtag: could not read RCS file for first-dir/file2
- ${PROG} rtag: could not read RCS file for first-dir/file2"
- # Restore file1 for the next test.
- dotest rcslib-long-symlink-init-1 "$testcvs -Q up -A"
- dotest rcslib-long-symlink-init-2 "$testcvs -Q add file1"
- dotest rcslib-long-symlink-init-3 "$testcvs -Q ci -mback" \
- "Checking in file1;
- $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
- new revision: 1\.4; previous revision: 1\.3
- done"
- cd ../.. # $TESTDIR
- # CVS has a hard-coded default link path size of 127 characters.
- # Make sure it knows how to exceed that.
- longpath=$CVSROOT_DIRNAME
- count=0
- while test $count -lt 10; do
- count=`expr $count + 1`
- longpath=$longpath/123456789012345678901234567890
- mkdir $longpath
- done
- cp $CVSROOT_DIRNAME/first-dir/file1,v $longpath
- mkdir $CVSROOT_DIRNAME/second-dir
- # Switch as for rcslib-symlink-1
- if test -n "$remotehost"; then
- dotest rcslib-long-symlink-1rh \
- "$CVS_RSH $remotehost 'ln -s $longpath/file1,v $CVSROOT_DIRNAME/second-dir/fileX,v'"
- else
- dotest rcslib-long-symlink-1 \
- "ln -s $longpath/file1,v $CVSROOT_DIRNAME/second-dir/fileX,v"
- fi
- dotest rcslib-long-symlink-2 "$testcvs co second-dir" \
- "$PROG checkout: Updating second-dir
- U second-dir/fileX"
- cd second-dir
- echo change-it >>fileX
- # Writes actually cause symlinks to be resolved.
- dotest rcslib-long-symlink-3 "$testcvs -q ci -mwrite-it" \
- "Checking in fileX;
- $CVSROOT_DIRNAME/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/file1,v <-- fileX
- new revision: 1\.5; previous revision: 1\.4
- done"
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ..
- # Must remove the symlink first. Samba doesn't appear to show
- # broken symlink across the SMB share, and rm -rf by itself
- # will remove file1,v first and leave file2,v a broken link and the
- # rm -rf will fail since it doesn't find file2,v and it still gets
- # directory not empty errors removing cvsroot/first-dir.
- #
- # I'm not sure why I need to do this on $remotehost. The rm above
- # rcslib-symlink-3j works fine, but the next one doesn't unless run
- # remotely under Cygwin and using a TESTDIR on a Samba share.
- if test -n "$remotehost"; then
- $CVS_RSH $remotehost \
- "rm -f $CVSROOT_DIRNAME/first-dir/file2,v $CVSROOT_DIRNAME/second-dir/fileX,v"
- fi
- rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/second-dir \
- $CVSROOT_DIRNAME/123456789012345678901234567890
- rm -r first-dir second-dir 2
- ;;
- multibranch)
- # Test the ability to have several branchpoints coming off the
- # same revision.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- dotest multibranch-1 "${testcvs} -q co first-dir" ''
- cd first-dir
- echo 1:trunk-1 >file1
- dotest multibranch-2 "${testcvs} add file1" \
- "${PROG}"' add: scheduling file `file1'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest_lit multibranch-3 "${testcvs} -q ci -m add-it" <<HERE
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1.1
- done
- HERE
- dotest multibranch-4 "${testcvs} tag -b br1" \
- "${PROG} tag: Tagging \.
- T file1"
- dotest multibranch-5 "${testcvs} tag -b br2" \
- "${PROG} tag: Tagging \.
- T file1"
- dotest multibranch-6 "$testcvs -q update -r br1" '[UP] file1'
- echo on-br1 >file1
- dotest multibranch-7 "${testcvs} -q ci -m modify-on-br1" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- dotest multibranch-8 "${testcvs} -q update -r br2" '[UP] file1'
- echo br2 adds a line >>file1
- dotest multibranch-9 "${testcvs} -q ci -m modify-on-br2" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.4\.1; previous revision: 1\.1
- done"
- dotest multibranch-10 "${testcvs} -q update -r br1" '[UP] file1'
- dotest multibranch-11 "cat file1" 'on-br1'
- dotest multibranch-12 "${testcvs} -q update -r br2" '[UP] file1'
- dotest multibranch-13 "cat file1" '1:trunk-1
- br2 adds a line'
- dotest multibranch-14 "${testcvs} log file1" \
- "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- Working file: file1
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- br2: 1\.1\.0\.4
- br1: 1\.1\.0\.2
- keyword substitution: kv
- total revisions: 3; selected revisions: 3
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- branches: 1\.1\.2; 1\.1\.4;
- add-it
- ----------------------------
- revision 1\.1\.4\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
- modify-on-br2
- ----------------------------
- revision 1\.1\.2\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
- modify-on-br1
- ============================================================================="
- cd ..
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -r first-dir
- ;;
- import) # test death after import
- # Tests of "cvs import":
- # basic2
- # rdiff -- imports with keywords
- # import -- more tests of imports with keywords
- # importb -- -b option.
- # importc -- bunch o' files in bunch o' directories
- # modules3
- # mflag -- various -m messages
- # ignore -- import and cvsignore
- # binwrap -- import and -k wrappers
- # info -- imports which are rejected by verifymsg
- # head -- intended to test vendor branches and HEAD,
- # although it doesn't really do it yet.
- # import-CVS -- refuse to import directories named "CVS".
- # import-quirks -- short tests of import quirks.
- # import
- mkdir import-dir ; cd import-dir
- for i in 1 2 3 4 ; do
- echo imported file"$i" > imported-f"$i"
- done
- # This directory should be on the default ignore list,
- # so it shouldn't get imported.
- mkdir RCS
- echo ignore.me >RCS/ignore.me
- echo 'import should not expand $''Id$' >>imported-f2
- cp imported-f2 ../imported-f2-orig.tmp
- dotest_sort import-96 \
- "${testcvs} import -m first-import first-dir vendor-branch junk-1_0" \
- "
- I first-dir/RCS
- N first-dir/imported-f1
- N first-dir/imported-f2
- N first-dir/imported-f3
- N first-dir/imported-f4
- No conflicts created by this import"
- dotest import-96.5 "cmp ../imported-f2-orig.tmp imported-f2" ''
- cd ..
- # co
- dotest import-97 "${testcvs} -q co first-dir" \
- "U first-dir/imported-f1
- U first-dir/imported-f2
- U first-dir/imported-f3
- U first-dir/imported-f4"
- cd first-dir
- for i in 1 2 3 4 ; do
- dotest import-98-$i "test -f imported-f$i" ''
- done
- dotest_fail import-98.5 "test -d RCS" ''
- # remove
- rm imported-f1
- dotest import-99 "${testcvs} rm imported-f1" \
- "${PROG}"' remove: scheduling `imported-f1'\'' for removal
- '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
- # change
- echo local-change >> imported-f2
- # commit
- dotest import-100 "${testcvs} ci -m local-changes" \
- "${PROG} [a-z]*: Examining .
- Removing imported-f1;
- ${CVSROOT_DIRNAME}/first-dir/imported-f1,v <-- imported-f1
- new revision: delete; previous revision: 1\.1\.1\.1
- done
- Checking in imported-f2;
- ${CVSROOT_DIRNAME}/first-dir/imported-f2,v <-- imported-f2
- new revision: 1\.2; previous revision: 1\.1
- done"
- # log
- dotest import-101 "${testcvs} log imported-f1" \
- "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/imported-f1,v
- Working file: imported-f1
- head: 1\.2
- branch:
- locks: strict
- access list:
- symbolic names:
- junk-1_0: 1\.1\.1\.1
- vendor-branch: 1\.1\.1
- keyword substitution: kv
- total revisions: 3; selected revisions: 3
- description:
- ----------------------------
- revision 1\.2
- date: [0-9/]* [0-9:]*; author: ${username}; state: dead; lines: ${PLUS}0 -0
- local-changes
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- branches: 1\.1\.1;
- Initial revision
- ----------------------------
- revision 1\.1\.1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
- first-import
- ============================================================================="
- # update into the vendor branch.
- dotest import-102 "$testcvs update -rvendor-branch" \
- "$PROG update: Updating .
- U imported-f1
- [UP] imported-f2
- [UP] imported-f3
- [UP] imported-f4"
- # remove file4 on the vendor branch
- rm imported-f4
- dotest import-103 "${testcvs} rm imported-f4" \
- "${PROG}"' remove: scheduling `imported-f4'\'' for removal
- '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
- # commit
- dotest import-104 \
- "${testcvs} ci -m vendor-removed imported-f4" \
- "Removing imported-f4;
- ${CVSROOT_DIRNAME}/first-dir/imported-f4,v <-- imported-f4
- new revision: delete; previous revision: 1\.1\.1\.1
- done"
- # update to main line
- dotest import-105 "$testcvs -q update -A" \
- "$PROG update: imported-f1 is no longer in the repository
- [UP] imported-f2
- [UP] imported-f3"
- # second import - file4 deliberately unchanged
- cd ../import-dir
- for i in 1 2 3 ; do
- echo rev 2 of file $i >> imported-f"$i"
- done
- cp imported-f2 ../imported-f2-orig.tmp
- dotest_sort import-106 \
- "${testcvs} import -m second-import first-dir vendor-branch junk-2_0" \
- "
- ${PROG} checkout -j<prev_rel_tag> -jjunk-2_0 first-dir
- 2 conflicts created by this import.
- C first-dir/imported-f1
- C first-dir/imported-f2
- I first-dir/RCS
- U first-dir/imported-f3
- U first-dir/imported-f4
- Use the following command to help the merge:"
- dotest import-106.5 "cmp ../imported-f2-orig.tmp imported-f2" \
- ''
- cd ..
- rm imported-f2-orig.tmp
- # co
- dotest import-107 "${testcvs} co first-dir" \
- "${PROG} checkout: Updating first-dir
- [UP] first-dir/imported-f3
- [UP] first-dir/imported-f4"
- cd first-dir
- dotest_fail import-108 "test -f imported-f1" ''
- for i in 2 3 ; do
- dotest import-109-$i "test -f imported-f$i" ''
- done
- # check vendor branch for file4
- dotest import-110 "$testcvs -q update -rvendor-branch" \
- 'U imported-f1
- [UP] imported-f2
- [UP] imported-f3
- [UP] imported-f4'
- dotest import-111 "test -f imported-f4" ''
- # update to main line
- dotest import-112 "$testcvs -q update -A" \
- "$PROG update: imported-f1 is no longer in the repository
- [UP] imported-f2
- [UP] imported-f3
- [UP] imported-f4"
- cd ..
- dotest import-113 \
- "${testcvs} -q co -jjunk-1_0 -jjunk-2_0 first-dir" \
- "${PROG} checkout: file first-dir/imported-f1 does not exist, but is present in revision junk-2_0
- RCS file: ${CVSROOT_DIRNAME}/first-dir/imported-f2,v
- retrieving revision 1\.1\.1\.1
- retrieving revision 1\.1\.1\.2
- Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into imported-f2
- rcsmerge: warning: conflicts during merge
- first-dir/imported-f3 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.2
- first-dir/imported-f4 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.3"
- cd first-dir
- dotest_fail import-114 "test -f imported-f1" ''
- for i in 2 3 ; do
- dotest import-115-$i "test -f imported-f$i" ''
- done
- dotest import-116 'cat imported-f2' \
- 'imported file2
- [<]<<<<<< imported-f2
- import should not expand \$''Id: imported-f2,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
- local-change
- [=]======
- import should not expand \$''Id: imported-f2,v 1\.1\.1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
- rev 2 of file 2
- [>]>>>>>> 1\.1\.1\.2'
- cd ..
- rm -r first-dir
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -r import-dir
- ;;
- importb)
- # More cvs import tests, especially -b option.
- # OK, first we get some sources from the NetMunger project, and
- # import them into the 1.1.1 vendor branch.
- mkdir imp-dir
- cd imp-dir
- echo 'OpenMunger sources' >file1
- echo 'OpenMunger sources' >file2
- dotest_sort importb-1 \
- "${testcvs} import -m add first-dir openmunger openmunger-1_0" \
- "
- N first-dir/file1
- N first-dir/file2
- No conflicts created by this import"
- cd ..
- rm -r imp-dir
- # Now we put the sources we get from FreeMunger into 1.1.3
- mkdir imp-dir
- cd imp-dir
- echo 'FreeMunger sources' >file1
- echo 'FreeMunger sources' >file2
- # Not completely sure how the conflict detection is supposed to
- # be working here (haven't really thought about it).
- # We use an explicit -d option to test that it is reflected
- # in the suggested checkout.
- dotest_sort importb-2 \
- "${testcvs} -d ${CVSROOT} import -m add -b 1.1.3 first-dir freemunger freemunger-1_0" \
- "
- ${PROG} -d ${CVSROOT} checkout -j<prev_rel_tag> -jfreemunger-1_0 first-dir
- 2 conflicts created by this import.
- C first-dir/file1
- C first-dir/file2
- Use the following command to help the merge:"
- cd ..
- rm -r imp-dir
- # Now a test of main branch import (into second-dir, not first-dir).
- mkdir imp-dir
- cd imp-dir
- echo 'my own stuff' >mine1.c
- echo 'my own stuff' >mine2.c
- dotest_fail importb-3 \
- "${testcvs} import -m add -b 1 second-dir dummy really_dumb_y" \
- "$PROG \[import aborted\]: Only numeric branch specifications with two dots are
- supported by import, not \`1'\. For example: \`1\.1\.1'\."
- : when we implement main-branch import, should be \
- "N second-dir/mine1\.c
- N second-dir/mine2\.c
- No conflicts created by this import"
- cd ..
- rm -r imp-dir
- mkdir 1
- cd 1
- # when we implement main branch import, will want to
- # add "second-dir" here.
- dotest importb-4 "${testcvs} -q co first-dir" \
- "U first-dir/file1
- U first-dir/file2"
- cd first-dir
- dotest importb-5 "${testcvs} -q log file1" "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- Working file: file1
- head: 1\.1
- branch: 1\.1\.1
- locks: strict
- access list:
- symbolic names:
- freemunger-1_0: 1\.1\.3\.1
- freemunger: 1\.1\.3
- openmunger-1_0: 1\.1\.1\.1
- openmunger: 1\.1\.1
- keyword substitution: kv
- total revisions: 3; selected revisions: 3
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- branches: 1\.1\.1; 1\.1\.3;
- Initial revision
- ----------------------------
- revision 1\.1\.3\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
- add
- ----------------------------
- revision 1\.1\.1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
- add
- ============================================================================="
- cd ../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
- ;;
- importc)
- # Test importing a bunch o' files in a bunch o' directories.
- # Also the -d option.
- mkdir 1; cd 1
- mkdir adir bdir cdir
- mkdir adir/sub1 adir/sub2
- mkdir adir/sub1/ssdir
- mkdir bdir/subdir
- touch adir/sub1/file1 adir/sub2/file2 adir/sub1/ssdir/ssfile
- touch -t 197107040343 bdir/subdir/file1
- touch -t 203412251801 cdir/cfile
- dotest_sort importc-1 \
- "${testcvs} import -d -m import-it first-dir vendor release" \
- "
- N first-dir/adir/sub1/file1
- N first-dir/adir/sub1/ssdir/ssfile
- N first-dir/adir/sub2/file2
- N first-dir/bdir/subdir/file1
- N first-dir/cdir/cfile
- No conflicts created by this import
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1/ssdir
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub2
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/bdir
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/bdir/subdir
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/cdir"
- cd ..
- mkdir 2; cd 2
- dotest importc-2 "${testcvs} -q co first-dir" \
- "U first-dir/adir/sub1/file1
- U first-dir/adir/sub1/ssdir/ssfile
- U first-dir/adir/sub2/file2
- U first-dir/bdir/subdir/file1
- U first-dir/cdir/cfile"
- cd first-dir
- dotest importc-3 "${testcvs} update adir/sub1" \
- "${PROG} update: Updating adir/sub1
- ${PROG} update: Updating adir/sub1/ssdir"
- dotest importc-4 "${testcvs} update adir/sub1 bdir/subdir" \
- "${PROG} update: Updating adir/sub1
- ${PROG} update: Updating adir/sub1/ssdir
- ${PROG} update: Updating bdir/subdir"
- echo modify >>cdir/cfile
- dotest importc-5 \
- "${testcvs} -q rtag -b -r release wip_test first-dir" ""
- dotest importc-6 "$testcvs -q update -r wip_test" \
- 'U adir/sub1/file1
- U adir/sub1/ssdir/ssfile
- U adir/sub2/file2
- U bdir/subdir/file1
- M cdir/cfile'
- # This used to fail in local mode
- dotest importc-7 "${testcvs} -q ci -m modify -r wip_test" \
- "Checking in cdir/cfile;
- ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v <-- cfile
- new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
- done"
- # TODO: should also be testing "import -d" when we update
- # an existing file.
- dotest importc-8 "${testcvs} -q log cdir/cfile" "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v
- Working file: cdir/cfile
- head: 1\.1
- branch: 1\.1\.1
- locks: strict
- access list:
- symbolic names:
- wip_test: 1\.1\.1\.1\.0\.2
- release: 1\.1\.1\.1
- vendor: 1\.1\.1
- keyword substitution: kv
- total revisions: 3; selected revisions: 3
- description:
- ----------------------------
- revision 1\.1
- date: 2034/12/2[4-6] [0-9][0-9]:01:[0-9][0-9]; author: ${username}; state: Exp;
- branches: 1\.1\.1;
- Initial revision
- ----------------------------
- revision 1\.1\.1\.1
- date: 2034/12/2[4-6] [0-9][0-9]:01:[0-9][0-9]; author: ${username}; state: Exp; lines: ${PLUS}0 -0
- branches: 1\.1\.1\.1\.2;
- import-it
- ----------------------------
- revision 1\.1\.1\.1\.2\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
- modify
- ============================================================================="
- dotest importc-9 "${testcvs} -q log bdir/subdir/file1" "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/bdir/subdir/file1,v
- Working file: bdir/subdir/file1
- head: 1\.1
- branch: 1\.1\.1
- locks: strict
- access list:
- symbolic names:
- wip_test: 1\.1\.1\.1\.0\.2
- release: 1\.1\.1\.1
- vendor: 1\.1\.1
- keyword substitution: kv
- total revisions: 2; selected revisions: 2
- description:
- ----------------------------
- revision 1\.1
- date: 1971/07/0[3-5] [0-9][0-9]:43:[0-9][0-9]; author: ${username}; state: Exp;
- branches: 1\.1\.1;
- Initial revision
- ----------------------------
- revision 1\.1\.1\.1
- date: 1971/07/0[3-5] [0-9][0-9]:43:[0-9][0-9]; author: ${username}; state: Exp; lines: ${PLUS}0 -0
- import-it
- ============================================================================="
- cd ..
- # Now tests of absolute pathnames and .. as repository directory.
- cd ../1
- dotest_fail importc-10 \
- "${testcvs} import -m imp ../other vendor release2" \
- "${PROG} \[[a-z]* aborted\]: directory \.\./other not relative within the repository"
- dotest_fail importc-11 \
- "${testcvs} import -m imp ${TESTDIR}/other vendor release3" \
- "${PROG} \[[a-z]* aborted\]: directory ${TESTDIR}/other not relative within the repository"
- dotest_fail importc-12 "test -d ${TESTDIR}/other" ""
- cd ..
- rm -r 1 2
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- import-CVS)
- mkdir import-CVS
- cd import-CVS
- touch file1 file2 file3
- dotest_fail import-CVS-1 "$testcvs import -mimport CVS vtag rtag" \
- "$PROG import: The word \`CVS' is reserved by CVS and may not be used
- $PROG \[import aborted\]: as a directory in a path or as a file name\."
- dotest_fail import-CVS-1b \
- "$testcvs import -mimport CVS-/CVS vtag rtag" \
- "$PROG import: The word \`CVS' is reserved by CVS and may not be used
- $PROG \[import aborted\]: as a directory in a path or as a file name\."
- mkdir sdir
- mkdir sdir/CVS
- touch CVS sdir/CVS/file4 sdir/CVS/file5 sdir/file6 sdir/file7
- # Calling the imported directory import-CVS is dual purpose in the
- # following test. It makes sure the path test which matched above
- # wasn't too strict.
- dotest_sort import-CVS-2 \
- "$testcvs import -I! -mimport import-CVS vtag rtag" \
- "
- I import-CVS/CVS
- I import-CVS/sdir/CVS
- N import-CVS/file1
- N import-CVS/file2
- N import-CVS/file3
- N import-CVS/sdir/file6
- N import-CVS/sdir/file7
- No conflicts created by this import
- $PROG import: Importing $CVSROOT_DIRNAME/import-CVS/sdir"
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ..
- rm -r import-CVS
- rm -rf $CVSROOT_DIRNAME/import-CVS
- ;;
- import-quirks)
- # Short tests of quirky import behavior.
- #
- # For a list of other import tests with short descriptions, see the
- # comment header of the "import" test.
- mkdir import-quirks
- cd import-quirks
- touch file1 file2 file3
- # CVS prior to 1.11.18 and 1.12.10 used to happily import to
- # "branch 1.1", creating RCS archives with revisions like,
- # "1.1..1". That double-dot is *not* a typo.
- dotest_fail import-quirks-1 \
- "$testcvs import -b1.1. -mbad-bad-bad import-quirks VB RT" \
- "$PROG \[import aborted\]: Only numeric branch specifications with two dots are
- supported by import, not \`1\.1\.'\. For example: \`1\.1\.1'\."
- dotest_fail import-quirks-2 \
- "$testcvs import -b1.1.1.. -mbad-bad-bad import-quirks VB RT" \
- "$PROG \[import aborted\]: Only numeric branch specifications with two dots are
- supported by import, not \`1\.1\.1\.\.'\. For example: \`1\.1\.1'\."
- # Try a few odd numbers. This is hardly comprehensive.
- dotest_sort import-quirks-2 \
- "$testcvs import -b10.10.101 -mthis-ones-ok import-quirks-2 VB RT" \
- "
- N import-quirks-2/file1
- N import-quirks-2/file2
- N import-quirks-2/file3
- No conflicts created by this import"
- dotest_sort import-quirks-3 \
- "$testcvs import -b2345678901.2345678901.2345678901 -mthis-ones-ok import-quirks-3 VB RT" \
- "
- N import-quirks-3/file1
- N import-quirks-3/file2
- N import-quirks-3/file3
- No conflicts created by this import"
- dotest_sort import-quirks-4 \
- "$testcvs import -b1.1.2 -mthis-ones-ok import-quirks-4 VB RT" \
- "
- N import-quirks-4/file1
- N import-quirks-4/file2
- N import-quirks-4/file3
- No conflicts created by this import"
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- cd ..
- rm -r import-quirks
- rm -rf $CVSROOT_DIRNAME/import-quirks-2 \
- $CVSROOT_DIRNAME/import-quirks-3 \
- $CVSROOT_DIRNAME/import-quirks-4
- ;;
- import-after-initial)
- # Properly handle the case in which the first version of a
- # file is created by a regular cvs add and commit, and there
- # is a subsequent cvs import of the same file. cvs update with
- # a date tag must resort to searching the vendor branch only if
- # the initial version of the file was created at the same time
- # as the initial version on the vendor branch.
- mkdir 1; cd 1
- module=x
- echo > unused-file
- # Create the module.
- dotest import-after-initial-1 \
- "$testcvs -Q import -m. $module X Y" ''
- file=m
- # Check it out and add a file.
- dotest import-after-initial-2 "$testcvs -Q co $module" ''
- cd $module
- echo original > $file
- dotest import-after-initial-3 "${testcvs} -Q add $file" ""
- dotest import-after-initial-4 "${testcvs} -Q ci -m. $file" \
- "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
- done
- Checking in $file;
- ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
- initial revision: 1\.1
- done"
- # Delay a little so the following import isn't done in the same
- # second as the preceding commit.
- sleep 2
- # Do the first import of $file *after* $file already has an
- # initial version.
- mkdir sub
- cd sub
- echo newer-via-import > $file
- dotest import-after-initial-5 \
- "$testcvs -Q import -m. $module X Y2" ''
- cd ..
- # Sleep a second so we're sure to be after the second of the import.
- sleep 1
- dotest import-after-initial-6 \
- "$testcvs -Q update -p -D now $file" 'original'
- cd ../..
- rm -rf 1
- rm -rf ${CVSROOT_DIRNAME}/$module
- ;;
- branch-after-import)
- # Test branching after an import via both cvs tag -b and
- # cvs add to verify that the HEAD remains at 1.1.1.1
- # This was a FreeBSD bug documented at the URL:
- # http://www.freebsd.org/cgi/query-pr.cgi?pr=4033
- mkdir branch-after-import
- cd branch-after-import
- # OK, first we get some sources from the NetMunger project,
- # and import them into the 1.1.1 vendor branch.
- mkdir imp-dir
- cd imp-dir
- echo 'OpenMunger sources' >file1
- echo 'OpenMunger sources' >file2
- dotest_sort branch-after-import-1 \
- "${testcvs} import -m add first-dir openmunger openmunger-1_0" \
- '
- N first-dir/file1
- N first-dir/file2
- No conflicts created by this import'
- cd ..
- # Next checkout the new module
- dotest branch-after-import-2 \
- "${testcvs} -q co first-dir" \
- 'U first-dir/file1
- U first-dir/file2'
- cd first-dir
- # Branch tag the file1 and cvs add file2,
- # the branch should remain the same in both cases
- # such that a new import will not require a conflict
- # resolution.
- dotest branch-after-import-3 \
- "${testcvs} tag -b TESTTOTRON file1" \
- 'T file1'
- dotest branch-after-import-4 \
- "$testcvs -q update -r TESTTOTRON" \
- "[UP] file1
- $PROG update: file2 is no longer in the repository"
- cp ../imp-dir/file2 .
- dotest branch-after-import-5 \
- "${testcvs} add file2" \
- "${PROG} add: scheduling file .file2. for addition on branch .TESTTOTRON.
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest branch-after-import-6 \
- "${testcvs} commit -m cvs-add file2" \
- "Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: 1\.1\.1\.1\.2\.2; previous revision: 1\.1\.1\.1\.2\.1
- done"
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ../..
- rm -r branch-after-import
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- join)
- # Test doing joins which involve adding and removing files.
- # Variety of scenarios (see list below), in the context of:
- # * merge changes from T1 to T2 into the main line
- # * merge changes from branch 'branch' into the main line
- # * merge changes from branch 'branch' into branch 'br2'.
- # See also binfile2, which does similar things with binary files.
- # See also join2, which tests joining (and update -A) on only
- # a single file, rather than a directory.
- # See also rmadd2, which tests -j cases not involving branches
- # (e.g. undoing a commit)
- # See also join3, which tests some cases involving the greatest
- # common ancestor. Here is a list of tests according to branch
- # topology:
- #
- # --->bp---->trunk too many to mention
- # \----->branch
- #
- # /----->branch1
- # --->bp---->trunk multibranch, multibranch2
- # \----->branch2
- #
- # --->bp1----->bp2---->trunk join3
- # \->br1 \->br2
- #
- # --->bp1----->trunk
- # \----bp2---->branch branches
- # \------>branch-of-branch
- # We check merging changes from T1 to T2 into the main line.
- # Here are the interesting cases I can think of:
- # 1) File added between T1 and T2, not on main line.
- # File should be marked for addition.
- # 2) File added between T1 and T2, also added on main line.
- # Conflict.
- # 3) File removed between T1 and T2, unchanged on main line.
- # File should be marked for removal.
- # 4) File removed between T1 and T2, modified on main line.
- # If mod checked in, file should be marked for removal.
- # If mod still in working directory, conflict.
- # 5) File removed between T1 and T2, was never on main line.
- # Nothing should happen.
- # 6) File removed between T1 and T2, also removed on main line.
- # Nothing should happen.
- # 7) File not added between T1 and T2, added on main line.
- # Nothing should happen.
- # 8) File not modified between T1 and T2, removed on main line.
- # Nothing should happen.
- # 9) File modified between T1 and T2, removed on main line.
- # Conflict.
- # 10) File was never on branch, removed on main line.
- # Nothing should happen.
- # We also check merging changes from a branch into the main
- # line. Here are the interesting cases:
- # 1) File added on branch, not on main line.
- # File should be marked for addition.
- # 2) File added on branch, also added on main line.
- # Conflict.
- # 3) File removed on branch, unchanged on main line.
- # File should be marked for removal.
- # 4) File removed on branch, modified on main line.
- # Conflict.
- # 5) File removed on branch, was never on main line.
- # Nothing should happen.
- # 6) File removed on branch, also removed on main line.
- # Nothing should happen.
- # 7) File added on main line, not added on branch.
- # Nothing should happen.
- # 8) File removed on main line, not modified on branch.
- # Nothing should happen.
- # 9) File modified on branch, removed on main line.
- # Conflict.
- # 10) File was never on branch, removed on main line.
- # Nothing should happen.
- # In the tests below, fileN represents case N in the above
- # lists.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir 1
- cd 1
- dotest join-1 "${testcvs} -q co first-dir" ''
- cd first-dir
- # Add two files.
- echo 'first revision of file3' > file3
- echo 'first revision of file4' > file4
- echo 'first revision of file6' > file6
- echo 'first revision of file8' > file8
- echo 'first revision of file9' > file9
- dotest join-2 "${testcvs} add file3 file4 file6 file8 file9" \
- "${PROG}"' add: scheduling file `file3'\'' for addition
- '"${PROG}"' add: scheduling file `file4'\'' for addition
- '"${PROG}"' add: scheduling file `file6'\'' for addition
- '"${PROG}"' add: scheduling file `file8'\'' for addition
- '"${PROG}"' add: scheduling file `file9'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
- dotest join-3 "${testcvs} -q commit -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
- done
- Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
- done
- Checking in file6;
- ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file8,v
- done
- Checking in file8;
- ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file9,v
- done
- Checking in file9;
- ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
- initial revision: 1\.1
- done"
- # Make a branch.
- dotest join-4 "${testcvs} -q tag -b branch ." \
- 'T file3
- T file4
- T file6
- T file8
- T file9'
- # Add file2, file7, and file10, modify file4, and remove
- # file6, file8, and file9.
- echo 'first revision of file2' > file2
- echo 'second revision of file4' > file4
- echo 'first revision of file7' > file7
- rm file6 file8 file9
- echo 'first revision of file10' > file10
- dotest join-5 "${testcvs} add file2 file7 file10" \
- "${PROG}"' add: scheduling file `file2'\'' for addition
- '"${PROG}"' add: scheduling file `file7'\'' for addition
- '"${PROG}"' add: scheduling file `file10'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
- dotest join-6 "${testcvs} rm file6 file8 file9" \
- "${PROG}"' remove: scheduling `file6'\'' for removal
- '"${PROG}"' remove: scheduling `file8'\'' for removal
- '"${PROG}"' remove: scheduling `file9'\'' for removal
- '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
- dotest join-7 "${testcvs} -q ci -mx ." \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
- done
- Checking in file10;
- ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 1\.1
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: 1\.2; previous revision: 1\.1
- done
- Removing file6;
- ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
- new revision: delete; previous revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
- done
- Checking in file7;
- ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
- initial revision: 1\.1
- done
- Removing file8;
- ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
- new revision: delete; previous revision: 1\.1
- done
- Removing file9;
- ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
- new revision: delete; previous revision: 1\.1
- done"
- # Remove file10
- dotest join-7a "${testcvs} rm -f file10" \
- "${PROG}"' remove: scheduling `file10'\'' for removal
- '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
- dotest join-7b "${testcvs} -q ci -mx ." \
- "Removing file10;
- ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
- new revision: delete; previous revision: 1\.1
- done"
- # Check out the branch.
- cd ../..
- mkdir 2
- cd 2
- dotest join-8 "${testcvs} -q co -r branch first-dir" \
- 'U first-dir/file3
- U first-dir/file4
- U first-dir/file6
- U first-dir/file8
- U first-dir/file9'
- cd first-dir
- # Modify the files on the branch, so that T1 is not an
- # ancestor of the main line, and add file5
- echo 'first branch revision of file3' > file3
- echo 'first branch revision of file4' > file4
- echo 'first branch revision of file5' > file5
- echo 'first branch revision of file6' > file6
- echo 'first branch revision of file9' > file9
- dotest join-9 "${testcvs} add file5" \
- "${PROG}"' add: scheduling file `file5'\'' for addition on branch `branch'\''
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest join-10 "${testcvs} -q ci -mx ." \
- "Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v
- done
- Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file6;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file6,v <-- file6
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file9;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file9,v <-- file9
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- # Tag the current revisions on the branch.
- dotest join-11 "${testcvs} -q tag T1 ." \
- 'T file3
- T file4
- T file5
- T file6
- T file8
- T file9'
- # Add file1 and file2, modify file9, and remove the other files.
- echo 'first branch revision of file1' > file1
- echo 'first branch revision of file2' > file2
- echo 'second branch revision of file9' > file9
- rm file3 file4 file5 file6
- dotest join-12 "${testcvs} add file1 file2" \
- "${PROG}"' add: scheduling file `file1'\'' for addition on branch `branch'\''
- '"${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
- '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
- dotest join-13 "${testcvs} rm file3 file4 file5 file6" \
- "${PROG}"' remove: scheduling `file3'\'' for removal
- '"${PROG}"' remove: scheduling `file4'\'' for removal
- '"${PROG}"' remove: scheduling `file5'\'' for removal
- '"${PROG}"' remove: scheduling `file6'\'' for removal
- '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
- dotest join-14 "${testcvs} -q ci -mx ." \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v <-- file1
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
- done
- Removing file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- new revision: delete; previous revision: 1\.1\.2\.1
- done
- Removing file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: delete; previous revision: 1\.1\.2\.1
- done
- Removing file5;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
- new revision: delete; previous revision: 1\.1\.2\.1
- done
- Removing file6;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file6,v <-- file6
- new revision: delete; previous revision: 1\.1\.2\.1
- done
- Checking in file9;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file9,v <-- file9
- new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
- done"
- # Tag the current revisions on the branch.
- dotest join-15 "${testcvs} -q tag T2 ." \
- 'T file1
- T file2
- T file8
- T file9'
- # Do a checkout with a merge.
- cd ../..
- mkdir 3
- cd 3
- dotest join-16 "$testcvs -q co -jT1 -jT2 first-dir" \
- "U first-dir/file1
- U first-dir/file2
- $PROG checkout: file first-dir/file2 exists, but has been added in revision T2
- U first-dir/file3
- $PROG checkout: scheduling first-dir/file3 for removal
- U first-dir/file4
- $PROG checkout: file first-dir/file4 has been removed in revision T2, but the destination is incompatibly modified
- C first-dir/file4
- U first-dir/file7
- $PROG checkout: file first-dir/file9 does not exist, but is present in revision T2"
- # Verify that the right changes have been scheduled.
- cd first-dir
- dotest_fail join-17 "$testcvs -q update" \
- 'A file1
- R file3
- C file4'
- # Modify file4 locally, and do an update with a merge.
- cd ../../1/first-dir
- echo 'third revision of file4' > file4
- dotest join-18 "$testcvs -q update -jT1 -jT2 ." \
- "U file1
- $PROG update: file file2 exists, but has been added in revision T2
- $PROG update: scheduling file3 for removal
- M file4
- $PROG update: file file4 has been removed in revision T2, but the destination is incompatibly modified
- C file4
- $PROG update: file file9 does not exist, but is present in revision T2"
- # Verify that the right changes have been scheduled.
- dotest_fail join-19 "$testcvs -q update" \
- 'A file1
- R file3
- C file4'
- # Do a checkout with a merge from a single revision.
- # FIXME: CVS currently gets this wrong. file2 has been
- # added on both the branch and the main line, and so should
- # be regarded as a conflict. However, given the way that
- # CVS sets up the RCS file, there is no way to distinguish
- # this case from the case of file2 having existed before the
- # branch was made. This could be fixed by reserving
- # a revision somewhere, perhaps 1.1, as an always dead
- # revision which can be used as the source for files added
- # on branches.
- cd ../../3
- rm -r first-dir
- dotest join-20 "$testcvs -q co -jbranch first-dir" \
- "U first-dir/file1
- U first-dir/file2
- RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
- retrieving revision 1\.1
- retrieving revision 1\.1\.2\.2
- Merging differences between 1\.1 and 1\.1\.2\.2 into file2
- U first-dir/file3
- $PROG checkout: scheduling first-dir/file3 for removal
- U first-dir/file4
- $PROG checkout: file first-dir/file4 has been removed in revision branch, but the destination is incompatibly modified
- C first-dir/file4
- U first-dir/file7
- $PROG checkout: file first-dir/file9 does not exist, but is present in revision branch"
- # Verify that the right changes have been scheduled.
- # The M file2 line is a bug; see above join-20.
- cd first-dir
- dotest_fail join-21 "$testcvs -q update" \
- 'A file1
- M file2
- R file3
- C file4'
- # Checkout the main line again.
- cd ../../1
- rm -r first-dir
- dotest join-22 "${testcvs} -q co first-dir" \
- 'U first-dir/file2
- U first-dir/file3
- U first-dir/file4
- U first-dir/file7'
- # Modify file4 locally, and do an update with a merge from a
- # single revision.
- # The file2 handling is a bug; see above join-20.
- cd first-dir
- echo 'third revision of file4' > file4
- dotest join-23 "$testcvs -q update -jbranch ." \
- "U file1
- RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
- retrieving revision 1\.1
- retrieving revision 1\.1\.2\.2
- Merging differences between 1\.1 and 1\.1\.2\.2 into file2
- $PROG update: scheduling file3 for removal
- M file4
- $PROG update: file file4 has been removed in revision branch, but the destination is incompatibly modified
- C file4
- $PROG update: file file9 does not exist, but is present in revision branch"
- # Verify that the right changes have been scheduled.
- # The M file2 line is a bug; see above join-20
- dotest_fail join-24 "$testcvs -q update" \
- 'A file1
- M file2
- R file3
- C file4'
- cd ..
- # Checkout the main line again and make a new branch which we
- # merge to.
- rm -r first-dir
- dotest join-25 "${testcvs} -q co first-dir" \
- 'U first-dir/file2
- U first-dir/file3
- U first-dir/file4
- U first-dir/file7'
- cd first-dir
- dotest join-26 "${testcvs} -q tag -b br2" \
- "T file2
- T file3
- T file4
- T file7"
- dotest join-27 "$testcvs -q update -r br2" \
- '[UP] file2
- [UP] file3
- [UP] file4
- [UP] file7'
- # The handling of file8 and file9 here look fishy to me. I don't
- # see why it should be different from the case where we merge to
- # the trunk (e.g. join-23).
- dotest join-28 "$testcvs -q update -j branch" \
- "U file1
- RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
- retrieving revision 1\.1
- retrieving revision 1\.1\.2\.2
- Merging differences between 1\.1 and 1\.1\.2\.2 into file2
- $PROG update: scheduling file3 for removal
- $PROG update: file file4 has been removed in revision branch, but the destination is incompatibly modified
- C file4
- U file8
- U file9"
- # Verify that the right changes have been scheduled.
- dotest_fail join-29 "$testcvs -q update" \
- "A file1
- M file2
- R file3
- C file4
- A file8
- A file9"
- # Checkout the mainline again to try updating and merging between two
- # branches in the same step
- # this seems a likely scenario - the user finishes up on branch and
- # updates to br2 and merges in the same step - and there was a bug
- # once that if the file was removed in the update then it wouldn't be
- # readded in the merge
- cd ..
- rm -rf first-dir
- dotest join-twobranch-1 "${testcvs} -q co -rbranch first-dir" \
- 'U first-dir/file1
- U first-dir/file2
- U first-dir/file8
- U first-dir/file9'
- cd first-dir
- dotest join-twobranch-2 "$testcvs -q update -rbr2 -jbranch" \
- "$PROG update: file1 is no longer in the repository
- U file1
- U file2
- RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
- retrieving revision 1\.1
- retrieving revision 1\.1\.2\.2
- Merging differences between 1\.1 and 1\.1\.2\.2 into file2
- U file3
- $PROG update: scheduling file3 for removal
- U file4
- $PROG update: file file4 has been removed in revision branch, but the destination is incompatibly modified
- C file4
- U file7
- $PROG update: file8 is no longer in the repository
- U file8
- $PROG update: file9 is no longer in the repository
- U file9"
- # Verify that the right changes have been scheduled.
- dotest_fail join-twobranch-3 "$testcvs -q update" \
- "A file1
- M file2
- R file3
- C file4
- A file8
- A file9"
- # Checkout the mainline again to try merging from the trunk
- # to a branch.
- cd ..
- rm -r first-dir
- dotest join-30 "${testcvs} -q co first-dir" \
- 'U first-dir/file2
- U first-dir/file3
- U first-dir/file4
- U first-dir/file7'
- cd first-dir
- # Tag the current revisions on the trunk.
- dotest join-31 "${testcvs} -q tag T3 ." \
- 'T file2
- T file3
- T file4
- T file7'
- # Modify file7.
- echo 'second revision of file7' > file7
- dotest join-32 "${testcvs} -q ci -mx ." \
- "Checking in file7;
- ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
- new revision: 1\.2; previous revision: 1\.1
- done"
- # And Tag again.
- dotest join-33 "${testcvs} -q tag T4 ." \
- 'T file2
- T file3
- T file4
- T file7'
- # Now update branch to T3.
- cd ../../2/first-dir
- dotest join-34 "${testcvs} -q up -jT3" \
- "${PROG} update: file file4 does not exist, but is present in revision T3
- U file7"
- # Verify that the right changes have been scheduled.
- dotest join-35 "${testcvs} -q update" \
- 'A file7'
- # Now update to T4.
- # This is probably a bug, although in this particular case it just
- # happens to do the right thing; see above join-20.
- dotest join-36 "${testcvs} -q up -j T3 -j T4" \
- "A file7
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into file7"
- # Verify that the right changes have been scheduled.
- dotest join-37 "${testcvs} -q update" \
- 'A file7'
- cd ../..
- rm -r 1 2 3
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- join2)
- # More joining tests.
- # First the usual setup; create a directory first-dir, a file
- # first-dir/file1, and a branch br1.
- mkdir 1; cd 1
- dotest join2-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest join2-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- echo 'initial contents of file1' >file1
- dotest join2-3 "${testcvs} add file1" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest join2-4 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- dotest join2-5 "${testcvs} -q tag -b br1" "T file1"
- dotest join2-6 "$testcvs -q update -r br1" '[UP] file1'
- echo 'modify on branch' >>file1
- touch bradd
- dotest join2-6a "${testcvs} add bradd" \
- "${PROG} add: scheduling file .bradd. for addition on branch .br1.
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest join2-7 "${testcvs} -q ci -m modify" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
- done
- Checking in bradd;
- ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v <-- bradd
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- # Here is the unusual/pathological part. We switch back to
- # the trunk *for file1 only*, not for the whole directory.
- dotest join2-8 "${testcvs} -q update -A file1" '[UP] file1'
- dotest join2-9 "${testcvs} -q status file1" \
- "===================================================================
- File: file1 Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest join2-10 "cat CVS/Tag" "Tbr1"
- dotest join2-11 "${testcvs} -q update -j br1 file1" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- retrieving revision 1\.1
- retrieving revision 1\.1\.2\.1
- Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
- dotest join2-12 "cat file1" "initial contents of file1
- modify on branch"
- # We should have no sticky tag on file1
- dotest join2-13 "${testcvs} -q status file1" \
- "===================================================================
- File: file1 Status: Locally Modified
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest join2-14 "cat CVS/Tag" "Tbr1"
- # And the checkin should go to the trunk
- dotest join2-15 "${testcvs} -q ci -m modify file1" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.2; previous revision: 1\.1
- done"
- # OK, the above is all well and good and has worked for some
- # time. Now try the case where the file had been added on
- # the branch.
- dotest join2-16 "${testcvs} -q update -r br1" "[UP] file1"
- # The workaround is to update the whole directory.
- # The non-circumvented version won't work. The reason is that
- # update removes the entry from CVS/Entries, so of course we get
- # the tag from CVS/Tag and not Entries. I suppose maybe
- # we could invent some new format in Entries which would handle
- # this, but doing so, and handling it properly throughout
- # CVS, would be a lot of work and I'm not sure this case justifies
- # it.
- dotest join2-17-circumvent "${testcvs} -q update -A" \
- "${PROG} update: bradd is no longer in the repository
- [UP] file1"
- : dotest join2-17 "${testcvs} -q update -A bradd" \
- "${PROG} update: warning: bradd is not (any longer) pertinent"
- dotest join2-18 "${testcvs} -q update -j br1 bradd" "U bradd"
- dotest join2-19 "${testcvs} -q status bradd" \
- "===================================================================
- File: bradd Status: Locally Added
- Working revision: New file!
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest join2-20 "${testcvs} -q ci -m modify bradd" \
- "Checking in bradd;
- ${CVSROOT_DIRNAME}/first-dir/bradd,v <-- bradd
- new revision: 1\.2; previous revision: 1\.1
- done"
- cd ../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- join3)
- # See "join" for a list of other joining/branching tests.
- # First the usual setup; create a directory first-dir, a file
- # first-dir/file1, and a branch br1.
- mkdir 1; cd 1
- dotest join3-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest join3-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- echo 'initial contents of file1' >file1
- dotest join3-3 "${testcvs} add file1" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest join3-4 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- dotest join3-5 "${testcvs} -q tag -b br1" "T file1"
- dotest join3-6 "$testcvs -q update -r br1" '[UP] file1'
- echo 'br1:line1' >>file1
- dotest join3-7 "${testcvs} -q ci -m modify" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- # Now back to the trunk for:
- # another revision and another branch for file1.
- # add file2, which will exist on trunk and br2 but not br1.
- dotest join3-8 "${testcvs} -q update -A" "[UP] file1"
- echo 'trunk:line1' > file2
- dotest join3-8a "${testcvs} add file2" \
- "${PROG} add: scheduling file .file2. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- echo 'trunk:line1' >>file1
- dotest join3-9 "${testcvs} -q ci -m modify" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.2; previous revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 1\.1
- done"
- dotest join3-10 "${testcvs} -q tag -b br2" "T file1
- T file2"
- # Before we actually have any revision on br2, let's try a join
- dotest join3-11 "${testcvs} -q update -r br1" "[UP] file1
- ${PROG} update: file2 is no longer in the repository"
- dotest join3-12 "${testcvs} -q update -j br2" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into file1
- rcsmerge: warning: conflicts during merge
- U file2"
- dotest join3-13 "cat file1" \
- "initial contents of file1
- [<]<<<<<< file1
- br1:line1
- [=]======
- trunk:line1
- [>]>>>>>> 1\.2"
- rm file1
- # OK, we'll try the same thing with a revision on br2.
- dotest join3-14 "${testcvs} -q update -r br2 file1" \
- "${PROG} update: warning: file1 was lost
- U file1" "U file1"
- echo 'br2:line1' >>file1
- dotest join3-15 "${testcvs} -q ci -m modify file1" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.2\.2\.1; previous revision: 1\.2
- done"
- # OK, now we can join br2 to br1
- dotest join3-16 "${testcvs} -q update -r br1 file1" "[UP] file1"
- # It may seem odd, to merge a higher branch into a lower
- # branch, but in fact CVS defines the ancestor as 1.1
- # and so it merges both the 1.1->1.2 and 1.2->1.2.2.1 changes.
- # This seems like a reasonably plausible behavior.
- dotest join3-17 "${testcvs} -q update -j br2 file1" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- retrieving revision 1\.1
- retrieving revision 1\.2\.2\.1
- Merging differences between 1\.1 and 1\.2\.2\.1 into file1
- rcsmerge: warning: conflicts during merge"
- dotest join3-18 "cat file1" \
- "initial contents of file1
- [<]<<<<<< file1
- br1:line1
- [=]======
- trunk:line1
- br2:line1
- [>]>>>>>> 1\.2\.2\.1"
- cd ../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- join4)
- # Like join, but with local (uncommitted) modifications.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir 1
- cd 1
- dotest join4-1 "${testcvs} -q co first-dir" ''
- cd first-dir
- # Add two files.
- echo 'first revision of file3' > file3
- echo 'first revision of file4' > file4
- echo 'first revision of file6' > file6
- echo 'first revision of file8' > file8
- echo 'first revision of file9' > file9
- dotest join4-2 "${testcvs} add file3 file4 file6 file8 file9" \
- "${PROG}"' add: scheduling file `file3'\'' for addition
- '"${PROG}"' add: scheduling file `file4'\'' for addition
- '"${PROG}"' add: scheduling file `file6'\'' for addition
- '"${PROG}"' add: scheduling file `file8'\'' for addition
- '"${PROG}"' add: scheduling file `file9'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
- dotest join4-3 "${testcvs} -q commit -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
- done
- Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
- done
- Checking in file6;
- ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file8,v
- done
- Checking in file8;
- ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file9,v
- done
- Checking in file9;
- ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
- initial revision: 1\.1
- done"
- # Make a branch.
- dotest join4-4 "${testcvs} -q tag -b branch ." \
- 'T file3
- T file4
- T file6
- T file8
- T file9'
- # Add file10
- echo 'first revision of file10' > file10
- dotest join4-7a "${testcvs} add file10" \
- "${PROG}"' add: scheduling file `file10'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest join4-7b "${testcvs} -q ci -mx ." \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
- done
- Checking in file10;
- ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
- initial revision: 1\.1
- done"
- # Add file2 and file7, modify file4, and remove
- # file6, file8, file9, and file10.
- echo 'first revision of file2' > file2
- echo 'second revision of file4' > file4
- echo 'first revision of file7' > file7
- rm file6 file8 file9 file10
- dotest join4-5 "${testcvs} add file2 file7" \
- "${PROG}"' add: scheduling file `file2'\'' for addition
- '"${PROG}"' add: scheduling file `file7'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
- dotest join4-6 "${testcvs} rm file6 file8 file9 file10" \
- "${PROG}"' remove: scheduling `file6'\'' for removal
- '"${PROG}"' remove: scheduling `file8'\'' for removal
- '"${PROG}"' remove: scheduling `file9'\'' for removal
- '"${PROG}"' remove: scheduling `file10'\'' for removal
- '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
- # Check out the branch.
- cd ../..
- mkdir 2
- cd 2
- dotest join4-8 "${testcvs} -q co -r branch first-dir" \
- 'U first-dir/file3
- U first-dir/file4
- U first-dir/file6
- U first-dir/file8
- U first-dir/file9'
- cd first-dir
- # Modify the files on the branch, so that T1 is not an
- # ancestor of the main line, and add file5
- echo 'first branch revision of file3' > file3
- echo 'first branch revision of file4' > file4
- echo 'first branch revision of file5' > file5
- echo 'first branch revision of file6' > file6
- echo 'first branch revision of file9' > file9
- dotest join4-9 "${testcvs} add file5" \
- "${PROG}"' add: scheduling file `file5'\'' for addition on branch `branch'\''
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest join4-10 "${testcvs} -q ci -mx ." \
- "Checking in file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v
- done
- Checking in file5;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file6;
- ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Checking in file9;
- ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- # Tag the current revisions on the branch.
- dotest join4-11 "${testcvs} -q tag T1 ." \
- 'T file3
- T file4
- T file5
- T file6
- T file8
- T file9'
- # Add file1 and file2, modify file9, and remove the other files.
- echo 'first branch revision of file1' > file1
- echo 'first branch revision of file2' > file2
- echo 'second branch revision of file9' > file9
- rm file3 file4 file5 file6
- dotest join4-12 "${testcvs} add file1 file2" \
- "${PROG}"' add: scheduling file `file1'\'' for addition on branch `branch'\''
- '"${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
- '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
- dotest join4-13 "${testcvs} rm file3 file4 file5 file6" \
- "${PROG}"' remove: scheduling `file3'\'' for removal
- '"${PROG}"' remove: scheduling `file4'\'' for removal
- '"${PROG}"' remove: scheduling `file5'\'' for removal
- '"${PROG}"' remove: scheduling `file6'\'' for removal
- '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
- dotest join4-14 "${testcvs} -q ci -mx ." \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v <-- file1
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v <-- file2
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done
- Removing file3;
- ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
- new revision: delete; previous revision: 1\.1\.2\.1
- done
- Removing file4;
- ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
- new revision: delete; previous revision: 1\.1\.2\.1
- done
- Removing file5;
- ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
- new revision: delete; previous revision: 1\.1\.2\.1
- done
- Removing file6;
- ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
- new revision: delete; previous revision: 1\.1\.2\.1
- done
- Checking in file9;
- ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
- new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
- done"
- # Tag the current revisions on the branch.
- dotest join4-15 "${testcvs} -q tag T2 ." \
- 'T file1
- T file2
- T file8
- T file9'
- # Modify file4 locally, and do an update with a merge.
- cd ../../1/first-dir
- echo 'third revision of file4' > file4
- dotest join4-18 "$testcvs -q update -jT1 -jT2 ." \
- "U file1
- R file10
- A file2
- $PROG update: file file2 exists, but has been added in revision T2
- $PROG update: scheduling file3 for removal
- M file4
- $PROG update: file file4 has been removed in revision T2, but the destination is incompatibly modified
- C file4
- R file6
- A file7
- R file8
- R file9
- $PROG update: file file9 does not exist, but is present in revision T2"
- # Verify that the right changes have been scheduled.
- dotest_fail join4-19 "${testcvs} -q update" \
- 'A file1
- R file10
- A file2
- R file3
- C file4
- R file6
- A file7
- R file8
- R file9'
- cd ../..
- rm -r 1 2
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- join5)
- # This test verifies that CVS can handle filenames starting with a
- # dash (`-') properly. What used to happen was that CVS handled it
- # just fine, until it went to pass them as arguments to the diff
- # library, at which point it neglected to pass `--' before the file
- # list, causing the diff library to attempt to interpret the file
- # name as an argument.
- mkdir join5; cd join5
- mkdir 1; cd 1
- dotest join5-init-1 "${testcvs} -Q co -l ."
- mkdir join5
- dotest join5-init-2 "${testcvs} -Q add join5"
- cd join5
- echo "there once was a file from harrisburg" >-file
- echo "who's existance it seems was quiteabsurd" >>-file
- dotest join5-init-3 "${testcvs} -Q add -- -file"
- dotest join5-init-4 "${testcvs} -q ci -minitial" \
- "RCS file: ${CVSROOT_DIRNAME}/join5/-file,v
- done
- Checking in -file;
- ${CVSROOT_DIRNAME}/join5/-file,v <-- -file
- initial revision: 1\.1
- done"
- cd ../..
- mkdir 2; cd 2
- dotest join5-init-5 "${testcvs} -Q co join5"
- cd join5
- echo "it tested for free" >>-file
- echo "when paid it should be" >>-file
- dotest join5-init-4 "${testcvs} -q ci -msecond" \
- "Checking in -file;
- ${CVSROOT_DIRNAME}/join5/-file,v <-- -file
- new revision: 1\.2; previous revision: 1\.1
- done"
- cd ../..
- cd 1/join5
- echo "but maybe it could charge bytheword" >>-file
- # This is the test that used to spew complaints from diff3:
- dotest join5 "${testcvs} up" \
- "${PROG} update: Updating \.
- RCS file: ${CVSROOT_DIRNAME}/join5/-file,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into -file
- rcsmerge: warning: conflicts during merge
- ${PROG} update: conflicts found in -file
- C -file"
- cd ../..
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ..
- rm -r join5
- rm -rf ${CVSROOT_DIRNAME}/join5
- ;;
- join6)
- mkdir join6; cd join6
- mkdir 1; cd 1
- dotest join6-init-1 "${testcvs} -Q co -l ."
- mkdir join6
- dotest join6-init-2 "${testcvs} -Q add join6"
- cd join6
- echo aaa >temp.txt
- echo bbb >>temp.txt
- echo ccc >>temp.txt
- dotest join6-1 "${testcvs} -Q add temp.txt"
- dotest join6-2 "${testcvs} -q commit -minitial temp.txt" \
- "RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
- done
- Checking in temp\.txt;
- ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
- initial revision: 1\.1
- done"
- cp temp.txt temp2.txt
- echo ddd >>temp.txt
- dotest join6-3 "${testcvs} -q commit -madd temp.txt" \
- "Checking in temp\.txt;
- ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
- new revision: 1\.2; previous revision: 1\.1
- done"
- # The case where the merge target is up-to-date and its base revision
- # matches the second argument to -j: CVS doesn't bother attempting
- # the merge since it already knows that the target contains the
- # change.
- dotest join6-3.3 "${testcvs} update -j1.1 -j1.2 temp.txt" \
- "temp\.txt already contains the differences between 1\.1 and 1\.2"
- dotest join6-3.4 "${testcvs} diff temp.txt" ""
- # The case where the merge target is modified but already contains
- # the change.
- echo bbb >temp.txt
- echo ccc >>temp.txt
- echo ddd >>temp.txt
- dotest join6-3.5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
- "M temp\.txt
- RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into temp\.txt
- temp\.txt already contains the differences between 1\.1 and 1\.2"
- dotest_fail join6-3.6 "${testcvs} diff temp.txt" \
- "Index: temp\.txt
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
- retrieving revision 1\.2
- diff -r1\.2 temp.txt
- 1d0
- < aaa"
- cp temp2.txt temp.txt
- dotest_fail join6-4 "${testcvs} diff temp.txt" \
- "Index: temp.txt
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
- retrieving revision 1\.2
- diff -r1\.2 temp\.txt
- 4d3
- < ddd"
- dotest join6-5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
- "M temp\.txt
- RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into temp\.txt"
- dotest join6-6 "${testcvs} diff temp.txt" ""
- mv temp.txt temp3.txt
- dotest join6-7 "sed 's/ddd/dddd/' < temp3.txt > temp.txt" ""
- dotest join6-8 "${testcvs} update -j1.1 -j1.2 temp.txt" \
- "M temp\.txt
- RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into temp\.txt
- rcsmerge: warning: conflicts during merge"
- dotest_fail join6-9 "${testcvs} diff temp.txt" \
- "Index: temp\.txt
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
- retrieving revision 1\.2
- diff -r1\.2 temp\.txt
- 3a4,6
- > <<<<<<< temp\.txt
- > dddd
- > =======
- 4a8
- > >>>>>>> 1\.2"
- cp temp2.txt temp.txt
- dotest join6-10 "${testcvs} -q ci -m del temp.txt" \
- "Checking in temp\.txt;
- ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
- new revision: 1\.3; previous revision: 1\.2
- done"
- cp temp3.txt temp.txt
- dotest_fail join6-11 "${testcvs} diff temp.txt" \
- "Index: temp\.txt
- ===================================================================
- RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
- retrieving revision 1\.3
- diff -r1\.3 temp\.txt
- 3a4
- > ddd"
- dotest join6-12 "${testcvs} update -j1.2 -j1.3 temp.txt" \
- "M temp\.txt
- RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
- retrieving revision 1\.2
- retrieving revision 1\.3
- Merging differences between 1\.2 and 1\.3 into temp\.txt"
- dotest join6-13 "${testcvs} diff temp.txt" ""
- # The case where the merge target wasn't created until after the
- # first tag was applied
- rm temp2.txt temp3.txt
- dotest join6-20 "${testcvs} -q tag -r1.1 t1" \
- "T temp.txt"
- echo xxx >temp2.txt
- dotest join6-21 "${testcvs} -Q add temp2.txt"
- dotest join6-22 "${testcvs} -q ci -m." \
- "RCS file: ${CVSROOT_DIRNAME}/join6/temp2.txt,v
- done
- Checking in temp2\.txt;
- ${CVSROOT_DIRNAME}/join6/temp2\.txt,v <-- temp2\.txt
- initial revision: 1\.1
- done"
- dotest join6-23 "${testcvs} -q tag t2" \
- "T temp.txt
- T temp2.txt"
- echo xxx >>temp.txt
- dotest join6-24 "${testcvs} -q ci -m." \
- "Checking in temp\.txt;
- ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
- new revision: 1\.4; previous revision: 1\.3
- done"
- dotest join6-25 "${testcvs} -q up -jt1 -jt2" \
- "RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
- retrieving revision 1\.1
- retrieving revision 1\.3
- Merging differences between 1\.1 and 1\.3 into temp.txt
- temp.txt already contains the differences between 1\.1 and 1\.3
- temp2.txt already contains the differences between creation and 1\.1"
- # Now for my next trick: delete the file, recreate it, and
- # try to merge
- dotest join6-30 "${testcvs} -q rm -f temp2.txt" \
- "${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest join6-31 "${testcvs} -q ci -m. temp2.txt" \
- "Removing temp2\.txt;
- ${CVSROOT_DIRNAME}/join6/temp2\.txt,v <-- temp2\.txt
- new revision: delete; previous revision: 1\.1
- done"
- echo new >temp2.txt
- # FIXCVS: Local and remote really shouldn't be different and there
- # really shouldn't be two different status lines for temp2.txt
- if $remote; then
- dotest_fail join6-32 "${testcvs} -q up -jt1 -jt2" \
- "? temp2\.txt
- RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
- retrieving revision 1\.1
- retrieving revision 1\.3
- Merging differences between 1\.1 and 1\.3 into temp.txt
- temp.txt already contains the differences between 1\.1 and 1\.3
- ${PROG} update: move away \./temp2\.txt; it is in the way
- C temp2\.txt"
- else
- dotest join6-32 "${testcvs} -q up -jt1 -jt2" \
- "RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
- retrieving revision 1\.1
- retrieving revision 1\.3
- Merging differences between 1\.1 and 1\.3 into temp.txt
- temp.txt already contains the differences between 1\.1 and 1\.3
- ${PROG} update: use .${PROG} add. to create an entry for temp2\.txt
- U temp2\.txt
- ? temp2\.txt"
- fi
- cd ../../..
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- rm -r join6
- rm -rf ${CVSROOT_DIRNAME}/join6
- ;;
- join7)
- # This test deals with joins that happen with the -n switch
- mkdir join7; cd join7
- mkdir impdir; cd impdir
- echo aaa >temp.txt
- echo bbb >>temp.txt
- echo ccc >>temp.txt
- dotest join7-1 \
- "${testcvs} -Q import -minitial join7 vendor vers-1" \
- ""
- cd ..
- dotest join7-2 "${testcvs} -Q co join7" ""
- cd join7
- echo ddd >> temp.txt
- dotest join7-3 "${testcvs} -Q ci -madded-line temp.txt" \
- "Checking in temp.txt;
- $CVSROOT_DIRNAME/join7/temp.txt,v <-- temp.txt
- new revision: 1\.2; previous revision: 1\.1
- done"
- cd ../impdir
- echo aaaa >temp.txt
- echo bbbb >>temp.txt
- echo ccc >>temp.txt
- echo eee >>temp.txt
- dotest join7-4 \
- "${testcvs} -Q import -minitial join7 vendor vers-2" \
- ""
- cd ../join7
- dotest join7-5 \
- "${testcvs} -n update -jvers-1 -jvers-2 temp.txt" \
- "RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
- retrieving revision 1\.1\.1\.1
- retrieving revision 1\.1\.1\.2
- Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
- rcsmerge: warning: conflicts during merge"
- touch temp.txt
- dotest join7-6 "${testcvs} -n update -jvers-1 -jvers-2 temp.txt" \
- "RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
- retrieving revision 1\.1\.1\.1
- retrieving revision 1\.1\.1\.2
- Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
- rcsmerge: warning: conflicts during merge" \
- "RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
- retrieving revision 1\.1\.1\.1
- retrieving revision 1\.1\.1\.2
- Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
- rcsmerge: warning: conflicts during merge"
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ../..
- rm -r join7
- rm -rf $CVSROOT_DIRNAME/join7
- ;;
- join8)
- # In this test case, we have 2 projects, one called "pvcs" and one
- # called "project". The "pvcs" project has modified the file, while
- # the "project" project has caused a deletion. When "project" is
- # merged into "pvcs", we expect CVS to detect a conflict.
- mkdir join8; cd join8
- mkdir combine
- mkdir base
- mkdir pvcs
- mkdir project
-
- echo "aaa" >base/file.txt
- echo "bbb" >pvcs/file.txt
- echo "ccc" >project/xxx.txt
-
- cd base
- dotest join8-1 \
- "$testcvs import -b 1.1.101 -ko -m 'base import' join8 base base-1" \
- "N join8/file\.txt
- No conflicts created by this import"
-
- cd ../pvcs
- dotest join8-2 \
- "$testcvs import -b 1.1.201 -ko -m 'pvcs import' join8 pvcs pvcs-1" \
- "C join8/file\.txt
- 1 conflicts created by this import.
- Use the following command to help the merge:
- $PROG checkout -j<prev_rel_tag> -jpvcs-1 join8"
- cd ../project
- dotest join8-3 \
- "$testcvs import -b 1.1.301 -ko -m 'project import' join8 project project-1" \
- "N join8/xxx\.txt
- No conflicts created by this import"
- cd ..
- dotest join8-4 \
- "$testcvs checkout -r pvcs-1 -j base-1 -j project-1 -d combine join8" \
- "$PROG checkout: Updating combine
- U combine/file\.txt
- $PROG checkout: file combine/file\.txt has been removed in revision project-1, but the destination is incompatibly modified
- C combine/file.txt
- U combine/xxx\.txt"
- dotest join8-5 \
- "$testcvs -Q up -pr base-1 combine/file.txt >combine/file.txt"
- dotest join8-6 \
- "$testcvs up -j base-1 -j project-1 combine" \
- "$PROG update: Updating combine
- M combine/file\.txt
- $PROG update: scheduling combine/file\.txt for removal
- A combine/xxx\.txt
- $PROG update: file combine/xxx\.txt exists, but has been added in revision project-1"
- cd ..
-
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
-
- rm -r join8
- rm -rf $CVSROOT_DIRNAME/join8
- ;;
- join9)
- # In this test case, we have 2 projects, one called "pvcs" and one
- # called "project". The "pvcs" project has not modified the file,
- # while the "project" project has caused a deletion. When "project"
- # is merged into "pvcs", we expect CVS to remove the file without
- # fuss, as there is no conflict.
- mkdir join9; cd join9
- mkdir combine
- mkdir base
- mkdir pvcs
- mkdir project
-
- echo "aaa" >base/file.txt
- echo "aaa" >pvcs/file.txt
- echo "ccc" >project/xxx.txt
-
- cd base
- dotest join9-1 \
- "$testcvs import -b 1.1.101 -ko -m 'base import' join9 base base-1" \
- "N join9/file\.txt
- No conflicts created by this import"
- cd ../pvcs
- dotest join9-2 \
- "$testcvs import -b 1.1.201 -ko -m 'pvcs import' join9 pvcs pvcs-1" \
- "C join9/file\.txt
- 1 conflicts created by this import.
- Use the following command to help the merge:
- $PROG checkout -j<prev_rel_tag> -jpvcs-1 join9"
- cd ../project
- dotest join9-3 \
- "$testcvs import -b 1.1.301 -ko -m 'project import' join9 project project-1" \
- "N join9/xxx\.txt
- No conflicts created by this import"
- cd ..
- dotest join9-4 \
- "$testcvs checkout -r pvcs-1 -j base-1 -j project-1 -d combine join9" \
- "$PROG checkout: Updating combine
- U combine/file\.txt
- $PROG checkout: scheduling combine/file\.txt for removal
- U combine/xxx\.txt"
- cd ..
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- rm -r join9
- rm -rf $CVSROOT_DIRNAME/join9
- ;;
- join-readonly-conflict)
- # Previously, only tests 1 & 11 were being tested. I added the
- # intermediate dotest's to try and diagnose a different failure
- #
- # Demonstrate that cvs-1.9.29 can fail on 2nd and subsequent
- # conflict-evoking join attempts.
- # Even with that version of CVS, This test failed only in
- # client-server mode, and would have been noticed in normal
- # operation only for files that were read-only (either due to
- # use of cvs' global -r option, setting the CVSREAD envvar,
- # or use of watch lists).
- mkdir join-readonly-conflict; cd join-readonly-conflict
- dotest join-readonly-conflict-1 "$testcvs -q co -l ." ''
- module=join-readonly-conflict
- mkdir $module
- $testcvs -q add $module >>$LOGFILE 2>&1
- cd $module
- file=m
- echo trunk > $file
- dotest join-readonly-conflict-2 "$testcvs -Q add $file" ''
- dotest join-readonly-conflict-3 "$testcvs -q ci -m . $file" \
- "RCS file: $CVSROOT_DIRNAME/$module/$file,v
- done
- Checking in $file;
- $CVSROOT_DIRNAME/$module/$file,v <-- $file
- initial revision: 1\.1
- done"
- dotest join-readonly-conflict-4 "$testcvs tag -b B $file" "T $file"
- dotest join-readonly-conflict-5 "$testcvs -q update -rB $file" \
- "[UP] $file"
- echo branch B > $file
- dotest join-readonly-conflict-6 "$testcvs -q ci -m . $file" \
- "Checking in $file;
- $CVSROOT_DIRNAME/$module/$file,v <-- $file
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- rm $file
- dotest join-readonly-conflict-7 "$testcvs -Q update -A $file" ''
- # Make sure $file is read-only. This can happen more realistically
- # via patch -- which could be used to apply a delta, yet would
- # preserve a file's read-only permissions.
- echo conflict > $file; chmod u-w $file
- dotest join-readonly-conflict-8 "$testcvs update -r B $file" \
- "RCS file: $CVSROOT_DIRNAME/$module/$file,v
- retrieving revision 1\.1
- retrieving revision 1\.1\.2\.1
- Merging differences between 1\.1 and 1\.1\.2\.1 into $file
- rcsmerge: warning: conflicts during merge
- ${PROG} update: conflicts found in $file
- C $file"
- # restore to the trunk
- rm -f $file
- dotest join-readonly-conflict-9 "$testcvs -Q update -A $file" ''
- # This one would fail because cvs couldn't open the existing
- # (and read-only) .# file for writing.
- echo conflict > $file
- # verify that the backup file is not writable
- if test -w ".#$file.1.1"; then
- fail "join-readonly-conflict-10 : .#$file.1.1 is writable"
- else
- pass "join-readonly-conflict-10"
- fi
- dotest join-readonly-conflict-11 "$testcvs update -r B $file" \
- "RCS file: $CVSROOT_DIRNAME/$module/$file,v
- retrieving revision 1\.1
- retrieving revision 1\.1\.2\.1
- Merging differences between 1\.1 and 1\.1\.2\.1 into $file
- rcsmerge: warning: conflicts during merge
- ${PROG} update: conflicts found in $file
- C m"
- cd ../..
- if $keep; then :; else
- rm -rf join-readonly-conflict
- rm -rf $CVSROOT_DIRNAME/$module
- fi
- ;;
- join-admin)
- mkdir 1; cd 1
- dotest join-admin-1 "$testcvs -q co -l ." ''
- module=x
- mkdir $module
- $testcvs -q add $module >>$LOGFILE 2>&1
- cd $module
- # Create a file so applying the first tag works.
- echo foo > a
- $testcvs -Q add a > /dev/null 2>&1
- $testcvs -Q ci -m. a > /dev/null 2>&1
- $testcvs -Q tag -b B
- $testcvs -Q tag -b M1
- echo '$''Id$' > b
- $testcvs -Q add b > /dev/null 2>&1
- $testcvs -Q ci -m. b > /dev/null 2>&1
- $testcvs -Q tag -b M2
- $testcvs -Q update -r B
- $testcvs -Q update -kk -jM1 -jM2
- $testcvs -Q ci -m. b >/dev/null 2>&1
- $testcvs -Q update -A
- # Verify that the -kk flag from the update did not
- # propagate to the repository.
- dotest join-admin-1 "$testcvs status b" \
- "===================================================================
- File: b Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/x/b,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- cd ../..
- rm -rf 1
- rm -rf ${CVSROOT_DIRNAME}/$module
- ;;
- join-admin-2)
- # Show that when a merge (via update -kk -jtag1 -jtag2) first
- # removes a file, then modifies another containing an $Id...$ line,
- # the resulting file contains the unexpanded `$Id.$' string, as
- # -kk requires.
- mkdir 1; cd 1
- dotest join-admin-2-1 "$testcvs -q co -l ." ''
- module=x
- mkdir $module
- dotest join-admin-2-2 "$testcvs -q add $module" \
- "Directory ${CVSROOT_DIRNAME}/x added to the repository"
- cd $module
- # Create a file so applying the first tag works.
- echo '$''Id$' > e0
- cp e0 e
- dotest join-admin-2-3 "$testcvs -Q add e" ''
- dotest join-admin-2-4 "$testcvs -Q ci -m. e" \
- "RCS file: ${CVSROOT_DIRNAME}/x/e,v
- done
- Checking in e;
- ${CVSROOT_DIRNAME}/x/e,v <-- e
- initial revision: 1\.1
- done"
- dotest join-admin-2-5 "$testcvs -Q tag -b T" '' "${QUESTION} e0"
- dotest join-admin-2-6 "$testcvs -Q update -r T" '' "${QUESTION} e0"
- cp e0 e
- dotest join-admin-2-7 "$testcvs -Q ci -m. e" \
- "Checking in e;
- ${CVSROOT_DIRNAME}/x/e,v <-- e
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- dotest join-admin-2-8 "$testcvs -Q update -A" '' "${QUESTION} e0"
- dotest join-admin-2-9 "$testcvs -Q tag -b M1" '' "${QUESTION} e0"
- echo '$''Id$' > b
- dotest join-admin-2-10 "$testcvs -Q add b" ''
- cp e0 e
- dotest join-admin-2-11 "$testcvs -Q ci -m. b e" \
- "RCS file: ${CVSROOT_DIRNAME}/x/b,v
- done
- Checking in b;
- ${CVSROOT_DIRNAME}/x/b,v <-- b
- initial revision: 1\.1
- done
- Checking in e;
- ${CVSROOT_DIRNAME}/x/e,v <-- e
- new revision: 1\.2; previous revision: 1\.1
- done"
- dotest join-admin-2-12 "$testcvs -Q tag -b M2" '' "${QUESTION} e0"
- dotest join-admin-2-13 "$testcvs -Q update -r T" '' "${QUESTION} e0"
- dotest join-admin-2-14 "$testcvs update -kk -jM1 -jM2" \
- "${PROG} update: Updating .
- U b
- U e
- RCS file: ${CVSROOT_DIRNAME}/x/e,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into e
- e already contains the differences between 1\.1 and 1\.2
- ${QUESTION} e0" \
- "${QUESTION} e0
- ${PROG} update: Updating .
- U b
- U e
- RCS file: ${CVSROOT_DIRNAME}/x/e,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into e
- e already contains the differences between 1\.1 and 1\.2"
- # Verify that the $Id.$ string is not expanded.
- dotest join-admin-2-15 "cat e" '$''Id$'
- cd ../..
- rm -rf 1
- rm -rf ${CVSROOT_DIRNAME}/$module
- ;;
- join-rm)
- # This first half of this test checks that a single-argument merge
- # from a branch is capable of removing files.
- #
- # The second half verifies that an update to another location with an
- # uncommitted removal will transfer the destination branch of the
- # removal.
- module=join-rm
- mkdir $module; cd $module
- dotest join-rm-init-1 "$testcvs -q co -l ." ''
- mkdir $module
- dotest join-rm-init-2 "$testcvs -q add $module" \
- "Directory $CVSROOT_DIRNAME/$module added to the repository"
- cd $module
- # add some files.
- touch a b c d e f g
- dotest join-rm-init-3 "$testcvs -Q add a b c d e f g"
- dotest join-rm-init-4 "$testcvs -Q ci -m add-em" \
- "RCS file: $CVSROOT_DIRNAME/join-rm/a,v
- done
- Checking in a;
- $CVSROOT_DIRNAME/join-rm/a,v <-- a
- initial revision: 1\.1
- done
- RCS file: $CVSROOT_DIRNAME/join-rm/b,v
- done
- Checking in b;
- $CVSROOT_DIRNAME/join-rm/b,v <-- b
- initial revision: 1\.1
- done
- RCS file: $CVSROOT_DIRNAME/join-rm/c,v
- done
- Checking in c;
- $CVSROOT_DIRNAME/join-rm/c,v <-- c
- initial revision: 1\.1
- done
- RCS file: $CVSROOT_DIRNAME/join-rm/d,v
- done
- Checking in d;
- $CVSROOT_DIRNAME/join-rm/d,v <-- d
- initial revision: 1\.1
- done
- RCS file: $CVSROOT_DIRNAME/join-rm/e,v
- done
- Checking in e;
- $CVSROOT_DIRNAME/join-rm/e,v <-- e
- initial revision: 1\.1
- done
- RCS file: $CVSROOT_DIRNAME/join-rm/f,v
- done
- Checking in f;
- $CVSROOT_DIRNAME/join-rm/f,v <-- f
- initial revision: 1\.1
- done
- RCS file: $CVSROOT_DIRNAME/join-rm/g,v
- done
- Checking in g;
- $CVSROOT_DIRNAME/join-rm/g,v <-- g
- initial revision: 1\.1
- done"
-
- # create the branch and update to it
- dotest join-rm-init-5 "$testcvs -Q tag -b br"
- dotest join-rm-init-6 "$testcvs -Q up -rbr"
- # remove a few files from the branch
- dotest join-rm-init-7 "$testcvs -Q rm -f b d g"
- dotest join-rm-init-8 "$testcvs -Q ci -mrm" \
- "Removing b;
- $CVSROOT_DIRNAME/join-rm/b,v <-- b
- new revision: delete; previous revision: 1\.1
- done
- Removing d;
- $CVSROOT_DIRNAME/join-rm/d,v <-- d
- new revision: delete; previous revision: 1\.1
- done
- Removing g;
- $CVSROOT_DIRNAME/join-rm/g,v <-- g
- new revision: delete; previous revision: 1\.1
- done"
- # update to the trunk
- dotest join-rm-init-9 "$testcvs -Q up -A"
- # now for the test - try and merge the removals.
- dotest join-rm-1 "$testcvs -q up -jbr" \
- "$PROG update: scheduling b for removal
- $PROG update: scheduling d for removal
- $PROG update: scheduling g for removal"
- # And make sure the merge took
- dotest join-rm-2 "$testcvs -qn up" \
- "R b
- R d
- R g"
- dotest join-rm-3 "$testcvs -q ci -m 'save the merge'" \
- "Removing b;
- $CVSROOT_DIRNAME/join-rm/b,v <-- b
- new revision: delete; previous revision: 1\.1
- done
- Removing d;
- $CVSROOT_DIRNAME/join-rm/d,v <-- d
- new revision: delete; previous revision: 1\.1
- done
- Removing g;
- $CVSROOT_DIRNAME/join-rm/g,v <-- g
- new revision: delete; previous revision: 1\.1
- done"
- # and verify that it was the head revision which was removed.
- dotest join-rm-4 "$testcvs -q log b" "
- RCS file: $CVSROOT_DIRNAME/join-rm/Attic/b,v
- Working file: b
- head: 1\.2
- branch:
- locks: strict
- access list:
- symbolic names:
- br: 1\.1\.0\.2
- keyword substitution: kv
- total revisions: 3; selected revisions: 3
- description:
- ----------------------------
- revision 1\.2
- date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: ${PLUS}0 -0
- save the merge
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: $username; state: Exp;
- branches: 1.1.2;
- add-em
- ----------------------------
- revision 1\.1\.2\.1
- date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: ${PLUS}0 -0
- rm
- ============================================================================="
- # go back to the branch to set up for the second set of tests
- dotest join-rm-init-10 "$testcvs -Q up -rbr"
- dotest join-rm-init-11 "$testcvs -Q rm -f a"
- dotest join-rm-init-12 "$testcvs -Q ci -m rma" \
- "Removing a;
- $CVSROOT_DIRNAME/join-rm/a,v <-- a
- new revision: delete; previous revision: 1\.1
- done"
- # now the test: update to the trunk
- #
- # FIXCVS: This update should merge the removal to the trunk. It does
- # not.
- dotest join-rm-5 "$testcvs -q up -A" \
- 'U a
- U c
- U e
- U f'
- # and verify that there is no sticky tag
- dotest join-rm-6 "$testcvs status a" \
- "===================================================================
- File: a Status: Up-to-date
- Working revision: 1\.1.*
- Repository revision: 1\.1 $CVSROOT_DIRNAME/join-rm/a,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- cd ../..
- rm -rf $CVSROOT_DIRNAME/$module
- rm -r $module
- ;;
- new) # look for stray "no longer pertinent" messages.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- if ${CVS} co first-dir ; then
- pass 117
- else
- fail 117
- fi
- cd first-dir
- touch a
- if ${CVS} add a 2>>${LOGFILE}; then
- pass 118
- else
- fail 118
- fi
- if ${CVS} ci -m added >>${LOGFILE} 2>&1; then
- pass 119
- else
- fail 119
- fi
- rm a
- if ${CVS} rm a 2>>${LOGFILE}; then
- pass 120
- else
- fail 120
- fi
- if ${CVS} ci -m removed >>${LOGFILE} ; then
- pass 121
- else
- fail 121
- fi
- if ${CVS} update -A 2>&1 | grep longer ; then
- fail 122
- else
- pass 122
- fi
- if ${CVS} update -rHEAD 2>&1 | grep longer ; then
- fail 123
- else
- pass 123
- fi
- cd ..
- rm -r first-dir
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- newb)
- # Test removing a file on a branch and then checking it out.
- # We call this "newb" only because it, like the "new" tests,
- # has something to do with "no longer pertinent" messages.
- # Not necessarily the most brilliant nomenclature.
- # Create file 'a'.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- dotest newb-123a "${testcvs} -q co first-dir" ''
- cd first-dir
- touch a
- dotest newb-123b "${testcvs} add a" \
- "${PROG} add: scheduling file .a. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest newb-123c "${testcvs} -q ci -m added" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
- done
- Checking in a;
- ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
- initial revision: 1\.1
- done"
- # Make a branch.
- dotest newb-123d "${testcvs} -q tag -b branch" "T a"
- # Check out the branch.
- cd ..
- rm -r first-dir
- mkdir 1
- cd 1
- dotest newb-123e "${testcvs} -q co -r branch first-dir" \
- "U first-dir/a"
- # Remove 'a' on another copy of the branch.
- cd ..
- mkdir 2
- cd 2
- dotest newb-123f "${testcvs} -q co -r branch first-dir" \
- "U first-dir/a"
- cd first-dir
- rm a
- dotest newb-123g "${testcvs} rm a" \
- "${PROG} remove: scheduling .a. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest newb-123h "${testcvs} -q ci -m removed" \
- "Removing a;
- ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
- new revision: delete; previous revision: 1\.1
- done"
- # Check out the file on the branch. This should report
- # that the file is not pertinent, but it should not
- # say anything else.
- cd ..
- rm -r first-dir
- dotest newb-123i "${testcvs} -q co -r branch first-dir/a" \
- "${PROG} checkout: warning: first-dir/a is not (any longer) pertinent"
- # Update the other copy, and make sure that a is removed.
- cd ../1/first-dir
- # "Entry Invalid" is a rather strange output here. Something like
- # "Removed in Repository" would make more sense.
- dotest newb-123j0 "${testcvs} status a" \
- "${PROG} status: a is no longer in the repository
- ===================================================================
- File: a Status: Entry Invalid
- Working revision: 1\.1.*
- Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/a,v
- Sticky Tag: branch (branch: 1\.1\.2)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest newb-123j "${testcvs} -q update" \
- "${PROG} update: a is no longer in the repository"
- if test -f a; then
- fail newb-123k
- else
- pass newb-123k
- fi
- cd ../..
- rm -r 1 2
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- conflicts)
- mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir 1
- cd 1
- dotest conflicts-124 "${testcvs} -q co first-dir" ''
- cd first-dir
- touch a
- dotest conflicts-125 "${testcvs} add a" \
- "${PROG} add: scheduling file .a. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest conflicts-126 "${testcvs} -q ci -m added" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
- done
- Checking in a;
- ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
- initial revision: 1\.1
- done"
- cd ../..
- mkdir 2
- cd 2
- dotest conflicts-126.5 "${testcvs} co -p first-dir" \
- "${PROG} checkout: Updating first-dir
- ===================================================================
- Checking out first-dir/a
- RCS: ${CVSROOT_DIRNAME}/first-dir/a,v
- VERS: 1\.1
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
- if ${CVS} co first-dir ; then
- pass 127
- else
- fail 127
- fi
- cd first-dir
- if test -f a; then
- pass 127a
- else
- fail 127a
- fi
- cd ../../1/first-dir
- echo add a line >>a
- mkdir dir1
- dotest conflicts-127b "${testcvs} add dir1" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
- dotest conflicts-128 "${testcvs} -q ci -m changed" \
- "Checking in a;
- ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
- new revision: 1\.2; previous revision: 1\.1
- done"
- cd ../..
- # Similar to conflicts-126.5, but now the file has nonempty
- # contents.
- mkdir 3
- cd 3
- dotest conflicts-128.5 "${testcvs} co -p -l first-dir" \
- "${PROG} checkout: Updating first-dir
- ===================================================================
- Checking out first-dir/a
- RCS: ${CVSROOT_DIRNAME}/first-dir/a,v
- VERS: 1\.2
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
- add a line"
- cd ..
- rmdir 3
- # Now go over the to the other working directory and
- # start testing conflicts
- cd 2/first-dir
- echo add a conflicting line >>a
- dotest_fail conflicts-129 "${testcvs} -q ci -m changed" \
- "${PROG}"' commit: Up-to-date check failed for `a'\''
- '"${PROG}"' \[commit aborted\]: correct above errors first!'
- mkdir dir1
- mkdir sdir
- dotest conflicts-status-0 "${testcvs} status a" \
- "===================================================================
- File: a Status: Needs Merge
- Working revision: 1\.1.*
- Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest conflicts-129a "${testcvs} -nq update a" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into a
- rcsmerge: warning: conflicts during merge
- ${PROG} update: conflicts found in a
- C a"
- dotest conflicts-130 "${testcvs} -q update" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into a
- rcsmerge: warning: conflicts during merge
- ${PROG} update: conflicts found in a
- C a
- ${QUESTION} dir1
- ${QUESTION} sdir" \
- "${QUESTION} dir1
- ${QUESTION} sdir
- RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into a
- rcsmerge: warning: conflicts during merge
- ${PROG} update: conflicts found in a
- C a"
- rmdir dir1 sdir
- dotest conflicts-status-1 "${testcvs} status a" \
- "===================================================================
- File: a Status: Unresolved Conflict
- Working revision: 1\.2.*
- Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest_fail conflicts-131 "${testcvs} -q ci -m try" \
- "${PROG} commit: file .a. had a conflict and has not been modified
- ${PROG} \[commit aborted\]: correct above errors first!"
- # Try to check in the file with the conflict markers in it.
- # Make sure we detect any one of the three conflict markers
- mv a aa
- grep '^<<<<<<<' aa >a
- dotest conflicts-status-2 "${testcvs} -nq ci -m try a" \
- "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
- grep '^=======' aa >a
- dotest conflicts-status-3 "${testcvs} -nq ci -m try a" \
- "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
- grep '^>>>>>>>' aa >a
- dotest conflicts-status-4 "${testcvs} -qn ci -m try a" \
- "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
- mv aa a
- echo lame attempt at resolving it >>a
- dotest conflicts-status-5 "${testcvs} status a" \
- "===================================================================
- File: a Status: File had conflicts on merge
- Working revision: 1\.2.*
- Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest conflicts-132 "${testcvs} -q ci -m try" \
- "${PROG} commit: warning: file .a. seems to still contain conflict indicators
- Checking in a;
- ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
- new revision: 1\.3; previous revision: 1\.2
- done"
- # OK, the user saw the warning (good user), and now
- # resolves it for real.
- echo resolve conflict >a
- dotest conflicts-status-6 "${testcvs} status a" \
- "===================================================================
- File: a Status: Locally Modified
- Working revision: 1\.3.*
- Repository revision: 1\.3 ${CVSROOT_DIRNAME}/first-dir/a,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest conflicts-133 "${testcvs} -q ci -m resolved" \
- "Checking in a;
- ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
- new revision: 1\.4; previous revision: 1\.3
- done"
- dotest conflicts-status-7 "${testcvs} status a" \
- "===================================================================
- File: a Status: Up-to-date
- Working revision: 1\.4.*
- Repository revision: 1\.4 ${CVSROOT_DIRNAME}/first-dir/a,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- # Now test that we can add a file in one working directory
- # and have an update in another get it.
- cd ../../1/first-dir
- echo abc >abc
- if ${testcvs} add abc >>${LOGFILE} 2>&1; then
- pass 134
- else
- fail 134
- fi
- if ${testcvs} ci -m 'add abc' abc >>${LOGFILE} 2>&1; then
- pass 135
- else
- fail 135
- fi
- cd ../../2
- mkdir first-dir/dir1 first-dir/sdir
- dotest conflicts-136 "${testcvs} -q update first-dir" \
- '[UP] first-dir/abc
- '"${QUESTION}"' first-dir/dir1
- '"${QUESTION}"' first-dir/sdir' \
- ''"${QUESTION}"' first-dir/dir1
- '"${QUESTION}"' first-dir/sdir
- [UP] first-dir/abc'
- dotest conflicts-137 'test -f first-dir/abc' ''
- rmdir first-dir/dir1 first-dir/sdir
- # Now test something similar, but in which the parent directory
- # (not the directory in question) has the Entries.Static flag
- # set.
- cd ../1/first-dir
- mkdir subdir
- if ${testcvs} add subdir >>${LOGFILE}; then
- pass 138
- else
- fail 138
- fi
- cd ../..
- mkdir 3
- cd 3
- if ${testcvs} -q co first-dir/abc first-dir/subdir \
- >>${LOGFILE}; then
- pass 139
- else
- fail 139
- fi
- cd ../1/first-dir/subdir
- echo sss >sss
- if ${testcvs} add sss >>${LOGFILE} 2>&1; then
- pass 140
- else
- fail 140
- fi
- if ${testcvs} ci -m adding sss >>${LOGFILE} 2>&1; then
- pass 140
- else
- fail 140
- fi
- cd ../../../3/first-dir
- if ${testcvs} -q update >>${LOGFILE}; then
- pass 141
- else
- fail 141
- fi
- if test -f subdir/sss; then
- pass 142
- else
- fail 142
- fi
- cd ../..
- rm -r 1 2 3 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- conflicts2)
- # More conflicts tests; separate from conflicts to keep each
- # test a manageable size.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir 1
- cd 1
- dotest conflicts2-142a1 "${testcvs} -q co first-dir" ''
- cd first-dir
- touch a abc
- dotest conflicts2-142a2 "${testcvs} add a abc" \
- "${PROG} add: scheduling file .a. for addition
- ${PROG} add: scheduling file .abc. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest conflicts2-142a3 "${testcvs} -q ci -m added" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
- done
- Checking in a;
- ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
- done
- Checking in abc;
- ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
- initial revision: 1\.1
- done"
- cd ../..
- mkdir 2
- cd 2
- dotest conflicts2-142a4 "${testcvs} -q co first-dir" 'U first-dir/a
- U first-dir/abc'
- cd ..
- # BEGIN TESTS USING THE FILE A
- # FIXME: would be cleaner to separate them out into their own
- # tests; conflicts2 is getting long.
- # Now test that if one person modifies and commits a
- # file and a second person removes it, it is a
- # conflict
- cd 1/first-dir
- echo modify a >>a
- dotest conflicts2-142b2 "${testcvs} -q ci -m modify-a" \
- "Checking in a;
- ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
- new revision: 1\.2; previous revision: 1\.1
- done"
- cd ../../2/first-dir
- rm a
- dotest conflicts2-142b3 "${testcvs} rm a" \
- "${PROG} remove: scheduling .a. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest_fail conflicts2-142b4 "${testcvs} -q update" \
- "${PROG} update: conflict: removed a was modified by second party
- C a"
- # Resolve the conflict by deciding not to remove the file
- # after all.
- dotest_sort conflicts2-142b5 "${testcvs} add a" "U a
- ${PROG} add: a, version 1\.1, resurrected"
- dotest conflicts2-142b5b1 "$testcvs status a" \
- "===================================================================
- File: a Status: Needs Patch
- Working revision: 1\.1.*
- Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/a,v
- Sticky Tag: (none)
- Sticky Date: (none)
- Sticky Options: (none)"
- dotest conflicts2-142b6 "${testcvs} -q update" 'U a'
- # Now one level up.
- cd ..
- dotest conflicts2-142b7 "${testcvs} rm -f first-dir/a" \
- "${PROG} remove: scheduling .first-dir/a. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- if $remote; then
- # Haven't investigated this one.
- dotest_fail conflicts2-142b8r "$testcvs add first-dir/a" \
- "${PROG} add: in directory \.:
- ${PROG} \[add aborted\]: there is no version here; do '${PROG} checkout' first"
- cd first-dir
- else
- dotest conflicts2-142b8 "${testcvs} add first-dir/a" \
- "U first-dir/a
- ${PROG} add: first-dir/a, version 1\.2, resurrected"
- cd first-dir
- # Now recover from the damage that the 142b8 test did.
- dotest conflicts2-142b9 "${testcvs} rm -f a" \
- "${PROG} remove: scheduling .a. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- fi
- dotest_sort conflicts2-142b10 "${testcvs} add a" "U a
- ${PROG} add: a, version 1\.2, resurrected"
- # As with conflicts2-142b6, check that things are normal again.
- dotest conflicts2-142b11 "${testcvs} -q update" ''
- cd ../..
- # END TESTS USING THE FILE A
- # Now test that if one person removes a file and
- # commits it, and a second person removes it, is it
- # not a conflict.
- cd 1/first-dir
- rm abc
- dotest conflicts2-142c0 "${testcvs} rm abc" \
- "${PROG} remove: scheduling .abc. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest conflicts2-142c1 "${testcvs} -q ci -m remove-abc" \
- "Removing abc;
- ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
- new revision: delete; previous revision: 1\.1
- done"
- cd ../../2/first-dir
- rm abc
- dotest conflicts2-142c2 "${testcvs} rm abc" \
- "${PROG} remove: scheduling .abc. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest conflicts2-142c3 "${testcvs} update" \
- "${PROG} update: Updating \."
- cd ../..
- # conflicts2-142d*: test that if one party adds a file, and another
- # party has a file of the same name, cvs notices
- cd 1/first-dir
- touch aa.c
- echo 'contents unchanged' >same.c
- dotest conflicts2-142d0 "${testcvs} add aa.c same.c" \
- "${PROG} add: scheduling file .aa\.c. for addition
- ${PROG} add: scheduling file .same\.c. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest conflicts2-142d1 "${testcvs} -q ci -m added" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa\.c,v
- done
- Checking in aa\.c;
- ${CVSROOT_DIRNAME}/first-dir/aa\.c,v <-- aa\.c
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/same\.c,v
- done
- Checking in same\.c;
- ${CVSROOT_DIRNAME}/first-dir/same\.c,v <-- same\.c
- initial revision: 1\.1
- done"
- cd ../../2/first-dir
- echo "don't you dare obliterate this text" >aa.c
- echo 'contents unchanged' >same.c
- # Note the discrepancy between local and remote in the handling
- # of same.c. I kind
- # of suspect that the local CVS behavior is the more useful one
- # although I do sort of wonder whether we should make people run
- # cvs add just to get them in that habit (also, trying to implement
- # the local CVS behavior for remote without the cvs add seems
- # pretty difficult).
- if $remote; then
- dotest_fail conflicts2-142d2 "${testcvs} -q update" \
- "${QUESTION} aa\.c
- ${QUESTION} same\.c
- ${PROG} update: move away \./aa\.c; it is in the way
- C aa\.c
- ${PROG} update: move away \./same\.c; it is in the way
- C same\.c"
- else
- dotest_fail conflicts2-142d2 "${testcvs} -q update" \
- "${PROG} [a-z]*: move away aa\.c; it is in the way
- C aa\.c
- U same\.c"
- fi
- dotest conflicts2-142d3 "${testcvs} -q status aa.c" \
- "${PROG} status: move away aa\.c; it is in the way
- ===================================================================
- File: aa\.c Status: Unresolved Conflict
- Working revision: No entry for aa\.c
- Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/aa\.c,v"
- # Could also be testing the case in which the cvs add happened
- # before the commit by the other user.
- # This message seems somewhat bogus. I mean, parallel development
- # means that we get to work in parallel if we choose, right? And
- # then at commit time it would be a conflict.
- dotest_fail conflicts2-142d4 "${testcvs} -q add aa.c" \
- "${PROG} add: aa.c added independently by second party"
- # The user might want to see just what the conflict is.
- # Don't bother, diff seems to kind of lose its mind, with or
- # without -N. This is a CVS bug(s).
- #dotest conflicts2-142d5 "${testcvs} -q diff -r HEAD -N aa.c" fixme
- # Now: "how can the user resolve this conflict", I hear you cry.
- # Well, one way is to forget about the file in the working
- # directory.
- # Since it didn't let us do the add in conflicts2-142d4, there
- # is no need to run cvs rm here.
- #dotest conflicts2-142d6 "${testcvs} -q rm -f aa.c" fixme
- dotest conflicts2-142d6 "rm aa.c" ''
- dotest conflicts2-142d7 "${testcvs} -q update aa.c" "U aa\.c"
- dotest conflicts2-142d8 "cat aa.c" ''
- # The other way is to use the version from the working directory
- # instead of the version from the repository. Unfortunately,
- # there doesn't seem to be any particularly clear way to do
- # this (?).
- cd ../..
- rm -r 1 2; rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- conflicts3)
- # More tests of conflicts and/or multiple working directories
- # in general.
- mkdir 1; cd 1
- dotest conflicts3-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest conflicts3-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd ..
- mkdir 2; cd 2
- dotest conflicts3-3 "${testcvs} -q co -l first-dir" ''
- cd ../1/first-dir
- touch file1 file2
- dotest conflicts3-4 "${testcvs} add file1 file2" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: scheduling file .file2. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest conflicts3-5 "${testcvs} -q ci -m add-them" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 1\.1
- done"
- cd ../../2/first-dir
- # Check that -n doesn't make CVS lose its mind as it creates
- # (or rather, doesn't) a new file.
- dotest conflicts3-6 "${testcvs} -nq update" \
- "U file1
- U file2"
- dotest_fail conflicts3-7 "test -f file1" ''
- dotest conflicts3-8 "${testcvs} -q update" \
- "U file1
- U file2"
- dotest conflicts3-9 "test -f file2" ''
- # OK, now remove two files at once
- dotest conflicts3-10 "${testcvs} rm -f file1 file2" \
- "${PROG} remove: scheduling .file1. for removal
- ${PROG} remove: scheduling .file2. for removal
- ${PROG} remove: use .${PROG} commit. to remove these files permanently"
- dotest conflicts3-11 "${testcvs} -q ci -m remove-them" \
- "Removing file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done
- Removing file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: delete; previous revision: 1\.1
- done"
- cd ../../1/first-dir
- dotest conflicts3-12 "${testcvs} -n -q update" \
- "${PROG} update: file1 is no longer in the repository
- ${PROG} update: file2 is no longer in the repository"
- dotest conflicts3-13 "${testcvs} -q update" \
- "${PROG} update: file1 is no longer in the repository
- ${PROG} update: file2 is no longer in the repository"
- # OK, now add a directory to both working directories
- # and see that CVS doesn't lose its mind.
- mkdir sdir
- dotest conflicts3-14 "${testcvs} add sdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
- touch sdir/sfile
- dotest conflicts3-14a "${testcvs} add sdir/sfile" \
- "${PROG} add: scheduling file .sdir/sfile. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest conflicts3-14b "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v
- done
- Checking in sdir/sfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v <-- sfile
- initial revision: 1\.1
- done"
- cd ../../2/first-dir
- # Create a CVS directory without the proper administrative
- # files in it. This can happen for example if you hit ^C
- # in the middle of a checkout.
- mkdir sdir
- mkdir sdir/CVS
- # OK, in the local case CVS sees that the directory exists
- # in the repository and recurses into it. In the remote case
- # CVS can't see the repository and has no way of knowing
- # that sdir is even a directory (stat'ing everything would be
- # too slow). The remote behavior makes more sense to me (but
- # would this affect other cases?).
- if $remote; then
- dotest conflicts3-15 "${testcvs} -q update" \
- "${QUESTION} sdir"
- else
- dotest conflicts3-15 "${testcvs} -q update" \
- "${QUESTION} sdir
- ${PROG} update: ignoring sdir (CVS/Repository missing)"
- touch sdir/CVS/Repository
- dotest conflicts3-16 "${testcvs} -q update" \
- "${QUESTION} sdir
- ${PROG} update: ignoring sdir (CVS/Entries missing)"
- cd ..
- dotest conflicts3-16a "${testcvs} -q update first-dir" \
- "${QUESTION} first-dir/sdir
- ${PROG} update: ignoring first-dir/sdir (CVS/Entries missing)"
- cd first-dir
- fi
- rm -r sdir
- # OK, now the same thing, but the directory doesn't exist
- # in the repository.
- mkdir newdir
- mkdir newdir/CVS
- dotest conflicts3-17 "${testcvs} -q update" "${QUESTION} newdir"
- echo "D/newdir////" >> CVS/Entries
- dotest conflicts3-18 "${testcvs} -q update" \
- "${PROG} [a-z]*: ignoring newdir (CVS/Repository missing)"
- touch newdir/CVS/Repository
- dotest conflicts3-19 "${testcvs} -q update" \
- "${PROG} [a-z]*: ignoring newdir (CVS/Entries missing)"
- cd ..
- dotest conflicts3-20 "${testcvs} -q update first-dir" \
- "${PROG} [a-z]*: ignoring first-dir/newdir (CVS/Entries missing)"
- cd first-dir
- rm -r newdir
- # The previous tests have left CVS/Entries in something of a mess.
- # While we "should" be able to deal with that (maybe), for now
- # we just start over.
- cd ..
- rm -r first-dir
- dotest conflicts3-20a "${testcvs} -q co -l first-dir" ''
- cd first-dir
- dotest conflicts3-21 "${testcvs} -q update -d sdir" "U sdir/sfile"
- rm -r sdir/CVS
- dotest conflicts3-22 "${testcvs} -q update" "${QUESTION} sdir"
- if $remote; then
- dotest_fail conflicts3-23 "${testcvs} -q update -PdA" \
- "${QUESTION} sdir
- ${PROG} update: move away sdir/sfile; it is in the way
- C sdir/sfile"
- else
- dotest conflicts3-23 "${testcvs} -q update -PdA" \
- "${QUESTION} sdir"
- fi
- # Not that it should really affect much, but let's do the case
- # where sfile has been removed. For example, suppose that sdir
- # had been a CVS-controlled directory which was then removed
- # by removing each file (and using update -P or some such). Then
- # suppose that the build process creates an sdir directory which
- # is not supposed to be under CVS.
- rm -r sdir
- dotest conflicts3-24 "${testcvs} -q update -d sdir" "U sdir/sfile"
- rm sdir/sfile
- dotest conflicts3-25 "${testcvs} rm sdir/sfile" \
- "${PROG} remove: scheduling .sdir/sfile. for removal
- ${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest conflicts3-26 "${testcvs} ci -m remove sdir/sfile" \
- "Removing sdir/sfile;
- ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v <-- sfile
- new revision: delete; previous revision: 1\.1
- done"
- rm -r sdir/CVS
- dotest conflicts3-27 "${testcvs} -q update" "${QUESTION} sdir"
- dotest conflicts3-28 "${testcvs} -q update -PdA" \
- "${QUESTION} sdir"
- cd ../..
- rm -r 1 2
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- conflicts4)
- mkdir conflicts4; cd conflicts4
- mkdir 1; cd 1
- dotest conflicts4-1 "$testcvs -q co -l ."
- mkdir first-dir
- dotest conflicts4-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd ..
- mkdir 2; cd 2
- dotest conflicts4-3 "${testcvs} -q co -l first-dir" ''
- cd ../1/first-dir
- echo baseline >file1
- dotest conflicts4-4 "${testcvs} -q add file1" \
- "$PROG add: use .$PROG commit. to add this file permanently"
- dotest conflicts4-5 "${testcvs} -q ci -m add-it" \
- "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
- done
- Checking in file1;
- $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- cd ../../2/first-dir
- dotest conflicts4-6 "${testcvs} -q update" "U file1"
- # Make a local change
- echo wibble2 >> file1
- dotest conflicts4-7 "${testcvs} -q ci -m update2" \
- "Checking in file1;
- $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
- new revision: 1\.2; previous revision: 1\.1
- done"
- cd ../../1/first-dir
- echo wibble1 >>file1
- dotest conflicts4-8 "${testcvs} -Q update" \
- "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into file1
- rcsmerge: warning: conflicts during merge
- cvs update: conflicts found in file1"
- dotest_fail conflicts4-9 "${testcvs} -q update" \
- "C file1"
- if $remote; then
- cat >$TESTDIR/conflicts4/serveme <<EOF
- #!$TESTSHELL
- # This is admittedly a bit cheezy, in the sense that we make lots
- # of assumptions about what the client is going to send us.
- # We don't mention Repository, because current clients don't require it.
- # Sending these at our own pace, rather than waiting for the client to
- # make the requests, is bogus, but hopefully we can get away with it.
- echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update Global_option"
- echo "ok"
- echo "MT text C "
- echo "MT fname file1"
- echo "MT newline"
- echo "error "
- cat >$TESTDIR/conflicts4/client.out
- EOF
- # Cygwin. Pthffffffffft!
- if test -n "$remotehost"; then
- $CVS_RSH $remotehost "chmod +x $TESTDIR/conflicts4/serveme"
- else
- chmod +x $TESTDIR/conflicts4/serveme
- fi
- save_CVS_SERVER=$CVS_SERVER
- CVS_SERVER=$TESTDIR/conflicts4/serveme; export CVS_SERVER
- dotest_fail conflicts4-10r "$testcvs -q up" "C file1"
- dotest conflicts4-11r "cat $TESTDIR/conflicts4/client.out" \
- "$DOTSTAR
- Argument --
- Directory .
- $CVSROOT_DIRNAME/first-dir
- Entry /file1/1.2/$PLUS=//
- Modified file1
- u=.*,g=.*,o=.*
- 59
- baseline
- ""<<<<<<< file1
- wibble1
- ""=======
- wibble2
- "">>>>>>> 1.2
- update"
- cat >$TESTDIR/conflicts4/serveme <<EOF
- #!$TESTSHELL
- # This is admittedly a bit cheezy, in the sense that we make lots
- # of assumptions about what the client is going to send us.
- # We don't mention Repository, because current clients don't require it.
- # Sending these at our own pace, rather than waiting for the client to
- # make the requests, is bogus, but hopefully we can get away with it.
- echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update Global_option Empty-conflicts"
- echo "ok"
- echo "MT text C "
- echo "MT fname file1"
- echo "MT newline"
- echo "error "
- cat >$TESTDIR/conflicts4/client.out
- EOF
- dotest_fail conflicts4-12r "$testcvs -q up" "C file1"
- dotest conflicts4-13r "cat $TESTDIR/conflicts4/client.out" \
- "$DOTSTAR
- Argument --
- Directory .
- $CVSROOT_DIRNAME/first-dir
- Entry /file1/1.2/$PLUS=//
- Unchanged file1
- update"
- CVS_SERVER=$save_CVS_SERVER; export CVS_SERVER
- fi
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- cd ../../..
- rm -rf conflicts4
- rm -rf $CVSROOT_DIRNAME/first-dir
- ;;
- clean)
- # Test update -C (overwrite local mods w/ repository copies)
- mkdir 1; cd 1
- dotest clean-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest clean-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- echo "The usual boring test text." > cleanme.txt
- dotest clean-3 "${testcvs} add cleanme.txt" \
- "${PROG} add: scheduling file .cleanme\.txt. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest clean-4 "${testcvs} -q ci -m clean-3" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
- done
- Checking in cleanme\.txt;
- ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v <-- cleanme\.txt
- initial revision: 1\.1
- done"
- # Okay, preparation is done, now test.
- # Check that updating an unmodified copy works.
- dotest clean-5 "${testcvs} -q update" ''
- # Check that updating -C an unmodified copy works.
- dotest clean-6 "${testcvs} -q update -C" ''
- # Check that updating a modified copy works.
- echo "fish" >> cleanme.txt
- dotest clean-7 "${testcvs} -q update" 'M cleanme\.txt'
- # Check that updating -C a modified copy works.
- dotest clean-8 "${testcvs} -q update -C" \
- "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
- U cleanme\.txt"
- # And check that the backup copy really was made.
- dotest clean-9 "cat .#cleanme.txt.1.1" \
- "The usual boring test text\.
- fish"
- # Do it all again, this time naming the file explicitly.
- rm .#cleanme.txt.1.1
- dotest clean-10 "${testcvs} -q update cleanme.txt" ''
- dotest clean-11 "${testcvs} -q update -C cleanme.txt" ''
- echo "bluegill" >> cleanme.txt
- dotest clean-12 "${testcvs} -q update cleanme.txt" 'M cleanme\.txt'
- dotest clean-13 "${testcvs} -q update -C cleanme.txt" \
- "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
- U cleanme\.txt"
- # And check that the backup copy really was made.
- dotest clean-14 "cat .#cleanme.txt.1.1" \
- "The usual boring test text\.
- bluegill"
- # Now try with conflicts
- cd ..
- dotest clean-15 "${testcvs} -q co -d second-dir first-dir" \
- 'U second-dir/cleanme\.txt'
- cd second-dir
- echo "conflict test" >> cleanme.txt
- dotest clean-16 "${testcvs} -q ci -m." \
- "Checking in cleanme\.txt;
- ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v <-- cleanme\.txt
- new revision: 1\.2; previous revision: 1\.1
- done"
- cd ../first-dir
- echo "fish" >> cleanme.txt
- dotest clean-17 "${testcvs} -nq update" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
- retrieving revision 1\.1
- retrieving revision 1\.2
- Merging differences between 1\.1 and 1\.2 into cleanme\.txt
- rcsmerge: warning: conflicts during merge
- ${PROG} update: conflicts found in cleanme\.txt
- C cleanme\.txt"
- dotest clean-18 "${testcvs} -q update -C" \
- "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
- U cleanme\.txt"
- dotest clean-19 "cat .#cleanme.txt.1.1" \
- "The usual boring test text\.
- fish"
-
- # Done. Clean up.
- cd ../..
- rm -rf 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- modules)
- # Tests of various ways to define and use modules.
- # Roadmap to various modules tests:
- # -a:
- # error on incorrect placement: modules
- # error combining with other options: modules2-a*
- # infinite loops: modules148a1.1 - modules148a1.2
- # use to specify a file more than once: modules3
- # use with ! feature: modules4
- # regular modules: modules, modules2, cvsadm
- # ampersand modules: modules2
- # -s: modules.
- # -d: modules, modules3, cvsadm
- # -i, -o, -u, -e, -t: modules5
- # slashes in module names: modules3
- # invalid module definitions: modules6
- ############################################################
- # These tests are to make sure that administrative files get
- # rebuilt, regardless of how and where files are checked
- # out.
- ############################################################
- # Check out the whole repository
- mkdir 1; cd 1
- dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/checkoutlist
- U CVSROOT/commitinfo
- U CVSROOT/config
- U CVSROOT/cvswrappers
- U CVSROOT/editinfo
- U CVSROOT/loginfo
- U CVSROOT/modules
- U CVSROOT/notify
- U CVSROOT/rcsinfo
- U CVSROOT/taginfo
- U CVSROOT/verifymsg'
- echo "# made a change" >>CVSROOT/modules
- dotest modules-1d "${testcvs} -q ci -m add-modules" \
- "Checking in CVSROOT/modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ..
- rm -rf 1
- ############################################################
- # Check out CVSROOT
- mkdir 1; cd 1
- dotest modules-2 "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist
- U CVSROOT/commitinfo
- U CVSROOT/config
- U CVSROOT/cvswrappers
- U CVSROOT/editinfo
- U CVSROOT/loginfo
- U CVSROOT/modules
- U CVSROOT/notify
- U CVSROOT/rcsinfo
- U CVSROOT/taginfo
- U CVSROOT/verifymsg'
- echo "# made a change" >>CVSROOT/modules
- dotest modules-2d "${testcvs} -q ci -m add-modules" \
- "Checking in CVSROOT/modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ..
- rm -rf 1
- ############################################################
- # Check out CVSROOT in some other directory
- mkdir ${CVSROOT_DIRNAME}/somedir
- mkdir 1; cd 1
- dotest modules-3 "${testcvs} -q co somedir" ''
- cd somedir
- dotest modules-3d "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist
- U CVSROOT/commitinfo
- U CVSROOT/config
- U CVSROOT/cvswrappers
- U CVSROOT/editinfo
- U CVSROOT/loginfo
- U CVSROOT/modules
- U CVSROOT/notify
- U CVSROOT/rcsinfo
- U CVSROOT/taginfo
- U CVSROOT/verifymsg'
- echo "# made a change" >>CVSROOT/modules
- dotest modules-3g "${testcvs} -q ci -m add-modules" \
- "Checking in CVSROOT/modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ../..
- rm -rf 1
- rm -rf ${CVSROOT_DIRNAME}/somedir
- ############################################################
- # end rebuild tests
- ############################################################
- mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir 1
- cd 1
- dotest modules-143 "${testcvs} -q co first-dir" ""
- cd first-dir
- mkdir subdir
- dotest modules-143a "${testcvs} add subdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
- cd subdir
- mkdir ssdir
- dotest modules-143b "${testcvs} add ssdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
- touch a b
- dotest modules-144 "${testcvs} add a b" \
- "${PROG} add: scheduling file .a. for addition
- ${PROG} add: scheduling file .b. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest modules-145 "${testcvs} ci -m added" \
- "${PROG} [a-z]*: Examining .
- ${PROG} [a-z]*: Examining ssdir
- RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/a,v
- done
- Checking in a;
- ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/b,v
- done
- Checking in b;
- ${CVSROOT_DIRNAME}/first-dir/subdir/b,v <-- b
- initial revision: 1\.1
- done"
- cd ..
- dotest modules-146 "${testcvs} -q co CVSROOT" \
- "U CVSROOT/checkoutlist
- U CVSROOT/commitinfo
- U CVSROOT/config
- U CVSROOT/cvswrappers
- U CVSROOT/editinfo
- U CVSROOT/loginfo
- U CVSROOT/modules
- U CVSROOT/notify
- U CVSROOT/rcsinfo
- U CVSROOT/taginfo
- U CVSROOT/verifymsg"
- # Here we test that CVS can deal with CVSROOT (whose repository
- # is at top level) in the same directory as subdir (whose repository
- # is a subdirectory of first-dir). TODO: Might want to check that
- # files can actually get updated in this state.
- dotest modules-147 "${testcvs} -q update" ""
- cat >CVSROOT/modules <<EOF
- realmodule first-dir/subdir a
- dirmodule first-dir/subdir
- namedmodule -d nameddir first-dir/subdir
- aliasmodule -a first-dir/subdir/a
- aliasnested -a first-dir/subdir/ssdir
- topfiles -a first-dir/file1 first-dir/file2
- world -a .
- statusmod -s Mungeable
- # Check for ability to block infinite loops.
- infinitealias -a infinitealias
- # Prior to 1.11.12 & 1.12.6, the infinite alias loop check didn't strip
- # slashes or work if a module called a module which then called itself
- # (A -> A was blocked, but not A -> B -> A or deeper).
- infinitealias2 -a infinitealias2/
- infinitealias3 -a infinitealias4/
- infinitealias4 -a aliasmodule infinitealias5
- infinitealias5 -a infinitealias3/
- # Options must come before arguments. It is possible this should
- # be relaxed at some point (though the result would be bizarre for
- # -a); for now test the current behavior.
- bogusalias first-dir/subdir/a -a
- EOF
- dotest modules-148 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
- "Checking in CVSROOT/modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ..
- # The "statusmod" module contains an error; trying to use it
- # will produce "modules file missing directory" I think.
- # However, that shouldn't affect the ability of "cvs co -c" or
- # "cvs co -s" to do something reasonable with it.
- dotest modules-148a0 "${testcvs} co -c" 'aliasmodule -a first-dir/subdir/a
- aliasnested -a first-dir/subdir/ssdir
- bogusalias first-dir/subdir/a -a
- dirmodule first-dir/subdir
- infinitealias -a infinitealias
- infinitealias2 -a infinitealias2/
- infinitealias3 -a infinitealias4/
- infinitealias4 -a aliasmodule infinitealias5
- infinitealias5 -a infinitealias3/
- namedmodule -d nameddir first-dir/subdir
- realmodule first-dir/subdir a
- statusmod -s Mungeable
- topfiles -a first-dir/file1 first-dir/file2
- world -a \.'
- # There is code in modules.c:save_d which explicitly skips
- # modules defined with -a, which is why aliasmodule is not
- # listed.
- dotest modules-148a1 "${testcvs} co -s" \
- 'statusmod Mungeable
- bogusalias NONE first-dir/subdir/a -a
- dirmodule NONE first-dir/subdir
- namedmodule NONE first-dir/subdir
- realmodule NONE first-dir/subdir a'
- # Check that infinite loops are avoided
- dotest modules-148a1.1 "${testcvs} co infinitealias" \
- "$PROG checkout: module \`infinitealias' in modules file contains infinite loop" \
- "$PROG server: module \`infinitealias' in modules file contains infinite loop
- $PROG checkout: module \`infinitealias' in modules file contains infinite loop"
- # Prior to 1.11.12 & 1.12.6, the inifinte alias loop check did not
- # strip slashes.
- dotest modules-148a1.2 "${testcvs} co infinitealias2" \
- "$PROG checkout: module \`infinitealias2' in modules file contains infinite loop" \
- "$PROG server: module \`infinitealias2' in modules file contains infinite loop
- $PROG checkout: module \`infinitealias2' in modules file contains infinite loop"
- # Prior to 1.11.12 & 1.12.6, the inifinte alias loop check did not
- # notice when A -> B -> A, it only noticed A -> A.
- dotest modules-148a1.3 "${testcvs} co infinitealias3/" \
- "$PROG checkout: module \`infinitealias3' in modules file contains infinite loop" \
- "$PROG server: module \`infinitealias3' in modules file contains infinite loop
- $PROG checkout: module \`infinitealias3' in modules file contains infinite loop"
- # Test that real modules check out to realmodule/a, not subdir/a.
- dotest modules-149a1 "${testcvs} co realmodule" "U realmodule/a"
- dotest modules-149a2 "test -d realmodule && test -f realmodule/a" ""
- dotest_fail modules-149a3 "test -f realmodule/b" ""
- dotest modules-149a4 "${testcvs} -q co realmodule" ""
- dotest modules-149a5 "echo yes | ${testcvs} release -d realmodule" \
- "You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .realmodule.: "
- dotest_fail modules-149b1 "${testcvs} co realmodule/a" \
- "${PROG}"' checkout: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
- "${PROG}"' server: module `realmodule/a'\'' is a request for a file in a module which is not a directory
- '"${PROG}"' \[checkout aborted\]: cannot expand modules'
- # Now test the ability to check out a single file from a directory
- dotest modules-150c "${testcvs} co dirmodule/a" "U dirmodule/a"
- dotest modules-150d "test -d dirmodule && test -f dirmodule/a" ""
- dotest_fail modules-150e "test -f dirmodule/b" ""
- dotest modules-150f "echo yes | ${testcvs} release -d dirmodule" \
- "You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .dirmodule.: "
- # Now test the ability to correctly reject a non-existent filename.
- # For maximum studliness we would check that an error message is
- # being output.
- # We accept a zero exit status because it is what CVS does
- # (Dec 95). Probably the exit status should be nonzero,
- # however.
- dotest modules-150g1 "${testcvs} co dirmodule/nonexist" \
- "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared"
- # We tolerate the creation of the dirmodule directory, since that
- # is what CVS does, not because we view that as preferable to not
- # creating it.
- dotest_fail modules-150g2 "test -f dirmodule/a || test -f dirmodule/b" ""
- rm -r dirmodule
- # Now test that a module using -d checks out to the specified
- # directory.
- dotest modules-150h1 "${testcvs} -q co namedmodule" \
- 'U nameddir/a
- U nameddir/b'
- dotest modules-150h2 "test -f nameddir/a && test -f nameddir/b" ""
- echo add line >>nameddir/a
- dotest modules-150h3 "${testcvs} -q co namedmodule" 'M nameddir/a'
- rm nameddir/a
- dotest modules-150h4 "${testcvs} -q co namedmodule" 'U nameddir/a'
- dotest modules-150h99 "echo yes | ${testcvs} release -d nameddir" \
- "You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .nameddir.: "
- # Now test that alias modules check out to subdir/a, not
- # aliasmodule/a.
- dotest modules-151 "${testcvs} co aliasmodule" ""
- dotest_fail modules-152 "test -d aliasmodule" ""
- echo abc >>first-dir/subdir/a
- dotest modules-153 "${testcvs} -q co aliasmodule" "M first-dir/subdir/a"
- cd ..
- rm -r 1
- mkdir 2
- cd 2
- dotest modules-155a0 "${testcvs} co aliasnested" \
- "${PROG} checkout: Updating first-dir/subdir/ssdir"
- dotest modules-155a1 "test -d first-dir" ''
- dotest modules-155a2 "test -d first-dir/subdir" ''
- dotest modules-155a3 "test -d first-dir/subdir/ssdir" ''
- # Test that nothing extraneous got created.
- dotest modules-155a4 "ls" "first-dir" \
- "CVS
- first-dir"
- cd ..
- rm -r 2
- # Test checking out everything.
- mkdir 1
- cd 1
- dotest modules-155b "${testcvs} -q co world" \
- "U CVSROOT/${DOTSTAR}
- U first-dir/subdir/a
- U first-dir/subdir/b"
- cd ..
- rm -r 1
- # Test checking out a module which lists at least two
- # specific files twice. At one time, this failed over
- # remote CVS.
- mkdir 1
- cd 1
- dotest modules-155c1 "${testcvs} -q co first-dir" \
- "U first-dir/subdir/a
- U first-dir/subdir/b"
- cd first-dir
- echo 'first revision' > file1
- echo 'first revision' > file2
- dotest modules-155c2 "${testcvs} add file1 file2" \
- "${PROG}"' add: scheduling file `file1'\'' for addition
- '"${PROG}"' add: scheduling file `file2'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
- dotest modules-155c3 "${testcvs} -q ci -m add-it" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 1\.1
- done"
- cd ..
- rm -r first-dir
- dotest modules-155c4 "${testcvs} -q co topfiles" \
- "U first-dir/file1
- U first-dir/file2"
- dotest modules-155c5 "${testcvs} -q co topfiles" ""
- # Make sure the right thing happens if we remove a file.
- cd first-dir
- dotest modules-155c6 "${testcvs} -q rm -f file1" \
- "${PROG} remove: use .${PROG} commit. to remove this file permanently"
- dotest modules-155c7 "${testcvs} -q ci -m remove-it" \
- "Removing file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: delete; previous revision: 1\.1
- done"
- cd ..
- rm -r first-dir
- dotest modules-155c8 "${testcvs} -q co topfiles" \
- "${PROG} checkout: warning: first-dir/file1 is not (any longer) pertinent
- U first-dir/file2"
- cd ..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- modules2)
- # More tests of modules, in particular the & feature.
- mkdir 1; cd 1
- dotest modules2-setup-1 "${testcvs} -q co -l ." ''
- mkdir first-dir second-dir third-dir
- dotest modules2-setup-2 \
- "${testcvs} add first-dir second-dir third-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
- Directory ${CVSROOT_DIRNAME}/second-dir added to the repository
- Directory ${CVSROOT_DIRNAME}/third-dir added to the repository"
- cd third-dir
- touch file3
- dotest modules2-setup-3 "${testcvs} add file3" \
- "${PROG} add: scheduling file .file3. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest modules2-setup-4 "${testcvs} -q ci -m add file3" \
- "RCS file: ${CVSROOT_DIRNAME}/third-dir/file3,v
- done
- Checking in file3;
- ${CVSROOT_DIRNAME}/third-dir/file3,v <-- file3
- initial revision: 1\.1
- done"
- cd ../..
- rm -r 1
- mkdir 1
- cd 1
- dotest modules2-1 "${testcvs} -q co CVSROOT/modules" \
- 'U CVSROOT/modules'
- cd CVSROOT
- cat >> modules << EOF
- ampermodule &first-dir &second-dir
- combmodule third-dir file3 &first-dir
- ampdirmod -d newdir &first-dir &second-dir
- badmod -d newdir
- messymod first-dir &messymodchild
- messymodchild -d sdir/child second-dir
- EOF
- # Depending on whether the user also ran the modules test
- # we will be checking in revision 1.2 or 1.3.
- dotest modules2-2 "${testcvs} -q ci -m add-modules" \
- "Checking in modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ..
- dotest modules2-3 "${testcvs} -q co ampermodule" ''
- dotest modules2-4 "test -d ampermodule/first-dir" ''
- dotest modules2-5 "test -d ampermodule/second-dir" ''
- # Test ability of cvs release to handle multiple arguments
- # See comment at "release" for list of other cvs release tests.
- cd ampermodule
- if ${testcvs} release -d first-dir second-dir <<EOF >>${LOGFILE}
- yes
- yes
- EOF
- then
- pass modules2-6
- else
- fail modules2-6
- fi
- dotest_fail modules2-7 "test -d first-dir" ''
- dotest_fail modules2-8 "test -d second-dir" ''
- cd ..
- # There used to be a nasty-hack that made CVS skip creation of the
- # module dir (in this case ampermodule) when -n was specified
- dotest modules2-ampermod-1 "${testcvs} -q co -n ampermodule" ''
- dotest modules2-ampermod-2 "test -d ampermodule/first-dir" ''
- dotest modules2-ampermod-3 "test -d ampermodule/second-dir" ''
- # Test release of a module
- if echo yes |${testcvs} release -d ampermodule >>${LOGFILE}; then
- pass modules2-ampermod-release-1
- else
- fail modules2-ampermod-release-1
- fi
- dotest_fail modules2-ampermod-release-2 "test -d ampermodule" ''
- # and the '-n' test again, but in conjunction with '-d'
- dotest modules2-ampermod-4 "${testcvs} -q co -n -d newname ampermodule" ''
- dotest modules2-ampermod-5 "test -d newname/first-dir" ''
- dotest modules2-ampermod-6 "test -d newname/second-dir" ''
- rm -rf newname
- # Now we create another directory named first-dir and make
- # sure that CVS doesn't get them mixed up.
- mkdir first-dir
- # Note that this message should say "Updating ampermodule/first-dir"
- # I suspect. This is a long-standing behavior/bug....
- dotest modules2-9 "${testcvs} co ampermodule" \
- "${PROG} checkout: Updating first-dir
- ${PROG} checkout: Updating second-dir"
- touch ampermodule/first-dir/amper1
- cd ampermodule
- dotest modules2-10 "${testcvs} add first-dir/amper1" \
- "${PROG} add: scheduling file .first-dir/amper1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- cd ..
- # As with the "Updating xxx" message, the "U first-dir/amper1"
- # message (instead of "U ampermodule/first-dir/amper1") is
- # rather fishy.
- dotest modules2-12 "${testcvs} co ampermodule" \
- "${PROG} checkout: Updating first-dir
- A first-dir/amper1
- ${PROG} checkout: Updating second-dir"
- if $remote; then
- dotest modules2-13 "${testcvs} -q ci -m add-it ampermodule" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/amper1,v
- done
- Checking in ampermodule/first-dir/amper1;
- ${CVSROOT_DIRNAME}/first-dir/amper1,v <-- amper1
- initial revision: 1\.1
- done"
- else
- # Trying this as above led to a "protocol error" message.
- # Work around this bug.
- cd ampermodule
- dotest modules2-13 "${testcvs} -q ci -m add-it" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/amper1,v
- done
- Checking in first-dir/amper1;
- ${CVSROOT_DIRNAME}/first-dir/amper1,v <-- amper1
- initial revision: 1\.1
- done"
- cd ..
- fi
- cd ..
- rm -r 1
- # Now test the "combmodule" module (combining regular modules
- # and ampersand modules in the same module definition).
- mkdir 1; cd 1
- dotest modules2-14 "${testcvs} co combmodule" \
- "U combmodule/file3
- ${PROG} checkout: Updating first-dir
- U first-dir/amper1"
- dotest modules2-15 "test -f combmodule/file3" ""
- dotest modules2-16 "test -f combmodule/first-dir/amper1" ""
- cd combmodule
- rm -r first-dir
- # At least for now there is no way to tell CVS that
- # some files/subdirectories come from one repository directory,
- # and others from another.
- # This seems like a pretty sensible behavior to me, in the
- # sense that first-dir doesn't "really" exist within
- # third-dir, so CVS just acts as if there is nothing there
- # to do.
- dotest modules2-17 "${testcvs} update -d" \
- "${PROG} update: Updating \."
- cd ..
- dotest modules2-18 "${testcvs} -q co combmodule" \
- "U first-dir/amper1"
- dotest modules2-19 "test -f combmodule/first-dir/amper1" ""
- cd ..
- rm -r 1
- # Now test the "ampdirmod" and "badmod" modules to be sure that
- # options work with ampersand modules but don't prevent the
- # "missing directory" error message.
- mkdir 1; cd 1
- dotest modules2-20 "${testcvs} co ampdirmod" \
- "${PROG} checkout: Updating first-dir
- U first-dir/amper1
- ${PROG} checkout: Updating second-dir"
- dotest modules2-21 "test -f newdir/first-dir/amper1" ""
- dotest modules2-22 "test -d newdir/second-dir" ""
- dotest_fail modules2-23 "${testcvs} co badmod" \
- "${PROG} checkout: modules file missing directory for module badmod" \
- "${PROG} server: modules file missing directory for module badmod
- ${PROG} \[checkout aborted\]: cannot expand modules"
- cd ..
- rm -r 1
- # Confirm that a rename with added depth nested in an ampersand
- # module works.
- mkdir 1; cd 1
- dotest modules2-nestedrename-1 "${testcvs} -q co messymod" \
- "U messymod/amper1"
- dotest modules2-nestedrename-2 "test -d messymod/sdir" ''
- dotest modules2-nestedrename-3 "test -d messymod/sdir/CVS" ''
- dotest modules2-nestedrename-4 "test -d messymod/sdir/child" ''
- dotest modules2-nestedrename-5 "test -d messymod/sdir/child/CVS" ''
- cd ..; rm -r 1
- # FIXME: client/server has a bug. It should be working like a local
- # repository in this case, but fails to check out the second module
- # in the list when a branch is specified.
- mkdir 1; cd 1
- dotest modules2-ampertag-setup-1 \
- "${testcvs} -Q rtag tag first-dir second-dir third-dir" \
- ''
- dotest modules2-ampertag-1 "${testcvs} -q co -rtag ampermodule" \
- "U first-dir/amper1"
- if $remote; then
- dotest_fail modules2-ampertag-2 "test -d ampermodule/second-dir" ''
- dotest_fail modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
- else
- dotest modules2-ampertag-2 "test -d ampermodule/second-dir" ''
- dotest modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
- fi
- cd ..; rm -r 1
- # Test for tag files when an ampermod is renamed with more path
- # elements than it started with.
- #
- # FIXME: This is currently broken in the remote case, possibly only
- # because the messymodchild isn't being checked out at all.
- mkdir 1; cd 1
- # dotest modules2-tagfiles-setup-1 \
- #"${testcvs} -Q rtag -b branch first-dir second-dir" \
- #''
- dotest modules2-tagfiles-1 "${testcvs} -q co -rtag messymod" \
- "U messymod/amper1"
- if $remote; then
- dotest_fail modules2-tagfiles-2r "test -d messymod/sdir" ''
- else
- dotest modules2-tagfiles-2 "cat messymod/sdir/CVS/Tag" 'Ttag'
- fi
- cd ..; rm -r 1
- # Test that CVS gives an error if one combines -a with
- # other options.
- # Probably would be better to break this out into a separate
- # test. Although it is short, it shares no files/state with
- # the rest of the modules2 tests.
- mkdir 1; cd 1
- dotest modules2-a0.5 "${testcvs} -q co CVSROOT/modules" \
- 'U CVSROOT/modules'
- cd CVSROOT
- echo 'aliasopt -a -d onedir first-dir' >modules
- dotest modules2-a0 "${testcvs} -q ci -m add-modules" \
- "Checking in modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ..
- dotest_fail modules2-a1 "${testcvs} -q co aliasopt" \
- "${PROG} checkout: -a cannot be specified in the modules file along with other options" \
- "${PROG} server: -a cannot be specified in the modules file along with other options
- ${PROG} \[checkout aborted\]: cannot expand modules"
- cd ..; rm -r 1
- # Clean up.
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -rf ${CVSROOT_DIRNAME}/second-dir
- rm -rf ${CVSROOT_DIRNAME}/third-dir
- ;;
- modules3)
- # More tests of modules, in particular what happens if several
- # modules point to the same file.
- # First just set up a directory first-dir and a file file1 in it.
- mkdir 1; cd 1
- dotest modules3-0 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest modules3-1 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- echo file1 >file1
- dotest modules3-2 "${testcvs} add file1" \
- "${PROG} add: scheduling file \`file1' for addition
- ${PROG} add: use '${PROG} commit' to add this file permanently"
- dotest modules3-3 "${testcvs} -q ci -m add-it" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- cd ..
- dotest modules3-4 "${testcvs} -q update -d CVSROOT" \
- "U CVSROOT${DOTSTAR}"
- cd CVSROOT
- cat >modules <<EOF
- mod1 -a first-dir/file1
- bigmod -a mod1 first-dir/file1
- namednest -d src/sub/dir first-dir
- nestdeeper -d src/sub1/sub2/sub3/dir first-dir
- nestshallow -d src/dir second-dir/suba/subb
- path/in/modules &mod1
- another/path/test -d another/path/test first-dir
- EOF
- dotest modules3-5 "${testcvs} -q ci -m add-modules" \
- "Checking in modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ..
- dotest modules3-6 "${testcvs} -q co bigmod" ''
- rm -r first-dir
- dotest modules3-7 "${testcvs} -q co bigmod" 'U first-dir/file1'
- cd ..
- rm -r 1
- mkdir 1; cd 1
- mkdir suba
- mkdir suba/subb
- # This fails to work remote (it doesn't notice the directories,
- # I suppose because they contain no files). Bummer, especially
- # considering this is a documented technique and everything.
- dotest modules3-7a \
- "${testcvs} import -m add-dirs second-dir tag1 tag2" \
- "${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/suba
- ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/suba/subb
- No conflicts created by this import" "
- No conflicts created by this import"
- cd ..; rm -r 1
- mkdir 1; cd 1
- dotest modules3-7b "${testcvs} co second-dir" \
- "${PROG} checkout: Updating second-dir
- ${PROG} checkout: Updating second-dir/suba
- ${PROG} checkout: Updating second-dir/suba/subb" \
- "${PROG} checkout: Updating second-dir"
- if $remote; then
- cd second-dir
- mkdir suba
- dotest modules3-7-workaround1 "${testcvs} add suba" \
- "Directory ${CVSROOT_DIRNAME}/second-dir/suba added to the repository"
- cd suba
- mkdir subb
- dotest modules3-7-workaround2 "${testcvs} add subb" \
- "Directory ${CVSROOT_DIRNAME}/second-dir/suba/subb added to the repository"
- cd ../..
- fi
- cd second-dir/suba/subb
- touch fileb
- dotest modules3-7c "${testcvs} add fileb" \
- "${PROG} add: scheduling file .fileb. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest modules3-7d "${testcvs} -q ci -m add-it" \
- "RCS file: ${CVSROOT_DIRNAME}/second-dir/suba/subb/fileb,v
- done
- Checking in fileb;
- ${CVSROOT_DIRNAME}/second-dir/suba/subb/fileb,v <-- fileb
- initial revision: 1\.1
- done"
- cd ../../..
- cd ..; rm -r 1
- mkdir 1
- cd 1
- dotest modules3-8 "${testcvs} -q co namednest" \
- 'U src/sub/dir/file1'
- dotest modules3-9 "test -f src/sub/dir/file1" ''
- cd ..
- rm -r 1
- # Try the same thing, but with the directories nested even
- # deeper (deeply enough so they are nested more deeply than
- # the number of directories from / to ${TESTDIR}).
- mkdir 1
- cd 1
- dotest modules3-10 "${testcvs} -q co nestdeeper" \
- 'U src/sub1/sub2/sub3/dir/file1'
- dotest modules3-11 "test -f src/sub1/sub2/sub3/dir/file1" ''
- # While we are doing things like twisted uses of '/' (e.g.
- # modules3-12), try this one.
- if $remote; then
- dotest_fail modules3-11b \
- "${testcvs} -q update ${TESTDIR}/1/src/sub1/sub2/sub3/dir/file1" \
- "absolute pathname .${TESTDIR}/1/src/sub1/sub2/sub3/dir. illegal for server"
- fi # end of remote-only tests
- cd ..
- rm -r 1
- # This one is almost too twisted for words. The pathname output
- # in the message from "co" doesn't include the "path/in/modules",
- # but those directories do get created (with no CVSADM except
- # in "modules" which has a CVSNULLREPOS).
- # I'm not sure anyone is relying on this nonsense or whether we
- # need to keep doing it, but it is what CVS currently does...
- # Skip it for remote; the remote code has the good sense to
- # not deal with it (on the minus side it gives
- # "internal error: repository string too short." (CVS 1.9) or
- # "warning: server is not creating directories one at a time" (now)
- # instead of a real error).
- # I'm tempted to just make it a fatal error to have '/' in a
- # module name. But see comments at modules3-16.
- if $remote; then :; else
- mkdir 1; cd 1
- dotest modules3-12 "${testcvs} -q co path/in/modules" \
- "U first-dir/file1"
- dotest modules3-13 "test -f path/in/modules/first-dir/file1" ''
- cd ..; rm -r 1
- fi # end of tests skipped for remote
- # Now here is where it used to get seriously bogus.
- mkdir 1; cd 1
- dotest modules3-14 \
- "${testcvs} -q rtag tag1 path/in/modules" ''
- # CVS used to create this even though rtag should *never* affect
- # the directory current when it is called!
- dotest_fail modules3-15 "test -d path/in/modules" ''
- # Just for trivia's sake, rdiff was not similarly vulnerable
- # because it passed 0 for run_module_prog to do_module.
- cd ..; rm -r 1
- # Some people seem to want this to work. I still suspect there
- # are dark corners in slashes in module names. This probably wants
- # more thought before we start hacking on CVS (one way or the other)
- # or documenting this.
- mkdir 2; cd 2
- dotest modules3-16 "${testcvs} -q co another/path/test" \
- "U another/path/test/file1"
- dotest modules3-17 "cat another/path/test/file1" 'file1'
- cd ..; rm -r 2
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -rf ${CVSROOT_DIRNAME}/second-dir
- ;;
- modules4)
- # Some tests using the modules file with aliases that
- # exclude particular directories.
- mkdir 1; cd 1
- dotest modules4-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest modules4-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- mkdir subdir subdir_long
- dotest modules4-3 "${testcvs} add subdir subdir_long" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository
- Directory ${CVSROOT_DIRNAME}/first-dir/subdir_long added to the repository"
- echo file1 > file1
- dotest modules4-4 "${testcvs} add file1" \
- "${PROG}"' add: scheduling file `file1'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- echo file2 > subdir/file2
- dotest modules4-5 "${testcvs} add subdir/file2" \
- "${PROG}"' add: scheduling file `subdir/file2'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- echo file3 > subdir_long/file3
- dotest modules4-6 "${testcvs} add subdir_long/file3" \
- "${PROG}"' add: scheduling file `subdir_long/file3'\'' for addition
- '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest modules4-7 "${testcvs} -q ci -m add-it" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
- done
- Checking in subdir/file2;
- ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v <-- file2
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir_long/file3,v
- done
- Checking in subdir_long/file3;
- ${CVSROOT_DIRNAME}/first-dir/subdir_long/file3,v <-- file3
- initial revision: 1\.1
- done"
- cd ..
- dotest modules4-8 "${testcvs} -q update -d CVSROOT" \
- "U CVSROOT${DOTSTAR}"
- cd CVSROOT
- cat >modules <<EOF
- all -a first-dir
- some -a !first-dir/subdir first-dir
- other -a !first-dir/subdir !first-dir/subdir_long first-dir
- somewhat -a first-dir !first-dir/subdir
- EOF
- dotest modules4-9 "${testcvs} -q ci -m add-modules" \
- "Checking in modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ..
- cd ..
- mkdir 2; cd 2
- dotest modules4-10 "${testcvs} -q co all" \
- "U first-dir/file1
- U first-dir/subdir/file2
- U first-dir/subdir_long/file3"
- rm -r first-dir
- dotest modules4-11 "${testcvs} -q co some" \
- "U first-dir/file1
- U first-dir/subdir_long/file3"
- dotest_fail modules4-12 "test -d first-dir/subdir" ''
- dotest modules4-13 "test -d first-dir/subdir_long" ''
- rm -r first-dir
- if $remote; then
- # But remote seems to do it the other way.
- dotest modules4-14r-1 "${testcvs} -q co somewhat" \
- "U first-dir/file1
- U first-dir/subdir_long/file3"
- dotest_fail modules4-14r-2 "test -d first-dir/subdir" ''
- dotest modules4-14r-3 "test -d first-dir/subdir_long" ''
- else
- # This is strange behavior, in that the order of the
- # "!first-dir/subdir" and "first-dir" matter, and it isn't
- # clear that they should. I suspect it is long-standing
- # strange behavior but I haven't verified that.
- dotest modules4-14-1 "${testcvs} -q co somewhat" \
- "U first-dir/file1
- U first-dir/subdir/file2
- U first-dir/subdir_long/file3"
- dotest modules4-14-2 "test -d first-dir/subdir" ''
- dotest modules4-14-3 "test -d first-dir/subdir_long" ''
- fi
- rm -r first-dir
- dotest modules4-15 "${testcvs} -q co other" \
- "U first-dir/file1"
- dotest_fail modules4-16 "test -d first-dir/subdir" ''
- dotest_fail modules4-17 "test -d first-dir/subdir_long" ''
- rm -r first-dir
- cd ..
- rm -r 2
- dotest modules4-18 "${testcvs} rtag tag some" \
- "${PROG} rtag: Tagging first-dir
- ${PROG} rtag: Ignoring first-dir/subdir
- ${PROG} rtag: Tagging first-dir/subdir_long"
- cd 1/first-dir/subdir
- dotest modules4-19 "${testcvs} log file2" "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
- Working file: file2
- head: 1\.1
- branch:
- locks: strict
- access list:
- symbolic names:
- keyword substitution: kv
- total revisions: 1; selected revisions: 1
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- add-it
- ============================================================================="
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- cd ../../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
- modules5)
- # Test module programs
- mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir 1
- cd 1
- dotest modules5-1 "${testcvs} -q co first-dir" ""
- cd first-dir
- mkdir subdir
- dotest modules5-2 "${testcvs} add subdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
- cd subdir
- mkdir ssdir
- dotest modules5-3 "${testcvs} add ssdir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
- touch a b
- dotest modules5-4 "${testcvs} add a b" \
- "${PROG} add: scheduling file .a. for addition
- ${PROG} add: scheduling file .b. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest modules5-5 "${testcvs} ci -m added" \
- "${PROG} [a-z]*: Examining .
- ${PROG} [a-z]*: Examining ssdir
- RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/a,v
- done
- Checking in a;
- ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/b,v
- done
- Checking in b;
- ${CVSROOT_DIRNAME}/first-dir/subdir/b,v <-- b
- initial revision: 1\.1
- done"
- cd ..
- dotest modules5-6 "${testcvs} -q co CVSROOT" \
- "U CVSROOT/checkoutlist
- U CVSROOT/commitinfo
- U CVSROOT/config
- U CVSROOT/cvswrappers
- U CVSROOT/editinfo
- U CVSROOT/loginfo
- U CVSROOT/modules
- U CVSROOT/notify
- U CVSROOT/rcsinfo
- U CVSROOT/taginfo
- U CVSROOT/verifymsg"
- # FIXCVS: The sleep in the following script helps avoid out of
- # order messages, but we really need to figure out how to fix
- # cvs to prevent them in the first place.
- for i in checkout export tag; do
- cat >> ${CVSROOT_DIRNAME}/$i.sh <<EOF
- #! /bin/sh
- sleep 1
- echo "$i script invoked in \`pwd\`"
- echo "args: \$@"
- EOF
- # Cygwin doesn't set premissions correctly over the Samba share.
- if test -n "$remotehost"; then
- $CVS_RSH $remotehost "chmod +x ${CVSROOT_DIRNAME}/$i.sh"
- else
- chmod +x ${CVSROOT_DIRNAME}/$i.sh
- fi
- done
- OPTS="-o${CVSROOT_DIRNAME}/checkout.sh -e ${CVSROOT_DIRNAME}/export.sh -t${CVSROOT_DIRNAME}/tag.sh"
- cat >CVSROOT/modules <<EOF
- realmodule ${OPTS} first-dir/subdir a
- dirmodule ${OPTS} first-dir/subdir
- namedmodule -d nameddir ${OPTS} first-dir/subdir
- EOF
- dotest modules5-7 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
- "" \
- "Checking in CVSROOT/modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ..
- rm -rf first-dir
- # Test that real modules check out to realmodule/a, not subdir/a.
- if $remote; then
- # FIXCVS?
- # Mac OSX 10.3 (Darwin ppc-osx1 5.5) fails here when $TMPDIR
- # contains a symlink (it does not fail the local modules5-8).
- # Since no other platforms are exhibiting the same problem, I
- # suspect an issue with OSX and fork() or the like dereferencing
- # the symlink, but it is possible it is something that could be
- # fixed or worked around in CVS.
- dotest modules5-8r "$testcvs co realmodule" \
- "U realmodule/a
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: realmodule"
- else
- dotest modules5-8 "${testcvs} co realmodule" \
- "U realmodule/a
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
- checkout script invoked in ${TESTDIR}/1
- args: realmodule"
- fi
- dotest modules5-9 "test -d realmodule && test -f realmodule/a" ""
- dotest_fail modules5-10 "test -f realmodule/b" ""
- if $remote; then
- dotest modules5-11 "${testcvs} -q co realmodule" \
- "checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: realmodule"
- dotest modules5-12 "${testcvs} -q update" ''
- echo "change" >>realmodule/a
- dotest modules5-13 "${testcvs} -q ci -m." \
- "Checking in realmodule/a;
- ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
- new revision: 1\.2; previous revision: 1\.1
- done"
- else
- dotest modules5-11 "${testcvs} -q co realmodule" \
- "checkout script invoked in ${TESTDIR}/1
- args: realmodule"
- dotest modules5-12 "${testcvs} -q update" ''
- echo "change" >>realmodule/a
- dotest modules5-13 "${testcvs} -q ci -m." \
- "Checking in realmodule/a;
- ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
- new revision: 1\.2; previous revision: 1\.1
- done"
- fi
- dotest modules5-14 "echo yes | ${testcvs} release -d realmodule" \
- "You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .realmodule.: "
- dotest modules5-15 "${testcvs} -q rtag -Dnow MYTAG realmodule" \
- "tag script invoked in ${TESTDIR}/1
- args: realmodule MYTAG" \
- "tag script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: realmodule MYTAG"
- if $remote; then
- dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
- "U realmodule/a
- export script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: realmodule"
- else
- dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
- "U realmodule/a
- export script invoked in ${TESTDIR}/1
- args: realmodule"
- fi
- rm -r realmodule
- dotest_fail modules5-17 "${testcvs} co realmodule/a" \
- "${PROG}"' checkout: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
- "${PROG}"' server: module `realmodule/a'\'' is a request for a file in a module which is not a directory
- '"${PROG}"' \[checkout aborted\]: cannot expand modules'
- # Now test the ability to check out a single file from a directory
- if $remote; then
- dotest modules5-18 "${testcvs} co dirmodule/a" \
- "U dirmodule/a
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: dirmodule"
- else
- dotest modules5-18 "${testcvs} co dirmodule/a" \
- "U dirmodule/a
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
- checkout script invoked in ${TESTDIR}/1
- args: dirmodule"
- fi
- dotest modules5-19 "test -d dirmodule && test -f dirmodule/a" ""
- dotest_fail modules5-20 "test -f dirmodule/b" ""
- dotest modules5-21 "echo yes | ${testcvs} release -d dirmodule" \
- "You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .dirmodule.: "
- # Now test the ability to correctly reject a non-existent filename.
- # For maximum studliness we would check that an error message is
- # being output.
- # We accept a zero exit status because it is what CVS does
- # (Dec 95). Probably the exit status should be nonzero,
- # however.
- if $remote; then
- dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
- "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: dirmodule"
- else
- dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
- "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
- checkout script invoked in ${TESTDIR}/1
- args: dirmodule"
- fi
- # We tolerate the creation of the dirmodule directory, since that
- # is what CVS does, not because we view that as preferable to not
- # creating it.
- dotest_fail modules5-23 "test -f dirmodule/a || test -f dirmodule/b" ""
- rm -r dirmodule
- # Now test that a module using -d checks out to the specified
- # directory.
- if $remote; then
- dotest modules5-24 "${testcvs} -q co namedmodule" \
- "U nameddir/a
- U nameddir/b
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: nameddir"
- else
- dotest modules5-24 "${testcvs} -q co namedmodule" \
- "U nameddir/a
- U nameddir/b
- checkout script invoked in ${TESTDIR}/1
- args: nameddir"
- fi
- dotest modules5-25 "test -f nameddir/a && test -f nameddir/b" ""
- echo add line >>nameddir/a
- # This seems suspicious: when we checkout an existing directory,
- # the checkout script gets executed in addition to the update
- # script. Is that by design or accident?
- if $remote; then
- dotest modules5-26 "${testcvs} -q co namedmodule" \
- "M nameddir/a
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: nameddir"
- else
- dotest modules5-26 "${testcvs} -q co namedmodule" \
- "M nameddir/a
- checkout script invoked in ${TESTDIR}/1
- args: nameddir"
- fi
- rm nameddir/a
- if $remote; then
- dotest modules5-27 "${testcvs} -q co namedmodule" \
- "U nameddir/a
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: nameddir"
- else
- dotest modules5-27 "${testcvs} -q co namedmodule" \
- "U nameddir/a
- checkout script invoked in ${TESTDIR}/1
- args: nameddir"
- fi
- dotest modules5-28 "echo yes | ${testcvs} release -d nameddir" \
- "You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .nameddir.: "
- # Now try the same tests with -d on command line
- # FIXCVS? The manual says the modules programs get the module name,
- # but they really get the directory name.
- if $remote; then
- dotest modules5-29 "${testcvs} co -d mydir realmodule" \
- "U mydir/a
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: mydir"
- else
- dotest modules5-29 "${testcvs} co -d mydir realmodule" \
- "U mydir/a
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
- checkout script invoked in ${TESTDIR}/1
- args: mydir"
- fi
- dotest modules5-30 "test -d mydir && test -f mydir/a" ""
- dotest_fail modules5-31 "test -d realmodule || test -f mydir/b" ""
- if $remote; then
- dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \
- "checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: mydir"
- dotest modules5-33 "${testcvs} -q update" ''
- echo "change" >>mydir/a
- dotest modules5-34 "${testcvs} -q ci -m." \
- "Checking in mydir/a;
- ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
- new revision: 1\.3; previous revision: 1\.2
- done"
- else
- dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \
- "checkout script invoked in ${TESTDIR}/1
- args: mydir"
- dotest modules5-33 "${testcvs} -q update" ''
- echo "change" >>mydir/a
- dotest modules5-34 "${testcvs} -q ci -m." \
- "Checking in mydir/a;
- ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
- new revision: 1\.3; previous revision: 1\.2
- done"
- fi
- dotest modules5-35 "echo yes | ${testcvs} release -d mydir" \
- "You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .mydir.: "
- if $remote; then
- dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \
- "tag script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: realmodule MYTAG2"
- dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \
- "U mydir/a
- export script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: mydir"
- else
- dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \
- "tag script invoked in ${TESTDIR}/1
- args: realmodule MYTAG2"
- dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \
- "U mydir/a
- export script invoked in ${TESTDIR}/1
- args: mydir"
- fi
- rm -r mydir
- # Now test the ability to check out a single file from a directory
- if $remote; then
- dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \
- "U mydir/a
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: mydir"
- else
- dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \
- "U mydir/a
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
- checkout script invoked in ${TESTDIR}/1
- args: mydir"
- fi
- dotest modules5-39 "test -d mydir && test -f mydir/a" ""
- dotest_fail modules5-40 "test -d dirmodule || test -f mydir/b" ""
- dotest modules5-41 "echo yes | ${testcvs} release -d mydir" \
- "You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .mydir.: "
- # Now test the ability to correctly reject a non-existent filename.
- # For maximum studliness we would check that an error message is
- # being output.
- # We accept a zero exit status because it is what CVS does
- # (Dec 95). Probably the exit status should be nonzero,
- # however.
- if $remote; then
- dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \
- "${PROG} checkout: warning: new-born mydir/nonexist has disappeared
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: mydir"
- else
- dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \
- "${PROG} checkout: warning: new-born mydir/nonexist has disappeared
- ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
- checkout script invoked in ${TESTDIR}/1
- args: mydir"
- fi
- # We tolerate the creation of the mydir directory, since that
- # is what CVS does, not because we view that as preferable to not
- # creating it.
- dotest_fail modules5-43 "test -f mydir/a || test -f mydir/b" ""
- rm -r mydir
- if $remote; then
- dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \
- "U mydir/a
- U mydir/b
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: mydir"
- else
- dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \
- "U mydir/a
- U mydir/b
- checkout script invoked in ${TESTDIR}/1
- args: mydir"
- fi
- dotest modules5-45 "test -f mydir/a && test -f mydir/b" ""
- dotest_fail modules5-46 "test -d namedir"
- echo add line >>mydir/a
- # This seems suspicious: when we checkout an existing directory,
- # the checkout script gets executed in addition to the update
- # script. Is that by design or accident?
- if $remote; then
- dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \
- "M mydir/a
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: mydir"
- else
- dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \
- "M mydir/a
- checkout script invoked in ${TESTDIR}/1
- args: mydir"
- fi
- rm mydir/a
- if $remote; then
- dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \
- "U mydir/a
- checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
- args: mydir"
- else
- dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \
- "U mydir/a
- checkout script invoked in ${TESTDIR}/1
- args: mydir"
- fi
- dotest modules5-49 "echo yes | ${testcvs} release -d mydir" \
- "You have \[0\] altered files in this repository\.
- Are you sure you want to release (and delete) directory .mydir.: "
- cd ..
- rm -rf 1 ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/*.sh
- ;;
- modules6)
- #
- # Test invalid module definitions
- #
- # See the header comment for the `modules' test for an index of
- # the complete suite of modules tests.
- #
- #
- # There was a bug in CVS through 1.11.1p1 where a bad module name
- # would cause the previous line to be parsed as the module
- # definition. This test proves this doesn't happen anymore.
- #
- mkdir modules6
- cd modules6
- dotest module6-setup-1 "${testcvs} -Q co CVSROOT" ""
- cd CVSROOT
- echo "longmodulename who cares" >modules
- echo "badname" >>modules
- # This test almost isn't setup since it generates the error message
- # we are looking for if `-Q' isn't specified, but I want to test the
- # filename in the message later.
- dotest modules6-setup-2 "${testcvs} -Q ci -mbad-modules" \
- "Checking in modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: [0-9.]*; previous revision: [0-9.]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- # Here's where CVS would report not being able to find `lename'
- cd ..
- dotest_fail modules6-1 "${testcvs} -q co badname" \
- "${PROG} checkout: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules.
- ${PROG} checkout: cannot find module .badname. - ignored" \
- "${PROG} server: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules.
- ${PROG} server: cannot find module .badname. - ignored
- ${PROG} \[checkout aborted\]: cannot expand modules"
- # cleanup
- cd CVSROOT
- echo "# empty modules file" >modules
- dotest modules6-cleanup-1 "${testcvs} -Q ci -mempty-modules" \
- "Checking in modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: [0-9.]*; previous revision: [0-9.]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ../..
- if $keep; then :; else
- rm -r modules6
- fi
- ;;
- modules7)
- #
- # Test tag problems vs an empty CVSROOT/val-tags file
- #
- # See the header comment for the `modules' test for an index of
- # the complete suite of modules tests.
- #
- mkdir modules7
- cd modules7
- dotest modules7-1 "$testcvs -Q co -d top ."
- cd top
- mkdir zero one
- dotest modules7-2 "$testcvs -Q add zero one"
- cd one
- echo 'file1 contents' > file1
- dotest modules7-2 "$testcvs -Q add file1"
- dotest modules7-3 "$testcvs -Q ci -mnew file1" \
- "RCS file: $CVSROOT_DIRNAME/one/file1,v
- done
- Checking in file1;
- $CVSROOT_DIRNAME/one/file1,v <-- file1
- initial revision: 1\.1
- done"
- dotest modules7-4 "$testcvs -Q tag mytag file1"
- cd ../CVSROOT
- echo 'all -a zero one' > modules
- dotest modules7-5 "$testcvs -Q ci -mall-module" \
- "Checking in modules;
- $CVSROOT_DIRNAME/CVSROOT/modules,v <-- modules
- new revision: [0-9.]*; previous revision: [0-9.]*
- done
- $PROG commit: Rebuilding administrative file database"
- cd ../..
- mkdir myexport
- cd myexport
- # FIXCVS: The export should NOT be aborted here
- dotest_fail modules7-6 "$testcvs export -rmytag all" \
- "$PROG \[export aborted\]: no such tag mytag"
- cd ..
- rm -fr myexport
- mkdir myexport
- cd myexport
- # FIXCVS: Workaround is to have mytag listed in val-tags
- echo 'mytag y' > $CVSROOT_DIRNAME/CVSROOT/val-tags
- dotest modules7-7 "$testcvs export -rmytag all" \
- "$PROG export: Updating zero
- $PROG export: Updating one
- U one/file1"
- dotest modules7-8 'cat one/file1' 'file1 contents'
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- # cleanup
- cd ../top/CVSROOT
- echo "# empty modules file" >modules
- dotest modules7-cleanup-1 "$testcvs -Q ci -mempty-modules" \
- "Checking in modules;
- $CVSROOT_DIRNAME/CVSROOT/modules,v <-- modules
- new revision: [0-9.]*; previous revision: [0-9.]*
- done
- $PROG commit: Rebuilding administrative file database"
- cd ../../..
- rm -fr modules7
- rm -rf $CVSROOT_DIRNAME/zero $CVSROOT_DIRNAME/one
- ;;
- mkmodules)
- # When a file listed in checkoutlist doesn't exist, cvs-1.10.4
- # would fail to remove the CVSROOT/.#[0-9]* temporary file it
- # creates while mkmodules is in the process of trying to check
- # out the missing file.
- mkdir 1; cd 1
- dotest mkmodules-temp-file-removal-1 "${testcvs} -Q co CVSROOT" ''
- cd CVSROOT
- echo no-such-file >> checkoutlist
- dotest mkmodules-temp-file-removal-2 "${testcvs} -Q ci -m. checkoutlist" \
- "Checking in checkoutlist;
- $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
- new revision: 1\.2; previous revision: 1\.1
- done
- ${PROG} commit: Rebuilding administrative file database"
- dotest mkmodules-temp-file-removal-3 "echo $CVSROOT_DIRNAME/CVSROOT/.#[0-9]*" \
- "$CVSROOT_DIRNAME/CVSROOT/\.#\[0-9\]\*"
- # Versions 1.11.6 & 1.12.1 and earlier of CVS printed most of the
- # white space included before error messages in checkoutlist.
- echo "no-such-file Failed to update no-such-file." >checkoutlist
- dotest mkmodules-error-message-1 "${testcvs} -Q ci -m. checkoutlist" \
- "Checking in checkoutlist;
- $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
- new revision: 1\.3; previous revision: 1\.2
- done
- ${PROG} commit: Rebuilding administrative file database
- ${PROG} commit: Failed to update no-such-file\."
- # Versions 1.11.6 & 1.12.1 and earlier of CVS used the error string
- # from the checkoutlist file as the format string passed to error()'s
- # printf. Check that this is no longer the case by verifying that
- # printf format patterns remain unchanged.
- echo "no-such-file Failed to update %s %lx times because %s happened %d times." >checkoutlist
- dotest mkmodules-error-message-2 "${testcvs} -Q ci -m. checkoutlist" \
- "Checking in checkoutlist;
- $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
- new revision: 1\.4; previous revision: 1\.3
- done
- ${PROG} commit: Rebuilding administrative file database
- ${PROG} commit: Failed to update %s %lx times because %s happened %d times\."
- dotest mkmodules-cleanup-1 "${testcvs} -Q up -pr1.1 checkoutlist >checkoutlist"
- dotest mkmodules-cleanup-2 "${testcvs} -Q ci -m. checkoutlist" \
- "Checking in checkoutlist;
- $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
- new revision: 1\.5; previous revision: 1\.4
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ../..
- rm -rf 1
- ;;
- co-d)
- # Some tests of various permutations of co-d when directories exist
- # and checkouts lengthen.
- #
- # Interestingly enough, these same tests pass when the directory
- # lengthening happens via the modules file. Go figure.
- module=co-d
- mkdir $module; cd $module
- mkdir top; cd top
- dotest co-d-init-1 "$testcvs -Q co -l ."
- mkdir $module
- dotest co-d-init-2 "$testcvs -Q add $module"
- cd $module
- echo content >file1
- echo different content >file2
- dotest co-d-init-3 "$testcvs -Q add file1 file2"
- dotest co-d-init-4 "$testcvs -Q ci -madd-em" \
- "RCS file: $CVSROOT_DIRNAME/co-d/file1,v
- done
- Checking in file1;
- $CVSROOT_DIRNAME/co-d/file1,v <-- file1
- initial revision: 1\.1
- done
- RCS file: $CVSROOT_DIRNAME/co-d/file2,v
- done
- Checking in file2;
- $CVSROOT_DIRNAME/co-d/file2,v <-- file2
- initial revision: 1\.1
- done"
- cd ../..
- mkdir 2; cd 2
- dotest co-d-1 "$testcvs -q co -d dir $module" \
- "U dir/file1
- U dir/file2"
- dotest co-d-1.2 "cat dir/CVS/Repository" "$module"
- # FIXCVS: This should work. Correct expected result:
- #
- #"U dir2/sdir/file1
- #U dir2/sdir/file2"
- dotest_fail co-d-2 "$testcvs -q co -d dir2/sdir $module" \
- "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir2': No such file or directory"
- # FIXCVS:
- # dotest co-d-2.2 "cat dir4/CVS/Repository" "CVSROOT/Emptydir"
- # dotest co-d-2.3 "cat dir5/CVS/Repository" "$module"
- mkdir dir3
- dotest co-d-3 "$testcvs -q co -d dir3 $module" \
- "U dir3/file1
- U dir3/file2"
- dotest co-d-3.2 "cat dir3/CVS/Repository" "$module"
- if $remote; then
- # FIXCVS: As for co-d-2.
- mkdir dir4
- dotest_fail co-d-4r "$testcvs -q co -d dir4/sdir $module" \
- "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir4': No such file or directory"
- # FIXCVS: As for co-d-2.
- mkdir dir5
- mkdir dir5/sdir
- dotest_fail co-d-5r "$testcvs -q co -d dir5/sdir $module" \
- "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir5': No such file or directory"
- else
- mkdir dir4
- dotest co-d-4 "$testcvs -q co -d dir4/sdir $module" \
- "U dir4/sdir/file1
- U dir4/sdir/file2"
- # CVS only creates administration directories for directories it
- # creates, and the last portion of the path passed to -d
- # regardless.
- dotest_fail co-d-4.2 "test -d dir4/CVS"
- dotest co-d-4.3 "cat dir4/sdir/CVS/Repository" "$module"
- mkdir dir5
- mkdir dir5/sdir
- dotest co-d-5 "$testcvs -q co -d dir5/sdir $module" \
- "U dir5/sdir/file1
- U dir5/sdir/file2"
- # CVS only creates administration directories for directories it
- # creates, and the last portion of the path passed to -d
- # regardless.
- dotest_fail co-d-5.2 "test -d dir5/CVS"
- dotest co-d-5.3 "cat dir5/sdir/CVS/Repository" "$module"
- fi
- # clean up
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ../..
- rm -rf $CVSROOT_DIRNAME/$module
- rm -r $module
- ;;
- cvsadm)
- # These test check the content of CVS' administrative
- # files as they are checked out in various configurations.
- # (As a side note, I'm not using the "-q" flag in any of
- # this code, which should provide some extra checking for
- # those messages which don't seem to be checked thoroughly
- # anywhere else.) To do a thorough test, we need to make
- # a bunch of modules in various configurations.
- #
- # <1mod> is a directory at the top level of cvsroot
- # ``foo bar''
- # <2mod> is a directory at the second level of cvsroot
- # ``foo bar/baz''
- # <1d1mod> is a directory at the top level which is
- # checked out into another directory
- # ``foo -d bar baz''
- # <1d2mod> is a directory at the second level which is
- # checked out into another directory
- # ``foo -d bar baz/quux''
- # <2d1mod> is a directory at the top level which is
- # checked out into a directory that is two deep
- # ``foo -d bar/baz quux''
- # <2d2mod> is a directory at the second level which is
- # checked out into a directory that is two deep
- # ``foo -d bar/baz quux''
- #
- # The tests do each of these types separately and in twos.
- # We also repeat each test -d flag for 1-deep and 2-deep
- # directories.
- #
- # Each test should check the output for the Repository
- # file, since that is the one which varies depending on
- # the directory and how it was checked out.
- #
- # Yes, this is verbose, but at least it's very thorough.
- # convenience variables
- REP=${CVSROOT}
- # First, set TopLevelAdmin=yes so we're sure to get
- # top-level CVS directories.
- mkdir 1; cd 1
- dotest cvsadm-setup-1 "${testcvs} -q co CVSROOT/config" \
- "U CVSROOT/config"
- cd CVSROOT
- echo "TopLevelAdmin=yes" >config
- dotest cvsadm-setup-2 "${testcvs} -q ci -m yes-top-level" \
- "Checking in config;
- ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ../..
- rm -r 1
- # Second, check out the modules file and edit it.
- mkdir 1; cd 1
- dotest cvsadm-1 "${testcvs} co CVSROOT/modules" \
- "U CVSROOT/modules"
- # Test CVS/Root once. Since there is only one part of
- # the code which writes CVS/Root files (Create_Admin),
- # there is no point in testing this every time.
- dotest cvsadm-1a "cat CVS/Root" ${REP}
- dotest cvsadm-1b "cat CVS/Repository" "\."
- dotest cvsadm-1c "cat CVSROOT/CVS/Root" ${REP}
- dotest cvsadm-1d "cat CVSROOT/CVS/Repository" "CVSROOT"
- # All of the defined module names begin with a number.
- # All of the top-level directory names begin with "dir".
- # All of the subdirectory names begin with "sub".
- # All of the top-level modules begin with "mod".
- echo "# Module defs for cvsadm tests" > CVSROOT/modules
- echo "1mod mod1" >> CVSROOT/modules
- echo "1mod-2 mod1-2" >> CVSROOT/modules
- echo "2mod mod2/sub2" >> CVSROOT/modules
- echo "2mod-2 mod2-2/sub2-2" >> CVSROOT/modules
- echo "1d1mod -d dir1d1 mod1" >> CVSROOT/modules
- echo "1d1mod-2 -d dir1d1-2 mod1-2" >> CVSROOT/modules
- echo "1d2mod -d dir1d2 mod2/sub2" >> CVSROOT/modules
- echo "1d2mod-2 -d dir1d2-2 mod2-2/sub2-2" >> CVSROOT/modules
- echo "2d1mod -d dir2d1/sub2d1 mod1" >> CVSROOT/modules
- echo "2d1mod-2 -d dir2d1-2/sub2d1-2 mod1-2" >> CVSROOT/modules
- echo "2d2mod -d dir2d2/sub2d2 mod2/sub2" >> CVSROOT/modules
- echo "2d2mod-2 -d dir2d2-2/sub2d2-2 mod2-2/sub2-2" >> CVSROOT/modules
- dotest cvsadm-1e "${testcvs} ci -m add-modules" \
- "${PROG} [a-z]*: Examining .
- ${PROG} [a-z]*: Examining CVSROOT
- Checking in CVSROOT/modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database" \
- "${PROG} commit: Examining .
- ${PROG} commit: Examining CVSROOT"
- rm -rf CVS CVSROOT;
- # Create the various modules
- dotest cvsadm-2 "${testcvs} -q co -l ." ''
- mkdir mod1
- mkdir mod1-2
- mkdir mod2
- mkdir mod2/sub2
- mkdir mod2-2
- mkdir mod2-2/sub2-2
- dotest cvsadm-2a "${testcvs} add mod1 mod1-2 mod2 mod2/sub2 mod2-2 mod2-2/sub2-2" \
- "Directory ${CVSROOT_DIRNAME}/mod1 added to the repository
- Directory ${CVSROOT_DIRNAME}/mod1-2 added to the repository
- Directory ${CVSROOT_DIRNAME}/mod2 added to the repository
- Directory ${CVSROOT_DIRNAME}/mod2/sub2 added to the repository
- Directory ${CVSROOT_DIRNAME}/mod2-2 added to the repository
- Directory ${CVSROOT_DIRNAME}/mod2-2/sub2-2 added to the repository"
- # Populate the directories for the halibut
- echo "file1" > mod1/file1
- echo "file1-2" > mod1-2/file1-2
- echo "file2" > mod2/sub2/file2
- echo "file2-2" > mod2-2/sub2-2/file2-2
- dotest cvsadm-2aa "${testcvs} add mod1/file1 mod1-2/file1-2 mod2/sub2/file2 mod2-2/sub2-2/file2-2" \
- "${PROG} add: scheduling file .mod1/file1. for addition
- ${PROG} add: scheduling file .mod1-2/file1-2. for addition
- ${PROG} add: scheduling file .mod2/sub2/file2. for addition
- ${PROG} add: scheduling file .mod2-2/sub2-2/file2-2. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest cvsadm-2b "${testcvs} ci -m yup mod1 mod1-2 mod2 mod2-2" \
- "${PROG} [a-z]*: Examining mod1
- ${PROG} [a-z]*: Examining mod1-2
- ${PROG} [a-z]*: Examining mod2
- ${PROG} [a-z]*: Examining mod2/sub2
- ${PROG} [a-z]*: Examining mod2-2
- ${PROG} [a-z]*: Examining mod2-2/sub2-2
- RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
- done
- Checking in mod1/file1;
- ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/mod1-2/file1-2,v
- done
- Checking in mod1-2/file1-2;
- ${CVSROOT_DIRNAME}/mod1-2/file1-2,v <-- file1-2
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/mod2/sub2/file2,v
- done
- Checking in mod2/sub2/file2;
- ${CVSROOT_DIRNAME}/mod2/sub2/file2,v <-- file2
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v
- done
- Checking in mod2-2/sub2-2/file2-2;
- ${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v <-- file2-2
- initial revision: 1.1
- done"
- # Finished creating the modules -- clean up.
- rm -rf CVS mod1 mod1-2 mod2 mod2-2
- # Done.
- ##################################################
- ## Start the dizzying array of possibilities.
- ## Begin with each module type separately.
- ##################################################
-
- # Pattern -- after each checkout, first check the top-level
- # CVS directory. Then, check the directories in numerical
- # order.
- dotest cvsadm-3 "${testcvs} co 1mod" \
- "${PROG} checkout: Updating 1mod
- U 1mod/file1"
- dotest cvsadm-3b "cat CVS/Repository" "\."
- dotest cvsadm-3d "cat 1mod/CVS/Repository" "mod1"
- rm -rf CVS 1mod
- dotest cvsadm-4 "${testcvs} co 2mod" \
- "${PROG} checkout: Updating 2mod
- U 2mod/file2"
- dotest cvsadm-4b "cat CVS/Repository" "\."
- dotest cvsadm-4d "cat 2mod/CVS/Repository" "mod2/sub2"
- rm -rf CVS 2mod
- dotest cvsadm-5 "${testcvs} co 1d1mod" \
- "${PROG} checkout: Updating dir1d1
- U dir1d1/file1"
- dotest cvsadm-5b "cat CVS/Repository" "\."
- dotest cvsadm-5d "cat dir1d1/CVS/Repository" "mod1"
- rm -rf CVS dir1d1
- dotest cvsadm-6 "${testcvs} co 1d2mod" \
- "${PROG} checkout: Updating dir1d2
- U dir1d2/file2"
- dotest cvsadm-6b "cat CVS/Repository" "\."
- dotest cvsadm-6d "cat dir1d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir1d2
- dotest cvsadm-7 "${testcvs} co 2d1mod" \
- "${PROG} checkout: Updating dir2d1/sub2d1
- U dir2d1/sub2d1/file1"
- dotest cvsadm-7b "cat CVS/Repository" "\."
- dotest cvsadm-7d "cat dir2d1/CVS/Repository" "\."
- dotest cvsadm-7f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS dir2d1
- dotest cvsadm-8 "${testcvs} co 2d2mod" \
- "${PROG} checkout: Updating dir2d2/sub2d2
- U dir2d2/sub2d2/file2"
- dotest cvsadm-8b "cat CVS/Repository" "\."
- dotest cvsadm-8d "cat dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-8f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir2d2
- ##################################################
- ## You are in a shell script of twisted little
- ## module combination statements, all alike.
- ##################################################
- ### 1mod
-
- dotest cvsadm-9 "${testcvs} co 1mod 1mod-2" \
- "${PROG} checkout: Updating 1mod
- U 1mod/file1
- ${PROG} checkout: Updating 1mod-2
- U 1mod-2/file1-2"
- # the usual for the top level
- dotest cvsadm-9b "cat CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-9d "cat 1mod/CVS/Repository" "mod1"
- # the usual for 1mod copy
- dotest cvsadm-9f "cat 1mod-2/CVS/Repository" "mod1-2"
- rm -rf CVS 1mod 1mod-2
- # 1mod 2mod redmod bluemod
- dotest cvsadm-10 "${testcvs} co 1mod 2mod" \
- "${PROG} checkout: Updating 1mod
- U 1mod/file1
- ${PROG} checkout: Updating 2mod
- U 2mod/file2"
- # the usual for the top level
- dotest cvsadm-10b "cat CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-10d "cat 1mod/CVS/Repository" "mod1"
- # the usual for 2dmod
- dotest cvsadm-10f "cat 2mod/CVS/Repository" "mod2/sub2"
- rm -rf CVS 1mod 2mod
- dotest cvsadm-11 "${testcvs} co 1mod 1d1mod" \
- "${PROG} checkout: Updating 1mod
- U 1mod/file1
- ${PROG} checkout: Updating dir1d1
- U dir1d1/file1"
- # the usual for the top level
- dotest cvsadm-11b "cat CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-11d "cat 1mod/CVS/Repository" "mod1"
- # the usual for 1d1mod
- dotest cvsadm-11f "cat dir1d1/CVS/Repository" "mod1"
- rm -rf CVS 1mod dir1d1
- dotest cvsadm-12 "${testcvs} co 1mod 1d2mod" \
- "${PROG} checkout: Updating 1mod
- U 1mod/file1
- ${PROG} checkout: Updating dir1d2
- U dir1d2/file2"
- # the usual for the top level
- dotest cvsadm-12b "cat CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-12d "cat 1mod/CVS/Repository" "mod1"
- # the usual for 1d2mod
- dotest cvsadm-12f "cat dir1d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS 1mod dir1d2
- dotest cvsadm-13 "${testcvs} co 1mod 2d1mod" \
- "${PROG} checkout: Updating 1mod
- U 1mod/file1
- ${PROG} checkout: Updating dir2d1/sub2d1
- U dir2d1/sub2d1/file1"
- # the usual for the top level
- dotest cvsadm-13b "cat CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-13d "cat 1mod/CVS/Repository" "mod1"
- # the usual for 2d1mod
- dotest cvsadm-13f "cat dir2d1/CVS/Repository" "\."
- dotest cvsadm-13h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS 1mod dir2d1
- dotest cvsadm-14 "${testcvs} co 1mod 2d2mod" \
- "${PROG} checkout: Updating 1mod
- U 1mod/file1
- ${PROG} checkout: Updating dir2d2/sub2d2
- U dir2d2/sub2d2/file2"
- # the usual for the top level
- dotest cvsadm-14b "cat CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-14d "cat 1mod/CVS/Repository" "mod1"
- # the usual for 2d2mod
- dotest cvsadm-14f "cat dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-14h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS 1mod dir2d2
- ### 2mod
-
- dotest cvsadm-15 "${testcvs} co 2mod 2mod-2" \
- "${PROG} checkout: Updating 2mod
- U 2mod/file2
- ${PROG} checkout: Updating 2mod-2
- U 2mod-2/file2-2"
- # the usual for the top level
- dotest cvsadm-15b "cat CVS/Repository" "\."
- # the usual for 2mod
- dotest cvsadm-15d "cat 2mod/CVS/Repository" "mod2/sub2"
- # the usual for 2mod copy
- dotest cvsadm-15f "cat 2mod-2/CVS/Repository" "mod2-2/sub2-2"
- rm -rf CVS 2mod 2mod-2
- dotest cvsadm-16 "${testcvs} co 2mod 1d1mod" \
- "${PROG} checkout: Updating 2mod
- U 2mod/file2
- ${PROG} checkout: Updating dir1d1
- U dir1d1/file1"
- # the usual for the top level
- dotest cvsadm-16b "cat CVS/Repository" "\."
- # the usual for 2mod
- dotest cvsadm-16d "cat 2mod/CVS/Repository" "mod2/sub2"
- # the usual for 1d1mod
- dotest cvsadm-16f "cat dir1d1/CVS/Repository" "mod1"
- rm -rf CVS 2mod dir1d1
- dotest cvsadm-17 "${testcvs} co 2mod 1d2mod" \
- "${PROG} checkout: Updating 2mod
- U 2mod/file2
- ${PROG} checkout: Updating dir1d2
- U dir1d2/file2"
- # the usual for the top level
- dotest cvsadm-17b "cat CVS/Repository" "\."
- # the usual for 2mod
- dotest cvsadm-17d "cat 2mod/CVS/Repository" "mod2/sub2"
- # the usual for 1d2mod
- dotest cvsadm-17f "cat dir1d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS 2mod dir1d2
- dotest cvsadm-18 "${testcvs} co 2mod 2d1mod" \
- "${PROG} checkout: Updating 2mod
- U 2mod/file2
- ${PROG} checkout: Updating dir2d1/sub2d1
- U dir2d1/sub2d1/file1"
- # the usual for the top level
- dotest cvsadm-18b "cat CVS/Repository" "\."
- # the usual for 2mod
- dotest cvsadm-18d "cat 2mod/CVS/Repository" "mod2/sub2"
- # the usual for 2d1mod
- dotest cvsadm-18f "cat dir2d1/CVS/Repository" "\."
- dotest cvsadm-18h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS 2mod dir2d1
- dotest cvsadm-19 "${testcvs} co 2mod 2d2mod" \
- "${PROG} checkout: Updating 2mod
- U 2mod/file2
- ${PROG} checkout: Updating dir2d2/sub2d2
- U dir2d2/sub2d2/file2"
- # the usual for the top level
- dotest cvsadm-19b "cat CVS/Repository" "\."
- # the usual for 2mod
- dotest cvsadm-19d "cat 2mod/CVS/Repository" "mod2/sub2"
- # the usual for 2d2mod
- dotest cvsadm-19f "cat dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-19h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS 2mod dir2d2
- ### 1d1mod
- dotest cvsadm-20 "${testcvs} co 1d1mod 1d1mod-2" \
- "${PROG} checkout: Updating dir1d1
- U dir1d1/file1
- ${PROG} checkout: Updating dir1d1-2
- U dir1d1-2/file1-2"
- # the usual for the top level
- dotest cvsadm-20b "cat CVS/Repository" "\."
- # the usual for 1d1mod
- dotest cvsadm-20d "cat dir1d1/CVS/Repository" "mod1"
- # the usual for 1d1mod copy
- dotest cvsadm-20f "cat dir1d1-2/CVS/Repository" "mod1-2"
- rm -rf CVS dir1d1 dir1d1-2
- dotest cvsadm-21 "${testcvs} co 1d1mod 1d2mod" \
- "${PROG} checkout: Updating dir1d1
- U dir1d1/file1
- ${PROG} checkout: Updating dir1d2
- U dir1d2/file2"
- # the usual for the top level
- dotest cvsadm-21b "cat CVS/Repository" "\."
- # the usual for 1d1mod
- dotest cvsadm-21d "cat dir1d1/CVS/Repository" "mod1"
- # the usual for 1d2mod
- dotest cvsadm-21f "cat dir1d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir1d1 dir1d2
- dotest cvsadm-22 "${testcvs} co 1d1mod 2d1mod" \
- "${PROG} checkout: Updating dir1d1
- U dir1d1/file1
- ${PROG} checkout: Updating dir2d1/sub2d1
- U dir2d1/sub2d1/file1"
- # the usual for the top level
- dotest cvsadm-22b "cat CVS/Repository" "\."
- # the usual for 1d1mod
- dotest cvsadm-22d "cat dir1d1/CVS/Repository" "mod1"
- # the usual for 2d1mod
- dotest cvsadm-22f "cat dir2d1/CVS/Repository" "\."
- dotest cvsadm-22h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS dir1d1 dir2d1
- dotest cvsadm-23 "${testcvs} co 1d1mod 2d2mod" \
- "${PROG} checkout: Updating dir1d1
- U dir1d1/file1
- ${PROG} checkout: Updating dir2d2/sub2d2
- U dir2d2/sub2d2/file2"
- # the usual for the top level
- dotest cvsadm-23b "cat CVS/Repository" "\."
- # the usual for 1d1mod
- dotest cvsadm-23d "cat dir1d1/CVS/Repository" "mod1"
- # the usual for 2d2mod
- dotest cvsadm-23f "cat dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-23h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir1d1 dir2d2
- ### 1d2mod
- dotest cvsadm-24 "${testcvs} co 1d2mod 1d2mod-2" \
- "${PROG} checkout: Updating dir1d2
- U dir1d2/file2
- ${PROG} checkout: Updating dir1d2-2
- U dir1d2-2/file2-2"
- # the usual for the top level
- dotest cvsadm-24b "cat CVS/Repository" "\."
- # the usual for 1d2mod
- dotest cvsadm-24d "cat dir1d2/CVS/Repository" "mod2/sub2"
- # the usual for 1d2mod copy
- dotest cvsadm-24f "cat dir1d2-2/CVS/Repository" "mod2-2/sub2-2"
- rm -rf CVS dir1d2 dir1d2-2
- dotest cvsadm-25 "${testcvs} co 1d2mod 2d1mod" \
- "${PROG} checkout: Updating dir1d2
- U dir1d2/file2
- ${PROG} checkout: Updating dir2d1/sub2d1
- U dir2d1/sub2d1/file1"
- # the usual for the top level
- dotest cvsadm-25b "cat CVS/Repository" "\."
- # the usual for 1d2mod
- dotest cvsadm-25d "cat dir1d2/CVS/Repository" "mod2/sub2"
- # the usual for 2d1mod
- dotest cvsadm-25f "cat dir2d1/CVS/Repository" "\."
- dotest cvsadm-25h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS dir1d2 dir2d1
- dotest cvsadm-26 "${testcvs} co 1d2mod 2d2mod" \
- "${PROG} checkout: Updating dir1d2
- U dir1d2/file2
- ${PROG} checkout: Updating dir2d2/sub2d2
- U dir2d2/sub2d2/file2"
- # the usual for the top level
- dotest cvsadm-26b "cat CVS/Repository" "\."
- # the usual for 1d2mod
- dotest cvsadm-26d "cat dir1d2/CVS/Repository" "mod2/sub2"
- # the usual for 2d2mod
- dotest cvsadm-26f "cat dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-26h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir1d2 dir2d2
- # 2d1mod
- dotest cvsadm-27 "${testcvs} co 2d1mod 2d1mod-2" \
- "${PROG} checkout: Updating dir2d1/sub2d1
- U dir2d1/sub2d1/file1
- ${PROG} checkout: Updating dir2d1-2/sub2d1-2
- U dir2d1-2/sub2d1-2/file1-2"
- # the usual for the top level
- dotest cvsadm-27b "cat CVS/Repository" "\."
- # the usual for 2d1mod
- dotest cvsadm-27d "cat dir2d1/CVS/Repository" "\."
- dotest cvsadm-27f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
- # the usual for 2d1mod
- dotest cvsadm-27h "cat dir2d1-2/CVS/Repository" "\."
- dotest cvsadm-27j "cat dir2d1-2/sub2d1-2/CVS/Repository" "mod1-2"
- rm -rf CVS dir2d1 dir2d1-2
- dotest cvsadm-28 "${testcvs} co 2d1mod 2d2mod" \
- "${PROG} checkout: Updating dir2d1/sub2d1
- U dir2d1/sub2d1/file1
- ${PROG} checkout: Updating dir2d2/sub2d2
- U dir2d2/sub2d2/file2"
- # the usual for the top level
- dotest cvsadm-28b "cat CVS/Repository" "\."
- # the usual for 2d1mod
- dotest cvsadm-28d "cat dir2d1/CVS/Repository" "\."
- dotest cvsadm-28f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
- # the usual for 2d2mod
- dotest cvsadm-28h "cat dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-28j "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir2d1 dir2d2
-
- # 2d2mod
- dotest cvsadm-29 "${testcvs} co 2d2mod 2d2mod-2" \
- "${PROG} checkout: Updating dir2d2/sub2d2
- U dir2d2/sub2d2/file2
- ${PROG} checkout: Updating dir2d2-2/sub2d2-2
- U dir2d2-2/sub2d2-2/file2-2"
- # the usual for the top level
- dotest cvsadm-29b "cat CVS/Repository" "\."
- # the usual for 2d2mod
- dotest cvsadm-29d "cat dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-29f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- # the usual for 2d2mod
- dotest cvsadm-29h "cat dir2d2-2/CVS/Repository" "mod2-2"
- dotest cvsadm-29j "cat dir2d2-2/sub2d2-2/CVS/Repository" \
- "mod2-2/sub2-2"
- rm -rf CVS dir2d2 dir2d2-2
- ##################################################
- ## And now, all of that again using the "-d" flag
- ## on the command line.
- ##################################################
- dotest cvsadm-1d3 "${testcvs} co -d dir 1mod" \
- "${PROG} checkout: Updating dir
- U dir/file1"
- dotest cvsadm-1d3b "cat CVS/Repository" "\."
- dotest cvsadm-1d3d "cat dir/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-1d4 "${testcvs} co -d dir 2mod" \
- "${PROG} checkout: Updating dir
- U dir/file2"
- dotest cvsadm-1d4b "cat CVS/Repository" "\."
- dotest cvsadm-1d4d "cat dir/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- dotest cvsadm-1d5 "${testcvs} co -d dir 1d1mod" \
- "${PROG} checkout: Updating dir
- U dir/file1"
- dotest cvsadm-1d5b "cat CVS/Repository" "\."
- dotest cvsadm-1d5d "cat dir/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-1d6 "${testcvs} co -d dir 1d2mod" \
- "${PROG} checkout: Updating dir
- U dir/file2"
- dotest cvsadm-1d6b "cat CVS/Repository" "\."
- dotest cvsadm-1d6d "cat dir/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- dotest cvsadm-1d7 "${testcvs} co -d dir 2d1mod" \
- "${PROG} checkout: Updating dir
- U dir/file1"
- dotest cvsadm-1d7b "cat CVS/Repository" "\."
- dotest cvsadm-1d7d "cat dir/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-1d8 "${testcvs} co -d dir 2d2mod" \
- "${PROG} checkout: Updating dir
- U dir/file2"
- dotest cvsadm-1d8b "cat CVS/Repository" "\."
- dotest cvsadm-1d8d "cat dir/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- ##################################################
- ## Los Combonaciones
- ##################################################
- ### 1mod
- dotest cvsadm-1d9 "${testcvs} co -d dir 1mod 1mod-2" \
- "${PROG} checkout: Updating dir/1mod
- U dir/1mod/file1
- ${PROG} checkout: Updating dir/1mod-2
- U dir/1mod-2/file1-2"
- # the usual for the top level
- dotest cvsadm-1d9b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d9d "cat dir/CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-1d9f "cat dir/1mod/CVS/Repository" "mod1"
- # the usual for 1mod copy
- dotest cvsadm-1d9h "cat dir/1mod-2/CVS/Repository" "mod1-2"
- rm -rf CVS dir
- # 1mod 2mod redmod bluemod
- dotest cvsadm-1d10 "${testcvs} co -d dir 1mod 2mod" \
- "${PROG} checkout: Updating dir/1mod
- U dir/1mod/file1
- ${PROG} checkout: Updating dir/2mod
- U dir/2mod/file2"
- dotest cvsadm-1d10b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d10d "cat dir/CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-1d10f "cat dir/1mod/CVS/Repository" "mod1"
- # the usual for 2dmod
- dotest cvsadm-1d10h "cat dir/2mod/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- dotest cvsadm-1d11 "${testcvs} co -d dir 1mod 1d1mod" \
- "${PROG} checkout: Updating dir/1mod
- U dir/1mod/file1
- ${PROG} checkout: Updating dir/dir1d1
- U dir/dir1d1/file1"
- dotest cvsadm-1d11b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d11d "cat dir/CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-1d11f "cat dir/1mod/CVS/Repository" "mod1"
- # the usual for 1d1mod
- dotest cvsadm-1d11h "cat dir/dir1d1/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-1d12 "${testcvs} co -d dir 1mod 1d2mod" \
- "${PROG} checkout: Updating dir/1mod
- U dir/1mod/file1
- ${PROG} checkout: Updating dir/dir1d2
- U dir/dir1d2/file2"
- dotest cvsadm-1d12b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d12d "cat dir/CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-1d12f "cat dir/1mod/CVS/Repository" "mod1"
- # the usual for 1d2mod
- dotest cvsadm-1d12h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- dotest cvsadm-1d13 "${testcvs} co -d dir 1mod 2d1mod" \
- "${PROG} checkout: Updating dir/1mod
- U dir/1mod/file1
- ${PROG} checkout: Updating dir/dir2d1/sub2d1
- U dir/dir2d1/sub2d1/file1"
- dotest cvsadm-1d13b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d13d "cat dir/CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-1d13f "cat dir/1mod/CVS/Repository" "mod1"
- # the usual for 2d1mod
- dotest cvsadm-1d13h "cat dir/dir2d1/CVS/Repository" "\."
- dotest cvsadm-1d13j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-1d14 "${testcvs} co -d dir 1mod 2d2mod" \
- "${PROG} checkout: Updating dir/1mod
- U dir/1mod/file1
- ${PROG} checkout: Updating dir/dir2d2/sub2d2
- U dir/dir2d2/sub2d2/file2"
- dotest cvsadm-1d14b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d14d "cat dir/CVS/Repository" "\."
- # the usual for 1mod
- dotest cvsadm-1d14f "cat dir/1mod/CVS/Repository" "mod1"
- # the usual for 2d2mod
- dotest cvsadm-1d14h "cat dir/dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-1d14j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- ### 2mod
- dotest cvsadm-1d15 "${testcvs} co -d dir 2mod 2mod-2" \
- "${PROG} checkout: Updating dir/2mod
- U dir/2mod/file2
- ${PROG} checkout: Updating dir/2mod-2
- U dir/2mod-2/file2-2"
- dotest cvsadm-1d15b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d15d "cat dir/CVS/Repository" "mod2"
- # the usual for 2mod
- dotest cvsadm-1d15f "cat dir/2mod/CVS/Repository" "mod2/sub2"
- # the usual for 2mod copy
- dotest cvsadm-1d15h "cat dir/2mod-2/CVS/Repository" "mod2-2/sub2-2"
- rm -rf CVS dir
- dotest cvsadm-1d16 "${testcvs} co -d dir 2mod 1d1mod" \
- "${PROG} checkout: Updating dir/2mod
- U dir/2mod/file2
- ${PROG} checkout: Updating dir/dir1d1
- U dir/dir1d1/file1"
- dotest cvsadm-1d16b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d16d "cat dir/CVS/Repository" "mod2"
- # the usual for 2mod
- dotest cvsadm-1d16f "cat dir/2mod/CVS/Repository" "mod2/sub2"
- # the usual for 1d1mod
- dotest cvsadm-1d16h "cat dir/dir1d1/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-1d17 "${testcvs} co -d dir 2mod 1d2mod" \
- "${PROG} checkout: Updating dir/2mod
- U dir/2mod/file2
- ${PROG} checkout: Updating dir/dir1d2
- U dir/dir1d2/file2"
- dotest cvsadm-1d17b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d17d "cat dir/CVS/Repository" "mod2"
- # the usual for 2mod
- dotest cvsadm-1d17f "cat dir/2mod/CVS/Repository" "mod2/sub2"
- # the usual for 1d2mod
- dotest cvsadm-1d17h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- dotest cvsadm-1d18 "${testcvs} co -d dir 2mod 2d1mod" \
- "${PROG} checkout: Updating dir/2mod
- U dir/2mod/file2
- ${PROG} checkout: Updating dir/dir2d1/sub2d1
- U dir/dir2d1/sub2d1/file1"
- dotest cvsadm-1d18b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d18d "cat dir/CVS/Repository" "mod2"
- # the usual for 2mod
- dotest cvsadm-1d18f "cat dir/2mod/CVS/Repository" "mod2/sub2"
- # the usual for 2d1mod
- dotest cvsadm-1d18h "cat dir/dir2d1/CVS/Repository" "\."
- dotest cvsadm-1d18j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-1d19 "${testcvs} co -d dir 2mod 2d2mod" \
- "${PROG} checkout: Updating dir/2mod
- U dir/2mod/file2
- ${PROG} checkout: Updating dir/dir2d2/sub2d2
- U dir/dir2d2/sub2d2/file2"
- dotest cvsadm-1d19b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d19d "cat dir/CVS/Repository" "mod2"
- # the usual for 2mod
- dotest cvsadm-1d19f "cat dir/2mod/CVS/Repository" "mod2/sub2"
- # the usual for 2d2mod
- dotest cvsadm-1d19h "cat dir/dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-1d19j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- ### 1d1mod
- dotest cvsadm-1d20 "${testcvs} co -d dir 1d1mod 1d1mod-2" \
- "${PROG} checkout: Updating dir/dir1d1
- U dir/dir1d1/file1
- ${PROG} checkout: Updating dir/dir1d1-2
- U dir/dir1d1-2/file1-2"
- dotest cvsadm-1d20b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d20d "cat dir/CVS/Repository" "\."
- # the usual for 1d1mod
- dotest cvsadm-1d20f "cat dir/dir1d1/CVS/Repository" "mod1"
- # the usual for 1d1mod copy
- dotest cvsadm-1d20h "cat dir/dir1d1-2/CVS/Repository" "mod1-2"
- rm -rf CVS dir
- dotest cvsadm-1d21 "${testcvs} co -d dir 1d1mod 1d2mod" \
- "${PROG} checkout: Updating dir/dir1d1
- U dir/dir1d1/file1
- ${PROG} checkout: Updating dir/dir1d2
- U dir/dir1d2/file2"
- dotest cvsadm-1d21b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d21d "cat dir/CVS/Repository" "\."
- # the usual for 1d1mod
- dotest cvsadm-1d21f "cat dir/dir1d1/CVS/Repository" "mod1"
- # the usual for 1d2mod
- dotest cvsadm-1d21h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- dotest cvsadm-1d22 "${testcvs} co -d dir 1d1mod 2d1mod" \
- "${PROG} checkout: Updating dir/dir1d1
- U dir/dir1d1/file1
- ${PROG} checkout: Updating dir/dir2d1/sub2d1
- U dir/dir2d1/sub2d1/file1"
- dotest cvsadm-1d22b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d22d "cat dir/CVS/Repository" "\."
- # the usual for 1d1mod
- dotest cvsadm-1d22f "cat dir/dir1d1/CVS/Repository" "mod1"
- # the usual for 2d1mod
- dotest cvsadm-1d22h "cat dir/dir2d1/CVS/Repository" "\."
- dotest cvsadm-1d22j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-1d23 "${testcvs} co -d dir 1d1mod 2d2mod" \
- "${PROG} checkout: Updating dir/dir1d1
- U dir/dir1d1/file1
- ${PROG} checkout: Updating dir/dir2d2/sub2d2
- U dir/dir2d2/sub2d2/file2"
- dotest cvsadm-1d23b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d23d "cat dir/CVS/Repository" "\."
- # the usual for 1d1mod
- dotest cvsadm-1d23f "cat dir/dir1d1/CVS/Repository" "mod1"
- # the usual for 2d2mod
- dotest cvsadm-1d23h "cat dir/dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-1d23j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- ### 1d2mod
- dotest cvsadm-1d24 "${testcvs} co -d dir 1d2mod 1d2mod-2" \
- "${PROG} checkout: Updating dir/dir1d2
- U dir/dir1d2/file2
- ${PROG} checkout: Updating dir/dir1d2-2
- U dir/dir1d2-2/file2-2"
- dotest cvsadm-1d24b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d24d "cat dir/CVS/Repository" "mod2"
- # the usual for 1d2mod
- dotest cvsadm-1d24f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
- # the usual for 1d2mod copy
- dotest cvsadm-1d24h "cat dir/dir1d2-2/CVS/Repository" "mod2-2/sub2-2"
- rm -rf CVS dir
- dotest cvsadm-1d25 "${testcvs} co -d dir 1d2mod 2d1mod" \
- "${PROG} checkout: Updating dir/dir1d2
- U dir/dir1d2/file2
- ${PROG} checkout: Updating dir/dir2d1/sub2d1
- U dir/dir2d1/sub2d1/file1"
- dotest cvsadm-1d25b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d25d "cat dir/CVS/Repository" "mod2"
- # the usual for 1d2mod
- dotest cvsadm-1d25f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
- # the usual for 2d1mod
- dotest cvsadm-1d25h "cat dir/dir2d1/CVS/Repository" "\."
- dotest cvsadm-1d25j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-1d26 "${testcvs} co -d dir 1d2mod 2d2mod" \
- "${PROG} checkout: Updating dir/dir1d2
- U dir/dir1d2/file2
- ${PROG} checkout: Updating dir/dir2d2/sub2d2
- U dir/dir2d2/sub2d2/file2"
- dotest cvsadm-1d26b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d26d "cat dir/CVS/Repository" "mod2"
- # the usual for 1d2mod
- dotest cvsadm-1d26f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
- # the usual for 2d2mod
- dotest cvsadm-1d26h "cat dir/dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-1d26j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- # 2d1mod
- dotest cvsadm-1d27 "${testcvs} co -d dir 2d1mod 2d1mod-2" \
- "${PROG} checkout: Updating dir/dir2d1/sub2d1
- U dir/dir2d1/sub2d1/file1
- ${PROG} checkout: Updating dir/dir2d1-2/sub2d1-2
- U dir/dir2d1-2/sub2d1-2/file1-2"
- dotest cvsadm-1d27b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d27d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
- # the usual for 2d1mod
- dotest cvsadm-1d27f "cat dir/dir2d1/CVS/Repository" "\."
- dotest cvsadm-1d27h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
- # the usual for 2d1mod
- dotest cvsadm-1d27j "cat dir/dir2d1-2/CVS/Repository" "\."
- dotest cvsadm-1d27l "cat dir/dir2d1-2/sub2d1-2/CVS/Repository" \
- "mod1-2"
- rm -rf CVS dir
- dotest cvsadm-1d28 "${testcvs} co -d dir 2d1mod 2d2mod" \
- "${PROG} checkout: Updating dir/dir2d1/sub2d1
- U dir/dir2d1/sub2d1/file1
- ${PROG} checkout: Updating dir/dir2d2/sub2d2
- U dir/dir2d2/sub2d2/file2"
- dotest cvsadm-1d28b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d28d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
- # the usual for 2d1mod
- dotest cvsadm-1d28f "cat dir/dir2d1/CVS/Repository" "\."
- dotest cvsadm-1d28h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
- # the usual for 2d2mod
- dotest cvsadm-1d28j "cat dir/dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-1d28l "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
-
- # 2d2mod
- dotest cvsadm-1d29 "${testcvs} co -d dir 2d2mod 2d2mod-2" \
- "${PROG} checkout: Updating dir/dir2d2/sub2d2
- U dir/dir2d2/sub2d2/file2
- ${PROG} checkout: Updating dir/dir2d2-2/sub2d2-2
- U dir/dir2d2-2/sub2d2-2/file2-2"
- dotest cvsadm-1d29b "cat CVS/Repository" "\."
- # the usual for the dir level
- dotest cvsadm-1d29d "cat dir/CVS/Repository" "\."
- # the usual for 2d2mod
- dotest cvsadm-1d29f "cat dir/dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-1d29h "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- # the usual for 2d2mod
- dotest cvsadm-1d29j "cat dir/dir2d2-2/CVS/Repository" "mod2-2"
- dotest cvsadm-1d29l "cat dir/dir2d2-2/sub2d2-2/CVS/Repository" \
- "mod2-2/sub2-2"
- rm -rf CVS dir
- ##################################################
- ## And now, some of that again using the "-d" flag
- ## on the command line, but use a longer path.
- ##################################################
- dotest_fail cvsadm-2d3-1 "${testcvs} co -d dir/dir2 1mod" \
- "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .dir.: No such file or directory"
- if $remote; then :; else
- # Remote can't handle this, even with the "mkdir dir".
- # This was also true of CVS 1.9.
- mkdir dir
- dotest cvsadm-2d3 "${testcvs} co -d dir/dir2 1mod" \
- "${PROG} checkout: Updating dir/dir2
- U dir/dir2/file1"
- dotest cvsadm-2d3b "cat CVS/Repository" "\."
- dotest_fail cvsadm-2d3d "test -f dir/CVS/Repository" ""
- dotest cvsadm-2d3f "cat dir/dir2/CVS/Repository" "mod1"
- rm -rf CVS dir
- mkdir dir
- dotest cvsadm-2d4 "${testcvs} co -d dir/dir2 2mod" \
- "${PROG} checkout: Updating dir/dir2
- U dir/dir2/file2"
- dotest cvsadm-2d4b "cat CVS/Repository" "\."
- dotest cvsadm-2d4f "cat dir/dir2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- mkdir dir
- dotest cvsadm-2d5 "${testcvs} co -d dir/dir2 1d1mod" \
- "${PROG} checkout: Updating dir/dir2
- U dir/dir2/file1"
- dotest cvsadm-2d5b "cat CVS/Repository" "\."
- dotest cvsadm-2d5f "cat dir/dir2/CVS/Repository" "mod1"
- rm -rf CVS dir
- mkdir dir
- dotest cvsadm-2d6 "${testcvs} co -d dir/dir2 1d2mod" \
- "${PROG} checkout: Updating dir/dir2
- U dir/dir2/file2"
- dotest cvsadm-2d6b "cat CVS/Repository" "\."
- dotest cvsadm-2d6f "cat dir/dir2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- mkdir dir
- dotest cvsadm-2d7 "${testcvs} co -d dir/dir2 2d1mod" \
- "${PROG} checkout: Updating dir/dir2
- U dir/dir2/file1"
- dotest cvsadm-2d7b "cat CVS/Repository" "\."
- dotest cvsadm-2d7f "cat dir/dir2/CVS/Repository" "mod1"
- rm -rf CVS dir
- mkdir dir
- dotest cvsadm-2d8 "${testcvs} co -d dir/dir2 2d2mod" \
- "${PROG} checkout: Updating dir/dir2
- U dir/dir2/file2"
- dotest cvsadm-2d8b "cat CVS/Repository" "\."
- dotest cvsadm-2d8f "cat dir/dir2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- ##################################################
- ## And now, a few of those tests revisited to
- ## test the behavior of the -N flag.
- ##################################################
- dotest cvsadm-N3 "${testcvs} co -N 1mod" \
- "${PROG} checkout: Updating 1mod
- U 1mod/file1"
- dotest cvsadm-N3b "cat CVS/Repository" "\."
- dotest cvsadm-N3d "cat 1mod/CVS/Repository" "mod1"
- rm -rf CVS 1mod
- dotest cvsadm-N4 "${testcvs} co -N 2mod" \
- "${PROG} checkout: Updating 2mod
- U 2mod/file2"
- dotest cvsadm-N4b "cat CVS/Repository" "\."
- dotest cvsadm-N4d "cat 2mod/CVS/Repository" "mod2/sub2"
- rm -rf CVS 2mod
- dotest cvsadm-N5 "${testcvs} co -N 1d1mod" \
- "${PROG} checkout: Updating dir1d1
- U dir1d1/file1"
- dotest cvsadm-N5b "cat CVS/Repository" "\."
- dotest cvsadm-N5d "cat dir1d1/CVS/Repository" "mod1"
- rm -rf CVS dir1d1
- dotest cvsadm-N6 "${testcvs} co -N 1d2mod" \
- "${PROG} checkout: Updating dir1d2
- U dir1d2/file2"
- dotest cvsadm-N6b "cat CVS/Repository" "\."
- dotest cvsadm-N6d "cat dir1d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir1d2
- dotest cvsadm-N7 "${testcvs} co -N 2d1mod" \
- "${PROG} checkout: Updating dir2d1/sub2d1
- U dir2d1/sub2d1/file1"
- dotest cvsadm-N7b "cat CVS/Repository" "\."
- dotest cvsadm-N7d "cat dir2d1/CVS/Repository" "\."
- dotest cvsadm-N7f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS dir2d1
- dotest cvsadm-N8 "${testcvs} co -N 2d2mod" \
- "${PROG} checkout: Updating dir2d2/sub2d2
- U dir2d2/sub2d2/file2"
- dotest cvsadm-N8b "cat CVS/Repository" "\."
- dotest cvsadm-N8d "cat dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-N8f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir2d2
- ## the ones in one-deep directories
- dotest cvsadm-N1d3 "${testcvs} co -N -d dir 1mod" \
- "${PROG} checkout: Updating dir/1mod
- U dir/1mod/file1"
- dotest cvsadm-N1d3b "cat CVS/Repository" "\."
- dotest cvsadm-N1d3d "cat dir/CVS/Repository" "\."
- dotest cvsadm-N1d3f "cat dir/1mod/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-N1d4 "${testcvs} co -N -d dir 2mod" \
- "${PROG} checkout: Updating dir/2mod
- U dir/2mod/file2"
- dotest cvsadm-N1d4b "cat CVS/Repository" "\."
- dotest cvsadm-N1d4d "cat dir/CVS/Repository" "mod2"
- dotest cvsadm-N1d4f "cat dir/2mod/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- dotest cvsadm-N1d5 "${testcvs} co -N -d dir 1d1mod" \
- "${PROG} checkout: Updating dir/dir1d1
- U dir/dir1d1/file1"
- dotest cvsadm-N1d5b "cat CVS/Repository" "\."
- dotest cvsadm-N1d5d "cat dir/CVS/Repository" "\."
- dotest cvsadm-N1d5d "cat dir/dir1d1/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-N1d6 "${testcvs} co -N -d dir 1d2mod" \
- "${PROG} checkout: Updating dir/dir1d2
- U dir/dir1d2/file2"
- dotest cvsadm-N1d6b "cat CVS/Repository" "\."
- dotest cvsadm-N1d6d "cat dir/CVS/Repository" "mod2"
- dotest cvsadm-N1d6f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- dotest cvsadm-N1d7 "${testcvs} co -N -d dir 2d1mod" \
- "${PROG} checkout: Updating dir/dir2d1/sub2d1
- U dir/dir2d1/sub2d1/file1"
- dotest cvsadm-N1d7b "cat CVS/Repository" "\."
- dotest cvsadm-N1d7d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
- dotest cvsadm-N1d7f "cat dir/dir2d1/CVS/Repository" "\."
- dotest cvsadm-N1d7h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
- rm -rf CVS dir
- dotest cvsadm-N1d8 "${testcvs} co -N -d dir 2d2mod" \
- "${PROG} checkout: Updating dir/dir2d2/sub2d2
- U dir/dir2d2/sub2d2/file2"
- dotest cvsadm-N1d8b "cat CVS/Repository" "\."
- dotest cvsadm-N1d8d "cat dir/CVS/Repository" "\."
- dotest cvsadm-N1d8d "cat dir/dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-N1d8d "cat dir/dir2d2/sub2d2/CVS/Repository" \
- "mod2/sub2"
- rm -rf CVS dir
- ## the ones in two-deep directories
- mkdir dir
- dotest cvsadm-N2d3 "${testcvs} co -N -d dir/dir2 1mod" \
- "${PROG} checkout: Updating dir/dir2/1mod
- U dir/dir2/1mod/file1"
- dotest cvsadm-N2d3b "cat CVS/Repository" "\."
- dotest cvsadm-N2d3f "cat dir/dir2/CVS/Repository" "\."
- dotest cvsadm-N2d3h "cat dir/dir2/1mod/CVS/Repository" "mod1"
- rm -rf CVS dir
- mkdir dir
- dotest cvsadm-N2d4 "${testcvs} co -N -d dir/dir2 2mod" \
- "${PROG} checkout: Updating dir/dir2/2mod
- U dir/dir2/2mod/file2"
- dotest cvsadm-N2d4b "cat CVS/Repository" "\."
- dotest cvsadm-N2d4f "cat dir/dir2/CVS/Repository" "mod2"
- dotest cvsadm-N2d4h "cat dir/dir2/2mod/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- mkdir dir
- dotest cvsadm-N2d5 "${testcvs} co -N -d dir/dir2 1d1mod" \
- "${PROG} checkout: Updating dir/dir2/dir1d1
- U dir/dir2/dir1d1/file1"
- dotest cvsadm-N2d5b "cat CVS/Repository" "\."
- dotest cvsadm-N2d5f "cat dir/dir2/CVS/Repository" "\."
- dotest cvsadm-N2d5h "cat dir/dir2/dir1d1/CVS/Repository" "mod1"
- rm -rf CVS dir
- mkdir dir
- dotest cvsadm-N2d6 "${testcvs} co -N -d dir/dir2 1d2mod" \
- "${PROG} checkout: Updating dir/dir2/dir1d2
- U dir/dir2/dir1d2/file2"
- dotest cvsadm-N2d6b "cat CVS/Repository" "\."
- dotest cvsadm-N2d6f "cat dir/dir2/CVS/Repository" "mod2"
- dotest cvsadm-N2d6h "cat dir/dir2/dir1d2/CVS/Repository" "mod2/sub2"
- rm -rf CVS dir
- mkdir dir
- dotest cvsadm-N2d7 "${testcvs} co -N -d dir/dir2 2d1mod" \
- "${PROG} checkout: Updating dir/dir2/dir2d1/sub2d1
- U dir/dir2/dir2d1/sub2d1/file1"
- dotest cvsadm-N2d7b "cat CVS/Repository" "\."
- dotest cvsadm-N2d7f "cat dir/dir2/CVS/Repository" "CVSROOT/Emptydir"
- dotest cvsadm-N2d7g "cat dir/dir2/dir2d1/CVS/Repository" "\."
- dotest cvsadm-N2d7h "cat dir/dir2/dir2d1/sub2d1/CVS/Repository" \
- "mod1"
- rm -rf CVS dir
- mkdir dir
- dotest cvsadm-N2d8 "${testcvs} co -N -d dir/dir2 2d2mod" \
- "${PROG} checkout: Updating dir/dir2/dir2d2/sub2d2
- U dir/dir2/dir2d2/sub2d2/file2"
- dotest cvsadm-N2d8b "cat CVS/Repository" "\."
- dotest cvsadm-N2d8f "cat dir/dir2/CVS/Repository" "\."
- dotest cvsadm-N2d8h "cat dir/dir2/dir2d2/CVS/Repository" "mod2"
- dotest cvsadm-N2d8j "cat dir/dir2/dir2d2/sub2d2/CVS/Repository" \
- "mod2/sub2"
- rm -rf CVS dir
- fi # end of tests to be skipped for remote
- ##################################################
- ## That's enough of that, thank you very much.
- ##################################################
- dotest cvsadm-cleanup-1 "${testcvs} -q co CVSROOT/config" \
- "U CVSROOT/config"
- cd CVSROOT
- echo "# empty file" >config
- dotest cvsadm-cleanup-2 "${testcvs} -q ci -m cvsadm-cleanup" \
- "Checking in config;
- ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ..
- rm -rf CVSROOT CVS
- # remove our junk
- cd ..
- rm -rf 1
- rm -rf ${CVSROOT_DIRNAME}/1mod
- rm -rf ${CVSROOT_DIRNAME}/1mod-2
- rm -rf ${CVSROOT_DIRNAME}/2mod
- rm -rf ${CVSROOT_DIRNAME}/2mod-2
- rm -rf ${CVSROOT_DIRNAME}/mod1
- rm -rf ${CVSROOT_DIRNAME}/mod1-2
- rm -rf ${CVSROOT_DIRNAME}/mod2
- rm -rf ${CVSROOT_DIRNAME}/mod2-2
- ;;
- emptydir)
- # Various tests of the Emptydir (CVSNULLREPOS) code. See also:
- # cvsadm: tests of Emptydir in various module definitions
- # basicb: Test that "Emptydir" is non-special in ordinary contexts
- mkdir 1; cd 1
- dotest emptydir-1 "${testcvs} co CVSROOT/modules" \
- "U CVSROOT/modules"
- echo "# Module defs for emptydir tests" > CVSROOT/modules
- echo "2d1mod -d dir2d1/sub/sub2d1 mod1" >> CVSROOT/modules
- echo "2d1moda -d dir2d1/suba moda/modasub" >> CVSROOT/modules
- echo "2d1modb -d dir2d1/suba mod1" >> CVSROOT/modules
- echo "comb -a 2d1modb 2d1moda" >> CVSROOT/modules
- dotest emptydir-2 "${testcvs} ci -m add-modules" \
- "${PROG} [a-z]*: Examining CVSROOT
- Checking in CVSROOT/modules;
- ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database" \
- "${PROG} commit: Examining CVSROOT"
- rm -rf CVS CVSROOT
- mkdir ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda
- # Populate. Not sure we really need to do this.
- dotest emptydir-3 "${testcvs} -q co -l ." ""
- dotest emptydir-3a "${testcvs} co mod1 moda" \
- "${PROG} checkout: Updating mod1
- ${PROG} checkout: Updating moda"
- echo "file1" > mod1/file1
- mkdir moda/modasub
- dotest emptydir-3b "${testcvs} add moda/modasub" \
- "Directory ${CVSROOT_DIRNAME}/moda/modasub added to the repository"
- echo "filea" > moda/modasub/filea
- dotest emptydir-4 "${testcvs} add mod1/file1 moda/modasub/filea" \
- "${PROG} add: scheduling file .mod1/file1. for addition
- ${PROG} add: scheduling file .moda/modasub/filea. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest emptydir-5 "${testcvs} -q ci -m yup" \
- "RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
- done
- Checking in mod1/file1;
- ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/moda/modasub/filea,v
- done
- Checking in moda/modasub/filea;
- ${CVSROOT_DIRNAME}/moda/modasub/filea,v <-- filea
- initial revision: 1\.1
- done"
- rm -rf mod1 moda CVS
- # End Populate.
- dotest emptydir-6 "${testcvs} co 2d1mod" \
- "${PROG} checkout: Updating dir2d1/sub/sub2d1
- U dir2d1/sub/sub2d1/file1"
- cd dir2d1
- touch emptyfile
- # It doesn't make any sense to add a file (or do much of anything
- # else) in Emptydir; Emptydir is a placeholder indicating that
- # the working directory doesn't correspond to anything in
- # the repository.
- dotest_fail emptydir-7 "${testcvs} add emptyfile" \
- "${PROG} \[add aborted\]: cannot add to ${CVSROOT_DIRNAME}/CVSROOT/Emptydir"
- mkdir emptydir
- dotest_fail emptydir-8 "${testcvs} add emptydir" \
- "${PROG} \[[a-z]* aborted\]: cannot add to ${CVSROOT_DIRNAME}/CVSROOT/Emptydir"
- cd ..
- rm -rf CVS dir2d1
- # OK, while we have an Emptydir around, test a few obscure
- # things about it.
- mkdir edir; cd edir
- dotest emptydir-9 "${testcvs} -q co -l CVSROOT" \
- "U CVSROOT${DOTSTAR}"
- cd CVSROOT
- dotest_fail emptydir-10 "test -d Emptydir" ''
- # This tests the code in find_dirs which skips Emptydir.
- dotest emptydir-11 "${testcvs} -q -n update -d -P" ''
- cd ../..
- rm -r edir
- cd ..
- # Now start playing with moda.
- mkdir 2; cd 2
- dotest emptydir-12 "${testcvs} -q co 2d1moda" \
- "U dir2d1/suba/filea"
- # OK, this is the crux of the matter. This used to show "Emptydir",
- # but everyone seemed to think it should show "moda". This
- # usually works better, but not always as shown by the following
- # test.
- dotest emptydir-13 "cat dir2d1/CVS/Repository" "moda"
- dotest_fail emptydir-14 "${testcvs} co comb" \
- "${PROG} checkout: existing repository ${CVSROOT_DIRNAME}/moda/modasub does not match ${CVSROOT_DIRNAME}/mod1
- ${PROG} checkout: ignoring module 2d1modb
- ${PROG} checkout: Updating dir2d1/suba"
- dotest emptydir-15 "cat dir2d1/CVS/Repository" "moda"
- cd ..
- # Test the effect of a non-cvs directory already existing with the
- # same name as one in the modules file.
- mkdir 3; cd 3
- mkdir dir2d1
- dotest emptydir-16 "${testcvs} co 2d1mod" \
- "${PROG} checkout: Updating dir2d1/sub/sub2d1
- U dir2d1/sub/sub2d1/file1"
- dotest emptydir-17 "test -d dir2d1/CVS"
- # clean up
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- cd ..
- rm -r 1 2 3
- rm -rf ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda
- # I guess for the moment the convention is going to be
- # that we don't need to remove ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
- ;;
- abspath)
-
- # These tests test the thituations thin thwitch thoo theck
- # things thout twith thabsolute thaths. Threally.
- #
- # CHECKOUTS
- #
- # Create a few modules to use
- mkdir ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/mod2
- dotest abspath-1a "${testcvs} co mod1 mod2" \
- "${PROG} checkout: Updating mod1
- ${PROG} checkout: Updating mod2"
- # Populate the module
- echo "file1" > mod1/file1
- echo "file2" > mod2/file2
- cd mod1
- dotest abspath-1ba "${testcvs} add file1" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- cd ..
- cd mod2
- dotest abspath-1bb "${testcvs} add file2" \
- "${PROG} add: scheduling file .file2. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- cd ..
- dotest abspath-1c "${testcvs} ci -m yup mod1 mod2" \
- "${PROG} [a-z]*: Examining mod1
- ${PROG} [a-z]*: Examining mod2
- RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
- done
- Checking in mod1/file1;
- ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
- initial revision: 1.1
- done
- RCS file: ${CVSROOT_DIRNAME}/mod2/file2,v
- done
- Checking in mod2/file2;
- ${CVSROOT_DIRNAME}/mod2/file2,v <-- file2
- initial revision: 1.1
- done"
- # Finished creating the module -- clean up.
- rm -rf CVS mod1 mod2
- # Done.
-
- # Try checking out the module in a local directory
- if $remote; then
- dotest_fail abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
- "${PROG} \[checkout aborted\]: absolute pathname .${TESTDIR}/1. illegal for server"
- dotest abspath-2a-try2 "${testcvs} co -d 1 mod1" \
- "${PROG} checkout: Updating 1
- U 1/file1"
- else
- dotest abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
- "${PROG} checkout: Updating ${TESTDIR}/1
- U ${TESTDIR}/1/file1"
- fi # remote workaround
- dotest abspath-2b "cat ${TESTDIR}/1/CVS/Repository" "mod1"
- # Done. Clean up.
- rm -rf ${TESTDIR}/1
- # Now try in a subdirectory. We're not covering any more
- # code here, but we might catch a future error if someone
- # changes the checkout code.
- # Note that for the same reason that the shell command
- # "touch 1/2/3" requires directories 1 and 1/2 to already
- # exist, we expect ${TESTDIR}/1 to already exist. I believe
- # this is the behavior of CVS 1.9 and earlier.
- if $remote; then :; else
- dotest_fail abspath-3.1 "${testcvs} co -d ${TESTDIR}/1/2 mod1" \
- "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .${TESTDIR}/1.: No such file or directory"
- fi
- dotest_fail abspath-3.2 "${testcvs} co -d 1/2 mod1" \
- "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .1.: No such file or directory"
- mkdir 1
- if $remote; then
- # The server wants the directory to exist, but that is
- # a bug, it should only need to exist on the client side.
- # See also cvsadm-2d3.
- dotest_fail abspath-3a "${testcvs} co -d 1/2 mod1" \
- "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .1.: No such file or directory"
- cd 1
- dotest abspath-3a-try2 "${testcvs} co -d 2 mod1" \
- "${PROG} checkout: Updating 2
- U 2/file1"
- cd ..
- rm -rf 1/CVS
- else
- dotest abspath-3a "${testcvs} co -d ${TESTDIR}/1/2 mod1" \
- "${PROG} checkout: Updating ${TESTDIR}/1/2
- U ${TESTDIR}/1/2/file1"
- fi # remote workaround
- dotest abspath-3b "cat ${TESTDIR}/1/2/CVS/Repository" "mod1"
- # For all the same reasons that we want "1" to already
- # exist, we don't to mess with it to traverse it, for
- # example by creating a CVS directory.
- dotest_fail abspath-3c "test -d ${TESTDIR}/1/CVS" ''
- # Done. Clean up.
- rm -rf ${TESTDIR}/1
- # Now try someplace where we don't have permission.
- mkdir ${TESTDIR}/barf
- chmod -w ${TESTDIR}/barf
- dotest_fail abspath-4r "${testcvs} co -d ${TESTDIR}/barf/sub mod1" \
- "${PROG} \[checkout aborted\]: absolute pathname .${TESTDIR}/barf/sub. illegal for server" \
- "${PROG} \[checkout aborted\]: cannot make directory sub: Permission denied"
- chmod +w ${TESTDIR}/barf
- rmdir ${TESTDIR}/barf
- # Done. Nothing to clean up.
- # Try checking out two modules into the same directory.
- if $remote; then
- dotest abspath-5ar "${testcvs} co -d 1 mod1 mod2" \
- "${PROG} checkout: Updating 1/mod1
- U 1/mod1/file1
- ${PROG} checkout: Updating 1/mod2
- U 1/mod2/file2"
- else
- dotest abspath-5a "${testcvs} co -d ${TESTDIR}/1 mod1 mod2" \
- "${PROG} checkout: Updating ${TESTDIR}/1/mod1
- U ${TESTDIR}/1/mod1/file1
- ${PROG} checkout: Updating ${TESTDIR}/1/mod2
- U ${TESTDIR}/1/mod2/file2"
- fi # end remote workaround
- dotest abspath-5b "cat ${TESTDIR}/1/CVS/Repository" "\."
- dotest abspath-5c "cat ${TESTDIR}/1/mod1/CVS/Repository" "mod1"
- dotest abspath-5d "cat ${TESTDIR}/1/mod2/CVS/Repository" "mod2"
- # Done. Clean up.
- rm -rf ${TESTDIR}/1
- # Try checking out the top-level module.
- if $remote; then
- dotest abspath-6ar "${testcvs} co -d 1 ." \
- "${PROG} checkout: Updating 1
- ${PROG} checkout: Updating 1/CVSROOT
- ${DOTSTAR}
- ${PROG} checkout: Updating 1/mod1
- U 1/mod1/file1
- ${PROG} checkout: Updating 1/mod2
- U 1/mod2/file2"
- else
- dotest abspath-6a "${testcvs} co -d ${TESTDIR}/1 ." \
- "${PROG} checkout: Updating ${TESTDIR}/1
- ${PROG} checkout: Updating ${TESTDIR}/1/CVSROOT
- ${DOTSTAR}
- ${PROG} checkout: Updating ${TESTDIR}/1/mod1
- U ${TESTDIR}/1/mod1/file1
- ${PROG} checkout: Updating ${TESTDIR}/1/mod2
- U ${TESTDIR}/1/mod2/file2"
- fi # end of remote workaround
- dotest abspath-6b "cat ${TESTDIR}/1/CVS/Repository" "\."
- dotest abspath-6c "cat ${TESTDIR}/1/CVSROOT/CVS/Repository" "CVSROOT"
- dotest abspath-6c "cat ${TESTDIR}/1/mod1/CVS/Repository" "mod1"
- dotest abspath-6d "cat ${TESTDIR}/1/mod2/CVS/Repository" "mod2"
- # Done. Clean up.
- rm -rf ${TESTDIR}/1
- # Test that an absolute pathname to some other directory
- # doesn't mess with the current working directory.
- mkdir 1
- cd 1
- if $remote; then
- dotest_fail abspath-7ar "${testcvs} -q co -d ../2 mod2" \
- "${PROG} checkout: protocol error: .\.\./2. contains more leading \.\.
- ${PROG} \[checkout aborted\]: than the 0 which Max-dotdot specified"
- cd ..
- dotest abspath-7a-try2r "${testcvs} -q co -d 2 mod2" \
- "U 2/file2"
- cd 1
- else
- dotest abspath-7a "${testcvs} -q co -d ${TESTDIR}/2 mod2" \
- "U ${TESTDIR}/2/file2"
- fi # remote workaround
- dotest abspath-7b "ls" ""
- dotest abspath-7c "${testcvs} -q co mod1" \
- "U mod1/file1"
- cd mod1
- if $remote; then
- cd ../..
- dotest abspath-7dr "${testcvs} -q co -d 3 mod2" \
- "U 3/file2"
- cd 1/mod1
- else
- dotest abspath-7d "${testcvs} -q co -d ${TESTDIR}/3 mod2" \
- "U ${TESTDIR}/3/file2"
- fi # remote workaround
- dotest abspath-7e "${testcvs} -q update -d" ""
- cd ../..
- rm -r 1 2 3
- #
- # FIXME: do other functions here (e.g. update /tmp/foo)
- #
- # Finished with all tests. Remove the module.
- rm -rf ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/mod2
- ;;
- abspath2)
- # More absolute path checks. The following used to attempt to create
- # directories in /:
- #
- # $ cvs -d:fork:/cvsroot co /foo
- # cvs checkout: warning: cannot make directory CVS in /: Permission denied
- # cvs [checkout aborted]: cannot make directory /foo: Permission denied
- # $
- #
- # The -z9 in this test also checks for an old server bug where the
- # server would block indefinitely attempting to read an EOF from the
- # client in the compression buffer shutdown routine.
- dotest_fail abspath2-1 "$testcvs -z9 co /foo" \
- "$PROG \[checkout aborted\]: Absolute module reference invalid: \`/foo'" \
- "$PROG \[server aborted\]: Absolute module reference invalid: \`/foo'
- $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
- ;;
- toplevel)
- # test the feature that cvs creates a CVS subdir also for
- # the toplevel directory
- # First set the TopLevelAdmin setting.
- mkdir 1; cd 1
- dotest toplevel-1a "${testcvs} -q co CVSROOT/config" \
- "U CVSROOT/config"
- cd CVSROOT
- echo "TopLevelAdmin=yes" >config
- dotest toplevel-1b "${testcvs} -q ci -m yes-top-level" \
- "Checking in config;
- ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ../..
- rm -r 1
- mkdir 1; cd 1
- dotest toplevel-1 "${testcvs} -q co -l ." ''
- mkdir top-dir second-dir
- dotest toplevel-2 "${testcvs} add top-dir second-dir" \
- "Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
- Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
- cd top-dir
- touch file1
- dotest toplevel-3 "${testcvs} add file1" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest toplevel-4 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/top-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/top-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- cd ..
- cd second-dir
- touch file2
- dotest toplevel-3s "${testcvs} add file2" \
- "${PROG} add: scheduling file .file2. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest toplevel-4s "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/second-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/second-dir/file2,v <-- file2
- initial revision: 1\.1
- done"
- cd ../..
- rm -r 1; mkdir 1; cd 1
- dotest toplevel-5 "${testcvs} co top-dir" \
- "${PROG} checkout: Updating top-dir
- U top-dir/file1"
- dotest toplevel-6 "${testcvs} update top-dir" \
- "${PROG} update: Updating top-dir"
- dotest toplevel-7 "${testcvs} update" \
- "${PROG} update: Updating \.
- ${PROG} update: Updating top-dir"
- dotest toplevel-8 "${testcvs} update -d top-dir" \
- "${PROG} update: Updating top-dir"
- # There is some sentiment that
- # "${PROG} update: Updating \.
- # ${PROG} update: Updating top-dir"
- # is correct but it isn't clear why that would be correct instead
- # of the remote CVS behavior (which also updates CVSROOT).
- #
- # The DOTSTAR matches of a bunch of lines like
- # "U CVSROOT/checkoutlist". Trying to match them more precisely
- # seemed to cause trouble. For example CVSROOT/cvsignore will
- # be present or absent depending on whether we ran the "ignore"
- # test or not.
- dotest toplevel-9 "${testcvs} update -d" \
- "${PROG} update: Updating \.
- ${PROG} update: Updating CVSROOT
- ${DOTSTAR}
- ${PROG} update: Updating top-dir"
- cd ..
- rm -r 1; mkdir 1; cd 1
- dotest toplevel-10 "${testcvs} co top-dir" \
- "${PROG} checkout: Updating top-dir
- U top-dir/file1"
- # This tests more or less the same thing, in a particularly
- # "real life" example.
- dotest toplevel-11 "${testcvs} -q update -d second-dir" \
- "U second-dir/file2"
- # Now remove the CVS directory (people may do this manually,
- # especially if they formed their habits with CVS
- # 1.9 and older, which didn't create it. Or perhaps the working
- # directory itself was created with 1.9 or older).
- rm -r CVS
- # Now set the permissions so we can't recreate it.
- if test -n "$remotehost"; then
- # Cygwin again.
- $CVS_RSH $remotehost "chmod -w $TESTDIR/1"
- else
- chmod -w ../1
- fi
- # Now see whether CVS has trouble because it can't create CVS.
- # First string is for local, second is for remote.
- dotest toplevel-12 "${testcvs} co top-dir" \
- "${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
- ${PROG} checkout: Updating top-dir" \
- "${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
- ${PROG} checkout: in directory \.:
- ${PROG} checkout: cannot open CVS/Entries for reading: No such file or directory
- ${PROG} checkout: Updating top-dir"
- chmod +w ../1
- dotest toplevel-cleanup-1 "${testcvs} -q co CVSROOT/config" \
- "U CVSROOT/config"
- cd CVSROOT
- echo "# empty file" >config
- dotest toplevel-cleanup-2 "${testcvs} -q ci -m toplevel-cleanup" \
- "Checking in config;
- ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/top-dir ${CVSROOT_DIRNAME}/second-dir
- ;;
- toplevel2)
- # Similar to toplevel, but test the case where TopLevelAdmin=no.
- # First set the TopLevelAdmin setting.
- mkdir 1; cd 1
- dotest toplevel2-1a "${testcvs} -q co CVSROOT/config" \
- "U CVSROOT/config"
- cd CVSROOT
- echo "TopLevelAdmin=no" >config
- dotest toplevel2-1b "${testcvs} -q ci -m no-top-level" \
- "Checking in config;
- ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ../..
- rm -r 1
- # Now set up some directories and subdirectories
- mkdir 1; cd 1
- dotest toplevel2-1 "${testcvs} -q co -l ." ''
- mkdir top-dir second-dir
- dotest toplevel2-2 "${testcvs} add top-dir second-dir" \
- "Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
- Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
- cd top-dir
- touch file1
- dotest toplevel2-3 "${testcvs} add file1" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest toplevel2-4 "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/top-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/top-dir/file1,v <-- file1
- initial revision: 1\.1
- done"
- cd ..
- cd second-dir
- touch file2
- dotest toplevel2-3s "${testcvs} add file2" \
- "${PROG} add: scheduling file .file2. for addition
- ${PROG} add: use .${PROG} commit. to add this file permanently"
- dotest toplevel2-4s "${testcvs} -q ci -m add" \
- "RCS file: ${CVSROOT_DIRNAME}/second-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/second-dir/file2,v <-- file2
- initial revision: 1\.1
- done"
- cd ../..
- rm -r 1; mkdir 1; cd 1
- dotest toplevel2-5 "${testcvs} co top-dir" \
- "${PROG} checkout: Updating top-dir
- U top-dir/file1"
- dotest toplevel2-6 "${testcvs} update top-dir" \
- "${PROG} update: Updating top-dir"
- dotest toplevel2-7 "${testcvs} update" \
- "${PROG} update: Updating top-dir"
- dotest toplevel2-8 "${testcvs} update -d top-dir" \
- "${PROG} update: Updating top-dir"
- # Contrast this with toplevel-9, which has TopLevelAdmin=yes.
- dotest toplevel2-9 "${testcvs} update -d" \
- "${PROG} update: Updating top-dir"
- cd ..
- rm -r 1; mkdir 1; cd 1
- dotest toplevel2-10 "${testcvs} co top-dir" \
- "${PROG} checkout: Updating top-dir
- U top-dir/file1"
- # This tests more or less the same thing, in a particularly
- # "real life" example. With TopLevelAdmin=yes, this command
- # would give us second-dir and CVSROOT directories too.
- dotest toplevel2-11 "${testcvs} -q update -d" ""
- dotest toplevel2-cleanup-1 "${testcvs} -q co CVSROOT/config" \
- "U CVSROOT/config"
- cd CVSROOT
- echo "# empty file" >config
- dotest toplevel2-cleanup-2 "${testcvs} -q ci -m toplevel2-cleanup" \
- "Checking in config;
- ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
- new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
- done
- ${PROG} commit: Rebuilding administrative file database"
- cd ../..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/top-dir ${CVSROOT_DIRNAME}/second-dir
- ;;
- rstar-toplevel)
- # This test used to confirm a bug that existed in the r* commands
- # run against the top-level project prior to CVS 1.11.18 & 1.12.10.
- #
- # The assertion failure was something like:
- # do_recursion: Assertion \`strstr (repository, \"/\./\") == ((void \*)0)' failed\..*"
- dotest rstar-toplevel-1 "$testcvs -q rlog ." \
- "
- RCS file: $CVSROOT_DIRNAME/CVSROOT$DOTSTAR"
- if $keep; then
- echo Keeping ${TESTDIR} and exiting due to --keep
- exit 0
- fi
- ;;
- trailingslashes)
- # Some tests of CVS's reactions to path specifications containing
- # trailing slashes.
- mkdir trailingslashes; cd trailingslashes
- dotest trailingslashes-init-1 "$testcvs -Q co -ldt ."
- dotest trailingslashes-init-2 "$testcvs -Q co -dt2 ."
- cd t
- echo "Ahh'll be baaack." >topfile
- dotest trailingslashes-init-3 "$testcvs -Q add topfile"
- dotest trailingslashes-init-4 "$testcvs -Q ci -mto-top" \
- "RCS file: $CVSROOT_DIRNAME/topfile,v
- done
- Checking in topfile;
- $CVSROOT_DIRNAME/topfile,v <-- topfile
- initial revision: 1\.1
- done"
- # First, demonstrate the usual case.
- cd ../t2
- dotest trailingslashes-1 "$testcvs -q up CVSROOT"
- dotest_fail trailingslashes-1a "test -f topfile"
- # Now the one that used to fail in remote mode prior to 1.11.24
- # & 1.12.14. Formerly TODO item #205.
- dotest trailingslashes-2 "$testcvs -q up CVSROOT/"
- dotest_fail trailingslashes-2a "test -f topfile"
- if $keep; then
- echo Keeping $TESTDIR and exiting due to --keep
- exit 0
- fi
- cd ../..
- rm -rf trailingslashes $CVSROOT_DIRNAME/topfile,v
- ;;
- checkout_repository)
- dotest_fail checkout_repository-1 \
- "${testcvs} co -d ${CVSROOT_DIRNAME} CVSROOT" \
- "${PROG} \[checkout aborted\]: Cannot check out files into the repository itself" \
- "${PROG} \[checkout aborted\]: absolute pathname \`${CVSROOT_DIRNAME}' illegal for server"
- # The behavior of the client/server test below should be correct.
- # The CVS client currently has no way of knowing that the client and
- # server are the same machine and thus skips the $CVSROOT checks.
- # I think checking for this case in CVS would be bloat since this
- # should be a fairly rare occurance.
- cd ${CVSROOT_DIRNAME}
- dotest_fail checkout_repository-2 "${testcvs} co CVSROOT" \
- "${PROG} \[checkout aborted\]: Cannot check out files into the repository itself" \
- "${PROG} checkout: Updating CVSROOT
- ${PROG} checkout: move away CVSROOT/checkoutlist; it is in the way
- C CVSROOT/checkoutlist
- ${PROG} checkout: move away CVSROOT/commitinfo; it is in the way
- C CVSROOT/commitinfo
- ${PROG} checkout: move away CVSROOT/config; it is in the way
- C CVSROOT/config
- ${PROG} checkout: move away CVSROOT/cvswrappers; it is in the way
- C CVSROOT/cvswrappers
- ${PROG} checkout: move away CVSROOT/editinfo; it is in the way
- C CVSROOT/editinfo
- ${PROG} checkout: move away CVSROOT/loginfo; it is in the way
- C CVSROOT/loginfo
- ${PROG} checkout: move away CVSROOT/modules; it is in the way
- C CVSROOT/modules
- ${PROG} checkout: move away CVSROOT/notify; it is in the way
- C CVSROOT/notify
- ${PROG} checkout: move away CVSROOT/rcsinfo; it is in the way
- C CVSROOT/rcsinfo
- ${PROG} checkout: move away CVSROOT/taginfo; it is in the way
- C CVSROOT/taginfo
- ${PROG} checkout: move away CVSROOT/verifymsg; it is in the way
- C CVSROOT/verifymsg"
- dotest checkout_repository-3 \
- "${testcvs} co -p CVSROOT/modules >/dev/null" \
- "===================================================================
- Checking out CVSROOT/modules
- RCS: ${CVSROOT_DIRNAME}/CVSROOT/modules,v
- VERS: 1\.[0-9]*
- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
- cd ${TESTDIR}
- ;;
- mflag)
- for message in '' ' ' '
- ' ' test' ; do
- # Set up
- mkdir a-dir; cd a-dir
- # Test handling of -m during import
- echo testa >>test
- if ${testcvs} import -m "$message" a-dir A A1 >>${LOGFILE} 2>&1;then
- pass 156
- else
- fail 156
- fi
- # Must import twice since the first time uses inline code that
- # avoids RCS call.
- echo testb >>test
- if ${testcvs} import -m "$message" a-dir A A2 >>${LOGFILE} 2>&1;then
- pass 157
- else
- fail 157
- fi
- # Test handling of -m during ci
- cd ..; rm -r a-dir
- if ${testcvs} co a-dir >>${LOGFILE} 2>&1; then
- pass 158
- else
- fail 158
- fi
- cd a-dir
- echo testc >>test
- if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
- pass 159
- else
- fail 159
- fi
- # Test handling of -m during rm/ci
- rm test;
- if ${testcvs} rm test >>${LOGFILE} 2>&1; then
- pass 160
- else
- fail 160
- fi
- if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
- pass 161
- else
- fail 161
- fi
- # Clean up
- cd ..
- rm -r a-dir
- rm -rf ${CVSROOT_DIRNAME}/a-dir
- done
- ;;
- editor)
- # More tests of log messages, in this case the ability to
- # run an external editor.
- # TODO:
- # * also test $EDITOR, $CVSEDITOR, &c.
- # * test what happens if up-to-date check fails.
- # Our "editor" puts "x" at the start of each line, so we
- # can see the "CVS:" lines.
- cat >${TESTDIR}/editme <<EOF
- #!${TESTSHELL}
- sleep 1
- sed <\$1 -e 's/^/x/' >${TESTDIR}/edit.new
- mv ${TESTDIR}/edit.new \$1
- exit 0
- EOF
- chmod +x ${TESTDIR}/editme
- mkdir 1; cd 1
- dotest editor-1 "${testcvs} -q co -l ." ''
- mkdir first-dir
- dotest editor-2 "${testcvs} add first-dir" \
- "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
- cd first-dir
- touch file1 file2
- dotest editor-3 "${testcvs} add file1 file2" \
- "${PROG} add: scheduling file .file1. for addition
- ${PROG} add: scheduling file .file2. for addition
- ${PROG} add: use .${PROG} commit. to add these files permanently"
- dotest editor-4 "${testcvs} -e ${TESTDIR}/editme -q ci" \
- "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- done
- Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- initial revision: 1\.1
- done
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- done
- Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- initial revision: 1\.1
- done"
- dotest editor-5 "${testcvs} -q tag -b br" "T file1
- T file2"
- dotest editor-6 "$testcvs -q update -r br" \
- 'U file1
- U file2'
- echo modify >>file1
- dotest editor-7 "${testcvs} -e ${TESTDIR}/editme -q ci" \
- "Checking in file1;
- ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- # OK, now we want to make sure "ci -r" puts in the branch
- # where appropriate. Note that we can check in on the branch
- # without being on the branch, because there is not a revision
- # already on the branch. If there were a revision on the branch,
- # CVS would correctly give an up-to-date check failed.
- dotest editor-8 "$testcvs -q update -A" \
- 'U file1
- U file2'
- echo add a line >>file2
- dotest editor-9 "${testcvs} -q -e ${TESTDIR}/editme ci -rbr file2" \
- "Checking in file2;
- ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
- new revision: 1\.1\.2\.1; previous revision: 1\.1
- done"
- dotest editor-log-file1 "${testcvs} log -N file1" "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
- Working file: file1
- head: 1\.1
- branch:
- locks: strict
- access list:
- keyword substitution: kv
- total revisions: 2; selected revisions: 2
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- branches: 1\.1\.2;
- xCVS: ----------------------------------------------------------------------
- xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
- xCVS:
- xCVS: Committing in .
- xCVS:
- xCVS: Added Files:
- xCVS: file1 file2
- xCVS: ----------------------------------------------------------------------
- ----------------------------
- revision 1\.1\.2\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
- xCVS: ----------------------------------------------------------------------
- xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
- xCVS:
- xCVS: Committing in .
- xCVS:
- xCVS: Modified Files:
- xCVS: Tag: br
- xCVS: file1
- xCVS: ----------------------------------------------------------------------
- ============================================================================="
- # The only difference between the two expect strings is the
- # presence or absence of "Committing in ." for 1.1.2.1.
- dotest editor-log-file2 "${testcvs} log -N file2" "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- Working file: file2
- head: 1\.1
- branch:
- locks: strict
- access list:
- keyword substitution: kv
- total revisions: 2; selected revisions: 2
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- branches: 1\.1\.2;
- xCVS: ----------------------------------------------------------------------
- xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
- xCVS:
- xCVS: Committing in .
- xCVS:
- xCVS: Added Files:
- xCVS: file1 file2
- xCVS: ----------------------------------------------------------------------
- ----------------------------
- revision 1\.1\.2\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
- xCVS: ----------------------------------------------------------------------
- xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
- xCVS:
- xCVS: Modified Files:
- xCVS: Tag: br
- xCVS: file2
- xCVS: ----------------------------------------------------------------------
- =============================================================================" "
- RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
- Working file: file2
- head: 1\.1
- branch:
- locks: strict
- access list:
- keyword substitution: kv
- total revisions: 2; selected revisions: 2
- description:
- ----------------------------
- revision 1\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
- branches: 1\.1\.2;
- xCVS: ----------------------------------------------------------------------
- xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
- xCVS:
- xCVS: Committing in .
- xCVS:
- xCVS: Added Files:
- xCVS: file1 file2
- xCVS: ----------------------------------------------------------------------
- ----------------------------
- revision 1\.1\.2\.1
- date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
- xCVS: ----------------------------------------------------------------------
- xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
- xCVS:
- xCVS: Committing in .
- xCVS:
- xCVS: Modified Files:
- xCVS: Tag: br
- xCVS: file2
- xCVS: ----------------------------------------------------------------------
- ============================================================================="
- # Test CVS's response to an unchanged log message
- cat >${TESTDIR}/editme <<EOF
- #!${TESTSHELL}
- sleep 1
- exit 0
- EOF
- chmod +x ${TESTDIR}/editme
- dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
- "
- Log message unchanged or not specified
- a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
- Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
- # Test CVS's response to an empty log message
- cat >${TESTDIR}/editme <<EOF
- #!${TESTSHELL}
- sleep 1
- cat /dev/null >\$1
- exit 0
- EOF
- chmod +x ${TESTDIR}/editme
- dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
- "
- Log message unchanged or not specified
- a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
- Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
- # Test CVS's response to a log message with one blank line
- cat >${TESTDIR}/editme <<EOF
- #!${TESTSHELL}
- sleep 1
- echo >\$1
- exit 0
- EOF
- chmod +x ${TESTDIR}/editme
- dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
- "
- Log message unchanged or not specified
- a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
- Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
- # Test CVS's response to a log message with only comments
- cat >${TESTDIR}/editme <<EOF
- #!${TESTSHELL}
- sleep 1
- cat \$1 >${TESTDIR}/edit.new
- mv ${TESTDIR}/edit.new \$1
- exit 0
- EOF
- chmod +x ${TESTD