xref: /netbsd-src/external/gpl2/xcvs/dist/src/sanity.sh (revision 69586eb894cdf25649d1ff533f5d083647caadc0)
1#! /bin/sh
2:
3#	sanity.sh -- a growing testsuite for cvs.
4#
5# The copyright notice said: "Copyright (C) 1992, 1993 Cygnus Support"
6# I'm not adding new copyright notices for new years as our recent
7# practice has been to include copying terms without copyright notices.
8#
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2, or (at your option)
12# any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17# GNU General Public License for more details.
18#
19# Original Author: K. Richard Pixley
20
21# usage:
22usage ()
23{
24    echo "Usage: `basename $0` --help"
25    echo "Usage: `basename $0` [--eklrw] [-c CONFIG-FILE] [-f FROM-TEST] \\"
26    echo "                 [-h HOSTNAME] [-s CVS-FOR-CVS-SERVER] CVS-TO-TEST \\"
27    echo "                 [TESTS-TO-RUN...]"
28}
29
30exit_usage ()
31{
32    usage 1>&2
33    exit 2
34}
35
36exit_help ()
37{
38    usage
39    echo
40    echo "-H|--help	display this text"
41    echo "-c CONFIG-FILE"
42    echo "--config=CONFIG_FILE"
43    echo "		use an alternate test suite config file (defaults to"
44    echo "		\`sanity.config.sh' in the same directory as"
45    echo "		CVS-TO-TEST is found in)"
46    echo "-e|--skipfail Treat tests that would otherwise be nonfatally skipped"
47    echo "              for reasons like missing tools as failures, exiting"
48    echo "              with an error message.  Also treat warnings as"
49    echo "		failures."
50    echo "-f FROM-TEST"
51    echo "--from-test=FROM-TEST"
52    echo "		run TESTS-TO-RUN, skipping all tests in the list before"
53    echo "		FROM-TEST"
54    echo "-h HOSTNAME"
55    echo "--hostname HOSTNAME"
56    echo "              Use :ext:HOSTNAME to run remote tests rather than"
57    echo "              :fork:.  Implies --remote and assumes that \$TESTDIR"
58    echo "              resolves to the same directory on both the client and"
59    echo "              the server."
60    echo "-k|--keep	try to keep directories created by individual tests"
61    echo "		around, exiting after the first test which supports"
62    echo "		--keep"
63    echo "-l|--link-root"
64    echo "		test CVS using a symlink to a real CVSROOT"
65    echo "-n|--noredirect"
66    echo "              test a secondary/primary CVS server (writeproxy)"
67    echo "              configuration with the Redirect response disabled"
68    echo "              (implies --proxy)."
69    echo "-p|--proxy	test a secondary/primary CVS server (writeproxy)"
70    echo "              configuration (implies --remote)."
71    echo "-r|--remote	test client/server, as opposed to local, CVS"
72    echo "-w|--wait	automatically sleep for a second before and after"
73    echo "		checkouts, commits, and updates.  Use this option"
74    echo "		if you have fast cores and a slow disk.  (For example,"
75    echo "		you may need this flag if you see tests fail because"
76    echo "		they think they have nothing to commit.)"
77    echo "-s CVS-FOR-CVS-SERVER"
78    echo "--server=CVS-FOR-CVS-SERVER"
79    echo "		use CVS-FOR-CVS-SERVER as the path to the CVS SERVER"
80    echo "		executable to be tested (defaults to CVS-TO-TEST and"
81    echo "		implies --remote)"
82    echo
83    echo "CVS-TO-TEST	the path to the CVS executable to be tested; used as"
84    echo "		the path to the CVS client when CVS-FOR-CVS-SERVER is"
85    echo "		specified"
86    echo "TESTS-TO-RUN	the names of the tests to run (defaults to all tests)"
87    exit 2
88}
89
90checklongoptarg()
91{
92    if test "x$1" != xoptional && test -z "$OPTARG"; then
93	echo "option \`--$LONGOPT' requires an argument" >&2
94	exit_usage
95    fi
96}
97
98# See TODO list at end of file.
99
100# required to make this script work properly.
101unset CVSREAD
102
103# We want to invoke a predictable set of i18n behaviors, not whatever
104# the user running this script might have set.
105# In particular:
106#   'sort' and tabs and spaces (LC_COLLATE).
107#   Messages from getopt (LC_MESSAGES) (in the future, CVS itself might
108#     also alter its messages based on LC_MESSAGES).
109LANG=C
110export LANG
111LC_ALL=C
112export LC_ALL
113
114# And a few tests want a predictable umask.
115umask 0002
116
117#
118# Initialize the test counts.
119#
120passed=0
121skipped=0
122warnings=0
123
124
125
126#
127# read our options
128#
129unset configfile
130unset fromtest
131unset remotehost
132unset rootoptions
133keep=false
134linkroot=false
135noredirect=false
136proxy=false
137remote=false
138servercvs=false
139skipfail=false
140waitforslowdisk=false
141while getopts Hc:ef:h:klnprs:w-: option ; do
142    # convert the long opts to short opts
143    if test x$option = x-;  then
144	# remove any argument
145	if echo "$OPTARG" |grep = >/dev/null; then
146	    LONGOPT=`echo "$OPTARG" |sed 's/=.*$//'`
147	    OPTARG=`echo "$OPTARG" |sed -e 's/^.*=//'`
148	else
149	    LONGOPT=$OPTARG
150	    OPTARG=
151	fi
152	# Convert LONGOPT to lower case
153	LONGOPT=`echo "$LONGOPT" |sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
154	case "$LONGOPT" in
155	    c|co|con|conf|confi|config)
156		option=c
157		checklongoptarg
158		;;
159	    f|fr|fro|from|from-|from-t|from-te|from-tes|from-test)
160		option=f
161		checklongoptarg
162		;;
163	    h)
164		echo "\`--h' is ambiguous.  Could mean \`--help' or \`--hostname'" >&2
165		exit_usage
166		;;
167	    he|hel|help)
168		option=H
169		OPTARG=
170		;;
171	    ho|hos|host|hostn|hostna|hostnam|hostname)
172		option=h
173		checklongoptarg
174		;;
175	    k|ke|kee|keep)
176		option=k
177		OPTARG=
178		;;
179	    l|li|lin|link|link-|link-r]|link-ro|link-roo|link-root)
180		option=l
181		OPTARG=
182		;;
183	    n|no|nor|nore|nored|noredi|noredir|noredire|noredirec|noredirect)
184		option=n
185		OPTARG=
186		;;
187	    p|pr|pro|prox|proxy)
188		option=p
189		OPTARG=
190		;;
191	    r|re|rem|remo|remot|remote)
192		option=r
193		OPTARG=
194		;;
195	    s)
196		echo "\`--s' is ambiguous.  Could mean \`--server' or \`--skipfail'" >&2
197		exit_usage
198		;;
199	    se|ser|serv|serve|server)
200		option=s
201		checklongoptarg
202		;;
203	    sk|ski|skip|skipf|skipfa|skipfai|skipfail)
204		option=e
205		OPTARG=
206		;;
207	    w|wa|wai|wait)
208		option=w
209		OPTARG=
210		;;
211	    *)
212		option=\?
213		OPTARG=
214	esac
215    fi
216    case "$option" in
217	c)
218	    configfile="$OPTARG"
219	    ;;
220	e)
221	    skipfail=:
222	    ;;
223	f)
224	    fromtest="$OPTARG"
225	    ;;
226	h)
227	    # Set a remotehost to run the remote tests on via :ext:
228	    # Implies `-r' and assumes that $TESTDIR resolves to the same
229	    # directory on the client and the server.
230	    remotehost="$OPTARG"
231	    remote=:
232	    ;;
233	H)
234	    exit_help
235	    ;;
236	k)
237	    # The -k (keep) option will eventually cause all the tests to
238	    # leave around the contents of the /tmp directory; right now only
239	    # some implement it.  Not originally intended to be useful with
240	    # more than one test, but this should work if each test uses a
241	    # uniquely named dir (use the name of the test).
242	    keep=:
243	    ;;
244	l)
245	    linkroot=:
246	    ;;
247        n)
248	    proxy=:
249	    noredirect=:
250	    remote=:
251	    ;;
252        p)
253	    proxy=:
254	    remote=:
255	    ;;
256	r)
257	    remote=:
258	    ;;
259        s)
260	    servercvs="$OPTARG"
261	    remote=:
262	    ;;
263	w)
264	    waitforslowdisk=:
265	    ;;
266	\?)
267	    exit_usage
268	    ;;
269    esac
270done
271
272# boot the arguments we used above
273while test $OPTIND -gt 1 ; do
274    shift
275    OPTIND=`expr $OPTIND - 1`
276done
277
278# Use full path for CVS executable, so that CVS_SERVER gets set properly
279# for remote.
280case $1 in
281"")
282  exit_usage
283  ;;
284/*)
285  testcvs=$1
286  ;;
287*)
288  testcvs=`pwd`/$1
289  ;;
290esac
291shift
292
293# Verify that $testcvs looks like CVS.
294# we can't use test -x since BSD 4.3 doesn't support it.
295if test ! -f $testcvs || test ! -r $testcvs; then
296  echo "No such file or file not readable: $testcvs" >&2
297  exit 1
298fi
299if $testcvs --version </dev/null 2>/dev/null |
300     grep '^Concurrent Versions System' >/dev/null 2>&1; then :; else
301  echo "Not a CVS executable: $testcvs" >&2
302  exit 1
303fi
304
305# If $remotehost is set, warn if $TESTDIR isn't since we are pretty sure
306# that its default value of `/tmp/cvs-sanity' will not resolve to the same
307# directory on two different machines.
308if test -n "$remotehost" && test -z "$TESTDIR"; then
309    echo "WARNING: CVS server hostname is set and \$TESTDIR is not.  If" >&2
310    echo "$remotehost is not the local machine, then it is unlikely that" >&2
311    echo "the default value assigned to \$TESTDIR will resolve to the same" >&2
312    echo "directory on both this client and the CVS server." >&2
313fi
314
315# Read our config file if we can find it.
316#
317# The config file should always be located in the same directory as the CVS
318# executable, unless we are testing an executable outside of the build
319# directory.  In this case, we echo a warning and attempt to assume the most
320# portable configuration.
321if test -z "$configfile"; then
322	configfile=`dirname $testcvs`/sanity.config.sh
323fi
324if test -r "$configfile"; then
325	. "$configfile"
326else
327	echo "WARNING: Failed to locate test suite config file" >&2
328	echo "         \`$configfile'." >&2
329fi
330
331
332
333# Set a default value for $CVS_RSH. The sanity.config.sh file will
334# have the configured value in the RSH_DFLT variable.
335#
336: ${CVS_RSH=${RSH_DFLT:-ssh}}; export CVS_RSH
337
338if test -n "$remotehost"; then
339    # Verify that $CVS_RSH $remotehost works.
340    result=`$CVS_RSH $remotehost 'echo test'`
341    if test $? != 0 || test "x$result" != "xtest"; then
342	echo "\`$CVS_RSH $remotehost' failed." >&2
343	exit 1
344    fi
345fi
346
347case "$servercvs" in
348"")
349  exit_usage
350  ;;
351false)
352  ;;
353/*)
354  ;;
355*)
356  servercvs=`pwd`/$servercvs
357  ;;
358esac
359
360if test false != $servercvs; then
361  # Allow command line to override $CVS_SERVER
362  CVS_SERVER=$servercvs
363else
364  # default $CVS_SERVER to ${testcvs}
365  : ${CVS_SERVER=$testcvs}
366  # With the previous command, effectively defaults $servercvs to $CVS_SERVER,
367  # then $testcvs
368  servercvs=$CVS_SERVER
369fi
370export CVS_SERVER
371servercvs_orig=$servercvs
372
373# Fail in client/server mode if our ${servercvs} does not contain server
374# support.
375if $remote; then
376  if test -n "$remotehost"; then
377    if $CVS_RSH $remotehost "test ! -f ${servercvs} || test ! -r ${servercvs}"
378    then
379      echo "No such file or file not readable: $remotehost:${testcvs}" >&2
380      exit 1
381    fi
382    if $CVS_RSH $remotehost "${servercvs} --version </dev/null 2>/dev/null |
383         grep '^Concurrent Versions System' >/dev/null 2>&1"; then :; else
384      echo "Not a CVS executable: $remotehost:${servercvs}" >&2
385      exit 1
386    fi
387    if $CVS_RSH $remotehost "${servercvs} --version </dev/null |
388         grep '^Concurrent.*(.*server)$' >/dev/null 2>&1"; then :; else
389      echo "CVS executable \`$remotehost:${servercvs}' does not contain server support." >&2
390      exit 1
391    fi
392  else
393    if test ! -f ${servercvs} || test ! -r ${servercvs}; then
394      echo "No such file or file not readable: ${testcvs}" >&2
395      exit 1
396    fi
397    if ${servercvs} --version </dev/null 2>/dev/null |
398         grep '^Concurrent Versions System' >/dev/null 2>&1; then :; else
399      echo "Not a CVS executable: ${servercvs}" >&2
400      exit 1
401    fi
402    if ${servercvs} --version </dev/null |
403         grep '^Concurrent.*(.*server)$' >/dev/null 2>&1; then :; else
404      echo "CVS executable \`${servercvs}' does not contain server support." >&2
405      exit 1
406    fi
407  fi
408fi
409
410# Fail in client/server mode if our ${testcvs} does not contain client
411# support.
412if $remote; then
413  if ${testcvs} --version </dev/null |
414       grep '^Concurrent.*(client.*)$' >/dev/null 2>&1; then :; else
415    echo "CVS executable \`${testcvs}' does not contain client support." >&2
416    exit 1
417  fi
418fi
419
420# For the "fork" tests.
421if ${testcvs} --version </dev/null |
422     grep '^Concurrent.*(.*server)$' >/dev/null 2>&1
423then
424  testcvs_server_support=:
425else
426  testcvs_server_support=false
427fi
428
429
430
431dokeep()
432{
433    if ${keep}; then
434      echo "Keeping ${TESTDIR} for test case \`${what}' and exiting due to --keep"
435      exit 0
436    fi
437}
438
439
440
441###
442### GUTS
443###
444
445# "debugger"
446#set -x
447
448echo 'This test should produce no other output than this message, and a final "OK".'
449echo '(Note that the test can take an hour or more to run and periodically stops'
450echo 'for as long as one minute.  Do not assume there is a problem just because'
451echo 'nothing seems to happen for a long time.  If you cannot live without'
452echo "running status, try the command: \`tail -f check.log' from another window.)"
453
454# Regexp to match what the CVS client will call itself in output that it prints.
455# FIXME: we don't properly quote this--if the name contains . we'll
456# just spuriously match a few things; if the name contains other regexp
457# special characters we are probably in big trouble.
458CPROG=`basename ${testcvs} |sed 's/\.exe$//'`
459# And the regexp for the CVS server when we have one.  In local mode, this
460# defaults to $CPROG since $servercvs already did.
461# FIXCVS: There are a few places in error messages where CVS suggests a command
462# and outputs $SPROG as the suggested executable.  This could hopefully use
463# MT (tagged text - see doc/cvs-client.texi) to request that the client print
464# its own name.
465SPROG=`basename ${servercvs} |sed 's/\.exe$//'`
466
467
468# Match the hostname
469hostname="[-_.a-zA-Z0-9]*"
470
471# Regexp to match a commitid
472commitid="[a-zA-Z0-9]*"
473
474# Regexp to match the name of a temporary file (from cvs_temp_name).
475# This appears in certain diff output.
476tempfile="cvs[-a-zA-Z0-9.%_]*"
477# $tempname set after $TMPDIR, below.
478
479# Regexp to match a date in RFC822 format (as amended by RFC1123).
480RFCDATE="[a-zA-Z0-9 ][a-zA-Z0-9 ]* [0-9:][0-9:]* -0000"
481RFCDATE_EPOCH="1 Jan 1970 00:00:00 -0000"
482
483# Special times used in touch -t commands and the regular expresions
484# to match them. Now that the tests set TZ=UTC0, it
485# should be easier to be more exact in their regexp.
486TOUCH1971="197107040343"
487# This date regexp was 1971/07/0[3-5] [0-9][0-9]:43:[0-9][0-9]
488ISO8601DATE1971="1971-07-04 03:43:[0-9][0-9] [+-]0000"
489
490TOUCH2034="203412251801"
491# This date regexp was 2034/12/2[4-6] [0-9][0-9]:01:[0-9][0-9]
492ISO8601DATE2034="2034-12-25 18:01:[0-9][0-9] [+-]0000"
493
494# Used in admin tests for exporting RCS files.
495# The RAWRCSDATE..... format is for internal ,v files and
496# the ISO8601DATE..... format is to allow for a regular expression in
497# 'cvs log' output patterns. The tests that use this set of specific
498# ${ISO8601DATE.....} variables also force TZ=UTC0 for the test.
499RAWRCSDATE2000A="2000.11.24.15.58.37"
500RAWRCSDATE1996A="96.11.24.15.57.41"
501RAWRCSDATE1996B="96.11.24.15.56.05"
502ISO8601DATE2000A="2000-11-24 15:58:37 [+-]0000"
503ISO8601DATE1996A="1996-11-24 15:57:41 [+-]0000"
504ISO8601DATE1996B="1996-11-24 15:56:05 [+-]0000"
505
506# Regexp to match the date in cvs log command output
507# This format has been enhanced in the future to accept either
508# old-style cvs log output dates or new-style ISO8601 timezone
509# information similar to the ISODATE format. The RCSKEYDATE is
510# similar, but uses '/' instead of '-' to sepearate year/month/day
511# and does not include the optional timezone offset.
512ISO8601DATE="[0-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9] [-+][0-1][0-9][0-6][0-9]"
513
514# Regexp to match the dates found in rcs keyword strings
515RCSKEYDATE="[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]"
516
517# Regexp to match the date in the delta section of rcs format files.
518# Dates in very old RCS files may not have included the century.
519RCSDELTADATE="[0-9][0-9]*\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]"
520
521# Regexp to match a date in standard Unix format as used by rdiff
522# FIXCVS: There's no reason for rdiff to use a different date format
523# than diff does
524DATE="[a-zA-Z]* [a-zA-Z]* [ 1-3][0-9] [0-9:]* [0-9]*"
525# ISO 8601 format "yyyy-mm-dd hh:mm -0000"
526ISODATE="[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] [+-][0-9][0-9][0-9][0-9]"
527# %p format is not well defined (nil) and hex digits are common. Using
528# ..* is a bad idea as the tests take a very long time to run due to
529# the complexity of the expressions.  If you run into any other characters
530# that are used in a %p format, add them here.
531PFMT="[0-9a-zA-Z()][0-9a-zA-Z()]*"
532
533# Which directories should Which and find_tool search for executables?
534SEARCHPATH=$PATH:/usr/local/bin:/usr/contrib/bin:/usr/contrib:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin:/sw/bin:/usr/pkg/bin
535
536# Do not assume that `type -p cmd` is portable
537# Usage: Which [-a] [-x|-f|-r] prog [$SEARCHPATH:/with/directories:/to/search]
538Which() {
539  # Optional first argument for file type, defaults to -x.
540  # Second argument is the file or directory to be found.
541  # Third argument is the PATH to search.
542  # By default, print only the first file that matches,
543  # -a will cause all matches to be printed.
544  notevery=:
545  if [ "x$1" = "x-a" ]; then notevery=false; shift; fi
546  case "$1" in
547    -*) t=$1; shift ;;
548    *) t=-x ;;
549  esac
550  case "$1" in
551    # FIXME: Someday this may need to be fixed
552    # to deal better with C:\some\path\to\ssh values...
553    /*) test $t $1 && echo $1 ;;
554    *) for d in `IFS=:; echo ${2-$SEARCHPATH}`
555       do
556         test $t $d/$1 && { echo $d/$1; if $notevery; then break; fi; }
557       done
558       ;;
559  esac
560}
561
562
563# On cygwin32, we may not have /bin/sh.
564if test -r /bin/sh; then
565  TESTSHELL="/bin/sh"
566else
567  TESTSHELL=`Which -f sh`
568  if test ! -r "$TESTSHELL"; then
569    TESTSHELL="/bin/sh"
570  fi
571fi
572
573# FIXME: try things (what things? checkins?) without -m.
574#
575# Some of these tests are written to expect -Q.  But testing with
576# -Q is kind of bogus, it is not the way users actually use CVS (usually).
577# So new tests probably should invoke ${testcvs} directly, rather than ${CVS}.
578# and then they've obviously got to do something with the output....
579#
580CVS="${testcvs} -Q"
581
582LOGFILE=`pwd`/check.log
583
584# Save the previous log in case the person running the tests decides
585# they want to look at it.  The extension ".plog" is chosen for consistency
586# with dejagnu.
587test -f check.plog && mv check.plog check.plog~
588test -f check.log && mv check.log check.plog
589
590# Create the log file so check.log can be tailed almost immediately after
591# this script is started.  Otherwise it can take up to a minute or two before
592# the log file gets created when $remotehost is specified on some systems,
593# which makes for a lot of failed `tail -f' attempts.
594touch check.log
595
596# Workaround any X11Forwarding by ssh. Otherwise this text:
597#   Warning: No xauth data; using fake authentication data for X11 forwarding.
598# has been known to end up in the test results below
599# causing the test to fail.
600[ -n "$DISPLAY" ] && unset DISPLAY
601
602# The default value of /tmp/cvs-sanity for TESTDIR is dubious,
603# because it loses if two people/scripts try to run the tests
604# at the same time.  Some possible solutions:
605# 1.  Use /tmp/cvs-test$$.  One disadvantage is that the old
606#     cvs-test* directories would pile up, because they wouldn't
607#     necessarily get removed.
608# 2.  Have everyone/everything running the testsuite set
609#     TESTDIR to some appropriate directory.
610# 3.  Have the default value of TESTDIR be some variation of
611#     `pwd`/cvs-sanity.  The biggest problem here is that we have
612#     been fairly careful to test that CVS prints in messages the
613#     actual pathnames that we pass to it, rather than a different
614#     pathname for the same directory, as may come out of `pwd`.
615#     So this would be lost if everything was `pwd`-based.  I suppose
616#     if we wanted to get baroque we could start making symlinks
617#     to ensure the two are different.
618if test -n "$remotehost"; then
619        # We need to set $tmp on the server since $TMPDIR is compared against
620	# messages generated by the server.
621	tmp=`$CVS_RSH $remotehost 'cd /tmp; /bin/pwd || pwd' 2>/dev/null`
622	if test $? != 0; then
623	    echo "$CVS_RSH $remotehost failed." >&2
624	    exit 1
625	fi
626else
627	tmp=`(cd /tmp; /bin/pwd || pwd) 2>/dev/null`
628fi
629
630# Now:
631#	1) Set TESTDIR if it's not set already
632#	2) Remove any old test remnants
633#	3) Create $TESTDIR
634#	4) Normalize TESTDIR with `cd && (/bin/pwd || pwd)`
635#	   (This will match CVS output later)
636: ${TESTDIR=$tmp/cvs-sanity}
637# clean any old remnants (we need the chmod because some tests make
638# directories read-only)
639if test -d $TESTDIR; then
640    chmod -R a+wx $TESTDIR
641    rm -rf $TESTDIR
642fi
643# These exits are important.  The first time I tried this, if the `mkdir && cd`
644# failed then the build directory would get blown away.  Some people probably
645# wouldn't appreciate that.
646mkdir $TESTDIR || exit 1
647cd $TESTDIR || exit 1
648# Ensure $TESTDIR is absolute
649if echo "$TESTDIR" |grep '^[^/]'; then
650    # Don't resolve this unless we have to.  This keeps symlinks intact.  This
651    # is important at least when testing using -h $remotehost, because the same
652    # value for $TESTDIR must resolve to the same directory on the client and
653    # the server and we likely used Samba, and possibly symlinks, to do this.
654    TESTDIR=`(/bin/pwd || pwd) 2>/dev/null`
655fi
656
657if test -z "$TESTDIR" || echo "$TESTDIR" |grep '^[^/]'; then
658    echo "Unable to resolve TESTDIR to an absolute directory." >&2
659    exit 1
660fi
661cd $TESTDIR
662
663
664
665: ${TIMING=false}
666if $remote; then
667    # Now override our CVS_RSH in order to forward variables which affect the
668    # test suite through.  This always needs to be done when $remotehost is
669    # set, needs to be done in $proxy mode for the crerepos tests, and needs to
670    # be done in $remote mode for the writeproxy-ssh tests.
671    if $TIMING; then
672	time="/usr/bin/time -ao'$TESTDIR/time.out'"
673    else
674	time=
675    fi
676    cat >$TESTDIR/ssh-wrapper-env <<EOF
677#! $TESTSHELL
678while [ \$# -gt 0 ]
679do
680  case "\$1" in
681    *=*)
682      eval "\$1"
683      var=\`echo "\$1" | sed 's/^\\(.*\\)=.*\$/\\1/'\`
684      export \$var
685      ;;
686    *) break;;
687  esac
688  shift
689done
690exec \${1+"\$@"}
691EOF
692    chmod a+x $TESTDIR/ssh-wrapper-env
693    cat >$TESTDIR/ssh-wrapper <<EOF
694#! $TESTSHELL
695hostname=\$1
696shift
697exec \
698$CVS_RSH \
699	 \$hostname \
700	 $TESTDIR/ssh-wrapper-env \
701	 "CVS_SERVER='\$CVS_SERVER'" \
702	 "CVS_SERVER_SLEEP='\$CVS_SERVER_SLEEP'" \
703	 "CVS_PARENT_SERVER_SLEEP='\$CVS_PARENT_SERVER_SLEEP'" \
704	 "CVS_SERVER_LOG='\$CVS_SERVER_LOG'" \
705	 "CVS_SECONDARY_LOG='\$CVS_SECONDARY_LOG'" \
706	 "TMPDIR='\$TMPDIR'" \
707	 "CVS_RSH='$TESTDIR/ssh-wrapper'" \
708	 "CVSUMASK='\$CVSUMASK'" \
709	 "CVS_PID='\$CVS_PID'" \
710	 $time \
711	 \${1+"\$@"}
712EOF
713    chmod a+x $TESTDIR/ssh-wrapper
714    CVS_RSH=$TESTDIR/ssh-wrapper
715fi # $remotehost
716
717
718
719# Now set $TMPDIR if the user hasn't overridden it.
720#
721# We use a $TMPDIR under $TESTDIR by default so that two tests may be run at
722# the same time without bumping heads without requiring the user to specify
723# more than $TESTDIR.  See the test for leftover cvs-serv* directories near the
724# end of this script at the end of "The big loop".
725: ${TMPDIR=$TESTDIR/tmp}
726export TMPDIR
727if test -d $TMPDIR; then :; else
728    mkdir $TMPDIR
729fi
730
731
732# Regexp to match the the full path to a temporary file (from cvs_temp_name).
733# This appears in certain diff output.
734tempname=$TMPDIR/$tempfile
735
736# Make sure various tools work the way we expect, or try to find
737# versions that do.
738: ${AWK=awk}
739: ${EXPR=expr}
740: ${ID=id}
741: ${TR=tr}
742
743# Keep track of tools that are found, but do NOT work as we hope
744# in order to avoid them in future
745badtools=
746set_bad_tool ()
747{
748   badtools=$badtools:$1
749}
750is_bad_tool ()
751{
752   case ":$badtools:" in *:$1:*) return 0 ;; *) return 1 ; esac
753}
754
755version_test ()
756{
757  vercmd=$1
758  verbad=:
759  if RES=`$vercmd --version </dev/null 2>&1`; then
760    if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
761      echo "$RES"
762      verbad=false
763    fi
764  fi
765  if $verbad; then
766    echo "The command \`$vercmd' does not support the --version option."
767  fi
768  # It does not really matter that --version is not supported
769  return 0
770}
771
772# Try to find a tool that satisfies all of the tests.
773# Usage: list:of:colon:separated:alternatives test1 test2 test3 test4...
774# Example: find_tool awk:gawk:nawk awk_tooltest1 awk_tooltest2
775find_tool ()
776{
777  default_TOOL=$1
778  echo find_tool: ${1+"$@"} >>$LOGFILE
779  cmds="`IFS=:; echo $1`"; shift; tooltests="${1+$@}"
780  if test -z "$tooltests"; then tooltests=version_test; fi
781  clist=; for cmd in $cmds; do clist="$clist `Which -a $cmd`"; done
782  # Make sure the default tool is just the first real command name
783  for default_TOOL in $clist `IFS=:; echo $default_TOOL`; do break; done
784  TOOL=""
785  for trytool in $clist ; do
786    pass=:
787    for tooltest in $tooltests; do
788      result=`eval $tooltest $trytool`
789      rc=$?
790      echo "Running $tooltest $trytool" >>$LOGFILE
791      if test -n "$result"; then
792	echo "$result" >>$LOGFILE
793      fi
794      if test "$rc" = "0"; then
795        echo "PASS: $tooltest $trytool" >>$LOGFILE
796      elif test "$rc" = "77"; then
797        echo "MARGINAL: $tooltest $trytool; rc=$rc" >>$LOGFILE
798        TOOL=$trytool
799	pass=false
800      else
801        set_bad_tool $trytool
802        echo "FAIL: $tooltest $trytool; rc=$rc" >>$LOGFILE
803	pass=false
804      fi
805    done
806    if $pass; then
807      echo $trytool
808      return 0
809    fi
810  done
811  if test -n "$TOOL"; then
812    echo "Notice: The default version of \`$default_TOOL' is defective." >>$LOGFILE
813    echo "using \`$TOOL' and hoping for the best." >>$LOGFILE
814    echo "Notice: The default version of \`$default_TOOL' is defective." >&2
815    echo "using \`$TOOL' and hoping for the best." >&2
816    echo $TOOL
817  else
818    echo $default_TOOL
819  fi
820}
821
822id_tool_test ()
823{
824  id=$1
825  if $id -u >/dev/null 2>&1 && $id -un >/dev/null 2>&1; then
826    return 0
827  else
828    echo "Running these tests requires an \`id' program that understands the"
829    echo "-u and -n flags.  Make sure that such an id (GNU, or many but not"
830    echo "all vendor-supplied versions) is in your path."
831    return 1
832  fi
833}
834
835ID=`find_tool id version_test id_tool_test`
836echo "Using ID=$ID" >>$LOGFILE
837
838# You can't run CVS as root; print a nice error message here instead
839# of somewhere later, after making a mess.
840for pass in false :; do
841  case "`$ID -u 2>/dev/null`" in
842    "0")
843      echo "Test suite does not work correctly when run as root" >&2
844      exit 1
845      ;;
846
847    *)
848      break
849      ;;
850  esac
851done
852
853# Cause NextStep 3.3 users to lose in a more graceful fashion.
854expr_tooltest1 ()
855{
856expr=$1
857if $expr 'abc
858def' : 'abc
859def' >/dev/null; then
860  # good, it works
861  return 0
862else
863  echo 'Running these tests requires an "expr" program that can handle'
864  echo 'multi-line patterns.  Make sure that such an expr (GNU, or many but'
865  echo 'not all vendor-supplied versions) is in your path.'
866  return 1
867fi
868}
869
870# Warn SunOS, SysVr3.2, etc., users that they may be partially losing
871# if we can't find a GNU expr to ease their troubles...
872expr_tooltest2 ()
873{
874expr=$1
875if $expr 'a
876b' : 'a
877c' >/dev/null; then
878  echo 'Warning: you are using a version of expr that does not correctly'
879  echo 'match multi-line patterns.  Some tests may spuriously pass or fail.'
880  echo 'You may wish to make sure GNU expr is in your path.'
881  return 1
882else
883  return 0
884fi
885}
886
887expr_create_bar ()
888{
889echo 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >${TESTDIR}/foo
890cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
891cat ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar >${TESTDIR}/foo
892cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
893rm -f ${TESTDIR}/foo
894}
895
896expr_tooltest3 ()
897{
898expr=$1
899# More SunOS lossage...
900test ! -f ${TESTDIR}/bar && expr_create_bar
901if $expr "`cat ${TESTDIR}/bar`" : "`cat ${TESTDIR}/bar`" >/dev/null; then
902  : good, it works
903else
904  echo 'Warning: you are using a version of expr that does not correctly'
905  echo 'match large patterns.  Some tests may spuriously pass or fail.'
906  echo 'You may wish to make sure GNU expr is in your path.'
907  return 1
908fi
909if $expr "`cat ${TESTDIR}/bar`x" : "`cat ${TESTDIR}/bar`y" >/dev/null; then
910  echo 'Warning: you are using a version of expr that does not correctly'
911  echo 'match large patterns.  Some tests may spuriously pass or fail.'
912  echo 'You may wish to make sure GNU expr is in your path.'
913  return 1
914fi
915# good, it works
916return 0
917}
918
919# That we should have to do this is total bogosity, but GNU expr
920# version 1.9.4-1.12 uses the emacs definition of "$" instead of the unix
921# (e.g. SunOS 4.1.3 expr) one.  Rumor has it this will be fixed in the
922# next release of GNU expr after 1.12 (but we still have to cater to the old
923# ones for some time because they are in many linux distributions).
924ENDANCHOR="$"
925expr_set_ENDANCHOR ()
926{
927expr=$1
928ENDANCHOR="$"
929if $expr 'abc
930def' : 'abc$' >/dev/null; then
931  ENDANCHOR='\'\'
932   echo "Notice: An ENDANCHOR of dollar does not work."
933   echo "Using a workaround for GNU expr versions 1.9.4 thru 1.12"
934fi
935return 0
936}
937
938# Work around another GNU expr (version 1.10-1.12) bug/incompatibility.
939# "." doesn't appear to match a newline (it does with SunOS 4.1.3 expr).
940# Note that the workaround is not a complete equivalent of .* because
941# the first parenthesized expression in the regexp must match something
942# in order for expr to return a successful exit status.
943# Rumor has it this will be fixed in the
944# next release of GNU expr after 1.12 (but we still have to cater to the old
945# ones for some time because they are in many linux distributions).
946DOTSTAR='.*'
947expr_set_DOTSTAR ()
948{
949expr=$1
950DOTSTAR='.*'
951if $expr 'abc
952def' : "a${DOTSTAR}f" >/dev/null; then
953  : good, it works
954else
955  DOTSTAR='\(.\|
956\)*'
957  echo "Notice: DOTSTAR changed from sane \`.*' value to \`$DOTSTAR\`"
958  echo "to workaround GNU expr version 1.10 thru 1.12 bug where \`.'"
959  echo "does not match a newline."
960fi
961return 0
962}
963
964# Now that we have DOTSTAR, make sure it works with big matches
965expr_tooltest_DOTSTAR ()
966{
967expr=$1
968test ! -f ${TESTDIR}/bar && expr_create_bar
969if $expr "`cat ${TESTDIR}/bar`" : "${DOTSTAR}xyzABC${DOTSTAR}$" >/dev/null; then
970  # good, it works
971  return 0
972else
973  echo 'Warning: you are using a version of expr that does not correctly'
974  echo 'match large patterns.  Some tests may spuriously pass or fail.'
975  echo 'You may wish to make sure GNU expr is in your path.'
976  return 77
977fi
978}
979
980EXPR=`find_tool ${EXPR}:gexpr \
981  version_test expr_tooltest1 expr_tooltest2 expr_tooltest3 \
982expr_set_ENDANCHOR expr_set_DOTSTAR expr_tooltest_DOTSTAR`
983
984# Set the ENDANCHOR and DOTSTAR for the chosen expr version.
985expr_set_ENDANCHOR ${EXPR} >/dev/null
986expr_tooltest_DOTSTAR ${EXPR} >/dev/null
987
988echo "Using EXPR=$EXPR" >>$LOGFILE
989echo "Using ENDANCHOR=$ENDANCHOR" >>$LOGFILE
990echo "Using DOTSTAR=$DOTSTAR" >>$LOGFILE
991
992# Cleanup
993rm -f ${TESTDIR}/bar
994
995# Work around yet another GNU expr (version 1.10) bug/incompatibility.
996# "+" is a special character, yet for unix expr (e.g. SunOS 4.1.3)
997# it is not.  I doubt that POSIX allows us to use \+ and assume it means
998# (non-special) +, so here is another workaround
999# Rumor has it this will be fixed in the
1000# next release of GNU expr after 1.12 (but we still have to cater to the old
1001# ones for some time because they are in many linux distributions).
1002PLUS='+'
1003if $EXPR 'a +b' : "a ${PLUS}b" >/dev/null; then
1004  : good, it works
1005else
1006  PLUS='\+'
1007fi
1008
1009# Likewise, for ?
1010QUESTION='?'
1011if $EXPR 'a?b' : "a${QUESTION}b" >/dev/null; then
1012  : good, it works
1013else
1014  QUESTION='\?'
1015fi
1016
1017# Now test the username to make sure it contains only valid characters
1018username=`$ID -un`
1019if $EXPR "${username}" : "${username}" >/dev/null; then
1020  : good, it works
1021else
1022  echo "Test suite does not work correctly when run by a username" >&2
1023  echo "containing regular expression meta-characters." >&2
1024  exit 1
1025fi
1026
1027# Only 8 characters of $username appear in some output.
1028if test `echo $username |wc -c` -gt 8; then
1029  username8=`echo $username |sed 's/^\(........\).*/\1/'`
1030else
1031  username8=$username
1032fi
1033
1034# Rarely, we need to match any username, not just the name of the user
1035# running this test.  This variable usually shouldn't be used.  $username
1036# contains the name of the user actually running this test.
1037#
1038# I believe this only ever actually gets compared to usernames created by this
1039# test.  It used to be compared to the username of the user running this test,
1040# but this hasn't been true for a long time.  Regardless, I tried to get the
1041# allowed character set right, based on a list in a private email from Mark
1042# Baushke, basically the allowed names from Linux systems (plus `.', which is
1043# only allowed on Gentoo Linux as of 2005-09-13).
1044anyusername="[_a-zA-Z0-9][-_.$a-zA-Z0-9]*"
1045
1046# now make sure that tr works on NULs
1047tr_tooltest1 ()
1048{
1049tr=$1
1050if $EXPR `echo "123" | $tr '2' '\0'` : "123" >/dev/null 2>&1; then
1051  echo 'Warning: you are using a version of tr which does not correctly'
1052  echo 'handle NUL bytes.  Some tests may spuriously pass or fail.'
1053  echo 'You may wish to make sure GNU tr is in your path.'
1054  return 77
1055fi
1056# good, it works
1057return 0
1058}
1059
1060TR=`find_tool ${TR}:gtr version_test tr_tooltest1`
1061echo "Using TR=$TR" >>$LOGFILE
1062
1063# MacOS X (10.2.8) has a /bin/ls that does not work correctly in that
1064# it will return true even if the wildcard argument does not match any
1065# files.
1066ls_tooltest ()
1067{
1068ls=$1
1069# Force cleanup
1070if test -d $TESTDIR/ls-test; then
1071    chmod -R a+wx $TESTDIR/ls-test
1072    rm -rf $TESTDIR/ls-test
1073fi
1074if $ls $TESTDIR/ls-test >/dev/null 2>&1; then
1075  echo "Notice: \`$ls' is defective."
1076  echo 'This is a version of ls which does not correctly'
1077  echo 'return false for files that do not exist. Some tests may'
1078  echo 'spuriously pass or fail.'
1079  echo 'You may wish to put a an ls from GNU coreutils into your path.'
1080  return 77
1081else
1082  return 0
1083fi
1084}
1085LS=`find_tool ls:gls version_test ls_tooltest`
1086echo "Using LS=$LS" >>$LOGFILE
1087
1088# Awk testing
1089
1090awk_tooltest1 ()
1091{
1092awk=$1
1093$awk 'BEGIN {printf("one\ntwo\nthree\nfour\nfive\nsix")}' </dev/null >abc
1094if $EXPR "`cat abc`" : \
1095'one
1096two
1097three
1098four
1099five
1100six'; then
1101  rm abc
1102  return 0
1103else
1104  rm abc
1105  echo "Notice: awk BEGIN clause or printf is not be working properly."
1106  return 1
1107fi
1108}
1109
1110# Format item %c check
1111awk_tooltest2 ()
1112{
1113awk=$1
1114$awk 'BEGIN { printf "%c%c%c", 2, 3, 4 }' </dev/null \
1115  | ${TR} '\002\003\004' '123' >abc
1116if $EXPR "`cat abc`" : "123" ; then
1117  : good, found it
1118else
1119  echo "Notice: awk format %c string may not be working properly."
1120  rm abc
1121  return 77
1122fi
1123rm abc
1124return 0
1125}
1126
1127AWK=`find_tool gawk:nawk:awk version_test awk_tooltest1 awk_tooltest2`
1128echo "Using AWK=$AWK" >>$LOGFILE
1129
1130
1131###
1132### Functions used by tests.
1133###
1134
1135# Execute a command on the repository, syncing when done if necessary.
1136#
1137# Syntax is as `eval'.
1138modify_repo ()
1139{
1140    eval "$*"
1141    if $proxy; then
1142	# And now resync the secondary.
1143	$TESTDIR/sync-secondary "repo modification" modify_repo ALL "$@"
1144    fi
1145}
1146
1147# Restore changes to CVSROOT admin files.
1148restore_adm ()
1149{
1150    modify_repo rm -rf $CVSROOT_DIRNAME/CVSROOT
1151    modify_repo cp -Rp $TESTDIR/CVSROOT.save $CVSROOT_DIRNAME/CVSROOT
1152}
1153
1154# Test that $RSYNC supports the options we need or try to find a
1155# replacement. If $RSYNC works or we replace it, and return 0.
1156# Otherwise, set $skipreason and return 77.
1157require_rsync ()
1158{
1159  rsyncworks=false
1160  # rsync is NOT a GNU tool, so do NOT use find_tool for name munging.
1161  for rsync in ${RSYNC} `Which -a rsync`;
1162  do
1163
1164    if is_bad_tool `Which $rsync` ; then continue ; fi
1165    # Make some data to test rsync on.
1166    mkdir $TESTDIR/rsync-test
1167    mkdir $TESTDIR/rsync-test/Attic && touch $TESTDIR/rsync-test/Attic/6
1168    mkdir $TESTDIR/rsync-test/otherdir && touch $TESTDIR/rsync-test/otherdir/7
1169    for file in 1 2 3 4 5; do
1170      touch $TESTDIR/rsync-test/$file
1171    done
1172
1173    if test -f "$rsync" && test -r "$rsync" \
1174      && $rsync -rglop --delete $TESTDIR/rsync-test/ $TESTDIR/rsync-test-copy \
1175  	      >/dev/null 2>&1 \
1176      && $rsync -rglop --delete --include Attic --exclude '*/' \
1177  	      $TESTDIR/rsync-test/ $TESTDIR/rsync-test-copy2 \
1178  	      >/dev/null 2>&1 \
1179      && test -f $TESTDIR/rsync-test/5 \
1180      && mv $TESTDIR/rsync-test/5 $TESTDIR/rsync-test/Attic/5 \
1181      && test -f $TESTDIR/rsync-test-copy/Attic/6 \
1182      && $rsync -rglop --delete $TESTDIR/rsync-test/ $TESTDIR/rsync-test-copy \
1183  	      >/dev/null 2>&1 \
1184      && $rsync -rglop --delete --include Attic --exclude '*/' \
1185  	      $TESTDIR/rsync-test/ $TESTDIR/rsync-test-copy2 \
1186  	      >/dev/null 2>&1 \
1187      && test ! -f $TESTDIR/rsync-test-copy/5 \
1188      && test ! -f $TESTDIR/rsync-test-copy2/5 \
1189      && test -f $TESTDIR/rsync-test-copy2/Attic/5 \
1190      && test ! -f $TESTDIR/rsync-test-copy2/otherdir/7
1191    then
1192      # good, it works
1193      rsyncworks=:
1194      RSYNC=$rsync
1195    else
1196      # Only use Which because of ${RSYNC} in the for loop.
1197      set_bad_tool `Which $rsync`
1198    fi
1199
1200    rm -rf $TESTDIR/rsync-test $TESTDIR/rsync-test-copy \
1201       $TESTDIR/rsync-test-copy2
1202
1203    if $rsyncworks; then
1204      return 0
1205    else
1206      (echo $rsync failed to work properly;\
1207       echo "$rsync --version"; $rsync --version) >>$LOGFILE 2>&1
1208    fi
1209  done
1210
1211  unset RSYNC
1212  skipreason="unusable or no rsync found"
1213  return 77
1214}
1215
1216# Test that $1 works as a remote shell.  If so, set $host, $CVS_RSH, &
1217# $save_CVS_RSH to match and return 0.  Otherwise, set $skipreason and return
1218# 77.
1219require_rsh ()
1220{
1221  host=${remotehost-"`hostname`"}
1222  result=`$1 $host 'echo test'`
1223  rc=$?
1224  if test $? != 0 || test "x$result" != "xtest"; then
1225    skipreason="\`$1 $host' failed rc=$rc result=$result"
1226    return 77
1227  fi
1228
1229  save_CVS_RSH=$CVS_RSH
1230  CVS_RSH=$1; export CVS_RSH
1231  return 0
1232}
1233
1234# Find a usable SSH.  When a usable ssh is found, set $host, $CVS_RSH, and
1235# $save_CVS_RSH and return 0.  Otherwise, set $skipreason and return 77.
1236require_ssh ()
1237{
1238  case "$CVS_RSH" in
1239    *ssh*|*putty*)
1240      tryssh=`Which $CVS_RSH`
1241      if [ ! -n "$tryssh" ]; then
1242	skipreason="Unable to find CVS_RSH=$CVS_RSH executable"
1243	return 77
1244      elif [ ! -x "$tryssh" ]; then
1245	skipreason="Unable to execute $tryssh program"
1246	return 77
1247      fi
1248      ;;
1249    *)
1250      # Look in the user's PATH for "ssh"
1251      tryssh=`Which ssh`
1252      if test ! -r "$tryssh"; then
1253	skipreason="Unable to find ssh program"
1254	return 77
1255      fi
1256      ;;
1257  esac
1258
1259  require_rsh "$tryssh"
1260  return $?
1261}
1262
1263pass ()
1264{
1265  echo "PASS: $1" >>${LOGFILE}
1266  passed=`expr $passed + 1`
1267}
1268
1269# Like skip(), but don't fail when $skipfail is set.
1270skip_always ()
1271{
1272  echo "SKIP: $1${2+ ($2)}" >>$LOGFILE
1273  skipped=`expr $skipped + 1`
1274}
1275
1276skip ()
1277{
1278  if $skipfail; then
1279    # exits
1280    fail "$1${2+ ($2)}"
1281  fi
1282
1283  skip_always ${1+"$@"}
1284}
1285
1286# Convenience function for skipping tests run only in remote mode.
1287remoteonly ()
1288{
1289  skip_always $1 "only tested in remote mode"
1290}
1291
1292# Convenience function for skipping tests not run in proxy mode.
1293notproxy ()
1294{
1295  skip_always $1 "not tested in proxy mode"
1296}
1297
1298# Convenience function for skipping tests not run in proxy mode.
1299notnoredirect ()
1300{
1301  skip_always $1 "not tested in proxy-noredirect mode"
1302}
1303
1304warn ()
1305{
1306  if $skipfail; then
1307    fail "$1${2+ ($2)}"
1308  else
1309    echo "WARNING: $1${2+ ($2)}" >>$LOGFILE
1310  fi
1311  warnings=`expr $warnings + 1`
1312}
1313
1314fail ()
1315{
1316  echo "FAIL: $1" | tee -a ${LOGFILE}
1317  echo "*** Please see the \`TESTS' and \`check.log' files for more information." >&2
1318  # This way the tester can go and see what remnants were left
1319  exit 1
1320}
1321
1322verify_tmp_empty ()
1323{
1324  # Test our temp directory for cvs-serv* directories and cvsXXXXXX temp
1325  # files.  We would like to not leave any behind.
1326  if $remote && $LS $TMPDIR/cvs-serv* >/dev/null 2>&1; then
1327    # A true value means ls found files/directories with these names.
1328    # Give the server some time to finish, then retry.
1329    sleep 1
1330    if $LS $TMPDIR/cvs-serv* >/dev/null 2>&1; then
1331      warn "$1" "Found cvs-serv* directories in $TMPDIR."
1332      # The above will exit if $skipfail
1333      rm -rf $TMPDIR/cvs-serv*
1334    fi
1335  fi
1336  if $LS $TMPDIR/cvs?????? >/dev/null 2>&1; then
1337    # A true value means ls found files/directories with these names.
1338    warn "$1" "Found cvsXXXXXX temp files in $TMPDIR."
1339    # The above will exit if $skipfail
1340    rm -f ls $TMPDIR/cvs??????
1341  fi
1342}
1343
1344# See dotest and dotest_fail for explanation (this is the parts
1345# of the implementation common to the two).
1346dotest_internal ()
1347{
1348  if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$3${ENDANCHOR}" >/dev/null; then
1349    # Why, I hear you ask, do we write this to the logfile
1350    # even when the test passes?  The reason is that the test
1351    # may give us the regexp which we were supposed to match,
1352    # but sometimes it may be useful to look at the exact
1353    # text which was output.  For example, suppose one wants
1354    # to grep for a particular warning, and make _sure_ that
1355    # CVS never hits it (even in cases where the tests might
1356    # match it with .*).  Or suppose one wants to see the exact
1357    # date format output in a certain case (where the test will
1358    # surely use a somewhat non-specific pattern).
1359    cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1360    pass "$1"
1361    verify_tmp_empty "$1"
1362  # expr can't distinguish between "zero characters matched" and "no match",
1363  # so special-case it.
1364  elif test -z "$3" && test ! -s ${TESTDIR}/dotest.tmp; then
1365    pass "$1"
1366    verify_tmp_empty "$1"
1367  elif test x"$4" != x; then
1368    if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$4${ENDANCHOR}" >/dev/null; then
1369      cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1370      pass "$1"
1371      verify_tmp_empty "$1"
1372    else
1373      echo "** expected: " >>${LOGFILE}
1374      echo "$3" >>${LOGFILE}
1375      echo "$3" > ${TESTDIR}/dotest.ex1
1376      echo "** or: " >>${LOGFILE}
1377      echo "$4" >>${LOGFILE}
1378      echo "$4" > ${TESTDIR}/dotest.ex2
1379      echo "** got: " >>${LOGFILE}
1380      cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1381      fail "$1"
1382    fi
1383  else
1384    echo "** expected: " >>${LOGFILE}
1385    echo "$3" >>${LOGFILE}
1386    echo "$3" > ${TESTDIR}/dotest.exp
1387    echo "** got: " >>${LOGFILE}
1388    cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1389    fail "$1"
1390  fi
1391}
1392
1393dotest_all_in_one ()
1394{
1395  if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : \
1396         "`cat ${TESTDIR}/dotest.exp`" >/dev/null; then
1397    return 0
1398  fi
1399  return 1
1400}
1401
1402# WARNING: this won't work with REs that match newlines....
1403#
1404dotest_line_by_line ()
1405{
1406  line=1
1407  while [ $line -le `wc -l <${TESTDIR}/dotest.tmp` ] ; do
1408    if $EXPR "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" : \
1409       "`sed -n ${line}p ${TESTDIR}/dotest.exp`" >/dev/null; then
1410      :
1411    elif test -z "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" &&
1412       test -z "`sed -n ${line}p ${TESTDIR}/dotest.exp`"; then
1413      :
1414    else
1415      echo "Line $line:" >> ${LOGFILE}
1416      echo "**** expected: " >>${LOGFILE}
1417      sed -n ${line}p ${TESTDIR}/dotest.exp >>${LOGFILE}
1418      echo "**** got: " >>${LOGFILE}
1419      sed -n ${line}p ${TESTDIR}/dotest.tmp >>${LOGFILE}
1420      unset line
1421      return 1
1422    fi
1423    line=`expr $line + 1`
1424  done
1425  unset line
1426  return 0
1427}
1428
1429# If you are having trouble telling which line of a multi-line
1430# expression is not being matched, replace calls to dotest_internal()
1431# with calls to this function:
1432#
1433dotest_internal_debug ()
1434{
1435  if test -z "$3"; then
1436    if test -s ${TESTDIR}/dotest.tmp; then
1437      echo "** expected: " >>${LOGFILE}
1438      echo "$3" >>${LOGFILE}
1439      echo "$3" > ${TESTDIR}/dotest.exp
1440      rm -f ${TESTDIR}/dotest.ex2
1441      echo "** got: " >>${LOGFILE}
1442      cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1443      fail "$1"
1444    else
1445      pass "$1"
1446      verify_tmp_empty "$1"
1447    fi
1448  else
1449    echo "$3" > ${TESTDIR}/dotest.exp
1450    if dotest_line_by_line "$1" "$2"; then
1451      pass "$1"
1452      verify_tmp_empty "$1"
1453    else
1454      if test x"$4" != x; then
1455	mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex1
1456	echo "$4" > ${TESTDIR}/dotest.exp
1457	if dotest_line_by_line "$1" "$2"; then
1458	  pass "$1"
1459	  verify_tmp_empty "$1"
1460	else
1461	  mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex2
1462	  echo "** expected: " >>${LOGFILE}
1463	  echo "$3" >>${LOGFILE}
1464	  echo "** or: " >>${LOGFILE}
1465	  echo "$4" >>${LOGFILE}
1466	  echo "** got: " >>${LOGFILE}
1467	  cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1468	  fail "$1"
1469	fi
1470      else
1471	echo "** expected: " >>${LOGFILE}
1472	echo "$3" >>${LOGFILE}
1473	echo "** got: " >>${LOGFILE}
1474	cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
1475	fail "$1"
1476      fi
1477    fi
1478  fi
1479}
1480
1481# This function allows the test output to be filtered before being verified.
1482# The dotest_* functions all call this function, which runs the command
1483# in the env var $TEST_FILTER on its argument if $TEST_FILTER is set.  If
1484# $TEST_FILTER is not set, this function does nothing.
1485#
1486# I found this primarily useful when running the test suite on a CVS
1487# executable linked with memory and function profilers which can generate
1488# spurious output.
1489run_filter ()
1490{
1491  if test -n "$TEST_FILTER"; then
1492    # Make sure there is an EOL
1493    echo >>$1
1494    sed '${/^$/d}' <$1 >$1.filter1
1495    # Run the filter
1496    eval "$TEST_FILTER" <$1.filter1 >$1.filter2
1497    diff -u $1 $1.filter2 \
1498	    >$1.diff
1499    mv $1.filter2 $1
1500    rm $1.filter1
1501  fi
1502}
1503
1504maybe_sleep_if_ci_co_or_up ()
1505{
1506  if $waitforslowdisk; then
1507    case "$@" in
1508    *" ci "*|*" ci"|*" commit "*|*" commit") sleep 1;;
1509    *" co "*|*" co"|*" checkout "*|*" checkout") sleep 1;;
1510    *" up "*|*" up"|*" update "*|*" update") sleep 1;;
1511    esac
1512  fi
1513}
1514
1515# Usage:
1516#  dotest TESTNAME COMMAND OUTPUT [OUTPUT2]
1517# TESTNAME is the name used in the log to identify the test.
1518# COMMAND is the command to run; for the test to pass, it exits with
1519# exitstatus zero.
1520# OUTPUT is a regexp which is compared against the output (stdout and
1521# stderr combined) from the test.  It is anchored to the start and end
1522# of the output, so should start or end with ".*" if that is what is desired.
1523# Trailing newlines are stripped from the command's actual output before
1524# matching against OUTPUT.
1525# If OUTPUT2 is specified and the output matches it, then it is also
1526# a pass (partial workaround for the fact that some versions of expr
1527# lack \|).
1528dotest ()
1529{
1530  maybe_sleep_if_ci_co_or_up "$2"
1531  rm -f $TESTDIR/dotest.ex? 2>&1
1532  eval "$2" >$TESTDIR/dotest.tmp 2>&1
1533  status=$?
1534  run_filter $TESTDIR/dotest.tmp
1535  if test "$status" != 0; then
1536    cat $TESTDIR/dotest.tmp >>$LOGFILE
1537    echo "exit status was $status" >>${LOGFILE}
1538    fail "$1"
1539  fi
1540  maybe_sleep_if_ci_co_or_up "$2"
1541  dotest_internal "$@"
1542}
1543
1544# Like dotest except only 2 args and result must exactly match stdin
1545dotest_lit ()
1546{
1547  maybe_sleep_if_ci_co_or_up "$2"
1548  rm -f $TESTDIR/dotest.ex? 2>&1
1549  eval "$2" >$TESTDIR/dotest.tmp 2>&1
1550  status=$?
1551  run_filter $TESTDIR/dotest.tmp
1552  if test "$status" != 0; then
1553    cat $TESTDIR/dotest.tmp >>$LOGFILE
1554    echo "exit status was $status" >>$LOGFILE
1555    fail "$1"
1556  fi
1557  maybe_sleep_if_ci_co_or_up "$2"
1558  cat >$TESTDIR/dotest.exp
1559  if cmp $TESTDIR/dotest.exp $TESTDIR/dotest.tmp >/dev/null 2>&1; then
1560    pass "$1"
1561    verify_tmp_empty "$1"
1562  else
1563    echo "** expected: " >>$LOGFILE
1564    cat $TESTDIR/dotest.exp >>$LOGFILE
1565    echo "** got: " >>$LOGFILE
1566    cat $TESTDIR/dotest.tmp >>$LOGFILE
1567    fail "$1"
1568  fi
1569}
1570
1571# Like dotest except exitstatus should be nonzero.
1572dotest_fail ()
1573{
1574  maybe_sleep_if_ci_co_or_up "$2"
1575  rm -f $TESTDIR/dotest.ex? 2>&1
1576  eval "$2" >$TESTDIR/dotest.tmp 2>&1
1577  status=$?
1578  run_filter $TESTDIR/dotest.tmp
1579  if test "$status" = 0; then
1580    cat $TESTDIR/dotest.tmp >>$LOGFILE
1581    echo "exit status was $status" >>$LOGFILE
1582    fail "$1"
1583  fi
1584  maybe_sleep_if_ci_co_or_up "$2"
1585  dotest_internal "$@"
1586}
1587
1588# Like dotest except output is sorted.
1589dotest_sort ()
1590{
1591  maybe_sleep_if_ci_co_or_up "$2"
1592  rm -f $TESTDIR/dotest.ex? 2>&1
1593  eval "$2" >$TESTDIR/dotest.tmp1 2>&1
1594  status=$?
1595  run_filter $TESTDIR/dotest.tmp1
1596  if test "$status" != 0; then
1597    cat $TESTDIR/dotest.tmp1 >>$LOGFILE
1598    echo "exit status was $status" >>$LOGFILE
1599    fail "$1"
1600  fi
1601  $TR '	' ' ' < $TESTDIR/dotest.tmp1 | sort > $TESTDIR/dotest.tmp
1602  maybe_sleep_if_ci_co_or_up "$2"
1603  dotest_internal "$@"
1604}
1605
1606# Like dotest_fail except output is sorted.
1607dotest_fail_sort ()
1608{
1609  maybe_sleep_if_ci_co_or_up "$2"
1610  rm -f $TESTDIR/dotest.ex? 2>&1
1611  eval "$2" >$TESTDIR/dotest.tmp1 2>&1
1612  status=$?
1613  run_filter $TESTDIR/dotest.tmp1
1614  if test "$status" = 0; then
1615    cat $TESTDIR/dotest.tmp1 >>$LOGFILE
1616    echo "exit status was $status" >>$LOGFILE
1617    fail "$1"
1618  fi
1619  $TR '	' ' ' < $TESTDIR/dotest.tmp1 | sort > $TESTDIR/dotest.tmp
1620  maybe_sleep_if_ci_co_or_up "$2"
1621  dotest_internal "$@"
1622}
1623
1624# A function for fetching the timestamp of a revison of a file
1625getrlogdate () {
1626    ${testcvs} -n rlog -N ${1+"$@"} |
1627    while read token value; do
1628	case "$token" in
1629	date:)
1630	    echo $value | sed "s,;.*,,"
1631	    break;
1632            ;;
1633	esac
1634    done
1635}
1636
1637# Avoid picking up any stray .cvsrc, etc., from the user running the tests
1638mkdir home
1639HOME=$TESTDIR/home; export HOME
1640
1641# Make sure this variable is not defined to anything that would
1642# change the format of rcs dates.  Otherwise people using e.g.,
1643# RCSINIT=-zLT get lots of spurious failures.
1644RCSINIT=; export RCSINIT
1645
1646# Remaining arguments are the names of tests to run.
1647#
1648# The testsuite is broken up into (hopefully manageably-sized)
1649# independently runnable tests, so that one can quickly get a result
1650# from a cvs or testsuite change, and to facilitate understanding the
1651# tests.
1652
1653if test x"$*" = x; then
1654	# Basic/miscellaneous functionality
1655	tests="version basica basicb basicc basic1 deep basic2 ls"
1656	tests="$tests parseroot parseroot2 parseroot3 files spacefiles"
1657	tests="${tests} commit-readonly commit-add-missing"
1658	tests="${tests} status"
1659	# Branching, tagging, removing, adding, multiple directories
1660	tests="${tests} rdiff rdiff-short"
1661	tests="${tests} rdiff2 diff diffnl death death2"
1662	tests="${tests} rm-update-message rmadd rmadd2 rmadd3 resurrection"
1663	tests="${tests} dirs dirs2 branches branches2 branches3"
1664	tests="${tests} branches4 tagc tagf tag-space"
1665	tests="${tests} rcslib multibranch import importb importc importX"
1666	tests="$tests importX2 import-CVS import-quirks"
1667	tests="${tests} update-p import-after-initial branch-after-import"
1668	tests="${tests} join join2 join3 join4 join5 join6 join7"
1669	tests="${tests} join-readonly-conflict join-admin join-admin-2"
1670	tests="${tests} join-rm"
1671	tests="${tests} new newb conflicts conflicts2 conflicts3"
1672	tests="${tests} clean"
1673	tests="${tests} keywordexpand"
1674	# Checking out various places (modules, checkout -d, &c)
1675	tests="${tests} modules modules2 modules3 modules4 modules5 modules6"
1676	tests="${tests} modules7 mkmodules co-d"
1677	tests="${tests} cvsadm emptydir abspath abspath2 toplevel toplevel2"
1678        tests="${tests} rstar-toplevel trailingslashes checkout_repository"
1679	# Log messages, error messages.
1680	tests="${tests} mflag editor env errmsg1 errmsg2 adderrmsg opterrmsg"
1681	tests="${tests} errmsg3"
1682	tests="${tests} close-stdout"
1683	tests="$tests debug-log-nonfatal"
1684	# Watches, binary files, history browsing, &c.
1685	tests="${tests} devcom devcom2 devcom3 watch4 watch5 watch6-0 watch6"
1686        tests="${tests} edit-check"
1687	tests="${tests} unedit-without-baserev"
1688	tests="${tests} ignore ignore-on-branch binfiles binfiles2 binfiles3"
1689	tests="${tests} mcopy binwrap binwrap2"
1690	tests="${tests} binwrap3 mwrap info taginfo posttag"
1691	tests="$tests config config2 config3 config4"
1692	tests="${tests} serverpatch log log2 logopt ann ann-id"
1693	# Repository Storage (RCS file format, CVS lock files, creating
1694	# a repository without "cvs init", &c).
1695	tests="${tests} crerepos rcs rcs2 rcs3 rcs4 rcs5"
1696	tests="$tests lockfiles backuprecover"
1697	tests="${tests} sshstdio"
1698	# More history browsing, &c.
1699	tests="${tests} history"
1700	tests="${tests} big modes modes2 modes3 stamps"
1701	# PreservePermissions stuff: permissions, symlinks et al.
1702	# tests="${tests} perms symlinks symlinks2 hardlinks"
1703	# More tag and branch tests, keywords.
1704	tests="${tests} sticky keyword keywordlog keywordname keyword2"
1705	tests="${tests} head tagdate multibranch2 tag8k"
1706	# "cvs admin", reserved checkouts.
1707	tests="${tests} admin reserved"
1708	# Nuts and bolts of diffing/merging (diff library, &c)
1709	tests="${tests} diffmerge1 diffmerge2"
1710	# Release of multiple directories
1711	tests="${tests} release"
1712	tests="${tests} recase"
1713	# Multiple root directories and low-level protocol tests.
1714	tests="${tests} multiroot multiroot2 multiroot3 multiroot4"
1715	tests="${tests} rmroot reposmv pserver server server2 client"
1716	tests="${tests} dottedroot fork commit-d template"
1717	tests="${tests} writeproxy writeproxy-noredirect writeproxy-ssh"
1718	tests="${tests} writeproxy-ssh-noredirect"
1719else
1720	tests="$*"
1721fi
1722
1723# Now check the -f argument for validity.
1724if test -n "$fromtest"; then
1725	# Don't allow spaces - they are our delimiters in tests
1726	count=0
1727	for sub in $fromtest; do
1728	  count=`expr $count + 1`
1729	done
1730	if test $count != 1; then
1731		echo "No such test \`$fromtest'." >&2
1732		exit 2
1733	fi
1734	# make sure it is in $tests
1735	case " $tests " in
1736		*" $fromtest "*)
1737			;;
1738		*)
1739			echo "No such test \`$fromtest'." >&2
1740			exit 2
1741			;;
1742	esac
1743fi
1744
1745
1746
1747# a simple function to compare directory contents
1748#
1749# Returns: 0 for same, 1 for different
1750#
1751directory_cmp ()
1752{
1753	OLDPWD=`pwd`
1754	DIR_1=$1
1755	DIR_2=$2
1756
1757	cd $DIR_1
1758	find . -print | fgrep -v /CVS | sort > $TESTDIR/dc$$d1
1759
1760	# go back where we were to avoid symlink hell...
1761	cd $OLDPWD
1762	cd $DIR_2
1763	find . -print | fgrep -v /CVS | sort > $TESTDIR/dc$$d2
1764
1765	if diff $TESTDIR/dc$$d1 $TESTDIR/dc$$d2 >/dev/null 2>&1
1766	then
1767		:
1768	else
1769		return 1
1770	fi
1771	cd $OLDPWD
1772	while read a
1773	do
1774		if test -f $DIR_1/"$a" ; then
1775			cmp -s $DIR_1/"$a" $DIR_2/"$a"
1776			if test $? -ne 0 ; then
1777				return 1
1778			fi
1779		fi
1780	done < $TESTDIR/dc$$d1
1781	rm -f $TESTDIR/dc$$*
1782	return 0
1783}
1784
1785
1786
1787#
1788# The following 4 functions are used by the diffmerge1 test case.  They set up,
1789# respectively, the four versions of the files necessary:
1790#
1791#	1.  Ancestor revisions.
1792#	2.  "Your" changes.
1793#	3.  "My" changes.
1794#	4.  Expected merge result.
1795#
1796
1797# Create ancestor revisions for diffmerge1
1798diffmerge_create_older_files() {
1799	  # This test case was supplied by Noah Friedman:
1800	  cat >testcase01 <<EOF
1801// Button.java
1802
1803package random.application;
1804
1805import random.util.*;
1806
1807public class Button
1808{
1809  /* Instantiates a Button with origin (0, 0) and zero width and height.
1810   * You must call an initializer method to properly initialize the Button.
1811   */
1812  public Button ()
1813  {
1814    super ();
1815
1816    _titleColor = Color.black;
1817    _disabledTitleColor = Color.gray;
1818    _titleFont = Font.defaultFont ();
1819  }
1820
1821  /* Convenience constructor for instantiating a Button with
1822   * bounds x, y, width, and height.  Equivalent to
1823   *     foo = new Button ();
1824   *     foo.init (x, y, width, height);
1825   */
1826  public Button (int x, int y, int width, int height)
1827  {
1828    this ();
1829    init (x, y, width, height);
1830  }
1831}
1832EOF
1833
1834	  # This test case was supplied by Jacob Burckhardt:
1835	  cat >testcase02 <<EOF
1836a
1837a
1838a
1839a
1840a
1841EOF
1842
1843	  # This test case was supplied by Karl Tomlinson who also wrote the
1844	  # patch which lets CVS correctly handle this and several other cases:
1845	  cat >testcase03 <<EOF
1846x
1847s
1848a
1849b
1850s
1851y
1852EOF
1853
1854	  # This test case was supplied by Karl Tomlinson:
1855	  cat >testcase04 <<EOF
1856s
1857x
1858m
1859m
1860x
1861s
1862v
1863s
1864x
1865m
1866m
1867x
1868s
1869EOF
1870
1871	  # This test case was supplied by Karl Tomlinson:
1872	  cat >testcase05 <<EOF
1873s
1874x
1875m
1876m
1877x
1878x
1879x
1880x
1881x
1882x
1883x
1884x
1885x
1886x
1887s
1888s
1889s
1890s
1891s
1892s
1893s
1894s
1895s
1896s
1897v
1898EOF
1899
1900	  # This test case was supplied by Jacob Burckhardt:
1901	  cat >testcase06 <<EOF
1902g
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914i
1915EOF
1916
1917	  # This test is supposed to verify that the horizon lines are the same
1918	  # for both 2-way diffs, but unfortunately, it does not fail with the
1919	  # old version of cvs.  However, Karl Tomlinson still thought it would
1920	  # be good to test it anyway:
1921	  cat >testcase07 <<EOF
1922h
1923f
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933g
1934r
1935
1936
1937
1938i
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949i
1950EOF
1951
1952	  # This test case was supplied by Jacob Burckhardt:
1953	  cat >testcase08 <<EOF
1954Both changes move this line to the end of the file.
1955
1956no
1957changes
1958here
1959
1960First change will delete this line.
1961
1962First change will also delete this line.
1963
1964    no
1965    changes
1966    here
1967
1968Second change will change it here.
1969
1970        no
1971        changes
1972        here
1973EOF
1974
1975	  # This test case was supplied by Jacob Burckhardt.  Note that I do not
1976	  # think cvs has ever failed with this case, but I include it anyway,
1977	  # since I think it is a hard case.  It is hard because Peter Miller's
1978	  # fmerge utility fails on it:
1979	  cat >testcase09 <<EOF
1980m
1981a
1982{
1983}
1984b
1985{
1986}
1987EOF
1988
1989	  # This test case was supplied by Martin Dorey and simplified by Jacob
1990	  # Burckhardt:
1991	  cat >testcase10 <<EOF
1992
1993    petRpY ( MtatRk );
1994    fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
1995
1996    MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
1997    OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
1998
1999    Bloke_GttpfIRte_MtpeaL ( &acI );
2000MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
2001{
2002    fV ( Y < 16 )
2003    {
2004        petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
2005                                                      Y * jfle_Uecopd_MfJe_fY_Mectopk,
2006                                jfle_Uecopd_MfJe_fY_Mectopk,
2007                                nRVVep ) );
2008    }
2009    elke
2010    {
2011        petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
2012                                                 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
2013                                jfle_Uecopd_MfJe_fY_Mectopk,
2014                                nRVVep ) );
2015    }
2016
2017}
2018
2019
2020/****************************************************************************
2021*                                                                           *
2022*   Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY )                      *
2023*                                                                           *
2024****************************************************************************/
2025
2026MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
2027{
2028MTGTXM MtatRk = Zy;
2029
2030    MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
2031
2032    petRpY ( MtatRk );
2033
2034}
2035    HfkQipfte ( waYdle,                 /*  waYdle                         */
2036                waYdleFok,              /*  ZVVket VpoL ktapt oV dfkQ      */
2037                (coYkt RfYt8*) nRVVep,  /*  nRVVep                         */
2038                0,                      /*  MRrepVlRoRk KfxoYfkL           */
2039                beYgtz                  /*  nEtek to Apfte                 */
2040              );
2041
2042    petRpY ( Zy );
2043}
2044EOF
2045}
2046
2047# Create "your" revisions for diffmerge1
2048diffmerge_create_your_files() {
2049	  # remove the Button() method
2050	  cat >testcase01 <<\EOF
2051// Button.java
2052
2053package random.application;
2054
2055import random.util.*;
2056
2057public class Button
2058{
2059  /* Instantiates a Button with origin (0, 0) and zero width and height.
2060   * You must call an initializer method to properly initialize the Button.
2061   */
2062  public Button ()
2063  {
2064    super ();
2065
2066    _titleColor = Color.black;
2067    _disabledTitleColor = Color.gray;
2068    _titleFont = Font.defaultFont ();
2069  }
2070}
2071EOF
2072
2073	  cat >testcase02 <<\EOF
2074y
2075a
2076a
2077a
2078a
2079EOF
2080
2081	  cat >testcase03 <<\EOF
2082x
2083s
2084a
2085b
2086s
2087b
2088s
2089y
2090EOF
2091
2092	  cat >testcase04 <<\EOF
2093s
2094m
2095s
2096v
2097s
2098m
2099s
2100EOF
2101
2102	  cat >testcase05 <<\EOF
2103v
2104s
2105m
2106s
2107s
2108s
2109s
2110s
2111s
2112s
2113s
2114s
2115s
2116v
2117EOF
2118
2119	  # Test case 6 and test case 7 both use the same input files, but they
2120	  # order the input files differently.  In one case, a certain file is
2121	  # used as the older file, but in the other test case, that same file
2122	  # is used as the file which has changes.  I could have put echo
2123	  # commands here, but since the echo lines would be the same as those
2124	  # in the previous function, I decided to save space and avoid repeating
2125	  # several lines of code.  Instead, I merely swap the files:
2126	  mv testcase07 tmp
2127	  mv testcase06 testcase07
2128	  mv tmp testcase06
2129
2130	  # Make the date newer so that cvs thinks that the files are changed:
2131	  touch testcase06 testcase07
2132
2133	  cat >testcase08 <<\EOF
2134no
2135changes
2136here
2137
2138First change has now added this in.
2139
2140    no
2141    changes
2142    here
2143
2144Second change will change it here.
2145
2146        no
2147        changes
2148        here
2149
2150Both changes move this line to the end of the file.
2151EOF
2152
2153	  cat >testcase09 <<\EOF
2154
2155m
2156a
2157{
2158}
2159b
2160{
2161}
2162c
2163{
2164}
2165EOF
2166
2167	  cat >testcase10 <<\EOF
2168
2169    fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
2170
2171    petRpY ( MtatRk );
2172    fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
2173
2174    fV ( jfle_Uecopd_KRLIep < 16 )
2175    {
2176        MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
2177    }
2178    elke
2179    {
2180        MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
2181        fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
2182
2183        MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
2184        OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
2185
2186    Bloke_GttpfIRte_MtpeaL ( &acI );
2187MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
2188{
2189MTGTXM MtatRk = Zy;
2190
2191    fV ( Y < 16 )
2192    {
2193        petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
2194                                                      Y * jfle_Uecopd_MfJe_fY_Mectopk,
2195                                jfle_Uecopd_MfJe_fY_Mectopk,
2196                                nRVVep ) );
2197    }
2198    elke
2199    {
2200        petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
2201                                                 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
2202                                jfle_Uecopd_MfJe_fY_Mectopk,
2203                                nRVVep ) );
2204    }
2205
2206    petRpY ( MtatRk );
2207
2208}
2209
2210
2211/****************************************************************************
2212*                                                                           *
2213*   Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY )                      *
2214*                                                                           *
2215****************************************************************************/
2216
2217MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
2218{
2219MTGTXM MtatRk = Zy;
2220
2221    MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
2222
2223    petRpY ( MtatRk );
2224
2225}
2226    HfkQipfte ( waYdle,                 /*  waYdle                         */
2227                waYdleFok,              /*  ZVVket VpoL ktapt oV dfkQ      */
2228                (coYkt RfYt8*) nRVVep,  /*  nRVVep                         */
2229                0,                      /*  MRrepVlRoRk KfxoYfkL           */
2230                beYgtz                  /*  nEtek to Apfte                 */
2231              );
2232
2233    petRpY ( Zy );
2234}
2235
2236EOF
2237}
2238
2239# Create "my" revisions for diffmerge1
2240diffmerge_create_my_files() {
2241          # My working copy still has the Button() method, but I
2242	  # comment out some code at the top of the class.
2243	  cat >testcase01 <<\EOF
2244// Button.java
2245
2246package random.application;
2247
2248import random.util.*;
2249
2250public class Button
2251{
2252  /* Instantiates a Button with origin (0, 0) and zero width and height.
2253   * You must call an initializer method to properly initialize the Button.
2254   */
2255  public Button ()
2256  {
2257    super ();
2258
2259    // _titleColor = Color.black;
2260    // _disabledTitleColor = Color.gray;
2261    // _titleFont = Font.defaultFont ();
2262  }
2263
2264  /* Convenience constructor for instantiating a Button with
2265   * bounds x, y, width, and height.  Equivalent to
2266   *     foo = new Button ();
2267   *     foo.init (x, y, width, height);
2268   */
2269  public Button (int x, int y, int width, int height)
2270  {
2271    this ();
2272    init (x, y, width, height);
2273  }
2274}
2275EOF
2276
2277	  cat >testcase02 <<\EOF
2278a
2279a
2280a
2281a
2282m
2283EOF
2284
2285	  cat >testcase03 <<\EOF
2286x
2287s
2288c
2289s
2290b
2291s
2292y
2293EOF
2294
2295	  cat >testcase04 <<\EOF
2296v
2297s
2298x
2299m
2300m
2301x
2302s
2303v
2304s
2305x
2306m
2307m
2308x
2309s
2310v
2311EOF
2312
2313	  # Note that in test case 5, there are no changes in the "mine"
2314	  # section, which explains why there is no command here which writes to
2315	  # file testcase05.
2316
2317	  # no changes for testcase06
2318
2319	  # The two branches make the same changes:
2320	  cp ../yours/testcase07 .
2321
2322	  cat >testcase08 <<\EOF
2323no
2324changes
2325here
2326
2327First change will delete this line.
2328
2329First change will also delete this line.
2330
2331    no
2332    changes
2333    here
2334
2335Second change has now changed it here.
2336
2337        no
2338        changes
2339        here
2340
2341Both changes move this line to the end of the file.
2342EOF
2343
2344	  cat >testcase09 <<\EOF
2345m
2346a
2347{
2348}
2349b
2350{
2351}
2352c
2353{
2354}
2355EOF
2356
2357	  cat >testcase10 <<\EOF
2358
2359    petRpY ( MtatRk );
2360    fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
2361
2362    MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
2363    OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
2364
2365    Bloke_GttpfIRte_MtpeaL ( &acI );
2366MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
2367{
2368    fV ( Y < 16 )
2369    {
2370        petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
2371                                                      Y * jfle_Uecopd_MfJe_fY_Mectopk,
2372                                jfle_Uecopd_MfJe_fY_Mectopk,
2373                                nRVVep ) );
2374    }
2375    elke
2376    {
2377        petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
2378                                                 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
2379                                jfle_Uecopd_MfJe_fY_Mectopk,
2380                                nRVVep ) );
2381    }
2382
2383}
2384
2385
2386/****************************************************************************
2387*                                                                           *
2388*   Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY )                      *
2389*                                                                           *
2390****************************************************************************/
2391
2392MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
2393{
2394MTGTXM MtatRk = Zy;
2395
2396    MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
2397
2398    petRpY ( MtatRk );
2399
2400}
2401    HfkQipfte ( waYdle,                 /*  waYdle                         */
2402                waYdleFok,              /*  ZVVket VpoL ktapt oV dfkQ      */
2403                (coYkt RfYt8*) nRVVep,  /*  nRVVep                         */
2404                beYgtz                  /*  nEtek to Apfte                 */
2405              );
2406
2407    petRpY ( Zy );
2408}
2409
2410EOF
2411}
2412
2413# Create expected results of merge for diffmerge1
2414diffmerge_create_expected_files() {
2415	  cat >testcase01 <<\EOF
2416// Button.java
2417
2418package random.application;
2419
2420import random.util.*;
2421
2422public class Button
2423{
2424  /* Instantiates a Button with origin (0, 0) and zero width and height.
2425   * You must call an initializer method to properly initialize the Button.
2426   */
2427  public Button ()
2428  {
2429    super ();
2430
2431    // _titleColor = Color.black;
2432    // _disabledTitleColor = Color.gray;
2433    // _titleFont = Font.defaultFont ();
2434  }
2435}
2436EOF
2437
2438	  cat >testcase02 <<\EOF
2439y
2440a
2441a
2442a
2443m
2444EOF
2445
2446	  cat >testcase03 <<\EOF
2447x
2448s
2449c
2450s
2451b
2452s
2453b
2454s
2455y
2456EOF
2457
2458	  cat >testcase04 <<\EOF
2459v
2460s
2461m
2462s
2463v
2464s
2465m
2466s
2467v
2468EOF
2469
2470	  # Since there are no changes in the "mine" section, just take exactly
2471	  # the version in the "yours" section:
2472	  cp ../yours/testcase05 .
2473
2474	  cp ../yours/testcase06 .
2475
2476	  # Since the two branches make the same changes, the result should be
2477	  # the same as both branches.  Here, I happen to pick yours to copy from,
2478	  # but I could have also picked mine, since the source of the copy is
2479	  # the same in either case.  However, the mine has already been
2480	  # altered by the update command, so don't use it.  Instead, use the
2481	  # yours section which has not had an update on it and so is unchanged:
2482	  cp ../yours/testcase07 .
2483
2484	  cat >testcase08 <<\EOF
2485no
2486changes
2487here
2488
2489First change has now added this in.
2490
2491    no
2492    changes
2493    here
2494
2495Second change has now changed it here.
2496
2497        no
2498        changes
2499        here
2500
2501Both changes move this line to the end of the file.
2502EOF
2503
2504	  cat >testcase09 <<\EOF
2505
2506m
2507a
2508{
2509}
2510b
2511{
2512}
2513c
2514{
2515}
2516EOF
2517
2518	  cat >testcase10 <<\EOF
2519
2520    fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
2521
2522    petRpY ( MtatRk );
2523    fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
2524
2525    fV ( jfle_Uecopd_KRLIep < 16 )
2526    {
2527        MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
2528    }
2529    elke
2530    {
2531        MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
2532        fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
2533
2534        MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
2535        OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
2536
2537    Bloke_GttpfIRte_MtpeaL ( &acI );
2538MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
2539{
2540MTGTXM MtatRk = Zy;
2541
2542    fV ( Y < 16 )
2543    {
2544        petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
2545                                                      Y * jfle_Uecopd_MfJe_fY_Mectopk,
2546                                jfle_Uecopd_MfJe_fY_Mectopk,
2547                                nRVVep ) );
2548    }
2549    elke
2550    {
2551        petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
2552                                                 ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
2553                                jfle_Uecopd_MfJe_fY_Mectopk,
2554                                nRVVep ) );
2555    }
2556
2557    petRpY ( MtatRk );
2558
2559}
2560
2561
2562/****************************************************************************
2563*                                                                           *
2564*   Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY )                      *
2565*                                                                           *
2566****************************************************************************/
2567
2568MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
2569{
2570MTGTXM MtatRk = Zy;
2571
2572    MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
2573
2574    petRpY ( MtatRk );
2575
2576}
2577    HfkQipfte ( waYdle,                 /*  waYdle                         */
2578                waYdleFok,              /*  ZVVket VpoL ktapt oV dfkQ      */
2579                (coYkt RfYt8*) nRVVep,  /*  nRVVep                         */
2580                beYgtz                  /*  nEtek to Apfte                 */
2581              );
2582
2583    petRpY ( Zy );
2584}
2585
2586EOF
2587}
2588
2589
2590
2591# Echo a new CVSROOT based on $1, $remote, and $remotehost
2592newroot() {
2593  if $remote; then
2594    if test -n "$remotehost"; then
2595      echo :ext$rootoptions:$remotehost$1
2596    else
2597      echo :fork$rootoptions:$1
2598    fi
2599  else
2600    echo $1
2601  fi
2602}
2603
2604
2605
2606# Set up CVSROOT (the crerepos tests will test operating without CVSROOT set).
2607#
2608# Currently we test :fork: and :ext: (see crerepos test).  There is a
2609# known difference between the two in modes-15 (see comments there).
2610#
2611# :ext: can be tested against a remote machine if:
2612#
2613#    1. $remotehost is set using the `-h' option to this script.
2614#    2. ${CVS_RSH=rsh} $remotehost works.
2615#    3. The path to $TESTDIR is the same on both machines (symlinks are okay)
2616#    4. The path to $testcvs is the same on both machines (symlinks are okay)
2617#       or $CVS_SERVER is overridden in this script's environment to point to
2618#       a working CVS exectuable on the remote machine.
2619#
2620# Testing :pserver: would be hard (inetd issues).  (How about using tcpserver
2621# and some high port number?  DRP)
2622
2623if $linkroot; then
2624    mkdir ${TESTDIR}/realcvsroot
2625    ln -s realcvsroot ${TESTDIR}/cvsroot
2626fi
2627CVSROOT_DIRNAME=${TESTDIR}/cvsroot
2628CVSROOT=`newroot $CVSROOT_DIRNAME`; export CVSROOT
2629
2630
2631
2632###
2633### Initialize the repository
2634###
2635dotest init-1 "$testcvs init"
2636
2637# Now hide the primary root behind a secondary if requested.
2638if $proxy; then
2639    # Save the primary root.
2640    PRIMARY_CVSROOT=$CVSROOT
2641    PRIMARY_CVSROOT_DIRNAME=$CVSROOT_DIRNAME
2642    # Where the secondary root will be
2643    SECONDARY_CVSROOT_DIRNAME=$TESTDIR/secondary_cvsroot
2644    if $noredirect; then
2645	rootoptions=";Redirect=no"
2646	SECONDARY_CVSROOT=`newroot $PRIMARY_CVSROOT_DIRNAME`
2647    else
2648	SECONDARY_CVSROOT=`newroot $SECONDARY_CVSROOT_DIRNAME`
2649    fi
2650    # Now set the global CVSROOT to use the secondary.
2651    CVSROOT=$SECONDARY_CVSROOT; export CVSROOT
2652
2653    require_rsync
2654    if test $? -eq 77; then
2655	echo "Unable to test in proxy mode: $skipreason" >&2
2656	skip all "missing or broken rsync command."
2657	exit 0
2658    fi
2659
2660    if $noredirect; then
2661	# Wrap the CVS server to allow --primary-root to be set by the
2662	# secondary.
2663	cat <<EOF >$TESTDIR/secondary-wrapper
2664#! $TESTSHELL
2665CVS_SERVER=$TESTDIR/primary-wrapper
2666export CVS_SERVER
2667
2668# No need to check the PID of the last client since we are testing with
2669# Redirect disabled.
2670proot_arg="--allow-root=$SECONDARY_CVSROOT_DIRNAME"
2671exec $CVS_SERVER \$proot_arg "\$@"
2672EOF
2673	cat <<EOF >$TESTDIR/primary-wrapper
2674#! $TESTSHELL
2675if test -n "$CVS_SERVER_LOG"; then
2676  CVS_SERVER_LOG=`dirname "$CVS_SERVER_LOG"`/cvsprimarylog
2677  export CVS_SERVER_LOG
2678fi
2679exec $CVS_SERVER "\$@"
2680EOF
2681
2682	CVS_SERVER_secondary=$TESTDIR/secondary-wrapper
2683	CVS_SERVER=$CVS_SERVER_secondary
2684
2685	chmod a+x $TESTDIR/secondary-wrapper \
2686	          $TESTDIR/primary-wrapper
2687    fi
2688
2689    # Script to sync the secondary root.
2690    cat >$TESTDIR/sync-secondary <<EOF
2691#! $TESTSHELL
2692# date >>$TESTDIR/update-log
2693
2694ps=\$1
2695cmd=\$2
2696dir=\$3
2697shift
2698shift
2699shift
2700
2701# echo "updating from \$ps for command \\\`\$cmd' in dir \\\`\$dir'" \${1+"\$@"} \\
2702#      >>$TESTDIR/update-log
2703
2704# If multiple CVS executables could attempt to access the repository, we would
2705# Need to lock for this sync and sleep
2706case "\$dir" in
2707  ALL)
2708    # This is a hack to allow a few of the tests to play with the
2709    # UseNewInfoFmtStrings key in CVSROOT/config.  It's inefficient, but there
2710    # aren't many tests than need it and the alternative is an awful lot of
2711    # special casing.
2712    $RSYNC -rglop --delete --exclude '#cvs.*' \\
2713           $PRIMARY_CVSROOT_DIRNAME/ \\
2714           $SECONDARY_CVSROOT_DIRNAME
2715    ;;
2716
2717  *)
2718    # For the majority of the tests we will only sync the directories that
2719    # were written to.
2720    case "\$cmd" in
2721      add|import)
2722	# For \`add', we need a recursive update due to quirks in rsync syntax,
2723	# but it shouldn't affect efficiency since any new dir should be empty.
2724	#
2725	# For \`import', a recursive update is necessary since subdirs may have
2726	# been added underneath the root dir we were passed. 
2727        $RSYNC -rglop \\
2728	       $PRIMARY_CVSROOT_DIRNAME/"\$dir" \\
2729	       $SECONDARY_CVSROOT_DIRNAME/\`dirname -- "\$dir"\`
2730        ;;
2731
2732      tag)
2733	# \`tag' may have changed CVSROOT/val-tags too.
2734        $RSYNC -glop \\
2735               $PRIMARY_CVSROOT_DIRNAME/CVSROOT/val-tags \\
2736               $SECONDARY_CVSROOT_DIRNAME/CVSROOT
2737	# Otherwise it is identical to other write commands.
2738        $RSYNC -rglop --delete \\
2739               --include Attic --include CVS \
2740               --exclude '#cvs.*' --exclude '*/' \\
2741               $PRIMARY_CVSROOT_DIRNAME/"\$dir"/ \\
2742               $SECONDARY_CVSROOT_DIRNAME/"\$dir"
2743        ;;
2744
2745      *)
2746	# By default, sync just what changed.
2747        $RSYNC -rglop --delete \\
2748               --include Attic --include CVS \
2749               --exclude '#cvs.*' --exclude '*/' \\
2750               $PRIMARY_CVSROOT_DIRNAME/"\$dir"/ \\
2751               $SECONDARY_CVSROOT_DIRNAME/"\$dir"
2752        ;;
2753    esac # \$cmd
2754
2755    # And keep the history file up to date for all commands.
2756    $RSYNC -glop \\
2757           $PRIMARY_CVSROOT_DIRNAME/CVSROOT/history \\
2758           $SECONDARY_CVSROOT_DIRNAME/CVSROOT
2759    ;; # \$dir = *
2760esac # \$dir
2761
2762# Avoid timestamp comparison issues with rsync.
2763sleep 1
2764EOF
2765    chmod a+x $TESTDIR/sync-secondary
2766
2767    # And now init the secondary.
2768    $TESTDIR/sync-secondary "- no, before - create secondary root" \
2769                            sanity-setup ALL
2770
2771    # Initialize the primary repository
2772    mkdir proxy-init; cd proxy-init
2773    dotest proxy-init-1 "$testcvs -Qd$PRIMARY_CVSROOT co CVSROOT"
2774    cd CVSROOT
2775    cat >>config <<EOF
2776PrimaryServer=$PRIMARY_CVSROOT
2777EOF
2778    cat >>loginfo <<EOF
2779ALL $TESTDIR/sync-secondary loginfo %c %p %{sVv}
2780EOF
2781    cat >>postadmin <<EOF
2782ALL $TESTDIR/sync-secondary postadmin %c %p
2783EOF
2784    cat >>posttag <<EOF
2785ALL $TESTDIR/sync-secondary posttag %c %p %o %b %t %{sVv}
2786EOF
2787    cat >>postwatch <<EOF
2788ALL $TESTDIR/sync-secondary postwatch %c %p
2789EOF
2790    dotest proxy-init-2 \
2791"$testcvs -Q ci -mconfigure-writeproxy"
2792
2793    # Save these files for later reference
2794    cp config $TESTDIR/config-clean
2795    cp loginfo $TESTDIR/loginfo-clean
2796    cp postadmin $TESTDIR/postadmin-clean
2797    cp posttag $TESTDIR/posttag-clean
2798    cp postwatch $TESTDIR/postwatch-clean
2799
2800    # done in here
2801    cd ../..
2802    rm -rf proxy-init
2803else # !$proxy
2804    # Set this even when not testing $proxy to match messages, like $SPROG.
2805    SECONDARY_CVSROOT_DIRNAME=$CVSROOT_DIRNAME
2806fi # $proxy
2807
2808# Save a copy of the initial repository so that it may be restored after the
2809# tests that alter it.
2810cp -Rp $CVSROOT_DIRNAME/CVSROOT $TESTDIR/CVSROOT.save
2811
2812
2813###
2814### The tests
2815###
2816dotest init-2 "$testcvs init"
2817
2818
2819
2820###
2821### The big loop
2822###
2823for what in $tests; do
2824	if test -n "$fromtest" ; then
2825	    if test $fromtest = $what ; then
2826		unset fromtest
2827	    else
2828		continue
2829	    fi
2830	fi
2831	case $what in
2832
2833	version)
2834	  # We've had cases where the version command started dumping core,
2835	  # so we might as well test it
2836	  dotest version-1 "${testcvs} --version" \
2837'
2838Concurrent Versions System (CVS) [0-9.]*.*with CVSACL Patch [0-9.]*.*
2839
2840Copyright (C) [0-9]* Free Software Foundation, Inc.
2841
2842Senior active maintainers include Larry Jones, Derek R. Price,
2843and Mark D. Baushke.  Please see the AUTHORS and README files from the CVS
2844distribution kit for a complete list of contributors and copyrights.
2845
2846CVS may be copied only under the terms of the GNU General Public License,
2847a copy of which can be found with the CVS distribution kit.
2848
2849Specify the --help option for further information about CVS'
2850
2851# Maybe someday...
2852#	  if $proxy; then
2853#		dotest version-2r "${testcvs} version" \
2854#'Client: Concurrent Versions System (CVS) [0-9p.]* (client.*)
2855#Server: Concurrent Versions System (CVS) [0-9p.]* (.*server)
2856#Secondary Server: Concurrent Versions System (CVS) [0-9p.]* (.*server)'
2857	  if $remote; then
2858		dotest version-2r "${testcvs} version" \
2859'Client: Concurrent Versions System (CVS) [0-9p.]* (client.*)
2860with CVSACL Patch [0-9p.]* (.*)
2861Server: Concurrent Versions System (CVS) [0-9p.]* (.*server)
2862with CVSACL Patch [0-9p.]* (.*)'
2863	  else
2864		dotest version-2 "${testcvs} version" \
2865'Concurrent Versions System (CVS) [0-9.]*.*'
2866	  fi
2867	  ;;
2868
2869
2870
2871	basica)
2872	  # Similar in spirit to some of the basic1, and basic2
2873	  # tests, but hopefully a lot faster.  Also tests operating on
2874	  # files two directories down *without* operating on the parent dirs.
2875
2876	  # Tests basica-0a and basica-0b provide the equivalent of the:
2877	  #    mkdir ${CVSROOT_DIRNAME}/first-dir
2878	  # used by many of the tests.  It is "more official" in the sense
2879	  # that is does everything through CVS; the reason most of the
2880	  # tests don't use it is mostly historical.
2881	  mkdir 1; cd 1
2882	  dotest basica-0a "$testcvs -q co -l ."
2883	  mkdir first-dir
2884	  dotest basica-0b "$testcvs add first-dir" \
2885"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
2886	  cd ..
2887	  rm -r 1
2888
2889	  dotest basica-1 "$testcvs -q co first-dir" ''
2890	  cd first-dir
2891
2892	  # Test a few operations, to ensure they gracefully do
2893	  # nothing in an empty directory.
2894	  dotest basica-1a0 "$testcvs -q update"
2895	  dotest basica-1a1 "$testcvs -q diff -c"
2896	  dotest basica-1a2 "$testcvs -q status"
2897	  dotest basica-1a3 "$testcvs -q update ."
2898	  dotest basica-1a4 "$testcvs -q update ./"
2899
2900	  mkdir sdir
2901	  # Remote CVS gives the "cannot open CVS/Entries" error, which is
2902	  # clearly a bug, but not a simple one to fix.
2903	  dotest basica-1a10 "$testcvs -n add sdir" \
2904"Directory $CVSROOT_DIRNAME/first-dir/sdir added to the repository" \
2905"$SPROG add: cannot open CVS/Entries for reading: No such file or directory
2906Directory $CVSROOT_DIRNAME/first-dir/sdir added to the repository"
2907	  dotest_fail basica-1a11 \
2908	    "test -d $CVSROOT_DIRNAME/first-dir/sdir"
2909	  dotest basica-2 "$testcvs add sdir" \
2910"Directory $CVSROOT_DIRNAME/first-dir/sdir added to the repository"
2911	  cd sdir
2912	  mkdir ssdir
2913	  dotest basica-3 "$testcvs add ssdir" \
2914"Directory $CVSROOT_DIRNAME/first-dir/sdir/ssdir added to the repository"
2915	  cd ssdir
2916	  echo ssfile >ssfile
2917
2918	  # Trying to commit it without a "cvs add" should be an error.
2919	  # The "use `cvs add' to create an entry" message is the one
2920	  # that I consider to be more correct, but local cvs prints the
2921	  # "nothing known" message and noone has gotten around to fixing it.
2922	  dotest_fail basica-notadded "${testcvs} -q ci ssfile" \
2923"${CPROG} commit: use .${CPROG} add. to create an entry for \`ssfile'
2924${CPROG}"' \[commit aborted\]: correct above errors first!' \
2925"${CPROG}"' commit: nothing known about `ssfile'\''
2926'"${CPROG}"' \[commit aborted\]: correct above errors first!'
2927
2928	  dotest basica-4 "${testcvs} add ssfile" \
2929"${SPROG}"' add: scheduling file `ssfile'\'' for addition
2930'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
2931	  dotest_fail basica-4a "${testcvs} tag tag0 ssfile" \
2932"${SPROG} tag: nothing known about ssfile
2933${SPROG} "'\[tag aborted\]: correct the above errors first!'
2934	  cd ../..
2935	  dotest basica-5 "${testcvs} -q ci -m add-it" \
2936"$CVSROOT_DIRNAME/first-dir/sdir/ssdir/ssfile,v  <--  sdir/ssdir/ssfile
2937initial revision: 1\.1"
2938	  dotest_fail basica-5a \
2939	    "${testcvs} -q tag BASE sdir/ssdir/ssfile" \
2940"${SPROG} tag: Attempt to add reserved tag name BASE
2941${SPROG} \[tag aborted\]: failed to set tag BASE to revision 1\.1 in ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v"
2942	  dotest basica-5b "${testcvs} -q tag NOT_RESERVED" \
2943'T sdir/ssdir/ssfile'
2944
2945	  dotest basica-6 "${testcvs} -q update" ''
2946	  echo "ssfile line 2" >>sdir/ssdir/ssfile
2947	  dotest_fail basica-6.2 "${testcvs} -q diff -c" \
2948"Index: sdir/ssdir/ssfile
2949===================================================================
2950RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2951retrieving revision 1\.1
2952diff -c -r1\.1 ssfile
2953\*\*\* sdir/ssdir/ssfile	${RFCDATE}	1\.1
2954--- sdir/ssdir/ssfile	${RFCDATE}
2955\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2956\*\*\* 1 \*\*\*\*
2957--- 1,2 ----
2958  ssfile
2959${PLUS} ssfile line 2"
2960	  dotest_fail basica-6.3 "${testcvs} -q diff -c -rBASE" \
2961"Index: sdir/ssdir/ssfile
2962===================================================================
2963RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2964retrieving revision 1\.1
2965diff -c -r1\.1 ssfile
2966\*\*\* sdir/ssdir/ssfile	${RFCDATE}	1\.1
2967--- sdir/ssdir/ssfile	${RFCDATE}
2968\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
2969\*\*\* 1 \*\*\*\*
2970--- 1,2 ----
2971  ssfile
2972${PLUS} ssfile line 2"
2973	  dotest_fail basica-6.4 "${testcvs} -q diff -c -rBASE -C3isacrowd" \
2974"Index: sdir/ssdir/ssfile
2975===================================================================
2976RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
2977retrieving revision 1\.1
2978diff -c -C 3isacrowd -r1\.1 ssfile
2979${SPROG} diff: invalid context length argument"
2980	  dotest basica-7 "${testcvs} -q ci -m modify-it" \
2981"$CVSROOT_DIRNAME/first-dir/sdir/ssdir/ssfile,v  <--  sdir/ssdir/ssfile
2982new revision: 1\.2; previous revision: 1\.1"
2983	  dotest_fail basica-nonexist "${testcvs} -q ci nonexist" \
2984"${CPROG}"' commit: nothing known about `nonexist'\''
2985'"${CPROG}"' \[commit aborted\]: correct above errors first!'
2986	  dotest basica-8 "${testcvs} -q update ." ''
2987
2988	  # Test the -f option to ci
2989	  cd sdir/ssdir
2990	  dotest basica-8a0 "${testcvs} -q ci -m not-modified ssfile" ''
2991	  dotest basica-8a "${testcvs} -q ci -f -m force-it" \
2992"$CVSROOT_DIRNAME/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
2993new revision: 1\.3; previous revision: 1\.2"
2994	  dotest basica-8a1 "${testcvs} -q ci -m bump-it -r 2.0" \
2995"$CVSROOT_DIRNAME/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
2996new revision: 2\.0; previous revision: 1\.3"
2997	  dotest basica-8a1a "${testcvs} -q ci -m bump-it -r 2.9" \
2998"${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
2999new revision: 2\.9; previous revision: 2\.0"
3000	  # Test string-based revion number increment rollover
3001	  dotest basica-8a1b "${testcvs} -q ci -m bump-it -f -r 2" \
3002"${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
3003new revision: 2\.10; previous revision: 2\.9"
3004	  dotest basica-8a1c "${testcvs} -q ci -m bump-it -r 2.99" \
3005"${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
3006new revision: 2\.99; previous revision: 2\.10"
3007	  # Test string-based revion number increment rollover
3008	  dotest basica-8a1d "${testcvs} -q ci -m bump-it -f -r 2" \
3009"${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
3010new revision: 2\.100; previous revision: 2\.99"
3011	  dotest basica-8a1e "${testcvs} -q ci -m bump-it -r 2.1099" \
3012"${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
3013new revision: 2\.1099; previous revision: 2\.100"
3014	  # Test string-based revion number increment rollover
3015	  dotest basica-8a1f "${testcvs} -q ci -m bump-it -f -r 2" \
3016"${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
3017new revision: 2\.1100; previous revision: 2\.1099"
3018	  # -f should not be necessary, but it should be harmless.
3019	  # Also test the "-r 3" (rather than "-r 3.0") usage.
3020	  dotest basica-8a2 "${testcvs} -q ci -m bump-it -f -r 3" \
3021"$CVSROOT_DIRNAME/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
3022new revision: 3\.1; previous revision: 2\.1100"
3023
3024	  # Test using -r to create a branch
3025	  dotest_fail basica-8a3 "${testcvs} -q ci -m bogus -r 3.0.0" \
3026"$CVSROOT_DIRNAME/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
3027$SPROG commit: $CVSROOT_DIRNAME/first-dir/sdir/ssdir/ssfile,v: can't find branch point 3\.0
3028$SPROG commit: could not check in ssfile"
3029	  dotest basica-8a4 "${testcvs} -q ci -m valid -r 3.1.2" \
3030"$CVSROOT_DIRNAME/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
3031new revision: 3\.1\.2\.1; previous revision: 3\.1"
3032	  # now get rid of the sticky tag and go back to the trunk
3033	  dotest basica-8a5 "${testcvs} -q up -A ./" "[UP] ssfile"
3034
3035	  cd ../..
3036	  dotest basica-8b "${testcvs} -q diff -r1.2 -r1.3"
3037
3038	  dotest basica-8b1 "${testcvs} -q diff -r1.2 -r1.3 -C 3isacrowd"
3039
3040	  # The .* here will normally be "No such file or directory",
3041	  # but if memory serves some systems (AIX?) have a different message.
3042:	  dotest_fail basica-9 \
3043	    "${testcvs} -q -d ${TESTDIR}/nonexist update" \
3044"${SPROG}: cannot access cvs root ${TESTDIR}/nonexist: .*"
3045	  dotest_fail basica-9a \
3046	    "${testcvs} -q -d ${TESTDIR}/nonexist update" \
3047"${CPROG} \[update aborted\]: ${TESTDIR}/nonexist/CVSROOT: .*"
3048
3049	  dotest basica-10 "${testcvs} annotate" \
3050'
3051Annotations for sdir/ssdir/ssfile
3052\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
30531\.1          .'"$username8"' *[0-9a-zA-Z-]*.: ssfile
30541\.2          .'"$username8"' *[0-9a-zA-Z-]*.: ssfile line 2'
3055
3056	  # Test resurrecting with strange revision numbers
3057	  cd sdir/ssdir
3058	  dotest basica-r1 "${testcvs} rm -f ssfile" \
3059"${SPROG} remove: scheduling .ssfile. for removal
3060${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
3061	  dotest basica-r2 "${testcvs} -q ci -m remove" \
3062"$CVSROOT_DIRNAME/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
3063new revision: delete; previous revision: 3\.1"
3064	  dotest basica-r3 "${testcvs} -q up -p -r 3.1 ./ssfile >ssfile" ""
3065	  dotest basica-r4 "${testcvs} add ssfile" \
3066"${SPROG} add: Re-adding file .ssfile. after dead revision 3\.2\.
3067${SPROG} add: use .${SPROG} commit. to add this file permanently"
3068	  dotest basica-r5 "${testcvs} -q ci -m resurrect" \
3069"$CVSROOT_DIRNAME/first-dir/sdir/ssdir/ssfile,v  <--  ssfile
3070new revision: 3\.3; previous revision: 3\.2"
3071	  cd ../..
3072
3073	  # As long as we have a file with a few revisions, test
3074	  # a few "cvs admin -o" invocations.
3075	  cd sdir/ssdir
3076	  dotest_fail basica-o1 "${testcvs} admin -o 1.2::1.2" \
3077"${CPROG} admin: while processing more than one file:
3078${CPROG} \[admin aborted\]: attempt to specify a numeric revision"
3079	  dotest basica-o2 "${testcvs} admin -o 1.2::1.2 ssfile" \
3080"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
3081done"
3082	  dotest basica-o2a "${testcvs} admin -o 1.1::NOT_RESERVED ssfile" \
3083"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
3084done"
3085	  dotest_fail basica-o2b "${testcvs} admin -o 1.1::NOT_EXIST ssfile" \
3086"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
3087${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: Revision NOT_EXIST doesn't exist.
3088${SPROG} admin: RCS file for .ssfile. not modified\."
3089	  dotest basica-o3 "${testcvs} admin -o 1.2::1.3 ssfile" \
3090"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
3091done"
3092	  dotest basica-o4 "${testcvs} admin -o 3.1:: ssfile" \
3093"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
3094deleting revision 3\.3
3095deleting revision 3\.2
3096done"
3097	  dotest basica-o5 "${testcvs} admin -o ::1.1 ssfile" \
3098"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
3099done"
3100	  dotest basica-o5a "${testcvs} -n admin -o 1.2::3.1 ssfile" \
3101"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
3102deleting revision 2\.1100
3103deleting revision 2\.1099
3104deleting revision 2\.100
3105deleting revision 2\.99
3106deleting revision 2\.10
3107deleting revision 2\.9
3108deleting revision 2\.0
3109deleting revision 1\.3
3110done"
3111	  dotest basica-o6 "${testcvs} admin -o 1.2::3.1 ssfile" \
3112"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
3113deleting revision 2\.1100
3114deleting revision 2\.1099
3115deleting revision 2\.100
3116deleting revision 2\.99
3117deleting revision 2\.10
3118deleting revision 2\.9
3119deleting revision 2\.0
3120deleting revision 1\.3
3121done"
3122	  dotest basica-o6a "${testcvs} admin -o 3.1.2: ssfile" \
3123"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
3124deleting revision 3\.1\.2\.1
3125done"
3126	  dotest basica-o7 "${testcvs} log -N ssfile" "
3127RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
3128Working file: ssfile
3129head: 3\.1
3130branch:
3131locks: strict
3132access list:
3133keyword substitution: kv
3134total revisions: 3;	selected revisions: 3
3135description:
3136----------------------------
3137revision 3\.1
3138date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}0 -0;  commitid: ${commitid};
3139bump-it
3140----------------------------
3141revision 1\.2
3142date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
3143modify-it
3144----------------------------
3145revision 1\.1
3146date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
3147add-it
3148============================================================================="
3149	  dotest basica-o8 "${testcvs} -q update -p -r 1.1 ./ssfile" "ssfile"
3150	  cd ../..
3151
3152	  cd ..
3153
3154	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
3155	  rm -r first-dir
3156	  ;;
3157
3158
3159
3160	basicb)
3161	  # More basic tests, including non-branch tags and co -d.
3162	  mkdir 1; cd 1
3163	  dotest basicb-0a "${testcvs} -q co -l ." ''
3164	  touch topfile
3165	  dotest basicb-0b "${testcvs} add topfile" \
3166"${SPROG} add: scheduling file .topfile. for addition
3167${SPROG} add: use .${SPROG} commit. to add this file permanently"
3168	  dotest basicb-0c "${testcvs} -q ci -m add-it topfile" \
3169"$CVSROOT_DIRNAME/topfile,v  <--  topfile
3170initial revision: 1\.1"
3171	  cd ..
3172	  rm -r 1
3173	  mkdir 2; cd 2
3174	  dotest basicb-0d "${testcvs} -q co -l ." "U topfile"
3175	  # Now test the ability to run checkout on an existing working
3176	  # directory without having it lose its mind.  I don't know
3177	  # whether this is tested elsewhere in sanity.sh.  A more elaborate
3178	  # test might also have modified files, make sure it works if
3179	  # the modules file was modified to add new directories to the
3180	  # module, and such.
3181	  dotest basicb-0d0 "${testcvs} -q co -l ." ""
3182	  mkdir first-dir
3183	  dotest basicb-0e "${testcvs} add first-dir" \
3184"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
3185	  cd ..
3186	  rm -r 2
3187
3188	  dotest basicb-1 "${testcvs} -q co first-dir" ''
3189
3190	  # The top-level CVS directory is not created by default.
3191	  # I'm leaving basicb-1a and basicb-1b untouched, mostly, in
3192	  # case we decide that the default should be reversed...
3193
3194	  dotest_fail basicb-1a "test -d CVS" ''
3195
3196	  dotest basicb-1c "cat first-dir/CVS/Repository" "first-dir"
3197
3198	  cd first-dir
3199	  # Note that the name Emptydir is chosen to test that CVS just
3200	  # treats it like any other directory name.  It should be
3201	  # special only when it is directly in $CVSROOT/CVSROOT.
3202	  mkdir Emptydir sdir2
3203	  dotest basicb-2 "${testcvs} add Emptydir sdir2" \
3204"Directory ${CVSROOT_DIRNAME}/first-dir/Emptydir added to the repository
3205Directory ${CVSROOT_DIRNAME}/first-dir/sdir2 added to the repository"
3206	  cd Emptydir
3207	  echo sfile1 starts >sfile1
3208	  dotest basicb-2a10 "${testcvs} -n add sfile1" \
3209"${SPROG} add: scheduling file .sfile1. for addition
3210${SPROG} add: use .${SPROG} commit. to add this file permanently"
3211	  dotest basicb-2a11 "${testcvs} status sfile1" \
3212"${SPROG} status: use \`${SPROG} add' to create an entry for \`sfile1'
3213===================================================================
3214File: sfile1           	Status: Unknown
3215
3216   Working revision:	No entry for sfile1
3217   Repository revision:	No revision control file"
3218	  dotest basicb-3 "${testcvs} add sfile1" \
3219"${SPROG} add: scheduling file .sfile1. for addition
3220${SPROG} add: use .${SPROG} commit. to add this file permanently"
3221	  dotest basicb-3a1 "${testcvs} status sfile1" \
3222"===================================================================
3223File: sfile1           	Status: Locally Added
3224
3225   Working revision:	New file!
3226   Repository revision:	No revision control file
3227   Sticky Tag:		(none)
3228   Sticky Date:		(none)
3229   Sticky Options:	(none)"
3230
3231	  cd ../sdir2
3232	  echo sfile2 starts >sfile2
3233	  dotest basicb-4 "${testcvs} add sfile2" \
3234"${SPROG} add: scheduling file .sfile2. for addition
3235${SPROG} add: use .${SPROG} commit. to add this file permanently"
3236	  dotest basicb-4a "${testcvs} -q ci CVS" \
3237"${CPROG} commit: warning: directory CVS specified in argument
3238${CPROG} commit: but CVS uses CVS for its own purposes; skipping CVS directory"
3239	  cd ..
3240	  dotest basicb-5 "${testcvs} -q ci -m add" \
3241"$CVSROOT_DIRNAME/first-dir/Emptydir/sfile1,v  <--  Emptydir/sfile1
3242initial revision: 1\.1
3243$CVSROOT_DIRNAME/first-dir/sdir2/sfile2,v  <--  sdir2/sfile2
3244initial revision: 1\.1"
3245	  echo sfile1 develops >Emptydir/sfile1
3246	  dotest basicb-6 "${testcvs} -q ci -m modify" \
3247"$CVSROOT_DIRNAME/first-dir/Emptydir/sfile1,v  <--  Emptydir/sfile1
3248new revision: 1\.2; previous revision: 1\.1"
3249	  dotest basicb-7 "${testcvs} -q tag release-1" 'T Emptydir/sfile1
3250T sdir2/sfile2'
3251	  echo not in time for release-1 >sdir2/sfile2
3252	  dotest basicb-8 "${testcvs} -q ci -m modify-2" \
3253"$CVSROOT_DIRNAME/first-dir/sdir2/sfile2,v  <--  sdir2/sfile2
3254new revision: 1\.2; previous revision: 1\.1"
3255	  # See if CVS can correctly notice when an invalid numeric
3256	  # revision is specified.
3257	  # Commented out until we get around to fixing CVS
3258:	  dotest basicb-8a0 "${testcvs} diff -r 1.5 -r 1.7 sfile2" 'error msg'
3259	  cd ..
3260
3261	  # Test that we recurse into the correct directory when checking
3262	  # for existing files, even if co -d is in use.
3263	  touch first-dir/extra
3264	  dotest basicb-cod-1 "${testcvs} -q co -d first-dir1 first-dir" \
3265'U first-dir1/Emptydir/sfile1
3266U first-dir1/sdir2/sfile2'
3267	  rm -r first-dir1
3268
3269	  rm -r first-dir
3270
3271	  # FIXME? basicb-9 used to check things out like this:
3272	  #   U newdir/Emptydir/sfile1
3273	  #   U newdir/sdir2/sfile2
3274	  # but that's difficult to do.  The whole "shorten" thing
3275	  # is pretty bogus, because it will break on things
3276	  # like "cvs co foo/bar baz/quux".  Unless there's some
3277	  # pretty detailed expansion and analysis of the command-line
3278	  # arguments, we shouldn't do "shorten" stuff at all.
3279
3280	  dotest basicb-9 \
3281"${testcvs} -q co -d newdir -r release-1 first-dir/Emptydir first-dir/sdir2" \
3282'U newdir/first-dir/Emptydir/sfile1
3283U newdir/first-dir/sdir2/sfile2'
3284
3285	  # basicb-9a and basicb-9b: see note about basicb-1a
3286
3287	  dotest_fail basicb-9a "test -d CVS" ''
3288
3289	  dotest basicb-9c "cat newdir/CVS/Repository" "\."
3290	  dotest basicb-9d "cat newdir/first-dir/CVS/Repository" \
3291"${CVSROOT_DIRNAME}/first-dir" \
3292"first-dir"
3293	  dotest basicb-9e "cat newdir/first-dir/Emptydir/CVS/Repository" \
3294"${CVSROOT_DIRNAME}/first-dir/Emptydir" \
3295"first-dir/Emptydir"
3296	  dotest basicb-9f "cat newdir/first-dir/sdir2/CVS/Repository" \
3297"${CVSROOT_DIRNAME}/first-dir/sdir2" \
3298"first-dir/sdir2"
3299
3300	  dotest basicb-10 "cat newdir/first-dir/Emptydir/sfile1 newdir/first-dir/sdir2/sfile2" \
3301"sfile1 develops
3302sfile2 starts"
3303
3304	  rm -r newdir
3305
3306	  # Hmm, this might be a case for CVSNULLREPOS, but CVS doesn't
3307	  # seem to deal with it...
3308	  if false; then
3309	  dotest basicb-11 "${testcvs} -q co -d sub1/sub2 first-dir" \
3310"U sub1/sub2/Emptydir/sfile1
3311U sub1/sub2/sdir2/sfile2"
3312	  cd sub1
3313	  dotest basicb-12 "${testcvs} -q update ./." ''
3314	  touch xx
3315	  dotest basicb-13 "${testcvs} add xx" fixme
3316	  cd ..
3317	  rm -r sub1
3318	  # to test: sub1/sub2/sub3
3319	  fi # end of tests commented out.
3320
3321	  # Create a second directory.
3322	  mkdir 1
3323	  cd 1
3324	  dotest basicb-14 "${testcvs} -q co -l ." 'U topfile'
3325	  mkdir second-dir
3326	  dotest basicb-15 "${testcvs} add second-dir" \
3327"Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
3328	  cd second-dir
3329	  touch aa
3330	  dotest basicb-16 "${testcvs} add aa" \
3331"${SPROG} add: scheduling file .aa. for addition
3332${SPROG} add: use .${SPROG} commit. to add this file permanently"
3333	  dotest basicb-17 "${testcvs} -q ci -m add" \
3334"$CVSROOT_DIRNAME/second-dir/aa,v  <--  aa
3335initial revision: 1\.1"
3336	  cd ..
3337
3338	  # Try to remove all revisions in a file.
3339	  dotest_fail basicb-o1 "${testcvs} admin -o1.1 topfile" \
3340"RCS file: ${CVSROOT_DIRNAME}/topfile,v
3341deleting revision 1\.1
3342${SPROG} \[admin aborted\]: attempt to delete all revisions"
3343	  dotest basicb-o2 "${testcvs} -q update -d first-dir" \
3344"U first-dir/Emptydir/sfile1
3345U first-dir/sdir2/sfile2"
3346	  dotest_fail basicb-o3 \
3347"${testcvs} admin -o1.1:1.2 first-dir/sdir2/sfile2" \
3348"RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
3349deleting revision 1\.2
3350deleting revision 1\.1
3351${SPROG} \[admin aborted\]: attempt to delete all revisions"
3352	  cd ..
3353	  rm -r 1
3354
3355	  mkdir 1; cd 1
3356	  # Note that -H is an invalid option.
3357	  # I suspect that the choice between "illegal" and "invalid"
3358	  # depends on the user's environment variables, the phase
3359	  # of the moon (weirdness with optind), and who knows what else.
3360	  # I've been seeing "illegal"...
3361	  # And I switched it to "invalid". -DRP
3362	  # POSIX 1003.2 specifies the format should be 'illegal option'
3363	  # many other folks are still using the older 'invalid option'
3364	  # lib/getopt.c will use POSIX when __posixly_correct
3365	  # otherwise the other, so accept both of them. -- mdb
3366	  dotest_fail basicb-21 "${testcvs} -q admin -H" \
3367"admin: invalid option -- '*H'*
3368${CPROG} \[admin aborted\]: specify ${CPROG} -H admin for usage information" \
3369"admin: illegal option -- '*H'*
3370${CPROG} \[admin aborted\]: specify ${CPROG} -H admin for usage information"
3371	  cd ..
3372	  rmdir 1
3373
3374	  if $keep; then
3375	    echo Keeping ${TESTDIR} and exiting due to --keep
3376	    exit 0
3377	  fi
3378
3379	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
3380			     $CVSROOT_DIRNAME/second-dir
3381	  modify_repo rm -f $CVSROOT_DIRNAME/topfile,v
3382	  ;;
3383
3384
3385
3386	basicc)
3387	  # More tests of basic/miscellaneous functionality.
3388	  mkdir 1; cd 1
3389	  dotest_fail basicc-1 "$testcvs diff" \
3390"$CPROG diff: in directory \.:
3391$CPROG \[diff aborted\]: there is no version here; run .$CPROG checkout. first"
3392	  dotest basicc-2 "$testcvs -q co -l ."
3393	  mkdir first-dir second-dir
3394	  dotest basicc-3 "${testcvs} add first-dir second-dir" \
3395"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
3396Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
3397	  # Old versions of CVS often didn't create this top-level CVS
3398	  # directory in the first place.  I think that maybe the only
3399	  # way to get it to work currently is to let CVS create it,
3400	  # and then blow it away (don't complain if it does not
3401	  # exist).  But that is perfectly valid; people who are used
3402	  # to the old behavior especially may be interested.
3403	  # FIXME: this test is intended for the TopLevelAdmin=yes case;
3404	  # should adjust/move it accordingly.
3405	  rm -rf CVS
3406	  dotest basicc-4 "echo *" "first-dir second-dir"
3407	  dotest basicc-5 "${testcvs} update" \
3408"${SPROG} update: Updating first-dir
3409${SPROG} update: Updating second-dir" \
3410"${SPROG} update: Updating \.
3411${SPROG} update: Updating first-dir
3412${SPROG} update: Updating second-dir"
3413
3414	  cd first-dir
3415	  dotest basicc-6 "${testcvs} release -d" ""
3416	  dotest basicc-7 "test -d ../first-dir" ""
3417	  # The Linux 2.2 kernel lets you delete ".".  That's OK either way,
3418	  # the point is that CVS must not mess with anything *outside* "."
3419	  # the way that CVS 1.10 and older tried to.
3420	  dotest basicc-8 "${testcvs} -Q release -d ." \
3421"" "${CPROG} release: deletion of directory \. failed: .*"
3422	  dotest basicc-9 "test -d ../second-dir" ""
3423	  # For CVS to make a syntactic check for "." wouldn't suffice.
3424	  # On Linux 2.2 systems, the cwd may be gone, so we recreate it
3425          # to allow basicc-11 to actually happen
3426	  if test ! -d ../first-dir; then
3427	    # Apparently `cd ..' doesn't work with Linux 2.2 & Bash 2.05b.
3428	    cd $TESTDIR/1
3429	    mkdir ./first-dir
3430            cd ./first-dir
3431	  fi
3432	  dotest basicc-11 "${testcvs} -Q release -d ./." \
3433"" "${CPROG} release: deletion of directory \./\. failed: .*"
3434	  dotest basicc-11a "test -d ../second-dir" ""
3435
3436	  cd ../..
3437
3438	  mkdir 2; cd 2
3439	  dotest basicc-12 "${testcvs} -Q co ." ""
3440	  # actual entries can be in either Entries or Entries.log, do
3441	  # an update to get them consolidated into Entries
3442	  dotest basicc-12a "${testcvs} -Q up" ""
3443	  dotest basicc-12b "cat CVS/Entries" \
3444"D/CVSROOT////
3445D/first-dir////
3446D/second-dir////"
3447	  dotest basicc-13 "echo *" "CVS CVSROOT first-dir second-dir"
3448	  dotest basicc-14 "${testcvs} -Q release first-dir second-dir" ""
3449	  # a normal release shouldn't affect the Entries file
3450	  dotest basicc-14b "cat CVS/Entries" \
3451"D/CVSROOT////
3452D/first-dir////
3453D/second-dir////"
3454	  # FIXCVS: but release -d probably should
3455	  dotest basicc-15 "${testcvs} -Q release -d first-dir second-dir" ""
3456	  dotest basicc-16 "echo *" "CVS CVSROOT"
3457	  dotest basicc-17 "cat CVS/Entries" \
3458"D/CVSROOT////
3459D/first-dir////
3460D/second-dir////"
3461	  # FIXCVS: if not, update should notice the missing directories
3462	  # and update Entries accordingly
3463	  dotest basicc-18 "${testcvs} -Q up" ""
3464	  dotest basicc-19 "cat CVS/Entries" \
3465"D/CVSROOT////
3466D/first-dir////
3467D/second-dir////"
3468
3469	  cd ..
3470	  rm -r 1 2
3471	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
3472			     $CVSROOT_DIRNAME/second-dir
3473	  ;;
3474
3475
3476
3477	basic1)
3478	  # first dive - add a files, first singly, then in a group.
3479	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
3480	  mkdir basic1; cd basic1
3481	  # check out an empty directory
3482	  dotest basic1-1 "${testcvs} -q co first-dir" ''
3483
3484	  cd first-dir
3485	  echo file2 >file2
3486	  echo file3 >file3
3487	  echo file4 >file4
3488	  echo file5 >file5
3489
3490	  dotest basic1-14-add-add "${testcvs} add file2 file3 file4 file5" \
3491"${SPROG} add: scheduling file \`file2' for addition
3492${SPROG} add: scheduling file \`file3' for addition
3493${SPROG} add: scheduling file \`file4' for addition
3494${SPROG} add: scheduling file \`file5' for addition
3495${SPROG} add: use .${SPROG} commit. to add these files permanently"
3496	  dotest basic1-15-add-add \
3497"${testcvs} -q update file2 file3 file4 file5" \
3498"A file2
3499A file3
3500A file4
3501A file5"
3502	  dotest basic1-16-add-add "${testcvs} -q update" \
3503"A file2
3504A file3
3505A file4
3506A file5"
3507	  dotest basic1-17-add-add "${testcvs} -q status" \
3508"===================================================================
3509File: file2            	Status: Locally Added
3510
3511   Working revision:	New file!
3512   Repository revision:	No revision control file
3513   Sticky Tag:		(none)
3514   Sticky Date:		(none)
3515   Sticky Options:	(none)
3516
3517===================================================================
3518File: file3            	Status: Locally Added
3519
3520   Working revision:	New file!
3521   Repository revision:	No revision control file
3522   Sticky Tag:		(none)
3523   Sticky Date:		(none)
3524   Sticky Options:	(none)
3525
3526===================================================================
3527File: file4            	Status: Locally Added
3528
3529   Working revision:	New file!
3530   Repository revision:	No revision control file
3531   Sticky Tag:		(none)
3532   Sticky Date:		(none)
3533   Sticky Options:	(none)
3534
3535===================================================================
3536File: file5            	Status: Locally Added
3537
3538   Working revision:	New file!
3539   Repository revision:	No revision control file
3540   Sticky Tag:		(none)
3541   Sticky Date:		(none)
3542   Sticky Options:	(none)"
3543	  dotest basic1-18-add-add "${testcvs} -q log" \
3544"${SPROG} log: file2 has been added, but not committed
3545${SPROG} log: file3 has been added, but not committed
3546${SPROG} log: file4 has been added, but not committed
3547${SPROG} log: file5 has been added, but not committed"
3548	  cd ..
3549	  dotest basic1-21-add-add "${testcvs} -q update" \
3550"A first-dir/file2
3551A first-dir/file3
3552A first-dir/file4
3553A first-dir/file5"
3554	  # FIXCVS?  Shouldn't this read first-dir/file2 instead of file2?
3555	  dotest basic1-22-add-add "${testcvs} log first-dir" \
3556"${SPROG} log: Logging first-dir
3557${SPROG} log: file2 has been added, but not committed
3558${SPROG} log: file3 has been added, but not committed
3559${SPROG} log: file4 has been added, but not committed
3560${SPROG} log: file5 has been added, but not committed"
3561	  dotest basic1-23-add-add "${testcvs} status first-dir" \
3562"${SPROG} status: Examining first-dir
3563===================================================================
3564File: file2            	Status: Locally Added
3565
3566   Working revision:	New file!
3567   Repository revision:	No revision control file
3568   Sticky Tag:		(none)
3569   Sticky Date:		(none)
3570   Sticky Options:	(none)
3571
3572===================================================================
3573File: file3            	Status: Locally Added
3574
3575   Working revision:	New file!
3576   Repository revision:	No revision control file
3577   Sticky Tag:		(none)
3578   Sticky Date:		(none)
3579   Sticky Options:	(none)
3580
3581===================================================================
3582File: file4            	Status: Locally Added
3583
3584   Working revision:	New file!
3585   Repository revision:	No revision control file
3586   Sticky Tag:		(none)
3587   Sticky Date:		(none)
3588   Sticky Options:	(none)
3589
3590===================================================================
3591File: file5            	Status: Locally Added
3592
3593   Working revision:	New file!
3594   Repository revision:	No revision control file
3595   Sticky Tag:		(none)
3596   Sticky Date:		(none)
3597   Sticky Options:	(none)"
3598	  dotest basic1-24-add-add "${testcvs} update first-dir" \
3599"${SPROG} update: Updating first-dir
3600A first-dir/file2
3601A first-dir/file3
3602A first-dir/file4
3603A first-dir/file5"
3604	  dotest basic1-27-add-add "${testcvs} co first-dir" \
3605"${SPROG} checkout: Updating first-dir
3606A first-dir/file2
3607A first-dir/file3
3608A first-dir/file4
3609A first-dir/file5"
3610	  cd first-dir
3611	  dotest basic1-14-add-ci \
3612"$testcvs commit -m test file2 file3 file4 file5" \
3613"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
3614initial revision: 1\.1
3615$CVSROOT_DIRNAME/first-dir/file3,v  <--  file3
3616initial revision: 1\.1
3617$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
3618initial revision: 1\.1
3619$CVSROOT_DIRNAME/first-dir/file5,v  <--  file5
3620initial revision: 1\.1"
3621	  dotest basic1-15-add-ci \
3622"${testcvs} -q update file2 file3 file4 file5" ''
3623	  dotest basic1-16-add-ci "${testcvs} -q update" ''
3624	  dotest basic1-17-add-ci "${testcvs} -q status" \
3625"===================================================================
3626File: file2            	Status: Up-to-date
3627
3628   Working revision:	1\.1.*
3629   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file2,v
3630   Commit Identifier:	${commitid}
3631   Sticky Tag:		(none)
3632   Sticky Date:		(none)
3633   Sticky Options:	(none)
3634
3635===================================================================
3636File: file3            	Status: Up-to-date
3637
3638   Working revision:	1\.1.*
3639   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file3,v
3640   Commit Identifier:	${commitid}
3641   Sticky Tag:		(none)
3642   Sticky Date:		(none)
3643   Sticky Options:	(none)
3644
3645===================================================================
3646File: file4            	Status: Up-to-date
3647
3648   Working revision:	1\.1.*
3649   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file4,v
3650   Commit Identifier:	${commitid}
3651   Sticky Tag:		(none)
3652   Sticky Date:		(none)
3653   Sticky Options:	(none)
3654
3655===================================================================
3656File: file5            	Status: Up-to-date
3657
3658   Working revision:	1\.1.*
3659   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file5,v
3660   Commit Identifier:	${commitid}
3661   Sticky Tag:		(none)
3662   Sticky Date:		(none)
3663   Sticky Options:	(none)"
3664	  # The "log" tests and friends probably already test the output
3665	  # from log quite adequately.
3666	  # Note: using dotest fails here.  It seems to be related
3667	  # to the output being sufficiently large (Red Hat 4.1).
3668	  # dotest basic1-18-add-ci "${testcvs} log" "${DOTSTAR}"
3669	  if ${testcvs} -q log >>${LOGFILE}; then
3670	    pass basic1-18-add-ci
3671	  else
3672	    pass basic1-18-add-ci
3673	  fi
3674	  cd ..
3675	  dotest basic1-21-add-ci "${testcvs} -q update" ''
3676	  # See test basic1-18-add-ci for explanation of non-use of dotest.
3677	  if ${testcvs} -q log first-dir >>${LOGFILE}; then
3678	    pass basic1-22-add-ci
3679	  else
3680	    pass basic1-22-add-ci
3681	  fi
3682	  # At least for the moment I am going to consider 17-add-ci
3683	  # an adequate test of the output here.
3684	  # See test basic1-18-add-ci for explanation of non-use of dotest.
3685	  if ${testcvs} -q status first-dir >>${LOGFILE}; then
3686	    pass basic1-23-add-ci
3687	  else
3688	    pass basic1-23-add-ci
3689	  fi
3690	  dotest basic1-24-add-ci "${testcvs} -q update first-dir" ''
3691	  dotest basic1-27-add-ci "${testcvs} -q co first-dir" ''
3692
3693	  cd first-dir
3694	  rm file2 file3 file4 file5
3695	  dotest basic1-14-rm-rm "${testcvs} rm file2 file3 file4 file5" \
3696"${SPROG} remove: scheduling .file2. for removal
3697${SPROG} remove: scheduling .file3. for removal
3698${SPROG} remove: scheduling .file4. for removal
3699${SPROG} remove: scheduling .file5. for removal
3700${SPROG} remove: use .${SPROG} commit. to remove these files permanently"
3701	  # 15-rm-rm was commented out.  Why?
3702	  dotest basic1-15-rm-rm \
3703"${testcvs} -q update file2 file3 file4 file5" \
3704"R file2
3705R file3
3706R file4
3707R file5"
3708	  dotest basic1-16-rm-rm "${testcvs} -q update" \
3709"R file2
3710R file3
3711R file4
3712R file5"
3713	  dotest basic1-17-rm-rm "${testcvs} -q status" \
3714"===================================================================
3715File: no file file2		Status: Locally Removed
3716
3717   Working revision:	-1\.1.*
3718   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file2,v
3719   Commit Identifier:	${commitid}
3720   Sticky Tag:		(none)
3721   Sticky Date:		(none)
3722   Sticky Options:	(none)
3723
3724===================================================================
3725File: no file file3		Status: Locally Removed
3726
3727   Working revision:	-1\.1.*
3728   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file3,v
3729   Commit Identifier:	${commitid}
3730   Sticky Tag:		(none)
3731   Sticky Date:		(none)
3732   Sticky Options:	(none)
3733
3734===================================================================
3735File: no file file4		Status: Locally Removed
3736
3737   Working revision:	-1\.1.*
3738   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file4,v
3739   Commit Identifier:	${commitid}
3740   Sticky Tag:		(none)
3741   Sticky Date:		(none)
3742   Sticky Options:	(none)
3743
3744===================================================================
3745File: no file file5		Status: Locally Removed
3746
3747   Working revision:	-1\.1.*
3748   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file5,v
3749   Commit Identifier:	${commitid}
3750   Sticky Tag:		(none)
3751   Sticky Date:		(none)
3752   Sticky Options:	(none)"
3753	  # Would be nice to test that real logs appear (with dead state
3754	  # and all), either here or someplace like log2 tests.
3755	  if ${testcvs} -q log >>${LOGFILE}; then
3756	    pass basic1-18-rm-rm
3757	  else
3758	    fail basic1-18-rm-rm
3759	  fi
3760	  cd ..
3761	  dotest basic1-21-rm-rm "${testcvs} -q update" \
3762"R first-dir/file2
3763R first-dir/file3
3764R first-dir/file4
3765R first-dir/file5"
3766	  if ${testcvs} -q log first-dir >>${LOGFILE}; then
3767	    pass basic1-22-rm-rm
3768	  else
3769	    fail basic1-22-rm-rm
3770	  fi
3771	  if ${testcvs} -q status first-dir >>${LOGFILE}; then
3772	    pass basic1-23-rm-rm
3773	  else
3774	    fail basic1-23-rm-rm
3775	  fi
3776	  dotest basic1-24-rm-rm "${testcvs} -q update first-dir" \
3777"R first-dir/file2
3778R first-dir/file3
3779R first-dir/file4
3780R first-dir/file5"
3781	  dotest basic1-27-rm-rm "${testcvs} -q co first-dir" \
3782"R first-dir/file2
3783R first-dir/file3
3784R first-dir/file4
3785R first-dir/file5"
3786	  cd first-dir
3787	  dotest basic1-14-rm-ci "${testcvs} -q commit -m test" \
3788"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
3789new revision: delete; previous revision: 1\.1
3790$CVSROOT_DIRNAME/first-dir/file3,v  <--  file3
3791new revision: delete; previous revision: 1\.1
3792$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
3793new revision: delete; previous revision: 1\.1
3794$CVSROOT_DIRNAME/first-dir/file5,v  <--  file5
3795new revision: delete; previous revision: 1\.1"
3796	  dotest basic1-15-rm-ci \
3797"${testcvs} -q update file2 file3 file4 file5" ''
3798	  dotest basic1-16-rm-ci "${testcvs} -q update" ''
3799	  dotest basic1-17-rm-ci "${testcvs} -q status" ''
3800	  # Would be nice to test that real logs appear (with dead state
3801	  # and all), either here or someplace like log2 tests.
3802	  if ${testcvs} -q log >>${LOGFILE}; then
3803	    pass basic1-18-rm-ci
3804	  else
3805	    fail basic1-18-rm-ci
3806	  fi
3807	  cd ..
3808	  dotest basic1-21-rm-ci "${testcvs} -q update" ''
3809	  if ${testcvs} -q log first-dir >>${LOGFILE}; then
3810	    pass basic1-22-rm-ci
3811	  else
3812	    fail basic1-22-rm-ci
3813	  fi
3814	  if ${testcvs} -q status first-dir >>${LOGFILE}; then
3815	    pass basic1-23-rm-ci
3816	  else
3817	    fail basic1-23-rm-ci
3818	  fi
3819	  dotest basic1-24-rm-ci "${testcvs} -q update first-dir" ''
3820	  dotest basic1-27-rm-ci "${testcvs} -q co first-dir" ''
3821	  cd first-dir
3822	  # All the files are removed, so nothing gets tagged.
3823	  dotest basic1-28 "${testcvs} -q tag first-dive" ''
3824	  cd ..
3825	  cd ..
3826
3827	  if $keep; then
3828	    echo Keeping ${TESTDIR} and exiting due to --keep
3829	    exit 0
3830	  fi
3831
3832	  rm -r basic1
3833	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
3834	  ;;
3835
3836
3837
3838	deep)
3839	  # Test the ability to operate on directories nested rather deeply.
3840	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
3841	  dotest deep-1 "${testcvs} -q co first-dir" ''
3842	  cd first-dir
3843	  for i in dir1 dir2 dir3 dir4 dir5 dir6 dir7 dir8; do
3844	    mkdir $i
3845	    dotest deep-2-$i "${testcvs} add $i" \
3846"Directory ${CVSROOT_DIRNAME}/first-dir/dir1[/dir0-9]* added to the repository"
3847	    cd $i
3848	    echo file1 >file1
3849	    dotest deep-3-$i "${testcvs} add file1" \
3850"${SPROG}"' add: scheduling file `file1'\'' for addition
3851'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
3852	  done
3853	  cd ../../../../../../../../..
3854	  dotest_lit deep-4 "$testcvs -q ci -m add-them first-dir" <<HERE
3855$CVSROOT_DIRNAME/first-dir/dir1/file1,v  <--  first-dir/dir1/file1
3856initial revision: 1.1
3857$CVSROOT_DIRNAME/first-dir/dir1/dir2/file1,v  <--  first-dir/dir1/dir2/file1
3858initial revision: 1.1
3859$CVSROOT_DIRNAME/first-dir/dir1/dir2/dir3/file1,v  <--  first-dir/dir1/dir2/dir3/file1
3860initial revision: 1.1
3861$CVSROOT_DIRNAME/first-dir/dir1/dir2/dir3/dir4/file1,v  <--  first-dir/dir1/dir2/dir3/dir4/file1
3862initial revision: 1.1
3863$CVSROOT_DIRNAME/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v  <--  first-dir/dir1/dir2/dir3/dir4/dir5/file1
3864initial revision: 1.1
3865$CVSROOT_DIRNAME/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v  <--  first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1
3866initial revision: 1.1
3867$CVSROOT_DIRNAME/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v  <--  first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1
3868initial revision: 1.1
3869$CVSROOT_DIRNAME/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v  <--  first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1
3870initial revision: 1.1
3871HERE
3872
3873	  cd first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
3874	  rm file1
3875	  dotest deep-4a0 "$testcvs rm file1" \
3876"$SPROG remove: scheduling .file1. for removal
3877$SPROG remove: use .$SPROG commit. to remove this file permanently"
3878	  dotest deep-4a1 "$testcvs -q ci -m rm-it" \
3879"$CVSROOT_DIRNAME/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v  <--  file1
3880new revision: delete; previous revision: 1\.1"
3881	  cd ../../..
3882	  dotest deep-4a2 "${testcvs} -q update -P dir6/dir7" ''
3883	  # Should be using "test -e", but it's not portable enough -
3884	  # Solaris 2.5 does not have it.
3885	  dotest_fail deep-4a3 "test -d dir6/dir7/dir8" ''
3886
3887	  # Test that if we remove the working directory, CVS does not
3888	  # recreate it.  (I realize that this behavior is what the
3889	  # users expect, but in the longer run we might want to
3890	  # re-think it.  The corresponding behavior for a file is that
3891	  # CVS *will* recreate it, and we might want to make it so
3892	  # that "cvs release -d" is the way to delete the directory
3893	  # and have it stay gone -kingdon, Oct1996).
3894	  rm -r dir6
3895	  dotest deep-4b0a "${testcvs} -q diff"
3896	  dotest deep-4b0b "${testcvs} -q ci"
3897	  dotest deep-4b1 "${testcvs} -q update"
3898	  dotest deep-4b2 "${testcvs} -q update -d -P" \
3899'U dir6/file1
3900U dir6/dir7/file1'
3901
3902	  # Test what happens if one uses -P when there are files removed
3903	  # but not committed.
3904	  cd dir6/dir7
3905	  dotest deep-rm1 "${testcvs} rm -f file1" \
3906"${SPROG} remove: scheduling .file1. for removal
3907${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
3908	  cd ..
3909	  dotest deep-rm2 "${testcvs} -q update -d -P" 'R dir7/file1'
3910	  dotest deep-rm3 "test -d dir7" ''
3911	  dotest deep-rm4 "$testcvs -q ci -m rm-it" \
3912"$CVSROOT_DIRNAME/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v  <--  dir7/file1
3913new revision: delete; previous revision: 1\.1"
3914	  dotest deep-rm5 "${testcvs} -q update -d -P" ''
3915	  dotest_fail deep-rm6 "test -d dir7" ''
3916
3917	  # Test rm -f -R.
3918	  cd ../..
3919	  dotest deep-rm7 "${testcvs} rm -f -R dir5" \
3920"${SPROG} remove: Removing dir5
3921${SPROG} remove: scheduling .dir5/file1. for removal
3922${SPROG} remove: Removing dir5/dir6
3923${SPROG} remove: scheduling .dir5/dir6/file1. for removal
3924${SPROG} remove: use .${SPROG} commit. to remove these files permanently"
3925	  dotest deep-rm8 "${testcvs} -q ci -m rm-it" \
3926"$CVSROOT_DIRNAME/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v  <--  dir5/file1
3927new revision: delete; previous revision: 1\.1
3928$CVSROOT_DIRNAME/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v  <--  dir5/dir6/file1
3929new revision: delete; previous revision: 1\.1"
3930	  dotest deep-rm9 "${testcvs} -q update -d -P" ''
3931	  dotest_fail deep-rm10 "test -d dir5"
3932
3933	  cd ../../../../..
3934
3935	  if echo "yes" | $testcvs release -d first-dir >>$LOGFILE 2>&1; then
3936	    pass deep-5
3937	  else
3938	    fail deep-5
3939	  fi
3940	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
3941	  ;;
3942
3943
3944
3945	basic2)
3946		# Test rtag, import, history, various miscellaneous operations
3947
3948		# NOTE: this section has reached the size and
3949		# complexity where it is getting to be a good idea to
3950		# add new tests to a new section rather than
3951		# continuing to piggyback them onto the tests here.
3952
3953		# First empty the history file
3954		modify_repo rm -rf $CVSROOT_DIRNAME/CVSROOT/history
3955		modify_repo touch $CVSROOT_DIRNAME/CVSROOT/history
3956
3957		modify_repo mkdir $CVSROOT_DIRNAME/first-dir
3958		dotest basic2-1 "$testcvs -q co first-dir"
3959		for i in first-dir dir1 dir2 ; do
3960			if test ! -d $i ; then
3961				mkdir $i
3962				dotest basic2-2-$i "${testcvs} add $i" \
3963"Directory ${CVSROOT_DIRNAME}/.*/$i added to the repository"
3964			fi
3965
3966			cd $i
3967
3968			for j in file6 file7; do
3969				echo $j > $j
3970			done
3971
3972			dotest basic2-3-$i "${testcvs} add file6 file7" \
3973"${SPROG} add: scheduling file .file6. for addition
3974${SPROG} add: scheduling file .file7. for addition
3975${SPROG} add: use .${SPROG} commit. to add these files permanently"
3976
3977		done
3978		cd ../../..
3979		dotest basic2-4 "${testcvs} update first-dir" \
3980"${SPROG} update: Updating first-dir
3981A first-dir/file6
3982A first-dir/file7
3983${SPROG} update: Updating first-dir/dir1
3984A first-dir/dir1/file6
3985A first-dir/dir1/file7
3986${SPROG} update: Updating first-dir/dir1/dir2
3987A first-dir/dir1/dir2/file6
3988A first-dir/dir1/dir2/file7"
3989
3990		# fixme: doesn't work right for added files.
3991		dotest basic2-5 "${testcvs} log first-dir" \
3992"${SPROG} log: Logging first-dir
3993${SPROG} log: file6 has been added, but not committed
3994${SPROG} log: file7 has been added, but not committed
3995${SPROG} log: Logging first-dir/dir1
3996${SPROG} log: file6 has been added, but not committed
3997${SPROG} log: file7 has been added, but not committed
3998${SPROG} log: Logging first-dir/dir1/dir2
3999${SPROG} log: file6 has been added, but not committed
4000${SPROG} log: file7 has been added, but not committed"
4001
4002		dotest basic2-6 "${testcvs} status first-dir" \
4003"${SPROG} status: Examining first-dir
4004===================================================================
4005File: file6            	Status: Locally Added
4006
4007   Working revision:	New file!
4008   Repository revision:	No revision control file
4009   Sticky Tag:		(none)
4010   Sticky Date:		(none)
4011   Sticky Options:	(none)
4012
4013===================================================================
4014File: file7            	Status: Locally Added
4015
4016   Working revision:	New file!
4017   Repository revision:	No revision control file
4018   Sticky Tag:		(none)
4019   Sticky Date:		(none)
4020   Sticky Options:	(none)
4021
4022${SPROG} status: Examining first-dir/dir1
4023===================================================================
4024File: file6            	Status: Locally Added
4025
4026   Working revision:	New file!
4027   Repository revision:	No revision control file
4028   Sticky Tag:		(none)
4029   Sticky Date:		(none)
4030   Sticky Options:	(none)
4031
4032===================================================================
4033File: file7            	Status: Locally Added
4034
4035   Working revision:	New file!
4036   Repository revision:	No revision control file
4037   Sticky Tag:		(none)
4038   Sticky Date:		(none)
4039   Sticky Options:	(none)
4040
4041${SPROG} status: Examining first-dir/dir1/dir2
4042===================================================================
4043File: file6            	Status: Locally Added
4044
4045   Working revision:	New file!
4046   Repository revision:	No revision control file
4047   Sticky Tag:		(none)
4048   Sticky Date:		(none)
4049   Sticky Options:	(none)
4050
4051===================================================================
4052File: file7            	Status: Locally Added
4053
4054   Working revision:	New file!
4055   Repository revision:	No revision control file
4056   Sticky Tag:		(none)
4057   Sticky Date:		(none)
4058   Sticky Options:	(none)"
4059
4060# XXX why is this commented out???
4061#		if ${CVS} diff -u first-dir   >> ${LOGFILE} || test $? = 1 ; then
4062#		    pass 34
4063#		else
4064#		    fail 34
4065#		fi
4066
4067		dotest basic2-8 "${testcvs} -q ci -m 'second dive' first-dir" \
4068"$CVSROOT_DIRNAME/first-dir/file6,v  <--  first-dir/file6
4069initial revision: 1\.1
4070$CVSROOT_DIRNAME/first-dir/file7,v  <--  first-dir/file7
4071initial revision: 1\.1
4072$CVSROOT_DIRNAME/first-dir/dir1/file6,v  <--  first-dir/dir1/file6
4073initial revision: 1\.1
4074$CVSROOT_DIRNAME/first-dir/dir1/file7,v  <--  first-dir/dir1/file7
4075initial revision: 1\.1
4076$CVSROOT_DIRNAME/first-dir/dir1/dir2/file6,v  <--  first-dir/dir1/dir2/file6
4077initial revision: 1\.1
4078$CVSROOT_DIRNAME/first-dir/dir1/dir2/file7,v  <--  first-dir/dir1/dir2/file7
4079initial revision: 1\.1"
4080
4081		dotest basic2-9 "${testcvs} tag second-dive first-dir" \
4082"${SPROG} tag: Tagging first-dir
4083T first-dir/file6
4084T first-dir/file7
4085${SPROG} tag: Tagging first-dir/dir1
4086T first-dir/dir1/file6
4087T first-dir/dir1/file7
4088${SPROG} tag: Tagging first-dir/dir1/dir2
4089T first-dir/dir1/dir2/file6
4090T first-dir/dir1/dir2/file7"
4091
4092		# third dive - in bunch o' directories, add bunch o' files,
4093		# delete some, change some.
4094
4095		for i in first-dir dir1 dir2 ; do
4096			cd $i
4097
4098			# modify a file
4099			echo file6 >>file6
4100
4101			# delete a file
4102			rm file7
4103
4104			dotest basic2-10-$i "${testcvs} rm file7" \
4105"${SPROG} remove: scheduling .file7. for removal
4106${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
4107
4108			# and add a new file
4109			echo file14 >file14
4110
4111			dotest basic2-11-$i "${testcvs} add file14" \
4112"${SPROG} add: scheduling file .file14. for addition
4113${SPROG} add: use .${SPROG} commit. to add this file permanently"
4114		done
4115
4116		cd ../../..
4117		dotest basic2-12 "${testcvs} update first-dir" \
4118"${SPROG} update: Updating first-dir
4119A first-dir/file14
4120M first-dir/file6
4121R first-dir/file7
4122${SPROG} update: Updating first-dir/dir1
4123A first-dir/dir1/file14
4124M first-dir/dir1/file6
4125R first-dir/dir1/file7
4126${SPROG} update: Updating first-dir/dir1/dir2
4127A first-dir/dir1/dir2/file14
4128M first-dir/dir1/dir2/file6
4129R first-dir/dir1/dir2/file7"
4130
4131		# FIXME: doesn't work right for added files
4132		dotest basic2-13 "${testcvs} log first-dir" \
4133"${SPROG} log: Logging first-dir
4134${SPROG} log: file14 has been added, but not committed
4135
4136RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
4137Working file: first-dir/file6
4138head: 1\.1
4139branch:
4140locks: strict
4141access list:
4142symbolic names:
4143	second-dive: 1\.1
4144keyword substitution: kv
4145total revisions: 1;	selected revisions: 1
4146description:
4147----------------------------
4148revision 1\.1
4149date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
4150second dive
4151=============================================================================
4152
4153RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
4154Working file: first-dir/file7
4155head: 1\.1
4156branch:
4157locks: strict
4158access list:
4159symbolic names:
4160	second-dive: 1\.1
4161keyword substitution: kv
4162total revisions: 1;	selected revisions: 1
4163description:
4164----------------------------
4165revision 1\.1
4166date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
4167second dive
4168=============================================================================
4169${SPROG} log: Logging first-dir/dir1
4170${SPROG} log: file14 has been added, but not committed
4171
4172RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
4173Working file: first-dir/dir1/file6
4174head: 1\.1
4175branch:
4176locks: strict
4177access list:
4178symbolic names:
4179	second-dive: 1\.1
4180keyword substitution: kv
4181total revisions: 1;	selected revisions: 1
4182description:
4183----------------------------
4184revision 1\.1
4185date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
4186second dive
4187=============================================================================
4188
4189RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
4190Working file: first-dir/dir1/file7
4191head: 1\.1
4192branch:
4193locks: strict
4194access list:
4195symbolic names:
4196	second-dive: 1\.1
4197keyword substitution: kv
4198total revisions: 1;	selected revisions: 1
4199description:
4200----------------------------
4201revision 1\.1
4202date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
4203second dive
4204=============================================================================
4205${SPROG} log: Logging first-dir/dir1/dir2
4206${SPROG} log: file14 has been added, but not committed
4207
4208RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
4209Working file: first-dir/dir1/dir2/file6
4210head: 1\.1
4211branch:
4212locks: strict
4213access list:
4214symbolic names:
4215	second-dive: 1\.1
4216keyword substitution: kv
4217total revisions: 1;	selected revisions: 1
4218description:
4219----------------------------
4220revision 1\.1
4221date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
4222second dive
4223=============================================================================
4224
4225RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
4226Working file: first-dir/dir1/dir2/file7
4227head: 1\.1
4228branch:
4229locks: strict
4230access list:
4231symbolic names:
4232	second-dive: 1\.1
4233keyword substitution: kv
4234total revisions: 1;	selected revisions: 1
4235description:
4236----------------------------
4237revision 1\.1
4238date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
4239second dive
4240============================================================================="
4241
4242		dotest basic2-14 "${testcvs} status first-dir" \
4243"${SPROG} status: Examining first-dir
4244===================================================================
4245File: file14           	Status: Locally Added
4246
4247   Working revision:	New file!
4248   Repository revision:	No revision control file
4249   Sticky Tag:		(none)
4250   Sticky Date:		(none)
4251   Sticky Options:	(none)
4252
4253===================================================================
4254File: file6            	Status: Locally Modified
4255
4256   Working revision:	1\.1.*
4257   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file6,v
4258   Commit Identifier:	${commitid}
4259   Sticky Tag:		(none)
4260   Sticky Date:		(none)
4261   Sticky Options:	(none)
4262
4263===================================================================
4264File: no file file7		Status: Locally Removed
4265
4266   Working revision:	-1\.1.*
4267   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file7,v
4268   Commit Identifier:	${commitid}
4269   Sticky Tag:		(none)
4270   Sticky Date:		(none)
4271   Sticky Options:	(none)
4272
4273${SPROG} status: Examining first-dir/dir1
4274===================================================================
4275File: file14           	Status: Locally Added
4276
4277   Working revision:	New file!
4278   Repository revision:	No revision control file
4279   Sticky Tag:		(none)
4280   Sticky Date:		(none)
4281   Sticky Options:	(none)
4282
4283===================================================================
4284File: file6            	Status: Locally Modified
4285
4286   Working revision:	1\.1.*
4287   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
4288   Commit Identifier:	${commitid}
4289   Sticky Tag:		(none)
4290   Sticky Date:		(none)
4291   Sticky Options:	(none)
4292
4293===================================================================
4294File: no file file7		Status: Locally Removed
4295
4296   Working revision:	-1\.1.*
4297   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
4298   Commit Identifier:	${commitid}
4299   Sticky Tag:		(none)
4300   Sticky Date:		(none)
4301   Sticky Options:	(none)
4302
4303${SPROG} status: Examining first-dir/dir1/dir2
4304===================================================================
4305File: file14           	Status: Locally Added
4306
4307   Working revision:	New file!
4308   Repository revision:	No revision control file
4309   Sticky Tag:		(none)
4310   Sticky Date:		(none)
4311   Sticky Options:	(none)
4312
4313===================================================================
4314File: file6            	Status: Locally Modified
4315
4316   Working revision:	1\.1.*
4317   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
4318   Commit Identifier:	${commitid}
4319   Sticky Tag:		(none)
4320   Sticky Date:		(none)
4321   Sticky Options:	(none)
4322
4323===================================================================
4324File: no file file7		Status: Locally Removed
4325
4326   Working revision:	-1\.1.*
4327   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
4328   Commit Identifier:	${commitid}
4329   Sticky Tag:		(none)
4330   Sticky Date:		(none)
4331   Sticky Options:	(none)${DOTSTAR}"
4332
4333# XXX why is this commented out?
4334#		if ${CVS} diff -u first-dir  >> ${LOGFILE} || test $? = 1 ; then
4335#		    pass 42
4336#		else
4337#		    fail 42
4338#		fi
4339
4340		dotest basic2-16 "${testcvs} ci -m 'third dive' first-dir" \
4341"${CPROG} commit: Examining first-dir
4342${CPROG} commit: Examining first-dir/dir1
4343${CPROG} commit: Examining first-dir/dir1/dir2
4344${CVSROOT_DIRNAME}/first-dir/file14,v  <--  first-dir/file14
4345initial revision: 1\.1
4346${CVSROOT_DIRNAME}/first-dir/file6,v  <--  first-dir/file6
4347new revision: 1\.2; previous revision: 1\.1
4348${CVSROOT_DIRNAME}/first-dir/file7,v  <--  first-dir/file7
4349new revision: delete; previous revision: 1\.1
4350${CVSROOT_DIRNAME}/first-dir/dir1/file14,v  <--  first-dir/dir1/file14
4351initial revision: 1\.1
4352${CVSROOT_DIRNAME}/first-dir/dir1/file6,v  <--  first-dir/dir1/file6
4353new revision: 1\.2; previous revision: 1\.1
4354${CVSROOT_DIRNAME}/first-dir/dir1/file7,v  <--  first-dir/dir1/file7
4355new revision: delete; previous revision: 1\.1
4356${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v  <--  first-dir/dir1/dir2/file14
4357initial revision: 1\.1
4358${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v  <--  first-dir/dir1/dir2/file6
4359new revision: 1\.2; previous revision: 1\.1
4360${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v  <--  first-dir/dir1/dir2/file7
4361new revision: delete; previous revision: 1\.1"
4362		dotest basic2-17 "${testcvs} -q update first-dir" ''
4363
4364		dotest basic2-18 "${testcvs} tag third-dive first-dir" \
4365"${SPROG} tag: Tagging first-dir
4366T first-dir/file14
4367T first-dir/file6
4368${SPROG} tag: Tagging first-dir/dir1
4369T first-dir/dir1/file14
4370T first-dir/dir1/file6
4371${SPROG} tag: Tagging first-dir/dir1/dir2
4372T first-dir/dir1/dir2/file14
4373T first-dir/dir1/dir2/file6"
4374
4375		dotest basic2-19 "echo yes | ${testcvs} release -d first-dir" \
4376"You have \[0\] altered files in this repository\.
4377Are you sure you want to release (and delete) directory .first-dir.: "
4378
4379		# end of third dive
4380		dotest_fail basic2-20 "test -d first-dir" ""
4381
4382		# now try some rtags
4383
4384		# rtag HEADS
4385		dotest basic2-21 "${testcvs} rtag rtagged-by-head first-dir" \
4386"${SPROG} rtag: Tagging first-dir
4387${SPROG} rtag: Tagging first-dir/dir1
4388${SPROG} rtag: Tagging first-dir/dir1/dir2"
4389
4390		dotest basic2-21b "${testcvs} co -p -r rtagged-by-head first-dir/file6" \
4391"===================================================================
4392Checking out first-dir/file6
4393RCS:  $CVSROOT_DIRNAME/first-dir/file6,v
4394VERS: 1\.2
4395\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4396file6
4397file6"
4398		# see what happens when val-tags is removed
4399		modify_repo mv $CVSROOT_DIRNAME/CVSROOT/val-tags \
4400				$CVSROOT_DIRNAME/CVSROOT/val-tags.save
4401		# The output for this used to be something like:
4402		# "${SPROG} checkout: cannot open CVS/Entries for reading: No such file or directory
4403		# ${SPROG} \[checkout aborted\]: no such tag \`rtagged-by-head'"
4404
4405		dotest basic2-21c \
4406"${testcvs} co -p -r rtagged-by-head first-dir/file6" \
4407"===================================================================
4408Checking out first-dir/file6
4409RCS:  $CVSROOT_DIRNAME/first-dir/file6,v
4410VERS: 1\.2
4411\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4412file6
4413file6"
4414		modify_repo mv $CVSROOT_DIRNAME/CVSROOT/val-tags.save \
4415				$CVSROOT_DIRNAME/CVSROOT/val-tags
4416
4417		# tag by tag
4418		dotest basic2-22 "${testcvs} rtag -r rtagged-by-head rtagged-by-tag first-dir" \
4419"${SPROG} rtag: Tagging first-dir
4420${SPROG} rtag: Tagging first-dir/dir1
4421${SPROG} rtag: Tagging first-dir/dir1/dir2"
4422
4423		# tag by revision
4424		dotest basic2-23 "${testcvs} rtag -r1.1 rtagged-by-revision first-dir" \
4425"${SPROG} rtag: Tagging first-dir
4426${SPROG} rtag: Tagging first-dir/dir1
4427${SPROG} rtag: Tagging first-dir/dir1/dir2"
4428
4429		# rdiff by revision
4430		dotest basic2-24 "${testcvs} rdiff -r1.1 -rrtagged-by-head first-dir" \
4431"${SPROG} rdiff: Diffing first-dir
4432Index: first-dir/file6
4433diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
4434\*\*\* first-dir/file6:1\.1	${DATE}
4435--- first-dir/file6	${DATE}
4436\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4437\*\*\* 1 \*\*\*\*
4438--- 1,2 ----
4439  file6
4440${PLUS} file6
4441Index: first-dir/file7
4442diff -c first-dir/file7:1\.1 first-dir/file7:removed
4443\*\*\* first-dir/file7:1.1	${DATE}
4444--- first-dir/file7	${DATE}
4445\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4446\*\*\* 1 \*\*\*\*
4447- file7
4448--- 0 ----
4449${SPROG} rdiff: Diffing first-dir/dir1
4450Index: first-dir/dir1/file6
4451diff -c first-dir/dir1/file6:1\.1 first-dir/dir1/file6:1\.2
4452\*\*\* first-dir/dir1/file6:1\.1	${DATE}
4453--- first-dir/dir1/file6	${DATE}
4454\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4455\*\*\* 1 \*\*\*\*
4456--- 1,2 ----
4457  file6
4458${PLUS} file6
4459Index: first-dir/dir1/file7
4460diff -c first-dir/dir1/file7:1\.1 first-dir/dir1/file7:removed
4461\*\*\* first-dir/dir1/file7:1\.1	${DATE}
4462--- first-dir/dir1/file7	${DATE}
4463\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4464\*\*\* 1 \*\*\*\*
4465- file7
4466--- 0 ----
4467${SPROG} rdiff: Diffing first-dir/dir1/dir2
4468Index: first-dir/dir1/dir2/file6
4469diff -c first-dir/dir1/dir2/file6:1\.1 first-dir/dir1/dir2/file6:1\.2
4470\*\*\* first-dir/dir1/dir2/file6:1\.1	${DATE}
4471--- first-dir/dir1/dir2/file6	${DATE}
4472\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4473\*\*\* 1 \*\*\*\*
4474--- 1,2 ----
4475  file6
4476${PLUS} file6
4477Index: first-dir/dir1/dir2/file7
4478diff -c first-dir/dir1/dir2/file7:1\.1 first-dir/dir1/dir2/file7:removed
4479\*\*\* first-dir/dir1/dir2/file7:1\.1	${DATE}
4480--- first-dir/dir1/dir2/file7	${DATE}
4481\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4482\*\*\* 1 \*\*\*\*
4483- file7
4484--- 0 ----"
4485		dotest basic2-24a "${testcvs} rdiff -l -r1.1 -rrtagged-by-head first-dir" \
4486"${SPROG} rdiff: Diffing first-dir
4487Index: first-dir/file6
4488diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
4489\*\*\* first-dir/file6:1\.1	${DATE}
4490--- first-dir/file6	${DATE}
4491\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4492\*\*\* 1 \*\*\*\*
4493--- 1,2 ----
4494  file6
4495${PLUS} file6
4496Index: first-dir/file7
4497diff -c first-dir/file7:1\.1 first-dir/file7:removed
4498\*\*\* first-dir/file7:1.1	${DATE}
4499--- first-dir/file7	${DATE}
4500\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
4501\*\*\* 1 \*\*\*\*
4502- file7
4503--- 0 ----"
4504		# now export by rtagged-by-head and rtagged-by-tag and compare.
4505		dotest basic2-25 "${testcvs} export -r rtagged-by-head -d 1dir first-dir" \
4506"${SPROG} export: Updating 1dir
4507U 1dir/file14
4508U 1dir/file6
4509${SPROG} export: Updating 1dir/dir1
4510U 1dir/dir1/file14
4511U 1dir/dir1/file6
4512${SPROG} export: Updating 1dir/dir1/dir2
4513U 1dir/dir1/dir2/file14
4514U 1dir/dir1/dir2/file6"
4515		dotest_fail basic2-25a "test -d 1dir/CVS"
4516		dotest_fail basic2-25b "test -d 1dir/dir1/CVS"
4517		dotest_fail basic2-25c "test -d 1dir/dir1/dir2/CVS"
4518
4519		dotest basic2-26 "${testcvs} export -r rtagged-by-tag first-dir" \
4520"${SPROG} export: Updating first-dir
4521U first-dir/file14
4522U first-dir/file6
4523${SPROG} export: Updating first-dir/dir1
4524U first-dir/dir1/file14
4525U first-dir/dir1/file6
4526${SPROG} export: Updating first-dir/dir1/dir2
4527U first-dir/dir1/dir2/file14
4528U first-dir/dir1/dir2/file6"
4529		dotest_fail basic2-26a "test -d first-dir/CVS"
4530		dotest_fail basic2-26b "test -d first-dir/dir1/CVS"
4531		dotest_fail basic2-26c "test -d first-dir/dir1/dir2/CVS"
4532
4533		dotest basic2-27 "directory_cmp 1dir first-dir"
4534		rm -r 1dir first-dir
4535
4536		# checkout by revision vs export by rtagged-by-revision and compare.
4537		mkdir export-dir
4538		dotest basic2-28 "${testcvs} export -rrtagged-by-revision -d export-dir first-dir" \
4539"${SPROG} export: Updating export-dir
4540U export-dir/file14
4541U export-dir/file6
4542U export-dir/file7
4543${SPROG} export: Updating export-dir/dir1
4544U export-dir/dir1/file14
4545U export-dir/dir1/file6
4546U export-dir/dir1/file7
4547${SPROG} export: Updating export-dir/dir1/dir2
4548U export-dir/dir1/dir2/file14
4549U export-dir/dir1/dir2/file6
4550U export-dir/dir1/dir2/file7"
4551		dotest_fail basic2-28a "test -d export-dir/CVS"
4552		dotest_fail basic2-28b "test -d export-dir/dir1/CVS"
4553		dotest_fail basic2-28c "test -d export-dir/dir1/dir2/CVS"
4554
4555		dotest basic2-29 "${testcvs} co -r1.1 first-dir" \
4556"${SPROG} checkout: Updating first-dir
4557U first-dir/file14
4558U first-dir/file6
4559U first-dir/file7
4560${SPROG} checkout: Updating first-dir/dir1
4561U first-dir/dir1/file14
4562U first-dir/dir1/file6
4563U first-dir/dir1/file7
4564${SPROG} checkout: Updating first-dir/dir1/dir2
4565U first-dir/dir1/dir2/file14
4566U first-dir/dir1/dir2/file6
4567U first-dir/dir1/dir2/file7"
4568
4569		# directory copies are done in an oblique way in order to avoid a bug in sun's tmp filesystem.
4570		mkdir first-dir.cpy ; (cd first-dir ; tar cf - . | (cd ../first-dir.cpy ; tar xf -))
4571
4572		dotest basic2-30 "directory_cmp first-dir export-dir"
4573
4574		# interrupt, while we've got a clean 1.1 here, let's import it
4575		# into a couple of other modules.
4576		cd export-dir
4577		dotest_sort basic2-31 \
4578"$testcvs import -m first-import second-dir first-immigration immigration1 immigration1_0" \
4579"
4580
4581N second-dir/dir1/dir2/file14
4582N second-dir/dir1/dir2/file6
4583N second-dir/dir1/dir2/file7
4584N second-dir/dir1/file14
4585N second-dir/dir1/file6
4586N second-dir/dir1/file7
4587N second-dir/file14
4588N second-dir/file6
4589N second-dir/file7
4590No conflicts created by this import
4591${SPROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/dir1
4592${SPROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/dir1/dir2"
4593		cd ..
4594
4595		dotest basic2-32 "${testcvs} export -r HEAD second-dir" \
4596"${SPROG} export: Updating second-dir
4597U second-dir/file14
4598U second-dir/file6
4599U second-dir/file7
4600${SPROG} export: Updating second-dir/dir1
4601U second-dir/dir1/file14
4602U second-dir/dir1/file6
4603U second-dir/dir1/file7
4604${SPROG} export: Updating second-dir/dir1/dir2
4605U second-dir/dir1/dir2/file14
4606U second-dir/dir1/dir2/file6
4607U second-dir/dir1/dir2/file7"
4608
4609		dotest basic2-33 "directory_cmp first-dir second-dir"
4610
4611		rm -r second-dir
4612
4613		rm -r export-dir first-dir
4614		mkdir first-dir
4615		(cd first-dir.cpy ; tar cf - . | (cd ../first-dir ; tar xf -))
4616
4617		# update the top, cancelling sticky tags, retag, update other copy, compare.
4618		cd first-dir
4619		dotest basic2-34 "${testcvs} update -A -l *file*" \
4620"[UP] file6
4621${SPROG} update: \`file7' is no longer in the repository"
4622
4623		# If we don't delete the tag first, cvs won't retag it.
4624		# This would appear to be a feature.
4625		dotest basic2-35 "${testcvs} tag -l -d rtagged-by-revision" \
4626"${SPROG} tag: Untagging \.
4627D file14
4628D file6"
4629		dotest basic2-36 "${testcvs} tag -l rtagged-by-revision" \
4630"${SPROG} tag: Tagging \.
4631T file14
4632T file6"
4633
4634		cd ..
4635		mv first-dir 1dir
4636		mv first-dir.cpy first-dir
4637		cd first-dir
4638
4639		dotest basic2-37 "${testcvs} -q diff -u" ''
4640
4641		dotest basic2-38 "${testcvs} update" \
4642"${SPROG} update: Updating .
4643${SPROG} update: Updating dir1
4644${SPROG} update: Updating dir1/dir2"
4645
4646		cd ..
4647
4648		#### FIXME: is this expected to work???  Need to investigate
4649		#### and fix or remove the test.
4650#		dotest basic2-39 "directory_cmp 1dir first-dir"
4651
4652		rm -r 1dir first-dir
4653
4654		# Test the cvs history command.
4655		#
4656		# Just skip these in write proxy mode for now.  We should only
4657		# see write commands and maybe the last few reads in the
4658		# secondary history file the way we currently sync, but I'm not
4659		# going to try and test this yet.
4660		if $proxy; then :; else
4661
4662		# The reason that there are two patterns rather than using
4663		# \(${TESTDIR}\|<remote>\) is that we are trying to
4664		# make this portable.  Perhaps at some point we should
4665		# ditch that notion and require GNU expr (or dejagnu or....)
4666		# since it seems to be so painful.
4667
4668		dotest basic2-64 "${testcvs} his -x TOFWUPCGMAR -a" \
4669"O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir           =first-dir= ${TESTDIR}/\*
4670A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6     first-dir           == ${TESTDIR}
4671A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7     first-dir           == ${TESTDIR}
4672A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6     first-dir/dir1      == ${TESTDIR}
4673A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7     first-dir/dir1      == ${TESTDIR}
4674A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6     first-dir/dir1/dir2 == ${TESTDIR}
4675A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7     first-dir/dir1/dir2 == ${TESTDIR}
4676T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[second-dive:A\]
4677A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14    first-dir           == ${TESTDIR}
4678M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6     first-dir           == ${TESTDIR}
4679R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7     first-dir           == ${TESTDIR}
4680A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14    first-dir/dir1      == ${TESTDIR}
4681M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6     first-dir/dir1      == ${TESTDIR}
4682R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7     first-dir/dir1      == ${TESTDIR}
4683A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14    first-dir/dir1/dir2 == ${TESTDIR}
4684M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6     first-dir/dir1/dir2 == ${TESTDIR}
4685R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7     first-dir/dir1/dir2 == ${TESTDIR}
4686T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[third-dive:A\]
4687F [0-9-]* [0-9:]* ${PLUS}0000 ${username}                     =first-dir= ${TESTDIR}/\*
4688T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
4689T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
4690T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
4691O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir           =first-dir= ${TESTDIR}/\*
4692U [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6     first-dir           == ${TESTDIR}/first-dir
4693W [0-9-]* [0-9:]* ${PLUS}0000 ${username}     file7     first-dir           == ${TESTDIR}/first-dir" \
4694"O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir           =first-dir= <remote>/\*
4695A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6     first-dir           == <remote>
4696A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7     first-dir           == <remote>
4697A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6     first-dir/dir1      == <remote>
4698A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7     first-dir/dir1      == <remote>
4699A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6     first-dir/dir1/dir2 == <remote>
4700A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7     first-dir/dir1/dir2 == <remote>
4701T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[second-dive:A\]
4702A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14    first-dir           == <remote>
4703M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6     first-dir           == <remote>
4704R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7     first-dir           == <remote>
4705A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14    first-dir/dir1      == <remote>
4706M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6     first-dir/dir1      == <remote>
4707R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7     first-dir/dir1      == <remote>
4708A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14    first-dir/dir1/dir2 == <remote>
4709M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6     first-dir/dir1/dir2 == <remote>
4710R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7     first-dir/dir1/dir2 == <remote>
4711T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[third-dive:A\]
4712F [0-9-]* [0-9:]* ${PLUS}0000 ${username}                     =first-dir= <remote>/\*
4713T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
4714T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
4715T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
4716O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir           =first-dir= <remote>/\*
4717P [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6     first-dir           == <remote>
4718W [0-9-]* [0-9:]* ${PLUS}0000 ${username}     file7     first-dir           == <remote>"
4719	  fi
4720
4721	  dokeep
4722	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
4723			     $CVSROOT_DIRNAME/second-dir
4724	  ;;
4725
4726
4727
4728	ls)
4729	  # Test the ls & rls commands.  There are some tests of
4730	  # Interaction of ls, rls, and branches in branches2.
4731	  mkdir ls; cd ls
4732	  dotest ls-init-1 "$testcvs -Q co -dtop ."
4733	  cd top
4734	  dotest ls-1 "$testcvs ls CVSROOT" \
4735"access
4736aclconfig
4737checkoutlist
4738commitinfo
4739config
4740cvswrappers
4741group
4742loginfo
4743modules
4744notify
4745postadmin
4746postproxy
4747posttag
4748postwatch
4749preproxy
4750rcsinfo
4751taginfo
4752verifymsg"
4753	  dotest ls-2 "$testcvs ls -R" \
4754"\.:
4755CVSROOT
4756
4757CVSROOT:
4758access
4759aclconfig
4760checkoutlist
4761commitinfo
4762config
4763cvswrappers
4764group
4765loginfo
4766modules
4767notify
4768postadmin
4769postproxy
4770posttag
4771postwatch
4772preproxy
4773rcsinfo
4774taginfo
4775verifymsg"
4776	  # This used to cause a fatal error.
4777	  modify_repo mkdir $CVSROOT_DIRNAME/notcheckedout
4778	  dotest ls-3 "$testcvs ls -RP" \
4779"\.:
4780CVSROOT
4781notcheckedout
4782
4783CVSROOT:
4784access
4785aclconfig
4786checkoutlist
4787commitinfo
4788config
4789cvswrappers
4790group
4791loginfo
4792modules
4793notify
4794postadmin
4795postproxy
4796posttag
4797postwatch
4798preproxy
4799rcsinfo
4800taginfo
4801verifymsg"
4802
4803	  # Make sure the previous command did not create the notcheckedout
4804	  # directory.
4805	  dotest_fail ls-4 "test -d notcheckedout"
4806
4807	  dotest ls-5 "$testcvs ls -R" \
4808"\.:
4809CVSROOT
4810notcheckedout
4811
4812CVSROOT:
4813access
4814aclconfig
4815checkoutlist
4816commitinfo
4817config
4818cvswrappers
4819group
4820loginfo
4821modules
4822notify
4823postadmin
4824postproxy
4825posttag
4826postwatch
4827preproxy
4828rcsinfo
4829taginfo
4830verifymsg
4831
4832notcheckedout:"
4833	  dotest_fail ls-6 "test -d notcheckedout"
4834
4835	  # Several test for ls -d, which shows dead revisions
4836
4837	  # Set up the dead files
4838	  mkdir cemetery
4839	  dotest ls-d-init-1 "$testcvs -Q add cemetery"
4840	  cd cemetery
4841	  touch dead living
4842	  dotest ls-d-init-2 "$testcvs -Q add dead living"
4843	  dotest ls-d-init-3 "$testcvs -Q ci -mm dead living"
4844	  dotest ls-d-init-4 "$testcvs -Q tag -b branch"
4845	  dotest ls-d-init-5 "$testcvs -Q up -A"
4846	  rm dead
4847	  dotest ls-d-init-6 "$testcvs -Q rm dead"
4848	  dotest ls-d-init-7 "$testcvs -Q ci -mm dead"
4849	  dotest ls-d-init-8 "$testcvs -Q up -r branch"
4850	  rm dead
4851	  dotest ls-d-init-9 "$testcvs -Q rm dead"
4852	  dotest ls-d-init-10 "$testcvs -Q ci -mm dead"
4853
4854	  # Possible output
4855	  output_living="living"
4856	  output_dead="dead
4857living"
4858
4859	  # The basic test is to make sure that dead revisions are shown if and
4860	  # only if -d is speficified (and that live revisions are always
4861	  # shown).  The following test cases cover all combinations of these
4862	  # factors:
4863	  #
4864	  #    + Working directory is on branch or trunk
4865	  #    + ls or rls
4866	  #    + implicit branch, explicit trunk, or explicit branch
4867	  #    + -d present or absent
4868
4869	  # Working directory on trunk
4870	  $testcvs -Q up -A
4871
4872	  ## ls
4873	  dotest ls-d-1 "$testcvs ls" "$output_living"
4874	  dotest ls-d-2 "$testcvs ls -d" "$output_dead"
4875
4876	  dotest ls-d-3 "$testcvs ls -rHEAD" "$output_living"
4877	  dotest ls-d-4 "$testcvs ls -drHEAD" "$output_dead"
4878
4879	  dotest ls-d-5 "$testcvs ls -rbranch" "$output_living"
4880	  dotest ls-d-6 "$testcvs ls -drbranch" "$output_dead"
4881
4882	  ## rls
4883	  dotest ls-d-7 "$testcvs rls cemetery" \
4884"$SPROG rls: Listing module: \`cemetery'
4885$output_living"
4886	  dotest ls-d-8 "$testcvs rls -d cemetery" \
4887"$SPROG rls: Listing module: \`cemetery'
4888$output_dead"
4889
4890	  dotest ls-d-9 "$testcvs -q rls -rHEAD cemetery" "$output_living"
4891	  dotest ls-d-10 "$testcvs -q rls -drHEAD cemetery" "$output_dead"
4892
4893	  dotest ls-d-11 "$testcvs -q rls -rbranch cemetery" "$output_living"
4894	  dotest ls-d-12 "$testcvs -q rls -drbranch cemetery" "$output_dead"
4895
4896	  # Working directory on branch
4897	  $testcvs -Q up -r branch
4898
4899	  ## ls
4900	  dotest ls-d-13 "$testcvs ls" "$output_living"
4901	  dotest ls-d-14 "$testcvs ls -d" "$output_dead"
4902
4903	  dotest ls-d-15 "$testcvs ls -r HEAD" "$output_living"
4904	  dotest ls-d-16 "$testcvs ls -d -r HEAD" "$output_dead"
4905
4906	  dotest ls-d-17 "$testcvs ls -r branch" "$output_living"
4907	  dotest ls-d-18 "$testcvs ls -d -r branch" "$output_dead"
4908
4909	  ## rls
4910	  dotest ls-d-19 "$testcvs -q rls cemetery" "$output_living"
4911	  dotest ls-d-20 "$testcvs -q rls -d cemetery" "$output_dead"
4912
4913	  dotest ls-d-21 "$testcvs -q rls -rHEAD cemetery" "$output_living"
4914	  dotest ls-d-22 "$testcvs -q rls -drHEAD cemetery" "$output_dead"
4915
4916	  dotest ls-d-23 "$testcvs -q rls -rbranch cemetery" "$output_living"
4917	  dotest ls-d-24 "$testcvs -q rls -drbranch cemetery" "$output_dead"
4918
4919	  # Some tests to cover specifying a file name as an option
4920	  # Combinations of factors:
4921	  #
4922	  #  + file in CVS/Entries or not
4923	  #  + current directory or subdirectory
4924	  #  + file dead or not
4925
4926	  # Switch back to the trunk
4927	  $testcvs -Q up -A
4928
4929	  ## file in CVS/Entries
4930	  dotest ls-filename-1 "$testcvs ls dead"
4931
4932	  # ls'ing a file that already exists once caused an assertion failure.
4933	  dotest ls-filename-2 "$testcvs ls living" "living"
4934
4935	  cd ..
4936	  dotest ls-filename-3 "$testcvs ls cemetery/dead"
4937
4938	  # ls'ing a file that already exists once caused an assertion failure.
4939	  dotest ls-filename-4 "$testcvs ls cemetery/living" "cemetery/living"
4940	  cd cemetery
4941
4942	  ## file not in CVS/Entries
4943	  echo D > CVS/Entries
4944
4945	  dotest ls-filename-5 "$testcvs ls dead"
4946
4947	  # ls'ing a file that already exists once caused an assertion failure.
4948	  dotest ls-filename-6 "$testcvs ls living" "living"
4949
4950	  cd ..
4951	  dotest ls-filename-7 "$testcvs ls cemetery/dead"
4952
4953	  # ls'ing a file that already exists once caused an assertion failure.
4954	  dotest ls-filename-8 "$testcvs ls cemetery/living" "cemetery/living"
4955
4956	  cd cemetery
4957
4958	  # Test the -D date option to cvs ls
4959
4960	  # try and list a file before it's created, during an old revision, in
4961	  # a period when it was dead and in the future
4962	  time_prebirth=`date '+%Y-%m-%d %H:%M:%S'` ; sleep 1
4963	  touch dated
4964	  dotest ls-D-init-1 "$testcvs -Q add dated"
4965	  dotest ls-D-init-2 "$testcvs -Q ci -mm dated"
4966	  time_newborn=`date '+%Y-%m-%d %H:%M:%S'` ; sleep 1
4967	  echo mm >> dated
4968	  dotest ls-D-init-2 "$testcvs -Q ci -mm dated"
4969	  time_predeath=`date '+%Y-%m-%d %H:%M:%S'` ; sleep 1
4970	  rm dated
4971	  dotest ls-D-init-3 "$testcvs -Q rm dated"
4972	  dotest ls-D-init-4 "$testcvs -Q ci -mm dated"
4973	  time_postdeath=`date '+%Y-%m-%d %H:%M:%S'`
4974
4975	  dotest ls-D-1 "$testcvs ls -D '$time_prebirth' -e dated"
4976
4977	  # ls'ing a file that already exists once caused an assertion failure.
4978	  dotest ls-D-2 "$testcvs ls -D '$time_newborn' -e dated" \
4979"/dated/1\.1/.*"
4980
4981	  # ls'ing a file that already exists once caused an assertion failure.
4982	  dotest ls-D-3 "$testcvs ls -D '$time_predeath' -e dated" \
4983"/dated/1.2/.*"
4984
4985	  dotest ls-D-4 "$testcvs ls -D '$time_postdeath' -e dated"
4986
4987	  dokeep
4988	  cd ../../..
4989	  rm -r ls
4990	  modify_repo rm -rf $CVSROOT_DIRNAME/notcheckedout \
4991			     $CVSROOT_DIRNAME/cemetery
4992	  unset output_living output_dead
4993	  ;;
4994
4995
4996
4997	parseroot)
4998	  mkdir 1; cd 1
4999	  # Test odd cases involving CVSROOT.  At the moment, that means we
5000	  # are testing roots with '/'s on the end, which CVS should parse off.
5001	  CVSROOT_save=${CVSROOT}
5002	  CVSROOT="${CVSROOT}/////"
5003	  dotest parseroot-1 "${testcvs} -q co CVSROOT/modules" \
5004"U CVSROOT/modules"
5005	  dotest parseroot-2 "${testcvs} -q ci -fmnull-change CVSROOT/modules" \
5006"$CVSROOT_DIRNAME/CVSROOT/modules,v  <--  CVSROOT/modules
5007new revision: 1\.2; previous revision: 1\.1
5008$SPROG commit: Rebuilding administrative file database"
5009
5010	  if $remote; then
5011	    # I only test these when testing remote in case CVS was compiled
5012	    # without client support.
5013
5014	    # logout does not try to contact the server.
5015	    CVSROOT=":pserver;proxy=localhost;proxyport=8080:localhost/dev/null"
5016	    dotest parseroot-3r "$testcvs -d'$CVSROOT' logout" \
5017"Logging out of :pserver:$username@localhost:2401/dev/null
5018$CPROG logout: warning: failed to open $HOME/\.cvspass for reading: No such file or directory
5019$CPROG logout: Entry not found."
5020	    CVSROOT=":pserver;proxyport=8080:localhost/dev/null"
5021	    dotest_fail parseroot-4r "$testcvs -d'$CVSROOT' logout" \
5022"$CPROG logout: Proxy port specified in CVSROOT without proxy host\.
5023$CPROG \[logout aborted\]: Bad CVSROOT: \`:pserver;proxyport=8080:localhost/dev/null'\."
5024	    CVSROOT=":pserver;optionnoarg:localhost/dev/null"
5025	    dotest_fail parseroot-5r "$testcvs -d'$CVSROOT' logout" \
5026"$CPROG logout: Option (\`optionnoarg') has no argument in CVSROOT\.
5027$CPROG \[logout aborted\]: Bad CVSROOT: \`:pserver;optionnoarg:localhost/dev/null'\."
5028	    CVSROOT=":pserver;notanoption=anything:localhost/dev/null"
5029	    dotest_fail parseroot-6r "$testcvs -d'$CVSROOT' logout" \
5030"$CPROG logout: Unknown option (\`notanoption') in CVSROOT\.
5031$CPROG \[logout aborted\]: Bad CVSROOT: \`:pserver;notanoption=anything:localhost/dev/null'\."
5032	    CVSROOT=":local;proxy=localhost:/dev/null"
5033	    dotest_fail parseroot-7r "$testcvs -d'$CVSROOT' logout" \
5034"$CPROG logout: CVSROOT proxy specification is only valid for gserver and
5035$CPROG logout: pserver connection methods\.
5036$CPROG \[logout aborted\]: Bad CVSROOT: \`:local;proxy=localhost:/dev/null'\."
5037	    CVSROOT="::pserver@anonymous@test.org:/cvs"
5038	    dotest_fail parseroot-8r "$testcvs -d'$CVSROOT' co test" \
5039"$CPROG checkout: Unknown method (\`') in CVSROOT\.
5040$CPROG \[checkout aborted\]: Bad CVSROOT: \`$CVSROOT'\."
5041	  fi
5042
5043	  dokeep
5044
5045	  # Clean up
5046	  CVSROOT=$CVSROOT_save
5047	  cd ..
5048	  rm -r 1
5049	  ;;
5050
5051
5052
5053	files)
5054	  # Test of how we specify files on the command line
5055	  # (recurse.c and that sort of thing).  Vaguely similar to
5056	  # tests like basic* and deep.  See modules and such tests
5057	  # for what happens when we throw in modules and co -d, &c.
5058
5059	  # This particular test is fairly carefully crafted, to spot
5060	  # one particular issue with remote.
5061	  mkdir 1; cd 1
5062	  dotest files-1 "${testcvs} -q co -l ." ""
5063	  mkdir first-dir
5064	  dotest files-2 "${testcvs} add first-dir" \
5065"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
5066	  cd first-dir
5067	  touch tfile
5068	  dotest files-3 "${testcvs} add tfile" \
5069"${SPROG} add: scheduling file .tfile. for addition
5070${SPROG} add: use .${SPROG} commit. to add this file permanently"
5071	  dotest files-4 "${testcvs} -q ci -m add" \
5072"$CVSROOT_DIRNAME/first-dir/tfile,v  <--  tfile
5073initial revision: 1\.1"
5074	  dotest files-5 "${testcvs} -q tag -b C" "T tfile"
5075	  dotest files-6 "${testcvs} -q update -r C" ""
5076	  mkdir dir
5077	  dotest files-7 "${testcvs} add dir" \
5078"Directory ${CVSROOT_DIRNAME}/first-dir/dir added to the repository
5079--> Using per-directory sticky tag .C'"
5080	  cd dir
5081	  touch .file
5082	  dotest files-7b "${testcvs} add .file" \
5083"${SPROG} add: scheduling file .\.file' for addition on branch .C.
5084${SPROG} add: use .${SPROG} commit. to add this file permanently"
5085	  mkdir sdir
5086	  dotest files-7c "${testcvs} add sdir" \
5087"Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir added to the repository
5088--> Using per-directory sticky tag .C'"
5089	  cd sdir
5090	  mkdir ssdir
5091	  dotest files-8 "${testcvs} add ssdir" \
5092"Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir added to the repository
5093--> Using per-directory sticky tag .C'"
5094	  cd ssdir
5095	  touch .file
5096	  dotest files-9 "${testcvs} add .file" \
5097"${SPROG} add: scheduling file .\.file' for addition on branch .C.
5098${SPROG} add: use .${SPROG} commit. to add this file permanently"
5099	  cd ../..
5100	  dotest files-10 "${testcvs} -q ci -m test" \
5101"$CVSROOT_DIRNAME/first-dir/dir/Attic/\.file,v  <--  \.file
5102new revision: 1\.1\.2\.1; previous revision: 1\.1
5103$CVSROOT_DIRNAME/first-dir/dir/sdir/ssdir/Attic/\.file,v  <--  sdir/ssdir/\.file
5104new revision: 1\.1\.2\.1; previous revision: 1\.1"
5105	  dotest files-11 \
5106"${testcvs} commit -m test -f ./.file ./sdir/ssdir/.file" \
5107"${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v  <--  \.file
5108new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
5109${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v  <--  \./sdir/ssdir/\.file
5110new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1"
5111	  if $remote; then
5112	    # FIXCVS:
5113	    # This is a bug, looks like that toplevel_repos cruft in
5114	    # client.c is coming back to haunt us.
5115	    # May want to think about the whole issue, toplevel_repos
5116	    # has always been crufty and trying to patch it up again
5117	    # might be a mistake.
5118	    dotest files-12r \
5119"$testcvs commit -f -m test ./sdir/ssdir/.file ./.file" \
5120"$CVSROOT_DIRNAME/first-dir/dir/sdir/ssdir/Attic/\.file,v  <--  \./sdir/ssdir/\.file
5121new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2"
5122
5123	    # Sync up the version numbers so that the rest of the
5124	    # tests don't need to expect different numbers based
5125	    # local or remote.
5126	    dotest files-12rworkaround \
5127"$testcvs commit -f -m test .file" \
5128"$CVSROOT_DIRNAME/first-dir/dir/Attic/\.file,v  <--  \.file
5129new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2"
5130	  else
5131	    dotest files-12 \
5132"${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
5133"${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v  <--  \./sdir/ssdir/\.file
5134new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
5135${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v  <--  \.file
5136new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2"
5137	  fi
5138	  dotest files-13 \
5139"${testcvs} commit -fmtest ./sdir/../sdir/ssdir/..///ssdir/.file" \
5140"${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v  <--  \./sdir/\.\./sdir/ssdir/\.\.///ssdir/\.file
5141new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3"
5142	  dotest files-14 \
5143"${testcvs} commit -fmtest ../../first-dir/dir/.file" \
5144"${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v  <--  \.\./\.\./first-dir/dir/\.file
5145new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3"
5146
5147	  dokeep
5148	  cd ../../..
5149	  rm -r 1
5150	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
5151	  ;;
5152
5153
5154
5155	spacefiles)
5156	  # More filename tests, in particular spaces in file names.
5157	  # (it might be better to just change a few of the names in
5158	  # basica or some other test instead, always good to keep the
5159	  # testsuite concise).
5160
5161	  mkdir 1; cd 1
5162	  dotest spacefiles-1 "${testcvs} -q co -l ." ""
5163	  touch ./-c
5164	  dotest spacefiles-2 "${testcvs} add -- -c" \
5165"${SPROG} add: scheduling file .-c. for addition
5166${SPROG} add: use .${SPROG} commit. to add this file permanently"
5167	  dotest spacefiles-3 "${testcvs} -q ci -m add" \
5168"$CVSROOT_DIRNAME/-c,v  <--  -c
5169initial revision: 1\.1"
5170	  mkdir 'first dir'
5171	  dotest spacefiles-4 "${testcvs} add 'first dir'" \
5172"Directory ${CVSROOT_DIRNAME}/first dir added to the repository"
5173	  mkdir ./-b
5174	  dotest spacefiles-5 "${testcvs} add -- -b" \
5175"Directory ${CVSROOT_DIRNAME}/-b added to the repository"
5176	  cd 'first dir'
5177	  touch 'a file'
5178	  dotest spacefiles-6 "${testcvs} add 'a file'" \
5179"${SPROG} add: scheduling file .a file. for addition
5180${SPROG} add: use .${SPROG} commit. to add this file permanently"
5181	  dotest spacefiles-7 "${testcvs} -q ci -m add" \
5182"$CVSROOT_DIRNAME/first dir/a file,v  <--  a file
5183initial revision: 1\.1"
5184	  dotest spacefiles-8 "${testcvs} -q tag new-tag" "T a file"
5185	  cd ../..
5186
5187	  mkdir 2; cd 2
5188	  dotest spacefiles-10 "${testcvs} co -- -b" \
5189"${SPROG} checkout: Updating -b"
5190	  dotest spacefiles-11 "${testcvs} -q co -- -c" "U \./-c"
5191	  rm ./-c
5192	  dotest spacefiles-13 "${testcvs} -q co 'first dir'" \
5193"U first dir/a file"
5194	  cd ..
5195
5196	  mkdir 3; cd 3
5197	  dotest spacefiles-14 "${testcvs} -q co 'first dir/a file'" \
5198"U first dir/a file"
5199	  cd ..
5200
5201	  rm -r 1 2 3
5202	  modify_repo rm -rf "'$CVSROOT_DIRNAME/first dir'" \
5203			     $CVSROOT_DIRNAME/-b $CVSROOT_DIRNAME/-c,v
5204	  ;;
5205
5206
5207
5208	commit-readonly)
5209	  mkdir 1; cd 1
5210	  module=x
5211
5212	  : > junk
5213	  dotest commit-readonly-1 "$testcvs -Q import -m . $module X Y" ''
5214	  dotest commit-readonly-2 "$testcvs -Q co $module" ''
5215	  cd $module
5216
5217	  file=m
5218
5219	  # Include an rcs keyword to be expanded.
5220	  echo '$Id''$' > $file
5221
5222	  dotest commit-readonly-3 "$testcvs add $file" \
5223"$SPROG add: scheduling file .$file. for addition
5224$SPROG add: use .$SPROG commit. to add this file permanently"
5225	  dotest commit-readonly-4 "$testcvs -Q ci -m . $file"
5226
5227	  echo line2 >> $file
5228	  # Make the file read-only.
5229	  chmod a-w $file
5230
5231	  dotest commit-readonly-5 "$testcvs -Q ci -m . $file"
5232
5233	  dokeep
5234	  cd ../..
5235	  rm -rf 1
5236	  modify_repo rm -rf $CVSROOT_DIRNAME/"$module"
5237	  ;;
5238
5239
5240
5241	status)
5242		# This tests for a bug in the status command which failed to
5243		# notice resolved conflicts.
5244		mkdir status; cd status
5245		dotest status-init-1 "$testcvs -q co -l ."
5246		mkdir first-dir
5247		dotest status-init-2 "${testcvs} add first-dir" \
5248"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
5249		cd first-dir
5250		echo a line >tfile
5251		dotest status-init-3 "${testcvs} add tfile" \
5252"${SPROG} add: scheduling file .tfile. for addition
5253${SPROG} add: use .${SPROG} commit. to add this file permanently"
5254		dotest status-init-4 "${testcvs} -q ci -m add" \
5255"$CVSROOT_DIRNAME/first-dir/tfile,v  <--  tfile
5256initial revision: 1\.1"
5257		cd ..
5258		dotest status-init-5 "${testcvs} -q co -dsecond-dir first-dir" \
5259"U second-dir/tfile"
5260		cd second-dir
5261		echo some junk >>tfile
5262		dotest status-init-6 "${testcvs} -q ci -maline" \
5263"$CVSROOT_DIRNAME/first-dir/tfile,v  <--  tfile
5264new revision: 1\.2; previous revision: 1\.1"
5265		cd ../first-dir
5266		echo force a conflict >>tfile
5267		dotest status-init-7 "${testcvs} -q up" \
5268"RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
5269retrieving revision 1\.1
5270retrieving revision 1\.2
5271Merging differences between 1\.1 and 1\.2 into tfile
5272rcsmerge: warning: conflicts during merge
5273${SPROG} update: conflicts found in tfile
5274C tfile"
5275
5276		# Now note our status
5277		dotest status-1 "${testcvs} status tfile" \
5278"===================================================================
5279File: tfile            	Status: Unresolved Conflict
5280
5281   Working revision:	1\.2.*
5282   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/tfile,v
5283   Commit Identifier:	${commitid}
5284   Sticky Tag:		(none)
5285   Sticky Date:		(none)
5286   Sticky Options:	(none)"
5287
5288		# touch the file, leaving conflict markers in place
5289		# and note our status
5290		touch tfile
5291		dotest status-2 "${testcvs} status tfile" \
5292"===================================================================
5293File: tfile            	Status: File had conflicts on merge
5294
5295   Working revision:	1\.2.*
5296   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/tfile,v
5297   Commit Identifier:	${commitid}
5298   Sticky Tag:		(none)
5299   Sticky Date:		(none)
5300   Sticky Options:	(none)"
5301
5302		# resolve the conflict
5303		echo resolution >tfile
5304		dotest status-3 "${testcvs} status tfile" \
5305"===================================================================
5306File: tfile            	Status: Locally Modified
5307
5308   Working revision:	1\.2.*
5309   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/tfile,v
5310   Commit Identifier:	${commitid}
5311   Sticky Tag:		(none)
5312   Sticky Date:		(none)
5313   Sticky Options:	(none)"
5314
5315		# Check that there are no problems just using CVS/Root too.
5316		save_CVSROOT=$CVSROOT
5317		unset CVSROOT
5318		dotest status-3a "${testcvs} status tfile" \
5319"===================================================================
5320File: tfile            	Status: Locally Modified
5321
5322   Working revision:	1\.2.*
5323   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/tfile,v
5324   Commit Identifier:	${commitid}
5325   Sticky Tag:		(none)
5326   Sticky Date:		(none)
5327   Sticky Options:	(none)"
5328		CVSROOT=$save_CVSROOT
5329		export CVSROOT
5330
5331		# FIXCVS:
5332		# Update is supposed to re-Register() the file when it
5333		# finds resolved conflicts:
5334		dotest status-4 "grep 'Result of merge' CVS/Entries" \
5335"/tfile/1\.2/Result of merge${PLUS}[a-zA-Z0-9 :]*//"
5336
5337                cd ..
5338                mkdir fourth-dir
5339                dotest status-init-8 "$testcvs add fourth-dir" \
5340"Directory $CVSROOT_DIRNAME/fourth-dir added to the repository"
5341                cd fourth-dir
5342                echo yet another line >t3file
5343                dotest status-init-9 "$testcvs add t3file" \
5344"$SPROG add: scheduling file .t3file. for addition
5345$SPROG add: use .$SPROG commit. to add this file permanently"
5346                dotest status-init-10 "$testcvs -q ci -m add" \
5347"$CVSROOT_DIRNAME/fourth-dir/t3file,v  <--  t3file
5348initial revision: 1\.1"
5349                cd ../first-dir
5350                mkdir third-dir
5351                dotest status-init-11 "$testcvs add third-dir" \
5352"Directory $CVSROOT_DIRNAME/first-dir/third-dir added to the repository"
5353                cd third-dir
5354                echo another line >t2file
5355                dotest status-init-12 "$testcvs add t2file" \
5356"$SPROG add: scheduling file .t2file. for addition
5357$SPROG add: use .$SPROG commit. to add this file permanently"
5358                dotest status-init-13 "$testcvs -q ci -m add" \
5359"$CVSROOT_DIRNAME/first-dir/third-dir/t2file,v  <--  t2file
5360initial revision: 1\.1"
5361                dotest status-5 "$testcvs status ../tfile" \
5362"===================================================================
5363File: tfile            	Status: Locally Modified
5364
5365   Working revision:	1\.2.*
5366   Repository revision:	1\.2	$CVSROOT_DIRNAME/first-dir/tfile,v
5367   Commit Identifier:	${commitid}
5368   Sticky Tag:		(none)
5369   Sticky Date:		(none)
5370   Sticky Options:	(none)"
5371                dotest status-6 "$testcvs status ../../fourth-dir/t3file" \
5372"===================================================================
5373File: t3file           	Status: Up-to-date
5374
5375   Working revision:	1\.1.*
5376   Repository revision:	1\.1	$CVSROOT_DIRNAME/fourth-dir/t3file,v
5377   Commit Identifier:	${commitid}
5378   Sticky Tag:		(none)
5379   Sticky Date:		(none)
5380   Sticky Options:	(none)"
5381
5382		dokeep
5383		cd ../../..
5384		rm -rf status
5385		modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
5386				   $CVSROOT_DIRNAME/fourth-dir
5387		;;
5388
5389
5390
5391	commit-readonlyfs)
5392	  mkdir 1; cd 1
5393	  module=x
5394	  : > junk
5395	  dotest commit-readonlyfs-1 "${testcvs} -Q import -m . $module X Y" ''
5396	  if $remote; then
5397	    dotest_fail commit-readonlyfs-2r1 "${testcvs} -Q -R co $module" \
5398"${CPROG} \[checkout aborted\]: Read-only repository feature unavailable with remote roots (cvsroot = ${CVSROOT_DIRNAME})"
5399	    dotest commit-readonlyfs-2r2 "${testcvs} -Q co $module" ''
5400          else
5401	    dotest commit-readonlyfs-2 "${testcvs} -Q -R co $module" ''
5402	    rm -rf $module
5403	    dotest commit-readonlyfs-2r3 "${testcvs} -q -R co $module" \
5404"U $module/junk"
5405	    rm -rf $module
5406	    dotest commit-readonlyfs-2r4 "${testcvs} -R co $module" \
5407"${SPROG}: WARNING: Read-only repository access mode selected via \`cvs -R'\.
5408Using this option to access a repository which some users write to may
5409cause intermittent sandbox corruption\.
5410${SPROG} checkout: Updating $module
5411U $module/junk"
5412          fi
5413	  cd $module
5414	  echo test > junk
5415	  if $remote; then
5416	    dotest_fail commit-readonlyfs-3r "${testcvs} -Q -R ci -m. junk" \
5417"${SPROG} \[commit aborted\]: Read-only repository feature unavailable with remote roots (cvsroot = ${CVSROOT_DIRNAME})"
5418	  else
5419	    dotest_fail commit-readonlyfs-3 "${testcvs} -Q -R ci -m. junk" \
5420"${SPROG} commit: write lock failed\.
5421WARNING: Read-only repository access mode selected via \`cvs -R'\.
5422Attempting to write to a read-only filesystem is not allowed\.
5423${SPROG} \[commit aborted\]: lock failed - giving up"
5424          fi
5425
5426	  dokeep
5427	  cd ../..
5428	  rm -rf 1
5429	  modify_repo rm -rf $CVSROOT_DIRNAME/"$module"
5430	  ;;
5431
5432
5433
5434	rdiff)
5435		# Test rdiff
5436		# XXX for now this is just the most essential test...
5437		cd ${TESTDIR}
5438
5439		mkdir testimport
5440		cd testimport
5441		echo '$''Id$' > foo
5442		echo '$''Name$' >> foo
5443		echo '$''Id$' > bar
5444		echo '$''Name$' >> bar
5445		dotest_sort rdiff-1 \
5446		  "${testcvs} import -I ! -m test-import-with-keyword trdiff TRDIFF T1" \
5447'
5448
5449N trdiff/bar
5450N trdiff/foo
5451No conflicts created by this import'
5452		dotest rdiff-2 \
5453		  "${testcvs} co -ko trdiff" \
5454"${SPROG} checkout: Updating trdiff
5455U trdiff/bar
5456U trdiff/foo"
5457		cd trdiff
5458		echo something >> foo
5459		dotest rdiff-3 \
5460		  "${testcvs} ci -m added-something foo" \
5461"${CVSROOT_DIRNAME}/trdiff/foo,v  <--  foo
5462new revision: 1\.2; previous revision: 1\.1"
5463		echo '#ident	"@(#)trdiff:$''Name$:$''Id$"' > new
5464		echo "new file" >> new
5465		dotest rdiff-4 \
5466		  "${testcvs} add -m new-file-description new" \
5467"${SPROG} add: scheduling file \`new' for addition
5468${SPROG} add: use .${SPROG} commit. to add this file permanently"
5469		dotest rdiff-5 \
5470		  "${testcvs} commit -m added-new-file new" \
5471"${CVSROOT_DIRNAME}/trdiff/new,v  <--  new
5472initial revision: 1\.1"
5473		dotest rdiff-6 \
5474		  "${testcvs} tag local-v0" \
5475"${SPROG} tag: Tagging .
5476T bar
5477T foo
5478T new"
5479		dotest rdiff-7 \
5480		  "${testcvs} status -v foo" \
5481"===================================================================
5482File: foo              	Status: Up-to-date
5483
5484   Working revision:	1\.2.*
5485   Repository revision:	1\.2	${CVSROOT_DIRNAME}/trdiff/foo,v
5486   Commit Identifier:	${commitid}
5487   Sticky Tag:		(none)
5488   Sticky Date:		(none)
5489   Sticky Options:	-ko
5490
5491   Existing Tags:
5492	local-v0                 	(revision: 1\.2)
5493	T1                       	(revision: 1\.1\.1\.1)
5494	TRDIFF                   	(branch: 1\.1\.1)"
5495
5496		cd ..
5497		rm -r trdiff
5498
5499		dotest rdiff-8 \
5500		  "${testcvs} rdiff -r T1 -r local-v0 trdiff" \
5501"${SPROG}"' rdiff: Diffing trdiff
5502Index: trdiff/foo
5503diff -c trdiff/foo:1\.1\.1\.1 trdiff/foo:1\.2
5504\*\*\* trdiff/foo:1\.1\.1\.1	'"${DATE}"'
5505--- trdiff/foo	'"${DATE}"'
5506\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5507\*\*\* 1,2 \*\*\*\*
5508! \$''Id: foo,v 1\.1\.1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$
5509! \$''Name: T1 \$
5510--- 1,3 ----
5511! \$''Id: foo,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
5512! \$''Name: local-v0 \$
5513! something
5514Index: trdiff/new
5515diff -c /dev/null trdiff/new:1\.1
5516\*\*\* /dev/null	'"${DATE}"'
5517--- trdiff/new	'"${DATE}"'
5518\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5519\*\*\* 0 \*\*\*\*
5520--- 1,2 ----
5521'"${PLUS}"' #ident	"@(#)trdiff:\$''Name: local-v0 \$:\$''Id: new,v 1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$"
5522'"${PLUS}"' new file'
5523
5524		dokeep
5525		cd ..
5526		rm -r testimport
5527		modify_repo rm -rf $CVSROOT_DIRNAME/trdiff
5528		;;
5529
5530
5531
5532	rdiff-short)
5533	  # Test that the short patch behaves as expected
5534	  #   1) Added file.
5535	  #   2) Removed file.
5536	  #   3) Different revision number with no difference.
5537	  #   4) Different revision number with changes.
5538	  #   5) Against trunk.
5539	  #   6) Same revision number (no difference).
5540	  mkdir rdiff-short; cd rdiff-short
5541	  mkdir abc
5542	  dotest rdiff-short-init-1 \
5543"${testcvs} -q import -I ! -m initial-import abc vendor initial" \
5544'
5545No conflicts created by this import'
5546
5547	  dotest rdiff-short-init-2 "${testcvs} -q get abc" ''
5548	  cd abc
5549	  echo "abc" >file1.txt
5550	  dotest rdiff-short-init-3 "${testcvs} add file1.txt" \
5551"${SPROG} add: scheduling file .file1\.txt' for addition
5552${SPROG} add: use \`${SPROG} commit' to add this file permanently"
5553	  dotest rdiff-short-init-4 \
5554"${testcvs} commit -madd-file1 file1.txt" \
5555"${CVSROOT_DIRNAME}/abc/file1\.txt,v  <--  file1\.txt
5556initial revision: 1\.1"
5557	  echo def >>file1.txt
5558	  dotest rdiff-short-init-5 \
5559"${testcvs} commit -mchange-file1 file1.txt" \
5560"${CVSROOT_DIRNAME}/abc/file1\.txt,v  <--  file1\.txt
5561new revision: 1\.2; previous revision: 1\.1"
5562	  echo "abc" >file1.txt
5563	  dotest rdiff-short-init-6 \
5564"${testcvs} commit -mrestore-file1-rev1 file1.txt" \
5565"${CVSROOT_DIRNAME}/abc/file1\.txt,v  <--  file1\.txt
5566new revision: 1\.3; previous revision: 1\.2"
5567	  dotest rdiff-short-init-7 \
5568"${testcvs} tag -r 1.1 tag1 file1.txt" \
5569"T file1\.txt"
5570	  dotest rdiff-short-init-8 \
5571"${testcvs} tag -r 1.2 tag2 file1.txt" \
5572"T file1\.txt"
5573	  dotest rdiff-short-init-9 \
5574"${testcvs} tag -r 1.3 tag3 file1.txt" \
5575"T file1\.txt"
5576	  echo "abc" >file2.txt
5577	  dotest rdiff-short-init-10 \
5578"${testcvs} add file2.txt" \
5579"${SPROG} add: scheduling file .file2\.txt' for addition
5580${SPROG} add: use \`${SPROG} commit' to add this file permanently"
5581	  dotest rdiff-add-remove-nodiff-init-11 \
5582"${testcvs} commit -madd-file2 file2.txt" \
5583"${CVSROOT_DIRNAME}/abc/file2\.txt,v  <--  file2\.txt
5584initial revision: 1\.1"
5585	  dotest rdiff-short-init-12 \
5586"${testcvs} tag -r 1.1 tag4 file2.txt" \
5587"T file2\.txt"
5588	  dotest rdiff-short-init-13 \
5589"${testcvs} tag -r 1.1 tag5 file2.txt" \
5590"T file2\.txt"
5591	  cd ../..
5592	  rm -fr rdiff-short
5593
5594	  # 3) Different revision number with no difference.
5595	  dotest rdiff-short-no-real-change \
5596"${testcvs} -q rdiff -s -r tag1 -r tag3 abc"
5597
5598	  # 4) Different revision number with changes.
5599	  dotest rdiff-short-real-change \
5600"${testcvs} -q rdiff -s -r tag1 -r tag2 abc" \
5601'File abc/file1.txt changed from revision 1\.1 to 1\.2'
5602
5603	  # 1) Added file.
5604	  # 2) Removed file.
5605	  dotest_sort rdiff-short-remove-add \
5606"${testcvs} -q rdiff -s -r tag2 -r tag4 abc" \
5607'File abc/file1\.txt is removed; tag2 revision 1\.2
5608File abc/file2\.txt is new; tag4 revision 1\.1'
5609
5610	  # 6) Same revision number (no difference).
5611	  dotest rdiff-short-no-change \
5612"${testcvs} -q rdiff -s -r tag4 -r tag5 abc"
5613
5614	  # 5) Against trunk.
5615	  # Check that the messages change when we diff against the trunk
5616	  # rather than a tag or date.
5617	  dotest rdiff-short-against-trunk-1 \
5618"${testcvs} -q rdiff -s -rtag4 abc" \
5619"File abc/file1\.txt is new; current revision 1\.3"
5620
5621	  dotest rdiff-short-against-trunk-2 \
5622"${testcvs} -q rdiff -s -rtag2 abc" \
5623"File abc/file1\.txt changed from revision 1\.2 to 1\.3
5624File abc/file2\.txt is new; current revision 1\.1"
5625
5626	  modify_repo rm -rf $CVSROOT_DIRNAME/abc
5627	  ;;
5628
5629
5630
5631	rdiff2)
5632	  # Test for the segv problem reported by James Cribb
5633	  # Somewhere to work
5634	  mkdir rdiff2; cd rdiff2
5635	  # Create a module "m" with files "foo" and "d/bar"
5636	  mkdir m; cd m
5637	  echo foo >foo
5638	  mkdir d
5639	  echo bar >d/bar
5640	  dotest_sort  rdiff2-1 \
5641"${testcvs} -q import -I ! -m initial-import m vendor initial" \
5642'
5643
5644N m/d/bar
5645N m/foo
5646No conflicts created by this import'
5647
5648	  cd ..
5649	  rm -r m
5650
5651	  # Remove "foo"
5652	  dotest rdiff2-2 "${testcvs} get m" \
5653"${SPROG} checkout: Updating m
5654U m/foo
5655${SPROG} checkout: Updating m/d
5656U m/d/bar"
5657	  cd m
5658	  dotest rdiff2-3 "${testcvs} rm -f foo" \
5659"${SPROG} remove: scheduling .foo. for removal
5660${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
5661
5662	  dotest rdiff2-4 "${testcvs} commit -m Removed foo" \
5663"${CVSROOT_DIRNAME}/m/foo,v  <--  foo
5664new revision: delete; previous revision: 1\.1\.1\.1"
5665
5666	  # Modify "d/bar"
5667	  echo foo >d/bar
5668	  dotest rdiff2-5 "${testcvs} commit -m Changed d/bar" \
5669"${CVSROOT_DIRNAME}/m/d/bar,v  <--  d/bar
5670new revision: 1\.2; previous revision: 1\.1"
5671
5672	  # Crash before showing d/bar diffs
5673	  dotest_fail rdiff2-6 "${testcvs} rdiff -t m" \
5674"${SPROG} rdiff: Diffing m
5675${SPROG} rdiff: Diffing m/d
5676Index: m/d/bar
5677diff -c m/d/bar:1\.1\.1\.1 m/d/bar:1\.2
5678\*\*\* m/d/bar:1\.1\.1\.1	${DATE}
5679--- m/d/bar	${DATE}
5680\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
5681\*\*\* 1 \*\*\*\*
5682! bar
5683--- 1 ----
5684! foo"
5685
5686	  dokeep
5687	  cd ../..
5688	  rm -rf rdiff2
5689	  modify_repo rm -rf $CVSROOT_DIRNAME/m
5690	  ;;
5691
5692
5693
5694	diff)
5695	  # Various tests specific to the "cvs diff" command.
5696	  # Related tests:
5697	  #   death2: -N
5698	  #   rcslib: cvs diff and $Name.
5699	  #   rdiff: cvs rdiff.
5700	  #   diffmerge*: nuts and bolts (stuff within diff library)
5701	  mkdir 1; cd 1
5702	  dotest diff-1 "$testcvs -q co -l ."
5703	  mkdir first-dir
5704	  dotest diff-2 "$testcvs add first-dir" \
5705"Directory $CVSROOT_DIRNAME/first-dir added to the repository"
5706	  cd first-dir
5707
5708	  # diff is anomalous.  Most CVS commands print the "nothing
5709	  # known" message (or worse yet, no message in some cases) but
5710	  # diff says "I know nothing".  Shrug.
5711	  dotest_fail diff-3 "${testcvs} diff xyzpdq" \
5712"${SPROG} diff: I know nothing about xyzpdq"
5713	  touch abc
5714	  dotest diff-4 "${testcvs} add abc" \
5715"${SPROG} add: scheduling file .abc. for addition
5716${SPROG} add: use .${SPROG} commit. to add this file permanently"
5717	  dotest diff-5 "${testcvs} -q ci -mtest" \
5718"$CVSROOT_DIRNAME/first-dir/abc,v  <--  abc
5719initial revision: 1\.1"
5720	  echo "extern int gethostname ();" >abc
5721	  dotest diff-6 "${testcvs} -q ci -mtest" \
5722"$CVSROOT_DIRNAME/first-dir/abc,v  <--  abc
5723new revision: 1\.2; previous revision: 1\.1"
5724	  echo "#include <winsock.h>" >abc
5725	  # check the behavior of the --ifdef=MACRO option
5726	  dotest_fail diff-7 "${testcvs} -q diff --ifdef=HAVE_WINSOCK_H" \
5727"Index: abc
5728===================================================================
5729RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5730retrieving revision 1\.2
5731diff --ifdef HAVE_WINSOCK_H -r1\.2 abc
5732#ifndef HAVE_WINSOCK_H
5733extern int gethostname ();
5734#else /\* HAVE_WINSOCK_H \*/
5735#include <winsock\.h>
5736#endif /\* HAVE_WINSOCK_H \*/"
5737
5738	  dokeep
5739	  cd ../..
5740	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
5741	  rm -r 1
5742	  ;;
5743
5744
5745
5746	diffnl)
5747	  # Test handling of 'cvs diff' of files without newlines
5748	  mkdir 1; cd 1
5749	  dotest diffnl-000 "${testcvs} -q co -l ." ''
5750	  mkdir first-dir
5751	  dotest diffnl-001 "${testcvs} add first-dir" \
5752"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
5753          cd first-dir
5754
5755	  ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nfive\nsix")}' </dev/null >abc
5756	  dotest diffnl-002 "${testcvs} add abc" \
5757"${SPROG} add: scheduling file .abc. for addition
5758${SPROG} add: use .${SPROG} commit. to add this file permanently"
5759          dotest diffnl-003 "${testcvs} -q ci -mtest" \
5760"$CVSROOT_DIRNAME/first-dir/abc,v  <--  abc
5761initial revision: 1\.1"
5762
5763	  # change to line near EOF
5764	  ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nsix")}' </dev/null >abc
5765	  dotest_fail diffnl-100 "${testcvs} diff abc" \
5766"Index: abc
5767===================================================================
5768RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5769retrieving revision 1\.1
5770diff -r1\.1 abc
57715d4
5772< five"
5773          dotest_fail diffnl-101 "${testcvs} diff -u abc" \
5774"Index: abc
5775===================================================================
5776RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5777retrieving revision 1\.1
5778diff -u -r1\.1 abc
5779--- abc	${RFCDATE}	1\.1
5780+++ abc	${RFCDATE}
5781@@ -2,5 +2,4 @@
5782 two
5783 three
5784 four
5785-five
5786 six
5787\\\\ No newline at end of file"
5788          dotest diffnl-102 "${testcvs} -q ci -mtest abc" \
5789"$CVSROOT_DIRNAME/first-dir/abc,v  <--  abc
5790new revision: 1\.2; previous revision: 1\.1"
5791
5792          # Change to last line
5793	  ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nseven")}' </dev/null >abc
5794          dotest_fail diffnl-200 "${testcvs} diff abc" \
5795"Index: abc
5796===================================================================
5797RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5798retrieving revision 1\.2
5799diff -r1\.2 abc
58005c5
5801< six
5802\\\\ No newline at end of file
5803---
5804> seven
5805\\\\ No newline at end of file"
5806	  dotest_fail diffnl-201 "${testcvs} diff -u abc" \
5807"Index: abc
5808===================================================================
5809RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5810retrieving revision 1\.2
5811diff -u -r1\.2 abc
5812--- abc	${RFCDATE}	1\.2
5813+++ abc	${RFCDATE}
5814@@ -2,4 +2,4 @@
5815 two
5816 three
5817 four
5818-six
5819\\\\ No newline at end of file
5820+seven
5821\\\\ No newline at end of file"
5822	  dotest diffnl-202 "${testcvs} ci -mtest abc" \
5823"${CVSROOT_DIRNAME}/first-dir/abc,v  <--  abc
5824new revision: 1\.3; previous revision: 1\.2"
5825
5826	  # Addition of newline
5827	  echo "one
5828two
5829three
5830four
5831seven" > abc
5832	  dotest_fail diffnl-300 "${testcvs} diff abc" \
5833"Index: abc
5834===================================================================
5835RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5836retrieving revision 1\.3
5837diff -r1\.3 abc
58385c5
5839< seven
5840\\\\ No newline at end of file
5841---
5842> seven"
5843	  dotest_fail diffnl-301 "${testcvs} diff -u abc" \
5844"Index: abc
5845===================================================================
5846RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5847retrieving revision 1\.3
5848diff -u -r1\.3 abc
5849--- abc	${RFCDATE}	1\.3
5850+++ abc	${RFCDATE}
5851@@ -2,4 +2,4 @@
5852 two
5853 three
5854 four
5855-seven
5856\\\\ No newline at end of file
5857+seven"
5858	  dotest diffnl-302 "${testcvs} ci -mtest abc" \
5859"${CVSROOT_DIRNAME}/first-dir/abc,v  <--  abc
5860new revision: 1\.4; previous revision: 1\.3"
5861
5862	  # Removal of newline
5863	  ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nseven")}' </dev/null >abc
5864	  dotest_fail diffnl-400 "${testcvs} diff abc" \
5865"Index: abc
5866===================================================================
5867RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5868retrieving revision 1\.4
5869diff -r1\.4 abc
58705c5
5871< seven
5872---
5873> seven
5874\\\\ No newline at end of file"
5875	  dotest_fail diffnl-401 "${testcvs} diff -u abc" \
5876"Index: abc
5877===================================================================
5878RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
5879retrieving revision 1\.4
5880diff -u -r1\.4 abc
5881--- abc	${RFCDATE}	1\.4
5882+++ abc	${RFCDATE}
5883@@ -2,4 +2,4 @@
5884 two
5885 three
5886 four
5887-seven
5888+seven
5889\\\\ No newline at end of file"
5890
5891	  dokeep
5892	  cd ../..
5893	  rm -r 1
5894	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
5895	  ;;
5896
5897
5898
5899	death)
5900		# next dive.  test death support.
5901
5902		# NOTE: this section has reached the size and
5903		# complexity where it is getting to be a good idea to
5904		# add new death support tests to a new section rather
5905		# than continuing to piggyback them onto the tests here.
5906
5907		modify_repo mkdir $CVSROOT_DIRNAME/first-dir
5908		dotest death-init-1 "$testcvs -Q co first-dir"
5909
5910		cd first-dir
5911
5912		# Create a directory with only dead files, to make sure CVS
5913		# doesn't get confused by it.
5914		mkdir subdir
5915		dotest 65a0 "${testcvs} add subdir" \
5916"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
5917		cd subdir
5918		echo file in subdir >sfile
5919		dotest 65a1 "${testcvs} add sfile" \
5920"${SPROG}"' add: scheduling file `sfile'\'' for addition
5921'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
5922		dotest 65a2 "${testcvs} -q ci -m add-it" \
5923"$CVSROOT_DIRNAME/first-dir/subdir/sfile,v  <--  sfile
5924initial revision: 1\.1"
5925		rm sfile
5926		dotest 65a3 "${testcvs} rm sfile" \
5927"${SPROG}"' remove: scheduling `sfile'\'' for removal
5928'"${SPROG}"' remove: use .'"${SPROG}"' commit. to remove this file permanently'
5929		dotest 65a4 "${testcvs} -q ci -m remove-it" \
5930"$CVSROOT_DIRNAME/first-dir/subdir/sfile,v  <--  sfile
5931new revision: delete; previous revision: 1\.1"
5932		cd ..
5933		dotest 65a5 "${testcvs} -q update -P" ''
5934		dotest_fail 65a6 "test -d subdir" ''
5935
5936		# add a file.
5937		touch file1
5938		if ${CVS} add file1  2>> ${LOGFILE}; then
5939		    pass 66
5940		else
5941		    fail 66
5942		fi
5943
5944		# commit
5945		if ${CVS} ci -m test  >> ${LOGFILE} 2>&1; then
5946		    pass 67
5947		else
5948		    fail 67
5949		fi
5950
5951		# remove
5952		rm file1
5953		if ${CVS} rm file1  2>> ${LOGFILE}; then
5954		    pass 68
5955		else
5956		    fail 68
5957		fi
5958
5959		# commit
5960		if ${CVS} ci -m test  >>${LOGFILE} ; then
5961		    pass 69
5962		else
5963		    fail 69
5964		fi
5965
5966		dotest_fail 69a0 "test -f file1" ''
5967		# get the old contents of file1 back
5968		if ${testcvs} update -p -r 1.1 file1 >file1 2>>${LOGFILE}; then
5969		  pass 69a1
5970		else
5971		  fail 69a1
5972		fi
5973		dotest 69a2 "cat file1" ''
5974
5975		# create second file
5976		touch file2
5977		if ${CVS} add file1 file2  2>> ${LOGFILE}; then
5978		    pass 70
5979		else
5980		    fail 70
5981		fi
5982
5983		# commit
5984		if ${CVS} ci -m test  >> ${LOGFILE} 2>&1; then
5985		    pass 71
5986		else
5987		    fail 71
5988		fi
5989
5990		# log
5991		if ${CVS} log file1  >> ${LOGFILE}; then
5992		    pass 72
5993		else
5994		    fail 72
5995		fi
5996
5997		# file4 will be dead at the time of branching and stay dead.
5998		echo file4 > file4
5999		dotest death-file4-add "${testcvs} add file4" \
6000"${SPROG}"' add: scheduling file `file4'\'' for addition
6001'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
6002		dotest death-file4-ciadd "${testcvs} -q ci -m add file4" \
6003"$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
6004initial revision: 1\.1"
6005		rm file4
6006		dotest death-file4-rm "${testcvs} remove file4" \
6007"${SPROG}"' remove: scheduling `file4'\'' for removal
6008'"${SPROG}"' remove: use .'"${SPROG}"' commit. to remove this file permanently'
6009		dotest death-file4-cirm "${testcvs} -q ci -m remove file4" \
6010"$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
6011new revision: delete; previous revision: 1\.1"
6012
6013		# Tag the branchpoint.
6014		dotest death-72a "${testcvs} -q tag bp_branch1" 'T file1
6015T file2'
6016
6017		# branch1
6018		if ${CVS} tag -b branch1  ; then
6019		    pass 73
6020		else
6021		    fail 73
6022		fi
6023
6024		# and move to the branch.
6025		if ${CVS} update -r branch1  ; then
6026		    pass 74
6027		else
6028		    fail 74
6029		fi
6030
6031		dotest_fail death-file4-3 "test -f file4" ''
6032
6033		# add a file in the branch
6034		echo line1 from branch1 >> file3
6035		if ${CVS} add file3  2>> ${LOGFILE}; then
6036		    pass 75
6037		else
6038		    fail 75
6039		fi
6040
6041		# commit
6042		if ${CVS} ci -m test  >> ${LOGFILE} 2>&1; then
6043		    pass 76
6044		else
6045		    fail 76
6046		fi
6047
6048		dotest death-76a0 \
6049"${testcvs} -q rdiff -r bp_branch1 -r branch1 first-dir" \
6050"Index: first-dir/file3
6051diff -c /dev/null first-dir/file3:1\.1\.2\.1
6052\*\*\* /dev/null	${DATE}
6053--- first-dir/file3	${DATE}
6054\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6055\*\*\* 0 \*\*\*\*
6056--- 1 ----
6057${PLUS} line1 from branch1"
6058		dotest death-76a1 \
6059"${testcvs} -q rdiff -r branch1 -r bp_branch1 first-dir" \
6060"Index: first-dir/file3
6061diff -c first-dir/file3:1\.1\.2\.1 first-dir/file3:removed
6062\*\*\* first-dir/file3:1\.1\.2\.1	${DATE}
6063--- first-dir/file3	${DATE}
6064\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6065\*\*\* 1 \*\*\*\*
6066- line1 from branch1
6067--- 0 ----"
6068
6069		# remove
6070		rm file3
6071		if ${CVS} rm file3  2>> ${LOGFILE}; then
6072		    pass 77
6073		else
6074		    fail 77
6075		fi
6076
6077		# commit
6078		if ${CVS} ci -m test  >>${LOGFILE} ; then
6079		    pass 78
6080		else
6081		    fail 78
6082		fi
6083
6084		# add again
6085		echo line1 from branch1 >> file3
6086		if ${CVS} add file3  2>> ${LOGFILE}; then
6087		    pass 79
6088		else
6089		    fail 79
6090		fi
6091
6092		# commit
6093		if ${CVS} ci -m test  >> ${LOGFILE} 2>&1; then
6094		    pass 80
6095		else
6096		    fail 80
6097		fi
6098
6099		# change the first file
6100		echo line2 from branch1 >> file1
6101
6102		# commit
6103		if ${CVS} ci -m test  >> ${LOGFILE} 2>&1; then
6104		    pass 81
6105		else
6106		    fail 81
6107		fi
6108
6109		# remove the second
6110		rm file2
6111		if ${CVS} rm file2  2>> ${LOGFILE}; then
6112		    pass 82
6113		else
6114		    fail 82
6115		fi
6116
6117		# commit
6118		if ${CVS} ci -m test  >>${LOGFILE}; then
6119		    pass 83
6120		else
6121		    fail 83
6122		fi
6123
6124		# back to the trunk.
6125		if ${CVS} update -A  2>> ${LOGFILE}; then
6126		    pass 84
6127		else
6128		    fail 84
6129		fi
6130
6131		dotest_fail death-file4-4 "test -f file4" ''
6132
6133		if test -f file3 ; then
6134		    fail 85
6135		else
6136		    pass 85
6137		fi
6138
6139		# join
6140		dotest death-86 "$testcvs -q update -j branch1" \
6141"RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
6142retrieving revision 1\.3
6143retrieving revision 1\.3\.2\.1
6144Merging differences between 1\.3 and 1\.3\.2\.1 into file1
6145${SPROG} update: scheduling \`file2' for removal
6146U file3"
6147
6148		dotest_fail death-file4-5 "test -f file4" ''
6149
6150		if test -f file3 ; then
6151		    pass 87
6152		else
6153		    fail 87
6154		fi
6155
6156		# Make sure that we joined the correct change to file1
6157		if echo line2 from branch1 | cmp - file1 >/dev/null; then
6158		    pass 87a
6159		else
6160		    fail 87a
6161		fi
6162
6163		# update
6164		if ${CVS} update  ; then
6165		    pass 88
6166		else
6167		    fail 88
6168		fi
6169
6170		# commit
6171		dotest 89 "${testcvs} -q ci -m test" \
6172"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6173new revision: 1\.4; previous revision: 1\.3
6174$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
6175new revision: delete; previous revision: 1\.1
6176$CVSROOT_DIRNAME/first-dir/file3,v  <--  file3
6177new revision: 1\.2; previous revision: 1\.1"
6178		cd ..
6179		mkdir 2
6180		cd 2
6181		dotest 89a "${testcvs} -q co first-dir" 'U first-dir/file1
6182U first-dir/file3'
6183		cd ..
6184		rm -r 2
6185		cd first-dir
6186
6187		# remove first file.
6188		rm file1
6189		if ${CVS} rm file1  2>> ${LOGFILE}; then
6190		    pass 90
6191		else
6192		    fail 90
6193		fi
6194
6195		# commit
6196		if ${CVS} ci -m test  >>${LOGFILE}; then
6197		    pass 91
6198		else
6199		    fail 91
6200		fi
6201
6202		if test -f file1 ; then
6203		    fail 92
6204		else
6205		    pass 92
6206		fi
6207
6208		# typo; try to get to the branch and fail
6209		dotest_fail 92.1a "$testcvs update -r brnach1" \
6210		  "$SPROG \[update aborted\]: no such tag \`brnach1'"
6211		# Make sure we are still on the trunk
6212		if test -f file1 ; then
6213		    fail 92.1b
6214		else
6215		    pass 92.1b
6216		fi
6217		if test -f file3 ; then
6218		    pass 92.1c
6219		else
6220		    fail 92.1c
6221		fi
6222
6223		# back to branch1
6224		if ${CVS} update -r branch1  2>> ${LOGFILE}; then
6225		    pass 93
6226		else
6227		    fail 93
6228		fi
6229
6230		dotest_fail death-file4-6 "test -f file4" ''
6231
6232		if test -f file1 ; then
6233		    pass 94
6234		else
6235		    fail 94
6236		fi
6237
6238		# and join
6239		dotest 95 "${testcvs} -q update -j HEAD" \
6240"${SPROG}"' update: file file1 has been modified, but has been removed in revision HEAD
6241'"${SPROG}"' update: file file3 exists, but has been added in revision HEAD'
6242
6243		dotest_fail death-file4-7 "test -f file4" ''
6244
6245		# file2 should not have been recreated.  It was
6246		# deleted on the branch, and has not been modified on
6247		# the trunk.  That means that there have been no
6248		# changes between the greatest common ancestor (the
6249		# trunk version) and HEAD.
6250		dotest_fail death-file2-1 "test -f file2" ''
6251
6252		dokeep
6253		cd ..
6254		rm -r first-dir
6255		modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
6256		;;
6257
6258
6259
6260	death2)
6261	  # More tests of death support.
6262	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
6263	  dotest death2-1 "$testcvs -q co first-dir"
6264
6265	  cd first-dir
6266
6267	  # Add two files on the trunk.
6268	  echo "first revision" > file1
6269	  echo "file4 first revision" > file4
6270	  dotest death2-2 "${testcvs} add file1 file4" \
6271"${SPROG}"' add: scheduling file `file1'\'' for addition
6272'"${SPROG}"' add: scheduling file `file4'\'' for addition
6273'"${SPROG}"' add: use .'"${SPROG}"' commit. to add these files permanently'
6274
6275	  dotest death2-3 "${testcvs} -q commit -m add" \
6276"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6277initial revision: 1\.1
6278$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
6279initial revision: 1\.1"
6280
6281	  # Make a branch and a non-branch tag.
6282	  dotest death2-4 "${testcvs} -q tag -b branch" \
6283'T file1
6284T file4'
6285	  dotest death2-5 "${testcvs} -q tag tag" \
6286'T file1
6287T file4'
6288
6289	  # Switch over to the branch.
6290	  dotest death2-6 "${testcvs} -q update -r branch" ''
6291
6292	  # Delete the file on the branch.
6293	  rm file1
6294	  dotest death2-7 "${testcvs} rm file1" \
6295"${SPROG} remove: scheduling .file1. for removal
6296${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
6297
6298	  # Test diff of the removed file before it is committed.
6299	  dotest_fail death2-diff-1 "${testcvs} -q diff file1" \
6300"${SPROG} diff: file1 was removed, no comparison available"
6301
6302	  dotest_fail death2-diff-2 "${testcvs} -q diff -N -c file1" \
6303"Index: file1
6304===================================================================
6305RCS file: file1
6306diff -N file1
6307\*\*\* file1	${RFCDATE}	[0-9.]*
6308--- /dev/null	${RFCDATE_EPOCH}
6309\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6310\*\*\* 1 \*\*\*\*
6311- first revision
6312--- 0 ----"
6313
6314	  dotest death2-8 "${testcvs} -q ci -m removed" \
6315"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6316new revision: delete; previous revision: 1\.1"
6317
6318	  # Test diff of a dead file.
6319	  dotest_fail death2-diff-3 \
6320"${testcvs} -q diff -r1.1 -rbranch -c file1" \
6321"${SPROG} diff: Tag branch refers to a dead (removed) revision in file .file1.\.
6322${SPROG} diff: No comparison available\.  Pass .-N. to .${SPROG} diff.${QUESTION}"
6323	  # and in reverse
6324	  dotest_fail death2-diff-3a \
6325"${testcvs} -q diff -rbranch -r1.1 -c file1" \
6326"${SPROG} diff: Tag branch refers to a dead (removed) revision in file .file1.\.
6327${SPROG} diff: No comparison available\.  Pass .-N. to .${SPROG} diff.${QUESTION}"
6328
6329	  dotest_fail death2-diff-4 \
6330"${testcvs} -q diff -r1.1 -rbranch -N -c file1" \
6331"Index: file1
6332===================================================================
6333RCS file: file1
6334diff -N file1
6335\*\*\* file1	${RFCDATE}	[0-9.]*
6336--- /dev/null	${RFCDATE_EPOCH}
6337\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6338\*\*\* 1 \*\*\*\*
6339- first revision
6340--- 0 ----"
6341	  # and in reverse
6342	  dotest_fail death2-diff-4a \
6343"${testcvs} -q diff -rbranch -r1.1 -N -c file1" \
6344"Index: file1
6345===================================================================
6346RCS file: file1
6347diff -N file1
6348\*\*\* /dev/null	${RFCDATE_EPOCH}
6349--- file1	${RFCDATE}	[0-9.]*
6350\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6351\*\*\* 0 \*\*\*\*
6352--- 1 ----
6353+ first revision"
6354
6355
6356	  dotest_fail death2-diff-5 "${testcvs} -q diff -rtag -c ." \
6357"${SPROG} diff: file1 no longer exists, no comparison available"
6358
6359	  dotest_fail death2-diff-6 "${testcvs} -q diff -rtag -N -c ." \
6360"Index: file1
6361===================================================================
6362RCS file: file1
6363diff -N file1
6364\*\*\* file1	[-a-zA-Z0-9: ]*	[0-9.]*
6365--- /dev/null	${RFCDATE_EPOCH}
6366\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6367\*\*\* 1 \*\*\*\*
6368- first revision
6369--- 0 ----"
6370
6371	  # Test rdiff of a dead file.
6372	  dotest death2-rdiff-1 \
6373"${testcvs} -q rtag -rbranch rdiff-tag first-dir" ''
6374
6375	  dotest death2-rdiff-2 "${testcvs} -q rdiff -rtag -rbranch first-dir" \
6376"Index: first-dir/file1
6377diff -c first-dir/file1:1\.1 first-dir/file1:removed
6378\*\*\* first-dir/file1:1\.1	[a-zA-Z0-9: ]*
6379--- first-dir/file1	[a-zA-Z0-9: ]*
6380\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6381\*\*\* 1 \*\*\*\*
6382- first revision
6383--- 0 ----"
6384
6385	  # Readd the file to the branch.
6386	  echo "second revision" > file1
6387	  dotest death2-9 "${testcvs} add file1" \
6388"${SPROG} add: Re-adding file \`file1' on branch \`branch' after dead revision 1\.1\.2\.1\.
6389${SPROG} add: use \`${SPROG} commit' to add this file permanently"
6390
6391	  # Test diff of the added file before it is committed.
6392	  dotest_fail death2-diff-7 "${testcvs} -q diff file1" \
6393"${SPROG} diff: file1 is a new entry, no comparison available"
6394
6395	  dotest_fail death2-diff-8 "${testcvs} -q diff -N -c file1" \
6396"Index: file1
6397===================================================================
6398RCS file: file1
6399diff -N file1
6400\*\*\* /dev/null	${RFCDATE_EPOCH}
6401--- file1	${RFCDATE}
6402\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6403\*\*\* 0 \*\*\*\*
6404--- 1 ----
6405${PLUS} second revision"
6406
6407	  dotest death2-10 "${testcvs} -q commit -m add" \
6408"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6409new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1"
6410
6411	  # Delete file4 from the branch
6412	  dotest death2-10a "${testcvs} rm -f file4" \
6413"${SPROG} remove: scheduling .file4. for removal
6414${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
6415	  dotest death2-10b "${testcvs} -q ci -m removed" \
6416"$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
6417new revision: delete; previous revision: 1\.1"
6418
6419	  # Back to the trunk.
6420	  dotest death2-11 "${testcvs} -q update -A" \
6421"[UP] file1
6422U file4"
6423
6424	  # Add another file on the trunk.
6425	  echo "first revision" > file2
6426	  dotest death2-12 "${testcvs} add file2" \
6427"${SPROG}"' add: scheduling file `file2'\'' for addition
6428'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
6429	  dotest death2-13 "${testcvs} -q commit -m add" \
6430"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
6431initial revision: 1\.1"
6432
6433	  # Modify file4 on the trunk.
6434	  echo "new file4 revision" > file4
6435	  dotest death2-13a "${testcvs} -q commit -m mod" \
6436"$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
6437new revision: 1\.2; previous revision: 1\.1"
6438
6439	  # Back to the branch.
6440	  # The ``no longer in the repository'' message doesn't really
6441	  # look right to me, but that's what CVS currently prints for
6442	  # this case.
6443	  dotest death2-14 "${testcvs} -q update -r branch" \
6444"[UP] file1
6445${SPROG} update: \`file2' is no longer in the repository
6446${SPROG} update: \`file4' is no longer in the repository"
6447
6448	  # Add a file on the branch with the same name.
6449	  echo "branch revision" > file2
6450	  dotest death2-15 "${testcvs} add file2" \
6451"${SPROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
6452'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
6453	  dotest death2-16 "${testcvs} -q commit -m add" \
6454"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
6455new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1"
6456
6457	  # Add a new file on the branch.
6458	  echo "first revision" > file3
6459	  dotest death2-17 "${testcvs} add file3" \
6460"${SPROG}"' add: scheduling file `file3'\'' for addition on branch `branch'\''
6461'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
6462	  dotest death2-18 "${testcvs} -q commit -m add" \
6463"$CVSROOT_DIRNAME/first-dir/Attic/file3,v  <--  file3
6464new revision: 1\.1\.2\.1; previous revision: 1\.1"
6465
6466	  # Test diff of a nonexistent tag
6467	  dotest_fail death2-diff-9 "$testcvs -q diff -rtag -c file3" \
6468"$SPROG diff: tag tag is not in file file3"
6469
6470	  dotest_fail death2-diff-10 "${testcvs} -q diff -rtag -N -c file3" \
6471"Index: file3
6472===================================================================
6473RCS file: file3
6474diff -N file3
6475\*\*\* /dev/null	${RFCDATE_EPOCH}
6476--- file3	${RFCDATE}	[0-9.]*
6477\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6478\*\*\* 0 \*\*\*\*
6479--- 1 ----
6480${PLUS} first revision"
6481
6482	  dotest_fail death2-diff-11 "${testcvs} -q diff -rtag -c ." \
6483"Index: file1
6484===================================================================
6485RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6486retrieving revision 1\.1
6487retrieving revision 1\.1\.2\.2
6488diff -c -r1\.1 -r1\.1\.2\.2
6489\*\*\* file1	${RFCDATE}	[0-9.]*
6490--- file1	${RFCDATE}	[0-9.]*
6491\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6492\*\*\* 1 \*\*\*\*
6493! first revision
6494--- 1 ----
6495! second revision
6496${SPROG} diff: tag tag is not in file file2
6497${SPROG} diff: tag tag is not in file file3
6498${SPROG} diff: file4 no longer exists, no comparison available"
6499
6500	  dotest_fail death2-diff-12 "${testcvs} -q diff -rtag -c -N ." \
6501"Index: file1
6502===================================================================
6503RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6504retrieving revision 1\.1
6505retrieving revision 1\.1\.2\.2
6506diff -c -r1\.1 -r1\.1\.2\.2
6507\*\*\* file1	${RFCDATE}	[0-9.]*
6508--- file1	${RFCDATE}	[0-9.]*
6509\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6510\*\*\* 1 \*\*\*\*
6511! first revision
6512--- 1 ----
6513! second revision
6514Index: file2
6515===================================================================
6516RCS file: file2
6517diff -N file2
6518\*\*\* /dev/null	${RFCDATE_EPOCH}
6519--- file2	${RFCDATE}	[0-9.]*
6520\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6521\*\*\* 0 \*\*\*\*
6522--- 1 ----
6523${PLUS} branch revision
6524Index: file3
6525===================================================================
6526RCS file: file3
6527diff -N file3
6528\*\*\* /dev/null	${RFCDATE_EPOCH}
6529--- file3	${RFCDATE}	[0-9.]*
6530\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6531\*\*\* 0 \*\*\*\*
6532--- 1 ----
6533${PLUS} first revision
6534Index: file4
6535===================================================================
6536RCS file: file4
6537diff -N file4
6538\*\*\* file4	${RFCDATE}	[0-9.]*
6539--- /dev/null	${RFCDATE_EPOCH}
6540\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6541\*\*\* 1 \*\*\*\*
6542- file4 first revision
6543--- 0 ----"
6544
6545	  # Switch to the nonbranch tag.
6546	  dotest death2-19 "${testcvs} -q update -r tag" \
6547"[UP] file1
6548${SPROG} update: \`file2' is no longer in the repository
6549${SPROG} update: \`file3' is no longer in the repository
6550U file4"
6551
6552	  dotest_fail death2-20 "test -f file2"
6553
6554	  # Make sure diff only reports appropriate files.
6555	  dotest_fail death2-diff-13 "${testcvs} -q diff -r rdiff-tag" \
6556"${SPROG} diff: Tag rdiff-tag refers to a dead (removed) revision in file .file1.\.
6557${SPROG} diff: No comparison available\.  Pass .-N. to .${SPROG} diff.${QUESTION}"
6558
6559	  dotest_fail death2-diff-14 "${testcvs} -q diff -r rdiff-tag -c -N" \
6560"Index: file1
6561===================================================================
6562RCS file: file1
6563diff -N file1
6564\*\*\* /dev/null	${RFCDATE_EPOCH}
6565--- file1	${RFCDATE}	[0-9.]*
6566\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
6567\*\*\* 0 \*\*\*\*
6568--- 1 ----
6569${PLUS} first revision"
6570
6571	  # now back to the trunk
6572	  dotest death2-21 "${testcvs} -q update -A" \
6573"U file2
6574[UP] file4"
6575
6576	  # test merging with a dead file
6577	  dotest death2-22 "${testcvs} -q co first-dir" \
6578"U first-dir/file1
6579U first-dir/file2
6580U first-dir/file4"
6581
6582	  cd first-dir
6583	  dotest death2-23 "${testcvs} rm -f file4" \
6584"${SPROG} remove: scheduling .file4. for removal
6585${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
6586	  dotest death2-24 "${testcvs} -q ci -m removed file4" \
6587"$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
6588new revision: delete; previous revision: 1\.2"
6589	  cd ..
6590	  echo "new stuff" >file4
6591	  dotest_fail death2-25 "${testcvs} up file4" \
6592"${SPROG} update: conflict: \`file4' is modified but no longer in the repository
6593C file4"
6594
6595	  dokeep
6596	  cd ..
6597	  rm -r first-dir
6598	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
6599	  ;;
6600
6601
6602
6603	rm-update-message)
6604	  # FIXME
6605	  # local CVS prints a warning message when update notices a missing
6606	  # file and client/server CVS doesn't.  These should be identical.
6607	  mkdir rm-update-message; cd rm-update-message
6608	  modify_repo mkdir $CVSROOT_DIRNAME/rm-update-message
6609	  dotest rm-update-message-setup-1 "$testcvs -q co rm-update-message" ''
6610	  cd rm-update-message
6611	  file=x
6612	  echo >$file
6613	  dotest rm-update-message-setup-2 "$testcvs -q add $file" \
6614"${SPROG} add: use .${SPROG} commit. to add this file permanently"
6615	  dotest rm-update-message-setup-3 "$testcvs -q ci -mcreate $file" \
6616"$CVSROOT_DIRNAME/rm-update-message/$file,v  <--  $file
6617initial revision: 1\.1"
6618
6619	  rm $file
6620	  dotest rm-update-message-1 "$testcvs up $file" \
6621"${SPROG} update: warning: \`$file' was lost
6622U $file"
6623
6624	  dokeep
6625	  cd ../..
6626	  rm -r rm-update-message
6627	  modify_repo rm -rf $CVSROOT_DIRNAME/rm-update-message
6628	  ;;
6629
6630
6631
6632	rmadd)
6633	  # More tests of adding and removing files.
6634	  # In particular ci -r.
6635	  # Other ci -r tests:
6636	  #   * editor-9: checking in a modified file,
6637	  #     where "ci -r" means a branch.
6638	  #   * basica-8a1: checking in a modified file with numeric revision.
6639	  #   * basica-8a2: likewise.
6640	  #   * keywordlog-4: adding a new file with numeric revision.
6641	  mkdir 1; cd 1
6642	  dotest rmadd-1 "$testcvs -q co -l ."
6643	  mkdir first-dir
6644	  dotest rmadd-2 "${testcvs} add first-dir" \
6645"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
6646	  cd first-dir
6647	  echo first file1 >file1
6648	  dotest rmadd-3 "${testcvs} add file1" \
6649"${SPROG} add: scheduling file .file1. for addition
6650${SPROG} add: use .${SPROG} commit. to add this file permanently"
6651
6652	  dotest_fail rmadd-4 "${testcvs} -q ci -r 1.2.2.4 -m add" \
6653"${SPROG} commit: cannot add file .file1' with revision .1\.2\.2\.4'; must be on trunk
6654${SPROG} \[commit aborted\]: correct above errors first!"
6655	  dotest_fail rmadd-5 "${testcvs} -q ci -r 1.2.2 -m add" \
6656"${SPROG} commit: cannot add file .file1' with revision .1\.2\.2'; must be on trunk
6657${SPROG} \[commit aborted\]: correct above errors first!"
6658	  dotest_fail rmadd-6 "$testcvs -q ci -r mybranch -m add" \
6659"$SPROG \[commit aborted\]: no such tag \`mybranch'"
6660
6661	  # The thing with the trailing periods strikes me as a very
6662	  # bizarre behavior, but it would seem to be intentional
6663	  # (see commit.c).  It probably could go away....
6664	  dotest rmadd-7 "${testcvs} -q ci -r 7.... -m add" \
6665"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6666initial revision: 7\.1"
6667	  if $remote; then
6668	    # I guess remote doesn't set a sticky tag in this case.
6669	    # Kind of odd, in the sense that rmadd-24a does set one
6670	    # both local and remote.
6671	    dotest_fail rmadd-7a "test -f CVS/Tag"
6672	    echo T7 >CVS/Tag
6673	  else
6674	    dotest rmadd-7a "cat CVS/Tag" "T7"
6675	  fi
6676
6677	  dotest rmadd-8 "${testcvs} -q tag -b mybranch" "T file1"
6678	  dotest rmadd-9 "${testcvs} -q tag mynonbranch" "T file1"
6679
6680	  touch file2
6681	  # The previous "cvs ci -r" set a sticky tag of '7'.  Seems a
6682	  # bit odd, and I guess commit.c (findmaxrev) makes '7' sticky
6683	  # tags unnecessary (?).  I kind of suspect that it should be
6684	  # saying "sticky tag is not a branch" like keywordlog-4b.
6685	  # Or something.
6686	  dotest rmadd-10 "${testcvs} add file2" \
6687"${SPROG} add: scheduling file .file2. for addition on branch .7'
6688${SPROG} add: use .${SPROG} commit. to add this file permanently"
6689	  # As in the previous example, CVS is confused....
6690	  dotest rmadd-11 "${testcvs} -q ci -m add" \
6691"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
6692initial revision: 7\.1"
6693
6694	  dotest rmadd-12 "${testcvs} -q update -A" ""
6695	  touch file3
6696	  dotest rmadd-13 "${testcvs} add file3" \
6697"${SPROG} add: scheduling file .file3. for addition
6698${SPROG} add: use .${SPROG} commit. to add this file permanently"
6699	  # Huh?  file2 is not up to date?  Seems buggy to me....
6700	  dotest_fail rmadd-14 "${testcvs} -q ci -r mybranch -m add" \
6701"${SPROG} commit: Up-to-date check failed for .file2'
6702${SPROG} \[commit aborted\]: correct above errors first!"
6703	  # Whatever, let's not let file2 distract us....
6704	  dotest rmadd-15 "${testcvs} -q ci -r mybranch -m add file3" \
6705"$CVSROOT_DIRNAME/first-dir/Attic/file3,v  <--  file3
6706new revision: 1\.1\.2\.1; previous revision: 1\.1"
6707
6708	  touch file4
6709	  dotest rmadd-16 "${testcvs} add file4" \
6710"${SPROG} add: scheduling file .file4. for addition
6711${SPROG} add: use .${SPROG} commit. to add this file permanently"
6712	  # Prior to CVS 1.12.10, this would fail with a, "no such tag" message
6713	  # since val-tags used to be updated the first time the tag was used
6714	  # rather than when it was created.
6715
6716	  # Try to make CVS write val-tags.
6717	  if $proxy; then :; else
6718	    # First remove the tag.
6719	    grep -v mynonbranch $CVSROOT_DIRNAME/CVSROOT/val-tags \
6720	         >$CVSROOT_DIRNAME/CVSROOT/val-tags-tmp
6721	    mv $CVSROOT_DIRNAME/CVSROOT/val-tags-tmp \
6722	       $CVSROOT_DIRNAME/CVSROOT/val-tags
6723
6724	    dotest rmadd-18 "$testcvs -q update -p -r mynonbranch file1" \
6725"first file1"
6726	    # Oops, -p suppresses writing val-tags (probably a questionable
6727	    # behavior).
6728	    dotest_fail rmadd-19 \
6729"$testcvs -q ci -r mynonbranch -m add file4" \
6730"$SPROG \[commit aborted\]: no such tag \`mynonbranch'"
6731	    # Now make CVS write val-tags for real.
6732	    dotest rmadd-20 "$testcvs -q update -r mynonbranch file1"
6733	  fi # !$proxy
6734
6735	  # Oops - CVS isn't distinguishing between a branch tag and
6736	  # a non-branch tag.
6737	  dotest rmadd-21 \
6738"${testcvs} -q ci -r mynonbranch -m add file4" \
6739"$CVSROOT_DIRNAME/first-dir/Attic/file4,v  <--  file4
6740new revision: 1\.1\.2\.1; previous revision: 1\.1"
6741
6742	  # OK, we add this one in a vanilla way, but then check in
6743	  # a modification with ci -r and sniff around for sticky tags.
6744	  echo file5 >file5
6745	  dotest rmadd-22 "${testcvs} add file5" \
6746"${SPROG} add: scheduling file .file5. for addition
6747${SPROG} add: use .${SPROG} commit. to add this file permanently"
6748	  if $remote; then
6749	    # Interesting bug (or missing feature) here.  findmaxrev
6750	    # gets the major revision from the Entries.  Well, remote
6751	    # doesn't send the entries for files which are not involved.
6752	    dotest rmadd-23r "${testcvs} -q ci -m add" \
6753"$CVSROOT_DIRNAME/first-dir/file5,v  <--  file5
6754initial revision: 1\.1"
6755	    dotest rmadd-23-workaroundr \
6756"${testcvs} -q ci -r 7 -m bump-it file5" \
6757"$CVSROOT_DIRNAME/first-dir/file5,v  <--  file5
6758new revision: 7\.1; previous revision: 1\.1"
6759	  else
6760	    dotest rmadd-23 "${testcvs} -q ci -m add" \
6761"$CVSROOT_DIRNAME/first-dir/file5,v  <--  file5
6762initial revision: 7\.1"
6763	  fi
6764	  echo change it >file5
6765	  dotest_fail rmadd-24 "$testcvs -q ci -r 4.8 -m change file5" \
6766"$CVSROOT_DIRNAME/first-dir/file5,v  <--  file5
6767$SPROG commit: $CVSROOT_DIRNAME/first-dir/file5,v: revision 4\.8 too low; must be higher than 7\.1
6768$SPROG commit: could not check in file5"
6769	  dotest rmadd-24a "${testcvs} -q ci -r 8.4 -m change file5" \
6770"$CVSROOT_DIRNAME/first-dir/file5,v  <--  file5
6771new revision: 8\.4; previous revision: 7\.1"
6772	  # I'm not really sure that a sticky tag make sense here.
6773	  # It seems to be longstanding behavior for what that is worth.
6774	  dotest rmadd-25 "${testcvs} status file5" \
6775"===================================================================
6776File: file5            	Status: Up-to-date
6777
6778   Working revision:	8\.4.*
6779   Repository revision:	8\.4	${CVSROOT_DIRNAME}/first-dir/file5,v
6780   Commit Identifier:	${commitid}
6781   Sticky Tag:		8\.4
6782   Sticky Date:		(none)
6783   Sticky Options:	(none)"
6784
6785	  # now try forced revision with recursion
6786	  mkdir sub
6787	  dotest rmadd-26 "${testcvs} -q add sub" \
6788"Directory ${CVSROOT_DIRNAME}/first-dir/sub added to the repository"
6789	  echo hello >sub/subfile
6790	  dotest rmadd-27 "${testcvs} -q add sub/subfile" \
6791"${SPROG} add: use .${SPROG} commit. to add this file permanently"
6792
6793	  dotest rmadd-28 "${testcvs} -q ci -m. sub" \
6794"$CVSROOT_DIRNAME/first-dir/sub/subfile,v  <--  sub/subfile
6795initial revision: 1\.1"
6796
6797	  # lose the branch
6798	  dotest rmadd-29 "${testcvs} -q up -A" \
6799"${SPROG} update: \`file3' is no longer in the repository
6800${SPROG} update: \`file4' is no longer in the repository"
6801
6802	  # -f disables recursion
6803	  dotest rmadd-30 "${testcvs} -q ci -f -r9 -m." \
6804"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6805new revision: 9\.1; previous revision: 7\.1
6806$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
6807new revision: 9\.1; previous revision: 7\.1
6808$CVSROOT_DIRNAME/first-dir/file5,v  <--  file5
6809new revision: 9\.1; previous revision: 8\.4"
6810
6811	  # add -R to force recursion
6812	  dotest rmadd-31 "${testcvs} -q ci -f -r9 -R -m." \
6813"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6814new revision: 9\.2; previous revision: 9\.1
6815$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
6816new revision: 9\.2; previous revision: 9\.1
6817$CVSROOT_DIRNAME/first-dir/file5,v  <--  file5
6818new revision: 9\.2; previous revision: 9\.1
6819$CVSROOT_DIRNAME/first-dir/sub/subfile,v  <--  sub/subfile
6820new revision: 9\.1; previous revision: 1\.1"
6821
6822	  if $remote; then
6823	    # as noted above, remote doesn't set a sticky tag
6824	    :
6825	  else
6826	    dotest rmadd-32 "cat CVS/Tag" "T9"
6827	    dotest rmadd-33 "cat sub/CVS/Tag" "T9"
6828	  fi
6829
6830	  dokeep
6831	  cd ../..
6832	  rm -r 1
6833	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
6834	  ;;
6835
6836
6837
6838	rmadd2)
6839	  # Tests of undoing commits, including in the presence of
6840	  # adding and removing files.  See join for a list of -j tests.
6841	  mkdir 1; cd 1
6842	  dotest rmadd2-1 "${testcvs} -q co -l ." ''
6843	  mkdir first-dir
6844	  dotest rmadd2-2 "${testcvs} add first-dir" \
6845"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
6846	  cd first-dir
6847	  echo 'initial contents' >file1
6848	  dotest rmadd2-3 "${testcvs} add file1" \
6849"${SPROG} add: scheduling file .file1. for addition
6850${SPROG} add: use .${SPROG} commit. to add this file permanently"
6851	  dotest rmadd2-4 "${testcvs} -q ci -m add" \
6852"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6853initial revision: 1\.1"
6854	  dotest rmadd2-4a "${testcvs} -Q tag tagone" ""
6855	  dotest rmadd2-5 "${testcvs} rm -f file1" \
6856"${SPROG} remove: scheduling .file1. for removal
6857${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
6858	  dotest rmadd2-6 "${testcvs} -q ci -m remove" \
6859"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6860new revision: delete; previous revision: 1\.1"
6861	  dotest rmadd2-7 "$testcvs -q update -j 1.2 -j 1.1 file1" "U file1"
6862	  dotest rmadd2-8 "${testcvs} -q ci -m readd" \
6863"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6864new revision: 1\.3; previous revision: 1\.2"
6865	  echo 'new contents' >file1
6866	  dotest rmadd2-9 "${testcvs} -q ci -m modify" \
6867"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6868new revision: 1\.4; previous revision: 1\.3"
6869	  dotest rmadd2-10 "${testcvs} -q update -j 1.4 -j 1.3 file1" \
6870"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
6871retrieving revision 1\.4
6872retrieving revision 1\.3
6873Merging differences between 1\.4 and 1\.3 into file1"
6874	  dotest rmadd2-11 "${testcvs} -q ci -m undo" \
6875"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6876new revision: 1\.5; previous revision: 1\.4"
6877	  dotest rmadd2-12 "cat file1" "initial contents"
6878	  dotest rmadd2-13 "${testcvs} -q update -p -r 1.3" "initial contents"
6879
6880	  # Hmm, might be a bit odd that this works even if 1.3 is not
6881	  # the head.
6882	  dotest rmadd2-14 "${testcvs} -q update -j 1.3 -j 1.2 file1" \
6883"${SPROG} update: scheduling \`file1' for removal"
6884
6885	  # Check that -p can get arbitrary revisions of a removed file
6886	  dotest rmadd2-14a "${testcvs} -q update -p" "initial contents"
6887	  dotest rmadd2-14b "${testcvs} -q update -p -r 1.5" "initial contents"
6888	  dotest rmadd2-14c "${testcvs} -q update -p -r 1.3" "initial contents"
6889
6890	  dotest rmadd2-15 "${testcvs} -q ci -m re-remove" \
6891"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6892new revision: delete; previous revision: 1\.5"
6893	  dotest rmadd2-16 "${testcvs} log -h file1" "
6894RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
6895Working file: file1
6896head: 1\.6
6897branch:
6898locks: strict
6899access list:
6900symbolic names:
6901	tagone: 1\.1
6902keyword substitution: kv
6903total revisions: 6
6904============================================================================="
6905	  dotest rmadd2-17 "${testcvs} status -v file1" \
6906"===================================================================
6907File: no file file1		Status: Up-to-date
6908
6909   Working revision:	No entry for file1
6910   Repository revision:	1\.6	${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
6911   Commit Identifier:	${commitid}
6912
6913   Existing Tags:
6914	tagone                   	(revision: 1.1)"
6915
6916	  dokeep
6917	  cd ../..
6918	  rm -r 1
6919	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
6920	  ;;
6921
6922
6923
6924	rmadd3)
6925          # This test demonstrates that CVS notices that file1 exists rather
6926	  # that deleting or writing over it after:
6927	  #
6928	  #   cvs remove -f file1; touch file1; cvs add file1.
6929	  #
6930          # According to the manual, this should work for:
6931	  #
6932	  #   rm file1; cvs remove file1; cvs add file1
6933	  #
6934	  # but in past version of CVS, new content in file1 would be
6935	  # erroneously deleted when file1 reappeared between the remove and
6936	  # the add.
6937	  #
6938	  # Later versions of CVS would refuse to perform the add, but still
6939	  # allow a subsequent local commit to erase the file from the
6940	  # workspace, possibly losing data.
6941	  mkdir 1; cd 1
6942	  dotest rmadd3-init1 "${testcvs} -q co -l ." ''
6943	  mkdir first-dir
6944	  dotest rmadd3-init2 "${testcvs} add first-dir" \
6945"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
6946	  cd first-dir
6947
6948	  echo initial content for file1 >file1
6949	  dotest rmadd3-init3 "${testcvs} add file1" \
6950"${SPROG} add: scheduling file \`file1' for addition
6951${SPROG} add: use \`${SPROG} commit' to add this file permanently"
6952	  dotest rmadd3-init4 "${testcvs} -q ci -m add" \
6953"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
6954initial revision: 1\.1"
6955
6956	  # Here begins the guts of this test, as detailed above.
6957	  dotest rmadd3-1 "${testcvs} rm -f file1" \
6958"${SPROG} remove: scheduling \`file1' for removal
6959${SPROG} remove: use \`${SPROG} commit' to remove this file permanently"
6960
6961          # Now recreate the file:
6962	  echo desired future contents for file1 >file1
6963
6964	  # And attempt to resurrect it at the same time:
6965	  dotest_fail rmadd3-2 "${testcvs} add file1" \
6966"${SPROG} add: \`file1' should be removed and is still there (or is back again)"
6967
6968	  # Now prove that commit knows that it shouldn't erase files.
6969	  dotest_fail rmadd3-3 "${testcvs} -q ci -m." \
6970"$CPROG commit: \`file1' should be removed and is still there (or is back again)
6971$CPROG \[commit aborted\]: correct above errors first!"
6972
6973	  # Then these should pass too:
6974	  dotest rmadd3-4 "test -f file1"
6975	  dotest rmadd3-5 "cat file1" "desired future contents for file1"
6976
6977	  if $keep; then
6978	    echo Keeping ${TESTDIR} and exiting due to --keep
6979	    exit 0
6980	  fi
6981
6982	  dokeep
6983	  cd ../..
6984	  rm -r 1
6985	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
6986	  ;;
6987
6988
6989
6990	resurrection)
6991	  # This test tests a few file resurrection scenarios.
6992	  mkdir 1; cd 1
6993	  dotest resurrection-init1 "$testcvs -q co -l ." ''
6994	  mkdir first-dir
6995	  dotest resurrection-init2 "$testcvs add first-dir" \
6996"Directory $CVSROOT_DIRNAME/first-dir added to the repository"
6997	  cd first-dir
6998
6999	  echo initial content for file1 >file1
7000	  dotest resurrection-init3 "$testcvs add file1" \
7001"$SPROG add: scheduling file \`file1' for addition
7002$SPROG add: use \`$SPROG commit' to add this file permanently"
7003	  dotest resurrection-init4 "$testcvs -q ci -m add" \
7004"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
7005initial revision: 1\.1"
7006
7007	  dotest resurrection-init5 "$testcvs -Q rm -f file1"
7008
7009	  # The first test is that `cvs add' will resurrect a file before its
7010	  # removal has been committed.
7011	  dotest_sort resurrection-1 "$testcvs add file1" \
7012"U file1
7013$SPROG add: \`file1', version 1\.1, resurrected"
7014	  dotest resurrection-2 "$testcvs -Q diff file1" ""
7015
7016	  dotest resurrection-init6 "$testcvs -Q tag -b resurrection"
7017	  dotest resurrection-init7 "$testcvs -Q rm -f file1"
7018	  dotest resurrection-init8 "$testcvs -Q ci -mrm"
7019
7020	  # The next test is that CVS will resurrect a committed removal.
7021	  dotest_sort resurrection-3 "$testcvs add file1" \
7022"U file1
7023$SPROG add: Re-adding file \`file1' after dead revision 1\.2\.
7024$SPROG add: Resurrecting file \`file1' from revision 1\.1\.
7025$SPROG add: use \`$SPROG commit' to add this file permanently"
7026	  dotest resurrection-4 "$testcvs -q diff -r1.1 file1" ""
7027	  dotest resurrection-5 "$testcvs -q ci -mreadd" \
7028"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
7029new revision: 1\.3; previous revision: 1\.2"
7030
7031	  dotest resurrection-init9 "$testcvs -Q up -rresurrection"
7032	  dotest resurrection-init10 "$testcvs -Q rm -f file1"
7033	  dotest resurrection-init11 "$testcvs -Q ci -mrm-on-resurrection"
7034
7035	  # The next test is that CVS will resurrect a committed removal to a
7036	  # branch.
7037	  dotest_sort resurrection-6 "$testcvs -r add file1" \
7038"U file1
7039$SPROG add: Re-adding file \`file1' on branch \`resurrection' after dead revision 1\.1\.2\.1\.
7040$SPROG add: Resurrecting file \`file1' from revision 1\.1\.
7041$SPROG add: use \`$SPROG commit' to add this file permanently"
7042	  # If the file is modified, it had better be read-write
7043	  # regardless of what the user has requested with the CVSREAD
7044	  # environment variable or the global -r switch
7045          dotest resurrection-6b 'test -w file1' ''
7046	  dotest resurrection-7 "$testcvs -Q diff -r1.1 file1" ""
7047	  dotest resurrection-8 "$testcvs -q ci -mreadd" \
7048"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
7049new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1"
7050
7051	  # The next few tests verify that an attempted resurrection of a file
7052	  # with no previous revision on the trunk fails.
7053	  touch file2
7054	  dotest resurrection-9 "$testcvs -Q add file2"
7055	  dotest resurrection-10 "$testcvs -Q ci -mnew-file2"
7056	  dotest resurrection-11 "$testcvs -Q up -A"
7057
7058	  # This command once caused an assertion failure.
7059	  dotest resurrection-12 "$testcvs add file2" \
7060"$SPROG add: File \`file2' has no previous revision to resurrect\."
7061
7062	  # Check what 'cvs -r add' does with resurrected files.
7063	  dotest resurrection-13 "$testcvs -Q rm -f file1"
7064	  dotest_sort resurrection-14 "$testcvs -r add file1" \
7065"U file1
7066$SPROG add: \`file1', version 1\.3, resurrected"
7067	  dotest_fail resurrection-15 'test -w file1' ''
7068
7069	  dokeep
7070	  cd ../..
7071	  rm -rf 1
7072	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
7073	  ;;
7074
7075
7076
7077	dirs)
7078	  # Tests related to removing and adding directories.
7079	  # See also:
7080	  #   conflicts (especially dir1 in conflicts-130): What happens if
7081	  #     directory exists in repository and a non-CVS-controlled
7082	  #     directory in the working directory?
7083	  #   conflicts3-15.  More cases, especially where CVS directory
7084	  #     exists but without CVS/Repository and friends.
7085	  #   conflicts3-22.  Similar to conflicts-130 but there is a file
7086	  #     in the directory.
7087	  #   dirs2.  Sort of similar to conflicts3-22 but somewhat different.
7088	  mkdir imp-dir; cd imp-dir
7089	  echo file1 >file1
7090	  mkdir sdir
7091	  echo sfile >sdir/sfile
7092	  dotest_sort dirs-1 \
7093"${testcvs} import -m import-it dir1 vend rel" "
7094
7095N dir1/file1
7096N dir1/sdir/sfile
7097No conflicts created by this import
7098${SPROG} import: Importing ${CVSROOT_DIRNAME}/dir1/sdir"
7099	  cd ..
7100
7101	  mkdir 1; cd 1
7102	  dotest dirs-2 "$testcvs -Q co dir1" ""
7103
7104	  # Various CVS administrators are in the habit of removing
7105	  # the repository directory for things they don't want any
7106	  # more.  I've even been known to do it myself (on rare
7107	  # occasions).  Not the usual recommended practice, but we want
7108	  # to try to come up with some kind of reasonable/documented/sensible
7109	  # behavior.
7110	  modify_repo rm -rf $CVSROOT_DIRNAME/dir1/sdir
7111
7112	  dotest dirs-3 "${testcvs} update" \
7113"${SPROG} update: Updating dir1
7114${SPROG} update: Updating dir1/sdir
7115${SPROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
7116${SPROG} update: skipping directory dir1/sdir"
7117	  dotest dirs-3a "${testcvs} update -d" \
7118"${SPROG} update: Updating dir1
7119${SPROG} update: Updating dir1/sdir
7120${SPROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
7121${SPROG} update: skipping directory dir1/sdir"
7122
7123	  # If we say "yes", then CVS gives errors about not being able to
7124	  # create lock files.
7125	  # The fact that it says "skipping directory " rather than
7126	  # "skipping directory dir1/sdir" is some kind of bug.
7127	  dotest dirs-4 "echo no | ${testcvs} release -d dir1/sdir" \
7128"${SPROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
7129${SPROG} update: skipping directory
7130You have \[0\] altered files in this repository\.
7131Are you sure you want to release (and delete) directory .dir1/sdir': .. .release' aborted by user choice."
7132
7133	  # OK, if "cvs release" won't help, we'll try it the other way...
7134	  rm -r dir1/sdir
7135
7136	  dotest dirs-5 "cat dir1/CVS/Entries" \
7137"/file1/1.1.1.1/[a-zA-Z0-9 :]*//
7138D/sdir////"
7139	  dotest dirs-6 "${testcvs} update" "${SPROG} update: Updating dir1"
7140	  dotest dirs-7 "cat dir1/CVS/Entries" \
7141"/file1/1.1.1.1/[a-zA-Z0-9 :]*//
7142D/sdir////"
7143	  dotest dirs-8 "${testcvs} update -d dir1" \
7144"${SPROG} update: Updating dir1"
7145
7146	  dokeep
7147	  cd ..
7148	  rm -r imp-dir 1
7149	  modify_repo rm -rf $CVSROOT_DIRNAME/dir1
7150	  ;;
7151
7152
7153
7154	dirs2)
7155	  # See "dirs" for a list of tests involving adding and
7156	  # removing directories.
7157	  mkdir 1; cd 1
7158	  dotest dirs2-1 "$testcvs -q co -l ."
7159	  mkdir first-dir
7160	  dotest dirs2-2 "${testcvs} add first-dir" \
7161"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
7162	  cd first-dir
7163	  mkdir sdir
7164	  dotest dirs2-3 "${testcvs} add sdir" \
7165"Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
7166	  touch sdir/file1
7167	  dotest dirs2-4 "${testcvs} add sdir/file1" \
7168"${SPROG} add: scheduling file .sdir/file1. for addition
7169${SPROG} add: use .${SPROG} commit. to add this file permanently"
7170	  dotest dirs2-5 "${testcvs} -q ci -m add" \
7171"$CVSROOT_DIRNAME/first-dir/sdir/file1,v  <--  sdir/file1
7172initial revision: 1\.1"
7173	  rm -r sdir/CVS
7174	  if $remote; then
7175	    # This is just like conflicts3-23
7176	    dotest_fail dirs2-6r "${testcvs} update -d" \
7177"${QUESTION} sdir
7178${SPROG} update: Updating \.
7179${SPROG} update: Updating sdir
7180${CPROG} update: move away \`sdir/file1'; it is in the way
7181C sdir/file1"
7182	    rm sdir/file1
7183	    rm -r sdir/CVS
7184
7185	    # This is where things are not just like conflicts3-23
7186	    dotest dirs2-7r "${testcvs} update -d" \
7187"${QUESTION} sdir
7188${SPROG} update: Updating \.
7189${SPROG} update: Updating sdir
7190U sdir/file1"
7191	  else
7192	    dotest dirs2-6 "${testcvs} update -d" \
7193"${CPROG} update: Updating \.
7194${QUESTION} sdir"
7195	    rm sdir/file1
7196	    dotest dirs2-7 "${testcvs} update -d" \
7197"${CPROG} update: Updating \.
7198${QUESTION} sdir"
7199	  fi
7200	  cd ../..
7201
7202	  # Now, the same thing (more or less) on a branch.
7203	  mkdir 2; cd 2
7204	  dotest dirs2-8 "${testcvs} -q co first-dir" 'U first-dir/sdir/file1'
7205	  cd first-dir
7206	  dotest dirs2-9 "${testcvs} -q tag -b br" "T sdir/file1"
7207	  rm -r sdir/CVS
7208
7209	  if $remote; then
7210	    # val-tags used to have a cute little quirk; if an update didn't
7211	    # recurse into the directories where the tag is defined, val-tags
7212	    # wouldn't get updated.  This is no longer a problem as of 1.12.10.
7213	    dotest_fail dirs2-10-againr "$testcvs update -d -r br" \
7214"$QUESTION sdir
7215$SPROG update: Updating \.
7216$SPROG update: Updating sdir
7217$CPROG update: move away \`sdir/file1'; it is in the way
7218C sdir/file1"
7219	  else
7220	    dotest dirs2-10 "${testcvs} update -d -r br" \
7221"$SPROG update: Updating \.
7222$QUESTION sdir"
7223# This is what used to happen.  I'm not sure why it changed with 1.12.10, but
7224# as near as I can tell from the comments in update_direntproc, the new
7225# behavior was the intended behavior.
7226#"$CPROG update: in directory \`sdir':
7227#$CPROG \[update aborted\]: there is no version here; do \`$CPROG checkout' first"
7228	  fi
7229	  cd ../..
7230
7231	  # OK, the above tests make the situation somewhat harder
7232	  # than it might be, in the sense that they actually have a
7233	  # file which is alive on the branch we are updating.  Let's
7234	  # try it where it is just a directory where all the files
7235	  # have been removed.
7236	  mkdir 3; cd 3
7237	  dotest dirs2-11 "${testcvs} -q co -r br first-dir" \
7238"U first-dir/sdir/file1"
7239	  cd first-dir
7240	  # Hmm, this doesn't mention the branch like add does.  That's
7241	  # an odd non-orthogonality.
7242	  dotest dirs2-12 "${testcvs} rm -f sdir/file1" \
7243"${SPROG} remove: scheduling .sdir/file1. for removal
7244${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
7245	  dotest dirs2-13 "${testcvs} -q ci -m remove" \
7246"$CVSROOT_DIRNAME/first-dir/sdir/file1,v  <--  sdir/file1
7247new revision: delete; previous revision: 1\.1"
7248	  cd ../../2/first-dir
7249	  if $remote; then
7250	    dotest dirs2-14 "${testcvs} update -d -r br" \
7251"${QUESTION} sdir/file1
7252${SPROG} update: Updating \.
7253${SPROG} update: Updating sdir"
7254	  else
7255	    dotest dirs2-14 "${testcvs} update -d -r br" \
7256"${CPROG} update: Updating \.
7257${QUESTION} sdir"
7258	  fi
7259
7260	  dokeep
7261	  cd ../..
7262	  rm -r 1 2 3
7263	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
7264	  ;;
7265
7266
7267
7268	branches)
7269	  # More branch tests, including branches off of branches
7270	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
7271	  dotest branches-1 "$testcvs -q co first-dir"
7272	  cd first-dir
7273	  echo 1:ancest >file1
7274	  echo 2:ancest >file2
7275	  echo 3:ancest >file3
7276	  echo 4:trunk-1 >file4
7277	  dotest branches-2 "${testcvs} add file1 file2 file3 file4" \
7278"$SPROG add: scheduling file \`file1' for addition
7279$SPROG add: scheduling file \`file2' for addition
7280$SPROG add: scheduling file \`file3' for addition
7281$SPROG add: scheduling file \`file4' for addition
7282$SPROG add: use .$SPROG commit. to add these files permanently"
7283	  dotest branches-2a "$testcvs -n -q ci -m dont-commit"
7284	  dotest_lit branches-3 "$testcvs -q ci -m add-it" <<HERE
7285$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
7286initial revision: 1.1
7287$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
7288initial revision: 1.1
7289${CVSROOT_DIRNAME}/first-dir/file3,v  <--  file3
7290initial revision: 1.1
7291${CVSROOT_DIRNAME}/first-dir/file4,v  <--  file4
7292initial revision: 1.1
7293HERE
7294	  echo 4:trunk-2 >file4
7295	  dotest branches-3.2 "${testcvs} -q ci -m trunk-before-branch" \
7296"$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
7297new revision: 1\.2; previous revision: 1\.1"
7298	  # The "cvs log file4" in test branches-14.3 will test that we
7299	  # didn't really add the tag.
7300	  dotest branches-3.3 "${testcvs} -qn tag dont-tag" \
7301"T file1
7302T file2
7303T file3
7304T file4"
7305	  # Modify this file before branching, to deal with the case where
7306	  # someone is hacking along, says "oops, I should be doing this on
7307	  # a branch", and only then creates the branch.
7308	  echo 1:br1 >file1
7309	  dotest branches-4 "${testcvs} tag -b br1" "${SPROG}"' tag: Tagging \.
7310T file1
7311T file2
7312T file3
7313T file4'
7314	  dotest branches-5 "${testcvs} update -r br1" \
7315"${SPROG} update: Updating \.
7316M file1"
7317	  echo 2:br1 >file2
7318	  echo 4:br1 >file4
7319	  dotest branches-6 "${testcvs} -q ci -m modify" \
7320"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
7321new revision: 1\.1\.2\.1; previous revision: 1\.1
7322$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
7323new revision: 1\.1\.2\.1; previous revision: 1\.1
7324$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
7325new revision: 1\.2\.2\.1; previous revision: 1\.2"
7326	  dotest branches-7 "${testcvs} -q tag -b brbr" 'T file1
7327T file2
7328T file3
7329T file4'
7330	  dotest branches-8 "${testcvs} -q update -r brbr" ''
7331	  echo 1:brbr >file1
7332	  echo 4:brbr >file4
7333	  dotest branches-9 "${testcvs} -q ci -m modify" \
7334"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
7335new revision: 1\.1\.2\.1\.2\.1; previous revision: 1\.1\.2\.1
7336$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
7337new revision: 1\.2\.2\.1\.2\.1; previous revision: 1\.2\.2\.1"
7338	  dotest branches-10 "cat file1 file2 file3 file4" '1:brbr
73392:br1
73403:ancest
73414:brbr'
7342	  dotest branches-11 "${testcvs} -q update -r br1" \
7343'[UP] file1
7344[UP] file4'
7345	  dotest branches-12 "cat file1 file2 file3 file4" '1:br1
73462:br1
73473:ancest
73484:br1'
7349	  echo 4:br1-2 >file4
7350	  dotest branches-12.2 "${testcvs} -q ci -m change-on-br1" \
7351"$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
7352new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1"
7353	  dotest branches-13 "${testcvs} -q update -A" '[UP] file1
7354[UP] file2
7355[UP] file4'
7356	  dotest branches-14 "cat file1 file2 file3 file4" '1:ancest
73572:ancest
73583:ancest
73594:trunk-2'
7360	  echo 4:trunk-3 >file4
7361	  dotest branches-14.2 \
7362	    "${testcvs} -q ci -m trunk-change-after-branch" \
7363"$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
7364new revision: 1\.3; previous revision: 1\.2"
7365	  dotest branches-14.3 "${testcvs} log file4" \
7366"
7367RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
7368Working file: file4
7369head: 1\.3
7370branch:
7371locks: strict
7372access list:
7373symbolic names:
7374	brbr: 1\.2\.2\.1\.0\.2
7375	br1: 1\.2\.0\.2
7376keyword substitution: kv
7377total revisions: 6;	selected revisions: 6
7378description:
7379----------------------------
7380revision 1\.3
7381date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
7382trunk-change-after-branch
7383----------------------------
7384revision 1\.2
7385date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
7386branches:  1\.2\.2;
7387trunk-before-branch
7388----------------------------
7389revision 1\.1
7390date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
7391add-it
7392----------------------------
7393revision 1\.2\.2\.2
7394date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
7395change-on-br1
7396----------------------------
7397revision 1\.2\.2\.1
7398date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
7399branches:  1\.2\.2\.1\.2;
7400modify
7401----------------------------
7402revision 1\.2\.2\.1\.2\.1
7403date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
7404modify
7405============================================================================="
7406	  dotest_fail branches-14.4 \
7407	    "${testcvs} diff -c -r 1.1 -r 1.3 file4" \
7408"Index: file4
7409===================================================================
7410RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
7411retrieving revision 1\.1
7412retrieving revision 1\.3
7413diff -c -r1\.1 -r1\.3
7414\*\*\* file4	${RFCDATE}	1\.1
7415--- file4	${RFCDATE}	1\.3
7416\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
7417\*\*\* 1 \*\*\*\*
7418! 4:trunk-1
7419--- 1 ----
7420! 4:trunk-3"
7421	  dotest_fail branches-14.5 \
7422	    "${testcvs} diff -c -r 1.1 -r 1.2.2.1 file4" \
7423"Index: file4
7424===================================================================
7425RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
7426retrieving revision 1\.1
7427retrieving revision 1\.2\.2\.1
7428diff -c -r1\.1 -r1\.2\.2\.1
7429\*\*\* file4	${RFCDATE}	1\.1
7430--- file4	${RFCDATE}	1\.2\.2\.1
7431\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
7432\*\*\* 1 \*\*\*\*
7433! 4:trunk-1
7434--- 1 ----
7435! 4:br1"
7436	  dotest branches-15 \
7437	    "${testcvs} update -j 1.1.2.1 -j 1.1.2.1.2.1 file1" \
7438	    "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7439retrieving revision 1\.1\.2\.1
7440retrieving revision 1\.1\.2\.1\.2\.1
7441Merging differences between 1\.1\.2\.1 and 1\.1\.2\.1\.2\.1 into file1
7442rcsmerge: warning: conflicts during merge"
7443	  dotest branches-16 "cat file1" '<<<<<<< file1
74441:ancest
7445[=]======
74461:brbr
7447[>]>>>>>> 1\.1\.2\.1\.2\.1'
7448
7449	  dotest branches-o1 "${testcvs} -q admin -o ::brbr" \
7450"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7451done
7452RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
7453done
7454RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
7455done
7456RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
7457done"
7458
7459	  dokeep
7460	  cd ..
7461	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
7462	  rm -r first-dir
7463	  ;;
7464
7465
7466
7467	branches2)
7468	  # More branch tests.
7469	  # Test that when updating a new subdirectory in a directory
7470	  # which was checked out on a branch, the new subdirectory is
7471	  # created on the appropriate branch.  Test this when joining
7472	  # as well.
7473
7474	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
7475	  mkdir trunk; cd trunk
7476
7477	  # Create a file.
7478	  dotest branches2-1 "${testcvs} -q co first-dir"
7479	  cd first-dir
7480	  echo "file1 first revision" > file1
7481	  dotest branches2-2 "${testcvs} add file1" \
7482"${SPROG} add: scheduling file .file1. for addition
7483${SPROG} add: use .${SPROG} commit. to add this file permanently"
7484	  dotest branches2-3 "${testcvs} commit -m add file1" \
7485"${CVSROOT_DIRNAME}/first-dir/file1,v  <--  file1
7486initial revision: 1\.1"
7487
7488	  # Tag the file.
7489	  dotest branches2-4 "${testcvs} -q tag tag1" 'T file1'
7490
7491	  # Make two branches.
7492	  dotest branches2-5 "${testcvs} -q rtag -b -r tag1 b1 first-dir" ''
7493	  dotest branches2-6 "${testcvs} -q rtag -b -r tag1 b2 first-dir" ''
7494
7495	  # Create some files and a subdirectory on branch b1.
7496	  cd ../..
7497	  mkdir b1; cd b1
7498	  dotest branches2-7 "${testcvs} -q co -r b1 first-dir" \
7499"U first-dir/file1"
7500	  cd first-dir
7501	  echo "file2 first revision" > file2
7502	  dotest branches2-8 "${testcvs} add file2" \
7503"${SPROG}"' add: scheduling file `file2'\'' for addition on branch `b1'\''
7504'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
7505	  mkdir dir1
7506	  dotest branches2-9 "${testcvs} add dir1" \
7507"Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository
7508--> Using per-directory sticky tag "'`'"b1'"
7509	  echo "file3 first revision" > dir1/file3
7510	  dotest branches2-10 "${testcvs} add dir1/file3" \
7511"${SPROG}"' add: scheduling file `dir1/file3'\'' for addition on branch `b1'\''
7512'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
7513	  dotest branches2-11 "${testcvs} -q ci -madd ." \
7514"$CVSROOT_DIRNAME/first-dir/Attic/file2,v  <--  file2
7515new revision: 1\.1\.2\.1; previous revision: 1\.1
7516$CVSROOT_DIRNAME/first-dir/dir1/Attic/file3,v  <--  dir1/file3
7517new revision: 1\.1\.2\.1; previous revision: 1\.1"
7518
7519	  # Check out the second branch, and update the working
7520	  # directory to the first branch, to make sure the right
7521	  # happens with dir1.
7522	  cd ../..
7523	  mkdir b2; cd b2
7524	  dotest branches2-12 "${testcvs} -q co -r b2 first-dir" \
7525'U first-dir/file1'
7526	  cd first-dir
7527	  dotest branches2-13 "${testcvs} update -d -r b1 dir1" \
7528"${SPROG} update: Updating dir1
7529U dir1/file3"
7530	  dotest branches2-14 "${testcvs} -q status" \
7531"===================================================================
7532File: file1            	Status: Up-to-date
7533
7534   Working revision:	1\.1.*
7535   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file1,v
7536   Commit Identifier:	${commitid}
7537   Sticky Tag:		b2 (branch: 1\.1\.4)
7538   Sticky Date:		(none)
7539   Sticky Options:	(none)
7540
7541===================================================================
7542File: file3            	Status: Up-to-date
7543
7544   Working revision:	1\.1\.2\.1.*
7545   Repository revision:	1\.1\.2\.1	${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
7546   Commit Identifier:	${commitid}
7547   Sticky Tag:		b1 (branch: 1\.1\.2)
7548   Sticky Date:		(none)
7549   Sticky Options:	(none)"
7550
7551	  # Test some calls to rls here because we can.  These should probably
7552	  # be somewhere else, but we already have some directories set up.
7553          dotest branches2-14-rls-1 "$testcvs rls" \
7554"$SPROG rls: Listing module: \`.'
7555CVSROOT
7556first-dir"
7557          dotest branches2-14-rls-2 "$testcvs rls -R" \
7558"$SPROG rls: Listing module: \`.'
7559\.:
7560CVSROOT
7561first-dir
7562
7563CVSROOT:
7564access
7565aclconfig
7566checkoutlist
7567commitinfo
7568config
7569cvswrappers
7570group
7571loginfo
7572modules
7573notify
7574postadmin
7575postproxy
7576posttag
7577postwatch
7578preproxy
7579rcsinfo
7580taginfo
7581verifymsg
7582Emptydir
7583
7584CVSROOT/Emptydir:
7585
7586first-dir:
7587file1
7588dir1
7589
7590first-dir/dir1:"
7591          dotest branches2-14-rls-3 "$testcvs rls -l -R" \
7592"$SPROG rls: Listing module: \`.'
7593\.:
7594d--- $ISO8601DATE            CVSROOT
7595d--- $ISO8601DATE            first-dir
7596
7597CVSROOT:
7598---- $ISO8601DATE 1\.[0-9][0-9]*        access
7599---- $ISO8601DATE 1\.[0-9][0-9]*        aclconfig
7600---- $ISO8601DATE 1\.[0-9][0-9]*        checkoutlist
7601---- $ISO8601DATE 1\.[0-9][0-9]*        commitinfo
7602---- $ISO8601DATE 1\.[0-9][0-9]*        config
7603---- $ISO8601DATE 1\.[0-9][0-9]*        cvswrappers
7604---- $ISO8601DATE 1\.[0-9][0-9]*        group
7605---- $ISO8601DATE 1\.[0-9][0-9]*        loginfo
7606---- $ISO8601DATE 1\.[0-9][0-9]*        modules
7607---- $ISO8601DATE 1\.[0-9][0-9]*        notify
7608---- $ISO8601DATE 1\.[0-9][0-9]*        postadmin
7609---- $ISO8601DATE 1\.[0-9][0-9]*        postproxy
7610---- $ISO8601DATE 1\.[0-9][0-9]*        posttag
7611---- $ISO8601DATE 1\.[0-9][0-9]*        postwatch
7612---- $ISO8601DATE 1\.[0-9][0-9]*        preproxy
7613---- $ISO8601DATE 1\.[0-9][0-9]*        rcsinfo
7614---- $ISO8601DATE 1\.[0-9][0-9]*        taginfo
7615---- $ISO8601DATE 1\.[0-9][0-9]*        verifymsg
7616d--- $ISO8601DATE            Emptydir
7617
7618CVSROOT/Emptydir:
7619
7620first-dir:
7621---- $ISO8601DATE 1\.1        file1
7622d--- $ISO8601DATE            dir1
7623
7624first-dir/dir1:"
7625          dotest branches2-14-rls-4 "$testcvs rls -eR" \
7626"$SPROG rls: Listing module: \`.'
7627\.:
7628D/CVSROOT////
7629D/first-dir////
7630
7631CVSROOT:
7632/access/1\.[0-9][0-9]*/$DATE//
7633/aclconfig/1\.[0-9][0-9]*/$DATE//
7634/checkoutlist/1\.[0-9][0-9]*/$DATE//
7635/commitinfo/1\.[0-9][0-9]*/$DATE//
7636/config/1\.[0-9][0-9]*/$DATE//
7637/cvswrappers/1\.[0-9][0-9]*/$DATE//
7638/group/1\.[0-9][0-9]*/$DATE//
7639/loginfo/1\.[0-9][0-9]*/$DATE//
7640/modules/1\.[0-9][0-9]*/$DATE//
7641/notify/1\.[0-9][0-9]*/$DATE//
7642/postadmin/1\.[0-9][0-9]*/$DATE//
7643/postproxy/1\.[0-9][0-9]*/$DATE//
7644/posttag/1\.[0-9][0-9]*/$DATE//
7645/postwatch/1\.[0-9][0-9]*/$DATE//
7646/preproxy/1\.[0-9][0-9]*/$DATE//
7647/rcsinfo/1\.[0-9][0-9]*/$DATE//
7648/taginfo/1\.[0-9][0-9]*/$DATE//
7649/verifymsg/1\.[0-9][0-9]*/$DATE//
7650D/Emptydir////
7651
7652CVSROOT/Emptydir:
7653
7654first-dir:
7655/file1/1\.1/$DATE//
7656D/dir1////
7657
7658first-dir/dir1:"
7659          dotest branches2-14-rls-5 "$testcvs -q rls -R" \
7660"\.:
7661CVSROOT
7662first-dir
7663
7664CVSROOT:
7665access
7666aclconfig
7667checkoutlist
7668commitinfo
7669config
7670cvswrappers
7671group
7672loginfo
7673modules
7674notify
7675postadmin
7676postproxy
7677posttag
7678postwatch
7679preproxy
7680rcsinfo
7681taginfo
7682verifymsg
7683Emptydir
7684
7685CVSROOT/Emptydir:
7686
7687first-dir:
7688file1
7689dir1
7690
7691first-dir/dir1:"
7692          dotest branches2-14-rls-6 "$testcvs -q rls -lRrb1" \
7693"\.:
7694d--- $ISO8601DATE            CVSROOT
7695d--- $ISO8601DATE            first-dir
7696
7697CVSROOT:
7698d--- $ISO8601DATE            Emptydir
7699
7700CVSROOT/Emptydir:
7701
7702first-dir:
7703---- $ISO8601DATE 1\.1        file1
7704---- $ISO8601DATE 1\.1\.2\.1    file2
7705d--- $ISO8601DATE            dir1
7706
7707first-dir/dir1:
7708---- $ISO8601DATE 1\.1\.2\.1    file3"
7709          dotest branches2-14-rls-7 "$testcvs -q rls -lRrb2" \
7710"\.:
7711d--- $ISO8601DATE            CVSROOT
7712d--- $ISO8601DATE            first-dir
7713
7714CVSROOT:
7715d--- $ISO8601DATE            Emptydir
7716
7717CVSROOT/Emptydir:
7718
7719first-dir:
7720---- $ISO8601DATE 1\.1        file1
7721d--- $ISO8601DATE            dir1
7722
7723first-dir/dir1:"
7724
7725	  # Now some calls to ls.  These are more appropriate here.
7726	  dotest branches2-14-ls-1 "$testcvs ls" \
7727"file1
7728dir1"
7729	  dotest branches2-14-ls-2 "$testcvs ls -e" \
7730"/file1/1\.1/$DATE//
7731D/dir1////"
7732	  dotest branches2-14-ls-3 "$testcvs ls -R" \
7733"\.:
7734file1
7735dir1
7736
7737dir1:
7738file3"
7739	  dotest branches2-14-ls-4 "$testcvs ls -eRrHEAD" \
7740"\.:
7741/file1/1\.1/$DATE//THEAD
7742D/dir1////
7743
7744dir1:"
7745	  dotest branches2-14-ls-5 "$testcvs ls -eRrb1" \
7746"\.:
7747/file1/1\.1/$DATE//Tb1
7748/file2/1\.1\.2\.1/$DATE//Tb1
7749D/dir1////
7750
7751dir1:
7752/file3/1\.1\.2\.1/$DATE//Tb1"
7753	  dotest branches2-14-ls-6 "$testcvs ls -eRrb2" \
7754"\.:
7755/file1/1.1/$DATE//Tb2
7756D/dir1////
7757
7758dir1:"
7759	  # Nonexistant tags used to cause assertion failures.
7760	  dotest_fail branches2-14-ls-7 "$testcvs ls -eRrnosuchtag" \
7761"$SPROG \[ls aborted\]: no such tag \`nosuchtag'"
7762
7763	  # FIXME: Just clobbering the directory like this is a bit
7764	  # tacky, although people generally expect it to work.  Maybe
7765	  # we should release it instead.  We do it a few other places
7766	  # below as well.
7767	  rm -r dir1
7768	  dotest branches2-15 "${testcvs} update -d -j b1 dir1" \
7769"${SPROG} update: Updating dir1
7770U dir1/file3"
7771	  # FIXCVS: The `No revision control file' stuff seems to be
7772	  # CVS's way of telling us that we're adding the file on a
7773	  # branch, and the file is not on that branch yet.  This
7774	  # should be nicer.
7775	  dotest branches2-16 "${testcvs} -q status" \
7776"===================================================================
7777File: file1            	Status: Up-to-date
7778
7779   Working revision:	1\.1.*
7780   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file1,v
7781   Commit Identifier:	${commitid}
7782   Sticky Tag:		b2 (branch: 1\.1\.4)
7783   Sticky Date:		(none)
7784   Sticky Options:	(none)
7785
7786===================================================================
7787File: file3            	Status: Locally Added
7788
7789   Working revision:	New file!
7790   Repository revision:	No revision control file
7791   Sticky Tag:		b2 - MISSING from RCS file!
7792   Sticky Date:		(none)
7793   Sticky Options:	(none)"
7794
7795	  cd ../../trunk/first-dir
7796	  dotest branches2-17 "${testcvs} update -d -P dir1" \
7797"${SPROG} update: Updating dir1"
7798	  dotest_fail branches2-18 "test -d dir1"
7799	  dotest branches2-19 "${testcvs} update -d -P -r b1 dir1" \
7800"${SPROG} update: Updating dir1
7801U dir1/file3"
7802	  dotest branches2-20 "${testcvs} -q status" \
7803"===================================================================
7804File: file1            	Status: Up-to-date
7805
7806   Working revision:	1\.1.*
7807   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file1,v
7808   Commit Identifier:	${commitid}
7809   Sticky Tag:		(none)
7810   Sticky Date:		(none)
7811   Sticky Options:	(none)
7812
7813===================================================================
7814File: file3            	Status: Up-to-date
7815
7816   Working revision:	1\.1\.2\.1.*
7817   Repository revision:	1\.1\.2\.1	${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
7818   Commit Identifier:	${commitid}
7819   Sticky Tag:		b1 (branch: 1\.1\.2)
7820   Sticky Date:		(none)
7821   Sticky Options:	(none)"
7822
7823	  rm -r dir1
7824	  dotest branches2-21 "${testcvs} update -d -P -j b1 dir1" \
7825"${SPROG} update: Updating dir1
7826U dir1/file3"
7827	  dotest branches2-22 "${testcvs} -q status" \
7828"===================================================================
7829File: file1            	Status: Up-to-date
7830
7831   Working revision:	1\.1.*
7832   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file1,v
7833   Commit Identifier:	${commitid}
7834   Sticky Tag:		(none)
7835   Sticky Date:		(none)
7836   Sticky Options:	(none)
7837
7838===================================================================
7839File: file3            	Status: Locally Added
7840
7841   Working revision:	New file!
7842   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
7843   Commit Identifier:	${commitid}
7844   Sticky Tag:		(none)
7845   Sticky Date:		(none)
7846   Sticky Options:	(none)"
7847
7848	  cd ../..
7849	  rm -r b1 b2
7850
7851	  # Check out branch b1 twice.  Crate a new directory in one
7852	  # working directory, then do a cvs update in the other
7853	  # working directory and see if the tags are right.
7854	  mkdir b1a
7855	  mkdir b1b
7856	  cd b1b
7857	  dotest branches2-23 "${testcvs} -q co -r b1 first-dir" \
7858'U first-dir/file1
7859U first-dir/file2
7860U first-dir/dir1/file3'
7861	  cd ../b1a
7862	  dotest branches2-24 "${testcvs} -q co -r b1 first-dir" \
7863'U first-dir/file1
7864U first-dir/file2
7865U first-dir/dir1/file3'
7866	  cd first-dir
7867	  mkdir dir2
7868	  dotest branches2-25 "${testcvs} add dir2" \
7869"Directory ${CVSROOT_DIRNAME}/first-dir/dir2 added to the repository
7870--> Using per-directory sticky tag "'`'"b1'"
7871	  echo "file4 first revision" > dir2/file4
7872	  dotest branches2-26 "${testcvs} add dir2/file4" \
7873"${SPROG}"' add: scheduling file `dir2/file4'\'' for addition on branch `b1'\''
7874'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
7875	  dotest branches2-27 "${testcvs} -q commit -madd" \
7876"$CVSROOT_DIRNAME/first-dir/dir2/Attic/file4,v  <--  dir2/file4
7877new revision: 1\.1\.2\.1; previous revision: 1\.1"
7878
7879	  cd ../../b1b/first-dir
7880	  dotest branches2-28 "${testcvs} update -d dir2" \
7881"${SPROG} update: Updating dir2
7882U dir2/file4"
7883	  cd dir2
7884	  dotest branches2-29 "${testcvs} -q status" \
7885"===================================================================
7886File: file4            	Status: Up-to-date
7887
7888   Working revision:	1\.1\.2\.1.*
7889   Repository revision:	1\.1\.2\.1	${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
7890   Commit Identifier:	${commitid}
7891   Sticky Tag:		b1 (branch: 1\.1\.2)
7892   Sticky Date:		(none)
7893   Sticky Options:	(none)"
7894	  dotest branches2-30 "cat CVS/Tag" 'Tb1'
7895
7896	  # Test update -A on a subdirectory
7897	  cd ..
7898	  rm -r dir2
7899	  dotest branches2-31 "${testcvs} update -A -d dir2" \
7900"${SPROG} update: Updating dir2"
7901	  cd dir2
7902	  dotest branches2-32 "${testcvs} -q status" ''
7903	  dotest_fail branches2-33 "test -f CVS/Tag"
7904
7905	  # Add a file on the trunk.
7906	  echo "file5 first revision" > file5
7907	  dotest branches2-34 "${testcvs} add file5" \
7908"${SPROG}"' add: scheduling file `file5'\'' for addition
7909'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
7910	  dotest branches2-35 "${testcvs} -q commit -madd" \
7911"$CVSROOT_DIRNAME/first-dir/dir2/file5,v  <--  file5
7912initial revision: 1\.1"
7913
7914	  cd ../../../trunk/first-dir
7915	  dotest branches2-36 "${testcvs} -q update -d dir2" 'U dir2/file5'
7916	  cd dir2
7917	  dotest branches2-37 "${testcvs} -q status" \
7918"===================================================================
7919File: file5            	Status: Up-to-date
7920
7921   Working revision:	1\.1.*
7922   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
7923   Commit Identifier:	${commitid}
7924   Sticky Tag:		(none)
7925   Sticky Date:		(none)
7926   Sticky Options:	(none)"
7927	  dotest_fail branches2-38 "test -f CVS/status"
7928
7929          dotest branches2-39 "$testcvs rls -rb1 -l -R first-dir" \
7930"$SPROG rls: Listing module: \`first-dir'
7931first-dir:
7932---- $ISO8601DATE 1\.1        file1
7933---- $ISO8601DATE 1\.1\.2\.1    file2
7934d--- $ISO8601DATE            dir1
7935d--- $ISO8601DATE            dir2
7936
7937first-dir/dir1:
7938---- $ISO8601DATE 1\.1\.2\.1    file3
7939
7940first-dir/dir2:
7941---- $ISO8601DATE 1\.1\.2\.1    file4"
7942
7943	  dokeep
7944	  cd ../../..
7945	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
7946	  rm -r trunk b1a b1b
7947	  ;;
7948
7949
7950
7951	branches3)
7952	  # test local branch number support
7953
7954	  # This test is skipped in $remotehost mode since the
7955	  # CVS_LOCAL_BRANCH_NUM is not inherited by the server process as it
7956	  # is with :fork:, for hopefully obvious reasons.
7957	  #
7958	  # FIXCVS?  Is this correct?  Should CVS_LOCAL_BRANCH_NUM be sent as
7959	  # a protocol extension or is it reasonable to only want this set on
7960	  # the server?
7961
7962	  if test -n "$remotehost"; then :;else
7963	    modify_repo mkdir $CVSROOT_DIRNAME/first-dir
7964	    mkdir branches3; cd branches3
7965
7966	    dotest branches3-1 "$testcvs -q co first-dir"
7967	    cd first-dir
7968	    echo "file1 first revision" > file1
7969	    dotest branches3-2 "${testcvs} add file1" \
7970"${SPROG} add: scheduling file .file1. for addition
7971${SPROG} add: use .${SPROG} commit. to add this file permanently"
7972	    dotest branches3-3 "${testcvs} commit -m add file1" \
7973"${CVSROOT_DIRNAME}/first-dir/file1,v  <--  file1
7974initial revision: 1\.1"
7975
7976	    # Tag the file using a CVS_LOCAL_BRANCH_NUM of 1000
7977	    CVS_LOCAL_BRANCH_NUM=1000; export CVS_LOCAL_BRANCH_NUM
7978	    dotest branches3-4 "${testcvs} -q tag -b tag1" 'T file1'
7979	    unset CVS_LOCAL_BRANCH_NUM
7980	    dotest branches3-5 "${testcvs} -q log file1" \
7981"
7982RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
7983Working file: file1
7984head: 1\.1
7985branch:
7986locks: strict
7987access list:
7988symbolic names:
7989	tag1: 1\.1\.0\.1000
7990keyword substitution: kv
7991total revisions: 1;	selected revisions: 1
7992description:
7993----------------------------
7994revision 1.1
7995date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
7996add
7997============================================================================="
7998
7999	    dokeep
8000	    cd ../..
8001	    modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
8002	    rm -r branches3
8003	  fi # !$remotehost
8004	  ;;
8005
8006
8007
8008	branches4)
8009	  # test where a tag is a branch tag in some files and a revision
8010	  # tag in others
8011
8012	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
8013	  mkdir branches4; cd branches4
8014
8015	  dotest branches4-1 "$testcvs -q co first-dir"
8016	  cd first-dir
8017	  mkdir branches mixed mixed2 versions
8018	  dotest branches4-2 "${testcvs} -q add branches mixed mixed2 versions" \
8019"Directory ${CVSROOT_DIRNAME}/first-dir/branches added to the repository
8020Directory ${CVSROOT_DIRNAME}/first-dir/mixed added to the repository
8021Directory ${CVSROOT_DIRNAME}/first-dir/mixed2 added to the repository
8022Directory ${CVSROOT_DIRNAME}/first-dir/versions added to the repository"
8023
8024	  echo file1 >branches/file1
8025	  echo file2 >branches/file2
8026	  echo file3 >branches/file3
8027	  echo file4 >branches/file4
8028	  cp branches/file* mixed
8029	  cp branches/file* mixed2
8030	  cp branches/file* versions
8031
8032	  dotest branches4-3 "${testcvs} -q add */file*" \
8033"${SPROG} add: use .${SPROG} commit. to add these files permanently"
8034	  dotest branches4-3a "${testcvs} -Q ci -m."
8035
8036	  dotest branches4-4 "${testcvs} -q tag xxx versions/file* mixed*/file1 mixed*/file3" \
8037"T versions/file1
8038T versions/file2
8039T versions/file3
8040T versions/file4
8041T mixed/file1
8042T mixed/file3
8043T mixed2/file1
8044T mixed2/file3"
8045
8046	  dotest branches4-5 "${testcvs} -q tag -b xxx branches/file* mixed*/file2 mixed*/file4" \
8047"T branches/file1
8048T branches/file2
8049T branches/file3
8050T branches/file4
8051T mixed/file2
8052T mixed/file4
8053T mixed2/file2
8054T mixed2/file4"
8055
8056	  # make sure we get the appropriate warnings when updating
8057	  dotest branches4-6 "${testcvs} update -r xxx" \
8058"${SPROG} update: Updating \.
8059${SPROG} update: Updating branches
8060${SPROG} update: Updating mixed
8061${SPROG} update: warning: xxx is a branch tag in some files and a revision tag in others\.
8062${SPROG} update: Updating mixed2
8063${SPROG} update: warning: xxx is a branch tag in some files and a revision tag in others\.
8064${SPROG} update: Updating versions"
8065
8066	  # make sure we don't get warned in quiet modes
8067	  dotest branches4-7 "${testcvs} -q update -A"
8068	  dotest branches4-8 "${testcvs} -q update -r xxx"
8069	  dotest branches4-9 "${testcvs} -q update -A"
8070	  dotest branches4-10 "${testcvs} -Q update -r xxx"
8071
8072	  # make sure the Tag files are correct
8073	  dotest branches4-11 "cat branches/CVS/Tag" "Txxx"
8074	  dotest branches4-12 "cat mixed/CVS/Tag" "Nxxx"
8075	  dotest branches4-13 "cat mixed2/CVS/Tag" "Nxxx"
8076	  dotest branches4-14 "cat versions/CVS/Tag" "Nxxx"
8077
8078	  # We only warn if there's mixed usage in a single directory.
8079	  # We may want to consider changing that in the future.
8080	  dotest branches4-15 "${testcvs} update -r xxx branches versions" \
8081"${SPROG} update: Updating branches
8082${SPROG} update: Updating versions"
8083
8084	  dokeep
8085	  cd ../..
8086	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
8087	  rm -r branches4
8088	  ;;
8089
8090
8091
8092	tagc)
8093	  # Test the tag -c option.
8094	  mkdir 1; cd 1
8095	  dotest tagc-1 "${testcvs} -q co -l ." ''
8096	  mkdir first-dir
8097	  dotest tagc-2 "${testcvs} add first-dir" \
8098"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
8099	  cd first-dir
8100	  touch file1 file2
8101	  dotest tagc-3 "${testcvs} add file1 file2" \
8102"${SPROG} add: scheduling file .file1. for addition
8103${SPROG} add: scheduling file .file2. for addition
8104${SPROG} add: use .${SPROG} commit. to add these files permanently"
8105	  dotest tagc-4 "${testcvs} -q ci -m add" \
8106"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
8107initial revision: 1\.1
8108$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
8109initial revision: 1\.1"
8110	  dotest tagc-5 "${testcvs} -q tag -c tag1" \
8111"T file1
8112T file2"
8113	  touch file1 file2
8114	  dotest tagc-6 "${testcvs} -q tag -c tag2" \
8115"T file1
8116T file2"
8117	  # Avoid timestamp granularity bugs (FIXME: CVS should be
8118	  # doing the sleep, right?).
8119	  sleep 1
8120	  echo myedit >>file1
8121	  dotest tagc-6a "${testcvs} rm -f file2" \
8122"${SPROG} remove: scheduling .file2. for removal
8123${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
8124	  touch file3
8125	  dotest tagc-6b "${testcvs} add file3" \
8126"${SPROG} add: scheduling file .file3. for addition
8127${SPROG} add: use .${SPROG} commit. to add this file permanently"
8128	  dotest_fail tagc-7 "${testcvs} -q tag -c tag3" \
8129"${SPROG} tag: file1 is locally modified
8130${SPROG} tag: file2 is locally modified
8131${SPROG} tag: file3 is locally modified
8132${SPROG} \[tag aborted\]: correct the above errors first!"
8133	  cd ../..
8134	  mkdir 2
8135	  cd 2
8136	  dotest tagc-8 "${testcvs} -q co first-dir" \
8137"U first-dir/file1
8138U first-dir/file2"
8139	  cd ../1/first-dir
8140	  dotest tagc-9 "${testcvs} -q ci -m modify" \
8141"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
8142new revision: 1\.2; previous revision: 1\.1
8143$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
8144new revision: delete; previous revision: 1\.1
8145$CVSROOT_DIRNAME/first-dir/file3,v  <--  file3
8146initial revision: 1\.1"
8147	  cd ../../2/first-dir
8148	  dotest tagc-10 "${testcvs} -q tag -c tag4" \
8149"${SPROG} tag: \`file2' is no longer in the repository
8150T file1
8151T file2"
8152
8153	  dokeep
8154	  cd ../..
8155	  rm -r 1 2
8156	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
8157	  ;;
8158
8159
8160
8161	update-p)
8162	  # Make sure `cvs update -p -rT FILE' works from a branch when
8163	  # FILE is already on the trunk and is being added to that branch.
8164
8165	  mkdir 1; cd 1
8166	  module=x
8167
8168	  echo > unused-file
8169
8170	  # Create the module.
8171	  dotest update-p-1 \
8172	    "$testcvs -Q import -m. $module X Y" ''
8173
8174	  file=F
8175	  # Check it out and tag it.
8176	  dotest update-p-2 "$testcvs -Q co $module" ''
8177	  cd $module
8178	  dotest update-p-3 "$testcvs -Q tag -b B" ''
8179	  echo v1 > $file
8180	  dotest update-p-4 "$testcvs -Q add $file" ''
8181	  dotest update-p-5 "$testcvs -Q ci -m. $file"
8182	  dotest update-p-6 "$testcvs -Q tag T $file" ''
8183	  dotest update-p-7 "$testcvs -Q update -rB" ''
8184
8185	  # This merge effectively adds file F on branch B.
8186	  dotest update-p-8 "$testcvs -Q update -jT" ''
8187
8188	  # Before the fix that prompted the addition of this test,
8189	  # the following command would fail with this diagnostic:
8190	  # cvs update: conflict: F created independently by second party
8191	  dotest update-p-9 "$testcvs update -p -rT $file" \
8192"===================================================================
8193Checking out $file
8194RCS:  ${CVSROOT_DIRNAME}/$module/$file,v
8195VERS: 1\.1
8196\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
8197v1"
8198
8199	  # Repeat the above, but with $file removed.
8200	  # This exercises a slightly different code path.
8201	  rm $file
8202	  # Before the fix that prompted the addition of this test,
8203	  # the following command would fail with this diagnostic:
8204	  # cvs update: warning: new-born \`F' has disappeared
8205	  dotest update-p-10 "$testcvs update -p -rT $file" \
8206"===================================================================
8207Checking out $file
8208RCS:  ${CVSROOT_DIRNAME}/$module/$file,v
8209VERS: 1\.1
8210\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
8211v1"
8212
8213	  # Exercise yet another code path:
8214	  # the one that involves reviving a `dead' file.
8215	  # And a little more, for good measure...
8216	  touch new
8217	  dotest update-p-a1 "$testcvs -Q add new" ''
8218	  dotest update-p-a2 "$testcvs -Q update -p new" ''
8219	  dotest update-p-a3 "$testcvs -Q rm -f new" ''
8220
8221	  # Both an update -A, *and* the following update are required
8222	  # to return to the state of being on the trunk with a $file
8223	  # that we can then remove.
8224	  dotest update-p-undead-0 "$testcvs update -A" \
8225"${SPROG} update: Updating \.
8226${SPROG} update: warning: new-born \`$file' has disappeared"
8227	  dotest update-p-undead-1 "$testcvs update" \
8228"${SPROG} update: Updating \.
8229U $file"
8230	  dotest update-p-undead-2 "$testcvs -Q update -p -rT $file" v1
8231	  dotest update-p-undead-3 "$testcvs -Q rm -f $file" ''
8232	  dotest update-p-undead-4 "$testcvs -Q update -p -rT $file" v1
8233	  dotest update-p-undead-5 "$testcvs -Q ci -m. $file"
8234	  dotest update-p-undead-6 "$testcvs -Q update -p -rT $file" v1
8235	  echo v2 > $file
8236	  dotest update-p-undead-7 "$testcvs -Q update -p -rT $file" v1
8237	  dotest update-p-undead-8 "$testcvs add $file" \
8238"$SPROG add: Re-adding file .$file. after dead revision 1\.2\.
8239$SPROG add: use \`$SPROG commit' to add this file permanently"
8240
8241	  dotest update-p-undead-9 "$testcvs -Q update -p -rT $file" v1
8242
8243	  dokeep
8244	  cd ../..
8245	  rm -rf 1
8246	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
8247	  ;;
8248
8249
8250
8251	tagf)
8252	  # More tagging tests, including using tag -F -B to convert a
8253	  # branch tag to a regular tag and recovering thereof.
8254
8255	  # Setup; check in first-dir/file1
8256	  mkdir 1; cd 1
8257	  dotest tagf-1 "${testcvs} -q co -l ." ''
8258	  mkdir first-dir
8259	  dotest tagf-2 "${testcvs} add first-dir" \
8260"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
8261	  cd first-dir
8262	  touch file1 file2
8263	  dotest tagf-3 "${testcvs} add file1 file2" \
8264"${SPROG} add: scheduling file .file1. for addition
8265${SPROG} add: scheduling file .file2. for addition
8266${SPROG} add: use .${SPROG} commit. to add these files permanently"
8267	  dotest tagf-4 "${testcvs} -q ci -m add" \
8268"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
8269initial revision: 1\.1
8270$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
8271initial revision: 1\.1"
8272
8273	  # Now create a branch and commit a revision there.
8274	  dotest tagf-5 "${testcvs} -q tag -b br" "T file1
8275T file2"
8276	  dotest tagf-6 "${testcvs} -q update -r br" ""
8277	  echo brmod >> file1
8278	  echo brmod >> file2
8279	  dotest tagf-7 "${testcvs} -q ci -m modify" \
8280"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
8281new revision: 1\.1\.2\.1; previous revision: 1\.1
8282$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
8283new revision: 1\.1\.2\.1; previous revision: 1\.1"
8284	  # Here we try to make it a non-branch tag, but will
8285	  # succeed in getting only warnings, even with -F
8286	  # because converting a branch tag to non-branch
8287	  # is potentially catastrophic.
8288	  dotest tagf-8a "${testcvs} -q tag -F br" \
8289"${SPROG} tag: file1: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\\.2\.1\.
8290${SPROG} tag: file2: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\.2\.1\."
8291	  # however, if we *really* are sure we want to move a branch tag,
8292	  # "-F -B" will do the trick
8293	  dotest tagf-8 "${testcvs} -q tag -F -B br" "T file1
8294T file2"
8295	  echo moremod >> file1
8296	  echo moremod >> file2
8297	  dotest tagf-9 "${testcvs} -q status -v file1" \
8298"===================================================================
8299File: file1            	Status: Locally Modified
8300
8301   Working revision:	1\.1\.2\.1.*
8302   Repository revision:	1\.1\.2\.1	${CVSROOT_DIRNAME}/first-dir/file1,v
8303   Commit Identifier:	${commitid}
8304   Sticky Tag:		br (revision: 1\.1\.2\.1)
8305   Sticky Date:		(none)
8306   Sticky Options:	(none)
8307
8308   Existing Tags:
8309	br                       	(revision: 1\.1\.2\.1)"
8310
8311	  # Now, how do we recover?
8312	  dotest tagf-10 "${testcvs} -q tag -d br" "D file1
8313D file2"
8314	  # This creates a new branch, 1.1.4.  See the code in RCS_magicrev
8315	  # which will notice that there is a (non-magic) 1.1.2 and thus
8316	  # skip that number.
8317	  dotest tagf-11 "${testcvs} -q tag -r 1.1 -b br file1" "T file1"
8318	  # Fix it with admin -n (cf admin-18, admin-26-4).
8319	  dotest tagf-12 "${testcvs} -q admin -nbr:1.1.2 file2" \
8320"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
8321done"
8322	  # Another variation on the file2 test would be to use two working
8323	  # directories so that the update -r br would need to
8324	  # a merge to get from 1.1.2.1 to the head of the 1.1.2 branch.
8325	  dotest tagf-13 "${testcvs} -q update -r br" \
8326"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8327retrieving revision 1\.1\.2\.1
8328retrieving revision 1\.1
8329Merging differences between 1\.1\.2\.1 and 1\.1 into file1
8330rcsmerge: warning: conflicts during merge
8331${SPROG} update: conflicts found in file1
8332C file1
8333M file2"
8334	  # CVS is giving a conflict because we are trying to get back to
8335	  # 1.1.4.  I'm not sure why it is a conflict rather than just
8336	  # "M file1".
8337	  dotest tagf-14 "cat file1" \
8338"<<<<<<< file1
8339brmod
8340moremod
8341[=]======
8342[>]>>>>>> 1\.1"
8343	  echo resolve >file1
8344	  dotest tagf-15 "${testcvs} -q ci -m recovered" \
8345"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
8346new revision: 1\.1\.4\.1; previous revision: 1\.1
8347$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
8348new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1"
8349	  # try accidentally deleting branch tag, "tag -d"
8350	  dotest_fail tagf-16 "${testcvs} tag -d br" \
8351"${SPROG} tag: Untagging \.
8352${SPROG} tag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\.
8353${SPROG} tag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\."
8354	  # try accidentally deleting branch tag, "rtag -d"
8355	  dotest_fail tagf-17 "${testcvs} rtag -d br first-dir" \
8356"${SPROG} rtag: Untagging first-dir
8357${SPROG} rtag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\.
8358${SPROG} rtag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\."
8359	  # try accidentally converting branch tag to non-branch tag "tag -F"
8360	  dotest tagf-18 "${testcvs} tag -r1.1 -F br file1" \
8361"${SPROG} tag: file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\."
8362	  # try accidentally converting branch tag to non-branch tag "rtag -F"
8363	  dotest tagf-19 "${testcvs} rtag -r1.1 -F br first-dir" \
8364"${SPROG} rtag: Tagging first-dir
8365${SPROG} rtag: first-dir/file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\.
8366${SPROG} rtag: first-dir/file2: Not moving branch tag .br. from 1\.1\.2\.2 to 1\.1\."
8367	  # create a non-branch tag
8368	  dotest tagf-20 "${testcvs} rtag regulartag first-dir" \
8369"${SPROG} rtag: Tagging first-dir"
8370	  # try accidentally converting non-branch tag to branch tag (tag -F -B -b)
8371	  dotest tagf-21 "${testcvs} tag -F -B -b regulartag file1" \
8372"${SPROG} tag: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1\.0\.2 due to .-B. option\."
8373	  # try accidentally converting non-branch tag to branch rtag (rtag -F -B -b)
8374	  dotest tagf-22 "${testcvs} rtag -F -B -b regulartag first-dir" \
8375"${SPROG} rtag: Tagging first-dir
8376${SPROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.6 due to .-B. option\.
8377${SPROG} rtag: first-dir/file2: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.4 due to .-B. option\."
8378	  # Try accidentally deleting non-branch: (tag -d -B)
8379	  dotest_fail tagf-23 "${testcvs} tag -d -B regulartag file1" \
8380"${SPROG} tag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\."
8381	  # Try accidentally deleting non-branch: (rtag -d -B)
8382	  dotest_fail tagf-24 \
8383		"${testcvs} rtag -d -B regulartag first-dir" \
8384"${SPROG} rtag: Untagging first-dir
8385${SPROG} rtag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\.
8386${SPROG} rtag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file2,v. due to .-B. option\."
8387
8388	  # the following tests (throught the next commit) keep moving the same
8389	  # tag back and forth between 1.1.6 & 1.1.8  in file1 and between
8390	  # 1.1.4 and 1.1.6 in file2 since nothing was checked in on some of
8391	  # these branches and CVS only tracks branches via tags unless they contain data.
8392
8393	  # try intentionally converting non-branch tag to branch tag (tag -F -b)
8394	  dotest tagf-25a "${testcvs} tag -F -b regulartag file1" "T file1"
8395	  # try intentionally moving a branch tag to a newly created branch (tag -F -b -B)
8396	  dotest tagf-25b "${testcvs} tag -F -B -b -r1.1 regulartag file1" \
8397"T file1"
8398	  # try intentionally converting mixed tags to branch tags (rtag -F -b)
8399	  dotest tagf-26a "${testcvs} rtag -F -b regulartag first-dir" \
8400"${SPROG} rtag: Tagging first-dir
8401${SPROG} rtag: first-dir/file1: Not moving branch tag .regulartag. from 1\.1 to 1\.1\.0\.8\."
8402	  # try intentionally converting a branch to a new branch tag (rtag -F -b -B)
8403	  dotest tagf-26b "${testcvs} rtag -F -B -b -r1.1 regulartag first-dir" \
8404"${SPROG} rtag: Tagging first-dir"
8405	  # update to our new branch
8406	  dotest tagf-27 "${testcvs} update -r regulartag" \
8407"${SPROG} update: Updating \.
8408U file1
8409U file2"
8410	  # commit some changes and see that all rev numbers look right
8411	  echo changes >> file1
8412	  echo changes >> file2
8413	  dotest tagf-28 "${testcvs} ci -m changes" \
8414"${CPROG} commit: Examining \.
8415${CVSROOT_DIRNAME}/first-dir/file1,v  <--  file1
8416new revision: 1\.1\.8\.1; previous revision: 1\.1
8417${CVSROOT_DIRNAME}/first-dir/file2,v  <--  file2
8418new revision: 1\.1\.6\.1; previous revision: 1\.1"
8419	  # try intentional branch to non-branch (tag -F -B)
8420	  dotest tagf-29 "${testcvs} tag -F -B -r1.1 regulartag file1" \
8421"T file1"
8422	  # try non-branch to non-branch (tag -F -B)
8423	  dotest tagf-29a "${testcvs} tag -F -B -r br regulartag file1" \
8424"${SPROG} tag: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\."
8425	  # try mixed-branch to non-branch (rtag -F -B )
8426	  dotest tagf-29b "${testcvs} rtag -F -B -r br regulartag first-dir" \
8427"${SPROG} rtag: Tagging first-dir
8428${SPROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\."
8429	  # at this point, regulartag is a regular tag within
8430	  # file1 and file2
8431
8432	  # try intentional branch to non-branch (rtag -F -B)
8433	  dotest tagf-30 "${testcvs} rtag -F -B -r1.1 br first-dir"  \
8434"${SPROG} rtag: Tagging first-dir"
8435	  # create a branch tag so we can try to delete it.
8436	  dotest tagf-31 "${testcvs} rtag -b brtag first-dir"  \
8437"${SPROG} rtag: Tagging first-dir"
8438
8439	  # try intentinal deletion of branch tag (tag -d -B)
8440	  dotest tagf-32 "${testcvs} tag -d -B brtag file1" "D file1"
8441	  # try intentinal deletion of branch tag (rtag -d -B)
8442	  dotest tagf-33 "${testcvs} rtag -d -B brtag first-dir" \
8443"${SPROG} rtag: Untagging first-dir"
8444
8445	  dokeep
8446	  cd ../..
8447	  rm -r 1
8448	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
8449	  ;;
8450
8451
8452
8453	tag-space)
8454	  # Test tags with spaces in the names.
8455	  #
8456	  # Prior to releases 1.11.18 & 1.12.10, some commands used with
8457	  # tags with spaces in the names could hang CVS.
8458
8459	  # Setup; check in first-dir/file1
8460	  mkdir 1; cd 1
8461	  dotest tag-space-init-1 "$testcvs -q co -l ."
8462	  mkdir first-dir
8463	  dotest tag-space-init-2 "$testcvs add first-dir" \
8464"Directory $CVSROOT_DIRNAME/first-dir added to the repository"
8465	  cd first-dir
8466	  touch file1
8467	  dotest tag-space-init-3 "$testcvs add file1" \
8468"$SPROG add: scheduling file \`file1' for addition
8469$SPROG add: use \`$SPROG commit' to add this file permanently"
8470	  dotest tag-space-init-4 "$testcvs -Q ci -m add"
8471
8472	  # Reportedly, the following two tags make it past WinCVS.
8473	  dotest_fail tag-space-1 "$testcvs tag ' spacetag '" \
8474"$SPROG \[tag aborted\]: tag \` spacetag ' must start with a letter"
8475	  dotest_fail tag-space-2 "$testcvs tag 'spacetag '" \
8476"$SPROG \[tag aborted\]: tag \`spacetag ' has non-visible graphic characters"
8477
8478	  if $remote; then
8479	    # Verify that this isn't a client check.
8480	    dotest tag-space-3 "$testcvs server" \
8481"E $SPROG \[tag aborted\]: tag \` spacetag ' must start with a letter
8482error  " <<EOF
8483Root $CVSROOT_DIRNAME
8484UseUnchanged
8485Argument --
8486Argument  spacetag 
8487Directory .
8488$CVSROOT_DIRNAME/first-dir
8489Entry /file1/1.1///
8490Unchanged file1
8491tag
8492EOF
8493
8494	    dotest tag-space-4 "$testcvs server" \
8495"E $SPROG \[tag aborted\]: tag \`spacetag ' has non-visible graphic characters
8496error  " <<EOF
8497Root $CVSROOT_DIRNAME
8498UseUnchanged
8499Argument --
8500Argument spacetag 
8501Directory .
8502$CVSROOT_DIRNAME/first-dir
8503Entry /file1/1.1///
8504Unchanged file1
8505tag
8506EOF
8507	  fi # $remote
8508
8509	  # Any number of normal tags and branches were handled correctly.
8510	  dotest tag-space-5 "$testcvs -Q tag t1"
8511	  dotest tag-space-5b "$testcvs -Q tag t2"
8512	  dotest tag-space-5c "$testcvs -Q tag -b b1"
8513
8514	  cd ../..
8515	  mkdir 2; cd 2
8516
8517	  # But once a vendor branch exists, it's all over.
8518	  mkdir project; cd project
8519	  touch file1
8520	  dotest tag-space-init-4 \
8521"$testcvs -Q import -mimport second-dir VENDOR RELEASE"
8522
8523	  cd ..
8524
8525	  dotest_fail tag-space-6 "$testcvs -Q co -r ' spacetag ' first-dir" \
8526"$SPROG \[checkout aborted\]: tag \` spacetag ' must start with a letter"
8527
8528	  # But when any files were imported, this test hung prior to CVS
8529	  # versions 1.11.18 & 1.12.10.
8530	  dotest_fail tag-space-7 "$testcvs -Q co -r ' spacetag ' second-dir" \
8531"$SPROG \[checkout aborted\]: tag \` spacetag ' must start with a letter"
8532
8533	  if $remote; then
8534	    # I based the client input in the next two tests on actual input
8535	    # from WinCVS 1.2.
8536	    dotest tag-space-8 "$testcvs server" \
8537"E $SPROG \[checkout aborted\]: tag \` spacetag ' must start with a letter
8538error  " <<EOF
8539Root $CVSROOT_DIRNAME
8540Argument -P
8541Argument -r
8542Argument  spacetag 
8543Argument first-dir
8544Directory .
8545$CVSROOT_DIRNAME
8546co
8547EOF
8548
8549	    # Verify the test is not on the client side.
8550	    dotest tag-space-9 "$testcvs server" \
8551"E $SPROG \[checkout aborted\]: tag \` spacetag ' must start with a letter
8552error  " <<EOF
8553Root $CVSROOT_DIRNAME
8554Argument -P
8555Argument -r
8556Argument  spacetag 
8557Argument second-dir
8558Directory .
8559$CVSROOT_DIRNAME
8560co
8561EOF
8562	  fi # $remote
8563
8564	  dotest tag-space-10 "$testcvs -Q co second-dir"
8565	  cd second-dir
8566
8567	  # This test would also hang.
8568	  dotest_fail tag-space-11 "$testcvs -Q up -r ' spacetag '" \
8569"$SPROG \[update aborted\]: tag \` spacetag ' must start with a letter"
8570
8571	  if $remote; then
8572	    dotest tag-space-12 "$testcvs server" \
8573"E $SPROG \[update aborted\]: tag \` spacetag ' must start with a letter
8574error  " <<EOF
8575Root $CVSROOT_DIRNAME
8576Argument -r
8577Argument  spacetag 
8578Argument -u
8579Argument --
8580Directory .
8581$CVSROOT_DIRNAME
8582Unchanged file1
8583update
8584EOF
8585	  fi # $remote
8586
8587	  # I'm skipping tests for other commands that may have had the same
8588	  # problem.  Hopefully, if a new issue arises, one of the above tests
8589	  # will catch the problem.
8590
8591	  if $keep; then
8592	    echo Keeping $TESTDIR and exiting due to --keep
8593	    exit 0
8594	  fi
8595
8596	  cd ../..
8597	  rm -r 1 2
8598	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
8599	                     $CVSROOT_DIRNAME/second-dir
8600	  ;;
8601
8602
8603
8604	rcslib)
8605	  # Test librarification of RCS.
8606	  # First: test whether `cvs diff' handles $Name expansion
8607	  # correctly.	We diff two revisions with their symbolic tags;
8608	  # neither tag should be expanded in the output.  Also diff
8609	  # one revision with the working copy.
8610
8611	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
8612	  dotest rcsdiff-1 "${testcvs} -q co first-dir" ''
8613	  cd first-dir
8614	  echo "I am the first foo, and my name is $""Name$." > foo.c
8615	  dotest rcsdiff-2 "${testcvs} add -m new-file foo.c" \
8616"${SPROG} add: scheduling file .foo\.c. for addition
8617${SPROG} add: use .${SPROG} commit. to add this file permanently"
8618	  dotest rcsdiff-3 "${testcvs} commit -m rev1 foo.c" \
8619"${CVSROOT_DIRNAME}/first-dir/foo.c,v  <--  foo\.c
8620initial revision: 1\.1"
8621	  dotest rcsdiff-4 "${testcvs} tag first foo.c" "T foo\.c"
8622	  dotest rcsdiff-5 "${testcvs} update -p -r first foo.c" \
8623"===================================================================
8624Checking out foo\.c
8625RCS:  ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
8626VERS: 1\.1
8627\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
8628I am the first foo, and my name is \$""Name: first \$\."
8629
8630	  echo "I am the second foo, and my name is $""Name$." > foo.c
8631	  dotest rcsdiff-6 "${testcvs} commit -m rev2 foo.c" \
8632"${CVSROOT_DIRNAME}/first-dir/foo\.c,v  <--  foo\.c
8633new revision: 1\.2; previous revision: 1\.1"
8634	  dotest rcsdiff-7 "${testcvs} tag second foo.c" "T foo\.c"
8635	  dotest rcsdiff-8 "${testcvs} update -p -r second foo.c" \
8636"===================================================================
8637Checking out foo\.c
8638RCS:  ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
8639VERS: 1\.2
8640\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
8641I am the second foo, and my name is \$""Name: second \$\."
8642
8643	dotest_fail rcsdiff-9 "${testcvs} diff -r first -r second" \
8644"${SPROG} diff: Diffing \.
8645Index: foo\.c
8646===================================================================
8647RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
8648retrieving revision 1\.1
8649retrieving revision 1\.2
8650diff -r1\.1 -r1\.2
86511c1
8652< I am the first foo, and my name is \$""Name:  \$\.
8653---
8654> I am the second foo, and my name is \$""Name:  \$\."
8655
8656	  echo "I am the once and future foo, and my name is $""Name$." > foo.c
8657	  dotest_fail rcsdiff-10 "${testcvs} diff -r first" \
8658"${SPROG} diff: Diffing \.
8659Index: foo\.c
8660===================================================================
8661RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
8662retrieving revision 1\.1
8663diff -r1\.1 foo\.c
86641c1
8665< I am the first foo, and my name is \$""Name:  \$\.
8666---
8667> I am the once and future foo, and my name is \$""Name\$\."
8668
8669	  # Test handling of libdiff options.  diff gets quite enough
8670	  # of a workout elsewhere in sanity.sh, so we assume that it's
8671	  # mostly working properly if it passes all the other tests.
8672	  # The main one we want to try is regex handling, since we are
8673	  # using CVS's regex matcher and not diff's.
8674
8675	  cat >rgx.c <<EOF
8676test_regex (whiz, bang)
8677{
8678foo;
8679bar;
8680baz;
8681grumble;
8682}
8683EOF
8684
8685	  dotest rcslib-diffrgx-1 "${testcvs} -q add -m '' rgx.c" \
8686"${SPROG} add: use .${SPROG} commit. to add this file permanently"
8687	  dotest rcslib-diffrgx-2 "${testcvs} -q ci -m '' rgx.c" \
8688"$CVSROOT_DIRNAME/first-dir/rgx\.c,v  <--  rgx\.c
8689initial revision: 1\.1"
8690	  cat >rgx.c <<EOF
8691test_regex (whiz, bang)
8692{
8693foo;
8694bar;
8695baz;
8696mumble;
8697}
8698EOF
8699	  # Use dotest_fail because exit status from `cvs diff' must be 1.
8700	  #
8701	  # Incidentally test that CVS no longer splits diff arguments on
8702	  # spaces.
8703	  dotest_fail rcslib-diffrgx-3 "$testcvs diff -c -F'.* (' rgx.c" \
8704"Index: rgx\.c
8705===================================================================
8706RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
8707retrieving revision 1\.1
8708diff -c -F '\.\* (' -r1\.1 rgx\.c
8709\*\*\* rgx\.c	${RFCDATE}	1\.1
8710--- rgx\.c	${RFCDATE}
8711\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* test_regex (whiz, bang)
8712\*\*\* 3,7 \*\*\*\*
8713  foo;
8714  bar;
8715  baz;
8716! grumble;
8717  }
8718--- 3,7 ----
8719  foo;
8720  bar;
8721  baz;
8722! mumble;
8723  }"
8724
8725	  # Tests of rcsmerge/diff3.  Merge operations get a good general
8726	  # workout elsewhere; we want to make sure that options are still
8727	  # handled properly.  Try merging two branches with -kv, to test
8728	  # both -j and -k switches.
8729
8730	  cd ..
8731
8732	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
8733	  rm -r first-dir
8734
8735	  mkdir 1; cd 1
8736	  dotest rcslib-merge-1 "$testcvs -q co -l ."
8737	  mkdir first-dir
8738	  dotest rcslib-merge-2 "$testcvs -q add first-dir" \
8739"Directory $CVSROOT_DIRNAME.*/first-dir added to the repository"
8740	  cd ..; rm -r 1
8741
8742	  dotest rcslib-merge-3 "$testcvs -q co first-dir" ""
8743	  cd first-dir
8744
8745	  echo '$''Revision$' > file1
8746	  echo '2' >> file1
8747	  echo '3' >> file1
8748	  dotest rcslib-merge-4 "${testcvs} -q add file1" \
8749"${SPROG} add: use .${SPROG} commit. to add this file permanently"
8750	  dotest rcslib-merge-5 "${testcvs} -q commit -m '' file1" \
8751"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
8752initial revision: 1\.1"
8753	  sed -e 's/2/two/' file1 > f; mv f file1
8754	  dotest rcslib-merge-6 "${testcvs} -q commit -m '' file1" \
8755"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
8756new revision: 1\.2; previous revision: 1\.1"
8757	  dotest rcslib-merge-7 "${testcvs} -q tag -b -r 1.1 patch1" "T file1"
8758	  dotest rcslib-merge-8 "${testcvs} -q update -r patch1" "[UP] file1"
8759	  dotest rcslib-merge-9 "${testcvs} -q status" \
8760"===================================================================
8761File: file1            	Status: Up-to-date
8762
8763   Working revision:	1\.1.*
8764   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file1,v
8765   Commit Identifier:	${commitid}
8766   Sticky Tag:		patch1 (branch: 1\.1\.2)
8767   Sticky Date:		(none)
8768   Sticky Options:	(none)"
8769	  dotest rcslib-merge-10 "cat file1" \
8770'$''Revision: 1\.1 $
87712
87723'
8773	  sed -e 's/3/three/' file1 > f; mv f file1
8774	  dotest rcslib-merge-11 "${testcvs} -q commit -m '' file1" \
8775"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
8776new revision: 1\.1\.2\.1; previous revision: 1\.1"
8777	  dotest rcslib-merge-12 "${testcvs} -q update -kv -j1.2" \
8778"U file1
8779RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
8780retrieving revision 1\.1
8781retrieving revision 1\.2
8782Merging differences between 1\.1 and 1\.2 into file1
8783rcsmerge: warning: conflicts during merge"
8784	  dotest rcslib-merge-13 "cat file1" \
8785"<<<<<<< file1
87861\.1\.2\.1
87872
8788three
8789[=]======
87901\.2
8791two
87923
8793[>]>>>>>> 1\.2"
8794
8795	  # Test behavior of symlinks in the repository.
8796	  if test -n "$remotehost"; then
8797	    # Create the link on the remote system.  This is because Cygwin's
8798	    # Windows support creates *.lnk files for Windows.  When creating
8799	    # these in an SMB share from UNIX, these links won't work from the
8800	    # UNIX side.
8801	    modify_repo $CVS_RSH $remotehost "'ln -s file1,v $CVSROOT_DIRNAME/first-dir/file2,v'"
8802	  else
8803	    modify_repo ln -s file1,v $CVSROOT_DIRNAME/first-dir/file2,v
8804	  fi
8805	  dotest rcslib-symlink-2 "$testcvs update file2" "U file2"
8806	  echo "This is a change" >> file2
8807	  dotest rcslib-symlink-3 "$testcvs ci -m because file2" \
8808"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file2
8809new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1"
8810
8811	  # Switch as for rcslib-symlink-1
8812	  if test -n "$remotehost"; then
8813	    dotest rcslib-symlink-4 "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/file2,v'" \
8814".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
8815	  else
8816	    dotest rcslib-symlink-4 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
8817".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
8818	  fi
8819
8820	  # CVS was failing to check both the symlink and the file
8821	  # for timestamp changes for a while.  Test that.
8822	  rm file1
8823	  dotest rcslib-symlink-3a "${testcvs} -q up file1" \
8824"${SPROG} update: warning: \`file1' was lost
8825U file1"
8826	  echo "This is a change" >> file1
8827	  dotest rcslib-symlink-3b "${testcvs} ci -m because file1" \
8828"${CVSROOT_DIRNAME}/first-dir/file1,v  <--  file1
8829new revision: 1\.1\.2\.[0-9]*; previous revision: 1\.1\.2\.[0-9]*"
8830	  dotest rcslib-symlink-3c "${testcvs} update file2" "[UP] file2"
8831
8832	  echo some new text >file3
8833	  dotest rcslib-symlink-3d "${testcvs} -Q add file3" ''
8834	  dotest rcslib-symlink-3e "$testcvs -Q ci -mtest file3"
8835
8836	  rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v
8837	  # As for rcslib-symlink-1
8838	  if test -n "$remotehost"; then
8839	    modify_repo "$CVS_RSH $remotehost 'ln -s Attic/file3,v $CVSROOT_DIRNAME/first-dir/file2,v'"
8840	  else
8841	    modify_repo ln -s Attic/file3,v $CVSROOT_DIRNAME/first-dir/file2,v
8842	  fi
8843
8844	  dotest rcslib-symlink-3g "$testcvs update file2" "U file2"
8845
8846	  # restore the link to file1 for the following tests
8847	  dotest rcslib-symlink-3i "$testcvs -Q rm -f file3" ''
8848	  dotest rcslib-symlink-3j "$testcvs -Q ci -mwhatever file3"
8849	  rm -f $CVSROOT_DIRNAME/first-dir/file2,v
8850	  rm -f $CVSROOT_DIRNAME/first-dir/Attic/file3,v
8851	  # As for rcslib-symlink-1
8852	  if test -n "$remotehost"; then
8853	    modify_repo "$CVS_RSH $remotehost 'ln -s file1,v $CVSROOT_DIRNAME/first-dir/file2,v'"
8854	  else
8855	    modify_repo ln -s file1,v $CVSROOT_DIRNAME/first-dir/file2,v
8856	  fi
8857
8858	  # Test 5 reveals a problem with having symlinks in the
8859	  # repository.  CVS will try to tag both of the files
8860	  # separately.  After processing one, it will do the same
8861	  # operation to the other, which is actually the same file,
8862	  # so the tag will already be there.  FIXME: do we bother
8863	  # changing operations to notice cases like this?  This
8864	  # strikes me as a difficult problem.  -Noel
8865	  dotest rcslib-symlink-5 "$testcvs tag the_tag" \
8866"$SPROG tag: Tagging .
8867T file1
8868W file2 : the_tag already exists on version 1.1.2.3 : NOT MOVING tag to version 1.1.2.1"
8869	  # As for rcslib-symlink-1
8870	  if test -n "$remotehost"; then
8871	    dotest rcslib-symlink-6 "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/file2,v'" \
8872".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
8873	  else
8874	    dotest rcslib-symlink-6 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
8875".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
8876	  fi
8877
8878	  # Symlinks tend to interact poorly with the Attic.
8879	  cd ..
8880	  mkdir 2; cd 2
8881	  dotest rcslib-symlink-7 "$testcvs -q co first-dir" \
8882"U first-dir/file1
8883U first-dir/file2"
8884	  cd first-dir
8885	  dotest rcslib-symlink-8 "$testcvs rm -f file2" \
8886"$SPROG remove: scheduling .file2. for removal
8887$SPROG remove: use .$SPROG commit. to remove this file permanently"
8888	  dotest rcslib-symlink-9 "$testcvs -q ci -m rm-it" \
8889"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file2
8890new revision: delete; previous revision: 1\.2"
8891	  # OK, why this message happens twice is relatively clear
8892	  # (the check_* and rtag_* calls to start_recursion).
8893	  # Why it happens a third time I didn't try to find out.
8894	  #
8895	  # DRP: One of the error messages disappeared while I was making
8896	  # proxy modifications.  Until I detect a deeper issue, I'm not
8897	  # going to stress over it.
8898	  #
8899	  # DRP: Both messages disappear starting with glibc 2.3.3 due to a bug
8900	  # in the glob function which causes it to fail to return broken
8901	  # symlinks.  I'm submitting a bug fix to glibc which will hopefully
8902	  # be released with glibc 2.3.6.  Once it is released and versions
8903	  # 2.3.3-2.3.5 of glibc become uncommon, the first, empty case below
8904	  # should be removed again.
8905	  dotest rcslib-symlink-10 \
8906"$testcvs -q rtag -b -r the_tag brtag first-dir" "" \
8907"$SPROG rtag: could not read RCS file for first-dir/file2
8908$SPROG rtag: could not read RCS file for first-dir/file2"
8909
8910	  # Restore file1 for the next test.
8911	  dotest rcslib-long-symlink-init-1 "$testcvs -Q up -A"
8912	  dotest rcslib-long-symlink-init-2 "$testcvs -Q add file1"
8913	  dotest rcslib-long-symlink-init-3 "$testcvs -Q ci -mback"
8914
8915	  cd ../..  # $TESTDIR
8916
8917	  # CVS has a hard-coded default link path size of 127 characters.
8918	  # Make sure it knows how to exceed that.
8919	  longpath=$CVSROOT_DIRNAME
8920	  count=0
8921	  while test $count -lt 10; do
8922	    # 10 * 30 characters + len $CVSROOT_DIRNAME
8923	    count=`expr $count + 1`
8924	    longpath=$longpath/123456789012345678901234567890
8925	    modify_repo mkdir $longpath
8926	  done
8927	  modify_repo cp $CVSROOT_DIRNAME/first-dir/file1,v $longpath
8928	  modify_repo mkdir $CVSROOT_DIRNAME/second-dir
8929
8930	  # Switch as for rcslib-symlink-1
8931	  if test -n "$remotehost"; then
8932	    modify_repo $CVS_RSH $remotehost \
8933	    'ln -s $longpath/file1,v $CVSROOT_DIRNAME/second-dir/fileX,v'
8934	  else
8935	    modify_repo ln -s $longpath/file1,v \
8936			      $CVSROOT_DIRNAME/second-dir/fileX,v
8937	  fi
8938
8939	  dotest rcslib-long-symlink-2 "$testcvs co second-dir" \
8940"$SPROG checkout: Updating second-dir
8941U second-dir/fileX"
8942
8943	  cd second-dir
8944	  echo change-it >>fileX
8945
8946	  # Writes actually cause symlinks to be resolved.
8947	  dotest rcslib-long-symlink-3 "$testcvs -q ci -mwrite-it" \
8948"$CVSROOT_DIRNAME/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/file1,v  <--  fileX
8949new revision: 1\.5; previous revision: 1\.4"
8950
8951	  dokeep
8952	  cd ..
8953
8954	  # Must remove the symlink first.  Samba doesn't appear to show
8955	  # broken symlink across the SMB share, and rm -rf by itself
8956	  # will remove file1,v first and leave file2,v a broken link and the
8957	  # rm -rf will fail since it doesn't find file2,v and it still gets
8958	  # directory not empty errors removing cvsroot/first-dir.
8959	  #
8960	  # I'm not sure why I need to do this on $remotehost.  The rm above
8961	  # rcslib-symlink-3j works fine, but the next one doesn't unless run
8962	  # remotely under Cygwin and using a TESTDIR on a Samba share.
8963	  if test -n "$remotehost"; then
8964	    $CVS_RSH $remotehost \
8965"rm -f $CVSROOT_DIRNAME/first-dir/file2,v $CVSROOT_DIRNAME/second-dir/fileX,v"
8966	  fi
8967	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
8968			     $CVSROOT_DIRNAME/second-dir \
8969			     $CVSROOT_DIRNAME/123456789012345678901234567890
8970	  rm -r first-dir second-dir 2
8971	  ;;
8972
8973
8974
8975	multibranch)
8976	  # Test the ability to have several branchpoints coming off the
8977	  # same revision.
8978	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
8979	  dotest multibranch-1 "${testcvs} -q co first-dir" ''
8980	  cd first-dir
8981	  echo 1:trunk-1 >file1
8982	  dotest multibranch-2 "${testcvs} add file1" \
8983"${SPROG}"' add: scheduling file `file1'\'' for addition
8984'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
8985	  dotest_lit multibranch-3 "${testcvs} -q ci -m add-it" <<HERE
8986$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
8987initial revision: 1.1
8988HERE
8989	  dotest multibranch-4 "${testcvs} tag -b br1" \
8990"${SPROG} tag: Tagging \.
8991T file1"
8992	  dotest multibranch-5 "${testcvs} tag -b br2" \
8993"${SPROG} tag: Tagging \.
8994T file1"
8995	  dotest multibranch-6 "${testcvs} -q update -r br1" ''
8996	  echo on-br1 >file1
8997	  dotest multibranch-7 "${testcvs} -q ci -m modify-on-br1" \
8998"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
8999new revision: 1\.1\.2\.1; previous revision: 1\.1"
9000	  dotest multibranch-8 "${testcvs} -q update -r br2" '[UP] file1'
9001	  echo br2 adds a line >>file1
9002	  dotest multibranch-9 "${testcvs} -q ci -m modify-on-br2" \
9003"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
9004new revision: 1\.1\.4\.1; previous revision: 1\.1"
9005	  dotest multibranch-10 "${testcvs} -q update -r br1" '[UP] file1'
9006	  dotest multibranch-11 "cat file1" 'on-br1'
9007	  dotest multibranch-12 "${testcvs} -q update -r br2" '[UP] file1'
9008	  dotest multibranch-13 "cat file1" '1:trunk-1
9009br2 adds a line'
9010
9011	  dotest multibranch-14 "${testcvs} log file1" \
9012"
9013RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
9014Working file: file1
9015head: 1\.1
9016branch:
9017locks: strict
9018access list:
9019symbolic names:
9020	br2: 1\.1\.0\.4
9021	br1: 1\.1\.0\.2
9022keyword substitution: kv
9023total revisions: 3;	selected revisions: 3
9024description:
9025----------------------------
9026revision 1\.1
9027date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
9028branches:  1\.1\.2;  1\.1\.4;
9029add-it
9030----------------------------
9031revision 1\.1\.4\.1
9032date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
9033modify-on-br2
9034----------------------------
9035revision 1\.1\.2\.1
9036date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
9037modify-on-br1
9038============================================================================="
9039
9040	  dokeep
9041	  cd ..
9042	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
9043	  rm -r first-dir
9044	  ;;
9045
9046
9047
9048	import) # test death after import
9049		# Tests of "cvs import":
9050		# basic2
9051		# rdiff  -- imports with keywords
9052		# import  -- more tests of imports with keywords
9053		# importb  -- -b option.
9054		# importc -- bunch o' files in bunch o' directories
9055		# importX  -- -X option.
9056		# importX2 -- CVSROOT/config ImportNewFilesToVendorBranchOnly
9057		#             flag
9058		# modules3
9059		# mflag -- various -m messages
9060		# ignore  -- import and cvsignore
9061		# binwrap -- import and -k wrappers
9062		# info -- imports which are rejected by verifymsg
9063		# head -- intended to test vendor branches and HEAD,
9064		#   although it doesn't really do it yet.
9065		# import-CVS -- refuse to import directories named "CVS".
9066		# import-quirks -- short tests of import quirks.
9067
9068		# import
9069		mkdir import-dir ; cd import-dir
9070
9071		for i in 1 2 3 4 ; do
9072		  echo imported file"$i" > imported-f"$i"
9073		done
9074
9075		# This directory should be on the default ignore list,
9076		# so it shouldn't get imported.
9077		mkdir RCS
9078		echo ignore.me >RCS/ignore.me
9079
9080		echo 'import should not expand $''Id$' >>imported-f2
9081		cp imported-f2 ../imported-f2-orig.tmp
9082
9083		dotest_sort import-96 \
9084"${testcvs} import -m first-import first-dir vendor-branch junk-1_0" \
9085"
9086
9087I first-dir/RCS
9088N first-dir/imported-f1
9089N first-dir/imported-f2
9090N first-dir/imported-f3
9091N first-dir/imported-f4
9092No conflicts created by this import"
9093
9094		dotest import-96.5 "cmp ../imported-f2-orig.tmp imported-f2" ''
9095
9096		cd ..
9097
9098		# co
9099		dotest import-97 "${testcvs} -q co first-dir" \
9100"U first-dir/imported-f1
9101U first-dir/imported-f2
9102U first-dir/imported-f3
9103U first-dir/imported-f4"
9104
9105		cd first-dir
9106
9107		for i in 1 2 3 4 ; do
9108		  dotest import-98-$i "test -f imported-f$i" ''
9109		done
9110		dotest_fail import-98.5 "test -d RCS" ''
9111
9112		# remove
9113		rm imported-f1
9114		dotest import-99 "${testcvs} rm imported-f1" \
9115"${SPROG}"' remove: scheduling `imported-f1'\'' for removal
9116'"${SPROG}"' remove: use .'"${SPROG}"' commit. to remove this file permanently'
9117
9118		# change
9119		echo local-change >> imported-f2
9120
9121		# commit
9122		dotest import-100 "${testcvs} ci -m local-changes" \
9123"${CPROG} commit: Examining .
9124${CVSROOT_DIRNAME}/first-dir/imported-f1,v  <--  imported-f1
9125new revision: delete; previous revision: 1\.1\.1\.1
9126${CVSROOT_DIRNAME}/first-dir/imported-f2,v  <--  imported-f2
9127new revision: 1\.2; previous revision: 1\.1"
9128
9129		# log
9130		dotest import-101 "${testcvs} log imported-f1" \
9131"
9132RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/imported-f1,v
9133Working file: imported-f1
9134head: 1\.2
9135branch:
9136locks: strict
9137access list:
9138symbolic names:
9139	junk-1_0: 1\.1\.1\.1
9140	vendor-branch: 1\.1\.1
9141keyword substitution: kv
9142total revisions: 3;	selected revisions: 3
9143description:
9144----------------------------
9145revision 1\.2
9146date: ${ISO8601DATE};  author: ${username};  state: dead;  lines: ${PLUS}0 -0;  commitid: ${commitid};
9147local-changes
9148----------------------------
9149revision 1\.1
9150date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
9151branches:  1\.1\.1;
9152Initial revision
9153----------------------------
9154revision 1\.1\.1\.1
9155date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}0 -0;  commitid: ${commitid};
9156first-import
9157============================================================================="
9158
9159		# update into the vendor branch.
9160		dotest import-102 "${testcvs} update -rvendor-branch" \
9161"${SPROG} update: Updating .
9162[UP] imported-f1
9163[UP] imported-f2"
9164
9165		# remove file4 on the vendor branch
9166		rm imported-f4
9167		dotest import-103 "${testcvs} rm imported-f4" \
9168"${SPROG}"' remove: scheduling `imported-f4'\'' for removal
9169'"${SPROG}"' remove: use .'"${SPROG}"' commit. to remove this file permanently'
9170
9171		# commit
9172		dotest import-104 \
9173"${testcvs} ci -m vendor-removed imported-f4" \
9174"${CVSROOT_DIRNAME}/first-dir/imported-f4,v  <--  imported-f4
9175new revision: delete; previous revision: 1\.1\.1\.1"
9176
9177		# update to main line
9178		dotest import-105 "${testcvs} -q update -A" \
9179"${SPROG} update: \`imported-f1' is no longer in the repository
9180[UP] imported-f2"
9181
9182		# second import - file4 deliberately unchanged
9183		cd ../import-dir
9184		for i in 1 2 3 ; do
9185		  echo rev 2 of file $i >> imported-f"$i"
9186		done
9187		cp imported-f2 ../imported-f2-orig.tmp
9188
9189		dotest_sort import-106 \
9190"${testcvs} import -m second-import first-dir vendor-branch junk-2_0" \
9191"
9192
9193
9194 ${CPROG} checkout -j<prev_rel_tag> -jjunk-2_0 first-dir
91952 conflicts created by this import.
9196C first-dir/imported-f1
9197C first-dir/imported-f2
9198I first-dir/RCS
9199U first-dir/imported-f3
9200U first-dir/imported-f4
9201Use the following command to help the merge:"
9202
9203		dotest import-106.5 "cmp ../imported-f2-orig.tmp imported-f2" \
9204''
9205
9206		cd ..
9207
9208		rm imported-f2-orig.tmp
9209
9210		# co
9211		dotest import-107 "${testcvs} co first-dir" \
9212"${SPROG} checkout: Updating first-dir
9213[UP] first-dir/imported-f3
9214[UP] first-dir/imported-f4"
9215
9216		cd first-dir
9217
9218		dotest_fail import-108 "test -f imported-f1" ''
9219
9220		for i in 2 3 ; do
9221		  dotest import-109-$i "test -f imported-f$i" ''
9222		done
9223
9224		# check vendor branch for file4
9225		dotest import-110 "${testcvs} -q update -rvendor-branch" \
9226"[UP] imported-f1
9227[UP] imported-f2"
9228
9229		dotest import-111 "test -f imported-f4" ''
9230
9231		# update to main line
9232		dotest import-112 "${testcvs} -q update -A" \
9233"${SPROG} update: \`imported-f1' is no longer in the repository
9234[UP] imported-f2"
9235
9236		cd ..
9237
9238		dotest import-113 \
9239"${testcvs} -q co -jjunk-1_0 -jjunk-2_0 first-dir" \
9240"${SPROG} checkout: file first-dir/imported-f1 does not exist, but is present in revision junk-2_0
9241RCS file: ${CVSROOT_DIRNAME}/first-dir/imported-f2,v
9242retrieving revision 1\.1\.1\.1
9243retrieving revision 1\.1\.1\.2
9244Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into imported-f2
9245rcsmerge: warning: conflicts during merge
9246first-dir/imported-f3 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.2
9247first-dir/imported-f4 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.3"
9248
9249		cd first-dir
9250
9251		dotest_fail import-114 "test -f imported-f1" ''
9252
9253		for i in 2 3 ; do
9254		  dotest import-115-$i "test -f imported-f$i" ''
9255		done
9256
9257		dotest import-116 'cat imported-f2' \
9258'imported file2
9259[<]<<<<<< imported-f2
9260import should not expand \$''Id: imported-f2,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
9261local-change
9262[=]======
9263import should not expand \$''Id: imported-f2,v 1\.1\.1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
9264rev 2 of file 2
9265[>]>>>>>> 1\.1\.1\.2'
9266
9267		dokeep
9268		cd ..
9269		rm -r first-dir
9270		modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
9271		rm -r import-dir
9272		;;
9273
9274
9275
9276	importb)
9277	  # More cvs import tests, especially -b option.
9278
9279	  # OK, first we get some sources from the NetMunger project, and
9280	  # import them into the 1.1.1 vendor branch.
9281	  mkdir imp-dir
9282	  cd imp-dir
9283	  echo 'OpenMunger sources' >file1
9284	  echo 'OpenMunger sources' >file2
9285	  dotest_sort importb-1 \
9286"${testcvs} import -m add first-dir openmunger openmunger-1_0" \
9287"
9288
9289N first-dir/file1
9290N first-dir/file2
9291No conflicts created by this import"
9292	  cd ..
9293	  rm -r imp-dir
9294
9295	  # Now we put the sources we get from FreeMunger into 1.1.3
9296	  mkdir imp-dir
9297	  cd imp-dir
9298	  echo 'FreeMunger sources' >file1
9299	  echo 'FreeMunger sources' >file2
9300	  # Not completely sure how the conflict detection is supposed to
9301	  # be working here (haven't really thought about it).
9302	  # We use an explicit -d option to test that it is reflected
9303	  # in the suggested checkout.
9304	  dotest_sort importb-2 \
9305"$testcvs -d '$CVSROOT' import -m add -b 1.1.3 \
9306          first-dir freemunger freemunger-1_0" \
9307"
9308
9309
9310 ${CPROG} -d ${CVSROOT} checkout -j<prev_rel_tag> -jfreemunger-1_0 first-dir
93112 conflicts created by this import.
9312C first-dir/file1
9313C first-dir/file2
9314Use the following command to help the merge:"
9315	  cd ..
9316	  rm -r imp-dir
9317
9318	  # Now a test of main branch import (into second-dir, not first-dir).
9319	  mkdir imp-dir
9320	  cd imp-dir
9321	  echo 'my own stuff' >mine1.c
9322	  echo 'my own stuff' >mine2.c
9323	  dotest_fail importb-3 \
9324"${testcvs} import -m add -b 1 second-dir dummy really_dumb_y" \
9325"$CPROG \[import aborted\]: Only numeric branch specifications with two dots are
9326supported by import, not \`1'\.  For example: \`1\.1\.1'\."
9327	  : when we implement main-branch import, should be \
9328"N second-dir/mine1\.c
9329N second-dir/mine2\.c
9330
9331No conflicts created by this import"
9332	  cd ..
9333	  rm -r imp-dir
9334
9335	  mkdir 1
9336	  cd 1
9337	  # when we implement main branch import, will want to
9338	  # add "second-dir" here.
9339	  dotest importb-4 "${testcvs} -q co first-dir" \
9340"U first-dir/file1
9341U first-dir/file2"
9342	  cd first-dir
9343	  dotest importb-5 "${testcvs} -q log file1" "
9344RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
9345Working file: file1
9346head: 1\.1
9347branch: 1\.1\.1
9348locks: strict
9349access list:
9350symbolic names:
9351	freemunger-1_0: 1\.1\.3\.1
9352	freemunger: 1\.1\.3
9353	openmunger-1_0: 1\.1\.1\.1
9354	openmunger: 1\.1\.1
9355keyword substitution: kv
9356total revisions: 3;	selected revisions: 3
9357description:
9358----------------------------
9359revision 1\.1
9360date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
9361branches:  1\.1\.1;  1\.1\.3;
9362Initial revision
9363----------------------------
9364revision 1\.1\.3\.1
9365date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
9366add
9367----------------------------
9368revision 1\.1\.1\.1
9369date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}0 -0;  commitid: ${commitid};
9370add
9371============================================================================="
9372
9373	  dokeep
9374	  cd ../..
9375	  rm -r 1
9376	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
9377			     $CVSROOT_DIRNAME/second-dir
9378	  ;;
9379
9380
9381
9382	importc)
9383	  # Test importing a bunch o' files in a bunch o' directories.
9384	  # Also the -d option.
9385
9386	  # Set a predictable time zone for these tests.
9387	  save_TZ=$TZ
9388	  TZ=UTC0; export TZ
9389
9390	  mkdir 1; cd 1
9391	  mkdir adir bdir cdir
9392	  mkdir adir/sub1 adir/sub2
9393	  mkdir adir/sub1/ssdir
9394	  mkdir bdir/subdir
9395	  touch adir/sub1/file1 adir/sub2/file2 adir/sub1/ssdir/ssfile
9396	  touch -t ${TOUCH1971} bdir/subdir/file1
9397	  touch -t ${TOUCH2034} cdir/cfile
9398	  dotest_sort importc-1 \
9399"${testcvs} import -d -m import-it first-dir vendor release" \
9400"
9401
9402N first-dir/adir/sub1/file1
9403N first-dir/adir/sub1/ssdir/ssfile
9404N first-dir/adir/sub2/file2
9405N first-dir/bdir/subdir/file1
9406N first-dir/cdir/cfile
9407No conflicts created by this import
9408${SPROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir
9409${SPROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1
9410${SPROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1/ssdir
9411${SPROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub2
9412${SPROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/bdir
9413${SPROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/bdir/subdir
9414${SPROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/cdir"
9415	  cd ..
9416	  mkdir 2; cd 2
9417	  dotest importc-2 "${testcvs} -q co first-dir" \
9418"U first-dir/adir/sub1/file1
9419U first-dir/adir/sub1/ssdir/ssfile
9420U first-dir/adir/sub2/file2
9421U first-dir/bdir/subdir/file1
9422U first-dir/cdir/cfile"
9423	  cd first-dir
9424	  dotest importc-3 "${testcvs} update adir/sub1" \
9425"${SPROG} update: Updating adir/sub1
9426${SPROG} update: Updating adir/sub1/ssdir"
9427	  dotest importc-4 "${testcvs} update adir/sub1 bdir/subdir" \
9428"${SPROG} update: Updating adir/sub1
9429${SPROG} update: Updating adir/sub1/ssdir
9430${SPROG} update: Updating bdir/subdir"
9431
9432	  echo modify >>cdir/cfile
9433	  dotest importc-5 \
9434"${testcvs} -q rtag -b -r release wip_test first-dir" ""
9435	  dotest importc-6 "${testcvs} -q update -r wip_test" "M cdir/cfile"
9436
9437	  # This used to fail in local mode
9438	  dotest importc-7 "${testcvs} -q ci -m modify -r wip_test" \
9439"$CVSROOT_DIRNAME/first-dir/cdir/cfile,v  <--  cdir/cfile
9440new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1"
9441
9442	  # TODO: should also be testing "import -d" when we update
9443	  # an existing file.
9444	  dotest importc-8 "${testcvs} -q log cdir/cfile" "
9445RCS file: ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v
9446Working file: cdir/cfile
9447head: 1\.1
9448branch: 1\.1\.1
9449locks: strict
9450access list:
9451symbolic names:
9452	wip_test: 1\.1\.1\.1\.0\.2
9453	release: 1\.1\.1\.1
9454	vendor: 1\.1\.1
9455keyword substitution: kv
9456total revisions: 3;	selected revisions: 3
9457description:
9458----------------------------
9459revision 1\.1
9460date: ${ISO8601DATE2034};  author: ${username};  state: Exp;  commitid: ${commitid};
9461branches:  1\.1\.1;
9462Initial revision
9463----------------------------
9464revision 1\.1\.1\.1
9465date: ${ISO8601DATE2034};  author: ${username};  state: Exp;  lines: ${PLUS}0 -0;  commitid: ${commitid};
9466branches:  1\.1\.1\.1\.2;
9467import-it
9468----------------------------
9469revision 1\.1\.1\.1\.2\.1
9470date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
9471modify
9472============================================================================="
9473
9474	  dotest importc-9 "${testcvs} -q log bdir/subdir/file1" "
9475RCS file: ${CVSROOT_DIRNAME}/first-dir/bdir/subdir/file1,v
9476Working file: bdir/subdir/file1
9477head: 1\.1
9478branch: 1\.1\.1
9479locks: strict
9480access list:
9481symbolic names:
9482	wip_test: 1\.1\.1\.1\.0\.2
9483	release: 1\.1\.1\.1
9484	vendor: 1\.1\.1
9485keyword substitution: kv
9486total revisions: 2;	selected revisions: 2
9487description:
9488----------------------------
9489revision 1\.1
9490date: ${ISO8601DATE1971};  author: ${username};  state: Exp;  commitid: ${commitid};
9491branches:  1\.1\.1;
9492Initial revision
9493----------------------------
9494revision 1\.1\.1\.1
9495date: ${ISO8601DATE1971};  author: ${username};  state: Exp;  lines: ${PLUS}0 -0;  commitid: ${commitid};
9496import-it
9497============================================================================="
9498	  cd ..
9499
9500	  # Now tests of absolute pathnames and .. as repository directory.
9501	  cd ../1
9502	  dotest_fail importc-10 \
9503"${testcvs} import -m imp ../other vendor release2" \
9504"${CPROG} \[import aborted\]: directory \.\./other not relative within the repository"
9505	  dotest_fail importc-11 \
9506"${testcvs} import -m imp ${TESTDIR}/other vendor release3" \
9507"${CPROG} \[import aborted\]: directory ${TESTDIR}/other not relative within the repository"
9508	  dotest_fail importc-12 "test -d ${TESTDIR}/other" ""
9509
9510	  dokeep
9511	  TZ=$save_TZ
9512	  cd ..
9513	  rm -r 1 2
9514	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
9515	  ;;
9516
9517
9518
9519	importX)
9520	  # More cvs import tests, especially -X option.
9521
9522	  # OK, first we get some sources from the Munger version 0.9,
9523	  # and import them into the 1.1.1 vendor branch (w/o -X).  (This
9524	  # will be used to test subsequent imports of the same file
9525	  # with -X.)
9526	  mkdir imp-dir
9527	  cd imp-dir
9528	  echo 'Munger sources 0.9' >file0
9529	  dotest_sort importX-1 \
9530"${testcvs} import -m add first-dir munger munger-0_9" \
9531"
9532
9533N first-dir/file0
9534No conflicts created by this import"
9535	  cd ..
9536	  rm -r imp-dir
9537
9538	  # Now we put the sources we get from Munger version 1.0 on
9539	  # to the 1.1.1 vendor branch using -X.  (This imports a new
9540	  # version of file0, and imports all-new files file1 and file2.)
9541	  mkdir imp-dir
9542	  cd imp-dir
9543	  echo 'Munger sources' >file0
9544	  echo 'Munger sources' >file1
9545	  echo 'Munger sources' >file2
9546	  dotest_sort importX-2 \
9547"${testcvs} import -X -m add first-dir munger munger-1_0" \
9548"
9549
9550
9551 ${CPROG} checkout -j<prev_rel_tag> -jmunger-1_0 first-dir
9552N first-dir/file1
9553N first-dir/file2
9554No conflicts created by this import.
9555U first-dir/file0
9556Use the following command to help the merge:"
9557	  cd ..
9558	  rm -r imp-dir
9559
9560	  # Now we put the sources we get from Munger version 1.1 on
9561	  # to the 1.1.1 vendor branch using -X.  (This imports unchanged
9562	  # versions of file0 and file2, a changed version of file1, and
9563	  # an all-new file3.)
9564	  mkdir imp-dir
9565	  cd imp-dir
9566	  echo 'Munger sources' >file0
9567	  echo 'Munger sources 1.1' >file1
9568	  echo 'Munger sources' >file2
9569	  echo 'Munger sources 1.1' >file3
9570	  dotest_sort importX-3 \
9571"$testcvs -d '$CVSROOT' import -X -m add first-dir munger munger-1_1" \
9572"
9573
9574
9575 ${CPROG} -d ${CVSROOT} checkout -j<prev_rel_tag> -jmunger-1_1 first-dir
95761 conflicts created by this import.
9577C first-dir/file1
9578N first-dir/file3
9579U first-dir/file0
9580U first-dir/file2
9581Use the following command to help the merge:"
9582	  cd ..
9583	  rm -r imp-dir
9584
9585	  mkdir 1
9586	  cd 1
9587	  # only file0 should be checked out
9588	  dotest importX-4 "${testcvs} -q co first-dir" \
9589"U first-dir/file0"
9590	  cd first-dir
9591
9592	  dotest importX-5 "${testcvs} -q log file0" "
9593RCS file: ${CVSROOT_DIRNAME}/first-dir/file0,v
9594Working file: file0
9595head: 1\.1
9596branch: 1\.1\.1
9597locks: strict
9598access list:
9599symbolic names:
9600	munger-1_1: 1\.1\.1\.2
9601	munger-1_0: 1\.1\.1\.2
9602	munger-0_9: 1\.1\.1\.1
9603	munger: 1\.1\.1
9604keyword substitution: kv
9605total revisions: 3;	selected revisions: 3
9606description:
9607----------------------------
9608revision 1\.1
9609date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
9610branches:  1\.1\.1;
9611Initial revision
9612----------------------------
9613revision 1\.1\.1\.2
9614date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
9615add
9616----------------------------
9617revision 1\.1\.1\.1
9618date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}0 -0;  commitid: ${commitid};
9619add
9620============================================================================="
9621
9622	  dotest importX-6 "${testcvs} -q log file1" "
9623RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
9624Working file: file1
9625head: 1\.2
9626branch:
9627locks: strict
9628access list:
9629symbolic names:
9630	munger-1_1: 1\.1\.1\.2
9631	munger-1_0: 1\.1\.1\.1
9632	munger: 1\.1\.1
9633keyword substitution: kv
9634total revisions: 4;	selected revisions: 4
9635description:
9636----------------------------
9637revision 1\.2
9638date: ${ISO8601DATE};  author: ${username};  state: dead;  lines: ${PLUS}0 -0;  commitid: ${commitid};
9639Revision 1\.1 was added on the vendor branch\.
9640----------------------------
9641revision 1\.1
9642date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
9643branches:  1\.1\.1;
9644Initial revision
9645----------------------------
9646revision 1\.1\.1\.2
9647date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
9648add
9649----------------------------
9650revision 1\.1\.1\.1
9651date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}0 -0;  commitid: ${commitid};
9652add
9653============================================================================="
9654
9655	  cd ../..
9656	  rm -r 1
9657	  modify_repo rm -rf ${CVSROOT_DIRNAME}/first-dir
9658	  ;;
9659
9660
9661
9662	importX2)
9663	  # Test ImportNewFilesToVendorBranchOnly config file option.
9664
9665	  # On Windows, we can't check out CVSROOT, because the case
9666	  # insensitivity means that this conflicts with cvsroot.
9667	  mkdir wnt
9668	  cd wnt
9669
9670	  dotest importX2-1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
9671	  cd CVSROOT
9672          echo "ImportNewFilesToVendorBranchOnly=yes" >> config
9673
9674	  dotest importX2-2 "$testcvs -q ci -m force-cvs-import-X" \
9675"$TESTDIR/cvsroot/CVSROOT/config,v  <--  config
9676new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
9677$SPROG commit: Rebuilding administrative file database"
9678
9679	  cd ../..
9680
9681	  # Import a sources file, but do NOT specify -X.  The new file
9682	  # should be killed, anyway (because of the config option).
9683	  mkdir imp-dir
9684	  cd imp-dir
9685	  echo 'source' >file1
9686	  dotest_sort importX2-3 \
9687"${testcvs} import -m add first-dir source source-1_0" \
9688"
9689
9690
9691 ${CPROG} checkout -j<prev_rel_tag> -jsource-1_0 first-dir
9692N first-dir/file1
9693No conflicts created by this import.
9694Use the following command to help the merge:"
9695	  cd ..
9696	  rm -r imp-dir
9697
9698	  mkdir 1
9699	  cd 1
9700	  # **nothing** should be checked out**
9701	  dotest importX2-4 "${testcvs} -q co first-dir" ""
9702
9703	  cd first-dir
9704	  dotest importX2-5 "${testcvs} -q log file1" "
9705RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
9706Working file: file1
9707head: 1\.2
9708branch:
9709locks: strict
9710access list:
9711symbolic names:
9712	source-1_0: 1\.1\.1\.1
9713	source: 1\.1\.1
9714keyword substitution: kv
9715total revisions: 3;	selected revisions: 3
9716description:
9717----------------------------
9718revision 1\.2
9719date: ${ISO8601DATE};  author: ${username};  state: dead;  lines: ${PLUS}0 -0;  commitid: ${commitid};
9720Revision 1\.1 was added on the vendor branch\.
9721----------------------------
9722revision 1\.1
9723date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
9724branches:  1\.1\.1;
9725Initial revision
9726----------------------------
9727revision 1\.1\.1\.1
9728date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}0 -0;  commitid: ${commitid};
9729add
9730============================================================================="
9731
9732	  dokeep
9733	  cd ../..
9734	  restore_adm
9735	  rm -r 1
9736	  rm -r wnt
9737	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
9738	  ;;
9739
9740
9741
9742	import-CVS)
9743	  mkdir import-CVS
9744	  cd import-CVS
9745	  touch file1 file2 file3
9746	  dotest_fail import-CVS-1 "$testcvs import CVS vtag rtag" \
9747"$CPROG import: The word \`CVS' is reserved by CVS and may not be used
9748$CPROG \[import aborted\]: as a directory in a path or as a file name\."
9749	  mkdir sdir
9750	  mkdir sdir/CVS
9751	  touch sdir/CVS/file4 sdir/CVS/file5 sdir/file6 sdir/file7
9752	  # Calling the imported directory import-CVS is dual purpose in the
9753	  # following test.  It makes sure the path test which matched above
9754	  # wasn't too strict.
9755	  dotest_sort import-CVS-2 \
9756"$testcvs import -I! -mimport import-CVS vtag rtag" \
9757"
9758
9759I import-CVS/sdir/CVS
9760N import-CVS/file1
9761N import-CVS/file2
9762N import-CVS/file3
9763N import-CVS/sdir/file6
9764N import-CVS/sdir/file7
9765No conflicts created by this import
9766$SPROG import: Importing $CVSROOT_DIRNAME/import-CVS/sdir"
9767
9768	  dokeep
9769	  cd ..
9770	  rm -r import-CVS
9771	  modify_repo rm -rf $CVSROOT_DIRNAME/import-CVS
9772	  ;;
9773
9774
9775
9776	import-quirks)
9777	  # Short tests of quirky import behavior.
9778	  #
9779	  # For a list of other import tests with short descriptions, see the
9780	  # comment header of the "import" test.
9781	  mkdir import-quirks
9782	  cd import-quirks
9783	  touch file1 file2 file3
9784
9785	  # CVS prior to 1.11.18 and 1.12.10 used to happily import to
9786	  # "branch 1.1", creating RCS archives with revisions like,
9787	  # "1.1..1".  That double-dot is *not* a typo.
9788	  dotest_fail import-quirks-1 \
9789"$testcvs import -b1.1. -mbad-bad-bad import-quirks VB RT" \
9790"$CPROG \[import aborted\]: Only numeric branch specifications with two dots are
9791supported by import, not \`1\.1\.'\.  For example: \`1\.1\.1'\."
9792
9793	  dotest_fail import-quirks-2 \
9794"$testcvs import -b1.1.1.. -mbad-bad-bad import-quirks VB RT" \
9795"$CPROG \[import aborted\]: Only numeric branch specifications with two dots are
9796supported by import, not \`1\.1\.1\.\.'\.  For example: \`1\.1\.1'\."
9797
9798	  # Try a few odd numbers.  This is hardly comprehensive.
9799	  dotest_sort import-quirks-2 \
9800"$testcvs import -b10.10.101 -mthis-ones-ok import-quirks-2 VB RT" \
9801"
9802
9803N import-quirks-2/file1
9804N import-quirks-2/file2
9805N import-quirks-2/file3
9806No conflicts created by this import"
9807
9808	  dotest_sort import-quirks-3 \
9809"$testcvs import -b2345678901.2345678901.2345678901 -mthis-ones-ok import-quirks-3 VB RT" \
9810"
9811
9812N import-quirks-3/file1
9813N import-quirks-3/file2
9814N import-quirks-3/file3
9815No conflicts created by this import"
9816
9817	  dotest_sort import-quirks-4 \
9818"$testcvs import -b1.1.2 -mthis-ones-ok import-quirks-4 VB RT" \
9819"
9820
9821N import-quirks-4/file1
9822N import-quirks-4/file2
9823N import-quirks-4/file3
9824No conflicts created by this import"
9825
9826	  dokeep
9827	  cd ..
9828	  rm -r import-quirks
9829	  rm -rf $CVSROOT_DIRNAME/import-quirks-2 \
9830		 $CVSROOT_DIRNAME/import-quirks-3 \
9831		 $CVSROOT_DIRNAME/import-quirks-4
9832	  ;;
9833
9834
9835
9836	import-after-initial)
9837	  # Properly handle the case in which the first version of a
9838	  # file is created by a regular cvs add and commit, and there
9839	  # is a subsequent cvs import of the same file.  cvs update with
9840	  # a date tag must resort to searching the vendor branch only if
9841	  # the initial version of the file was created at the same time
9842	  # as the initial version on the vendor branch.
9843
9844	  mkdir 1; cd 1
9845	  module=x
9846
9847	  echo > unused-file
9848
9849	  # Create the module.
9850	  dotest import-after-initial-1 \
9851	    "$testcvs -Q import -m. $module X Y" ''
9852
9853	  file=m
9854	  # Check it out and add a file.
9855	  dotest import-after-initial-2 "$testcvs -Q co $module" ''
9856	  cd $module
9857	  echo original > $file
9858	  dotest import-after-initial-3 "${testcvs} -Q add $file" ""
9859	  dotest import-after-initial-4 "$testcvs -Q ci -m. $file"
9860
9861	  # Delay a little so the following import isn't done in the same
9862	  # second as the preceding commit.
9863	  sleep 2
9864
9865	  # Do the first import of $file *after* $file already has an
9866	  # initial version.
9867	  mkdir sub
9868	  cd sub
9869	  echo newer-via-import > $file
9870	  dotest import-after-initial-5 \
9871	    "$testcvs -Q import -m. $module X Y2" ''
9872	  cd ..
9873
9874	  # Sleep a second so we're sure to be after the second of the import.
9875	  sleep 1
9876
9877	  dotest import-after-initial-6 \
9878	    "$testcvs -Q update -p -D now $file" 'original'
9879
9880	  dokeep
9881	  cd ../..
9882	  rm -rf 1
9883	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
9884	  ;;
9885
9886
9887
9888        branch-after-import)
9889	  # Test branching after an import via both cvs tag -b and
9890	  # cvs add to verify that the HEAD remains at 1.1.1.1
9891	  # This was a FreeBSD bug documented at the URL:
9892	  # http://www.freebsd.org/cgi/query-pr.cgi?pr=4033
9893
9894	  mkdir branch-after-import
9895	  cd branch-after-import
9896
9897	  # OK, first we get some sources from the NetMunger project,
9898	  # and import them into the 1.1.1 vendor branch.
9899	  mkdir imp-dir
9900	  cd imp-dir
9901	  echo 'OpenMunger sources' >file1
9902	  echo 'OpenMunger sources' >file2
9903	  dotest_sort branch-after-import-1 \
9904"${testcvs} import -m add first-dir openmunger openmunger-1_0" \
9905'
9906
9907N first-dir/file1
9908N first-dir/file2
9909No conflicts created by this import'
9910	  cd ..
9911
9912	  # Next checkout the new module
9913	  dotest branch-after-import-2 \
9914"${testcvs} -q co first-dir" \
9915'U first-dir/file1
9916U first-dir/file2'
9917	  cd first-dir
9918	  # Branch tag the file1 and cvs add file2,
9919	  # the branch should remain the same in both cases
9920	  # such that a new import will not require a conflict
9921	  # resolution.
9922	  dotest branch-after-import-3 \
9923"${testcvs} tag -b TESTTOTRON file1" \
9924'T file1'
9925	  dotest branch-after-import-4 \
9926"${testcvs} -q update -r TESTTOTRON" \
9927"${SPROG} update: \`file2' is no longer in the repository"
9928
9929	  cp ../imp-dir/file2 .
9930	  dotest branch-after-import-5 \
9931"${testcvs} add file2" \
9932"${SPROG} add: scheduling file .file2. for addition on branch .TESTTOTRON.
9933${SPROG} add: use .${SPROG} commit. to add this file permanently"
9934
9935	  dotest branch-after-import-6 \
9936"$testcvs commit -m cvs-add file2" \
9937"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
9938new revision: 1\.1\.1\.1\.2\.2; previous revision: 1\.1\.1\.1\.2\.1"
9939
9940	  dokeep
9941	  cd ../..
9942	  rm -r branch-after-import
9943	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
9944	  ;;
9945
9946
9947
9948	join)
9949	  # Test doing joins which involve adding and removing files.
9950	  #   Variety of scenarios (see list below), in the context of:
9951	  #     * merge changes from T1 to T2 into the main line
9952	  #     * merge changes from branch 'branch' into the main line
9953	  #     * merge changes from branch 'branch' into branch 'br2'.
9954	  # See also binfile2, which does similar things with binary files.
9955	  # See also join2, which tests joining (and update -A) on only
9956	  # a single file, rather than a directory.
9957	  # See also rmadd2, which tests -j cases not involving branches
9958	  #   (e.g. undoing a commit)
9959	  # See also join3, which tests some cases involving the greatest
9960	  # common ancestor.  Here is a list of tests according to branch
9961	  # topology:
9962	  #
9963	  # --->bp---->trunk          too many to mention
9964	  #     \----->branch
9965	  #
9966	  #     /----->branch1
9967	  # --->bp---->trunk          multibranch, multibranch2
9968	  #     \----->branch2
9969	  #
9970	  # --->bp1----->bp2---->trunk   join3
9971	  #     \->br1   \->br2
9972	  #
9973	  # --->bp1----->trunk
9974	  #     \----bp2---->branch                branches
9975	  #          \------>branch-of-branch
9976
9977	  # We check merging changes from T1 to T2 into the main line.
9978	  # Here are the interesting cases I can think of:
9979	  #   1) File added between T1 and T2, not on main line.
9980	  #      File should be marked for addition.
9981	  #   2) File added between T1 and T2, also added on main line.
9982	  #      Conflict.
9983	  #   3) File removed between T1 and T2, unchanged on main line.
9984	  #      File should be marked for removal.
9985	  #   4) File removed between T1 and T2, modified on main line.
9986	  #      If mod checked in, file should be marked for removal.
9987	  #	 If mod still in working directory, conflict.
9988	  #   5) File removed between T1 and T2, was never on main line.
9989	  #      Nothing should happen.
9990	  #   6) File removed between T1 and T2, also removed on main line.
9991	  #      Nothing should happen.
9992	  #   7) File not added between T1 and T2, added on main line.
9993	  #      Nothing should happen.
9994	  #   8) File not modified between T1 and T2, removed on main line.
9995	  #      Nothing should happen.
9996	  #   9) File modified between T1 and T2, removed on main line.
9997	  #      Conflict.
9998	  #  10) File was never on branch, removed on main line.
9999	  #      Nothing should happen.
10000
10001	  # We also check merging changes from a branch into the main
10002	  # line.  Here are the interesting cases:
10003	  #   1) File added on branch, not on main line.
10004	  #      File should be marked for addition.
10005	  #   2) File added on branch, also added on main line.
10006	  #      Conflict.
10007	  #   3) File removed on branch, unchanged on main line.
10008	  #      File should be marked for removal.
10009	  #   4) File removed on branch, modified on main line.
10010	  #      Conflict.
10011	  #   5) File removed on branch, was never on main line.
10012	  #      Nothing should happen.
10013	  #   6) File removed on branch, also removed on main line.
10014	  #      Nothing should happen.
10015	  #   7) File added on main line, not added on branch.
10016	  #      Nothing should happen.
10017	  #   8) File removed on main line, not modified on branch.
10018	  #      Nothing should happen.
10019	  #   9) File modified on branch, removed on main line.
10020	  #      Conflict.
10021	  #  10) File was never on branch, removed on main line.
10022	  #      Nothing should happen.
10023
10024	  # In the tests below, fileN represents case N in the above
10025	  # lists.
10026
10027	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
10028	  mkdir 1
10029	  cd 1
10030	  dotest join-1 "$testcvs -q co first-dir"
10031
10032	  cd first-dir
10033
10034	  # Add two files.
10035	  echo 'first revision of file3' > file3
10036	  echo 'first revision of file4' > file4
10037	  echo 'first revision of file6' > file6
10038	  echo 'first revision of file8' > file8
10039	  echo 'first revision of file9' > file9
10040	  dotest join-2 "${testcvs} add file3 file4 file6 file8 file9" \
10041"${SPROG}"' add: scheduling file `file3'\'' for addition
10042'"${SPROG}"' add: scheduling file `file4'\'' for addition
10043'"${SPROG}"' add: scheduling file `file6'\'' for addition
10044'"${SPROG}"' add: scheduling file `file8'\'' for addition
10045'"${SPROG}"' add: scheduling file `file9'\'' for addition
10046'"${SPROG}"' add: use .'"${SPROG}"' commit. to add these files permanently'
10047
10048	  dotest join-3 "${testcvs} -q commit -m add" \
10049"$CVSROOT_DIRNAME/first-dir/file3,v  <--  file3
10050initial revision: 1\.1
10051$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
10052initial revision: 1\.1
10053$CVSROOT_DIRNAME/first-dir/file6,v  <--  file6
10054initial revision: 1\.1
10055$CVSROOT_DIRNAME/first-dir/file8,v  <--  file8
10056initial revision: 1\.1
10057$CVSROOT_DIRNAME/first-dir/file9,v  <--  file9
10058initial revision: 1\.1"
10059
10060	  # Make a branch.
10061	  dotest join-4 "${testcvs} -q tag -b branch ." \
10062'T file3
10063T file4
10064T file6
10065T file8
10066T file9'
10067
10068	  # Add file2, file7, and file10, modify file4, and remove
10069	  # file6, file8, and file9.
10070	  echo 'first revision of file2' > file2
10071	  echo 'second revision of file4' > file4
10072	  echo 'first revision of file7' > file7
10073	  rm file6 file8 file9
10074	  echo 'first revision of file10' > file10
10075	  dotest join-5 "${testcvs} add file2 file7 file10" \
10076"${SPROG}"' add: scheduling file `file2'\'' for addition
10077'"${SPROG}"' add: scheduling file `file7'\'' for addition
10078'"${SPROG}"' add: scheduling file `file10'\'' for addition
10079'"${SPROG}"' add: use .'"${SPROG}"' commit. to add these files permanently'
10080	  dotest join-6 "${testcvs} rm file6 file8 file9" \
10081"${SPROG}"' remove: scheduling `file6'\'' for removal
10082'"${SPROG}"' remove: scheduling `file8'\'' for removal
10083'"${SPROG}"' remove: scheduling `file9'\'' for removal
10084'"${SPROG}"' remove: use .'"${SPROG}"' commit. to remove these files permanently'
10085	  dotest join-7 "${testcvs} -q ci -mx ." \
10086"$CVSROOT_DIRNAME/first-dir/file10,v  <--  file10
10087initial revision: 1\.1
10088$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
10089initial revision: 1\.1
10090$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
10091new revision: 1\.2; previous revision: 1\.1
10092$CVSROOT_DIRNAME/first-dir/file6,v  <--  file6
10093new revision: delete; previous revision: 1\.1
10094$CVSROOT_DIRNAME/first-dir/file7,v  <--  file7
10095initial revision: 1\.1
10096$CVSROOT_DIRNAME/first-dir/file8,v  <--  file8
10097new revision: delete; previous revision: 1\.1
10098$CVSROOT_DIRNAME/first-dir/file9,v  <--  file9
10099new revision: delete; previous revision: 1\.1"
10100
10101	  # Remove file10
10102	  dotest join-7a "${testcvs} rm -f file10" \
10103"${SPROG}"' remove: scheduling `file10'\'' for removal
10104'"${SPROG}"' remove: use .'"${SPROG}"' commit. to remove this file permanently'
10105	  dotest join-7b "${testcvs} -q ci -mx ." \
10106"$CVSROOT_DIRNAME/first-dir/file10,v  <--  file10
10107new revision: delete; previous revision: 1\.1"
10108
10109	  # Check out the branch.
10110	  cd ../..
10111	  mkdir 2
10112	  cd 2
10113	  dotest join-8 "${testcvs} -q co -r branch first-dir" \
10114'U first-dir/file3
10115U first-dir/file4
10116U first-dir/file6
10117U first-dir/file8
10118U first-dir/file9'
10119
10120	  cd first-dir
10121
10122	  # Modify the files on the branch, so that T1 is not an
10123	  # ancestor of the main line, and add file5
10124	  echo 'first branch revision of file3' > file3
10125	  echo 'first branch revision of file4' > file4
10126	  echo 'first branch revision of file5' > file5
10127	  echo 'first branch revision of file6' > file6
10128	  echo 'first branch revision of file9' > file9
10129	  dotest join-9 "${testcvs} add file5" \
10130"${SPROG}"' add: scheduling file `file5'\'' for addition on branch `branch'\''
10131'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
10132	  dotest join-10 "${testcvs} -q ci -mx ." \
10133"$CVSROOT_DIRNAME/first-dir/file3,v  <--  file3
10134new revision: 1\.1\.2\.1; previous revision: 1\.1
10135$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
10136new revision: 1\.1\.2\.1; previous revision: 1\.1
10137$CVSROOT_DIRNAME/first-dir/Attic/file5,v  <--  file5
10138new revision: 1\.1\.2\.1; previous revision: 1\.1
10139$CVSROOT_DIRNAME/first-dir/Attic/file6,v  <--  file6
10140new revision: 1\.1\.2\.1; previous revision: 1\.1
10141$CVSROOT_DIRNAME/first-dir/Attic/file9,v  <--  file9
10142new revision: 1\.1\.2\.1; previous revision: 1\.1"
10143
10144	  # Tag the current revisions on the branch.
10145	  dotest join-11 "${testcvs} -q tag T1 ." \
10146'T file3
10147T file4
10148T file5
10149T file6
10150T file8
10151T file9'
10152
10153	  # Add file1 and file2, modify file9, and remove the other files.
10154	  echo 'first branch revision of file1' > file1
10155	  echo 'first branch revision of file2' > file2
10156	  echo 'second branch revision of file9' > file9
10157	  rm file3 file4 file5 file6
10158	  dotest join-12 "${testcvs} add file1 file2" \
10159"${SPROG}"' add: scheduling file `file1'\'' for addition on branch `branch'\''
10160'"${SPROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
10161'"${SPROG}"' add: use .'"${SPROG}"' commit. to add these files permanently'
10162	  dotest join-13 "${testcvs} rm file3 file4 file5 file6" \
10163"${SPROG}"' remove: scheduling `file3'\'' for removal
10164'"${SPROG}"' remove: scheduling `file4'\'' for removal
10165'"${SPROG}"' remove: scheduling `file5'\'' for removal
10166'"${SPROG}"' remove: scheduling `file6'\'' for removal
10167'"${SPROG}"' remove: use .'"${SPROG}"' commit. to remove these files permanently'
10168	  dotest join-14 "${testcvs} -q ci -mx ." \
10169"$CVSROOT_DIRNAME/first-dir/Attic/file1,v  <--  file1
10170new revision: 1\.1\.2\.1; previous revision: 1\.1
10171$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
10172new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
10173$CVSROOT_DIRNAME/first-dir/file3,v  <--  file3
10174new revision: delete; previous revision: 1\.1\.2\.1
10175$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
10176new revision: delete; previous revision: 1\.1\.2\.1
10177$CVSROOT_DIRNAME/first-dir/Attic/file5,v  <--  file5
10178new revision: delete; previous revision: 1\.1\.2\.1
10179$CVSROOT_DIRNAME/first-dir/Attic/file6,v  <--  file6
10180new revision: delete; previous revision: 1\.1\.2\.1
10181$CVSROOT_DIRNAME/first-dir/Attic/file9,v  <--  file9
10182new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1"
10183
10184	  # Tag the current revisions on the branch.
10185	  dotest join-15 "${testcvs} -q tag T2 ." \
10186'T file1
10187T file2
10188T file8
10189T file9'
10190
10191	  # Do a checkout with a merge.
10192	  cd ../..
10193	  mkdir 3
10194	  cd 3
10195	  dotest join-16 "${testcvs} -q co -jT1 -jT2 first-dir" \
10196"U first-dir/file1
10197U first-dir/file2
10198${SPROG} checkout: file first-dir/file2 exists, but has been added in revision T2
10199U first-dir/file3
10200${SPROG} checkout: scheduling \`first-dir/file3' for removal
10201U first-dir/file4
10202${SPROG} checkout: scheduling \`first-dir/file4' for removal
10203U first-dir/file7
10204${SPROG} checkout: file first-dir/file9 does not exist, but is present in revision T2"
10205
10206	  # Verify that the right changes have been scheduled.
10207	  cd first-dir
10208	  dotest join-17 "${testcvs} -q update" \
10209'A file1
10210R file3
10211R file4'
10212
10213	  # Modify file4 locally, and do an update with a merge.
10214	  cd ../../1/first-dir
10215	  echo 'third revision of file4' > file4
10216	  dotest join-18 "${testcvs} -q update -jT1 -jT2 ." \
10217"U file1
10218$SPROG update: file file2 exists, but has been added in revision T2
10219$SPROG update: scheduling \`file3' for removal
10220M file4
10221$SPROG update: file file4 is locally modified, but has been removed in revision T2
10222$SPROG update: file file9 does not exist, but is present in revision T2"
10223
10224	  # Verify that the right changes have been scheduled.
10225	  dotest join-19 "${testcvs} -q update" \
10226'A file1
10227R file3
10228M file4'
10229
10230	  # Do a checkout with a merge from a single revision.
10231
10232	  # FIXME: CVS currently gets this wrong.  file2 has been
10233	  # added on both the branch and the main line, and so should
10234	  # be regarded as a conflict.  However, given the way that
10235	  # CVS sets up the RCS file, there is no way to distinguish
10236	  # this case from the case of file2 having existed before the
10237	  # branch was made.  This could be fixed by reserving
10238	  # a revision somewhere, perhaps 1.1, as an always dead
10239	  # revision which can be used as the source for files added
10240	  # on branches.
10241	  cd ../../3
10242	  rm -r first-dir
10243	  dotest join-20 "${testcvs} -q co -jbranch first-dir" \
10244"U first-dir/file1
10245U first-dir/file2
10246RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
10247retrieving revision 1\.1
10248retrieving revision 1\.1\.2\.2
10249Merging differences between 1\.1 and 1\.1\.2\.2 into file2
10250U first-dir/file3
10251${SPROG} checkout: scheduling \`first-dir/file3' for removal
10252U first-dir/file4
10253${SPROG} checkout: file first-dir/file4 has been modified, but has been removed in revision branch
10254U first-dir/file7
10255${SPROG} checkout: file first-dir/file9 does not exist, but is present in revision branch"
10256
10257	  # Verify that the right changes have been scheduled.
10258	  # The M file2 line is a bug; see above join-20.
10259	  cd first-dir
10260	  dotest join-21 "${testcvs} -q update" \
10261'A file1
10262M file2
10263R file3'
10264
10265	  # Checkout the main line again.
10266	  cd ../../1
10267	  rm -r first-dir
10268	  dotest join-22 "${testcvs} -q co first-dir" \
10269'U first-dir/file2
10270U first-dir/file3
10271U first-dir/file4
10272U first-dir/file7'
10273
10274	  # Modify file4 locally, and do an update with a merge from a
10275	  # single revision.
10276	  # The file2 handling is a bug; see above join-20.
10277	  cd first-dir
10278	  echo 'third revision of file4' > file4
10279	  dotest join-23 "${testcvs} -q update -jbranch ." \
10280"U file1
10281RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
10282retrieving revision 1\.1
10283retrieving revision 1\.1\.2\.2
10284Merging differences between 1\.1 and 1\.1\.2\.2 into file2
10285${SPROG} update: scheduling \`file3' for removal
10286M file4
10287${SPROG} update: file file4 is locally modified, but has been removed in revision branch
10288${SPROG} update: file file9 does not exist, but is present in revision branch"
10289
10290	  # Verify that the right changes have been scheduled.
10291	  # The M file2 line is a bug; see above join-20
10292	  dotest join-24 "${testcvs} -q update" \
10293'A file1
10294M file2
10295R file3
10296M file4'
10297
10298	  cd ..
10299
10300	  # Checkout the main line again and make a new branch which we
10301	  # merge to.
10302	  rm -r first-dir
10303	  dotest join-25 "${testcvs} -q co first-dir" \
10304'U first-dir/file2
10305U first-dir/file3
10306U first-dir/file4
10307U first-dir/file7'
10308	  cd first-dir
10309	  dotest join-26 "${testcvs} -q tag -b br2" \
10310"T file2
10311T file3
10312T file4
10313T file7"
10314	  dotest join-27 "${testcvs} -q update -r br2" ""
10315	  # The handling of file8 and file9 here look fishy to me.  I don't
10316	  # see why it should be different from the case where we merge to
10317	  # the trunk (e.g. join-23).
10318	  dotest join-28 "${testcvs} -q update -j branch" \
10319"U file1
10320RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
10321retrieving revision 1.1
10322retrieving revision 1.1.2.2
10323Merging differences between 1.1 and 1.1.2.2 into file2
10324${SPROG} update: scheduling \`file3' for removal
10325${SPROG} update: file file4 has been modified, but has been removed in revision branch
10326U file8
10327U file9"
10328	  # Verify that the right changes have been scheduled.
10329	  dotest join-29 "${testcvs} -q update" \
10330"A file1
10331M file2
10332R file3
10333A file8
10334A file9"
10335
10336	  # Checkout the mainline again to try updating and merging between two
10337	  # branches in the same step
10338	  # this seems a likely scenario - the user finishes up on branch and
10339	  # updates to br2 and merges in the same step - and there was a bug
10340	  # once that if the file was removed in the update then it wouldn't be
10341	  # readded in the merge
10342	  cd ..
10343	  rm -r first-dir
10344	  dotest join-twobranch-1 "${testcvs} -q co -rbranch first-dir" \
10345'U first-dir/file1
10346U first-dir/file2
10347U first-dir/file8
10348U first-dir/file9'
10349	  cd first-dir
10350	  dotest join-twobranch-2 "${testcvs} -q update -rbr2 -jbranch" \
10351"${SPROG} update: \`file1' is no longer in the repository
10352U file1
10353U file2
10354RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
10355retrieving revision 1\.1
10356retrieving revision 1\.1\.2\.2
10357Merging differences between 1\.1 and 1\.1\.2\.2 into file2
10358U file3
10359${SPROG} update: scheduling \`file3' for removal
10360U file4
10361${SPROG} update: file file4 has been modified, but has been removed in revision branch
10362U file7
10363${SPROG} update: \`file8' is no longer in the repository
10364U file8
10365${SPROG} update: \`file9' is no longer in the repository
10366U file9"
10367	  # Verify that the right changes have been scheduled.
10368	  dotest join-twobranch-3 "${testcvs} -q update" \
10369"A file1
10370M file2
10371R file3
10372A file8
10373A file9"
10374
10375	  # Checkout the mainline again to try merging from the trunk
10376	  # to a branch.
10377	  cd ..
10378	  rm -r first-dir
10379	  dotest join-30 "${testcvs} -q co first-dir" \
10380'U first-dir/file2
10381U first-dir/file3
10382U first-dir/file4
10383U first-dir/file7'
10384	  cd first-dir
10385
10386	  # Tag the current revisions on the trunk.
10387	  dotest join-31 "${testcvs} -q tag T3 ." \
10388'T file2
10389T file3
10390T file4
10391T file7'
10392
10393	  # Modify file7.
10394	  echo 'second revision of file7' > file7
10395	  dotest join-32 "${testcvs} -q ci -mx ." \
10396"$CVSROOT_DIRNAME/first-dir/file7,v  <--  file7
10397new revision: 1\.2; previous revision: 1\.1"
10398
10399	  # And Tag again.
10400	  dotest join-33 "${testcvs} -q tag T4 ." \
10401'T file2
10402T file3
10403T file4
10404T file7'
10405
10406	  # Now update branch to T3.
10407	  cd ../../2/first-dir
10408	  dotest join-34 "${testcvs} -q up -jT3" \
10409"${SPROG} update: file file4 does not exist, but is present in revision T3
10410U file7"
10411
10412	  # Verify that the right changes have been scheduled.
10413	  dotest join-35 "${testcvs} -q update" \
10414'A file7'
10415
10416	  # Now update to T4.
10417	  # This is probably a bug, although in this particular case it just
10418	  # happens to do the right thing; see above join-20.
10419	  dotest join-36 "${testcvs} -q up -j T3 -j T4" \
10420"A file7
10421RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
10422retrieving revision 1\.1
10423retrieving revision 1\.2
10424Merging differences between 1\.1 and 1\.2 into file7"
10425
10426	  # Verify that the right changes have been scheduled.
10427	  dotest join-37 "${testcvs} -q update" \
10428'A file7'
10429
10430	  dokeep
10431	  cd ../..
10432	  rm -r 1 2 3
10433	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
10434	  ;;
10435
10436
10437
10438	join2)
10439	  # More joining tests.
10440
10441	  # First the usual setup; create a directory first-dir, a file
10442	  # first-dir/file1, and a branch br1.
10443	  mkdir 1; cd 1
10444	  dotest join2-1 "${testcvs} -q co -l ." ''
10445	  mkdir first-dir
10446	  dotest join2-2 "${testcvs} add first-dir" \
10447"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
10448          cd first-dir
10449	  echo 'initial contents of file1' >file1
10450	  dotest join2-3 "${testcvs} add file1" \
10451"${SPROG} add: scheduling file .file1. for addition
10452${SPROG} add: use .${SPROG} commit. to add this file permanently"
10453	  dotest join2-4 "${testcvs} -q ci -m add" \
10454"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
10455initial revision: 1\.1"
10456	  dotest join2-5 "${testcvs} -q tag -b br1" "T file1"
10457	  dotest join2-6 "${testcvs} -q update -r br1" ""
10458	  echo 'modify on branch' >>file1
10459	  touch bradd
10460	  dotest join2-6a "${testcvs} add bradd" \
10461"${SPROG} add: scheduling file .bradd. for addition on branch .br1.
10462${SPROG} add: use .${SPROG} commit. to add this file permanently"
10463	  dotest join2-7 "${testcvs} -q ci -m modify" \
10464"$CVSROOT_DIRNAME/first-dir/Attic/bradd,v  <--  bradd
10465new revision: 1\.1\.2\.1; previous revision: 1\.1
10466$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
10467new revision: 1\.1\.2\.1; previous revision: 1\.1"
10468
10469	  # Here is the unusual/pathological part.  We switch back to
10470	  # the trunk *for file1 only*, not for the whole directory.
10471	  dotest join2-8 "${testcvs} -q update -A file1" '[UP] file1'
10472	  dotest join2-9 "${testcvs} -q status file1" \
10473"===================================================================
10474File: file1            	Status: Up-to-date
10475
10476   Working revision:	1\.1.*
10477   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file1,v
10478   Commit Identifier:	${commitid}
10479   Sticky Tag:		(none)
10480   Sticky Date:		(none)
10481   Sticky Options:	(none)"
10482	  dotest join2-10 "cat CVS/Tag" "Tbr1"
10483
10484	  dotest join2-11 "${testcvs} -q update -j br1 file1" \
10485"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
10486retrieving revision 1\.1
10487retrieving revision 1\.1\.2\.1
10488Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
10489	  dotest join2-12 "cat file1" "initial contents of file1
10490modify on branch"
10491	  # We should have no sticky tag on file1
10492	  dotest join2-13 "${testcvs} -q status file1" \
10493"===================================================================
10494File: file1            	Status: Locally Modified
10495
10496   Working revision:	1\.1.*
10497   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file1,v
10498   Commit Identifier:	${commitid}
10499   Sticky Tag:		(none)
10500   Sticky Date:		(none)
10501   Sticky Options:	(none)"
10502	  dotest join2-14 "cat CVS/Tag" "Tbr1"
10503	  # And the checkin should go to the trunk
10504	  dotest join2-15 "${testcvs} -q ci -m modify file1" \
10505"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
10506new revision: 1\.2; previous revision: 1\.1"
10507
10508	  # OK, the above is all well and good and has worked for some
10509	  # time.  Now try the case where the file had been added on
10510	  # the branch.
10511	  dotest join2-16 "${testcvs} -q update -r br1" "[UP] file1"
10512	  # The workaround is to update the whole directory.
10513	  # The non-circumvented version won't work.  The reason is that
10514	  # update removes the entry from CVS/Entries, so of course we get
10515	  # the tag from CVS/Tag and not Entries.  I suppose maybe
10516	  # we could invent some new format in Entries which would handle
10517	  # this, but doing so, and handling it properly throughout
10518	  # CVS, would be a lot of work and I'm not sure this case justifies
10519	  # it.
10520	  dotest join2-17-circumvent "${testcvs} -q update -A" \
10521"${SPROG} update: \`bradd' is no longer in the repository
10522[UP] file1"
10523:	  dotest join2-17 "${testcvs} -q update -A bradd" \
10524"${SPROG} update: warning: \`bradd' is not (any longer) pertinent"
10525	  dotest join2-18 "${testcvs} -q update -j br1 bradd" "U bradd"
10526	  dotest join2-19 "${testcvs} -q status bradd" \
10527"===================================================================
10528File: bradd            	Status: Locally Added
10529
10530   Working revision:	New file!
10531   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
10532   Commit Identifier:	${commitid}
10533   Sticky Tag:		(none)
10534   Sticky Date:		(none)
10535   Sticky Options:	(none)"
10536	  dotest join2-20 "${testcvs} -q ci -m modify bradd" \
10537"$CVSROOT_DIRNAME/first-dir/bradd,v  <--  bradd
10538new revision: 1\.2; previous revision: 1\.1"
10539
10540	  dokeep
10541	  cd ../..
10542	  rm -r 1
10543	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
10544	  ;;
10545
10546
10547
10548	join3)
10549	  # See "join" for a list of other joining/branching tests.
10550	  # First the usual setup; create a directory first-dir, a file
10551	  # first-dir/file1, and a branch br1.
10552	  mkdir 1; cd 1
10553	  dotest join3-1 "${testcvs} -q co -l ." ''
10554	  mkdir first-dir
10555	  dotest join3-2 "${testcvs} add first-dir" \
10556"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
10557	  cd first-dir
10558	  echo 'initial contents of file1' >file1
10559	  dotest join3-3 "${testcvs} add file1" \
10560"${SPROG} add: scheduling file .file1. for addition
10561${SPROG} add: use .${SPROG} commit. to add this file permanently"
10562	  dotest join3-4 "${testcvs} -q ci -m add" \
10563"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
10564initial revision: 1\.1"
10565	  dotest join3-5 "${testcvs} -q tag -b br1" "T file1"
10566	  dotest join3-6 "${testcvs} -q update -r br1" ""
10567	  echo 'br1:line1' >>file1
10568	  dotest join3-7 "${testcvs} -q ci -m modify" \
10569"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
10570new revision: 1\.1\.2\.1; previous revision: 1\.1"
10571
10572	  # Now back to the trunk for:
10573	  # another revision and another branch for file1.
10574	  # add file2, which will exist on trunk and br2 but not br1.
10575	  dotest join3-8 "${testcvs} -q update -A" "[UP] file1"
10576	  echo 'trunk:line1' > file2
10577	  dotest join3-8a "${testcvs} add file2" \
10578"${SPROG} add: scheduling file .file2. for addition
10579${SPROG} add: use .${SPROG} commit. to add this file permanently"
10580	  echo 'trunk:line1' >>file1
10581	  dotest join3-9 "${testcvs} -q ci -m modify" \
10582"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
10583new revision: 1\.2; previous revision: 1\.1
10584$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
10585initial revision: 1\.1"
10586	  dotest join3-10 "${testcvs} -q tag -b br2" "T file1
10587T file2"
10588
10589	  # Before we actually have any revision on br2, let's try a join
10590	  dotest join3-11 "${testcvs} -q update -r br1" "[UP] file1
10591${SPROG} update: \`file2' is no longer in the repository"
10592	  dotest join3-12 "${testcvs} -q update -j br2" \
10593"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
10594retrieving revision 1\.1
10595retrieving revision 1\.2
10596Merging differences between 1\.1 and 1\.2 into file1
10597rcsmerge: warning: conflicts during merge
10598U file2"
10599	  dotest join3-13 "cat file1" \
10600"initial contents of file1
10601[<]<<<<<< file1
10602br1:line1
10603[=]======
10604trunk:line1
10605[>]>>>>>> 1\.2"
10606	  rm file1
10607
10608	  # OK, we'll try the same thing with a revision on br2.
10609	  dotest join3-14 "${testcvs} -q update -r br2 file1" \
10610"${SPROG} update: warning: \`file1' was lost
10611U file1" "U file1"
10612	  echo 'br2:line1' >>file1
10613	  dotest join3-15 "${testcvs} -q ci -m modify file1" \
10614"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
10615new revision: 1\.2\.2\.1; previous revision: 1\.2"
10616
10617	  # OK, now we can join br2 to br1
10618	  dotest join3-16 "${testcvs} -q update -r br1 file1" "[UP] file1"
10619	  # It may seem odd, to merge a higher branch into a lower
10620	  # branch, but in fact CVS defines the ancestor as 1.1
10621	  # and so it merges both the 1.1->1.2 and 1.2->1.2.2.1 changes.
10622	  # This seems like a reasonably plausible behavior.
10623	  dotest join3-17 "${testcvs} -q update -j br2 file1" \
10624"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
10625retrieving revision 1\.1
10626retrieving revision 1\.2\.2\.1
10627Merging differences between 1\.1 and 1\.2\.2\.1 into file1
10628rcsmerge: warning: conflicts during merge"
10629	  dotest join3-18 "cat file1" \
10630"initial contents of file1
10631[<]<<<<<< file1
10632br1:line1
10633[=]======
10634trunk:line1
10635br2:line1
10636[>]>>>>>> 1\.2\.2\.1"
10637
10638	  dokeep
10639	  cd ../..
10640	  rm -r 1
10641	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
10642	  ;;
10643
10644
10645
10646	join4)
10647	  # Like join, but with local (uncommitted) modifications.
10648
10649	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
10650	  mkdir 1
10651	  cd 1
10652	  dotest join4-1 "${testcvs} -q co first-dir" ''
10653
10654	  cd first-dir
10655
10656	  # Add two files.
10657	  echo 'first revision of file3' > file3
10658	  echo 'first revision of file4' > file4
10659	  echo 'first revision of file6' > file6
10660	  echo 'first revision of file8' > file8
10661	  echo 'first revision of file9' > file9
10662	  dotest join4-2 "${testcvs} add file3 file4 file6 file8 file9" \
10663"${SPROG}"' add: scheduling file `file3'\'' for addition
10664'"${SPROG}"' add: scheduling file `file4'\'' for addition
10665'"${SPROG}"' add: scheduling file `file6'\'' for addition
10666'"${SPROG}"' add: scheduling file `file8'\'' for addition
10667'"${SPROG}"' add: scheduling file `file9'\'' for addition
10668'"${SPROG}"' add: use .'"${SPROG}"' commit. to add these files permanently'
10669
10670	  dotest join4-3 "${testcvs} -q commit -m add" \
10671"$CVSROOT_DIRNAME/first-dir/file3,v  <--  file3
10672initial revision: 1\.1
10673$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
10674initial revision: 1\.1
10675$CVSROOT_DIRNAME/first-dir/file6,v  <--  file6
10676initial revision: 1\.1
10677$CVSROOT_DIRNAME/first-dir/file8,v  <--  file8
10678initial revision: 1\.1
10679$CVSROOT_DIRNAME/first-dir/file9,v  <--  file9
10680initial revision: 1\.1"
10681
10682	  # Make a branch.
10683	  dotest join4-4 "${testcvs} -q tag -b branch ." \
10684'T file3
10685T file4
10686T file6
10687T file8
10688T file9'
10689
10690	  # Add file10
10691	  echo 'first revision of file10' > file10
10692	  dotest join4-7a "${testcvs} add file10" \
10693"${SPROG}"' add: scheduling file `file10'\'' for addition
10694'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
10695	  dotest join4-7b "${testcvs} -q ci -mx ." \
10696"$CVSROOT_DIRNAME/first-dir/file10,v  <--  file10
10697initial revision: 1\.1"
10698
10699	  # Add file2 and file7, modify file4, and remove
10700	  # file6, file8, file9, and file10.
10701	  echo 'first revision of file2' > file2
10702	  echo 'second revision of file4' > file4
10703	  echo 'first revision of file7' > file7
10704	  rm file6 file8 file9 file10
10705	  dotest join4-5 "${testcvs} add file2 file7" \
10706"${SPROG}"' add: scheduling file `file2'\'' for addition
10707'"${SPROG}"' add: scheduling file `file7'\'' for addition
10708'"${SPROG}"' add: use .'"${SPROG}"' commit. to add these files permanently'
10709	  dotest join4-6 "${testcvs} rm file6 file8 file9 file10" \
10710"${SPROG}"' remove: scheduling `file6'\'' for removal
10711'"${SPROG}"' remove: scheduling `file8'\'' for removal
10712'"${SPROG}"' remove: scheduling `file9'\'' for removal
10713'"${SPROG}"' remove: scheduling `file10'\'' for removal
10714'"${SPROG}"' remove: use .'"${SPROG}"' commit. to remove these files permanently'
10715
10716	  # Check out the branch.
10717	  cd ../..
10718	  mkdir 2
10719	  cd 2
10720	  dotest join4-8 "${testcvs} -q co -r branch first-dir" \
10721'U first-dir/file3
10722U first-dir/file4
10723U first-dir/file6
10724U first-dir/file8
10725U first-dir/file9'
10726
10727	  cd first-dir
10728
10729	  # Modify the files on the branch, so that T1 is not an
10730	  # ancestor of the main line, and add file5
10731	  echo 'first branch revision of file3' > file3
10732	  echo 'first branch revision of file4' > file4
10733	  echo 'first branch revision of file5' > file5
10734	  echo 'first branch revision of file6' > file6
10735	  echo 'first branch revision of file9' > file9
10736	  dotest join4-9 "${testcvs} add file5" \
10737"${SPROG}"' add: scheduling file `file5'\'' for addition on branch `branch'\''
10738'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
10739	  dotest join4-10 "${testcvs} -q ci -mx ." \
10740"$CVSROOT_DIRNAME/first-dir/file3,v  <--  file3
10741new revision: 1\.1\.2\.1; previous revision: 1\.1
10742$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
10743new revision: 1\.1\.2\.1; previous revision: 1\.1
10744$CVSROOT_DIRNAME/first-dir/Attic/file5,v  <--  file5
10745new revision: 1\.1\.2\.1; previous revision: 1\.1
10746$CVSROOT_DIRNAME/first-dir/file6,v  <--  file6
10747new revision: 1\.1\.2\.1; previous revision: 1\.1
10748$CVSROOT_DIRNAME/first-dir/file9,v  <--  file9
10749new revision: 1\.1\.2\.1; previous revision: 1\.1"
10750
10751	  # Tag the current revisions on the branch.
10752	  dotest join4-11 "${testcvs} -q tag T1 ." \
10753'T file3
10754T file4
10755T file5
10756T file6
10757T file8
10758T file9'
10759
10760	  # Add file1 and file2, modify file9, and remove the other files.
10761	  echo 'first branch revision of file1' > file1
10762	  echo 'first branch revision of file2' > file2
10763	  echo 'second branch revision of file9' > file9
10764	  rm file3 file4 file5 file6
10765	  dotest join4-12 "${testcvs} add file1 file2" \
10766"${SPROG}"' add: scheduling file `file1'\'' for addition on branch `branch'\''
10767'"${SPROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
10768'"${SPROG}"' add: use .'"${SPROG}"' commit. to add these files permanently'
10769	  dotest join4-13 "${testcvs} rm file3 file4 file5 file6" \
10770"${SPROG}"' remove: scheduling `file3'\'' for removal
10771'"${SPROG}"' remove: scheduling `file4'\'' for removal
10772'"${SPROG}"' remove: scheduling `file5'\'' for removal
10773'"${SPROG}"' remove: scheduling `file6'\'' for removal
10774'"${SPROG}"' remove: use .'"${SPROG}"' commit. to remove these files permanently'
10775	  dotest join4-14 "${testcvs} -q ci -mx ." \
10776"$CVSROOT_DIRNAME/first-dir/Attic/file1,v  <--  file1
10777new revision: 1\.1\.2\.1; previous revision: 1\.1
10778$CVSROOT_DIRNAME/first-dir/Attic/file2,v  <--  file2
10779new revision: 1\.1\.2\.1; previous revision: 1\.1
10780$CVSROOT_DIRNAME/first-dir/file3,v  <--  file3
10781new revision: delete; previous revision: 1\.1\.2\.1
10782$CVSROOT_DIRNAME/first-dir/file4,v  <--  file4
10783new revision: delete; previous revision: 1\.1\.2\.1
10784$CVSROOT_DIRNAME/first-dir/Attic/file5,v  <--  file5
10785new revision: delete; previous revision: 1\.1\.2\.1
10786$CVSROOT_DIRNAME/first-dir/file6,v  <--  file6
10787new revision: delete; previous revision: 1\.1\.2\.1
10788$CVSROOT_DIRNAME/first-dir/file9,v  <--  file9
10789new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1"
10790
10791	  # Tag the current revisions on the branch.
10792	  dotest join4-15 "${testcvs} -q tag T2 ." \
10793'T file1
10794T file2
10795T file8
10796T file9'
10797
10798	  # Modify file4 locally, and do an update with a merge.
10799	  cd ../../1/first-dir
10800	  echo 'third revision of file4' > file4
10801	  dotest join4-18 "${testcvs} -q update -jT1 -jT2 ." \
10802"U file1
10803R file10
10804A file2
10805${SPROG} update: file file2 exists, but has been added in revision T2
10806${SPROG} update: scheduling \`file3' for removal
10807M file4
10808${SPROG} update: file file4 is locally modified, but has been removed in revision T2
10809R file6
10810A file7
10811R file8
10812R file9
10813${SPROG} update: file file9 does not exist, but is present in revision T2"
10814
10815	  # Verify that the right changes have been scheduled.
10816	  dotest join4-19 "${testcvs} -q update" \
10817'A file1
10818R file10
10819A file2
10820R file3
10821M file4
10822R file6
10823A file7
10824R file8
10825R file9'
10826
10827	  dokeep
10828	  cd ../..
10829	  rm -r 1 2
10830	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
10831	  ;;
10832
10833
10834
10835	join5)
10836	  # This test verifies that CVS can handle filenames starting with a
10837	  # dash (`-') properly.  What used to happen was that CVS handled it
10838	  # just fine, until it went to pass them as arguments to the diff
10839	  # library, at which point it neglected to pass `--' before the file
10840	  # list, causing the diff library to attempt to interpret the file
10841	  # name as an argument.
10842	  mkdir join5; cd join5
10843	  mkdir 1; cd 1
10844	  dotest join5-init-1 "${testcvs} -Q co -l ."
10845	  mkdir join5
10846	  dotest join5-init-2 "${testcvs} -Q add join5"
10847	  cd join5
10848	  echo "there once was a file from harrisburg" >-file
10849	  echo "who's existance it seems was quiteabsurd" >>-file
10850	  dotest join5-init-3 "${testcvs} -Q add -- -file"
10851	  dotest join5-init-4 "${testcvs} -q ci -minitial" \
10852"$CVSROOT_DIRNAME/join5/-file,v  <--  -file
10853initial revision: 1\.1"
10854	  cd ../..
10855
10856	  mkdir 2; cd 2
10857	  dotest join5-init-5 "${testcvs} -Q co join5"
10858	  cd join5
10859	  echo "it tested for free" >>-file
10860	  echo "when paid it should be" >>-file
10861	  dotest join5-init-4 "${testcvs} -q ci -msecond" \
10862"$CVSROOT_DIRNAME/join5/-file,v  <--  -file
10863new revision: 1\.2; previous revision: 1\.1"
10864	  cd ../..
10865
10866	  cd 1/join5
10867	  echo "but maybe it could charge bytheword" >>-file
10868	  # This is the test that used to spew complaints from diff3:
10869	  dotest join5 "${testcvs} up" \
10870"${SPROG} update: Updating \.
10871RCS file: ${CVSROOT_DIRNAME}/join5/-file,v
10872retrieving revision 1\.1
10873retrieving revision 1\.2
10874Merging differences between 1\.1 and 1\.2 into -file
10875rcsmerge: warning: conflicts during merge
10876${SPROG} update: conflicts found in -file
10877C -file"
10878
10879	  dokeep
10880	  cd ../../..
10881	  rm -r join5
10882	  modify_repo rm -rf $CVSROOT_DIRNAME/join5
10883	  ;;
10884
10885
10886
10887        join6)
10888	  mkdir join6; cd join6
10889          mkdir 1; cd 1
10890	  dotest join6-init-1 "${testcvs} -Q co -l ."
10891	  mkdir join6
10892	  dotest join6-init-2 "${testcvs} -Q add join6"
10893	  cd join6
10894          echo aaa >temp.txt
10895	  echo bbb >>temp.txt
10896	  echo ccc >>temp.txt
10897	  dotest join6-1 "${testcvs} -Q add temp.txt"
10898	  dotest join6-2 "${testcvs} -q commit -minitial temp.txt" \
10899"$CVSROOT_DIRNAME/join6/temp\.txt,v  <--  temp\.txt
10900initial revision: 1\.1"
10901	  cp temp.txt temp2.txt
10902	  echo ddd >>temp.txt
10903	  dotest join6-3 "${testcvs} -q commit -madd temp.txt" \
10904"$CVSROOT_DIRNAME/join6/temp.txt,v  <--  temp\.txt
10905new revision: 1\.2; previous revision: 1\.1"
10906
10907	  # The case where the merge target is up-to-date and its base revision
10908	  # matches the second argument to -j: CVS doesn't bother attempting
10909	  # the merge since it already knows that the target contains the
10910	  # change.
10911	  dotest join6-3.3 "${testcvs} update -j1.1 -j1.2 temp.txt" \
10912"temp\.txt already contains the differences between 1\.1 and 1\.2"
10913	  dotest join6-3.4 "${testcvs} diff temp.txt" ""
10914
10915	  # The case where the merge target is modified but already contains
10916	  # the change.
10917	  echo bbb >temp.txt
10918	  echo ccc >>temp.txt
10919	  echo ddd >>temp.txt
10920	  dotest join6-3.5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
10921"M temp\.txt
10922RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10923retrieving revision 1\.1
10924retrieving revision 1\.2
10925Merging differences between 1\.1 and 1\.2 into temp\.txt
10926temp\.txt already contains the differences between 1\.1 and 1\.2"
10927	  dotest_fail join6-3.6 "${testcvs} diff temp.txt" \
10928"Index: temp\.txt
10929===================================================================
10930RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10931retrieving revision 1\.2
10932diff -r1\.2 temp.txt
109331d0
10934< aaa"
10935
10936	  cp temp2.txt temp.txt
10937	  dotest_fail join6-4 "${testcvs} diff temp.txt" \
10938"Index: temp.txt
10939===================================================================
10940RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10941retrieving revision 1\.2
10942diff -r1\.2 temp\.txt
109434d3
10944< ddd"
10945
10946	  dotest join6-5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
10947"M temp\.txt
10948RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10949retrieving revision 1\.1
10950retrieving revision 1\.2
10951Merging differences between 1\.1 and 1\.2 into temp\.txt"
10952	  dotest join6-6 "${testcvs} diff temp.txt" ""
10953	  mv temp.txt temp3.txt
10954	  dotest join6-7 "sed 's/ddd/dddd/' < temp3.txt > temp.txt" ""
10955	  dotest join6-8 "${testcvs} update -j1.1 -j1.2 temp.txt" \
10956"M temp\.txt
10957RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10958retrieving revision 1\.1
10959retrieving revision 1\.2
10960Merging differences between 1\.1 and 1\.2 into temp\.txt
10961rcsmerge: warning: conflicts during merge"
10962	  dotest_fail join6-9 "${testcvs} diff temp.txt" \
10963"Index: temp\.txt
10964===================================================================
10965RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
10966retrieving revision 1\.2
10967diff -r1\.2 temp\.txt
109683a4,6
10969> <<<<<<< temp\.txt
10970> dddd
10971> =======
109724a8
10973> >>>>>>> 1\.2"
10974	  cp temp2.txt temp.txt
10975	  dotest join6-10 "${testcvs} -q ci -m del temp.txt" \
10976"$CVSROOT_DIRNAME/join6/temp.txt,v  <--  temp\.txt
10977new revision: 1\.3; previous revision: 1\.2"
10978          cp temp3.txt temp.txt
10979	  dotest_fail join6-11 "${testcvs} diff temp.txt" \
10980"Index: temp\.txt
10981===================================================================
10982RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
10983retrieving revision 1\.3
10984diff -r1\.3 temp\.txt
109853a4
10986> ddd"
10987	  dotest join6-12 "${testcvs} update -j1.2 -j1.3 temp.txt" \
10988"M temp\.txt
10989RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
10990retrieving revision 1\.2
10991retrieving revision 1\.3
10992Merging differences between 1\.2 and 1\.3 into temp\.txt"
10993	  dotest join6-13 "${testcvs} diff temp.txt" ""
10994
10995	  # The case where the merge target wasn't created until after the
10996	  # first tag was applied
10997	  rm temp2.txt temp3.txt
10998	  dotest join6-20 "${testcvs} -q tag -r1.1 t1" \
10999"T temp.txt"
11000	  echo xxx >temp2.txt
11001	  dotest join6-21 "${testcvs} -Q add temp2.txt"
11002	  dotest join6-22 "${testcvs} -q ci -m." \
11003"$CVSROOT_DIRNAME/join6/temp2\.txt,v  <--  temp2\.txt
11004initial revision: 1\.1"
11005	  dotest join6-23 "${testcvs} -q tag t2" \
11006"T temp.txt
11007T temp2.txt"
11008	  echo xxx >>temp.txt
11009	  dotest join6-24 "${testcvs} -q ci -m." \
11010"$CVSROOT_DIRNAME/join6/temp.txt,v  <--  temp\.txt
11011new revision: 1\.4; previous revision: 1\.3"
11012	  dotest join6-25 "${testcvs} -q up -jt1 -jt2" \
11013"RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
11014retrieving revision 1\.1
11015retrieving revision 1\.3
11016Merging differences between 1\.1 and 1\.3 into temp.txt
11017temp.txt already contains the differences between 1\.1 and 1\.3
11018temp2.txt already contains the differences between creation and 1\.1"
11019
11020	  # Now for my next trick: delete the file, recreate it, and
11021	  # try to merge
11022	  dotest join6-30 "${testcvs} -q rm -f temp2.txt" \
11023"${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
11024	  dotest join6-31 "${testcvs} -q ci -m. temp2.txt" \
11025"$CVSROOT_DIRNAME/join6/temp2\.txt,v  <--  temp2\.txt
11026new revision: delete; previous revision: 1\.1"
11027	  echo new >temp2.txt
11028	  # FIXCVS: Local and remote really shouldn't be different and there
11029	  # really shouldn't be two different status lines for temp2.txt
11030	  if $remote; then
11031	    dotest_fail join6-32 "${testcvs} -q up -jt1 -jt2" \
11032"? temp2\.txt
11033RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
11034retrieving revision 1\.1
11035retrieving revision 1\.3
11036Merging differences between 1\.1 and 1\.3 into temp.txt
11037temp.txt already contains the differences between 1\.1 and 1\.3
11038$CPROG update: move away .\./temp2\.txt.; it is in the way
11039C temp2\.txt"
11040	  else
11041	    dotest join6-32 "${testcvs} -q up -jt1 -jt2" \
11042"RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
11043retrieving revision 1\.1
11044retrieving revision 1\.3
11045Merging differences between 1\.1 and 1\.3 into temp.txt
11046temp.txt already contains the differences between 1\.1 and 1\.3
11047${SPROG} update: use .${SPROG} add. to create an entry for .temp2\.txt.
11048U temp2\.txt
11049? temp2\.txt"
11050	  fi
11051
11052	  dokeep
11053	  cd ../../..
11054	  rm -r join6
11055	  modify_repo rm -rf $CVSROOT_DIRNAME/join6
11056	  ;;
11057
11058
11059
11060	join7)
11061	  # This test deals with joins that happen with the -n switch
11062	  mkdir join7; cd join7
11063	  mkdir impdir; cd impdir
11064          echo aaa >temp.txt
11065	  echo bbb >>temp.txt
11066	  echo ccc >>temp.txt
11067	  dotest join7-1 \
11068"${testcvs} -Q import -minitial join7 vendor vers-1" \
11069""
11070	  cd ..
11071	  dotest join7-2 "${testcvs} -Q co join7" ""
11072	  cd join7
11073	  echo ddd >> temp.txt
11074	  dotest join7-3 "${testcvs} -Q ci -madded-line temp.txt" ""
11075	  cd ../impdir
11076	  echo aaaa >temp.txt
11077	  echo bbbb >>temp.txt
11078	  echo ccc >>temp.txt
11079	  echo eee >>temp.txt
11080	  dotest join7-4 \
11081"${testcvs} -Q import -minitial join7 vendor vers-2" \
11082""
11083	  cd ../join7
11084	  dotest join7-5 \
11085"${testcvs} -n update -jvers-1 -jvers-2 temp.txt" \
11086"RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
11087retrieving revision 1\.1\.1\.1
11088retrieving revision 1\.1\.1\.2
11089Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
11090rcsmerge: warning: conflicts during merge"
11091	  touch temp.txt
11092	  dotest join7-6 "${testcvs} -n update -jvers-1 -jvers-2 temp.txt" \
11093"RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
11094retrieving revision 1\.1\.1\.1
11095retrieving revision 1\.1\.1\.2
11096Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
11097rcsmerge: warning: conflicts during merge" \
11098"RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
11099retrieving revision 1\.1\.1\.1
11100retrieving revision 1\.1\.1\.2
11101Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
11102rcsmerge: warning: conflicts during merge"
11103
11104	  dokeep
11105	  cd ../..
11106	  rm -r join7
11107	  modify_repo rm -rf $CVSROOT_DIRNAME/join7
11108	  ;;
11109
11110
11111
11112	join-readonly-conflict)
11113	  # Previously, only tests 1 & 11 were being tested.  I added the
11114	  # intermediate dotest's to try and diagnose a different failure
11115	  #
11116	  # Demonstrate that cvs-1.9.29 can fail on 2nd and subsequent
11117	  # conflict-evoking join attempts.
11118	  # Even with that version of CVS, This test failed only in
11119	  # client-server mode, and would have been noticed in normal
11120	  # operation only for files that were read-only (either due to
11121	  # use of cvs' global -r option, setting the CVSREAD envvar,
11122	  # or use of watch lists).
11123	  mkdir join-readonly-conflict; cd join-readonly-conflict
11124	  dotest join-readonly-conflict-1 "$testcvs -q co -l ." ''
11125	  module=join-readonly-conflict
11126	  mkdir $module
11127	  $testcvs -q add $module >>$LOGFILE 2>&1
11128	  cd $module
11129
11130	  file=m
11131	  echo trunk > $file
11132	  dotest join-readonly-conflict-2 "$testcvs -Q add $file" ''
11133
11134	  dotest join-readonly-conflict-3 "$testcvs -q ci -m . $file" \
11135"$CVSROOT_DIRNAME/$module/$file,v  <--  $file
11136initial revision: 1\.1"
11137
11138	  dotest join-readonly-conflict-4 "$testcvs tag -b B $file" "T $file"
11139	  dotest join-readonly-conflict-5 "$testcvs -q update -rB $file" ''
11140	  echo branch B > $file
11141	  dotest join-readonly-conflict-6 "$testcvs -q ci -m . $file" \
11142"$CVSROOT_DIRNAME/$module/$file,v  <--  $file
11143new revision: 1\.1\.2\.1; previous revision: 1\.1"
11144
11145	  rm $file
11146	  dotest join-readonly-conflict-7 "$testcvs -Q update -A $file" ''
11147	  # Make sure $file is read-only.  This can happen more realistically
11148	  # via patch -- which could be used to apply a delta, yet would
11149	  # preserve a file's read-only permissions.
11150	  echo conflict > $file; chmod u-w $file
11151	  dotest join-readonly-conflict-8 "$testcvs update -r B $file" \
11152"RCS file: $CVSROOT_DIRNAME/$module/$file,v
11153retrieving revision 1\.1
11154retrieving revision 1\.1\.2\.1
11155Merging differences between 1\.1 and 1\.1\.2\.1 into $file
11156rcsmerge: warning: conflicts during merge
11157${SPROG} update: conflicts found in $file
11158C $file"
11159
11160	  # restore to the trunk
11161	  rm -f $file
11162	  dotest join-readonly-conflict-9 "$testcvs -Q update -A $file" ''
11163
11164	  # This one would fail because cvs couldn't open the existing
11165	  # (and read-only) .# file for writing.
11166	  echo conflict > $file
11167
11168	  # verify that the backup file is not writable
11169	  if test -w ".#$file.1.1"; then
11170	    fail "join-readonly-conflict-10 : .#$file.1.1 is writable"
11171	  else
11172	    pass "join-readonly-conflict-10"
11173	  fi
11174	  dotest join-readonly-conflict-11 "$testcvs update -r B $file" \
11175"RCS file: $CVSROOT_DIRNAME/$module/$file,v
11176retrieving revision 1\.1
11177retrieving revision 1\.1\.2\.1
11178Merging differences between 1\.1 and 1\.1\.2\.1 into $file
11179rcsmerge: warning: conflicts during merge
11180${SPROG} update: conflicts found in $file
11181C m"
11182
11183	  dokeep
11184	  cd ../..
11185	  rm -r join-readonly-conflict
11186	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
11187	  ;;
11188
11189
11190
11191	join-admin)
11192	  mkdir 1; cd 1
11193	  dotest join-admin-0-1 "$testcvs -q co -l ."
11194	  module=x
11195	  mkdir $module
11196	  dotest join-admin-0-2 "$testcvs -q add $module" \
11197"Directory $CVSROOT_DIRNAME/$module added to the repository"
11198	  cd $module
11199
11200	  # Create a file so applying the first tag works.
11201	  echo foo > a
11202	  dotest join-admin-0-3 "$testcvs -Q add a" ''
11203	  dotest join-admin-0-4 "$testcvs -Q ci -m. a" ''
11204
11205	  dotest join-admin-0-5 "$testcvs -Q tag -b B" ''
11206	  dotest join-admin-0-6 "$testcvs -Q tag -b M1" ''
11207	  echo '$''Id$' > b
11208	  dotest join-admin-0-7 "$testcvs -Q add b" ''
11209	  dotest join-admin-0-8 "$testcvs -Q ci -m. b" ''
11210	  dotest join-admin-0-9 "$testcvs -Q tag -b M2" ''
11211
11212	  dotest join-admin-0-10 "$testcvs -Q update -r B" ''
11213	  dotest join-admin-0-11 "$testcvs -Q update -kk -jM1 -jM2" ''
11214	  dotest join-admin-0-12 "$testcvs -Q ci -m. b" ''
11215
11216	  dotest join-admin-0-13 "$testcvs -Q update -A" ''
11217
11218	  # Verify that the -kk flag from the update did not
11219	  # propagate to the repository.
11220	  dotest join-admin-1 "$testcvs status b" \
11221"===================================================================
11222File: b                	Status: Up-to-date
11223
11224   Working revision:	1\.1.*
11225   Repository revision:	1\.1	${CVSROOT_DIRNAME}/x/b,v
11226   Commit Identifier:	${commitid}
11227   Sticky Tag:		(none)
11228   Sticky Date:		(none)
11229   Sticky Options:	(none)"
11230
11231	  dokeep
11232	  cd ../..
11233	  rm -rf 1
11234	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
11235	  ;;
11236
11237
11238
11239	join-admin-2)
11240	  # Show that when a merge (via update -kk -jtag1 -jtag2) first
11241	  # removes a file, then modifies another containing an $Id...$ line,
11242	  # the resulting file contains the unexpanded `$Id.$' string, as
11243	  # -kk requires.
11244	  mkdir 1; cd 1
11245	  dotest join-admin-2-1 "$testcvs -q co -l ." ''
11246	  module=x
11247	  mkdir $module
11248	  dotest join-admin-2-2 "$testcvs -q add $module" \
11249"Directory ${CVSROOT_DIRNAME}/x added to the repository"
11250	  cd $module
11251
11252	  # Create a file so applying the first tag works.
11253	  echo '$''Id$' > e0
11254	  cp e0 e
11255	  dotest join-admin-2-3 "$testcvs -Q add e"
11256	  dotest join-admin-2-4 "$testcvs -Q ci -m. e"
11257
11258	  dotest join-admin-2-5 "$testcvs -Q tag -b T" '' "${QUESTION} e0"
11259	  dotest join-admin-2-6 "$testcvs -Q update -r T" '' "${QUESTION} e0"
11260	  cp e0 e
11261	  dotest join-admin-2-7 "$testcvs -Q ci -m. e"
11262
11263	  dotest join-admin-2-8 "$testcvs -Q update -A" '' "${QUESTION} e0"
11264	  dotest join-admin-2-9 "$testcvs -Q tag -b M1" '' "${QUESTION} e0"
11265
11266	  echo '$''Id$' > b
11267	  dotest join-admin-2-10 "$testcvs -Q add b" ''
11268	  cp e0 e
11269	  dotest join-admin-2-11 "$testcvs -Q ci -m. b e"
11270
11271	  dotest join-admin-2-12 "$testcvs -Q tag -b M2" '' "${QUESTION} e0"
11272
11273	  dotest join-admin-2-13 "$testcvs -Q update -r T" '' "${QUESTION} e0"
11274	  dotest join-admin-2-14 "$testcvs update -kk -jM1 -jM2" \
11275"${SPROG} update: Updating .
11276U b
11277U e
11278RCS file: ${CVSROOT_DIRNAME}/x/e,v
11279retrieving revision 1\.1
11280retrieving revision 1\.2
11281Merging differences between 1\.1 and 1\.2 into e
11282e already contains the differences between 1\.1 and 1\.2
11283${QUESTION} e0" \
11284"${QUESTION} e0
11285${SPROG} update: Updating .
11286U b
11287U e
11288RCS file: ${CVSROOT_DIRNAME}/x/e,v
11289retrieving revision 1\.1
11290retrieving revision 1\.2
11291Merging differences between 1\.1 and 1\.2 into e
11292e already contains the differences between 1\.1 and 1\.2"
11293
11294	  # Verify that the $Id.$ string is not expanded.
11295	  dotest join-admin-2-15 "cat e" '$''Id$'
11296
11297	  dokeep
11298	  cd ../..
11299	  rm -rf 1
11300	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
11301	  ;;
11302
11303
11304
11305	join-rm)
11306	  # This first half of this test checks that a single-argument merge
11307	  # from a branch is capable of removing files.
11308	  #
11309	  # The second half verifies that an update to another location with an
11310	  # uncommitted removal will transfer the destination branch of the
11311	  # removal.
11312
11313	  module=join-rm
11314	  mkdir $module; cd $module
11315
11316	  dotest join-rm-init-1 "$testcvs -q co -l ." ''
11317	  mkdir $module
11318	  dotest join-rm-init-2 "$testcvs -q add $module" \
11319"Directory $CVSROOT_DIRNAME/$module added to the repository"
11320	  cd $module
11321
11322	  # add some files.
11323	  touch a b c d e f g
11324	  dotest join-rm-init-3 "$testcvs -Q add a b c d e f g"
11325	  dotest join-rm-init-4 "$testcvs -Q ci -m add-em"
11326
11327	  # create the branch and update to it
11328	  dotest join-rm-init-5 "$testcvs -Q tag -b br"
11329	  dotest join-rm-init-6 "$testcvs -Q up -rbr"
11330
11331	  # remove a few files from the branch
11332	  dotest join-rm-init-7 "$testcvs -Q rm -f b d g"
11333	  dotest join-rm-init-8 "$testcvs -Q ci -mrm"
11334
11335	  # update to the trunk
11336	  dotest join-rm-init-9 "$testcvs -Q up -A"
11337
11338	  # now for the test - try and merge the removals.
11339	  dotest join-rm-1 "$testcvs -q up -jbr" \
11340"$SPROG update: scheduling \`b' for removal
11341$SPROG update: scheduling \`d' for removal
11342$SPROG update: scheduling \`g' for removal"
11343
11344	  # And make sure the merge took
11345	  dotest join-rm-2 "$testcvs -qn up" \
11346"R b
11347R d
11348R g"
11349
11350	  dotest join-rm-3 "$testcvs -q ci -m 'save the merge'" \
11351"$CVSROOT_DIRNAME/join-rm/b,v  <--  b
11352new revision: delete; previous revision: 1\.1
11353$CVSROOT_DIRNAME/join-rm/d,v  <--  d
11354new revision: delete; previous revision: 1\.1
11355$CVSROOT_DIRNAME/join-rm/g,v  <--  g
11356new revision: delete; previous revision: 1\.1"
11357
11358	  # and verify that it was the head revision which was removed.
11359	  dotest join-rm-4 "$testcvs -q log b"  "
11360RCS file: $CVSROOT_DIRNAME/join-rm/Attic/b,v
11361Working file: b
11362head: 1\.2
11363branch:
11364locks: strict
11365access list:
11366symbolic names:
11367	br: 1\.1\.0\.2
11368keyword substitution: kv
11369total revisions: 3;	selected revisions: 3
11370description:
11371----------------------------
11372revision 1\.2
11373date: ${ISO8601DATE};  author: $username;  state: dead;  lines: ${PLUS}0 -0;  commitid: ${commitid};
11374save the merge
11375----------------------------
11376revision 1\.1
11377date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
11378branches:  1.1.2;
11379add-em
11380----------------------------
11381revision 1\.1\.2\.1
11382date: ${ISO8601DATE};  author: $username;  state: dead;  lines: ${PLUS}0 -0;  commitid: ${commitid};
11383rm
11384============================================================================="
11385
11386	  # go back to the branch to set up for the second set of tests
11387	  dotest join-rm-init-10 "$testcvs -Q up -rbr"
11388	  dotest join-rm-init-11 "$testcvs -Q rm -f a"
11389	  dotest join-rm-init-12 "$testcvs -Q ci -m rma"
11390
11391	  # now the test: update to the trunk
11392	  #
11393	  # FIXCVS: This update should merge the removal to the trunk.  It does
11394	  # not.
11395	  dotest join-rm-5 "$testcvs -q up -A" "U a"
11396
11397	  # and verify that there is no sticky tag
11398	  dotest join-rm-6 "$testcvs status a" \
11399"===================================================================
11400File: a                	Status: Up-to-date
11401
11402   Working revision:	1\.1.*
11403   Repository revision:	1\.1	$CVSROOT_DIRNAME/join-rm/a,v
11404   Commit Identifier:	${commitid}
11405   Sticky Tag:		(none)
11406   Sticky Date:		(none)
11407   Sticky Options:	(none)"
11408
11409	  dokeep
11410	  cd ../..
11411	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
11412	  rm -r $module
11413	  ;;
11414
11415
11416
11417	new) # look for stray "no longer pertinent" messages.
11418	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
11419	  dotest new-init-1 "$testcvs -Q co first-dir"
11420
11421	  cd first-dir
11422	  touch a
11423
11424	  dotest new-1 "$testcvs -Q add a"
11425
11426	  dotest new-2 "$testcvs -Q ci -m added"
11427	  rm a
11428
11429	  dotest new-3 "$testcvs -Q rm a"
11430	  dotest new-4 "$testcvs -Q ci -m removed"
11431	  dotest new-5 "$testcvs -Q update -A"
11432	  dotest new-6 "$testcvs -Q update -rHEAD"
11433
11434	  dokeep
11435	  cd ..
11436	  rm -r first-dir
11437	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
11438	  ;;
11439
11440
11441
11442	newb)
11443	  # Test removing a file on a branch and then checking it out.
11444
11445	  # We call this "newb" only because it, like the "new" tests,
11446	  # has something to do with "no longer pertinent" messages.
11447	  # Not necessarily the most brilliant nomenclature.
11448
11449	  # Create file 'a'.
11450	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
11451	  dotest newb-123a "${testcvs} -q co first-dir" ''
11452	  cd first-dir
11453	  touch a
11454	  dotest newb-123b "${testcvs} add a" \
11455"${SPROG} add: scheduling file .a. for addition
11456${SPROG} add: use .${SPROG} commit. to add this file permanently"
11457	  dotest newb-123c "${testcvs} -q ci -m added" \
11458"$CVSROOT_DIRNAME/first-dir/a,v  <--  a
11459initial revision: 1\.1"
11460
11461	  # Make a branch.
11462	  dotest newb-123d "${testcvs} -q tag -b branch" "T a"
11463
11464	  # Check out the branch.
11465	  cd ..
11466	  rm -r first-dir
11467	  mkdir 1
11468	  cd 1
11469	  dotest newb-123e "${testcvs} -q co -r branch first-dir" \
11470"U first-dir/a"
11471
11472	  # Remove 'a' on another copy of the branch.
11473	  cd ..
11474	  mkdir 2
11475	  cd 2
11476	  dotest newb-123f "${testcvs} -q co -r branch first-dir" \
11477"U first-dir/a"
11478	  cd first-dir
11479	  rm a
11480	  dotest newb-123g "${testcvs} rm a" \
11481"${SPROG} remove: scheduling .a. for removal
11482${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
11483	  dotest newb-123h "${testcvs} -q ci -m removed" \
11484"$CVSROOT_DIRNAME/first-dir/a,v  <--  a
11485new revision: delete; previous revision: 1\.1"
11486
11487	  # Check out the file on the branch.  This should report
11488	  # that the file is not pertinent, but it should not
11489	  # say anything else.
11490	  cd ..
11491	  rm -r first-dir
11492	  dotest newb-123i "${testcvs} -q co -r branch first-dir/a" \
11493"${SPROG} checkout: warning: \`first-dir/a' is not (any longer) pertinent"
11494
11495	  # Update the other copy, and make sure that a is removed.
11496	  cd ../1/first-dir
11497	  # "Entry Invalid" is a rather strange output here.  Something like
11498	  # "Removed in Repository" would make more sense.
11499	  dotest newb-123j0 "${testcvs} status a" \
11500"${SPROG} status: \`a' is no longer in the repository
11501===================================================================
11502File: a                	Status: Entry Invalid
11503
11504   Working revision:	1\.1.*
11505   Repository revision:	1\.1\.2\.1	${CVSROOT_DIRNAME}/first-dir/a,v
11506   Commit Identifier:	${commitid}
11507   Sticky Tag:		branch (branch: 1\.1\.2)
11508   Sticky Date:		(none)
11509   Sticky Options:	(none)${DOTSTAR}"
11510	  dotest newb-123j "${testcvs} -q update" \
11511"${SPROG} update: \`a' is no longer in the repository"
11512
11513	  if test -f a; then
11514	    fail newb-123k
11515	  else
11516	    pass newb-123k
11517	  fi
11518
11519	  dokeep
11520	  cd ../..
11521	  rm -r 1 2
11522	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
11523	  ;;
11524
11525
11526
11527	conflicts)
11528		modify_repo mkdir $CVSROOT_DIRNAME/first-dir
11529
11530		mkdir 1
11531		cd 1
11532
11533		dotest conflicts-124 "${testcvs} -q co first-dir" ''
11534
11535		cd first-dir
11536		touch a
11537
11538		dotest conflicts-125 "${testcvs} add a" \
11539"${SPROG} add: scheduling file .a. for addition
11540${SPROG} add: use .${SPROG} commit. to add this file permanently"
11541		dotest conflicts-126 "${testcvs} -q ci -m added" \
11542"$CVSROOT_DIRNAME/first-dir/a,v  <--  a
11543initial revision: 1\.1"
11544
11545		cd ../..
11546		mkdir 2
11547		cd 2
11548
11549		dotest conflicts-126.5 "${testcvs} co -p first-dir" \
11550"${SPROG} checkout: Updating first-dir
11551===================================================================
11552Checking out first-dir/a
11553RCS:  ${CVSROOT_DIRNAME}/first-dir/a,v
11554VERS: 1\.1
11555\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
11556		dotest conflicts-127 "${testcvs} -Q co first-dir" ''
11557		cd first-dir
11558		dotest conflicts-127a "test -f a" ''
11559
11560		cd ../../1/first-dir
11561		echo add a line >>a
11562		mkdir dir1
11563		dotest conflicts-127b "${testcvs} add dir1" \
11564"Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
11565		dotest conflicts-128 "${testcvs} -q ci -m changed" \
11566"$CVSROOT_DIRNAME/first-dir/a,v  <--  a
11567new revision: 1\.2; previous revision: 1\.1"
11568		cd ../..
11569
11570		# Similar to conflicts-126.5, but now the file has nonempty
11571		# contents.
11572		mkdir 3
11573		cd 3
11574		dotest conflicts-128.5 "${testcvs} co -p -l first-dir" \
11575"${SPROG} checkout: Updating first-dir
11576===================================================================
11577Checking out first-dir/a
11578RCS:  ${CVSROOT_DIRNAME}/first-dir/a,v
11579VERS: 1\.2
11580\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
11581add a line"
11582		cd ..
11583		rmdir 3
11584
11585		# Now go over the to the other working directory and
11586		# start testing conflicts
11587		cd 2/first-dir
11588		echo add a conflicting line >>a
11589		dotest_fail conflicts-129 "${testcvs} -q ci -m changed" \
11590"${SPROG}"' commit: Up-to-date check failed for `a'\''
11591'"${SPROG}"' \[commit aborted\]: correct above errors first!'
11592		mkdir dir1
11593		mkdir sdir
11594		dotest conflicts-status-0 "${testcvs} status a" \
11595"===================================================================
11596File: a                	Status: Needs Merge
11597
11598   Working revision:	1\.1.*
11599   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/a,v
11600   Commit Identifier:	${commitid}
11601   Sticky Tag:		(none)
11602   Sticky Date:		(none)
11603   Sticky Options:	(none)"
11604		dotest conflicts-129a "${testcvs} -nq update a" \
11605"RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
11606retrieving revision 1\.1
11607retrieving revision 1\.2
11608Merging differences between 1\.1 and 1\.2 into a
11609rcsmerge: warning: conflicts during merge
11610${SPROG} update: conflicts found in a
11611C a"
11612		dotest conflicts-130 "${testcvs} -q update" \
11613"RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
11614retrieving revision 1\.1
11615retrieving revision 1\.2
11616Merging differences between 1\.1 and 1\.2 into a
11617rcsmerge: warning: conflicts during merge
11618${SPROG} update: conflicts found in a
11619C a
11620${QUESTION} dir1
11621${QUESTION} sdir" \
11622"${QUESTION} dir1
11623${QUESTION} sdir
11624RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
11625retrieving revision 1\.1
11626retrieving revision 1\.2
11627Merging differences between 1\.1 and 1\.2 into a
11628rcsmerge: warning: conflicts during merge
11629${SPROG} update: conflicts found in a
11630C a"
11631		rmdir dir1 sdir
11632
11633		dotest conflicts-status-1 "${testcvs} status a" \
11634"===================================================================
11635File: a                	Status: Unresolved Conflict
11636
11637   Working revision:	1\.2.*
11638   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/a,v
11639   Commit Identifier:	${commitid}
11640   Sticky Tag:		(none)
11641   Sticky Date:		(none)
11642   Sticky Options:	(none)"
11643		dotest_fail conflicts-131 "${testcvs} -q ci -m try" \
11644"${SPROG} commit: file .a. had a conflict and has not been modified
11645${SPROG} \[commit aborted\]: correct above errors first!"
11646
11647		# Try to check in the file with the conflict markers in it.
11648		# Make sure we detect any one of the three conflict markers
11649		mv a aa
11650		grep '^<<<<<<<' aa >a
11651		dotest conflicts-status-2 "${testcvs} -nq ci -m try a" \
11652"${SPROG} commit: warning: file .a. seems to still contain conflict indicators"
11653
11654		grep '^=======' aa >a
11655		dotest conflicts-status-3 "${testcvs} -nq ci -m try a" \
11656"${SPROG} commit: warning: file .a. seems to still contain conflict indicators"
11657
11658		grep '^>>>>>>>' aa >a
11659		dotest conflicts-status-4 "${testcvs} -qn ci -m try a" \
11660"${SPROG} commit: warning: file .a. seems to still contain conflict indicators"
11661
11662		mv aa a
11663		echo lame attempt at resolving it >>a
11664		dotest conflicts-status-5 "${testcvs} status a" \
11665"===================================================================
11666File: a                	Status: File had conflicts on merge
11667
11668   Working revision:	1\.2.*
11669   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/a,v
11670   Commit Identifier:	${commitid}
11671   Sticky Tag:		(none)
11672   Sticky Date:		(none)
11673   Sticky Options:	(none)"
11674		dotest conflicts-132 "$testcvs -q ci -m try" \
11675"$SPROG commit: warning: file .a. seems to still contain conflict indicators
11676$CVSROOT_DIRNAME/first-dir/a,v  <--  a
11677new revision: 1\.3; previous revision: 1\.2"
11678
11679		# OK, the user saw the warning (good user), and now
11680		# resolves it for real.
11681		echo resolve conflict >a
11682		dotest conflicts-status-6 "${testcvs} status a" \
11683"===================================================================
11684File: a                	Status: Locally Modified
11685
11686   Working revision:	1\.3.*
11687   Repository revision:	1\.3	${CVSROOT_DIRNAME}/first-dir/a,v
11688   Commit Identifier:	${commitid}
11689   Sticky Tag:		(none)
11690   Sticky Date:		(none)
11691   Sticky Options:	(none)"
11692		dotest conflicts-133 "${testcvs} -q ci -m resolved" \
11693"$CVSROOT_DIRNAME/first-dir/a,v  <--  a
11694new revision: 1\.4; previous revision: 1\.3"
11695		dotest conflicts-status-7 "${testcvs} status a" \
11696"===================================================================
11697File: a                	Status: Up-to-date
11698
11699   Working revision:	1\.4.*
11700   Repository revision:	1\.4	${CVSROOT_DIRNAME}/first-dir/a,v
11701   Commit Identifier:	${commitid}
11702   Sticky Tag:		(none)
11703   Sticky Date:		(none)
11704   Sticky Options:	(none)"
11705
11706		# Now test that we can add a file in one working directory
11707		# and have an update in another get it.
11708		cd ../../1/first-dir
11709		echo abc >abc
11710		if ${testcvs} add abc >>${LOGFILE} 2>&1; then
11711		    pass 134
11712		else
11713		    fail 134
11714		fi
11715		if ${testcvs} ci -m 'add abc' abc >>${LOGFILE} 2>&1; then
11716		    pass 135
11717		else
11718		    fail 135
11719		fi
11720		cd ../../2
11721		mkdir first-dir/dir1 first-dir/sdir
11722		dotest conflicts-136 "${testcvs} -q update first-dir" \
11723'[UP] first-dir/abc
11724'"${QUESTION}"' first-dir/dir1
11725'"${QUESTION}"' first-dir/sdir' \
11726''"${QUESTION}"' first-dir/dir1
11727'"${QUESTION}"' first-dir/sdir
11728[UP] first-dir/abc'
11729		dotest conflicts-137 'test -f first-dir/abc' ''
11730		rmdir first-dir/dir1 first-dir/sdir
11731
11732		# Now test something similar, but in which the parent directory
11733		# (not the directory in question) has the Entries.Static flag
11734		# set.
11735		cd ../1/first-dir
11736		mkdir subdir
11737		dotest conflicts-138 "${testcvs} add subdir" "${DOTSTAR}"
11738		cd ../..
11739		mkdir 3
11740		cd 3
11741		dotest conflicts-139 \
11742"${testcvs} -q co first-dir/abc first-dir/subdir" "${DOTSTAR}"
11743		cd ../1/first-dir/subdir
11744		echo sss >sss
11745		dotest conflicts-140 "${testcvs} add sss" "${DOTSTAR}"
11746		dotest conflicts-140a "${testcvs} ci -m adding sss" \
11747"${DOTSTAR}"
11748		cd ../../../3/first-dir
11749		dotest conflicts-141 "${testcvs} -q update" "${DOTSTAR}"
11750		dotest conflicts-142 "test -f subdir/sss"
11751
11752		dokeep
11753		cd ../..
11754		rm -r 1 2 3
11755		modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
11756		restore_adm
11757		;;
11758
11759
11760
11761	conflicts2)
11762	  # More conflicts tests; separate from conflicts to keep each
11763	  # test a manageable size.
11764	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
11765
11766	  mkdir 1
11767	  cd 1
11768
11769	  dotest conflicts2-142a1 "${testcvs} -q co first-dir" ''
11770
11771	  cd first-dir
11772	  touch a abc
11773
11774	  dotest conflicts2-142a2 "${testcvs} add a abc" \
11775"${SPROG} add: scheduling file .a. for addition
11776${SPROG} add: scheduling file .abc. for addition
11777${SPROG} add: use .${SPROG} commit. to add these files permanently"
11778	  dotest conflicts2-142a3 "${testcvs} -q ci -m added" \
11779"$CVSROOT_DIRNAME/first-dir/a,v  <--  a
11780initial revision: 1\.1
11781${CVSROOT_DIRNAME}/first-dir/abc,v  <--  abc
11782initial revision: 1\.1"
11783
11784	  cd ../..
11785	  mkdir 2
11786	  cd 2
11787
11788	  dotest conflicts2-142a4 "${testcvs} -q co first-dir" 'U first-dir/a
11789U first-dir/abc'
11790	  cd ..
11791
11792	  # BEGIN TESTS USING THE FILE A
11793	  # FIXME: would be cleaner to separate them out into their own
11794	  # tests; conflicts2 is getting long.
11795	  # Now test that if one person modifies and commits a
11796	  # file and a second person removes it, it is a
11797	  # conflict
11798	  cd 1/first-dir
11799	  echo modify a >>a
11800	  dotest conflicts2-142b2 "${testcvs} -q ci -m modify-a" \
11801"$CVSROOT_DIRNAME/first-dir/a,v  <--  a
11802new revision: 1\.2; previous revision: 1\.1"
11803	  cd ../../2/first-dir
11804	  rm a
11805	  dotest conflicts2-142b3 "${testcvs} rm a" \
11806"${SPROG} remove: scheduling .a. for removal
11807${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
11808	  dotest_fail conflicts2-142b4 "${testcvs} -q update" \
11809"${SPROG} update: conflict: removed \`a' was modified by second party
11810C a"
11811	  # Resolve the conflict by deciding not to remove the file
11812	  # after all.
11813	  dotest_sort conflicts2-142b5 "$testcvs add a" "U a
11814${SPROG} add: \`a', version 1\.1, resurrected"
11815	  dotest conflicts2-142b5b1 "$testcvs status a" \
11816"===================================================================
11817File: a                	Status: Needs Patch
11818
11819   Working revision:	1\.1.*
11820   Repository revision:	1\.2	$CVSROOT_DIRNAME/first-dir/a,v
11821   Commit Identifier:	${commitid}
11822   Sticky Tag:		(none)
11823   Sticky Date:		(none)
11824   Sticky Options:	(none)"
11825	  dotest conflicts2-142b6 "$testcvs -q update" 'U a'
11826
11827	  # Now one level up.
11828	  cd ..
11829	  dotest conflicts2-142b7 "${testcvs} rm -f first-dir/a" \
11830"${SPROG} remove: scheduling \`first-dir/a' for removal
11831${SPROG} remove: use \`${SPROG} commit' to remove this file permanently"
11832
11833	  if $remote; then
11834	    # Haven't investigated this one.
11835	    dotest_fail conflicts2-142b8r "$testcvs add first-dir/a" \
11836"${CPROG} add: in directory \`\.':
11837${CPROG} \[add aborted\]: there is no version here; do \`${CPROG} checkout' first"
11838	    cd first-dir
11839	  else
11840	    dotest conflicts2-142b8 "${testcvs} add first-dir/a" \
11841"U first-dir/a
11842$SPROG add: \`first-dir/a', version 1\.2, resurrected"
11843	    cd first-dir
11844	    # Now recover from the damage that the 142b8 test did.
11845	    dotest conflicts2-142b9 "${testcvs} rm -f a" \
11846"${SPROG} remove: scheduling \`a' for removal
11847${SPROG} remove: use \`${SPROG} commit' to remove this file permanently"
11848	  fi
11849
11850	  # As before, 1.2 instead of 1.1 is a bug.
11851	  dotest_sort conflicts2-142b10 "$testcvs add a" "U a
11852${SPROG} add: \`a', version 1\.2, resurrected"
11853	  # As with conflicts2-142b6, check that things are normal again.
11854	  dotest conflicts2-142b11 "${testcvs} -q update" ''
11855	  cd ../..
11856	  # END TESTS USING THE FILE A
11857
11858	  # Now test that if one person removes a file and
11859	  # commits it, and a second person removes it, is it
11860	  # not a conflict.
11861	  cd 1/first-dir
11862	  rm abc
11863	  dotest conflicts2-142c0 "${testcvs} rm abc" \
11864"${SPROG} remove: scheduling \`abc' for removal
11865${SPROG} remove: use \`${SPROG} commit' to remove this file permanently"
11866	  dotest conflicts2-142c1 "${testcvs} -q ci -m remove-abc" \
11867"$CVSROOT_DIRNAME/first-dir/abc,v  <--  abc
11868new revision: delete; previous revision: 1\.1"
11869	  cd ../../2/first-dir
11870	  rm abc
11871	  dotest conflicts2-142c2 "${testcvs} rm abc" \
11872"${SPROG} remove: scheduling \`abc' for removal
11873${SPROG} remove: use \`${SPROG} commit' to remove this file permanently"
11874	  dotest conflicts2-142c3 "${testcvs} update" \
11875"${SPROG} update: Updating \."
11876	  cd ../..
11877
11878	  # conflicts2-142d*: test that if one party adds a file, and another
11879	  # party has a file of the same name, cvs notices
11880	  cd 1/first-dir
11881	  touch aa.c
11882	  echo 'contents unchanged' >same.c
11883	  dotest conflicts2-142d0 "${testcvs} add aa.c same.c" \
11884"${SPROG} add: scheduling file .aa\.c. for addition
11885${SPROG} add: scheduling file .same\.c. for addition
11886${SPROG} add: use .${SPROG} commit. to add these files permanently"
11887	  dotest conflicts2-142d1 "${testcvs} -q ci -m added" \
11888"$CVSROOT_DIRNAME/first-dir/aa\.c,v  <--  aa\.c
11889initial revision: 1\.1
11890$CVSROOT_DIRNAME/first-dir/same\.c,v  <--  same\.c
11891initial revision: 1\.1"
11892
11893	  # Test the case where the second user manages the add before the
11894	  # first commits
11895	  touch bb.c
11896	  dotest conflicts2-142d1a "$testcvs add bb.c" \
11897"$SPROG add: scheduling file .bb\.c. for addition
11898$SPROG add: use .$SPROG commit. to add this file permanently"
11899	  cd ../../2/first-dir
11900	  echo "don't you dare obliterate this text" >bb.c
11901	  dotest conflicts2-142d1b "$testcvs add bb.c" \
11902"$SPROG add: scheduling file .bb\.c. for addition
11903$SPROG add: use .$SPROG commit. to add this file permanently"
11904	  cd ../../1/first-dir
11905	  dotest conflicts2-142d1c "$testcvs -q ci -m added" \
11906"$CVSROOT_DIRNAME/first-dir/bb\.c,v  <--  bb\.c
11907initial revision: 1\.1"
11908
11909	  cd ../../2/first-dir
11910	  echo "don't you dare obliterate this text either" >aa.c
11911	  echo 'contents unchanged' >same.c
11912	  # Note the discrepancy between local and remote in the handling
11913	  # of same.c.  I kind
11914	  # of suspect that the local CVS behavior is the more useful one
11915	  # although I do sort of wonder whether we should make people run
11916	  # cvs add just to get them in that habit (also, trying to implement
11917	  # the local CVS behavior for remote without the cvs add seems
11918	  # pretty difficult).
11919	  if $remote; then
11920	    dotest_fail conflicts2-142d2r "${testcvs} -q update" \
11921"${QUESTION} aa\.c
11922${QUESTION} same\.c
11923${CPROG} update: move away \`\./aa\.c'; it is in the way
11924C aa\.c
11925${SPROG} update: conflict: \`bb\.c' created independently by second party
11926C bb\.c
11927${CPROG} update: move away \`\./same\.c'; it is in the way
11928C same\.c"
11929	  else
11930	    dotest_fail conflicts2-142d2 "${testcvs} -q update" \
11931"${CPROG} update: move away \`aa\.c'; it is in the way
11932C aa\.c
11933${CPROG} update: conflict: \`bb\.c' created independently by second party
11934C bb\.c
11935U same\.c"
11936	  fi
11937	  dotest conflicts2-142d3 "${testcvs} -q status aa.c" \
11938"${SPROG} status: move away \`aa\.c'; it is in the way
11939===================================================================
11940File: aa\.c             	Status: Unresolved Conflict
11941
11942   Working revision:	No entry for aa\.c
11943   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/aa\.c,v
11944   Commit Identifier:	${commitid}"
11945	  dotest conflicts2-142d3a "${testcvs} -q status bb.c" \
11946"${SPROG} status: conflict: \`bb\.c' created independently by second party
11947===================================================================
11948File: bb\.c             	Status: Unresolved Conflict
11949
11950   Working revision:	New file!
11951   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/bb\.c,v
11952   Commit Identifier:	${commitid}
11953   Sticky Tag:		(none)
11954   Sticky Date:		(none)
11955   Sticky Options:	(none)"
11956
11957	  # FIXCVS
11958	  # This message seems somewhat bogus.  I mean, parallel development
11959	  # means that we get to work in parallel if we choose, right?  And
11960	  # then at commit time it would be a conflict.
11961	  #
11962	  # Well, the status is "Unresolved conflict" before _and_ after
11963	  # the update/merge (when conflicts happen, not at commit time).
11964	  # It is possible that this message could be changed to something
11965	  # more infomrative to novice users, like "File of same name exists
11966	  # in repository", or "File of same name committed independantly by
11967	  # second party", but these two messages look too long for the Status
11968	  # field and the move away & added independantly error messages _are_
11969	  # displayed.  Still, we get a lot of questions about this on the
11970	  # email lists.  Somehow we need to get more information to users
11971	  # via these messages and the ones generated by update. -DRP
11972	  dotest_fail conflicts2-142d4 "${testcvs} -q add aa.c" \
11973"${SPROG} add: \`aa.c' added independently by second party"
11974
11975	  # The user might want to see just what the conflict is.
11976	  # Don't bother, diff seems to kind of lose its mind, with or
11977	  # without -N.  This is a CVS bug(s).
11978	  #dotest conflicts2-142d5 \
11979	  #"${testcvs} -q diff -r HEAD -N aa.c" FIXCVS THEN FIXME
11980
11981	  # Now: "how can the user resolve this conflict", I hear you cry.
11982	  # Well, one way is to forget about the file in the working
11983	  # directory.
11984	  # Since it didn't let us do the add in conflicts2-142d4, there
11985	  # is no need to run cvs rm here.
11986	  #dotest conflicts2-142d6 "${testcvs} -q rm -f aa.c" fixme
11987	  dotest conflicts2-142d6 "rm aa.c" ''
11988	  dotest conflicts2-142d7 "${testcvs} -q update aa.c" "U aa\.c"
11989	  dotest conflicts2-142d8 "cat aa.c" ''
11990
11991	  # The other way is to use the version from the working directory
11992	  # instead of the version from the repository.  Unfortunately,
11993	  # there doesn't seem to be any particularly clear way to do
11994	  # this (?).
11995
11996	  dokeep
11997	  cd ../..
11998	  rm -r 1 2
11999	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
12000	  ;;
12001
12002
12003
12004	conflicts3)
12005	  # More tests of conflicts and/or multiple working directories
12006	  # in general.
12007
12008	  mkdir 1; cd 1
12009	  dotest conflicts3-1 "$testcvs -q co -l ."
12010	  mkdir first-dir
12011	  dotest conflicts3-2 "${testcvs} add first-dir" \
12012"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
12013	  cd ..
12014	  mkdir 2; cd 2
12015	  dotest conflicts3-3 "${testcvs} -q co -l first-dir" ''
12016	  cd ../1/first-dir
12017	  touch file1 file2
12018	  dotest conflicts3-4 "${testcvs} add file1 file2" \
12019"${SPROG} add: scheduling file .file1. for addition
12020${SPROG} add: scheduling file .file2. for addition
12021${SPROG} add: use .${SPROG} commit. to add these files permanently"
12022	  dotest conflicts3-5 "${testcvs} -q ci -m add-them" \
12023"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
12024initial revision: 1\.1
12025$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
12026initial revision: 1\.1"
12027	  cd ../../2/first-dir
12028	  # Check that -n doesn't make CVS lose its mind as it creates
12029	  # (or rather, doesn't) a new file.
12030	  dotest conflicts3-6 "${testcvs} -nq update" \
12031"U file1
12032U file2"
12033	  dotest_fail conflicts3-7 "test -f file1" ''
12034	  dotest conflicts3-8 "${testcvs} -q update" \
12035"U file1
12036U file2"
12037	  dotest conflicts3-9 "test -f file2" ''
12038
12039	  # OK, now remove two files at once
12040	  dotest conflicts3-10 "${testcvs} rm -f file1 file2" \
12041"${SPROG} remove: scheduling .file1. for removal
12042${SPROG} remove: scheduling .file2. for removal
12043${SPROG} remove: use .${SPROG} commit. to remove these files permanently"
12044	  dotest conflicts3-11 "${testcvs} -q ci -m remove-them" \
12045"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
12046new revision: delete; previous revision: 1\.1
12047$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
12048new revision: delete; previous revision: 1\.1"
12049	  cd ../../1/first-dir
12050	  dotest conflicts3-12 "${testcvs} -n -q update" \
12051"${SPROG} update: \`file1' is no longer in the repository
12052${SPROG} update: \`file2' is no longer in the repository"
12053	  dotest conflicts3-13 "${testcvs} -q update" \
12054"${SPROG} update: \`file1' is no longer in the repository
12055${SPROG} update: \`file2' is no longer in the repository"
12056
12057	  # OK, now add a directory to both working directories
12058	  # and see that CVS doesn't lose its mind.
12059	  mkdir sdir
12060	  dotest conflicts3-14 "${testcvs} add sdir" \
12061"Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
12062	  touch sdir/sfile
12063	  dotest conflicts3-14a "${testcvs} add sdir/sfile" \
12064"${SPROG} add: scheduling file .sdir/sfile. for addition
12065${SPROG} add: use .${SPROG} commit. to add this file permanently"
12066	  dotest conflicts3-14b "${testcvs} -q ci -m add" \
12067"$CVSROOT_DIRNAME/first-dir/sdir/sfile,v  <--  sdir/sfile
12068initial revision: 1\.1"
12069
12070	  cd ../../2/first-dir
12071
12072	  # Create a CVS directory without the proper administrative
12073	  # files in it.  This can happen for example if you hit ^C
12074	  # in the middle of a checkout.
12075	  mkdir sdir
12076	  mkdir sdir/CVS
12077	  # OK, in the local case CVS sees that the directory exists
12078	  # in the repository and recurses into it.  In the remote case
12079	  # CVS can't see the repository and has no way of knowing
12080	  # that sdir is even a directory (stat'ing everything would be
12081	  # too slow).  The remote behavior makes more sense to me (but
12082	  # would this affect other cases?).
12083	  if $remote; then
12084	    dotest conflicts3-15 "${testcvs} -q update" \
12085"${QUESTION} sdir"
12086	  else
12087	    dotest conflicts3-15 "${testcvs} -q update" \
12088"${QUESTION} sdir
12089${SPROG} update: ignoring sdir (CVS/Repository missing)"
12090	    touch sdir/CVS/Repository
12091	    dotest conflicts3-16 "${testcvs} -q update" \
12092"${QUESTION} sdir
12093${SPROG} update: ignoring sdir (CVS/Entries missing)"
12094	    cd ..
12095	    dotest conflicts3-16a "${testcvs} -q update first-dir" \
12096"${QUESTION} first-dir/sdir
12097${SPROG} update: ignoring first-dir/sdir (CVS/Entries missing)"
12098	    cd first-dir
12099	  fi
12100	  rm -r sdir
12101
12102	  # OK, now the same thing, but the directory doesn't exist
12103	  # in the repository.
12104	  mkdir newdir
12105	  mkdir newdir/CVS
12106	  dotest conflicts3-17 "${testcvs} -q update" "${QUESTION} newdir"
12107	  echo "D/newdir////" >> CVS/Entries
12108	  dotest conflicts3-18 "${testcvs} -q update" \
12109"${CPROG} update: ignoring newdir (CVS/Repository missing)"
12110	  touch newdir/CVS/Repository
12111	  dotest conflicts3-19 "${testcvs} -q update" \
12112"${CPROG} update: ignoring newdir (CVS/Entries missing)"
12113	  cd ..
12114	  dotest conflicts3-20 "${testcvs} -q update first-dir" \
12115"${CPROG} update: ignoring first-dir/newdir (CVS/Entries missing)"
12116	  cd first-dir
12117	  rm -r newdir
12118
12119	  # The previous tests have left CVS/Entries in something of a mess.
12120	  # While we "should" be able to deal with that (maybe), for now
12121	  # we just start over.
12122	  cd ..
12123	  rm -r first-dir
12124	  dotest conflicts3-20a "${testcvs} -q co -l first-dir" ''
12125	  cd first-dir
12126
12127	  dotest conflicts3-21 "${testcvs} -q update -d sdir" "U sdir/sfile"
12128	  rm -r sdir/CVS
12129	  dotest conflicts3-22 "${testcvs} -q update" "${QUESTION} sdir"
12130	  if $remote; then
12131	    dotest_fail conflicts3-23 "${testcvs} -q update -PdA" \
12132"${QUESTION} sdir
12133${CPROG} update: move away \`sdir/sfile'; it is in the way
12134C sdir/sfile"
12135	  else
12136	    dotest conflicts3-23 "${testcvs} -q update -PdA" \
12137"${QUESTION} sdir"
12138	  fi
12139
12140	  # Not that it should really affect much, but let's do the case
12141	  # where sfile has been removed.  For example, suppose that sdir
12142	  # had been a CVS-controlled directory which was then removed
12143	  # by removing each file (and using update -P or some such).  Then
12144	  # suppose that the build process creates an sdir directory which
12145	  # is not supposed to be under CVS.
12146	  rm -r sdir
12147	  dotest conflicts3-24 "${testcvs} -q update -d sdir" "U sdir/sfile"
12148	  rm sdir/sfile
12149	  dotest conflicts3-25 "${testcvs} rm sdir/sfile" \
12150"${SPROG} remove: scheduling .sdir/sfile. for removal
12151${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
12152	  dotest conflicts3-26 "${testcvs} ci -m remove sdir/sfile" \
12153"${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v  <--  sdir/sfile
12154new revision: delete; previous revision: 1\.1"
12155	  rm -r sdir/CVS
12156	  dotest conflicts3-27 "${testcvs} -q update" "${QUESTION} sdir"
12157	  dotest conflicts3-28 "${testcvs} -q update -PdA" \
12158"${QUESTION} sdir"
12159
12160	  dokeep
12161	  cd ../..
12162	  rm -r 1 2
12163	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
12164	  ;;
12165
12166
12167
12168	clean)
12169	  # Test update -C (overwrite local mods w/ repository copies)
12170	  mkdir 1; cd 1
12171	  dotest clean-1 "${testcvs} -q co -l ." ''
12172	  mkdir first-dir
12173	  dotest clean-2 "${testcvs} add first-dir" \
12174"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
12175	  cd first-dir
12176	  echo "The usual boring test text." > cleanme.txt
12177          dotest clean-3 "${testcvs} add cleanme.txt" \
12178"${SPROG} add: scheduling file .cleanme\.txt. for addition
12179${SPROG} add: use .${SPROG} commit. to add this file permanently"
12180	  dotest clean-4 "${testcvs} -q ci -m clean-3" \
12181"$CVSROOT_DIRNAME/first-dir/cleanme\.txt,v  <--  cleanme\.txt
12182initial revision: 1\.1"
12183          # Okay, preparation is done, now test.
12184          # Check that updating an unmodified copy works.
12185	  dotest clean-5 "${testcvs} -q update" ''
12186          # Check that updating -C an unmodified copy works.
12187	  dotest clean-6 "${testcvs} -q update -C" ''
12188          # Check that updating a modified copy works.
12189	  echo "fish" >> cleanme.txt
12190	  dotest clean-7 "${testcvs} -q update" 'M cleanme\.txt'
12191          # Check that updating -C a modified copy works.
12192	  dotest clean-8 "${testcvs} -q update -C" \
12193"(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
12194U cleanme\.txt"
12195	  # And check that the backup copy really was made.
12196	  dotest clean-9 "cat .#cleanme.txt.1.1" \
12197"The usual boring test text\.
12198fish"
12199
12200          # Do it all again, this time naming the file explicitly.
12201	  rm .#cleanme.txt.1.1
12202	  dotest clean-10 "${testcvs} -q update cleanme.txt" ''
12203	  dotest clean-11 "${testcvs} -q update -C cleanme.txt" ''
12204	  echo "bluegill" >> cleanme.txt
12205	  dotest clean-12 "${testcvs} -q update cleanme.txt" 'M cleanme\.txt'
12206	  dotest clean-13 "${testcvs} -q update -C cleanme.txt" \
12207"(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
12208U cleanme\.txt"
12209	  # And check that the backup copy really was made.
12210	  dotest clean-14 "cat .#cleanme.txt.1.1" \
12211"The usual boring test text\.
12212bluegill"
12213
12214	  # Now try with conflicts
12215	  cd ..
12216	  dotest clean-15 "${testcvs} -q co -d second-dir first-dir" \
12217'U second-dir/cleanme\.txt'
12218	  cd second-dir
12219	  echo "conflict test" >> cleanme.txt
12220	  dotest clean-16 "${testcvs} -q ci -m." \
12221"$CVSROOT_DIRNAME/first-dir/cleanme\.txt,v  <--  cleanme\.txt
12222new revision: 1\.2; previous revision: 1\.1"
12223	  cd ../first-dir
12224	  echo "fish" >> cleanme.txt
12225	  dotest clean-17 "${testcvs} -nq update" \
12226"RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
12227retrieving revision 1\.1
12228retrieving revision 1\.2
12229Merging differences between 1\.1 and 1\.2 into cleanme\.txt
12230rcsmerge: warning: conflicts during merge
12231${SPROG} update: conflicts found in cleanme\.txt
12232C cleanme\.txt"
12233	  dotest clean-18 "${testcvs} -q update -C" \
12234"(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
12235U cleanme\.txt"
12236	  dotest clean-19 "cat .#cleanme.txt.1.1" \
12237"The usual boring test text\.
12238fish"
12239
12240          # Done.  Clean up.
12241	  dokeep
12242	  cd ../..
12243          rm -rf 1
12244	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
12245	  ;;
12246
12247
12248
12249	keywordexpand)
12250	  # Tests of the original *BSD tag= and keywordexpand= features
12251	  # are done via the LocalKeyword= and KeywordExpand features.
12252
12253	  # Skip this in noredirect mode because it is too easy for the primary
12254	  # and secondary error messages to get out of sync when the
12255	  # CVSROOT/config files are broken.  This is intentional, since it is
12256	  # possible and even likely that an administrator might want to set up
12257	  # different configurations on the two servers and the paths to the
12258	  # config files on the secondary and primary were intentionally left
12259	  # intact even though they might be different.
12260	  if $noredirect; then
12261            notnoredirect keywordexpand
12262	    continue
12263	  fi
12264
12265	  mkdir keywordexpand; cd keywordexpand
12266
12267	  dotest keywordexpand-1 "${testcvs} -q co CVSROOT" \
12268'U CVSROOT/access
12269U CVSROOT/aclconfig
12270U CVSROOT/checkoutlist
12271U CVSROOT/commitinfo
12272U CVSROOT/config
12273U CVSROOT/cvswrappers
12274U CVSROOT/group
12275U CVSROOT/loginfo
12276U CVSROOT/modules
12277U CVSROOT/notify
12278U CVSROOT/postadmin
12279U CVSROOT/postproxy
12280U CVSROOT/posttag
12281U CVSROOT/postwatch
12282U CVSROOT/preproxy
12283U CVSROOT/rcsinfo
12284U CVSROOT/taginfo
12285U CVSROOT/verifymsg'
12286	  cd CVSROOT
12287	  echo LocalKeyword=MyBSD=CVSHeader >> config
12288	  # First do not expand any keywords
12289	  echo KeywordExpand=i >> config
12290	  dotest keywordexpand-2 "${testcvs} -Q ci -mkeywordexpand config"
12291
12292	  cd ..
12293
12294	  mkdir testimport; cd testimport
12295	  echo '$''Author$' > file1
12296	  echo '$''Date$' >> file1
12297	  echo '$''CVSHeader$' >> file1
12298	  echo '$''Header$' >> file1
12299	  echo '$''Id$' >> file1
12300	  echo '$''Locker$' >> file1
12301	  echo '$''Log$' >> file1
12302	  echo '$''Name$' >> file1
12303	  echo '$''RCSfile$' >> file1
12304	  echo '$''Revision$' >> file1
12305	  echo '$''Source$' >> file1
12306	  echo '$''State$' >> file1
12307	  echo '$''MyBSD$' >> file1
12308	  dotest keywordexpand-3 \
12309"${testcvs} -Q import -I ! -m test-import-with-bsd-keyword keywordexpand vendor v1" \
12310''
12311	  cd ..
12312
12313	  dotest keywordexpand-4 "${testcvs} -Q checkout keywordexpand" ''
12314	  cd keywordexpand
12315	  dotest keywordexpand-5 "cat file1" \
12316"\$""Author\$
12317\$""Date\$
12318\$""CVSHeader\$
12319\$""Header\$
12320\$""Id\$
12321\$""Locker\$
12322\$""Log\$
12323\$""Name\$
12324\$""RCSfile\$
12325\$""Revision\$
12326\$""Source\$
12327\$""State\$
12328\$MyBSD\$"
12329	  cd ../CVSROOT
12330	  # Now expand just the MyBSD and Id keywords
12331	  mv config config.old
12332	  sed -e 's/KeywordExpand=i/KeywordExpand=iMyBSD,Id/' < config.old > config
12333	  rm -f config.old
12334	  dotest keywordexpand-6 "${testcvs} -Q ci -mkeywordexpand config"
12335	  cd ../keywordexpand
12336	  echo 'a change' >> file1
12337	  dotest keywordexpand-7 "${testcvs} -Q ci -madd"
12338	  dotest keywordexpand-8 "cat file1" \
12339"\$""Author\$
12340\$""Date\$
12341\$""CVSHeader\$
12342\$""Header\$
12343\$""Id: file1,v 1\.2 [0-9/]* [0-9:]* ${username} Exp \$
12344\$""Locker\$
12345\$""Log\$
12346\$""Name\$
12347\$""RCSfile\$
12348\$""Revision\$
12349\$""Source\$
12350\$""State\$
12351\$MyBSD: keywordexpand/file1,v 1\.2 [0-9/]* [0-9:]* ${username} Exp \$
12352a change"
12353
12354	  cd ../CVSROOT
12355	  mv config config.old
12356	  sed -e 's/LocalKeyword=MyBSD/LocalKeyword=My_BSD/' \
12357	      <config.old >config
12358	  dotest keywordexpand-9 "$testcvs -Q ci -minvalidlocalkeyword config"
12359	  dotest keywordexpand-10 "$testcvs -Q update config" \
12360"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: LocalKeyword ignored: Bad character \`_' in key \`My_BSD'"
12361	  cp config.old config
12362	  dotest keywordexpand-11 "$testcvs -Q ci -mfixit config" \
12363"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: LocalKeyword ignored: Bad character \`_' in key \`My_BSD'" \
12364"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: LocalKeyword ignored: Bad character \`_' in key \`My_BSD'
12365$SPROG [a-z]*: $CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: LocalKeyword ignored: Bad character \`_' in key \`My_BSD'"
12366	  dotest keywordexpand-12 "$testcvs -Q update config"
12367	  sed -e 's/LocalKeyword=MyBSD=CVSHeader/LocalKeyword=MyBSD=Name/' \
12368	      <config.old >config
12369	  dotest keywordexpand-13 \
12370"$testcvs -Q ci -minvalidlocalkeyword2 config"
12371	  dotest keywordexpand-14 "$testcvs -Q update config" \
12372"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: LocalKeyword ignored: Unknown LocalId mode: \`Name'"
12373	  cp config.old config
12374	  dotest keywordexpand-15 "$testcvs -Q ci -mfixit2 config" \
12375"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: LocalKeyword ignored: Unknown LocalId mode: \`Name'" \
12376"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: LocalKeyword ignored: Unknown LocalId mode: \`Name'
12377$SPROG [a-z]*: $CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: LocalKeyword ignored: Unknown LocalId mode: \`Name'"
12378	  dotest keywordexpand-16 "$testcvs -Q update config"
12379
12380	  dokeep
12381	  # Done. Clean up.
12382	  cd ../..
12383	  rm -rf $TESTDIR/keywordexpand
12384          modify_repo rm -rf $CVSROOT_DIRNAME/keywordexpand
12385	  restore_adm
12386	  ;;
12387
12388
12389
12390	modules)
12391	  # Tests of various ways to define and use modules.
12392	  # Roadmap to various modules tests:
12393	  # -a:
12394	  #   error on incorrect placement: modules
12395	  #   error combining with other options: modules2-a*
12396	  #   infinite loops: modules148a1.1 - modules148a1.2
12397	  #   use to specify a file more than once: modules3
12398	  #   use with ! feature: modules4
12399	  # regular modules: modules, modules2, cvsadm
12400	  # ampersand modules: modules2
12401	  # -s: modules.
12402	  # -d: modules, modules3, cvsadm
12403	  # -i, -o, -u, -e, -t: modules5
12404	  # slashes in module names: modules3
12405	  # invalid module definitions: modules6
12406
12407	  ############################################################
12408	  # These tests are to make sure that administrative files get
12409	  # rebuilt, regardless of how and where files are checked
12410	  # out.
12411	  ############################################################
12412	  # Check out the whole repository
12413	  mkdir 1; cd 1
12414	  dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/access
12415U CVSROOT/aclconfig
12416U CVSROOT/checkoutlist
12417U CVSROOT/commitinfo
12418U CVSROOT/config
12419U CVSROOT/cvswrappers
12420U CVSROOT/group
12421U CVSROOT/loginfo
12422U CVSROOT/modules
12423U CVSROOT/notify
12424U CVSROOT/postadmin
12425U CVSROOT/postproxy
12426U CVSROOT/posttag
12427U CVSROOT/postwatch
12428U CVSROOT/preproxy
12429U CVSROOT/rcsinfo
12430U CVSROOT/taginfo
12431U CVSROOT/verifymsg'
12432	  echo "# made a change" >>CVSROOT/modules
12433	  dotest modules-1d "${testcvs} -q ci -m add-modules" \
12434"$CVSROOT_DIRNAME/CVSROOT/modules,v  <--  CVSROOT/modules
12435new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12436$SPROG commit: Rebuilding administrative file database"
12437	  cd ..
12438	  rm -rf 1
12439
12440	  ############################################################
12441	  # Check out CVSROOT
12442	  mkdir 1; cd 1
12443	  dotest modules-2 "${testcvs} -q co CVSROOT" 'U CVSROOT/access
12444U CVSROOT/aclconfig
12445U CVSROOT/checkoutlist
12446U CVSROOT/commitinfo
12447U CVSROOT/config
12448U CVSROOT/cvswrappers
12449U CVSROOT/group
12450U CVSROOT/loginfo
12451U CVSROOT/modules
12452U CVSROOT/notify
12453U CVSROOT/postadmin
12454U CVSROOT/postproxy
12455U CVSROOT/posttag
12456U CVSROOT/postwatch
12457U CVSROOT/preproxy
12458U CVSROOT/rcsinfo
12459U CVSROOT/taginfo
12460U CVSROOT/verifymsg'
12461	  echo "# made a change" >>CVSROOT/modules
12462	  dotest modules-2d "${testcvs} -q ci -m add-modules" \
12463"$CVSROOT_DIRNAME/CVSROOT/modules,v  <--  CVSROOT/modules
12464new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12465$SPROG commit: Rebuilding administrative file database"
12466	  cd ..
12467	  rm -rf 1
12468
12469	  ############################################################
12470	  # Check out CVSROOT in some other directory
12471	  modify_repo mkdir $CVSROOT_DIRNAME/somedir
12472	  mkdir 1; cd 1
12473	  dotest modules-3 "${testcvs} -q co somedir" ''
12474	  cd somedir
12475	  dotest modules-3d "${testcvs} -q co CVSROOT" 'U CVSROOT/access
12476U CVSROOT/aclconfig
12477U CVSROOT/checkoutlist
12478U CVSROOT/commitinfo
12479U CVSROOT/config
12480U CVSROOT/cvswrappers
12481U CVSROOT/group
12482U CVSROOT/loginfo
12483U CVSROOT/modules
12484U CVSROOT/notify
12485U CVSROOT/postadmin
12486U CVSROOT/postproxy
12487U CVSROOT/posttag
12488U CVSROOT/postwatch
12489U CVSROOT/preproxy
12490U CVSROOT/rcsinfo
12491U CVSROOT/taginfo
12492U CVSROOT/verifymsg'
12493	  echo "# made a change" >>CVSROOT/modules
12494	  dotest modules-3g "${testcvs} -q ci -m add-modules" \
12495"$CVSROOT_DIRNAME/CVSROOT/modules,v  <--  CVSROOT/modules
12496new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12497$SPROG commit: Rebuilding administrative file database"
12498	  cd ../..
12499	  rm -rf 1
12500	  modify_repo rm -rf $CVSROOT_DIRNAME/somedir
12501	  ############################################################
12502	  # end rebuild tests
12503	  ############################################################
12504
12505
12506	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
12507
12508	  mkdir 1
12509	  cd 1
12510
12511	  dotest modules-143 "${testcvs} -q co first-dir" ""
12512
12513	  cd first-dir
12514	  mkdir subdir
12515	  dotest modules-143a "${testcvs} add subdir" \
12516"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
12517
12518	  cd subdir
12519	  mkdir ssdir
12520	  dotest modules-143b "${testcvs} add ssdir" \
12521"Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
12522
12523	  touch a b
12524
12525	  dotest modules-144 "${testcvs} add a b" \
12526"${SPROG} add: scheduling file .a. for addition
12527${SPROG} add: scheduling file .b. for addition
12528${SPROG} add: use .${SPROG} commit. to add these files permanently"
12529
12530	  dotest modules-145 "$testcvs ci -m added" \
12531"$CPROG commit: Examining .
12532$CPROG commit: Examining ssdir
12533$CVSROOT_DIRNAME/first-dir/subdir/a,v  <--  a
12534initial revision: 1\.1
12535$CVSROOT_DIRNAME/first-dir/subdir/b,v  <--  b
12536initial revision: 1\.1"
12537
12538	  cd ..
12539	  dotest modules-146 "$testcvs -q co CVSROOT" \
12540"U CVSROOT/access
12541U CVSROOT/aclconfig
12542U CVSROOT/checkoutlist
12543U CVSROOT/commitinfo
12544U CVSROOT/config
12545U CVSROOT/cvswrappers
12546U CVSROOT/group
12547U CVSROOT/loginfo
12548U CVSROOT/modules
12549U CVSROOT/notify
12550U CVSROOT/postadmin
12551U CVSROOT/postproxy
12552U CVSROOT/posttag
12553U CVSROOT/postwatch
12554U CVSROOT/preproxy
12555U CVSROOT/rcsinfo
12556U CVSROOT/taginfo
12557U CVSROOT/verifymsg"
12558
12559	  # Here we test that CVS can deal with CVSROOT (whose repository
12560	  # is at top level) in the same directory as subdir (whose repository
12561	  # is a subdirectory of first-dir).  TODO: Might want to check that
12562	  # files can actually get updated in this state.
12563	  dotest modules-147 "$testcvs -q update"
12564
12565	  cat >CVSROOT/modules <<EOF
12566realmodule first-dir/subdir a
12567dirmodule first-dir/subdir
12568namedmodule -d nameddir first-dir/subdir
12569aliasmodule -a first-dir/subdir/a
12570aliasnested -a first-dir/subdir/ssdir
12571topfiles -a first-dir/file1 first-dir/file2
12572world -a .
12573statusmod -s Mungeable
12574# Check for ability to block infinite loops.
12575infinitealias -a infinitealias
12576# Prior to 1.11.12 & 1.12.6, the infinite alias loop check didn't strip
12577# slashes or work if a module called a module which then called itself
12578# (A -> A was blocked, but not A -> B -> A or deeper).
12579infinitealias2 -a infinitealias2/
12580infinitealias3 -a infinitealias4/
12581infinitealias4 -a aliasmodule infinitealias5
12582infinitealias5 -a infinitealias3/
12583# Options must come before arguments.  It is possible this should
12584# be relaxed at some point (though the result would be bizarre for
12585# -a); for now test the current behavior.
12586bogusalias first-dir/subdir/a -a
12587EOF
12588	  dotest modules-148 "$testcvs ci -m 'add modules' CVSROOT/modules" \
12589"$CVSROOT_DIRNAME/CVSROOT/modules,v  <--  CVSROOT/modules
12590new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12591$SPROG commit: Rebuilding administrative file database"
12592
12593	  cd ..
12594	  # The "statusmod" module contains an error; trying to use it
12595	  # will produce "modules file missing directory" I think.
12596	  # However, that shouldn't affect the ability of "cvs co -c" or
12597	  # "cvs co -s" to do something reasonable with it.
12598	  dotest modules-148a0 "$testcvs co -c" \
12599'aliasmodule  -a first-dir/subdir/a
12600aliasnested  -a first-dir/subdir/ssdir
12601bogusalias   first-dir/subdir/a -a
12602dirmodule    first-dir/subdir
12603infinitealias -a infinitealias
12604infinitealias2 -a infinitealias2/
12605infinitealias3 -a infinitealias4/
12606infinitealias4 -a aliasmodule infinitealias5
12607infinitealias5 -a infinitealias3/
12608namedmodule  -d nameddir first-dir/subdir
12609realmodule   first-dir/subdir a
12610statusmod    -s Mungeable
12611topfiles     -a first-dir/file1 first-dir/file2
12612world        -a \.'
12613	  # There is code in modules.c:save_d which explicitly skips
12614	  # modules defined with -a, which is why aliasmodule is not
12615	  # listed.
12616	  dotest modules-148a1 "${testcvs} co -s" \
12617'statusmod    Mungeable
12618bogusalias   NONE        first-dir/subdir/a -a
12619dirmodule    NONE        first-dir/subdir
12620namedmodule  NONE        first-dir/subdir
12621realmodule   NONE        first-dir/subdir a'
12622
12623	  # Check that infinite loops are avoided
12624	  dotest modules-148a1.1 "${testcvs} co infinitealias" \
12625"$CPROG checkout: module \`infinitealias' in modules file contains infinite loop" \
12626"$SPROG server: module \`infinitealias' in modules file contains infinite loop
12627$SPROG checkout: module \`infinitealias' in modules file contains infinite loop"
12628	  # Prior to 1.11.12 & 1.12.6, the inifinte alias loop check did not
12629	  # strip slashes.
12630	  dotest modules-148a1.2 "${testcvs} co infinitealias2" \
12631"$CPROG checkout: module \`infinitealias2' in modules file contains infinite loop" \
12632"$SPROG server: module \`infinitealias2' in modules file contains infinite loop
12633$SPROG checkout: module \`infinitealias2' in modules file contains infinite loop"
12634	  # Prior to 1.11.12 & 1.12.6, the inifinte alias loop check did not
12635	  # notice when A -> B -> A, it only noticed A -> A.
12636	  dotest modules-148a1.3 "${testcvs} co infinitealias3/" \
12637"$CPROG checkout: module \`infinitealias3' in modules file contains infinite loop" \
12638"$SPROG server: module \`infinitealias3' in modules file contains infinite loop
12639$SPROG checkout: module \`infinitealias3' in modules file contains infinite loop"
12640
12641	  # Test that real modules check out to realmodule/a, not subdir/a.
12642	  dotest modules-149a1 "${testcvs} co realmodule" "U realmodule/a"
12643	  dotest modules-149a2 "test -d realmodule && test -f realmodule/a" ""
12644	  dotest_fail modules-149a3 "test -f realmodule/b" ""
12645	  dotest modules-149a4 "${testcvs} -q co realmodule" ""
12646	  dotest modules-149a5 "echo yes | ${testcvs} release -d realmodule" \
12647"You have \[0\] altered files in this repository\.
12648Are you sure you want to release (and delete) directory .realmodule.: "
12649
12650	  dotest_fail modules-149b1 "${testcvs} co realmodule/a" \
12651"${SPROG}"' checkout: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
12652"${SPROG}"' server: module `realmodule/a'\'' is a request for a file in a module which is not a directory
12653'"${CPROG}"' \[checkout aborted\]: cannot expand modules'
12654
12655	  # Now test the ability to check out a single file from a directory
12656	  dotest modules-150c "${testcvs} co dirmodule/a" "U dirmodule/a"
12657	  dotest modules-150d "test -d dirmodule && test -f dirmodule/a" ""
12658	  dotest_fail modules-150e "test -f dirmodule/b" ""
12659	  dotest modules-150f "echo yes | ${testcvs} release -d dirmodule" \
12660"You have \[0\] altered files in this repository\.
12661Are you sure you want to release (and delete) directory .dirmodule.: "
12662	  # Now test the ability to correctly reject a non-existent filename.
12663	  # For maximum studliness we would check that an error message is
12664	  # being output.
12665	  # We accept a zero exit status because it is what CVS does
12666	  # (Dec 95).  Probably the exit status should be nonzero,
12667	  # however.
12668	  dotest modules-150g1 "${testcvs} co dirmodule/nonexist" \
12669"${SPROG} checkout: warning: new-born \`dirmodule/nonexist' has disappeared"
12670	  # We tolerate the creation of the dirmodule directory, since that
12671	  # is what CVS does, not because we view that as preferable to not
12672	  # creating it.
12673	  dotest_fail modules-150g2 "test -f dirmodule/a || test -f dirmodule/b" ""
12674	  rm -r dirmodule
12675
12676	  # Now test that a module using -d checks out to the specified
12677	  # directory.
12678	  dotest modules-150h1 "${testcvs} -q co namedmodule" \
12679'U nameddir/a
12680U nameddir/b'
12681	  dotest modules-150h2 "test -f nameddir/a && test -f nameddir/b" ""
12682	  echo add line >>nameddir/a
12683	  dotest modules-150h3 "${testcvs} -q co namedmodule" 'M nameddir/a'
12684	  rm nameddir/a
12685	  dotest modules-150h4 "${testcvs} -q co namedmodule" 'U nameddir/a'
12686	  dotest modules-150h99 "echo yes | ${testcvs} release -d nameddir" \
12687"You have \[0\] altered files in this repository\.
12688Are you sure you want to release (and delete) directory .nameddir.: "
12689
12690	  # Now test that alias modules check out to subdir/a, not
12691	  # aliasmodule/a.
12692	  dotest modules-151 "${testcvs} co aliasmodule" ""
12693	  dotest_fail modules-152 "test -d aliasmodule" ""
12694	  echo abc >>first-dir/subdir/a
12695	  dotest modules-153 "${testcvs} -q co aliasmodule" "M first-dir/subdir/a"
12696
12697	  cd ..
12698	  rm -r 1
12699
12700	  mkdir 2
12701	  cd 2
12702	  dotest modules-155a0 "${testcvs} co aliasnested" \
12703"${SPROG} checkout: Updating first-dir/subdir/ssdir"
12704	  dotest modules-155a1 "test -d first-dir" ''
12705	  dotest modules-155a2 "test -d first-dir/subdir" ''
12706	  dotest modules-155a3 "test -d first-dir/subdir/ssdir" ''
12707	  # Test that nothing extraneous got created.
12708	  dotest modules-155a4 "ls" "first-dir" \
12709"CVS
12710first-dir"
12711	  cd ..
12712	  rm -r 2
12713
12714	  # Test checking out everything.
12715	  mkdir 1
12716	  cd 1
12717	  dotest modules-155b "${testcvs} -q co world" \
12718"U CVSROOT/${DOTSTAR}
12719U first-dir/subdir/a
12720U first-dir/subdir/b"
12721	  cd ..
12722	  rm -r 1
12723
12724	  # Test checking out a module which lists at least two
12725	  # specific files twice.  At one time, this failed over
12726	  # remote CVS.
12727	  mkdir 1
12728	  cd 1
12729	  dotest modules-155c1 "${testcvs} -q co first-dir" \
12730"U first-dir/subdir/a
12731U first-dir/subdir/b"
12732
12733	  cd first-dir
12734	  echo 'first revision' > file1
12735	  echo 'first revision' > file2
12736	  dotest modules-155c2 "${testcvs} add file1 file2" \
12737"${SPROG}"' add: scheduling file `file1'\'' for addition
12738'"${SPROG}"' add: scheduling file `file2'\'' for addition
12739'"${SPROG}"' add: use .'"${SPROG}"' commit. to add these files permanently'
12740	  dotest modules-155c3 "${testcvs} -q ci -m add-it" \
12741"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
12742initial revision: 1\.1
12743$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
12744initial revision: 1\.1"
12745
12746	  cd ..
12747	  rm -r first-dir
12748	  dotest modules-155c4 "${testcvs} -q co topfiles" \
12749"U first-dir/file1
12750U first-dir/file2"
12751	  dotest modules-155c5 "${testcvs} -q co topfiles" ""
12752
12753	  # Make sure the right thing happens if we remove a file.
12754	  cd first-dir
12755	  dotest modules-155c6 "${testcvs} -q rm -f file1" \
12756"${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
12757	  dotest modules-155c7 "${testcvs} -q ci -m remove-it" \
12758"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
12759new revision: delete; previous revision: 1\.1"
12760	  cd ..
12761	  rm -r first-dir
12762	  dotest modules-155c8 "${testcvs} -q co topfiles" \
12763"${SPROG} checkout: warning: \`first-dir/file1' is not (any longer) pertinent
12764U first-dir/file2"
12765
12766	  dokeep
12767	  cd ..
12768	  rm -r 1
12769	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
12770	  ;;
12771
12772
12773
12774	modules2)
12775	  # More tests of modules, in particular the & feature.
12776	  mkdir 1; cd 1
12777	  dotest modules2-setup-1 "${testcvs} -q co -l ." ''
12778	  mkdir first-dir second-dir third-dir
12779	  dotest modules2-setup-2 \
12780"${testcvs} add first-dir second-dir third-dir" \
12781"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
12782Directory ${CVSROOT_DIRNAME}/second-dir added to the repository
12783Directory ${CVSROOT_DIRNAME}/third-dir added to the repository"
12784	  cd third-dir
12785	  touch file3
12786	  dotest modules2-setup-3 "${testcvs} add file3" \
12787"${SPROG} add: scheduling file .file3. for addition
12788${SPROG} add: use .${SPROG} commit. to add this file permanently"
12789	  dotest modules2-setup-4 "${testcvs} -q ci -m add file3" \
12790"$CVSROOT_DIRNAME/third-dir/file3,v  <--  file3
12791initial revision: 1\.1"
12792	  cd ../..
12793	  rm -r 1
12794
12795	  mkdir 1
12796	  cd 1
12797
12798	  dotest modules2-1 "${testcvs} -q co CVSROOT/modules" \
12799'U CVSROOT/modules'
12800	  cd CVSROOT
12801	  cat >> modules << EOF
12802ampermodule &first-dir &second-dir
12803combmodule third-dir file3 &first-dir
12804ampdirmod -d newdir &first-dir &second-dir
12805badmod -d newdir
12806messymod first-dir &messymodchild
12807messymodchild -d sdir/child second-dir
12808EOF
12809	  # Depending on whether the user also ran the modules test
12810	  # we will be checking in revision 1.2 or 1.3.
12811	  dotest modules2-2 "${testcvs} -q ci -m add-modules" \
12812"$CVSROOT_DIRNAME/CVSROOT/modules,v  <--  modules
12813new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
12814$SPROG commit: Rebuilding administrative file database"
12815
12816	  cd ..
12817
12818	  dotest modules2-3 "${testcvs} -q co ampermodule" ''
12819	  dotest modules2-4 "test -d ampermodule/first-dir" ''
12820	  dotest modules2-5 "test -d ampermodule/second-dir" ''
12821
12822	  # Test ability of cvs release to handle multiple arguments
12823	  # See comment at "release" for list of other cvs release tests.
12824	  cd ampermodule
12825	  if ${testcvs} release -d first-dir second-dir <<EOF >>${LOGFILE}
12826yes
12827yes
12828EOF
12829	  then
12830	    pass modules2-6
12831	  else
12832	    fail modules2-6
12833	  fi
12834	  dotest_fail modules2-7 "test -d first-dir" ''
12835	  dotest_fail modules2-8 "test -d second-dir" ''
12836
12837	  cd ..
12838
12839	  # There used to be a nasty-hack that made CVS skip creation of the
12840	  # module dir (in this case ampermodule) when -n was specified
12841	  dotest modules2-ampermod-1 "${testcvs} -q co -n ampermodule" ''
12842	  dotest modules2-ampermod-2 "test -d ampermodule/first-dir" ''
12843	  dotest modules2-ampermod-3 "test -d ampermodule/second-dir" ''
12844
12845	  # Test release of a module
12846	  if echo yes |${testcvs} release -d ampermodule >>${LOGFILE}; then
12847	    pass modules2-ampermod-release-1
12848	  else
12849	    fail modules2-ampermod-release-1
12850	  fi
12851	  dotest_fail modules2-ampermod-release-2 "test -d ampermodule" ''
12852
12853	  # and the '-n' test again, but in conjunction with '-d'
12854	  dotest modules2-ampermod-4 "${testcvs} -q co -n -d newname ampermodule" ''
12855	  dotest modules2-ampermod-5 "test -d newname/first-dir" ''
12856	  dotest modules2-ampermod-6 "test -d newname/second-dir" ''
12857	  rm -rf newname
12858
12859	  # Now we create another directory named first-dir and make
12860	  # sure that CVS doesn't get them mixed up.
12861	  mkdir first-dir
12862	  # Note that this message should say "Updating ampermodule/first-dir"
12863	  # I suspect.  This is a long-standing behavior/bug....
12864	  dotest modules2-9 "${testcvs} co ampermodule" \
12865"${SPROG} checkout: Updating first-dir
12866${SPROG} checkout: Updating second-dir"
12867	  touch ampermodule/first-dir/amper1
12868	  cd ampermodule
12869	  dotest modules2-10 "${testcvs} add first-dir/amper1" \
12870"${SPROG} add: scheduling file .first-dir/amper1. for addition
12871${SPROG} add: use .${SPROG} commit. to add this file permanently"
12872	  cd ..
12873
12874	  # As with the "Updating xxx" message, the "U first-dir/amper1"
12875	  # message (instead of "U ampermodule/first-dir/amper1") is
12876	  # rather fishy.
12877	  dotest modules2-12 "${testcvs} co ampermodule" \
12878"${SPROG} checkout: Updating first-dir
12879A first-dir/amper1
12880${SPROG} checkout: Updating second-dir"
12881
12882	  if $remote; then
12883	    dotest modules2-13r "$testcvs -q ci -m add-it ampermodule" \
12884"$CVSROOT_DIRNAME/first-dir/amper1,v  <--  ampermodule/first-dir/amper1
12885initial revision: 1\.1"
12886	  else
12887	    # Trying this as above led to a "protocol error" message.
12888	    # Work around this bug.
12889	    cd ampermodule
12890	    dotest modules2-13 "$testcvs -q ci -m add-it" \
12891"$CVSROOT_DIRNAME/first-dir/amper1,v  <--  first-dir/amper1
12892initial revision: 1\.1"
12893	    cd ..
12894	  fi
12895	  cd ..
12896	  rm -r 1
12897
12898	  # Now test the "combmodule" module (combining regular modules
12899	  # and ampersand modules in the same module definition).
12900	  mkdir 1; cd 1
12901	  dotest modules2-14 "${testcvs} co combmodule" \
12902"U combmodule/file3
12903${SPROG} checkout: Updating first-dir
12904U first-dir/amper1"
12905	  dotest modules2-15 "test -f combmodule/file3" ""
12906	  dotest modules2-16 "test -f combmodule/first-dir/amper1" ""
12907	  cd combmodule
12908	  rm -r first-dir
12909	  # At least for now there is no way to tell CVS that
12910	  # some files/subdirectories come from one repository directory,
12911	  # and others from another.
12912	  # This seems like a pretty sensible behavior to me, in the
12913	  # sense that first-dir doesn't "really" exist within
12914	  # third-dir, so CVS just acts as if there is nothing there
12915	  # to do.
12916	  dotest modules2-17 "${testcvs} update -d" \
12917"${SPROG} update: Updating \."
12918
12919	  cd ..
12920	  dotest modules2-18 "${testcvs} -q co combmodule" \
12921"U first-dir/amper1"
12922	  dotest modules2-19 "test -f combmodule/first-dir/amper1" ""
12923	  cd ..
12924	  rm -r 1
12925
12926	  # Now test the "ampdirmod" and "badmod" modules to be sure that
12927	  # options work with ampersand modules but don't prevent the
12928	  # "missing directory" error message.
12929	  mkdir 1; cd 1
12930	  dotest modules2-20 "${testcvs} co ampdirmod" \
12931"${SPROG} checkout: Updating first-dir
12932U first-dir/amper1
12933${SPROG} checkout: Updating second-dir"
12934	  dotest modules2-21 "test -f newdir/first-dir/amper1" ""
12935	  dotest modules2-22 "test -d newdir/second-dir" ""
12936	  dotest_fail modules2-23 "${testcvs} co badmod" \
12937"${SPROG} checkout: modules file missing directory for module badmod" \
12938"${SPROG} server: modules file missing directory for module badmod
12939${CPROG} \[checkout aborted\]: cannot expand modules"
12940	  cd ..
12941	  rm -r 1
12942
12943	  # Confirm that a rename with added depth nested in an ampersand
12944	  # module works.
12945	  mkdir 1; cd 1
12946	  dotest modules2-nestedrename-1 "${testcvs} -q co messymod" \
12947"U messymod/amper1"
12948	  dotest modules2-nestedrename-2 "test -d messymod/sdir" ''
12949	  dotest modules2-nestedrename-3 "test -d messymod/sdir/CVS" ''
12950	  dotest modules2-nestedrename-4 "test -d messymod/sdir/child" ''
12951	  dotest modules2-nestedrename-5 "test -d messymod/sdir/child/CVS" ''
12952	  cd ..; rm -r 1
12953
12954	  # FIXME:  client/server has a bug.  It should be working like a local
12955	  # repository in this case, but fails to check out the second module
12956	  # in the list when a branch is specified.
12957	  mkdir 1; cd 1
12958	  dotest modules2-ampertag-setup-1 \
12959"${testcvs} -Q rtag tag first-dir second-dir third-dir" \
12960''
12961	  dotest modules2-ampertag-1 "${testcvs} -q co -rtag ampermodule" \
12962"U first-dir/amper1"
12963	  if $remote; then
12964	    dotest_fail modules2-ampertag-2 "test -d ampermodule/second-dir" ''
12965	    dotest_fail modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
12966	  else
12967	    dotest modules2-ampertag-2 "test -d ampermodule/second-dir" ''
12968	    dotest modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
12969	  fi
12970	  cd ..; rm -r 1
12971
12972	  # Test for tag files when an ampermod is renamed with more path
12973	  # elements than it started with.
12974	  #
12975	  # FIXME: This is currently broken in the remote case, possibly only
12976	  # because the messymodchild isn't being checked out at all.
12977	  mkdir 1; cd 1
12978#	  dotest modules2-tagfiles-setup-1 \
12979#"${testcvs} -Q rtag -b branch first-dir second-dir" \
12980#''
12981	  dotest modules2-tagfiles-1 "${testcvs} -q co -rtag messymod" \
12982"U messymod/amper1"
12983	  if $remote; then
12984	    dotest_fail modules2-tagfiles-2r "test -d messymod/sdir" ''
12985	  else
12986	    dotest modules2-tagfiles-2 "cat messymod/sdir/CVS/Tag" 'Ttag'
12987	  fi
12988	  cd ..; rm -r 1
12989
12990	  # Test that CVS gives an error if one combines -a with
12991	  # other options.
12992	  # Probably would be better to break this out into a separate
12993	  # test.  Although it is short, it shares no files/state with
12994	  # the rest of the modules2 tests.
12995	  mkdir 1; cd 1
12996	  dotest modules2-a0.5 "${testcvs} -q co CVSROOT/modules" \
12997'U CVSROOT/modules'
12998	  cd CVSROOT
12999	  echo 'aliasopt -a -d onedir first-dir' >modules
13000	  dotest modules2-a0 "${testcvs} -q ci -m add-modules" \
13001"$CVSROOT_DIRNAME/CVSROOT/modules,v  <--  modules
13002new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13003$SPROG commit: Rebuilding administrative file database"
13004	  cd ..
13005	  dotest_fail modules2-a1 "${testcvs} -q co aliasopt" \
13006"${SPROG} checkout: -a cannot be specified in the modules file along with other options" \
13007"${SPROG} server: -a cannot be specified in the modules file along with other options
13008${CPROG} \[checkout aborted\]: cannot expand modules"
13009	  cd ..;  rm -r 1
13010
13011	  # Clean up.
13012	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
13013			     $CVSROOT_DIRNAME/second-dir \
13014			     $CVSROOT_DIRNAME/third-dir
13015	  ;;
13016
13017
13018
13019	modules3)
13020	  # More tests of modules, in particular what happens if several
13021	  # modules point to the same file.
13022
13023	  # First just set up a directory first-dir and a file file1 in it.
13024	  mkdir 1; cd 1
13025
13026	  dotest modules3-0 "$testcvs -q co -l ."
13027	  mkdir first-dir
13028	  dotest modules3-1 "${testcvs} add first-dir" \
13029"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
13030
13031	  cd first-dir
13032	  echo file1 >file1
13033	  dotest modules3-2 "${testcvs} add file1" \
13034"${SPROG} add: scheduling file \`file1' for addition
13035${SPROG} add: use \`${SPROG} commit' to add this file permanently"
13036	  dotest modules3-3 "${testcvs} -q ci -m add-it" \
13037"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
13038initial revision: 1\.1"
13039	  cd ..
13040
13041	  dotest modules3-4 "${testcvs} -q update -d CVSROOT" \
13042"U CVSROOT${DOTSTAR}"
13043	  cd CVSROOT
13044	  cat >modules <<EOF
13045mod1 -a first-dir/file1
13046bigmod -a mod1 first-dir/file1
13047namednest -d src/sub/dir first-dir
13048nestdeeper -d src/sub1/sub2/sub3/dir first-dir
13049nestshallow -d src/dir second-dir/suba/subb
13050path/in/modules &mod1
13051another/path/test -d another/path/test first-dir
13052EOF
13053	  dotest modules3-5 "${testcvs} -q ci -m add-modules" \
13054"$CVSROOT_DIRNAME/CVSROOT/modules,v  <--  modules
13055new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13056$SPROG commit: Rebuilding administrative file database"
13057	  cd ..
13058
13059	  dotest modules3-6 "${testcvs} -q co bigmod" ''
13060	  rm -r first-dir
13061	  dotest modules3-7 "${testcvs} -q co bigmod" 'U first-dir/file1'
13062	  cd ..
13063	  rm -r 1
13064
13065	  mkdir 1; cd 1
13066	  mkdir suba
13067	  mkdir suba/subb
13068	  # This fails to work remote (it doesn't notice the directories,
13069	  # I suppose because they contain no files).  Bummer, especially
13070	  # considering this is a documented technique and everything.
13071	  dotest modules3-7a \
13072"${testcvs} import -m add-dirs second-dir tag1 tag2" \
13073"${SPROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/suba
13074${SPROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/suba/subb
13075
13076No conflicts created by this import" "
13077No conflicts created by this import"
13078	  cd ..; rm -r 1
13079	  mkdir 1; cd 1
13080	  dotest modules3-7b "${testcvs} co second-dir" \
13081"${SPROG} checkout: Updating second-dir
13082${SPROG} checkout: Updating second-dir/suba
13083${SPROG} checkout: Updating second-dir/suba/subb" \
13084"${SPROG} checkout: Updating second-dir"
13085
13086	  if $remote; then
13087	    cd second-dir
13088	    mkdir suba
13089	    dotest modules3-7-workaround1 "${testcvs} add suba" \
13090"Directory ${CVSROOT_DIRNAME}/second-dir/suba added to the repository"
13091	    cd suba
13092	    mkdir subb
13093	    dotest modules3-7-workaround2 "${testcvs} add subb" \
13094"Directory ${CVSROOT_DIRNAME}/second-dir/suba/subb added to the repository"
13095	    cd ../..
13096	  fi
13097
13098	  cd second-dir/suba/subb
13099	  touch fileb
13100	  dotest modules3-7c "${testcvs} add fileb" \
13101"${SPROG} add: scheduling file .fileb. for addition
13102${SPROG} add: use .${SPROG} commit. to add this file permanently"
13103	  dotest modules3-7d "${testcvs} -q ci -m add-it" \
13104"$CVSROOT_DIRNAME/second-dir/suba/subb/fileb,v  <--  fileb
13105initial revision: 1\.1"
13106	  cd ../../..
13107	  cd ..; rm -r 1
13108
13109	  mkdir 1
13110	  cd 1
13111	  dotest modules3-8 "${testcvs} -q co namednest" \
13112'U src/sub/dir/file1'
13113	  dotest modules3-9 "test -f src/sub/dir/file1" ''
13114	  cd ..
13115	  rm -r 1
13116
13117	  # Try the same thing, but with the directories nested even
13118	  # deeper (deeply enough so they are nested more deeply than
13119	  # the number of directories from / to ${TESTDIR}).
13120	  mkdir 1
13121	  cd 1
13122	  dotest modules3-10 "${testcvs} -q co nestdeeper" \
13123'U src/sub1/sub2/sub3/dir/file1'
13124	  dotest modules3-11 "test -f src/sub1/sub2/sub3/dir/file1" ''
13125
13126	  # While we are doing things like twisted uses of '/' (e.g.
13127	  # modules3-12), try this one.
13128	  if $remote; then
13129	    dotest_fail modules3-11b \
13130"${testcvs} -q update ${TESTDIR}/1/src/sub1/sub2/sub3/dir/file1" \
13131"absolute pathnames invalid for server (specified .${TESTDIR}/1/src/sub1/sub2/sub3/dir.)"
13132	  fi # end of remote-only tests
13133
13134	  cd ..
13135	  rm -r 1
13136
13137	  # This one is almost too twisted for words.  The pathname output
13138	  # in the message from "co" doesn't include the "path/in/modules",
13139	  # but those directories do get created (with no CVSADM except
13140	  # in "modules" which has a CVSNULLREPOS).
13141	  # I'm not sure anyone is relying on this nonsense or whether we
13142	  # need to keep doing it, but it is what CVS currently does...
13143	  # Skip it for remote; the remote code has the good sense to
13144	  # not deal with it (on the minus side it gives
13145	  # "internal error: repository string too short." (CVS 1.9) or
13146	  # "warning: server is not creating directories one at a time" (now)
13147	  # instead of a real error).
13148	  # I'm tempted to just make it a fatal error to have '/' in a
13149	  # module name.  But see comments at modules3-16.
13150	  if $remote; then :; else
13151	    mkdir 1; cd 1
13152	    dotest modules3-12 "${testcvs} -q co path/in/modules" \
13153"U first-dir/file1"
13154	    dotest modules3-13 "test -f path/in/modules/first-dir/file1" ''
13155	    cd ..; rm -r 1
13156	  fi # end of tests skipped for remote
13157
13158	  # Now here is where it used to get seriously bogus.
13159	  mkdir 1; cd 1
13160	  dotest modules3-14 \
13161"${testcvs} -q rtag tag1 path/in/modules" ''
13162	  # CVS used to create this even though rtag should *never* affect
13163	  # the directory current when it is called!
13164	  dotest_fail modules3-15 "test -d path/in/modules" ''
13165	  # Just for trivia's sake, rdiff was not similarly vulnerable
13166	  # because it passed 0 for run_module_prog to do_module.
13167	  cd ..; rm -r 1
13168
13169	  # Some people seem to want this to work.  I still suspect there
13170	  # are dark corners in slashes in module names.  This probably wants
13171	  # more thought before we start hacking on CVS (one way or the other)
13172	  # or documenting this.
13173	  mkdir 2; cd 2
13174	  dotest modules3-16 "${testcvs} -q co another/path/test" \
13175"U another/path/test/file1"
13176	  dotest modules3-17 "cat another/path/test/file1" 'file1'
13177
13178	  dokeep
13179	  cd ..; rm -r 2
13180	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
13181			     $CVSROOT_DIRNAME/second-dir
13182	  ;;
13183
13184
13185
13186	modules4)
13187	  # Some tests using the modules file with aliases that
13188	  # exclude particular directories.
13189
13190	  mkdir 1; cd 1
13191
13192	  dotest modules4-1 "${testcvs} -q co -l ." ''
13193	  mkdir first-dir
13194	  dotest modules4-2 "${testcvs} add first-dir" \
13195"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
13196
13197	  cd first-dir
13198          mkdir subdir subdir_long
13199          dotest modules4-3 "${testcvs} add subdir subdir_long" \
13200"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository
13201Directory ${CVSROOT_DIRNAME}/first-dir/subdir_long added to the repository"
13202
13203	  echo file1 > file1
13204	  dotest modules4-4 "${testcvs} add file1" \
13205"${SPROG}"' add: scheduling file `file1'\'' for addition
13206'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
13207
13208	  echo file2 > subdir/file2
13209	  dotest modules4-5 "${testcvs} add subdir/file2" \
13210"${SPROG}"' add: scheduling file `subdir/file2'\'' for addition
13211'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
13212
13213	  echo file3 > subdir_long/file3
13214	  dotest modules4-6 "${testcvs} add subdir_long/file3" \
13215"${SPROG}"' add: scheduling file `subdir_long/file3'\'' for addition
13216'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
13217
13218	  dotest modules4-7 "${testcvs} -q ci -m add-it" \
13219"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
13220initial revision: 1\.1
13221$CVSROOT_DIRNAME/first-dir/subdir/file2,v  <--  subdir/file2
13222initial revision: 1\.1
13223$CVSROOT_DIRNAME/first-dir/subdir_long/file3,v  <--  subdir_long/file3
13224initial revision: 1\.1"
13225
13226	  cd ..
13227
13228	  dotest modules4-8 "${testcvs} -q update -d CVSROOT" \
13229"U CVSROOT${DOTSTAR}"
13230	  cd CVSROOT
13231	  cat >modules <<EOF
13232all -a first-dir
13233some -a !first-dir/subdir first-dir
13234other -a !first-dir/subdir !first-dir/subdir_long first-dir
13235somewhat -a first-dir !first-dir/subdir
13236EOF
13237	  dotest modules4-9 "${testcvs} -q ci -m add-modules" \
13238"$CVSROOT_DIRNAME/CVSROOT/modules,v  <--  modules
13239new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13240$SPROG commit: Rebuilding administrative file database"
13241	  cd ..
13242
13243	  cd ..
13244	  mkdir 2; cd 2
13245
13246	  dotest modules4-10 "${testcvs} -q co all" \
13247"U first-dir/file1
13248U first-dir/subdir/file2
13249U first-dir/subdir_long/file3"
13250	  rm -r first-dir
13251
13252	  dotest modules4-11 "${testcvs} -q co some" \
13253"U first-dir/file1
13254U first-dir/subdir_long/file3"
13255	  dotest_fail modules4-12 "test -d first-dir/subdir" ''
13256	  dotest modules4-13 "test -d first-dir/subdir_long" ''
13257	  rm -r first-dir
13258
13259	  if $remote; then
13260	    # But remote seems to do it the other way.
13261	    dotest modules4-14r-1 "${testcvs} -q co somewhat" \
13262"U first-dir/file1
13263U first-dir/subdir_long/file3"
13264	    dotest_fail modules4-14r-2 "test -d first-dir/subdir" ''
13265	    dotest modules4-14r-3 "test -d first-dir/subdir_long" ''
13266	  else
13267	    # This is strange behavior, in that the order of the
13268	    # "!first-dir/subdir" and "first-dir" matter, and it isn't
13269	    # clear that they should.  I suspect it is long-standing
13270	    # strange behavior but I haven't verified that.
13271	    dotest modules4-14-1 "${testcvs} -q co somewhat" \
13272"U first-dir/file1
13273U first-dir/subdir/file2
13274U first-dir/subdir_long/file3"
13275	    dotest modules4-14-2 "test -d first-dir/subdir" ''
13276	    dotest modules4-14-3 "test -d first-dir/subdir_long" ''
13277	  fi
13278	  rm -r first-dir
13279
13280	  dotest modules4-15 "${testcvs} -q co other" \
13281"U first-dir/file1"
13282	  dotest_fail modules4-16 "test -d first-dir/subdir" ''
13283	  dotest_fail modules4-17 "test -d first-dir/subdir_long" ''
13284	  rm -r first-dir
13285
13286	  cd ..
13287	  rm -r 2
13288
13289	  dotest modules4-18 "${testcvs} rtag tag some" \
13290"${SPROG} rtag: Tagging first-dir
13291${SPROG} rtag: Ignoring first-dir/subdir
13292${SPROG} rtag: Tagging first-dir/subdir_long"
13293
13294	  cd 1/first-dir/subdir
13295	  dotest modules4-19 "${testcvs} log file2" "
13296RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
13297Working file: file2
13298head: 1\.1
13299branch:
13300locks: strict
13301access list:
13302symbolic names:
13303keyword substitution: kv
13304total revisions: 1;	selected revisions: 1
13305description:
13306----------------------------
13307revision 1\.1
13308date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
13309add-it
13310============================================================================="
13311
13312	  dokeep
13313	  cd ../../..
13314	  rm -r 1
13315	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
13316	  ;;
13317
13318
13319
13320	modules5)
13321	  # Test module programs
13322
13323	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
13324	  mkdir 1
13325	  cd 1
13326	  dotest modules5-1 "$testcvs -q co first-dir"
13327	  cd first-dir
13328	  mkdir subdir
13329	  dotest modules5-2 "${testcvs} add subdir" \
13330"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
13331	  cd subdir
13332	  mkdir ssdir
13333	  dotest modules5-3 "${testcvs} add ssdir" \
13334"Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
13335	  touch a b
13336	  dotest modules5-4 "${testcvs} add a b" \
13337"${SPROG} add: scheduling file .a. for addition
13338${SPROG} add: scheduling file .b. for addition
13339${SPROG} add: use .${SPROG} commit. to add these files permanently"
13340
13341	  dotest modules5-5 "${testcvs} ci -m added" \
13342"${CPROG} commit: Examining .
13343${CPROG} commit: Examining ssdir
13344${CVSROOT_DIRNAME}/first-dir/subdir/a,v  <--  a
13345initial revision: 1\.1
13346${CVSROOT_DIRNAME}/first-dir/subdir/b,v  <--  b
13347initial revision: 1\.1"
13348
13349	  cd ..
13350	  dotest modules5-6 "${testcvs} -q co CVSROOT" \
13351"U CVSROOT/access
13352U CVSROOT/aclconfig
13353U CVSROOT/checkoutlist
13354U CVSROOT/commitinfo
13355U CVSROOT/config
13356U CVSROOT/cvswrappers
13357U CVSROOT/group
13358U CVSROOT/loginfo
13359U CVSROOT/modules
13360U CVSROOT/notify
13361U CVSROOT/postadmin
13362U CVSROOT/postproxy
13363U CVSROOT/posttag
13364U CVSROOT/postwatch
13365U CVSROOT/preproxy
13366U CVSROOT/rcsinfo
13367U CVSROOT/taginfo
13368U CVSROOT/verifymsg"
13369
13370	  # FIXCVS: The sleep in the following script helps avoid out of
13371	  # order messages, but we really need to figure out how to fix
13372	  # cvs to prevent them in the first place.
13373	  for i in checkout export tag; do
13374	    cat >> ${CVSROOT_DIRNAME}/$i.sh <<EOF
13375#! $TESTSHELL
13376sleep 1
13377echo "$i script invoked in \`pwd\`"
13378echo "args: \$@"
13379EOF
13380	    # Cygwin doesn't set premissions correctly over the Samba share.
13381	    if test -n "$remotehost"; then
13382	      $CVS_RSH $remotehost "chmod +x ${CVSROOT_DIRNAME}/$i.sh"
13383	    else
13384	      chmod +x ${CVSROOT_DIRNAME}/$i.sh
13385	    fi
13386	  done
13387
13388	  OPTS="-o${CVSROOT_DIRNAME}/checkout.sh -e ${CVSROOT_DIRNAME}/export.sh -t${CVSROOT_DIRNAME}/tag.sh"
13389	  cat >CVSROOT/modules <<EOF
13390realmodule ${OPTS} first-dir/subdir a
13391dirmodule ${OPTS} first-dir/subdir
13392namedmodule -d nameddir ${OPTS} first-dir/subdir
13393EOF
13394
13395	  dotest modules5-7 "$testcvs -Q ci -m 'add modules' CVSROOT/modules"
13396
13397	  cd ..
13398	  rm -rf first-dir
13399
13400	  # Test that real modules check out to realmodule/a, not subdir/a.
13401	  if $remote; then
13402	    # FIXCVS?
13403	    # Mac OSX 10.3 (Darwin ppc-osx1 5.5) fails here when $TMPDIR
13404	    # contains a symlink (it does not fail the local modules5-8).
13405	    # Since no other platforms are exhibiting the same problem, I
13406	    # suspect an issue with OSX and fork() or the like dereferencing
13407	    # the symlink, but it is possible it is something that could be
13408	    # fixed or worked around in CVS.
13409	    dotest modules5-8r "$testcvs co realmodule" \
13410"U realmodule/a
13411${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
13412checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13413args: realmodule"
13414	  else
13415	    dotest modules5-8 "${testcvs} co realmodule" \
13416"U realmodule/a
13417${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
13418checkout script invoked in ${TESTDIR}/1
13419args: realmodule"
13420	  fi
13421	  dotest modules5-9 "test -d realmodule && test -f realmodule/a" ""
13422	  dotest_fail modules5-10 "test -f realmodule/b" ""
13423	  if $remote; then
13424	    dotest modules5-11 "${testcvs} -q co realmodule" \
13425"checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13426args: realmodule"
13427	    dotest modules5-12 "${testcvs} -q update" ''
13428	    echo "change" >>realmodule/a
13429	    dotest modules5-13 "${testcvs} -q ci -m." \
13430"$CVSROOT_DIRNAME/first-dir/subdir/a,v  <--  realmodule/a
13431new revision: 1\.2; previous revision: 1\.1"
13432	  else
13433	    dotest modules5-11 "${testcvs} -q co realmodule" \
13434"checkout script invoked in ${TESTDIR}/1
13435args: realmodule"
13436	    dotest modules5-12 "${testcvs} -q update" ''
13437	    echo "change" >>realmodule/a
13438	    dotest modules5-13 "${testcvs} -q ci -m." \
13439"$CVSROOT_DIRNAME/first-dir/subdir/a,v  <--  realmodule/a
13440new revision: 1\.2; previous revision: 1\.1"
13441	  fi
13442	  dotest modules5-14 "echo yes | ${testcvs} release -d realmodule" \
13443"You have \[0\] altered files in this repository\.
13444Are you sure you want to release (and delete) directory .realmodule.: "
13445	  dotest modules5-15 "${testcvs} -q rtag -Dnow MYTAG realmodule" \
13446"tag script invoked in ${TESTDIR}/1
13447args: realmodule MYTAG" \
13448"tag script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13449args: realmodule MYTAG"
13450	  if $remote; then
13451	    dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
13452"U realmodule/a
13453export script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13454args: realmodule"
13455	  else
13456	    dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
13457"U realmodule/a
13458export script invoked in ${TESTDIR}/1
13459args: realmodule"
13460	  fi
13461	  rm -r realmodule
13462
13463	  dotest_fail modules5-17 "${testcvs} co realmodule/a" \
13464"${SPROG}"' checkout: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
13465"${SPROG}"' server: module `realmodule/a'\'' is a request for a file in a module which is not a directory
13466'"${CPROG}"' \[checkout aborted\]: cannot expand modules'
13467
13468	  # Now test the ability to check out a single file from a directory
13469	  if $remote; then
13470	    dotest modules5-18 "${testcvs} co dirmodule/a" \
13471"U dirmodule/a
13472${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
13473checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13474args: dirmodule"
13475	  else
13476	    dotest modules5-18 "${testcvs} co dirmodule/a" \
13477"U dirmodule/a
13478${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
13479checkout script invoked in ${TESTDIR}/1
13480args: dirmodule"
13481	  fi
13482	  dotest modules5-19 "test -d dirmodule && test -f dirmodule/a" ""
13483	  dotest_fail modules5-20 "test -f dirmodule/b" ""
13484	  dotest modules5-21 "echo yes | ${testcvs} release -d dirmodule" \
13485"You have \[0\] altered files in this repository\.
13486Are you sure you want to release (and delete) directory .dirmodule.: "
13487
13488	  # Now test the ability to correctly reject a non-existent filename.
13489	  # For maximum studliness we would check that an error message is
13490	  # being output.
13491	  # We accept a zero exit status because it is what CVS does
13492	  # (Dec 95).  Probably the exit status should be nonzero,
13493	  # however.
13494	  if $remote; then
13495	    dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
13496"${SPROG} checkout: warning: new-born \`dirmodule/nonexist' has disappeared
13497${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
13498checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13499args: dirmodule"
13500	  else
13501	    dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
13502"${SPROG} checkout: warning: new-born \`dirmodule/nonexist' has disappeared
13503${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
13504checkout script invoked in ${TESTDIR}/1
13505args: dirmodule"
13506	  fi
13507	  # We tolerate the creation of the dirmodule directory, since that
13508	  # is what CVS does, not because we view that as preferable to not
13509	  # creating it.
13510	  dotest_fail modules5-23 "test -f dirmodule/a || test -f dirmodule/b" ""
13511	  rm -r dirmodule
13512
13513	  # Now test that a module using -d checks out to the specified
13514	  # directory.
13515	  if $remote; then
13516	    dotest modules5-24 "${testcvs} -q co namedmodule" \
13517"U nameddir/a
13518U nameddir/b
13519checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13520args: nameddir"
13521	  else
13522	    dotest modules5-24 "${testcvs} -q co namedmodule" \
13523"U nameddir/a
13524U nameddir/b
13525checkout script invoked in ${TESTDIR}/1
13526args: nameddir"
13527	  fi
13528	  dotest modules5-25 "test -f nameddir/a && test -f nameddir/b" ""
13529	  echo add line >>nameddir/a
13530	  # This seems suspicious: when we checkout an existing directory,
13531	  # the checkout script gets executed in addition to the update
13532	  # script.  Is that by design or accident?
13533	  if $remote; then
13534	    dotest modules5-26 "${testcvs} -q co namedmodule" \
13535"M nameddir/a
13536checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13537args: nameddir"
13538	  else
13539	    dotest modules5-26 "${testcvs} -q co namedmodule" \
13540"M nameddir/a
13541checkout script invoked in ${TESTDIR}/1
13542args: nameddir"
13543	  fi
13544	  rm nameddir/a
13545
13546	  if $remote; then
13547	    dotest modules5-27 "${testcvs} -q co namedmodule" \
13548"U nameddir/a
13549checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13550args: nameddir"
13551	  else
13552	    dotest modules5-27 "${testcvs} -q co namedmodule" \
13553"U nameddir/a
13554checkout script invoked in ${TESTDIR}/1
13555args: nameddir"
13556	  fi
13557	  dotest modules5-28 "echo yes | ${testcvs} release -d nameddir" \
13558"You have \[0\] altered files in this repository\.
13559Are you sure you want to release (and delete) directory .nameddir.: "
13560
13561	  # Now try the same tests with -d on command line
13562	  # FIXCVS?  The manual says the modules programs get the module name,
13563	  # but they really get the directory name.
13564	  if $remote; then
13565	    dotest modules5-29 "${testcvs} co -d mydir realmodule" \
13566"U mydir/a
13567${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13568checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13569args: mydir"
13570	  else
13571	    dotest modules5-29 "${testcvs} co -d mydir realmodule" \
13572"U mydir/a
13573${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13574checkout script invoked in ${TESTDIR}/1
13575args: mydir"
13576	  fi
13577	  dotest modules5-30 "test -d mydir && test -f mydir/a" ""
13578	  dotest_fail modules5-31 "test -d realmodule || test -f mydir/b" ""
13579	  if $remote; then
13580	    dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \
13581"checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13582args: mydir"
13583	    dotest modules5-33 "${testcvs} -q update" ''
13584	    echo "change" >>mydir/a
13585	    dotest modules5-34 "${testcvs} -q ci -m." \
13586"$CVSROOT_DIRNAME/first-dir/subdir/a,v  <--  mydir/a
13587new revision: 1\.3; previous revision: 1\.2"
13588	  else
13589	    dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \
13590"checkout script invoked in ${TESTDIR}/1
13591args: mydir"
13592	    dotest modules5-33 "${testcvs} -q update" ''
13593	    echo "change" >>mydir/a
13594	    dotest modules5-34 "${testcvs} -q ci -m." \
13595"$CVSROOT_DIRNAME/first-dir/subdir/a,v  <--  mydir/a
13596new revision: 1\.3; previous revision: 1\.2"
13597	  fi
13598	  dotest modules5-35 "echo yes | ${testcvs} release -d mydir" \
13599"You have \[0\] altered files in this repository\.
13600Are you sure you want to release (and delete) directory .mydir.: "
13601	  if $remote; then
13602	    dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \
13603"tag script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13604args: realmodule MYTAG2"
13605	    dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \
13606"U mydir/a
13607export script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13608args: mydir"
13609	  else
13610	    dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \
13611"tag script invoked in ${TESTDIR}/1
13612args: realmodule MYTAG2"
13613	    dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \
13614"U mydir/a
13615export script invoked in ${TESTDIR}/1
13616args: mydir"
13617	  fi
13618	  rm -r mydir
13619
13620	  # Now test the ability to check out a single file from a directory
13621	  if $remote; then
13622	    dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \
13623"U mydir/a
13624${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13625checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13626args: mydir"
13627	  else
13628	    dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \
13629"U mydir/a
13630${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13631checkout script invoked in ${TESTDIR}/1
13632args: mydir"
13633	  fi
13634	  dotest modules5-39 "test -d mydir && test -f mydir/a" ""
13635	  dotest_fail modules5-40 "test -d dirmodule || test -f mydir/b" ""
13636	  dotest modules5-41 "echo yes | ${testcvs} release -d mydir" \
13637"You have \[0\] altered files in this repository\.
13638Are you sure you want to release (and delete) directory .mydir.: "
13639
13640	  # Now test the ability to correctly reject a non-existent filename.
13641	  # For maximum studliness we would check that an error message is
13642	  # being output.
13643	  # We accept a zero exit status because it is what CVS does
13644	  # (Dec 95).  Probably the exit status should be nonzero,
13645	  # however.
13646	  if $remote; then
13647	    dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \
13648"${SPROG} checkout: warning: new-born \`mydir/nonexist' has disappeared
13649${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13650checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13651args: mydir"
13652	  else
13653	    dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \
13654"${SPROG} checkout: warning: new-born \`mydir/nonexist' has disappeared
13655${SPROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
13656checkout script invoked in ${TESTDIR}/1
13657args: mydir"
13658	  fi
13659	  # We tolerate the creation of the mydir directory, since that
13660	  # is what CVS does, not because we view that as preferable to not
13661	  # creating it.
13662	  dotest_fail modules5-43 "test -f mydir/a || test -f mydir/b" ""
13663	  rm -r mydir
13664
13665	  if $remote; then
13666	    dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \
13667"U mydir/a
13668U mydir/b
13669checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13670args: mydir"
13671	  else
13672	    dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \
13673"U mydir/a
13674U mydir/b
13675checkout script invoked in ${TESTDIR}/1
13676args: mydir"
13677	  fi
13678	  dotest modules5-45 "test -f mydir/a && test -f mydir/b" ""
13679	  dotest_fail modules5-46 "test -d namedir"
13680	  echo add line >>mydir/a
13681	  # This seems suspicious: when we checkout an existing directory,
13682	  # the checkout script gets executed in addition to the update
13683	  # script.  Is that by design or accident?
13684	  if $remote; then
13685	    dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \
13686"M mydir/a
13687checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13688args: mydir"
13689	  else
13690	    dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \
13691"M mydir/a
13692checkout script invoked in ${TESTDIR}/1
13693args: mydir"
13694	  fi
13695	  rm mydir/a
13696
13697	  if $remote; then
13698	    dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \
13699"U mydir/a
13700checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
13701args: mydir"
13702	  else
13703	    dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \
13704"U mydir/a
13705checkout script invoked in ${TESTDIR}/1
13706args: mydir"
13707	  fi
13708	  dotest modules5-49 "echo yes | ${testcvs} release -d mydir" \
13709"You have \[0\] altered files in this repository\.
13710Are you sure you want to release (and delete) directory .mydir.: "
13711
13712	  dokeep
13713	  cd ..
13714	  rm -r 1
13715	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
13716			     $CVSROOT_DIRNAME/*.sh
13717	  ;;
13718
13719
13720
13721	modules6)
13722	  #
13723	  # Test invalid module definitions
13724	  #
13725	  # See the header comment for the `modules' test for an index of
13726	  # the complete suite of modules tests.
13727	  #
13728
13729	  #
13730	  # There was a bug in CVS through 1.11.1p1 where a bad module name
13731	  # would cause the previous line to be parsed as the module
13732	  # definition.  This test proves this doesn't happen anymore.
13733	  #
13734	  mkdir modules6
13735	  cd modules6
13736	  dotest module6-setup-1 "${testcvs} -Q co CVSROOT" ""
13737	  cd CVSROOT
13738	  echo "longmodulename who cares" >modules
13739	  echo "badname" >>modules
13740	  # This test almost isn't setup since it generates the error message
13741	  # we are looking for if `-Q' isn't specified, but I want to test the
13742	  # filename in the message later.
13743	  dotest modules6-setup-2 "$testcvs -Q ci -mbad-modules"
13744
13745	  # Here's where CVS would report not being able to find `lename'
13746	  cd ..
13747	  dotest_fail modules6-1 "${testcvs} -q co badname" \
13748"${SPROG} checkout: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules.
13749${SPROG} checkout: cannot find module .badname. - ignored" \
13750"${SPROG} server: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules.
13751${SPROG} server: cannot find module .badname. - ignored
13752${CPROG} \[checkout aborted\]: cannot expand modules"
13753
13754	  dokeep
13755	  restore_adm
13756	  cd ..
13757	  rm -r modules6
13758	  ;;
13759
13760
13761
13762	modules7)
13763	  #
13764	  # Test tag problems vs an empty CVSROOT/val-tags file
13765	  #
13766	  # See the header comment for the `modules' test for an index of
13767	  # the complete suite of modules tests.
13768	  #
13769	  mkdir modules7
13770	  cd modules7
13771	  dotest modules7-1 "$testcvs -Q co -d top ."
13772	  cd top
13773	  mkdir zero one
13774	  dotest modules7-2 "$testcvs -Q add zero one"
13775	  cd one
13776	  echo 'file1 contents' > file1
13777	  dotest modules7-2 "$testcvs -Q add file1"
13778	  dotest modules7-3 "$testcvs -Q ci -mnew file1"
13779	  dotest modules7-4 "$testcvs -Q tag mytag file1"
13780	  cd ../CVSROOT
13781	  echo 'all -a zero one' > modules
13782	  dotest modules7-5 "$testcvs -Q ci -mall-module"
13783	  cd ../..
13784	  mkdir myexport
13785	  cd myexport
13786
13787	  # This failed prior to CVS version 1.12.10.
13788	  dotest modules7-7 "$testcvs export -rmytag all" \
13789"$SPROG export: Updating zero
13790$SPROG export: Updating one
13791U one/file1"
13792	  dotest modules7-8 'cat one/file1' 'file1 contents'
13793
13794	  dokeep
13795
13796	  # cleanup
13797	  restore_adm
13798	  cd ../..
13799	  rm -fr modules7
13800	  rm -rf $CVSROOT_DIRNAME/zero $CVSROOT_DIRNAME/one
13801	  ;;
13802
13803
13804
13805	mkmodules)
13806	  # When a file listed in checkoutlist doesn't exist, cvs-1.10.4
13807	  # would fail to remove the CVSROOT/.#[0-9]* temporary file it
13808	  # creates while mkmodules is in the process of trying to check
13809	  # out the missing file.
13810
13811	  mkdir 1; cd 1
13812	  dotest mkmodules-temp-file-removal-1 "${testcvs} -Q co CVSROOT" ''
13813	  cd CVSROOT
13814	  echo no-such-file >> checkoutlist
13815	  dotest mkmodules-temp-file-removal-2 "$testcvs -Q ci -m. checkoutlist"
13816
13817	  dotest mkmodules-temp-file-removal-3 \
13818"echo $CVSROOT_DIRNAME/CVSROOT/.#[0-9]*" \
13819"$CVSROOT_DIRNAME/CVSROOT/\.#\[0-9\]\*"
13820
13821	  # Versions 1.11.6 & 1.12.1 and earlier of CVS printed most of the
13822	  # white space included before error messages in checkoutlist.
13823	  echo "no-such-file     Failed to update no-such-file." >checkoutlist
13824	  dotest mkmodules-error-message-1 "$testcvs -Q ci -m. checkoutlist" \
13825"$SPROG commit: Failed to update no-such-file\."
13826
13827	  # Versions 1.11.6 & 1.12.1 and earlier of CVS used the error string
13828	  # from the checkoutlist file as the format string passed to error()'s
13829	  # printf.  Check that this is no longer the case by verifying that
13830	  # printf format patterns remain unchanged.
13831	  echo "no-such-file     Failed to update %s %lx times because %s happened %d times." >checkoutlist
13832	  dotest mkmodules-error-message-2 "$testcvs -Q ci -m. checkoutlist" \
13833"$SPROG commit: Failed to update %s %lx times because %s happened %d times\."
13834
13835	  dotest mkmodules-cleanup-1 \
13836"$testcvs -Q up -pr1.1 checkoutlist >checkoutlist"
13837	  dotest mkmodules-cleanup-2 "$testcvs -Q ci -m. checkoutlist"
13838
13839	  dokeep
13840	  cd ../..
13841	  rm -r 1
13842	  ;;
13843
13844
13845
13846	co-d)
13847	  # Some tests of various permutations of co-d when directories exist
13848	  # and checkouts lengthen.
13849	  #
13850	  # Interestingly enough, these same tests pass when the directory
13851	  # lengthening happens via the modules file.  Go figure.
13852	  module=co-d
13853	  mkdir $module; cd $module
13854	  mkdir top; cd top
13855	  dotest co-d-init-1 "$testcvs -Q co -l ."
13856	  mkdir $module
13857	  dotest co-d-init-2 "$testcvs -Q add $module"
13858	  cd $module
13859	  echo content >file1
13860	  echo different content >file2
13861	  dotest co-d-init-3 "$testcvs -Q add file1 file2"
13862	  dotest co-d-init-4 "$testcvs -Q ci -madd-em"
13863	  cd ../..
13864
13865	  mkdir 2; cd 2
13866	  dotest co-d-1 "$testcvs -q co -d dir $module" \
13867"U dir/file1
13868U dir/file2"
13869	  dotest co-d-1.2 "cat dir/CVS/Repository" "$module"
13870
13871	  dotest co-d-2 "$testcvs -q co -d dir2/sdir $module" \
13872"U dir2/sdir/file1
13873U dir2/sdir/file2"
13874	  dotest co-d-2.2 "cat dir2/CVS/Repository" "."
13875	  dotest co-d-2.3 "cat dir2/sdir/CVS/Repository" "$module"
13876
13877	  dotest co-d-2.4 "$testcvs -q co -d dir2.4/sdir/sdir2 $module" \
13878"U dir2.4/sdir/sdir2/file1
13879U dir2.4/sdir/sdir2/file2"
13880	  dotest co-d-2.4.2 "cat dir2.4/CVS/Repository" "CVSROOT/Emptydir"
13881	  dotest co-d-2.4.3 "cat dir2.4/sdir/CVS/Repository" "."
13882	  dotest co-d-2.4.3 "cat dir2.4/sdir/sdir2/CVS/Repository" "$module"
13883
13884	  mkdir dir3
13885	  dotest co-d-3 "$testcvs -q co -d dir3 $module" \
13886"U dir3/file1
13887U dir3/file2"
13888	  dotest co-d-3.2 "cat dir3/CVS/Repository" "$module"
13889
13890	  mkdir dir4
13891	  dotest co-d-4 "$testcvs -q co -d dir4/sdir $module" \
13892"U dir4/sdir/file1
13893U dir4/sdir/file2"
13894
13895	  # CVS is only supposed to create administration directories in
13896	  # directories it also creates, and in the directory specified by
13897	  # the last portion of the path passed to -d regardless.  This is
13898	  #
13899	  # FIXCVS:
13900	  # This is broken in client/server mode because the server does not
13901	  # know the client's directory structure and has to create
13902	  # everything.
13903	  if $remote; then
13904	    dotest co-d-4.2r "cat dir4/CVS/Repository" "."
13905	  else
13906	    dotest_fail co-d-4.2 "test -d dir4/CVS"
13907	  fi
13908
13909	  dotest co-d-4.3 "cat dir4/sdir/CVS/Repository" "$module"
13910
13911	  mkdir dir5
13912	  mkdir dir5/sdir
13913	  dotest co-d-5 "$testcvs -q co -d dir5/sdir $module" \
13914"U dir5/sdir/file1
13915U dir5/sdir/file2"
13916	    # FIXCVS as for co-d-4.2r.
13917	  if $remote; then
13918	    dotest co-d-5.2 "cat dir5/CVS/Repository" "."
13919	  else
13920	    dotest_fail co-d-5.2 "test -d dir5/CVS"
13921	  fi
13922
13923	  dotest co-d-5.3 "cat dir5/sdir/CVS/Repository" "$module"
13924
13925	  # clean up
13926	  dokeep
13927	  cd ../..
13928	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
13929	  rm -r $module
13930	  ;;
13931
13932
13933
13934	cvsadm)
13935	  # These test check the content of CVS' administrative
13936	  # files as they are checked out in various configurations.
13937	  # (As a side note, I'm not using the "-q" flag in any of
13938	  # this code, which should provide some extra checking for
13939          # those messages which don't seem to be checked thoroughly
13940	  # anywhere else.)  To do a thorough test, we need to make
13941	  # a bunch of modules in various configurations.
13942	  #
13943	  # <1mod> is a directory at the top level of cvsroot
13944	  #    ``foo bar''
13945	  # <2mod> is a directory at the second level of cvsroot
13946	  #    ``foo bar/baz''
13947	  # <1d1mod> is a directory at the top level which is
13948	  #   checked out into another directory
13949	  #     ``foo -d bar baz''
13950	  # <1d2mod> is a directory at the second level which is
13951	  #   checked out into another directory
13952	  #     ``foo -d bar baz/quux''
13953	  # <2d1mod> is a directory at the top level which is
13954	  #   checked out into a directory that is two deep
13955	  #     ``foo -d bar/baz quux''
13956	  # <2d2mod> is a directory at the second level which is
13957	  #   checked out into a directory that is two deep
13958	  #     ``foo -d bar/baz quux''
13959	  #
13960	  # The tests do each of these types separately and in twos.
13961	  # We also repeat each test -d flag for 1-deep and 2-deep
13962	  # directories.
13963	  #
13964	  # Each test should check the output for the Repository
13965	  # file, since that is the one which varies depending on
13966	  # the directory and how it was checked out.
13967	  #
13968	  # Yes, this is verbose, but at least it's very thorough.
13969
13970	  # convenience variables
13971	  REP=${CVSROOT}
13972
13973	  # First, set TopLevelAdmin=yes so we're sure to get
13974	  # top-level CVS directories.
13975	  mkdir 1; cd 1
13976	  dotest cvsadm-setup-1 "${testcvs} -q co CVSROOT/config" \
13977"U CVSROOT/config"
13978	  cd CVSROOT
13979	  echo "TopLevelAdmin=yes" >>config
13980	  dotest cvsadm-setup-2 "${testcvs} -q ci -m yes-top-level" \
13981"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
13982new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
13983$SPROG commit: Rebuilding administrative file database"
13984	  cd ../..
13985	  rm -r 1
13986
13987	  # Second, check out the modules file and edit it.
13988	  mkdir 1; cd 1
13989	  dotest cvsadm-1 "${testcvs} co CVSROOT/modules" \
13990"U CVSROOT/modules"
13991
13992	  # Test CVS/Root once.  Since there is only one part of
13993	  # the code which writes CVS/Root files (Create_Admin),
13994	  # there is no point in testing this every time.
13995	  dotest cvsadm-1a "cat CVS/Root" ${REP}
13996	  dotest cvsadm-1b "cat CVS/Repository" "\."
13997	  dotest cvsadm-1c "cat CVSROOT/CVS/Root" ${REP}
13998	  dotest cvsadm-1d "cat CVSROOT/CVS/Repository" "CVSROOT"
13999          # All of the defined module names begin with a number.
14000	  # All of the top-level directory names begin with "dir".
14001	  # All of the subdirectory names begin with "sub".
14002	  # All of the top-level modules begin with "mod".
14003	  echo "# Module defs for cvsadm tests" > CVSROOT/modules
14004	  echo "1mod mod1" >> CVSROOT/modules
14005	  echo "1mod-2 mod1-2" >> CVSROOT/modules
14006	  echo "2mod mod2/sub2" >> CVSROOT/modules
14007	  echo "2mod-2 mod2-2/sub2-2" >> CVSROOT/modules
14008	  echo "1d1mod -d dir1d1 mod1" >> CVSROOT/modules
14009	  echo "1d1mod-2 -d dir1d1-2 mod1-2" >> CVSROOT/modules
14010	  echo "1d2mod -d dir1d2 mod2/sub2" >> CVSROOT/modules
14011	  echo "1d2mod-2 -d dir1d2-2 mod2-2/sub2-2" >> CVSROOT/modules
14012	  echo "2d1mod -d dir2d1/sub2d1 mod1" >> CVSROOT/modules
14013	  echo "2d1mod-2 -d dir2d1-2/sub2d1-2 mod1-2" >> CVSROOT/modules
14014	  echo "2d2mod -d dir2d2/sub2d2 mod2/sub2" >> CVSROOT/modules
14015	  echo "2d2mod-2 -d dir2d2-2/sub2d2-2 mod2-2/sub2-2" >> CVSROOT/modules
14016	  dotest cvsadm-1e "${testcvs} ci -m add-modules" \
14017"${CPROG} commit: Examining .
14018${CPROG} commit: Examining CVSROOT
14019${CVSROOT_DIRNAME}/CVSROOT/modules,v  <--  CVSROOT/modules
14020new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
14021${SPROG} commit: Rebuilding administrative file database" \
14022"${CPROG} commit: Examining .
14023${CPROG} commit: Examining CVSROOT"
14024	  rm -rf CVS CVSROOT;
14025
14026	  # Create the various modules
14027	  dotest cvsadm-2 "${testcvs} -q co -l ." ''
14028	  mkdir mod1
14029	  mkdir mod1-2
14030	  mkdir mod2
14031	  mkdir mod2/sub2
14032	  mkdir mod2-2
14033	  mkdir mod2-2/sub2-2
14034	  dotest cvsadm-2a "${testcvs} add mod1 mod1-2 mod2 mod2/sub2 mod2-2 mod2-2/sub2-2" \
14035"Directory ${CVSROOT_DIRNAME}/mod1 added to the repository
14036Directory ${CVSROOT_DIRNAME}/mod1-2 added to the repository
14037Directory ${CVSROOT_DIRNAME}/mod2 added to the repository
14038Directory ${CVSROOT_DIRNAME}/mod2/sub2 added to the repository
14039Directory ${CVSROOT_DIRNAME}/mod2-2 added to the repository
14040Directory ${CVSROOT_DIRNAME}/mod2-2/sub2-2 added to the repository"
14041
14042	  # Populate the directories for the halibut
14043	  echo "file1" > mod1/file1
14044	  echo "file1-2" > mod1-2/file1-2
14045	  echo "file2" > mod2/sub2/file2
14046	  echo "file2-2" > mod2-2/sub2-2/file2-2
14047	  dotest cvsadm-2aa "${testcvs} add mod1/file1 mod1-2/file1-2 mod2/sub2/file2 mod2-2/sub2-2/file2-2" \
14048"${SPROG} add: scheduling file .mod1/file1. for addition
14049${SPROG} add: scheduling file .mod1-2/file1-2. for addition
14050${SPROG} add: scheduling file .mod2/sub2/file2. for addition
14051${SPROG} add: scheduling file .mod2-2/sub2-2/file2-2. for addition
14052${SPROG} add: use \`${SPROG} commit' to add these files permanently"
14053
14054	  dotest cvsadm-2b "${testcvs} ci -m yup mod1 mod1-2 mod2 mod2-2" \
14055"${CPROG} commit: Examining mod1
14056${CPROG} commit: Examining mod1-2
14057${CPROG} commit: Examining mod2
14058${CPROG} commit: Examining mod2/sub2
14059${CPROG} commit: Examining mod2-2
14060${CPROG} commit: Examining mod2-2/sub2-2
14061${CVSROOT_DIRNAME}/mod1/file1,v  <--  mod1/file1
14062initial revision: 1.1
14063${CVSROOT_DIRNAME}/mod1-2/file1-2,v  <--  mod1-2/file1-2
14064initial revision: 1.1
14065${CVSROOT_DIRNAME}/mod2/sub2/file2,v  <--  mod2/sub2/file2
14066initial revision: 1.1
14067${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v  <--  mod2-2/sub2-2/file2-2
14068initial revision: 1.1"
14069	  # Finished creating the modules -- clean up.
14070	  rm -rf CVS mod1 mod1-2 mod2 mod2-2
14071	  # Done.
14072
14073	  ##################################################
14074	  ## Start the dizzying array of possibilities.
14075	  ## Begin with each module type separately.
14076	  ##################################################
14077
14078	  # Pattern -- after each checkout, first check the top-level
14079	  # CVS directory.  Then, check the directories in numerical
14080	  # order.
14081
14082	  dotest cvsadm-3 "${testcvs} co 1mod" \
14083"${SPROG} checkout: Updating 1mod
14084U 1mod/file1"
14085	  dotest cvsadm-3b "cat CVS/Repository" "\."
14086	  dotest cvsadm-3d "cat 1mod/CVS/Repository" "mod1"
14087	  rm -rf CVS 1mod
14088
14089	  dotest cvsadm-4 "${testcvs} co 2mod" \
14090"${SPROG} checkout: Updating 2mod
14091U 2mod/file2"
14092	  dotest cvsadm-4b "cat CVS/Repository" "\."
14093	  dotest cvsadm-4d "cat 2mod/CVS/Repository" "mod2/sub2"
14094	  rm -rf CVS 2mod
14095
14096	  dotest cvsadm-5 "${testcvs} co 1d1mod" \
14097"${SPROG} checkout: Updating dir1d1
14098U dir1d1/file1"
14099	  dotest cvsadm-5b "cat CVS/Repository" "\."
14100	  dotest cvsadm-5d "cat dir1d1/CVS/Repository" "mod1"
14101	  rm -rf CVS dir1d1
14102
14103	  dotest cvsadm-6 "${testcvs} co 1d2mod" \
14104"${SPROG} checkout: Updating dir1d2
14105U dir1d2/file2"
14106	  dotest cvsadm-6b "cat CVS/Repository" "\."
14107	  dotest cvsadm-6d "cat dir1d2/CVS/Repository" "mod2/sub2"
14108	  rm -rf CVS dir1d2
14109
14110	  dotest cvsadm-7 "${testcvs} co 2d1mod" \
14111"${SPROG} checkout: Updating dir2d1/sub2d1
14112U dir2d1/sub2d1/file1"
14113	  dotest cvsadm-7b "cat CVS/Repository" "\."
14114	  dotest cvsadm-7d "cat dir2d1/CVS/Repository" "\."
14115	  dotest cvsadm-7f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14116	  rm -rf CVS dir2d1
14117
14118	  dotest cvsadm-8 "${testcvs} co 2d2mod" \
14119"${SPROG} checkout: Updating dir2d2/sub2d2
14120U dir2d2/sub2d2/file2"
14121	  dotest cvsadm-8b "cat CVS/Repository" "\."
14122	  dotest cvsadm-8d "cat dir2d2/CVS/Repository" "mod2"
14123	  dotest cvsadm-8f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14124	  rm -rf CVS dir2d2
14125
14126	  ##################################################
14127	  ## You are in a shell script of twisted little
14128	  ## module combination statements, all alike.
14129	  ##################################################
14130
14131	  ### 1mod
14132
14133	  dotest cvsadm-9 "${testcvs} co 1mod 1mod-2" \
14134"${SPROG} checkout: Updating 1mod
14135U 1mod/file1
14136${SPROG} checkout: Updating 1mod-2
14137U 1mod-2/file1-2"
14138	  # the usual for the top level
14139	  dotest cvsadm-9b "cat CVS/Repository" "\."
14140	  # the usual for 1mod
14141	  dotest cvsadm-9d "cat 1mod/CVS/Repository" "mod1"
14142	  # the usual for 1mod copy
14143	  dotest cvsadm-9f "cat 1mod-2/CVS/Repository" "mod1-2"
14144	  rm -rf CVS 1mod 1mod-2
14145
14146	  # 1mod 2mod redmod bluemod
14147	  dotest cvsadm-10 "${testcvs} co 1mod 2mod" \
14148"${SPROG} checkout: Updating 1mod
14149U 1mod/file1
14150${SPROG} checkout: Updating 2mod
14151U 2mod/file2"
14152	  # the usual for the top level
14153	  dotest cvsadm-10b "cat CVS/Repository" "\."
14154	  # the usual for 1mod
14155	  dotest cvsadm-10d "cat 1mod/CVS/Repository" "mod1"
14156	  # the usual for 2dmod
14157	  dotest cvsadm-10f "cat 2mod/CVS/Repository" "mod2/sub2"
14158	  rm -rf CVS 1mod 2mod
14159
14160	  dotest cvsadm-11 "${testcvs} co 1mod 1d1mod" \
14161"${SPROG} checkout: Updating 1mod
14162U 1mod/file1
14163${SPROG} checkout: Updating dir1d1
14164U dir1d1/file1"
14165	  # the usual for the top level
14166	  dotest cvsadm-11b "cat CVS/Repository" "\."
14167	  # the usual for 1mod
14168	  dotest cvsadm-11d "cat 1mod/CVS/Repository" "mod1"
14169	  # the usual for 1d1mod
14170	  dotest cvsadm-11f "cat dir1d1/CVS/Repository" "mod1"
14171	  rm -rf CVS 1mod dir1d1
14172
14173	  dotest cvsadm-12 "${testcvs} co 1mod 1d2mod" \
14174"${SPROG} checkout: Updating 1mod
14175U 1mod/file1
14176${SPROG} checkout: Updating dir1d2
14177U dir1d2/file2"
14178	  # the usual for the top level
14179	  dotest cvsadm-12b "cat CVS/Repository" "\."
14180	  # the usual for 1mod
14181	  dotest cvsadm-12d "cat 1mod/CVS/Repository" "mod1"
14182	  # the usual for 1d2mod
14183	  dotest cvsadm-12f "cat dir1d2/CVS/Repository" "mod2/sub2"
14184	  rm -rf CVS 1mod dir1d2
14185
14186	  dotest cvsadm-13 "${testcvs} co 1mod 2d1mod" \
14187"${SPROG} checkout: Updating 1mod
14188U 1mod/file1
14189${SPROG} checkout: Updating dir2d1/sub2d1
14190U dir2d1/sub2d1/file1"
14191	  # the usual for the top level
14192	  dotest cvsadm-13b "cat CVS/Repository" "\."
14193	  # the usual for 1mod
14194	  dotest cvsadm-13d "cat 1mod/CVS/Repository" "mod1"
14195	  # the usual for 2d1mod
14196	  dotest cvsadm-13f "cat dir2d1/CVS/Repository" "\."
14197	  dotest cvsadm-13h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14198	  rm -rf CVS 1mod dir2d1
14199
14200	  dotest cvsadm-14 "${testcvs} co 1mod 2d2mod" \
14201"${SPROG} checkout: Updating 1mod
14202U 1mod/file1
14203${SPROG} checkout: Updating dir2d2/sub2d2
14204U dir2d2/sub2d2/file2"
14205	  # the usual for the top level
14206	  dotest cvsadm-14b "cat CVS/Repository" "\."
14207	  # the usual for 1mod
14208	  dotest cvsadm-14d "cat 1mod/CVS/Repository" "mod1"
14209	  # the usual for 2d2mod
14210	  dotest cvsadm-14f "cat dir2d2/CVS/Repository" "mod2"
14211	  dotest cvsadm-14h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14212	  rm -rf CVS 1mod dir2d2
14213
14214
14215	  ### 2mod
14216
14217	  dotest cvsadm-15 "${testcvs} co 2mod 2mod-2" \
14218"${SPROG} checkout: Updating 2mod
14219U 2mod/file2
14220${SPROG} checkout: Updating 2mod-2
14221U 2mod-2/file2-2"
14222	  # the usual for the top level
14223	  dotest cvsadm-15b "cat CVS/Repository" "\."
14224	  # the usual for 2mod
14225	  dotest cvsadm-15d "cat 2mod/CVS/Repository" "mod2/sub2"
14226	  # the usual for 2mod copy
14227	  dotest cvsadm-15f "cat 2mod-2/CVS/Repository" "mod2-2/sub2-2"
14228	  rm -rf CVS 2mod 2mod-2
14229
14230
14231	  dotest cvsadm-16 "${testcvs} co 2mod 1d1mod" \
14232"${SPROG} checkout: Updating 2mod
14233U 2mod/file2
14234${SPROG} checkout: Updating dir1d1
14235U dir1d1/file1"
14236	  # the usual for the top level
14237	  dotest cvsadm-16b "cat CVS/Repository" "\."
14238	  # the usual for 2mod
14239	  dotest cvsadm-16d "cat 2mod/CVS/Repository" "mod2/sub2"
14240	  # the usual for 1d1mod
14241	  dotest cvsadm-16f "cat dir1d1/CVS/Repository" "mod1"
14242	  rm -rf CVS 2mod dir1d1
14243
14244	  dotest cvsadm-17 "${testcvs} co 2mod 1d2mod" \
14245"${SPROG} checkout: Updating 2mod
14246U 2mod/file2
14247${SPROG} checkout: Updating dir1d2
14248U dir1d2/file2"
14249	  # the usual for the top level
14250	  dotest cvsadm-17b "cat CVS/Repository" "\."
14251	  # the usual for 2mod
14252	  dotest cvsadm-17d "cat 2mod/CVS/Repository" "mod2/sub2"
14253	  # the usual for 1d2mod
14254	  dotest cvsadm-17f "cat dir1d2/CVS/Repository" "mod2/sub2"
14255	  rm -rf CVS 2mod dir1d2
14256
14257	  dotest cvsadm-18 "${testcvs} co 2mod 2d1mod" \
14258"${SPROG} checkout: Updating 2mod
14259U 2mod/file2
14260${SPROG} checkout: Updating dir2d1/sub2d1
14261U dir2d1/sub2d1/file1"
14262	  # the usual for the top level
14263	  dotest cvsadm-18b "cat CVS/Repository" "\."
14264	  # the usual for 2mod
14265	  dotest cvsadm-18d "cat 2mod/CVS/Repository" "mod2/sub2"
14266	  # the usual for 2d1mod
14267	  dotest cvsadm-18f "cat dir2d1/CVS/Repository" "\."
14268	  dotest cvsadm-18h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14269	  rm -rf CVS 2mod dir2d1
14270
14271	  dotest cvsadm-19 "${testcvs} co 2mod 2d2mod" \
14272"${SPROG} checkout: Updating 2mod
14273U 2mod/file2
14274${SPROG} checkout: Updating dir2d2/sub2d2
14275U dir2d2/sub2d2/file2"
14276	  # the usual for the top level
14277	  dotest cvsadm-19b "cat CVS/Repository" "\."
14278	  # the usual for 2mod
14279	  dotest cvsadm-19d "cat 2mod/CVS/Repository" "mod2/sub2"
14280	  # the usual for 2d2mod
14281	  dotest cvsadm-19f "cat dir2d2/CVS/Repository" "mod2"
14282	  dotest cvsadm-19h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14283	  rm -rf CVS 2mod dir2d2
14284
14285
14286	  ### 1d1mod
14287
14288	  dotest cvsadm-20 "${testcvs} co 1d1mod 1d1mod-2" \
14289"${SPROG} checkout: Updating dir1d1
14290U dir1d1/file1
14291${SPROG} checkout: Updating dir1d1-2
14292U dir1d1-2/file1-2"
14293	  # the usual for the top level
14294	  dotest cvsadm-20b "cat CVS/Repository" "\."
14295	  # the usual for 1d1mod
14296	  dotest cvsadm-20d "cat dir1d1/CVS/Repository" "mod1"
14297	  # the usual for 1d1mod copy
14298	  dotest cvsadm-20f "cat dir1d1-2/CVS/Repository" "mod1-2"
14299	  rm -rf CVS dir1d1 dir1d1-2
14300
14301	  dotest cvsadm-21 "${testcvs} co 1d1mod 1d2mod" \
14302"${SPROG} checkout: Updating dir1d1
14303U dir1d1/file1
14304${SPROG} checkout: Updating dir1d2
14305U dir1d2/file2"
14306	  # the usual for the top level
14307	  dotest cvsadm-21b "cat CVS/Repository" "\."
14308	  # the usual for 1d1mod
14309	  dotest cvsadm-21d "cat dir1d1/CVS/Repository" "mod1"
14310	  # the usual for 1d2mod
14311	  dotest cvsadm-21f "cat dir1d2/CVS/Repository" "mod2/sub2"
14312	  rm -rf CVS dir1d1 dir1d2
14313
14314	  dotest cvsadm-22 "${testcvs} co 1d1mod 2d1mod" \
14315"${SPROG} checkout: Updating dir1d1
14316U dir1d1/file1
14317${SPROG} checkout: Updating dir2d1/sub2d1
14318U dir2d1/sub2d1/file1"
14319	  # the usual for the top level
14320	  dotest cvsadm-22b "cat CVS/Repository" "\."
14321	  # the usual for 1d1mod
14322	  dotest cvsadm-22d "cat dir1d1/CVS/Repository" "mod1"
14323	  # the usual for 2d1mod
14324	  dotest cvsadm-22f "cat dir2d1/CVS/Repository" "\."
14325	  dotest cvsadm-22h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14326	  rm -rf CVS dir1d1 dir2d1
14327
14328	  dotest cvsadm-23 "${testcvs} co 1d1mod 2d2mod" \
14329"${SPROG} checkout: Updating dir1d1
14330U dir1d1/file1
14331${SPROG} checkout: Updating dir2d2/sub2d2
14332U dir2d2/sub2d2/file2"
14333	  # the usual for the top level
14334	  dotest cvsadm-23b "cat CVS/Repository" "\."
14335	  # the usual for 1d1mod
14336	  dotest cvsadm-23d "cat dir1d1/CVS/Repository" "mod1"
14337	  # the usual for 2d2mod
14338	  dotest cvsadm-23f "cat dir2d2/CVS/Repository" "mod2"
14339	  dotest cvsadm-23h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14340	  rm -rf CVS dir1d1 dir2d2
14341
14342
14343	  ### 1d2mod
14344
14345	  dotest cvsadm-24 "${testcvs} co 1d2mod 1d2mod-2" \
14346"${SPROG} checkout: Updating dir1d2
14347U dir1d2/file2
14348${SPROG} checkout: Updating dir1d2-2
14349U dir1d2-2/file2-2"
14350	  # the usual for the top level
14351	  dotest cvsadm-24b "cat CVS/Repository" "\."
14352	  # the usual for 1d2mod
14353	  dotest cvsadm-24d "cat dir1d2/CVS/Repository" "mod2/sub2"
14354	  # the usual for 1d2mod copy
14355	  dotest cvsadm-24f "cat dir1d2-2/CVS/Repository" "mod2-2/sub2-2"
14356	  rm -rf CVS dir1d2 dir1d2-2
14357
14358	  dotest cvsadm-25 "${testcvs} co 1d2mod 2d1mod" \
14359"${SPROG} checkout: Updating dir1d2
14360U dir1d2/file2
14361${SPROG} checkout: Updating dir2d1/sub2d1
14362U dir2d1/sub2d1/file1"
14363	  # the usual for the top level
14364	  dotest cvsadm-25b "cat CVS/Repository" "\."
14365	  # the usual for 1d2mod
14366	  dotest cvsadm-25d "cat dir1d2/CVS/Repository" "mod2/sub2"
14367	  # the usual for 2d1mod
14368	  dotest cvsadm-25f "cat dir2d1/CVS/Repository" "\."
14369	  dotest cvsadm-25h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14370	  rm -rf CVS dir1d2 dir2d1
14371
14372	  dotest cvsadm-26 "${testcvs} co 1d2mod 2d2mod" \
14373"${SPROG} checkout: Updating dir1d2
14374U dir1d2/file2
14375${SPROG} checkout: Updating dir2d2/sub2d2
14376U dir2d2/sub2d2/file2"
14377	  # the usual for the top level
14378	  dotest cvsadm-26b "cat CVS/Repository" "\."
14379	  # the usual for 1d2mod
14380	  dotest cvsadm-26d "cat dir1d2/CVS/Repository" "mod2/sub2"
14381	  # the usual for 2d2mod
14382	  dotest cvsadm-26f "cat dir2d2/CVS/Repository" "mod2"
14383	  dotest cvsadm-26h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14384	  rm -rf CVS dir1d2 dir2d2
14385
14386
14387	  # 2d1mod
14388
14389	  dotest cvsadm-27 "${testcvs} co 2d1mod 2d1mod-2" \
14390"${SPROG} checkout: Updating dir2d1/sub2d1
14391U dir2d1/sub2d1/file1
14392${SPROG} checkout: Updating dir2d1-2/sub2d1-2
14393U dir2d1-2/sub2d1-2/file1-2"
14394	  # the usual for the top level
14395	  dotest cvsadm-27b "cat CVS/Repository" "\."
14396	  # the usual for 2d1mod
14397	  dotest cvsadm-27d "cat dir2d1/CVS/Repository" "\."
14398	  dotest cvsadm-27f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14399	  # the usual for 2d1mod
14400	  dotest cvsadm-27h "cat dir2d1-2/CVS/Repository" "\."
14401	  dotest cvsadm-27j "cat dir2d1-2/sub2d1-2/CVS/Repository" "mod1-2"
14402	  rm -rf CVS dir2d1 dir2d1-2
14403
14404	  dotest cvsadm-28 "${testcvs} co 2d1mod 2d2mod" \
14405"${SPROG} checkout: Updating dir2d1/sub2d1
14406U dir2d1/sub2d1/file1
14407${SPROG} checkout: Updating dir2d2/sub2d2
14408U dir2d2/sub2d2/file2"
14409	  # the usual for the top level
14410	  dotest cvsadm-28b "cat CVS/Repository" "\."
14411	  # the usual for 2d1mod
14412	  dotest cvsadm-28d "cat dir2d1/CVS/Repository" "\."
14413	  dotest cvsadm-28f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14414	  # the usual for 2d2mod
14415	  dotest cvsadm-28h "cat dir2d2/CVS/Repository" "mod2"
14416	  dotest cvsadm-28j "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14417	  rm -rf CVS dir2d1 dir2d2
14418
14419
14420	  # 2d2mod
14421
14422	  dotest cvsadm-29 "${testcvs} co 2d2mod 2d2mod-2" \
14423"${SPROG} checkout: Updating dir2d2/sub2d2
14424U dir2d2/sub2d2/file2
14425${SPROG} checkout: Updating dir2d2-2/sub2d2-2
14426U dir2d2-2/sub2d2-2/file2-2"
14427	  # the usual for the top level
14428	  dotest cvsadm-29b "cat CVS/Repository" "\."
14429	  # the usual for 2d2mod
14430	  dotest cvsadm-29d "cat dir2d2/CVS/Repository" "mod2"
14431	  dotest cvsadm-29f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14432	  # the usual for 2d2mod
14433	  dotest cvsadm-29h "cat dir2d2-2/CVS/Repository" "mod2-2"
14434	  dotest cvsadm-29j "cat dir2d2-2/sub2d2-2/CVS/Repository" \
14435"mod2-2/sub2-2"
14436	  rm -rf CVS dir2d2 dir2d2-2
14437
14438	  ##################################################
14439	  ## And now, all of that again using the "-d" flag
14440	  ## on the command line.
14441	  ##################################################
14442
14443	  dotest cvsadm-1d3 "${testcvs} co -d dir 1mod" \
14444"${SPROG} checkout: Updating dir
14445U dir/file1"
14446	  dotest cvsadm-1d3b "cat CVS/Repository" "\."
14447	  dotest cvsadm-1d3d "cat dir/CVS/Repository" "mod1"
14448	  rm -rf CVS dir
14449
14450	  dotest cvsadm-1d4 "${testcvs} co -d dir 2mod" \
14451"${SPROG} checkout: Updating dir
14452U dir/file2"
14453	  dotest cvsadm-1d4b "cat CVS/Repository" "\."
14454	  dotest cvsadm-1d4d "cat dir/CVS/Repository" "mod2/sub2"
14455	  rm -rf CVS dir
14456
14457	  dotest cvsadm-1d5 "${testcvs} co -d dir 1d1mod" \
14458"${SPROG} checkout: Updating dir
14459U dir/file1"
14460	  dotest cvsadm-1d5b "cat CVS/Repository" "\."
14461	  dotest cvsadm-1d5d "cat dir/CVS/Repository" "mod1"
14462	  rm -rf CVS dir
14463
14464	  dotest cvsadm-1d6 "${testcvs} co -d dir 1d2mod" \
14465"${SPROG} checkout: Updating dir
14466U dir/file2"
14467	  dotest cvsadm-1d6b "cat CVS/Repository" "\."
14468	  dotest cvsadm-1d6d "cat dir/CVS/Repository" "mod2/sub2"
14469	  rm -rf CVS dir
14470
14471	  dotest cvsadm-1d7 "${testcvs} co -d dir 2d1mod" \
14472"${SPROG} checkout: Updating dir
14473U dir/file1"
14474	  dotest cvsadm-1d7b "cat CVS/Repository" "\."
14475	  dotest cvsadm-1d7d "cat dir/CVS/Repository" "mod1"
14476	  rm -rf CVS dir
14477
14478	  dotest cvsadm-1d8 "${testcvs} co -d dir 2d2mod" \
14479"${SPROG} checkout: Updating dir
14480U dir/file2"
14481	  dotest cvsadm-1d8b "cat CVS/Repository" "\."
14482	  dotest cvsadm-1d8d "cat dir/CVS/Repository" "mod2/sub2"
14483	  rm -rf CVS dir
14484
14485	  ##################################################
14486	  ## Los Combonaciones
14487	  ##################################################
14488
14489	  ### 1mod
14490
14491	  dotest cvsadm-1d9 "${testcvs} co -d dir 1mod 1mod-2" \
14492"${SPROG} checkout: Updating dir/1mod
14493U dir/1mod/file1
14494${SPROG} checkout: Updating dir/1mod-2
14495U dir/1mod-2/file1-2"
14496	  # the usual for the top level
14497	  dotest cvsadm-1d9b "cat CVS/Repository" "\."
14498	  # the usual for the dir level
14499	  dotest cvsadm-1d9d "cat dir/CVS/Repository" "\."
14500	  # the usual for 1mod
14501	  dotest cvsadm-1d9f "cat dir/1mod/CVS/Repository" "mod1"
14502	  # the usual for 1mod copy
14503	  dotest cvsadm-1d9h "cat dir/1mod-2/CVS/Repository" "mod1-2"
14504	  rm -rf CVS dir
14505
14506	  # 1mod 2mod redmod bluemod
14507	  dotest cvsadm-1d10 "${testcvs} co -d dir 1mod 2mod" \
14508"${SPROG} checkout: Updating dir/1mod
14509U dir/1mod/file1
14510${SPROG} checkout: Updating dir/2mod
14511U dir/2mod/file2"
14512	  dotest cvsadm-1d10b "cat CVS/Repository" "\."
14513	  # the usual for the dir level
14514	  dotest cvsadm-1d10d "cat dir/CVS/Repository" "\."
14515	  # the usual for 1mod
14516	  dotest cvsadm-1d10f "cat dir/1mod/CVS/Repository" "mod1"
14517	  # the usual for 2dmod
14518	  dotest cvsadm-1d10h "cat dir/2mod/CVS/Repository" "mod2/sub2"
14519	  rm -rf CVS dir
14520
14521	  dotest cvsadm-1d11 "${testcvs} co -d dir 1mod 1d1mod" \
14522"${SPROG} checkout: Updating dir/1mod
14523U dir/1mod/file1
14524${SPROG} checkout: Updating dir/dir1d1
14525U dir/dir1d1/file1"
14526	  dotest cvsadm-1d11b "cat CVS/Repository" "\."
14527	  # the usual for the dir level
14528	  dotest cvsadm-1d11d "cat dir/CVS/Repository" "\."
14529	  # the usual for 1mod
14530	  dotest cvsadm-1d11f "cat dir/1mod/CVS/Repository" "mod1"
14531	  # the usual for 1d1mod
14532	  dotest cvsadm-1d11h "cat dir/dir1d1/CVS/Repository" "mod1"
14533	  rm -rf CVS dir
14534
14535	  dotest cvsadm-1d12 "${testcvs} co -d dir 1mod 1d2mod" \
14536"${SPROG} checkout: Updating dir/1mod
14537U dir/1mod/file1
14538${SPROG} checkout: Updating dir/dir1d2
14539U dir/dir1d2/file2"
14540	  dotest cvsadm-1d12b "cat CVS/Repository" "\."
14541	  # the usual for the dir level
14542	  dotest cvsadm-1d12d "cat dir/CVS/Repository" "\."
14543	  # the usual for 1mod
14544	  dotest cvsadm-1d12f "cat dir/1mod/CVS/Repository" "mod1"
14545	  # the usual for 1d2mod
14546	  dotest cvsadm-1d12h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14547	  rm -rf CVS dir
14548
14549	  dotest cvsadm-1d13 "${testcvs} co -d dir 1mod 2d1mod" \
14550"${SPROG} checkout: Updating dir/1mod
14551U dir/1mod/file1
14552${SPROG} checkout: Updating dir/dir2d1/sub2d1
14553U dir/dir2d1/sub2d1/file1"
14554	  dotest cvsadm-1d13b "cat CVS/Repository" "\."
14555	  # the usual for the dir level
14556	  dotest cvsadm-1d13d "cat dir/CVS/Repository" "\."
14557	  # the usual for 1mod
14558	  dotest cvsadm-1d13f "cat dir/1mod/CVS/Repository" "mod1"
14559	  # the usual for 2d1mod
14560	  dotest cvsadm-1d13h "cat dir/dir2d1/CVS/Repository" "\."
14561	  dotest cvsadm-1d13j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14562	  rm -rf CVS dir
14563
14564	  dotest cvsadm-1d14 "${testcvs} co -d dir 1mod 2d2mod" \
14565"${SPROG} checkout: Updating dir/1mod
14566U dir/1mod/file1
14567${SPROG} checkout: Updating dir/dir2d2/sub2d2
14568U dir/dir2d2/sub2d2/file2"
14569	  dotest cvsadm-1d14b "cat CVS/Repository" "\."
14570	  # the usual for the dir level
14571	  dotest cvsadm-1d14d "cat dir/CVS/Repository" "\."
14572	  # the usual for 1mod
14573	  dotest cvsadm-1d14f "cat dir/1mod/CVS/Repository" "mod1"
14574	  # the usual for 2d2mod
14575	  dotest cvsadm-1d14h "cat dir/dir2d2/CVS/Repository" "mod2"
14576	  dotest cvsadm-1d14j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14577	  rm -rf CVS dir
14578
14579
14580	  ### 2mod
14581
14582	  dotest cvsadm-1d15 "${testcvs} co -d dir 2mod 2mod-2" \
14583"${SPROG} checkout: Updating dir/2mod
14584U dir/2mod/file2
14585${SPROG} checkout: Updating dir/2mod-2
14586U dir/2mod-2/file2-2"
14587	  dotest cvsadm-1d15b "cat CVS/Repository" "\."
14588	  # the usual for the dir level
14589	  dotest cvsadm-1d15d "cat dir/CVS/Repository" "mod2"
14590	  # the usual for 2mod
14591	  dotest cvsadm-1d15f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14592	  # the usual for 2mod copy
14593	  dotest cvsadm-1d15h "cat dir/2mod-2/CVS/Repository" "mod2-2/sub2-2"
14594	  rm -rf CVS dir
14595
14596	  dotest cvsadm-1d16 "${testcvs} co -d dir 2mod 1d1mod" \
14597"${SPROG} checkout: Updating dir/2mod
14598U dir/2mod/file2
14599${SPROG} checkout: Updating dir/dir1d1
14600U dir/dir1d1/file1"
14601	  dotest cvsadm-1d16b "cat CVS/Repository" "\."
14602	  # the usual for the dir level
14603	  dotest cvsadm-1d16d "cat dir/CVS/Repository" "mod2"
14604	  # the usual for 2mod
14605	  dotest cvsadm-1d16f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14606	  # the usual for 1d1mod
14607	  dotest cvsadm-1d16h "cat dir/dir1d1/CVS/Repository" "mod1"
14608	  rm -rf CVS dir
14609
14610	  dotest cvsadm-1d17 "${testcvs} co -d dir 2mod 1d2mod" \
14611"${SPROG} checkout: Updating dir/2mod
14612U dir/2mod/file2
14613${SPROG} checkout: Updating dir/dir1d2
14614U dir/dir1d2/file2"
14615	  dotest cvsadm-1d17b "cat CVS/Repository" "\."
14616	  # the usual for the dir level
14617	  dotest cvsadm-1d17d "cat dir/CVS/Repository" "mod2"
14618	  # the usual for 2mod
14619	  dotest cvsadm-1d17f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14620	  # the usual for 1d2mod
14621	  dotest cvsadm-1d17h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14622	  rm -rf CVS dir
14623
14624	  dotest cvsadm-1d18 "${testcvs} co -d dir 2mod 2d1mod" \
14625"${SPROG} checkout: Updating dir/2mod
14626U dir/2mod/file2
14627${SPROG} checkout: Updating dir/dir2d1/sub2d1
14628U dir/dir2d1/sub2d1/file1"
14629	  dotest cvsadm-1d18b "cat CVS/Repository" "\."
14630	  # the usual for the dir level
14631	  dotest cvsadm-1d18d "cat dir/CVS/Repository" "mod2"
14632	  # the usual for 2mod
14633	  dotest cvsadm-1d18f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14634	  # the usual for 2d1mod
14635	  dotest cvsadm-1d18h "cat dir/dir2d1/CVS/Repository" "\."
14636	  dotest cvsadm-1d18j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14637	  rm -rf CVS dir
14638
14639	  dotest cvsadm-1d19 "${testcvs} co -d dir 2mod 2d2mod" \
14640"${SPROG} checkout: Updating dir/2mod
14641U dir/2mod/file2
14642${SPROG} checkout: Updating dir/dir2d2/sub2d2
14643U dir/dir2d2/sub2d2/file2"
14644	  dotest cvsadm-1d19b "cat CVS/Repository" "\."
14645	  # the usual for the dir level
14646	  dotest cvsadm-1d19d "cat dir/CVS/Repository" "mod2"
14647	  # the usual for 2mod
14648	  dotest cvsadm-1d19f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14649	  # the usual for 2d2mod
14650	  dotest cvsadm-1d19h "cat dir/dir2d2/CVS/Repository" "mod2"
14651	  dotest cvsadm-1d19j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14652	  rm -rf CVS dir
14653
14654
14655	  ### 1d1mod
14656
14657	  dotest cvsadm-1d20 "${testcvs} co -d dir 1d1mod 1d1mod-2" \
14658"${SPROG} checkout: Updating dir/dir1d1
14659U dir/dir1d1/file1
14660${SPROG} checkout: Updating dir/dir1d1-2
14661U dir/dir1d1-2/file1-2"
14662	  dotest cvsadm-1d20b "cat CVS/Repository" "\."
14663	  # the usual for the dir level
14664	  dotest cvsadm-1d20d "cat dir/CVS/Repository" "\."
14665	  # the usual for 1d1mod
14666	  dotest cvsadm-1d20f "cat dir/dir1d1/CVS/Repository" "mod1"
14667	  # the usual for 1d1mod copy
14668	  dotest cvsadm-1d20h "cat dir/dir1d1-2/CVS/Repository" "mod1-2"
14669	  rm -rf CVS dir
14670
14671	  dotest cvsadm-1d21 "${testcvs} co -d dir 1d1mod 1d2mod" \
14672"${SPROG} checkout: Updating dir/dir1d1
14673U dir/dir1d1/file1
14674${SPROG} checkout: Updating dir/dir1d2
14675U dir/dir1d2/file2"
14676	  dotest cvsadm-1d21b "cat CVS/Repository" "\."
14677	  # the usual for the dir level
14678	  dotest cvsadm-1d21d "cat dir/CVS/Repository" "\."
14679	  # the usual for 1d1mod
14680	  dotest cvsadm-1d21f "cat dir/dir1d1/CVS/Repository" "mod1"
14681	  # the usual for 1d2mod
14682	  dotest cvsadm-1d21h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14683	  rm -rf CVS dir
14684
14685	  dotest cvsadm-1d22 "${testcvs} co -d dir 1d1mod 2d1mod" \
14686"${SPROG} checkout: Updating dir/dir1d1
14687U dir/dir1d1/file1
14688${SPROG} checkout: Updating dir/dir2d1/sub2d1
14689U dir/dir2d1/sub2d1/file1"
14690	  dotest cvsadm-1d22b "cat CVS/Repository" "\."
14691	  # the usual for the dir level
14692	  dotest cvsadm-1d22d "cat dir/CVS/Repository" "\."
14693	  # the usual for 1d1mod
14694	  dotest cvsadm-1d22f "cat dir/dir1d1/CVS/Repository" "mod1"
14695	  # the usual for 2d1mod
14696	  dotest cvsadm-1d22h "cat dir/dir2d1/CVS/Repository" "\."
14697	  dotest cvsadm-1d22j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14698	  rm -rf CVS dir
14699
14700	  dotest cvsadm-1d23 "${testcvs} co -d dir 1d1mod 2d2mod" \
14701"${SPROG} checkout: Updating dir/dir1d1
14702U dir/dir1d1/file1
14703${SPROG} checkout: Updating dir/dir2d2/sub2d2
14704U dir/dir2d2/sub2d2/file2"
14705	  dotest cvsadm-1d23b "cat CVS/Repository" "\."
14706	  # the usual for the dir level
14707	  dotest cvsadm-1d23d "cat dir/CVS/Repository" "\."
14708	  # the usual for 1d1mod
14709	  dotest cvsadm-1d23f "cat dir/dir1d1/CVS/Repository" "mod1"
14710	  # the usual for 2d2mod
14711	  dotest cvsadm-1d23h "cat dir/dir2d2/CVS/Repository" "mod2"
14712	  dotest cvsadm-1d23j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14713	  rm -rf CVS dir
14714
14715
14716	  ### 1d2mod
14717
14718	  dotest cvsadm-1d24 "${testcvs} co -d dir 1d2mod 1d2mod-2" \
14719"${SPROG} checkout: Updating dir/dir1d2
14720U dir/dir1d2/file2
14721${SPROG} checkout: Updating dir/dir1d2-2
14722U dir/dir1d2-2/file2-2"
14723	  dotest cvsadm-1d24b "cat CVS/Repository" "\."
14724	  # the usual for the dir level
14725	  dotest cvsadm-1d24d "cat dir/CVS/Repository" "mod2"
14726	  # the usual for 1d2mod
14727	  dotest cvsadm-1d24f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14728	  # the usual for 1d2mod copy
14729	  dotest cvsadm-1d24h "cat dir/dir1d2-2/CVS/Repository" "mod2-2/sub2-2"
14730	  rm -rf CVS dir
14731
14732	  dotest cvsadm-1d25 "${testcvs} co -d dir 1d2mod 2d1mod" \
14733"${SPROG} checkout: Updating dir/dir1d2
14734U dir/dir1d2/file2
14735${SPROG} checkout: Updating dir/dir2d1/sub2d1
14736U dir/dir2d1/sub2d1/file1"
14737	  dotest cvsadm-1d25b "cat CVS/Repository" "\."
14738	  # the usual for the dir level
14739	  dotest cvsadm-1d25d "cat dir/CVS/Repository" "mod2"
14740	  # the usual for 1d2mod
14741	  dotest cvsadm-1d25f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14742	  # the usual for 2d1mod
14743	  dotest cvsadm-1d25h "cat dir/dir2d1/CVS/Repository" "\."
14744	  dotest cvsadm-1d25j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14745	  rm -rf CVS dir
14746
14747	  dotest cvsadm-1d26 "${testcvs} co -d dir 1d2mod 2d2mod" \
14748"${SPROG} checkout: Updating dir/dir1d2
14749U dir/dir1d2/file2
14750${SPROG} checkout: Updating dir/dir2d2/sub2d2
14751U dir/dir2d2/sub2d2/file2"
14752	  dotest cvsadm-1d26b "cat CVS/Repository" "\."
14753	  # the usual for the dir level
14754	  dotest cvsadm-1d26d "cat dir/CVS/Repository" "mod2"
14755	  # the usual for 1d2mod
14756	  dotest cvsadm-1d26f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14757	  # the usual for 2d2mod
14758	  dotest cvsadm-1d26h "cat dir/dir2d2/CVS/Repository" "mod2"
14759	  dotest cvsadm-1d26j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14760	  rm -rf CVS dir
14761
14762
14763	  # 2d1mod
14764
14765	  dotest cvsadm-1d27 "${testcvs} co -d dir 2d1mod 2d1mod-2" \
14766"${SPROG} checkout: Updating dir/dir2d1/sub2d1
14767U dir/dir2d1/sub2d1/file1
14768${SPROG} checkout: Updating dir/dir2d1-2/sub2d1-2
14769U dir/dir2d1-2/sub2d1-2/file1-2"
14770	  dotest cvsadm-1d27b "cat CVS/Repository" "\."
14771	  # the usual for the dir level
14772	  dotest cvsadm-1d27d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
14773	  # the usual for 2d1mod
14774	  dotest cvsadm-1d27f "cat dir/dir2d1/CVS/Repository" "\."
14775	  dotest cvsadm-1d27h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14776	  # the usual for 2d1mod
14777	  dotest cvsadm-1d27j "cat dir/dir2d1-2/CVS/Repository" "\."
14778	  dotest cvsadm-1d27l "cat dir/dir2d1-2/sub2d1-2/CVS/Repository" \
14779"mod1-2"
14780	  rm -rf CVS dir
14781
14782	  dotest cvsadm-1d28 "${testcvs} co -d dir 2d1mod 2d2mod" \
14783"${SPROG} checkout: Updating dir/dir2d1/sub2d1
14784U dir/dir2d1/sub2d1/file1
14785${SPROG} checkout: Updating dir/dir2d2/sub2d2
14786U dir/dir2d2/sub2d2/file2"
14787	  dotest cvsadm-1d28b "cat CVS/Repository" "\."
14788	  # the usual for the dir level
14789	  dotest cvsadm-1d28d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
14790	  # the usual for 2d1mod
14791	  dotest cvsadm-1d28f "cat dir/dir2d1/CVS/Repository" "\."
14792	  dotest cvsadm-1d28h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14793	  # the usual for 2d2mod
14794	  dotest cvsadm-1d28j "cat dir/dir2d2/CVS/Repository" "mod2"
14795	  dotest cvsadm-1d28l "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14796	  rm -rf CVS dir
14797
14798
14799	  # 2d2mod
14800
14801	  dotest cvsadm-1d29 "${testcvs} co -d dir 2d2mod 2d2mod-2" \
14802"${SPROG} checkout: Updating dir/dir2d2/sub2d2
14803U dir/dir2d2/sub2d2/file2
14804${SPROG} checkout: Updating dir/dir2d2-2/sub2d2-2
14805U dir/dir2d2-2/sub2d2-2/file2-2"
14806	  dotest cvsadm-1d29b "cat CVS/Repository" "\."
14807	  # the usual for the dir level
14808	  dotest cvsadm-1d29d "cat dir/CVS/Repository" "\."
14809	  # the usual for 2d2mod
14810	  dotest cvsadm-1d29f "cat dir/dir2d2/CVS/Repository" "mod2"
14811	  dotest cvsadm-1d29h "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14812	  # the usual for 2d2mod
14813	  dotest cvsadm-1d29j "cat dir/dir2d2-2/CVS/Repository" "mod2-2"
14814	  dotest cvsadm-1d29l "cat dir/dir2d2-2/sub2d2-2/CVS/Repository" \
14815"mod2-2/sub2-2"
14816	  rm -rf CVS dir
14817
14818	  ##################################################
14819	  ## And now, some of that again using the "-d" flag
14820	  ## on the command line, but use a longer path.
14821	  ##################################################
14822
14823	  dotest cvsadm-2d3-1 "$testcvs co -d dir/dir2 1mod" \
14824"$SPROG checkout: Updating dir/dir2
14825U dir/dir2/file1"
14826
14827	  # Remote couldn't handle this, even with the "mkdir dir", before
14828	  # CVS 1.11.14.
14829	  dotest cvsadm-2d3b "cat CVS/Repository" "\."
14830	  dotest cvsadm-2d3d "cat dir/CVS/Repository" "."
14831	  dotest cvsadm-2d3f "cat dir/dir2/CVS/Repository" "mod1"
14832	  rm -rf CVS dir
14833
14834	  mkdir dir
14835	  dotest cvsadm-2d4 "$testcvs co -d dir/dir2 2mod" \
14836"$SPROG checkout: Updating dir/dir2
14837U dir/dir2/file2"
14838	  dotest cvsadm-2d4b "cat CVS/Repository" "\."
14839	  dotest cvsadm-2d4f "cat dir/dir2/CVS/Repository" "mod2/sub2"
14840	  rm -rf CVS dir
14841
14842	  mkdir dir
14843	  dotest cvsadm-2d5 "$testcvs co -d dir/dir2 1d1mod" \
14844"$SPROG checkout: Updating dir/dir2
14845U dir/dir2/file1"
14846	  dotest cvsadm-2d5b "cat CVS/Repository" "\."
14847	  dotest cvsadm-2d5f "cat dir/dir2/CVS/Repository" "mod1"
14848	  rm -rf CVS dir
14849
14850	  mkdir dir
14851	  dotest cvsadm-2d6 "$testcvs co -d dir/dir2 1d2mod" \
14852"$SPROG checkout: Updating dir/dir2
14853U dir/dir2/file2"
14854	  dotest cvsadm-2d6b "cat CVS/Repository" "\."
14855	  dotest cvsadm-2d6f "cat dir/dir2/CVS/Repository" "mod2/sub2"
14856	  rm -rf CVS dir
14857
14858	  mkdir dir
14859	  dotest cvsadm-2d7 "$testcvs co -d dir/dir2 2d1mod" \
14860"$SPROG checkout: Updating dir/dir2
14861U dir/dir2/file1"
14862	  dotest cvsadm-2d7b "cat CVS/Repository" "\."
14863	  dotest cvsadm-2d7f "cat dir/dir2/CVS/Repository" "mod1"
14864	  rm -rf CVS dir
14865
14866	  mkdir dir
14867	  dotest cvsadm-2d8 "$testcvs co -d dir/dir2 2d2mod" \
14868"$SPROG checkout: Updating dir/dir2
14869U dir/dir2/file2"
14870	  dotest cvsadm-2d8b "cat CVS/Repository" "\."
14871	  dotest cvsadm-2d8f "cat dir/dir2/CVS/Repository" "mod2/sub2"
14872	  rm -rf CVS dir
14873
14874	  ##################################################
14875	  ## And now, a few of those tests revisited to
14876	  ## test the behavior of the -N flag.
14877	  ##################################################
14878
14879	  dotest cvsadm-N3 "$testcvs co -N 1mod" \
14880"$SPROG checkout: Updating 1mod
14881U 1mod/file1"
14882	  dotest cvsadm-N3b "cat CVS/Repository" "\."
14883	  dotest cvsadm-N3d "cat 1mod/CVS/Repository" "mod1"
14884	  rm -rf CVS 1mod
14885
14886	  dotest cvsadm-N4 "$testcvs co -N 2mod" \
14887"$SPROG checkout: Updating 2mod
14888U 2mod/file2"
14889	  dotest cvsadm-N4b "cat CVS/Repository" "\."
14890	  dotest cvsadm-N4d "cat 2mod/CVS/Repository" "mod2/sub2"
14891	  rm -rf CVS 2mod
14892
14893	  dotest cvsadm-N5 "$testcvs co -N 1d1mod" \
14894"$SPROG checkout: Updating dir1d1
14895U dir1d1/file1"
14896	  dotest cvsadm-N5b "cat CVS/Repository" "\."
14897	  dotest cvsadm-N5d "cat dir1d1/CVS/Repository" "mod1"
14898	  rm -rf CVS dir1d1
14899
14900	  dotest cvsadm-N6 "$testcvs co -N 1d2mod" \
14901"$SPROG checkout: Updating dir1d2
14902U dir1d2/file2"
14903	  dotest cvsadm-N6b "cat CVS/Repository" "\."
14904	  dotest cvsadm-N6d "cat dir1d2/CVS/Repository" "mod2/sub2"
14905	  rm -rf CVS dir1d2
14906
14907	  dotest cvsadm-N7 "$testcvs co -N 2d1mod" \
14908"$SPROG checkout: Updating dir2d1/sub2d1
14909U dir2d1/sub2d1/file1"
14910	  dotest cvsadm-N7b "cat CVS/Repository" "\."
14911	  dotest cvsadm-N7d "cat dir2d1/CVS/Repository" "\."
14912	  dotest cvsadm-N7f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
14913	  rm -rf CVS dir2d1
14914
14915	  dotest cvsadm-N8 "$testcvs co -N 2d2mod" \
14916"$SPROG checkout: Updating dir2d2/sub2d2
14917U dir2d2/sub2d2/file2"
14918	  dotest cvsadm-N8b "cat CVS/Repository" "\."
14919	  dotest cvsadm-N8d "cat dir2d2/CVS/Repository" "mod2"
14920	  dotest cvsadm-N8f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
14921	  rm -rf CVS dir2d2
14922
14923	  ## the ones in one-deep directories
14924
14925	  dotest cvsadm-N1d3 "$testcvs co -N -d dir 1mod" \
14926"$SPROG checkout: Updating dir/1mod
14927U dir/1mod/file1"
14928	  dotest cvsadm-N1d3b "cat CVS/Repository" "\."
14929	  dotest cvsadm-N1d3d "cat dir/CVS/Repository" "\."
14930	  dotest cvsadm-N1d3f "cat dir/1mod/CVS/Repository" "mod1"
14931	  rm -rf CVS dir
14932
14933	  dotest cvsadm-N1d4 "$testcvs co -N -d dir 2mod" \
14934"$SPROG checkout: Updating dir/2mod
14935U dir/2mod/file2"
14936	  dotest cvsadm-N1d4b "cat CVS/Repository" "\."
14937	  dotest cvsadm-N1d4d "cat dir/CVS/Repository" "mod2"
14938	  dotest cvsadm-N1d4f "cat dir/2mod/CVS/Repository" "mod2/sub2"
14939	  rm -rf CVS dir
14940
14941	  dotest cvsadm-N1d5 "$testcvs co -N -d dir 1d1mod" \
14942"$SPROG checkout: Updating dir/dir1d1
14943U dir/dir1d1/file1"
14944	  dotest cvsadm-N1d5b "cat CVS/Repository" "\."
14945	  dotest cvsadm-N1d5d "cat dir/CVS/Repository" "\."
14946	  dotest cvsadm-N1d5d "cat dir/dir1d1/CVS/Repository" "mod1"
14947	  rm -rf CVS dir
14948
14949	  dotest cvsadm-N1d6 "$testcvs co -N -d dir 1d2mod" \
14950"$SPROG checkout: Updating dir/dir1d2
14951U dir/dir1d2/file2"
14952	  dotest cvsadm-N1d6b "cat CVS/Repository" "\."
14953	  dotest cvsadm-N1d6d "cat dir/CVS/Repository" "mod2"
14954	  dotest cvsadm-N1d6f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
14955	  rm -rf CVS dir
14956
14957	  dotest cvsadm-N1d7 "$testcvs co -N -d dir 2d1mod" \
14958"$SPROG checkout: Updating dir/dir2d1/sub2d1
14959U dir/dir2d1/sub2d1/file1"
14960	  dotest cvsadm-N1d7b "cat CVS/Repository" "\."
14961	  dotest cvsadm-N1d7d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
14962	  dotest cvsadm-N1d7f "cat dir/dir2d1/CVS/Repository" "\."
14963	  dotest cvsadm-N1d7h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
14964	  rm -rf CVS dir
14965
14966	  dotest cvsadm-N1d8 "$testcvs co -N -d dir 2d2mod" \
14967"$SPROG checkout: Updating dir/dir2d2/sub2d2
14968U dir/dir2d2/sub2d2/file2"
14969	  dotest cvsadm-N1d8b "cat CVS/Repository" "\."
14970	  dotest cvsadm-N1d8d "cat dir/CVS/Repository" "\."
14971	  dotest cvsadm-N1d8d "cat dir/dir2d2/CVS/Repository" "mod2"
14972	  dotest cvsadm-N1d8d "cat dir/dir2d2/sub2d2/CVS/Repository" \
14973"mod2/sub2"
14974	  rm -rf CVS dir
14975
14976	  ## the ones in two-deep directories
14977
14978	  mkdir dir
14979	  dotest cvsadm-N2d3 "$testcvs co -N -d dir/dir2 1mod" \
14980"$SPROG checkout: Updating dir/dir2/1mod
14981U dir/dir2/1mod/file1"
14982	  dotest cvsadm-N2d3b "cat CVS/Repository" "\."
14983	  dotest cvsadm-N2d3f "cat dir/dir2/CVS/Repository" "\."
14984	  dotest cvsadm-N2d3h "cat dir/dir2/1mod/CVS/Repository" "mod1"
14985	  rm -rf CVS dir
14986
14987	  mkdir dir
14988	  dotest cvsadm-N2d4 "$testcvs co -N -d dir/dir2 2mod" \
14989"$SPROG checkout: Updating dir/dir2/2mod
14990U dir/dir2/2mod/file2"
14991	  dotest cvsadm-N2d4b "cat CVS/Repository" "\."
14992	  dotest cvsadm-N2d4f "cat dir/dir2/CVS/Repository" "mod2"
14993	  dotest cvsadm-N2d4h "cat dir/dir2/2mod/CVS/Repository" "mod2/sub2"
14994	  rm -rf CVS dir
14995
14996	  mkdir dir
14997	  dotest cvsadm-N2d5 "$testcvs co -N -d dir/dir2 1d1mod" \
14998"$SPROG checkout: Updating dir/dir2/dir1d1
14999U dir/dir2/dir1d1/file1"
15000	  dotest cvsadm-N2d5b "cat CVS/Repository" "\."
15001	  dotest cvsadm-N2d5f "cat dir/dir2/CVS/Repository" "\."
15002	  dotest cvsadm-N2d5h "cat dir/dir2/dir1d1/CVS/Repository" "mod1"
15003	  rm -rf CVS dir
15004
15005	  mkdir dir
15006	  dotest cvsadm-N2d6 "$testcvs co -N -d dir/dir2 1d2mod" \
15007"$SPROG checkout: Updating dir/dir2/dir1d2
15008U dir/dir2/dir1d2/file2"
15009	  dotest cvsadm-N2d6b "cat CVS/Repository" "\."
15010	  dotest cvsadm-N2d6f "cat dir/dir2/CVS/Repository" "mod2"
15011	  dotest cvsadm-N2d6h "cat dir/dir2/dir1d2/CVS/Repository" "mod2/sub2"
15012	  rm -rf CVS dir
15013
15014	  mkdir dir
15015	  dotest cvsadm-N2d7 "$testcvs co -N -d dir/dir2 2d1mod" \
15016"$SPROG checkout: Updating dir/dir2/dir2d1/sub2d1
15017U dir/dir2/dir2d1/sub2d1/file1"
15018	  dotest cvsadm-N2d7b "cat CVS/Repository" "\."
15019	  dotest cvsadm-N2d7f "cat dir/dir2/CVS/Repository" "CVSROOT/Emptydir"
15020	  dotest cvsadm-N2d7g "cat dir/dir2/dir2d1/CVS/Repository" "\."
15021	  dotest cvsadm-N2d7h "cat dir/dir2/dir2d1/sub2d1/CVS/Repository" \
15022"mod1"
15023	  rm -rf CVS dir
15024
15025	  mkdir dir
15026	  dotest cvsadm-N2d8 "$testcvs co -N -d dir/dir2 2d2mod" \
15027"$SPROG checkout: Updating dir/dir2/dir2d2/sub2d2
15028U dir/dir2/dir2d2/sub2d2/file2"
15029	  dotest cvsadm-N2d8b "cat CVS/Repository" "\."
15030	  dotest cvsadm-N2d8f "cat dir/dir2/CVS/Repository" "\."
15031	  dotest cvsadm-N2d8h "cat dir/dir2/dir2d2/CVS/Repository" "mod2"
15032	  dotest cvsadm-N2d8j "cat dir/dir2/dir2d2/sub2d2/CVS/Repository" \
15033"mod2/sub2"
15034	  rm -rf CVS dir
15035	  # End of test that didn't work for remote prior to CVS 1.11.14.
15036
15037	  ##################################################
15038	  ## That's enough of that, thank you very much.
15039	  ##################################################
15040
15041	  dokeep
15042	  restore_adm
15043
15044	  # remove our junk
15045	  cd ..
15046	  rm -r 1
15047	  modify_repo rm -rf $CVSROOT_DIRNAME/1mod $CVSROOT_DIRNAME/1mod-2 \
15048			     $CVSROOT_DIRNAME/2mod $CVSROOT_DIRNAME/2mod-2 \
15049			     $CVSROOT_DIRNAME/mod1 $CVSROOT_DIRNAME/mod1-2 \
15050			     $CVSROOT_DIRNAME/mod2 $CVSROOT_DIRNAME/mod2-2
15051	  ;;
15052
15053
15054
15055	emptydir)
15056	  # Various tests of the Emptydir (CVSNULLREPOS) code.  See also:
15057	  #   cvsadm: tests of Emptydir in various module definitions
15058	  #   basicb: Test that "Emptydir" is non-special in ordinary contexts
15059
15060	  mkdir 1; cd 1
15061	  dotest emptydir-1 "${testcvs} co CVSROOT/modules" \
15062"U CVSROOT/modules"
15063	  echo "# Module defs for emptydir tests" > CVSROOT/modules
15064	  echo "2d1mod -d dir2d1/sub/sub2d1 mod1" >> CVSROOT/modules
15065	  echo "2d1moda -d dir2d1/suba moda/modasub" >> CVSROOT/modules
15066	  echo "2d1modb -d dir2d1/suba mod1" >> CVSROOT/modules
15067	  echo "comb -a 2d1modb 2d1moda" >> CVSROOT/modules
15068
15069	  dotest emptydir-2 "${testcvs} ci -m add-modules" \
15070"${CPROG} commit: Examining CVSROOT
15071${CVSROOT_DIRNAME}/CVSROOT/modules,v  <--  CVSROOT/modules
15072new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
15073${SPROG} commit: Rebuilding administrative file database" \
15074"${CPROG} commit: Examining CVSROOT"
15075	  rm -rf CVS CVSROOT
15076
15077	  modify_repo mkdir $CVSROOT_DIRNAME/mod1 $CVSROOT_DIRNAME/moda
15078	  # Populate.  Not sure we really need to do this.
15079	  dotest emptydir-3 "$testcvs -q co -l ."
15080	  dotest emptydir-3a "${testcvs} co mod1 moda" \
15081"${SPROG} checkout: Updating mod1
15082${SPROG} checkout: Updating moda"
15083	  echo "file1" > mod1/file1
15084	  mkdir moda/modasub
15085	  dotest emptydir-3b "${testcvs} add moda/modasub" \
15086"Directory ${CVSROOT_DIRNAME}/moda/modasub added to the repository"
15087	  echo "filea" > moda/modasub/filea
15088	  dotest emptydir-4 "${testcvs} add mod1/file1 moda/modasub/filea" \
15089"${SPROG} add: scheduling file .mod1/file1. for addition
15090${SPROG} add: scheduling file .moda/modasub/filea. for addition
15091${SPROG} add: use \`${SPROG} commit' to add these files permanently"
15092	  dotest emptydir-5 "${testcvs} -q ci -m yup" \
15093"$CVSROOT_DIRNAME/mod1/file1,v  <--  mod1/file1
15094initial revision: 1\.1
15095${CVSROOT_DIRNAME}/moda/modasub/filea,v  <--  moda/modasub/filea
15096initial revision: 1\.1"
15097	  rm -rf mod1 moda CVS
15098	  # End Populate.
15099
15100	  dotest emptydir-6 "${testcvs} co 2d1mod" \
15101"${SPROG} checkout: Updating dir2d1/sub/sub2d1
15102U dir2d1/sub/sub2d1/file1"
15103	  cd dir2d1
15104	  touch emptyfile
15105	  # It doesn't make any sense to add a file (or do much of anything
15106	  # else) in Emptydir; Emptydir is a placeholder indicating that
15107	  # the working directory doesn't correspond to anything in
15108	  # the repository.
15109	  dotest_fail emptydir-7 "${testcvs} add emptyfile" \
15110"${SPROG} \[add aborted]: cannot add to \`${CVSROOT_DIRNAME}/CVSROOT/Emptydir'"
15111	  mkdir emptydir
15112	  dotest_fail emptydir-8 "${testcvs} add emptydir" \
15113"${CPROG} \[add aborted]: cannot add to \`${CVSROOT_DIRNAME}/CVSROOT/Emptydir'"
15114	  cd ..
15115	  rm -rf CVS dir2d1
15116
15117	  # OK, while we have an Emptydir around, test a few obscure
15118	  # things about it.
15119	  mkdir edir; cd edir
15120	  dotest emptydir-9 "${testcvs} -q co -l CVSROOT" \
15121"U CVSROOT${DOTSTAR}"
15122	  cd CVSROOT
15123	  dotest_fail emptydir-10 "test -d Emptydir" ''
15124	  # This tests the code in find_dirs which skips Emptydir.
15125	  dotest emptydir-11 "${testcvs} -q -n update -d -P" ''
15126	  cd ../..
15127	  rm -r edir
15128	  cd ..
15129
15130	  # Now start playing with moda.
15131	  mkdir 2; cd 2
15132	  dotest emptydir-12 "${testcvs} -q co 2d1moda" \
15133"U dir2d1/suba/filea"
15134	  # OK, this is the crux of the matter.  This used to show "Emptydir",
15135	  # but everyone seemed to think it should show "moda".  This
15136	  # usually works better, but not always as shown by the following
15137	  # test.
15138	  dotest emptydir-13 "cat dir2d1/CVS/Repository" "moda"
15139	  dotest_fail emptydir-14 "${testcvs} co comb" \
15140"${SPROG} checkout: existing repository ${CVSROOT_DIRNAME}/moda/modasub does not match ${CVSROOT_DIRNAME}/mod1
15141${SPROG} checkout: ignoring module 2d1modb
15142${SPROG} checkout: Updating dir2d1/suba"
15143	  dotest emptydir-15 "cat dir2d1/CVS/Repository" "moda"
15144	  cd ..
15145
15146	  # Test the effect of a non-cvs directory already existing with the
15147	  # same name as one in the modules file.
15148	  mkdir 3; cd 3
15149	  mkdir dir2d1
15150	  dotest emptydir-16 "${testcvs} co 2d1mod" \
15151"${SPROG} checkout: Updating dir2d1/sub/sub2d1
15152U dir2d1/sub/sub2d1/file1"
15153
15154	  if $remote; then
15155	    dotest emptydir-17 "cat dir2d1/CVS/Repository" "CVSROOT/Emptydir"
15156	  else
15157	    dotest_fail emptydir-17 "test -d dir2d1/CVS"
15158	  fi
15159
15160	  dokeep
15161	  cd ..
15162	  rm -r 1 2 3
15163	  modify_repo rm -rf $CVSROOT_DIRNAME/mod1 $CVSROOT_DIRNAME/moda
15164	  # I guess for the moment the convention is going to be
15165	  # that we don't need to remove $CVSROOT_DIRNAME/CVSROOT/Emptydir
15166	  ;;
15167
15168
15169
15170	abspath)
15171
15172	  # These tests test the thituations thin thwitch thoo theck
15173	  # things thout twith thabsolute thaths.  Threally.
15174
15175	  #
15176	  # CHECKOUTS
15177	  #
15178
15179	  # Create a few modules to use
15180	  modify_repo mkdir $CVSROOT_DIRNAME/mod1 $CVSROOT_DIRNAME/mod2
15181	  dotest abspath-1a "${testcvs} co mod1 mod2" \
15182"${SPROG} checkout: Updating mod1
15183${SPROG} checkout: Updating mod2"
15184
15185	  # Populate the module
15186	  echo "file1" > mod1/file1
15187	  echo "file2" > mod2/file2
15188	  cd mod1
15189	  dotest abspath-1ba "${testcvs} add file1" \
15190"${SPROG} add: scheduling file .file1. for addition
15191${SPROG} add: use \`${SPROG} commit' to add this file permanently"
15192          cd ..
15193          cd mod2
15194	  dotest abspath-1bb "${testcvs} add file2" \
15195"${SPROG} add: scheduling file .file2. for addition
15196${SPROG} add: use \`${SPROG} commit' to add this file permanently"
15197          cd ..
15198
15199	  dotest abspath-1c "${testcvs} ci -m yup mod1 mod2" \
15200"${CPROG} commit: Examining mod1
15201${CPROG} commit: Examining mod2
15202${CVSROOT_DIRNAME}/mod1/file1,v  <--  mod1/file1
15203initial revision: 1.1
15204${CVSROOT_DIRNAME}/mod2/file2,v  <--  mod2/file2
15205initial revision: 1.1"
15206	  # Finished creating the module -- clean up.
15207	  rm -rf CVS mod1 mod2
15208	  # Done.
15209
15210	  # Try checking out the module in a local directory
15211	  if $remote; then
15212	    dotest_fail abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
15213"${SPROG} \[checkout aborted\]: absolute pathnames invalid for server (specified .${TESTDIR}/1.)"
15214	    dotest abspath-2a-try2 "${testcvs} co -d 1 mod1" \
15215"${SPROG} checkout: Updating 1
15216U 1/file1"
15217	  else
15218	    dotest abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
15219"${SPROG} checkout: Updating ${TESTDIR}/1
15220U ${TESTDIR}/1/file1"
15221	  fi # remote workaround
15222
15223	  dotest abspath-2b "cat ${TESTDIR}/1/CVS/Repository" "mod1"
15224
15225	  # Done.  Clean up.
15226	  rm -r $TESTDIR/1
15227
15228
15229	  # Now try in a subdirectory.  We're not covering any more
15230	  # code here, but we might catch a future error if someone
15231	  # changes the checkout code.
15232
15233	  # Since CVS 1.11.14, CVS will create leading directories specified
15234	  # via co -d.
15235	  # I am unsure that this wasn't the behavior prior to CVS 1.9, but the
15236	  # comment that used to be here leads me to believe it was not.
15237	  if $remote; then :; else
15238	    dotest abspath-3.1 "$testcvs -q co -d $TESTDIR/1/2 mod1" \
15239"U $TESTDIR/1/2/file1"
15240	    rm -r $TESTDIR/1
15241	  fi
15242	  dotest abspath-3.2 "$testcvs -q co -d 1/2 mod1" \
15243"U 1/2/file1"
15244	  rm -r 1
15245
15246	  # We don't to mess with an existing directory just to traverse it,
15247	  # for example by creating a CVS directory, but currently we can't
15248	  # avoid this in client/server mode.
15249	  mkdir 1
15250	  if $remote; then
15251	    dotest abspath-3ar "$testcvs co -d 1/2 mod1" \
15252"$SPROG checkout: Updating 1/2
15253U 1/2/file1"
15254	    dotest abspath-3br "cat 1/CVS/Repository" .
15255	  else
15256	    dotest abspath-3a "$testcvs co -d $TESTDIR/1/2 mod1" \
15257"$SPROG checkout: Updating $TESTDIR/1/2
15258U $TESTDIR/1/2/file1"
15259	    dotest_fail abspath-3b "test -d ${TESTDIR}/1/CVS"
15260	  fi
15261
15262	  dotest abspath-3c "cat ${TESTDIR}/1/2/CVS/Repository" mod1
15263
15264
15265	  # Done.  Clean up.
15266	  rm -rf ${TESTDIR}/1
15267
15268
15269	  # Now try someplace where we don't have permission.
15270	  mkdir ${TESTDIR}/barf
15271	  chmod -w ${TESTDIR}/barf
15272	  dotest_fail abspath-4r "${testcvs} co -d ${TESTDIR}/barf/sub mod1" \
15273"${SPROG} \[checkout aborted\]: cannot make directory sub: Permission denied" \
15274"${SPROG} \[checkout aborted\]: absolute pathnames invalid for server (specified .${TESTDIR}/barf/sub.)"
15275	  chmod +w ${TESTDIR}/barf
15276	  rmdir ${TESTDIR}/barf
15277	  # Done.  Nothing to clean up.
15278
15279
15280	  # Try checking out two modules into the same directory.
15281	  if $remote; then
15282	    dotest abspath-5ar "${testcvs} co -d 1 mod1 mod2" \
15283"${SPROG} checkout: Updating 1/mod1
15284U 1/mod1/file1
15285${SPROG} checkout: Updating 1/mod2
15286U 1/mod2/file2"
15287	  else
15288	    dotest abspath-5a "${testcvs} co -d ${TESTDIR}/1 mod1 mod2" \
15289"${SPROG} checkout: Updating ${TESTDIR}/1/mod1
15290U ${TESTDIR}/1/mod1/file1
15291${SPROG} checkout: Updating ${TESTDIR}/1/mod2
15292U ${TESTDIR}/1/mod2/file2"
15293	  fi # end remote workaround
15294	  dotest abspath-5b "cat ${TESTDIR}/1/CVS/Repository" "\."
15295	  dotest abspath-5c "cat ${TESTDIR}/1/mod1/CVS/Repository" "mod1"
15296	  dotest abspath-5d "cat ${TESTDIR}/1/mod2/CVS/Repository" "mod2"
15297	  # Done.  Clean up.
15298	  rm -rf $TESTDIR/1
15299
15300
15301	  # Try checking out the top-level module.
15302	  if $remote; then
15303	    dotest abspath-6ar "$testcvs co -d 1 ." \
15304"$SPROG checkout: Updating 1
15305$SPROG checkout: Updating 1/CVSROOT
15306$DOTSTAR
15307$SPROG checkout: Updating 1/mod1
15308U 1/mod1/file1
15309$SPROG checkout: Updating 1/mod2
15310U 1/mod2/file2"
15311	  else
15312	    dotest abspath-6a "${testcvs} co -d ${TESTDIR}/1 ." \
15313"${SPROG} checkout: Updating ${TESTDIR}/1
15314${SPROG} checkout: Updating ${TESTDIR}/1/CVSROOT
15315${DOTSTAR}
15316${SPROG} checkout: Updating ${TESTDIR}/1/mod1
15317U ${TESTDIR}/1/mod1/file1
15318${SPROG} checkout: Updating ${TESTDIR}/1/mod2
15319U ${TESTDIR}/1/mod2/file2"
15320	  fi # end of remote workaround
15321	  dotest abspath-6b "cat ${TESTDIR}/1/CVS/Repository" "\."
15322	  dotest abspath-6c "cat ${TESTDIR}/1/CVSROOT/CVS/Repository" "CVSROOT"
15323	  dotest abspath-6c "cat ${TESTDIR}/1/mod1/CVS/Repository" "mod1"
15324	  dotest abspath-6d "cat ${TESTDIR}/1/mod2/CVS/Repository" "mod2"
15325	  # Done.  Clean up.
15326	  rm -rf ${TESTDIR}/1
15327
15328	  # Test that an absolute pathname to some other directory
15329	  # doesn't mess with the current working directory.
15330	  mkdir 1
15331	  cd 1
15332	  if $remote; then
15333	    dotest_fail abspath-7ar "${testcvs} -q co -d ../2 mod2" \
15334"${SPROG} checkout: protocol error: .\.\./2. contains more leading \.\.
15335${SPROG} \[checkout aborted\]: than the 0 which Max-dotdot specified"
15336	    cd ..
15337	    dotest abspath-7a-try2r "${testcvs} -q co -d 2 mod2" \
15338"U 2/file2"
15339	    cd 1
15340	  else
15341	    dotest abspath-7a "${testcvs} -q co -d ${TESTDIR}/2 mod2" \
15342"U ${TESTDIR}/2/file2"
15343	  fi # remote workaround
15344	  dotest abspath-7b "ls" ""
15345	  dotest abspath-7c "${testcvs} -q co mod1" \
15346"U mod1/file1"
15347	  cd mod1
15348	  if $remote; then
15349	    cd ../..
15350	    dotest abspath-7dr "${testcvs} -q co -d 3 mod2" \
15351"U 3/file2"
15352	    cd 1/mod1
15353	  else
15354	    dotest abspath-7d "${testcvs} -q co -d ${TESTDIR}/3 mod2" \
15355"U ${TESTDIR}/3/file2"
15356	  fi # remote workaround
15357	  dotest abspath-7e "${testcvs} -q update -d"
15358
15359	  #
15360	  # FIXME: do other functions here (e.g. update /tmp/foo)
15361	  #
15362
15363	  # Finished with all tests.  Cleanup.
15364	  dokeep
15365	  cd ../..
15366	  rm -r 1 2 3
15367	  modify_repo rm -rf $CVSROOT_DIRNAME/mod1 $CVSROOT_DIRNAME/mod2
15368	  ;;
15369
15370
15371
15372	abspath2)
15373	  # More absolute path checks.  The following used to attempt to create
15374	  # directories in /:
15375	  #
15376	  # $ cvs -d:fork:/cvsroot co /foo
15377	  # cvs checkout: warning: cannot make directory CVS in /: Permission denied
15378	  # cvs [checkout aborted]: cannot make directory /foo: Permission denied
15379	  # $
15380	  #
15381	  # The -z9 in this test also checks for an old server bug where the
15382	  # server would block indefinitely attempting to read an EOF from the
15383	  # client in the compression buffer shutdown routine.
15384	  dotest_fail abspath2-1 "$testcvs -z9 co /foo" \
15385"$CPROG \[checkout aborted\]: Absolute module reference invalid: \`/foo'" \
15386"$SPROG \[server aborted\]: Absolute module reference invalid: \`/foo'
15387$CPROG \[checkout aborted\]: end of file from server (consult above messages if any)"
15388	  ;;
15389
15390
15391
15392	toplevel)
15393	  # test the feature that cvs creates a CVS subdir also for
15394	  # the toplevel directory
15395
15396	  # First set the TopLevelAdmin setting.
15397	  mkdir 1; cd 1
15398	  dotest toplevel-1a "${testcvs} -q co CVSROOT/config" \
15399"U CVSROOT/config"
15400	  cd CVSROOT
15401	  echo "TopLevelAdmin=yes" >>config
15402	  dotest toplevel-1b "${testcvs} -q ci -m yes-top-level" \
15403"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
15404new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
15405$SPROG commit: Rebuilding administrative file database"
15406	  cd ../..
15407	  rm -r 1
15408
15409	  mkdir 1; cd 1
15410	  dotest toplevel-1 "${testcvs} -q co -l ." ''
15411	  mkdir top-dir second-dir
15412	  dotest toplevel-2 "${testcvs} add top-dir second-dir" \
15413"Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
15414Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
15415	  cd top-dir
15416
15417	  touch file1
15418	  dotest toplevel-3 "${testcvs} add file1" \
15419"${SPROG} add: scheduling file .file1. for addition
15420${SPROG} add: use .${SPROG} commit. to add this file permanently"
15421	  dotest toplevel-4 "${testcvs} -q ci -m add" \
15422"$CVSROOT_DIRNAME/top-dir/file1,v  <--  file1
15423initial revision: 1\.1"
15424	  cd ..
15425
15426	  cd second-dir
15427	  touch file2
15428	  dotest toplevel-3s "${testcvs} add file2" \
15429"${SPROG} add: scheduling file .file2. for addition
15430${SPROG} add: use .${SPROG} commit. to add this file permanently"
15431	  dotest toplevel-4s "${testcvs} -q ci -m add" \
15432"$CVSROOT_DIRNAME/second-dir/file2,v  <--  file2
15433initial revision: 1\.1"
15434
15435	  cd ../..
15436	  rm -r 1; mkdir 1; cd 1
15437	  dotest toplevel-5 "${testcvs} co top-dir" \
15438"${SPROG} checkout: Updating top-dir
15439U top-dir/file1"
15440
15441	  dotest toplevel-6 "${testcvs} update top-dir" \
15442"${SPROG} update: Updating top-dir"
15443	  dotest toplevel-7 "${testcvs} update"  \
15444"${SPROG} update: Updating \.
15445${SPROG} update: Updating top-dir"
15446
15447	  dotest toplevel-8 "${testcvs} update -d top-dir" \
15448"${SPROG} update: Updating top-dir"
15449	  # There is some sentiment that
15450	  #   "${SPROG} update: Updating \.
15451          #   ${SPROG} update: Updating top-dir"
15452	  # is correct but it isn't clear why that would be correct instead
15453	  # of the remote CVS behavior (which also updates CVSROOT).
15454	  #
15455	  # The DOTSTAR matches of a bunch of lines like
15456	  # "U CVSROOT/checkoutlist".  Trying to match them more precisely
15457	  # seemed to cause trouble.  For example CVSROOT/cvsignore will
15458	  # be present or absent depending on whether we ran the "ignore"
15459	  # test or not.
15460	  dotest toplevel-9 "${testcvs} update -d" \
15461"${SPROG} update: Updating \.
15462${SPROG} update: Updating CVSROOT
15463${DOTSTAR}
15464${SPROG} update: Updating top-dir"
15465
15466	  cd ..
15467	  rm -r 1; mkdir 1; cd 1
15468	  dotest toplevel-10 "${testcvs} co top-dir" \
15469"${SPROG} checkout: Updating top-dir
15470U top-dir/file1"
15471
15472	  # This tests more or less the same thing, in a particularly
15473	  # "real life" example.
15474	  dotest toplevel-11 "${testcvs} -q update -d second-dir" \
15475"U second-dir/file2"
15476
15477	  # Now remove the CVS directory (people may do this manually,
15478	  # especially if they formed their habits with CVS
15479	  # 1.9 and older, which didn't create it.  Or perhaps the working
15480	  # directory itself was created with 1.9 or older).
15481	  rm -r CVS
15482	  # Now set the permissions so we can't recreate it.
15483	  if test -n "$remotehost"; then
15484	    # Cygwin again.
15485	    $CVS_RSH $remotehost "chmod -w $TESTDIR/1"
15486	  else
15487	    chmod -w ../1
15488	  fi
15489	  # Now see whether CVS has trouble because it can't create CVS.
15490	  # First string is for local, second is for remote.
15491	  dotest toplevel-12 "${testcvs} co top-dir" \
15492"${SPROG} checkout: warning: cannot make directory CVS in \.: Permission denied
15493${SPROG} checkout: Updating top-dir" \
15494"${CPROG} checkout: warning: cannot make directory CVS in \.: Permission denied
15495${CPROG} checkout: in directory \.:
15496${CPROG} checkout: cannot open CVS/Entries for reading: No such file or directory
15497${SPROG} checkout: Updating top-dir"
15498
15499	  chmod +w ../1
15500
15501	  dokeep
15502	  restore_adm
15503	  cd ..
15504	  rm -r 1
15505	  modify_repo rm -rf $CVSROOT_DIRNAME/top-dir \
15506			     $CVSROOT_DIRNAME/second-dir
15507	  ;;
15508
15509
15510
15511	toplevel2)
15512	  # Similar to toplevel, but test the case where TopLevelAdmin=no.
15513
15514	  # First set the TopLevelAdmin setting.
15515	  mkdir 1; cd 1
15516	  dotest toplevel2-1a "${testcvs} -q co CVSROOT/config" \
15517"U CVSROOT/config"
15518	  cd CVSROOT
15519	  echo "TopLevelAdmin=no" >>config
15520	  dotest toplevel2-1b "$testcvs -q ci -m no-top-level" \
15521"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
15522new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
15523$SPROG commit: Rebuilding administrative file database"
15524	  cd ../..
15525	  rm -r 1
15526
15527	  # Now set up some directories and subdirectories
15528	  mkdir 1; cd 1
15529	  dotest toplevel2-1 "${testcvs} -q co -l ." ''
15530	  mkdir top-dir second-dir
15531	  dotest toplevel2-2 "${testcvs} add top-dir second-dir" \
15532"Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
15533Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
15534	  cd top-dir
15535
15536	  touch file1
15537	  dotest toplevel2-3 "${testcvs} add file1" \
15538"${SPROG} add: scheduling file .file1. for addition
15539${SPROG} add: use .${SPROG} commit. to add this file permanently"
15540	  dotest toplevel2-4 "${testcvs} -q ci -m add" \
15541"$CVSROOT_DIRNAME/top-dir/file1,v  <--  file1
15542initial revision: 1\.1"
15543	  cd ..
15544
15545	  cd second-dir
15546	  touch file2
15547	  dotest toplevel2-3s "${testcvs} add file2" \
15548"${SPROG} add: scheduling file .file2. for addition
15549${SPROG} add: use .${SPROG} commit. to add this file permanently"
15550	  dotest toplevel2-4s "${testcvs} -q ci -m add" \
15551"$CVSROOT_DIRNAME/second-dir/file2,v  <--  file2
15552initial revision: 1\.1"
15553
15554	  cd ../..
15555	  rm -r 1; mkdir 1; cd 1
15556	  dotest toplevel2-5 "${testcvs} co top-dir" \
15557"${SPROG} checkout: Updating top-dir
15558U top-dir/file1"
15559
15560	  dotest toplevel2-6 "${testcvs} update top-dir" \
15561"${SPROG} update: Updating top-dir"
15562	  dotest toplevel2-7 "${testcvs} update"  \
15563"${SPROG} update: Updating top-dir"
15564
15565	  dotest toplevel2-8 "${testcvs} update -d top-dir" \
15566"${SPROG} update: Updating top-dir"
15567	  # Contrast this with toplevel-9, which has TopLevelAdmin=yes.
15568	  dotest toplevel2-9 "${testcvs} update -d" \
15569"${SPROG} update: Updating top-dir"
15570
15571	  cd ..
15572	  rm -r 1; mkdir 1; cd 1
15573	  dotest toplevel2-10 "${testcvs} co top-dir" \
15574"${SPROG} checkout: Updating top-dir
15575U top-dir/file1"
15576	  # This tests more or less the same thing, in a particularly
15577	  # "real life" example.  With TopLevelAdmin=yes, this command
15578	  # would give us second-dir and CVSROOT directories too.
15579	  dotest toplevel2-11 "${testcvs} -q update -d" ""
15580
15581	  dokeep
15582	  cd ..
15583	  restore_adm
15584	  rm -r 1
15585	  modify_repo rm -rf $CVSROOT_DIRNAME/top-dir \
15586			     $CVSROOT_DIRNAME/second-dir
15587	  ;;
15588
15589
15590
15591	rstar-toplevel)
15592	  # This test used to confirm a bug that existed in the r* commands
15593	  # run against the top-level project prior to CVS 1.11.18 & 1.12.10.
15594	  #
15595	  # The assertion failure was something like:
15596	  # do_recursion: Assertion \`strstr (repository, \"/\./\") == ((void \*)0)' failed\..*"
15597	  dotest rstar-toplevel-1 "$testcvs -q rlog ." \
15598"
15599RCS file: $CVSROOT_DIRNAME/CVSROOT$DOTSTAR"
15600
15601	  dokeep
15602	;;
15603
15604
15605
15606	trailingslashes)
15607	  # Some tests of CVS's reactions to path specifications containing
15608	  # trailing slashes.
15609	  mkdir trailingslashes; cd trailingslashes
15610	  dotest trailingslashes-init-1 "$testcvs -Q co -ldt ."
15611	  dotest trailingslashes-init-2 "$testcvs -Q co -dt2 ."
15612	  cd t
15613	  echo "Ahh'll be baaack." >topfile
15614	  dotest trailingslashes-init-3 "$testcvs -Q add topfile"
15615	  dotest trailingslashes-init-4 "$testcvs -Q ci -mto-top"
15616
15617	  # First, demonstrate the usual case.
15618	  cd ../t2
15619	  dotest trailingslashes-1 "$testcvs -q up CVSROOT"
15620	  dotest_fail trailingslashes-1a "test -f topfile"
15621
15622	  # FIXCVS:
15623	  # Now the one that fails in remote mode.
15624	  # This highlights one of the failure cases mentioned in TODO item
15625	  # #205.
15626	  if $remote; then
15627		  dotest trailingslashes-2 "$testcvs -q up CVSROOT/" \
15628"U topfile"
15629		  dotest trailingslashes-2a "test -f topfile"
15630	  else
15631		  dotest trailingslashes-2 "$testcvs -q up CVSROOT/"
15632		  dotest_fail trailingslashes-2a "test -f topfile"
15633	  fi
15634
15635	  dokeep
15636	  cd ../..
15637	  rm -rf trailingslashes
15638	  modify_repo rm -rf $CVSROOT_DIRNAME/topfile,v
15639	  ;;
15640
15641
15642
15643        checkout_repository)
15644          dotest_fail checkout_repository-1 \
15645"${testcvs} co -d ${CVSROOT_DIRNAME} CVSROOT" \
15646"${CPROG} \[checkout aborted\]: Cannot check out files into the repository itself" \
15647"${SPROG} \[checkout aborted\]: absolute pathnames invalid for server (specified \`${CVSROOT_DIRNAME}')"
15648
15649	  # The behavior of the client/server test below should be correct.
15650	  # The CVS client currently has no way of knowing that the client and
15651	  # server are the same machine and thus skips the $CVSROOT checks.
15652	  # I think checking for this case in CVS would be bloat since this
15653	  # should be a fairly rare occurance.
15654	  cd ${CVSROOT_DIRNAME}
15655          dotest_fail checkout_repository-2 "${testcvs} co CVSROOT" \
15656"${CPROG} \[checkout aborted\]: Cannot check out files into the repository itself" \
15657"${SPROG} checkout: Updating CVSROOT
15658${CPROG} checkout: move away \`CVSROOT/access'; it is in the way
15659C CVSROOT/access
15660${CPROG} checkout: move away \`CVSROOT/aclconfig'; it is in the way
15661C CVSROOT/aclconfig
15662${CPROG} checkout: move away \`CVSROOT/checkoutlist'; it is in the way
15663C CVSROOT/checkoutlist
15664${CPROG} checkout: move away \`CVSROOT/commitinfo'; it is in the way
15665C CVSROOT/commitinfo
15666${CPROG} checkout: move away \`CVSROOT/config'; it is in the way
15667C CVSROOT/config
15668${CPROG} checkout: move away \`CVSROOT/cvswrappers'; it is in the way
15669C CVSROOT/cvswrappers
15670${CPROG} checkout: move away \`CVSROOT/group'; it is in the way
15671C CVSROOT/group
15672${CPROG} checkout: move away \`CVSROOT/loginfo'; it is in the way
15673C CVSROOT/loginfo
15674${CPROG} checkout: move away \`CVSROOT/modules'; it is in the way
15675C CVSROOT/modules
15676${CPROG} checkout: move away \`CVSROOT/notify'; it is in the way
15677C CVSROOT/notify
15678${CPROG} checkout: move away \`CVSROOT/postadmin'; it is in the way
15679C CVSROOT/postadmin
15680${CPROG} checkout: move away \`CVSROOT/postproxy'; it is in the way
15681C CVSROOT/postproxy
15682${CPROG} checkout: move away \`CVSROOT/posttag'; it is in the way
15683C CVSROOT/posttag
15684${CPROG} checkout: move away \`CVSROOT/postwatch'; it is in the way
15685C CVSROOT/postwatch
15686${CPROG} checkout: move away \`CVSROOT/preproxy'; it is in the way
15687C CVSROOT/preproxy
15688${CPROG} checkout: move away \`CVSROOT/rcsinfo'; it is in the way
15689C CVSROOT/rcsinfo
15690${CPROG} checkout: move away \`CVSROOT/taginfo'; it is in the way
15691C CVSROOT/taginfo
15692${CPROG} checkout: move away \`CVSROOT/verifymsg'; it is in the way
15693C CVSROOT/verifymsg"
15694
15695          dotest checkout_repository-3 \
15696"${testcvs} co -p CVSROOT/modules >/dev/null" \
15697"===================================================================
15698Checking out CVSROOT/modules
15699RCS:  ${CVSROOT_DIRNAME}/CVSROOT/modules,v
15700VERS: 1\.[0-9]*
15701\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
15702
15703	  dokeep
15704	  cd $TESTDIR
15705          ;;
15706
15707
15708
15709	mflag)
15710	  for message in '' ' ' '
15711           ' '    	  	test' ; do
15712	    # Set up
15713	    mkdir a-dir; cd a-dir
15714	    # Test handling of -m during import
15715	    echo testa >>test
15716	    if ${testcvs} import -m "$message" a-dir A A1 >>${LOGFILE} 2>&1;then
15717	        pass 156
15718	    else
15719		fail 156
15720	    fi
15721	    # Must import twice since the first time uses inline code that
15722	    # avoids RCS call.
15723	    echo testb >>test
15724	    if ${testcvs} import -m "$message" a-dir A A2 >>${LOGFILE} 2>&1;then
15725		pass 157
15726	    else
15727		fail 157
15728	    fi
15729	    # Test handling of -m during ci
15730	    cd ..; rm -r a-dir
15731	    if ${testcvs} co a-dir >>${LOGFILE} 2>&1; then
15732		pass 158
15733	    else
15734		fail 158
15735	    fi
15736	    cd a-dir
15737	    echo testc >>test
15738	    if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
15739		pass 159
15740	    else
15741		fail 159
15742	    fi
15743	    # Test handling of -m during rm/ci
15744	    rm test;
15745	    if ${testcvs} rm test >>${LOGFILE} 2>&1; then
15746		pass 160
15747	    else
15748		fail 160
15749	    fi
15750	    if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
15751		pass 161
15752	    else
15753		fail 161
15754	    fi
15755
15756	    dokeep
15757	    # Clean up
15758	    cd ..
15759	    rm -r a-dir
15760	    modify_repo rm -rf $CVSROOT_DIRNAME/a-dir
15761	  done
15762	  ;;
15763
15764
15765
15766	editor)
15767	  # More tests of log messages, in this case the ability to
15768	  # run an external editor.
15769	  # TODO:
15770	  #   * also test $EDITOR, $CVSEDITOR, &c.
15771	  #   * test what happens if up-to-date check fails.
15772
15773	  # Our "editor" puts "x" at the start of each line, so we
15774	  # can see the "CVS:" lines.
15775	  cat >${TESTDIR}/editme <<EOF
15776#!${TESTSHELL}
15777sleep 1
15778sed <\$1 -e 's/^/x/' >${TESTDIR}/edit.new
15779mv ${TESTDIR}/edit.new \$1
15780exit 0
15781EOF
15782	  chmod +x ${TESTDIR}/editme
15783
15784	  mkdir 1; cd 1
15785	  dotest editor-1 "${testcvs} -q co -l ." ''
15786	  mkdir first-dir
15787	  dotest editor-2 "${testcvs} add first-dir" \
15788"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
15789	  cd first-dir
15790	  touch file1 file2
15791	  dotest editor-3 "${testcvs} add file1 file2" \
15792"${SPROG} add: scheduling file .file1. for addition
15793${SPROG} add: scheduling file .file2. for addition
15794${SPROG} add: use .${SPROG} commit. to add these files permanently"
15795	  dotest editor-4 "${testcvs} -e ${TESTDIR}/editme -q ci" \
15796"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
15797initial revision: 1\.1
15798$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
15799initial revision: 1\.1"
15800	  dotest editor-5 "${testcvs} -q tag -b br" "T file1
15801T file2"
15802	  dotest editor-6 "${testcvs} -q update -r br" ''
15803	  echo modify >>file1
15804	  dotest editor-7 "${testcvs} -e ${TESTDIR}/editme -q ci" \
15805"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
15806new revision: 1\.1\.2\.1; previous revision: 1\.1"
15807	  # OK, now we want to make sure "ci -r" puts in the branch
15808	  # where appropriate.  Note that we can check in on the branch
15809	  # without being on the branch, because there is not a revision
15810	  # already on the branch.  If there were a revision on the branch,
15811	  # CVS would correctly give an up-to-date check failed.
15812	  dotest editor-8 "${testcvs} -q update -A" "U file1"
15813	  echo add a line >>file2
15814	  dotest editor-9 "${testcvs} -q -e ${TESTDIR}/editme ci -rbr file2" \
15815"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
15816new revision: 1\.1\.2\.1; previous revision: 1\.1"
15817
15818	  dotest editor-log-file1 "${testcvs} log -N file1" "
15819RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
15820Working file: file1
15821head: 1\.1
15822branch:
15823locks: strict
15824access list:
15825keyword substitution: kv
15826total revisions: 2;	selected revisions: 2
15827description:
15828----------------------------
15829revision 1\.1
15830date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
15831branches:  1\.1\.2;
15832x
15833xCVS: ----------------------------------------------------------------------
15834xCVS: Enter Log.  Lines beginning with .CVS:. are removed automatically
15835xCVS:
15836xCVS: Committing in .
15837xCVS:
15838xCVS: Added Files:
15839xCVS: 	file1 file2
15840xCVS: ----------------------------------------------------------------------
15841----------------------------
15842revision 1\.1\.2\.1
15843date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
15844x
15845xCVS: ----------------------------------------------------------------------
15846xCVS: Enter Log.  Lines beginning with .CVS:. are removed automatically
15847xCVS:
15848xCVS: Committing in .
15849xCVS:
15850xCVS: Modified Files:
15851xCVS:  Tag: br
15852xCVS: 	file1
15853xCVS: ----------------------------------------------------------------------
15854============================================================================="
15855
15856	  # The only difference between the two expect strings is the
15857	  # presence or absence of "Committing in ." for 1.1.2.1.
15858	  dotest editor-log-file2 "${testcvs} log -N file2" "
15859RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
15860Working file: file2
15861head: 1\.1
15862branch:
15863locks: strict
15864access list:
15865keyword substitution: kv
15866total revisions: 2;	selected revisions: 2
15867description:
15868----------------------------
15869revision 1\.1
15870date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
15871branches:  1\.1\.2;
15872x
15873xCVS: ----------------------------------------------------------------------
15874xCVS: Enter Log.  Lines beginning with .CVS:. are removed automatically
15875xCVS:
15876xCVS: Committing in .
15877xCVS:
15878xCVS: Added Files:
15879xCVS: 	file1 file2
15880xCVS: ----------------------------------------------------------------------
15881----------------------------
15882revision 1\.1\.2\.1
15883date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
15884x
15885xCVS: ----------------------------------------------------------------------
15886xCVS: Enter Log.  Lines beginning with .CVS:. are removed automatically
15887xCVS:
15888xCVS: Modified Files:
15889xCVS:  Tag: br
15890xCVS: 	file2
15891xCVS: ----------------------------------------------------------------------
15892=============================================================================" "
15893RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
15894Working file: file2
15895head: 1\.1
15896branch:
15897locks: strict
15898access list:
15899keyword substitution: kv
15900total revisions: 2;	selected revisions: 2
15901description:
15902----------------------------
15903revision 1\.1
15904date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
15905branches:  1\.1\.2;
15906x
15907xCVS: ----------------------------------------------------------------------
15908xCVS: Enter Log.  Lines beginning with .CVS:. are removed automatically
15909xCVS:
15910xCVS: Committing in .
15911xCVS:
15912xCVS: Added Files:
15913xCVS: 	file1 file2
15914xCVS: ----------------------------------------------------------------------
15915----------------------------
15916revision 1\.1\.2\.1
15917date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
15918x
15919xCVS: ----------------------------------------------------------------------
15920xCVS: Enter Log.  Lines beginning with .CVS:. are removed automatically
15921xCVS:
15922xCVS: Committing in .
15923xCVS:
15924xCVS: Modified Files:
15925xCVS:  Tag: br
15926xCVS: 	file2
15927xCVS: ----------------------------------------------------------------------
15928============================================================================="
15929
15930	  # Test CVS's response to an unchanged log message
15931	  cat >${TESTDIR}/editme <<EOF
15932#!${TESTSHELL}
15933sleep 1
15934exit 0
15935EOF
15936	  chmod +x ${TESTDIR}/editme
15937	  dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
15938"
15939Log message unchanged or not specified
15940a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
15941Action: (abort) ${CPROG} \[commit aborted\]: aborted by user"
15942
15943	  # Test CVS's response to an empty log message
15944	  cat >${TESTDIR}/editme <<EOF
15945#!${TESTSHELL}
15946sleep 1
15947cat /dev/null >\$1
15948exit 0
15949EOF
15950	  chmod +x ${TESTDIR}/editme
15951	  dotest_fail editor-emptylog-1a "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
15952"
15953Log message unchanged or not specified
15954a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
15955Action: (abort) ${CPROG} \[commit aborted\]: aborted by user"
15956
15957	  # Test CVS's response to a log message with one blank line
15958	  cat >${TESTDIR}/editme <<EOF
15959#!${TESTSHELL}
15960sleep 1
15961echo >\$1
15962exit 0
15963EOF
15964	  chmod +x ${TESTDIR}/editme
15965	  dotest_fail editor-emptylog-1b "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
15966"
15967Log message unchanged or not specified
15968a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
15969Action: (abort) ${CPROG} \[commit aborted\]: aborted by user"
15970
15971	  # Test CVS's response to a log message with only comments
15972	  cat >${TESTDIR}/editme <<EOF
15973#!${TESTSHELL}
15974sleep 1
15975cat \$1 >${TESTDIR}/edit.new
15976mv ${TESTDIR}/edit.new \$1
15977exit 0
15978EOF
15979	  chmod +x ${TESTDIR}/editme
15980	  dotest_fail editor-emptylog-1c "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
15981"
15982Log message unchanged or not specified
15983a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
15984Action: (abort) ${CPROG} \[commit aborted\]: aborted by user"
15985
15986	  # Test CVS's response to a log message that is zero bytes
15987	  # in length. This caused core dumps in cvs 1.11.5 on Solaris
15988	  # hosts.
15989	  cd ..
15990	  dotest editor-emptylog-continue-1 "${testcvs} -q co CVSROOT/loginfo" \
15991"U CVSROOT/loginfo"
15992
15993          cd CVSROOT
15994	  cat <<\EOF >>loginfo
15995DEFAULT (echo Start-Log;cat;echo End-Log) >> $CVSROOT/CVSROOT/commitlog
15996EOF
15997	  dotest editor-emptylog-continue-2 "$testcvs -Q ci -mloggem"
15998
15999	  cd ../first-dir
16000	  cat >${TESTDIR}/editme <<EOF
16001#!${TESTSHELL}
16002sleep 1
16003cp /dev/null \$1
16004exit 1
16005EOF
16006	  chmod +x ${TESTDIR}/editme
16007	  dotest editor-emptylog-continue-3 "echo c |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
16008"${CPROG} commit: warning: editor session failed
16009
16010Log message unchanged or not specified
16011a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
16012Action: (abort) ${CVSROOT_DIRNAME}/first-dir/file1,v  <--  file1
16013new revision: 1\.2; previous revision: 1\.1"
16014	  # The loginfo Log message should be an empty line and not "(null)"
16015	  # which is what some fprintf() implementations do with "%s"
16016	  # format and a NULL pointer...
16017	  if $remote; then
16018	    dotest editor-emptylog-continue-4r \
16019"cat $CVSROOT_DIRNAME/CVSROOT/commitlog" \
16020"Start-Log
16021Update of $CVSROOT_DIRNAME/CVSROOT
16022In directory $hostname:$TMPDIR/cvs-serv[0-9a-z]*
16023
16024Modified Files:
16025	loginfo
16026Log Message:
16027loggem
16028End-Log
16029Start-Log
16030Update of $CVSROOT_DIRNAME/first-dir
16031In directory $hostname:$TMPDIR/cvs-serv[0-9a-z]*
16032
16033Modified Files:
16034	file1
16035Log Message:
16036
16037End-Log"
16038          else
16039	    dotest editor-emptylog-continue-4 \
16040"cat $CVSROOT_DIRNAME/CVSROOT/commitlog" \
16041"Start-Log
16042Update of $CVSROOT_DIRNAME/CVSROOT
16043In directory $hostname:$TESTDIR/1/CVSROOT
16044
16045Modified Files:
16046	loginfo
16047Log Message:
16048loggem
16049End-Log
16050Start-Log
16051Update of $CVSROOT_DIRNAME/first-dir
16052In directory $hostname:$TESTDIR/1/first-dir
16053
16054Modified Files:
16055	file1
16056Log Message:
16057
16058End-Log"
16059         fi
16060	  # There should have an empty log message at this point
16061	  dotest editor-emptylog-continue-5 "${testcvs} log -N -r1.2 file1" \
16062"
16063RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
16064Working file: file1
16065head: 1\.2
16066branch:
16067locks: strict
16068access list:
16069keyword substitution: kv
16070total revisions: 3;	selected revisions: 1
16071description:
16072----------------------------
16073revision 1\.2
16074date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: +0 -0;  commitid: ${commitid};
16075\*\*\* empty log message \*\*\*
16076============================================================================="
16077
16078	  # clean up
16079	  dokeep
16080	  # restore the default loginfo script
16081	  restore_adm
16082	  cd ../..
16083	  rm -r 1
16084	  rm $TESTDIR/editme
16085	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
16086	  ;;
16087
16088
16089
16090	env)
16091	  # Test to see if the CVS_PID environment variable is being set
16092	  mkdir ${TESTDIR}/env
16093	  cd ${TESTDIR}/env
16094	  dotest env-1 "${testcvs} -Q co . >>${LOGFILE}" ''
16095
16096	  cat > ${TESTDIR}/env/test-cvs-pid <<EOF
16097#!${TESTSHELL}
16098if test "x\$CVS_PID" != "x"; then
16099  # In local mode, there is no directory with the pid in it for use.
16100  # In remote mode the CVS_PID will be the parent process of the
16101  # cvs process that runs the commitinfo script.
16102  if test "x$remote" = "x:" ; then
16103    ppid=\`pwd | sed -e 's,.*/cvs-serv,,'\`
16104  else
16105    # This assumes that the -l switch puts PPID in the banner and does
16106    # not run the elements together such that whitespace surrounds the
16107    # pid and ppid in the output. This could be made slightly simpler
16108    # if all hosts had a 'ps' command that supported the -p switch,
16109    # but Solaris 7 /usr/ucb/ps does not and that may be the one we use.
16110    # It is because this is so messy that the CVS_PID feature exists.
16111    pid=\$\$
16112    pidcmd="ps -o pid,ppid -p \$pid || ps -el || ps -al"
16113    if echo \$pidcmd | sh >pid.stdout 2> pid.stderr; then
16114      ppid=\`cat pid.stdout |\\
16115      awk '/PPID/ { for (i=1; i <= NF; i++) {
16116                      if (\$i == "PPID") ppidx = i; 
16117                      if (\$i == "PID") pidx = i;
16118		    }
16119                    next; 
16120                  }
16121                  { print \$pidx " " \$ppidx }' |\\
16122      grep "^\$pid " |\\
16123      awk '{ print \$NF }'\`
16124    else
16125      ppid=unkown
16126    fi
16127  fi
16128  if test "x\$ppid" = "x\${CVS_PID}"; then
16129    # The PID looks okay to me
16130    # Clean up any temporary files
16131    rm -f pid.stdout pid.stderr
16132    exit 0
16133  else
16134    echo The environment variable CVS_PID is not properly set.
16135    echo It should have been set to \'\$ppid\' but instead was \'\$CVS_PID\'
16136    echo It is possible that this test is broken for your host.
16137    echo Current pid: \$pid
16138    [ -n "\$pidcmd" ] && echo "Command: \$pidcmd"
16139    [ -s pid.stdout ] && echo Standard Out: && cat pid.stdout
16140    [ -s pid.stderr ] && echo Standard Error: && cat pid.stderr
16141    exit 1
16142  fi
16143else
16144  echo The environment variable CVS_PID is not set.
16145  exit 1
16146fi
16147EOF
16148	  if test -n "$remotehost"; then
16149	    $CVS_RSH $remotehost "chmod +x ${TESTDIR}/env/test-cvs-pid"
16150	  else
16151	    chmod +x ${TESTDIR}/env/test-cvs-pid
16152	  fi
16153	  cd CVSROOT
16154	  echo "^env ${TESTDIR}/env/test-cvs-pid %r/%p %s" >>commitinfo
16155	  dotest env-2 "${testcvs} -q ci -m test-pid commitinfo" \
16156"${CVSROOT_DIRNAME}/CVSROOT/commitinfo,v  <--  commitinfo
16157new revision: 1\.2; previous revision: 1\.1
16158${SPROG} commit: Rebuilding administrative file database"
16159	  cd ..
16160	  mkdir env
16161	  dotest env-3 "${testcvs} -q add env" \
16162"Directory ${CVSROOT_DIRNAME}/env added to the repository"
16163	  cd env
16164	  echo testing >file1
16165	  dotest env-4 "${testcvs} add file1" \
16166"${SPROG} add: scheduling file .file1. for addition
16167${SPROG} add: use .${SPROG} commit. to add this file permanently"
16168	  dotest env-5 "${testcvs} -q commit -m test-pid" \
16169"${CVSROOT_DIRNAME}/env/file1,v  <--  file1
16170initial revision: 1\.1"
16171
16172	  dokeep
16173	  # undo commitinfo changes
16174	  restore_adm
16175	  cd ../..
16176	  rm -fr $TESTDIR/env
16177	  modify_repo rm -rf $CVSROOT_DIRNAME/env
16178	  ;;
16179
16180
16181
16182	errmsg1)
16183	  modify_repo mkdir $CVSROOT_DIRNAME/1dir
16184	  mkdir 1
16185	  cd 1
16186	  dotest errmsg1-init-1 "$testcvs -Q co 1dir"
16187	  cd 1dir
16188	  touch foo
16189	  dotest errmsg-init-2 "$testcvs -Q add foo"
16190	  if ${testcvs} ci -m added >>${LOGFILE} 2>&1; then
16191	      pass 164
16192	  else
16193	      fail 164
16194	  fi
16195	  cd ../..
16196	  mkdir 2
16197	  cd 2
16198	  if ${testcvs} -q co 1dir >>${LOGFILE}; then
16199	      pass 165
16200	  else
16201	      fail 165
16202	  fi
16203	  chmod a-w 1dir
16204	  cd ../1/1dir
16205	  rm foo;
16206	  if ${testcvs} rm foo >>${LOGFILE} 2>&1; then
16207	      pass 166
16208	  else
16209	      fail 166
16210	  fi
16211	  if ${testcvs} ci -m removed >>${LOGFILE} 2>&1; then
16212	      pass 167
16213	  else
16214	      fail 167
16215	  fi
16216
16217	  cd ../../2/1dir
16218	  # The second case in the local and remote versions of errmsg1-168
16219	  # below happens on Cygwin under Windows, where write privileges
16220	  # aren't enforced properly.
16221	  if $remote; then
16222	    dotest errmsg1-168r "${testcvs} -q update" \
16223"${SPROG} update: \`foo' is no longer in the repository
16224$CPROG update: unable to remove \./foo: Permission denied" \
16225"${SPROG} update: \`foo' is no longer in the repository"
16226	  else
16227	    dotest errmsg1-168 "${testcvs} -q update" \
16228"${SPROG} update: \`foo' is no longer in the repository
16229${SPROG} update: unable to remove foo: Permission denied" \
16230"${SPROG} update: \`foo' is no longer in the repository"
16231	  fi
16232
16233	  dokeep
16234	  cd ..
16235	  chmod u+w 1dir
16236	  cd ..
16237	  rm -r 1 2
16238	  modify_repo rm -rf $CVSROOT_DIRNAME/1dir
16239	  ;;
16240
16241
16242
16243	errmsg2)
16244	  # More tests of various miscellaneous error handling,
16245	  # and cvs add behavior in general.
16246	  # See also test basicb-4a, concerning "cvs ci CVS".
16247	  # Too many tests to mention test the simple cases of
16248	  # adding files and directories.
16249	  # Test basicb-2a10 tests cvs -n add.
16250
16251	  # First the usual setup; create a directory first-dir.
16252	  mkdir 1; cd 1
16253	  dotest errmsg2-1 "$testcvs -q co -l ."
16254	  mkdir first-dir
16255	  dotest errmsg2-2 "${testcvs} add first-dir" \
16256"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
16257          cd first-dir
16258	  dotest_fail errmsg2-3 "${testcvs} add CVS" \
16259"${CPROG} add: cannot add special file .CVS.; skipping"
16260	  touch file1
16261	  # For the most part add returns a failure exitstatus if
16262	  # there are any errors, even if the remaining files are
16263	  # processed without incident.  The "cannot add
16264	  # special file" message fits this pattern, at
16265	  # least currently.
16266	  dotest_fail errmsg2-4 "${testcvs} add CVS file1" \
16267"${CPROG} add: cannot add special file .CVS.; skipping
16268${SPROG} add: scheduling file .file1. for addition
16269${SPROG} add: use .${SPROG} commit. to add this file permanently"
16270	  # I'm not sure these tests completely convey the various strange
16271	  # behaviors that CVS had before it specially checked for "." and
16272	  # "..".  Suffice it to say that these are unlikely to work right
16273	  # without a special case.
16274	  dotest_fail errmsg2-5 "${testcvs} add ." \
16275"${CPROG} add: cannot add special file .\..; skipping"
16276	  dotest_fail errmsg2-6 "${testcvs} add .." \
16277"${CPROG} add: cannot add special file .\.\..; skipping"
16278	  # Make sure that none of the error messages left droppings
16279	  # which interfere with normal operation.
16280	  dotest errmsg2-7 "${testcvs} -q ci -m add-file1" \
16281"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
16282initial revision: 1\.1"
16283	  mkdir sdir
16284	  cd ..
16285	  dotest errmsg2-8 "${testcvs} add first-dir/sdir" \
16286"Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
16287	  # while we're here... check commit with no CVS directory
16288	  dotest_fail errmsg2-8a "${testcvs} -q ci first-dir nonexistant" \
16289"${CPROG} commit: nothing known about .nonexistant'
16290${CPROG} \[commit aborted\]: correct above errors first!"
16291	  dotest_fail errmsg2-8b "$testcvs -q ci nonexistant first-dir" \
16292"$CPROG commit: nothing known about .nonexistant'
16293$CPROG \[commit aborted\]: correct above errors first!"
16294	  dotest errmsg2-8c "$testcvs -q ci first-dir"
16295
16296	  cd first-dir
16297
16298	  touch file10
16299	  mkdir sdir10
16300	  dotest errmsg2-10 "${testcvs} add file10 sdir10" \
16301"${SPROG} add: scheduling file .file10. for addition
16302Directory ${CVSROOT_DIRNAME}/first-dir/sdir10 added to the repository
16303${SPROG} add: use .${SPROG} commit. to add this file permanently"
16304	  dotest errmsg2-11 "${testcvs} -q ci -m add-file10" \
16305"$CVSROOT_DIRNAME/first-dir/file10,v  <--  file10
16306initial revision: 1\.1"
16307	  # Try to see that there are no droppings left by
16308	  # any of the previous tests.
16309	  dotest errmsg2-12 "${testcvs} -q update" ""
16310
16311	  # Now test adding files with '/' in the name, both one level
16312	  # down and more than one level down.
16313	  cd ..
16314	  mkdir first-dir/sdir10/ssdir
16315	  dotest errmsg2-13 "${testcvs} add first-dir/sdir10/ssdir" \
16316"Directory ${CVSROOT_DIRNAME}/first-dir/sdir10/ssdir added to the repository"
16317
16318	  touch first-dir/sdir10/ssdir/ssfile
16319	  dotest errmsg2-14 \
16320	    "${testcvs} add first-dir/sdir10/ssdir/ssfile" \
16321"${SPROG} add: scheduling file .first-dir/sdir10/ssdir/ssfile. for addition
16322${SPROG} add: use .${SPROG} commit. to add this file permanently"
16323	  touch first-dir/file15
16324	  dotest errmsg2-15 "${testcvs} add first-dir/file15" \
16325"${SPROG} add: scheduling file .first-dir/file15. for addition
16326${SPROG} add: use .${SPROG} commit. to add this file permanently"
16327
16328	  # Now the case where we try to give it a directory which is not
16329	  # under CVS control.
16330	  mkdir bogus-dir
16331	  touch bogus-dir/file16
16332	  # FIXCVS: The first message, from local CVS, is nice.  The second one
16333	  # is not nice; would be good to fix remote CVS to give a clearer
16334	  # message (e.g. the one from local CVS).  But at least it is an
16335	  # error message.
16336	  dotest_fail errmsg2-16 "${testcvs} add bogus-dir/file16" \
16337"${SPROG} add: in directory \`bogus-dir':
16338${SPROG} \[add aborted\]: there is no version here; do .${SPROG} checkout. first" \
16339"${CPROG} add: cannot open CVS/Entries for reading: No such file or directory
16340${CPROG} \[add aborted\]: no repository"
16341	  rm -r bogus-dir
16342
16343	  # One error condition we don't test for is trying to add a file
16344	  # or directory which already is there.
16345
16346	  dotest errmsg2-17 "${testcvs} -q ci -m checkin" \
16347"$CVSROOT_DIRNAME/first-dir/file15,v  <--  first-dir/file15
16348initial revision: 1\.1
16349$CVSROOT_DIRNAME/first-dir/sdir10/ssdir/ssfile,v  <--  first-dir/sdir10/ssdir/ssfile
16350initial revision: 1\.1"
16351	  dotest errmsg2-18 "${testcvs} -Q tag test" ''
16352
16353	  # trying to import the repository
16354
16355	  if $remote; then :; else
16356	    cd ${CVSROOT_DIRNAME}
16357	    dotest_fail errmsg2-20 "${testcvs} import -mtest . A B" \
16358"${SPROG} \[import aborted\]: attempt to import the repository"
16359	    dotest_fail errmsg2-21 "${testcvs} import -mtest first-dir A B" \
16360"${SPROG} \[import aborted\]: attempt to import the repository"
16361	  fi
16362
16363	  dokeep
16364	  cd ..
16365	  rm -r 1
16366	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
16367	  ;;
16368
16369
16370
16371	errmsg3)
16372	  # Test the *PANIC* message caused by missing administration files
16373	  mkdir errmsg3
16374	  cd errmsg3
16375	  mkdir CVS
16376	  dotest_fail errmsg3-1 "${testcvs} -q up" \
16377"${CPROG} update: in directory \`.':
16378${CPROG} update: CVS directory found without administrative files\.
16379${CPROG} update: Use CVS to create the CVS directory, or rename the
16380${CPROG} update: directory if it is intended to store something
16381${CPROG} update: besides CVS administrative files\.
16382${CPROG} \[update aborted\]: \*PANIC\* administration files missing!"
16383
16384	  dokeep
16385	  cd ..
16386	  rm -r errmsg3
16387	  ;;
16388
16389
16390
16391	close-stdout)
16392	  # Ensure that cvs update -p FILE > /dev/full fails
16393	  # Perform this test IFF /dev/full is a writable character device.
16394	  if test -w /dev/full && test -c /dev/full; then
16395	    mkdir close-stdout
16396	    cd close-stdout
16397	    echo a > file
16398	    dotest close-stdout-1 "$testcvs -Q import -m. closeout X Y" ''
16399	    dotest close-stdout-2 "$testcvs -Q co closeout" ''
16400	    # Match either a bare `write error' or
16401	    # `write error: No space left on device',
16402	    # since closeout.c can produce both.
16403	    dotest_fail close-stdout-3 \
16404		"${testcvs} -Q update -p closeout/file > /dev/full" \
16405		"${CPROG} \[update aborted\]: write error.*"
16406
16407	    dokeep
16408	    cd ..
16409	    rm -r close-stdout
16410	    modify_repo rm -rf $CVSROOT_DIRNAME/closeout
16411	  else
16412	    skip close-stdout '/dev/full is not available'
16413	  fi
16414	  ;;
16415
16416
16417
16418	debug-log-nonfatal)
16419	  # Once upon a time, failure to create the debug log could be fatal.
16420          if $remote; then :; else
16421            remoteonly debug-log-nonfatal
16422	    continue
16423	  fi
16424
16425	  mkdir $TESTDIR/unwritable
16426	  chmod a-w $TESTDIR/unwritable
16427	  if test -n "$CVS_CLIENT_LOG"; then
16428              save_CVS_CLIENT_LOG=$CVS_CLIENT_LOG
16429	  fi
16430	  CVS_CLIENT_LOG=$TESTDIR/unwritable/cvsclientlog
16431	  export CVS_CLIENT_LOG
16432
16433	  dotest debug-log-nonfatal-1 \
16434"$testcvs -Q co -p CVSROOT/config >/dev/null" \
16435"$CPROG checkout: opening to-server logfile $TESTDIR/unwritable/cvsclientlog.in: Permission denied
16436$CPROG checkout: opening from-server logfile $TESTDIR/unwritable/cvsclientlog.out: Permission denied"
16437
16438	  dokeep
16439	  rm -rf $TESTDIR/unwritable
16440	  unset CVS_CLIENT_LOG
16441	  if test -n "$save_CVS_CLIENT_LOG"; then
16442	      CVS_CLIENT_LOG=$save_CVS_CLIENT_LOG
16443	  fi
16444	  ;;
16445
16446
16447
16448	adderrmsg)
16449	  # Test some of the error messages the 'add' command can return and
16450	  # their reactions to '-q'.
16451
16452	  # First the usual setup; create a directory first-dir.
16453	  mkdir 1; cd 1
16454	  dotest adderrmsg-init1 "${testcvs} -q co -l ." ''
16455	  mkdir adderrmsg-dir
16456	  dotest adderrmsg-init2 "${testcvs} add adderrmsg-dir" \
16457"Directory ${CVSROOT_DIRNAME}/adderrmsg-dir added to the repository"
16458          cd adderrmsg-dir
16459
16460	  # try to add the admin dir
16461	  dotest_fail adderrmsg-1 "${testcvs} add CVS" \
16462"${CPROG} add: cannot add special file .CVS.; skipping"
16463	  # might not want to see this message when you 'cvs add *'
16464	  dotest_fail adderrmsg-2 "${testcvs} -q add CVS" ""
16465
16466	  # to test some other messages
16467	  touch file1
16468	  dotest adderrmsg-3 "${testcvs} add file1" \
16469"${SPROG} add: scheduling file .file1. for addition
16470${SPROG} add: use .${SPROG} commit. to add this file permanently"
16471
16472	  # add it twice
16473	  dotest_fail adderrmsg-4 "${testcvs} add file1" \
16474"${SPROG} add: \`file1' has already been entered"
16475	  dotest_fail adderrmsg-5 "${testcvs} -q add file1" ""
16476
16477	  dotest adderrmsg-6 "${testcvs} -q ci -madd" \
16478"$CVSROOT_DIRNAME/adderrmsg-dir/file1,v  <--  file1
16479initial revision: 1\.1"
16480
16481	  # file in Entries & repository
16482	  dotest_fail adderrmsg-7 "${testcvs} add file1" \
16483"${SPROG} add: \`file1' already exists, with version number 1\.1"
16484	  dotest_fail adderrmsg-8 "${testcvs} -q add file1" ""
16485
16486	  # clean up
16487	  dokeep
16488	  cd ../..
16489	  rm -r 1
16490	  modify_repo rm -rf $CVSROOT_DIRNAME/adderrmsg-dir
16491	  ;;
16492
16493
16494
16495	opterrmsg)
16496	  # Test some option parsing error messages
16497
16498	  # No init is necessary since these error messages are printed b4
16499	  # CVS looks for a sandbox or repository
16500
16501	  # -z used to accept non-numeric arguments.  This bit someone who
16502	  # attempted `cvs -z -n up' when the -n was read as the argument to
16503	  # -z.
16504	  dotest_fail opterrmsg-1 "${testcvs} -z -n up" \
16505"${CPROG}: gzip compression level must be between 0 and 9"
16506
16507	  # Some general -z checks
16508	  dotest_fail opterrmsg-2 "${testcvs} -z -1 up" \
16509"${CPROG}: gzip compression level must be between 0 and 9"
16510	  dotest_fail opterrmsg-3 "${testcvs} -z10 up" \
16511"${CPROG}: gzip compression level must be between 0 and 9"
16512	  ;;
16513
16514
16515
16516	devcom)
16517	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
16518	  mkdir 1
16519	  cd 1
16520	  dotest devcom-1 "$testcvs -q co first-dir"
16521
16522	  cd first-dir
16523	  echo abb >abb
16524	  dotest devcom-2 "$testcvs add abb" \
16525"$SPROG add: scheduling file \`abb' for addition
16526$SPROG add: use \`$SPROG commit' to add this file permanently"
16527
16528	  dotest devcom-3 "$testcvs -q ci -m added" \
16529"$CVSROOT_DIRNAME/first-dir/abb,v  <--  abb
16530initial revision: 1\.1"
16531
16532	  dotest_fail devcom-4 "$testcvs watch" "Usage$DOTSTAR"
16533
16534	  dotest devcom-5 "$testcvs watch on"
16535
16536	  echo abc >abc
16537	  dotest devcom-6 "$testcvs add abc" \
16538"$SPROG add: scheduling file \`abc' for addition
16539$SPROG add: use \`$SPROG commit' to add this file permanently"
16540
16541	  dotest devcom-7 "$testcvs -q ci -m added" \
16542"$CVSROOT_DIRNAME/first-dir/abc,v  <--  abc
16543initial revision: 1\.1"
16544
16545	  cd ../..
16546	  mkdir 2
16547	  cd 2
16548
16549	  dotest devcom-8 "$testcvs -q co first-dir" \
16550"U first-dir/abb
16551U first-dir/abc"
16552
16553	  cd first-dir
16554	  dotest_fail devcom-9 "test -w abb"
16555	  dotest_fail devcom-9b "test -w abc"
16556
16557	  dotest devcom-10 "$testcvs editors"
16558	  dotest devcom-11 "$testcvs edit abb"
16559
16560	  # Here we test for the traditional ISO C ctime() date format.
16561	  # We assume the C locale; I guess that works provided we set
16562	  # LC_ALL at the start of this script but whether these
16563	  # strings should vary based on locale does not strike me as
16564	  # self-evident.
16565	  dotest devcom-12 "$testcvs editors" \
16566"abb	${username}	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	[-a-zA-Z_.0-9]*	${TESTDIR}/2/first-dir"
16567
16568	  echo aaaa >>abb
16569	  dotest devcom-13 "$testcvs ci -m modify abb" \
16570"${CVSROOT_DIRNAME}/first-dir/abb,v  <--  abb
16571new revision: 1\.2; previous revision: 1\.1"
16572
16573	  # Unedit of a file not being edited should be a noop.
16574	  dotest devcom-14 "$testcvs unedit abb" ''
16575
16576	  dotest devcom-15 "$testcvs editors" ""
16577
16578	  dotest_fail devcom-16 "test -w abb"
16579
16580	  dotest devcom-17 "$testcvs edit abc"
16581
16582	  # Unedit of an unmodified file.
16583	  dotest devcom-18 "$testcvs unedit abc"
16584	  dotest devcom-19 "$testcvs edit abc"
16585
16586	  echo changedabc >abc
16587	  # Try to unedit a modified file; cvs should ask for confirmation
16588	  dotest devcom-20 "echo no | $testcvs unedit abc" \
16589"abc has been modified; revert changes? "
16590
16591	  dotest devcom-21 "echo changedabc | cmp - abc"
16592
16593	  # OK, now confirm the unedit
16594	  dotest devcom-22 "echo yes |$testcvs unedit abc" \
16595"abc has been modified; revert changes? "
16596
16597	  dotest devcom-23 "echo abc |cmp - abc"
16598
16599	  dotest devcom-24 "$testcvs watchers" ''
16600
16601	  # FIXME: This probably should be an error message instead
16602	  # of silently succeeding and printing nothing.
16603	  dotest devcom-a-nonexist "$testcvs watchers nonexist" ''
16604
16605	  dotest devcom-a1 "$testcvs watch add" ''
16606	  dotest devcom-a2 "$testcvs watchers" \
16607"abb	$username	edit	unedit	commit
16608abc	$username	edit	unedit	commit"
16609	  dotest devcom-a3 "$testcvs watch remove -a unedit abb" ''
16610	  dotest devcom-a4 "$testcvs watchers abb" \
16611"abb	$username	edit	commit"
16612
16613	  # Check tagging and checking out while we have a CVS
16614	  # directory in the repository.
16615	  dotest devcom-t0 "${testcvs} -q tag tag" \
16616'T abb
16617T abc'
16618	  cd ../..
16619	  mkdir 3
16620	  cd 3
16621
16622	  # Test commented out because the bug it tests for is not fixed
16623	  # The error is:
16624	  # cvs watchers: cannot open CVS/Entries for reading: No such file or directory
16625	  # cvs: ../../work/ccvs/src/fileattr.c:75: fileattr_read: Assertion `fileattr_stored_repos != ((void *)0)' failed.
16626:	  dotest devcom-t-nonexist "${testcvs} watchers nonexist" fixme
16627
16628	  dotest devcom-t1 "${testcvs} -q co -rtag first-dir/abb" \
16629'U first-dir/abb'
16630	  cd ..
16631	  # Since first-dir/abb is readonly, use -f.
16632	  rm -rf 3
16633
16634	  # Test checking out the directory rather than the file.
16635	  mkdir 3
16636	  cd 3
16637	  dotest devcom-t2 "${testcvs} -q co -rtag first-dir" \
16638'U first-dir/abb
16639U first-dir/abc'
16640	  cd ..
16641	  # Since the files are readonly, use -f.
16642	  rm -rf 3
16643
16644	  # Now do it again, after removing the val-tags file created
16645	  # by devcom-t1 to force CVS to search the repository
16646	  # containing CVS directories.
16647	  rm ${CVSROOT_DIRNAME}/CVSROOT/val-tags
16648	  mkdir 3
16649	  cd 3
16650	  dotest devcom-t3 "${testcvs} -q co -rtag first-dir" \
16651'U first-dir/abb
16652U first-dir/abc'
16653	  cd ..
16654	  # Since the files are readonly, use -f.
16655	  rm -rf 3
16656
16657	  # Now remove all the file attributes
16658	  cd 2/first-dir
16659	  dotest devcom-b0 "${testcvs} watch off" ''
16660	  dotest devcom-b1 "${testcvs} watch remove" ''
16661	  # Test that CVS 1.6 and earlier can handle the repository.
16662	  dotest_fail devcom-b2 "test -d ${CVSROOT_DIRNAME}/first-dir/CVS"
16663
16664	  # Now test watching just some, not all, files.
16665	  dotest devcom-some0 "${testcvs} watch on abc" ''
16666	  cd ../..
16667	  mkdir 3
16668	  cd 3
16669	  dotest devcom-some1 "${testcvs} -q co first-dir" 'U first-dir/abb
16670U first-dir/abc'
16671	  dotest devcom-some2 "test -w first-dir/abb" ''
16672	  dotest_fail devcom-some3 "test -w first-dir/abc" ''
16673
16674	  dokeep
16675	  cd ..
16676	  # Use -f because of the readonly files.
16677	  rm -rf 1 2 3
16678	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
16679	  ;;
16680
16681
16682
16683	devcom2)
16684	  # More watch tests, most notably setting watches on
16685	  # files in various different states.
16686	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
16687	  mkdir 1
16688	  cd 1
16689	  dotest devcom2-1 "${testcvs} -q co first-dir" ''
16690	  cd first-dir
16691
16692	  # This should probably be an error; setting a watch on a totally
16693	  # unknown file is more likely to be a typo than intentional.
16694	  # But that isn't the currently implemented behavior.
16695	  dotest devcom2-2 "${testcvs} watch on w1" ''
16696
16697	  touch w1 w2 w3 nw1
16698	  dotest devcom2-3 "${testcvs} add w1 w2 w3 nw1" "${DOTSTAR}"
16699	  # Letting the user set the watch here probably can be considered
16700	  # a feature--although it leads to a few potentially strange
16701	  # consequences like one user can set the watch and another actually
16702	  # adds the file.
16703	  dotest devcom2-4 "${testcvs} watch on w2" ''
16704	  dotest devcom2-5 "${testcvs} -Q ci -m add-them"
16705
16706	  # Note that this test differs in a subtle way from devcom-some0;
16707	  # in devcom-some0 the watch is creating a new fileattr file, and
16708	  # here we are modifying an existing one.
16709	  dotest devcom2-6 "${testcvs} watch on w3" ''
16710
16711	  # Now test that all the watches got set on the correct files
16712	  # FIXME: CVS should have a way to report whether watches are
16713	  # set, I think.  The "check it out and see if it read-only" is
16714	  # sort of OK, but is complicated by CVSREAD and doesn't help
16715	  # if the file is added and not yet committed or some such.
16716	  # Probably "cvs status" should report "watch: on" if watch is on
16717	  # (and nothing if watch is off, so existing behavior is preserved).
16718	  cd ../..
16719	  mkdir 2
16720	  cd 2
16721	  dotest devcom2-7 "${testcvs} -q co first-dir" 'U first-dir/nw1
16722U first-dir/w1
16723U first-dir/w2
16724U first-dir/w3'
16725	  dotest devcom2-8 "test -w first-dir/nw1" ''
16726	  dotest_fail devcom2-9 "test -w first-dir/w1" ''
16727	  dotest_fail devcom2-10 "test -w first-dir/w2" ''
16728	  dotest_fail devcom2-11 "test -w first-dir/w3" ''
16729
16730	  cd first-dir
16731	  # OK, now we want to try files in various states with cvs edit.
16732	  dotest_fail devcom2-12 "$testcvs edit w4" \
16733"${CPROG} edit: no such file w4; ignored"
16734	  # Try the same thing with a per-directory watch set.
16735	  dotest devcom2-13 "${testcvs} watch on" ''
16736	  dotest_fail devcom2-14 "$testcvs edit w5" \
16737"${CPROG} edit: no such file w5; ignored"
16738	  dotest devcom2-15 "${testcvs} editors" ''
16739	  dotest devcom2-16 "${testcvs} editors w4" ''
16740	  # Make sure there are no droppings lying around
16741	  dotest devcom2-17 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
16742"Fw1	_watched=
16743Fw2	_watched=
16744Fw3	_watched=
16745Fnw1	_watched=
16746D	_watched="
16747	  cd ..
16748
16749	  # Do a little error testing
16750	  dotest devcom2-18 "${testcvs} -q co -d first+dir first-dir" \
16751"U first${PLUS}dir/nw1
16752U first${PLUS}dir/w1
16753U first${PLUS}dir/w2
16754U first${PLUS}dir/w3"
16755	  cd first+dir
16756	  dotest_fail devcom2-19 "${testcvs} edit" \
16757"${CPROG} \[edit aborted\]: current directory (${TESTDIR}/2/first${PLUS}dir) contains an invalid character (${PLUS},>;=\\\\t\\\\n)"
16758
16759	  # Make sure there are no droppings lying around
16760	  dotest devcom2-20 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
16761"Fw1	_watched=
16762Fw2	_watched=
16763Fw3	_watched=
16764Fnw1	_watched=
16765D	_watched="
16766
16767	  dokeep
16768	  cd ../..
16769	  # Use -f because of the readonly files.
16770	  rm -rf 1 2
16771	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
16772	  ;;
16773
16774
16775
16776	devcom3)
16777	  # More watch tests, most notably handling of features designed
16778	  # for future expansion.
16779	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
16780	  mkdir 1
16781	  cd 1
16782
16783	  # Set up logging via the postwatch script hook.  See the `info' test
16784	  # for a list of tests where other script hooks are tested.
16785	  dotest devcom3-init-1 "$testcvs -Q co CVSROOT"
16786	  cd CVSROOT
16787	  echo "ALL $TESTDIR/1/loggit %r %p %c" >>postwatch
16788	  dotest devcom3-init-2 "$testcvs -Q ci -mlog-watch"
16789	  cd .. # 1
16790
16791	  cat >loggit <<EOF
16792#!$TESTSHELL
16793echo \${1+"\$@"} >>$TESTDIR/1/watch-log
16794EOF
16795	  # #^@&!^@ Cygwin.
16796	  if test -n "$remotehost"; then
16797	    $CVS_RSH $remotehost "chmod +x $TESTDIR/1/loggit"
16798	  else
16799	    chmod +x loggit
16800	  fi
16801
16802
16803
16804	  dotest devcom3-1 "$testcvs -q co first-dir"
16805	  cd first-dir
16806
16807	  touch w1 w2
16808	  dotest devcom3-2 "${testcvs} add w1 w2" "${DOTSTAR}"
16809	  dotest devcom3-3 "${testcvs} watch on w1 w2" ''
16810	  dotest devcom3-4 "${testcvs} -Q ci -m add-them"
16811
16812	  # OK, since we are about to delve into CVS's internals, make
16813	  # sure that we seem to be correct about how they work.
16814	  dotest devcom3-5 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
16815"Fw1	_watched=
16816Fw2	_watched="
16817	  # Now write a few more lines, just as if we were a newer version
16818	  # of CVS implementing some new feature.
16819	  cat <<'EOF' >>${CVSROOT_DIRNAME}/first-dir/CVS/fileattr
16820Enew	line	here
16821G@#$^!@#=&
16822EOF
16823	  # Now get CVS to write to the fileattr file....
16824	  dotest devcom3-6 "${testcvs} watch off w1" ''
16825	  # ...and make sure that it hasn't clobbered our new lines.
16826	  # Note that writing these lines in another order would be OK
16827	  # too.
16828	  dotest devcom3-7 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
16829"Fw2	_watched=
16830G@#..!@#=&
16831Enew	line	here"
16832
16833	  # See what CVS does when a file name is duplicated.  The
16834	  # behavior of all versions of CVS since file attributes were
16835	  # implemented is that it nukes the duplications.  This seems
16836	  # reasonable enough, although it means it isn't clear how
16837	  # useful duplicates would be for purposes of future
16838	  # expansion.  But in the interests of keeping behaviors
16839	  # predictable, might as well test for it, I guess.
16840	  echo 'Fw2	duplicate=' >>${CVSROOT_DIRNAME}/first-dir/CVS/fileattr
16841	  dotest devcom3-8 "${testcvs} watch on w1" ''
16842	  dotest devcom3-9 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
16843"Fw2	_watched=
16844Fw1	_watched=
16845Enew	line	here
16846G@#..!@#=&"
16847
16848	  # Now test disconnected "cvs edit" and the format of the
16849	  # CVS/Notify file.
16850	  if $remote; then
16851	    CVS_SERVER_save=$CVS_SERVER
16852	    CVS_SERVER=$TESTDIR/cvs-none; export CVS_SERVER
16853
16854	    # The ${DOTSTAR} below matches the exact CVS server error message,
16855	    # which in :fork: mode is:
16856	    # "$SPROG \[edit aborted\]: cannot exec $TESTDIR/cvs-none: ${DOTSTAR}",
16857	    # but which is:
16858	    # "bash2: line 1: $TESTDIR/cvs-none: No such file or directory"
16859	    # when testing across an :ext:/ssh link to my Linux 2.4 box.
16860	    #
16861	    # I can't even test for the second part of the error message,
16862	    # from the client, which varies more consistently, usually either
16863	    # "end of file from server" (if the process doing the exec exits
16864	    # before the parent gets around to sending data to it) or
16865	    # "received broken pipe signal" (if it is the other way around),
16866	    # since HP-UX fails to output it.
16867	    dotest_fail devcom3-9ar "$testcvs edit w1 2>/dev/null"
16868	    dotest devcom3-9br "test -w w1"
16869	    dotest devcom3-9cr "cat CVS/Notify" \
16870"Ew1	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	[-a-zA-Z_.0-9]*	${TESTDIR}/1/first-dir	EUC"
16871	    CVS_SERVER=${CVS_SERVER_save}; export CVS_SERVER
16872	    if $proxy; then
16873	      dotest_fail devcom3-9dp "$testcvs -q update" \
16874"This CVS server does not support disconnected \`cvs edit'\.  For now, remove all \`CVS/Notify' files in your workspace and try your command again\."
16875	      dotest devcom3-9ep "test -f CVS/Notify"
16876	      rm CVS/Notify
16877	      dotest devcom3-9hp "$testcvs watchers w1"
16878	    else
16879	      dotest devcom3-9dr "$testcvs -q update"
16880	      dotest_fail devcom3-9er "test -f CVS/Notify"
16881	      dotest devcom3-9fr "$testcvs watchers w1" \
16882"w1	$username	tedit	tunedit	tcommit"
16883	    fi
16884	    dotest devcom3-9gr "$testcvs unedit w1"
16885	    dotest devcom3-9hr "$testcvs watchers w1"
16886	  fi
16887
16888	  cd ../..
16889	  # OK, now change the tab to a space, and see that CVS gives
16890	  # a reasonable error (this is database corruption but CVS should
16891	  # not lose its mind).
16892	  sed -e 's/Fw2	/Fw2 /' <$CVSROOT_DIRNAME/first-dir/CVS/fileattr \
16893	    >$CVSROOT_DIRNAME/first-dir/CVS/fileattr.new
16894	  modify_repo mv $CVSROOT_DIRNAME/first-dir/CVS/fileattr.new \
16895			 $CVSROOT_DIRNAME/first-dir/CVS/fileattr
16896	  mkdir 2; cd 2
16897	  dotest_fail devcom3-10 "${testcvs} -Q co ." \
16898"${SPROG} \[checkout aborted\]: file attribute database corruption: tab missing in ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr"
16899
16900	  notifyworks=false
16901	  if $remote; then
16902	    if $proxy; then :; else
16903	      notifyworks=:
16904	    fi
16905	  fi
16906	  if $notifyworks; then
16907	    dotest devcom3-postwatch-examine-1r "cat $TESTDIR/1/watch-log" \
16908"$CVSROOT_DIRNAME first-dir watch
16909$CVSROOT_DIRNAME first-dir watch
16910$CVSROOT_DIRNAME first-dir watch
16911$CVSROOT_DIRNAME first-dir update
16912$CVSROOT_DIRNAME first-dir server"
16913	  else
16914	    dotest devcom3-postwatch-examine-1 "cat $TESTDIR/1/watch-log" \
16915"$CVSROOT_DIRNAME first-dir watch
16916$CVSROOT_DIRNAME first-dir watch
16917$CVSROOT_DIRNAME first-dir watch"
16918	  fi
16919
16920	  dokeep
16921	  restore_adm
16922	  cd ..
16923	  # Use -f because of the readonly files.
16924	  rm -rf 1 2
16925	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
16926	  ;;
16927
16928
16929
16930	watch4)
16931	  # More watch tests, including adding directories.
16932	  mkdir 1; cd 1
16933	  dotest watch4-0a "${testcvs} -q co -l ." ''
16934	  mkdir first-dir
16935	  dotest watch4-0b "${testcvs} add first-dir" \
16936"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
16937
16938	  cd first-dir
16939	  dotest watch4-1 "${testcvs} watch on" ''
16940	  # This is just like the 173 test
16941	  touch file1
16942	  dotest watch4-2 "$testcvs add file1" \
16943"$SPROG add: scheduling file .file1. for addition
16944$SPROG add: use .$SPROG commit. to add this file permanently"
16945	  dotest watch4-3 "$testcvs -q ci -m add" \
16946"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
16947initial revision: 1\.1"
16948	  # Now test the analogous behavior for directories.
16949	  mkdir subdir
16950	  dotest watch4-4 "${testcvs} add subdir" \
16951"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
16952	  cd subdir
16953	  touch sfile
16954	  dotest watch4-5 "${testcvs} add sfile" \
16955"${SPROG} add: scheduling file .sfile. for addition
16956${SPROG} add: use .${SPROG} commit. to add this file permanently"
16957	  dotest watch4-6 "${testcvs} -q ci -m add" \
16958"$CVSROOT_DIRNAME/first-dir/subdir/sfile,v  <--  sfile
16959initial revision: 1\.1"
16960	  cd ../../..
16961	  mkdir 2; cd 2
16962	  dotest watch4-7 "${testcvs} -q co first-dir" "U first-dir/file1
16963U first-dir/subdir/sfile"
16964	  dotest_fail watch4-8 "test -w first-dir/file1" ''
16965	  dotest_fail watch4-9 "test -w first-dir/subdir/sfile" ''
16966	  cd first-dir
16967	  dotest watch4-10 "${testcvs} edit file1" ''
16968	  echo 'edited in 2' >file1
16969	  cd ../..
16970
16971	  cd 1/first-dir
16972
16973            # NOTE: I'm leaving in '' as acceptable
16974            #  to maintain partial compatibility with CVS versions
16975            #  prior to the edit check patch.
16976          editorsLineRE="file1	$username	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	$hostname	$TESTDIR/2/first-dir"
16977	  dotest watch4-11 "$testcvs edit file1" "$editorsLineRE"
16978
16979	  echo 'edited in 1' >file1
16980	  dotest watch4-12 "${testcvs} -q ci -m edit-in-1" \
16981"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
16982new revision: 1\.2; previous revision: 1\.1"
16983	  cd ../..
16984	  cd 2/first-dir
16985	  dotest watch4-13 "${testcvs} -q update" \
16986"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
16987retrieving revision 1\.1
16988retrieving revision 1\.2
16989Merging differences between 1\.1 and 1\.2 into file1
16990rcsmerge: warning: conflicts during merge
16991${SPROG} update: conflicts found in file1
16992C file1"
16993	  if (echo yes | ${testcvs} unedit file1) >>${LOGFILE}; then
16994	    pass watch4-14
16995	  else
16996	    fail watch4-15
16997	  fi
16998	  # This could plausibly be defined to either go back to the revision
16999	  # which was cvs edit'd (the status quo), or back to revision 1.2
17000	  # (that is, the merge could update CVS/Base/file1).  We pick the
17001	  # former because it is easier to implement, not because we have
17002	  # thought much about which is better.
17003	  dotest watch4-16 "cat file1" ''
17004	  # Make sure CVS really thinks we are at 1.1.
17005	  dotest watch4-17 "${testcvs} -q update" "U file1"
17006	  dotest watch4-18 "cat file1" "edited in 1"
17007	  cd ../..
17008
17009	  # As a sanity check, make sure we are in the right place.
17010	  dotest watch4-cleanup-1 "test -d 1"
17011	  dotest watch4-cleanup-1 "test -d 2"
17012
17013	  dokeep
17014	  # Specify -f because of the readonly files.
17015	  rm -rf 1 2
17016	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
17017	  ;;
17018
17019
17020
17021	watch5)
17022	  # This test was designed to catch a problem in server
17023	  # mode where an 'cvs edit'd file disappeared from the
17024	  # CVS/Base directory when 'cvs status' or 'cvs update'
17025	  # was called on the file after the file was touched.
17026	  #
17027	  # This test is still here to prevent the bug from
17028	  # being reintroduced.
17029	  #
17030	  # The rationale for having CVS/Base stay around is that
17031	  # CVS/Base should be there if "cvs edit" has been run (this
17032	  # may be helpful as a "cvs editors" analogue, it is
17033	  # client-side and based on working directory not username;
17034	  # but more importantly, it isn't clear why a "cvs status"
17035	  # would act like an unedit, and even if it does, it would
17036	  # need to make the file read-only again).
17037
17038	  mkdir watch5; cd watch5
17039	  dotest watch5-0a "${testcvs} -q co -l ." ''
17040	  mkdir first-dir
17041	  dotest watch5-0b "${testcvs} add first-dir" \
17042"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
17043
17044	  cd first-dir
17045	  dotest watch5-1 "${testcvs} watch on" ''
17046	  # This is just like the 173 test
17047	  touch file1
17048	  dotest watch5-2 "${testcvs} add file1" \
17049"${SPROG} add: scheduling file .file1. for addition
17050${SPROG} add: use .${SPROG} commit. to add this file permanently"
17051	  dotest watch5-3 "${testcvs} -q ci -m add" \
17052"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
17053initial revision: 1\.1"
17054	  dotest watch5-4 "${testcvs} edit file1" ''
17055	  dotest watch5-5 "test -f CVS/Base/file1" ''
17056	  if ${testcvs} status file1 >>${LOGFILE} 2>&1; then
17057		pass watch5-6
17058	  else
17059		fail watch5-6
17060	  fi
17061	  dotest watch5-7 "test -f CVS/Base/file1" ''
17062
17063	  # Here's where the file used to dissappear
17064	  touch file1
17065	  if ${testcvs} status file1 >>${LOGFILE} 2>&1; then
17066		pass watch5-8
17067	  else
17068		fail watch5-8
17069	  fi
17070	  dotest watch5-10 "test -f CVS/Base/file1" ''
17071
17072	  # Make sure update won't remove the file either
17073	  touch file1
17074	  dotest watch5-11 "${testcvs} -q up" ''
17075	  dotest watch5-12 "test -f CVS/Base/file1" ''
17076
17077	  dokeep
17078	  cd ../..
17079	  rm -r watch5
17080	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
17081	  ;;
17082
17083
17084
17085	watch6-0)
17086
17087	  # Make sure that default attributes are being set properly.
17088	  # Specifying a directory has, it seems, never worked,
17089	  # and 1.12.10 broke it completely.
17090	  mkdir watch6-0; cd watch6-0
17091
17092	  dotest watch6-0-setup-1 "$testcvs -Q co -ldtop ."
17093	  cd top
17094	  mkdir watch6-0
17095	  dotest watch6-0-setup-2 "$testcvs -Q add watch6-0"
17096	  cd watch6-0
17097	  dotest watch6-0-1 "$testcvs watch add"
17098	  dotest watch6-0-2 "grep -qE '^D' $CVSROOT_DIRNAME/watch6-0/CVS/fileattr"
17099	  dotest watch6-0-3 "$testcvs watch remove"
17100	  dotest_fail watch6-0-4 "grep -qE '^D' $CVSROOT_DIRNAME/watch6-0/CVS/fileattr 2>/dev/null"
17101
17102	  dotest watch6-0-5 "$testcvs watch add ."
17103	  dotest watch6-0-6 "grep -qE '^D' $CVSROOT_DIRNAME/watch6-0/CVS/fileattr"
17104	  dotest watch6-0-7 "$testcvs watch remove ."
17105	  dotest_fail watch6-0-8 "grep -qE '^D' $CVSROOT_DIRNAME/watch6-0/CVS/fileattr 2>/dev/null"
17106
17107	  # OK, basic add/remove work. Now, make sure it works with named directories
17108	  mkdir dir1
17109	  mkdir dir2
17110	  mkdir dir3
17111	  echo afile>afile
17112	  $testcvs -Q add afile dir1 dir2 dir3
17113	  $testcvs -Q ci -m "Adding test files"
17114
17115	  # Current directory should not be watched, but there should be a watch on the file,
17116	  # and on dir1 & dir2, but not on dir3.
17117	  dotest watch6-0-9 "$testcvs -Q watch add afile dir1 dir2"
17118	  dotest_fail watch6-0-10 "grep -qE '^D' $CVSROOT_DIRNAME/watch6-0/CVS/fileattr 2>/dev/null"
17119	  dotest watch6-0-11 "grep -qE '^Fafile' $CVSROOT_DIRNAME/watch6-0/CVS/fileattr"
17120	  dotest watch6-0-12 "grep -qE '^D' $CVSROOT_DIRNAME/watch6-0/dir1/CVS/fileattr"
17121	  dotest watch6-0-13 "grep -qE '^D' $CVSROOT_DIRNAME/watch6-0/dir2/CVS/fileattr"
17122	  dotest_fail watch6-0-12 "grep -qE '^D' $CVSROOT_DIRNAME/watch6-0/dir3/CVS/fileattr 2>/dev/null"
17123
17124	  dokeep
17125	  cd ../../..
17126	  rm -rf watch6-0
17127	  modify_repo rm -rf $CVSROOT_DIRNAME/watch6-0
17128	  ;;
17129
17130
17131
17132	watch6)
17133	  # Check that `cvs watch on' does not reset the fileattr file.
17134	  mkdir watch6; cd watch6
17135
17136	  dotest watch6-setup-1 "$testcvs -Q co -ldtop ."
17137	  cd top
17138	  mkdir watch6
17139	  dotest watch6-setup-2 "$testcvs -Q add watch6"
17140
17141	  # I don't recall why I had these next 3 lines.
17142	  cd ..
17143	  dotest watch6-setup-3 "$testcvs -Q co watch6"
17144	  cd watch6
17145
17146	  mkdir subdir
17147	  dotest watch6-setup-4 "$testcvs -Q add subdir"
17148	  cd subdir
17149
17150	  # START watch add/remove sequence
17151	  dotest watch6-1 "$testcvs -Q watch add"
17152	  dotest watch6-2 \
17153"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
17154
17155	  dotest watch6-3 "$testcvs watch on"
17156	  dotest watch6-4 \
17157"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
17158	  dotest watch6-5 \
17159"grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
17160
17161	  dotest watch6-6 "$testcvs watch off"
17162	  dotest watch6-7 \
17163"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
17164	  dotest_fail watch6-8 \
17165"grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
17166
17167	  dotest watch6-9 "$testcvs watch remove"
17168	  dotest_fail watch6-10 \
17169"test -d $CVSROOT_DIRNAME/test-directory/subdir/CVS"
17170	  dotest_fail watch6-11 \
17171"test -f $CVSROOT_DIRNAME/test-directory/subdir/CVS/fileattr"
17172	  # END watch add/remove sequence
17173
17174	  echo Hi there >afile
17175	  dotest watch6-12 "$testcvs -Q add afile"
17176	  dotest watch6-13 "$testcvs ci -m 'A file' afile" \
17177"$CVSROOT_DIRNAME/watch6/subdir/afile,v  <--  afile
17178initial revision: 1.1"
17179
17180	  # START watch add/remove sequence
17181	  dotest watch6-14 "$testcvs -Q watch add"
17182	  dotest watch6-15 \
17183"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
17184
17185	  dotest watch6-16 "$testcvs watch on"
17186	  dotest watch6-17 \
17187"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
17188	  dotest watch6-18 \
17189"grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
17190
17191	  dotest watch6-19 "$testcvs watch off"
17192	  dotest watch6-20 \
17193"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
17194	  dotest_fail watch6-21 \
17195"grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
17196
17197	  dotest watch6-22 "$testcvs watch remove"
17198	  dotest_fail watch6-23 \
17199"test -d $CVSROOT_DIRNAME/test-directory/subdir/CVS"
17200	  dotest_fail watch6-24 \
17201"test -f $CVSROOT_DIRNAME/test-directory/subdir/CVS/fileattr"
17202	  # END watch add/remove sequence
17203
17204	  if $keep; then
17205	    echo Keeping $TESTDIR and exiting due to --keep
17206	    exit 0
17207	  fi
17208	  cd ../../..
17209	  rm -r watch6
17210	  modify_repo rm -rf $CVSROOT_DIRNAME/watch6
17211	  ;;
17212
17213
17214
17215        edit-check)
17216          # This tests the edit -c/-f and related features.
17217
17218	  mkdir edit-check; cd edit-check
17219	  dotest edit-check-0a "$testcvs -q co -l ."
17220	  mkdir first-dir
17221	  dotest edit-check-0b "$testcvs add first-dir" \
17222"Directory $CVSROOT_DIRNAME/first-dir added to the repository"
17223
17224	  cd first-dir
17225	  dotest edit-check-1 "$testcvs watch on"
17226
17227          echo foo > file1
17228          dotest edit-check-2a "$testcvs add -minitial file1" \
17229"$SPROG [a-z]*: scheduling file .file1. for addition
17230$SPROG [a-z]*: use .$SPROG commit. to add this file permanently"
17231
17232          dotest edit-check-2b "$testcvs commit -m 'c1' file1" \
17233"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
17234initial revision: 1\.1"
17235
17236          editorsLineRE="file1	$username	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	$hostname	$TESTDIR/edit-check/first-dir"
17237
17238          R_editorsLineRE="first-dir/file1	$username	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	$hostname	$TESTDIR/edit-check"
17239          F3_editorsLineRE="second-dir/file3	$username	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	$hostname	$TESTDIR/edit-check/first-dir"
17240
17241          A_editorsLineRE="file1	[-a-zA-Z0-9_]*	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	$hostname	$TESTDIR[0-9]*/edit-check/first-dir"
17242
17243          AF_editorsLineRE="file[12]	[-a-zA-Z0-9_]*	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	$hostname	$TESTDIR/edit-check/first-dir"
17244
17245          NF_editorsLineRE="	[-a-zA-Z0-9_]*	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	$hostname	$TESTDIR/edit-check/first-dir"
17246
17247          dotest edit-check-3 "$testcvs edit file1"
17248          dotest edit-check-4 "$testcvs edit file1" "$editorsLineRE"
17249
17250          dotest_fail edit-check-5a "$testcvs edit -c file1" \
17251"$editorsLineRE
17252$SPROG edit: Skipping file \`file1' due to existing editors\."
17253
17254          dotest edit-check-5b "$testcvs editors" "$editorsLineRE"
17255
17256          dotest edit-check-6a "$testcvs edit -c -f file1" "$editorsLineRE"
17257          dotest edit-check-6b "$testcvs editors" "$editorsLineRE"
17258
17259          dotest edit-check-7a "cat file1" "foo"
17260          echo "bar" > file1
17261          dotest_fail edit-check-7b "$testcvs edit -c file1" \
17262"$editorsLineRE
17263$SPROG edit: Skipping file \`file1' due to existing editors\."
17264          dotest edit-check-7c "cat file1" "bar"
17265
17266            # edit-check-8a has issues.  It copies the current (modified)
17267            # version of the file into CVS/Base, so that edit-check-9a and
17268            # edit-check-9b don't get the expected results.
17269            #   Maybe unedit is *supposed* to return it to the state
17270            # it was in before the edit (even if it was modified),
17271            # but while that has a certain symetry, it doesn't seem
17272            # to pass the intuitive-usability test.
17273            #   This aspect of the general problem could
17274            # be fixed by not overwriting pre-existing Base versions,
17275            # but it still wouldn't fix it if the user manually
17276            # modified the file before doing the first edit.
17277            #   Because of the possibility that this is working as
17278            # intended, I'm just commenting out the test, not fixing
17279            # the issue.
17280          #dotest edit-check-8a "${testcvs} edit -c -f file1" \
17281          #   "${editorsLineRE}"
17282          dotest edit-check-8b "$testcvs editors" "$editorsLineRE"
17283
17284          dotest edit-check-9a "echo yes | $testcvs unedit file1" \
17285"file1 has been modified; revert changes? "
17286          dotest edit-check-9b "$testcvs editors"
17287          dotest edit-check-9c "cat file1" "foo"
17288
17289          dotest edit-check-10 "$testcvs edit -c file1"
17290          dotest_fail edit-check-11 "$testcvs edit -c file1" \
17291"$editorsLineRE
17292$SPROG edit: Skipping file \`file1' due to existing editors\."
17293
17294          echo "morefoo" > file1
17295          dotest edit-check-12a "$testcvs commit -m 'c2' -c file1" \
17296"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
17297new revision: 1\.2; previous revision: 1\.1"
17298          dotest edit-check-12b "$testcvs editors file1"
17299
17300          chmod u+w file1
17301          echo "morebar" > file1
17302          dotest_fail edit-check-13a "$testcvs commit -m 'c3' -c file1" \
17303"$SPROG [a-z]*: Valid edit does not exist for file1
17304$SPROG \[[a-z]* aborted\]: correct above errors first!"
17305          dotest edit-check-13b "$testcvs editors file1"
17306
17307          dotest edit-check-14a "$testcvs commit -m 'c4' -c -f file1" \
17308"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
17309new revision: 1\.3; previous revision: 1\.2"
17310          dotest edit-check-14b "$testcvs editors file1"
17311
17312          dotest edit-check-15 "$testcvs edit -c file1"
17313          cd ..
17314
17315          dotest edit-check-16a "echo yes | $testcvs release -d first-dir" \
17316"You have \[0\] altered files in this repository.
17317Are you sure you want to release (and delete) directory \`first-dir': "
17318          dotest edit-check-16b "$testcvs -q update -d first-dir" \
17319             "U first-dir/file1"
17320          cd first-dir
17321          dotest edit-check-16c "$testcvs editors file1"
17322
17323          cd ..
17324          dotest edit-check-17a "$testcvs edit -c"
17325          dotest_fail edit-check-17b "$testcvs edit -c" \
17326"$R_editorsLineRE
17327$SPROG edit: Skipping file \`first-dir/file1' due to existing editors\."
17328          dotest edit-check-17c "$testcvs edit -c -f" "$R_editorsLineRE"
17329
17330          echo "more changes" > first-dir/file1
17331          dotest edit-check-18a "$testcvs -q commit -m 'c5' -c" \
17332"$CVSROOT_DIRNAME/first-dir/file1,v  <--  first-dir/file1
17333new revision: 1\.4; previous revision: 1\.3"
17334          dotest edit-check-18b "$testcvs editors"
17335
17336          cd first-dir
17337
17338            # Manually fake another editor:
17339
17340            # Try to gaurantee a seperate name for an "other" user editting
17341            # the file.
17342          otherUser="dummyUser"
17343          if [ x"$USER" = x"$otherUser" ]  ; then
17344            otherUser="dummyUser2"
17345          fi
17346          if [ x"$LOGNAME" = x"$otherUser" ] ; then
17347            otherUser="dummyUser3"
17348          fi
17349          tabChar='	'
17350
17351          backupFileattrName="$CVSROOT_DIRNAME/first-dir/CVS/bak.fileattr.$$"
17352          mv $CVSROOT_DIRNAME/first-dir/CVS/fileattr $backupFileattrName
17353
17354          otherDir="`pwd | sed 's%/edit-check/%2/edit-check/%'`"
17355          echo \
17356"Ffile1${tabChar}_watched=;_editors=$otherUser>Sat Oct  6 04:25:00 2001 -0000+`hostname`+$otherDir;_watchers=$otherUser>tedit+tunedit+tcommit
17357D${tabChar}_watched=" > $CVSROOT_DIRNAME/first-dir/CVS/fileattr
17358
17359          editFileattrName="$CVSROOT_DIRNAME/first-dir/CVS/edit.fileattr.$$"
17360          cp $CVSROOT_DIRNAME/first-dir/CVS/fileattr $editFileattrName
17361
17362          O_editorsLineRE="file1	$otherUser	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	$hostname	$TESTDIR[0-9]/edit-check/first-dir"
17363
17364          dotest edit-check-19a "$testcvs edit file1" "$O_editorsLineRE"
17365          dotest edit-check-19b "$testcvs editors" \
17366"$A_editorsLineRE
17367$NF_editorsLineRE"
17368
17369          dotest edit-check-20a "$testcvs unedit file1"
17370          dotest edit-check-20b "$testcvs editors" "$O_editorsLineRE"
17371
17372          dotest_fail edit-check-21a "$testcvs edit -c file1" \
17373"$O_editorsLineRE
17374$SPROG edit: Skipping file \`file1' due to existing editors\."
17375          dotest edit-check-21b "$testcvs editors" "$O_editorsLineRE"
17376
17377          dotest edit-check-22a "$testcvs edit -c -f file1" "$O_editorsLineRE"
17378          dotest edit-check-22b "$testcvs editors" \
17379"$A_editorsLineRE
17380$NF_editorsLineRE"
17381
17382          echo "Yet another change" >file1
17383
17384          dotest_fail edit-check-23a "$testcvs edit -c" \
17385"$A_editorsLineRE
17386$NF_editorsLineRE
17387$SPROG edit: Skipping file \`file1' due to existing editors\."
17388
17389          dotest edit-check-23b "$testcvs editors" \
17390"$A_editorsLineRE
17391$NF_editorsLineRE"
17392
17393          dotest edit-check-24a "echo y | $testcvs unedit" \
17394             "file1 has been modified; revert changes? "
17395          dotest edit-check-24b "$testcvs editors" "$O_editorsLineRE"
17396          dotest edit-check-24c "cat file1" "more changes"
17397
17398          dotest edit-check-25a "$testcvs unedit"
17399          dotest edit-check-25b "$testcvs editors" "$O_editorsLineRE"
17400          dotest_fail edit-check-25c "test -w file1"
17401
17402          dotest edit-check-26a "$testcvs edit file1" "$O_editorsLineRE"
17403          dotest edit-check-26b "$testcvs editors file1" \
17404"$A_editorsLineRE
17405$NF_editorsLineRE"
17406          dotest edit-check-26c "test -w file1"
17407
17408          echo "Yet more changes" >file1
17409          dotest edit-check-27a "$testcvs -q commit -mmsg -c file1" \
17410"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
17411new revision: 1\.5; previous revision: 1\.4"
17412          dotest edit-check-27b "$testcvs editors" "$O_editorsLineRE"
17413
17414          chmod u+w file1
17415          echo "unofficial change" >file1
17416
17417          dotest_fail edit-check-28a "$testcvs -q commit -mmsg -c" \
17418"$SPROG commit: Valid edit does not exist for file1
17419$SPROG \[commit aborted\]: correct above errors first!"
17420          dotest edit-check-28b "$testcvs editors" "$O_editorsLineRE"
17421
17422          dotest edit-check-29a "$testcvs -q commit -mmsg -c -f" \
17423"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
17424new revision: 1\.6; previous revision: 1\.5"
17425          dotest edit-check-29b "$testcvs editors" "$O_editorsLineRE"
17426          dotest edit-check-29c "cat file1" "unofficial change"
17427
17428          modify_repo cp "$backupFileattrName" \
17429			 $CVSROOT_DIRNAME/first-dir/CVS/fileattr
17430          dotest edit-check-30 "$testcvs editors"
17431
17432          # Make sure earlier unreported editors are reported properly
17433          # with the edit-check code running.
17434          if $remote; then
17435            CVS_SERVER_SAVED=$CVS_SERVER
17436            CVS_SERVER=$TESTDIR/cvs-none; export CVS_SERVER
17437
17438            # The $DOTSTAR matches the exact exec error message
17439            # (which varies) and either "end of file from server"
17440            # (if the process doing the exec exits before the parent
17441            # gets around to sending data to it) or "broken pipe" (if it
17442            # is the other way around).
17443            dotest_fail edit-check-31ar "$testcvs edit file1" \
17444"$SPROG \[edit aborted\]: cannot exec $TESTDIR/cvs-none: $DOTSTAR"
17445            dotest edit-check-31br "test -w file1"
17446            dotest edit-check-31cr "cat CVS/Notify" \
17447"Efile1	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	[-a-zA-Z_.0-9]*	$TESTDIR/edit-check/first-dir	EUC"
17448            CVS_SERVER=$CVS_SERVER_SAVED; export CVS_SERVER
17449
17450            dotest_fail edit-check-31dr "$testcvs edit -c file1" \
17451"$editorsLineRE
17452$SPROG edit: Skipping file \`file1' due to existing editors\."
17453            dotest edit-check-31er "$testcvs editors file1" "$editorsLineRE"
17454            dotest edit-check-31fr "$testcvs unedit file1"
17455          fi
17456
17457           # Make sure it isn't confused by handling multiple files at
17458           # the same time:
17459          echo file2Data >file2
17460
17461          dotest edit-check-32a "$testcvs add file2" \
17462"$SPROG [a-z]*: scheduling file .file2. for addition
17463$SPROG [a-z]*: use .$SPROG commit. to add this file permanently"
17464
17465          dotest edit-check-32b "$testcvs commit -m 'c1' file2" \
17466"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
17467initial revision: 1\.1"
17468
17469          mkdir second-dir
17470          dotest edit-check-32c "$testcvs add second-dir" \
17471"Directory $CVSROOT_DIRNAME/first-dir/second-dir added to the repository"
17472          cd second-dir
17473          echo ThirdFile >file3
17474
17475          dotest edit-check-32d "$testcvs add file3" \
17476"$SPROG [a-z]*: scheduling file .file3. for addition
17477$SPROG [a-z]*: use .$SPROG commit. to add this file permanently"
17478
17479          dotest edit-check-32f "$testcvs commit -m 'c1' file3" \
17480"$CVSROOT_DIRNAME/first-dir/second-dir/file3,v  <--  file3
17481initial revision: 1\.1"
17482          dotest_fail edit-check-32g "test -w file3"
17483
17484          cd ..
17485
17486          dotest edit-check-33a "$testcvs edit -c"
17487
17488          dotest edit-check-33b "$testcvs editors" \
17489"$AF_editorsLineRE
17490$AF_editorsLineRE
17491$F3_editorsLineRE"
17492          dotest edit-check-33c "test -w second-dir/file3"
17493
17494          dotest_fail edit-check-34a "$testcvs edit -c file1 file2" \
17495"$AF_editorsLineRE
17496$SPROG edit: Skipping file \`file1' due to existing editors\.
17497$AF_editorsLineRE
17498$SPROG edit: Skipping file \`file2' due to existing editors\."
17499
17500          dotest edit-check-34b "$testcvs editors file1 file2" \
17501"$editorsLineRE
17502$AF_editorsLineRE"
17503
17504          dotest edit-check-35a "$testcvs unedit file1"
17505          dotest edit-check-35b "$testcvs editors" \
17506"$AF_editorsLineRE
17507$F3_editorsLineRE"
17508          dotest edit-check-35c "test -w second-dir/file3"
17509
17510          dotest edit-check-36a "$testcvs unedit"
17511          dotest edit-check-36b "$testcvs editors"
17512          dotest_fail edit-check-36c "test -w second-dir/file3"
17513
17514	  dokeep
17515          cd ../..
17516          rm -rf edit-check
17517          rm -rf $CVSROOT_DIRNAME/first-dir
17518          ;;
17519
17520
17521
17522	unedit-without-baserev)
17523	  mkdir 1; cd 1
17524	  module=x
17525
17526	  file=m
17527	  echo foo > $file
17528	  dotest unedit-without-baserev-1 \
17529	    "$testcvs -Q import -m . $module X Y" ''
17530	  dotest unedit-without-baserev-2 "$testcvs -Q co $module" ''
17531	  cd $module
17532
17533	  dotest unedit-without-baserev-3 "$testcvs -Q edit $file" ''
17534
17535	  echo add a line >> $file
17536	  rm -f CVS/Baserev
17537
17538	  # This will fail on most systems.
17539	  dotest unedit-without-baserev-4 "echo yes |${testcvs} -Q unedit $file" \
17540"m has been modified; revert changes${QUESTION} ${CPROG} unedit: m not mentioned in CVS/Baserev
17541${CPROG} unedit: run update to complete the unedit"
17542
17543	  # SunOS4.1.4 systems make it this far, but with a corrupted
17544	  # CVS/Entries file.  Demonstrate the corruption!
17545	  dotest unedit-without-baserev-5 "cat CVS/Entries" \
17546	    "/$file/1\.1\.1\.1/${DOTSTAR}"
17547
17548	  dotest unedit-without-baserev-6 "${testcvs} -q update" \
17549"$SPROG update: warning: \`m' was lost
17550U m"
17551
17552	  # OK, those were the easy cases.  Now tackle the hard one
17553	  # (the reason that CVS/Baserev was invented rather than just
17554	  # getting the revision from CVS/Entries).  This is very
17555	  # similar to watch4-10 through watch4-18 but with Baserev
17556	  # missing.
17557	  cd ../..
17558	  mkdir 2; cd 2
17559	  dotest unedit-without-baserev-7 "${testcvs} -Q co x" ''
17560	  cd x
17561
17562	  dotest unedit-without-baserev-10 "${testcvs} edit m" ''
17563	  echo 'edited in 2' >m
17564	  cd ../..
17565
17566	  cd 1/x
17567
17568          editorsLineRE="m	$username	[SMTWF][uoehra][neduit] [JFAMSOND][aepuco][nbrylgptvc] [0-9 ][0-9] [0-9:]* [0-9][0-9][0-9][0-9] -0000	$hostname	$TESTDIR/2/x"
17569	  dotest unedit-without-baserev-11 "$testcvs edit m" "$editorsLineRE"
17570
17571	  echo 'edited in 1' >m
17572	  dotest unedit-without-baserev-12 "${testcvs} -q ci -m edit-in-1" \
17573"$CVSROOT_DIRNAME/x/m,v  <--  m
17574new revision: 1\.2; previous revision: 1\.1"
17575	  cd ../..
17576	  cd 2/x
17577	  dotest unedit-without-baserev-13 "${testcvs} -q update" \
17578"RCS file: ${CVSROOT_DIRNAME}/x/m,v
17579retrieving revision 1\.1\.1\.1
17580retrieving revision 1\.2
17581Merging differences between 1\.1\.1\.1 and 1\.2 into m
17582rcsmerge: warning: conflicts during merge
17583${SPROG} update: conflicts found in m
17584C m"
17585	  rm CVS/Baserev
17586	  dotest unedit-without-baserev-14 "echo yes |${testcvs} unedit m" \
17587"m has been modified; revert changes${QUESTION} ${CPROG} unedit: m not mentioned in CVS/Baserev
17588${CPROG} unedit: run update to complete the unedit"
17589	  dotest unedit-without-baserev-15 "${testcvs} -q update" \
17590"$SPROG update: warning: \`m' was lost
17591U m"
17592	  # The following tests are kind of degenerate compared with
17593	  # watch4-16 through watch4-18 but might as well make sure that
17594	  # nothing seriously wrong has happened to the working directory.
17595	  dotest unedit-without-baserev-16 "cat m" 'edited in 1'
17596	  # Make sure CVS really thinks we are at 1.2.
17597	  dotest unedit-without-baserev-17 "${testcvs} -q update" ""
17598	  dotest unedit-without-baserev-18 "cat m" "edited in 1"
17599
17600	  dokeep
17601	  cd ../..
17602	  rm -rf 1
17603	  rm -r 2
17604	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
17605	  ;;
17606
17607
17608
17609	ignore)
17610	  # On Windows, we can't check out CVSROOT, because the case
17611	  # insensitivity means that this conflicts with cvsroot.
17612	  mkdir ignore
17613	  cd ignore
17614
17615	  dotest ignore-1 "${testcvs} -q co CVSROOT" "U CVSROOT/${DOTSTAR}"
17616	  cd CVSROOT
17617	  echo rootig.c >cvsignore
17618	  dotest ignore-2 "${testcvs} add cvsignore" "${SPROG}"' add: scheduling file `cvsignore'"'"' for addition
17619'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
17620
17621	  dotest ignore-3 " ${testcvs} ci -m added" \
17622"${CPROG} commit: Examining \.
17623${CVSROOT_DIRNAME}/CVSROOT/cvsignore,v  <--  cvsignore
17624initial revision: 1\.1
17625${SPROG} commit: Rebuilding administrative file database"
17626
17627	  cd ..
17628	  if echo "yes" | ${testcvs} release -d CVSROOT >>${LOGFILE} ; then
17629	      pass ignore-4
17630	  else
17631	      fail ignore-4
17632	  fi
17633
17634	  # CVS looks at the home dir from getpwuid, not HOME (is that correct
17635	  # behavior?), so this is hard to test and we won't try.
17636	  # echo foobar.c >${HOME}/.cvsignore
17637	  CVSIGNORE=envig.c; export CVSIGNORE
17638	  mkdir dir-to-import
17639	  cd dir-to-import
17640	  touch foobar.c bar.c rootig.c defig.o envig.c optig.c
17641	  # We use sort because we can't predict the order in which
17642	  # the files will be listed.
17643	  dotest_sort ignore-5 "${testcvs} import -m m -I optig.c ignore/first-dir tag1 tag2" \
17644'
17645
17646I ignore/first-dir/defig.o
17647I ignore/first-dir/envig.c
17648I ignore/first-dir/optig.c
17649I ignore/first-dir/rootig.c
17650N ignore/first-dir/bar.c
17651N ignore/first-dir/foobar.c
17652No conflicts created by this import'
17653	  dotest_sort ignore-6 "${testcvs} import -m m -I ! ignore/second-dir tag3 tag4" \
17654'
17655
17656N ignore/second-dir/bar.c
17657N ignore/second-dir/defig.o
17658N ignore/second-dir/envig.c
17659N ignore/second-dir/foobar.c
17660N ignore/second-dir/optig.c
17661N ignore/second-dir/rootig.c
17662No conflicts created by this import'
17663	  cd ..
17664	  rm -r dir-to-import
17665
17666	  mkdir 1
17667	  cd 1
17668	  dotest ignore-7 "${testcvs} -q co -dsecond-dir ignore/second-dir" \
17669'U second-dir/bar.c
17670U second-dir/defig.o
17671U second-dir/envig.c
17672U second-dir/foobar.c
17673U second-dir/optig.c
17674U second-dir/rootig.c'
17675	  dotest ignore-8 "${testcvs} -q co -dfirst-dir ignore/first-dir" 'U first-dir/bar.c
17676U first-dir/foobar.c'
17677	  cd first-dir
17678	  touch rootig.c defig.o envig.c optig.c notig.c
17679	  dotest ignore-9 "${testcvs} -q update -I optig.c" "${QUESTION} notig.c"
17680	  # The fact that CVS requires us to specify -I CVS here strikes me
17681	  # as a bug.
17682	  dotest_sort ignore-10 "${testcvs} -q update -I ! -I CVS" \
17683"${QUESTION} defig.o
17684${QUESTION} envig.c
17685${QUESTION} notig.c
17686${QUESTION} optig.c
17687${QUESTION} rootig.c"
17688
17689	  # Now test that commands other than update also print "? notig.c"
17690	  # where appropriate.  Only test this for remote, because local
17691	  # CVS only prints it on update.
17692	  rm optig.c
17693	  if $remote; then
17694	    dotest ignore-11r "$testcvs -q diff" "$QUESTION notig.c"
17695
17696	    # Force the server to be contacted.  Ugh.  Having CVS
17697	    # contact the server for the sole purpose of checking
17698	    # the CVSROOT/cvsignore file does not seem like such a
17699	    # good idea, so I imagine this will continue to be
17700	    # necessary.  Oh well, at least we test CVS's ablity to
17701	    # handle a file with a modified timestamp but unmodified
17702	    # contents.
17703	    touch bar.c
17704
17705	    dotest ignore-11ar "$testcvs -q ci -m commit-it" \
17706"$QUESTION notig.c"
17707	  fi
17708
17709	  # now test .cvsignore files
17710	  cd ..
17711	  echo notig.c >first-dir/.cvsignore
17712	  echo foobar.c >second-dir/.cvsignore
17713	  touch first-dir/notig.c second-dir/notig.c second-dir/foobar.c
17714	  dotest_sort ignore-12 "${testcvs} -qn update" \
17715"${QUESTION} first-dir/.cvsignore
17716${QUESTION} second-dir/.cvsignore
17717${QUESTION} second-dir/notig.c"
17718	  dotest_sort ignore-13 "${testcvs} -qn update -I! -I CVS" \
17719"${QUESTION} first-dir/.cvsignore
17720${QUESTION} first-dir/defig.o
17721${QUESTION} first-dir/envig.c
17722${QUESTION} first-dir/rootig.c
17723${QUESTION} second-dir/.cvsignore
17724${QUESTION} second-dir/notig.c"
17725
17726	  echo yes | dotest ignore-14 "${testcvs} release -d first-dir" \
17727"${QUESTION} \.cvsignore
17728You have \[0\] altered files in this repository.
17729Are you sure you want to release (and delete) directory .first-dir': "
17730
17731	  echo add a line >>second-dir/foobar.c
17732	  rm second-dir/notig.c second-dir/.cvsignore
17733	  echo yes | dotest ignore-15 "${testcvs} release -d second-dir" \
17734"M foobar.c
17735You have \[1\] altered files in this repository.
17736Are you sure you want to release (and delete) directory .second-dir': "
17737
17738	  dokeep
17739	  cd ../..
17740	  rm -r ignore
17741	  modify_repo rm -rf $CVSROOT_DIRNAME/ignore
17742	  ;;
17743
17744
17745
17746	ignore-on-branch)
17747	  # Test that CVS _doesn't_ ignore files on branches because they were
17748	  # added to the trunk.
17749	  mkdir ignore-on-branch; cd ignore-on-branch
17750	  modify_repo mkdir $CVSROOT_DIRNAME/ignore-on-branch
17751
17752	  # create file1 & file2 on trunk
17753	  dotest ignore-on-branch-setup-1 "$testcvs -q co -dsetup ignore-on-branch" ''
17754	  cd setup
17755	  echo file1 >file1
17756	  dotest ignore-on-branch-setup-2 "$testcvs -q add file1" \
17757"${SPROG} add: use .${SPROG} commit. to add this file permanently"
17758	  dotest ignore-on-branch-setup-3 "$testcvs -q ci -mfile1 file1" \
17759"$CVSROOT_DIRNAME/ignore-on-branch/file1,v  <--  file1
17760initial revision: 1\.1"
17761	  dotest ignore-on-branch-setup-4 "$testcvs -q tag -b branch" 'T file1'
17762	  echo file2 >file2
17763	  dotest ignore-on-branch-setup-5 "$testcvs -q add file2" \
17764"${SPROG} add: use .${SPROG} commit. to add this file permanently"
17765	  dotest ignore-on-branch-setup-6 "$testcvs -q ci -mtrunk file2" \
17766"$CVSROOT_DIRNAME/ignore-on-branch/file2,v  <--  file2
17767initial revision: 1\.1"
17768
17769	  cd ..
17770
17771	  # Check out branch.
17772	  #
17773	  # - This was the original failure case - file2 would not be flagged
17774	  #   with a '?'
17775	  dotest ignore-on-branch-1 "$testcvs -q co -rbranch ignore-on-branch" \
17776'U ignore-on-branch/file1'
17777	  cd ignore-on-branch
17778	  echo file2 on branch >file2
17779	  dotest ignore-on-branch-2 "$testcvs -nq update" '? file2'
17780
17781	  # Now set up for a join.  One of the original fixes for this would
17782	  # print out a 'U' and a '?' during a join which added a file.
17783	  if $remote; then
17784	    dotest ignore-on-branch-3 "$testcvs -q tag -b branch2" \
17785'? file2
17786T file1'
17787	  else
17788	    dotest ignore-on-branch-3 "$testcvs -q tag -b branch2" 'T file1'
17789	  fi
17790	  dotest ignore-on-branch-4 "$testcvs -q add file2" \
17791"${SPROG} add: use .${SPROG} commit. to add this file permanently"
17792	  dotest ignore-on-branch-5 "$testcvs -q ci -mbranch file2" \
17793"$CVSROOT_DIRNAME/ignore-on-branch/file2,v  <--  file2
17794new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1"
17795	  dotest ignore-on-branch-6 "$testcvs -q up -rbranch2" \
17796"${SPROG} update: \`file2' is no longer in the repository"
17797	  dotest ignore-on-branch-7 "$testcvs -q up -jbranch" 'U file2'
17798
17799	  dokeep
17800	  cd ../..
17801	  rm -r ignore-on-branch
17802	  modify_repo rm -rf $CVSROOT_DIRNAME/ignore-on-branch
17803	  ;;
17804
17805
17806
17807	binfiles)
17808	  # Test cvs's ability to handle binary files.
17809	  # List of binary file tests:
17810	  #   * conflicts, "cvs admin": binfiles
17811	  #   * branching and joining: binfiles2
17812	  #   * adding and removing files: binfiles3
17813	  #   * -k wrappers: binwrap, binwrap2, binwrap3
17814	  #   * "cvs import" and wrappers: binwrap, binwrap2, binwrap3
17815	  #   * -k option to "cvs import": none yet, as far as I know.
17816	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
17817	  mkdir 1; cd 1
17818	  dotest binfiles-1 "${testcvs} -q co first-dir" ''
17819	  ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
17820	    </dev/null | ${TR} '@' '\000' >binfile.dat
17821	  cat binfile.dat binfile.dat >binfile2.dat
17822	  cd first-dir
17823	  cp ../binfile.dat binfile
17824	  dotest binfiles-2 "${testcvs} add -kb binfile" \
17825"${SPROG}"' add: scheduling file `binfile'\'' for addition
17826'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
17827	  dotest binfiles-3 "${testcvs} -q ci -m add-it" \
17828"$CVSROOT_DIRNAME/first-dir/binfile,v  <--  binfile
17829initial revision: 1\.1"
17830	  cd ../..
17831	  mkdir 2; cd 2
17832	  dotest binfiles-4 "${testcvs} -q co first-dir" 'U first-dir/binfile'
17833	  cd first-dir
17834	  dotest binfiles-5 "cmp ../../1/binfile.dat binfile" ''
17835	  # Testing that sticky options is -kb is the closest thing we have
17836	  # to testing that binary files work right on non-unix machines
17837	  # (until there is automated testing for such machines, of course).
17838	  dotest binfiles-5.5 "${testcvs} status binfile" \
17839"===================================================================
17840File: binfile          	Status: Up-to-date
17841
17842   Working revision:	1\.1.*
17843   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/binfile,v
17844   Commit Identifier:	${commitid}
17845   Sticky Tag:		(none)
17846   Sticky Date:		(none)
17847   Sticky Options:	-kb"
17848
17849	  # Test that "-kk" does not override "-kb"
17850	  cd ../..
17851	  mkdir 2a; cd 2a
17852	  dotest binfiles-4 "${testcvs} -q co -kk first-dir" 'U first-dir/binfile'
17853	  cd first-dir
17854	  # Testing that sticky options is -kb is the closest thing we have
17855	  # to testing that binary files work right on non-unix machines
17856	  # (until there is automated testing for such machines, of course).
17857	  dotest binfiles-5.5 "${testcvs} status binfile" \
17858"===================================================================
17859File: binfile          	Status: Up-to-date
17860
17861   Working revision:	1\.1.*
17862   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/binfile,v
17863   Commit Identifier:	${commitid}
17864   Sticky Tag:		(none)
17865   Sticky Date:		(none)
17866   Sticky Options:	-kb"
17867
17868	  # Test whether the default options from the RCS file are
17869	  # also used when operating on files instead of whole
17870	  # directories
17871          cd ../..
17872	  rm -r 2a
17873	  mkdir 3; cd 3
17874	  dotest binfiles-5.5b0 "${testcvs} -q co first-dir/binfile" \
17875'U first-dir/binfile'
17876	  cd first-dir
17877	  dotest binfiles-5.5b1 "${testcvs} status binfile" \
17878"===================================================================
17879File: binfile          	Status: Up-to-date
17880
17881   Working revision:	1\.1.*
17882   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/binfile,v
17883   Commit Identifier:	${commitid}
17884   Sticky Tag:		(none)
17885   Sticky Date:		(none)
17886   Sticky Options:	-kb"
17887	  cd ../..
17888	  rm -r 3
17889	  # test that "-kk" does not override "-kb"
17890	  mkdir 3; cd 3
17891	  dotest binfiles-5.5b0 "${testcvs} -q co -kk first-dir/binfile" \
17892'U first-dir/binfile'
17893	  cd first-dir
17894	  dotest binfiles-5.5b1 "${testcvs} status binfile" \
17895"===================================================================
17896File: binfile          	Status: Up-to-date
17897
17898   Working revision:	1\.1.*
17899   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/binfile,v
17900   Commit Identifier:	${commitid}
17901   Sticky Tag:		(none)
17902   Sticky Date:		(none)
17903   Sticky Options:	-kb"
17904	  cd ../..
17905	  rm -r 3
17906	  cd 2/first-dir
17907
17908	  cp ../../1/binfile2.dat binfile
17909	  dotest binfiles-6 "${testcvs} -q ci -m modify-it" \
17910"$CVSROOT_DIRNAME/first-dir/binfile,v  <--  binfile
17911new revision: 1\.2; previous revision: 1\.1"
17912	  cd ../../1/first-dir
17913	  dotest binfiles-7 "${testcvs} -q update" '[UP] binfile'
17914	  dotest binfiles-8 "cmp ../binfile2.dat binfile" ''
17915
17916	  # Now test handling of conflicts with binary files.
17917	  cp ../binfile.dat binfile
17918	  dotest binfiles-con0 "${testcvs} -q ci -m modify-it" \
17919"$CVSROOT_DIRNAME/first-dir/binfile,v  <--  binfile
17920new revision: 1\.3; previous revision: 1\.2"
17921	  cd ../../2/first-dir
17922	  echo 'edits in dir 2' >binfile
17923	  dotest binfiles-con1 "${testcvs} -q update" \
17924"$SPROG update: nonmergeable file needs merge
17925$SPROG update: revision 1\.3 from repository is now in binfile
17926$SPROG update: file from working directory is now in \.#binfile\.1\.2
17927C binfile"
17928
17929	  dotest_fail binfiles-con1b "$testcvs -q up" "C binfile"
17930
17931	  dotest binfiles-con2 "cmp binfile ../../1/binfile.dat" ''
17932	  dotest binfiles-con3 "cat .#binfile.1.2" 'edits in dir 2'
17933
17934	  cp ../../1/binfile2.dat binfile
17935	  dotest binfiles-con4 "$testcvs -q ci -m resolve-it" \
17936"$CVSROOT_DIRNAME/first-dir/binfile,v  <--  binfile
17937new revision: 1\.4; previous revision: 1\.3"
17938	  cd ../../1/first-dir
17939	  dotest binfiles-con5 "${testcvs} -q update" '[UP] binfile'
17940
17941	  dotest binfiles-9 "${testcvs} -q update -A" ''
17942	  # "-kk" no longer does anything with "-kb"
17943	  dotest binfiles-10 "${testcvs} -q update -kk" ''
17944	  dotest binfiles-11 "${testcvs} -q update" ''
17945	  # "-kk" no longer does anything with "-kb"
17946	  dotest binfiles-12 "${testcvs} -q update -A" ''
17947	  dotest binfiles-13 "${testcvs} -q update -A" ''
17948
17949	  cd ../..
17950
17951	  mkdir 3
17952	  cd 3
17953	  dotest binfiles-13a0 "${testcvs} -q co -r HEAD first-dir" \
17954'U first-dir/binfile'
17955	  cd first-dir
17956	  dotest binfiles-13a1 "${testcvs} status binfile" \
17957"===================================================================
17958File: binfile          	Status: Up-to-date
17959
17960   Working revision:	1\.4.*
17961   Repository revision:	1\.4	${CVSROOT_DIRNAME}/first-dir/binfile,v
17962   Commit Identifier:	${commitid}
17963   Sticky Tag:		HEAD (revision: 1\.4)
17964   Sticky Date:		(none)
17965   Sticky Options:	-kb"
17966	  cd ../..
17967	  rm -r 3
17968
17969	  cd 2/first-dir
17970	  echo 'this file is $''RCSfile$' >binfile
17971	  dotest binfiles-14a "${testcvs} -q ci -m modify-it" \
17972"$CVSROOT_DIRNAME/first-dir/binfile,v  <--  binfile
17973new revision: 1\.5; previous revision: 1\.4"
17974	  dotest binfiles-14b "cat binfile" 'this file is $''RCSfile$'
17975	  # See binfiles-5.5 for discussion of -kb.
17976	  dotest binfiles-14c "${testcvs} status binfile" \
17977"===================================================================
17978File: binfile          	Status: Up-to-date
17979
17980   Working revision:	1\.5.*
17981   Repository revision:	1\.5	${CVSROOT_DIRNAME}/first-dir/binfile,v
17982   Commit Identifier:	${commitid}
17983   Sticky Tag:		(none)
17984   Sticky Date:		(none)
17985   Sticky Options:	-kb"
17986	  dotest binfiles-14d "${testcvs} admin -kv binfile" \
17987"RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
17988done"
17989	  # cvs admin doesn't change the checked-out file or its sticky
17990	  # kopts.  There probably should be a way which does (but
17991	  # what if the file is modified?  And do we try to version
17992	  # control the kopt setting?)
17993	  dotest binfiles-14e "cat binfile" 'this file is $''RCSfile$'
17994	  dotest binfiles-14f "${testcvs} status binfile" \
17995"===================================================================
17996File: binfile          	Status: Up-to-date
17997
17998   Working revision:	1\.5.*
17999   Repository revision:	1\.5	${CVSROOT_DIRNAME}/first-dir/binfile,v
18000   Commit Identifier:	${commitid}
18001   Sticky Tag:		(none)
18002   Sticky Date:		(none)
18003   Sticky Options:	-kb"
18004	  dotest binfiles-14g "${testcvs} -q update -A" '[UP] binfile'
18005	  dotest binfiles-14h "cat binfile" 'this file is binfile,v'
18006	  dotest binfiles-14i "${testcvs} status binfile" \
18007"===================================================================
18008File: binfile          	Status: Up-to-date
18009
18010   Working revision:	1\.5.*
18011   Repository revision:	1\.5	${CVSROOT_DIRNAME}/first-dir/binfile,v
18012   Commit Identifier:	${commitid}
18013   Sticky Tag:		(none)
18014   Sticky Date:		(none)
18015   Sticky Options:	-kv"
18016
18017	  # Do sticky options work when used with 'cvs update'?
18018	  echo "Not a binary file." > nibfile
18019	  dotest binfiles-sticky1 "${testcvs} -q add nibfile" \
18020"${SPROG} add: use .${SPROG} commit. to add this file permanently"
18021	  dotest binfiles-sticky2 "${testcvs} -q ci -m add-it nibfile" \
18022"$CVSROOT_DIRNAME/first-dir/nibfile,v  <--  nibfile
18023initial revision: 1\.1"
18024	  dotest binfiles-sticky3 "${testcvs} -q update -kb nibfile" \
18025	    '[UP] nibfile'
18026	  dotest binfiles-sticky4 "${testcvs} -q status nibfile" \
18027"===================================================================
18028File: nibfile          	Status: Up-to-date
18029
18030   Working revision:	1\.1.*
18031   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/nibfile,v
18032   Commit Identifier:	${commitid}
18033   Sticky Tag:		(none)
18034   Sticky Date:		(none)
18035   Sticky Options:	-kb"
18036
18037	  # Now test that -A can clear the sticky option.
18038	  dotest binfiles-sticky5 "${testcvs} -q update -A nibfile" \
18039"[UP] nibfile"
18040	  dotest binfiles-sticky6 "${testcvs} -q status nibfile" \
18041"===================================================================
18042File: nibfile          	Status: Up-to-date
18043
18044   Working revision:	1\.1.*
18045   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/nibfile,v
18046   Commit Identifier:	${commitid}
18047   Sticky Tag:		(none)
18048   Sticky Date:		(none)
18049   Sticky Options:	(none)"
18050	  dotest binfiles-15 "${testcvs} -q admin -kb nibfile" \
18051"RCS file: ${CVSROOT_DIRNAME}/first-dir/nibfile,v
18052done"
18053	  dotest binfiles-16 "${testcvs} -q update nibfile" "[UP] nibfile"
18054	  dotest binfiles-17 "${testcvs} -q status nibfile" \
18055"===================================================================
18056File: nibfile          	Status: Up-to-date
18057
18058   Working revision:	1\.1.*
18059   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/nibfile,v
18060   Commit Identifier:	${commitid}
18061   Sticky Tag:		(none)
18062   Sticky Date:		(none)
18063   Sticky Options:	-kb"
18064
18065	  dotest binfiles-o1 "${testcvs} admin -o1.3:: binfile" \
18066"RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
18067deleting revision 1\.5
18068deleting revision 1\.4
18069done"
18070	  dotest binfiles-o2 "${testcvs} admin -o::1.3 binfile" \
18071"RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
18072deleting revision 1\.2
18073deleting revision 1\.1
18074done"
18075	  dotest binfiles-o3 "${testcvs} -q log -h -N binfile" "
18076RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile,v
18077Working file: binfile
18078head: 1\.3
18079branch:
18080locks: strict
18081access list:
18082keyword substitution: v
18083total revisions: 1
18084============================================================================="
18085
18086	  # Check that the contents were right.  This isn't the hard case
18087	  # (in which RCS_delete_revs does a diff), but might as well.
18088	  dotest binfiles-o4 "${testcvs} -q update binfile" "U binfile"
18089	  dotest binfiles-o5 "cmp binfile ../../1/binfile.dat" ""
18090
18091	  dokeep
18092	  cd ../..
18093	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
18094	  rm -r 1 2
18095	  ;;
18096
18097
18098
18099	binfiles2)
18100	  # Test cvs's ability to handle binary files, particularly branching
18101	  # and joining.  The key thing we are worrying about is that CVS
18102	  # doesn't print "cannot merge binary files" or some such, in
18103	  # situations where no merging is required.
18104	  # See also "join" which does this with non-binary files.
18105	  #
18106	  # Cases (we are merging from the branch to the trunk):
18107	  # binfile.dat) File added on branch, not on trunk.
18108	  #      File should be marked for addition.
18109	  # brmod) File modified on branch, not on trunk.
18110	  #      File should be copied over to trunk (no merging is needed).
18111	  # brmod-trmod) File modified on branch, also on trunk.
18112	  #      This is a conflict.  Present the user with both files and
18113	  #      let them figure it out.
18114	  # brmod-wdmod) File modified on branch, not modified in the trunk
18115	  #      repository, but modified in the (trunk) working directory.
18116	  #      This is also a conflict.
18117
18118	  modify_repo mkdir ${CVSROOT_DIRNAME}/first-dir
18119	  mkdir 1; cd 1
18120	  dotest binfiles2-1 "${testcvs} -q co first-dir" ''
18121	  cd first-dir
18122
18123	  # The most important thing here is that binfile, binfile2, &c
18124	  # each be distinct from each other.  We also make sure to include
18125	  # a few likely end-of-line patterns to make sure nothing is
18126	  # being munged as if in text mode.
18127	  ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
18128	    </dev/null | ${TR} '@' '\000' >../binfile
18129	  # Use binfl2 rather than binfile2 because of a problem with Cygwin
18130	  # and Samba. that causes cat to report that the input and output file
18131	  # are the same when outputting to binfile3.  Why?  I don't know, but
18132	  # it is consistently reproducible.
18133	  cat ../binfile ../binfile >../binfl2
18134	  cat ../binfl2 ../binfile >../binfile3
18135
18136	  # FIXCVS: unless a branch has at least one file on it,
18137	  # tag_check_valid won't know it exists.  So if brmod didn't
18138	  # exist, we would have to invent it.
18139	  cp ../binfile brmod
18140	  cp ../binfile brmod-trmod
18141	  cp ../binfile brmod-wdmod
18142	  dotest binfiles2-1a \
18143"${testcvs} add -kb brmod brmod-trmod brmod-wdmod" \
18144"${SPROG} add: scheduling file .brmod. for addition
18145${SPROG} add: scheduling file .brmod-trmod. for addition
18146${SPROG} add: scheduling file .brmod-wdmod. for addition
18147${SPROG} add: use .${SPROG} commit. to add these files permanently"
18148	  dotest binfiles2-1b "${testcvs} -q ci -m add" \
18149"$CVSROOT_DIRNAME/first-dir/brmod,v  <--  brmod
18150initial revision: 1\.1
18151$CVSROOT_DIRNAME/first-dir/brmod-trmod,v  <--  brmod-trmod
18152initial revision: 1\.1
18153$CVSROOT_DIRNAME/first-dir/brmod-wdmod,v  <--  brmod-wdmod
18154initial revision: 1\.1"
18155	  dotest binfiles2-2 "${testcvs} -q tag -b br" 'T brmod
18156T brmod-trmod
18157T brmod-wdmod'
18158	  dotest binfiles2-3 "${testcvs} -q update -r br" ''
18159	  cp ../binfile binfile.dat
18160	  dotest binfiles2-4 "${testcvs} add -kb binfile.dat" \
18161"${SPROG} add: scheduling file .binfile\.dat. for addition on branch .br.
18162${SPROG} add: use .${SPROG} commit. to add this file permanently"
18163	  cp ../binfl2 brmod
18164	  cp ../binfl2 brmod-trmod
18165	  cp ../binfl2 brmod-wdmod
18166	  dotest binfiles2-5 "${testcvs} -q ci -m br-changes" \
18167"$CVSROOT_DIRNAME/first-dir/Attic/binfile\.dat,v  <--  binfile\.dat
18168new revision: 1\.1\.2\.1; previous revision: 1\.1
18169$CVSROOT_DIRNAME/first-dir/brmod,v  <--  brmod
18170new revision: 1\.1\.2\.1; previous revision: 1\.1
18171$CVSROOT_DIRNAME/first-dir/brmod-trmod,v  <--  brmod-trmod
18172new revision: 1\.1\.2\.1; previous revision: 1\.1
18173$CVSROOT_DIRNAME/first-dir/brmod-wdmod,v  <--  brmod-wdmod
18174new revision: 1\.1\.2\.1; previous revision: 1\.1"
18175	  dotest binfiles2-6 "${testcvs} -q update -A" \
18176"${SPROG} update: \`binfile\.dat' is no longer in the repository
18177[UP] brmod
18178[UP] brmod-trmod
18179[UP] brmod-wdmod"
18180	  dotest_fail binfiles2-7 "test -f binfile.dat" ''
18181	  dotest binfiles2-7-brmod "cmp ../binfile brmod"
18182	  cp ../binfile3 brmod-trmod
18183	  dotest binfiles2-7a "${testcvs} -q ci -m tr-modify" \
18184"$CVSROOT_DIRNAME/first-dir/brmod-trmod,v  <--  brmod-trmod
18185new revision: 1\.2; previous revision: 1\.1"
18186	  cp ../binfile3 brmod-wdmod
18187
18188	  dotest binfiles2-8 "${testcvs} -q update -j br" \
18189"U binfile\.dat
18190U brmod
18191${SPROG} update: nonmergeable file needs merge
18192${SPROG} update: revision 1.1.2.1 from repository is now in brmod-trmod
18193${SPROG} update: file from working directory is now in .#brmod-trmod.1.2
18194C brmod-trmod
18195M brmod-wdmod
18196${SPROG} update: nonmergeable file needs merge
18197${SPROG} update: revision 1.1.2.1 from repository is now in brmod-wdmod
18198${SPROG} update: file from working directory is now in .#brmod-wdmod.1.1
18199C brmod-wdmod"
18200
18201	  dotest binfiles2-9 "cmp ../binfile binfile.dat"
18202	  dotest binfiles2-9-brmod "cmp ../binfl2 brmod"
18203	  dotest binfiles2-9-brmod-trmod "cmp ../binfl2 brmod-trmod"
18204	  dotest binfiles2-9-brmod-trmod "cmp ../binfl2 brmod-wdmod"
18205	  dotest binfiles2-9a-brmod-trmod "cmp ../binfile3 .#brmod-trmod.1.2"
18206	  dotest binfiles2-9a-brmod-wdmod "cmp ../binfile3 .#brmod-wdmod.1.1"
18207
18208	  # Test that everything was properly scheduled.
18209	  dotest binfiles2-10 "${testcvs} -q ci -m checkin" \
18210"$CVSROOT_DIRNAME/first-dir/binfile\.dat,v  <--  binfile\.dat
18211new revision: 1\.2; previous revision: 1\.1
18212$CVSROOT_DIRNAME/first-dir/brmod,v  <--  brmod
18213new revision: 1\.2; previous revision: 1\.1
18214$CVSROOT_DIRNAME/first-dir/brmod-trmod,v  <--  brmod-trmod
18215new revision: 1\.3; previous revision: 1\.2
18216$CVSROOT_DIRNAME/first-dir/brmod-wdmod,v  <--  brmod-wdmod
18217new revision: 1\.2; previous revision: 1\.1"
18218
18219	  dotest_fail binfiles2-o1 "${testcvs} -q admin -o :1.2 brmod-trmod" \
18220"RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
18221deleting revision 1\.2
18222${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v: can't remove branch point 1\.1
18223${SPROG} admin: RCS file for .brmod-trmod. not modified\."
18224	  dotest binfiles2-o2 "${testcvs} -q admin -o 1.1.2.1: brmod-trmod" \
18225"RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
18226deleting revision 1\.1\.2\.1
18227done"
18228	  dotest binfiles2-o3 "${testcvs} -q admin -o :1.2 brmod-trmod" \
18229"RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
18230deleting revision 1\.2
18231deleting revision 1\.1
18232done"
18233	  dotest binfiles2-o4 "${testcvs} -q log -N brmod-trmod" "
18234RCS file: ${CVSROOT_DIRNAME}/first-dir/brmod-trmod,v
18235Working file: brmod-trmod
18236head: 1\.3
18237branch:
18238locks: strict
18239access list:
18240keyword substitution: b
18241total revisions: 1;	selected revisions: 1
18242description:
18243----------------------------
18244revision 1\.3
18245date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
18246checkin
18247============================================================================="
18248
18249	  dokeep
18250	  cd ../..
18251	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
18252	  rm -r 1
18253	  ;;
18254
18255
18256
18257	binfiles3)
18258	  # More binary file tests, especially removing, adding, &c.
18259	  # See "binfiles" for a list of binary file tests.
18260	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
18261	  mkdir 1; cd 1
18262	  dotest binfiles3-1 "${testcvs} -q co first-dir" ''
18263	  ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
18264	    </dev/null | ${TR} '@' '\000' >binfile.dat
18265	  cd first-dir
18266	  echo hello >file1
18267	  dotest binfiles3-2 "${testcvs} add file1" \
18268"${SPROG} add: scheduling file .file1. for addition
18269${SPROG} add: use .${SPROG} commit. to add this file permanently"
18270	  dotest binfiles3-3 "${testcvs} -q ci -m add-it" \
18271"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
18272initial revision: 1\.1"
18273	  rm file1
18274	  dotest binfiles3-4 "${testcvs} rm file1" \
18275"${SPROG} remove: scheduling .file1. for removal
18276${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
18277	  dotest binfiles3-5 "${testcvs} -q ci -m remove-it" \
18278"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
18279new revision: delete; previous revision: 1\.1"
18280	  cp ../binfile.dat file1
18281	  dotest binfiles3-6 "${testcvs} add -kb file1" \
18282"$SPROG add: Re-adding file .file1. after dead revision 1\.2\.
18283${SPROG} add: use .${SPROG} commit. to add this file permanently"
18284	  # The idea behind this test is to make sure that the file
18285	  # gets opened in binary mode to send to "cvs ci".
18286	  dotest binfiles3-6a "cat CVS/Entries" \
18287"/file1/0/[A-Za-z0-9 :]*/-kb/
18288D"
18289	  # TODO: This just tests the case where the old keyword
18290	  # expansion mode is the default (RCS_getexpand == NULL
18291	  # in checkaddfile()); should also test the case in which
18292	  # we are changing it from one non-default value to another.
18293	  dotest binfiles3-7 "$testcvs -q ci -m readd-it" \
18294"$SPROG commit: changing keyword expansion mode to -kb
18295$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
18296new revision: 1\.3; previous revision: 1\.2"
18297	  dotest binfiles3-8 "${testcvs} -q log -h -N file1" "
18298RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18299Working file: file1
18300head: 1\.3
18301branch:
18302locks: strict
18303access list:
18304keyword substitution: b
18305total revisions: 3
18306============================================================================="
18307
18308	  # OK, now test admin -o on a binary file.  See "admin"
18309	  # test for a more complete list of admin -o tests.
18310	  cp ${TESTDIR}/1/binfile.dat ${TESTDIR}/1/binfile4.dat
18311	  echo '%%$$##@@!!jjiiuull' | ${TR} j '\000' >>${TESTDIR}/1/binfile4.dat
18312	  cp ${TESTDIR}/1/binfile4.dat ${TESTDIR}/1/binfile5.dat
18313	  echo 'aawwee%$$##@@!!jjil' | ${TR} w '\000' >>${TESTDIR}/1/binfile5.dat
18314
18315	  cp ../binfile4.dat file1
18316	  dotest binfiles3-9 "${testcvs} -q ci -m change" \
18317"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
18318new revision: 1\.4; previous revision: 1\.3"
18319	  cp ../binfile5.dat file1
18320	  dotest binfiles3-10 "${testcvs} -q ci -m change" \
18321"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
18322new revision: 1\.5; previous revision: 1\.4"
18323	  dotest binfiles3-11 "${testcvs} admin -o 1.3::1.5 file1" \
18324"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
18325deleting revision 1\.4
18326done"
18327	  dotest binfiles3-12 "${testcvs} -q update -r 1.3 file1" "U file1"
18328	  dotest binfiles3-13 "cmp file1 ${TESTDIR}/1/binfile.dat" ""
18329
18330	  dokeep
18331	  cd ../..
18332	  rm -r 1
18333	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
18334	  ;;
18335
18336
18337
18338	mcopy)
18339	  # See comment at "mwrap" test for list of other wrappers tests.
18340	  # Test cvs's ability to handle nonmergeable files specified with
18341	  # -m 'COPY' in wrappers.  Similar to the binfiles2 test,
18342	  # which tests the same thing for binary files
18343	  # (which are non-mergeable in the same sense).
18344	  #
18345	  # Cases (we are merging from the branch to the trunk):
18346	  # brmod) File modified on branch, not on trunk.
18347	  #      File should be copied over to trunk (no merging is needed).
18348	  # brmod-trmod) File modified on branch, also on trunk.
18349	  #      This is a conflict.  Present the user with both files and
18350	  #      let them figure it out.
18351	  # brmod-wdmod) File modified on branch, not modified in the trunk
18352	  #      repository, but modified in the (trunk) working directory.
18353	  #      This is also a conflict.
18354
18355	  # For the moment, remote CVS can't pass wrappers from CVSWRAPPERS
18356	  # (see wrap_send).  So skip these tests for remote.
18357	  if $remote; then :; else
18358
18359	    mkdir ${CVSROOT_DIRNAME}/first-dir
18360	    mkdir 1; cd 1
18361	    dotest mcopy-1 "${testcvs} -q co first-dir" ''
18362	    cd first-dir
18363
18364	    # FIXCVS: unless a branch has at least one file on it,
18365	    # tag_check_valid won't know it exists.  So if brmod didn't
18366	    # exist, we would have to invent it.
18367	    echo 'brmod initial contents' >brmod
18368	    echo 'brmod-trmod initial contents' >brmod-trmod
18369	    echo 'brmod-wdmod initial contents' >brmod-wdmod
18370	    echo "* -m 'COPY'" >.cvswrappers
18371	    dotest mcopy-1a \
18372"${testcvs} add .cvswrappers brmod brmod-trmod brmod-wdmod" \
18373"${SPROG} add: scheduling file .\.cvswrappers. for addition
18374${SPROG} add: scheduling file .brmod. for addition
18375${SPROG} add: scheduling file .brmod-trmod. for addition
18376${SPROG} add: scheduling file .brmod-wdmod. for addition
18377${SPROG} add: use .${SPROG} commit. to add these files permanently"
18378	    dotest mcopy-1b "${testcvs} -q ci -m add" \
18379"$CVSROOT_DIRNAME/first-dir/\.cvswrappers,v  <--  \.cvswrappers
18380initial revision: 1\.1
18381$CVSROOT_DIRNAME/first-dir/brmod,v  <--  brmod
18382initial revision: 1\.1
18383$CVSROOT_DIRNAME/first-dir/brmod-trmod,v  <--  brmod-trmod
18384initial revision: 1\.1
18385$CVSROOT_DIRNAME/first-dir/brmod-wdmod,v  <--  brmod-wdmod
18386initial revision: 1\.1"
18387
18388	    # NOTE: .cvswrappers files are broken (see comment in
18389	    # src/wrapper.c).  So doing everything via the environment
18390	    # variable is a workaround.  Better would be to test them
18391	    # both.
18392	    CVSWRAPPERS="* -m 'COPY'"
18393	    export CVSWRAPPERS
18394	    dotest mcopy-2 "${testcvs} -q tag -b br" 'T \.cvswrappers
18395T brmod
18396T brmod-trmod
18397T brmod-wdmod'
18398	    dotest mcopy-3 "${testcvs} -q update -r br" ''
18399	    echo 'modify brmod on br' >brmod
18400	    echo 'modify brmod-trmod on br' >brmod-trmod
18401	    echo 'modify brmod-wdmod on br' >brmod-wdmod
18402	    dotest mcopy-5 "${testcvs} -q ci -m br-changes" \
18403"$CVSROOT_DIRNAME/first-dir/brmod,v  <--  brmod
18404new revision: 1\.1\.2\.1; previous revision: 1\.1
18405$CVSROOT_DIRNAME/first-dir/brmod-trmod,v  <--  brmod-trmod
18406new revision: 1\.1\.2\.1; previous revision: 1\.1
18407$CVSROOT_DIRNAME/first-dir/brmod-wdmod,v  <--  brmod-wdmod
18408new revision: 1\.1\.2\.1; previous revision: 1\.1"
18409	    dotest mcopy-6 "${testcvs} -q update -A" \
18410"[UP] brmod
18411[UP] brmod-trmod
18412[UP] brmod-wdmod"
18413	    dotest mcopy-7 "cat brmod brmod-trmod brmod-wdmod" \
18414"brmod initial contents
18415brmod-trmod initial contents
18416brmod-wdmod initial contents"
18417
18418	    echo 'modify brmod-trmod again on trunk' >brmod-trmod
18419	    dotest mcopy-7a "${testcvs} -q ci -m tr-modify" \
18420"$CVSROOT_DIRNAME/first-dir/brmod-trmod,v  <--  brmod-trmod
18421new revision: 1\.2; previous revision: 1\.1"
18422	    echo 'modify brmod-wdmod in working dir' >brmod-wdmod
18423
18424	    dotest mcopy-8 "${testcvs} -q update -j br" \
18425"U brmod
18426${SPROG} update: nonmergeable file needs merge
18427${SPROG} update: revision 1.1.2.1 from repository is now in brmod-trmod
18428${SPROG} update: file from working directory is now in .#brmod-trmod.1.2
18429C brmod-trmod
18430M brmod-wdmod
18431${SPROG} update: nonmergeable file needs merge
18432${SPROG} update: revision 1.1.2.1 from repository is now in brmod-wdmod
18433${SPROG} update: file from working directory is now in .#brmod-wdmod.1.1
18434C brmod-wdmod"
18435
18436	    dotest mcopy-9 "cat brmod brmod-trmod brmod-wdmod" \
18437"modify brmod on br
18438modify brmod-trmod on br
18439modify brmod-wdmod on br"
18440	    dotest mcopy-9a "cat .#brmod-trmod.1.2 .#brmod-wdmod.1.1" \
18441"modify brmod-trmod again on trunk
18442modify brmod-wdmod in working dir"
18443
18444	    # Test that everything was properly scheduled.
18445	    dotest mcopy-10 "${testcvs} -q ci -m checkin" \
18446"$CVSROOT_DIRNAME/first-dir/brmod,v  <--  brmod
18447new revision: 1\.2; previous revision: 1\.1
18448$CVSROOT_DIRNAME/first-dir/brmod-trmod,v  <--  brmod-trmod
18449new revision: 1\.3; previous revision: 1\.2
18450$CVSROOT_DIRNAME/first-dir/brmod-wdmod,v  <--  brmod-wdmod
18451new revision: 1\.2; previous revision: 1\.1"
18452
18453	    dokeep
18454	    cd ../..
18455	    modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
18456	    rm -r 1
18457	    unset CVSWRAPPERS
18458	  fi # end of tests to be skipped for remote
18459	  ;;
18460
18461
18462
18463	binwrap)
18464	  # Test the ability to specify binary-ness based on file name.
18465	  # See "mwrap" for a list of other wrappers tests.
18466
18467	  mkdir dir-to-import
18468	  cd dir-to-import
18469	  touch foo.c foo.exe
18470
18471	  # While we're here, test for rejection of duplicate tag names.
18472	  dotest_fail binwrap-0 \
18473	    "${testcvs} import -m msg -I ! first-dir dup dup" \
18474"${CPROG} \[import aborted\]: tag .dup. was specified more than once"
18475
18476	  if ${testcvs} import -m message -I ! -W "*.exe -k 'b'" \
18477	      first-dir tag1 tag2 >>${LOGFILE}; then
18478	    pass binwrap-1
18479	  else
18480	    fail binwrap-1
18481	  fi
18482	  cd ..
18483	  rm -r dir-to-import
18484	  dotest binwrap-2 "${testcvs} -q co first-dir" 'U first-dir/foo.c
18485U first-dir/foo.exe'
18486	  dotest binwrap-3 "${testcvs} -q status first-dir" \
18487"===================================================================
18488File: foo\.c            	Status: Up-to-date
18489
18490   Working revision:	1\.1\.1\.1.*
18491   Repository revision:	1\.1\.1\.1	${CVSROOT_DIRNAME}/first-dir/foo\.c,v
18492   Commit Identifier:	${commitid}
18493   Sticky Tag:		(none)
18494   Sticky Date:		(none)
18495   Sticky Options:	(none)
18496
18497===================================================================
18498File: foo\.exe          	Status: Up-to-date
18499
18500   Working revision:	1\.1\.1\.1.*
18501   Repository revision:	1\.1\.1\.1	${CVSROOT_DIRNAME}/first-dir/foo\.exe,v
18502   Commit Identifier:	${commitid}
18503   Sticky Tag:		(none)
18504   Sticky Date:		(none)
18505   Sticky Options:	-kb"
18506
18507	  dokeep
18508	  rm -r first-dir
18509	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
18510	  ;;
18511
18512
18513
18514	binwrap2)
18515	  # Test the ability to specify binary-ness based on file name.
18516	  # See "mwrap" for a list of other wrappers tests.
18517
18518	  mkdir dir-to-import
18519	  cd dir-to-import
18520	  touch foo.c foo.exe
18521
18522	  # Specify that all files are binary except *.c.
18523	  # The order seems to matter, with the earlier rules taking
18524	  # precedence.  I'm not sure whether that is good or not,
18525	  # but it is the current behavior.
18526	  if ${testcvs} import -m message -I ! \
18527	      -W "*.c -k 'o'" -W "* -k 'b'" \
18528	      first-dir tag1 tag2 >>${LOGFILE}; then
18529	    pass binwrap2-1
18530	  else
18531	    fail binwrap2-1
18532	  fi
18533	  cd ..
18534	  rm -r dir-to-import
18535	  dotest binwrap2-2 "${testcvs} -q co first-dir" 'U first-dir/foo.c
18536U first-dir/foo.exe'
18537	  dotest binwrap2-3 "${testcvs} -q status first-dir" \
18538"===================================================================
18539File: foo\.c            	Status: Up-to-date
18540
18541   Working revision:	1\.1\.1\.1.*
18542   Repository revision:	1\.1\.1\.1	${CVSROOT_DIRNAME}/first-dir/foo\.c,v
18543   Commit Identifier:	${commitid}
18544   Sticky Tag:		(none)
18545   Sticky Date:		(none)
18546   Sticky Options:	-ko
18547
18548===================================================================
18549File: foo\.exe          	Status: Up-to-date
18550
18551   Working revision:	1\.1\.1\.1.*
18552   Repository revision:	1\.1\.1\.1	${CVSROOT_DIRNAME}/first-dir/foo\.exe,v
18553   Commit Identifier:	${commitid}
18554   Sticky Tag:		(none)
18555   Sticky Date:		(none)
18556   Sticky Options:	-kb"
18557
18558	  dokeep
18559	  rm -r first-dir
18560	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
18561	  ;;
18562
18563
18564
18565        binwrap3)
18566          # Test communication of file-specified -k wrappers between
18567          # client and server, in `import':
18568          #
18569          #   1. Set up a directory tree, populate it with files.
18570          #   2. Give each directory a different .cvswrappers file.
18571          #   3. Give the server its own .cvswrappers file.
18572          #   4. Import the whole tree, see if the right files got set
18573          #      to binary.
18574          #
18575          # The tree has a top ("0th") level, and two subdirs, sub1/
18576          # and sub2/; sub2/ contains directory subsub/.  Every
18577          # directory has a .cvswrappers file as well as regular
18578          # files.
18579          #
18580          # In the file names, "foo-b.*" should end up binary, and
18581          # "foo-t.*" should end up text.  Don't worry about the two
18582          # letter extensions; they're just there to help me keep
18583          # things straight.
18584          #
18585          # Here's the directory tree:
18586          #
18587          # ./
18588          #    .cvswrappers
18589          #    foo-b.c0
18590          #    foo-b.sb
18591          #    foo-t.c1
18592          #    foo-t.st
18593          #
18594          #    sub1/             sub2/
18595          #      .cvswrappers      .cvswrappers
18596          #      foo-b.c1          foo-b.sb
18597          #      foo-b.sb          foo-b.st
18598          #      foo-t.c0          foo-t.c0
18599          #      foo-t.st          foo-t.c1
18600          #                        foo-t.c2
18601          #                        foo-t.c3
18602          #
18603          #                        subsub/
18604          #                          .cvswrappers
18605          #                          foo-b.c3
18606          #                          foo-b.sb
18607          #                          foo-t.c0
18608          #                          foo-t.c1
18609          #                          foo-t.c2
18610          #                          foo-t.st
18611
18612          binwrap3_line1="This is a test file "
18613          binwrap3_line2="containing little of use "
18614          binwrap3_line3="except this non-haiku"
18615
18616          binwrap3_text="${binwrap3_line1}${binwrap3_line2}${binwrap3_line3}"
18617
18618          cd ${TESTDIR}
18619
18620	  # On Windows, we can't check out CVSROOT, because the case
18621	  # insensitivity means that this conflicts with cvsroot.
18622	  mkdir wnt
18623	  cd wnt
18624
18625          mkdir binwrap3 # the 0th dir
18626          mkdir binwrap3/sub1
18627          mkdir binwrap3/sub2
18628          mkdir binwrap3/sub2/subsub
18629
18630          echo "bar*" > binwrap3/.cvswrappers
18631          echo "*.c0 -k 'b'" >> binwrap3/.cvswrappers
18632          echo "whatever -k 'b'" >> binwrap3/.cvswrappers
18633          echo ${binwrap3_text} > binwrap3/foo-b.c0
18634          echo ${binwrap3_text} > binwrap3/bar-t.c0
18635          echo ${binwrap3_text} > binwrap3/foo-b.sb
18636          echo ${binwrap3_text} > binwrap3/foo-t.sb
18637          echo ${binwrap3_text} > binwrap3/foo-t.c1
18638          echo ${binwrap3_text} > binwrap3/foo-t.st
18639
18640          echo "bar* -k 'kv'" > binwrap3/sub1/.cvswrappers
18641          echo "*.c1 -k 'b'" >> binwrap3/sub1/.cvswrappers
18642          echo "whatever -k 'b'" >> binwrap3/sub1/.cvswrappers
18643          echo ${binwrap3_text} > binwrap3/sub1/foo-b.c1
18644          echo ${binwrap3_text} > binwrap3/sub1/bar-t.c1
18645          echo ${binwrap3_text} > binwrap3/sub1/foo-b.sb
18646          echo ${binwrap3_text} > binwrap3/sub1/foo-t.sb
18647          echo ${binwrap3_text} > binwrap3/sub1/foo-t.c0
18648          echo ${binwrap3_text} > binwrap3/sub1/foo-t.st
18649
18650          echo "bar*" > binwrap3/sub2/.cvswrappers
18651          echo "*.st -k 'b'" >> binwrap3/sub2/.cvswrappers
18652          echo ${binwrap3_text} > binwrap3/sub2/foo-b.sb
18653          echo ${binwrap3_text} > binwrap3/sub2/foo-t.sb
18654          echo ${binwrap3_text} > binwrap3/sub2/foo-b.st
18655          echo ${binwrap3_text} > binwrap3/sub2/bar-t.st
18656          echo ${binwrap3_text} > binwrap3/sub2/foo-t.c0
18657          echo ${binwrap3_text} > binwrap3/sub2/foo-t.c1
18658          echo ${binwrap3_text} > binwrap3/sub2/foo-t.c2
18659          echo ${binwrap3_text} > binwrap3/sub2/foo-t.c3
18660
18661          echo "bar* -k 'kv'" > binwrap3/sub2/subsub/.cvswrappers
18662          echo "*.c3 -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
18663          echo "foo -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
18664          echo "c0* -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers
18665          echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-b.c3
18666          echo ${binwrap3_text} > binwrap3/sub2/subsub/bar-t.c3
18667          echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-b.sb
18668          echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.sb
18669          echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c0
18670          echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c1
18671          echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c2
18672          echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.st
18673
18674          # Now set up CVSROOT/cvswrappers, the easy way:
18675	  dotest binwrap3-1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
18676	  cd CVSROOT
18677          # This destroys anything currently in cvswrappers, but
18678	  # presumably other tests will take care of it themselves if
18679	  # they use cvswrappers:
18680	  echo "foo-t.sb" > cvswrappers
18681	  echo "foo*.sb  -k 'b'" >> cvswrappers
18682	  dotest binwrap3-2 "${testcvs} -q ci -m cvswrappers-mod" \
18683"$CVSROOT_DIRNAME/CVSROOT/cvswrappers,v  <--  cvswrappers
18684new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18685$SPROG commit: Rebuilding administrative file database"
18686          cd ..
18687
18688          # Avoid environmental interference
18689          CVSWRAPPERS_save=${CVSWRAPPERS}
18690          unset CVSWRAPPERS
18691
18692          # Do the import
18693          cd binwrap3
18694	  # Not importing .cvswrappers tests whether the client is really
18695	  # letting the server know "honestly" whether the file is binary,
18696	  # rather than just letting the server see the .cvswrappers file.
18697          dotest binwrap3-2a \
18698"${testcvs} import -m . -I .cvswrappers binwrap3 tag1 tag2" \
18699"[NI] ${DOTSTAR}"
18700
18701	  # OK, now test "cvs add".
18702          cd ..
18703	  rm -r binwrap3
18704          dotest binwrap3-2b "${testcvs} co binwrap3" "${DOTSTAR}"
18705          cd binwrap3
18706	  cd sub2
18707	  echo "*.newbin -k 'b'" > .cvswrappers
18708	  echo .cvswrappers >.cvsignore
18709	  echo .cvsignore >>.cvsignore
18710	  touch file1.newbin file1.txt
18711	  dotest binwrap3-2c "${testcvs} add file1.newbin file1.txt" \
18712"${SPROG} add: scheduling file .file1\.newbin. for addition
18713${SPROG} add: scheduling file .file1\.txt. for addition
18714${SPROG} add: use .${SPROG} commit. to add these files permanently"
18715	  dotest binwrap3-2d "${testcvs} -q ci -m add" \
18716"$CVSROOT_DIRNAME/binwrap3/sub2/file1\.newbin,v  <--  file1\.newbin
18717initial revision: 1\.1
18718$CVSROOT_DIRNAME/binwrap3/sub2/file1\.txt,v  <--  file1\.txt
18719initial revision: 1\.1"
18720	  cd ..
18721
18722          # Now check out the module and see which files are binary.
18723          cd ..
18724	  rm -r binwrap3
18725          dotest binwrap3-3 "${testcvs} co binwrap3" "${DOTSTAR}"
18726          cd binwrap3
18727
18728          # Running "cvs status" and matching output is too
18729          # error-prone, too likely to falsely fail.  Instead, we'll
18730          # just grep the Entries lines:
18731
18732          dotest binwrap3-top1 "grep foo-b.c0 ./CVS/Entries" \
18733                 "/foo-b.c0/1.1.1.1/[A-Za-z0-9 	:]*/-kb/"
18734
18735          dotest binwrap3-top2 "grep foo-b.sb ./CVS/Entries" \
18736                 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 	:]*/-kb/"
18737
18738          dotest binwrap3-top3 "grep foo-t.c1 ./CVS/Entries" \
18739                 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 	:]*//"
18740
18741          dotest binwrap3-top4 "grep foo-t.st ./CVS/Entries" \
18742                 "/foo-t.st/1.1.1.1/[A-Za-z0-9 	:]*//"
18743
18744          dotest binwrap3-top5 "grep foo-t.sb ./CVS/Entries" \
18745                 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 	:]*//"
18746
18747          dotest binwrap3-top6 "grep bar-t.c0 ./CVS/Entries" \
18748                 "/bar-t.c0/1.1.1.1/[A-Za-z0-9 	:]*//"
18749
18750          dotest binwrap3-sub1-1 "grep foo-b.c1 sub1/CVS/Entries" \
18751                 "/foo-b.c1/1.1.1.1/[A-Za-z0-9 	:]*/-kb/"
18752
18753          dotest binwrap3-sub1-2 "grep foo-b.sb sub1/CVS/Entries" \
18754                 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 	:]*/-kb/"
18755
18756          dotest binwrap3-sub1-3 "grep foo-t.c0 sub1/CVS/Entries" \
18757                 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 	:]*//"
18758
18759          dotest binwrap3-sub1-4 "grep foo-t.st sub1/CVS/Entries" \
18760                 "/foo-t.st/1.1.1.1/[A-Za-z0-9 	:]*//"
18761
18762          dotest binwrap3-sub1-5 "grep foo-t.sb sub1/CVS/Entries" \
18763                 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 	:]*//"
18764
18765          dotest binwrap3-sub1-6 "grep bar-t.c1 sub1/CVS/Entries" \
18766                 "/bar-t.c1/1.1.1.1/[A-Za-z0-9 	:]*//"
18767
18768          dotest binwrap3-sub2-1 "grep foo-b.sb sub2/CVS/Entries" \
18769                 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 	:]*/-kb/"
18770
18771          dotest binwrap3-sub2-2 "grep foo-b.st sub2/CVS/Entries" \
18772                 "/foo-b.st/1.1.1.1/[A-Za-z0-9 	:]*/-kb/"
18773
18774          dotest binwrap3-sub2-3 "grep foo-t.c0 sub2/CVS/Entries" \
18775                 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 	:]*//"
18776
18777          dotest binwrap3-sub2-4 "grep foo-t.c1 sub2/CVS/Entries" \
18778                 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 	:]*//"
18779
18780          dotest binwrap3-sub2-5 "grep foo-t.c2 sub2/CVS/Entries" \
18781                 "/foo-t.c2/1.1.1.1/[A-Za-z0-9 	:]*//"
18782
18783          dotest binwrap3-sub2-6 "grep foo-t.c3 sub2/CVS/Entries" \
18784                 "/foo-t.c3/1.1.1.1/[A-Za-z0-9 	:]*//"
18785
18786          dotest binwrap3-sub2-7 "grep foo-t.sb sub2/CVS/Entries" \
18787                 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 	:]*//"
18788
18789          dotest binwrap3-sub2-8 "grep bar-t.st sub2/CVS/Entries" \
18790                 "/bar-t.st/1.1.1.1/[A-Za-z0-9 	:]*//"
18791
18792          dotest binwrap3-subsub1 "grep foo-b.c3 sub2/subsub/CVS/Entries" \
18793                 "/foo-b.c3/1.1.1.1/[A-Za-z0-9 	:]*/-kb/"
18794
18795          dotest binwrap3-subsub2 "grep foo-b.sb sub2/subsub/CVS/Entries" \
18796                 "/foo-b.sb/1.1.1.1/[A-Za-z0-9 	:]*/-kb/"
18797
18798          dotest binwrap3-subsub3 "grep foo-t.c0 sub2/subsub/CVS/Entries" \
18799                 "/foo-t.c0/1.1.1.1/[A-Za-z0-9 	:]*//"
18800
18801          dotest binwrap3-subsub4 "grep foo-t.c1 sub2/subsub/CVS/Entries" \
18802                 "/foo-t.c1/1.1.1.1/[A-Za-z0-9 	:]*//"
18803
18804          dotest binwrap3-subsub5 "grep foo-t.c2 sub2/subsub/CVS/Entries" \
18805                 "/foo-t.c2/1.1.1.1/[A-Za-z0-9 	:]*//"
18806
18807          dotest binwrap3-subsub6 "grep foo-t.st sub2/subsub/CVS/Entries" \
18808                 "/foo-t.st/1.1.1.1/[A-Za-z0-9 	:]*//"
18809
18810          dotest binwrap3-subsub7 "grep foo-t.sb sub2/subsub/CVS/Entries" \
18811                 "/foo-t.sb/1.1.1.1/[A-Za-z0-9 	:]*//"
18812
18813          dotest binwrap3-subsub8 "grep bar-t.c3 sub2/subsub/CVS/Entries" \
18814                 "/bar-t.c3/1.1.1.1/[A-Za-z0-9 	:]*//"
18815
18816	  dotest binwrap3-sub2-add1 "grep file1.newbin sub2/CVS/Entries" \
18817	    "/file1.newbin/1.1/[A-Za-z0-9 	:]*/-kb/"
18818	  dotest binwrap3-sub2-add2 "grep file1.txt sub2/CVS/Entries" \
18819	    "/file1.txt/1.1/[A-Za-z0-9 	:]*//"
18820
18821          # Restore and clean up
18822	  dokeep
18823          cd ..
18824	  rm -r binwrap3 CVSROOT
18825	  cd ..
18826	  rm -r wnt
18827	  modify_repo rm -rf $CVSROOT_DIRNAME/binwrap3
18828          CVSWRAPPERS=${CVSWRAPPERS_save}
18829          ;;
18830
18831
18832
18833	mwrap)
18834	  # Tests of various wrappers features:
18835	  # -m 'COPY' and cvs update: mwrap
18836	  # -m 'COPY' and joining: mcopy
18837	  # -k: binwrap, binwrap2
18838	  # -t/-f: hasn't been written yet.
18839	  #
18840	  # Tests of different ways of specifying wrappers:
18841	  # CVSROOT/cvswrappers: mwrap
18842	  # -W: binwrap, binwrap2
18843	  # .cvswrappers in working directory, local: mcopy
18844	  # CVSROOT/cvswrappers, .cvswrappers remote: binwrap3
18845	  # CVSWRAPPERS environment variable: mcopy
18846
18847	  # This test is similar to binfiles-con1; -m 'COPY' specifies
18848	  # non-mergeableness the same way that -kb does.
18849
18850	  # On Windows, we can't check out CVSROOT, because the case
18851	  # insensitivity means that this conflicts with cvsroot.
18852	  mkdir wnt
18853	  cd wnt
18854
18855	  dotest mwrap-c1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
18856	  cd CVSROOT
18857	  echo "* -m 'COPY'" >>cvswrappers
18858	  dotest mwrap-c2 "${testcvs} -q ci -m wrapper-mod" \
18859"$CVSROOT_DIRNAME/CVSROOT/cvswrappers,v  <--  cvswrappers
18860new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18861$SPROG commit: Rebuilding administrative file database"
18862	  cd ..
18863	  mkdir m1; cd m1
18864	  dotest mwrap-1 "${testcvs} -q co -l ." ''
18865	  mkdir first-dir
18866	  dotest mwrap-2 "${testcvs} add first-dir" \
18867"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
18868	  cd first-dir
18869	  touch aa
18870	  dotest mwrap-3 "${testcvs} add aa" \
18871"${SPROG} add: scheduling file .aa. for addition
18872${SPROG} add: use .${SPROG} commit. to add this file permanently"
18873	  dotest mwrap-4 "${testcvs} -q ci -m add" \
18874"$CVSROOT_DIRNAME/first-dir/aa,v  <--  aa
18875initial revision: 1\.1"
18876	  cd ../..
18877	  mkdir m2; cd m2
18878	  dotest mwrap-5 "${testcvs} -q co first-dir" "U first-dir/aa"
18879	  cd first-dir
18880	  echo "changed in m2" >aa
18881	  dotest mwrap-6 "${testcvs} -q ci -m m2-mod" \
18882"$CVSROOT_DIRNAME/first-dir/aa,v  <--  aa
18883new revision: 1\.2; previous revision: 1\.1"
18884	  cd ../..
18885	  cd m1/first-dir
18886	  echo "changed in m1" >aa
18887	    dotest mwrap-7 "$testcvs -nq update" \
18888"$SPROG update: nonmergeable file needs merge
18889$SPROG update: revision 1\.2 from repository is now in aa
18890$SPROG update: file from working directory is now in \.#aa\.1\.1
18891C aa"
18892	  dotest mwrap-8 "$testcvs -q update" \
18893"$SPROG update: nonmergeable file needs merge
18894$SPROG update: revision 1\.2 from repository is now in aa
18895$SPROG update: file from working directory is now in \.#aa\.1\.1
18896C aa"
18897	  dotest mwrap-9 "cat aa" "changed in m2"
18898	  dotest mwrap-10 "cat .#aa.1.1" "changed in m1"
18899
18900	  dokeep
18901	  restore_adm
18902	  cd ../..
18903	  rm -r CVSROOT
18904	  rm -r m1 m2
18905	  cd ..
18906	  rm -r wnt
18907	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
18908	  ;;
18909
18910
18911
18912	info)
18913	  # Administrative file tests.
18914	  # Here is a list of where each administrative file is tested:
18915	  # loginfo: info
18916	  # modules: modules, modules2, modules3
18917	  # cvsignore: ignore
18918	  # verifymsg: info
18919	  # cvswrappers: mwrap
18920	  # taginfo: taginfo
18921	  # posttag: posttag
18922	  # postadmin: admin
18923	  # postwatch: devcom3
18924	  # config: config
18925	  # config2: MinCompressionLevel and MaxCompressionLevel in config
18926
18927	  # On Windows, we can't check out CVSROOT, because the case
18928	  # insensitivity means that this conflicts with cvsroot.
18929	  mkdir wnt
18930	  cd wnt
18931
18932	  dotest info-1 "$testcvs -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
18933	  cd CVSROOT
18934	  dotest info-2 "$testcvs -Q tag info-start"
18935	  sed -e's/%p/ALL/' <loginfo >tmploginfo
18936	  mv tmploginfo loginfo
18937	  echo "ALL sh -c \"echo x\${=MYENV}\${=OTHER}y\${=ZEE}=\$USER=\$COMMITID=\$SESSIONID=\$CVSROOT= >>$TESTDIR/testlog; cat >/dev/null\"" >> loginfo
18938          # The following cases test the format string substitution
18939          echo "ALL echo %{} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18940          echo "ALL echo %x >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18941          echo "ALL echo % >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18942          echo "ALL echo %{sxVv} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18943          echo "ALL echo %{v} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18944          echo "ALL echo %s %s >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18945          echo "ALL echo %{V}AX >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
18946          echo "first-dir echo %sux >>$TESTDIR/testlog2; cat >/dev/null" \
18947            >> loginfo
18948	  sed -e's/^UseNewInfoFmtStrings=yes$/#&/' <config >tmpconfig
18949	  mv tmpconfig config
18950
18951	  # Might be nice to move this to crerepos tests; it should
18952	  # work to create a loginfo file if you didn't create one
18953	  # with "cvs init".
18954	  : dotest info-2 "$testcvs add loginfo" \
18955"$SPROG add: scheduling file \`loginfo' for addition
18956$SPROG add: use \`$SPROG commit' to add this file permanently"
18957
18958	  dotest_fail info-3 "$testcvs -q ci -m new-loginfo" \
18959"$TESTDIR/cvsroot/CVSROOT/config,v  <--  config
18960new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18961$CVSROOT_DIRNAME/CVSROOT/loginfo,v  <--  loginfo
18962new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
18963$SPROG commit: Rebuilding administrative file database
18964$SPROG commit: loginfo:[0-9]*: no such user variable \${=MYENV}
18965$SPROG \[commit aborted\]: Unknown format character in info file ('').
18966Info files are the hook files, verifymsg, taginfo, commitinfo, etc\."
18967	  cd ..
18968
18969	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
18970	  dotest info-5 "$testcvs -q co first-dir" ''
18971	  cd first-dir
18972	  touch file1
18973	  dotest info-6 "$testcvs add file1" \
18974"$SPROG add: scheduling file \`file1' for addition
18975$SPROG add: use \`$SPROG commit' to add this file permanently"
18976	  echo "cvs -s OTHER=not-this -s MYENV=env-" >>$HOME/.cvsrc
18977	  dotest info-6b "$testcvs -q -s OTHER=value ci -m add-it" \
18978"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
18979initial revision: 1\.1
18980$SPROG commit: loginfo:[0-9]*: no such user variable \${=ZEE}
18981$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
18982compatibility with the new info file format strings (add a temporary .1. in
18983all info files after each .%. which doesn.t represent a literal percent)
18984and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
18985individual command lines and scripts to handle the new format at your
18986leisure\." \
18987"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
18988initial revision: 1\.1
18989$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
18990compatibility with the new info file format strings (add a temporary .1. in
18991all info files after each .%. which doesn.t represent a literal percent)
18992and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
18993individual command lines and scripts to handle the new format at your
18994leisure\.
18995$SPROG commit: loginfo:[0-9]*: no such user variable \${=ZEE}"
18996	  echo line0 >>file1
18997	  dotest info-6c "$testcvs -q -sOTHER=foo ci -m mod-it" \
18998"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
18999new revision: 1\.2; previous revision: 1\.1
19000$SPROG commit: loginfo:[0-9]*: no such user variable \${=ZEE}
19001$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
19002compatibility with the new info file format strings (add a temporary .1. in
19003all info files after each .%. which doesn.t represent a literal percent)
19004and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
19005individual command lines and scripts to handle the new format at your
19006leisure\." \
19007"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
19008new revision: 1\.2; previous revision: 1\.1
19009$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
19010compatibility with the new info file format strings (add a temporary .1. in
19011all info files after each .%. which doesn.t represent a literal percent)
19012and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
19013individual command lines and scripts to handle the new format at your
19014leisure\.
19015$SPROG commit: loginfo:[0-9]*: no such user variable \${=ZEE}"
19016	  echo line1 >>file1
19017	  dotest info-7 "${testcvs} -q -s OTHER=value -s ZEE=z ci -m mod-it" \
19018"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
19019new revision: 1\.3; previous revision: 1\.2
19020$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
19021compatibility with the new info file format strings (add a temporary .1. in
19022all info files after each .%. which doesn.t represent a literal percent)
19023and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
19024individual command lines and scripts to handle the new format at your
19025leisure\."
19026
19027	  cd ..
19028	  dotest info-9 "cat $TESTDIR/testlog" \
19029"xenv-valueyz=${username}=${commitid}=${commitid}=${CVSROOT_DIRNAME}="
19030          dotest info-10 "cat $TESTDIR/testlog2" \
19031'first-dir
19032first-dir
19033first-dir
19034first-dir file1,,NONE,1.1
19035first-dir 1.1
19036first-dir file1 %s
19037first-dir NONEAX
19038first-dir file1ux
19039first-dir
19040first-dir
19041first-dir
19042first-dir file1,,1.1,1.2
19043first-dir 1.2
19044first-dir file1 %s
19045first-dir 1.1AX
19046first-dir file1ux
19047first-dir
19048first-dir
19049first-dir
19050first-dir file1,,1.2,1.3
19051first-dir 1.3
19052first-dir file1 %s
19053first-dir 1.2AX
19054first-dir file1ux'
19055
19056	  # and make sure adding a '1' in the format strings really does ensure
19057	  # ensure backwards compatibility.
19058	  #
19059	  # these tests are identical to the above except for the loginfo setup
19060	  # and the project name
19061	  cd CVSROOT
19062	  dotest info-setup-intfmt-1 "$testcvs -q up -prinfo-start config >config"
19063	  dotest info-setup-intfmt-2 "$testcvs -q up -prinfo-start loginfo >loginfo"
19064	  sed -e's/%p/ALL/' <loginfo >tmploginfo
19065	  mv tmploginfo loginfo
19066	  echo "ALL sh -c \"echo x\${=MYENV}\${=OTHER}y\${=ZEE}=\$USER=\$CVSROOT= >>$TESTDIR/testlog; cat >/dev/null\"" >> loginfo
19067          # The following cases test the format string substitution
19068          echo "ALL echo %1{} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19069          echo "ALL echo %1x >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19070          echo "ALL echo %1 >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19071          echo "ALL echo %1{sxVv} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19072          echo "ALL echo %1{v} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19073          echo "ALL echo %1s %%s >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19074          echo "ALL echo %1{V}AX >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19075          echo "third-dir echo %1sux >>$TESTDIR/testlog2; cat >/dev/null" \
19076            >> loginfo
19077
19078	  dotest info-setup-intfmt-2 "${testcvs} -q -s ZEE=garbage ci -m nuke-admin-for-info-intfmt" \
19079"$TESTDIR/cvsroot/CVSROOT/config,v  <--  config
19080new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19081$TESTDIR/cvsroot/CVSROOT/loginfo,v  <--  loginfo
19082new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19083$SPROG commit: Rebuilding administrative file database
19084$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
19085compatibility with the new info file format strings (add a temporary .1. in
19086all info files after each .%. which doesn.t represent a literal percent)
19087and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
19088individual command lines and scripts to handle the new format at your
19089leisure\."
19090	  cd ..
19091
19092	  # delete the logs now so the results look more like the last tests
19093	  # (they won't include the config file update)
19094	  rm ${TESTDIR}/testlog ${TESTDIR}/testlog2
19095
19096	  modify_repo mkdir $CVSROOT_DIRNAME/third-dir
19097	  dotest info-intfmt-5 "${testcvs} -q co third-dir" ''
19098	  cd third-dir
19099	  touch file1
19100	  dotest info-intfmt-6 "${testcvs} add file1" \
19101"${SPROG}"' add: scheduling file `file1'\'' for addition
19102'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
19103	  echo "cvs -s OTHER=not-this -s MYENV=env-" >>$HOME/.cvsrc
19104	  dotest info-intfmt-6b "${testcvs} -q -s OTHER=value ci -m add-it" \
19105"${TESTDIR}/cvsroot/third-dir/file1,v  <--  file1
19106initial revision: 1\.1
19107${SPROG} commit: loginfo:[0-9]*: no such user variable \${=ZEE}
19108${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19109the new argument format and remove '1's from your info file format strings\.
19110${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19111the new argument format and remove '1's from your info file format strings\.
19112${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19113the new argument format and remove '1's from your info file format strings\.
19114${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19115the new argument format and remove '1's from your info file format strings\.
19116${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19117the new argument format and remove '1's from your info file format strings\.
19118${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19119the new argument format and remove '1's from your info file format strings\.
19120${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19121the new argument format and remove '1's from your info file format strings\.
19122${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19123the new argument format and remove '1's from your info file format strings\."
19124	  echo line0 >>file1
19125	  dotest info-intfmt-6c "${testcvs} -q -sOTHER=foo ci -m mod-it" \
19126"${TESTDIR}/cvsroot/third-dir/file1,v  <--  file1
19127new revision: 1\.2; previous revision: 1\.1
19128${SPROG} commit: loginfo:[0-9]*: no such user variable \${=ZEE}
19129${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19130the new argument format and remove '1's from your info file format strings\.
19131${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19132the new argument format and remove '1's from your info file format strings\.
19133${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19134the new argument format and remove '1's from your info file format strings\.
19135${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19136the new argument format and remove '1's from your info file format strings\.
19137${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19138the new argument format and remove '1's from your info file format strings\.
19139${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19140the new argument format and remove '1's from your info file format strings\.
19141${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19142the new argument format and remove '1's from your info file format strings\.
19143${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19144the new argument format and remove '1's from your info file format strings\."
19145	  echo line1 >>file1
19146	  dotest info-intfmt-7 "${testcvs} -q -s OTHER=value -s ZEE=z ci -m mod-it" \
19147"${TESTDIR}/cvsroot/third-dir/file1,v  <--  file1
19148new revision: 1\.3; previous revision: 1\.2
19149${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19150the new argument format and remove '1's from your info file format strings\.
19151${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19152the new argument format and remove '1's from your info file format strings\.
19153${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19154the new argument format and remove '1's from your info file format strings\.
19155${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19156the new argument format and remove '1's from your info file format strings\.
19157${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19158the new argument format and remove '1's from your info file format strings\.
19159${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19160the new argument format and remove '1's from your info file format strings\.
19161${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19162the new argument format and remove '1's from your info file format strings\.
19163${SPROG} commit: Using deprecated info format strings\.  Convert your scripts to use
19164the new argument format and remove '1's from your info file format strings\."
19165
19166	  cd ..
19167	  dotest info-intfmt-9 "cat $TESTDIR/testlog" "xenv-valueyz=${username}=${TESTDIR}/cvsroot="
19168          dotest info-intfmt-10 "cat $TESTDIR/testlog2" \
19169'third-dir
19170third-dir
19171third-dir
19172third-dir file1,,NONE,1.1
19173third-dir 1.1
19174third-dir file1 %s
19175third-dir NONEAX
19176third-dir file1ux
19177third-dir
19178third-dir
19179third-dir
19180third-dir file1,,1.1,1.2
19181third-dir 1.2
19182third-dir file1 %s
19183third-dir 1.1AX
19184third-dir file1ux
19185third-dir
19186third-dir
19187third-dir
19188third-dir file1,,1.2,1.3
19189third-dir 1.3
19190third-dir file1 %s
19191third-dir 1.2AX
19192third-dir file1ux'
19193
19194	  rm ${TESTDIR}/testlog ${TESTDIR}/testlog2
19195
19196	  # test the new format strings too
19197	  cd CVSROOT
19198	  dotest info-setup-newfmt-1 "$testcvs -q up -prinfo-start loginfo >loginfo"
19199	  echo "ALL sh -c \"echo x\${=MYENV}\${=OTHER}y\${=ZEE}=\$USER=\$CVSROOT= >>$TESTDIR/testlog; cat >/dev/null\" %{sVv}" >> loginfo
19200          # The following cases test the format string substitution
19201          echo "ALL echo %p \"%{sTVv}\" >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19202          echo "ALL echo %{v} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19203          echo "ALL echo %s >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19204          echo "ALL echo %{V}AX >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19205          echo "second-dir echo %sux >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
19206	  dotest info-setup-newfmt-2 "$testcvs -q -s ZEE=garbage ci -m nuke-admin-for-info-newfmt" \
19207"${CVSROOT_DIRNAME}/CVSROOT/loginfo,v  <--  loginfo
19208new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19209${SPROG} commit: Rebuilding administrative file database"
19210	  cd ..
19211
19212	  # delete the logs now so the results look more like the last tests
19213	  # (they won't include the config file update)
19214	  rm ${TESTDIR}/testlog ${TESTDIR}/testlog2
19215
19216	  modify_repo mkdir $CVSROOT_DIRNAME/fourth-dir
19217	  dotest info-newfmt-1 "${testcvs} -q co fourth-dir" ''
19218	  cd fourth-dir
19219	  touch file1
19220	  dotest info-newfmt-2 "${testcvs} add file1" \
19221"${SPROG}"' add: scheduling file `file1'\'' for addition
19222'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
19223	  echo "cvs -s OTHER=not-this -s MYENV=env-" >>$HOME/.cvsrc
19224	  dotest info-newfmt-3 "$testcvs -q -s OTHER=value ci -m add-it" \
19225"$TESTDIR/cvsroot/fourth-dir/file1,v  <--  file1
19226initial revision: 1\.1
19227$SPROG commit: loginfo:[0-9]*: no such user variable \${=ZEE}"
19228	  echo line0 >>file1
19229	  dotest info-newfmt-4 "$testcvs -q -sOTHER=foo ci -m mod-it" \
19230"$TESTDIR/cvsroot/fourth-dir/file1,v  <--  file1
19231new revision: 1\.2; previous revision: 1\.1
19232$SPROG commit: loginfo:[0-9]*: no such user variable \${=ZEE}"
19233	  echo line1 >>file1
19234	  dotest info-newfmt-5 "${testcvs} -q -s OTHER=value -s ZEE=z ci -m mod-it" \
19235"${TESTDIR}/cvsroot/fourth-dir/file1,v  <--  file1
19236new revision: 1\.3; previous revision: 1\.2"
19237
19238	  cd ..
19239	  dotest info-newfmt-6 "cat $TESTDIR/testlog" \
19240"xenv-valueyz=${username}=${TESTDIR}/cvsroot="
19241          dotest info-newfmt-7 "cat $TESTDIR/testlog2" \
19242'fourth-dir file1  NONE 1\.1
192431\.1
19244file1
19245NONEAX
19246fourth-dir file1  1\.1 1\.2
192471\.2
19248file1
192491\.1AX
19250fourth-dir file1  1\.2 1\.3
192511\.3
19252file1
192531\.2AX'
19254
19255	  # clean up after newfmt tests
19256	  cd CVSROOT
19257	  dotest info-cleanup-newfmt-1 "$testcvs -q up -prinfo-start loginfo >loginfo"
19258	  dotest info-cleanup-newfmt-2 "$testcvs -q ci -m nuke-loginfo" \
19259"$CVSROOT_DIRNAME/CVSROOT/loginfo,v  <--  loginfo
19260new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19261$SPROG commit: Rebuilding administrative file database"
19262
19263	  # clean up the logs
19264	  rm ${TESTDIR}/testlog ${TESTDIR}/testlog2
19265
19266	  # Now test verifymsg
19267	  cat >${TESTDIR}/vscript <<EOF
19268#!${TESTSHELL}
19269echo vscript "\$@"
19270if sed 1q < \$1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
19271    exit 0
19272elif sed 1q < \$1 | grep '^BugId:[ ]*new$' > /dev/null; then
19273    echo A new bugid was found. >> \$1
19274    exit 0
19275else
19276    echo "No BugId found."
19277    sleep 1
19278    exit 1
19279fi
19280EOF
19281	  cat >${TESTDIR}/vscript2 <<EOF
19282#!${TESTSHELL}
19283echo vscript2 "\$@"
19284if test -f CVS/Repository; then
19285	repo=\`cat CVS/Repository\`
19286else
19287	repo=\`pwd\`
19288fi
19289echo \$repo
19290if echo "\$repo" |grep yet-another/ >/dev/null 2>&1; then
19291	exit 1
19292else
19293	exit 0
19294fi
19295EOF
19296	  # Grumble, grumble, mumble, search for "Cygwin".
19297	  if test -n "$remotehost"; then
19298	    $CVS_RSH $remotehost "chmod +x ${TESTDIR}/vscript*"
19299	  else
19300	    chmod +x ${TESTDIR}/vscript*
19301	  fi
19302	  echo "^first-dir/yet-another\\(/\\|\$\\) ${TESTDIR}/vscript2 %l %{sV}" >verifymsg
19303	  echo "^first-dir\\(/\\|\$\\) ${TESTDIR}/vscript %l %{sV}" >>verifymsg
19304	  echo "^missing-script\$ ${TESTDIR}/bogus %l" >>verifymsg
19305	  echo "^missing-var\$ ${TESTDIR}/vscript %l \${=Bogus}" >>verifymsg
19306	  # first test the directory independant verifymsg
19307	  dotest info-v1 "${testcvs} -q ci -m add-verification" \
19308"$CVSROOT_DIRNAME/CVSROOT/verifymsg,v  <--  verifymsg
19309new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19310$SPROG commit: Rebuilding administrative file database"
19311
19312	  cd ../first-dir
19313	  echo line2 >>file1
19314	  dotest_fail info-v2 "${testcvs} -q ci -m bogus" \
19315"vscript $tempname file1 1\.3
19316No BugId found\.
19317${SPROG} \[commit aborted\]: Message verification failed"
19318
19319	  cat >${TESTDIR}/comment.tmp <<EOF
19320BugId: 42
19321and many more lines after it
19322EOF
19323	  dotest info-v3 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
19324"vscript $tempname file1 1\.3
19325$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
19326new revision: 1\.4; previous revision: 1\.3"
19327	  rm ${TESTDIR}/comment.tmp
19328
19329	  cd ..
19330	  mkdir another-dir
19331	  cd another-dir
19332	  touch file2
19333	  dotest_fail info-v4 \
19334	    "${testcvs} import -m bogus first-dir/another x y" \
19335"vscript $tempname - Imported sources NONE
19336No BugId found\.
19337${SPROG} \[import aborted\]: Message verification failed"
19338
19339	  # now verify that directory dependent verifymsgs work
19340	  dotest info-v5 \
19341	    "${testcvs} import -m bogus first-dir/yet-another x y" \
19342"vscript2 $tempname - Imported sources NONE
19343$TESTDIR/wnt/another-dir
19344N first-dir/yet-another/file2
19345
19346No conflicts created by this import" \
19347"vscript2 $tempname - Imported sources NONE
19348$CVSROOT_DIRNAME/first-dir/yet-another
19349N first-dir/yet-another/file2
19350
19351No conflicts created by this import"
19352
19353	  # FIXCVS
19354	  #
19355	  # note that in the local case the error message is the same as
19356	  # info-v5
19357	  #
19358	  # This means that the verifymsg scripts cannot reliably and
19359	  # consistantly obtain information on which directory is being
19360	  # committed to.  Thus it is currently useless for them to be
19361	  # running in every dir.  They should either be run once or
19362	  # directory information should be passed.
19363	  if $remote; then
19364	    dotest_fail info-v6r \
19365	      "${testcvs} import -m bogus first-dir/yet-another/and-another x y" \
19366"vscript2 $tempname - Imported sources NONE
19367$CVSROOT_DIRNAME/first-dir/yet-another/and-another
19368$SPROG \[import aborted\]: Message verification failed"
19369	  else
19370	    dotest info-v6 \
19371	      "${testcvs} import -m bogus first-dir/yet-another/and-another x y" \
19372"vscript2 $tempname - Imported sources NONE
19373$TESTDIR/wnt/another-dir
19374N first-dir/yet-another/and-another/file2
19375
19376No conflicts created by this import"
19377	  fi
19378
19379	  # check that errors invoking the script cause verification failure
19380	  #
19381	  # The second text below occurs on Cygwin, where I assume execvp
19382	  # does not return to let CVS print the error message when its
19383	  # argument does not exist.
19384	  dotest_fail info-v7 "${testcvs} import -m bogus missing-script x y" \
19385"${SPROG} import: cannot exec ${TESTDIR}/bogus: No such file or directory
19386${SPROG} \[import aborted\]: Message verification failed" \
19387"${SPROG} \[import aborted\]: Message verification failed"
19388
19389	  dotest_fail info-v8 "${testcvs} import -m bogus missing-var x y" \
19390"${SPROG} import: verifymsg:4: no such user variable \${=Bogus}
19391${SPROG} \[import aborted\]: Message verification failed"
19392
19393	  rm file2
19394	  cd ..
19395	  rmdir another-dir
19396
19397	  cd CVSROOT
19398	  echo "RereadLogAfterVerify=always" >>config
19399	  dotest info-rereadlog-1 "${testcvs} -q ci -m add-RereadLogAfterVerify=always" \
19400"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
19401new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19402$SPROG commit: Rebuilding administrative file database"
19403	  cd ../first-dir
19404	  echo line3 >>file1
19405	  cat >${TESTDIR}/comment.tmp <<EOF
19406BugId: new
19407See what happens next.
19408EOF
19409	  dotest info-reread-2 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
19410"vscript $tempname file1 1\.4
19411$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
19412new revision: 1\.5; previous revision: 1\.4"
19413	  dotest info-reread-3 "${testcvs} -q log -N -r1.5 file1" "
19414.*
19415BugId: new
19416See what happens next.
19417A new bugid was found.
19418============================================================================="
19419
19420	  cd ../CVSROOT
19421	  grep -v "RereadLogAfterVerify" config > config.new
19422	  mv config.new config
19423	  echo "RereadLogAfterVerify=stat" >>config
19424	  dotest info-reread-4 \
19425"$testcvs -q ci -m add-RereadLogAfterVerify=stat" \
19426"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
19427new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19428$SPROG commit: Rebuilding administrative file database"
19429	  cd ../first-dir
19430	  echo line4 >>file1
19431	  cat >${TESTDIR}/comment.tmp <<EOF
19432BugId: new
19433See what happens next with stat.
19434EOF
19435	  dotest info-reread-5 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
19436"vscript $tempname file1 1\.5
19437$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
19438new revision: 1\.6; previous revision: 1\.5"
19439	  dotest info-reread-6 "${testcvs} -q log -N -r1.6 file1" "
19440.*
19441BugId: new
19442See what happens next with stat.
19443A new bugid was found.
19444============================================================================="
19445
19446	  cd ../CVSROOT
19447	  grep -v "RereadLogAfterVerify" config > config.new
19448	  mv config.new config
19449	  echo "RereadLogAfterVerify=never" >>config
19450	  dotest info-reread-7 \
19451"$testcvs -q ci -m add-RereadLogAfterVerify=never" \
19452"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
19453new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19454$SPROG commit: Rebuilding administrative file database"
19455	  cd ../first-dir
19456	  echo line5 >>file1
19457	  cat >${TESTDIR}/comment.tmp <<EOF
19458BugId: new
19459See what happens next.
19460EOF
19461	  dotest info-reread-8 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
19462"vscript $tempname file1 1\.6
19463$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
19464new revision: 1\.7; previous revision: 1\.6"
19465	  dotest info-reread-6 "${testcvs} -q log -N -r1.7 file1" "
19466.*
19467BugId: new
19468See what happens next.
19469============================================================================="
19470
19471	  cd ../CVSROOT
19472	  dotest info-reread-cleanup-1 "$testcvs -q up -prinfo-start config >config"
19473	  # Append the NULL format string until we remove the deprecation
19474	  # warning for lack of format strings.
19475	  echo 'DEFAULT false %n' >verifymsg
19476	  echo 'DEFAULT true %n' >>verifymsg
19477	  dotest info-multdef "${testcvs} -q ci -m multdef" \
19478"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
19479new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19480$CVSROOT_DIRNAME/CVSROOT/verifymsg,v  <--  verifymsg
19481new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19482$SPROG commit: Rebuilding administrative file database"
19483
19484	  cd ../CVSROOT
19485	  dotest info-reread--cleanup-1 \
19486"$testcvs -q up -prinfo-start verifymsg >verifymsg"
19487	  dotest info-cleanup-verifymsg "$testcvs -q ci -m nuke-verifymsg" \
19488"$SPROG commit: Multiple .DEFAULT. lines (1 and 2) in verifymsg file
19489$CVSROOT_DIRNAME/CVSROOT/verifymsg,v  <--  verifymsg
19490new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19491$SPROG commit: Rebuilding administrative file database"
19492
19493	  dokeep
19494	  rm ${TESTDIR}/vscript*
19495	  cd ..
19496
19497	  dotest info-cleanup-0 "$testcvs -n release -d CVSROOT" \
19498"You have \[0\] altered files in this repository\."
19499
19500	  dotest info-cleanup-1 \
19501"echo yes |${testcvs} -q release -d CVSROOT >/dev/null"
19502	  dotest info-cleanup-2 \
19503"echo yes |${testcvs} -q release -d first-dir >/dev/null"
19504	  dotest info-cleanup-3 \
19505"echo yes |${testcvs} -q release -d third-dir >/dev/null"
19506	  dotest info-cleanup-4 \
19507"echo yes |${testcvs} -q release -d fourth-dir >/dev/null"
19508
19509	  dokeep
19510	  cd ..
19511	  rm -r wnt
19512	  rm $HOME/.cvsrc
19513	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
19514			     $CVSROOT_DIRNAME/third-dir \
19515			     $CVSROOT_DIRNAME/fourth-dir
19516	  ;;
19517
19518
19519
19520	taginfo)
19521	  # Tests of the CVSROOT/taginfo file.  See the comment at the
19522	  # "info" tests for a full list of administrative file tests.
19523
19524	  # all the oldfmt stuff can come out once we finish deprecating
19525	  # the old info file command line format stuff.
19526	  #
19527	  # grep the code for SUPPORT_OLD_INFO_FMT_STRINGS and see the stuff
19528	  # in configure.in about oldinfoformatsupport
19529
19530	  mkdir 1; cd 1
19531	  dotest taginfo-init-1 "$testcvs -q co CVSROOT" "U CVSROOT/$DOTSTAR"
19532	  cd CVSROOT
19533	  dotest taginfo-init-2 "$testcvs -Q tag taginfo-start"
19534	  cat >$TESTDIR/1/loggit <<EOF
19535#!$TESTSHELL
19536if test "\$1" = rejectme; then
19537  exit 1
19538else
19539  echo "\$@" >>$TESTDIR/1/taglog
19540  exit 0
19541fi
19542EOF
19543	  # #^@&!^@ Cygwin.
19544	  if test -n "$remotehost"; then
19545	    $CVS_RSH $remotehost "chmod +x ${TESTDIR}/1/loggit"
19546	  else
19547	    chmod +x ${TESTDIR}/1/loggit
19548	  fi
19549	  echo "ALL ${TESTDIR}/1/loggit" >>taginfo
19550	  sed -e's/^UseNewInfoFmtStrings=yes$/#&/' <config >tmpconfig
19551	  mv tmpconfig config
19552	  sed -e's/%p/ALL/' <loginfo >tmploginfo
19553	  mv tmploginfo loginfo
19554	  dotest taginfo-2 "${testcvs} -q ci -m check-in-taginfo" \
19555"$TESTDIR/cvsroot/CVSROOT/config,v  <--  config
19556new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19557$CVSROOT_DIRNAME/CVSROOT/loginfo,v  <--  loginfo
19558new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19559$CVSROOT_DIRNAME/CVSROOT/taginfo,v  <--  taginfo
19560new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19561$SPROG commit: Rebuilding administrative file database"
19562	  cd ..
19563
19564	  # taginfo-3 used to rely on the top-level CVS directory
19565	  # being created to add "first-dir" to the repository.  Since
19566	  # that won't happen anymore, we create the directory in the
19567	  # repository.
19568	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
19569	  dotest taginfo-3 "$testcvs -q co first-dir"
19570
19571	  cd first-dir
19572	  echo first >file1
19573	  dotest taginfo-4 "${testcvs} add file1" \
19574"${SPROG} add: scheduling file .file1. for addition
19575${SPROG} add: use .${SPROG} commit. to add this file permanently"
19576	  dotest taginfo-5 "${testcvs} -q ci -m add-it" \
19577"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
19578initial revision: 1\.1" \
19579"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
19580initial revision: 1\.1
19581$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
19582compatibility with the new info file format strings (add a temporary '1' in
19583all info files after each '%' which doesn't represent a literal percent)
19584and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
19585individual command lines and scripts to handle the new format at your
19586leisure\."
19587	  dotest taginfo-6 "${testcvs} -q tag tag1" \
19588"${SPROG} tag: warning: taginfo line contains no format strings:
19589    \"${TESTDIR}/1/loggit\"
19590Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19591usage is deprecated\.
19592T file1"
19593	  dotest taginfo-7 "${testcvs} -q tag -b br" \
19594"${SPROG} tag: warning: taginfo line contains no format strings:
19595    \"${TESTDIR}/1/loggit\"
19596Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19597usage is deprecated\.
19598T file1"
19599	  dotest taginfo-8 "$testcvs -q update -r br"
19600	  echo add text on branch >>file1
19601	  dotest taginfo-9 "${testcvs} -q ci -m modify-on-br" \
19602"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
19603new revision: 1\.1\.2\.1; previous revision: 1\.1" \
19604"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
19605new revision: 1\.1\.2\.1; previous revision: 1\.1
19606$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
19607compatibility with the new info file format strings (add a temporary '1' in
19608all info files after each '%' which doesn't represent a literal percent)
19609and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
19610individual command lines and scripts to handle the new format at your
19611leisure\."
19612	  dotest taginfo-10 "${testcvs} -q tag -F -c brtag" \
19613"${SPROG} tag: warning: taginfo line contains no format strings:
19614    \"${TESTDIR}/1/loggit\"
19615Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19616usage is deprecated\.
19617T file1"
19618
19619	  dotest_fail taginfo-11 "${testcvs} -q tag rejectme" \
19620"${SPROG} tag: warning: taginfo line contains no format strings:
19621    \"${TESTDIR}/1/loggit\"
19622Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19623usage is deprecated\.
19624${SPROG} tag: Pre-tag check failed
19625${SPROG} \[tag aborted\]: correct the above errors first!"
19626
19627	  # When we are using taginfo to allow/disallow, it would be
19628	  # convenient to be able to use "cvs -n tag" to test whether
19629	  # the allow/disallow functionality is working as expected.
19630	  dotest taginfo-12 "${testcvs} -nq tag rejectme" \
19631"${SPROG} tag: warning: taginfo line contains no format strings:
19632    \"${TESTDIR}/1/loggit\"
19633Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19634usage is deprecated\.
19635T file1"
19636
19637	  # But when taginfo is used for logging, it is a pain for -n
19638	  # to call taginfo, since taginfo doesn't know whether -n was
19639	  # specified or not.
19640	  dotest taginfo-13 "${testcvs} -nq tag would-be-tag" \
19641"${SPROG} tag: warning: taginfo line contains no format strings:
19642    \"${TESTDIR}/1/loggit\"
19643Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19644usage is deprecated\.
19645T file1"
19646
19647	  # Deleting: the cases are basically either the tag existed,
19648	  # or it didn't exist.
19649	  dotest taginfo-14 "${testcvs} -q tag -d tag1" \
19650"${SPROG} tag: warning: taginfo line contains no format strings:
19651    \"${TESTDIR}/1/loggit\"
19652Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19653usage is deprecated\.
19654D file1"
19655	  dotest taginfo-15 "${testcvs} -q tag -d tag1" \
19656"${SPROG} tag: warning: taginfo line contains no format strings:
19657    \"${TESTDIR}/1/loggit\"
19658Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19659usage is deprecated\."
19660
19661	  # Likewise with rtag.
19662	  dotest taginfo-16 "${testcvs} -q rtag tag1 first-dir" \
19663"${SPROG} rtag: warning: taginfo line contains no format strings:
19664    \"${TESTDIR}/1/loggit\"
19665Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19666usage is deprecated\."
19667	  dotest taginfo-17 "${testcvs} -q rtag -d tag1 first-dir" \
19668"${SPROG} rtag: warning: taginfo line contains no format strings:
19669    \"${TESTDIR}/1/loggit\"
19670Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19671usage is deprecated\."
19672	  dotest taginfo-18 "${testcvs} -q rtag -d tag1 first-dir" \
19673"${SPROG} rtag: warning: taginfo line contains no format strings:
19674    \"${TESTDIR}/1/loggit\"
19675Filling in old defaults ('%t %o %p %{sv}'), but please be aware that this
19676usage is deprecated\."
19677
19678	  # The "br" example should be passing 1.1.2 or 1.1.0.2.
19679	  # But it turns out that is very hard to implement, since
19680	  # check_fileproc doesn't know what branch number it will
19681	  # get.  Probably the whole thing should be re-architected
19682	  # so that taginfo only allows/denies tagging, and a new
19683	  # hook, which is done from tag_fileproc, does logging.
19684	  # That would solve this, some more subtle races, and also
19685	  # the fact that it is nice for users to run "-n tag foo" to
19686	  # see whether a tag would be allowed.  Failing that,
19687	  # I suppose passing "1.1.branch" or "branch" for "br"
19688	  # would be an improvement.
19689	  dotest taginfo-examine-1 "cat ${TESTDIR}/1/taglog" \
19690"tag1 add first-dir file1 1\.1
19691br add first-dir file1 1\.1
19692brtag mov first-dir file1 1\.1\.2\.1
19693tag1 del first-dir file1 1\.1
19694tag1 del first-dir
19695tag1 add first-dir file1 1\.1
19696tag1 del first-dir file1 1\.1
19697tag1 del first-dir"
19698
19699	  # now that we've tested the default operation, try a new
19700	  # style fmt string.
19701	  rm $TESTDIR/1/taglog
19702	  cd ..
19703	  cd CVSROOT
19704	  dotest taginfo-newfmt-init-1 \
19705"$testcvs -q up -prtaginfo-start taginfo >taginfo"
19706	  echo "ALL $TESTDIR/1/loggit %r %t %o %b %p %{sTVv}" >>taginfo
19707	  dotest taginfo-newfmt-init-2 "$testcvs -q ci -m check-in-taginfo" \
19708"$TESTDIR/cvsroot/CVSROOT/taginfo,v  <--  taginfo
19709new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19710$SPROG commit: Rebuilding administrative file database"  \
19711"$TESTDIR/cvsroot/CVSROOT/taginfo,v  <--  taginfo
19712new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19713$SPROG commit: Rebuilding administrative file database
19714$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
19715compatibility with the new info file format strings (add a temporary '1' in
19716all info files after each '%' which doesn't represent a literal percent)
19717and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
19718individual command lines and scripts to handle the new format at your
19719leisure\."
19720
19721	  cat >${TESTDIR}/1/loggit <<EOF
19722#!${TESTSHELL}
19723if test "\$1" = rejectme; then
19724  exit 1
19725else
19726  while test "\$#" -gt 0; do
19727    echo "\$1" >>${TESTDIR}/1/taglog
19728    shift
19729  done
19730  exit 0
19731fi
19732EOF
19733
19734	  cd ..
19735	  cd first-dir
19736	  dotest taginfo-newfmt-2 "${testcvs} -q update -A" "[UP] file1"
19737	  echo "bull pucky" >'file 2'
19738	  dotest taginfo-newfmt-2b "${testcvs} add 'file 2'" \
19739"${SPROG} add: scheduling file .file 2. for addition
19740${SPROG} add: use .${SPROG} commit. to add this file permanently"
19741	  dotest taginfo-newfmt-2c "$testcvs -q ci -m add-it" \
19742"$TESTDIR/cvsroot/first-dir/file 2,v  <--  file 2
19743initial revision: 1\.1" \
19744"$TESTDIR/cvsroot/first-dir/file 2,v  <--  file 2
19745initial revision: 1\.1
19746$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
19747compatibility with the new info file format strings (add a temporary '1' in
19748all info files after each '%' which doesn't represent a literal percent)
19749and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
19750individual command lines and scripts to handle the new format at your
19751leisure\."
19752
19753	  dotest taginfo-newfmt-3 "${testcvs} -q tag tag1" \
19754"T file 2
19755T file1"
19756	  dotest taginfo-newfmt-4 "${testcvs} -q tag tag3" \
19757"T file 2
19758T file1"
19759	  dotest taginfo-newfmt-5 "$testcvs -q tag -rtag1 tag4" \
19760"T file 2
19761T file1"
19762
19763	  dotest taginfo-newfmt-examine-1 "cat ${TESTDIR}/1/taglog" \
19764"$TESTDIR/cvsroot
19765tag1
19766add
19767N
19768first-dir
19769file 2
19770
19771NONE
197721\.1
19773file1
19774
19775NONE
197761\.1
19777$TESTDIR/cvsroot
19778tag3
19779add
19780N
19781first-dir
19782file 2
19783
19784NONE
197851\.1
19786file1
19787
19788NONE
197891\.1
19790$TESTDIR/cvsroot
19791tag4
19792add
19793N
19794first-dir
19795file 2
19796tag1
19797NONE
197981\.1
19799file1
19800tag1
19801NONE
198021\.1"
19803
19804	  # now update to use the new format strings (really, disable support
19805	  # of the old format) and run the whole gamut of tests again.
19806	  rm ${TESTDIR}/1/taglog
19807	  cd ..
19808	  cd CVSROOT
19809	  cat >${TESTDIR}/1/loggit <<EOF
19810#!${TESTSHELL}
19811if test "\$1" = rejectme; then
19812  exit 1
19813else
19814  echo "\$@" >>${TESTDIR}/1/taglog
19815  exit 0
19816fi
19817EOF
19818	  dotest taginfo-newfmt-init-7 \
19819"$testcvs -q up -prtaginfo-start taginfo >taginfo"
19820	  echo "ALL ${TESTDIR}/1/loggit %{t} %b %{o} %p %{sTVv}" >>taginfo
19821	  echo "UseNewInfoFmtStrings=yes" >>config
19822	  dotest taginfo-newfmt-7 "$testcvs -q ci -m check-in-taginfo" \
19823"$TESTDIR/cvsroot/CVSROOT/config,v  <--  config
19824new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19825$TESTDIR/cvsroot/CVSROOT/taginfo,v  <--  taginfo
19826new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19827$SPROG commit: Rebuilding administrative file database" \
19828"$TESTDIR/cvsroot/CVSROOT/config,v  <--  config
19829new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19830$TESTDIR/cvsroot/CVSROOT/taginfo,v  <--  taginfo
19831new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19832$SPROG commit: Rebuilding administrative file database
19833$SPROG commit: warning:  Set to use deprecated info format strings\.  Establish
19834compatibility with the new info file format strings (add a temporary '1' in
19835all info files after each '%' which doesn't represent a literal percent)
19836and set UseNewInfoFmtStrings=yes in CVSROOT/config\.  After that, convert
19837individual command lines and scripts to handle the new format at your
19838leisure\."
19839
19840	  cd ../first-dir
19841	  dotest taginfo-newfmt-8 "${testcvs} -q tag tag1" ""
19842	  mkdir sdir
19843	  dotest taginfo-newfmt-8b "${testcvs} -q add sdir" \
19844"Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
19845	  touch sdir/file3
19846	  dotest taginfo-newfmt-8c "${testcvs} -q add sdir/file3" \
19847"${SPROG} add: use .${SPROG} commit. to add this file permanently"
19848	  dotest taginfo-newfmt-8d "${testcvs} -q ci -m added-sdir" \
19849"${TESTDIR}/cvsroot/first-dir/sdir/file3,v  <--  sdir/file3
19850initial revision: 1\.1"
19851	  dotest taginfo-newfmt-9 "${testcvs} -q tag -b br" \
19852"T file 2
19853W file1 : br already exists on branch 1\.1\.2\.1 : NOT MOVING tag to branch 1\.1\.0\.4
19854T sdir/file3"
19855	  dotest taginfo-newfmt-10 "${testcvs} -q update -r br" "[UP] file1"
19856	  echo add more text on branch >>file1
19857	  dotest taginfo-newfmt-11 "${testcvs} -q ci -m modify-on-br" \
19858"${TESTDIR}/cvsroot/first-dir/file1,v  <--  file1
19859new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1"
19860	  dotest taginfo-newfmt-12 "${testcvs} -q tag -F -c brtag" \
19861"T file 2
19862T file1
19863T sdir/file3"
19864
19865	  # we are being called once for each directory.  I'm not sure
19866	  # I like this, but I'm also not sure how hard it would be to change,
19867	  # It seems like it would be more trouble than it is really worth
19868	  # to let a partial tag go through...
19869	  dotest_fail taginfo-newfmt-13 "${testcvs} -q tag rejectme" \
19870"${SPROG} tag: Pre-tag check failed
19871${SPROG} tag: Pre-tag check failed
19872${SPROG} \[tag aborted\]: correct the above errors first!"
19873
19874	  # When we are using taginfo to allow/disallow, it would be
19875	  # convenient to be able to use "cvs -n tag" to test whether
19876	  # the allow/disallow functionality is working as expected.
19877	  # see the comment before taginfo-newfmt-15 for notes on
19878	  # pretag and posttag proc
19879	  dotest taginfo-newfmt-14 "${testcvs} -nq tag rejectme" \
19880"T file 2
19881T file1
19882T sdir/file3"
19883
19884	  # But when taginfo is used for logging, it is a pain for -n
19885	  # to call taginfo, since taginfo doesn't know whether -n was
19886	  # specified or not. (this could be fixed pretty easily now
19887	  # with a new fmt string.  i suppose it would be better to
19888	  # have a pretag proc and a posttag proc, though.)
19889	  dotest taginfo-newfmt-15 "${testcvs} -nq tag would-be-tag" \
19890"T file 2
19891T file1
19892T sdir/file3"
19893
19894	  # Deleting: the cases are basically either the tag existed,
19895	  # or it didn't exist.
19896	  dotest taginfo-newfmt-16 "${testcvs} -q tag -d tag1" \
19897"D file 2
19898D file1"
19899	  dotest taginfo-newfmt-17 "${testcvs} -q tag -d tag1" ""
19900
19901	  # Likewise with rtag.
19902	  dotest taginfo-newfmt-18 "${testcvs} -q rtag tag1 first-dir" ""
19903	  dotest taginfo-newfmt-19 "${testcvs} -q rtag -d tag1 first-dir" ""
19904	  dotest taginfo-newfmt-20 "${testcvs} -q rtag -d tag1 first-dir" ""
19905
19906	  # The "br" example should be passing 1.1.2 or 1.1.0.2.
19907	  # But it turns out that is very hard to implement, since
19908	  # check_fileproc doesn't know what branch number it will
19909	  # get.  Probably the whole thing should be re-architected
19910	  # so that taginfo only allows/denies tagging, and a new
19911	  # hook, which is done from tag_fileproc, does logging.
19912	  # That would solve this, some more subtle races, and also
19913	  # the fact that it is nice for users to run "-n tag foo" to
19914	  # see whether a tag would be allowed.  Failing that,
19915	  # I suppose passing "1.1.branch" or "branch" for "br"
19916	  # would be an improvement.
19917	  dotest taginfo-newfmt-examine-2 "cat ${TESTDIR}/1/taglog" \
19918"tag1 N add first-dir
19919br T add first-dir file 2  NONE 1\.1
19920br T add first-dir/sdir file3  NONE 1\.1
19921brtag N mov first-dir file 2 br NONE 1\.1 file1 br 1\.1\.2\.1 1\.1\.2\.2
19922brtag N mov first-dir/sdir file3 br NONE 1\.1
19923tag1 ? del first-dir file 2 br 1\.1 1\.1 file1 br 1\.1 1\.1
19924tag1 ? del first-dir/sdir
19925tag1 ? del first-dir
19926tag1 ? del first-dir/sdir
19927tag1 N add first-dir file 2  NONE 1\.1 file1  NONE 1\.1
19928tag1 N add first-dir/sdir file3  NONE 1\.1
19929tag1 ? del first-dir file 2  1\.1 1\.1 file1  1\.1 1\.1
19930tag1 ? del first-dir/sdir file3  1\.1 1\.1
19931tag1 ? del first-dir
19932tag1 ? del first-dir/sdir"
19933
19934	  dokeep
19935	  restore_adm
19936	  cd ../..
19937	  rm -r 1
19938	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
19939	  ;;
19940
19941
19942
19943	posttag)
19944	  # Tests of the CVSROOT/taginfo file.  See the comment at the
19945	  # "info" tests for a full list of administrative file tests.
19946
19947	  mkdir 1; cd 1
19948
19949	  dotest posttag-init-1 "$testcvs -q co CVSROOT" "U CVSROOT/$DOTSTAR"
19950
19951	  # now that we've tested the default operation, try a new
19952	  # style fmt string.
19953	  cd CVSROOT
19954	  echo "ALL $TESTDIR/1/loggit %r %t %o %b %p %{sVv}" >posttag
19955	  dotest posttag-init-2 "$testcvs -q ci -m check-in-taginfo" \
19956"$TESTDIR/cvsroot/CVSROOT/posttag,v  <--  posttag
19957new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
19958$SPROG commit: Rebuilding administrative file database"
19959	  cd ..
19960
19961	  cat >$TESTDIR/1/loggit <<EOF
19962#!$TESTSHELL
19963if test "\$1" = rejectme; then
19964    error=:
19965else
19966    error=false
19967fi
19968
19969while [ -n "\$1" ]; do
19970    echo "\$1" >>$TESTDIR/1/taglog
19971    shift
19972done
19973
19974if \$error; then
19975  exit 1
19976fi
19977exit 0
19978EOF
19979	  # #^@&!^@ Cygwin.
19980	  if test -n "$remotehost"; then
19981	    $CVS_RSH $remotehost "chmod +x $TESTDIR/1/loggit"
19982	  else
19983	    chmod +x $TESTDIR/1/loggit
19984	  fi
19985
19986	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
19987	  dotest posttag-init-3 "$testcvs -q co first-dir"
19988
19989	  cd first-dir
19990	  echo first >file1
19991	  echo "bull pucky" >'file 2'
19992	  dotest posttag-init-4 "$testcvs add file1 'file 2'" \
19993"$SPROG add: scheduling file \`file1' for addition
19994$SPROG add: scheduling file \`file 2' for addition
19995$SPROG add: use \`$SPROG commit' to add these files permanently"
19996	  dotest posttag-init-5 "$testcvs -q ci -m add-it" \
19997"$CVSROOT_DIRNAME/first-dir/file 2,v  <--  file 2
19998initial revision: 1\.1
19999$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
20000initial revision: 1\.1"
20001
20002	  dotest posttag-1 "$testcvs -q tag tag1" \
20003"T file 2
20004T file1"
20005	  dotest posttag-2 "$testcvs -q tag tag3" \
20006"T file 2
20007T file1"
20008
20009	  dotest posttag-3 "$testcvs -q tag rejectme" \
20010"T file 2
20011T file1"
20012
20013	  dotest posttag-4 "$testcvs -q tag -d rejectme" \
20014"D file 2
20015D file1"
20016
20017	  dotest posttag-examine-1 "cat $TESTDIR/1/taglog" \
20018"$TESTDIR/cvsroot
20019tag1
20020add
20021N
20022first-dir
20023file 2
20024NONE
200251\.1
20026file1
20027NONE
200281\.1
20029$TESTDIR/cvsroot
20030tag3
20031add
20032N
20033first-dir
20034file 2
20035NONE
200361\.1
20037file1
20038NONE
200391\.1
20040$TESTDIR/cvsroot
20041rejectme
20042add
20043N
20044first-dir
20045file 2
20046NONE
200471.1
20048file1
20049NONE
200501.1
20051$TESTDIR/cvsroot
20052rejectme
20053del
20054?
20055first-dir
20056file 2
200571.1
200581.1
20059file1
200601.1
200611.1"
20062
20063	  dokeep
20064	  cd ../..
20065	  restore_adm
20066	  rm -r 1
20067	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
20068	  ;;
20069
20070
20071
20072	config)
20073	  # Tests of the CVSROOT/config file.  See the comment at the
20074	  # "info" tests for a full list of administrative file tests.
20075
20076	  # See note in keywordexpand about config errors from a proxied
20077	  # primary.
20078	  if $noredirect; then
20079	    notnoredirect config
20080	    continue
20081	  fi
20082
20083	  # On Windows, we can't check out CVSROOT, because the case
20084	  # insensitivity means that this conflicts with cvsroot.
20085	  mkdir wnt
20086	  cd wnt
20087
20088	  dotest config-init-1 "$testcvs -q co CVSROOT" "U CVSROOT/$DOTSTAR"
20089	  cd CVSROOT
20090	  dotest config-init-2 "$testcvs -Q tag config-start"
20091	  echo 'bogus line' >>config
20092	  dotest config-3 "$testcvs -q ci -m change-to-bogus-line" \
20093"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20094new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20095$SPROG commit: Rebuilding administrative file database"
20096	  dotest config-3a "$testcvs -Q update -jHEAD -jconfig-start" \
20097"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: syntax error: missing \`=' between keyword and value
20098RCS file: $CVSROOT_DIRNAME/CVSROOT/config,v
20099retrieving revision 1.[0-9]*
20100retrieving revision 1.[0-9]*
20101Merging differences between 1.[0-9]* and 1.[0-9]* into config"
20102	  echo 'BogusOption=yes' >>config
20103	  if $proxy; then
20104	    dotest config-4p "$testcvs -q ci -m change-to-bogus-opt" \
20105"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: syntax error: missing \`=' between keyword and value
20106$SPROG [a-z]*: $CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: syntax error: missing \`=' between keyword and value
20107$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20108new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20109$SPROG commit: Rebuilding administrative file database"
20110	  else
20111	    dotest config-4 "$testcvs -q ci -m change-to-bogus-opt" \
20112"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: syntax error: missing \`=' between keyword and value
20113$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20114new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20115$SPROG commit: Rebuilding administrative file database"
20116	  fi
20117
20118	  if $proxy; then
20119	    : # FIXME: don't try in proxy mode
20120	  else
20121	    # Now test the HistoryLogPath and HistorySearchPath options.
20122	    mkdir $TESTDIR/historylogs
20123	    echo >config \
20124	         'HistoryLogPath=$CVSROOT/../historylogs/%Y-%m-%d-%H-%M-%S'
20125	    echo 'HistorySearchPath=$CVSROOT/../historylogs/*' >>config
20126
20127	    # The warning is left over from the previous test.
20128	    dotest config-5 "$testcvs -q ci -m set-HistoryLogPath" \
20129"$SPROG [a-z]*: $CVSROOT_DIRNAME/CVSROOT/config \[[1-9][0-9]*\]: unrecognized keyword \`BogusOption'
20130$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20131new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20132$SPROG commit: Rebuilding administrative file database"
20133
20134	    echo '# noop' >> config
20135	    dotest config-6 "$testcvs -q ci -mlog-commit" \
20136"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20137new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20138$SPROG commit: Rebuilding administrative file database"
20139
20140	    echo '# noop' >> config
20141	    dotest config-7 "$testcvs -q ci -mlog-commit" \
20142"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20143new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20144$SPROG commit: Rebuilding administrative file database"
20145
20146	    # The log entry was intentionally split across multiple files.
20147	    dotest config-8 "ls -l $TESTDIR/historylogs/*" \
20148"-rw-rw-r--.*$TESTDIR/historylogs/2[0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]-[0-2][0-9]-[0-5][0-9]-[0-5][0-9]
20149-rw-rw-r--.*$TESTDIR/historylogs/2[0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]-[0-2][0-9]-[0-5][0-9]-[0-5][0-9]"
20150
20151	    # Should still see both commits.
20152	    if $remote; then
20153	      dotest config-9r "$testcvs history -ea" \
20154"M [0-9-]* [0-9:]* ${PLUS}0000 $username 1\.[0-9]* config CVSROOT == <remote>
20155M [0-9-]* [0-9:]* ${PLUS}0000 $username 1\.[0-9]* config CVSROOT == <remote>"
20156	    else
20157	      dotest config-9 "$testcvs history -ea" \
20158"M [0-9-]* [0-9:]* ${PLUS}0000 $username 1\.[0-9]* config CVSROOT == $TESTDIR/wnt/CVSROOT
20159M [0-9-]* [0-9:]* ${PLUS}0000 $username 1\.[0-9]* config CVSROOT == $TESTDIR/wnt/CVSROOT"
20160	    fi
20161
20162	    # Remove this now to see what kind of error messages we get.
20163	    rm -r $TESTDIR/historylogs
20164	  fi
20165
20166	  dokeep
20167	  restore_adm
20168	  cd ../..
20169	  rm -r wnt
20170	  ;;
20171
20172
20173
20174	config2)
20175	  # Tests of the CVSROOT/config file.  See the comment at the
20176	  # "info" tests for a full list of administrative file tests.
20177
20178	  # No point in testing compression effects in local mode.
20179          if $remote; then :; else
20180            remoteonly config2
20181	    continue
20182	  fi
20183
20184	  # On Windows, we can't check out CVSROOT, because the case
20185	  # insensitivity means that this conflicts with cvsroot.
20186	  mkdir wnt
20187	  cd wnt
20188
20189	  # Set MinCompressionLevel and MaxCompressionLevel in config.
20190	  dotest config2-init-1 "$testcvs -q co CVSROOT" "U CVSROOT/$DOTSTAR"
20191	  dotest config2-init-1b "$testcvs -Q tag initial"
20192	  cd CVSROOT
20193	  cat << EOF >> config
20194MinCompressionLevel=5
20195MaxCompressionLevel=6
20196EOF
20197	  dotest config2-init-2 \
20198"$testcvs -q ci -m set-compression-constraints" \
20199"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20200new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20201$SPROG commit: Rebuilding administrative file database"
20202
20203	  # Verify that the server reports forcing compression to an allowed
20204	  # level.
20205
20206	  # Too high.
20207	  dotest config2-1 "$testcvs -z9 update" \
20208"$SPROG server: Forcing compression level 6 (allowed: 5 <= z <= 6)\.
20209$SPROG update: Updating \."
20210	  # Too low.
20211	  dotest config2-2 "$testcvs -z1 update" \
20212"$SPROG server: Forcing compression level 5 (allowed: 5 <= z <= 6)\.
20213$SPROG update: Updating \."
20214	  # From zero.
20215	  dotest config2-3 "$testcvs update" \
20216"$SPROG server: Forcing compression level 5 (allowed: 5 <= z <= 6)\.
20217$SPROG update: Updating \."
20218	  # Just right.
20219	  dotest config2-3 "$testcvs -z5 update" \
20220"$SPROG update: Updating \."
20221
20222	  # Check that compression may be forced to 0.
20223	  dotest config2-init-2b "$testcvs -z5 up -jHEAD -jinitial" "$DOTSTAR"
20224	  cat << EOF >> config
20225MaxCompressionLevel=0
20226EOF
20227	  dotest config2-init-3 "$testcvs -qz5 ci -m no-compression" \
20228"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20229new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20230$SPROG commit: Rebuilding administrative file database"
20231
20232	  # Too high.
20233	  dotest config2-5 "$testcvs -z9 update" \
20234"$SPROG server: Forcing compression level 0 (allowed: 0 <= z <= 0)\.
20235$SPROG update: Updating \."
20236	  # Just right.
20237	  dotest config2-6 "$testcvs update" \
20238"$SPROG update: Updating \."
20239
20240	  # And verify effect without restrictions.
20241	  dotest config2-init-3b "$testcvs up -jHEAD -jinitial" "$DOTSTAR"
20242	  dotest config2-init-4 "$testcvs -q ci -m change-to-comment" \
20243"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20244new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20245$SPROG commit: Rebuilding administrative file database"
20246	  dotest config2-7 "$testcvs update" \
20247"$SPROG update: Updating \."
20248
20249	  dokeep
20250	  restore_adm
20251	  cd ../..
20252	  rm -r wnt
20253	  ;;
20254
20255	config3)
20256	  # Verify comments, white space, & [rootspecs] in CVSROOT/config
20257	  #
20258	  # `cvs server' `-c' option tested in `server' test
20259	  modify_repo mkdir $CVSROOT_DIRNAME/config3
20260	  mkdir config3
20261	  cd config3
20262
20263	  dotest config3-init-1 "$testcvs -q co CVSROOT" "U CVSROOT/$DOTSTAR"
20264	  cd CVSROOT
20265
20266	  # I break the usual sanity.sh indentation standard for here-docs
20267	  # mostly to test that leading white-space is now ignored.
20268	  dotest config3-init-1b "$testcvs -Q tag initial-config"
20269
20270	  cat <<EOF >>config
20271	      # Ignore a comment with leading spaces.
20272	      GLOBAL-BAD-OPTION=WWW
20273 
20274	      [/ignore/this/root]
20275	      [/and/this/one]
20276		  IGNORED-BAD-OPTION=YYY
20277EOF
20278	  dotest config3-init-2 \
20279"$testcvs -q ci -m test-root-specs" \
20280"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20281new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20282$SPROG commit: Rebuilding administrative file database"
20283
20284	  cd ..
20285	  dotest config3-1 "$testcvs co config3" \
20286"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[0-9]*\]: unrecognized keyword \`GLOBAL-BAD-OPTION'
20287$SPROG checkout: Updating config3"
20288
20289	  cd CVSROOT
20290	  dotest config3-init-2a "$testcvs -Q up -jHEAD -jinitial-config" \
20291"$DOTSTAR
20292Merging differences between 1\.[0-9]* and 1\.[0-9]* into config"
20293
20294	  cat <<EOF >>config
20295	      # Ignore a comment with leading spaces.
20296
20297	      [/ignore/this/root]
20298	      [/and/this/one]
20299		  IGNORED-BAD-OPTION=YYY
20300		  # Ignore a comment with leading spaces.
20301
20302	      [/some/other/root]
20303
20304	      # Comments and blank lines do not affect fall-through behavior.
20305
20306	      [$CVSROOT_DIRNAME]
20307	      [$SECONDARY_CVSROOT_DIRNAME]
20308
20309	      # Comments and blank lines do not affect fall-through behavior.
20310
20311	      [/yet/another/root]
20312		  # Ignore a comment with leading spaces.
20313		  PROCESS-BAD-OPTION=XXX
20314EOF
20315	  dotest config3-init-3 \
20316"$testcvs -q ci -m test-root-specs" \
20317"$SPROG [a-z]*: $CVSROOT_DIRNAME/CVSROOT/config \[[0-9]*\]: unrecognized keyword \`GLOBAL-BAD-OPTION'
20318$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20319new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20320$SPROG commit: Rebuilding administrative file database" \
20321"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[0-9]*\]: unrecognized keyword \`GLOBAL-BAD-OPTION'
20322$SPROG [a-z]*: $CVSROOT_DIRNAME/CVSROOT/config \[[0-9]*\]: unrecognized keyword \`GLOBAL-BAD-OPTION'
20323$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20324new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20325$SPROG commit: Rebuilding administrative file database"
20326
20327	  cd ..
20328	  dotest config3-2 "$testcvs co config3" \
20329"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[0-9]*\]: unrecognized keyword \`PROCESS-BAD-OPTION'
20330$SPROG checkout: Updating config3"
20331
20332	  # The next few tests make sure both global options and root
20333	  # specific options are processed by setting the history log and
20334	  # search paths in different locations and then verifying that
20335	  # both registered.  It also verifies that a key for a different
20336	  # root is ignored.
20337	  cd CVSROOT
20338	  dotest config3-init-3a "$testcvs -Q up -jHEAD -jinitial-config" \
20339"$DOTSTAR
20340Merging differences between 1\.[0-9]* and 1\.[0-9]* into config"
20341
20342	  cat <<EOF >>config
20343	      HistoryLogPath=$TESTDIR/historylog
20344
20345	      [/ignore/this/root]
20346	      [/and/this/one]
20347		  IGNORED-BAD-OPTION=YYY
20348
20349	      [/some/other/root]
20350	      [$CVSROOT_DIRNAME]
20351	      [$SECONDARY_CVSROOT_DIRNAME]
20352	      [/yet/another/root]
20353		  HistorySearchPath=$TESTDIR/historylog
20354
20355	      [/ignore/another/root]
20356	      [/and/this/one/too]
20357		  ANOTHER-IGNORED-BAD-OPTION=ZZZ
20358
20359	      [$CVSROOT_DIRNAME]
20360	      [$SECONDARY_CVSROOT_DIRNAME]
20361		  LogHistory=TMAR
20362EOF
20363	  dotest config3-init-4 \
20364"$testcvs -q ci -m test-root-specs" \
20365"$SPROG [a-z]*: $CVSROOT_DIRNAME/CVSROOT/config \[[0-9]*\]: unrecognized keyword \`PROCESS-BAD-OPTION'
20366$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20367new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20368$SPROG commit: Rebuilding administrative file database" \
20369"$SPROG [a-z]*: $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \[[0-9]*\]: unrecognized keyword \`PROCESS-BAD-OPTION'
20370$SPROG [a-z]*: $CVSROOT_DIRNAME/CVSROOT/config \[[0-9]*\]: unrecognized keyword \`PROCESS-BAD-OPTION'
20371$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20372new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20373$SPROG commit: Rebuilding administrative file database"
20374
20375	  cd ..
20376	  dotest config3-3 "$testcvs co -d config3-2 config3" \
20377"$SPROG checkout: Updating config3-2"
20378
20379	  cd config3-2
20380	  touch newfile
20381	  dotest config3-4 "$testcvs -Q add newfile"
20382	  dotest config3-5 "$testcvs -q ci -madd-file" \
20383"$CVSROOT_DIRNAME/config3/newfile,v  <--  newfile
20384initial revision: 1\.1"
20385
20386	  dotest config3-6 "$testcvs rtag testtag config3" \
20387"$SPROG rtag: Tagging config3"
20388
20389	  cd ..
20390	  dotest config3-7 "$testcvs history -ea" \
20391"A [0-9-]* [0-9:]* ${PLUS}0000 $username 1\.1 newfile config3 == [-_/a-zA-Z0-9<>]*
20392T [0-9-]* [0-9:]* ${PLUS}0000 $username config3 \[testtag:A\]"
20393
20394	  dokeep
20395	  restore_adm
20396	  cd ..
20397	  rm -r config3
20398	  modify_repo rm -rf $CVSROOT_DIRNAME/config3
20399	  ;;
20400
20401
20402
20403	config4)
20404	  # TmpDir
20405	  mkdir config4
20406	  cd config4
20407
20408	  dotest config4-init-1 "$testcvs -q co CVSROOT" "U CVSROOT/$DOTSTAR"
20409	  cd CVSROOT
20410	  mkdir $TESTDIR/config4/tmp
20411	  echo "TmpDir=$TESTDIR/config4/tmp" >>config
20412	  echo "DEFAULT $TESTDIR/config4/verify %l" >>verifymsg
20413	  dotest config4-init-2 "$testcvs -q ci -m change-tmpdir" \
20414"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20415new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20416$CVSROOT_DIRNAME/CVSROOT/verifymsg,v  <--  verifymsg
20417new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20418$SPROG commit: Rebuilding administrative file database"
20419
20420	  cat >$TESTDIR/config4/verify <<EOF
20421#! /bin/sh
20422echo \$1
20423exit 0
20424EOF
20425	  chmod a+x $TESTDIR/config4/verify
20426	  dotest config4-1 \
20427"$testcvs -q ci -fmtest-tmpdir config" \
20428"$TESTDIR/config4/tmp/$tempfile
20429$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
20430new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
20431$SPROG commit: Rebuilding administrative file database"
20432
20433	  dokeep
20434	  restore_adm
20435	  cd ../..
20436	  rm -r config4
20437	  modify_repo rm -rf $CVSROOT_DIRNAME/config4
20438	  ;;
20439
20440
20441
20442	serverpatch)
20443	  # Test remote CVS handling of unpatchable files.  This isn't
20444	  # much of a test for local CVS.
20445	  # We test this with some keyword expansion games, but the situation
20446	  # also arises if the user modifies the file while CVS is running.
20447	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
20448	  mkdir 1
20449	  cd 1
20450	  dotest serverpatch-1 "$testcvs -q co first-dir"
20451
20452	  cd first-dir
20453
20454	  # Add a file with an RCS keyword.
20455	  echo '$''Name$' > file1
20456	  echo '1' >> file1
20457	  dotest serverpatch-2 "$testcvs add file1" \
20458"$SPROG add: scheduling file \`file1' for addition
20459$SPROG add: use \`$SPROG commit' to add this file permanently"
20460
20461	  dotest serverpatch-3 "${testcvs} -q commit -m add" \
20462"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
20463initial revision: 1\.1"
20464
20465	  # Tag the file.
20466	  dotest serverpatch-4 "${testcvs} -q tag tag file1" 'T file1'
20467
20468	  # Check out a tagged copy of the file.
20469	  cd ../..
20470	  mkdir 2
20471	  cd 2
20472	  dotest serverpatch-5 "${testcvs} -q co -r tag first-dir" \
20473'U first-dir/file1'
20474
20475	  # Remove the tag.  This will leave the tag string in the
20476	  # expansion of the Name keyword.
20477	  dotest serverpatch-6 "${testcvs} -q update -A first-dir" ''
20478
20479	  # Modify and check in the first copy.
20480	  cd ../1/first-dir
20481	  echo '2' >> file1
20482	  dotest serverpatch-7 "${testcvs} -q ci -mx file1" \
20483"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
20484new revision: 1\.2; previous revision: 1\.1"
20485
20486	  # Now update the second copy.  When using remote CVS, the
20487	  # patch will fail, forcing the file to be refetched.
20488	  cd ../../2/first-dir
20489	  dotest serverpatch-8 "${testcvs} -q update" \
20490'U file1' \
20491"P file1
20492${CPROG} update: checksum failure after patch to \./file1; will refetch
20493${CPROG} client: refetching unpatchable files
20494$SPROG update: warning: \`file1' was lost
20495U file1"
20496
20497	  dokeep
20498	  cd ../..
20499	  rm -r 1 2
20500	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
20501	  ;;
20502
20503
20504
20505	log)
20506	  # Test selecting revisions with cvs log.
20507	  # See also log2 tests for more tests.
20508	  # See also branches-14.3 for logging with a branch off of a branch.
20509	  # See also multibranch-14 for logging with several branches off the
20510	  #   same branchpoint.
20511	  # Tests of each option to cvs log:
20512	  #   -h: admin-19a-log
20513	  #   -N: log, log2, admin-19a-log
20514	  #   -b, -r: log
20515	  #   -d: logopt, rcs
20516	  #   -s: logopt, rcs3
20517	  #   -R: logopt, rcs3
20518	  #   -w, -t: not tested yet (TODO)
20519
20520	  # Check in a file with a few revisions and branches.
20521	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
20522	  dotest log-1 "$testcvs -q co first-dir"
20523	  cd first-dir
20524	  echo 'first revision' > file1
20525	  echo 'first revision' > file2
20526	  dotest log-2 "${testcvs} add file1 file2" \
20527"${SPROG} add: scheduling file .file1. for addition
20528${SPROG} add: scheduling file .file2. for addition
20529${SPROG} add: use .${SPROG} commit. to add these files permanently"
20530
20531	  # While we're at it, check multi-line comments, input from file,
20532	  # and trailing whitespace trimming
20533	  echo 'line 1     '	 >${TESTDIR}/comment.tmp
20534	  echo '     '		>>${TESTDIR}/comment.tmp
20535	  echo 'line 2	'	>>${TESTDIR}/comment.tmp
20536	  echo '	'	>>${TESTDIR}/comment.tmp
20537	  echo '  	  '	>>${TESTDIR}/comment.tmp
20538	  dotest log-3 "${testcvs} -q commit -F ${TESTDIR}/comment.tmp" \
20539"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
20540initial revision: 1\.1
20541$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
20542initial revision: 1\.1"
20543	  rm -f ${TESTDIR}/comment.tmp
20544
20545	  echo 'second revision' > file1
20546	  echo 'second revision' > file2
20547	  dotest log-4 "${testcvs} -q ci -m2 file1 file2" \
20548"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
20549new revision: 1\.2; previous revision: 1\.1
20550$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
20551new revision: 1\.2; previous revision: 1\.1"
20552
20553	  dotest log-5 "${testcvs} -q tag -b branch file1" 'T file1'
20554	  dotest log-5a "${testcvs} -q tag tag1 file2" 'T file2'
20555
20556	  echo 'third revision' > file1
20557	  echo 'third revision' > file2
20558	  dotest log-6 "${testcvs} -q ci -m3 file1 file2" \
20559"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
20560new revision: 1\.3; previous revision: 1\.2
20561$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
20562new revision: 1\.3; previous revision: 1\.2"
20563
20564	  dotest log-6a "${testcvs} -q tag tag2 file2" 'T file2'
20565
20566	  dotest log-7 "${testcvs} -q update -r branch" \
20567"[UP] file1
20568${SPROG} update: \`file2' is no longer in the repository"
20569
20570	  echo 'first branch revision' > file1
20571	  dotest log-8 "${testcvs} -q ci -m1b file1" \
20572"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
20573new revision: 1\.2\.2\.1; previous revision: 1\.2"
20574
20575	  dotest log-9 "${testcvs} -q tag tag file1" 'T file1'
20576
20577	  echo 'second branch revision' > file1
20578	  dotest log-10 "${testcvs} -q ci -m2b file1" \
20579"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
20580new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1"
20581
20582	  # Set up a bunch of shell variables to make the later tests
20583	  # easier to describe.=
20584	  log_header1="
20585RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20586Working file: file1
20587head: 1\.3
20588branch:
20589locks: strict
20590access list:"
20591	  rlog_header1="
20592RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
20593head: 1\.3
20594branch:
20595locks: strict
20596access list:"
20597	  log_tags1='symbolic names:
20598	tag: 1\.2\.2\.1
20599	branch: 1\.2\.0\.2'
20600	  log_keyword='keyword substitution: kv'
20601	  log_dash='----------------------------
20602revision'
20603	  log_date="date: ${ISO8601DATE};  author: ${username};  state: Exp;"
20604	  log_lines="  lines: ${PLUS}1 -1;"
20605	  log_commitid="  commitid: ${commitid};"
20606	  log_rev1="${log_dash} 1\.1
20607${log_date}${log_commitid}
20608line 1
20609
20610line 2"
20611	  log_rev2="${log_dash} 1\.2
20612${log_date}${log_lines}${log_commitid}
20613branches:  1\.2\.2;
206142"
20615	  log_rev3="${log_dash} 1\.3
20616${log_date}${log_lines}${log_commitid}
206173"
20618	  log_rev1b="${log_dash} 1\.2\.2\.1
20619${log_date}${log_lines}${log_commitid}
206201b"
20621	  log_rev2b="${log_dash} 1\.2\.2\.2
20622${log_date}${log_lines}${log_commitid}
206232b"
20624	  log_trailer='============================================================================='
20625
20626	  # Now, finally, test the log output.
20627
20628	  dotest log-11 "${testcvs} log file1" \
20629"${log_header1}
20630${log_tags1}
20631${log_keyword}
20632total revisions: 5;	selected revisions: 5
20633description:
20634${log_rev3}
20635${log_rev2}
20636${log_rev1}
20637${log_rev2b}
20638${log_rev1b}
20639${log_trailer}"
20640
20641	  dotest log-12 "${testcvs} log -N file1" \
20642"${log_header1}
20643${log_keyword}
20644total revisions: 5;	selected revisions: 5
20645description:
20646${log_rev3}
20647${log_rev2}
20648${log_rev1}
20649${log_rev2b}
20650${log_rev1b}
20651${log_trailer}"
20652
20653	  dotest log-13 "${testcvs} log -b file1" \
20654"${log_header1}
20655${log_tags1}
20656${log_keyword}
20657total revisions: 5;	selected revisions: 3
20658description:
20659${log_rev3}
20660${log_rev2}
20661${log_rev1}
20662${log_trailer}"
20663
20664	  dotest log-14 "${testcvs} log -r file1" \
20665"${log_header1}
20666${log_tags1}
20667${log_keyword}
20668total revisions: 5;	selected revisions: 1
20669description:
20670${log_rev3}
20671${log_trailer}"
20672
20673	  dotest log-14a "${testcvs} log -rHEAD file1" \
20674"${log_header1}
20675${log_tags1}
20676${log_keyword}
20677total revisions: 5;	selected revisions: 1
20678description:
20679${log_rev3}
20680${log_trailer}"
20681
20682	  # The user might not realize that "-r" must not take a space.
20683	  # In the error message, HEAD is a file name, not a tag name (which
20684	  # might be confusing itself).
20685	  dotest_fail log-14b "${testcvs} log -r HEAD file1" \
20686"${SPROG} log: nothing known about HEAD
20687${log_header1}
20688${log_tags1}
20689${log_keyword}
20690total revisions: 5;	selected revisions: 1
20691description:
20692${log_rev3}
20693${log_trailer}"
20694
20695#	  Check that unusual syntax works correctly.
20696
20697	  dotest log-14c "${testcvs} log -r: file1" \
20698"${log_header1}
20699${log_tags1}
20700${log_keyword}
20701total revisions: 5;	selected revisions: 1
20702description:
20703${log_rev3}
20704${log_trailer}"
20705	  dotest log-14d "${testcvs} log -r, file1" \
20706"${log_header1}
20707${log_tags1}
20708${log_keyword}
20709total revisions: 5;	selected revisions: 1
20710description:
20711${log_rev3}
20712${log_trailer}"
20713	  dotest log-14e "${testcvs} log -r. file1" \
20714"${log_header1}
20715${log_tags1}
20716${log_keyword}
20717total revisions: 5;	selected revisions: 1
20718description:
20719${log_rev3}
20720${log_trailer}"
20721	  dotest log-14f "${testcvs} log -r:: file1" \
20722"${log_header1}
20723${log_tags1}
20724${log_keyword}
20725total revisions: 5;	selected revisions: 0
20726description:
20727${log_trailer}"
20728
20729	  dotest log-15 "${testcvs} log -r1.2 file1" \
20730"${log_header1}
20731${log_tags1}
20732${log_keyword}
20733total revisions: 5;	selected revisions: 1
20734description:
20735${log_rev2}
20736${log_trailer}"
20737
20738	  dotest log-16 "${testcvs} log -r1.2.2 file1" \
20739"${log_header1}
20740${log_tags1}
20741${log_keyword}
20742total revisions: 5;	selected revisions: 2
20743description:
20744${log_rev2b}
20745${log_rev1b}
20746${log_trailer}"
20747
20748	  # This test would fail with the old invocation of rlog, but it
20749	  # works with the builtin log support.
20750	  dotest log-17 "${testcvs} log -rbranch file1" \
20751"${log_header1}
20752${log_tags1}
20753${log_keyword}
20754total revisions: 5;	selected revisions: 2
20755description:
20756${log_rev2b}
20757${log_rev1b}
20758${log_trailer}"
20759
20760	  dotest log-18 "${testcvs} log -r1.2.2. file1" \
20761"${log_header1}
20762${log_tags1}
20763${log_keyword}
20764total revisions: 5;	selected revisions: 1
20765description:
20766${log_rev2b}
20767${log_trailer}"
20768
20769	  # Multiple -r options are undocumented; see comments in
20770	  # cvs.texinfo about whether they should be deprecated.
20771	  dotest log-18a "${testcvs} log -r1.2.2.2 -r1.3:1.3 file1" \
20772"${log_header1}
20773${log_tags1}
20774${log_keyword}
20775total revisions: 5;	selected revisions: 2
20776description:
20777${log_rev3}
20778${log_rev2b}
20779${log_trailer}"
20780
20781	  # This test would fail with the old invocation of rlog, but it
20782	  # works with the builtin log support.
20783	  dotest log-19 "${testcvs} log -rbranch. file1" \
20784"${log_header1}
20785${log_tags1}
20786${log_keyword}
20787total revisions: 5;	selected revisions: 1
20788description:
20789${log_rev2b}
20790${log_trailer}"
20791
20792	  dotest log-20 "${testcvs} log -r1.2: file1" \
20793"${log_header1}
20794${log_tags1}
20795${log_keyword}
20796total revisions: 5;	selected revisions: 2
20797description:
20798${log_rev3}
20799${log_rev2}
20800${log_trailer}"
20801
20802	  dotest log-20a "${testcvs} log -r1.2:: file1" \
20803"${log_header1}
20804${log_tags1}
20805${log_keyword}
20806total revisions: 5;	selected revisions: 1
20807description:
20808${log_rev3}
20809${log_trailer}"
20810
20811	  dotest log-21 "${testcvs} log -r:1.2 file1" \
20812"${log_header1}
20813${log_tags1}
20814${log_keyword}
20815total revisions: 5;	selected revisions: 2
20816description:
20817${log_rev2}
20818${log_rev1}
20819${log_trailer}"
20820
20821	  dotest log-21a "${testcvs} log -r::1.2 file1" \
20822"${log_header1}
20823${log_tags1}
20824${log_keyword}
20825total revisions: 5;	selected revisions: 2
20826description:
20827${log_rev2}
20828${log_rev1}
20829${log_trailer}"
20830
20831	  dotest log-22 "${testcvs} log -r1.1:1.2 file1" \
20832"${log_header1}
20833${log_tags1}
20834${log_keyword}
20835total revisions: 5;	selected revisions: 2
20836description:
20837${log_rev2}
20838${log_rev1}
20839${log_trailer}"
20840
20841	  dotest log-22a "${testcvs} log -r1.1::1.2 file1" \
20842"${log_header1}
20843${log_tags1}
20844${log_keyword}
20845total revisions: 5;	selected revisions: 1
20846description:
20847${log_rev2}
20848${log_trailer}"
20849
20850	  dotest log-22b "${testcvs} log -r1.1::1.3 file1" \
20851"${log_header1}
20852${log_tags1}
20853${log_keyword}
20854total revisions: 5;	selected revisions: 2
20855description:
20856${log_rev3}
20857${log_rev2}
20858${log_trailer}"
20859
20860	  dotest log-23 "${testcvs} log -rfoo:: file1" \
20861"${SPROG} log: warning: no revision .foo. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
20862${log_header1}
20863${log_tags1}
20864${log_keyword}
20865total revisions: 5;	selected revisions: 0
20866description:
20867${log_trailer}"
20868
20869	  dotest log-24 "${testcvs} log -rfoo::1.3 file1" \
20870"${SPROG} log: warning: no revision .foo. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
20871${log_header1}
20872${log_tags1}
20873${log_keyword}
20874total revisions: 5;	selected revisions: 0
20875description:
20876${log_trailer}"
20877
20878	  dotest log-25 "${testcvs} log -r::foo file1" \
20879"${SPROG} log: warning: no revision .foo. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
20880${log_header1}
20881${log_tags1}
20882${log_keyword}
20883total revisions: 5;	selected revisions: 0
20884description:
20885${log_trailer}"
20886
20887	  dotest log-26 "${testcvs} log -r1.1::foo file1" \
20888"${SPROG} log: warning: no revision .foo. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
20889${log_header1}
20890${log_tags1}
20891${log_keyword}
20892total revisions: 5;	selected revisions: 0
20893description:
20894${log_trailer}"
20895
20896	  # Test BASE pseudotag
20897	  dotest log-27 "${testcvs} log -rBASE file1" \
20898"${log_header1}
20899${log_tags1}
20900${log_keyword}
20901total revisions: 5;	selected revisions: 1
20902description:
20903${log_rev2b}
20904${log_trailer}"
20905
20906	  dotest log-28 "${testcvs} -q up -r1.2 file1" "[UP] file1"
20907	  dotest log-29 "${testcvs} log -rBASE file1" \
20908"${log_header1}
20909${log_tags1}
20910${log_keyword}
20911total revisions: 5;	selected revisions: 1
20912description:
20913${log_rev2}
20914${log_trailer}"
20915
20916	  dotest log-30 "${testcvs} -q up -rbranch file1" "[UP] file1"
20917
20918	  # Now the same tests but with rlog
20919
20920	  dotest log-r11 "${testcvs} rlog first-dir/file1" \
20921"${rlog_header1}
20922${log_tags1}
20923${log_keyword}
20924total revisions: 5;	selected revisions: 5
20925description:
20926${log_rev3}
20927${log_rev2}
20928${log_rev1}
20929${log_rev2b}
20930${log_rev1b}
20931${log_trailer}"
20932
20933	  dotest log-r12 "${testcvs} rlog -N first-dir/file1" \
20934"${rlog_header1}
20935${log_keyword}
20936total revisions: 5;	selected revisions: 5
20937description:
20938${log_rev3}
20939${log_rev2}
20940${log_rev1}
20941${log_rev2b}
20942${log_rev1b}
20943${log_trailer}"
20944
20945	  dotest log-r13 "${testcvs} rlog -b first-dir/file1" \
20946"${rlog_header1}
20947${log_tags1}
20948${log_keyword}
20949total revisions: 5;	selected revisions: 3
20950description:
20951${log_rev3}
20952${log_rev2}
20953${log_rev1}
20954${log_trailer}"
20955
20956	  dotest log-r14 "${testcvs} rlog -r first-dir/file1" \
20957"${rlog_header1}
20958${log_tags1}
20959${log_keyword}
20960total revisions: 5;	selected revisions: 1
20961description:
20962${log_rev3}
20963${log_trailer}"
20964
20965	  dotest log-r14a "${testcvs} rlog -rHEAD first-dir/file1" \
20966"${rlog_header1}
20967${log_tags1}
20968${log_keyword}
20969total revisions: 5;	selected revisions: 1
20970description:
20971${log_rev3}
20972${log_trailer}"
20973
20974	  dotest_fail log-r14b "${testcvs} rlog -r HEAD first-dir/file1" \
20975"${SPROG} rlog: cannot find module .HEAD. - ignored
20976${rlog_header1}
20977${log_tags1}
20978${log_keyword}
20979total revisions: 5;	selected revisions: 1
20980description:
20981${log_rev3}
20982${log_trailer}"
20983
20984	  dotest log-r14c "${testcvs} rlog -r: first-dir/file1" \
20985"${rlog_header1}
20986${log_tags1}
20987${log_keyword}
20988total revisions: 5;	selected revisions: 1
20989description:
20990${log_rev3}
20991${log_trailer}"
20992	  dotest log-r14d "${testcvs} rlog -r, first-dir/file1" \
20993"${rlog_header1}
20994${log_tags1}
20995${log_keyword}
20996total revisions: 5;	selected revisions: 1
20997description:
20998${log_rev3}
20999${log_trailer}"
21000	  dotest log-r14e "${testcvs} rlog -r. first-dir/file1" \
21001"${rlog_header1}
21002${log_tags1}
21003${log_keyword}
21004total revisions: 5;	selected revisions: 1
21005description:
21006${log_rev3}
21007${log_trailer}"
21008	  dotest log-r14f "${testcvs} rlog -r:: first-dir/file1" \
21009"${rlog_header1}
21010${log_tags1}
21011${log_keyword}
21012total revisions: 5;	selected revisions: 0
21013description:
21014${log_trailer}"
21015
21016	  dotest log-r15 "${testcvs} rlog -r1.2 first-dir/file1" \
21017"${rlog_header1}
21018${log_tags1}
21019${log_keyword}
21020total revisions: 5;	selected revisions: 1
21021description:
21022${log_rev2}
21023${log_trailer}"
21024
21025	  dotest log-r16 "${testcvs} rlog -r1.2.2 first-dir/file1" \
21026"${rlog_header1}
21027${log_tags1}
21028${log_keyword}
21029total revisions: 5;	selected revisions: 2
21030description:
21031${log_rev2b}
21032${log_rev1b}
21033${log_trailer}"
21034
21035	  dotest log-r17 "${testcvs} rlog -rbranch first-dir/file1" \
21036"${rlog_header1}
21037${log_tags1}
21038${log_keyword}
21039total revisions: 5;	selected revisions: 2
21040description:
21041${log_rev2b}
21042${log_rev1b}
21043${log_trailer}"
21044
21045	  dotest log-r18 "${testcvs} rlog -r1.2.2. first-dir/file1" \
21046"${rlog_header1}
21047${log_tags1}
21048${log_keyword}
21049total revisions: 5;	selected revisions: 1
21050description:
21051${log_rev2b}
21052${log_trailer}"
21053
21054	  dotest log-r18a "${testcvs} rlog -r1.2.2.2 -r1.3:1.3 first-dir/file1" \
21055"${rlog_header1}
21056${log_tags1}
21057${log_keyword}
21058total revisions: 5;	selected revisions: 2
21059description:
21060${log_rev3}
21061${log_rev2b}
21062${log_trailer}"
21063
21064	  dotest log-r19 "${testcvs} rlog -rbranch. first-dir/file1" \
21065"${rlog_header1}
21066${log_tags1}
21067${log_keyword}
21068total revisions: 5;	selected revisions: 1
21069description:
21070${log_rev2b}
21071${log_trailer}"
21072
21073	  dotest log-r20 "${testcvs} rlog -r1.2: first-dir/file1" \
21074"${rlog_header1}
21075${log_tags1}
21076${log_keyword}
21077total revisions: 5;	selected revisions: 2
21078description:
21079${log_rev3}
21080${log_rev2}
21081${log_trailer}"
21082
21083	  dotest log-r20a "${testcvs} rlog -r1.2:: first-dir/file1" \
21084"${rlog_header1}
21085${log_tags1}
21086${log_keyword}
21087total revisions: 5;	selected revisions: 1
21088description:
21089${log_rev3}
21090${log_trailer}"
21091
21092	  dotest log-r21 "${testcvs} rlog -r:1.2 first-dir/file1" \
21093"${rlog_header1}
21094${log_tags1}
21095${log_keyword}
21096total revisions: 5;	selected revisions: 2
21097description:
21098${log_rev2}
21099${log_rev1}
21100${log_trailer}"
21101
21102	  dotest log-r21a "${testcvs} rlog -r::1.2 first-dir/file1" \
21103"${rlog_header1}
21104${log_tags1}
21105${log_keyword}
21106total revisions: 5;	selected revisions: 2
21107description:
21108${log_rev2}
21109${log_rev1}
21110${log_trailer}"
21111
21112	  dotest log-r22 "${testcvs} rlog -r1.1:1.2 first-dir/file1" \
21113"${rlog_header1}
21114${log_tags1}
21115${log_keyword}
21116total revisions: 5;	selected revisions: 2
21117description:
21118${log_rev2}
21119${log_rev1}
21120${log_trailer}"
21121
21122	  dotest log-r22a "${testcvs} rlog -r1.1::1.2 first-dir/file1" \
21123"${rlog_header1}
21124${log_tags1}
21125${log_keyword}
21126total revisions: 5;	selected revisions: 1
21127description:
21128${log_rev2}
21129${log_trailer}"
21130
21131	  dotest log-r22b "${testcvs} rlog -r1.1::1.3 first-dir/file1" \
21132"${rlog_header1}
21133${log_tags1}
21134${log_keyword}
21135total revisions: 5;	selected revisions: 2
21136description:
21137${log_rev3}
21138${log_rev2}
21139${log_trailer}"
21140
21141	  dotest log-r23 "${testcvs} rlog -rfoo:: first-dir/file1" \
21142"${SPROG} rlog: warning: no revision .foo. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
21143${rlog_header1}
21144${log_tags1}
21145${log_keyword}
21146total revisions: 5;	selected revisions: 0
21147description:
21148${log_trailer}"
21149
21150	  dotest log-r24 "${testcvs} rlog -rfoo::1.3 first-dir/file1" \
21151"${SPROG} rlog: warning: no revision .foo. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
21152${rlog_header1}
21153${log_tags1}
21154${log_keyword}
21155total revisions: 5;	selected revisions: 0
21156description:
21157${log_trailer}"
21158
21159	  dotest log-r25 "${testcvs} rlog -r::foo first-dir/file1" \
21160"${SPROG} rlog: warning: no revision .foo. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
21161${rlog_header1}
21162${log_tags1}
21163${log_keyword}
21164total revisions: 5;	selected revisions: 0
21165description:
21166${log_trailer}"
21167
21168	  dotest log-r26 "${testcvs} rlog -r1.1::foo first-dir/file1" \
21169"${SPROG} rlog: warning: no revision .foo. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
21170${rlog_header1}
21171${log_tags1}
21172${log_keyword}
21173total revisions: 5;	selected revisions: 0
21174description:
21175${log_trailer}"
21176
21177	  # Test BASE pseudotag
21178	  dotest log-r27 "${testcvs} rlog -rBASE first-dir/file1" \
21179"${SPROG} rlog: warning: no revision .BASE. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
21180${rlog_header1}
21181${log_tags1}
21182${log_keyword}
21183total revisions: 5;	selected revisions: 0
21184description:
21185${log_trailer}"
21186
21187	  dotest log-r28 "${testcvs} -q up -r1.2 file1" "[UP] file1"
21188	  dotest log-r29 "${testcvs} rlog -rBASE first-dir/file1" \
21189"${SPROG} rlog: warning: no revision .BASE. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
21190${rlog_header1}
21191${log_tags1}
21192${log_keyword}
21193total revisions: 5;	selected revisions: 0
21194description:
21195${log_trailer}"
21196
21197	  # Test when head is dead
21198
21199	  dotest log-d0 "${testcvs} -q up -A" \
21200"[UP] file1
21201U file2"
21202	  dotest log-d1 "${testcvs} -q rm -f file1" \
21203"${SPROG} remove: use .${SPROG} commit. to remove this file permanently"
21204	  dotest log-d2 "${testcvs} -q ci -m4" \
21205"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
21206new revision: delete; previous revision: 1\.3"
21207
21208	  log_header1="
21209RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
21210Working file: file1
21211head: 1\.4
21212branch:
21213locks: strict
21214access list:"
21215	  rlog_header1="
21216RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
21217head: 1\.4
21218branch:
21219locks: strict
21220access list:"
21221	  log_header2="
21222RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
21223Working file: file2
21224head: 1\.3
21225branch:
21226locks: strict
21227access list:"
21228	  rlog_header2="
21229RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
21230head: 1\.3
21231branch:
21232locks: strict
21233access list:"
21234	  log_tags2='symbolic names:
21235	tag2: 1\.3
21236	tag1: 1\.2'
21237	  log_rev4="${log_dash} 1\.4
21238date: ${ISO8601DATE};  author: ${username};  state: dead;  lines: ${PLUS}0 -0;  commitid: ${commitid};
212394"
21240	  log_rev22="${log_dash} 1\.2
21241${log_date}${log_lines}${log_commitid}
212422"
21243
21244	  dotest log-d3 "${testcvs} log -rbranch file1" \
21245"${log_header1}
21246${log_tags1}
21247${log_keyword}
21248total revisions: 6;	selected revisions: 2
21249description:
21250${log_rev2b}
21251${log_rev1b}
21252${log_trailer}"
21253	  dotest log-rd3 "${testcvs} rlog -rbranch first-dir/file1" \
21254"${rlog_header1}
21255${log_tags1}
21256${log_keyword}
21257total revisions: 6;	selected revisions: 2
21258description:
21259${log_rev2b}
21260${log_rev1b}
21261${log_trailer}"
21262	  dotest log-d4 "${testcvs} -q log -rbranch" \
21263"${log_header1}
21264${log_tags1}
21265${log_keyword}
21266total revisions: 6;	selected revisions: 2
21267description:
21268${log_rev2b}
21269${log_rev1b}
21270${log_trailer}
21271${SPROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
21272${log_header2}
21273${log_tags2}
21274${log_keyword}
21275total revisions: 3;	selected revisions: 0
21276description:
21277${log_trailer}"
21278	  dotest log-d4a "${testcvs} -q log -t -rbranch" \
21279"${log_header1}
21280${log_tags1}
21281${log_keyword}
21282total revisions: 6
21283description:
21284${log_trailer}
21285${SPROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
21286${log_header2}
21287${log_tags2}
21288${log_keyword}
21289total revisions: 3
21290description:
21291${log_trailer}"
21292	  dotest log-d4b "${testcvs} -q log -tS -rbranch" \
21293"${log_header1}
21294${log_tags1}
21295${log_keyword}
21296total revisions: 6;	selected revisions: 2
21297description:
21298${log_trailer}
21299${SPROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
21300	  dotest log-d4c "${testcvs} -q log -h -rbranch" \
21301"${log_header1}
21302${log_tags1}
21303${log_keyword}
21304total revisions: 6
21305${log_trailer}
21306${SPROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
21307${log_header2}
21308${log_tags2}
21309${log_keyword}
21310total revisions: 3
21311${log_trailer}"
21312	  dotest log-d4d "${testcvs} -q log -hS -rbranch" \
21313"${log_header1}
21314${log_tags1}
21315${log_keyword}
21316total revisions: 6;	selected revisions: 2
21317${log_trailer}
21318${SPROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
21319	  dotest log-d4e "$testcvs -q log -R -rbranch" \
21320"$CVSROOT_DIRNAME/first-dir/Attic/file1,v
21321$CVSROOT_DIRNAME/first-dir/file2,v"
21322	  dotest log-d4f "${testcvs} -q log -R -S -rbranch" \
21323"${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
21324${SPROG} log: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
21325	  dotest log-rd4 "${testcvs} -q rlog -rbranch first-dir" \
21326"${rlog_header1}
21327${log_tags1}
21328${log_keyword}
21329total revisions: 6;	selected revisions: 2
21330description:
21331${log_rev2b}
21332${log_rev1b}
21333${log_trailer}
21334${SPROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
21335${rlog_header2}
21336${log_tags2}
21337${log_keyword}
21338total revisions: 3;	selected revisions: 0
21339description:
21340${log_trailer}"
21341	  dotest log-rd4a "${testcvs} -q rlog -t -rbranch first-dir" \
21342"${rlog_header1}
21343${log_tags1}
21344${log_keyword}
21345total revisions: 6
21346description:
21347${log_trailer}
21348${SPROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
21349${rlog_header2}
21350${log_tags2}
21351${log_keyword}
21352total revisions: 3
21353description:
21354${log_trailer}"
21355	  dotest log-rd4b "${testcvs} -q rlog -St -rbranch first-dir" \
21356"${rlog_header1}
21357${log_tags1}
21358${log_keyword}
21359total revisions: 6;	selected revisions: 2
21360description:
21361${log_trailer}
21362${SPROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
21363	  dotest log-rd4c "${testcvs} -q rlog -h -rbranch first-dir" \
21364"${rlog_header1}
21365${log_tags1}
21366${log_keyword}
21367total revisions: 6
21368${log_trailer}
21369${SPROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v.
21370${rlog_header2}
21371${log_tags2}
21372${log_keyword}
21373total revisions: 3
21374${log_trailer}"
21375	  dotest log-rd4d "${testcvs} -q rlog -Sh -rbranch first-dir" \
21376"${rlog_header1}
21377${log_tags1}
21378${log_keyword}
21379total revisions: 6;	selected revisions: 2
21380${log_trailer}
21381${SPROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
21382	  dotest log-rd4e "${testcvs} -q rlog -R -rbranch first-dir" \
21383"${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
21384${CVSROOT_DIRNAME}/first-dir/file2,v"
21385	  dotest log-rd4f "${testcvs} -q rlog -R -S -rbranch first-dir" \
21386"${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
21387${SPROG} rlog: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v."
21388	  dotest log-d5 "${testcvs} log -r1.2.2.1:1.2.2.2 file1" \
21389"${log_header1}
21390${log_tags1}
21391${log_keyword}
21392total revisions: 6;	selected revisions: 2
21393description:
21394${log_rev2b}
21395${log_rev1b}
21396${log_trailer}"
21397	  dotest log-rd5 "${testcvs} rlog -r1.2.2.1:1.2.2.2 first-dir/file1" \
21398"${rlog_header1}
21399${log_tags1}
21400${log_keyword}
21401total revisions: 6;	selected revisions: 2
21402description:
21403${log_rev2b}
21404${log_rev1b}
21405${log_trailer}"
21406	  dotest log-d6 "${testcvs} -q log -r1.2.2.1:1.2.2.2" \
21407"${log_header1}
21408${log_tags1}
21409${log_keyword}
21410total revisions: 6;	selected revisions: 2
21411description:
21412${log_rev2b}
21413${log_rev1b}
21414${log_trailer}
21415${log_header2}
21416${log_tags2}
21417${log_keyword}
21418total revisions: 3;	selected revisions: 0
21419description:
21420${log_trailer}"
21421	  dotest log-rd6 "${testcvs} -q rlog -r1.2.2.1:1.2.2.2 first-dir" \
21422"${rlog_header1}
21423${log_tags1}
21424${log_keyword}
21425total revisions: 6;	selected revisions: 2
21426description:
21427${log_rev2b}
21428${log_rev1b}
21429${log_trailer}
21430${rlog_header2}
21431${log_tags2}
21432${log_keyword}
21433total revisions: 3;	selected revisions: 0
21434description:
21435${log_trailer}"
21436	  dotest log-d7 "${testcvs} log -r1.2:1.3 file1" \
21437"${log_header1}
21438${log_tags1}
21439${log_keyword}
21440total revisions: 6;	selected revisions: 2
21441description:
21442${log_rev3}
21443${log_rev2}
21444${log_trailer}"
21445	  dotest log-rd7 "${testcvs} -q rlog -r1.2:1.3 first-dir/file1" \
21446"${rlog_header1}
21447${log_tags1}
21448${log_keyword}
21449total revisions: 6;	selected revisions: 2
21450description:
21451${log_rev3}
21452${log_rev2}
21453${log_trailer}"
21454	  dotest log-d8 "${testcvs} -q log -rtag1:tag2" \
21455"${SPROG} log: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
21456${SPROG} log: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
21457${log_header1}
21458${log_tags1}
21459${log_keyword}
21460total revisions: 6;	selected revisions: 0
21461description:
21462${log_trailer}
21463${log_header2}
21464${log_tags2}
21465${log_keyword}
21466total revisions: 3;	selected revisions: 2
21467description:
21468${log_rev3}
21469${log_rev22}
21470${log_trailer}"
21471	  dotest log-d8a "${testcvs} -q log -rtag1:tag2 -S" \
21472"${SPROG} log: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
21473${SPROG} log: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
21474${log_header2}
21475${log_tags2}
21476${log_keyword}
21477total revisions: 3;	selected revisions: 2
21478description:
21479${log_rev3}
21480${log_rev22}
21481${log_trailer}"
21482	  dotest log-rd8 "${testcvs} -q rlog -rtag1:tag2 first-dir" \
21483"${SPROG} rlog: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
21484${SPROG} rlog: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
21485${rlog_header1}
21486${log_tags1}
21487${log_keyword}
21488total revisions: 6;	selected revisions: 0
21489description:
21490${log_trailer}
21491${rlog_header2}
21492${log_tags2}
21493${log_keyword}
21494total revisions: 3;	selected revisions: 2
21495description:
21496${log_rev3}
21497${log_rev22}
21498${log_trailer}"
21499	  dotest log-rd8a "${testcvs} -q rlog -rtag1:tag2 -S first-dir" \
21500"${SPROG} rlog: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
21501${SPROG} rlog: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v.
21502${rlog_header2}
21503${log_tags2}
21504${log_keyword}
21505total revisions: 3;	selected revisions: 2
21506description:
21507${log_rev3}
21508${log_rev22}
21509${log_trailer}"
21510
21511	  dotest log-d99 "${testcvs} -q up -rbranch" \
21512"[UP] file1
21513${SPROG} update: \`file2' is no longer in the repository"
21514
21515	  # Now test outdating revisions
21516
21517	  dotest log-o0 "${testcvs} admin -o 1.2.2.2:: file1" \
21518"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
21519done"
21520	  dotest log-o1 "${testcvs} admin -o ::1.2.2.1 file1" \
21521"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
21522done"
21523	  dotest log-o2 "${testcvs} admin -o 1.2.2.1:: file1" \
21524"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
21525deleting revision 1\.2\.2\.2
21526done"
21527	  dotest log-o3 "${testcvs} log file1" \
21528"${log_header1}
21529${log_tags1}
21530${log_keyword}
21531total revisions: 5;	selected revisions: 5
21532description:
21533${log_rev4}
21534${log_rev3}
21535${log_rev2}
21536${log_rev1}
21537${log_rev1b}
21538${log_trailer}"
21539	  dotest log-ro3 "${testcvs} rlog first-dir/file1" \
21540"${rlog_header1}
21541${log_tags1}
21542${log_keyword}
21543total revisions: 5;	selected revisions: 5
21544description:
21545${log_rev4}
21546${log_rev3}
21547${log_rev2}
21548${log_rev1}
21549${log_rev1b}
21550${log_trailer}"
21551	  dotest log-o4 "${testcvs} -q update -p -r 1.2.2.1 file1" \
21552"first branch revision"
21553
21554	  dokeep
21555	  cd ..
21556	  rm -r first-dir
21557	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
21558	  ;;
21559
21560
21561
21562	log2)
21563	  # More "cvs log" tests, for example the file description.
21564
21565	  # Check in a file
21566	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
21567	  dotest log2-1 "$testcvs -q co first-dir"
21568	  cd first-dir
21569	  echo 'first revision' > file1
21570	  dotest log2-2 "${testcvs} add -m file1-is-for-testing file1" \
21571"${SPROG}"' add: scheduling file `file1'\'' for addition
21572'"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
21573	  dotest log2-3 "${testcvs} -q commit -m 1" \
21574"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
21575initial revision: 1\.1"
21576	  # Setting the file description with add -m doesn't yet work
21577	  # client/server, so skip log2-4 for remote.
21578	  if $remote; then :; else
21579
21580	    dotest log2-4 "${testcvs} log -N file1" "
21581RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21582Working file: file1
21583head: 1\.1
21584branch:
21585locks: strict
21586access list:
21587keyword substitution: kv
21588total revisions: 1;	selected revisions: 1
21589description:
21590file1-is-for-testing
21591----------------------------
21592revision 1\.1
21593date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
215941
21595============================================================================="
21596
21597	  fi # end of tests skipped for remote
21598
21599	  dotest log2-5 "${testcvs} admin -t-change-description file1" \
21600"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21601done"
21602	  dotest log2-6 "${testcvs} log -N file1" "
21603RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21604Working file: file1
21605head: 1\.1
21606branch:
21607locks: strict
21608access list:
21609keyword substitution: kv
21610total revisions: 1;	selected revisions: 1
21611description:
21612change-description
21613----------------------------
21614revision 1\.1
21615date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
216161
21617============================================================================="
21618
21619	  echo 'longer description' >${TESTDIR}/descrip
21620	  echo 'with two lines' >>${TESTDIR}/descrip
21621	  dotest log2-7 "${testcvs} admin -t${TESTDIR}/descrip file1" \
21622"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21623done"
21624	  dotest_fail log2-7a "${testcvs} admin -t${TESTDIR}/nonexist file1" \
21625"${CPROG} \[admin aborted\]: can't stat ${TESTDIR}/nonexist: No such file or directory"
21626	  dotest log2-8 "${testcvs} log -N file1" "
21627RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21628Working file: file1
21629head: 1\.1
21630branch:
21631locks: strict
21632access list:
21633keyword substitution: kv
21634total revisions: 1;	selected revisions: 1
21635description:
21636longer description
21637with two lines
21638----------------------------
21639revision 1\.1
21640date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
216411
21642============================================================================="
21643
21644	  # TODO: `cvs admin -t "my message" file1' is a request to
21645	  # read the message from stdin and to operate on two files.
21646	  # Should test that there is an error because "my message"
21647	  # doesn't exist.
21648
21649	  dotest log2-9 "echo change from stdin | ${testcvs} admin -t -q file1" ""
21650	  dotest log2-10 "${testcvs} log -N file1" "
21651RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
21652Working file: file1
21653head: 1\.1
21654branch:
21655locks: strict
21656access list:
21657keyword substitution: kv
21658total revisions: 1;	selected revisions: 1
21659description:
21660change from stdin
21661----------------------------
21662revision 1\.1
21663date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
216641
21665============================================================================="
21666
21667	  dokeep
21668	  cd ..
21669	  rm $TESTDIR/descrip
21670	  rm -r first-dir
21671	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
21672	  ;;
21673
21674
21675
21676	logopt)
21677	  # Some tests of log.c's option parsing and such things.
21678	  mkdir 1; cd 1
21679	  dotest logopt-1 "$testcvs -q co -l ." ''
21680	  mkdir first-dir
21681	  dotest logopt-2 "$testcvs add first-dir" \
21682"Directory $CVSROOT_DIRNAME/first-dir added to the repository"
21683	  cd first-dir
21684	  echo hi >file1
21685	  dotest logopt-3 "${testcvs} add file1" \
21686"${SPROG} add: scheduling file .file1. for addition
21687${SPROG} add: use .${SPROG} commit. to add this file permanently"
21688	  dotest logopt-4 "${testcvs} -q ci -m add file1" \
21689"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
21690initial revision: 1\.1"
21691	  cd ..
21692
21693	  dotest logopt-5 "${testcvs} log -R -d 2038-01-01" \
21694"${SPROG} log: Logging \.
21695${SPROG} log: Logging first-dir
21696${CVSROOT_DIRNAME}/first-dir/file1,v"
21697	  dotest logopt-6 "${testcvs} log -d 2038-01-01 -R" \
21698"${SPROG} log: Logging \.
21699${SPROG} log: Logging first-dir
21700${CVSROOT_DIRNAME}/first-dir/file1,v"
21701	  dotest logopt-6a "${testcvs} log -Rd 2038-01-01" \
21702"${SPROG} log: Logging \.
21703${SPROG} log: Logging first-dir
21704${CVSROOT_DIRNAME}/first-dir/file1,v"
21705	  dotest logopt-7 "${testcvs} log -s Exp -R" \
21706"${SPROG} log: Logging \.
21707${SPROG} log: Logging first-dir
21708${CVSROOT_DIRNAME}/first-dir/file1,v"
21709
21710	  dokeep
21711	  cd ..
21712	  rm -r 1
21713	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
21714	  ;;
21715
21716
21717
21718	ann)
21719	  # Tests of "cvs annotate".  See also:
21720	  #   basica-10  A simple annotate test
21721	  #   rcs        Annotate and the year 2000
21722	  #   keywordlog Annotate and $Log.
21723	  mkdir 1; cd 1
21724	  dotest ann-1 "$testcvs -q co -l ."
21725	  mkdir first-dir
21726	  dotest ann-2 "${testcvs} add first-dir" \
21727"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
21728	  cd first-dir
21729	  cat >file1 <<EOF
21730this
21731is
21732the
21733ancestral
21734file
21735EOF
21736	  dotest ann-3 "${testcvs} add file1" \
21737"${SPROG} add: scheduling file .file1. for addition
21738${SPROG} add: use .${SPROG} commit. to add this file permanently"
21739	  dotest ann-4 "${testcvs} -q ci -m add file1" \
21740"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
21741initial revision: 1\.1"
21742	  cat >file1 <<EOF
21743this
21744is
21745a
21746file
21747
21748with
21749a
21750blank
21751line
21752EOF
21753	  dotest ann-5 "${testcvs} -q ci -m modify file1" \
21754"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
21755new revision: 1\.2; previous revision: 1\.1"
21756	  dotest ann-6 "${testcvs} -q tag -b br" "T file1"
21757	  cat >file1 <<EOF
21758this
21759is
21760a
21761trunk file
21762
21763with
21764a
21765blank
21766line
21767EOF
21768	  dotest ann-7 "${testcvs} -q ci -m modify file1" \
21769"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
21770new revision: 1\.3; previous revision: 1\.2"
21771	  dotest ann-8 "${testcvs} -q update -r br" "[UP] file1"
21772	  cat >file1 <<EOF
21773this
21774is
21775a
21776file
21777
21778with
21779a
21780blank
21781line
21782and some
21783branched content
21784EOF
21785	  dotest ann-9 "${testcvs} -q ci -m modify" \
21786"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
21787new revision: 1\.2\.2\.1; previous revision: 1\.2"
21788	  # Note that this annotates the trunk despite the presence
21789	  # of a sticky tag in the current directory.  This is
21790	  # fairly bogus, but it is the longstanding behavior for
21791	  # whatever that is worth.
21792	  dotest ann-10 "${testcvs} ann" \
21793"
21794Annotations for file1
21795\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
217961\.1          ($username8 *[0-9a-zA-Z-]*): this
217971\.1          ($username8 *[0-9a-zA-Z-]*): is
217981\.2          ($username8 *[0-9a-zA-Z-]*): a
217991\.3          ($username8 *[0-9a-zA-Z-]*): trunk file
218001\.2          ($username8 *[0-9a-zA-Z-]*):
218011\.2          ($username8 *[0-9a-zA-Z-]*): with
218021\.2          ($username8 *[0-9a-zA-Z-]*): a
218031\.2          ($username8 *[0-9a-zA-Z-]*): blank
218041\.2          ($username8 *[0-9a-zA-Z-]*): line"
21805	  dotest ann-11 "${testcvs} ann -r br" \
21806"
21807Annotations for file1
21808\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
218091\.1          ($username8 *[0-9a-zA-Z-]*): this
218101\.1          ($username8 *[0-9a-zA-Z-]*): is
218111\.2          ($username8 *[0-9a-zA-Z-]*): a
218121\.1          ($username8 *[0-9a-zA-Z-]*): file
218131\.2          ($username8 *[0-9a-zA-Z-]*):
218141\.2          ($username8 *[0-9a-zA-Z-]*): with
218151\.2          ($username8 *[0-9a-zA-Z-]*): a
218161\.2          ($username8 *[0-9a-zA-Z-]*): blank
218171\.2          ($username8 *[0-9a-zA-Z-]*): line
218181\.2\.2\.1      ($username8 *[0-9a-zA-Z-]*): and some
218191\.2\.2\.1      ($username8 *[0-9a-zA-Z-]*): branched content"
21820	  # FIXCVS: shouldn't "-r 1.2.0.2" be the same as "-r br"?
21821	  dotest ann-12 "${testcvs} ann -r 1.2.0.2 file1" ""
21822	  dotest ann-13 "${testcvs} ann -r 1.2.2 file1" \
21823"
21824Annotations for file1
21825\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
218261\.1          ($username8 *[0-9a-zA-Z-]*): this
218271\.1          ($username8 *[0-9a-zA-Z-]*): is
218281\.2          ($username8 *[0-9a-zA-Z-]*): a
218291\.1          ($username8 *[0-9a-zA-Z-]*): file
218301\.2          ($username8 *[0-9a-zA-Z-]*):
218311\.2          ($username8 *[0-9a-zA-Z-]*): with
218321\.2          ($username8 *[0-9a-zA-Z-]*): a
218331\.2          ($username8 *[0-9a-zA-Z-]*): blank
218341\.2          ($username8 *[0-9a-zA-Z-]*): line
218351\.2\.2\.1      ($username8 *[0-9a-zA-Z-]*): and some
218361\.2\.2\.1      ($username8 *[0-9a-zA-Z-]*): branched content"
21837	  dotest_fail ann-14 "$testcvs ann -r bill-clintons-chastity file1" \
21838"$SPROG \[annotate aborted\]: no such tag \`bill-clintons-chastity'"
21839
21840	  # Now get rid of the working directory and test rannotate
21841
21842	  cd ../..
21843	  rm -r 1
21844	  dotest ann-r10 "${testcvs} rann first-dir" \
21845"
21846Annotations for first-dir/file1
21847\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
218481\.1          ($username8 *[0-9a-zA-Z-]*): this
218491\.1          ($username8 *[0-9a-zA-Z-]*): is
218501\.2          ($username8 *[0-9a-zA-Z-]*): a
218511\.3          ($username8 *[0-9a-zA-Z-]*): trunk file
218521\.2          ($username8 *[0-9a-zA-Z-]*):
218531\.2          ($username8 *[0-9a-zA-Z-]*): with
218541\.2          ($username8 *[0-9a-zA-Z-]*): a
218551\.2          ($username8 *[0-9a-zA-Z-]*): blank
218561\.2          ($username8 *[0-9a-zA-Z-]*): line"
21857	  dotest ann-r11 "${testcvs} rann -r br first-dir" \
21858"
21859Annotations for first-dir/file1
21860\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
218611\.1          ($username8 *[0-9a-zA-Z-]*): this
218621\.1          ($username8 *[0-9a-zA-Z-]*): is
218631\.2          ($username8 *[0-9a-zA-Z-]*): a
218641\.1          ($username8 *[0-9a-zA-Z-]*): file
218651\.2          ($username8 *[0-9a-zA-Z-]*):
218661\.2          ($username8 *[0-9a-zA-Z-]*): with
218671\.2          ($username8 *[0-9a-zA-Z-]*): a
218681\.2          ($username8 *[0-9a-zA-Z-]*): blank
218691\.2          ($username8 *[0-9a-zA-Z-]*): line
218701\.2\.2\.1      ($username8 *[0-9a-zA-Z-]*): and some
218711\.2\.2\.1      ($username8 *[0-9a-zA-Z-]*): branched content"
21872	  dotest ann-r12 "${testcvs} rann -r 1.2.0.2 first-dir/file1" ""
21873	  dotest ann-r13 "${testcvs} rann -r 1.2.2 first-dir/file1" \
21874"
21875Annotations for first-dir/file1
21876\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
218771\.1          ($username8 *[0-9a-zA-Z-]*): this
218781\.1          ($username8 *[0-9a-zA-Z-]*): is
218791\.2          ($username8 *[0-9a-zA-Z-]*): a
218801\.1          ($username8 *[0-9a-zA-Z-]*): file
218811\.2          ($username8 *[0-9a-zA-Z-]*):
218821\.2          ($username8 *[0-9a-zA-Z-]*): with
218831\.2          ($username8 *[0-9a-zA-Z-]*): a
218841\.2          ($username8 *[0-9a-zA-Z-]*): blank
218851\.2          ($username8 *[0-9a-zA-Z-]*): line
218861\.2\.2\.1      ($username8 *[0-9a-zA-Z-]*): and some
218871\.2\.2\.1      ($username8 *[0-9a-zA-Z-]*): branched content"
21888	  dotest_fail ann-r14 "$testcvs rann -r bill-clintons-chastity first-dir/file1" \
21889"$SPROG \[rannotate aborted\]: no such tag \`bill-clintons-chastity'"
21890
21891	  dokeep
21892	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
21893	  ;;
21894
21895
21896
21897	ann-id)
21898	  # Demonstrate that cvs-1.9.28.1 improperly expands rcs keywords in
21899	  # the output of `cvs annotate' -- it uses values from the previous
21900	  # delta.  In this case, `1.1' instead of `1.2', even though it puts
21901	  # the proper version number on the prefix to each line of output.
21902	  mkdir 1; cd 1
21903	  dotest ann-id-1 "$testcvs -q co -l ."
21904	  module=x
21905	  mkdir $module
21906	  dotest ann-id-2 "${testcvs} add $module" \
21907"Directory ${CVSROOT_DIRNAME}/$module added to the repository"
21908	  cd $module
21909
21910	  file=m
21911	  echo '$Id''$' > $file
21912
21913	  dotest ann-id-3 "$testcvs add $file" \
21914"$SPROG add: scheduling file .$file. for addition
21915$SPROG add: use .$SPROG commit. to add this file permanently"
21916	  dotest ann-id-4 "$testcvs -Q ci -m . $file"
21917
21918	  echo line2 >> $file
21919	  dotest ann-id-5 "$testcvs -Q ci -m . $file"
21920
21921	  # The version number after $file,v should be `1.2'.
21922	  # 1.9.28.1 puts `1.1' there.
21923	  dotest ann-id-6 "$testcvs -Q ann $file" \
21924"
21925Annotations for $file
21926\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
219271.2          ($username8 *[0-9a-zA-Z-]*): "'\$'"Id: $file,v 1.1 [0-9/]* [0-9:]* $username Exp "'\$'"
219281.2          ($username8 *[0-9a-zA-Z-]*): line2"
21929
21930	  dokeep
21931	  cd ../..
21932	  rm -rf 1
21933	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
21934	  ;;
21935
21936
21937
21938	crerepos)
21939	  # Various tests relating to creating repositories, operating
21940	  # on repositories created with old versions of CVS, etc.
21941
21942	  CVS_SERVER_save=$CVS_SERVER
21943
21944	  # Because this test is all about -d options and such, it
21945	  # at least to some extent needs to be different for remote vs.
21946	  # local.
21947	  if $remote; then
21948
21949	    # Use :ext: rather than :fork:.  Most of the tests use :fork:,
21950	    # so we want to make sure that we test :ext: _somewhere_.
21951	    # Make sure 'rsh' works first.
21952	    require_rsh "$CVS_RSH"
21953	    if test $? -eq 77; then
21954		skip crerepos "$skipreason"
21955		continue
21956	    fi
21957
21958            # Make sure server ignores real $HOME/.cvsrc:
21959            cat >$TESTDIR/cvs-setHome <<EOF
21960#!$TESTSHELL
21961HOME=$HOME
21962export HOME
21963exec $CVS_SERVER "\$@"
21964EOF
21965            chmod a+x $TESTDIR/cvs-setHome
21966
21967	    # Note that we set CVS_SERVER at the beginning.
21968	    CVS_SERVER=$TESTDIR/cvs-setHome; export CVS_SERVER
21969	    CREREPOS_ROOT=:ext:$host$TESTDIR/crerepos
21970	  else # local
21971	    CREREPOS_ROOT=$TESTDIR/crerepos
21972	  fi
21973
21974	  # First, if the repository doesn't exist at all...
21975	  dotest_fail crerepos-1 \
21976"${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
21977"${SPROG} \[checkout aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
21978	  mkdir crerepos
21979
21980	  # The repository exists but CVSROOT doesn't.
21981	  dotest_fail crerepos-2 \
21982"${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
21983"${SPROG} \[checkout aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
21984	  mkdir crerepos/CVSROOT
21985
21986	  # Checkout of nonexistent module
21987	  dotest_fail crerepos-3 \
21988"${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
21989"${SPROG} checkout: cannot find module .cvs-sanity. - ignored"
21990
21991	  # Now test that CVS works correctly without a modules file
21992	  # or any of that other stuff.  In particular, it *must*
21993	  # function if administrative files added to CVS recently (since
21994	  # CVS 1.3) do not exist, because the repository might have
21995	  # been created with an old version of CVS.
21996	  mkdir 1; cd 1
21997	  dotest crerepos-4 \
21998"${testcvs} -q -d ${TESTDIR}/crerepos co CVSROOT" \
21999''
22000	  dotest crerepos-5 \
22001"echo yes | $testcvs -d $TESTDIR/crerepos release -d CVSROOT" \
22002"You have \[0\] altered files in this repository\.
22003Are you sure you want to release (and delete) directory \`CVSROOT': "
22004	  rm -rf CVS
22005	  cd ..
22006	  # The directory 1 should be empty
22007	  dotest crerepos-6 "rmdir 1"
22008
22009	  if $remote; then
22010	    # Test that CVS rejects a relative path in CVSROOT.
22011	    mkdir 1; cd 1
22012	    # Note that having the client reject the pathname (as :fork:
22013	    # does), does _not_ test for the bugs we are trying to catch
22014	    # here.  The point is that malicious clients might send all
22015	    # manner of things and the server better protect itself.
22016	    dotest_fail crerepos-6a-r \
22017"${testcvs} -q -d :ext:`hostname`:../crerepos get ." \
22018"${CPROG} checkout: CVSROOT may only specify a positive, non-zero, integer port (not .\.\..)\.
22019${CPROG} checkout: Perhaps you entered a relative pathname${QUESTION}
22020${CPROG} \[checkout aborted\]: Bad CVSROOT: .:ext:${hostname}:\.\./crerepos.\."
22021	    cd ..
22022	    rm -r 1
22023
22024	    mkdir 1; cd 1
22025	    dotest_fail crerepos-6b-r \
22026"${testcvs} -d :ext:`hostname`:crerepos init" \
22027"${CPROG} init: CVSROOT requires a path spec:
22028${CPROG} init: :(gserver|kserver|pserver):\[\[user\]\[:password\]@\]host\[:\[port\]\]/path
22029${CPROG} init: \[:(ext|server):\]\[\[user\]@\]host\[:\]/path
22030${CPROG} \[init aborted\]: Bad CVSROOT: .:ext:${hostname}:crerepos.\."
22031	    cd ..
22032	    rm -r 1
22033	  else # local
22034	    # Test that CVS rejects a relative path in CVSROOT.
22035
22036	    mkdir 1; cd 1
22037	    # Set CVS_RSH=false since ocassionally (e.g. when CVS_RSH=ssh on
22038	    # some systems) some rsh implementations will block because they
22039	    # can look up '..' and want to ask the user about the unknown host
22040	    # key or somesuch.  Which error message we get depends on whether
22041	    # false finishes running before we try to talk to it or not.
22042	    dotest_fail crerepos-6a "CVS_RSH=false ${testcvs} -q -d ../crerepos get ." \
22043"${SPROG} \[checkout aborted\]: end of file from server (consult above messages if any)" \
22044"${SPROG} \[checkout aborted\]: received broken pipe signal"
22045	    cd ..
22046	    rm -r 1
22047
22048	    mkdir 1; cd 1
22049	    dotest_fail crerepos-6b "${testcvs} -d crerepos init" \
22050"${SPROG} init: CVSROOT must be an absolute pathname (not .crerepos.)
22051${SPROG} init: when using local access method\.
22052${SPROG} \[init aborted\]: Bad CVSROOT: .crerepos.\."
22053	    cd ..
22054	    rm -r 1
22055	  fi # end of tests to be skipped for remote
22056
22057	  # CVS should have created a history file.  If the administrator
22058	  # doesn't need it and wants to save on disk space, they just
22059	  # delete it and set LogHistory = the empty string in config.
22060	  dotest crerepos-7 "test -f $TESTDIR/crerepos/CVSROOT/history"
22061
22062	  # Now test mixing repositories.  This kind of thing tends to
22063	  # happen accidentally when people work with several repositories.
22064	  mkdir 1; cd 1
22065	  dotest crerepos-8 "${testcvs} -q co -l ." ''
22066	  mkdir first-dir
22067	  dotest crerepos-9 "${testcvs} add first-dir" \
22068"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
22069	  cd first-dir
22070	  touch file1
22071	  dotest crerepos-10 "${testcvs} add file1" \
22072"${SPROG} add: scheduling file .file1. for addition
22073${SPROG} add: use .${SPROG} commit. to add this file permanently"
22074	  dotest crerepos-11 "${testcvs} -q ci -m add-it" \
22075"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
22076initial revision: 1\.1"
22077	  cd ../..
22078	  rm -r 1
22079
22080	  mkdir 1; cd 1
22081	  dotest crerepos-12 "$testcvs -d $CREREPOS_ROOT -q co -l ."
22082	  mkdir crerepos-dir
22083	  dotest crerepos-13 "$testcvs add crerepos-dir" \
22084"Directory $TESTDIR/crerepos/crerepos-dir added to the repository"
22085	  cd crerepos-dir
22086	  touch cfile
22087	  dotest crerepos-14 "${testcvs} add cfile" \
22088"${SPROG} add: scheduling file .cfile. for addition
22089${SPROG} add: use .${SPROG} commit. to add this file permanently"
22090	  dotest crerepos-15 "${testcvs} -q ci -m add-it" \
22091"$TESTDIR/crerepos/crerepos-dir/cfile,v  <--  cfile
22092initial revision: 1\.1"
22093	  cd ../..
22094	  rm -r 1
22095
22096	  mkdir 1; cd 1
22097	  dotest crerepos-16 "${testcvs} co first-dir" \
22098"${SPROG} checkout: Updating first-dir
22099U first-dir/file1"
22100	  dotest crerepos-17 "${testcvs} -d ${CREREPOS_ROOT} co crerepos-dir" \
22101"${SPROG} checkout: Updating crerepos-dir
22102U crerepos-dir/cfile"
22103	  dotest crerepos-18 "${testcvs} update" \
22104"${SPROG} update: Updating first-dir
22105${SPROG} update: Updating crerepos-dir"
22106
22107	  cd ..
22108
22109          CVS_SERVER=$CVS_SERVER_save; export CVS_SERVER
22110
22111	  if $keep; then
22112	    echo Keeping ${TESTDIR} and exiting due to --keep
22113	    exit 0
22114	  fi
22115
22116	  dokeep
22117          rm -f $TESTDIR/cvs-setHome
22118	  rm -r 1
22119	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
22120	  rm -rf $TESTDIR/crerepos
22121	  ;;
22122
22123
22124
22125	rcs)
22126	  # Test ability to import an RCS file.  Note that this format
22127	  # is fixed--files written by RCS5, and other software which
22128	  # implements this format, will be out there "forever" and
22129	  # CVS must always be able to import such files.
22130
22131	  # See tests admin-13, admin-25 and rcs-8a for exporting RCS files.
22132
22133	  # Save the timezone and set it to UTC for these tests to make the
22134	  # value more predicatable.
22135	  save_TZ=$TZ
22136	  TZ=UTC0; export TZ
22137
22138	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
22139
22140	  # Currently the way to import an RCS file is to copy it
22141	  # directly into the repository.
22142	  #
22143	  # This file was written by RCS 5.7, and then the dates were
22144	  # hacked so that we test year 2000 stuff.  Note also that
22145	  # "author" names are just strings, as far as importing
22146	  # RCS files is concerned--they need not correspond to user
22147	  # IDs on any particular system.
22148	  #
22149	  # I also tried writing a file with the RCS supplied with
22150	  # HPUX A.09.05.  According to "man rcsintro" this is
22151	  # "Revision Number: 3.0; Release Date: 83/05/11".  There
22152	  # were a few minor differences like whitespace but at least
22153	  # in simple cases like this everything else seemed the same
22154	  # as the file written by RCS 5.7 (so I won't try to make it
22155	  # a separate test case).
22156
22157	  cat <<EOF >$TESTDIR/file1,v
22158head	1.3;
22159access;
22160symbols;
22161locks; strict;
22162comment	@# @;
22163
22164
221651.3
22166date	${RAWRCSDATE2000A};	author kingdon;	state Exp;
22167branches;
22168next	1.2;
22169
221701.2
22171date	${RAWRCSDATE1996A};	author kingdon;	state Exp;
22172branches;
22173next	1.1;
22174
221751.1
22176date	${RAWRCSDATE1996B};	author kingdon;	state Exp;
22177branches;
22178next	;
22179
22180
22181desc
22182@file1 is for testing CVS
22183@
22184
22185
221861.3
22187log
22188@delete second line; modify twelfth line
22189@
22190text
22191@This is the first line
22192This is the third line
22193This is the fourth line
22194This is the fifth line
22195This is the sixth line
22196This is the seventh line
22197This is the eighth line
22198This is the ninth line
22199This is the tenth line
22200This is the eleventh line
22201This is the twelfth line (and what a line it is)
22202This is the thirteenth line
22203@
22204
22205
222061.2
22207log
22208@add more lines
22209@
22210text
22211@a1 1
22212This is the second line
22213d11 1
22214a11 1
22215This is the twelfth line
22216@
22217
22218
222191.1
22220log
22221@add file1
22222@
22223text
22224@d2 12
22225@
22226EOF
22227	  modify_repo mv $TESTDIR/file1,v $CVSROOT_DIRNAME/first-dir/file1,v
22228
22229	  dotest rcs-1 "$testcvs -q co first-dir" 'U first-dir/file1'
22230	  cd first-dir
22231	  dotest rcs-2 "$testcvs -q log" "
22232RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
22233Working file: file1
22234head: 1\.3
22235branch:
22236locks: strict
22237access list:
22238symbolic names:
22239keyword substitution: kv
22240total revisions: 3;	selected revisions: 3
22241description:
22242file1 is for testing CVS
22243----------------------------
22244revision 1\.3
22245date: ${ISO8601DATE2000A};  author: kingdon;  state: Exp;  lines: ${PLUS}1 -2;
22246delete second line; modify twelfth line
22247----------------------------
22248revision 1\.2
22249date: ${ISO8601DATE1996A};  author: kingdon;  state: Exp;  lines: ${PLUS}12 -0;
22250add more lines
22251----------------------------
22252revision 1\.1
22253date: ${ISO8601DATE1996B};  author: kingdon;  state: Exp;
22254add file1
22255============================================================================="
22256
22257	  # Note that the dates here are chosen so that (a) we test
22258	  # at least one date after 2000, (b) we will notice if the
22259	  # month and day are getting mixed up with each other.
22260	  # TODO: also test that year isn't getting mixed up with month
22261	  # or day, for example 01-02-03.
22262
22263	  # ISO8601 format.  There are many, many, other variations
22264	  # specified by ISO8601 which we should be testing too.
22265	  dotest rcs-3 "${testcvs} -q log -d '1996-12-11<'" "
22266RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22267Working file: file1
22268head: 1\.3
22269branch:
22270locks: strict
22271access list:
22272symbolic names:
22273keyword substitution: kv
22274total revisions: 3;	selected revisions: 1
22275description:
22276file1 is for testing CVS
22277----------------------------
22278revision 1\.3
22279date: ${ISO8601DATE2000A};  author: kingdon;  state: Exp;  lines: ${PLUS}1 -2;
22280delete second line; modify twelfth line
22281============================================================================="
22282
22283	  # RFC822 format (as amended by RFC1123).
22284	  dotest rcs-4 "${testcvs} -q log -d '<3 Apr 2000 00:00'" \
22285"
22286RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
22287Working file: file1
22288head: 1\.3
22289branch:
22290locks: strict
22291access list:
22292symbolic names:
22293keyword substitution: kv
22294total revisions: 3;	selected revisions: 2
22295description:
22296file1 is for testing CVS
22297----------------------------
22298revision 1\.2
22299date: ${ISO8601DATE1996A};  author: kingdon;  state: Exp;  lines: ${PLUS}12 -0;
22300add more lines
22301----------------------------
22302revision 1\.1
22303date: ${ISO8601DATE1996B};  author: kingdon;  state: Exp;
22304add file1
22305============================================================================="
22306
22307	  # Intended behavior for "cvs annotate" is that it displays the
22308	  # last two digits of the year.  Make sure it does that rather
22309	  # than some bogosity like "100".
22310	  dotest rcs-4a "${testcvs} annotate file1" \
22311"
22312Annotations for file1
22313\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
223141\.1          (kingdon  24-Nov-96): This is the first line
223151\.2          (kingdon  24-Nov-96): This is the third line
223161\.2          (kingdon  24-Nov-96): This is the fourth line
223171\.2          (kingdon  24-Nov-96): This is the fifth line
223181\.2          (kingdon  24-Nov-96): This is the sixth line
223191\.2          (kingdon  24-Nov-96): This is the seventh line
223201\.2          (kingdon  24-Nov-96): This is the eighth line
223211\.2          (kingdon  24-Nov-96): This is the ninth line
223221\.2          (kingdon  24-Nov-96): This is the tenth line
223231\.2          (kingdon  24-Nov-96): This is the eleventh line
223241\.3          (kingdon  24-Nov-00): This is the twelfth line (and what a line it is)
223251\.2          (kingdon  24-Nov-96): This is the thirteenth line"
22326
22327	  # Probably should split this test into two at this point (file1
22328	  # above this line and file2 below), as the two share little
22329	  # data/setup.
22330
22331	  # OK, here is another one.  This one was written by hand based on
22332	  # doc/RCSFILES and friends.  One subtle point is that none of
22333	  # the lines end with newlines; that is a feature which we
22334	  # should be testing.
22335	  cat <<EOF >$TESTDIR/file2,v
22336head			 	1.5                 ;
22337     branch        1.2.6;
22338access ;
22339symbols branch:1.2.6;
22340locks;
22341testofanewphrase @without newphrase we'd have trouble extending @@ all@ ;
223421.5 date 71.01.01.01.00.00; author joe; state bogus; branches; next 1.4;
223431.4 date 71.01.01.00.00.05; author joe; state bogus; branches; next 1.3;
223441.3 date 70.12.31.15.00.05; author joe; state bogus; branches; next 1.2;
223451.2 date 70.12.31.12.15.05; author me; state bogus; branches 1.2.6.1; next 1.1;
223461.1 date 70.12.31.11.00.05; author joe; state bogus; branches; next; newph;
223471.2.6.1 date 71.01.01.08.00.05; author joe; state Exp; branches; next;
22348desc @@
223491.5 log @@ newphrase1; newphrase2 42; text @head revision@
223501.4 log @@ text @d1 1
22351a1 1
22352new year revision@
223531.3 log @@ text @d1 1
22354a1 1
22355old year revision@
223561.2 log @@ text @d1 1
22357a1 1
22358mid revision@ 1.1
22359
22360log           @@ text @d1 1
22361a1 1
22362start revision@
223631.2.6.1 log @@ text @d1 1
22364a1 1
22365branch revision@
22366EOF
22367	  modify_repo mv $TESTDIR/file2,v $CVSROOT_DIRNAME/first-dir/file2,v
22368	  # ' Match the single quote in above here doc -- for font-lock mode.
22369
22370	  # First test the default branch.
22371	  dotest rcs-5 "${testcvs} -q update file2" "U file2"
22372	  dotest rcs-6 "cat file2" "branch revision"
22373
22374	  # Check in a revision on the branch to force CVS to
22375	  # interpret every revision in the file.
22376	  dotest rcs-6a "${testcvs} -q update -r branch file2" ""
22377	  echo "next branch revision" > file2
22378	  dotest rcs-6b "${testcvs} -q ci -m mod file2" \
22379"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
22380new revision: 1\.2\.6\.2; previous revision: 1\.2\.6\.1"
22381
22382	  # Now get rid of the default branch, it will get in the way.
22383	  dotest rcs-7 "${testcvs} admin -b file2" \
22384"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22385done"
22386	  # But we do want to make sure that "cvs admin" leaves the newphrases
22387	  # in the file.
22388	  # The extra whitespace regexps are for the RCS library, which does
22389	  # not preserve whitespace in the dogmatic manner of RCS 5.7. -twp
22390	  dotest rcs-8 \
22391"grep testofanewphrase ${CVSROOT_DIRNAME}/first-dir/file2,v" \
22392"testofanewphrase[	 ][ 	]*@without newphrase we'd have trouble extending @@ all@[	 ]*;"
22393	  # The easiest way to test for newphrases in deltas and deltatexts
22394	  # is to just look at the whole file, I guess.
22395	  dotest rcs-8a "cat ${CVSROOT_DIRNAME}/first-dir/file2,v" \
22396"head	1\.5;
22397access;
22398symbols
22399	branch:1.2.6;
22400locks;
22401
22402testofanewphrase	@without newphrase we'd have trouble extending @@ all@;
22403
224041\.5
22405date	71\.01\.01\.01\.00\.00;	author joe;	state bogus;
22406branches;
22407next	1\.4;
22408
224091\.4
22410date	71\.01\.01\.00\.00\.05;	author joe;	state bogus;
22411branches;
22412next	1\.3;
22413
224141\.3
22415date	70\.12\.31\.15\.00\.05;	author joe;	state bogus;
22416branches;
22417next	1\.2;
22418
224191\.2
22420date	70\.12\.31\.12\.15\.05;	author me;	state bogus;
22421branches
22422	1\.2\.6\.1;
22423next	1\.1;
22424
224251\.1
22426date	70\.12\.31\.11\.00\.05;	author joe;	state bogus;
22427branches;
22428next	;
22429newph	;
22430
224311\.2\.6\.1
22432date	71\.01\.01\.08\.00\.05;	author joe;	state Exp;
22433branches;
22434next	1\.2\.6\.2;
22435
224361\.2\.6\.2
22437date	[0-9.]*;	author ${username};	state Exp;
22438branches;
22439next	;
22440commitid	${commitid};
22441
22442
22443desc
22444@@
22445
22446
224471\.5
22448log
22449@@
22450newphrase1	;
22451newphrase2	42;
22452text
22453@head revision@
22454
22455
224561\.4
22457log
22458@@
22459text
22460@d1 1
22461a1 1
22462new year revision@
22463
22464
224651\.3
22466log
22467@@
22468text
22469@d1 1
22470a1 1
22471old year revision@
22472
22473
224741\.2
22475log
22476@@
22477text
22478@d1 1
22479a1 1
22480mid revision@
22481
22482
224831\.1
22484log
22485@@
22486text
22487@d1 1
22488a1 1
22489start revision@
22490
22491
224921\.2\.6\.1
22493log
22494@@
22495text
22496@d1 1
22497a1 1
22498branch revision@
22499
22500
225011\.2\.6\.2
22502log
22503@mod
22504@
22505text
22506@d1 1
22507a1 1
22508next branch revision
22509@"
22510
22511	  dotest rcs-9 "${testcvs} -q update -p -D '1970-12-31 11:30 UT' file2" \
22512"start revision"
22513
22514	  dotest rcs-10 "${testcvs} -q update -p -D '1970-12-31 12:30 UT' file2" \
22515"mid revision"
22516
22517	  dotest rcs-11 "${testcvs} -q update -p -D '1971-01-01 00:30 UT' file2" \
22518"new year revision"
22519
22520	  # Same test as rcs-10, but with am/pm.
22521	  dotest rcs-12 "${testcvs} -q update -p -D 'December 31, 1970 12:30pm UT' file2" \
22522"mid revision"
22523
22524	  # Same test as rcs-11, but with am/pm.
22525	  dotest rcs-13 "${testcvs} -q update -p -D 'January 1, 1971 12:30am UT' file2" \
22526"new year revision"
22527
22528	  # OK, now make sure cvs log doesn't have any trouble with the
22529	  # newphrases and such.
22530	  dotest rcs-14 "${testcvs} -q log file2" "
22531RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
22532Working file: file2
22533head: 1\.5
22534branch:
22535locks:
22536access list:
22537symbolic names:
22538	branch: 1\.2\.6
22539keyword substitution: kv
22540total revisions: 7;	selected revisions: 7
22541description:
22542----------------------------
22543revision 1\.5
22544date: 1971-01-01 01:00:00 [+-]0000;  author: joe;  state: bogus;  lines: ${PLUS}1 -1;
22545\*\*\* empty log message \*\*\*
22546----------------------------
22547revision 1\.4
22548date: 1971-01-01 00:00:05 [+-]0000;  author: joe;  state: bogus;  lines: ${PLUS}1 -1;
22549\*\*\* empty log message \*\*\*
22550----------------------------
22551revision 1\.3
22552date: 1970-12-31 15:00:05 [+-]0000;  author: joe;  state: bogus;  lines: ${PLUS}1 -1;
22553\*\*\* empty log message \*\*\*
22554----------------------------
22555revision 1\.2
22556date: 1970-12-31 12:15:05 [+-]0000;  author: me;  state: bogus;  lines: ${PLUS}1 -1;
22557branches:  1\.2\.6;
22558\*\*\* empty log message \*\*\*
22559----------------------------
22560revision 1\.1
22561date: 1970-12-31 11:00:05 [+-]0000;  author: joe;  state: bogus;
22562\*\*\* empty log message \*\*\*
22563----------------------------
22564revision 1\.2\.6\.2
22565date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
22566mod
22567----------------------------
22568revision 1\.2\.6\.1
22569date: 1971-01-01 08:00:05 [+-]0000;  author: joe;  state: Exp;  lines: ${PLUS}1 -1;
22570\*\*\* empty log message \*\*\*
22571============================================================================="
22572	  # Now test each date format for "cvs log -d".
22573	  # Earlier than 1971-01-01
22574	  dotest rcs-15 "${testcvs} -q log -d '<1971-01-01 00:00 GMT' file2 \
22575	    | grep revision" \
22576"total revisions: 7;	selected revisions: 3
22577revision 1\.3
22578revision 1\.2
22579revision 1\.1"
22580	  # Later than 1971-01-01
22581	  dotest rcs-16 "${testcvs} -q log -d '1971-01-01 00:00 GMT<' file2 \
22582	    | grep revision" \
22583"total revisions: 7;	selected revisions: 4
22584revision 1\.5
22585revision 1\.4
22586revision 1\.2\.6\.2
22587revision 1\.2\.6\.1"
22588	  # Alternate syntaxes for later and earlier; multiple -d options
22589	  dotest rcs-17 "${testcvs} -q log -d '>1971-01-01 00:00 GMT' \
22590	    -d '1970-12-31 12:15 GMT>' file2 | grep revision" \
22591"total revisions: 7;	selected revisions: 5
22592revision 1\.5
22593revision 1\.4
22594revision 1\.1
22595revision 1\.2\.6\.2
22596revision 1\.2\.6\.1"
22597	  # Range, and single date
22598	  dotest rcs-18 "${testcvs} -q log -d '1970-12-31 11:30 GMT' \
22599	    -d '1971-01-01 00:00:05 GMT<1971-01-01 01:00:01 GMT' \
22600	    file2 | grep revision" \
22601"total revisions: 7;	selected revisions: 2
22602revision 1\.5
22603revision 1\.1"
22604	  # Alternate range syntax; equality
22605	  dotest rcs-19 "${testcvs} -q log \
22606	    -d '1971-01-01 01:00:01 GMT>=1971-01-01 00:00:05 GMT' \
22607	    file2 | grep revision" \
22608"total revisions: 7;	selected revisions: 2
22609revision 1\.5
22610revision 1\.4"
22611
22612	  dokeep
22613	  TZ=$save_TZ
22614	  cd ..
22615	  rm -r first-dir
22616	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
22617	  ;;
22618
22619
22620
22621	rcs2)
22622	  # More date tests.  Might as well do this as a separate
22623	  # test from "rcs", so that we don't need to perturb the
22624	  # "written by RCS 5.7" RCS file.
22625	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
22626	  # Significance of various dates:
22627	  # * At least one Y2K standard refers to recognizing 9 Sep 1999
22628	  #   (as an example of a pre-2000 date, I guess).
22629	  # * At least one Y2K standard refers to recognizing 1 Jan 2001
22630	  #   (as an example of a post-2000 date, I guess).
22631	  # * Many Y2K standards refer to 2000 being a leap year.
22632	  cat <<EOF >$TESTDIR/file1,v
22633head 1.7; access; symbols; locks; strict;
226341.7 date 2004.08.31.01.01.01; author sue; state; branches; next 1.6;
226351.6 date 2004.02.29.01.01.01; author sue; state; branches; next 1.5;
226361.5 date 2003.02.28.01.01.01; author sue; state; branches; next 1.4;
226371.4 date 2001.01.01.01.01.01; author sue; state; branches; next 1.3;
226381.3 date 2000.02.29.01.01.01; author sue; state; branches; next 1.2;
226391.2 date 99.09.09.01.01.01; author sue; state; branches; next 1.1;
226401.1 date 98.09.10.01.01.01; author sue; state; branches; next;
22641desc @a test file@
226421.7 log @@ text @head revision@
226431.6 log @@ text @d1 1
22644a1 1
226452004 was a great year for leaping@
226461.5 log @@ text @d1 1
22647a1 1
226482003 wasn't@
226491.4 log @@ text @d1 1
22650a1 1
22651two year hiatus@
226521.3 log @@ text @d1 1
22653a1 1
226542000 is also a good year for leaping@
226551.2 log @@ text @d1 1
22656a1 1
22657Tonight we're going to party like it's a certain year@
226581.1 log @@ text @d1 1
22659a1 1
22660Need to start somewhere@
22661EOF
22662	  modify_repo mv $TESTDIR/file1,v $CVSROOT_DIRNAME/first-dir/file1,v
22663	  # ' Match the 3rd single quote in the here doc -- for font-lock mode.
22664
22665	  dotest rcs2-1 "${testcvs} -q co first-dir" 'U first-dir/file1'
22666	  cd first-dir
22667
22668	  # 9 Sep 1999
22669	  dotest rcs2-2 "${testcvs} -q update -p -D '1999-09-09 11:30 UT' file1" \
22670"Tonight we're going to party like it's a certain year"
22671	  # 1 Jan 2001.
22672	  dotest rcs2-3 "${testcvs} -q update -p -D '2001-01-01 11:30 UT' file1" \
22673"two year hiatus"
22674	  # 29 Feb 2000
22675	  dotest rcs2-4 "${testcvs} -q update -p -D '2000-02-29 11:30 UT' file1" \
22676"2000 is also a good year for leaping"
22677	  # 29 Feb 2003 is invalid
22678	  dotest_fail rcs2-5 "${testcvs} -q update -p -D '2003-02-29 11:30 UT' file1" \
22679"$CPROG \[update aborted\]: Can't parse date/time: \`2003-02-29 11:30 UT'"
22680
22681	  dotest rcs2-6 "${testcvs} -q update -p -D 2007-01-07 file1" \
22682"head revision"
22683	  # This assumes that the clock of the machine running the tests
22684	  # is set to at least the year 1998 or so.  There don't seem
22685	  # to be a lot of ways to test the relative date code (short
22686	  # of something like LD_LIBRARY_PRELOAD'ing in our own
22687	  # getttimeofday, or hacking the CVS source with testing
22688	  # features, which always seems to be problematic since then
22689	  # someone feels like documenting them and things go downhill
22690	  # from there).
22691	  #
22692	  # These tests can be expected to fail 3 times every 400 years
22693	  # starting Feb. 29, 2096 (because 8 years from that date would
22694	  # be Feb. 29, 2100, which is an invalid date -- 2100 isn't a
22695	  # leap year because it's divisible by 100 but not by 400).
22696
22697	  dotest rcs2-7 "${testcvs} -q update -p -D '96 months' file1" \
22698"head revision"
22699	  dotest rcs2-8 "${testcvs} -q update -p -D '8 years' file1" \
22700"head revision"
22701
22702	  dokeep
22703	  cd ..
22704	  rm -r first-dir
22705	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
22706	  ;;
22707
22708
22709
22710	rcs3)
22711	  # More RCS file tests, in particular at least some of the
22712	  # error handling issues.
22713	  mkdir ${CVSROOT_DIRNAME}/first-dir
22714	  cat <<EOF >$TESTDIR/file1,v
22715head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
22716; author jeremiah ;state ;  branches; next;desc@@1.1log@@text@head@
22717EOF
22718	  modify_repo mv $TESTDIR/file1,v $CVSROOT_DIRNAME/first-dir/file1,v
22719	  mkdir 1; cd 1
22720	  # CVS requires whitespace between "desc" and its value.
22721	  # The rcsfile(5) manpage doesn't really seem to answer the
22722	  # question one way or the other (it has a grammar but almost
22723	  # nothing about lexical analysis).
22724	  dotest_fail rcs3-1 "${testcvs} -q co first-dir" \
22725"${SPROG} \[checkout aborted\]: EOF while looking for value in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
22726	  cat <<EOF >$TESTDIR/file1,v
22727head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
22728; author jeremiah ;state ;  branches; next;desc @@1.1log@@text@head@
22729EOF
22730	  modify_repo mv $TESTDIR/file1,v $CVSROOT_DIRNAME/first-dir/file1,v
22731	  # Whitespace issues, likewise.
22732	  dotest_fail rcs3-2 "${testcvs} -q co first-dir" \
22733"${SPROG} \[checkout aborted\]: unexpected '.x6c' reading revision number in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
22734	  cat <<EOF >$TESTDIR/file1,v
22735head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
22736; author jeremiah ;state ;  branches; next;desc @@1.1 log@@text@head@
22737EOF
22738	  modify_repo mv $TESTDIR/file1,v $CVSROOT_DIRNAME/first-dir/file1,v
22739	  # Charming array of different messages for similar
22740	  # whitespace issues (depending on where the whitespace is).
22741	  dotest_fail rcs3-3 "${testcvs} -q co first-dir" \
22742"${SPROG} \[checkout aborted\]: EOF while looking for value in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
22743	  cat <<EOF >$TESTDIR/file1,v
22744head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
22745; author jeremiah ;state ;  branches; next;desc @@1.1 log @@text @head@
22746EOF
22747	  modify_repo mv $TESTDIR/file1,v $CVSROOT_DIRNAME/first-dir/file1,v
22748	  dotest rcs3-4 "${testcvs} -q co first-dir" 'U first-dir/file1'
22749
22750	  # Ouch, didn't expect this one.  FIXCVS.  Or maybe just remove
22751	  # the feature, if this is a -s problem?
22752	  dotest_fail rcs3-5 "${testcvs} log -s nostate first-dir/file1" \
22753"${DOTSTAR}ssertion.*failed${DOTSTAR}" "${DOTSTAR}failed assertion${DOTSTAR}"
22754	  cd first-dir
22755	  dotest_fail rcs3-5a "${testcvs} log -s nostate file1" \
22756"${DOTSTAR}ssertion.*failed${DOTSTAR}" "${DOTSTAR}failed assertion${DOTSTAR}"
22757	  cd ..
22758
22759	  # See remote code above for rationale for cd.
22760	  cd first-dir
22761	  dotest rcs3-6 "${testcvs} log -R file1" \
22762"${CVSROOT_DIRNAME}/first-dir/file1,v"
22763
22764	  # OK, now put an extraneous '\0' at the end.
22765	  mv $CVSROOT_DIRNAME/first-dir/file1,v $TESTDIR/file1,v
22766	  ${AWK} </dev/null 'BEGIN { printf "@%c", 10 }' | ${TR} '@' '\000' \
22767	    >>$TESTDIR/file1,v
22768	  modify_repo mv $TESTDIR/file1,v $CVSROOT_DIRNAME/first-dir/file1,v
22769	  dotest_fail rcs3-7 "${testcvs} log -s nostate file1" \
22770"${SPROG} \[log aborted\]: unexpected '.x0' reading revision number in RCS file ${CVSROOT_DIRNAME}/first-dir/file1,v"
22771
22772	  dokeep
22773	  cd ../..
22774	  rm -r 1
22775	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
22776	  ;;
22777
22778
22779
22780	rcs4)
22781	  # Fix a bug that shows up when checking out files by date with the
22782	  # "-D date" command line option.  There is code in the original to
22783	  # handle a special case.  If the date search finds revision 1.1 it
22784	  # is supposed to check whether revision 1.1.1.1 has the same date
22785	  # stamp, which would indicate that the file was originally brought
22786	  # in with "cvs import".  In that case it is supposed to return the
22787	  # vendor branch version 1.1.1.1.
22788	  #
22789	  # However, there is a bug in the code. It actually compares
22790	  # the date of revision 1.1 for equality with the date given
22791	  # on the command line -- clearly wrong. This commit fixes
22792	  # the coding bug.
22793	  #
22794	  # There is an additional bug which is _not_ fixed yet.
22795	  # The date comparison should not be a strict
22796	  # equality test. It should allow a fudge factor of, say, 2-3
22797	  # seconds. Old versions of CVS created the two revisions
22798	  # with two separate invocations of the RCS "ci" command. We
22799	  # have many old files in the tree in which the dates of
22800	  # revisions 1.1 and 1.1.1.1 differ by 1 second.
22801
22802	  # Need a predictable time zone.
22803	  save_TZ=$TZ
22804	  TZ=UTC0; export TZ
22805
22806          mkdir rcs4
22807          cd rcs4
22808
22809	  mkdir imp-dir
22810	  cd imp-dir
22811	  echo 'OpenMunger sources' >file1
22812
22813	  # choose a time in the past to demonstrate the problem
22814	  touch -t 200012010123 file1
22815
22816	  dotest_sort rcs4-1 \
22817"${testcvs} import -d -m add rcs4-dir openmunger openmunger-1_0" \
22818'
22819
22820N rcs4-dir/file1
22821No conflicts created by this import'
22822	  echo 'OpenMunger sources release 1.1 extras' >>file1
22823	  touch -t 200112011234 file1
22824	  dotest_sort rcs4-2 \
22825"${testcvs} import -d -m add rcs4-dir openmunger openmunger-1_1" \
22826'
22827
22828No conflicts created by this import
22829U rcs4-dir/file1'
22830	  cd ..
22831	  # Next checkout the new module
22832	  dotest rcs4-3 \
22833"${testcvs} -q co rcs4-dir" \
22834'U rcs4-dir/file1'
22835	  cd rcs4-dir
22836	  echo 'local change' >> file1
22837
22838	  # commit a local change
22839	  dotest rcs4-4 "${testcvs} -q commit -m hack file1" \
22840"$CVSROOT_DIRNAME/rcs4-dir/file1,v  <--  file1
22841new revision: 1\.2; previous revision: 1\.1"
22842	  # now see if we get version 1.1 or 1.1.1.1 when we ask for
22843	  # a checkout by time... it really should be 1.1.1.1 as
22844          # that was indeed the version that was visible at the target
22845	  # time.
22846	  dotest rcs4-5 \
22847"${testcvs} -q update -D 'October 1, 2001 UTC' file1" \
22848'[UP] file1'
22849	  dotest rcs4-6 \
22850"${testcvs} -q status file1" \
22851'===================================================================
22852File: file1            	Status: Up-to-date
22853
22854   Working revision:	1\.1\.1\.1.*
22855   Repository revision:	1\.1\.1\.1	'${CVSROOT_DIRNAME}'/rcs4-dir/file1,v
22856   Commit Identifier:	'${commitid}'
22857   Sticky Tag:		(none)
22858   Sticky Date:		2001\.10\.01\.00\.00\.00
22859   Sticky Options:	(none)'
22860
22861	  dokeep
22862	  TZ=$save_TZ
22863	  cd ../..
22864          rm -r rcs4
22865          modify_repo rm -rf $CVSROOT_DIRNAME/rcs4-dir
22866	  ;;
22867
22868
22869
22870	rcs5)
22871	  # Some tests of the $Log keyword and log message without a trailing
22872	  # EOL.  This used to look ugly and, in the worst case, could cause
22873	  # a seg fault due to a buffer overflow.
22874	  #
22875	  # Note that it should not be possible to create this situation via a
22876	  # CVS server (and any client), since the server itself inserts the
22877	  # trailing EOL onto log messages that are missing one.  Still, we
22878	  # shouldn't segfault due to a corrupt RCS file and I think that a log
22879	  # message without the trailing EOL doesn't actually violate the RCS
22880	  # spec, though it doesn't appear to be possible to create such a log
22881	  # message using RCS 5.7.
22882
22883	  modify_repo mkdir $CVSROOT_DIRNAME/rcs5
22884	  cat <<\EOF >$TESTDIR/file1,v
22885head 1.1;
22886access;
22887symbols;
22888locks;
22889expand kv;
22890
228911.1 date 2007.03.20.04.03.02; author jeremiah; state Ext;  branches; next;
22892
22893desc
22894@@
22895
228961.1
22897log
22898@he always had very fine wine@
22899text
22900@line1
22901/*
22902EOF
22903echo ' * History: $''Log$' >>$TESTDIR/file1,v
22904	  cat <<\EOF >>$TESTDIR/file1,v
22905 */
22906line5
22907@
22908EOF
22909	  modify_repo mv $TESTDIR/file1,v $CVSROOT_DIRNAME/rcs5/file1,v
22910
22911          mkdir rcs5
22912          cd rcs5
22913	  dotest rcs5-1 "$testcvs -Q co rcs5"
22914	  dotest rcs5-2 "cat rcs5/file1" \
22915"line1
22916/\\*
22917 \\* History: "'\$'"Log: file1,v "'\$'"
22918 \\* History: Revision 1\.1  2007/03/20 04:03:02  jeremiah
22919 \\* History: he always had very fine wine
22920 \\* History:
22921 \\*/
22922line5"
22923
22924	  cd ..
22925          rm -r rcs5
22926          modify_repo rm -rf $CVSROOT_DIRNAME/rcs5
22927	  ;;
22928
22929
22930
22931	lockfiles)
22932	  # Tests of CVS lock files.
22933	  # TODO-maybe: Add a test where we arrange for a loginfo
22934	  # script (or some such) to ensure that locks are in place
22935	  # so then we can see how they are behaving.
22936
22937	  if $proxy; then
22938	    # don't even try
22939	    continue
22940	  fi
22941
22942	  mkdir 1; cd 1
22943	  mkdir sdir
22944	  mkdir sdir/ssdir
22945	  echo file >sdir/ssdir/file1
22946	  dotest lockfiles-1 \
22947"${testcvs} -Q import -m import-it first-dir bar baz" ""
22948	  cd ..
22949
22950	  mkdir 2; cd 2
22951	  dotest lockfiles-2 "${testcvs} -q co first-dir" \
22952"U first-dir/sdir/ssdir/file1"
22953	  dotest lockfiles-3 "${testcvs} -Q co CVSROOT" ""
22954	  cd CVSROOT
22955	  echo "LockDir=${TESTDIR}/locks" >>config
22956	  dotest lockfiles-4 "${testcvs} -q ci -m config-it" \
22957"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
22958new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
22959$SPROG commit: Rebuilding administrative file database"
22960	  cd ../first-dir/sdir/ssdir
22961	  # The error message appears twice because Lock_Cleanup only
22962	  # stops recursing after the first attempt.
22963	  dotest_fail lockfiles-5 "${testcvs} -q update" \
22964"${SPROG} \[update aborted\]: cannot stat ${TESTDIR}/locks: No such file or directory"
22965	  mkdir ${TESTDIR}/locks
22966	  # Grumble, mumble.  Cygwin.
22967	  if test -n "$remotehost"; then
22968	    $CVS_RSH $remotehost "chmod u=rwx,g=r,o= ${TESTDIR}/locks"
22969	  else
22970	    chmod u=rwx,g=r,o= ${TESTDIR}/locks
22971	  fi
22972	  save_umask=`umask`
22973	  umask 0077
22974	  CVSUMASK=0077; export CVSUMASK
22975	  dotest lockfiles-6 "${testcvs} -q update" ""
22976	  # TODO: should also be testing that CVS continues to honor the
22977	  # umask and CVSUMASK normally.  In the case of the umask, CVS
22978	  # doesn't seem to use it for much (although it perhaps should).
22979	  dotest lockfiles-7 "ls ${TESTDIR}/locks/first-dir/sdir/ssdir" ""
22980
22981	  # The policy is that when CVS creates new lock directories, they
22982	  # inherit the permissions from the parent directory.  CVSUMASK
22983	  # isn't right, because typically the reason for LockDir is to
22984	  # use a different set of permissions.
22985	  #
22986	  # Bah!  Cygwin!
22987	  if test -n "$remotehost"; then
22988	    dotest lockfiles-7a "$CVS_RSH $remotehost 'ls -ld ${TESTDIR}/locks/first-dir'" \
22989"drwxr-----.*first-dir"
22990	    dotest lockfiles-7b "$CVS_RSH $remotehost 'ls -ld ${TESTDIR}/locks/first-dir/sdir/ssdir'" \
22991"drwxr-----.*first-dir/sdir/ssdir"
22992	  else
22993	    dotest lockfiles-7a "ls -ld ${TESTDIR}/locks/first-dir" \
22994"drwxr-----.*first-dir"
22995	    dotest lockfiles-7b "ls -ld ${TESTDIR}/locks/first-dir/sdir/ssdir" \
22996"drwxr-----.*first-dir/sdir/ssdir"
22997	  fi
22998
22999	  cd ../../..
23000	  dotest lockfiles-8 "${testcvs} -q update" ""
23001	  dotest lockfiles-9 "${testcvs} -q co -l ." ""
23002
23003	  ###
23004	  ### There are race conditions in the following tests, but hopefully
23005	  ### the 5 seconds the first process waits to remove the lockdir and
23006	  ### the 30 seconds CVS waits betweens checks will be significant
23007	  ### enough to render the case moot.
23008	  ###
23009	  # Considers the following cases:
23010	  #
23011	  #                    Lock Present
23012	  # Operation          Allowed (case #)
23013	  #
23014	  #                    Read      Promotable   Write
23015	  #                    _______   __________   ______
23016	  # Read              |Yes (1)   Yes (2)      No (3)
23017	  # Promotable Read   |Yes (4)   No (5)       No (6)
23018	  # Write             |No (7)    No (8)       No (9)
23019	  #
23020	  # Tests do not appear in same ordering as table:
23021	  # 1. Read when read locks are present...
23022	  # 2. Read when promotable locks are present...
23023	  # 3. Don't read when write locks present...
23024	  # 4. Read but don't write when read locks are present... (fail
23025	  #    commit up-to-date check with promotable lock present).
23026	  # 5. Don't allow promotable read when promotable locks are present...
23027	  #    (fail to perform commit up-to-date check with promotable lock
23028	  #     present).
23029	  # 6. Don't allow promotable read when write locks are present...
23030	  #    (fail to perform commit up-to-date check with promotable lock
23031	  #     present).
23032	  # 7. Don't write when read locks are present...
23033	  # 8. Don't write when promotable locks are present...
23034	  # 9. Don't write when write locks are present...
23035
23036	  # 3. Don't read when write locks present...
23037	  mkdir "$TESTDIR/locks/first-dir/#cvs.lock"
23038	  (sleep 5; rmdir "$TESTDIR/locks/first-dir/#cvs.lock")&
23039	  dotest lockfiles-10 "$testcvs -q co -l first-dir" \
23040"$SPROG checkout: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir
23041$SPROG checkout: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir"
23042
23043	  # 1. Read when read locks are present...
23044	  touch "$TESTDIR/locks/first-dir/#cvs.rfl.test.lock"
23045	  dotest lockfiles-11 "$testcvs -q co -l first-dir"
23046	  rm "$TESTDIR/locks/first-dir/#cvs.rfl.test.lock"
23047
23048	  # 2. Read when promotable locks are present...
23049	  cd ..
23050	  mkdir 3; cd 3
23051	  touch "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.pfl.test.lock"
23052	  dotest lockfiles-12 "$testcvs -q co first-dir" \
23053"U first-dir/sdir/ssdir/file1"
23054	  rm "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.pfl.test.lock"
23055
23056	  # 7. Don't write when read locks are present...
23057	  echo I always have trouble coming up with witty text for the test files >>first-dir/sdir/ssdir/file1
23058	  touch "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.rfl.test.lock"
23059	  (sleep 5; rm "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.rfl.test.lock")&
23060	  dotest lockfiles-13 "$testcvs -q ci -mconflict first-dir" \
23061"$SPROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
23062$SPROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
23063$CVSROOT_DIRNAME/first-dir/sdir/ssdir/file1,v  <--  first-dir/sdir/ssdir/file1
23064new revision: 1\.2; previous revision: 1\.1"
23065
23066	  # 4. Read but don't write when read locks are present... (fail
23067	  #    commit up-to-date check with promotable lock present).
23068	  cd ../2
23069	  echo something that would render readers all full of smiles >>first-dir/sdir/ssdir/file1
23070	  touch "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.rfl.test.lock"
23071	  dotest_fail lockfiles-14 "$testcvs -q ci -mnot-up-to-date first-dir" \
23072"$SPROG commit: Up-to-date check failed for \`first-dir/sdir/ssdir/file1'
23073$SPROG \[commit aborted\]: correct above errors first!"
23074	  rm "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.rfl.test.lock"
23075
23076	  # 5. Don't allow promotable read when promotable locks are present...
23077	  #    (fail to perform commit up-to-date check with promotable lock
23078	  #     present).
23079	  touch "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.pfl.test.lock"
23080	  (sleep 5; rm "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.pfl.test.lock")&
23081	  dotest_fail lockfiles-15 "$testcvs -q ci -mnot-up-to-date first-dir" \
23082"$SPROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
23083$SPROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
23084$SPROG commit: Up-to-date check failed for \`first-dir/sdir/ssdir/file1'
23085$SPROG \[commit aborted\]: correct above errors first!"
23086
23087	  # 6. Don't allow promotable read when write locks are present...
23088	  #    (fail to perform commit up-to-date check with promotable lock
23089	  #     present).
23090	  mkdir "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.lock"
23091	  (sleep 5; rmdir "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.lock")&
23092	  dotest_fail lockfiles-16 "$testcvs -q ci -mnot-up-to-date first-dir" \
23093"$SPROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
23094$SPROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
23095$SPROG commit: Up-to-date check failed for \`first-dir/sdir/ssdir/file1'
23096$SPROG \[commit aborted\]: correct above errors first!"
23097
23098	  # 8. Don't write when promotable locks are present...
23099	  dotest lockfiles-17 "$testcvs -Q up -C first-dir/sdir/ssdir"
23100	  echo the kinds of smiles that light faces for miles >>first-dir/sdir/ssdir/file1
23101	  touch "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.pfl.test.lock"
23102	  (sleep 5; rm "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.pfl.test.lock")&
23103	  dotest lockfiles-18 "$testcvs -q ci -mnot-up-to-date first-dir" \
23104"$SPROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
23105$SPROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
23106$CVSROOT_DIRNAME/first-dir/sdir/ssdir/file1,v  <--  first-dir/sdir/ssdir/file1
23107new revision: 1\.3; previous revision: 1\.2"
23108
23109	  # 9. Don't write when write locks are present...
23110	  echo yet this poem would probably only give longfellow bile >>first-dir/sdir/ssdir/file1
23111	  mkdir "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.lock"
23112	  (sleep 5; rmdir "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.lock")&
23113	  dotest lockfiles-19 "$testcvs -q ci -mnot-up-to-date first-dir" \
23114"$SPROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
23115$SPROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
23116$CVSROOT_DIRNAME/first-dir/sdir/ssdir/file1,v  <--  first-dir/sdir/ssdir/file1
23117new revision: 1\.4; previous revision: 1\.3"
23118
23119	  # 10. Don't write when history locks are present...
23120	  echo have you ever heard a poem quite so vile\? >>first-dir/sdir/ssdir/file1
23121	  mkdir "$TESTDIR/locks/CVSROOT/#cvs.history.lock"
23122	  (sleep 5; rmdir "$TESTDIR/locks/CVSROOT/#cvs.history.lock")&
23123	  dotest lockfiles-20 "$testcvs -q ci -mnot-up-to-date first-dir" \
23124"$CVSROOT_DIRNAME/first-dir/sdir/ssdir/file1,v  <--  first-dir/sdir/ssdir/file1
23125new revision: 1\.5; previous revision: 1\.4
23126$SPROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/CVSROOT
23127$SPROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/CVSROOT"
23128
23129	  dotest lockfiles-21 "$testcvs -Q tag newtag first-dir"
23130
23131	  rm $CVSROOT_DIRNAME/CVSROOT/val-tags
23132	  mkdir "$TESTDIR/locks/CVSROOT/#cvs.val-tags.lock"
23133	  (sleep 5; rmdir "$TESTDIR/locks/CVSROOT/#cvs.val-tags.lock")&
23134	  dotest lockfiles-22 "$testcvs -q up -r newtag first-dir" \
23135"$SPROG update: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/CVSROOT
23136$SPROG update: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/CVSROOT"
23137
23138	  cd CVSROOT
23139	  dotest lockfiles-cleanup-1 "$testcvs -q up -pr1.1 config >config" ""
23140	  dotest lockfiles-cleanup-2 "$testcvs -q ci -m config-it" \
23141"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
23142new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
23143$SPROG commit: Rebuilding administrative file database"
23144
23145	  dokeep
23146	  cd ../..
23147	  # Restore umask.
23148	  umask $save_umask
23149	  unset CVSUMASK
23150	  rm -r $TESTDIR/locks
23151	  rm -r 1 2 3
23152	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
23153	  ;;
23154
23155
23156
23157	backuprecover)
23158	  # Tests to make sure we get the expected behavior
23159	  # when we recover a repository from an old backup
23160	  #
23161	  # Details:
23162	  #   Backup will be older than some developer's workspaces
23163	  #	This means the first attempt at an update will fail
23164	  #	The workaround for this is to replace the CVS
23165	  #	  directories with those from a "new" checkout from
23166	  #	  the recovered repository.  Due to this, multiple
23167	  #	  merges should cause conflicts (the same data
23168	  #	  will be merged more than once).
23169	  #	A workspace updated before the date of the recovered
23170	  #	  copy will not need any extra attention
23171	  #
23172	  # Note that backuprecover-15 is probably a failure case
23173	  #   If nobody else had a more recent update, the data would be lost
23174	  #	permanently
23175	  #   Granted, the developer should have been notified not to do this
23176	  #	by now, but still...
23177	  #
23178	  mkdir backuprecover; cd backuprecover
23179	  mkdir 1; cd 1
23180	  dotest backuprecover-1 "$testcvs -q co -l ."
23181	  mkdir first-dir
23182	  dotest backuprecover-2 "${testcvs} add first-dir" \
23183"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
23184          cd first-dir
23185	  mkdir dir
23186	  dotest backuprecover-3 "${testcvs} add dir" \
23187"Directory ${CVSROOT_DIRNAME}/first-dir/dir added to the repository"
23188	  touch file1 dir/file2
23189	  dotest backuprecover-4 "${testcvs} -q add file1 dir/file2" \
23190"${SPROG} add: use \`${SPROG} commit' to add these files permanently"
23191	  dotest backuprecover-5 "${testcvs} -q ci -mtest" \
23192"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
23193initial revision: 1\.1
23194$CVSROOT_DIRNAME/first-dir/dir/file2,v  <--  dir/file2
23195initial revision: 1\.1"
23196	  echo "Line one" >>file1
23197	  echo "  is the place" >>file1
23198	  echo "    we like to begin" >>file1
23199	  echo "Anything else" >>file1
23200	  echo "  looks like" >>file1
23201	  echo "    a sin" >>file1
23202	  echo "File 2" >>dir/file2
23203	  echo "  is the place" >>dir/file2
23204	  echo "    the rest of it goes"  >>dir/file2
23205	  echo "Why I don't use" >>dir/file2
23206	  echo "  something like 'foo'" >>dir/file2
23207	  echo "    God only knows" >>dir/file2
23208	  dotest backuprecover-6 "${testcvs} -q ci -mtest" \
23209"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
23210new revision: 1\.2; previous revision: 1\.1
23211$CVSROOT_DIRNAME/first-dir/dir/file2,v  <--  dir/file2
23212new revision: 1\.2; previous revision: 1\.1"
23213
23214	  # Simulate the lazy developer
23215	  # (he did some work but didn't check it in...)
23216	  cd ../..
23217	  mkdir 2; cd 2
23218	  dotest backuprecover-7 "${testcvs} -Q co first-dir" ''
23219	  cd first-dir
23220	  sed -e "s/looks like/just looks like/" file1 >tmp; mv tmp file1
23221	  sed -e "s/don't use/don't just use/" dir/file2 >tmp; mv tmp dir/file2
23222
23223	  # developer 1 is on a roll
23224	  cd ../../1/first-dir
23225	  echo "I need some more words" >>file1
23226	  echo "  to fill up this space" >>file1
23227	  echo "    anything else would be a disgrace" >>file1
23228	  echo "My rhymes cross many boundries" >>dir/file2
23229	  echo "  this time it's files" >>dir/file2
23230	  echo "    a word that fits here would be something like dials" >>dir/file2
23231	  dotest backuprecover-8 "${testcvs} -q ci -mtest" \
23232"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
23233new revision: 1\.3; previous revision: 1\.2
23234$CVSROOT_DIRNAME/first-dir/dir/file2,v  <--  dir/file2
23235new revision: 1\.3; previous revision: 1\.2"
23236
23237	  # Save a backup copy
23238	  cp -R $CVSROOT_DIRNAME/first-dir $TESTDIR/backup
23239
23240	  # Simulate developer 3
23241	  cd ../..
23242	  mkdir 3; cd 3
23243	  dotest backuprecover-9a "${testcvs} -Q co first-dir" ''
23244	  cd first-dir
23245	  echo >>file1
23246	  echo >>dir/file2
23247	  echo "Developer 1 makes very lame rhymes" >>file1
23248	  echo "  I think he should quit and become a mime" >>file1
23249	  echo "What the %*^# kind of rhyme crosses a boundry?" >>dir/file2
23250	  echo "  I think you should quit and get a job in the foundry" >>dir/file2
23251	  dotest backuprecover-9b "${testcvs} -q ci -mtest" \
23252"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
23253new revision: 1\.4; previous revision: 1\.3
23254$CVSROOT_DIRNAME/first-dir/dir/file2,v  <--  dir/file2
23255new revision: 1\.4; previous revision: 1\.3"
23256
23257	  # Developer 4 so we can simulate a conflict later...
23258	  cd ../..
23259	  mkdir 4; cd 4
23260	  dotest backuprecover-10 "${testcvs} -Q co first-dir" ''
23261	  cd first-dir
23262	  sed -e "s/quit and/be fired so he can/" dir/file2 >tmp; mv tmp dir/file2
23263
23264	  # And back to developer 1
23265	  cd ../../1/first-dir
23266	  dotest backuprecover-11 "${testcvs} -Q update" ''
23267	  echo >>file1
23268	  echo >>dir/file2
23269	  echo "Oh yeah, well rhyme this" >>file1
23270	  echo "  developer three" >>file1
23271	  echo "    you want opposition" >>file1
23272	  echo "      you found some in me!" >>file1
23273	  echo "I'll give you mimes" >>dir/file2
23274	  echo "  and foundries galore!"  >>dir/file2
23275	  echo "    your head will spin" >>dir/file2
23276	  echo "      once you find what's in store!" >>dir/file2
23277	  dotest backuprecover-12 "${testcvs} -q ci -mtest" \
23278"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
23279new revision: 1\.5; previous revision: 1\.4
23280$CVSROOT_DIRNAME/first-dir/dir/file2,v  <--  dir/file2
23281new revision: 1\.5; previous revision: 1\.4"
23282
23283	  # developer 3'll do a bit of work that never gets checked in
23284	  cd ../../3/first-dir
23285	  dotest backuprecover-13 "${testcvs} -Q update" ''
23286	  sed -e "s/very/some extremely/" file1 >tmp; mv tmp file1
23287	  dotest backuprecover-14 "${testcvs} -q ci -mtest" \
23288"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
23289new revision: 1\.6; previous revision: 1\.5"
23290	  echo >>file1
23291	  echo "Tee hee hee hee" >>file1
23292	  echo >>dir/file2
23293	  echo "Find what's in store?" >>dir/file2
23294	  echo "  Oh, I'm so sure!" >>dir/file2
23295	  echo "    You've got an ill, and I have the cure!"  >>dir/file2
23296
23297	  # Slag the original and restore it a few revisions back
23298	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
23299	  modify_repo mv $TESTDIR/backup $CVSROOT_DIRNAME/first-dir
23300
23301	  # Have developer 1 try an update and lose some data
23302	  #
23303	  # Feel free to imagine the horrific scream of despair
23304	  cd ../../1/first-dir
23305	  dotest backuprecover-15 "${testcvs} update" \
23306"${SPROG} update: Updating .
23307U file1
23308${SPROG} update: Updating dir
23309U dir/file2"
23310
23311	  # Developer 3 tries the same thing (he has an office)
23312	  # but fails without losing data since all of his files have
23313	  # uncommitted changes
23314	  cd ../../3/first-dir
23315	  dotest_fail backuprecover-16 "${testcvs} update" \
23316"${SPROG} update: Updating \.
23317${SPROG} \[update aborted\]: could not find desired version 1\.6 in ${CVSROOT_DIRNAME}/first-dir/file1,v"
23318
23319	  # create our workspace fixin' script
23320	  cd ../..
23321	  echo \
23322"#!$TESTSHELL
23323
23324# This script will copy the CVS database dirs from the checked out
23325# version of a newly recovered repository and replace the CVS
23326# database dirs in a workspace with later revisions than those in the
23327# recovered repository
23328cd repos-first-dir
23329DATADIRS=\`find . -name CVS -print\`
23330cd ../first-dir
23331find . -name CVS -print | xargs rm -rf
23332for file in \${DATADIRS}; do
23333	cp -R ../repos-first-dir/\${file} \${file}
23334done" >fixit
23335
23336	  # We only need to fix the workspaces of developers 3 and 4
23337	  # (1 lost all her data and 2 has an update date from
23338	  # before the date the backup was made)
23339	  cd 3
23340	  dotest backuprecover-17 \
23341		"${testcvs} -Q co -d repos-first-dir first-dir" ''
23342	  cd ../4
23343	  dotest backuprecover-18 \
23344		"${testcvs} -Q co -d repos-first-dir first-dir" ''
23345	  sh ../fixit
23346	  cd ../3; sh ../fixit
23347
23348	  # (re)commit developer 3's stuff
23349	  cd first-dir
23350	  dotest backuprecover-19 "${testcvs} -q ci -mrecover/merge" \
23351"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
23352new revision: 1\.4; previous revision: 1\.3
23353$CVSROOT_DIRNAME/first-dir/dir/file2,v  <--  dir/file2
23354new revision: 1\.4; previous revision: 1\.3"
23355
23356	  # and we should get a conflict on developer 4's stuff
23357	  cd ../../4/first-dir
23358	  dotest backuprecover-20 "${testcvs} update" \
23359"${SPROG} update: Updating \.
23360RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23361retrieving revision 1\.3
23362retrieving revision 1\.4
23363Merging differences between 1\.3 and 1\.4 into file1
23364rcsmerge: warning: conflicts during merge
23365${SPROG} update: conflicts found in file1
23366C file1
23367${SPROG} update: Updating dir
23368RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
23369retrieving revision 1\.3
23370retrieving revision 1\.4
23371Merging differences between 1\.3 and 1\.4 into file2
23372rcsmerge: warning: conflicts during merge
23373${SPROG} update: conflicts found in dir/file2
23374C dir/file2"
23375	  sed -e \
23376"/^<<<<<<</,/^=======/d
23377/^>>>>>>>/d" file1 >tmp; mv tmp file1
23378	  sed -e \
23379"/^<<<<<<</,/^=======/d
23380/^>>>>>>>/d
23381s/quit and/be fired so he can/" dir/file2 >tmp; mv tmp dir/file2
23382	  dotest backuprecover-21 "${testcvs} -q ci -mrecover/merge" \
23383"$CVSROOT_DIRNAME/first-dir/dir/file2,v  <--  dir/file2
23384new revision: 1\.5; previous revision: 1\.4"
23385
23386	  # go back and commit developer 2's stuff to prove it can still be done
23387	  cd ../../2/first-dir
23388	  dotest backuprecover-22 "${testcvs} -Q update" \
23389"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
23390retrieving revision 1\.2
23391retrieving revision 1\.4
23392Merging differences between 1\.2 and 1\.4 into file1
23393RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/file2,v
23394retrieving revision 1\.2
23395retrieving revision 1\.5
23396Merging differences between 1\.2 and 1\.5 into file2"
23397	  dotest backuprecover-23 "${testcvs} -q ci -mtest" \
23398"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
23399new revision: 1\.5; previous revision: 1\.4
23400$CVSROOT_DIRNAME/first-dir/dir/file2,v  <--  dir/file2
23401new revision: 1\.6; previous revision: 1\.5"
23402
23403	  # and restore the data to developer 1
23404	  cd ../../1/first-dir
23405	  dotest backuprecover-24 "${testcvs} -Q update" ''
23406
23407	  dokeep
23408	  cd ../../..
23409	  rm -r backuprecover
23410	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
23411	  ;;
23412
23413
23414
23415        sshstdio)
23416          # CVS_RSH=ssh can have a problem with a non-blocking stdio
23417          # in some cases. So, this test is all about testing :ext:
23418          # with CVS_RSH=ssh. The problem is that not all machines
23419          # will necessarily have ssh available, so be prepared to
23420          # skip this test.
23421
23422	  if $proxy; then
23423            notproxy sshstdio
23424	    continue
23425	  fi
23426
23427          if $remote; then :; else
23428            remoteonly sshstdio
23429	    continue
23430	  fi
23431
23432	  require_ssh
23433	  if test $? -eq 77; then
23434            skip sshstdio "$skipreason"
23435	    continue
23436	  fi
23437
23438	  SSHSTDIO_ROOT=:ext:$host$CVSROOT_DIRNAME
23439
23440          mkdir sshstdio; cd sshstdio
23441          dotest sshstdio-1 "$testcvs -d $SSHSTDIO_ROOT -q co -l ."
23442          mkdir first-dir
23443          dotest sshstdio-2 "$testcvs add first-dir" \
23444  "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
23445          cd first-dir
23446          a='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
23447          c='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
23448          # Generate 1024 lines of $a
23449          cnt=0
23450          echo $a > aaa
23451          while [ $cnt -lt 5 ] ; do
23452            cnt=`expr $cnt + 1` ;
23453            mv aaa aaa.old
23454            cat aaa.old aaa.old aaa.old aaa.old > aaa
23455          done
23456          dotest sshstdio-3 "$testcvs -q add aaa" \
23457"$SPROG add: use .$SPROG commit. to add this file permanently"
23458          dotest sshstdio-4 "$testcvs -q ci -mcreate aaa" \
23459"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
23460initial revision: 1\.1"
23461          # replace lines 1, 512, 513, 1024 with $c
23462          sed 510q < aaa > aaa.old
23463          (echo $c; cat aaa.old; echo $c; \
23464           echo $c; cat aaa.old; echo $c) > aaa
23465          dotest sshstdio-5 "$testcvs -q ci -mmodify-it aaa" \
23466"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
23467new revision: 1\.2; previous revision: 1\.1"
23468          cat > wrapper.sh <<EOF
23469#!$TESTSHELL
23470exec "\$@" 2>&1 < /dev/null | cat
23471EOF
23472          chmod +x wrapper.sh
23473          ./wrapper.sh \
23474           $testcvs -z5 -Q diff --side-by-side -W 500 -r 1.1 -r 1.2 \
23475             aaa > wrapper.dif
23476
23477          $testcvs -z5 -Q diff --side-by-side -W 500 -r 1.1 -r 1.2 \
23478             aaa > good.dif
23479
23480          dotest sshstdio-6 "cmp wrapper.dif good.dif"
23481
23482	  dokeep
23483          cd ../..
23484          CVS_RSH=$save_CVS_RSH; export CVS_RSH
23485          rm -r sshstdio
23486          rm -rf $CVSROOT_DIRNAME/first-dir
23487          ;;
23488
23489
23490
23491	parseroot2)
23492	  # Test some :ext: roots for consistancy.
23493	  if $remote; then :; else
23494	    remoteonly parseroot2
23495	    continue
23496	  fi
23497
23498	  require_rsh "$CVS_RSH"
23499	  if test $? -eq 77; then
23500	    skip parseroot2 "$skipreason"
23501	    continue
23502	  fi
23503
23504	  # Test checking out and subsequently updating with some different
23505	  # CVSROOTs.
23506
23507	  # A standard case, hostname:dirname.
23508	  mkdir parseroot2; cd parseroot2
23509	  save_CVSROOT=$CVSROOT
23510	  CVSROOT=$host:$CVSROOT_DIRNAME
23511	  dotest parseroot2-1 "$testcvs -Q co CVSROOT"
23512	  cd CVSROOT
23513	  dotest parseroot2-2 "$testcvs -Q up"
23514	  cd ..
23515
23516	  # A degenerate remote case, just the server name and the directory
23517	  # name, with no :'s to help parsing.  It can be mistaken for a
23518	  # relative directory name.
23519	  rm -r CVSROOT
23520	  CVSROOT=$host$CVSROOT_DIRNAME
23521	  dotest parseroot2-3 "$testcvs -Q co CVSROOT"
23522	  cd CVSROOT
23523	  dotest parseroot2-4 "$testcvs -Q up"
23524
23525	  dokeep
23526	  cd ../..
23527	  CVSROOT=$save_CVSROOT
23528	  rm -r parseroot2
23529	  ;;
23530
23531
23532
23533	parseroot3)
23534	  # Test some :ext: roots for consistancy.
23535	  if $remote; then :; else
23536	    remoteonly parseroot3
23537	    continue
23538	  fi
23539
23540	  require_rsh "$CVS_RSH"
23541	  if test $? -eq 77; then
23542	    skip parseroot3 "$skipreason"
23543	    continue
23544	  fi
23545
23546	  # Test checking out and subsequently updating with some different
23547	  # CVSROOTs.
23548
23549	  # A standard case, hostname:dirname.
23550	  mkdir parseroot3; cd parseroot3
23551	  save_CVSROOT=$CVSROOT
23552	  save_CVS_RSH=$CVS_RSH
23553	  save_CVS_SERVER=$CVS_SERVER
23554	  unset CVS_RSH
23555	  unset CVS_SERVER
23556	  CVSROOT=":ext;CVS_RSH=$save_CVS_RSH;CVS_SERVER=$save_CVS_SERVER:$host:$CVSROOT_DIRNAME"
23557	  dotest parseroot3-1 "$testcvs -Q co CVSROOT"
23558	  cd CVSROOT
23559	  dotest parseroot3-2 "$testcvs -Q up"
23560	  cd ..
23561
23562	  # Initial checkout.
23563	  rm -r CVSROOT
23564	  CVSROOT=":ext;cvs_RSH=$save_CVS_RSH;CVS_Server=$save_CVS_SERVER:$host$CVSROOT_DIRNAME"
23565	  dotest parseroot3-3 "$testcvs -Q co CVSROOT"
23566	  cd CVSROOT
23567	  dotest parseroot3-4 "$testcvs -Q up"
23568	  cd ..
23569
23570	  # Checkout bogus values for Redirect
23571	  rm -r CVSROOT
23572	  CVSROOT=":ext;Redirect=bogus;CVS_RSH=$save_CVS_RSH;CVS_SERVER=$save_CVS_SERVER:$host$CVSROOT_DIRNAME"
23573	  dotest parseroot3-5 "$testcvs -Q co CVSROOT" \
23574"$SPROG checkout: CVSROOT: unrecognized value \`bogus' for \`Redirect'"
23575	  cd CVSROOT
23576	  # FIXCVS: parse_cvsroot is called more often that is
23577	  # desirable.
23578	  dotest parseroot3-6 "$testcvs -Q up" \
23579"$SPROG update: CVSROOT: unrecognized value \`bogus' for \`Redirect'"
23580	  cd ..
23581
23582	  # Checkout good values for Redirect
23583	  rm -r CVSROOT
23584	  CVSROOT=":EXT;Redirect=no;CVS_RSH=$save_CVS_RSH;CVS_SERVER=$save_CVS_SERVER:$host$CVSROOT_DIRNAME"
23585	  dotest parseroot3-7 "$testcvs -Q co CVSROOT"
23586	  cd CVSROOT
23587	  dotest parseroot3-8 "$testcvs -Q up"
23588	  cd ..
23589
23590	  dotest parseroot3-9 "$testcvs -Q co -ldtop ."
23591	  dotest parseroot3-10 "test -d top"
23592	  dotest parseroot3-11 "test -d top/CVS"
23593	  dotest parseroot3-10 "cat top/CVS/Root" "$CVSROOT"
23594
23595	  dokeep
23596	  cd ..
23597	  CVSROOT=$save_CVSROOT
23598	  CVS_RSH=$save_CVS_RSH
23599	  CVS_SERVER=$save_CVS_SERVER
23600	  export CVS_RSH CVS_SERVER
23601	  rm -r parseroot3
23602	  ;;
23603
23604
23605
23606	history)
23607	  # CVSROOT/history tests:
23608	  # history: various "cvs history" invocations
23609	  # basic2: Generating the CVSROOT/history file via CVS commands.
23610
23611	  # Put in some data for the history file (discarding what was
23612	  # there before).  Note that this file format is fixed; the
23613	  # user may wish to analyze data from a previous version of
23614	  # CVS.  If we phase out this format, it should be done
23615	  # slowly and carefully.
23616
23617	  if $proxy; then
23618	    # don't even try
23619	    continue
23620	  fi
23621
23622	  cat <<EOF >$CVSROOT_DIRNAME/CVSROOT/history
23623O3395c677|anonymous|<remote>/*0|ccvs||ccvs
23624O3396c677|anonymous|<remote>/src|ccvs||src
23625O3397c677|kingdon|<remote>/*0|ccvs||ccvs
23626M339cafae|nk|<remote>|ccvs/src|1.229|sanity.sh
23627M339cafff|anonymous|<remote>|ccvs/src|1.23|Makefile
23628M339dc339|kingdon|~/work/*0|ccvs/src|1.231|sanity.sh
23629W33a6eada|anonymous|<remote>*4|ccvs/emx||Makefile.in
23630C3b235f50|kingdon|<remote>|ccvs/emx|1.3|README
23631M3b23af50|kingdon|~/work/*0|ccvs/doc|1.281|cvs.texinfo
23632EOF
23633
23634	  dotest history-1 "${testcvs} history -e -a" \
23635"O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs     =ccvs= <remote>/\*
23636O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs     =src=  <remote>/\*
23637M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23  Makefile    ccvs/src == <remote>
23638W 1997-06-17 19:51 ${PLUS}0000 anonymous       Makefile\.in ccvs/emx == <remote>/emx
23639O 1997-06-06 08:12 ${PLUS}0000 kingdon   ccvs     =ccvs= <remote>/\*
23640M 1997-06-10 21:12 ${PLUS}0000 kingdon   1\.231 sanity\.sh   ccvs/src == ~/work/ccvs/src
23641C 2001-06-10 11:51 ${PLUS}0000 kingdon   1\.3   README      ccvs/emx == <remote>
23642M 2001-06-10 17:33 ${PLUS}0000 kingdon   1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc
23643M 1997-06-10 01:36 ${PLUS}0000 nk        1\.229 sanity\.sh   ccvs/src == <remote>"
23644
23645	  dotest history-2 "${testcvs} history -e -a -D '10 Jun 1997 13:00 UT'" \
23646"W 1997-06-17 19:51 ${PLUS}0000 anonymous       Makefile\.in ccvs/emx == <remote>/emx
23647M 1997-06-10 21:12 ${PLUS}0000 kingdon   1\.231 sanity\.sh   ccvs/src == ~/work/ccvs/src
23648C 2001-06-10 11:51 ${PLUS}0000 kingdon   1\.3   README      ccvs/emx == <remote>
23649M 2001-06-10 17:33 ${PLUS}0000 kingdon   1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc"
23650
23651	  dotest history-3 "${testcvs} history -e -a -D '10 Jun 2001 13:00 UT'" \
23652"M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc"
23653
23654	  dotest history-4 "${testcvs} history -ac sanity.sh" \
23655"M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
23656M 1997-06-10 01:36 ${PLUS}0000 nk      1\.229 sanity\.sh ccvs/src == <remote>"
23657
23658	  dotest history-5 "${testcvs} history -a -xCGUWAMR README sanity.sh" \
23659"M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
23660C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3   README    ccvs/emx == <remote>
23661M 1997-06-10 01:36 ${PLUS}0000 nk      1\.229 sanity\.sh ccvs/src == <remote>"
23662
23663	  dotest history-6 "${testcvs} history -xCGUWAMR -a -f README -f sanity.sh" \
23664"M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
23665C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3   README    ccvs/emx == <remote>
23666M 1997-06-10 01:36 ${PLUS}0000 nk      1\.229 sanity\.sh ccvs/src == <remote>"
23667
23668	  dotest history-7 "${testcvs} history -xCGUWAMR -a -f sanity.sh README" \
23669"M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
23670C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3   README    ccvs/emx == <remote>
23671M 1997-06-10 01:36 ${PLUS}0000 nk      1\.229 sanity\.sh ccvs/src == <remote>"
23672
23673	  dotest history-8 "${testcvs} history -ca -D '1970-01-01 00:00 UT'" \
23674"M 1997-06-10 01:36 ${PLUS}0000 nk        1\.229 sanity.sh   ccvs/src == <remote>
23675M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23  Makefile    ccvs/src == <remote>
23676M 1997-06-10 21:12 ${PLUS}0000 kingdon   1\.231 sanity.sh   ccvs/src == ~/work/ccvs/src
23677M 2001-06-10 17:33 ${PLUS}0000 kingdon   1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc"
23678
23679	  dotest history-9 "${testcvs} history -acl" \
23680"M 2001-06-10 17:33 ${PLUS}0000 kingdon   1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc
23681M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23  Makefile    ccvs/src == <remote>
23682M 1997-06-10 21:12 ${PLUS}0000 kingdon   1\.231 sanity.sh   ccvs/src == ~/work/ccvs/src"
23683
23684	  dotest history-10 "${testcvs} history -lca -D '1970-01-01 00:00 UT'" \
23685"M 2001-06-10 17:33 ${PLUS}0000 kingdon   1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc
23686M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23  Makefile    ccvs/src == <remote>
23687M 1997-06-10 21:12 ${PLUS}0000 kingdon   1\.231 sanity.sh   ccvs/src == ~/work/ccvs/src"
23688
23689	  dotest history-11 "${testcvs} history -aw" \
23690"O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
23691O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src=  <remote>/\*
23692O 1997-06-06 08:12 ${PLUS}0000 kingdon   ccvs =ccvs= <remote>/\*"
23693
23694	  dotest history-12 "${testcvs} history -aw -D'1970-01-01 00:00 UT'" \
23695"O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
23696O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src=  <remote>/\*
23697O 1997-06-06 08:12 ${PLUS}0000 kingdon   ccvs =ccvs= <remote>/\*"
23698	  ;;
23699
23700
23701
23702	big)
23703
23704	  # Test ability to operate on big files.  Intention is to
23705	  # test various realloc'ing code in RCS_deltas, rcsgetkey,
23706	  # etc.  "big" is currently defined to be 1000 lines (64000
23707	  # bytes), which in terms of files that users will use is not
23708	  # large, merely average, but my reasoning is that this
23709	  # should be big enough to make sure realloc'ing is going on
23710	  # and that raising it a lot would start to stress resources
23711	  # on machines which run the tests, without any significant
23712	  # benefit.
23713
23714	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
23715	  dotest big-1 "$testcvs -q co first-dir"
23716	  cd first-dir
23717	  for i in 0 1 2 3 4 5 6 7 8 9; do
23718	    for j in 0 1 2 3 4 5 6 7 8 9; do
23719	      for k in 0 1 2 3 4 5 6 7 8 9; do
23720		echo \
23721"This is line ($i,$j,$k) which goes into the file file1 for testing" >>file1
23722	      done
23723	    done
23724	  done
23725	  dotest big-2 "$testcvs add file1" \
23726"$SPROG add: scheduling file .file1. for addition
23727$SPROG add: use .$SPROG commit. to add this file permanently"
23728	  dotest big-3 "$testcvs -q ci -m add" \
23729"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
23730initial revision: 1\.1"
23731	  cd ..
23732	  mkdir 2
23733	  cd 2
23734	  dotest big-4 "$testcvs -q get first-dir" "U first-dir/file1"
23735	  cd ../first-dir
23736	  echo "add a line to the end" >>file1
23737
23738	  dotest_fail big-4b "$testcvs -q diff -u" \
23739"Index: file1
23740===================================================================
23741RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
23742retrieving revision 1\.1
23743diff -u -r1\.1 file1
23744--- file1	$RFCDATE	1\.1
23745$PLUS$PLUS$PLUS file1	$RFCDATE
23746@@ -998,3 ${PLUS}998,4 @@
23747 This is line (9,9,7) which goes into the file file1 for testing
23748 This is line (9,9,8) which goes into the file file1 for testing
23749 This is line (9,9,9) which goes into the file file1 for testing
23750${PLUS}add a line to the end"
23751
23752	  dotest big-5 "$testcvs -q ci -m modify" \
23753"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
23754new revision: 1\.2; previous revision: 1\.1"
23755	  cd ../2/first-dir
23756	  # The idea here is particularly to test the Rcs-diff response
23757	  # and the reallocing thereof, for remote.
23758	  dotest big-6 "$testcvs -q update" "[UP] file1"
23759
23760	  dokeep
23761	  cd ../..
23762	  rm -r first-dir 2
23763	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
23764	  ;;
23765
23766
23767
23768	modes)
23769	  # Test repository permissions (CVSUMASK and so on).
23770	  # Although the tests in this section "cheat" by testing
23771	  # repository permissions, which are sort of not a user-visible
23772	  # sort of thing, the modes do have user-visible consequences,
23773	  # such as whether a second user can check out the files.  But
23774	  # it would be awkward to test the consequences, so we don't.
23775
23776	  # Solaris /bin/sh doesn't support export -n.  I'm not sure
23777	  # what we can do about this, other than hope that whoever
23778	  # is running the tests doesn't have CVSUMASK set.
23779	  #export -n CVSUMASK # if unset, defaults to 002
23780
23781	  save_umask=`umask`
23782	  umask 077
23783	  mkdir 1; cd 1
23784	  dotest modes-1 "${testcvs} -q co -l ." ''
23785	  mkdir first-dir
23786	  dotest modes-2 "${testcvs} add first-dir" \
23787"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
23788	  cd first-dir
23789	  touch aa
23790	  dotest modes-3 "${testcvs} add aa" \
23791"${SPROG} add: scheduling file .aa. for addition
23792${SPROG} add: use .${SPROG} commit. to add this file permanently"
23793	  dotest modes-4 "${testcvs} -q ci -m add" \
23794"$CVSROOT_DIRNAME/first-dir/aa,v  <--  aa
23795initial revision: 1\.1"
23796	  # Yawn.  Cygwin.
23797	  if test -n "$remotehost"; then
23798	    dotest modes-5remotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v'" \
23799"-r--r--r-- .*"
23800	  else
23801	    dotest modes-5 "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
23802"-r--r--r-- .*"
23803	  fi
23804
23805	  # Test for whether we can set the execute bit.
23806	  chmod +x aa
23807	  echo change it >>aa
23808	  dotest modes-6 "${testcvs} -q ci -m set-execute-bit" \
23809"$CVSROOT_DIRNAME/first-dir/aa,v  <--  aa
23810new revision: 1\.2; previous revision: 1\.1"
23811	  # If CVS let us update the execute bit, it would be set here.
23812	  # But it doesn't, and as far as I know that is longstanding
23813	  # CVS behavior.
23814	  #
23815	  # Yeah, yeah.  Search for "Cygwin".
23816	  if test -n "$remotehost"; then
23817	    dotest modes-7remotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v'" \
23818"-r--r--r-- .*"
23819	  else
23820	    dotest modes-7 "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
23821"-r--r--r-- .*"
23822	  fi
23823
23824	  # OK, now manually change the modes and see what happens.
23825	  #
23826	  # Cygwin, already.
23827	  if test -n "$remotehost"; then
23828	    $CVS_RSH $remotehost "chmod g=r,o= ${CVSROOT_DIRNAME}/first-dir/aa,v"
23829	  else
23830	    chmod g=r,o= ${CVSROOT_DIRNAME}/first-dir/aa,v
23831	  fi
23832	  echo second line >>aa
23833	  dotest modes-7a "${testcvs} -q ci -m set-execute-bit" \
23834"$CVSROOT_DIRNAME/first-dir/aa,v  <--  aa
23835new revision: 1\.3; previous revision: 1\.2"
23836	  # Cygwin.
23837	  if test -n "$remotehost"; then
23838	    dotest modes-7bremotehost "$CVS_RSH $remotehost 'ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v'" \
23839"-r--r----- .*"
23840	  else
23841	    dotest modes-7b "ls -l ${CVSROOT_DIRNAME}/first-dir/aa,v" \
23842"-r--r----- .*"
23843	  fi
23844
23845	  CVSUMASK=007
23846	  export CVSUMASK
23847	  touch ab
23848	  # Might as well test the execute bit too.
23849	  chmod +x ab
23850	  dotest modes-8 "$testcvs add ab" \
23851"$SPROG add: scheduling file .ab. for addition
23852$SPROG add: use .$SPROG commit. to add this file permanently"
23853	  dotest modes-9 "$testcvs -q ci -m add" \
23854"$CVSROOT_DIRNAME/first-dir/ab,v  <--  ab
23855initial revision: 1\.1"
23856
23857	  # The ssh-wrapper script set up by this script forwards CVSUMASK to
23858	  # the server.  In practice it would be set on the server in some
23859	  # other manner (for instance, by the `env' command, or as an option
23860	  # in the xinted.conf file).
23861	  #
23862	  # I don't recall why, but I used to look for:
23863	  #
23864	  #   dotest modes-10remotehost \
23865	  #   "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/ab,v'" \
23866	  #   "-r--r--r--.*"
23867	  #
23868	  # here when $remotehost was set.  I'm not sure why.  Maybe this was
23869	  # one of the innumerable Cygwin issues?
23870	  dotest modes-10 "ls -l $CVSROOT_DIRNAME/first-dir/ab,v" \
23871"-r-xr-x---.*"
23872
23873	  # OK, now add a file on a branch.  Check that the mode gets
23874	  # set the same way (it is a different code path in CVS).
23875	  dotest modes-11 "${testcvs} -q tag -b br" 'T aa
23876T ab'
23877	  dotest modes-12 "${testcvs} -q update -r br" ''
23878	  touch ac
23879	  dotest modes-13 "${testcvs} add ac" \
23880"${SPROG} add: scheduling file .ac. for addition on branch .br.
23881${SPROG} add: use .${SPROG} commit. to add this file permanently"
23882	  # Not sure it really makes sense to refer to a "previous revision"
23883	  # when we are just now adding the file; as far as I know
23884	  # that is longstanding CVS behavior, for what it's worth.
23885	  dotest modes-14 "${testcvs} -q ci -m add" \
23886"$CVSROOT_DIRNAME/first-dir/Attic/ac,v  <--  ac
23887new revision: 1\.1\.2\.1; previous revision: 1\.1"
23888
23889	  # ssh-wrapper forwards CVSUMASK.  See modes-10 for notes.
23890	  dotest modes-15 \
23891"ls -l ${CVSROOT_DIRNAME}/first-dir/Attic/ac,v" \
23892"-r--r-----.*"
23893
23894	  dokeep
23895	  cd ../..
23896	  # Restore umask.
23897	  umask $save_umask
23898	  rm -r 1
23899	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
23900	  ;;
23901
23902
23903
23904	modes2)
23905	  # More tests of file permissions in the working directory
23906	  # and that sort of thing.
23907
23908	  # The usual setup, file first-dir/aa with two revisions.
23909	  mkdir 1; cd 1
23910	  dotest modes2-1 "${testcvs} -q co -l ." ''
23911	  mkdir first-dir
23912	  dotest modes2-2 "${testcvs} add first-dir" \
23913"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
23914	  cd first-dir
23915	  touch aa
23916	  dotest modes2-3 "${testcvs} add aa" \
23917"${SPROG} add: scheduling file .aa. for addition
23918${SPROG} add: use .${SPROG} commit. to add this file permanently"
23919	  dotest modes2-4 "${testcvs} -q ci -m add" \
23920"$CVSROOT_DIRNAME/first-dir/aa,v  <--  aa
23921initial revision: 1\.1"
23922	  echo "more money" >> aa
23923	  dotest modes2-5 "${testcvs} -q ci -m add" \
23924"$CVSROOT_DIRNAME/first-dir/aa,v  <--  aa
23925new revision: 1\.2; previous revision: 1\.1"
23926
23927	  # OK, here is the test.  The idea is to see what
23928	  # No_Difference does if it can't open the file.
23929	  # If we don't change the st_mtime, CVS doesn't even try to read
23930	  # the file.  Note that some versions of "touch" require that we
23931	  # do this while the file is still writable.
23932	  touch aa
23933	  chmod a= aa
23934	  # Don't try this when permissions are broken, as with Cygwin.
23935	  if ${LS} ${CVSROOT_DIRNAME}/first-dir >/dev/null 2>&1; then :; else
23936	    dotest_fail modes2-6 "${testcvs} -q update -r 1.1 aa" \
23937"${CPROG} \[update aborted\]: cannot open file aa for comparing: Permission denied" \
23938"${CPROG} \[update aborted\]: reading aa: Permission denied"
23939	  fi
23940
23941	  dokeep
23942	  chmod u+rwx aa
23943	  cd ../..
23944	  rm -r 1
23945	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
23946	  ;;
23947
23948
23949
23950	modes3)
23951	  # Repository permissions.  Particularly, what happens if we
23952	  # can't read/write in the repository.
23953	  # TODO: the case where we can access the repository, just not
23954	  # the attic (may that one can remain a fatal error, seems less
23955	  # useful for access control).
23956	  mkdir 1; cd 1
23957	  dotest modes3-1 "$testcvs -q co -l ."
23958	  mkdir first-dir second-dir
23959	  dotest modes3-2 "${testcvs} add first-dir second-dir" \
23960"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
23961Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
23962	  touch first-dir/aa second-dir/ab
23963	  dotest modes3-3 "${testcvs} add first-dir/aa second-dir/ab" \
23964"${SPROG} add: scheduling file .first-dir/aa. for addition
23965${SPROG} add: scheduling file .second-dir/ab. for addition
23966${SPROG} add: use .${SPROG} commit. to add these files permanently"
23967	  dotest modes3-4 "${testcvs} -q ci -m add" \
23968"$CVSROOT_DIRNAME/first-dir/aa,v  <--  first-dir/aa
23969initial revision: 1\.1
23970$CVSROOT_DIRNAME/second-dir/ab,v  <--  second-dir/ab
23971initial revision: 1\.1"
23972	  # quiet down this one as it will be noisy in proxy mode
23973	  modify_repo chmod a= $CVSROOT_DIRNAME/first-dir >/dev/null 2>&1
23974	  if ${LS} ${CVSROOT_DIRNAME}/first-dir >/dev/null 2>&1; then
23975	    # Avoid this test under Cygwin since permissions work differently
23976	    # there.
23977	    #
23978	    # This test also gets avoided under Mac OS X since the system `ls'
23979	    # is broken and exits with a 0 status despite the permission
23980	    # denied error.
23981	    if test -n "$remotehost"; then
23982	      cygwin_hack=false
23983	    else
23984	      cygwin_hack=:
23985	    fi
23986	  else
23987	    cygwin_hack=false
23988	  fi
23989
23990	  cd $TESTDIR/1
23991	  if $cygwin_hack; then :; else
23992	    dotest modes3-5 "${testcvs} update" \
23993"${SPROG} update: Updating \.
23994${SPROG} update: Updating first-dir
23995${SPROG} update: cannot open directory ${CVSROOT_DIRNAME}/first-dir: Permission denied
23996${SPROG} update: skipping directory first-dir
23997${SPROG} update: Updating second-dir"
23998	  fi
23999
24000	  # OK, I can see why one might say the above case could be a
24001	  # fatal error, because normally users without access to first-dir
24002	  # won't have it in their working directory.  But the next
24003	  # one is more of a problem if it is fatal.
24004	  #
24005	  # The second text string below is for Cygwin again, and again it
24006	  # should really be XFAIL under Cygwin, but for now deal with the
24007	  # passing opendir by accepting the alternate string.
24008	  rm -r first-dir
24009	  dotest modes3-6 "${testcvs} update -dP" \
24010"${SPROG} update: Updating .
24011${SPROG} update: Updating CVSROOT
24012U ${DOTSTAR}
24013${SPROG} update: Updating first-dir
24014${SPROG} update: cannot open directory ${CVSROOT_DIRNAME}/first-dir: Permission denied
24015${SPROG} update: skipping directory first-dir
24016${SPROG} update: Updating second-dir" \
24017"${SPROG} update: Updating .
24018${SPROG} update: Updating CVSROOT
24019U ${DOTSTAR}
24020${SPROG} update: Updating first-dir
24021${SPROG} update: Updating second-dir"
24022
24023	  dokeep
24024	  cd ..
24025	  rm -r 1
24026	  # quiet down this one as it will be noisy in proxy mode
24027	  modify_repo chmod u+rwx $CVSROOT_DIRNAME/first-dir 2>/dev/null
24028	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir \
24029			     $CVSROOT_DIRNAME/second-dir
24030	  ;;
24031
24032
24033
24034	stamps)
24035	  # Test timestamps.
24036	  mkdir 1; cd 1
24037	  dotest stamps-1 "${testcvs} -q co -l ." ''
24038	  mkdir first-dir
24039	  dotest stamps-2 "${testcvs} add first-dir" \
24040"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
24041	  cd first-dir
24042	  touch aa
24043	  echo '$''Id$' >kw
24044	  # Cygwin, *cough*, puts the year in the time column until the minute
24045	  # is no longer the current minute.  Sleep 60 seconds to avoid this
24046	  # problem.
24047	  sleep 60
24048	  ls -l aa >${TESTDIR}/1/stamp.aa.touch
24049	  ls -l kw >${TESTDIR}/1/stamp.kw.touch
24050	  # "sleep 1" would suffice if we could assume ls --full-time, but
24051	  # that is as far as I know unique to GNU ls.  Is there some POSIX.2
24052	  # way to get the timestamp of a file, including the seconds?
24053	  sleep 60
24054	  dotest stamps-3 "${testcvs} add aa kw" \
24055"${SPROG} add: scheduling file .aa. for addition
24056${SPROG} add: scheduling file .kw. for addition
24057${SPROG} add: use .${SPROG} commit. to add these files permanently"
24058	  ls -l aa >${TESTDIR}/1/stamp.aa.add
24059	  ls -l kw >${TESTDIR}/1/stamp.kw.add
24060	  # "cvs add" should not muck with the timestamp.
24061	  dotest stamps-4aa \
24062"cmp ${TESTDIR}/1/stamp.aa.touch ${TESTDIR}/1/stamp.aa.add" ''
24063	  dotest stamps-4kw \
24064"cmp ${TESTDIR}/1/stamp.kw.touch ${TESTDIR}/1/stamp.kw.add" ''
24065	  sleep 60
24066	  dotest stamps-5 "${testcvs} -q ci -m add" \
24067"$CVSROOT_DIRNAME/first-dir/aa,v  <--  aa
24068initial revision: 1\.1
24069$CVSROOT_DIRNAME/first-dir/kw,v  <--  kw
24070initial revision: 1\.1"
24071	  # Cygwin, *cough*, puts the year in the time column until the minute
24072	  # is no longer the current minute.  Sleep 60 seconds to avoid this
24073	  # problem.
24074	  sleep 60
24075	  ls -l aa >${TESTDIR}/1/stamp.aa.ci
24076	  ls -l kw >${TESTDIR}/1/stamp.kw.ci
24077	  # If there are no keywords, "cvs ci" leaves the timestamp alone
24078	  # If there are, it sets the timestamp to the date of the commit.
24079	  # I'm not sure how logical this is, but it is intentional.
24080	  # If we wanted to get fancy we would make sure the time as
24081	  # reported in "cvs log kw" matched stamp.kw.ci.  But that would
24082	  # be a lot of work.
24083	  dotest stamps-6aa \
24084	    "cmp ${TESTDIR}/1/stamp.aa.add ${TESTDIR}/1/stamp.aa.ci" ''
24085	  if cmp ${TESTDIR}/1/stamp.kw.add ${TESTDIR}/1/stamp.kw.ci >/dev/null
24086	  then
24087	    fail stamps-6kw
24088	  else
24089	    pass stamps-6kw
24090	  fi
24091	  cd ../..
24092	  sleep 60
24093	  mkdir 2
24094	  cd 2
24095	  dotest stamps-7 "${testcvs} -q get first-dir" "U first-dir/aa
24096U first-dir/kw"
24097	  cd first-dir
24098	  ls -l aa >${TESTDIR}/1/stamp.aa.get
24099	  ls -l kw >${TESTDIR}/1/stamp.kw.get
24100	  # On checkout, CVS should set the timestamp to the date that the
24101	  # file was committed.  Could check that the time as reported in
24102	  # "cvs log aa" matches stamp.aa.get, but that would be a lot of
24103	  # work.
24104	  dotest_fail stamps-8aa \
24105"cmp $TESTDIR/1/stamp.aa.ci $TESTDIR/1/stamp.aa.get >/dev/null"
24106	  dotest stamps-8kw \
24107"cmp $TESTDIR/1/stamp.kw.ci $TESTDIR/1/stamp.kw.get"
24108
24109	  # Now we want to see what "cvs update" does.
24110	  sleep 60
24111	  echo add a line >>aa
24112	  echo add a line >>kw
24113	  dotest stamps-9 "${testcvs} -q ci -m change-them" \
24114"$CVSROOT_DIRNAME/first-dir/aa,v  <--  aa
24115new revision: 1\.2; previous revision: 1\.1
24116$CVSROOT_DIRNAME/first-dir/kw,v  <--  kw
24117new revision: 1\.2; previous revision: 1\.1"
24118
24119	  # Cygwin, *cough*, puts the year in the time column until the minute
24120	  # is no longer the current minute.  Sleep 60 seconds to avoid this
24121	  # problem.
24122	  sleep 60
24123	  ls -l aa >${TESTDIR}/1/stamp.aa.ci2
24124	  ls -l kw >${TESTDIR}/1/stamp.kw.ci2
24125	  cd ../..
24126	  cd 1/first-dir
24127	  sleep 60
24128	  dotest stamps-10 "${testcvs} -q update" '[UP] aa
24129[UP] kw'
24130	  # this doesn't serve any function other than being able to
24131	  # look at it manually, as we have no machinery for dates being
24132	  # newer or older than other dates.
24133	  date >$TESTDIR/1/stamp.debug.update
24134	  ls -l aa >$TESTDIR/1/stamp.aa.update
24135	  ls -l kw >$TESTDIR/1/stamp.kw.update
24136	  # stamp.aa.update and stamp.kw.update should both be approximately
24137	  # the same as stamp.debug.update.  Perhaps we could be testing
24138	  # this in a more fancy fashion by "touch stamp.before" before
24139	  # stamps-10, "touch stamp.after" after, and then using ls -t
24140	  # to check them.  But for now we just make sure that the *.update
24141	  # stamps differ from the *.ci2 ones.
24142	  # As for the rationale, this is so that if one updates and gets
24143	  # a new revision, then "make" will be sure to regard those files
24144	  # as newer than .o files which may be sitting around.
24145	  dotest_fail stamps-11aa \
24146"cmp $TESTDIR/1/stamp.aa.update $TESTDIR/1/stamp.aa.ci2 >/dev/null"
24147	  dotest_fail stamps-11kw \
24148"cmp $TESTDIR/1/stamp.kw.update $TESTDIR/1/stamp.kw.ci2 >/dev/null"
24149
24150	  dokeep
24151	  cd ../..
24152	  rm -r 1 2
24153	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
24154	  ;;
24155
24156
24157
24158	perms)
24159	  mkdir 1; cd 1
24160	  dotest perms-init-1 "$testcvs -Q co CVSROOT"
24161	  cd CVSROOT
24162	  echo 'PreservePermissions=yes' >> ${CVSROOT_DIRNAME}/CVSROOT/config
24163	  dotest perms-init-2 "$testcvs -Q ci -mperms"
24164	  cd ..
24165
24166	  dotest perms-1 "$testcvs -q co -l ."
24167	  mkdir first-dir
24168	  dotest perms-2 "${testcvs} add first-dir" \
24169"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
24170	  cd first-dir
24171
24172	  touch foo
24173	  chmod 431 foo
24174	  dotest perms-3 "${testcvs} add foo" \
24175"${SPROG} add: scheduling file .foo. for addition
24176${SPROG} add: use .${SPROG} commit. to add this file permanently"
24177	  dotest perms-4 "${testcvs} -q ci -m ''" \
24178"$CVSROOT_DIRNAME/first-dir/foo,v  <--  foo
24179initial revision: 1\.1"
24180
24181	  # Test checking out files with different permissions.
24182	  cd ../..
24183	  mkdir 2; cd 2
24184	  dotest perms-5 "${testcvs} -q co first-dir" "U first-dir/foo"
24185	  cd first-dir
24186	  if $remote; then :; else
24187	    # PreservePermissions not yet implemented for remote.
24188	    dotest perms-6 "ls -l foo" "-r---wx--x .* foo"
24189	  fi
24190
24191	  dokeep
24192	  cd ../1/CVSROOT
24193	  restore_adm
24194	  cd ../..
24195	  rm -rf 1 2
24196	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
24197	  ;;
24198
24199
24200
24201	symlinks)
24202	  # short cut around checking out and committing CVSROOT
24203	  rm -f $CVSROOT_DIRNAME/CVSROOT/config
24204	  echo 'PreservePermissions=yes' >> $CVSROOT_DIRNAME/CVSROOT/config
24205	  chmod 444 $CVSROOT_DIRNAME/CVSROOT/config
24206
24207	  mkdir 1; cd 1
24208	  dotest symlinks-1 "$testcvs -q co -l ."
24209	  mkdir first-dir
24210	  dotest symlinks-2 "$testcvs add first-dir" \
24211"Directory $CVSROOT_DIRNAME/first-dir added to the repository"
24212	  cd first-dir
24213
24214	  dotest symlinks-2.1 "ln -s $TESTDIR/fumble slink"
24215	  dotest symlinks-3 "$testcvs add slink" \
24216"$SPROG add: scheduling file .slink. for addition
24217$SPROG add: use .$SPROG commit. to add this file permanently"
24218	  if $remote; then
24219	    # Remote doesn't implement PreservePermissions, and in its
24220	    # absence the correct behavior is to follow the symlink.
24221	    dotest_fail symlinks-4r "$testcvs -q ci -m ''" \
24222"$SPROG \[commit aborted\]: reading slink: No such file or directory"
24223	  else
24224	    dotest symlinks-4 "$testcvs -q ci -m ''" \
24225"$CVSROOT_DIRNAME/first-dir/slink,v  <--  slink
24226initial revision: 1\.1"
24227
24228	    # Test checking out symbolic links.
24229	    cd ../..
24230	    mkdir 2; cd 2
24231	    dotest symlinks-5 "$testcvs -q co first-dir" "U first-dir/slink"
24232	    cd first-dir
24233	    dotest symlinks-6 "ls -l slink" \
24234"l[rwx\-]* .* slink -> $TESTDIR/fumble"
24235	  fi
24236
24237	  dokeep
24238	  cd ../..
24239	  rm -rf 1 2
24240	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
24241	  restore_adm
24242	  ;;
24243
24244
24245
24246	symlinks2)
24247	  # Symlinks in working directory without PreservePermissions.
24248	  # Also see: symlinks: with PreservePermissions
24249	  # rcslib-symlink-*: symlinks in repository.
24250	  mkdir 1; cd 1
24251	  dotest symlinks2-1 "${testcvs} -q co -l ." ''
24252	  mkdir first-dir
24253	  dotest symlinks2-2 "${testcvs} add first-dir" \
24254"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
24255	  cd first-dir
24256	  echo nonsymlink > slink
24257	  dotest symlinks2-3 "${testcvs} add slink" \
24258"${SPROG} add: scheduling file .slink. for addition
24259${SPROG} add: use .${SPROG} commit. to add this file permanently"
24260	  dotest symlinks2-4 "${testcvs} -q ci -m ''" \
24261"$CVSROOT_DIRNAME/first-dir/slink,v  <--  slink
24262initial revision: 1\.1"
24263	  rm slink
24264	  # Choose name cvslog.* so it is in default ignore list.
24265	  echo second file >cvslog.file2
24266	  dotest symlinks2-5 "ln -s cvslog.file2 slink" ""
24267	  dotest symlinks2-6 "${testcvs} -q ci -m linkify" \
24268"$CVSROOT_DIRNAME/first-dir/slink,v  <--  slink
24269new revision: 1\.2; previous revision: 1\.1"
24270	  dotest symlinks2-7 "${testcvs} -q update -r 1.1 slink" "[UP] slink"
24271	  dotest symlinks2-8 "cat slink" "nonsymlink"
24272	  dotest symlinks2-9 "ls -l slink" "-[-rwx]* .* slink"
24273
24274	  dokeep
24275	  cd ../..
24276	  rm -rf 1
24277	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
24278	  ;;
24279
24280
24281
24282	hardlinks)
24283	  # short cut around checking out and committing CVSROOT
24284	  rm -f ${CVSROOT_DIRNAME}/CVSROOT/config
24285	  echo 'PreservePermissions=yes' > ${CVSROOT_DIRNAME}/CVSROOT/config
24286	  chmod 444 ${CVSROOT_DIRNAME}/CVSROOT/config
24287
24288	  mkdir 1; cd 1
24289	  dotest hardlinks-1 "${testcvs} -q co -l ." ''
24290	  mkdir first-dir
24291	  dotest hardlinks-2 "${testcvs} add first-dir" \
24292"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
24293	  cd first-dir
24294
24295	  # Make up some ugly filenames, to test that they get
24296	  # encoded properly in the delta nodes.  Note that `dotest' screws
24297	  # up if some arguments have embedded spaces.
24298	  if touch aaaa
24299	  then
24300	    pass hardlinks-2.1
24301	  else
24302	    fail hardlinks-2.1
24303	  fi
24304
24305	  if ln aaaa b.b.b.b
24306	  then
24307	    pass hardlinks-2.2
24308	  else
24309	    fail hardlinks-2.2
24310	  fi
24311
24312	  if ln aaaa 'dd dd dd'
24313	  then
24314	    pass hardlinks-2.3
24315	  else
24316	    fail hardlinks-2.3
24317	  fi
24318
24319	  dotest hardlinks-3 "${testcvs} add [abd]*" \
24320"${SPROG} add: scheduling file .aaaa. for addition
24321${SPROG} add: scheduling file .b\.b\.b\.b. for addition
24322${SPROG} add: scheduling file .dd dd dd. for addition
24323${SPROG} add: use .${SPROG} commit. to add these files permanently"
24324	  dotest hardlinks-4 "${testcvs} -q ci -m ''" \
24325"$CVSROOT_DIRNAME/first-dir/aaaa,v  <--  aaaa
24326initial revision: 1\.1
24327$CVSROOT_DIRNAME/first-dir/b\.b\.b\.b,v  <--  b\.b\.b\.b
24328initial revision: 1\.1
24329$CVSROOT_DIRNAME/first-dir/dd dd dd,v  <--  dd dd dd
24330initial revision: 1\.1"
24331	  # Test checking out hardlinked files.
24332	  cd ../..
24333	  mkdir 2; cd 2
24334	  if $remote; then
24335	    # Remote does not implement PreservePermissions.
24336	    dotest hardlinks-5r "${testcvs} -q co first-dir" \
24337"U first-dir/aaaa
24338U first-dir/b\.b\.b\.b
24339U first-dir/dd dd dd"
24340	    cd first-dir
24341	    dotest hardlinks-6r "ls -l [abd]*" \
24342"-[rwx\-]* *1 .* aaaa
24343-[rwx\-]* *1 .* b\.b\.b\.b
24344-[rwx\-]* *1 .* dd dd dd"
24345	  else
24346	    dotest hardlinks-5 "${testcvs} -q co first-dir" \
24347"U first-dir/aaaa
24348U first-dir/b\.b\.b\.b
24349U first-dir/dd dd dd"
24350	    cd first-dir
24351	    # To make sure that the files are properly hardlinked, it
24352	    # would be nice to do `ls -i' and make sure all the inodes
24353	    # match.  But I think that would require expr to support
24354	    # tagged regexps, and I don't think we can rely on that.
24355	    # So instead we just see that each file has the right
24356	    # number of links. -twp
24357	    dotest hardlinks-6 "ls -l [abd]*" \
24358"-[rwx\-]* *3 .* aaaa
24359-[rwx\-]* *3 .* b\.b\.b\.b
24360-[rwx\-]* *3 .* dd dd dd"
24361	  fi
24362
24363	  dokeep
24364	  cd ../..
24365	  rm -rf 1 2
24366	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
24367	  restore_adm
24368	  ;;
24369
24370
24371
24372	sticky)
24373	  # More tests of sticky tags, particularly non-branch sticky tags.
24374	  # See many tests (e.g. multibranch) for ordinary sticky tag
24375	  # operations such as adding files on branches.
24376	  # See "head" test for interaction between stick tags and HEAD.
24377	  mkdir 1; cd 1
24378	  dotest sticky-1 "$testcvs -q co -l ."
24379	  mkdir first-dir
24380	  dotest sticky-2 "$testcvs add first-dir" \
24381"Directory $CVSROOT_DIRNAME/first-dir added to the repository"
24382	  cd first-dir
24383
24384	  touch file1
24385	  dotest sticky-3 "$testcvs add file1" \
24386"$SPROG add: scheduling file .file1. for addition
24387$SPROG add: use .$SPROG commit. to add this file permanently"
24388	  dotest sticky-4 "$testcvs -q ci -m add" \
24389"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
24390initial revision: 1\.1"
24391	  dotest sticky-5 "$testcvs -q tag tag1" "T file1"
24392	  echo add a line >>file1
24393	  dotest sticky-6 "$testcvs -q ci -m modify" \
24394"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
24395new revision: 1\.2; previous revision: 1\.1"
24396	  dotest sticky-7 "$testcvs -q update -r tag1" "[UP] file1"
24397	  dotest sticky-8 "cat file1" ''
24398	  dotest sticky-9 "$testcvs -q update" ''
24399	  dotest sticky-10 "cat file1" ''
24400	  touch file2
24401	  dotest_fail sticky-11 "$testcvs add file2" \
24402"$SPROG add: cannot add file on non-branch tag \`tag1'"
24403	  dotest sticky-12 "$testcvs -q update -A" "[UP] file1
24404$QUESTION file2" "$QUESTION file2
24405[UP] file1"
24406	  dotest sticky-13 "${testcvs} add file2" \
24407"$SPROG add: scheduling file .file2. for addition
24408$SPROG add: use .$SPROG commit. to add this file permanently"
24409	  dotest sticky-14 "${testcvs} -q ci -m add" \
24410"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
24411initial revision: 1\.1"
24412
24413	  # Now back to tag1
24414	  dotest sticky-15 "${testcvs} -q update -r tag1" "[UP] file1
24415$SPROG update: \`file2' is no longer in the repository"
24416
24417	  rm file1
24418	  dotest sticky-16 "${testcvs} rm file1" \
24419"$SPROG remove: scheduling .file1. for removal
24420$SPROG remove: use .$SPROG commit. to remove this file permanently"
24421	  # Hmm, this command seems to silently remove the tag from
24422	  # the file.  This appears to be intentional.
24423	  # The silently part especially strikes me as odd, though.
24424	  dotest sticky-17 "$testcvs -q ci -m remove-it" ""
24425	  dotest sticky-18 "$testcvs -q update -A" "U file1
24426U file2"
24427	  dotest sticky-19 "$testcvs -q update -r tag1" \
24428"${SPROG} update: \`file1' is no longer in the repository
24429${SPROG} update: \`file2' is no longer in the repository"
24430	  dotest sticky-20 "$testcvs -q update -A" "U file1
24431U file2"
24432
24433	  # Now try with a numeric revision.
24434	  dotest sticky-21 "$testcvs -q update -r 1.1 file1" "U file1"
24435	  dotest sticky-22 "$testcvs rm -f file1" \
24436"$SPROG remove: cannot remove file .file1. which has a numeric sticky tag of .1\.1."
24437	  # The old behavior was that remove allowed this and then commit
24438	  # gave an error, which was somewhat hard to clear.  I mean, you
24439	  # could get into a long elaborate discussion of this being a
24440	  # conflict and two ways to resolve it, but I don't really see
24441	  # why CVS should have a concept of conflict that arises, not from
24442	  # parallel development, but from CVS's own sticky tags.
24443
24444	  # Ditto with a sticky date.
24445	  #
24446	  # I'm kind of surprised that the "file1 was lost" doesn't crop
24447	  # up elsewhere in the testsuite.  It is a long-standing
24448	  # discrepency between local and remote CVS and should probably
24449	  # be cleaned up at some point.
24450	  dotest sticky-23 "$testcvs -q update -Dnow file1" \
24451"$SPROG update: warning: \`file1' was lost
24452U file1" "U file1"
24453	  dotest sticky-24 "$testcvs rm -f file1" \
24454"$SPROG remove: cannot remove file .file1. which has a sticky date of .[0-9.]*."
24455
24456	  dotest sticky-25 "$testcvs -q update -A" \
24457"$SPROG update: warning: \`file1' was lost
24458U file1" "U file1"
24459
24460	  dokeep
24461	  restore_adm
24462	  cd ../..
24463	  rm -r 1
24464	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
24465	  ;;
24466
24467
24468
24469	keyword)
24470	  # Test keyword expansion.
24471	  # Various other tests relate to our ability to correctly
24472	  # set the keyword expansion mode.
24473	  # "binfiles" tests "cvs admin -k".
24474	  # "binfiles" and "binfiles2" test "cvs add -k".
24475	  # "rdiff" tests "cvs co -k".
24476	  # "binfiles" (and this test) test "cvs update -k".
24477	  # "binwrap" tests setting the mode from wrappers.
24478	  # "keyword2" tests "cvs update -kk -j" with text and binary files
24479	  # I don't think any test is testing "cvs import -k".
24480	  # Other keyword expansion tests:
24481	  #   keywordlog - $Log.
24482	  mkdir 1; cd 1
24483	  dotest keyword-1 "${testcvs} -q co -l ." ''
24484	  mkdir first-dir
24485	  dotest keyword-2 "${testcvs} add first-dir" \
24486"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
24487          cd first-dir
24488
24489	  echo '$''Author$' > file1
24490	  echo '$''Date$' >> file1
24491	  echo '$''Header$' >> file1
24492	  echo '$''Id$' >> file1
24493	  echo '$''Locker$' >> file1
24494	  echo '$''Name$' >> file1
24495	  echo '$''RCSfile$' >> file1
24496	  echo '$''Revision$' >> file1
24497	  echo '$''Source$' >> file1
24498	  echo '$''State$' >> file1
24499	  echo '$''Nonkey$' >> file1
24500	  # Omit the trailing dollar sign
24501	  echo '$''Date' >> file1
24502	  # Put two keywords on one line
24503	  echo '$''State$' '$''State$' >> file1
24504	  # Use a header for Log
24505	  echo 'xx $''Log$' >> file1
24506
24507	  dotest keyword-3 "${testcvs} add file1" \
24508"${SPROG} add: scheduling file .file1. for addition
24509${SPROG} add: use .${SPROG} commit. to add this file permanently"
24510	  dotest keyword-4 "${testcvs} -q ci -m add" \
24511"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
24512initial revision: 1\.1"
24513	  dotest keyword-5 "cat file1" \
24514'\$'"Author: ${username} "'\$'"
24515"'\$'"Date: [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] "'\$'"
24516"'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
24517"'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
24518"'\$'"Locker:  "'\$'"
24519"'\$'"Name:  "'\$'"
24520"'\$'"RCSfile: file1,v "'\$'"
24521"'\$'"Revision: 1\.1 "'\$'"
24522"'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
24523"'\$'"State: Exp "'\$'"
24524"'\$'"Nonkey"'\$'"
24525"'\$'"Date
24526"'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
24527xx "'\$'"Log: file1,v "'\$'"
24528xx Revision 1\.1  [0-9/]* [0-9:]*  ${username}
24529xx add
24530xx"
24531
24532	  # Use cvs admin to lock the RCS file in order to check -kkvl
24533	  # vs. -kkv.  CVS does not normally lock RCS files, but some
24534	  # people use cvs admin to enforce reserved checkouts.
24535	  dotest keyword-6 "${testcvs} admin -l file1" \
24536"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
245371\.1 locked
24538done"
24539
24540	  dotest keyword-7 "${testcvs} update -kkv file1" "U file1"
24541	  dotest keyword-8 "cat file1" \
24542'\$'"Author: ${username} "'\$'"
24543"'\$'"Date: [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] "'\$'"
24544"'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
24545"'\$'"Id: file1,v 1\.1 [0-9/]* [0-9:]* ${username} Exp "'\$'"
24546"'\$'"Locker:  "'\$'"
24547"'\$'"Name:  "'\$'"
24548"'\$'"RCSfile: file1,v "'\$'"
24549"'\$'"Revision: 1\.1 "'\$'"
24550"'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
24551"'\$'"State: Exp "'\$'"
24552"'\$'"Nonkey"'\$'"
24553"'\$'"Date
24554"'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
24555xx "'\$'"Log: file1,v "'\$'"
24556xx Revision 1\.1  [0-9/]* [0-9:]*  ${username}
24557xx add
24558xx"
24559
24560	  dotest keyword-9 "${testcvs} update -kkvl file1" "U file1"
24561	  dotest keyword-10 "cat file1" \
24562'\$'"Author: ${username} "'\$'"
24563"'\$'"Date: ${RCSKEYDATE} "'\$'"
24564"'\$'"Header: ${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 ${RCSKEYDATE} ${username} Exp ${username} "'\$'"
24565"'\$'"Id: file1,v 1\.1 ${RCSKEYDATE} ${username} Exp ${username} "'\$'"
24566"'\$'"Locker: ${username} "'\$'"
24567"'\$'"Name:  "'\$'"
24568"'\$'"RCSfile: file1,v "'\$'"
24569"'\$'"Revision: 1\.1 "'\$'"
24570"'\$'"Source: ${CVSROOT_DIRNAME}/first-dir/file1,v "'\$'"
24571"'\$'"State: Exp "'\$'"
24572"'\$'"Nonkey"'\$'"
24573"'\$'"Date
24574"'\$'"State: Exp "'\$'" "'\$'"State: Exp "'\$'"
24575xx "'\$'"Log: file1,v "'\$'"
24576xx Revision 1\.1  ${RCSKEYDATE}  ${username}
24577xx add
24578xx"
24579
24580	  dotest keyword-11 "${testcvs} update -kk file1" "U file1"
24581	  dotest keyword-12 "cat file1" \
24582'\$'"Author"'\$'"
24583"'\$'"Date"'\$'"
24584"'\$'"Header"'\$'"
24585"'\$'"Id"'\$'"
24586"'\$'"Locker"'\$'"
24587"'\$'"Name"'\$'"
24588"'\$'"RCSfile"'\$'"
24589"'\$'"Revision"'\$'"
24590"'\$'"Source"'\$'"
24591"'\$'"State"'\$'"
24592"'\$'"Nonkey"'\$'"
24593"'\$'"Date
24594"'\$'"State"'\$'" "'\$'"State"'\$'"
24595xx "'\$'"Log"'\$'"
24596xx Revision 1\.1  ${RCSKEYDATE}  ${username}
24597xx add
24598xx"
24599
24600	  dotest keyword-13 "${testcvs} update -kv file1" "U file1"
24601	  dotest keyword-14 "cat file1" \
24602"${username}
24603${RCSKEYDATE}
24604${CVSROOT_DIRNAME}/first-dir/file1,v 1\.1 ${RCSKEYDATE} ${username} Exp
24605file1,v 1\.1 ${RCSKEYDATE} ${username} Exp
24606
24607
24608file1,v
246091\.1
24610${CVSROOT_DIRNAME}/first-dir/file1,v
24611Exp
24612"'\$'"Nonkey"'\$'"
24613"'\$'"Date
24614Exp Exp
24615xx file1,v
24616xx Revision 1\.1  ${RCSKEYDATE}  ${username}
24617xx add
24618xx"
24619
24620	  dotest keyword-15 "${testcvs} update -ko file1" "U file1"
24621	  dotest keyword-16 "cat file1" \
24622'\$'"Author"'\$'"
24623"'\$'"Date"'\$'"
24624"'\$'"Header"'\$'"
24625"'\$'"Id"'\$'"
24626"'\$'"Locker"'\$'"
24627"'\$'"Name"'\$'"
24628"'\$'"RCSfile"'\$'"
24629"'\$'"Revision"'\$'"
24630"'\$'"Source"'\$'"
24631"'\$'"State"'\$'"
24632"'\$'"Nonkey"'\$'"
24633"'\$'"Date
24634"'\$'"State"'\$'" "'\$'"State"'\$'"
24635xx "'\$'"Log"'\$'
24636
24637	  # Test the Name keyword.  First go back to normal expansion.
24638
24639	  dotest keyword-17 "${testcvs} update -A file1" "U file1"
24640
24641	  echo '$''Name$' > file1
24642	  dotest keyword-18 "${testcvs} ci -m modify file1" \
24643"${CVSROOT_DIRNAME}/first-dir/file1,v  <--  file1
24644new revision: 1\.2; previous revision: 1\.1"
24645	  dotest keyword-19 "${testcvs} -q tag tag1" "T file1"
24646	  echo "change" >> file1
24647	  dotest keyword-20 "${testcvs} -q ci -m mod2 file1" \
24648"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
24649new revision: 1\.3; previous revision: 1\.2"
24650	  # FIXCVS - These unpatchable files are happening because the tag
24651	  # associated with the current base version of the file in the
24652	  # sandbox is not available in these cases.  See the note in the
24653	  # patch_file function in update.c.
24654	  dotest keyword-21 "${testcvs} -q update -r tag1" "U file1" \
24655"P file1
24656${CPROG} update: checksum failure after patch to \./file1; will refetch
24657${CPROG} client: refetching unpatchable files
24658$SPROG update: warning: \`file1' was lost
24659U file1"
24660
24661	  dotest keyword-22 "cat file1" '\$'"Name: tag1 "'\$'
24662
24663	  if $remote; then
24664	    # Like serverpatch-8.  Not sure there is anything much we
24665	    # can or should do about this.
24666	    dotest keyword-23r "${testcvs} update -A file1" "P file1
24667${CPROG} update: checksum failure after patch to \./file1; will refetch
24668${CPROG} client: refetching unpatchable files
24669$SPROG update: warning: \`file1' was lost
24670U file1"
24671	  else
24672	    dotest keyword-23 "${testcvs} update -A file1" "[UP] file1"
24673	  fi
24674	  dotest keyword-24 "cat file1" '\$'"Name:  "'\$'"
24675change"
24676
24677	  dokeep
24678	  cd ../..
24679	  rm -r 1
24680	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
24681	  ;;
24682
24683
24684
24685	keywordlog)
24686	  # Test the Log keyword.
24687	  mkdir 1; cd 1
24688	  dotest keywordlog-1 "${testcvs} -q co -l ." ''
24689	  mkdir first-dir
24690	  dotest keywordlog-2 "${testcvs} add first-dir" \
24691"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
24692	  cd first-dir
24693	  echo initial >file1
24694	  dotest keywordlog-3 "${testcvs} add file1" \
24695"${SPROG} add: scheduling file .file1. for addition
24696${SPROG} add: use .${SPROG} commit. to add this file permanently"
24697
24698	  # See "rmadd" for a list of other tests of cvs ci -r.
24699	  dotest keywordlog-4 "${testcvs} -q ci -r 1.3 -m add file1" \
24700"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
24701initial revision: 1\.3"
24702
24703	  cd ../..
24704	  mkdir 2; cd 2
24705	  dotest keywordlog-4a "${testcvs} -q co first-dir" "U first-dir/file1"
24706	  cd ../1/first-dir
24707
24708	  echo 'xx $''Log$' >> file1
24709	  cat >${TESTDIR}/comment.tmp <<EOF
24710First log line
24711Second log line
24712EOF
24713	  # As with rmadd-25, "cvs ci -r" sets a sticky tag.
24714	  dotest_fail keywordlog-4b \
24715"${testcvs} ci -F ${TESTDIR}/comment.tmp file1" \
24716"${SPROG} commit: sticky tag .1\.3. for file .file1. is not a branch
24717${SPROG} \[commit aborted\]: correct above errors first!"
24718	  dotest keywordlog-4c "${testcvs} -q update -A" "M file1"
24719
24720	  dotest keywordlog-5 "${testcvs} ci -F ${TESTDIR}/comment.tmp file1" \
24721"${CVSROOT_DIRNAME}/first-dir/file1,v  <--  file1
24722new revision: 1\.4; previous revision: 1\.3"
24723	  rm -f ${TESTDIR}/comment.tmp
24724	  dotest keywordlog-6 "${testcvs} -q tag -b br" "T file1"
24725	  dotest keywordlog-7 "cat file1" \
24726"initial
24727xx "'\$'"Log: file1,v "'\$'"
24728xx Revision 1\.4  ${RCSKEYDATE}  ${username}
24729xx First log line
24730xx Second log line
24731xx"
24732
24733	  cd ../../2/first-dir
24734	  dotest keywordlog-8 "${testcvs} -q update" "[UP] file1"
24735	  dotest keywordlog-9 "cat file1" \
24736"initial
24737xx "'\$'"Log: file1,v "'\$'"
24738xx Revision 1\.4  ${RCSKEYDATE}  ${username}
24739xx First log line
24740xx Second log line
24741xx"
24742	  cd ../../1/first-dir
24743
24744	  echo "change" >> file1
24745	  dotest keywordlog-10 "${testcvs} ci -m modify file1" \
24746"${CVSROOT_DIRNAME}/first-dir/file1,v  <--  file1
24747new revision: 1\.5; previous revision: 1\.4"
24748	  dotest keywordlog-11 "cat file1" \
24749"initial
24750xx "'\$'"Log: file1,v "'\$'"
24751xx Revision 1\.5  ${RCSKEYDATE}  ${username}
24752xx modify
24753xx
24754xx Revision 1\.4  ${RCSKEYDATE}  ${username}
24755xx First log line
24756xx Second log line
24757xx
24758change"
24759
24760	  cd ../../2/first-dir
24761	  dotest keywordlog-12 "${testcvs} -q update" "[UP] file1"
24762	  dotest keywordlog-13 "cat file1" \
24763"initial
24764xx "'\$'"Log: file1,v "'\$'"
24765xx Revision 1\.5  ${RCSKEYDATE}  ${username}
24766xx modify
24767xx
24768xx Revision 1\.4  ${RCSKEYDATE}  ${username}
24769xx First log line
24770xx Second log line
24771xx
24772change"
24773
24774	  cd ../../1/first-dir
24775	  dotest keywordlog-14 "${testcvs} -q update -r br" "[UP] file1"
24776	  echo br-change >>file1
24777	  dotest keywordlog-15 "${testcvs} -q ci -m br-modify" \
24778"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
24779new revision: 1\.4\.2\.1; previous revision: 1\.4"
24780	  dotest keywordlog-16 "cat file1" \
24781"initial
24782xx "'\$'"Log: file1,v "'\$'"
24783xx Revision 1\.4\.2\.1  ${RCSKEYDATE}  ${username}
24784xx br-modify
24785xx
24786xx Revision 1\.4  ${RCSKEYDATE}  ${username}
24787xx First log line
24788xx Second log line
24789xx
24790br-change"
24791	  cd ../../2/first-dir
24792	  dotest keywordlog-17 "${testcvs} -q update -r br" "[UP] file1"
24793	  dotest keywordlog-18 "cat file1" \
24794"initial
24795xx "'\$'"Log: file1,v "'\$'"
24796xx Revision 1\.4\.2\.1  ${RCSKEYDATE}  ${username}
24797xx br-modify
24798xx
24799xx Revision 1\.4  ${RCSKEYDATE}  ${username}
24800xx First log line
24801xx Second log line
24802xx
24803br-change"
24804	  cd ../..
24805	  dotest keywordlog-19 "${testcvs} -q co -p -r br first-dir/file1" \
24806"initial
24807xx "'\$'"Log: file1,v "'\$'"
24808xx Revision 1\.4\.2\.1  ${RCSKEYDATE}  ${username}
24809xx br-modify
24810xx
24811xx Revision 1\.4  ${RCSKEYDATE}  ${username}
24812xx First log line
24813xx Second log line
24814xx
24815br-change"
24816	  dotest keywordlog-20 "${testcvs} -q co -p first-dir/file1" \
24817"initial
24818xx "'\$'"Log: file1,v "'\$'"
24819xx Revision 1\.5  ${RCSKEYDATE}  ${username}
24820xx modify
24821xx
24822xx Revision 1\.4  ${RCSKEYDATE}  ${username}
24823xx First log line
24824xx Second log line
24825xx
24826change"
24827	  dotest keywordlog-21 "${testcvs} -q co -p -r 1.4 first-dir/file1" \
24828"initial
24829xx "'\$'"Log: file1,v "'\$'"
24830xx Revision 1\.4  ${RCSKEYDATE}  ${username}
24831xx First log line
24832xx Second log line
24833xx"
24834
24835	  cd 2/first-dir
24836	  # OK, the basic rule for keyword expansion is that it
24837	  # happens on checkout.  And the rule for annotate is that
24838	  # it annotates a checked-in revision, rather than a checked-out
24839	  # file.  So, although it is kind of confusing that the latest
24840	  # revision does not appear in the annotated output, and the
24841	  # annotated output does not quite match what you'd get with
24842	  # update or checkout, the behavior is more or less logical.
24843	  # The same issue occurs with annotate and other keywords,
24844	  # I think, although it is particularly noticeable for $Log.
24845	  dotest keywordlog-22 "${testcvs} ann -r br file1" \
24846"
24847Annotations for file1
24848\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
248491\.3          ($username8 *[0-9a-zA-Z-]*): initial
248501\.4\.2\.1      ($username8 *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'"
248511\.4\.2\.1      ($username8 *[0-9a-zA-Z-]*): xx Revision 1\.4  ${RCSKEYDATE}  $username
248521\.4\.2\.1      ($username8 *[0-9a-zA-Z-]*): xx First log line
248531\.4\.2\.1      ($username8 *[0-9a-zA-Z-]*): xx Second log line
248541\.4\.2\.1      ($username8 *[0-9a-zA-Z-]*): xx
248551\.4\.2\.1      ($username8 *[0-9a-zA-Z-]*): br-change"
24856	  dotest keywordlog-23 "${testcvs} ann -r HEAD file1" \
24857"
24858Annotations for file1
24859\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
248601\.3          ($username8 *[0-9a-zA-Z-]*): initial
248611\.5          ($username8 *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'"
248621\.5          ($username8 *[0-9a-zA-Z-]*): xx Revision 1\.4  ${RCSKEYDATE}  $username
248631\.5          ($username8 *[0-9a-zA-Z-]*): xx First log line
248641\.5          ($username8 *[0-9a-zA-Z-]*): xx Second log line
248651\.5          ($username8 *[0-9a-zA-Z-]*): xx
248661\.5          ($username8 *[0-9a-zA-Z-]*): change"
24867	  cd ../..
24868
24869	  #
24870	  # test the operation of 'admin -o' in conjunction with keywords
24871	  # (especially Log - this used to munge the RCS file for all time)
24872	  #
24873
24874	  dotest keywordlog-24 \
24875"${testcvs} admin -oHEAD 1/first-dir/file1" \
24876"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
24877deleting revision 1\.5
24878done"
24879
24880	  dotest keywordlog-25 \
24881"${testcvs} -q co -p first-dir/file1" \
24882"initial
24883xx "'\$'"Log: file1,v "'\$'"
24884xx Revision 1\.4  ${RCSKEYDATE}  ${username}
24885xx First log line
24886xx Second log line
24887xx"
24888
24889	  # Now test the behavior when the comment leader exceeds the
24890	  # configured maximum.
24891	  mkdir 3; cd 3
24892	  dotest keywordlog-26 "$testcvs -Q co first-dir"
24893
24894	  cd first-dir
24895	  sed 's/xx \$/1234567890123456789 $/' <file1 >tmp
24896	  mv tmp file1
24897	  dotest keywordlog-27 "$testcvs -Q ci -mrevision-5"
24898	  dotest keywordlog-28 "cat file1" \
24899"initial
249001234567890123456789 "'\$'"Log: file1,v "'\$'"
249011234567890123456789 Revision 1\.5  $RCSKEYDATE  $username
249021234567890123456789 revision-5
249031234567890123456789
24904xx Revision 1\.4  $RCSKEYDATE  $username
24905xx First log line
24906xx Second log line
24907xx"
24908
24909	  sed 's/1234567890123456789 \$/12345678901234567890 $/' <file1 >tmp
24910	  mv tmp file1
24911	  dotest keywordlog-29 "$testcvs -Q ci -mrevision-6" \
24912"$SPROG commit: Skipping "'`$''Log$'"' keyword due to excessive comment leader\."
24913	  dotest keywordlog-30 "cat file1" \
24914"initial
2491512345678901234567890 "'\$'"Log: file1,v "'\$'"
249161234567890123456789 Revision 1\.5  $RCSKEYDATE  $username
249171234567890123456789 revision-5
249181234567890123456789
24919xx Revision 1\.4  $RCSKEYDATE  $username
24920xx First log line
24921xx Second log line
24922xx"
24923
24924	  # Check that the Log-related config options work.
24925	  cd ..
24926	  dotest keywordlog-31 "$testcvs -Q co CVSROOT"
24927	  cd CVSROOT
24928	  echo "UseArchiveCommentLeader=TrUe" >>config
24929	  dotest keywordlog-32 "$testcvs -Q ci -mset-UseArchiveCommentLeader"
24930
24931	  cd ../first-dir
24932	  dotest keywordlog-33 "$testcvs -Q ci -fmrevision-7 file1"
24933	  dotest keywordlog-34 "cat file1" \
24934"initial
2493512345678901234567890 "'\$'"Log: file1,v "'\$'"
24936# Revision 1\.7  $RCSKEYDATE  $username
24937# revision-7
24938#
249391234567890123456789 Revision 1\.5  $RCSKEYDATE  $username
249401234567890123456789 revision-5
249411234567890123456789
24942xx Revision 1\.4  $RCSKEYDATE  $username
24943xx First log line
24944xx Second log line
24945xx"
24946
24947	  cd ../CVSROOT
24948	  echo "MaxCommentLeaderLength=1k" >>config
24949	  dotest keywordlog-35 "$testcvs -Q ci -mset-MaxCommentLeaderLength"
24950
24951	  cd ../first-dir
24952	  dotest keywordlog-36 "$testcvs -Q ci -fmrevision-8 file1"
24953	  dotest keywordlog-37 "cat file1" \
24954"initial
2495512345678901234567890 "'\$'"Log: file1,v "'\$'"
2495612345678901234567890 Revision 1\.8  $RCSKEYDATE  $username
2495712345678901234567890 revision-8
2495812345678901234567890
24959# Revision 1\.7  $RCSKEYDATE  $username
24960# revision-7
24961#
249621234567890123456789 Revision 1\.5  $RCSKEYDATE  $username
249631234567890123456789 revision-5
249641234567890123456789
24965xx Revision 1\.4  $RCSKEYDATE  $username
24966xx First log line
24967xx Second log line
24968xx"
24969
24970	  dokeep
24971	  cd ../..
24972	  restore_adm
24973	  rm -r 1 2 3
24974	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
24975	  ;;
24976
24977
24978
24979	keywordname)
24980	  # Test the Name keyword.
24981	  # See the keyword test for a descriptions of some other tests that
24982	  # test keyword expansion modes.
24983	  mkdir keywordname; cd keywordname
24984	  mkdir 1; cd 1
24985	  dotest keywordname-init-1 "${testcvs} -q co -l ." ''
24986	  mkdir first-dir
24987	  dotest keywordname-init-2 "${testcvs} add first-dir" \
24988"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
24989	  cd first-dir
24990
24991	  echo '$'"Name$" >file1
24992	  echo '$'"Name$" >file2
24993	  dotest keywordname-init-3 "${testcvs} add file1 file2" \
24994"${SPROG} add: scheduling file .file1. for addition
24995${SPROG} add: scheduling file .file2. for addition
24996${SPROG} add: use .${SPROG} commit. to add these files permanently"
24997
24998	  # See "rmadd" for a list of other tests of cvs ci -r.
24999	  dotest keywordname-init-4 "${testcvs} -q ci -r 1.3 -m add" \
25000"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25001initial revision: 1\.3
25002$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
25003initial revision: 1\.3"
25004
25005	  dotest keywordname-init-6 "${testcvs} -q up -A"
25006	  dotest keywordname-init-7 "${testcvs} -q tag -b br" \
25007"T file1
25008T file2"
25009
25010	  echo new data >>file1
25011	  dotest keywordname-init-8 "${testcvs} -q ci -mchange" \
25012"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25013new revision: 1\.4; previous revision: 1\.3"
25014
25015	  # First check out a branch.
25016	  #
25017	  # There used to be a bug where static tags would be substituted for
25018	  # Name keywords but not branch tags.
25019	  #
25020	  # FIXCVS - BUG
25021	  # Why shouldn't the non-update case not cause a substitution?
25022	  # An update -kk or -A will unsub and sub keywords without updates
25023	  # being required.
25024	  # FIXCVS - see note above keyword-21
25025	  dotest keywordname-update-1 "${testcvs} -q up -rbr" "U file1" \
25026"P file1
25027${CPROG} update: checksum failure after patch to \./file1; will refetch
25028${CPROG} client: refetching unpatchable files
25029$SPROG update: warning: \`file1' was lost
25030U file1"
25031	  dotest keywordname-update-2 "cat file1" '\$'"Name: br "'\$'
25032	  dotest keywordname-update-3 "cat file2" '\$'"Name:  "'\$'
25033
25034	  # Now verify that updating to the trunk leaves no substitution for
25035	  # $Name
25036	  dotest keywordname-update-4 "${testcvs} -q tag firsttag" \
25037"T file1
25038T file2"
25039	  # FIXCVS - see note above keyword-21
25040	  dotest keywordname-update-5 "${testcvs} -q up -A" "U file1" \
25041"P file1
25042${CPROG} update: checksum failure after patch to \./file1; will refetch
25043${CPROG} client: refetching unpatchable files
25044$SPROG update: warning: \`file1' was lost
25045U file1"
25046	  dotest keywordname-update-6 "cat file1" \
25047'\$'"Name:  "'\$'"
25048new data"
25049	  dotest keywordname-update-7 "cat file2" '\$'"Name:  "'\$'
25050
25051	  # But updating to a static tag does cause a substitution
25052	  # FIXCVS - see same note above
25053	  dotest keywordname-update-8 "${testcvs} -q up -rfirsttag" "U file1" \
25054"P file1
25055${CPROG} update: checksum failure after patch to \./file1; will refetch
25056${CPROG} client: refetching unpatchable files
25057$SPROG update: warning: \`file1' was lost
25058U file1"
25059	  dotest keywordname-update-9 "cat file1" '\$'"Name: firsttag "'\$'
25060	  dotest keywordname-update-10 "cat file2" '\$'"Name:  "'\$'
25061
25062	  # And reverify the trunk update when the change is actually removed.
25063	  dotest keywordname-update-11 "${testcvs} -q up -A" "[UP] file1" \
25064"P file1
25065${CPROG} update: checksum failure after patch to ./file1; will refetch
25066${CPROG} client: refetching unpatchable files
25067$SPROG update: warning: \`file1' was lost
25068U file1"
25069	  dotest keywordname-update-12 "cat file1" \
25070'\$'"Name:  "'\$'"
25071new data"
25072	  dotest keywordname-update-13 "cat file2" '\$'"Name:  "'\$'
25073
25074	  cd ../..
25075
25076	  # now verify that a fresh checkout substitutes all the $Name fields
25077	  mkdir 2; cd 2
25078	  dotest keywordname-checkout-1 \
25079"${testcvs} -q co -rfirsttag first-dir" \
25080"U first-dir/file1
25081U first-dir/file2"
25082	  cd first-dir
25083	  dotest keywordname-checkout-2 "cat file1" '\$'"Name: firsttag "'\$'
25084	  dotest keywordname-checkout-3 "cat file2" '\$'"Name: firsttag "'\$'
25085
25086	  dokeep
25087	  cd ../../..
25088	  rm -r keywordname
25089	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
25090	  ;;
25091
25092
25093
25094	keyword2)
25095	  # Test merging on files with keywords:
25096	  #   without -kk
25097	  #   with -kk
25098	  #     on text files
25099	  #     on binary files
25100	  # Note:  This test assumes that CVS has already passed the binfiles
25101	  #    test sequence
25102	  # Note2:  We are testing positive on binary corruption here
25103	  #    we probably really DON'T want to 'cvs update -kk' a binary file...
25104	  mkdir 1; cd 1
25105	  dotest keyword2-1 "${testcvs} -q co -l ." ''
25106	  mkdir first-dir
25107	  dotest keyword2-2 "${testcvs} add first-dir" \
25108"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
25109          cd first-dir
25110
25111	  echo '$''Revision$' >> file1
25112	  echo "I" >>file1
25113	  echo "like" >>file1
25114	  echo "long" >>file1
25115	  echo "files!" >>file1
25116	  echo "" >>file1
25117	  echo "a test line for our times" >>file1
25118	  echo "" >>file1
25119	  echo "They" >>file1
25120	  echo "make" >>file1
25121	  echo "diff" >>file1
25122	  echo "look like it" >>file1
25123	  echo "did a much better" >>file1
25124	  echo "job." >>file1
25125	  dotest keyword2-3 "${testcvs} add file1" \
25126"${SPROG} add: scheduling file .file1. for addition
25127${SPROG} add: use .${SPROG} commit. to add this file permanently"
25128
25129	  ${AWK} 'BEGIN { printf "%c%c%c%sRevision: 1.1 $@%c%c", \
25130	    2, 10, 137, "$", 13, 10 }' \
25131	    </dev/null | ${TR} '@' '\000' >../binfile.dat
25132	  cp ../binfile.dat .
25133	  dotest keyword2-5 "${testcvs} add -kb binfile.dat" \
25134"${SPROG} add: scheduling file .binfile\.dat. for addition
25135${SPROG} add: use .${SPROG} commit. to add this file permanently"
25136
25137	  dotest keyword2-6 "${testcvs} -q ci -m add" \
25138"$CVSROOT_DIRNAME/first-dir/binfile\.dat,v  <--  binfile\.dat
25139initial revision: 1\.1
25140$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25141initial revision: 1\.1"
25142
25143	  dotest keyword2-7 "${testcvs} -q tag -b branch" \
25144"T binfile\.dat
25145T file1"
25146
25147	  sed -e 's/our/the best of and the worst of/' file1 >f; mv f file1
25148	  dotest keyword2-8 "${testcvs} -q ci -m change" \
25149"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25150new revision: 1\.2; previous revision: 1\.1"
25151
25152	  dotest keyword2-9 "${testcvs} -q update -r branch" '[UP] file1'
25153
25154	  echo "what else do we have?" >>file1
25155	  dotest keyword2-10 "${testcvs} -q ci -m change" \
25156"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25157new revision: 1\.1\.2\.1; previous revision: 1\.1"
25158
25159	  # Okay, first a conflict in file1 - should be okay with binfile.dat
25160	  dotest keyword2-11 "${testcvs} -q update -A -j branch" \
25161"U file1
25162RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25163retrieving revision 1\.1
25164retrieving revision 1\.1\.2\.1
25165Merging differences between 1\.1 and 1\.1\.2\.1 into file1
25166rcsmerge: warning: conflicts during merge"
25167
25168	  dotest_fail keyword2-12 "${testcvs} diff file1" \
25169"Index: file1
25170===================================================================
25171RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25172retrieving revision 1\.2
25173diff -r1\.2 file1
251740a1
25175> <<<<<<< file1
251761a3,5
25177> =======
25178> \\\$""Revision: 1\.1\.2\.1 \\\$
25179> >>>>>>> 1\.1\.2\.1
2518014a19
25181> what else do we have${QUESTION}"
25182
25183	  # Here's the problem... shouldn't -kk a binary file...
25184	  rm file1
25185	  dotest keyword2-13 "${testcvs} -q update -A -kk -j branch" \
25186"${SPROG} update: warning: \`file1' was lost
25187U file1
25188RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25189retrieving revision 1\.1
25190retrieving revision 1\.1\.2\.1
25191Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
25192
25193	  # binfile won't get checked in, but it is now corrupt and could
25194	  # have been checked in if it had changed on the branch...
25195	  dotest keyword2-14 "${testcvs} -q ci -m change" \
25196"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25197new revision: 1\.3; previous revision: 1\.2"
25198
25199	  # "-kk" no longer corrupts binary files
25200	  dotest keyword2-15 "cmp binfile.dat ../binfile.dat" ''
25201
25202	  # Okay, restore everything and make CVS try and merge a binary file...
25203	  # "-kk" no longer affects binary files
25204	  dotest keyword2-16 "${testcvs} -q update -A" \
25205"[UP] file1"
25206	  dotest keyword2-17 "${testcvs} -q tag -b branch2" \
25207"T binfile\.dat
25208T file1"
25209	  dotest keyword2-18 "${testcvs} -q update -r branch2" ''
25210
25211	  ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
25212	    </dev/null | ${TR} '@' '\000' >>binfile.dat
25213	  dotest keyword2-19 "$testcvs -q ci -m badbadbad" \
25214"$CVSROOT_DIRNAME/first-dir/binfile\.dat,v  <--  binfile\.dat
25215new revision: 1\.1\.4\.1; previous revision: 1\.1"
25216	  # "-kk" no longer affects binary files
25217
25218	  # XXXX: do not ask, why we get the "U binfile.dat" line twice
25219	  #       looks like a bug!
25220	  dotest keyword2-20 "${testcvs} -q update -A -kk -j branch2" \
25221"U binfile\.dat
25222U binfile\.dat
25223U file1"
25224
25225	  dokeep
25226	  cd ../..
25227	  rm -r 1
25228	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
25229	  ;;
25230
25231
25232
25233	head)
25234	  # Testing handling of the HEAD special tag.
25235	  # There are many cases involving added and removed files
25236	  # which we don't yet try to deal with.
25237	  # TODO: We also could be paying much closer attention to
25238	  # "head of the trunk" versus "head of the default branch".
25239	  # That is what "cvs import" is doing here (but I didn't really
25240	  # fully follow through on writing the tests for that case).
25241	  mkdir imp-dir
25242	  cd imp-dir
25243	  echo 'imported contents' >file1
25244	  # It may seem like we don't do much with file2, but do note that
25245	  # the "cvs diff" invocations do also diff file2 (and come up empty).
25246	  echo 'imported contents' >file2
25247	  dotest_sort head-1 "${testcvs} import -m add first-dir tag1 tag2" \
25248"
25249
25250N first-dir/file1
25251N first-dir/file2
25252No conflicts created by this import"
25253	  cd ..
25254	  rm -r imp-dir
25255	  mkdir 1
25256	  cd 1
25257	  dotest head-2 "${testcvs} -q co first-dir" \
25258"U first-dir/file1
25259U first-dir/file2"
25260	  cd first-dir
25261	  echo 'add a line on trunk' >> file1
25262	  dotest head-3 "${testcvs} -q ci -m modify" \
25263"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25264new revision: 1\.2; previous revision: 1\.1"
25265	  dotest head-4 "${testcvs} -q tag trunktag" "T file1
25266T file2"
25267	  echo 'add a line on trunk after trunktag' >> file1
25268	  dotest head-5 "${testcvs} -q ci -m modify" \
25269"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25270new revision: 1\.3; previous revision: 1\.2"
25271	  dotest head-6 "${testcvs} -q tag -b br1" "T file1
25272T file2"
25273	  dotest head-7 "${testcvs} -q update -r br1" ""
25274	  echo 'modify on branch' >>file1
25275	  dotest head-8 "${testcvs} -q ci -m modify" \
25276"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25277new revision: 1\.3\.2\.1; previous revision: 1\.3"
25278	  dotest head-9 "${testcvs} -q tag brtag" "T file1
25279T file2"
25280	  echo 'modify on branch after brtag' >>file1
25281	  dotest head-10 "${testcvs} -q ci -m modify" \
25282"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25283new revision: 1\.3\.2\.2; previous revision: 1\.3\.2\.1"
25284	  # With no sticky tags, HEAD is the head of the trunk.
25285	  dotest head-trunk-setup "${testcvs} -q update -A" "[UP] file1"
25286	  dotest head-trunk-update "${testcvs} -q update -r HEAD -p file1" \
25287"imported contents
25288add a line on trunk
25289add a line on trunk after trunktag"
25290	  # and diff thinks so too.  Case (a) from the comment in
25291	  # cvs.texinfo (Common options).
25292	  dotest_fail head-trunk-diff "${testcvs} -q diff -c -r HEAD -r br1" \
25293"Index: file1
25294===================================================================
25295RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25296retrieving revision 1\.3
25297retrieving revision 1\.3\.2\.2
25298diff -c -r1\.3 -r1\.3\.2\.2
25299\*\*\* file1	${RFCDATE}	1\.3
25300--- file1	${RFCDATE}	1\.3\.2\.2
25301\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
25302\*\*\* 1,3 \*\*\*\*
25303--- 1,5 ----
25304  imported contents
25305  add a line on trunk
25306  add a line on trunk after trunktag
25307${PLUS} modify on branch
25308${PLUS} modify on branch after brtag"
25309
25310	  # With a branch sticky tag, HEAD is the head of the trunk.
25311	  dotest head-br1-setup "${testcvs} -q update -r br1" "[UP] file1"
25312	  dotest head-br1-update "${testcvs} -q update -r HEAD -p file1" \
25313"imported contents
25314add a line on trunk
25315add a line on trunk after trunktag"
25316	  # But diff thinks that HEAD is "br1".  Case (b) from cvs.texinfo.
25317	  # Probably people are relying on it.
25318	  dotest head-br1-diff "${testcvs} -q diff -c -r HEAD -r br1" ""
25319
25320	  # With a nonbranch sticky tag on a branch,
25321	  # HEAD is the head of the trunk
25322	  dotest head-brtag-setup "${testcvs} -q update -r brtag" "[UP] file1"
25323	  dotest head-brtag-update "${testcvs} -q update -r HEAD -p file1" \
25324"imported contents
25325add a line on trunk
25326add a line on trunk after trunktag"
25327
25328	  # CVS 1.9 and older thought that HEAD is "brtag" (this was
25329	  # noted as "strange, maybe accidental").  But "br1" makes a
25330	  # whole lot more sense.
25331	  dotest head-brtag-diff "${testcvs} -q diff -c -r HEAD -r br1" ""
25332
25333	  # With a nonbranch sticky tag on the trunk, HEAD is the head
25334	  # of the trunk, I think.
25335	  dotest head-trunktag-setup "${testcvs} -q update -r trunktag" \
25336"[UP] file1"
25337	  dotest head-trunktag-check "cat file1" "imported contents
25338add a line on trunk"
25339	  dotest head-trunktag-update "${testcvs} -q update -r HEAD -p file1" \
25340"imported contents
25341add a line on trunk
25342add a line on trunk after trunktag"
25343	  # Like head-brtag-diff, there is a non-branch sticky tag.
25344	  dotest_fail head-trunktag-diff \
25345	    "${testcvs} -q diff -c -r HEAD -r br1" \
25346"Index: file1
25347===================================================================
25348RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25349retrieving revision 1\.3
25350retrieving revision 1\.3\.2\.2
25351diff -c -r1\.3 -r1\.3\.2\.2
25352\*\*\* file1	${RFCDATE}	1\.3
25353--- file1	${RFCDATE}	1\.3\.2\.2
25354\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
25355\*\*\* 1,3 \*\*\*\*
25356--- 1,5 ----
25357  imported contents
25358  add a line on trunk
25359  add a line on trunk after trunktag
25360${PLUS} modify on branch
25361${PLUS} modify on branch after brtag"
25362
25363	  # Also might test what happens if we setup with update -r
25364	  # HEAD.  In general, if sticky tags matter, does the
25365	  # behavior of "update -r <foo>" (without -p) depend on the
25366	  # sticky tags before or after the update?
25367
25368	  # Note that we are testing both the case where this deletes
25369	  # a revision (file1) and the case where it does not (file2)
25370	  dotest_fail head-o0a "${testcvs} admin -o ::br1" \
25371"${SPROG} admin: Administrating \.
25372RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25373${SPROG} admin: cannot remove revision 1\.3\.2\.1 because it has tags
25374${SPROG} admin: RCS file for .file1. not modified\.
25375RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25376done"
25377	  dotest head-o0b "${testcvs} tag -d brtag" \
25378"${SPROG} tag: Untagging \.
25379D file1
25380D file2"
25381	  dotest head-o1 "${testcvs} admin -o ::br1" \
25382"${SPROG} admin: Administrating \.
25383RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25384deleting revision 1\.3\.2\.1
25385done
25386RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25387done"
25388
25389	  dokeep
25390	  cd ../..
25391	  rm -r 1
25392	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
25393	  ;;
25394
25395
25396
25397	tagdate)
25398	  # Test combining -r and -D.
25399	  #
25400	  # Note that this is not a complete test.  It relies on the fact
25401	  # that update, checkout and export have a LOT of shared code.
25402	  # Notice:
25403	  #	1)  checkout is never tested at all with -r -D
25404	  #	2)  update never uses an argument to '-D' besides 'now'
25405	  #		(this test does not provide enough data to prove
25406	  #		that 'cvs update' with both a '-r' and a '-D'
25407	  #		specified does not ignore '-D': a 'cvs up
25408	  #		-r<branch> -Dnow' and a 'cvs up -r<branch>'
25409	  #		should specify the same file revision).
25410	  #	3)  export uses '-r<branch> -D<when there was a different
25411	  #		revision>', hopefully completing this behavior test
25412	  #		for checkout and update as well.
25413	  #
25414	  mkdir 1; cd 1
25415	  save_TZ=$TZ
25416	  TZ=UTC0; export TZ
25417	  dotest tagdate-1 "${testcvs} -q co -l ." ''
25418	  mkdir first-dir
25419	  dotest tagdate-2 "${testcvs} add first-dir" \
25420"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
25421	  cd first-dir
25422
25423	  echo trunk-1 >file1
25424	  dotest tagdate-3 "${testcvs} add file1" \
25425"${SPROG} add: scheduling file .file1. for addition
25426${SPROG} add: use .${SPROG} commit. to add this file permanently"
25427	  dotest tagdate-4 "${testcvs} -q ci -m add" \
25428"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25429initial revision: 1\.1"
25430	  date_T1=`getrlogdate -r1.1 first-dir/file1`
25431
25432	  dotest tagdate-5 "${testcvs} -q tag -b br1" "T file1"
25433	  dotest tagdate-6 "${testcvs} -q tag -b br2" "T file1"
25434	  echo trunk-2 >file1
25435	  dotest tagdate-7 "${testcvs} -q ci -m modify-on-trunk" \
25436"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25437new revision: 1\.2; previous revision: 1\.1"
25438	  date_T2=`getrlogdate -r1.2 first-dir/file1`
25439
25440	  # We are testing -r -D where br1 is a (magic) branch without
25441	  # any revisions.  First the case where br2 doesn't have any
25442	  # revisions either:
25443	  dotest tagdate-8 "${testcvs} -q update -p -r br1 -D now" "trunk-1"
25444	  dotest tagdate-9 "${testcvs} -q update -r br2" "[UP] file1"
25445	  echo br2-1 >file1
25446	  dotest tagdate-10 "${testcvs} -q ci -m modify-on-br2" \
25447"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25448new revision: 1\.1\.4\.1; previous revision: 1\.1"
25449	  date_T3=`getrlogdate -r1.1.4.1 first-dir/file1`
25450
25451	  # Then the case where br2 does have revisions:
25452	  dotest tagdate-11 "${testcvs} -q update -p -r br1 -D now" "trunk-1"
25453
25454	  # Joins from dates on the head used to be prohibited.
25455	  dotest tagdate-12 "$testcvs -q update -j:yesterday -j:now"
25456	  dotest tagdate-12b "$testcvs -Q update -C"
25457	  # And check export
25458
25459	  echo br2-2 >file1
25460	  dotest tagdate-13 "${testcvs} -q ci -m modify-2-on-br2" \
25461"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25462new revision: 1\.1\.4\.2; previous revision: 1\.1\.4\.1"
25463	  date_T4=`getrlogdate -r1.1.4.2 first-dir/file1`
25464
25465	  # Test diff -r<tag>:<date> with two revisions specified.
25466	  dotest_fail tagdate-13b \
25467"$testcvs -q diff -u -rbr2:'$date_T3' -rbr2:now file1" \
25468"Index: file1
25469===================================================================
25470RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
25471retrieving revision 1\.1\.4\.1
25472retrieving revision 1\.1\.4\.2
25473diff -u -r1\.1\.4\.1 -r1\.1\.4\.2
25474--- file1	$RFCDATE	1\.1\.4\.1
25475+++ file1	$RFCDATE	1\.1\.4\.2
25476@@ -1 ${PLUS}1 @@
25477-br2-1
25478${PLUS}br2-2"
25479
25480	  # Tag a date on a branch.
25481	  dotest tagdate-13c "$testcvs -q tag -rbr2:'$date_T3' tagdate" \
25482"T file1"
25483	  dotest tagdate-13d "$testcvs -q update -rtagdate" "[UP] file1"
25484	  dotest tagdate-13e "cat file1" "br2-1"
25485
25486	  # This one should fail, though currently without an error message,
25487	  # since a date on a static tag is meaningless.
25488	  dotest tagdate-13f "$testcvs -q tag -rtagdate:'$date_T3' tagdate"
25489
25490	  # and restore to using the trunk for future tests.
25491	  dotest tagdate-13g "$testcvs -q up -rbr2" "[UP] file1"
25492
25493	  cd ../..
25494	  mkdir 2; cd 2
25495	  dotest tagdate-14 \
25496"$testcvs -q export -r br2 -D'$date_T3' first-dir" \
25497"[UP] first-dir/file1"
25498	  dotest tagdate-14b "cat first-dir/file1" "br2-1"
25499	  dotest tagdate-15 \
25500"$testcvs -q export -rbr2:'$date_T3' -dsecond-dir first-dir" \
25501"[UP] second-dir/file1"
25502	  dotest tagdate-15b "cat second-dir/file1" "br2-1"
25503
25504	  # Now for annotate
25505	  cd ../1/first-dir
25506	  dotest tagdate-16 "${testcvs} annotate -rbr2 -D'$date_T3'" \
25507"
25508Annotations for file1
25509\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
255101\.1\.4\.1      ($username8 *[0-9a-zA-Z-]*): br2-1"
25511
25512	  dotest tagdate-17 "${testcvs} annotate -rbr2 -Dnow" \
25513"
25514Annotations for file1
25515\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
255161\.1\.4\.2      ($username8 *[0-9a-zA-Z-]*): br2-2"
25517
25518	  # Now check to see what happens when we add files to br2 and trunk
25519	  echo br2-1 > file3
25520	  dotest tagdate-18 "${testcvs} add file3" \
25521"${SPROG} add: scheduling file \`file3' for addition on branch \`br2'
25522${SPROG} add: use \`${SPROG} commit' to add this file permanently"
25523	  dotest tagdate-19 "${testcvs} -q ci -m add file3" \
25524"$CVSROOT_DIRNAME/first-dir/Attic/file3,v  <--  file3
25525new revision: 1\.1\.2\.1; previous revision: 1\.1"
25526	  date_T5=`getrlogdate -r1.1 first-dir/file3`
25527	  date_T6=`getrlogdate -r1.1.2.1 first-dir/file3`
25528
25529	  cd ../..
25530	  mkdir 3; cd 3
25531	  dotest tagdate-20 "${testcvs} -Q co first-dir" ''
25532	  cd first-dir
25533	  echo trunk-1 > file2
25534	  dotest tagdate-21 "${testcvs} add file2" \
25535"${SPROG} add: scheduling file .file2. for addition
25536${SPROG} add: use .${SPROG} commit. to add this file permanently"
25537	  dotest tagdate-22 "${testcvs} -q ci -m add file2" \
25538"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
25539initial revision: 1\.1"
25540	  date_T7=`getrlogdate -r1.1 first-dir/file2`
25541	  echo "trunk-2" >file2
25542	  dotest tagdate-23 "${testcvs} -q ci -m update file2" \
25543"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
25544new revision: 1\.2; previous revision: 1\.1"
25545	  date_T8=`getrlogdate -r1.2 first-dir/file2`
25546
25547	  cd ../../1/first-dir
25548	  echo br2-1 > file2
25549	  dotest tagdate-24 "${testcvs} add file2" \
25550"${SPROG} add: scheduling file \`file2' for addition on branch \`br2'
25551${SPROG} add: use \`${SPROG} commit' to add this file permanently"
25552	  dotest tagdate-25 "${testcvs} -q ci -m add file2" \
25553"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
25554new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1"
25555	  date_T9=`getrlogdate -r1.2.2.2 first-dir/file2`
25556	  cd ../..
25557
25558	  # Time  Rev     Branch  Comments
25559	  # T0            trunk   first-dir created
25560	  # T1    1.1     trunk   first-dir/file1 committed "trunk-1"
25561	  #               br1     branch created
25562	  #               br2     branch created
25563	  # T2    1.2     trunk   first-dir/file1 committed "trunk-2"
25564	  # T3    1.1.4.1 br2     first-dir/file1 committed "br2-1"
25565	  # +60s
25566	  # T4    1.1.4.2 br2     first-dir/file1 committed "br2-2"
25567	  # T5    1.1     trunk   first-dir/file3 dead
25568	  # T6    1.1.2.1 br2     first-dir/file3 committed "br2-1"
25569	  # T7    1.1     trunk   first-dir/file2 committed "trunk-1"
25570	  # T8    1.2     trunk   first-dir/file2 committed "trunk-2"
25571	  # T8    1.2.2.1 br2     first-dir/file2 dead
25572	  # T9    1.2.2.2 br2     first-dir/file2 committed "br2-1"
25573	  #
25574
25575	  mkdir 4; cd 4
25576	  (echo Dates for tagdate-26-* are:;\
25577	   echo "  date_T1='$date_T1'";\
25578	   echo "  date_T2='$date_T2'";\
25579	   echo "  date_T3='$date_T3'";\
25580	   echo "  date_T4='$date_T4'";\
25581	   echo "  date_T5='$date_T5'";\
25582	   echo "  date_T6='$date_T6'";\
25583	   echo "  date_T7='$date_T7'";\
25584	   echo "  date_T8='$date_T8'";\
25585	   echo "  date_T9='$date_T9'") >>$LOGFILE
25586	  dotest tagdate-26-trunk-t1 \
25587"${testcvs} co -D'$date_T1' -d first-dir-trunk-t1 first-dir" \
25588"${SPROG} checkout: Updating first-dir-trunk-t1
25589U first-dir-trunk-t1/file1"
25590	  dotest tagdate-26-br2-t1 \
25591"${testcvs} co -r br2 -D'$date_T1' -d first-dir-br2-t1 first-dir" \
25592"${SPROG} checkout: Updating first-dir-br2-t1
25593U first-dir-br2-t1/file1"
25594	  dotest tagdate-26-trunk-t2 \
25595"${testcvs} co -D'$date_T2' -d first-dir-trunk-t2 first-dir" \
25596"${SPROG} checkout: Updating first-dir-trunk-t2
25597U first-dir-trunk-t2/file1"
25598	  dotest tagdate-26-br2-t2 \
25599"${testcvs} co -r br2 -D'$date_T2' -d first-dir-br2-t2 first-dir" \
25600"${SPROG} checkout: Updating first-dir-br2-t2
25601U first-dir-br2-t2/file1"
25602	  dotest tagdate-26-br2-t3 \
25603"${testcvs} co -r br2 -D'$date_T3' -d first-dir-br2-t3 first-dir" \
25604"${SPROG} checkout: Updating first-dir-br2-t3
25605U first-dir-br2-t3/file1"
25606	  dotest tagdate-26-br2-t4 \
25607"${testcvs} co -r br2 -D'$date_T4' -d first-dir-br2-t4 first-dir" \
25608"${SPROG} checkout: Updating first-dir-br2-t4
25609U first-dir-br2-t4/file1"
25610	  dotest tagdate-26-br2-t6 \
25611"${testcvs} co -r br2 -D'$date_T6' -d first-dir-br2-t6 first-dir" \
25612"${SPROG} checkout: Updating first-dir-br2-t6
25613U first-dir-br2-t6/file1
25614U first-dir-br2-t6/file3"
25615	  dotest tagdate-26-trunk-t7 \
25616"${testcvs} co -D'$date_T7' -d first-dir-trunk-t7 first-dir" \
25617"${SPROG} checkout: Updating first-dir-trunk-t7
25618U first-dir-trunk-t7/file1
25619U first-dir-trunk-t7/file2"
25620	  dotest tagdate-26-br2-t7 \
25621"${testcvs} co -r br2 -D'$date_T7' -d first-dir-br2-t7 first-dir" \
25622"${SPROG} checkout: Updating first-dir-br2-t7
25623U first-dir-br2-t7/file1
25624U first-dir-br2-t7/file3"
25625	  dotest tagdate-26-trunk-t8 \
25626"${testcvs} co -D'$date_T8' -d first-dir-trunk-t8 first-dir" \
25627"${SPROG} checkout: Updating first-dir-trunk-t8
25628U first-dir-trunk-t8/file1
25629U first-dir-trunk-t8/file2"
25630	  dotest tagdate-26-br2-t8 \
25631"${testcvs} co -r br2 -D'$date_T8' -d first-dir-br2-t8 first-dir" \
25632"${SPROG} checkout: Updating first-dir-br2-t8
25633U first-dir-br2-t8/file1
25634U first-dir-br2-t8/file3"
25635	  dotest tagdate-26-br2-t9 \
25636"${testcvs} co -r br2 -D'$date_T9' -d first-dir-br2-t9 first-dir" \
25637"${SPROG} checkout: Updating first-dir-br2-t9
25638U first-dir-br2-t9/file1
25639U first-dir-br2-t9/file2
25640U first-dir-br2-t9/file3"
25641	  dotest tagdate-27-trunk-t1 \
25642"${testcvs} status first-dir-trunk-t1" \
25643"${SPROG} status: Examining first-dir-trunk-t1
25644===================================================================
25645File: file1            	Status: Up-to-date
25646
25647   Working revision:	1\.1[^.]*
25648   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file1,v
25649   Commit Identifier:	${commitid}
25650   Sticky Tag:		(none)
25651   Sticky Date:		${RCSDELTADATE}
25652   Sticky Options:	(none)"
25653	  dotest tagdate-27-br2-t1 \
25654"${testcvs} status first-dir-br2-t1" \
25655"${SPROG} status: Examining first-dir-br2-t1
25656===================================================================
25657File: file1            	Status: Needs Patch
25658
25659   Working revision:	1\.1[^.]*
25660   Repository revision:	1\.1\.4\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25661   Commit Identifier:	${commitid}
25662   Sticky Tag:		br2 (branch: 1\.1\.4)
25663   Sticky Date:		(none)
25664   Sticky Options:	(none)"
25665	  dotest tagdate-27-trunk-t2 \
25666"${testcvs} status first-dir-trunk-t2" \
25667"${SPROG} status: Examining first-dir-trunk-t2
25668===================================================================
25669File: file1            	Status: Up-to-date
25670
25671   Working revision:	1\.2[^.]*
25672   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25673   Commit Identifier:	${commitid}
25674   Sticky Tag:		(none)
25675   Sticky Date:		${RCSDELTADATE}
25676   Sticky Options:	(none)"
25677	  dotest tagdate-27-br2-t2 \
25678"${testcvs} status first-dir-br2-t2" \
25679"${SPROG} status: Examining first-dir-br2-t2
25680===================================================================
25681File: file1            	Status: Needs Patch
25682
25683   Working revision:	1\.1[^.]*
25684   Repository revision:	1\.1\.4\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25685   Commit Identifier:	${commitid}
25686   Sticky Tag:		br2 (branch: 1\.1\.4)
25687   Sticky Date:		(none)
25688   Sticky Options:	(none)"
25689	  dotest tagdate-27-br2-t3 \
25690"${testcvs} status first-dir-br2-t3" \
25691"${SPROG} status: Examining first-dir-br2-t3
25692===================================================================
25693File: file1            	Status: Needs Patch
25694
25695   Working revision:	1\.1\.4\.1[^.]*
25696   Repository revision:	1\.1\.4\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25697   Commit Identifier:	${commitid}
25698   Sticky Tag:		br2 (branch: 1\.1\.4)
25699   Sticky Date:		(none)
25700   Sticky Options:	(none)"
25701	  dotest tagdate-27-br2-t4 \
25702"${testcvs} status first-dir-br2-t4" \
25703"${SPROG} status: Examining first-dir-br2-t4
25704===================================================================
25705File: file1            	Status: Up-to-date
25706
25707   Working revision:	1\.1\.4\.2[^.]*
25708   Repository revision:	1\.1\.4\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25709   Commit Identifier:	${commitid}
25710   Sticky Tag:		br2 (branch: 1\.1\.4)
25711   Sticky Date:		(none)
25712   Sticky Options:	(none)"
25713	  dotest tagdate-27-br2-t6 \
25714"${testcvs} status first-dir-br2-t6" \
25715"${SPROG} status: Examining first-dir-br2-t6
25716===================================================================
25717File: file1            	Status: Up-to-date
25718
25719   Working revision:	1\.1\.4\.2[^.]*
25720   Repository revision:	1\.1\.4\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25721   Commit Identifier:	${commitid}
25722   Sticky Tag:		br2 (branch: 1\.1\.4)
25723   Sticky Date:		(none)
25724   Sticky Options:	(none)
25725
25726===================================================================
25727File: file3            	Status: Up-to-date
25728
25729   Working revision:	1\.1\.2\.1[^.]*
25730   Repository revision:	1\.1\.2\.1	${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
25731   Commit Identifier:	${commitid}
25732   Sticky Tag:		br2 (branch: 1\.1\.2)
25733   Sticky Date:		(none)
25734   Sticky Options:	(none)"
25735	  dotest tagdate-27-trunk-t7 \
25736"${testcvs} status first-dir-trunk-t7" \
25737"${SPROG} status: Examining first-dir-trunk-t7
25738===================================================================
25739File: file1            	Status: Up-to-date
25740
25741   Working revision:	1\.2[^.]*
25742   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25743   Commit Identifier:	${commitid}
25744   Sticky Tag:		(none)
25745   Sticky Date:		${RCSDELTADATE}
25746   Sticky Options:	(none)
25747
25748===================================================================
25749File: file2            	Status: Up-to-date
25750
25751   Working revision:	1\.1[^.]*
25752   Repository revision:	1\.1	${CVSROOT_DIRNAME}/first-dir/file2,v
25753   Commit Identifier:	${commitid}
25754   Sticky Tag:		(none)
25755   Sticky Date:		${RCSDELTADATE}
25756   Sticky Options:	(none)"
25757	  dotest tagdate-27-br2-t7 \
25758"${testcvs} status first-dir-br2-t7" \
25759"${SPROG} status: Examining first-dir-br2-t7
25760===================================================================
25761File: file1            	Status: Up-to-date
25762
25763   Working revision:	1\.1\.4\.2[^.]*
25764   Repository revision:	1\.1\.4\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25765   Commit Identifier:	${commitid}
25766   Sticky Tag:		br2 (branch: 1\.1\.4)
25767   Sticky Date:		(none)
25768   Sticky Options:	(none)
25769
25770===================================================================
25771File: file3            	Status: Up-to-date
25772
25773   Working revision:	1\.1\.2\.1[^.]*
25774   Repository revision:	1\.1\.2\.1	${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
25775   Commit Identifier:	${commitid}
25776   Sticky Tag:		br2 (branch: 1\.1\.2)
25777   Sticky Date:		(none)
25778   Sticky Options:	(none)"
25779	  dotest tagdate-27-trunk-t8 \
25780"${testcvs} status first-dir-trunk-t8" \
25781"${SPROG} status: Examining first-dir-trunk-t8
25782===================================================================
25783File: file1            	Status: Up-to-date
25784
25785   Working revision:	1\.2[^.]*
25786   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25787   Commit Identifier:	${commitid}
25788   Sticky Tag:		(none)
25789   Sticky Date:		${RCSDELTADATE}
25790   Sticky Options:	(none)
25791
25792===================================================================
25793File: file2            	Status: Up-to-date
25794
25795   Working revision:	1\.2[^.]*
25796   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/file2,v
25797   Commit Identifier:	${commitid}
25798   Sticky Tag:		(none)
25799   Sticky Date:		${RCSDELTADATE}
25800   Sticky Options:	(none)"
25801	  dotest tagdate-27-br2-t8 \
25802"${testcvs} status first-dir-br2-t8" \
25803"${SPROG} status: Examining first-dir-br2-t8
25804===================================================================
25805File: file1            	Status: Up-to-date
25806
25807   Working revision:	1\.1\.4\.2[^.]*
25808   Repository revision:	1\.1\.4\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25809   Commit Identifier:	${commitid}
25810   Sticky Tag:		br2 (branch: 1\.1\.4)
25811   Sticky Date:		(none)
25812   Sticky Options:	(none)
25813
25814===================================================================
25815File: file3            	Status: Up-to-date
25816
25817   Working revision:	1\.1\.2\.1[^.]*
25818   Repository revision:	1\.1\.2\.1	${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
25819   Commit Identifier:	${commitid}
25820   Sticky Tag:		br2 (branch: 1\.1\.2)
25821   Sticky Date:		(none)
25822   Sticky Options:	(none)"
25823	  dotest tagdate-27-br2-t9 \
25824"${testcvs} status first-dir-br2-t9" \
25825"${SPROG} status: Examining first-dir-br2-t9
25826===================================================================
25827File: file1            	Status: Up-to-date
25828
25829   Working revision:	1\.1\.4\.2[^.]*
25830   Repository revision:	1\.1\.4\.2	${CVSROOT_DIRNAME}/first-dir/file1,v
25831   Commit Identifier:	${commitid}
25832   Sticky Tag:		br2 (branch: 1\.1\.4)
25833   Sticky Date:		(none)
25834   Sticky Options:	(none)
25835
25836===================================================================
25837File: file2            	Status: Up-to-date
25838
25839   Working revision:	1\.2\.2\.2[^.]*
25840   Repository revision:	1\.2\.2\.2	${CVSROOT_DIRNAME}/first-dir/file2,v
25841   Commit Identifier:	${commitid}
25842   Sticky Tag:		br2 (branch: 1\.2\.2)
25843   Sticky Date:		(none)
25844   Sticky Options:	(none)
25845
25846===================================================================
25847File: file3            	Status: Up-to-date
25848
25849   Working revision:	1\.1\.2\.1[^.]*
25850   Repository revision:	1\.1\.2\.1	${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
25851   Commit Identifier:	${commitid}
25852   Sticky Tag:		br2 (branch: 1\.1\.2)
25853   Sticky Date:		(none)
25854   Sticky Options:	(none)"
25855
25856	  # Now check the contents of the files
25857	  dotest tagdate-28-trunk-t1 'cat first-dir-trunk-t1/file1' 'trunk-1'
25858	  dotest tagdate-28-br2-t1 'cat first-dir-br2-t1/file1' 'trunk-1'
25859	  dotest tagdate-28-trunk-t2 'cat first-dir-trunk-t2/file1' 'trunk-2'
25860	  dotest tagdate-28-br2-t2 'cat first-dir-br2-t2/file1' 'trunk-1'
25861	  dotest tagdate-28-br2-t3 'cat first-dir-br2-t3/file1' 'br2-1'
25862	  dotest tagdate-28-br2-t4 'cat first-dir-br2-t4/file1' 'br2-2'
25863	  dotest tagdate-28-br2-t6a 'cat first-dir-br2-t6/file1' "br2-2"
25864	  dotest tagdate-28-br2-t6b 'cat first-dir-br2-t6/file3' "br2-1"
25865	  dotest tagdate-28-trunk-t7a 'cat first-dir-trunk-t7/file1' "trunk-2"
25866	  dotest tagdate-28-trunk-t7b 'cat first-dir-trunk-t7/file2' "trunk-1"
25867	  dotest tagdate-28-br2-t7a 'cat first-dir-br2-t7/file1' "br2-2"
25868	  dotest tagdate-28-br2-t7b 'cat first-dir-br2-t7/file3' "br2-1"
25869	  dotest tagdate-28-trunk-t8a 'cat first-dir-trunk-t8/file1' "trunk-2"
25870	  dotest tagdate-28-trunk-t8b 'cat first-dir-trunk-t8/file2' "trunk-2"
25871	  dotest tagdate-28-br2-t8a 'cat first-dir-br2-t8/file1' "br2-2"
25872	  dotest tagdate-28-br2-t8c 'cat first-dir-br2-t8/file3' "br2-1"
25873	  dotest tagdate-28-br2-t9a 'cat first-dir-br2-t9/file1' "br2-2"
25874	  dotest tagdate-28-br2-t9b 'cat first-dir-br2-t9/file2' "br2-1"
25875	  dotest tagdate-28-br2-t9c 'cat first-dir-br2-t9/file3' "br2-1"
25876	  cd ..
25877
25878	  unset date_T1 date_T2 date_T3 date_T4 date_T5
25879	  unset date_T6 date_T7 date_T8 date_T9
25880	  TZ=$save_TZ
25881
25882	  dokeep
25883	  rm -r 1 2 3 4
25884	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
25885	  ;;
25886
25887
25888
25889	multibranch2)
25890	  # Commit the first delta on branch A when there is an older
25891	  # branch, B, that already has a delta.  A and B come from the
25892	  # same branch point.  Then verify that branches A and B are
25893	  # in the right order.
25894	  mkdir 1; cd 1
25895	  dotest multibranch2-1 "${testcvs} -q co -l ." ''
25896	  mkdir first-dir
25897	  dotest multibranch2-2 "${testcvs} add first-dir" \
25898"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
25899	  cd first-dir
25900
25901	  echo trunk-1 >file1
25902	  echo trunk-1 >file2
25903	  dotest multibranch2-3 "${testcvs} add file1 file2" \
25904"${SPROG} add: scheduling file .file1. for addition
25905${SPROG} add: scheduling file .file2. for addition
25906${SPROG} add: use .${SPROG} commit. to add these files permanently"
25907	  dotest multibranch2-4 "${testcvs} -q ci -m add" \
25908"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25909initial revision: 1\.1
25910$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
25911initial revision: 1\.1"
25912	  dotest multibranch2-5 "${testcvs} -q tag -b A" "T file1
25913T file2"
25914	  dotest multibranch2-6 "${testcvs} -q tag -b B" "T file1
25915T file2"
25916
25917	  dotest multibranch2-7 "${testcvs} -q update -r B" ''
25918	  echo branch-B >file1
25919	  echo branch-B >file2
25920	  dotest multibranch2-8 "${testcvs} -q ci -m modify-on-B" \
25921"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25922new revision: 1\.1\.4\.1; previous revision: 1\.1
25923$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
25924new revision: 1\.1\.4\.1; previous revision: 1\.1"
25925
25926	  dotest multibranch2-9 "${testcvs} -q update -r A" '[UP] file1
25927[UP] file2'
25928	  echo branch-A >file1
25929	  # When using cvs-1.9.20, this commit gets a failed assertion in rcs.c.
25930	  dotest multibranch2-10 "${testcvs} -q ci -m modify-on-A" \
25931"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
25932new revision: 1\.1\.2\.1; previous revision: 1\.1"
25933
25934	  dotest multibranch2-11 "${testcvs} -q log file1" \
25935"
25936RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25937Working file: file1
25938head: 1\.1
25939branch:
25940locks: strict
25941access list:
25942symbolic names:
25943	B: 1\.1\.0\.4
25944	A: 1\.1\.0\.2
25945keyword substitution: kv
25946total revisions: 3;	selected revisions: 3
25947description:
25948----------------------------
25949revision 1\.1
25950date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
25951branches:  1\.1\.2;  1\.1\.4;
25952add
25953----------------------------
25954revision 1\.1\.4\.1
25955date: ${ISO8601DATE};  author: $username;  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
25956modify-on-B
25957----------------------------
25958revision 1\.1\.2\.1
25959date: ${ISO8601DATE};  author: $username;  state: Exp;  lines: ${PLUS}1 -1;  commitid: ${commitid};
25960modify-on-A
25961============================================================================="
25962
25963	  # This one is more concise.
25964	  dotest multibranch2-12 "${testcvs} -q log -r1.1 file1" \
25965"
25966RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
25967Working file: file1
25968head: 1\.1
25969branch:
25970locks: strict
25971access list:
25972symbolic names:
25973	B: 1\.1\.0\.4
25974	A: 1\.1\.0\.2
25975keyword substitution: kv
25976total revisions: 3;	selected revisions: 1
25977description:
25978----------------------------
25979revision 1\.1
25980date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
25981branches:  1\.1\.2;  1\.1\.4;
25982add
25983============================================================================="
25984
25985	  # OK, try very much the same thing except we run update -j to
25986	  # bring the changes from B to A.  Probably tests many of the
25987	  # same code paths but might as well keep it separate, I guess.
25988
25989	  dotest multibranch2-13 "${testcvs} -q update -r B" "[UP] file1
25990[UP] file2"
25991	  dotest multibranch2-14 "${testcvs} -q update -r A -j B file2" \
25992"[UP] file2
25993RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
25994retrieving revision 1.1
25995retrieving revision 1.1.4.1
25996Merging differences between 1.1 and 1.1.4.1 into file2"
25997	  dotest multibranch2-15 "${testcvs} -q ci -m commit-on-A file2" \
25998"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
25999new revision: 1\.1\.2\.1; previous revision: 1\.1"
26000
26001	  dokeep
26002	  cd ../..
26003	  rm -r 1
26004	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
26005	  ;;
26006
26007
26008
26009	tag8k)
26010	  # In cvs-1.9.27, there is a bug that can cause an abort.
26011	  # It happens when you commit a change to a ,v file that has
26012	  # just the right amount of tag/branch info to align one of the
26013	  # semicolons in the branch info to be on a 8k-byte boundary.
26014	  # The result: rcsbuf_getkey got an abort.  This failure doesn't
26015	  # corrupt the ,v file -- that would be really serious.  But it
26016	  # does leave stale write locks that have to be removed manually.
26017
26018	  mkdir 1
26019	  cd 1
26020
26021	  module=x
26022
26023	  : > junk
26024	  dotest tag8k-1 "$testcvs -Q import -m . $module X Y" ''
26025	  dotest tag8k-2 "$testcvs -Q co $module" ''
26026	  cd $module
26027
26028	  file=m
26029	  : > $file
26030	  dotest tag8k-3 "$testcvs add $file" \
26031"$SPROG add: scheduling file .$file. for addition
26032$SPROG add: use .$SPROG commit. to add this file permanently"
26033	  dotest tag8k-4 "$testcvs -Q ci -m . $file"
26034
26035	  # It seems there have to be at least two versions.
26036	  echo a > $file
26037	  dotest tag8k-5 "$testcvs -Q ci -m . $file"
26038
26039	  # Add just under 8K worth of tags.
26040	  t=TAG---------------------------------------------------------------------
26041	  t=$t$t
26042	  t=$t$t$t$t$t
26043	  # Now $t is 720 bytes long.
26044
26045	  # Apply some tags with that long prefix.
26046	  dotest tag8k-6  "$testcvs -Q tag $t-0 $file" ''
26047	  dotest tag8k-7  "$testcvs -Q tag $t-1 $file" ''
26048	  dotest tag8k-8  "$testcvs -Q tag $t-2 $file" ''
26049	  dotest tag8k-9  "$testcvs -Q tag $t-3 $file" ''
26050	  dotest tag8k-10 "$testcvs -Q tag $t-4 $file" ''
26051	  dotest tag8k-11 "$testcvs -Q tag $t-5 $file" ''
26052	  dotest tag8k-12 "$testcvs -Q tag $t-6 $file" ''
26053	  dotest tag8k-13 "$testcvs -Q tag $t-7 $file" ''
26054	  dotest tag8k-14 "$testcvs -Q tag $t-8 $file" ''
26055	  dotest tag8k-15 "$testcvs -Q tag $t-9 $file" ''
26056	  dotest tag8k-16 "$testcvs -Q tag $t-a $file" ''
26057
26058	  # Extract the author value.
26059	  name=`sed -n 's/.*;	author \([^;]*\);.*/\1/p' ${CVSROOT_DIRNAME}/$module/$file,v|sed 1q`
26060
26061	  # Form a suffix string of length (16 - length($name)).
26062	  # CAREFUL: this will lose if $name is longer than 16.
26063	  sed_pattern=`echo $name|sed s/././g`
26064	  suffix=`echo 1234567890123456|sed s/$sed_pattern//`
26065
26066	  # Add a final tag with length chosen so that it will push the
26067	  # offset of the `;' in the 2nd occurrence of `;\tauthor' in the
26068	  # ,v file to exactly 8192.
26069	  dotest tag8k-17 "$testcvs -Q tag "x8bytes-$suffix" $file" ''
26070
26071	  # This commit would fail with 1.9.27.
26072	  echo a >> $file
26073	  dotest tag8k-18 "$testcvs -Q ci -m . $file"
26074
26075	  dokeep
26076	  cd ../..
26077	  rm -r 1
26078	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
26079	  ;;
26080
26081
26082
26083	admin)
26084	  # More "cvs admin" tests.
26085	  # The basicb-21 test tests rejecting an invalid option.
26086	  # For -l and -u, see "reserved" and "keyword" tests.
26087	  # "binfiles" test has a test of "cvs admin -k".
26088	  # "log2" test has tests of -t and -q options to cvs admin.
26089	  # "rcs" tests -b option also.
26090	  # For -o, see:
26091	  #   admin-22-o1 through admin-23 (various cases not involving ::)
26092	  #   binfiles2-o* (:rev, rev on trunk; rev:, deleting entire branch)
26093	  #   basicb-o* (attempt to delete all revisions)
26094	  #   basica-o1 through basica-o3 (basic :: usage)
26095	  #   head-o1 (::branch, where this deletes a revision or is noop)
26096	  #   branches-o1 (::branch, similar, with different branch topology)
26097	  #   log-o1 (1.3.2.1::)
26098	  #   binfiles-o1 (1.3:: and ::1.3; binary files)
26099	  #   binfiles3-9 (binary files)
26100	  #   Also could be testing:
26101	  #     1.3.2.6::1.3.2.8
26102	  #     1.3.2.6::1.3.2
26103	  #     1.3.2.1::1.3.2.6
26104	  #     1.3::1.3.2.6 (error?  or synonym for ::1.3.2.6?)
26105	  # -n: admin, tagf tests.
26106
26107	  # Test the postadmin hook as a side effect of the rest of the tests.
26108	  # See the `info' test for notes on where other script hooks are
26109	  # tested.
26110	  mkdir 2; cd 2
26111	  dotest admin-init-1 "$testcvs -Q co CVSROOT"
26112	  cd CVSROOT
26113	  echo "ALL $TESTDIR/2/loggit %r %p %c" >>postadmin
26114	  dotest admin-init-2 "$testcvs -Q ci -mlog-admin"
26115	  cd .. # 2
26116
26117	  cat >loggit <<EOF
26118#!$TESTSHELL
26119echo \${1+"\$@"} >>$TESTDIR/2/admin-log
26120EOF
26121	  # #^@&!^@ Cygwin.
26122	  if test -n "$remotehost"; then
26123	    $CVS_RSH $remotehost "chmod +x $TESTDIR/2/loggit"
26124	  else
26125	    chmod +x loggit
26126	  fi
26127	  cd .. # $TESTDIR
26128
26129
26130	  mkdir 1; cd 1
26131	  dotest admin-1 "${testcvs} -q co -l ." ''
26132	  mkdir first-dir
26133	  dotest admin-2 "${testcvs} add first-dir" \
26134"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
26135          cd first-dir
26136
26137	  dotest_fail admin-3 "${testcvs} -q admin -i file1" \
26138"${CPROG} admin: the -i option to admin is not supported
26139${CPROG} admin: run add or import to create an RCS file
26140${CPROG} \[admin aborted\]: specify ${CPROG} -H admin for usage information"
26141	  dotest_fail admin-4 "${testcvs} -q log file1" \
26142"${SPROG} log: nothing known about file1"
26143	  dotest_fail admin-4a "${testcvs} -q admin file1" \
26144"${SPROG} admin: nothing known about file1"
26145
26146	  # Set up some files, file2 a plain one and file1 with a revision
26147	  # on a branch.
26148	  touch file1 file2
26149	  dotest admin-5 "${testcvs} add file1 file2" \
26150"${SPROG} add: scheduling file .file1. for addition
26151${SPROG} add: scheduling file .file2. for addition
26152${SPROG} add: use .${SPROG} commit. to add these files permanently"
26153	  dotest admin-6 "${testcvs} -q ci -m add" \
26154"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
26155initial revision: 1\.1
26156$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
26157initial revision: 1\.1"
26158	  dotest admin-7 "${testcvs} -q tag -b br" "T file1
26159T file2"
26160	  dotest admin-8 "${testcvs} -q update -r br" ""
26161	  echo 'add a line on the branch' >> file1
26162	  echo 'add a file on the branch' >> file3
26163	  dotest admin-9a "${testcvs} -q add file3" \
26164"${SPROG} add: use .${SPROG} commit. to add this file permanently"
26165	  dotest admin-9b "${testcvs} -q ci -m modify-on-branch" \
26166"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
26167new revision: 1\.1\.2\.1; previous revision: 1\.1
26168$CVSROOT_DIRNAME/first-dir/Attic/file3,v  <--  file3
26169new revision: 1\.1\.2\.1; previous revision: 1\.1"
26170	  dotest admin-10 "${testcvs} -q update -A" \
26171"U file1
26172${SPROG} update: \`file3' is no longer in the repository"
26173
26174	  # Check that we can administer files in the repository that
26175	  # aren't in the working directory.
26176	  dotest admin-10-1 "${testcvs} admin ." \
26177"${SPROG} admin: Administrating .
26178RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26179done
26180RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26181done"
26182	  dotest admin-10-2 "${testcvs} -q admin file3" \
26183"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
26184done"
26185
26186	  # Try to recurse with a numeric revision arg.
26187	  # If we wanted to comprehensive about this, we would also test
26188	  # this for -l, -u, and all the different -o syntaxes.
26189	  dotest_fail admin-10a "${testcvs} -q admin -b1.1.2" \
26190"${CPROG} admin: while processing more than one file:
26191${CPROG} \[admin aborted\]: attempt to specify a numeric revision"
26192	  dotest_fail admin-10b "${testcvs} -q admin -m1.1:bogus file1 file2" \
26193"${CPROG} admin: while processing more than one file:
26194${CPROG} \[admin aborted\]: attempt to specify a numeric revision"
26195
26196	  # try a bad symbolic revision
26197	  dotest_fail admin-10c "${testcvs} -q admin -bBOGUS" \
26198"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26199${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/file1,v: Symbolic name BOGUS is undefined.
26200${SPROG} admin: RCS file for .file1. not modified\.
26201RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26202${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name BOGUS is undefined.
26203${SPROG} admin: RCS file for .file2. not modified\."
26204
26205	  # Note that -s option applies to the new default branch, not
26206	  # the old one.
26207	  # Also note that the implementation of -a via "rcs" requires
26208	  # no space between -a and the argument.  However, we expect
26209	  # to change that once CVS parses options.
26210	  dotest admin-11 "${testcvs} -q admin -afoo,bar -abaz \
26211-b1.1.2 -cxx -U -sfoo file1" \
26212"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26213done"
26214	  dotest admin-11a "${testcvs} log -N file1" "
26215RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26216Working file: file1
26217head: 1\.1
26218branch: 1\.1\.2
26219locks:
26220access list:
26221	foo
26222	bar
26223	baz
26224keyword substitution: kv
26225total revisions: 2;	selected revisions: 2
26226description:
26227----------------------------
26228revision 1\.1
26229date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
26230branches:  1\.1\.2;
26231add
26232----------------------------
26233revision 1\.1\.2\.1
26234date: ${ISO8601DATE};  author: ${username};  state: foo;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26235modify-on-branch
26236============================================================================="
26237	  dotest admin-12 "${testcvs} -q admin -bbr file1" \
26238"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26239done"
26240	  dotest admin-12a "${testcvs} log -N file1" "
26241RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26242Working file: file1
26243head: 1\.1
26244branch: 1\.1\.2
26245locks:
26246access list:
26247	foo
26248	bar
26249	baz
26250keyword substitution: kv
26251total revisions: 2;	selected revisions: 2
26252description:
26253----------------------------
26254revision 1\.1
26255date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
26256branches:  1\.1\.2;
26257add
26258----------------------------
26259revision 1\.1\.2\.1
26260date: ${ISO8601DATE};  author: ${username};  state: foo;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26261modify-on-branch
26262============================================================================="
26263
26264	  # "cvs log" doesn't print the comment leader.  RCS 5.7 will print
26265	  # the comment leader only if one specifies "-V4" to rlog.  So it
26266	  # seems like the only way to test it is by looking at the RCS file
26267	  # directly.  This also serves as a test of exporting RCS files
26268	  # (analogous to the import tests in "rcs").
26269	  # Rather than try to write a rigorous check for whether the
26270	  # file CVS exports is valid, we just write a simpler
26271	  # test for what CVS actually exports, and figure we can revise
26272	  # the check as needed (within the confines of the RCS5 format as
26273	  # documented in RCSFILES).
26274	  # Note that we must accept either 2 or 4 digit year.
26275	  dotest admin-13 "cat ${CVSROOT_DIRNAME}/first-dir/file1,v" \
26276"head	1\.1;
26277branch	1\.1\.2;
26278access
26279	foo
26280	bar
26281	baz;
26282symbols
26283	br:1\.1\.0\.2;
26284locks;
26285comment	@xx@;
26286
26287
262881\.1
26289date	${RCSDELTADATE};	author ${username};	state Exp;
26290branches
26291	1\.1\.2\.1;
26292next	;
26293commitid	${commitid};
26294
262951\.1\.2\.1
26296date	${RCSDELTADATE};	author ${username};	state foo;
26297branches;
26298next	;
26299commitid	${commitid};
26300
26301
26302desc
26303@@
26304
26305
263061\.1
26307log
26308@add
26309@
26310text
26311@@
26312
26313
263141\.1\.2\.1
26315log
26316@modify-on-branch
26317@
26318text
26319@a0 1
26320add a line on the branch
26321@"
26322	  dotest_fail admin-14-1 "${testcvs} -q admin \
26323-m1.1.1.1:changed-bogus-log-message file2" \
26324"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26325$SPROG admin: $CVSROOT_DIRNAME/first-dir/file2,v: no such revision 1\.1\.1\.1
26326$SPROG admin: RCS file for .file2. not modified."
26327	  dotest admin-14-2 "${testcvs} -q log file2" "
26328RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26329Working file: file2
26330head: 1\.1
26331branch:
26332locks: strict
26333access list:
26334symbolic names:
26335	br: 1\.1\.0\.2
26336keyword substitution: kv
26337total revisions: 1;	selected revisions: 1
26338description:
26339----------------------------
26340revision 1\.1
26341date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
26342add
26343============================================================================="
26344
26345	  dotest admin-14-3 "${testcvs} -q admin -aauth3 -aauth2,foo \
26346-soneone:1.1 -m1.1:changed-log-message -ntagone: file2" \
26347"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26348done"
26349	  dotest admin-15 "${testcvs} -q log file2" "
26350RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26351Working file: file2
26352head: 1\.1
26353branch:
26354locks: strict
26355access list:
26356	auth3
26357	auth2
26358	foo
26359symbolic names:
26360	tagone: 1\.1
26361	br: 1\.1\.0\.2
26362keyword substitution: kv
26363total revisions: 1;	selected revisions: 1
26364description:
26365----------------------------
26366revision 1\.1
26367date: ${ISO8601DATE};  author: ${username};  state: oneone;  commitid: ${commitid};
26368changed-log-message
26369============================================================================="
26370
26371	  dotest admin-16 "${testcvs} -q admin \
26372-A${CVSROOT_DIRNAME}/first-dir/file2,v -b -L -Nbr:1.1 file1" \
26373"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26374done"
26375	  dotest admin-17 "${testcvs} -q log file1" "
26376RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26377Working file: file1
26378head: 1\.1
26379branch:
26380locks: strict
26381access list:
26382	foo
26383	bar
26384	baz
26385	auth3
26386	auth2
26387symbolic names:
26388	br: 1\.1
26389keyword substitution: kv
26390total revisions: 2;	selected revisions: 2
26391description:
26392----------------------------
26393revision 1\.1
26394date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
26395branches:  1\.1\.2;
26396add
26397----------------------------
26398revision 1\.1\.2\.1
26399date: ${ISO8601DATE};  author: ${username};  state: foo;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26400modify-on-branch
26401============================================================================="
26402
26403	  dotest_fail admin-18 "${testcvs} -q admin -nbr:1.1.2 file1" \
26404"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26405${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/file1,v: symbolic name br already bound to 1\.1
26406${SPROG} admin: RCS file for .file1. not modified\."
26407	  dotest admin-19 "${testcvs} -q admin -ebaz -ebar,auth3 -nbr file1" \
26408"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26409done"
26410	  dotest admin-20 "${testcvs} -q log file1" "
26411RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26412Working file: file1
26413head: 1\.1
26414branch:
26415locks: strict
26416access list:
26417	foo
26418	auth2
26419symbolic names:
26420keyword substitution: kv
26421total revisions: 2;	selected revisions: 2
26422description:
26423----------------------------
26424revision 1\.1
26425date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
26426branches:  1\.1\.2;
26427add
26428----------------------------
26429revision 1.1.2.1
26430date: ${ISO8601DATE};  author: ${username};  state: foo;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26431modify-on-branch
26432============================================================================="
26433
26434	  # OK, this is starting to get ridiculous, in terms of
26435	  # testing a feature (access lists) which doesn't do anything
26436	  # useful, but what about nonexistent files and
26437	  # relative pathnames in admin -A?
26438	  dotest_fail admin-19a-nonexist \
26439"${testcvs} -q admin -A${TESTDIR}/foo/bar file1" \
26440"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26441${SPROG} admin: Couldn't open rcs file .${TESTDIR}/foo/bar.: No such file or directory
26442${SPROG} \[admin aborted\]: cannot continue"
26443
26444	  # In the remote case, we are cd'd off into the temp directory
26445	  # and so these tests give "No such file or directory" errors.
26446	  if $remote; then :; else
26447	    dotest admin-19a-admin "${testcvs} -q admin -A../../cvsroot/first-dir/file2,v file1" \
26448"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26449done"
26450	    dotest admin-19a-log "${testcvs} -q log -h -N file1" "
26451RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26452Working file: file1
26453head: 1\.1
26454branch:
26455locks: strict
26456access list:
26457	foo
26458	auth2
26459	auth3
26460keyword substitution: kv
26461total revisions: 2
26462============================================================================="
26463	  fi # end of tests skipped for remote
26464
26465	  # Now test that plain -e works right.
26466	  dotest admin-19a-2 "${testcvs} -q admin -e file1" \
26467"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26468done"
26469	  dotest admin-19a-3 "${testcvs} -q log -h -N file1" "
26470RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26471Working file: file1
26472head: 1\.1
26473branch:
26474locks: strict
26475access list:
26476keyword substitution: kv
26477total revisions: 2
26478============================================================================="
26479
26480	  # Put the access list back, to avoid special cases later.
26481	  dotest admin-19a-4 "${testcvs} -q admin -afoo,auth2 file1" \
26482"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26483done"
26484
26485	  # Add another revision to file2, so we can delete one.
26486	  echo 'add a line' >> file2
26487	  dotest admin-21 "${testcvs} -q ci -m modify file2" \
26488"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
26489new revision: 1\.2; previous revision: 1\.1"
26490	  dotest admin-22 "${testcvs} -q admin -o1.1 file2" \
26491"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26492deleting revision 1\.1
26493done"
26494	  # Test admin -o.  More variants that we could be testing:
26495	  # * REV: [on branch]
26496	  # * REV1:REV2 [deleting whole branch]
26497	  # * high branch numbers (e.g. 1.2.2.3.2.3)
26498	  # ... and probably others.  See RCS_delete_revs for ideas.
26499
26500	  echo first rev > aaa
26501	  dotest admin-22-o1 "${testcvs} add aaa" \
26502"${SPROG} add: scheduling file .aaa. for addition
26503${SPROG} add: use .${SPROG} commit. to add this file permanently"
26504	  dotest admin-22-o2 "${testcvs} -q ci -m first aaa" \
26505"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
26506initial revision: 1\.1"
26507	  echo second rev >> aaa
26508	  dotest admin-22-o3 "${testcvs} -q ci -m second aaa" \
26509"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
26510new revision: 1\.2; previous revision: 1\.1"
26511	  echo third rev >> aaa
26512	  dotest admin-22-o4 "${testcvs} -q ci -m third aaa" \
26513"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
26514new revision: 1\.3; previous revision: 1\.2"
26515	  echo fourth rev >> aaa
26516	  dotest admin-22-o5 "${testcvs} -q ci -m fourth aaa" \
26517"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
26518new revision: 1\.4; previous revision: 1\.3"
26519	  echo fifth rev >>aaa
26520	  dotest admin-22-o6 "${testcvs} -q ci -m fifth aaa" \
26521"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
26522new revision: 1\.5; previous revision: 1\.4"
26523	  echo sixth rev >> aaa
26524	  dotest admin-22-o7 "${testcvs} -q ci -m sixth aaa" \
26525"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
26526new revision: 1\.6; previous revision: 1\.5"
26527	  dotest admin-22-o8 "${testcvs} admin -l1.6 aaa" \
26528"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
265291\.6 locked
26530done"
26531	  dotest admin-22-o9 "${testcvs} log -r1.6 aaa" "
26532RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
26533Working file: aaa
26534head: 1\.6
26535branch:
26536locks: strict
26537	${username}: 1\.6
26538access list:
26539symbolic names:
26540keyword substitution: kv
26541total revisions: 6;	selected revisions: 1
26542description:
26543----------------------------
26544revision 1\.6	locked by: ${username};
26545date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26546sixth
26547============================================================================="
26548	  dotest_fail admin-22-o10 "${testcvs} admin -o1.5: aaa" \
26549"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
26550${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/aaa,v: can't remove locked revision 1\.6
26551${SPROG} admin: RCS file for .aaa. not modified\."
26552	  dotest admin-22-o11 "${testcvs} admin -u aaa" \
26553"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
265541\.6 unlocked
26555done"
26556	  dotest admin-22-o12 "${testcvs} admin -o1.5: aaa" \
26557"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
26558deleting revision 1\.6
26559deleting revision 1\.5
26560done"
26561	  dotest admin-22-o13 "${testcvs} log aaa" "
26562RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
26563Working file: aaa
26564head: 1\.4
26565branch:
26566locks: strict
26567access list:
26568symbolic names:
26569keyword substitution: kv
26570total revisions: 4;	selected revisions: 4
26571description:
26572----------------------------
26573revision 1\.4
26574date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26575fourth
26576----------------------------
26577revision 1\.3
26578date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26579third
26580----------------------------
26581revision 1\.2
26582date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26583second
26584----------------------------
26585revision 1\.1
26586date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
26587first
26588============================================================================="
26589
26590	  dotest admin-22-o14 "${testcvs} tag -b -r1.3 br1 aaa" "T aaa"
26591	  dotest admin-22-o15 "${testcvs} update -rbr1 aaa" "U aaa"
26592	  echo new branch rev >> aaa
26593	  dotest admin-22-o16 "${testcvs} ci -m new-branch aaa" \
26594"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
26595new revision: 1\.3\.2\.1; previous revision: 1\.3"
26596	  dotest_fail admin-22-o17 "${testcvs} admin -o1.2:1.4 aaa" \
26597"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
26598deleting revision 1\.4
26599${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/aaa,v: can't remove branch point 1\.3
26600${SPROG} admin: RCS file for .aaa. not modified\."
26601	  dotest admin-22-o18 "${testcvs} update -p -r1.4 aaa" \
26602"===================================================================
26603Checking out aaa
26604RCS:  ${CVSROOT_DIRNAME}/first-dir/aaa,v
26605VERS: 1\.4
26606\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
26607first rev
26608second rev
26609third rev
26610fourth rev"
26611	  echo second branch rev >> aaa
26612	  dotest admin-22-o19 "${testcvs} ci -m branch-two aaa" \
26613"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
26614new revision: 1\.3\.2\.2; previous revision: 1\.3\.2\.1"
26615	  echo third branch rev >> aaa
26616	  dotest admin-22-o20 "${testcvs} ci -m branch-three aaa" \
26617"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
26618new revision: 1\.3\.2\.3; previous revision: 1\.3\.2\.2"
26619	  echo fourth branch rev >> aaa
26620	  dotest admin-22-o21 "${testcvs} ci -m branch-four aaa" \
26621"$CVSROOT_DIRNAME/first-dir/aaa,v  <--  aaa
26622new revision: 1\.3\.2\.4; previous revision: 1\.3\.2\.3"
26623	  dotest admin-22-o22 "${testcvs} admin -o:1.3.2.3 aaa" \
26624"RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
26625deleting revision 1\.3\.2\.1
26626deleting revision 1\.3\.2\.2
26627deleting revision 1\.3\.2\.3
26628done"
26629	  dotest admin-22-o23 "${testcvs} log aaa" "
26630RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
26631Working file: aaa
26632head: 1\.4
26633branch:
26634locks: strict
26635access list:
26636symbolic names:
26637	br1: 1\.3\.0\.2
26638keyword substitution: kv
26639total revisions: 5;	selected revisions: 5
26640description:
26641----------------------------
26642revision 1\.4
26643date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26644fourth
26645----------------------------
26646revision 1\.3
26647date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26648branches:  1\.3\.2;
26649third
26650----------------------------
26651revision 1\.2
26652date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26653second
26654----------------------------
26655revision 1\.1
26656date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
26657first
26658----------------------------
26659revision 1\.3\.2\.4
26660date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}4 -0;  commitid: ${commitid};
26661branch-four
26662============================================================================="
26663
26664	  dotest admin-22-o24 "${testcvs} -q update -p -r 1.3.2.4 aaa" \
26665"first rev
26666second rev
26667third rev
26668new branch rev
26669second branch rev
26670third branch rev
26671fourth branch rev"
26672
26673	  # The bit here about how there is a "tagone" tag pointing to
26674	  # a nonexistent revision is documented by rcs.  I dunno, I
26675	  # wonder whether the "cvs admin -o" should give a warning in
26676	  # this case.
26677	  dotest admin-23 "${testcvs} -q log file2" "
26678RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26679Working file: file2
26680head: 1\.2
26681branch:
26682locks: strict
26683access list:
26684	auth3
26685	auth2
26686	foo
26687symbolic names:
26688	tagone: 1\.1
26689	br: 1\.1\.0\.2
26690keyword substitution: kv
26691total revisions: 1;	selected revisions: 1
26692description:
26693----------------------------
26694revision 1\.2
26695date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
26696modify
26697============================================================================="
26698
26699	  dotest admin-25 "cat ${CVSROOT_DIRNAME}/first-dir/file1,v" \
26700"head	1\.1;
26701access
26702	foo
26703	auth2;
26704symbols;
26705locks; strict;
26706comment	@xx@;
26707
26708
267091\.1
26710date	${RCSDELTADATE};	author ${username};	state Exp;
26711branches
26712	1\.1\.2\.1;
26713next	;
26714commitid	${commitid};
26715
267161\.1\.2\.1
26717date	${RCSDELTADATE};	author ${username};	state foo;
26718branches;
26719next	;
26720commitid	${commitid};
26721
26722
26723desc
26724@@
26725
26726
267271\.1
26728log
26729@add
26730@
26731text
26732@@
26733
26734
267351\.1\.2\.1
26736log
26737@modify-on-branch
26738@
26739text
26740@a0 1
26741add a line on the branch
26742@"
26743
26744	  # Tests of cvs admin -n.  Make use of the results of
26745	  # admin-1 through admin-25.
26746	  # FIXME: We probably shouldn't make use of those results;
26747	  # this test is way too long as it is.
26748
26749	  # tagtwo should be a revision
26750	  #
26751	  dotest admin-26-1 "${testcvs} admin -ntagtwo:tagone file2" \
26752"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26753done"
26754
26755	  # br1 should be a branch
26756	  #
26757	  dotest admin-26-2 "${testcvs} admin -nbr1:br file2" \
26758"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26759done"
26760
26761	  # Attach some tags using RCS versions
26762	  #
26763	  dotest admin-26-3 "${testcvs} admin -ntagthree:1.1 file2" \
26764"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26765done"
26766
26767	  dotest admin-26-4 "${testcvs} admin -nbr2:1.1.2 file2"  \
26768"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26769done"
26770
26771	  dotest admin-26-5 "${testcvs} admin -nbr4:1.1.0.2 file2"  \
26772"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26773done"
26774
26775	  # Check results so far
26776	  #
26777	  dotest admin-26-6 "${testcvs} status -v file2" \
26778"===================================================================
26779File: file2            	Status: Up-to-date
26780
26781   Working revision:	1\.2.*
26782   Repository revision:	1\.2	${CVSROOT_DIRNAME}/first-dir/file2,v
26783   Commit Identifier:	${commitid}
26784   Sticky Tag:		(none)
26785   Sticky Date:		(none)
26786   Sticky Options:	(none)
26787
26788   Existing Tags:
26789	br4                      	(branch: 1\.1\.2)
26790	br2                      	(branch: 1\.1\.2)
26791	tagthree                 	(revision: 1\.1)
26792	br1                      	(branch: 1\.1\.2)
26793	tagtwo                   	(revision: 1\.1)
26794	tagone                   	(revision: 1\.1)
26795	br                       	(branch: 1\.1\.2)"
26796
26797
26798	  # Add a couple more revisions
26799	  #
26800	  echo "nuthr_line" >> file2
26801	  dotest admin-27-1 "${testcvs} commit -m nuthr_line file2"  \
26802"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
26803new revision: 1\.3; previous revision: 1\.2"
26804
26805	  echo "yet_another" >> file2
26806	  dotest admin-27-2 "${testcvs} commit -m yet_another file2"  \
26807"$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
26808new revision: 1\.4; previous revision: 1\.3"
26809
26810	  # Fail trying to reattach existing tag with -n
26811	  #
26812	  dotest admin-27-3 "${testcvs} admin -ntagfour:1.1 file2"  \
26813"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26814done"
26815
26816	  dotest_fail admin-27-4 "${testcvs} admin -ntagfour:1.3 file2"  \
26817"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26818${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: symbolic name tagfour already bound to 1\.1
26819${SPROG} admin: RCS file for .file2. not modified\."
26820
26821	  # Succeed at reattaching existing tag, using -N
26822	  #
26823	  dotest admin-27-5 "${testcvs} admin -Ntagfour:1.3 file2"  \
26824"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26825done"
26826
26827	  # Fail on some bogus operations
26828	  # Try to attach to nonexistant tag
26829	  #
26830	  dotest_fail admin-28-1 "${testcvs} admin -ntagsix:tagfive file2" \
26831"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26832${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name or revision tagfive is undefined\.
26833${SPROG} admin: RCS file for .file2. not modified\."
26834
26835	  # Try a some nonexisting numeric target tags
26836	  #
26837	  dotest_fail admin-28-2 "${testcvs} admin -ntagseven:2.1 file2"  \
26838"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26839${SPROG} \[admin aborted\]: revision .2\.1. does not exist"
26840
26841	  dotest_fail admin-28-3 "${testcvs} admin -ntageight:2.1.2 file2"  \
26842"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26843${SPROG} \[admin aborted\]: revision .2\.1\.2. does not exist"
26844
26845	  # Try some invalid targets
26846	  #
26847	  dotest_fail admin-28-4 "${testcvs} admin -ntagnine:1.a.2 file2"  \
26848"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26849${SPROG} \[admin aborted\]: tag .1\.a\.2. must start with a letter"
26850
26851	  # Confirm that a missing tag is not a fatal error.
26852	  dotest admin-28-5.1 "${testcvs} -Q tag BO+GUS file1" ''
26853	  dotest_fail admin-28-5.2 "${testcvs} admin -ntagten:BO+GUS file2 file1"  \
26854"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26855${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: Symbolic name or revision BO${PLUS}GUS is undefined\.
26856${SPROG} admin: RCS file for .file2. not modified\.
26857RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26858done"
26859
26860	  dotest_fail admin-28-6 "${testcvs} admin -nq.werty:tagfour file2"  \
26861"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26862${SPROG} \[admin aborted\]: tag .q\.werty. must not contain the characters ..*"
26863
26864	  # Verify the archive
26865	  #
26866	  dotest admin-29 "cat ${CVSROOT_DIRNAME}/first-dir/file2,v" \
26867"head	1\.4;
26868access
26869	auth3
26870	auth2
26871	foo;
26872symbols
26873	tagfour:1\.3
26874	br4:1\.1\.0\.2
26875	br2:1\.1\.0\.2
26876	tagthree:1\.1
26877	br1:1\.1\.0\.2
26878	tagtwo:1\.1
26879	tagone:1\.1
26880	br:1\.1\.0\.2;
26881locks; strict;
26882comment	@# @;
26883
26884
268851\.4
26886date	${RCSDELTADATE};	author ${username};	state Exp;
26887branches;
26888next	1\.3;
26889commitid	${commitid};
26890
268911\.3
26892date	${RCSDELTADATE};	author ${username};	state Exp;
26893branches;
26894next	1\.2;
26895commitid	${commitid};
26896
268971\.2
26898date	${RCSDELTADATE};	author ${username};	state Exp;
26899branches;
26900next	;
26901commitid	${commitid};
26902
26903
26904desc
26905@@
26906
26907
269081\.4
26909log
26910@yet_another
26911@
26912text
26913@add a line
26914nuthr_line
26915yet_another
26916@
26917
26918
269191\.3
26920log
26921@nuthr_line
26922@
26923text
26924@d3 1
26925@
26926
26927
269281\.2
26929log
26930@modify
26931@
26932text
26933@d2 1
26934@"
26935
26936	  dotest_fail admin-30 "${testcvs} admin -mbr:another-log-message \
26937file2 aaa file3" \
26938"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
26939${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/file2,v: no such revision br: 1\.1
26940${SPROG} admin: RCS file for .file2. not modified.
26941RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
26942${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/aaa,v: no such revision br
26943${SPROG} admin: RCS file for .aaa. not modified.
26944RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
26945done"
26946	  dotest admin-31 "${testcvs} log" \
26947"${SPROG} log: Logging \.
26948
26949RCS file: ${CVSROOT_DIRNAME}/first-dir/aaa,v
26950Working file: aaa
26951head: 1\.4
26952branch:
26953locks: strict
26954access list:
26955symbolic names:
26956	br1: 1\.3\.0\.2
26957keyword substitution: kv
26958total revisions: 5;	selected revisions: 5
26959description:
26960----------------------------
26961revision 1\.4
26962date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26963fourth
26964----------------------------
26965revision 1\.3
26966date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26967branches:  1\.3\.2;
26968third
26969----------------------------
26970revision 1\.2
26971date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
26972second
26973----------------------------
26974revision 1\.1
26975date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
26976first
26977----------------------------
26978revision 1\.3\.2\.4
26979date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}4 -0;  commitid: ${commitid};
26980branch-four
26981=============================================================================
26982
26983RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
26984Working file: file1
26985head: 1\.1
26986branch:
26987locks: strict
26988access list:
26989	foo
26990	auth2
26991symbolic names:
26992	tagten: 1\.1
26993	BO${PLUS}GUS: 1\.1
26994keyword substitution: kv
26995total revisions: 2;	selected revisions: 2
26996description:
26997----------------------------
26998revision 1\.1
26999date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
27000branches:  1\.1\.2;
27001add
27002----------------------------
27003revision 1\.1\.2\.1
27004date: ${ISO8601DATE};  author: ${username};  state: foo;  lines: ${PLUS}1 -0;  commitid: ${commitid};
27005modify-on-branch
27006=============================================================================
27007
27008RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
27009Working file: file2
27010head: 1\.4
27011branch:
27012locks: strict
27013access list:
27014	auth3
27015	auth2
27016	foo
27017symbolic names:
27018	tagfour: 1\.3
27019	br4: 1\.1\.0\.2
27020	br2: 1\.1\.0\.2
27021	tagthree: 1\.1
27022	br1: 1\.1\.0\.2
27023	tagtwo: 1\.1
27024	tagone: 1\.1
27025	br: 1\.1\.0\.2
27026keyword substitution: kv
27027total revisions: 3;	selected revisions: 3
27028description:
27029----------------------------
27030revision 1\.4
27031date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
27032yet_another
27033----------------------------
27034revision 1\.3
27035date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
27036nuthr_line
27037----------------------------
27038revision 1\.2
27039date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
27040modify
27041=============================================================================
27042
27043RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
27044Working file: file3
27045head: 1\.1
27046branch:
27047locks: strict
27048access list:
27049symbolic names:
27050	br: 1\.1\.0\.2
27051keyword substitution: kv
27052total revisions: 2;	selected revisions: 2
27053description:
27054----------------------------
27055revision 1\.1
27056date: ${ISO8601DATE};  author: ${username};  state: dead;  commitid: ${commitid};
27057branches:  1\.1\.2;
27058file file3 was initially added on branch br\.
27059----------------------------
27060revision 1\.1\.2\.1
27061date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
27062another-log-message
27063============================================================================="
27064
27065	  # Currently, this test outputs 36 identical lines, so I am just
27066	  # checking $DOTSTAR for brevity.
27067	  dotest admin-postadmin-examine-1 "cat $TESTDIR/2/admin-log" \
27068"$CVSROOT_DIRNAME first-dir admin$DOTSTAR"
27069
27070	  dokeep
27071
27072	  # clean up our after ourselves
27073	  restore_adm
27074	  cd ../..
27075	  rm -r 1 2
27076	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
27077	  ;;
27078
27079
27080
27081	reserved)
27082	  # Tests of reserved checkouts.  Eventually this will test
27083	  # rcslock.pl (or equivalent) and all kinds of stuff.  Right
27084	  # now it just does some very basic checks on cvs admin -u
27085	  # and cvs admin -l.
27086	  # Also should test locking on a branch (and making sure that
27087	  # locks from one branch don't get mixed up with those from
27088	  # another.  Both the case where one of the branches is the
27089	  # main branch, and in which neither one is).
27090	  # See also test keyword, which tests that keywords and -kkvl
27091	  # do the right thing in the presence of locks.
27092
27093	  # The usual setup, directory first-dir containing file file1.
27094	  mkdir 1; cd 1
27095	  dotest reserved-1 "${testcvs} -q co -l ." ''
27096	  mkdir first-dir
27097	  dotest reserved-2 "${testcvs} add first-dir" \
27098"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
27099          cd first-dir
27100	  touch file1
27101	  dotest reserved-3 "${testcvs} add file1" \
27102"${SPROG} add: scheduling file .file1. for addition
27103${SPROG} add: use .${SPROG} commit. to add this file permanently"
27104	  dotest reserved-4 "${testcvs} -q ci -m add" \
27105"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
27106initial revision: 1\.1"
27107
27108	  dotest reserved-5 "${testcvs} -q admin -l file1" \
27109"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
271101\.1 locked
27111done"
27112	  dotest reserved-6 "${testcvs} log -N file1" "
27113RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
27114Working file: file1
27115head: 1\.1
27116branch:
27117locks: strict
27118	${username}: 1\.1
27119access list:
27120keyword substitution: kv
27121total revisions: 1;	selected revisions: 1
27122description:
27123----------------------------
27124revision 1\.1	locked by: ${username};
27125date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
27126add
27127============================================================================="
27128
27129	  # Note that this just tests the owner of the lock giving
27130	  # it up.  It doesn't test breaking a lock.
27131	  dotest reserved-7 "${testcvs} -q admin -u file1" \
27132"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
271331\.1 unlocked
27134done"
27135
27136	  dotest reserved-8 "${testcvs} log -N file1" "
27137RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
27138Working file: file1
27139head: 1\.1
27140branch:
27141locks: strict
27142access list:
27143keyword substitution: kv
27144total revisions: 1;	selected revisions: 1
27145description:
27146----------------------------
27147revision 1\.1
27148date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
27149add
27150============================================================================="
27151
27152	  # rcslock.pl tests.  Of course, the point isn't to test
27153	  # rcslock.pl from the distribution but equivalent
27154	  # functionality (for example, many sites may have an old
27155	  # rcslock.pl).  The functionality of this hook falls
27156	  # short of the real rcslock.pl though.
27157	  # Note that we can use rlog or look at the RCS file directly,
27158	  # but we can't use "cvs log" because "cvs commit" has a lock.
27159
27160	  cat >${TESTDIR}/lockme <<EOF
27161#!${TESTSHELL}
27162line=\`grep <\$1/\$2,v 'locks $anyusername:1\.[0-9];'\`
27163if test -z "\$line"; then
27164  # It isn't locked
27165  exit 0
27166else
27167  user=\`echo \$line | sed -e 's/locks \\($anyusername\\):[0-9.]*;.*/\\1/'\`
27168  version=\`echo \$line | sed -e 's/locks $anyusername:\\([0-9.]*\\);.*/\\1/'\`
27169  echo "\$user has file a-lock locked for version  \$version" >&2
27170  exit 1
27171fi
27172EOF
27173	  # Cygwin.  Blaaarg.
27174	  if test -n "$remotehost"; then
27175	    $CVS_RSH $remotehost "chmod +x ${TESTDIR}/lockme"
27176	  else
27177	    chmod +x ${TESTDIR}/lockme
27178	  fi
27179
27180	  echo stuff > a-lock
27181	  dotest reserved-9 "${testcvs} add a-lock" \
27182"${SPROG} add: scheduling file .a-lock. for addition
27183${SPROG} add: use .${SPROG} commit. to add this file permanently"
27184	  dotest reserved-10 "${testcvs} -q ci -m new a-lock" \
27185"$CVSROOT_DIRNAME/first-dir/a-lock,v  <--  a-lock
27186initial revision: 1\.1"
27187	  # FIXME: the contents of CVSROOT fluctuate a lot
27188	  # here. Maybe the expect pattern should just
27189	  # confirm that commitinfo is one of the files checked out,
27190	  # but for now we just check that CVS exited with success.
27191	  cd ..
27192	  if ${testcvs} -q co CVSROOT >>${LOGFILE} ; then
27193	    pass reserved-11
27194	  else
27195	    fail reserved-11
27196	  fi
27197	  cd CVSROOT
27198	  echo "DEFAULT ${TESTDIR}/lockme" >>commitinfo
27199	  dotest reserved-12 "${testcvs} -q ci -m rcslock commitinfo" \
27200"$CVSROOT_DIRNAME/CVSROOT/commitinfo,v  <--  commitinfo
27201new revision: 1\.2; previous revision: 1\.1
27202$SPROG commit: Rebuilding administrative file database"
27203	  cd ..; cd first-dir
27204
27205	  # Simulate (approximately) what a-lock would look like
27206	  # if someone else had locked revision 1.1.
27207	  sed -e 's/locks; strict;/locks fred:1.1; strict;/' ${CVSROOT_DIRNAME}/first-dir/a-lock,v > a-lock,v
27208	  # Cygwin.
27209	  if test -n "$remotehost"; then
27210	    $CVS_RSH $remotehost "chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v"
27211	  else
27212	    chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
27213	  fi
27214	  dotest reserved-13 "mv a-lock,v ${CVSROOT_DIRNAME}/first-dir/a-lock,v"
27215	  # Cygwin.  Blah.
27216	  if test -n "$remotehost"; then
27217	    $CVS_RSH $remotehost "chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v"
27218	  else
27219	    chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
27220	  fi
27221	  echo more stuff >> a-lock
27222	  dotest_fail_sort reserved-13b "$testcvs ci -m '' a-lock" \
27223"    \"$TESTDIR/lockme\"
27224Appending defaults (\" %r/%p %s\"), but please be aware that this usage is
27225$SPROG \[commit aborted\]: correct above errors first!
27226$SPROG commit: Pre-commit check failed
27227$SPROG commit: warning: commitinfo line contains no format strings:
27228deprecated\.
27229fred has file a-lock locked for version  1\.1"
27230	  # OK, now test "cvs admin -l" in the case where someone
27231	  # else has the file locked.
27232	  dotest_fail reserved-13c "${testcvs} admin -l a-lock" \
27233"RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
27234${SPROG} \[admin aborted\]: Revision 1\.1 is already locked by fred"
27235
27236	  dotest reserved-14 "${testcvs} admin -u1.1 a-lock" \
27237"RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v
27238${SPROG} admin: ${CVSROOT_DIRNAME}/first-dir/a-lock,v: revision 1\.1 locked by fred; breaking lock
272391\.1 unlocked
27240done"
27241	  dotest reserved-15 "$testcvs -q ci -m success a-lock" \
27242"$SPROG commit: warning: commitinfo line contains no format strings:
27243    \"$TESTDIR/lockme\"
27244Appending defaults (\" %r/%p %s\"), but please be aware that this usage is
27245deprecated\.
27246$CVSROOT_DIRNAME/first-dir/a-lock,v  <--  a-lock
27247new revision: 1\.2; previous revision: 1\.1"
27248
27249	  # Now test for a bug involving branches and locks
27250	  sed -e 's/locks; strict;/locks fred:1.2; strict;/' ${CVSROOT_DIRNAME}/first-dir/a-lock,v > a-lock,v
27251	  chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
27252	  dotest reserved-16 \
27253"mv a-lock,v ${CVSROOT_DIRNAME}/first-dir/a-lock,v" ""
27254	  chmod 444 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
27255	  dotest reserved-17 "${testcvs} -q tag -b br a-lock" "T a-lock"
27256	  dotest reserved-18 "${testcvs} -q update -r br a-lock" ""
27257	  echo edit it >>a-lock
27258	  dotest reserved-19 "${testcvs} -q ci -m modify a-lock" \
27259"$SPROG commit: warning: commitinfo line contains no format strings:
27260    \"$TESTDIR/lockme\"
27261Appending defaults (\" %r/%p %s\"), but please be aware that this usage is
27262deprecated\.
27263$CVSROOT_DIRNAME/first-dir/a-lock,v  <--  a-lock
27264new revision: 1\.2\.2\.1; previous revision: 1\.2"
27265
27266	  # undo commitinfo changes
27267	  cd ../CVSROOT
27268	  echo '# vanilla commitinfo' >commitinfo
27269	  dotest reserved-cleanup-1 "${testcvs} -q ci -m back commitinfo" \
27270"$SPROG commit: warning: commitinfo line contains no format strings:
27271    \"$TESTDIR/lockme\"
27272Appending defaults (\" %r/%p %s\"), but please be aware that this usage is
27273deprecated\.
27274$CVSROOT_DIRNAME/CVSROOT/commitinfo,v  <--  commitinfo
27275new revision: 1\.3; previous revision: 1\.2
27276$SPROG commit: Rebuilding administrative file database"
27277
27278	  dokeep
27279	  cd ..; rm -r CVSROOT
27280	  cd ..
27281	  rm -r 1
27282	  rm $TESTDIR/lockme
27283	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
27284	  ;;
27285
27286
27287
27288        diffmerge1)
27289	  # Make sure CVS can merge correctly in circumstances where it
27290	  # used to mess up (due to a bug which existed in diffutils 2.7
27291	  # and 2.6, but not 2.5, and which has been fixed in CVS's diff
27292	  # lib by Paul Eggert, bless his bitty heart).
27293
27294	  # This first test involves two working copies, "mine" and
27295	  # "yours", checked out from the same repository at the same
27296	  # time.  In yours, you remove some text from the end of the
27297	  # file and check it in; meanwhile, "me" has commented out some
27298	  # lines earlier in the file, and I go to check it in right
27299	  # after you checked yours in.  CVS naturally tells me the file
27300	  # is not up-to-date, so I run cvs update, but it updates
27301	  # incorrectly, leaving in the lines of text you just deleted.
27302	  # Bad!  I'm in too much of a hurry to actually look at the
27303	  # file, so I check it in and go home, and so your changes have
27304	  # been lost.  Later you discover this, and you suspect me of
27305	  # deliberately sabotaging your work, so you let all the air
27306	  # out of my tires.  Only after a series of expensive lawsuits
27307	  # and countersuits do we discover that this was all CVS's
27308	  # fault.
27309	  #
27310	  # Luckily, this problem has been fixed now, as our test will
27311	  # handily confirm, no doubt:
27312
27313	  # First make a repository containing the original text:
27314
27315	  # We should be here anyway, but cd to it just in case:
27316	  cd ${TESTDIR}
27317
27318	  mkdir diffmerge1
27319	  cd diffmerge1
27320
27321	  # These are the files we both start out with:
27322	  mkdir import
27323	  cd import
27324	  diffmerge_create_older_files
27325
27326	  dotest diffmerge1_import \
27327	    "${testcvs} import -m import diffmerge1 tag1 tag2" \
27328	    "${DOTSTAR}No conflicts created by this import"
27329	  cd ..
27330
27331	  # Check out two working copies, one for "you" and one for
27332	  # "me".  If no branch is used and cvs detects that only one
27333	  # of the two people made changes, then cvs does not run the
27334	  # merge algorithm.  But if a branch is used, then cvs does run
27335	  # the merge algorithm (even in this case of only one of the two
27336	  # people having made changes).  CVS used to have a bug in this
27337	  # case.  Therefore, it is important to test this case by
27338	  # using a branch:
27339	  ${testcvs} rtag     -b tag diffmerge1 >/dev/null 2>&1
27340	  ${testcvs} checkout -r tag diffmerge1 >/dev/null 2>&1
27341	  mv diffmerge1 yours
27342	  ${testcvs} checkout diffmerge1 >/dev/null 2>&1
27343	  mv diffmerge1 mine
27344
27345	  # In your working copy, you'll make changes, and
27346	  # then check in your changes before I check in mine:
27347	  cd yours
27348	  diffmerge_create_your_files
27349          dotest diffmerge1_yours "${testcvs} -q ci -m yours" \
27350"$CVSROOT_DIRNAME/diffmerge1/testcase01,v  <--  testcase01
27351new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
27352$CVSROOT_DIRNAME/diffmerge1/testcase02,v  <--  testcase02
27353new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
27354$CVSROOT_DIRNAME/diffmerge1/testcase03,v  <--  testcase03
27355new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
27356$CVSROOT_DIRNAME/diffmerge1/testcase04,v  <--  testcase04
27357new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
27358$CVSROOT_DIRNAME/diffmerge1/testcase05,v  <--  testcase05
27359new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
27360$CVSROOT_DIRNAME/diffmerge1/testcase06,v  <--  testcase06
27361new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
27362$CVSROOT_DIRNAME/diffmerge1/testcase07,v  <--  testcase07
27363new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
27364$CVSROOT_DIRNAME/diffmerge1/testcase08,v  <--  testcase08
27365new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
27366$CVSROOT_DIRNAME/diffmerge1/testcase09,v  <--  testcase09
27367new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
27368$CVSROOT_DIRNAME/diffmerge1/testcase10,v  <--  testcase10
27369new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1"
27370
27371	  # Change my copy.  Then I
27372	  # update, after both my modifications and your checkin:
27373	  cd ../mine
27374	  diffmerge_create_my_files
27375	  dotest diffmerge1_mine "${testcvs} -q update -j tag" \
27376"M testcase01
27377RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase01,v
27378retrieving revision 1\.1\.1\.1
27379retrieving revision 1\.1\.1\.1\.2\.1
27380Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase01
27381M testcase02
27382RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase02,v
27383retrieving revision 1\.1\.1\.1
27384retrieving revision 1\.1\.1\.1\.2\.1
27385Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase02
27386M testcase03
27387RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase03,v
27388retrieving revision 1\.1\.1\.1
27389retrieving revision 1\.1\.1\.1\.2\.1
27390Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase03
27391M testcase04
27392RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase04,v
27393retrieving revision 1\.1\.1\.1
27394retrieving revision 1\.1\.1\.1\.2\.1
27395Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase04
27396RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase05,v
27397retrieving revision 1\.1\.1\.1
27398retrieving revision 1\.1\.1\.1\.2\.1
27399Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase05
27400RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase06,v
27401retrieving revision 1\.1\.1\.1
27402retrieving revision 1\.1\.1\.1\.2\.1
27403Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase06
27404M testcase07
27405RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase07,v
27406retrieving revision 1\.1\.1\.1
27407retrieving revision 1\.1\.1\.1\.2\.1
27408Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase07
27409testcase07 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1
27410M testcase08
27411RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase08,v
27412retrieving revision 1\.1\.1\.1
27413retrieving revision 1\.1\.1\.1\.2\.1
27414Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase08
27415M testcase09
27416RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase09,v
27417retrieving revision 1\.1\.1\.1
27418retrieving revision 1\.1\.1\.1\.2\.1
27419Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase09
27420M testcase10
27421RCS file: ${CVSROOT_DIRNAME}/diffmerge1/testcase10,v
27422retrieving revision 1\.1\.1\.1
27423retrieving revision 1\.1\.1\.1\.2\.1
27424Merging differences between 1\.1\.1\.1 and 1\.1\.1\.1\.2\.1 into testcase10"
27425
27426	  # So if your changes didn't make it into my working copy, or
27427	  # in any case if the files do not look like the final text
27428	  # in the files in directory comp_me, then the test flunks:
27429	  cd ..
27430	  mkdir comp_me
27431	  cd comp_me
27432	  diffmerge_create_expected_files
27433	  cd ..
27434	  rm mine/.#*
27435
27436	  # If you have GNU's version of diff, you may try
27437	  # uncommenting the following line which will give more
27438	  # fine-grained information about how cvs differed from the
27439	  # correct result:
27440	  #dotest diffmerge1_cmp "diff -u --recursive --exclude=CVS comp_me mine" ''
27441	  dotest diffmerge1_cmp "directory_cmp comp_me mine"
27442
27443	  # Clean up after ourselves:
27444	  dokeep
27445	  cd ..
27446	  rm -r diffmerge1
27447	  modify_repo rm -rf $CVSROOT_DIRNAME/diffmerge1
27448	  ;;
27449
27450
27451
27452        diffmerge2)
27453
27454	  # FIXME: This test should be rewritten to be much more concise.
27455	  # It currently weighs in at something like 600 lines, but the
27456	  # same thing could probably be tested in more like 50-100 lines.
27457	  mkdir diffmerge2
27458
27459	  # This tests for another diffmerge bug reported by Martin
27460	  # Tomes; actually, his bug was probably caused by an initial
27461	  # fix for the bug in test diffmerge1, and likely wasn't ever
27462	  # a problem in CVS as long as one was using a normal
27463	  # distribution of diff or a version of CVS that has the diff
27464	  # lib in it.
27465	  #
27466	  # Nevertheless, once burned twice cautious, so we test for his
27467	  # bug here.
27468	  #
27469	  # Here is his report, more or less verbatim:
27470	  # ------------------------------------------
27471	  #
27472	  # Put the attached file (sgrid.h,v) into your repository
27473	  # somewhere, check out the module and do this:
27474	  #
27475	  # cvs update -j Review_Phase_2_Enhancements sgrid.h
27476	  # cvs diff -r Review_V1p3 sgrid.h
27477	  #
27478	  # As there have been no changes made on the trunk there
27479	  # should be no differences, however this is output:
27480	  #
27481	  # % cvs diff -r Review_V1p3 sgrid.h
27482	  # Index: sgrid.h
27483	  # ===================================================================
27484	  # RCS file: /usr/local/repository/play/fred/sgrid.h,v
27485	  # retrieving revision 1.1.2.1
27486	  # diff -r1.1.2.1 sgrid.h
27487	  # 178a179,184
27488	  # > /*--------------------------------------------------------------
27489	  # > INLINE FUNCTION    :    HORIZONTALLINES
27490	  # > NOTES              :    Description at the end of the file
27491	  # > ----------------------------------------------------------------*/
27492	  # >         uint16 horizontalLines( void );
27493	  # >
27494	  #
27495	  # I did a cvs diff -c -r 1.1 -r 1.1.2.1 sgrid.h and patched those
27496	  # differences to sgrid.h version 1.1 and got the correct result
27497	  # so it looks like the built in patch is faulty.
27498	  # -------------------------------------------------------------------
27499	  #
27500	  # This is the RCS file, sgrid.h,v, that he sent:
27501
27502	  echo "head	1.1;
27503access;
27504symbols
27505	Review_V1p3:1.1.2.1
27506	Review_V1p3C:1.1.2.1
27507	Review_1p3A:1.1.2.1
27508	Review_V1p3A:1.1.2.1
27509	Review_Phase_2_Enhancements:1.1.0.2
27510	Review_V1p2:1.1
27511	Review_V1p2B:1.1
27512	Review_V1p2A:1.1
27513	Review_V1p1:1.1
27514	Review_1p1:1.1;
27515locks; strict;
27516comment	@ * @;
27517
27518
275191.1
27520date	97.04.02.11.20.05;	author colinl;	state Exp;
27521branches
27522	1.1.2.1;
27523next	;
27524
275251.1.2.1
27526date	97.06.09.10.00.07;	author colinl;	state Exp;
27527branches;
27528next	;
27529
27530
27531desc
27532@@
27533
27534
275351.1
27536log
27537@Project:     DEV1175
27538DCN:
27539Tested By:   Colin Law
27540Reviewed By:
27541Reason for Change: Initial Revision of all files
27542
27543Design Change Details:
27544
27545Implications:
27546@
27547text
27548@/* \$""Header:   L:/gpanels/dis/sgrid.h_v   1.1.1.0   24 Jan 1996 14:59:20   PAULT  \$ */
27549/*
27550 * \$""Log:   L:/gpanels/dis/sgrid.h_v  \$
27551 *
27552 *    Rev 1.1.1.0   24 Jan 1996 14:59:20   PAULT
27553 * Branched
27554 *
27555 *    Rev 1.1   24 Jan 1996 12:09:52   PAULT
27556 * Consolidated 4100 code merged to trunk
27557 *
27558 *    Rev 1.0.2.0   01 Jun 1995 14:18:58   DAVEH
27559 * Branched
27560 *
27561 *    Rev 1.0   19 Apr 1995 16:32:48   COLINL
27562 * Initial revision.
27563*/
27564/*****************************************************************************
27565FILE        :   SGRID.H
27566VERSION     :   2.1
27567AUTHOR      :   Dave Hartley
27568SYSTEM      :   Borland C++
27569DESCRIPTION :   The declaration of the scrolling grid class
27570
27571*****************************************************************************/
27572#if !defined(__SGRID_H)
27573#define __SGRID_H
27574
27575#if !defined(__SCROLL_H)
27576#include <scroll.h>
27577#endif
27578
27579#if !defined(__GKI_H)
27580#include \"gki.h\"
27581#endif
27582
27583#if defined PRINTING_SUPPORT
27584class Printer;
27585#endif
27586
27587/*****************************************************************************
27588CLASS      :    ScrollingGrid
27589DESCRIPTION:    This class inherits from a grid and a scrollable, and
27590                can therefore use all the PUBLIC services provided by these
27591                classes. A description of these can be found in
27592                GRID.H and SCROLL.H.
27593                A scrolling grid is a set of horizontal and vertical lines
27594                that scroll and continually update to provide a complete grid
27595
27596*****************************************************************************/
27597
27598class ScrollingGrid : public Scrollable
27599{
27600    public:
27601#if defined _WINDOWS
27602/*---------------------------------------------------------------------------
27603FUNCTION    :   CONSTRUCTOR
27604DESCRIPTION :   sets up the details of the grid, ready for painting
27605ARGUMENTS   :   name  : sgColour
27606                        - the colour of the grid
27607                        sgLineType
27608                        - the syle of line
27609                        sgHorizontalTotal
27610                        - the total number of horizontal grid lines
27611                        verticalSpacingMin
27612                        - the min distance between the vertical grid lines
27613                          on the scrolling axis
27614                        currentTimestamp
27615                        - timestamp value now
27616                        ticksPerSecond
27617                        - number of timestamp ticks per second
27618                        ticksPerPixel
27619                        - number of timestamp ticks per pixel required
27620
27621RETURN      :   None
27622NOTES       :
27623---------------------------------------------------------------------------*/
27624        ScrollingGrid( GkiColour sgColour, GkiLineType sgLineType,
27625            uint16 sgHorizontalTotal,
27626            uint16 verticalSpacingMin, uint32 currentTimestamp,
27627            uint16 ticksPerSecond, uint32 ticksPerPixel );
27628#else
27629/*---------------------------------------------------------------------------
27630FUNCTION    :   CONSTRUCTOR
27631DESCRIPTION :   sets up the details of the grid, ready for painting
27632ARGUMENTS   :   name  : sgColour
27633                        - the colour of the grid
27634                        sgLineType
27635                        - the syle of line
27636                        sgHorizontalTotal ( THE MAX NUMBER OF LINES IS 100 )
27637                        - the total number of horizontal grid lines
27638                        sgVerticalSpacing
27639                        - the distance between the vertical grid lines
27640                        on the scrolling axis
27641
27642RETURN      :   None
27643NOTES       :   If the caller does not get the total grid lines value, synced
27644                with the overall size of the viewport, the spacing between
27645                grid lines will not be consistent.
27646
27647---------------------------------------------------------------------------*/
27648        ScrollingGrid( GkiColour sgColour, GkiLineType sgLineType
27649                     , uint16 sgHorizontalTotal, uint16 sgVerticalSpacing );
27650#endif
27651/*---------------------------------------------------------------------------
27652FUNCTION    :   DESTRUCTOR
27653DESCRIPTION :   tidies it all up
27654ARGUMENTS   :   name  :
27655
27656RETURN      :   None
27657NOTES       :
27658---------------------------------------------------------------------------*/
27659        ~ScrollingGrid( void );
27660
27661/*---------------------------------------------------------------------------
27662FUNCTION    :   ATTACH
27663DESCRIPTION :   This service overloads the base class service, as it does
27664                additional work at the time of attachment.
27665
27666ARGUMENTS   :   name  : tDrawingArea
27667                        - the scrolled viewport to attach this trend to
27668
27669RETURN      :   None
27670NOTES       :
27671---------------------------------------------------------------------------*/
27672        void attach( SViewport *tDrawingArea );
27673
27674#if defined _WINDOWS
27675/*---------------------------------------------------------------------------
27676FUNCTION    :   calculateVerticalSpacing
27677DESCRIPTION :   determines optimum spacing along time axis
27678ARGUMENTS   :
27679RETURN      :   None
27680NOTES       :
27681---------------------------------------------------------------------------*/
27682        void calculateVerticalSpacing();
27683
27684/*---------------------------------------------------------------------------
27685FUNCTION    :   gridSpacingTicks
27686DESCRIPTION :   Provides the grid spacing in the time axis in ticks
27687ARGUMENTS   :
27688RETURN      :   Number of ticks
27689NOTES       :
27690---------------------------------------------------------------------------*/
27691        uint32 gridSpacingTicks();
27692
27693#endif
27694
27695/*---------------------------------------------------------------------------
27696INLINE FUNCTION    :    HORIZONTALLINES
27697NOTES              :    Description at the end of the file
27698---------------------------------------------------------------------------*/
27699        uint16 horizontalLines( void );
27700
27701#if defined _WINDOWS
27702// In Windows the OnDraw() function replaces paint()
27703/*---------------------------------------------------------------------------
27704FUNCTION    :   ScrollingGrid OnDraw
27705DESCRIPTION :   Paints the given area of the grid.
27706                Pure virtual
27707ARGUMENTS   :   pDC     pointer to the device context to use for display
27708                        Note that the device context operates in the coords
27709                        of the window owning the viewport
27710RETURN      :   None
27711NOTES       :
27712---------------------------------------------------------------------------*/
27713        virtual void OnDraw( CDC *pDC );
27714
27715#else   // not Windows
27716
27717/*---------------------------------------------------------------------------
27718FUNCTION    :   PAINT
27719DESCRIPTION :   This extends the standard grid paint method to paint the
27720                viewport relative to its current position.
27721
27722ARGUMENTS   :   name  :
27723
27724RETURN      :   None
27725NOTES       :
27726---------------------------------------------------------------------------*/
27727        void paint( void );
27728#endif
27729
27730/*---------------------------------------------------------------------------
27731FUNCTION    :   P A I N T   T E X T   M A R K E R S
27732DESCRIPTION :   this service allow the text markers to be painted seperatley
27733                from the grid lines
27734
27735ARGUMENTS   :   name :
27736
27737RETURN      :   None
27738NOTES       :
27739---------------------------------------------------------------------------*/
27740        void paintTextMarkers();
27741
27742#if defined PRINTING_SUPPORT
27743/*---------------------------------------------------------------------------
27744FUNCTION    :   P R I N T
27745DESCRIPTION :   This print service prints a grid marker ( being either a
27746                timestamp or a date, IF there is one at the plot position
27747                given
27748
27749ARGUMENTS   :   name :
27750                        displayPosition
27751                        - Where in the log to look to see if there is an
27752                          entry to print
27753
27754                        - printerPtr
27755                          the printer to print to
27756
27757RETURN      :   None
27758NOTES       :
27759---------------------------------------------------------------------------*/
27760        void print( uint16 currentPrintPos, Printer *printerPtr );
27761#endif
27762
27763/*---------------------------------------------------------------------------
27764FUNCTION    :   S E T  D R I V E  D I R E C T I O N
27765DESCRIPTION :   Sets direction for update and scrolling forwards or backwards
27766ARGUMENTS   :   direction  - required direction
27767RETURN      :   None
27768NOTES       :
27769---------------------------------------------------------------------------*/
27770        void setDriveDirection( ScrollDirection direction );
27771
27772/*---------------------------------------------------------------------------
27773FUNCTION    :   S E T U P
27774DESCRIPTION :   service that will setup the grid prior to a paint
27775
27776ARGUMENTS   :   name :
27777                        - newTimestamp
27778
27779
27780                        - newTimeBase
27781                        the number of ticks that represent a plot point on
27782                        the trendgraph.
27783
27784RETURN      :   None
27785NOTES       :
27786---------------------------------------------------------------------------*/
27787        void setup( uint32 newTimestamp, uint32 newTimeBase );
27788
27789#if defined PRINTING_SUPPORT
27790/*---------------------------------------------------------------------------
27791FUNCTION    :   S E T U P   F O R   P R I N T
27792DESCRIPTION :   This service iis to be called prior to printing. It allows
27793                the grid to prepare its markers ready for the print
27794                commands
27795
27796ARGUMENTS   :   name :
27797
27798RETURN      :   None
27799NOTES       :
27800---------------------------------------------------------------------------*/
27801        void setupForPrint();
27802#endif
27803
27804/*---------------------------------------------------------------------------
27805FUNCTION    :   UPDATE
27806DESCRIPTION :   When this service is called it will calculate what needs to
27807                be painted and fill in the display again.
27808
27809ARGUMENTS   :   name  :     timeStamp
27810                            - the reference time of this update.
27811
27812RETURN      :   None
27813NOTES       :
27814---------------------------------------------------------------------------*/
27815        void update( uint32 timeStamp );
27816
27817/*---------------------------------------------------------------------------
27818FUNCTION    :   U P D A T E   B U F F E R
27819DESCRIPTION :   When a display update is not required, use this method. It
27820                updates the internal data ready for a call to paint that
27821                will then show the grid in the right position
27822
27823ARGUMENTS   :   name  :
27824
27825RETURN      :   None
27826NOTES       :
27827---------------------------------------------------------------------------*/
27828        void updateBuffer( void );
27829
27830    private:
27831
27832/*---------------------------------------------------------------------------
27833FUNCTION    :   M A K E   G R I D   M A R K E R
27834DESCRIPTION :   service that perpares a string for display. The string will
27835                either be a short date, or short time. this is determined
27836                by the current setting of the dateMarker flag
27837
27838ARGUMENTS   :   name :  timestampVal
27839                        - the value to convert
27840
27841                        storePtr
27842                        - the place to put the string
27843
27844RETURN      :   None
27845NOTES       :
27846---------------------------------------------------------------------------*/
27847        void makeGridMarker( uint32 timestampVal, char *storePtr );
27848
27849/*---------------------------------------------------------------------------
27850FUNCTION    :   P A I N T   G R I D   M A R K E R
27851DESCRIPTION :   given a position will put the string on the display
27852
27853ARGUMENTS   :   name :
27854                        yPos
27855                        - were it goes on the Y-axis
27856
27857                        gridMarkerPtr
27858                        - what it is
27859
27860RETURN      :   None
27861NOTES       :
27862---------------------------------------------------------------------------*/
27863        void paintGridMarker( uint16 yPos, char *gridMarkerPtr );
27864
27865#if defined _WINDOWS
27866/*---------------------------------------------------------------------------
27867FUNCTION    :   PAINTHORIZONTALLINES
27868DESCRIPTION :   responsible for painting the grids horizontal lines
27869ARGUMENTS   :   pRectToDraw     pointer to rectangle that needs refreshing.
27870                                in viewport coords
27871                pDC             pointer to device context to use
27872
27873RETURN      : None
27874NOTES       :
27875---------------------------------------------------------------------------*/
27876        void paintHorizontalLines(RectCoords* pRectToDraw, CDC* pDC );
27877#else
27878/*---------------------------------------------------------------------------
27879FUNCTION    :   PAINTHORIZONTALLINES
27880DESCRIPTION :   responsible for painting the grids horizontal lines
27881ARGUMENTS   : name: xStart
27882                    - the starting X co-ordinate for the horizontal line
27883                    xEnd
27884                    - the ending X co-ordinate for the horizontal line
27885
27886RETURN      : None
27887NOTES       : Remember lines are drawn from origin. The origin in a
27888              horizontal viewport will be the top.
27889---------------------------------------------------------------------------*/
27890        void paintHorizontalLines( uint16 xStart, uint16 xEnd );
27891#endif
27892
27893#if defined _WINDOWS
27894/*---------------------------------------------------------------------------
27895FUNCTION    :   PAINTVERTICALLINES
27896DESCRIPTION :   responsible for painting the grids vertical lines
27897ARGUMENTS   :   pRectToDraw     pointer to rectangle that needs refreshing.
27898                                in viewport coords
27899                offset          offset from rhs that rightmost line would be
27900                                drawn if rectangle included whole viewport
27901                pDC             pointer to device context to use
27902RETURN      : None
27903NOTES       :
27904---------------------------------------------------------------------------*/
27905        void paintVerticalLines( RectCoords* pRectToDraw, uint16 offset,
27906            CDC* pDC );
27907#else
27908/*---------------------------------------------------------------------------
27909FUNCTION    :   PAINTVERTICALLINES
27910DESCRIPTION :   responsible for painting the grids vertical lines
27911ARGUMENTS   : name  :   yStart
27912                        - the starting Y co-ordinate for the vertical line
27913                        yEnd
27914                        - the ending Y co-ordinate for the vertical line
27915                        offset
27916                        - a starting point offset that determines at what X
27917                        position the first line will be drawn
27918
27919
27920RETURN      : None
27921NOTES       :
27922---------------------------------------------------------------------------*/
27923        void paintVerticalLines( uint16 yStart, uint16 yEnd, uint16 offset );
27924#endif
27925
27926#if defined _WINDOWS
27927/*---------------------------------------------------------------------------
27928FUNCTION    :   PAINTVERTICALLINE
27929DESCRIPTION :   paints one line at the position specified, and length
27930ARGUMENTS   :   name  : yStart
27931                        - the starting point on the y axis for the line
27932                        yEnd
27933                        - the end point on the y axis for the line
27934                        xPosition
27935                        - The horizontal offset from the start of the viewport
27936                pDC             pointer to device context to use
27937
27938RETURN      :   None
27939NOTES       :   There is not an equivalent horizontal method as yet. This
27940                is a seperate method because the service is useful to a
27941                derivation of this class
27942---------------------------------------------------------------------------*/
27943        void paintVerticalLine( uint16 yStart, uint16 yEnd
27944                              , uint16 xPosition, CDC *pDC );
27945#else
27946/*---------------------------------------------------------------------------
27947FUNCTION    :   PAINTVERTICALLINE
27948DESCRIPTION :   paints one line at the position specified, and length
27949ARGUMENTS   :   name  : yStart
27950                        - the starting point on the y axis for the line
27951                        yEnd
27952                        - the end point on the y axis for the line
27953                        xPosition
27954                        - The horizontal offset from the start of the viewport
27955
27956RETURN      :   None
27957NOTES       :   There is not an equivalent horizontal method as yet. This
27958                is a seperate method because the service is useful to a
27959                derivation of this class
27960---------------------------------------------------------------------------*/
27961        void paintVerticalLine( uint16 yStart, uint16 yEnd
27962                              , uint16 xPosition );
27963#endif
27964
27965/*---------------------------------------------------------------------------
27966INLINE FUNCTION    :    VERTICALSPACING
27967NOTES              :    Description at the end of the file
27968---------------------------------------------------------------------------*/
27969        uint16 verticalSpacing( void );
27970
27971
27972        // Position in viewport that we are now writing to if going forwards
27973        // Note that if this is greater than viewport length then we have
27974        // just scrolled and value must be adjusted before use.
27975        sint16 forwardsOutputPosition;
27976
27977        // Position in viewport that we are now writing to if going backwards
27978        // Note that if this is less than zero then we have
27979        // just scrolled and value must be adjusted before use.
27980        sint16 backwardsOutputPosition;
27981
27982        // position in grid cycle of forwards output position.
27983        // if zero then it is time to output a grid line
27984        sint16 forwardsIntervalCount;
27985
27986        // position in grid cycle of forwards output position.
27987        // if zero then it is time to output a grid line
27988        sint16 backwardsIntervalCount;
27989
27990        uint32  lastUpdateTimestamp;
27991        uint32  timeBase;       // ticks per pixel
27992        uint16  currentOutputPosition;
27993        uint16  gridTimestampSpacing;
27994        uint16  intervalCount;
27995        uint16  horizontalTotal;
27996        uint16  vSpacing;
27997#if defined PRINTING_SUPPORT
27998        uint16  numberOfGridMarkersPrinted;
27999#endif
28000        bool    firstTime;       // indicates first time through
28001        bool    dateMarker;
28002
28003        GkiLineType lineType;
28004        GkiColour   gridColour;
28005
28006    #if defined _WINDOWS
28007        uint16 ticksPerSec;     // number of time ticks per second
28008        uint16 vSpacingMin;     // minimum pixels per division along time axis
28009        CPen *pPen;             // the pen to use for drawing in windows
28010    #endif
28011
28012};
28013
28014
28015/*****************************************************************************
28016                        I N L I N E   F U N C T I O N S
28017*****************************************************************************/
28018
28019/*---------------------------------------------------------------------------
28020FUNCTION    :   HORIZONTALLINES
28021DESCRIPTION :   supplies the number of horizontal lines in the grid
28022ARGUMENTS   :   name  :
28023
28024RETURN      :
28025NOTES       :
28026---------------------------------------------------------------------------*/
28027inline uint16 ScrollingGrid::horizontalLines( void )
28028{
28029    return( horizontalTotal );
28030}
28031/*---------------------------------------------------------------------------
28032FUNCTION    :   VERTICALSPACING
28033DESCRIPTION :   returns the distance between adjacent vertical lines
28034ARGUMENTS   :   name  :
28035
28036RETURN      :   None
28037NOTES       :
28038---------------------------------------------------------------------------*/
28039inline uint16 ScrollingGrid::verticalSpacing( void )
28040{
28041    return( vSpacing );
28042}
28043
28044#endif
28045@
28046
28047
280481.1.2.1
28049log
28050@DEV1194:DS4    Provision of major and minor grid lines
28051@
28052text
28053@d1 1
28054a1 1
28055/* \$""Header: /usr/local/repository/cmnsrc/review/src/sgrid.h,v 1.1 1997/04/02 11:20:05 colinl Exp \$ */
28056d3 1
28057a3 12
28058 * \$""Log: sgrid.h,v \$
28059 * Revision 1.1  1997/04/02 11:20:05  colinl
28060 * Project:     DEV1175
28061 * DCN:
28062 * Tested By:   Colin Law
28063 * Reviewed By:
28064 * Reason for Change: Initial Revision of all files
28065 *
28066 * Design Change Details:
28067 *
28068 * Implications:
28069 *
28070d58 6
28071a63 5
28072ARGUMENTS   :   name  : majorColour         colour for major grid lines
28073                        minorColour         colour for minor grid lines
28074                        sgLineType          line type for minor grid lines
28075                        yMajorGridLines     number of major y lines on grid
28076                        yMinorGridLines     number of major y lines on grid
28077d77 2
28078a78 3
28079        ScrollingGrid( GkiColour majorColour, GkiColour minorColour,
28080            GkiLineType sgLineType,
28081            uint16 yMajorGridLines, uint16 yMinorGridLines,
28082a137 17
28083FUNCTION    :   DrawHorizontalGridLines
28084
28085DESCRIPTION :   Draws major or minor grid lines
28086ARGUMENTS   :   pDC         device context
28087                pPen        pen to use
28088                numLines    total lines required
28089                yLow, yHigh, xLow, xHigh   rectangle to draw in
28090                yMax        max y value
28091RETURN      :   None
28092NOTES       :
28093---------------------------------------------------------------------------*/
28094        void DrawHorizontalGridLines( CDC* pDC, CPen* pPen,
28095            uint16 numLines,
28096            uint16 yLow, uint16 yHigh, uint16 xLow, uint16 xHigh,
28097            uint16 yMax );
28098
28099/*---------------------------------------------------------------------------
28100d148 6
28101d448 1
28102a448 2
28103        uint16  m_yMajorGridLines;
28104        uint16  m_yMinorGridLines;
28105d456 2
28106a457 3
28107        GkiLineType lineType;    // line type for minor grid lines
28108        GkiColour   m_majorColour;
28109        GkiColour   m_minorColour;
28110d462 1
28111a462 2
28112        CPen *pMajorPen;        // pen to use for drawing major grid lines
28113        CPen *pMinorPen;        // pen to use for drawing minor grid lines
28114d472 12
28115@" > diffmerge2/sgrid.h,v
28116
28117	  # We have to put the RCS file in the repository by hand for
28118	  # this test:
28119	  modify_repo mkdir $CVSROOT_DIRNAME/diffmerge2
28120	  modify_repo cp diffmerge2/sgrid.h,v \
28121		         $CVSROOT_DIRNAME/diffmerge2/sgrid.h,v
28122	  rm -rf diffmerge2
28123	  dotest diffmerge2_co \
28124	    "$testcvs co diffmerge2" "${DOTSTAR}U $DOTSTAR"
28125	  cd diffmerge2
28126	  dotest diffmerge2_update \
28127	    "${testcvs} update -j Review_Phase_2_Enhancements sgrid.h" \
28128	    "${DOTSTAR}erging ${DOTSTAR}"
28129	  # This is the one that counts -- there should be no output:
28130	  dotest diffmerge2_diff \
28131	    "${testcvs} diff -r Review_V1p3 sgrid.h" ''
28132
28133	  dokeep
28134	  cd ..
28135	  rm -rf diffmerge2
28136	  modify_repo rm -rf $CVSROOT_DIRNAME/diffmerge2
28137	  ;;
28138
28139
28140
28141	release)
28142	  # Tests of "cvs release", particularly multiple arguments.
28143	  # Other CVS release tests:
28144	  #   info-cleanup-0 for "cvs -n release".
28145	  #   ignore-193 for the text of the question that cvs release asks.
28146	  #     Also for interactions with cvsignore.
28147	  #   basicc: "-d .", global -Q, no arguments (is a noop),
28148	  #     "cvs release" without -d, multiple arguments.
28149	  #   dirs-4: repository directory has been deleted.
28150	  #   modules2-6: multiple arguments.
28151
28152	  # First the usual setup; create a directory first-dir.
28153	  mkdir 1; cd 1
28154	  dotest release-1 "${testcvs} -q co -l ." ''
28155	  mkdir first-dir
28156	  dotest release-2 "${testcvs} add first-dir" \
28157"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
28158          cd first-dir
28159	  mkdir dir1
28160	  dotest release-3 "${testcvs} add dir1" \
28161"Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
28162	  mkdir dir2
28163	  dotest release-4 "${testcvs} add dir2" \
28164"Directory ${CVSROOT_DIRNAME}/first-dir/dir2 added to the repository"
28165          cd dir2
28166	  mkdir dir3
28167	  dotest release-5 "${testcvs} add dir3" \
28168"Directory ${CVSROOT_DIRNAME}/first-dir/dir2/dir3 added to the repository"
28169
28170          cd ../..
28171	  dotest release-6 "${testcvs} release -d first-dir/dir2/dir3 first-dir/dir1" \
28172"You have .0. altered files in this repository.
28173Are you sure you want to release (and delete) directory .first-dir/dir2/dir3.: \
28174You have .0. altered files in this repository.
28175Are you sure you want to release (and delete) directory .first-dir/dir1.: " <<EOF
28176yes
28177yes
28178EOF
28179	  dotest_fail release-7 "test -d first-dir/dir1" ''
28180	  dotest_fail release-8 "test -d first-dir/dir2/dir3" ''
28181	  dotest release-9 "${testcvs} update" \
28182"${SPROG} update: Updating \.
28183${SPROG} update: Updating first-dir
28184${SPROG} update: Updating first-dir/dir2"
28185
28186          cd first-dir
28187	  mkdir dir1
28188	  dotest release-10 "${testcvs} add dir1" \
28189"Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
28190          cd dir2
28191	  mkdir dir3
28192	  dotest release-11 "${testcvs} add dir3" \
28193"Directory ${CVSROOT_DIRNAME}/first-dir/dir2/dir3 added to the repository"
28194
28195          cd ../..
28196	  dotest release-12 "${testcvs} release first-dir/dir2/dir3 first-dir/dir1" \
28197"You have .0. altered files in this repository.
28198Are you sure you want to release directory .first-dir/dir2/dir3.: .. .release. aborted by user choice.
28199You have .0. altered files in this repository.
28200Are you sure you want to release directory .first-dir/dir1.: " <<EOF
28201no
28202yes
28203EOF
28204	  dotest release-13 "${testcvs} release first-dir/dir2/dir3 first-dir/dir2" \
28205"You have .0. altered files in this repository.
28206Are you sure you want to release directory .first-dir/dir2/dir3.: \
28207You have .0. altered files in this repository.
28208Are you sure you want to release directory .first-dir/dir2.: " <<EOF
28209yes
28210yes
28211EOF
28212	  dotest release-14 "test -d first-dir/dir1" ''
28213	  dotest release-15 "test -d first-dir/dir2/dir3" ''
28214
28215	  mkdir first-dir/dir1/dir4
28216	  # FIXCVS: There should be a path showing in front of dir below,
28217	  # I believe.
28218	  dotest release-unrecognized-dir-1 \
28219"${testcvs} release -d first-dir/dir1" \
28220"${QUESTION} dir4
28221You have .0. altered files in this repository.
28222Are you sure you want to release (and delete) directory \`first-dir/dir1': " <<EOF
28223yes
28224EOF
28225
28226	  rm -rf first-dir/dir2
28227
28228	  dotest release-16 "${testcvs} update" \
28229"$SPROG update: Updating \.
28230$SPROG update: Updating first-dir"
28231
28232	  # Check to make sure release isn't overwriting a
28233	  # CVS/Entries file in the current directory (using data
28234	  # from the released directory).
28235
28236	  # cvs 1.11 (remote) fails on release-21 (a message about
28237          # chdir into the removed directory), although it seemingly
28238	  # unedits and removes the directory correctly.  If
28239	  # you manually continue, it then fails on release-22 do
28240	  # to the messed up CVS/Entries file from release-21.
28241          cd first-dir
28242	  mkdir second-dir
28243	  dotest release-18 "$testcvs add second-dir" \
28244"Directory $CVSROOT_DIRNAME/first-dir/second-dir added to the repository"
28245
28246	  cd second-dir
28247	  touch file1
28248	  dotest release-19 "$testcvs -Q add file1"
28249	  dotest release-20 '$testcvs -q ci -m add' \
28250"$CVSROOT_DIRNAME/first-dir/second-dir/file1,v  <--  file1
28251initial revision: 1\.1"
28252	  dotest release-21 "$testcvs edit file1"
28253	  cd ..
28254	  dotest release-22 "echo yes | $testcvs release -d second-dir" \
28255"You have \[0\] altered files in this repository.
28256Are you sure you want to release (and delete) directory \`second-dir': "
28257	  dotest release-23 "$testcvs -q update -d" "U second-dir/file1"
28258	  dotest release-24 "$testcvs edit"
28259
28260	  dokeep
28261	  cd ../..
28262	  rm -r 1
28263	  modify_repo rm -rf 1 $CVSROOT_DIRNAME/first-dir
28264	  ;;
28265
28266
28267
28268	recase)
28269	  #
28270	  # Some tests of behavior which broke at one time or another when run
28271	  # from case insensitive clients against case sensitive servers.
28272	  #
28273	  # These tests are namned according to the following convention:
28274	  #
28275	  #   ci	Client (sandbox filesystem) case Insensitive
28276	  #   cs	Client (sandbox filesystem) case Sensitive
28277	  #   si	Server (repository filesystem) case Insensitive
28278	  #   ss	Server (repository filesystem) case Sensitive
28279	  #
28280
28281	  mkdir 1; cd 1
28282
28283	  # First, we will expect different results for a few of these tests
28284	  # based on whether the repository is on a case sensitive filesystem
28285	  # or not and whether the sandbox is on a case sensitive filesystem or
28286	  # not, so determine which cases we are dealing with:
28287	  echo file >file
28288	  echo FiLe >FiLe
28289	  if cmp file FiLe >/dev/null; then
28290	    client_sensitive=false
28291	  else
28292	    client_sensitive=:
28293	  fi
28294	  if test -n "$remotehost"; then
28295	    $CVS_RSH $remotehost 'echo file >file'
28296	    $CVS_RSH $remotehost 'echo FiLe >FiLe'
28297	    if $CVS_RSH $remotehost 'cmp file FiLe >/dev/null'; then
28298	      server_sensitive=false
28299	    else
28300	      server_sensitive=:
28301	    fi
28302	  else
28303	    server_sensitive=$client_sensitive
28304	  fi
28305
28306	  # The first test (recase-1 & recase-2) is for a remove of a file then
28307	  # a readd in a different case.
28308	  modify_repo mkdir $CVSROOT_DIRNAME/first-dir
28309	  dotest recase-init-1 "$testcvs -Q co first-dir"
28310	  cd first-dir
28311
28312	  echo this file has no content >file
28313	  dotest recase-init-2 "$testcvs -Q add file"
28314	  dotest recase-init-3 "$testcvs -Q ci -madd"
28315	  dotest recase-init-4 "$testcvs -Q tag first"
28316
28317	  # Now remove the file.
28318	  dotest recase-init-5 "$testcvs -Q rm -f file"
28319	  dotest recase-init-6 "$testcvs -Q ci -mrm"
28320
28321	  # Now the test - readd in a different case.
28322	  echo this file needs some content >FiLe
28323	  if $server_sensitive; then
28324	    dotest recase-1ss "$testcvs add FiLe" \
28325"$SPROG add: scheduling file \`FiLe' for addition
28326$SPROG add: use \`$SPROG commit' to add this file permanently"
28327	    dotest recase-2ss "$testcvs -q ci -mrecase" \
28328"$CVSROOT_DIRNAME/first-dir/FiLe,v  <--  FiLe
28329initial revision: 1\.1"
28330	  else # server insensitive
28331	    dotest recase-1si "$testcvs add FiLe" \
28332"$SPROG add: Re-adding file \`FiLe' after dead revision 1\.2\.
28333$SPROG add: use \`$SPROG commit' to add this file permanently"
28334	    dotest recase-2si "$testcvs -q ci -mrecase" \
28335"$CVSROOT_DIRNAME/first-dir/FiLe,v  <--  FiLe
28336new revision: 1\.3; previous revision: 1\.2"
28337	  fi
28338
28339	  # Now verify that a checkout will still work
28340	  cd ../..
28341	  mkdir 2; cd 2
28342	  dotest recase-3 "$testcvs -q co first-dir" \
28343"U first-dir/FiLe"
28344
28345	  cd first-dir
28346	  # Prove that we can still get status and log information on
28347	  # conflicting case files (1 in Attic, one in parent).
28348	  if $remote; then
28349	    if $client_sensitive; then
28350	      file=file
28351	      fIlE=fIlE
28352	    else # client insensitive
28353	      # Because FiLe is present on a case insensitive client, it is the
28354	      # only one ever found and queried or altered.
28355	      file=FiLe
28356	      fIlE=FiLe
28357	    fi
28358	  else # ! $remote
28359	    file=file
28360	    fIlE=fIlE
28361	  fi
28362	  if $server_sensitive; then
28363	    if $client_sensitive; then
28364	      # Client finds Entry only for FiLe.  Others returned by server.
28365	      dotest recase-4sscs "$testcvs status file" \
28366"===================================================================
28367File: no file file		Status: Up-to-date
28368
28369   Working revision:	No entry for file
28370   Repository revision:	1\.2	$CVSROOT_DIRNAME/first-dir/Attic/file,v
28371   Commit Identifier:	${commitid}"
28372	      dotest recase-5sscs "$testcvs log file" \
28373"
28374RCS file: $CVSROOT_DIRNAME/first-dir/Attic/file,v
28375Working file: file
28376head: 1\.2
28377branch:
28378locks: strict
28379access list:
28380symbolic names:
28381	first: 1\.1
28382keyword substitution: kv
28383total revisions: 2;	selected revisions: 2
28384description:
28385----------------------------
28386revision 1\.2
28387date: ${ISO8601DATE};  author: $username;  state: dead;  lines: +0 -0;  commitid: ${commitid};
28388rm
28389----------------------------
28390revision 1\.1
28391date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28392add
28393============================================================================="
28394	      dotest recase-6sscs "$testcvs status FiLe" \
28395"===================================================================
28396File: FiLe             	Status: Up-to-date
28397
28398   Working revision:	1\.1.*
28399   Repository revision:	1\.1	$CVSROOT_DIRNAME/first-dir/FiLe,v
28400   Commit Identifier:	${commitid}
28401   Sticky Tag:		(none)
28402   Sticky Date:		(none)
28403   Sticky Options:	(none)"
28404	      dotest recase-7sscs "$testcvs log FiLe" \
28405"
28406RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
28407Working file: FiLe
28408head: 1\.1
28409branch:
28410locks: strict
28411access list:
28412symbolic names:
28413keyword substitution: kv
28414total revisions: 1;	selected revisions: 1
28415description:
28416----------------------------
28417revision 1\.1
28418date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28419recase
28420============================================================================="
28421	    else # server sensitive && client insensitive
28422	      # Client finds same Entry for file & FiLe.
28423	      dotest recase-4ssci "$testcvs status file" \
28424"===================================================================
28425File: FiLe             	Status: Up-to-date
28426
28427   Working revision:	1\.1.*
28428   Repository revision:	1\.1	$CVSROOT_DIRNAME/first-dir/FiLe,v
28429   Commit Identifier:	${commitid}
28430   Sticky Tag:		(none)
28431   Sticky Date:		(none)
28432   Sticky Options:	(none)"
28433	      dotest recase-5ssci "$testcvs log file" \
28434"
28435RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
28436Working file: FiLe
28437head: 1\.1
28438branch:
28439locks: strict
28440access list:
28441symbolic names:
28442keyword substitution: kv
28443total revisions: 1;	selected revisions: 1
28444description:
28445----------------------------
28446revision 1\.1
28447date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28448recase
28449============================================================================="
28450	      dotest recase-6ss "$testcvs status FiLe" \
28451"===================================================================
28452File: FiLe             	Status: Up-to-date
28453
28454   Working revision:	1\.1.*
28455   Repository revision:	1\.1	$CVSROOT_DIRNAME/first-dir/FiLe,v
28456   Commit Identifier:	${commitid}
28457   Sticky Tag:		(none)
28458   Sticky Date:		(none)
28459   Sticky Options:	(none)"
28460	      dotest recase-7ss "$testcvs log FiLe" \
28461"
28462RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
28463Working file: FiLe
28464head: 1\.1
28465branch:
28466locks: strict
28467access list:
28468symbolic names:
28469keyword substitution: kv
28470total revisions: 1;	selected revisions: 1
28471description:
28472----------------------------
28473revision 1\.1
28474date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28475recase
28476============================================================================="
28477	    fi
28478	  else # server insensitive
28479	    # There is only one archive when the server is insensitive, but the
28480	    # printed file/archive name can vary.
28481	    dotest recase-4si "$testcvs status file" \
28482"===================================================================
28483File: $file             	Status: Up-to-date
28484
28485   Working revision:	1\.3.*
28486   Repository revision:	1\.3	$CVSROOT_DIRNAME/first-dir/$file,v
28487   Commit Identifier:	${commitid}
28488   Sticky Tag:		(none)
28489   Sticky Date:		(none)
28490   Sticky Options:	(none)"
28491	    dotest recase-5si "$testcvs log file" \
28492"
28493RCS file: $CVSROOT_DIRNAME/first-dir/$file,v
28494Working file: $file
28495head: 1\.3
28496branch:
28497locks: strict
28498access list:
28499symbolic names:
28500	first: 1\.1
28501keyword substitution: kv
28502total revisions: 3;	selected revisions: 3
28503description:
28504----------------------------
28505revision 1\.3
28506date: ${ISO8601DATE};  author: $username;  state: Exp;  lines: +1 -1;  commitid: ${commitid};
28507recase
28508----------------------------
28509revision 1\.2
28510date: ${ISO8601DATE};  author: $username;  state: dead;  lines: +0 -0;  commitid: ${commitid};
28511rm
28512----------------------------
28513revision 1\.1
28514date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28515add
28516============================================================================="
28517	    dotest recase-6si "$testcvs status FiLe" \
28518"===================================================================
28519File: FiLe             	Status: Up-to-date
28520
28521   Working revision:	1\.3.*
28522   Repository revision:	1\.3	$CVSROOT_DIRNAME/first-dir/FiLe,v
28523   Commit Identifier:	${commitid}
28524   Sticky Tag:		(none)
28525   Sticky Date:		(none)
28526   Sticky Options:	(none)"
28527	    dotest recase-7si "$testcvs log FiLe" \
28528"
28529RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
28530Working file: FiLe
28531head: 1\.3
28532branch:
28533locks: strict
28534access list:
28535symbolic names:
28536	first: 1\.1
28537keyword substitution: kv
28538total revisions: 3;	selected revisions: 3
28539description:
28540----------------------------
28541revision 1\.3
28542date: ${ISO8601DATE};  author: $username;  state: Exp;  lines: +1 -1;  commitid: ${commitid};
28543recase
28544----------------------------
28545revision 1\.2
28546date: ${ISO8601DATE};  author: $username;  state: dead;  lines: +0 -0;  commitid: ${commitid};
28547rm
28548----------------------------
28549revision 1\.1
28550date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28551add
28552============================================================================="
28553	  fi
28554
28555	  # And when the file does not exist on the client, we go with the
28556	  # client Entries match.
28557	  if $client_sensitive && $server_sensitive; then
28558	    dotest recase-8sscs "$testcvs status fIlE" \
28559"$SPROG status: nothing known about \`fIlE'
28560===================================================================
28561File: no file fIlE		Status: Unknown
28562
28563   Working revision:	No entry for fIlE
28564   Repository revision:	No revision control file"
28565	  else # !$client_sensitive || !$server_sensitive
28566	    dotest recase-8anyi "$testcvs status fIlE" \
28567"===================================================================
28568File: $fIlE             	Status: Up-to-date
28569
28570   Working revision:	1\.[0-9]*.*
28571   Repository revision:	1\.[0-9]*	$CVSROOT_DIRNAME/first-dir/$fIlE,v
28572   Commit Identifier:	${commitid}
28573   Sticky Tag:		(none)
28574   Sticky Date:		(none)
28575   Sticky Options:	(none)"
28576	  fi
28577
28578	  # and an update
28579	  if $server_sensitive; then
28580	    dotest recase-9ss "$testcvs -q up -rfirst" \
28581"$SPROG update: \`FiLe' is no longer in the repository
28582U file"
28583
28584	    if $client_sensitive; then
28585	      dotest recase-10sscs "$testcvs -q up -A" \
28586"U FiLe
28587$SPROG update: \`file' is no longer in the repository"
28588	    else # client insensitive
28589	      # FIXCVS: This should remove the offending file first.
28590	      dotest_fail recase-10ssci "$testcvs -q up -A" \
28591"$SPROG update: move away \`\./FiLe'; it is in the way
28592C FiLe
28593$SPROG update: \`file' is no longer in the repository"
28594
28595	      cd ..
28596	      rm -r first-dir
28597	      dotest recase-11ssci "$testcvs -q co first-dir" \
28598"U first-dir/FiLe"
28599	      cd first-dir
28600	    fi
28601
28602	    #
28603	    # See what happens when cased names clash.
28604	    #
28605
28606	    # Copy the archive
28607	    if test -n "$remotehost"; then
28608	      modify_repo $CVS_RSH $remotehost \
28609			  "cp $CVSROOT_DIRNAME/first-dir/FiLe,v \
28610			  $CVSROOT_DIRNAME/first-dir/FILE,v"
28611	    else
28612	      modify_repo cp $CVSROOT_DIRNAME/first-dir/FiLe,v \
28613			     $CVSROOT_DIRNAME/first-dir/FILE,v
28614	    fi
28615
28616	    if $client_sensitive; then
28617	      dotest recase-12sscs "$testcvs -q up" "U FILE"
28618	    else # client insensitive
28619	      dotest_fail recase-12ssci "$testcvs -q up" \
28620"$SPROG update: move away \`\./FILE'; it is in the way
28621C FILE"
28622	    fi
28623	  else # server insensitive
28624	    dotest recase-9si "$testcvs -q up -rfirst" "U FiLe"
28625	    dotest recase-10si "$testcvs -q up -A" "U FiLe"
28626	  fi
28627
28628	  # Prove that we can still get status and log information on
28629	  # conflicting case files (1 in Attic, two in parent).
28630	  if $server_sensitive; then
28631	    if $client_sensitive; then
28632	      # Client finds Entry only for FiLe.  Others returned by server.
28633	      dotest recase-13sscs "$testcvs status file" \
28634"===================================================================
28635File: no file file		Status: Up-to-date
28636
28637   Working revision:	No entry for file
28638   Repository revision:	1\.2	$CVSROOT_DIRNAME/first-dir/Attic/file,v
28639   Commit Identifier:	${commitid}"
28640	    dotest recase-14sscs "$testcvs log file" \
28641"
28642RCS file: $CVSROOT_DIRNAME/first-dir/Attic/file,v
28643Working file: file
28644head: 1\.2
28645branch:
28646locks: strict
28647access list:
28648symbolic names:
28649	first: 1\.1
28650keyword substitution: kv
28651total revisions: 2;	selected revisions: 2
28652description:
28653----------------------------
28654revision 1\.2
28655date: ${ISO8601DATE};  author: $username;  state: dead;  lines: +0 -0;  commitid: ${commitid};
28656rm
28657----------------------------
28658revision 1\.1
28659date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28660add
28661============================================================================="
28662	    dotest recase-15sscs "$testcvs status FiLe" \
28663"===================================================================
28664File: FiLe             	Status: Up-to-date
28665
28666   Working revision:	1\.1.*
28667   Repository revision:	1\.1	$CVSROOT_DIRNAME/first-dir/FiLe,v
28668   Commit Identifier:	${commitid}
28669   Sticky Tag:		(none)
28670   Sticky Date:		(none)
28671   Sticky Options:	(none)"
28672	      dotest recase-16sscs "$testcvs log FiLe" \
28673"
28674RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
28675Working file: FiLe
28676head: 1\.1
28677branch:
28678locks: strict
28679access list:
28680symbolic names:
28681keyword substitution: kv
28682total revisions: 1;	selected revisions: 1
28683description:
28684----------------------------
28685revision 1\.1
28686date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28687recase
28688============================================================================="
28689	      dotest recase-17sscs "$testcvs status FILE" \
28690"===================================================================
28691File: FILE             	Status: Up-to-date
28692
28693   Working revision:	1.1.*
28694   Repository revision:	1.1	${CVSROOT_DIRNAME}/first-dir/FILE,v
28695   Commit Identifier:	${commitid}
28696   Sticky Tag:		(none)
28697   Sticky Date:		(none)
28698   Sticky Options:	(none)"
28699	      dotest recase-18sscs "$testcvs log FILE" \
28700"
28701RCS file: $CVSROOT_DIRNAME/first-dir/FILE,v
28702Working file: FILE
28703head: 1\.1
28704branch:
28705locks: strict
28706access list:
28707symbolic names:
28708keyword substitution: kv
28709total revisions: 1;	selected revisions: 1
28710description:
28711----------------------------
28712revision 1\.1
28713date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28714recase
28715============================================================================="
28716	    else # $server_sensitive && !$client_sensitive
28717	      # Client finds same Entry for file & FiLe.
28718	      dotest recase-13ssci "$testcvs status file" \
28719"===================================================================
28720File: FiLe             	Status: Up-to-date
28721
28722   Working revision:	1\.1.*
28723   Repository revision:	1\.1	$CVSROOT_DIRNAME/first-dir/FiLe,v
28724   Commit Identifier:	${commitid}
28725   Sticky Tag:		(none)
28726   Sticky Date:		(none)
28727   Sticky Options:	(none)"
28728	      dotest recase-16ssci "$testcvs log FiLe" \
28729"
28730RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
28731Working file: FiLe
28732head: 1\.1
28733branch:
28734locks: strict
28735access list:
28736symbolic names:
28737keyword substitution: kv
28738total revisions: 1;	selected revisions: 1
28739description:
28740----------------------------
28741revision 1\.1
28742date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28743recase
28744============================================================================="
28745	      dotest recase-17ssci "$testcvs status FILE" \
28746"===================================================================
28747File: FiLe             	Status: Up-to-date
28748
28749   Working revision:	1\.1.*
28750   Repository revision:	1\.1	$CVSROOT_DIRNAME/first-dir/FiLe,v
28751   Commit Identifier:	${commitid}
28752   Sticky Tag:		(none)
28753   Sticky Date:		(none)
28754   Sticky Options:	(none)"
28755	      dotest recase-18ssci "$testcvs log FILE" \
28756"
28757RCS file: $CVSROOT_DIRNAME/first-dir/FiLe,v
28758Working file: FiLe
28759head: 1\.1
28760branch:
28761locks: strict
28762access list:
28763symbolic names:
28764keyword substitution: kv
28765total revisions: 1;	selected revisions: 1
28766description:
28767----------------------------
28768revision 1\.1
28769date: ${ISO8601DATE};  author: $username;  state: Exp;  commitid: ${commitid};
28770recase
28771============================================================================="
28772	    fi
28773	  else # !$server_sensitive
28774	    # Skip these when the server is case insensitive - nothing
28775	    # has changed since recase-[4-7]si
28776	    :
28777	  fi
28778
28779	  if $client_sensitive && $server_sensitive; then
28780	    dotest recase-19sscs "$testcvs status fIlE" \
28781"$SPROG status: nothing known about \`fIlE'
28782===================================================================
28783File: no file fIlE		Status: Unknown
28784
28785   Working revision:	No entry for fIlE
28786   Repository revision:	No revision control file"
28787	  else # !$client_sensitive || !$server_sensitive
28788	    dotest recase-19anyi "$testcvs status fIlE" \
28789"===================================================================
28790File: $fIlE             	Status: Up-to-date
28791
28792   Working revision:	1\.[0-9]*.*
28793   Repository revision:	1\.[0-9]*	$CVSROOT_DIRNAME/first-dir/$fIlE,v
28794   Commit Identifier:	${commitid}
28795   Sticky Tag:		(none)
28796   Sticky Date:		(none)
28797   Sticky Options:	(none)"
28798	  fi
28799
28800	  # And last but not least, prove that a checkout is still possible.
28801	  cd ../..
28802	  mkdir 3; cd 3
28803	  if $server_sensitive; then
28804	    if $client_sensitive; then
28805	      dotest recase-20sscs "$testcvs -q co first-dir" \
28806"U first-dir/FILE
28807U first-dir/FiLe"
28808	    else # $server_senstive && !$client_sensitive
28809	      dotest_fail recase-20ssci "$testcvs -q co first-dir" \
28810"U first-dir/FILE
28811$SPROG checkout: move away \`first-dir/FiLe'; it is in the way
28812C first-dir/FiLe"
28813	    fi
28814	  else # !$server_sensitive
28815	    # Skip these since nothing has changed.
28816	    :
28817	  fi
28818
28819	  dokeep
28820	  cd ..
28821	  rm -r 1 2 3
28822	  if $server_sensitive && test -n "$remotehost"; then
28823	    # It is necessary to remove one of the case-conflicted files before
28824	    # recursively removing the rest under Cygwin on a Samba share or
28825	    # Samba returns a permission denied error due to its case
28826	    # confusion.
28827	    $CVS_RSH $remotehost "rm -f $CVSROOT_DIRNAME/first-dir/FILE,v"
28828	  fi
28829	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
28830	  ;;
28831
28832
28833
28834	multiroot)
28835	  #
28836	  # set up two repositories
28837	  #
28838
28839	  if $proxy; then
28840	    # don't even try
28841	    continue
28842	  fi
28843
28844	  CVSROOT1_DIRNAME=${TESTDIR}/root.1
28845	  CVSROOT2_DIRNAME=${TESTDIR}/root.2
28846	  CVSROOT1=`newroot $CVSROOT1_DIRNAME`
28847	  CVSROOT2=`newroot $CVSROOT2_DIRNAME`
28848	  testcvs1="$testcvs -d '$CVSROOT1'"
28849	  testcvs2="$testcvs -d '$CVSROOT2'"
28850
28851	  dotest multiroot-setup-1 "mkdir $CVSROOT1_DIRNAME $CVSROOT2_DIRNAME"
28852	  dotest multiroot-setup-2 "$testcvs1 init"
28853	  dotest multiroot-setup-3 "$testcvs2 init"
28854
28855	  #
28856	  # create some directories in ${CVSROOT1_DIRNAME}
28857	  #
28858	  mkdir 1; cd 1
28859	  dotest multiroot-setup-4 "${testcvs1} co -l ." "${SPROG} checkout: Updating ."
28860	  mkdir mod1-1 mod1-2
28861	  dotest multiroot-setup-5 "${testcvs1} add mod1-1 mod1-2" \
28862"Directory ${CVSROOT1_DIRNAME}/mod1-1 added to the repository
28863Directory ${CVSROOT1_DIRNAME}/mod1-2 added to the repository"
28864	  echo file1-1 > mod1-1/file1-1
28865	  echo file1-2 > mod1-2/file1-2
28866	  dotest multiroot-setup-6 "${testcvs1} add mod1-1/file1-1 mod1-2/file1-2" \
28867"${SPROG} add: scheduling file .mod1-1/file1-1. for addition
28868${SPROG} add: scheduling file .mod1-2/file1-2. for addition
28869${SPROG} add: use \`${SPROG} commit' to add these files permanently"
28870	  dotest multiroot-setup-7 "${testcvs1} commit -m is" \
28871"${CPROG} commit: Examining \.
28872${CPROG} commit: Examining mod1-1
28873${CPROG} commit: Examining mod1-2
28874${CVSROOT1_DIRNAME}/mod1-1/file1-1,v  <--  mod1-1/file1-1
28875initial revision: 1.1
28876${CVSROOT1_DIRNAME}/mod1-2/file1-2,v  <--  mod1-2/file1-2
28877initial revision: 1.1"
28878	  cd ..
28879	  rm -rf 1
28880
28881	  #
28882	  # create some directories in ${CVSROOT2_DIRNAME}
28883	  #
28884	  mkdir 1; cd 1
28885	  dotest multiroot-setup-8 "${testcvs2} co -l ." "${SPROG} checkout: Updating ."
28886	  mkdir mod2-1 mod2-2
28887	  dotest multiroot-setup-9 "${testcvs2} add mod2-1 mod2-2" \
28888"Directory ${CVSROOT2_DIRNAME}/mod2-1 added to the repository
28889Directory ${CVSROOT2_DIRNAME}/mod2-2 added to the repository"
28890	  echo file2-1 > mod2-1/file2-1
28891	  echo file2-2 > mod2-2/file2-2
28892	  dotest multiroot-setup-6 "${testcvs2} add mod2-1/file2-1 mod2-2/file2-2" \
28893"${SPROG} add: scheduling file .mod2-1/file2-1. for addition
28894${SPROG} add: scheduling file .mod2-2/file2-2. for addition
28895${SPROG} add: use \`${SPROG} commit' to add these files permanently"
28896	  dotest multiroot-setup-10 "${testcvs2} commit -m anyone" \
28897"${CPROG} commit: Examining \.
28898${CPROG} commit: Examining mod2-1
28899${CPROG} commit: Examining mod2-2
28900${CVSROOT2_DIRNAME}/mod2-1/file2-1,v  <--  mod2-1/file2-1
28901initial revision: 1.1
28902${CVSROOT2_DIRNAME}/mod2-2/file2-2,v  <--  mod2-2/file2-2
28903initial revision: 1.1"
28904	  cd ..
28905	  rm -rf 1
28906
28907	  # check out a few directories, from simple/shallow to
28908	  # complex/deep
28909	  mkdir 1; cd 1
28910
28911	  # OK, this case is kind of weird.  If we just run things from
28912	  # here, without CVS/Root, then CVS will contact the server
28913	  # mentioned in CVSROOT (which is irrelevant) which will print
28914	  # some messages.  Our workaround is to make sure we have a
28915	  # CVS/Root file at top level.  In the future, it is possible
28916	  # the best behavior will be to extend the existing behavior
28917	  # ("being called from a directory without CVS administration
28918	  # has always meant to process each of the sub-dirs") to also
28919	  # do that if there is no CVSROOT, CVS/Root, or -d at top level.
28920	  #
28921	  # The local case could stumble through the tests without creating
28922	  # the top-level CVS/Root, but we create it for local and for
28923	  # remote to reduce special cases later in the test.
28924	  dotest multiroot-workaround "${testcvs1} -q co -l ." ""
28925
28926	  dotest multiroot-setup-11 "${testcvs1} co mod1-1 mod1-2" \
28927"${SPROG} checkout: Updating mod1-1
28928U mod1-1/file1-1
28929${SPROG} checkout: Updating mod1-2
28930U mod1-2/file1-2"
28931	  dotest multiroot-setup-12 "${testcvs2} co mod2-1 mod2-2" \
28932"${SPROG} checkout: Updating mod2-1
28933U mod2-1/file2-1
28934${SPROG} checkout: Updating mod2-2
28935U mod2-2/file2-2"
28936	  cd mod1-2
28937	  dotest multiroot-setup-13 "${testcvs2} co mod2-2" \
28938"${SPROG} checkout: Updating mod2-2
28939U mod2-2/file2-2"
28940	  cd ..
28941	  cd mod2-2
28942	  dotest multiroot-setup-14 "${testcvs1} co mod1-2" \
28943"${SPROG} checkout: Updating mod1-2
28944U mod1-2/file1-2"
28945	  cd ..
28946
28947	  #
28948	  # Make sure that the Root and Repository files contain the
28949	  # correct information.
28950	  #
28951	  dotest multiroot-cvsadm-1a "cat mod1-1/CVS/Root" "${CVSROOT1}"
28952	  dotest multiroot-cvsadm-1b "cat mod1-1/CVS/Repository" "mod1-1"
28953	  dotest multiroot-cvsadm-2a "cat mod2-1/CVS/Root" "${CVSROOT2}"
28954	  dotest multiroot-cvsadm-2b "cat mod2-1/CVS/Repository" "mod2-1"
28955	  dotest multiroot-cvsadm-3a "cat mod1-2/CVS/Root" "${CVSROOT1}"
28956	  dotest multiroot-cvsadm-3b "cat mod1-2/CVS/Repository" "mod1-2"
28957	  dotest multiroot-cvsadm-3c "cat mod1-2/mod2-2/CVS/Root" "${CVSROOT2}"
28958	  dotest multiroot-cvsadm-3d "cat mod1-2/mod2-2/CVS/Repository" "mod2-2"
28959	  dotest multiroot-cvsadm-4a "cat mod2-2/CVS/Root" "${CVSROOT2}"
28960	  dotest multiroot-cvsadm-4b "cat mod2-2/CVS/Repository" "mod2-2"
28961	  dotest multiroot-cvsadm-4c "cat mod2-2/mod1-2/CVS/Root" "${CVSROOT1}"
28962	  dotest multiroot-cvsadm-4d "cat mod2-2/mod1-2/CVS/Repository" "mod1-2"
28963
28964	  #
28965	  # Start testing various cvs commands.  Begin with commands
28966	  # without extra arguments (e.g. "cvs update", "cvs diff",
28967	  # etc.
28968	  #
28969
28970	  # Do at least one command with both CVSROOTs to make sure
28971	  # that there's not some kind of unexpected dependency on the
28972	  # choice of which CVSROOT is specified on the command line.
28973
28974	  dotest multiroot-update-1a "${testcvs1} update" \
28975"${SPROG} update: Updating \.
28976${SPROG} update: Updating mod1-1
28977${SPROG} update: Updating mod1-2
28978${SPROG} update: Updating mod1-2/mod2-2
28979${SPROG} update: cannot open directory ${CVSROOT1_DIRNAME}/mod2-2: No such file or directory
28980${SPROG} update: skipping directory mod1-2/mod2-2
28981${SPROG} update: Updating mod2-1
28982${SPROG} update: cannot open directory ${CVSROOT1_DIRNAME}/mod2-1: No such file or directory
28983${SPROG} update: skipping directory mod2-1
28984${SPROG} update: Updating mod2-2
28985${SPROG} update: cannot open directory ${CVSROOT1_DIRNAME}/mod2-2: No such file or directory
28986${SPROG} update: skipping directory mod2-2"
28987
28988	  # Same deal but with -d ${CVSROOT2}.
28989	  dotest multiroot-update-1b "${testcvs2} update" \
28990"${SPROG} update: Updating \.
28991${SPROG} update: Updating mod1-1
28992${SPROG} update: cannot open directory ${CVSROOT2_DIRNAME}/mod1-1: No such file or directory
28993${SPROG} update: skipping directory mod1-1
28994${SPROG} update: Updating mod1-2
28995${SPROG} update: cannot open directory ${CVSROOT2_DIRNAME}/mod1-2: No such file or directory
28996${SPROG} update: skipping directory mod1-2
28997${SPROG} update: Updating mod2-1
28998${SPROG} update: Updating mod2-2
28999${SPROG} update: Updating mod2-2/mod1-2
29000${SPROG} update: cannot open directory ${CVSROOT2_DIRNAME}/mod1-2: No such file or directory
29001${SPROG} update: skipping directory mod2-2/mod1-2"
29002
29003	  # modify all files and do a diff
29004
29005	  echo bobby >> mod1-1/file1-1
29006	  echo brown >> mod1-2/file1-2
29007	  echo goes >> mod2-1/file2-1
29008	  echo down >> mod2-2/file2-2
29009
29010	  dotest_fail multiroot-diff-1 "${testcvs} diff" \
29011"${SPROG} diff: Diffing \.
29012${SPROG} diff: Diffing mod1-1
29013Index: mod1-1/file1-1
29014===================================================================
29015RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
29016retrieving revision 1\.1
29017diff -r1\.1 file1-1
290181a2
29019> bobby
29020${SPROG} diff: Diffing mod1-2
29021Index: mod1-2/file1-2
29022===================================================================
29023RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
29024retrieving revision 1\.1
29025diff -r1\.1 file1-2
290261a2
29027> brown
29028${SPROG} diff: Diffing mod2-2/mod1-2
29029${SPROG} diff: Diffing mod1-2/mod2-2
29030${SPROG} diff: Diffing mod2-1
29031Index: mod2-1/file2-1
29032===================================================================
29033RCS file: ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
29034retrieving revision 1\.1
29035diff -r1\.1 file2-1
290361a2
29037> goes
29038${SPROG} diff: Diffing mod2-2
29039Index: mod2-2/file2-2
29040===================================================================
29041RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
29042retrieving revision 1\.1
29043diff -r1\.1 file2-2
290441a2
29045> down" \
29046"${SPROG} diff: Diffing \.
29047${SPROG} diff: Diffing mod1-1
29048Index: mod1-1/file1-1
29049===================================================================
29050RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
29051retrieving revision 1\.1
29052diff -r1\.1 file1-1
290531a2
29054> bobby
29055${SPROG} diff: Diffing mod1-2
29056Index: mod1-2/file1-2
29057===================================================================
29058RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
29059retrieving revision 1\.1
29060diff -r1\.1 file1-2
290611a2
29062> brown
29063${SPROG} diff: Diffing mod2-2
29064${SPROG} diff: Diffing mod2-2/mod1-2
29065${SPROG} diff: Diffing mod1-2
29066${SPROG} diff: Diffing mod1-2/mod2-2
29067${SPROG} diff: Diffing mod2-1
29068Index: mod2-1/file2-1
29069===================================================================
29070RCS file: ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
29071retrieving revision 1\.1
29072diff -r1\.1 file2-1
290731a2
29074> goes
29075${SPROG} diff: Diffing mod2-2
29076Index: mod2-2/file2-2
29077===================================================================
29078RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
29079retrieving revision 1\.1
29080diff -r1\.1 file2-2
290811a2
29082> down"
29083
29084	  dotest multiroot-commit-1 "${testcvs} commit -m actually" \
29085"${CPROG} commit: Examining \.
29086${CPROG} commit: Examining mod1-1
29087${CPROG} commit: Examining mod1-2
29088${CPROG} commit: Examining mod2-2/mod1-2
29089${CVSROOT1_DIRNAME}/mod1-1/file1-1,v  <--  mod1-1/file1-1
29090new revision: 1.2; previous revision: 1.1
29091${CVSROOT1_DIRNAME}/mod1-2/file1-2,v  <--  mod1-2/file1-2
29092new revision: 1.2; previous revision: 1.1
29093${CPROG} commit: Examining mod1-2/mod2-2
29094${CPROG} commit: Examining mod2-1
29095${CPROG} commit: Examining mod2-2
29096${CVSROOT2_DIRNAME}/mod2-1/file2-1,v  <--  mod2-1/file2-1
29097new revision: 1.2; previous revision: 1.1
29098${CVSROOT2_DIRNAME}/mod2-2/file2-2,v  <--  mod2-2/file2-2
29099new revision: 1.2; previous revision: 1.1"
29100
29101	  dotest multiroot-update-2 "${testcvs} update" \
29102"${CPROG} update: Updating \.
29103${CPROG} update: Updating mod1-1
29104${CPROG} update: Updating mod1-2
29105${CPROG} update: Updating mod2-2/mod1-2
29106U mod2-2/mod1-2/file1-2
29107${CPROG} update: Updating mod1-2/mod2-2
29108U mod1-2/mod2-2/file2-2
29109${CPROG} update: Updating mod2-1
29110${CPROG} update: Updating mod2-2" \
29111"${SPROG} update: Updating \.
29112${SPROG} update: Updating mod1-1
29113${SPROG} update: Updating mod1-2
29114${SPROG} update: Updating mod2-2
29115${SPROG} update: Updating mod2-2/mod1-2
29116P mod2-2/mod1-2/file1-2
29117${SPROG} update: Updating mod1-2
29118${SPROG} update: Updating mod1-2/mod2-2
29119P mod1-2/mod2-2/file2-2
29120${SPROG} update: Updating mod2-1
29121${SPROG} update: Updating mod2-2"
29122
29123	  dotest multiroot-tag-1 "${testcvs} tag cattle" \
29124"${SPROG} tag: Tagging \.
29125${SPROG} tag: Tagging mod1-1
29126T mod1-1/file1-1
29127${SPROG} tag: Tagging mod1-2
29128T mod1-2/file1-2
29129${SPROG} tag: Tagging mod2-2/mod1-2
29130${SPROG} tag: Tagging mod1-2/mod2-2
29131T mod1-2/mod2-2/file2-2
29132${SPROG} tag: Tagging mod2-1
29133T mod2-1/file2-1
29134${SPROG} tag: Tagging mod2-2" \
29135"${SPROG} tag: Tagging \.
29136${SPROG} tag: Tagging mod1-1
29137T mod1-1/file1-1
29138${SPROG} tag: Tagging mod1-2
29139T mod1-2/file1-2
29140${SPROG} tag: Tagging mod2-2
29141${SPROG} tag: Tagging mod2-2/mod1-2
29142${SPROG} tag: Tagging mod1-2
29143${SPROG} tag: Tagging mod1-2/mod2-2
29144T mod1-2/mod2-2/file2-2
29145${SPROG} tag: Tagging mod2-1
29146T mod2-1/file2-1
29147${SPROG} tag: Tagging mod2-2"
29148
29149	  echo anotherfile1-1 > mod1-1/anotherfile1-1
29150	  echo anotherfile2-1 > mod2-1/anotherfile2-1
29151	  echo anotherfile1-2 > mod2-2/mod1-2/anotherfile1-2
29152	  echo anotherfile2-2 > mod1-2/mod2-2/anotherfile2-2
29153
29154	  if $remote; then
29155	    cd mod1-1
29156	    dotest multiroot-add-1ar "${testcvs} add anotherfile1-1" \
29157"${SPROG} add: scheduling file .anotherfile1-1. for addition
29158${SPROG} add: use .${SPROG} commit. to add this file permanently"
29159	    cd ../mod2-1
29160	    dotest multiroot-add-1br "${testcvs} add anotherfile2-1" \
29161"${SPROG} add: scheduling file .anotherfile2-1. for addition
29162${SPROG} add: use .${SPROG} commit. to add this file permanently"
29163	    cd ../mod2-2/mod1-2
29164	    dotest multiroot-add-1cr "${testcvs} add anotherfile1-2" \
29165"${SPROG} add: scheduling file .anotherfile1-2. for addition
29166${SPROG} add: use .${SPROG} commit. to add this file permanently"
29167	    cd ../../mod1-2/mod2-2
29168	    dotest multiroot-add-1dr "${testcvs} add anotherfile2-2" \
29169"${SPROG} add: scheduling file .anotherfile2-2. for addition
29170${SPROG} add: use .${SPROG} commit. to add this file permanently"
29171	    cd ../..
29172          else
29173	    dotest multiroot-add-1 "${testcvs} add mod1-1/anotherfile1-1 mod2-1/anotherfile2-1 mod2-2/mod1-2/anotherfile1-2 mod1-2/mod2-2/anotherfile2-2" \
29174"${SPROG} add: scheduling file .mod1-1/anotherfile1-1. for addition
29175${SPROG} add: scheduling file .mod2-1/anotherfile2-1. for addition
29176${SPROG} add: scheduling file .mod2-2/mod1-2/anotherfile1-2. for addition
29177${SPROG} add: scheduling file .mod1-2/mod2-2/anotherfile2-2. for addition
29178${SPROG} add: use .${SPROG} commit. to add these files permanently"
29179          fi
29180
29181	  dotest multiroot-status-1 "${testcvs} status -v" \
29182"${SPROG} status: Examining \.
29183${SPROG} status: Examining mod1-1
29184===================================================================
29185File: anotherfile1-1   	Status: Locally Added
29186
29187   Working revision:	New file!
29188   Repository revision:	No revision control file
29189   Sticky Tag:		(none)
29190   Sticky Date:		(none)
29191   Sticky Options:	(none)
29192
29193===================================================================
29194File: file1-1          	Status: Up-to-date
29195
29196   Working revision:	1\.2.*
29197   Repository revision:	1\.2	${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
29198   Commit Identifier:	${commitid}
29199   Sticky Tag:		(none)
29200   Sticky Date:		(none)
29201   Sticky Options:	(none)
29202
29203   Existing Tags:
29204	cattle                   	(revision: 1\.2)
29205
29206${SPROG} status: Examining mod1-2
29207===================================================================
29208File: file1-2          	Status: Up-to-date
29209
29210   Working revision:	1\.2.*
29211   Repository revision:	1\.2	${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
29212   Commit Identifier:	${commitid}
29213   Sticky Tag:		(none)
29214   Sticky Date:		(none)
29215   Sticky Options:	(none)
29216
29217   Existing Tags:
29218	cattle                   	(revision: 1\.2)
29219
29220${SPROG} status: Examining mod2-2/mod1-2
29221===================================================================
29222File: anotherfile1-2   	Status: Locally Added
29223
29224   Working revision:	New file!
29225   Repository revision:	No revision control file
29226   Sticky Tag:		(none)
29227   Sticky Date:		(none)
29228   Sticky Options:	(none)
29229
29230===================================================================
29231File: file1-2          	Status: Up-to-date
29232
29233   Working revision:	1\.2.*
29234   Repository revision:	1\.2	${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
29235   Commit Identifier:	${commitid}
29236   Sticky Tag:		(none)
29237   Sticky Date:		(none)
29238   Sticky Options:	(none)
29239
29240   Existing Tags:
29241	cattle                   	(revision: 1\.2)
29242
29243${SPROG} status: Examining mod1-2/mod2-2
29244===================================================================
29245File: anotherfile2-2   	Status: Locally Added
29246
29247   Working revision:	New file!
29248   Repository revision:	No revision control file
29249   Sticky Tag:		(none)
29250   Sticky Date:		(none)
29251   Sticky Options:	(none)
29252
29253===================================================================
29254File: file2-2          	Status: Up-to-date
29255
29256   Working revision:	1\.2.*
29257   Repository revision:	1\.2	${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
29258   Commit Identifier:	${commitid}
29259   Sticky Tag:		(none)
29260   Sticky Date:		(none)
29261   Sticky Options:	(none)
29262
29263   Existing Tags:
29264	cattle                   	(revision: 1\.2)
29265
29266${SPROG} status: Examining mod2-1
29267===================================================================
29268File: anotherfile2-1   	Status: Locally Added
29269
29270   Working revision:	New file!
29271   Repository revision:	No revision control file
29272   Sticky Tag:		(none)
29273   Sticky Date:		(none)
29274   Sticky Options:	(none)
29275
29276===================================================================
29277File: file2-1          	Status: Up-to-date
29278
29279   Working revision:	1\.2.*
29280   Repository revision:	1\.2	${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
29281   Commit Identifier:	${commitid}
29282   Sticky Tag:		(none)
29283   Sticky Date:		(none)
29284   Sticky Options:	(none)
29285
29286   Existing Tags:
29287	cattle                   	(revision: 1\.2)
29288
29289${SPROG} status: Examining mod2-2
29290===================================================================
29291File: file2-2          	Status: Up-to-date
29292
29293   Working revision:	1\.2.*
29294   Repository revision:	1\.2	${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
29295   Commit Identifier:	${commitid}
29296   Sticky Tag:		(none)
29297   Sticky Date:		(none)
29298   Sticky Options:	(none)
29299
29300   Existing Tags:
29301	cattle                   	(revision: 1\.2)" \
29302"${SPROG} status: Examining \.
29303${SPROG} status: Examining mod1-1
29304===================================================================
29305File: anotherfile1-1   	Status: Locally Added
29306
29307   Working revision:	New file!
29308   Repository revision:	No revision control file
29309   Sticky Tag:		(none)
29310   Sticky Date:		(none)
29311   Sticky Options:	(none)
29312
29313===================================================================
29314File: file1-1          	Status: Up-to-date
29315
29316   Working revision:	1\.2.*
29317   Repository revision:	1\.2	${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
29318   Commit Identifier:	${commitid}
29319   Sticky Tag:		(none)
29320   Sticky Date:		(none)
29321   Sticky Options:	(none)
29322
29323   Existing Tags:
29324	cattle                   	(revision: 1\.2)
29325
29326${SPROG} status: Examining mod1-2
29327===================================================================
29328File: file1-2          	Status: Up-to-date
29329
29330   Working revision:	1\.2.*
29331   Repository revision:	1\.2	${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
29332   Commit Identifier:	${commitid}
29333   Sticky Tag:		(none)
29334   Sticky Date:		(none)
29335   Sticky Options:	(none)
29336
29337   Existing Tags:
29338	cattle                   	(revision: 1\.2)
29339
29340${SPROG} status: Examining mod2-2
29341${SPROG} status: Examining mod2-2/mod1-2
29342===================================================================
29343File: anotherfile1-2   	Status: Locally Added
29344
29345   Working revision:	New file!
29346   Repository revision:	No revision control file
29347   Sticky Tag:		(none)
29348   Sticky Date:		(none)
29349   Sticky Options:	(none)
29350
29351===================================================================
29352File: file1-2          	Status: Up-to-date
29353
29354   Working revision:	1\.2.*
29355   Repository revision:	1\.2	${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
29356   Commit Identifier:	${commitid}
29357   Sticky Tag:		(none)
29358   Sticky Date:		(none)
29359   Sticky Options:	(none)
29360
29361   Existing Tags:
29362	cattle                   	(revision: 1\.2)
29363
29364${SPROG} status: Examining mod1-2
29365${SPROG} status: Examining mod1-2/mod2-2
29366===================================================================
29367File: anotherfile2-2   	Status: Locally Added
29368
29369   Working revision:	New file!
29370   Repository revision:	No revision control file
29371   Sticky Tag:		(none)
29372   Sticky Date:		(none)
29373   Sticky Options:	(none)
29374
29375===================================================================
29376File: file2-2          	Status: Up-to-date
29377
29378   Working revision:	1\.2.*
29379   Repository revision:	1\.2	${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
29380   Commit Identifier:	${commitid}
29381   Sticky Tag:		(none)
29382   Sticky Date:		(none)
29383   Sticky Options:	(none)
29384
29385   Existing Tags:
29386	cattle                   	(revision: 1\.2)
29387
29388${SPROG} status: Examining mod2-1
29389===================================================================
29390File: anotherfile2-1   	Status: Locally Added
29391
29392   Working revision:	New file!
29393   Repository revision:	No revision control file
29394   Sticky Tag:		(none)
29395   Sticky Date:		(none)
29396   Sticky Options:	(none)
29397
29398===================================================================
29399File: file2-1          	Status: Up-to-date
29400
29401   Working revision:	1\.2.*
29402   Repository revision:	1\.2	${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
29403   Commit Identifier:	${commitid}
29404   Sticky Tag:		(none)
29405   Sticky Date:		(none)
29406   Sticky Options:	(none)
29407
29408   Existing Tags:
29409	cattle                   	(revision: 1\.2)
29410
29411${SPROG} status: Examining mod2-2
29412===================================================================
29413File: file2-2          	Status: Up-to-date
29414
29415   Working revision:	1\.2.*
29416   Repository revision:	1\.2	${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
29417   Commit Identifier:	${commitid}
29418   Sticky Tag:		(none)
29419   Sticky Date:		(none)
29420   Sticky Options:	(none)
29421
29422   Existing Tags:
29423	cattle                   	(revision: 1\.2)"
29424
29425	  dotest multiroot-commit-2 "${testcvs} commit -m reading" \
29426"${CPROG} commit: Examining \.
29427${CPROG} commit: Examining mod1-1
29428${CPROG} commit: Examining mod1-2
29429${CPROG} commit: Examining mod2-2/mod1-2
29430${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v  <--  mod1-1/anotherfile1-1
29431initial revision: 1\.1
29432${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v  <--  mod2-2/mod1-2/anotherfile1-2
29433initial revision: 1\.1
29434${CPROG} commit: Examining mod1-2/mod2-2
29435${CPROG} commit: Examining mod2-1
29436${CPROG} commit: Examining mod2-2
29437${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v  <--  mod1-2/mod2-2/anotherfile2-2
29438initial revision: 1\.1
29439${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v  <--  mod2-1/anotherfile2-1
29440initial revision: 1\.1"
29441
29442	  dotest multiroot-update-3 "${testcvs} update" \
29443"${CPROG} update: Updating \.
29444${CPROG} update: Updating mod1-1
29445${CPROG} update: Updating mod1-2
29446U mod1-2/anotherfile1-2
29447${CPROG} update: Updating mod2-2/mod1-2
29448${CPROG} update: Updating mod1-2/mod2-2
29449${CPROG} update: Updating mod2-1
29450${CPROG} update: Updating mod2-2
29451U mod2-2/anotherfile2-2" \
29452"${SPROG} update: Updating \.
29453${SPROG} update: Updating mod1-1
29454${SPROG} update: Updating mod1-2
29455U mod1-2/anotherfile1-2
29456${SPROG} update: Updating mod2-2
29457${SPROG} update: Updating mod2-2/mod1-2
29458${SPROG} update: Updating mod1-2
29459${SPROG} update: Updating mod1-2/mod2-2
29460${SPROG} update: Updating mod2-1
29461${SPROG} update: Updating mod2-2
29462U mod2-2/anotherfile2-2"
29463
29464	  dotest multiroot-log-1 "${testcvs} log" \
29465"${SPROG} log: Logging \.
29466${SPROG} log: Logging mod1-1
29467
29468RCS file: ${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v
29469Working file: mod1-1/anotherfile1-1
29470head: 1\.1
29471branch:
29472locks: strict
29473access list:
29474symbolic names:
29475keyword substitution: kv
29476total revisions: 1;	selected revisions: 1
29477description:
29478----------------------------
29479revision 1\.1
29480date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29481reading
29482=============================================================================
29483
29484RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
29485Working file: mod1-1/file1-1
29486head: 1\.2
29487branch:
29488locks: strict
29489access list:
29490symbolic names:
29491	cattle: 1\.2
29492keyword substitution: kv
29493total revisions: 2;	selected revisions: 2
29494description:
29495----------------------------
29496revision 1\.2
29497date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29498actually
29499----------------------------
29500revision 1\.1
29501date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29502is
29503=============================================================================
29504${SPROG} log: Logging mod1-2
29505
29506RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
29507Working file: mod1-2/anotherfile1-2
29508head: 1\.1
29509branch:
29510locks: strict
29511access list:
29512symbolic names:
29513keyword substitution: kv
29514total revisions: 1;	selected revisions: 1
29515description:
29516----------------------------
29517revision 1\.1
29518date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29519reading
29520=============================================================================
29521
29522RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
29523Working file: mod1-2/file1-2
29524head: 1\.2
29525branch:
29526locks: strict
29527access list:
29528symbolic names:
29529	cattle: 1\.2
29530keyword substitution: kv
29531total revisions: 2;	selected revisions: 2
29532description:
29533----------------------------
29534revision 1\.2
29535date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29536actually
29537----------------------------
29538revision 1\.1
29539date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29540is
29541=============================================================================
29542${SPROG} log: Logging mod2-2/mod1-2
29543
29544RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
29545Working file: mod2-2/mod1-2/anotherfile1-2
29546head: 1\.1
29547branch:
29548locks: strict
29549access list:
29550symbolic names:
29551keyword substitution: kv
29552total revisions: 1;	selected revisions: 1
29553description:
29554----------------------------
29555revision 1\.1
29556date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29557reading
29558=============================================================================
29559
29560RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
29561Working file: mod2-2/mod1-2/file1-2
29562head: 1\.2
29563branch:
29564locks: strict
29565access list:
29566symbolic names:
29567	cattle: 1\.2
29568keyword substitution: kv
29569total revisions: 2;	selected revisions: 2
29570description:
29571----------------------------
29572revision 1\.2
29573date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29574actually
29575----------------------------
29576revision 1\.1
29577date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29578is
29579=============================================================================
29580${SPROG} log: Logging mod1-2/mod2-2
29581
29582RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
29583Working file: mod1-2/mod2-2/anotherfile2-2
29584head: 1\.1
29585branch:
29586locks: strict
29587access list:
29588symbolic names:
29589keyword substitution: kv
29590total revisions: 1;	selected revisions: 1
29591description:
29592----------------------------
29593revision 1\.1
29594date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29595reading
29596=============================================================================
29597
29598RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
29599Working file: mod1-2/mod2-2/file2-2
29600head: 1\.2
29601branch:
29602locks: strict
29603access list:
29604symbolic names:
29605	cattle: 1\.2
29606keyword substitution: kv
29607total revisions: 2;	selected revisions: 2
29608description:
29609----------------------------
29610revision 1\.2
29611date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29612actually
29613----------------------------
29614revision 1\.1
29615date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29616anyone
29617=============================================================================
29618${SPROG} log: Logging mod2-1
29619
29620RCS file: ${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v
29621Working file: mod2-1/anotherfile2-1
29622head: 1\.1
29623branch:
29624locks: strict
29625access list:
29626symbolic names:
29627keyword substitution: kv
29628total revisions: 1;	selected revisions: 1
29629description:
29630----------------------------
29631revision 1\.1
29632date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29633reading
29634=============================================================================
29635
29636RCS file: ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
29637Working file: mod2-1/file2-1
29638head: 1\.2
29639branch:
29640locks: strict
29641access list:
29642symbolic names:
29643	cattle: 1\.2
29644keyword substitution: kv
29645total revisions: 2;	selected revisions: 2
29646description:
29647----------------------------
29648revision 1\.2
29649date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29650actually
29651----------------------------
29652revision 1\.1
29653date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29654anyone
29655=============================================================================
29656${SPROG} log: Logging mod2-2
29657
29658RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
29659Working file: mod2-2/anotherfile2-2
29660head: 1\.1
29661branch:
29662locks: strict
29663access list:
29664symbolic names:
29665keyword substitution: kv
29666total revisions: 1;	selected revisions: 1
29667description:
29668----------------------------
29669revision 1\.1
29670date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29671reading
29672=============================================================================
29673
29674RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
29675Working file: mod2-2/file2-2
29676head: 1\.2
29677branch:
29678locks: strict
29679access list:
29680symbolic names:
29681	cattle: 1\.2
29682keyword substitution: kv
29683total revisions: 2;	selected revisions: 2
29684description:
29685----------------------------
29686revision 1\.2
29687date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29688actually
29689----------------------------
29690revision 1\.1
29691date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29692anyone
29693=============================================================================" \
29694"${SPROG} log: Logging \.
29695${SPROG} log: Logging mod1-1
29696
29697RCS file: ${CVSROOT1_DIRNAME}/mod1-1/anotherfile1-1,v
29698Working file: mod1-1/anotherfile1-1
29699head: 1\.1
29700branch:
29701locks: strict
29702access list:
29703symbolic names:
29704keyword substitution: kv
29705total revisions: 1;	selected revisions: 1
29706description:
29707----------------------------
29708revision 1\.1
29709date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29710reading
29711=============================================================================
29712
29713RCS file: ${CVSROOT1_DIRNAME}/mod1-1/file1-1,v
29714Working file: mod1-1/file1-1
29715head: 1\.2
29716branch:
29717locks: strict
29718access list:
29719symbolic names:
29720	cattle: 1\.2
29721keyword substitution: kv
29722total revisions: 2;	selected revisions: 2
29723description:
29724----------------------------
29725revision 1\.2
29726date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29727actually
29728----------------------------
29729revision 1\.1
29730date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29731is
29732=============================================================================
29733${SPROG} log: Logging mod1-2
29734
29735RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
29736Working file: mod1-2/anotherfile1-2
29737head: 1\.1
29738branch:
29739locks: strict
29740access list:
29741symbolic names:
29742keyword substitution: kv
29743total revisions: 1;	selected revisions: 1
29744description:
29745----------------------------
29746revision 1\.1
29747date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29748reading
29749=============================================================================
29750
29751RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
29752Working file: mod1-2/file1-2
29753head: 1\.2
29754branch:
29755locks: strict
29756access list:
29757symbolic names:
29758	cattle: 1\.2
29759keyword substitution: kv
29760total revisions: 2;	selected revisions: 2
29761description:
29762----------------------------
29763revision 1\.2
29764date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29765actually
29766----------------------------
29767revision 1\.1
29768date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29769is
29770=============================================================================
29771${SPROG} log: Logging mod2-2
29772${SPROG} log: Logging mod2-2/mod1-2
29773
29774RCS file: ${CVSROOT1_DIRNAME}/mod1-2/anotherfile1-2,v
29775Working file: mod2-2/mod1-2/anotherfile1-2
29776head: 1\.1
29777branch:
29778locks: strict
29779access list:
29780symbolic names:
29781keyword substitution: kv
29782total revisions: 1;	selected revisions: 1
29783description:
29784----------------------------
29785revision 1\.1
29786date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29787reading
29788=============================================================================
29789
29790RCS file: ${CVSROOT1_DIRNAME}/mod1-2/file1-2,v
29791Working file: mod2-2/mod1-2/file1-2
29792head: 1\.2
29793branch:
29794locks: strict
29795access list:
29796symbolic names:
29797	cattle: 1\.2
29798keyword substitution: kv
29799total revisions: 2;	selected revisions: 2
29800description:
29801----------------------------
29802revision 1\.2
29803date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29804actually
29805----------------------------
29806revision 1\.1
29807date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29808is
29809=============================================================================
29810${SPROG} log: Logging mod1-2
29811${SPROG} log: Logging mod1-2/mod2-2
29812
29813RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
29814Working file: mod1-2/mod2-2/anotherfile2-2
29815head: 1\.1
29816branch:
29817locks: strict
29818access list:
29819symbolic names:
29820keyword substitution: kv
29821total revisions: 1;	selected revisions: 1
29822description:
29823----------------------------
29824revision 1\.1
29825date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29826reading
29827=============================================================================
29828
29829RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
29830Working file: mod1-2/mod2-2/file2-2
29831head: 1\.2
29832branch:
29833locks: strict
29834access list:
29835symbolic names:
29836	cattle: 1\.2
29837keyword substitution: kv
29838total revisions: 2;	selected revisions: 2
29839description:
29840----------------------------
29841revision 1\.2
29842date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29843actually
29844----------------------------
29845revision 1\.1
29846date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29847anyone
29848=============================================================================
29849${SPROG} log: Logging mod2-1
29850
29851RCS file: ${CVSROOT2_DIRNAME}/mod2-1/anotherfile2-1,v
29852Working file: mod2-1/anotherfile2-1
29853head: 1\.1
29854branch:
29855locks: strict
29856access list:
29857symbolic names:
29858keyword substitution: kv
29859total revisions: 1;	selected revisions: 1
29860description:
29861----------------------------
29862revision 1\.1
29863date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29864reading
29865=============================================================================
29866
29867RCS file: ${CVSROOT2_DIRNAME}/mod2-1/file2-1,v
29868Working file: mod2-1/file2-1
29869head: 1\.2
29870branch:
29871locks: strict
29872access list:
29873symbolic names:
29874	cattle: 1\.2
29875keyword substitution: kv
29876total revisions: 2;	selected revisions: 2
29877description:
29878----------------------------
29879revision 1\.2
29880date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29881actually
29882----------------------------
29883revision 1\.1
29884date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29885anyone
29886=============================================================================
29887${SPROG} log: Logging mod2-2
29888
29889RCS file: ${CVSROOT2_DIRNAME}/mod2-2/anotherfile2-2,v
29890Working file: mod2-2/anotherfile2-2
29891head: 1\.1
29892branch:
29893locks: strict
29894access list:
29895symbolic names:
29896keyword substitution: kv
29897total revisions: 1;	selected revisions: 1
29898description:
29899----------------------------
29900revision 1\.1
29901date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29902reading
29903=============================================================================
29904
29905RCS file: ${CVSROOT2_DIRNAME}/mod2-2/file2-2,v
29906Working file: mod2-2/file2-2
29907head: 1\.2
29908branch:
29909locks: strict
29910access list:
29911symbolic names:
29912	cattle: 1\.2
29913keyword substitution: kv
29914total revisions: 2;	selected revisions: 2
29915description:
29916----------------------------
29917revision 1\.2
29918date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}1 -0;  commitid: ${commitid};
29919actually
29920----------------------------
29921revision 1\.1
29922date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
29923anyone
29924============================================================================="
29925
29926
29927	  # After the simple cases, let's execute some commands which
29928	  # refer to parts of our checked-out tree (e.g. "cvs update
29929	  # mod1-1 mod2-2")
29930
29931	  dokeep
29932
29933	  # clean up after ourselves
29934	  cd ..
29935	  rm -r 1
29936
29937	  # clean up our repositories
29938	  rm -rf ${CVSROOT1_DIRNAME} ${CVSROOT2_DIRNAME}
29939	  ;;
29940
29941
29942
29943	multiroot2)
29944	  # More multiroot tests.  In particular, nested directories.
29945
29946	  if $proxy; then
29947	    # don't even try
29948	    continue
29949	  fi
29950
29951	  CVSROOT1_DIRNAME=${TESTDIR}/root1
29952	  CVSROOT2_DIRNAME=${TESTDIR}/root2
29953	  CVSROOT1=`newroot $CVSROOT1_DIRNAME`
29954	  CVSROOT2=`newroot $CVSROOT2_DIRNAME`
29955
29956	  dotest multiroot2-1 "${testcvs} -d ${CVSROOT1} init" ""
29957	  dotest multiroot2-2 "${testcvs} -d ${CVSROOT2} init" ""
29958
29959	  mkdir imp-dir; cd imp-dir
29960	  echo file1 >file1
29961	  mkdir sdir
29962	  echo sfile >sdir/sfile
29963	  mkdir sdir/ssdir
29964	  echo ssfile >sdir/ssdir/ssfile
29965	  dotest_sort multiroot2-3 \
29966"${testcvs} -d ${CVSROOT1} import -m import-to-root1 dir1 vend rel" "
29967
29968N dir1/file1
29969N dir1/sdir/sfile
29970N dir1/sdir/ssdir/ssfile
29971No conflicts created by this import
29972${SPROG} import: Importing ${TESTDIR}/root1/dir1/sdir
29973${SPROG} import: Importing ${TESTDIR}/root1/dir1/sdir/ssdir"
29974	  cd sdir
29975	  dotest_sort multiroot2-4 \
29976"${testcvs} -d ${CVSROOT2} import -m import-to-root2 sdir vend2 rel2" "
29977
29978N sdir/sfile
29979N sdir/ssdir/ssfile
29980No conflicts created by this import
29981${SPROG} import: Importing ${TESTDIR}/root2/sdir/ssdir"
29982	  cd ../..
29983
29984	  mkdir 1; cd 1
29985	  # Get TopLevelAdmin-like behavior.
29986	  dotest multiroot2-5 "${testcvs} -d ${CVSROOT1} -q co -l ."
29987	  dotest multiroot2-5 "${testcvs} -d ${CVSROOT1} -q co dir1" \
29988"U dir1/file1
29989U dir1/sdir/sfile
29990U dir1/sdir/ssdir/ssfile"
29991	  cd dir1
29992	  dotest multiroot2-6 "${testcvs} -Q release -d sdir" ""
29993	  dotest multiroot2-7 "${testcvs} -d ${CVSROOT2} -q co sdir" \
29994"U sdir/sfile
29995U sdir/ssdir/ssfile"
29996	  cd ..
29997	  # This has one subtle effect - it deals with Entries.Log
29998	  # so that the next test doesn't get trace messages for
29999	  # Entries.Log
30000	  dotest multiroot2-8 "${testcvs} update" \
30001"${CPROG} update: Updating \.
30002${CPROG} update: Updating dir1
30003${CPROG} update: Updating dir1/sdir
30004${CPROG} update: Updating dir1/sdir/ssdir" \
30005"${SPROG} update: Updating \.
30006${SPROG} update: Updating dir1
30007${SPROG} update: Updating dir1
30008${SPROG} update: Updating dir1/sdir
30009${SPROG} update: Updating dir1/sdir/ssdir"
30010	  # Two reasons we don't run this on the server: (1) the server
30011	  # also prints some trace messages, and (2) the server trace
30012	  # messages are subject to out-of-order bugs (this one is hard
30013	  # to work around).
30014	  if $remote; then :; else
30015	    dotest multiroot2-9a "${testcvs} -t update" \
30016" *-> main: Session ID is ${commitid}
30017 *-> main loop with CVSROOT=${TESTDIR}/root1
30018 *-> parse_config ($TESTDIR/root1)
30019 *-> do_update ((null), (null), (null), 1, 0, 0, 0, 0, 0, 3, (null), (null), (null), (null), (null), 1, (null))
30020 *-> Write_Template (\., ${TESTDIR}/root1)
30021${CPROG} update: Updating \.
30022 *-> Reader_Lock(${TESTDIR}/root1)
30023 *-> Simple_Lock_Cleanup()
30024 *-> Write_Template (dir1, ${TESTDIR}/root1/dir1)
30025${CPROG} update: Updating dir1
30026 *-> Reader_Lock(${TESTDIR}/root1/dir1)
30027 *-> Simple_Lock_Cleanup()
30028 *-> main loop with CVSROOT=${TESTDIR}/root2
30029 *-> parse_config ($TESTDIR/root2)
30030 *-> do_update ((null), (null), (null), 1, 0, 0, 0, 0, 0, 3, (null), (null), (null), (null), (null), 1, (null))
30031 *-> Write_Template (dir1/sdir, ${TESTDIR}/root2/dir1/sdir)
30032${CPROG} update: Updating dir1/sdir
30033 *-> Reader_Lock(${TESTDIR}/root2/sdir)
30034 *-> Simple_Lock_Cleanup()
30035 *-> Write_Template (dir1/sdir/ssdir, ${TESTDIR}/root2/sdir/ssdir)
30036${CPROG} update: Updating dir1/sdir/ssdir
30037 *-> Reader_Lock(${TESTDIR}/root2/sdir/ssdir)
30038 *-> Simple_Lock_Cleanup()
30039 *-> Lock_Cleanup()
30040 *-> Simple_Lock_Cleanup()"
30041	  fi
30042
30043	  dotest multiroot2-9 "${testcvs} -q tag tag1" \
30044"T dir1/file1
30045T dir1/sdir/sfile
30046T dir1/sdir/ssdir/ssfile"
30047	  echo "change it" >>dir1/file1
30048	  echo "change him too" >>dir1/sdir/sfile
30049	  dotest multiroot2-10 "${testcvs} -q ci -m modify" \
30050"$TESTDIR/root1/dir1/file1,v  <--  dir1/file1
30051new revision: 1\.2; previous revision: 1\.1
30052$TESTDIR/root2/sdir/sfile,v  <--  dir1/sdir/sfile
30053new revision: 1\.2; previous revision: 1\.1"
30054	  dotest multiroot2-11 "${testcvs} -q tag tag2" \
30055"T dir1/file1
30056T dir1/sdir/sfile
30057T dir1/sdir/ssdir/ssfile"
30058	  dotest_fail multiroot2-12 \
30059"${testcvs} -q diff -u -r tag1 -r tag2" \
30060"Index: dir1/file1
30061===================================================================
30062RCS file: ${TESTDIR}/root1/dir1/file1,v
30063retrieving revision 1\.1\.1\.1
30064retrieving revision 1\.2
30065diff -u -r1\.1\.1\.1 -r1\.2
30066--- dir1/file1	${RFCDATE}	1\.1\.1\.1
30067${PLUS}${PLUS}${PLUS} dir1/file1	${RFCDATE}	1\.2
30068@@ -1 ${PLUS}1,2 @@
30069 file1
30070${PLUS}change it
30071Index: dir1/sdir/sfile
30072===================================================================
30073RCS file: ${TESTDIR}/root2/sdir/sfile,v
30074retrieving revision 1\.1\.1\.1
30075retrieving revision 1\.2
30076diff -u -r1\.1\.1\.1 -r1\.2
30077--- dir1/sdir/sfile	${RFCDATE}	1\.1\.1\.1
30078${PLUS}${PLUS}${PLUS} dir1/sdir/sfile	${RFCDATE}	1\.2
30079@@ -1 ${PLUS}1,2 @@
30080 sfile
30081${PLUS}change him too"
30082
30083	  if $keep; then
30084	    echo Keeping ${TESTDIR} and exiting due to --keep
30085	    exit 0
30086	  fi
30087
30088	  # clean up after ourselves
30089	  cd ..
30090	  rm -r imp-dir 1
30091
30092	  # clean up our repositories
30093	  rm -rf root1 root2
30094	  ;;
30095
30096
30097
30098	multiroot3)
30099	  # More multiroot tests.  Directories are side-by-side, not nested.
30100	  # Not drastically different from multiroot but it covers somewhat
30101	  # different stuff.
30102
30103	  if $proxy; then
30104	    # don't even try
30105	    continue
30106	  fi
30107
30108	  CVSROOT1=`newroot ${TESTDIR}/root1`
30109	  CVSROOT2=`newroot ${TESTDIR}/root2`
30110
30111	  mkdir 1; cd 1
30112	  dotest multiroot3-1 "${testcvs} -d ${CVSROOT1} init" ""
30113	  dotest multiroot3-2 "${testcvs} -d ${CVSROOT1} -q co -l ." ""
30114	  mkdir dir1
30115	  dotest multiroot3-3 "${testcvs} add dir1" \
30116"Directory ${TESTDIR}/root1/dir1 added to the repository"
30117	  dotest multiroot3-4 "${testcvs} -d ${CVSROOT2} init" ""
30118	  rm -r CVS
30119	  dotest multiroot3-5 "${testcvs} -d ${CVSROOT2} -q co -l ." ""
30120	  mkdir dir2
30121
30122	  # OK, the problem is that CVS/Entries doesn't look quite right,
30123	  # I suppose because of the "rm -r".  Then again, why *should* it
30124	  # look right?  CVS/Root can only point to a single location, but
30125	  # we expect CVS/Entries to hold entries for two repositories?  It
30126	  # just plain isn't part of the filespec yet.
30127	  #
30128	  # Use the quick and dirty fix.
30129	  echo "D/dir1////" >CVS/Entries
30130	  echo "D/dir2////" >>CVS/Entries
30131
30132	  dotest multiroot3-7 "${testcvs} add dir2" \
30133"Directory ${TESTDIR}/root2/dir2 added to the repository"
30134
30135	  touch dir1/file1 dir2/file2
30136	  if $remote; then
30137	    # Trying to add them both in one command doesn't work,
30138	    # because add.c doesn't do multiroot (it doesn't use recurse.c).
30139	    # Furthermore, it can't deal with the parent directory
30140	    # having a different root from the child, hence the cd.
30141	    cd dir1
30142	    dotest multiroot3-8 "${testcvs} add file1" \
30143"${SPROG} add: scheduling file .file1. for addition
30144${SPROG} add: use .${SPROG} commit. to add this file permanently"
30145	    cd ..
30146	    dotest multiroot3-8a "${testcvs} add dir2/file2" \
30147"${SPROG} add: scheduling file .dir2/file2. for addition
30148${SPROG} add: use .${SPROG} commit. to add this file permanently"
30149	  else
30150	    dotest multiroot3-8 "${testcvs} add dir1/file1 dir2/file2" \
30151"${SPROG} add: scheduling file .dir1/file1. for addition
30152${SPROG} add: scheduling file .dir2/file2. for addition
30153${SPROG} add: use .${SPROG} commit. to add these files permanently"
30154	  fi
30155
30156	  dotest multiroot3-9 "${testcvs} -q ci -m add-them" \
30157"$TESTDIR/root2/dir2/file2,v  <--  dir2/file2
30158initial revision: 1\.1
30159$TESTDIR/root1/dir1/file1,v  <--  dir1/file1
30160initial revision: 1\.1"
30161
30162	  # That this is an error is good - we are asking CVS to do
30163	  # something which doesn't make sense.
30164	  dotest_fail multiroot3-10 \
30165"${testcvs} -q -d ${CVSROOT1} diff dir1/file1 dir2/file2" \
30166"${SPROG} diff: failed to create lock directory for .${TESTDIR}/root1/dir2' (${TESTDIR}/root1/dir2/#cvs.lock): No such file or directory
30167${SPROG} diff: failed to obtain dir lock in repository .${TESTDIR}/root1/dir2'
30168${SPROG} \[diff aborted\]: read lock failed - giving up"
30169
30170	  # This one is supposed to work.
30171	  dotest multiroot3-11 "${testcvs} -q diff dir1/file1 dir2/file2" ""
30172
30173	  # make sure we can't access across repositories
30174	  # FIXCVS: we probably shouldn't even create the local directories
30175	  # in this case, but we do, so deal with it.
30176	  mkdir 1a
30177	  cd 1a
30178	  dotest_fail multiroot3-12 \
30179"$testcvs -d $CVSROOT1 -q co ../root2/dir2" \
30180"$CPROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\." \
30181"$SPROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\.
30182$CPROG \[checkout aborted\]: end of file from server (consult above messages if any)"
30183	  dotest_fail multiroot3-13 \
30184"$testcvs -d $CVSROOT2 -q co ../root1/dir1" \
30185"$CPROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\.\./root1/dir1'\." \
30186"$SPROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\.\./root1/dir1'\.
30187$CPROG \[checkout aborted\]: end of file from server (consult above messages if any)"
30188	  dotest_fail multiroot3-14 \
30189"$testcvs -d $CVSROOT1 -q co ./../root2/dir2" \
30190"$CPROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root2/dir2'\." \
30191"$SPROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root2/dir2'\.
30192$CPROG \[checkout aborted\]: end of file from server (consult above messages if any)"
30193	  dotest_fail multiroot3-15 \
30194"$testcvs -d $CVSROOT2 -q co ./../root1/dir1" \
30195"$CPROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\." \
30196"$SPROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\.
30197$CPROG \[checkout aborted\]: end of file from server (consult above messages if any)"
30198	  dotest_fail multiroot3-16 \
30199"$testcvs -d $CVSROOT1 -q co -p ../root2/dir2" \
30200"$CPROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\." \
30201"$SPROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\.\./root2/dir2'\.
30202$CPROG \[checkout aborted\]: end of file from server (consult above messages if any)"
30203	  dotest_fail multiroot3-17 \
30204"$testcvs -d $CVSROOT1 -q co -p ./../root1/dir1" \
30205"$CPROG \[checkout aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\." \
30206"$SPROG \[server aborted\]: up-level in module reference (\`..') invalid: \`\./\.\./root1/dir1'\.
30207$CPROG \[checkout aborted\]: end of file from server (consult above messages if any)"
30208
30209	  cd ../..
30210
30211	  if $keep; then
30212	    echo Keeping ${TESTDIR} and exiting due to --keep
30213	    exit 0
30214	  fi
30215
30216	  rm -r 1
30217	  rm -rf ${TESTDIR}/root1 ${TESTDIR}/root2
30218	  unset CVSROOT1
30219	  unset CVSROOT2
30220	  ;;
30221
30222
30223
30224	multiroot4)
30225	  # More multiroot tests, in particular we have two roots with
30226	  # similarly-named directories and we try to see that CVS can
30227	  # keep them separate.
30228
30229	  if $proxy; then
30230	    # don't even try
30231	    continue
30232	  fi
30233
30234	  CVSROOT1=`newroot ${TESTDIR}/root1`
30235	  CVSROOT2=`newroot ${TESTDIR}/root2`
30236
30237	  mkdir 1; cd 1
30238	  dotest multiroot4-1 "${testcvs} -d ${CVSROOT1} init" ""
30239	  dotest multiroot4-2 "${testcvs} -d ${CVSROOT1} -q co -l ." ""
30240	  mkdir dircom
30241	  dotest multiroot4-3 "${testcvs} add dircom" \
30242"Directory ${TESTDIR}/root1/dircom added to the repository"
30243	  cd dircom
30244	  touch file1
30245	  dotest multiroot4-4 "${testcvs} add file1" \
30246"${SPROG} add: scheduling file .file1. for addition
30247${SPROG} add: use .${SPROG} commit. to add this file permanently"
30248	  dotest multiroot4-5 "${testcvs} -q ci -m add" \
30249"$TESTDIR/root1/dircom/file1,v  <--  file1
30250initial revision: 1\.1"
30251	  cd ../..
30252	  mkdir 2; cd 2
30253	  dotest multiroot4-6 "${testcvs} -d ${CVSROOT2} init" ""
30254	  dotest multiroot4-7 "${testcvs} -d ${CVSROOT2} -q co -l ." ""
30255	  mkdir dircom
30256	  dotest multiroot4-8 "${testcvs} add dircom" \
30257"Directory ${TESTDIR}/root2/dircom added to the repository"
30258	  cd dircom
30259	  touch file2
30260	  dotest multiroot4-9 "${testcvs} add file2" \
30261"${SPROG} add: scheduling file .file2. for addition
30262${SPROG} add: use .${SPROG} commit. to add this file permanently"
30263	  dotest multiroot4-10 "${testcvs} -q ci -m add" \
30264"$TESTDIR/root2/dircom/file2,v  <--  file2
30265initial revision: 1\.1"
30266
30267	  cd ../..
30268	  cd 1/dircom
30269	  # This may look contrived; the real world example which inspired
30270	  # it was that a user was changing from local to remote.  Cases
30271	  # like switching servers (among those mounting the same
30272	  # repository) and so on would also look the same.
30273	  mkdir sdir2
30274	  dotest multiroot4-11 "${testcvs} -d ${CVSROOT2} add sdir2" \
30275"Directory ${TESTDIR}/root2/dircom/sdir2 added to the repository"
30276
30277	  dotest multiroot4-12 "${testcvs} -q update" ""
30278	  cd ..
30279	  dotest multiroot4-13 "${testcvs} -q update dircom" ""
30280	  cd ..
30281
30282	  rm -r 1 2
30283	  rm -rf ${TESTDIR}/root1 ${TESTDIR}/root2
30284	  unset CVSROOT1
30285	  unset CVSROOT2
30286	  ;;
30287
30288
30289
30290	rmroot)
30291	  # When the Entries/Root file is removed from an existing
30292	  # workspace, CVS should assume $CVSROOT instead
30293	  #
30294	  # Right now only checking that CVS exits normally on an
30295	  # update once CVS/Root is deleted
30296	  #
30297	  # There was a time when this would core dump when run in
30298	  # client/server mode
30299
30300	  mkdir 1; cd 1
30301	  dotest rmroot-setup-1 "${testcvs} -q co -l ." ''
30302	  mkdir first-dir
30303	  dotest rmroot-setup-2 "${testcvs} add first-dir" \
30304"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
30305          cd first-dir
30306	  touch file1 file2
30307	  dotest rmroot-setup-3 "${testcvs} add file1 file2" \
30308"${SPROG} add: scheduling file .file1. for addition
30309${SPROG} add: scheduling file .file2. for addition
30310${SPROG} add: use .${SPROG} commit. to add these files permanently"
30311	  dotest rmroot-setup-4 "${testcvs} -q commit -minit" \
30312"$CVSROOT_DIRNAME/first-dir/file1,v  <--  file1
30313initial revision: 1\.1
30314$CVSROOT_DIRNAME/first-dir/file2,v  <--  file2
30315initial revision: 1\.1"
30316	  rm CVS/Root
30317	  dotest rmroot-1 "${testcvs} -q update" ''
30318
30319	  dokeep
30320	  cd ../..
30321	  rm -rf 1
30322	  modify_repo rm -rf $CVSROOT_DIRNAME/first-dir
30323	  ;;
30324
30325
30326
30327	reposmv)
30328	  # More tests of repositories and specifying them.
30329	  # Similar to crerepos but that test is probably getting big
30330	  # enough.
30331
30332	  if $proxy; then
30333	    # don't even try
30334	    continue
30335	  fi
30336
30337	  CVSROOT1=`newroot ${TESTDIR}/root1`
30338	  CVSROOT_MOVED=`newroot ${TESTDIR}/root-moved`
30339
30340	  dotest reposmv-setup-1 "${testcvs} -d ${CVSROOT1} init" ""
30341	  mkdir imp-dir; cd imp-dir
30342	  echo file1 >file1
30343	  dotest reposmv-setup-2 \
30344"${testcvs} -d ${CVSROOT1} import -m add dir1 vendor release" \
30345"N dir1/file1
30346
30347No conflicts created by this import"
30348	  cd ..
30349
30350	  mkdir 1; cd 1
30351	  dotest reposmv-1 "${testcvs} -d ${CVSROOT1} -Q co dir1" ""
30352	  mv ${TESTDIR}/root1 ${TESTDIR}/root-moved
30353	  cd dir1
30354
30355	  # If we didn't have a relative repository, get one now.
30356	  dotest reposmv-1a "cat CVS/Repository" \
30357"${TESTDIR}/root1/dir1" "dir1"
30358	  echo dir1 >CVS/Repository
30359
30360	  # There were some duplicated warnings and such; only test
30361	  # for the part of the error message which makes sense.
30362	  #
30363	  # FIXCVS then FIXME
30364	  # Now the duplicated error messages only occur on some platforms,
30365	  # including, apparently, NetBSD 1.6.1, RedHat Linux 7.3, whatever
30366	  # kernel that is using, and Solaris 9.  These platforms somehow
30367	  # decide to call Name_Root() up to four times, via do_recursion, but
30368	  # I'm not sure of the rest of the details.  Other platforms,
30369	  # including Fedora Core 1 (Linux 2.4.22-1.2199.nptl), RH Linux 9
30370	  # (Linux 2.4.20-37.9.legacy), and probably AIX 3.4, Solaris 8,
30371	  # BSD/OS 4.2, & IRIX 6.5 only call Name_Root() once as a result of
30372	  # this test.
30373	  #
30374	  # Bug: "skipping directory " without filename.
30375	  if $remote; then
30376	    dotest_fail reposmv-2r "${testcvs} update" \
30377"Cannot access ${TESTDIR}/root1/CVSROOT
30378No such file or directory"
30379	  else
30380	    dotest reposmv-2 "$testcvs update" \
30381"$DOTSTAR$CPROG update: in directory \.:
30382$CPROG update: ignoring CVS/Root because it specifies a non-existent repository $TESTDIR/root1
30383$CPROG update: Updating \.
30384$DOTSTAR$CPROG update: cannot open directory $CVSROOT_DIRNAME/dir1: No such file or directory
30385$CPROG update: skipping directory "
30386	  fi
30387
30388	  # CVS/Root overrides $CVSROOT
30389	  if $remote; then
30390	    CVSROOT_save=${CVSROOT}
30391	    CVSROOT=:fork:${TESTDIR}/root-moved; export CVSROOT
30392	    dotest_fail reposmv-3r "${testcvs} update" \
30393"Cannot access ${TESTDIR}/root1/CVSROOT
30394No such file or directory"
30395	    CVSROOT=${CVSROOT_save}; export CVSROOT
30396	  else
30397	    CVSROOT_save=$CVSROOT
30398	    CVSROOT=$TESTDIR/root-moved; export CVSROOT
30399	    dotest reposmv-3 "$testcvs update" \
30400"$DOTSTAR$CPROG update: in directory \.:
30401$CPROG update: ignoring CVS/Root because it specifies a non-existent repository $TESTDIR/root1
30402$CPROG update: Updating \.$DOTSTAR"
30403	    CVSROOT=$CVSROOT_save; export CVSROOT
30404	  fi
30405
30406	  if $remote; then
30407	    CVSROOT_save=${CVSROOT}
30408	    CVSROOT=:fork:${TESTDIR}/root-none; export CVSROOT
30409	    dotest_fail reposmv-4r "${testcvs} update" \
30410"Cannot access ${TESTDIR}/root1/CVSROOT
30411No such file or directory"
30412	    CVSROOT=${CVSROOT_save}; export CVSROOT
30413	  else
30414	    # CVS/Root doesn't seem to quite completely override $CVSROOT
30415	    # Bug?  Not necessarily a big deal if it only affects error
30416	    # messages.
30417	    CVSROOT_save=${CVSROOT}
30418	    CVSROOT=${TESTDIR}/root-none; export CVSROOT
30419	    dotest_fail reposmv-4 "${testcvs} update" \
30420"${CPROG} update: in directory \.:
30421${CPROG} update: ignoring CVS/Root because it specifies a non-existent repository ${TESTDIR}/root1
30422${CPROG} \[update aborted\]: ${TESTDIR}/root-none/CVSROOT: No such file or directory"
30423	    CVSROOT=${CVSROOT_save}; export CVSROOT
30424	  fi
30425
30426	  # -d overrides CVS/Root
30427	  #
30428	  # Oddly enough, with CVS 1.10 I think this didn't work for
30429	  # local (that is, it would appear that CVS/Root would not
30430	  # get used, but would produce an error if it didn't exist).
30431	  dotest reposmv-5 "${testcvs} -d ${CVSROOT_MOVED} update" \
30432"${SPROG} update: Updating \."
30433
30434	  # TODO: could also test various other things, like what if the
30435	  # user removes CVS/Root (which is legit).  Or another set of
30436	  # tests would be if both repositories exist but we want to make
30437	  # sure that CVS is using the correct one.
30438
30439	  cd ../..
30440	  rm -r imp-dir 1
30441	  rm -rf root1 root2
30442	  unset CVSROOT1
30443	  ;;
30444
30445
30446
30447	pserver)
30448	  # Test basic pserver functionality.
30449	  if $remote; then
30450	    if test -n "$remotehost"; then
30451	      # Don't even try.  (The issue is getting servercvs & testcvs
30452	      # set correctly for the following tests.  Some expect one access
30453	      # method and some another, which in $remotehost mode, means that
30454	      # sometimes the executables must run on one platform and
30455	      # sometimes another.)
30456	      continue
30457	    fi
30458	    save_servercvs=$servercvs
30459	    servercvs=$testcvs
30460   	    # First set SystemAuth=no.  Not really necessary, I don't
30461	    # think, but somehow it seems like the clean thing for
30462	    # the testsuite.
30463	    mkdir 1; cd 1
30464	    dotest pserver-1 "$testcvs -Q co CVSROOT" ""
30465	    cd CVSROOT
30466	    echo "SystemAuth=no" >>config
30467	    dotest pserver-2 "$testcvs -q ci -m config-it" \
30468"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
30469new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
30470$SPROG commit: Rebuilding administrative file database"
30471	    cat >$CVSROOT_DIRNAME/CVSROOT/passwd <<EOF
30472testme:q6WV9d2t848B2:$username
30473dontroot:q6WV9d2t848B2:root
30474anonymous::$username
30475$username:
30476willfail:   :whocares
30477EOF
30478	    dotest_fail pserver-3 "$servercvs pserver" \
30479"error 0 Server configuration missing --allow-root in inetd.conf" <<EOF
30480BEGIN AUTH REQUEST
30481$CVSROOT_DIRNAME
30482testme
30483Ay::'d
30484END AUTH REQUEST
30485EOF
30486
30487	    # Confirm that not sending a newline during auth cannot constitute
30488	    # a denial-of-service attack.  This assumes that PATH_MAX is less
30489	    # than 65536 bytes.  If PATH_MAX is larger than 65535 bytes, this
30490	    # test could hang indefinitely.
30491	    ${AWK} 'BEGIN { printf "0123456789abcdef" }' </dev/null >garbageseg
30492	    echo "BEGIN AUTH REQUEST" >garbageinput
30493	    i=0
30494	    while test $i -lt 64; do
30495	      cat <garbageseg >>garbageseg2
30496	      i=`expr $i + 1`
30497	    done
30498	    i=0
30499	    while test $i -lt 64; do
30500	      cat <garbageseg2 >>garbageinput
30501	      i=`expr $i + 1`
30502	    done
30503	    dotest_fail pserver-auth-no-dos \
30504"${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30505"$CPROG \\[pserver aborted\\]: error reading from net while validating pserver: Not enough space" \
30506"$CPROG \\[pserver aborted\\]: error reading from net while validating pserver: Cannot allocate memory" <garbageinput
30507	    unset i
30508	    rm garbageseg garbageseg2 garbageinput
30509
30510	    # Sending the Root and noop before waiting for the
30511	    # "I LOVE YOU" is bogus, but hopefully we can get
30512	    # away with it.
30513	    dotest pserver-4 "$servercvs --allow-root=$CVSROOT_DIRNAME pserver" \
30514"$DOTSTAR LOVE YOU
30515ok" <<EOF
30516BEGIN AUTH REQUEST
30517$CVSROOT_DIRNAME
30518testme
30519Ay::'d
30520END AUTH REQUEST
30521Root $CVSROOT_DIRNAME
30522noop
30523EOF
30524
30525	    dotest_fail pserver-4.2 \
30526"$servercvs --allow-root=$CVSROOT_DIRNAME pserver" \
30527"error 0: root not allowed" <<EOF
30528BEGIN AUTH REQUEST
30529$CVSROOT_DIRNAME
30530dontroot
30531Ay::'d
30532END AUTH REQUEST
30533EOF
30534
30535	    dotest pserver-5 "$servercvs --allow-root=$CVSROOT_DIRNAME pserver" \
30536"$DOTSTAR LOVE YOU
30537E Protocol error: Root says \"$TESTDIR/1\" but pserver says \"$CVSROOT_DIRNAME\"
30538error  " <<EOF
30539BEGIN AUTH REQUEST
30540$CVSROOT_DIRNAME
30541testme
30542Ay::'d
30543END AUTH REQUEST
30544Root $TESTDIR/1
30545noop
30546EOF
30547
30548	    dotest pserver-5a "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30549"${DOTSTAR} LOVE YOU
30550E Protocol error: init says \"${TESTDIR}/2\" but pserver says \"${CVSROOT_DIRNAME}\"
30551error  " <<EOF
30552BEGIN AUTH REQUEST
30553${CVSROOT_DIRNAME}
30554testme
30555Ay::'d
30556END AUTH REQUEST
30557init ${TESTDIR}/2
30558EOF
30559	    dotest_fail pserver-5b "test -d ${TESTDIR}/2" ''
30560
30561	    dotest pserver-5c "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30562"${DOTSTAR} LOVE YOU
30563E init xxx must be an absolute pathname
30564error  " <<EOF
30565BEGIN AUTH REQUEST
30566${CVSROOT_DIRNAME}
30567testme
30568Ay::'d
30569END AUTH REQUEST
30570init xxx
30571EOF
30572	    dotest_fail pserver-5d "test -d xxx" ''
30573
30574	    dotest_fail pserver-6 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30575"I HATE YOU" <<EOF
30576BEGIN AUTH REQUEST
30577${CVSROOT_DIRNAME}
30578testme
30579Ay::'d^b?hd
30580END AUTH REQUEST
30581EOF
30582
30583	    dotest_fail pserver-7 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30584"I HATE YOU" <<EOF
30585BEGIN VERIFICATION REQUEST
30586${CVSROOT_DIRNAME}
30587testme
30588Ay::'d^b?hd
30589END VERIFICATION REQUEST
30590EOF
30591
30592	    dotest pserver-8 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30593"${DOTSTAR} LOVE YOU" <<EOF
30594BEGIN VERIFICATION REQUEST
30595${CVSROOT_DIRNAME}
30596testme
30597Ay::'d
30598END VERIFICATION REQUEST
30599EOF
30600
30601# Tests pserver-9 through pserver-13 are about empty passwords
30602
30603            # Test empty password (both sides) for aliased user
30604	    dotest pserver-9 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30605"${DOTSTAR} LOVE YOU" <<EOF
30606BEGIN AUTH REQUEST
30607${CVSROOT_DIRNAME}
30608anonymous
30609A
30610END AUTH REQUEST
30611EOF
30612
30613            # Test empty password (server side only) for aliased user
30614	    dotest pserver-10 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30615"${DOTSTAR} LOVE YOU" <<EOF
30616BEGIN AUTH REQUEST
30617${CVSROOT_DIRNAME}
30618anonymous
30619Aanythingwouldworkhereittrulydoesnotmatter
30620END AUTH REQUEST
30621EOF
30622
30623            # Test empty (both sides) password for non-aliased user
30624	    dotest pserver-11 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30625"${DOTSTAR} LOVE YOU" <<EOF
30626BEGIN AUTH REQUEST
30627${CVSROOT_DIRNAME}
30628${username}
30629A
30630END AUTH REQUEST
30631EOF
30632
30633            # Test empty (server side only) password for non-aliased user
30634	    dotest pserver-12 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30635"${DOTSTAR} LOVE YOU" <<EOF
30636BEGIN AUTH REQUEST
30637${CVSROOT_DIRNAME}
30638${username}
30639Anypasswordwouldworkwhynotthisonethen
30640END AUTH REQUEST
30641EOF
30642
30643            # Test failure of whitespace password
30644	    dotest_fail pserver-13 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30645"${DOTSTAR} HATE YOU" <<EOF
30646BEGIN AUTH REQUEST
30647${CVSROOT_DIRNAME}
30648willfail
30649Amquiteunabletocomeupwithinterestingpasswordsanymore
30650END AUTH REQUEST
30651EOF
30652
30653	    # The following tests are for read-only access
30654
30655	    # Check that readers can only read, everyone else can write
30656
30657	    echo anonymous >$CVSROOT_DIRNAME/CVSROOT/readers
30658
30659	    dotest pserver-14 "$servercvs --allow-root=$CVSROOT_DIRNAME pserver" \
30660"$DOTSTAR LOVE YOU
30661M Concurrent Versions System (CVS) .*
30662ok" <<EOF
30663BEGIN AUTH REQUEST
30664$CVSROOT_DIRNAME
30665anonymous
30666Ay::'d
30667END AUTH REQUEST
30668Root $CVSROOT_DIRNAME
30669version
30670EOF
30671
30672	    dotest pserver-15 "$servercvs --allow-root=$CVSROOT_DIRNAME pserver" \
30673"$DOTSTAR LOVE YOU
30674E $CPROG \\[server aborted\\]: .init. requires write access to the repository
30675error  " <<EOF
30676BEGIN AUTH REQUEST
30677$CVSROOT_DIRNAME
30678anonymous
30679Ay::'d
30680END AUTH REQUEST
30681init $CVSROOT_DIRNAME
30682EOF
30683
30684	    dotest pserver-16 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30685"${DOTSTAR} LOVE YOU
30686M Concurrent Versions System (CVS) .*
30687ok" <<EOF
30688BEGIN AUTH REQUEST
30689${CVSROOT_DIRNAME}
30690testme
30691Ay::'d
30692END AUTH REQUEST
30693Root ${CVSROOT_DIRNAME}
30694version
30695EOF
30696
30697	    dotest pserver-17 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30698"${DOTSTAR} LOVE YOU
30699ok" <<EOF
30700BEGIN AUTH REQUEST
30701${CVSROOT_DIRNAME}
30702testme
30703Ay::'d
30704END AUTH REQUEST
30705init ${CVSROOT_DIRNAME}
30706EOF
30707
30708	    dotest pserver-18 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30709"${DOTSTAR} LOVE YOU
30710M Concurrent Versions System (CVS) .*
30711ok" <<EOF
30712BEGIN AUTH REQUEST
30713${CVSROOT_DIRNAME}
30714${username}
30715Ay::'d
30716END AUTH REQUEST
30717Root ${CVSROOT_DIRNAME}
30718version
30719EOF
30720
30721	    dotest pserver-19 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30722"${DOTSTAR} LOVE YOU
30723ok" <<EOF
30724BEGIN AUTH REQUEST
30725${CVSROOT_DIRNAME}
30726${username}
30727Anything
30728END AUTH REQUEST
30729init ${CVSROOT_DIRNAME}
30730EOF
30731
30732	    # Check that writers can write, everyone else can only read
30733	    # even if not listed in readers
30734
30735	    cat >${CVSROOT_DIRNAME}/CVSROOT/writers <<EOF
30736testme
30737EOF
30738
30739	    dotest pserver-20 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30740"${DOTSTAR} LOVE YOU
30741M Concurrent Versions System (CVS) .*
30742ok" <<EOF
30743BEGIN AUTH REQUEST
30744${CVSROOT_DIRNAME}
30745anonymous
30746Ay::'d
30747END AUTH REQUEST
30748Root ${CVSROOT_DIRNAME}
30749version
30750EOF
30751
30752	    dotest pserver-21 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30753"${DOTSTAR} LOVE YOU
30754E $CPROG \\[server aborted\\]: .init. requires write access to the repository
30755error  " <<EOF
30756BEGIN AUTH REQUEST
30757${CVSROOT_DIRNAME}
30758anonymous
30759Ay::'d
30760END AUTH REQUEST
30761init ${CVSROOT_DIRNAME}
30762EOF
30763
30764	    dotest pserver-22 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30765"${DOTSTAR} LOVE YOU
30766M Concurrent Versions System (CVS) .*
30767ok" <<EOF
30768BEGIN AUTH REQUEST
30769${CVSROOT_DIRNAME}
30770testme
30771Ay::'d
30772END AUTH REQUEST
30773Root ${CVSROOT_DIRNAME}
30774version
30775EOF
30776
30777	    dotest pserver-23 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30778"${DOTSTAR} LOVE YOU
30779ok" <<EOF
30780BEGIN AUTH REQUEST
30781${CVSROOT_DIRNAME}
30782testme
30783Ay::'d
30784END AUTH REQUEST
30785init ${CVSROOT_DIRNAME}
30786EOF
30787
30788	    dotest pserver-24 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30789"${DOTSTAR} LOVE YOU
30790M Concurrent Versions System (CVS) .*
30791ok" <<EOF
30792BEGIN AUTH REQUEST
30793${CVSROOT_DIRNAME}
30794${username}
30795Ay::'d
30796END AUTH REQUEST
30797Root ${CVSROOT_DIRNAME}
30798version
30799EOF
30800
30801	    dotest pserver-25 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30802"${DOTSTAR} LOVE YOU
30803E $CPROG \\[server aborted\\]: .init. requires write access to the repository
30804error  " <<EOF
30805BEGIN AUTH REQUEST
30806${CVSROOT_DIRNAME}
30807${username}
30808Anything
30809END AUTH REQUEST
30810init ${CVSROOT_DIRNAME}
30811EOF
30812
30813	    # Should work the same without readers
30814
30815	    rm ${CVSROOT_DIRNAME}/CVSROOT/readers
30816
30817	    dotest pserver-26 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30818"${DOTSTAR} LOVE YOU
30819M Concurrent Versions System (CVS) .*
30820ok" <<EOF
30821BEGIN AUTH REQUEST
30822${CVSROOT_DIRNAME}
30823anonymous
30824Ay::'d
30825END AUTH REQUEST
30826Root ${CVSROOT_DIRNAME}
30827version
30828EOF
30829
30830	    dotest pserver-27 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30831"${DOTSTAR} LOVE YOU
30832E $CPROG \\[server aborted\\]: .init. requires write access to the repository
30833error  " <<EOF
30834BEGIN AUTH REQUEST
30835${CVSROOT_DIRNAME}
30836anonymous
30837Ay::'d
30838END AUTH REQUEST
30839init ${CVSROOT_DIRNAME}
30840EOF
30841
30842	    dotest pserver-28 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30843"${DOTSTAR} LOVE YOU
30844M Concurrent Versions System (CVS) .*
30845ok" <<EOF
30846BEGIN AUTH REQUEST
30847${CVSROOT_DIRNAME}
30848testme
30849Ay::'d
30850END AUTH REQUEST
30851Root ${CVSROOT_DIRNAME}
30852version
30853EOF
30854
30855	    dotest pserver-29 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30856"${DOTSTAR} LOVE YOU
30857ok" <<EOF
30858BEGIN AUTH REQUEST
30859${CVSROOT_DIRNAME}
30860testme
30861Ay::'d
30862END AUTH REQUEST
30863init ${CVSROOT_DIRNAME}
30864EOF
30865
30866	    dotest pserver-30 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30867"${DOTSTAR} LOVE YOU
30868M Concurrent Versions System (CVS) .*
30869ok" <<EOF
30870BEGIN AUTH REQUEST
30871${CVSROOT_DIRNAME}
30872${username}
30873Ay::'d
30874END AUTH REQUEST
30875Root ${CVSROOT_DIRNAME}
30876version
30877EOF
30878
30879	    dotest pserver-31 "${servercvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
30880"${DOTSTAR} LOVE YOU
30881E $CPROG \\[server aborted\\]: .init. requires write access to the repository
30882error  " <<EOF
30883BEGIN AUTH REQUEST
30884${CVSROOT_DIRNAME}
30885${username}
30886Anything
30887END AUTH REQUEST
30888init ${CVSROOT_DIRNAME}
30889EOF
30890
30891	    # pserver used to try and print from the NULL pointer
30892	    # in this error message in this case
30893	    dotest_fail pserver-bufinit "${servercvs} pserver" \
30894"$CPROG \[pserver aborted\]: unexpected EOF encountered during authentication" </dev/null
30895
30896	    # Clean up.
30897	    dotest pserver-cleanup-1 "${testcvs} -q up -pr1.1 config >config" ""
30898	    dotest pserver-cleanup-2 "${testcvs} -q ci -m config-it" \
30899"$CVSROOT_DIRNAME/CVSROOT/config,v  <--  config
30900new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
30901$SPROG commit: Rebuilding administrative file database"
30902
30903	    dokeep
30904	    cd ../..
30905	    rm -r 1
30906	    restore_adm
30907	    servercvs=$save_servercvs
30908	  fi # skip the whole thing for local
30909	  ;;
30910
30911
30912
30913	server)
30914	  # Some tests of the server (independent of the client).
30915	  if $remote; then
30916	    save_servercvs=$servercvs
30917	    servercvs=$testcvs
30918	    dotest server-1 "${servercvs} server" \
30919"E Protocol error: Root request missing
30920error  " <<EOF
30921Directory bogus
30922mumble/bar
30923update
30924EOF
30925
30926	    # Could also test for relative pathnames here (so that crerepos-6a
30927	    # and crerepos-6b can use :fork:).
30928	    dotest server-2 "${servercvs} server" "ok" <<EOF
30929Set OTHER=variable
30930Set MYENV=env-value
30931init ${TESTDIR}/crerepos
30932EOF
30933	    dotest server-3 "test -d ${TESTDIR}/crerepos/CVSROOT" ""
30934
30935	    # Now some tests of gzip-file-contents (used by jCVS).
30936	    ${AWK} 'BEGIN { \
30937printf "%c%c%c%c%c%c.6%c%c+I-.%c%c%c%c5%c;%c%c%c%c", \
3093831, 139, 8, 64, 5, 7, 64, 3, 225, 2, 64, 198, 185, 5, 64, 64, 64}' \
30939	      </dev/null | ${TR} '\100' '\000' >gzipped.dat
30940	    # Note that the CVS client sends "-b 1.1.1", and this
30941	    # test doesn't.  But the server also defaults to that.
30942	    cat <<EOF >session.dat
30943Root ${TESTDIR}/crerepos
30944UseUnchanged
30945gzip-file-contents 3
30946Argument -m
30947Argument msg
30948Argumentx 
30949Argument dir1
30950Argument tag1
30951Argument tag2
30952Directory .
30953${TESTDIR}/crerepos
30954Modified file1
30955u=rw,g=r,o=r
30956z25
30957EOF
30958	    cat gzipped.dat >>session.dat
30959	    echo import >>session.dat
30960	    dotest server-4 "${servercvs} server" \
30961"M N dir1/file1
30962M
30963M No conflicts created by this import
30964M
30965ok" <session.dat
30966	    dotest server-5 \
30967"${testcvs} -q -d ${TESTDIR}/crerepos co -p dir1/file1" "test"
30968
30969	    # OK, here are some notify tests.
30970	    dotest server-6 "${servercvs} server" \
30971"Notified \./
30972${TESTDIR}/crerepos/dir1/file1
30973ok" <<EOF
30974Root ${TESTDIR}/crerepos
30975Directory .
30976${TESTDIR}/crerepos/dir1
30977Notify file1
30978E	Fri May  7 13:21:09 1999 -0000	myhost	some-work-dir	EUC
30979noop
30980EOF
30981	    # Sending the second "noop" before waiting for the output
30982	    # from the first is bogus but hopefully we can get away
30983	    # with it.
30984	    dotest server-7 "${servercvs} server" \
30985"M file1	$username	Fri May  7 13:21:09 1999 -0000	myhost	some-work-dir
30986Notified \./
30987${TESTDIR}/crerepos/dir1/file1
30988ok
30989M file1	$username	Fri May  7 13:21:09 1999 -0000	myhost	some-work-dir
30990Notified \./
30991${TESTDIR}/crerepos/dir1/file1
30992ok" <<EOF
30993Root ${TESTDIR}/crerepos
30994Directory .
30995${TESTDIR}/crerepos/dir1
30996Notify file1
30997E	Fri May  7 13:21:09 1999 -0000	myhost	some-work-dir	EUC
30998noop
30999Notify file1
31000E	The 57th day of Discord in the YOLD 3165	myhost	some-work-dir	EUC
31001noop
31002EOF
31003
31004	    # OK, now test a few error conditions.
31005	    # FIXCVS: should give "error" and no "Notified", like server-9
31006	    dotest server-8 "${servercvs} server" \
31007"M file1	$username	The 57th day of Discord in the YOLD 3165	myhost	some-work-dir
31008E $CPROG server: invalid character in editor value
31009Notified \./
31010${TESTDIR}/crerepos/dir1/file1
31011ok" <<EOF
31012Root ${TESTDIR}/crerepos
31013Directory .
31014${TESTDIR}/crerepos/dir1
31015Notify file1
31016E	Setting Orange, the 52th day of Discord in the YOLD 3165	myhost	some-work-dir	EUC
31017noop
31018EOF
31019
31020	    dotest server-9 "${servercvs} server" \
31021"E Protocol error; misformed Notify request
31022error  " <<EOF
31023Root ${TESTDIR}/crerepos
31024Directory .
31025${TESTDIR}/crerepos/dir1
31026Notify file1
31027E	Setting Orange+57th day of Discord	myhost	some-work-dir	EUC
31028noop
31029EOF
31030
31031	    # First demonstrate an interesting quirk in the protocol.
31032	    # The "watchers" request selects the files to operate based
31033	    # on files which exist in the working directory.  So if we
31034	    # don't send "Entry" or the like, it won't do anything.
31035	    # Wants to be documented in cvsclient.texi...
31036	    dotest server-10 "${servercvs} server" "ok" <<EOF
31037Root ${TESTDIR}/crerepos
31038Directory .
31039${TESTDIR}/crerepos/dir1
31040watchers
31041EOF
31042	    # See if "watchers" and "editors" display the right thing.
31043	    dotest server-11 "${servercvs} server" \
31044"M file1	${username}	tedit	tunedit	tcommit
31045ok" <<EOF
31046Root ${TESTDIR}/crerepos
31047Directory .
31048${TESTDIR}/crerepos/dir1
31049Entry /file1/1.1////
31050watchers
31051EOF
31052	    dotest server-12 "${servercvs} server" \
31053"M file1	${username}	The 57th day of Discord in the YOLD 3165	myhost	some-work-dir
31054ok" <<EOF
31055Root ${TESTDIR}/crerepos
31056Directory .
31057${TESTDIR}/crerepos/dir1
31058Entry /file1/1.1////
31059editors
31060EOF
31061
31062	    # Now do an unedit.
31063	    dotest server-13 "${servercvs} server" \
31064"Notified \./
31065${TESTDIR}/crerepos/dir1/file1
31066ok" <<EOF
31067Root ${TESTDIR}/crerepos
31068Directory .
31069${TESTDIR}/crerepos/dir1
31070Notify file1
31071U	7 May 1999 15:00 -0000	myhost	some-work-dir	EUC
31072noop
31073EOF
31074
31075	    # Now try "watchers" and "editors" again.
31076	    dotest server-14 "${servercvs} server" "ok" <<EOF
31077Root ${TESTDIR}/crerepos
31078Directory .
31079${TESTDIR}/crerepos/dir1
31080watchers
31081EOF
31082	    dotest server-15 "${servercvs} server" "ok" <<EOF
31083Root ${TESTDIR}/crerepos
31084Directory .
31085${TESTDIR}/crerepos/dir1
31086editors
31087EOF
31088
31089	    # Test that the global `-l' option is ignored nonfatally.
31090	    dotest server-16 "${testcvs} server" \
31091"E $CPROG server: WARNING: global \`-l' option ignored\.
31092ok" <<EOF
31093Global_option -l
31094noop
31095EOF
31096
31097	    # There used to be some exploits based on malformed Entry requests
31098	    dotest server-17 "$testcvs server" \
31099"E protocol error: Malformed Entry
31100error  " <<EOF
31101Root $TESTDIR/crerepos
31102Directory .
31103$TESTDIR/crerepos/dir1
31104Entry X/file1/1.1////
31105noop
31106EOF
31107
31108	    dotest server-18 "$testcvs server" \
31109"E protocol error: Malformed Entry
31110error  " <<EOF
31111Root $TESTDIR/crerepos
31112Directory .
31113$TESTDIR/crerepos/dir1
31114Entry /CC/CC/CC
31115noop
31116EOF
31117
31118	    # Check that the config file may be set from the command line.
31119	    # But first verify the default config produces no error messages.
31120	    dotest server-19 "$testcvs server" \
31121"ok" <<EOF
31122Root $TESTDIR/crerepos
31123Directory .
31124$TESTDIR/crerepos
31125noop
31126EOF
31127	    echo THIS-CONFIG-OPTION-IS-BAD=XXX >$TESTDIR/newconfig
31128	    dotest_fail server-20 "$testcvs server -c $TESTDIR/newconfig" \
31129"E $SPROG \[server aborted\]: Invalid path to config file specified: \`$TESTDIR/newconfig'" <<EOF
31130Root $TESTDIR/crerepos
31131Directory .
31132$TESTDIR/crerepos
31133noop
31134EOF
31135	    dotest_fail server-21 \
31136"$testcvs server -c /etc/cvs/this-shouldnt-exist" \
31137"E $SPROG \[server aborted\]: Failed to resolve path: \`/etc/cvs/this-shouldnt-exist': No such file or directory" <<EOF
31138Root $TESTDIR/crerepos
31139Directory .
31140$TESTDIR/crerepos
31141noop
31142EOF
31143
31144	    # Now make sure that the config file can't be set via the user's
31145	    # .cvsrc.
31146	    echo server -c $TESTDIR/newconfig >$HOME/.cvsrc
31147	    dotest server-22 "$testcvs server" \
31148"ok" <<EOF
31149Root $TESTDIR/crerepos
31150Directory .
31151$TESTDIR/crerepos
31152noop
31153EOF
31154
31155	    dokeep
31156	    rm -rf $TESTDIR/crerepos
31157	    rm gzipped.dat session.dat
31158	    rm $TESTDIR/newconfig $HOME/.cvsrc
31159	    servercvs=$save_servercvs
31160	  fi # skip the whole thing for local
31161	  ;;
31162
31163
31164
31165	server2)
31166	  # More server tests, in particular testing that various
31167	  # possible security holes are plugged.
31168	  if $remote; then
31169	    if test -n "$remotehost"; then
31170	      # Don't even try.  (The issue is getting servercvs & testcvs
31171	      # set correctly for the following tests.  Some expect one access
31172	      # method and some another, which in $remotehost mode, means that
31173	      # sometimes the executables must run on one platform and
31174	      # sometimes another.)
31175	      continue
31176	    fi
31177	    save_servercvs=$servercvs
31178	    servercvs=$testcvs
31179	    dotest server2-1 "${servercvs} server" \
31180"E protocol error: directory '${CVSROOT_DIRNAME}/\.\./dir1' not within root '${CVSROOT_DIRNAME}'
31181error  " <<EOF
31182Root ${CVSROOT_DIRNAME}
31183Directory .
31184${CVSROOT_DIRNAME}/../dir1
31185noop
31186EOF
31187
31188	    dotest server2-2 "${servercvs} server" \
31189"E protocol error: directory '${CVSROOT_DIRNAME}dir1' not within root '${CVSROOT_DIRNAME}'
31190error  " <<EOF
31191Root ${CVSROOT_DIRNAME}
31192Directory .
31193${CVSROOT_DIRNAME}dir1
31194noop
31195EOF
31196
31197	    dotest 2-3 "${servercvs} server" \
31198"E protocol error: directory '${TESTDIR}' not within root '${CVSROOT_DIRNAME}'
31199error  " <<EOF
31200Root ${CVSROOT_DIRNAME}
31201Directory .
31202${TESTDIR}
31203noop
31204EOF
31205
31206	    # OK, now a few tests for the rule that one cannot pass a
31207	    # filename containing a slash to Modified, Is-modified,
31208	    # Notify, Questionable, or Unchanged.  For completeness
31209	    # we'd try them all.  For lazyness/conciseness we don't.
31210	    dotest server2-4 "${servercvs} server" \
31211"E protocol error: directory 'foo/bar' not within current directory
31212error  " <<EOF
31213Root ${CVSROOT_DIRNAME}
31214Directory .
31215${CVSROOT_DIRNAME}
31216Unchanged foo/bar
31217noop
31218EOF
31219	    servercvs=$save_servercvs
31220	  fi
31221	  ;;
31222
31223
31224
31225	client)
31226	  # Some tests of the client (independent of the server).
31227	  if $remote; then :; else
31228	    remoteonly client
31229	    continue
31230	  fi
31231
31232	  if $proxy; then
31233	    # Skip these tests in proxy mode since they assume we are not
31234	    # writing through a proxy server.  There is no writeproxy-client
31235	    # test currently.  The writeproxy & writeproxy-noredirect tests
31236	    # test the writeproxy server.
31237	    notproxy client
31238	    continue
31239	  fi
31240
31241	  cat >$TESTDIR/serveme <<EOF
31242#!$TESTSHELL
31243# This is admittedly a bit cheezy, in the sense that we make lots
31244# of assumptions about what the client is going to send us.
31245# We don't mention Repository, because current clients don't require it.
31246# Sending these at our own pace, rather than waiting for the client to
31247# make the requests, is bogus, but hopefully we can get away with it.
31248echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31249echo "ok"
31250echo "M special message"
31251echo "Created first-dir/"
31252echo "$CVSROOT_DIRNAME/first-dir/file1"
31253echo "/file1/1.1///"
31254echo "u=rw,g=rw,o=rw"
31255echo "4"
31256echo "xyz"
31257echo "ok"
31258cat >/dev/null
31259EOF
31260	  # Cygwin.  Pthffffffffft!
31261	  if test -n "$remotehost"; then
31262	    $CVS_RSH $remotehost "chmod +x $TESTDIR/serveme"
31263	  else
31264	    chmod +x $TESTDIR/serveme
31265	  fi
31266	  save_CVS_SERVER=$CVS_SERVER
31267	  CVS_SERVER=$TESTDIR/serveme; export CVS_SERVER
31268	  mkdir 1; cd 1
31269	  dotest_fail client-1 "$testcvs -q co first-dir" \
31270"$CPROG \[checkout aborted\]: This server does not support the global -q option$DOTSTAR"
31271	  dotest client-2 "$testcvs co first-dir" "special message"
31272
31273	  cat >$TESTDIR/serveme <<EOF
31274#!$TESTSHELL
31275echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31276echo "ok"
31277echo "M merge-it"
31278echo "Copy-file ./"
31279echo "$CVSROOT_DIRNAME/first-dir/file1"
31280echo "$TESTDIR/bogus/.#file1.1.1"
31281echo "Merged ./"
31282echo "$CVSROOT_DIRNAME/first-dir/file1"
31283echo "/file1/1.2///"
31284echo "u=rw,g=rw,o=rw"
31285echo "4"
31286echo "abd"
31287echo "ok"
31288cat >/dev/null
31289EOF
31290	  cd first-dir
31291	  mkdir $TESTDIR/bogus
31292	  # The ${DOTSTAR} is to match a potential "broken pipe" if the
31293	  # client exits before the server script sends everything
31294	  dotest_fail client-3 "$testcvs update" \
31295"merge-it
31296$CPROG \[update aborted\]: protocol error: Copy-file tried to specify director$DOTSTAR"
31297	  cat >$TESTDIR/serveme <<EOF
31298#!$TESTSHELL
31299echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31300echo "ok"
31301echo "M merge-it"
31302echo "Copy-file ./"
31303echo "$CVSROOT_DIRNAME/first-dir/file1"
31304echo ".#file1.1.1"
31305echo "Merged ./"
31306echo "$CVSROOT_DIRNAME/first-dir/file1"
31307echo "/file1/1.2///"
31308echo "u=rw,g=rw,o=rw"
31309echo "4"
31310echo "abc"
31311echo "ok"
31312cat >/dev/null
31313EOF
31314	  dotest client-4 "$testcvs update" "merge-it"
31315	  dotest client-5 "cat .#file1.1.1" "xyz"
31316	  dotest client-6 "cat CVS/Entries" "/file1/1.2/[A-Za-z0-9 :]*//
31317D"
31318	  dotest client-7 "cat file1" "abc"
31319
31320	  cat >$TESTDIR/serveme <<EOF
31321#!$TESTSHELL
31322echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31323echo "ok"
31324echo "M OK, whatever"
31325echo "ok"
31326cat >$TESTDIR/client.tmp
31327EOF
31328	  chmod u=rw,go= file1
31329	  # By specifying the time zone in local time, we don't
31330	  # know exactly how that will translate to GMT.
31331	  dotest client-8 "$testcvs update -D 99-10-04" "OK, whatever"
31332	  # String 2 below is Cygwin again - ptoooey.
31333	  dotest client-9 "cat $TESTDIR/client.tmp" \
31334"Root $CVSROOT_DIRNAME
31335Valid-responses [-a-zA-Z ]*
31336valid-requests
31337Argument -D
31338Argument [34] Oct 1999 [0-9][0-9]:00:00 -0000
31339Argument --
31340Directory \.
31341$CVSROOT_DIRNAME/first-dir
31342Entry /file1/1\.2///
31343Modified file1
31344u=rw,g=,o=
313454
31346abc
31347update" \
31348"Root $CVSROOT_DIRNAME
31349Valid-responses [-a-zA-Z ]*
31350valid-requests
31351Argument -D
31352Argument [34] Oct 1999 [0-9][0-9]:00:00 -0000
31353Argument --
31354Directory \.
31355$CVSROOT_DIRNAME/first-dir
31356Entry /file1/1\.2///
31357Modified file1
31358u=rw,g=r,o=r
313594
31360abc
31361update"
31362
31363	  # The following test tests what was a potential client exploit in
31364	  # CVS versions 1.11.14 and CVS versions 1.12.6 and earlier.  This
31365	  # exploit would allow a trojan server to create arbitrary files,
31366	  # anywhere the user had write permissions, even outside of the
31367	  # user's sandbox.
31368	  cat >$HOME/.bashrc <<EOF
31369#!$TESTSHELL
31370# This is where login scripts would usually be
31371# stored.
31372EOF
31373	  cat >$TESTDIR/serveme <<EOF
31374#!$TESTSHELL
31375echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31376echo "ok"
31377echo "Rcs-diff $HOME/"
31378echo "$HOME/.bashrc"
31379echo "/.bashrc/73.50///"
31380echo "u=rw,g=rw,o=rw"
31381echo "20"
31382echo "a1 1"
31383echo "echo 'gotcha!'"
31384echo "ok"
31385cat >/dev/null
31386EOF
31387
31388	  # If I don't run the following sleep between the above cat and
31389	  # the following calls to dotest, sometimes the serveme file isn't
31390	  # completely written yet by the time CVS tries to execute it,
31391	  # causing the shell to intermittantly report syntax errors (usually
31392	  # early EOF).  There's probably a new race condition here, but this
31393	  # works.
31394	  #
31395	  # Incidentally, I can reproduce this behavior with Linux 2.4.20 and
31396	  # Bash 2.05 or Bash 2.05b.
31397	  sleep 1
31398	  dotest_fail client-10 "$testcvs update" \
31399"$CPROG update: Server attempted to update a file via an invalid pathname:
31400$CPROG \[update aborted\]: \`$HOME/.bashrc'\."
31401
31402	  # A second try at a client exploit.  This one never actually
31403	  # failed in the past, but I thought it wouldn't hurt to add a test.
31404	  cat >$TESTDIR/serveme <<EOF
31405#!$TESTSHELL
31406echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31407echo "ok"
31408echo "Rcs-diff ./"
31409echo "$HOME/.bashrc"
31410echo "/.bashrc/73.50///"
31411echo "u=rw,g=rw,o=rw"
31412echo "20"
31413echo "a1 1"
31414echo "echo 'gotcha!'"
31415echo "ok"
31416cat >/dev/null
31417EOF
31418	  sleep 1
31419	  dotest_fail client-11 "$testcvs update" \
31420"$CPROG \[update aborted\]: patch original file \./\.bashrc does not exist"
31421
31422	  # A third try at a client exploit.  This one did used to fail like
31423	  # client-10.
31424	  cat >$TESTDIR/serveme <<EOF
31425#!$TESTSHELL
31426echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31427echo "ok"
31428echo "Rcs-diff ../../home/"
31429echo "../../.bashrc"
31430echo "/.bashrc/73.50///"
31431echo "u=rw,g=rw,o=rw"
31432echo "20"
31433echo "a1 1"
31434echo "echo 'gotcha!'"
31435echo "ok"
31436cat >/dev/null
31437EOF
31438	  sleep 1
31439	  dotest_fail client-12 "$testcvs update" \
31440"$CPROG update: Server attempted to update a file via an invalid pathname:
31441$CPROG \[update aborted\]: \`\.\./\.\./home/.bashrc'\."
31442
31443	  # Try the same exploit using the Created response.
31444	  cat >$TESTDIR/serveme <<EOF
31445#!$TESTSHELL
31446echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31447echo "ok"
31448echo "Created $HOME/"
31449echo "$HOME/.bashrc"
31450echo "/.bashrc/73.50///"
31451echo "u=rw,g=rw,o=rw"
31452echo "26"
31453echo "#! $TESTSHELL"
31454echo "echo 'gotcha!'"
31455echo "ok"
31456cat >/dev/null
31457EOF
31458	  sleep 1
31459	  dotest_fail client-13 "$testcvs update" \
31460"$CPROG update: Server attempted to update a file via an invalid pathname:
31461$CPROG \[update aborted\]: \`$HOME/.bashrc'\."
31462
31463	  # Now try using the Update-existing response
31464	  cat >$TESTDIR/serveme <<EOF
31465#!$TESTSHELL
31466echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31467echo "ok"
31468echo "Update-existing ../../home/"
31469echo "../../home/.bashrc"
31470echo "/.bashrc/73.50///"
31471echo "u=rw,g=rw,o=rw"
31472echo "26"
31473echo "#! $TESTSHELL"
31474echo "echo 'gotcha!'"
31475echo "ok"
31476cat >/dev/null
31477EOF
31478	  sleep 1
31479	  dotest_fail client-14 "$testcvs update" \
31480"$CPROG update: Server attempted to update a file via an invalid pathname:
31481$CPROG \[update aborted\]: \`\.\./\.\./home/.bashrc'\."
31482
31483	  # Try the same exploit using the Merged response.
31484	  cat >$TESTDIR/serveme <<EOF
31485#!$TESTSHELL
31486echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31487echo "ok"
31488echo "Merged $HOME/"
31489echo "$HOME/.bashrc"
31490echo "/.bashrc/73.50///"
31491echo "u=rw,g=rw,o=rw"
31492echo "26"
31493echo "#! $TESTSHELL"
31494echo "echo 'gotcha!'"
31495echo "ok"
31496cat >/dev/null
31497EOF
31498	  sleep 1
31499	  dotest_fail client-15 "$testcvs update" \
31500"$CPROG update: Server attempted to update a file via an invalid pathname:
31501$CPROG \[update aborted\]: \`$HOME/.bashrc'\."
31502
31503	  # Now try using the Updated response
31504	  cat >$TESTDIR/serveme <<EOF
31505#!$TESTSHELL
31506echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31507echo "ok"
31508echo "Updated ../../home/"
31509echo "../../home/.bashrc"
31510echo "/.bashrc/73.50///"
31511echo "u=rw,g=rw,o=rw"
31512echo "26"
31513echo "#! $TESTSHELL"
31514echo "echo 'gotcha!'"
31515echo "ok"
31516cat >/dev/null
31517EOF
31518	  sleep 1
31519	  dotest_fail client-16 "$testcvs update" \
31520"$CPROG update: Server attempted to update a file via an invalid pathname:
31521$CPROG \[update aborted\]: \`\.\./\.\./home/.bashrc'\."
31522
31523	  # Try the same exploit using the Copy-file response.
31524	  # As far as I know, Copy-file was never exploitable either.
31525	  cat >$TESTDIR/serveme <<EOF
31526#!$TESTSHELL
31527echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
31528echo "ok"
31529echo "Created ."
31530echo "./innocuous"
31531echo "/innocuous/73.50///"
31532echo "u=rw,g=rw,o=rw"
31533echo "26"
31534echo "#! $TESTSHELL"
31535echo "echo 'gotcha!'"
31536echo "Copy-file ."
31537echo "./innocuous"
31538echo "$HOME/innocuous"
31539echo "ok"
31540cat >/dev/null
31541EOF
31542	  sleep 1
31543	  dotest_fail client-18 "$testcvs update" \
31544"$CPROG \[update aborted\]: protocol error: Copy-file tried to specify directory"
31545
31546	  # And verify that none of the exploits was successful.
31547	  dotest client-19 "cat $HOME/.bashrc" \
31548"#!$TESTSHELL
31549# This is where login scripts would usually be
31550# stored\."
31551
31552	  # Check that the client detects redirect loops.
31553	  cat >$TESTDIR/serveme <<EOF
31554#!$TESTSHELL
31555echo "Valid-requests Root Valid-responses valid-requests Command-prep Referrer Repository Directory Relative-directory Max-dotdot Static-directory Sticky Entry Kopt Checkin-time Modified Is-modified UseUnchanged Unchanged Notify Hostname LocalDir Questionable Argument Argumentx Global_option Gzip-stream wrapper-sendme-rcsOptions Set Gssapi-authenticate expand-modules ci co update diff log rlog acl racl list rlist global-list-quiet ls add remove update-patches gzip-file-contents status rdiff tag rtag import admin export history release watch-on watch-off watch-add watch-remove watchers editors edit init annotate rannotate noop version"
31556echo "ok"
31557echo "Redirect $CVSROOT"
31558
31559# Eat up data from the client to avoid broken pipe errors.
31560cat >/dev/null
31561EOF
31562	  echo newstuff >file1
31563	  dotest_fail client-20 "$testcvs ci" \
31564"$CPROG commit: Examining \.
31565$CPROG \[commit aborted\]: \`Redirect' loop detected\.  Server misconfiguration$QUESTION"
31566
31567	  dokeep
31568	  cd ../..
31569	  rm -r 1
31570	  rmdir $TESTDIR/bogus
31571	  rm $TESTDIR/serveme $HOME/.bashrc
31572	  CVS_SERVER=$save_CVS_SERVER; export CVS_SERVER
31573	  ;;
31574
31575
31576
31577	dottedroot)
31578	  # Check that a CVSROOT with a "." in the name will work.
31579
31580	  if $proxy; then
31581	    # don't even try
31582	    continue
31583	  fi
31584
31585	  CVSROOT_save=${CVSROOT}
31586	  CVSROOT_DIRNAME_save=${CVSROOT_DIRNAME}
31587	  CVSROOT_DIRNAME=${TESTDIR}/cvs.root
31588	  CVSROOT=`newroot ${CVSROOT_DIRNAME}`
31589
31590	  dotest dottedroot-init-1 "${testcvs} init" ""
31591	  mkdir dir1
31592	  mkdir dir1/dir2
31593	  echo version1 >dir1/dir2/file1
31594	  cd dir1
31595	  dotest dottedroot-1 "${testcvs} import -m '' module1 AUTHOR INITIAL" \
31596"${SPROG} import: Importing ${CVSROOT_DIRNAME}/module1/dir2
31597N module1/dir2/file1
31598
31599No conflicts created by this import"
31600	  cd ..
31601
31602	  # This is the test that used to cause an assertion failure
31603	  # in recurse.c:do_recursion().
31604	  dotest dottedroot-2 "${testcvs} co -rINITIAL module1" \
31605"${SPROG} checkout: Updating module1
31606${SPROG} checkout: Updating module1/dir2
31607U module1/dir2/file1"
31608
31609	  dokeep
31610
31611	  rm -rf ${CVSROOT_DIRNAME}
31612	  rm -r dir1 module1
31613	  CVSROOT_DIRNAME=${CVSROOT_DIRNAME_save}
31614	  CVSROOT=${CVSROOT_save}
31615	  ;;
31616
31617
31618
31619	fork)
31620	  # Test that the server defaults to the correct executable in :fork:
31621	  # mode.  See the note in the TODO at the end of this file about this.
31622	  #
31623	  # This test and client should be left after all other references to
31624	  # CVS_SERVER are removed from this script.
31625	  #
31626	  # The client series of tests already tests that CVS_SERVER is
31627	  # working, but that test might be better here.
31628	  if $remote; then
31629	    if test -n "$remotehost"; then
31630	      # Don't even try.  If our caller specified a remotehost, our
31631	      # access method has been determined anyhow.
31632	      continue
31633	    fi
31634	    mkdir fork; cd fork
31635	    save_CVS_SERVER=$CVS_SERVER
31636	    unset CVS_SERVER
31637	    # So looking through $PATH for cvs won't work...
31638	    echo "echo junk" >cvs
31639	    chmod a+x cvs
31640	    save_PATH=$PATH; PATH=.:$PATH
31641	    # The second error message below is for testing clients without
31642	    # server support.
31643	    if ${testcvs_server_support}; then
31644		dotest fork-1 "$testcvs -d:fork:$CVSROOT_DIRNAME version" \
31645'Client: \(.*\)
31646Server: \1'
31647	    else
31648		dotest_fail fork-1-noss \
31649"$testcvs -d:fork:$CVSROOT_DIRNAME version" \
31650"Client: .*
31651Server: ${CPROG} version: You must set the CVS_SERVER environment variable when
31652${CPROG} version: using the :fork: access method\.
31653${CPROG} \[version aborted\]: This CVS was not compiled with server support\."
31654	    fi
31655
31656	    CVS_SERVER=${save_CVS_SERVER}; export CVS_SERVER
31657	    unset save_CVS_SERVER
31658	    PATH=$save_PATH; unset save_PATH
31659
31660	    dokeep
31661	    cd ..
31662	    rm -r fork
31663	  fi
31664	  ;;
31665
31666
31667
31668	commit-add-missing)
31669	  # Make sure that a commit fails when a `cvs add'ed file has
31670	  # been removed from the working directory.
31671
31672	  mkdir 1; cd 1
31673	  module=c-a-m
31674	  echo > unused-file
31675	  dotest commit-add-missing-1 \
31676	    "$testcvs -Q import -m. $module X Y" ''
31677
31678	  file=F
31679	  # Check it out and tag it.
31680	  dotest commit-add-missing-2 "$testcvs -Q co $module" ''
31681	  cd $module
31682	  dotest commit-add-missing-3 "$testcvs -Q tag -b B" ''
31683	  echo v1 > $file
31684	  dotest commit-add-missing-4 "$testcvs -Q add $file" ''
31685	  rm -f $file
31686	  dotest_fail commit-add-missing-5 "$testcvs -Q ci -m. $file" \
31687"${SPROG} commit: Up-to-date check failed for .$file'
31688${SPROG} \[commit aborted\]: correct above errors first!"
31689
31690	  dotest
31691	  cd ../..
31692	  rm -rf 1
31693	  modify_repo rm -rf $CVSROOT_DIRNAME/$module
31694	  ;;
31695
31696
31697
31698	commit-d)
31699	  # Check that top-level commits work when CVS/Root
31700	  # is overridden by cvs -d.
31701
31702	  mkdir -p 1/subdir; cd 1
31703	  touch file1 subdir/file2
31704	  dotest commit-d-1 "$testcvs -Q import -m. c-d-c X Y" ""
31705	  dotest commit-d-2 "$testcvs -Q co c-d-c" ""
31706	  cd c-d-c
31707	  echo change >>file1; echo another change >>subdir/file2
31708	  # Changing working root, then override with -d
31709	  echo nosuchhost:/cvs > CVS/Root
31710	  dotest commit-d-3 "$testcvs -q -d '$CVSROOT' commit -m." \
31711"$CVSROOT_DIRNAME/c-d-c/file1,v  <--  file1
31712new revision: 1.2; previous revision: 1.1
31713$CVSROOT_DIRNAME/c-d-c/subdir/file2,v  <--  subdir/file2
31714new revision: 1.2; previous revision: 1.1"
31715
31716	  dokeep
31717	  cd ../..
31718	  rm -rf 1 cvsroot/c-d-c
31719	  ;;
31720
31721
31722
31723	template)
31724	  # Check that the CVS/Template directory is being
31725	  # properly created.
31726	  modify_repo mkdir -p $CVSROOT_DIRNAME/first/subdir
31727	  modify_repo mkdir $CVSROOT_DIRNAME/second
31728	  mkdir template; cd template
31729
31730	  # check that no CVS/Template is created for an empty rcsinfo
31731	  # Note: For cvs clients with no Clear-template response, the
31732	  # CVS/Template file will exist and be zero bytes in length.
31733	  dotest template-empty-1 "${testcvs} -Q co first" ''
31734	  dotest template-empty-2 \
31735"test ! -s first/CVS/Template" ''
31736	  dotest template-empty-3 \
31737"test ! -s first/subdir/CVS/Template" ''
31738	  rm -fr first
31739
31740	  # create some template files
31741	  echo 'CVS: the default template' > ${TESTDIR}/template/temp.def
31742	  echo 'CVS: the first template' > ${TESTDIR}/template/temp.first
31743	  echo 'CVS: the subdir template' > ${TESTDIR}/template/temp.subdir
31744
31745	  dotest template-rcsinfo-1 "${testcvs} -Q co CVSROOT" ''
31746	  cd CVSROOT
31747	  echo DEFAULT ${TESTDIR}/template/temp.def >>rcsinfo
31748	  dotest template-rcsinfo-2 "$testcvs -Q ci -m."
31749	  # Make sure we get the update without a commit.
31750	  dotest template-rcsinfo-3 "${testcvs} -Q ci -m." ''
31751	  # Did the CVSROOT/CVS/Template file get the updated version?
31752	  if $remote; then
31753	    dotest template-rcsinfo-4r \
31754"cmp CVS/Template ${TESTDIR}/template/temp.def" ''
31755	  else
31756	    dotest template-rcsinfo-4 \
31757"test ! -f CVS/Template" ''
31758	  fi
31759	  echo "^first/subdir ${TESTDIR}/template/temp.subdir" >>rcsinfo
31760	  echo "^first ${TESTDIR}/template/temp.first" >>rcsinfo
31761	  dotest template-rcsinfo-4.1 "${testcvs} -Q ci -m. rcsinfo"
31762	  # Did the CVSROOT/CVS/Template file get the updated version?
31763	  if $remote; then
31764	    dotest template-rcsinfo-5r \
31765"cmp CVS/Template ${TESTDIR}/template/temp.def" ''
31766	  else
31767	    dotest template-rcsinfo-5 \
31768"test ! -f CVS/Template" ''
31769	  fi
31770	  cd ..
31771
31772	  # Now checkout the first and second modules and see
31773	  # if the proper template has been provided for each
31774	  dotest template-first "${testcvs} co first second" \
31775"${SPROG} checkout: Updating first
31776${SPROG} checkout: Updating first/subdir
31777${SPROG} checkout: Updating second"
31778
31779	  if $remote; then
31780	    # When in client/server CVS/Template must exist
31781	    dotest template-first-r-1 "test -f first/CVS/Template" ''
31782	    dotest template-first-r-2 "test -f first/subdir/CVS/Template" ''
31783	    dotest template-first-r-3 "test -f second/CVS/Template" ''
31784	    # The value of the CVS/Template should be equal to the
31785	    # file called out in the rcsinfo file.
31786	    dotest template-first-r-4 \
31787"cmp first/CVS/Template ${TESTDIR}/template/temp.first" ''
31788	    dotest template-first-r-5 \
31789"cmp first/subdir/CVS/Template ${TESTDIR}/template/temp.subdir" ''
31790	    dotest template-first-r-6 \
31791"cmp second/CVS/Template ${TESTDIR}/template/temp.def" ''
31792          else
31793	    # When in local mode CVS/Template must NOT exist
31794	    dotest_fail template-first-1 "test -f first/CVS/Template" ''
31795	    dotest_fail template-first-2 "test -f first/subdir/CVS/Template" ''
31796	    dotest_fail template-first-3 "test -f second/CVS/Template" ''
31797	  fi
31798
31799	  # Next, create a new subdirectory and see if it gets the
31800	  # correct template or not
31801	  cd second
31802	  mkdir otherdir
31803	  dotest template-add-1 "${testcvs} add otherdir" \
31804"Directory ${CVSROOT_DIRNAME}/second/otherdir added to the repository"
31805	  if $remote; then
31806	    dotest template-add-2r \
31807"cmp otherdir/CVS/Template ${TESTDIR}/template/temp.def" ''
31808	  else
31809	    dotest_fail template-add-2 "test -f otherdir/CVS/Template" ''
31810	  fi
31811	  cd ..
31812
31813	  # Update the remote template. Then see if doing an
31814	  # update of a checked out tree will properly update
31815	  # the CVS/Template files.
31816	  echo 'CVS: Line two' >> ${TESTDIR}/template/temp.def
31817	  echo 'CVS: Line two' >> ${TESTDIR}/template/temp.first
31818	  echo 'CVS: Line two' >> ${TESTDIR}/template/temp.subdir
31819	  dotest template-second "${testcvs} update first second" \
31820"${SPROG} update: Updating first
31821${SPROG} update: Updating first/subdir
31822${SPROG} update: Updating second
31823${SPROG} update: Updating second/otherdir"
31824
31825	  if $remote; then
31826	    dotest template-second-r-1 \
31827"cmp first/CVS/Template ${TESTDIR}/template/temp.first" ''
31828	    dotest template-second-r-2 \
31829"cmp first/subdir/CVS/Template ${TESTDIR}/template/temp.subdir" ''
31830	    dotest template-second-r-3 \
31831"cmp second/CVS/Template ${TESTDIR}/template/temp.def" ''
31832	    dotest template-second-r-4 \
31833"cmp second/otherdir/CVS/Template ${TESTDIR}/template/temp.def" ''
31834          else
31835	    # When in local mode CVS/Template must NOT exist
31836	    dotest_fail template-second-1 "test -f CVS/Template" ''
31837	    dotest_fail template-second-2 "test -f subdir/CVS/Template" ''
31838	    dotest_fail template-second-3 "test -f second/CVS/Template" ''
31839	    dotest_fail template-second-4 \
31840"test -f second/otherdir/CVS/Template" ''
31841	  fi
31842	  # Update the remote template with a zero-length template
31843	  : > ${TESTDIR}/template/temp.def
31844	  dotest template-third-1 "${testcvs} update second" \
31845"${SPROG} update: Updating second
31846${SPROG} update: Updating second/otherdir"
31847
31848	  if $remote; then
31849	    dotest_fail template-third-r-2 "test -s second/CVS/Template" ''
31850	    dotest_fail template-third-r-3 "test -s second/otherdir/CVS/Template" ''
31851          else
31852	    dotest_fail template-third-2 "test -f second/CVS/Template" ''
31853	    dotest_fail template-third-3 \
31854"test -f second/otherdir/CVS/Template" ''
31855          fi
31856
31857	  # fun with remote protocols and tags
31858	  if $remote; then
31859	    cd second
31860	    echo hello > file1
31861	    dotest template-tag-r-1 "${testcvs} -Q add file1" ''
31862	    dotest template-tag-r-2 "${testcvs} -Q commit -madd file1"
31863            dotest template-tag-r-3 "${testcvs} -q tag tag" 'T file1'
31864	    rm ${CVSROOT_DIRNAME}/CVSROOT/val-tags
31865	    cd ..
31866	    rm -fr second
31867	    dotest template-tag-r-4 "${testcvs} -Q co -rtag second" ''
31868	  fi
31869
31870	  cd CVSROOT
31871	  dotest template-norcsinfo-1 "${testcvs} up" \
31872"${SPROG} update: Updating \."
31873	  # Did the CVSROOT/CVS/Template file get the updated version?
31874	  if $remote; then
31875	    dotest template-norcsinfo-r-2 \
31876"cmp CVS/Template ${TESTDIR}/template/temp.def" ''
31877          else
31878	    dotest_fail template-norcsinfo-2 "test -f CVS/Template" ''
31879	  fi
31880
31881	  : > rcsinfo
31882	  dotest template-norcsinfo-3 "${testcvs} -Q ci -m. rcsinfo"
31883	  # Did the CVSROOT/CVS/Template file get the updated version?
31884	  # The file should be gone or of zero length.
31885	  dotest template-norcsinfo-4 \
31886"test ! -s CVS/Template" ''
31887	  cd ..
31888
31889	  dotest template-norcsinfo-5 "${testcvs} update first" \
31890"${SPROG} update: Updating first
31891${SPROG} update: Updating first/subdir"
31892
31893	  # Note: For cvs clients with no Clear-template response, the
31894	  # CVS/Template file will exist and be zero bytes in length.
31895	  dotest template-norcsinfo-6 \
31896"test ! -s first/CVS/Template" ''
31897	  dotest template-norcsinfo-7 \
31898"test ! -s first/subdir/CVS/Template" ''
31899
31900	  dokeep
31901
31902	  # cleanup
31903          modify_repo rm -rf $CVSROOT_DIRNAME/first $CVSROOT_DIRNAME/second
31904	  restore_adm
31905	  cd ..
31906	  rm -rf template
31907	  ;;
31908
31909
31910
31911	writeproxy)
31912	  # Various tests for a read-only CVS mirror set up as a write-proxy
31913	  # for a central server.
31914	  #
31915	  # These tests are only meaningful in client/server mode.
31916	  if $remote; then :; else
31917	    remoteonly writeproxy
31918	    continue
31919	  fi
31920
31921	  if $noredirect; then
31922	    notnoredirect writeproxy
31923	    continue
31924	  fi
31925
31926	  require_rsync
31927	  if test $? -eq 77; then
31928	    skip writeproxy "$skipreason"
31929	    continue
31930	  fi
31931
31932	  PRIMARY_CVSROOT_DIRNAME_save=$PRIMARY_CVSROOT_DIRNAME
31933	  PRIMARY_CVSROOT_save=$PRIMARY_CVSROOT
31934	  PRIMARY_CVSROOT_DIRNAME=$TESTDIR/primary_cvsroot
31935	  PRIMARY_CVSROOT=`newroot $PRIMARY_CVSROOT_DIRNAME`
31936	  SECONDARY_CVSROOT_DIRNAME_save=$SECONDARY_CVSROOT_DIRNAME
31937	  SECONDARY_CVSROOT_save=$SECONDARY_CVSROOT
31938	  SECONDARY_CVSROOT_DIRNAME=$TESTDIR/writeproxy_cvsroot
31939	  SECONDARY_CVSROOT=`newroot $SECONDARY_CVSROOT_DIRNAME`
31940
31941	  # Initialize the primary repository
31942	  dotest writeproxy-init-1 "$testcvs -d$PRIMARY_CVSROOT init"
31943	  mkdir writeproxy; cd writeproxy
31944	  mkdir primary; cd primary
31945	  dotest writeproxy-init-2 "$testcvs -Qd$PRIMARY_CVSROOT co CVSROOT"
31946	  cd CVSROOT
31947	  cat >>loginfo <<EOF
31948ALL (cat >/dev/null; echo %R) >$TESTDIR/referrer
31949ALL $RSYNC -gopr --delete $PRIMARY_CVSROOT_DIRNAME/ $SECONDARY_CVSROOT_DIRNAME
31950EOF
31951	  cat >>config <<EOF
31952PrimaryServer=$PRIMARY_CVSROOT
31953EOF
31954	  dotest writeproxy-init-3 \
31955"$testcvs -Q ci -mconfigure-writeproxy"
31956
31957	  # Quickly verify that the server can resolve symlinks when
31958	  # determining whether it is the primary.
31959	  # This shouldn't actually change the repository.
31960	  save_CVS_SERVER=$CVS_SERVER
31961	  ln -s $PRIMARY_CVSROOT_DIRNAME $TESTDIR/primary_link
31962	  dotest writeproxy-0 "$CVS_SERVER server" \
31963"Valid-requests Root Valid-responses valid-requests Command-prep Referrer Repository Directory Relative-directory Max-dotdot Static-directory Sticky Checkin-prog Update-prog Entry Kopt Checkin-time Modified Is-modified UseUnchanged Unchanged Notify Hostname LocalDir Questionable Argument Argumentx Global_option Gzip-stream wrapper-sendme-rcsOptions Set ${DOTSTAR}expand-modules ci co update diff log rlog acl racl list rlist global-list-quiet ls add remove update-patches gzip-file-contents status rdiff tag rtag import admin export history release watch-on watch-off watch-add watch-remove watchers editors edit init annotate rannotate noop version
31964ok
31965ok
31966ok" \
31967<< EOF
31968Root $TESTDIR/primary_link
31969Valid-responses ok error Valid-requests Redirect Checked-in New-entry Checksum Copy-file Updated Created Update-existing Merged Patched Rcs-diff Mode Mod-time Removed Remove-entry Set-static-directory Clear-static-directory Set-sticky Clear-sticky Edit-file Template Clear-template Notified Module-expansion Wrapper-rcsOption M Mbinary E F MT
31970valid-requests
31971UseUnchanged
31972Command-prep commit
31973Global_option -q
31974Global_option -Q
31975Argument -m
31976Argument configure-writeproxy
31977Argument --
31978Directory .
31979CVSROOT
31980Entry /checkoutlist/1.1///
31981Modified checkoutlist
31982u=rw,g=rw,o=r
31983495
31984# The "checkoutlist" file is used to support additional version controlled
31985# administrative files in \$CVSROOT/CVSROOT, such as template files.
31986#
31987# The first entry on a line is a filename which will be checked out from
31988# the corresponding RCS file in the \$CVSROOT/CVSROOT directory.
31989# The remainder of the line is an error message to use if the file cannot
31990# be checked out.
31991#
31992# File format:
31993#
31994#	[<whitespace>]<filename>[<whitespace><error message>]<end-of-line>
31995#
31996# comment lines begin with '#'
31997ci
31998EOF
31999	  rm $TESTDIR/primary_link
32000
32001	  # And now the secondary.
32002	  $RSYNC -gopr $PRIMARY_CVSROOT_DIRNAME/ $SECONDARY_CVSROOT_DIRNAME
32003
32004	  # Checkout from secondary
32005	  #
32006	  # For now, move the primary root out of the way to satisfy
32007	  # ourselves that the data is coming from the secondary.
32008	  mv $PRIMARY_CVSROOT_DIRNAME $TESTDIR/save-root
32009	  cd ../..
32010	  mkdir secondary; cd secondary
32011	  dotest writeproxy-1 "$testcvs -qd$SECONDARY_CVSROOT co CVSROOT" \
32012"U CVSROOT/access
32013U CVSROOT/aclconfig
32014U CVSROOT/checkoutlist
32015U CVSROOT/commitinfo
32016U CVSROOT/config
32017U CVSROOT/cvswrappers
32018U CVSROOT/group
32019U CVSROOT/loginfo
32020U CVSROOT/modules
32021U CVSROOT/notify
32022U CVSROOT/postadmin
32023U CVSROOT/postproxy
32024U CVSROOT/posttag
32025U CVSROOT/postwatch
32026U CVSROOT/preproxy
32027U CVSROOT/rcsinfo
32028U CVSROOT/taginfo
32029U CVSROOT/verifymsg"
32030
32031	  # Confirm data present
32032	  cd CVSROOT
32033	  dotest writeproxy-2 "grep rsync loginfo" \
32034"ALL $RSYNC -gopr --delete $PRIMARY_CVSROOT_DIRNAME/ $SECONDARY_CVSROOT_DIRNAME"
32035	  dotest writeproxy-3 "grep PrimaryServer config" \
32036"${DOTSTAR}
32037PrimaryServer=$PRIMARY_CVSROOT"
32038
32039	  # Checkin to secondary
32040	  cd ..
32041	  dotest writeproxy-4 "$testcvs -Qd$SECONDARY_CVSROOT co -ldtop ."
32042	  cd top
32043	  mkdir firstdir
32044
32045	  # Have to move the primary root back before we can perform write
32046	  # operations.
32047	  mv $TESTDIR/save-root $PRIMARY_CVSROOT_DIRNAME
32048
32049	  dotest writeproxy-5 "$testcvs -Q add firstdir"
32050	  cd firstdir
32051	  echo now you see me >file1
32052	  dotest writeproxy-6 "$testcvs -Q add file1"
32053	  dotest writeproxy-6a "grep file1 CVS/Entries >/dev/null"
32054	  dotest writeproxy-7 "$testcvs -Q ci -mfirst-file file1"
32055
32056	  # Verify that the server got the correct referrer.
32057	  #
32058	  # This happens even when using a :fork:ed server because CVS is
32059	  # hardcoded to support only :ext: servers.
32060	  #
32061	  # This test meaningfully detects that a referrer was passed in fork
32062	  # mode because the only time the referrer string can be altered from
32063	  # its original state is when the server sends a Referrer response.
32064	  # If the client were not parsing and resending the referrer, this
32065	  # string would still match $SECONDARY_CVSROOT_DIRNAME.
32066	  dotest writeproxy-7a "cat $TESTDIR/referrer" \
32067":ext:$username@$hostname$SECONDARY_CVSROOT_DIRNAME"
32068
32069	  # Make sure the sync took place
32070	  dotest writeproxy-7b "$testcvs -Q up"
32071
32072	  # Checkout from primary
32073	  cd ../../../primary
32074	  dotest writeproxy-8 "$testcvs -qd$PRIMARY_CVSROOT co firstdir" \
32075"U firstdir/file1"
32076
32077	  # Confirm data present
32078	  #  - This test indirectly confirms that the commit did not take
32079	  #    place on the secondary.
32080	  cd firstdir
32081	  dotest writeproxy-9 "cat file1" "now you see me"
32082
32083	  # Commit to primary
32084	  echo now you see me again >file1
32085	  dotest writeproxy-10 "$testcvs -Q ci -medit file1"
32086
32087	  # Update from secondary
32088	  cd ../../secondary/top/firstdir
32089	  dotest writeproxy-11 "$testcvs -q up" \
32090"U file1"
32091
32092	  # Confirm data present
32093	  dotest writeproxy-12 "cat file1" "now you see me again"
32094
32095	  # Test a failing rsync
32096	  cd ../../CVSROOT
32097	  sed \$d <loginfo >tmp
32098	  mv tmp loginfo
32099	  echo >>loginfo \
32100"ALL echo >&2 'Im rsync and I encountered an error!'; cat >/dev/null; exit 1"
32101	  dotest writeproxy-init-13 "$testcvs -Q ci -mbreak-rsync" \
32102"Im rsync and I encountered an error!"
32103	  echo "# a comment" >>loginfo
32104	  dotest writeproxy-13 "$testcvs -Q ci -mtest-broken-rsync" \
32105"Im rsync and I encountered an error!"
32106	  touch loginfo
32107	  dotest_fail writeproxy-14 "$testcvs up" \
32108"$SPROG update: Updating \.
32109$SPROG \[update aborted\]: could not find desired version 1\.4 in $PRIMARY_CVSROOT_DIRNAME/CVSROOT/loginfo,v"
32110
32111	  dokeep
32112	  cd ../../..
32113	  rm -r writeproxy $TESTDIR/referrer
32114	  rm -rf $PRIMARY_CVSROOT_DIRNAME $SECONDARY_CVSROOT_DIRNAME
32115	  PRIMARY_CVSROOT_DIRNAME=$PRIMARY_CVSROOT_DIRNAME_save
32116	  PRIMARY_CVSROOT=$PRIMARY_CVSROOT_save
32117	  SECONDARY_CVSROOT_DIRNAME=$SECONDARY_CVSROOT_DIRNAME_save
32118	  SECONDARY_CVSROOT=$SECONDARY_CVSROOT_save
32119	  ;;
32120
32121
32122
32123	writeproxy-noredirect)
32124	  # Various tests for a read-only CVS mirror set up as a write-proxy
32125	  # for a central server.
32126	  #
32127	  # These tests are only meaningful in client/server mode.
32128	  #
32129	  # These tests are a few simple tests for a writeproxy setup with a
32130	  # client that can't handle the `Redirect' response.  Mostly they
32131	  # parallel the "writeproxy" tests but, in the style of the "server",
32132	  # "server2", "pserver", and related tests, they bypass the CVS client
32133	  # for write commands by piping data into a server on STDIN to mimic
32134	  # a client that cannot handle the `Redirect' response.
32135	  if $remote; then :; else
32136	    remoteonly writeproxy-noredirect
32137	    continue
32138	  fi
32139
32140	  require_rsync
32141	  if test $? -eq 77; then
32142	    skip writeproxy-noredirect "$skipreason"
32143	    continue
32144	  fi
32145
32146	  PRIMARY_CVSROOT_DIRNAME_save=$PRIMARY_CVSROOT_DIRNAME
32147	  PRIMARY_CVSROOT_save=$PRIMARY_CVSROOT
32148	  PRIMARY_CVSROOT_DIRNAME=$TESTDIR/primary_cvsroot
32149	  PRIMARY_CVSROOT=`newroot $PRIMARY_CVSROOT_DIRNAME`
32150	  SECONDARY_CVSROOT_DIRNAME_save=$SECONDARY_CVSROOT_DIRNAME
32151	  SECONDARY_CVSROOT_DIRNAME=$TESTDIR/writeproxy_cvsroot
32152
32153	  # Initialize the primary repository
32154	  dotest writeproxy-noredirect-init-1 \
32155"$testcvs -d'$PRIMARY_CVSROOT' init"
32156	  mkdir writeproxy-noredirect; cd writeproxy-noredirect
32157	  mkdir primary; cd primary
32158	  dotest writeproxy-noredirect-init-2 \
32159"$testcvs -Qd'$PRIMARY_CVSROOT' co CVSROOT"
32160	  cd CVSROOT
32161	  cat >>loginfo <<EOF
32162ALL $RSYNC -gopr --delete $PRIMARY_CVSROOT_DIRNAME/ $SECONDARY_CVSROOT_DIRNAME
32163EOF
32164	  cat >>config <<EOF
32165PrimaryServer=$PRIMARY_CVSROOT
32166EOF
32167	  dotest writeproxy-noredirect-init-3 \
32168"$testcvs -Q ci -mconfigure-writeproxy"
32169
32170	  # And now the secondary.
32171	  $RSYNC -gopr $PRIMARY_CVSROOT_DIRNAME/ $SECONDARY_CVSROOT_DIRNAME
32172
32173	  CVS_SERVER_save=$CVS_SERVER
32174	  CVS_SERVER_secondary=$TESTDIR/writeproxy-secondary-wrapper
32175	  CVS_SERVER=$CVS_SERVER_secondary
32176
32177	  # Wrap the CVS server to allow --primary-root to be set by the
32178	  # secondary.
32179	  cat <<EOF >$TESTDIR/writeproxy-secondary-wrapper
32180#! $TESTSHELL
32181CVS_SERVER=$TESTDIR/writeproxy-primary-wrapper
32182export CVS_SERVER
32183
32184# No need to check the PID of the last client since we are testing with
32185# Redirect disabled.
32186proot_arg="--allow-root $SECONDARY_CVSROOT_DIRNAME"
32187exec $servercvs \$proot_arg "\$@"
32188EOF
32189	  cat <<EOF >$TESTDIR/writeproxy-primary-wrapper
32190#! $TESTSHELL
32191#CVS_SERVER_LOG=/tmp/cvsprimarylog
32192exec $servercvs "\$@"
32193EOF
32194
32195	  chmod a+x $TESTDIR/writeproxy-secondary-wrapper \
32196	            $TESTDIR/writeproxy-primary-wrapper
32197
32198	  # Checkout from secondary
32199	  #
32200	  # It may look like we are checking out from the primary here, but
32201	  # in fork mode, the deciding factor is the PrimaryServer translation
32202	  # above.
32203	  #
32204	  # When the primary and secondary hostname were different, the server
32205	  # the client is talking directly to is more obvious.
32206	  #
32207	  # For now, move the primary root out of the way to satisfy
32208	  # ourselves that the data is coming from the secondary.
32209	  mv $PRIMARY_CVSROOT_DIRNAME $TESTDIR/save-root
32210	  cd ../..
32211	  mkdir secondary; cd secondary
32212	  dotest writeproxy-noredirect-1 \
32213"$testcvs -qd'$PRIMARY_CVSROOT' co CVSROOT" \
32214"U CVSROOT/access
32215U CVSROOT/aclconfig
32216U CVSROOT/checkoutlist
32217U CVSROOT/commitinfo
32218U CVSROOT/config
32219U CVSROOT/cvswrappers
32220U CVSROOT/group
32221U CVSROOT/loginfo
32222U CVSROOT/modules
32223U CVSROOT/notify
32224U CVSROOT/postadmin
32225U CVSROOT/postproxy
32226U CVSROOT/posttag
32227U CVSROOT/postwatch
32228U CVSROOT/preproxy
32229U CVSROOT/rcsinfo
32230U CVSROOT/taginfo
32231U CVSROOT/verifymsg"
32232
32233	  # Confirm data present
32234	  cd CVSROOT
32235	  dotest writeproxy-noredirect-2 "grep rsync loginfo" \
32236"ALL $RSYNC -gopr --delete $PRIMARY_CVSROOT_DIRNAME/ $SECONDARY_CVSROOT_DIRNAME"
32237	  dotest writeproxy-noredirect-3 "grep PrimaryServer config" \
32238"${DOTSTAR}
32239PrimaryServer=$PRIMARY_CVSROOT"
32240
32241	  # Checkin to secondary
32242	  cd ..
32243	  dotest writeproxy-noredirect-4 \
32244"$testcvs -Qd'$PRIMARY_CVSROOT' co -ldtop ."
32245	  cd top
32246	  mkdir firstdir
32247
32248	  # Have to move the primary root back before we can perform write
32249	  # operations.
32250	  mv $TESTDIR/save-root $PRIMARY_CVSROOT_DIRNAME
32251
32252	  dotest writeproxy-noredirect-5 "$CVS_SERVER server" \
32253"Valid-requests Root Valid-responses valid-requests Command-prep Referrer Repository Directory Relative-directory Max-dotdot Static-directory Sticky Checkin-prog Update-prog Entry Kopt Checkin-time Modified Is-modified UseUnchanged Unchanged Notify Hostname LocalDir Questionable Argument Argumentx Global_option Gzip-stream wrapper-sendme-rcsOptions Set ${DOTSTAR}expand-modules ci co update diff log rlog acl racl list rlist global-list-quiet ls add remove update-patches gzip-file-contents status rdiff tag rtag import admin export history release watch-on watch-off watch-add watch-remove watchers editors edit init annotate rannotate noop version
32254ok
32255ok
32256ok
32257Clear-template firstdir/
32258firstdir/
32259ok" \
32260<< EOF
32261Root $PRIMARY_CVSROOT_DIRNAME
32262Valid-responses ok error Valid-requests Checked-in New-entry Checksum Copy-file Updated Created Update-existing Merged Patched Rcs-diff Mode Mod-time Removed Remove-entry Set-static-directory Clear-static-directory Set-sticky Clear-sticky Template Clear-template Notified Module-expansion Wrapper-rcsOption M Mbinary E F MT
32263valid-requests
32264UseUnchanged
32265Command-prep add
32266Global_option -q
32267Global_option -Q
32268wrapper-sendme-rcsOptions
32269Argument --
32270Directory firstdir
32271firstdir
32272Directory .
32273
32274Argument firstdir
32275add
32276EOF
32277
32278	  # Gotta update the workspace ourselves since we bypassed the client.
32279	  cp -R CVS firstdir/CVS
32280	  echo "firstdir" >firstdir/CVS/Repository
32281
32282	  cd firstdir
32283	  echo now you see me >file1
32284	  dotest writeproxy-noredirect-6 "$CVS_SERVER server" \
32285"Valid-requests Root Valid-responses valid-requests Command-prep Referrer Repository Directory Relative-directory Max-dotdot Static-directory Sticky Checkin-prog Update-prog Entry Kopt Checkin-time Modified Is-modified UseUnchanged Unchanged Notify Hostname LocalDir Questionable Argument Argumentx Global_option Gzip-stream wrapper-sendme-rcsOptions Set ${DOTSTAR}expand-modules ci co update diff log rlog acl racl list rlist global-list-quiet ls add remove update-patches gzip-file-contents status rdiff tag rtag import admin export history release watch-on watch-off watch-add watch-remove watchers editors edit init annotate rannotate noop version
32286ok
32287ok
32288ok
32289Checked-in \./
32290firstdir/file1
32291/file1/0///
32292ok" \
32293<< EOF
32294Root $PRIMARY_CVSROOT_DIRNAME
32295Valid-responses ok error Valid-requests Checked-in New-entry Checksum Copy-file Updated Created Update-existing Merged Patched Rcs-diff Mode Mod-time Removed Remove-entry Set-static-directory Clear-static-directory Set-sticky Clear-sticky Template Clear-template Notified Module-expansion Wrapper-rcsOption M Mbinary E F MT
32296valid-requests
32297UseUnchanged
32298Command-prep add
32299Global_option -q
32300Global_option -Q
32301wrapper-sendme-rcsOptions
32302Argument --
32303Directory .
32304firstdir
32305Is-modified file1
32306Argument file1
32307add
32308EOF
32309
32310	  # Have to add it to the workspace ourselves again since we are
32311	  # bypassing the client.
32312	  echo /file1/0/dummy+timestamp// >>CVS/Entries
32313
32314	  dotest writeproxy-noredirect-7 "$CVS_SERVER server" \
32315"Valid-requests Root Valid-responses valid-requests Command-prep Referrer Repository Directory Relative-directory Max-dotdot Static-directory Sticky Checkin-prog Update-prog Entry Kopt Checkin-time Modified Is-modified UseUnchanged Unchanged Notify Hostname LocalDir Questionable Argument Argumentx Global_option Gzip-stream wrapper-sendme-rcsOptions Set ${DOTSTAR}expand-modules ci co update diff log rlog acl racl list rlist global-list-quiet ls add remove update-patches gzip-file-contents status rdiff tag rtag import admin export history release watch-on watch-off watch-add watch-remove watchers editors edit init annotate rannotate noop version
32316ok
32317ok
32318Mode u=rw,g=rw,o=r
32319Checked-in \./
32320firstdir/file1
32321/file1/1\.1///
32322ok" \
32323<< EOF
32324Root $PRIMARY_CVSROOT_DIRNAME
32325Valid-responses ok error Valid-requests Checked-in New-entry Checksum Copy-file Updated Created Update-existing Merged Patched Rcs-diff Mode Mod-time Removed Remove-entry Set-static-directory Clear-static-directory Set-sticky Clear-sticky Template Clear-template Notified Module-expansion Wrapper-rcsOption M Mbinary E F MT
32326valid-requests
32327UseUnchanged
32328Command-prep commit
32329Global_option -q
32330Global_option -Q
32331Argument -m
32332Argument first-file
32333Argument --
32334Directory .
32335firstdir
32336Entry /file1/0/+modified//
32337Modified file1
32338u=rw,g=rw,o=r
3233915
32340now you see me
32341Argument file1
32342ci
32343EOF
32344
32345	  # Have to add it to the workspace ourselves again since we are
32346	  # bypassing the client.
32347	  echo D >CVS/Entries
32348	  echo /file1/1.1/dummy+timestamp// >>CVS/Entries
32349
32350	  # Make sure the sync took place
32351	  dotest writeproxy-noredirect-7a "$testcvs -Q up"
32352
32353	  CVS_SERVER=$servercvs
32354	  # Checkout from primary
32355	  cd ../../../primary
32356	  dotest writeproxy-noredirect-8 \
32357"$testcvs -qd'$PRIMARY_CVSROOT' co firstdir" \
32358"U firstdir/file1"
32359
32360	  # Confirm data present
32361	  #  - This test indirectly confirms that the commit did not take
32362	  #    place on the secondary.
32363	  cd firstdir
32364	  dotest writeproxy-noredirect-9 "cat file1" "now you see me"
32365
32366	  # Commit to primary
32367	  echo now you see me again >file1
32368	  dotest writeproxy-noredirect-10 "$testcvs -Q ci -medit file1"
32369
32370	  CVS_SERVER=$CVS_SERVER_secondary
32371	  # Update from secondary
32372	  cd ../../secondary/top/firstdir
32373	  dotest writeproxy-noredirect-11 "$testcvs -q up" "U file1"
32374
32375	  # Confirm data present
32376	  dotest writeproxy-noredirect-12 "cat file1" "now you see me again"
32377
32378	  dokeep
32379	  cd ../../../..
32380	  rm -r writeproxy-noredirect
32381	  rm -rf $PRIMARY_CVSROOT_DIRNAME $SECONDARY_CVSROOT_DIRNAME
32382	  rm $TESTDIR/writeproxy-secondary-wrapper \
32383	     $TESTDIR/writeproxy-primary-wrapper
32384	  CVS_SERVER=$CVS_SERVER_save
32385	  PRIMARY_CVSROOT_DIRNAME=$PRIMARY_CVSROOT_DIRNAME_save
32386	  PRIMARY_CVSROOT=$PRIMARY_CVSROOT_save
32387	  SECONDARY_CVSROOT_DIRNAME=$SECONDARY_CVSROOT_DIRNAME_save
32388	  ;;
32389
32390
32391
32392	writeproxy-ssh)
32393	  # Various tests for a read-only CVS mirror set up as a write-proxy
32394	  # for a central server accessed via the :ext: method.
32395	  #
32396	  # Mostly these tests are intended to set up for the final test which
32397	  # verifies that the server registers the referrer.
32398	  if $remote; then :; else
32399	    remoteonly writeproxy-ssh
32400	    continue
32401	  fi
32402
32403	  if $noredirect; then
32404	    notnoredirect writeproxy-ssh
32405	    continue
32406	  fi
32407
32408	  require_rsh "$CVS_RSH"
32409	  if test $? -eq 77; then
32410	    skip writeproxy-ssh "$skipreason"
32411	    continue
32412	  fi
32413
32414	  require_rsync
32415	  if test $? -eq 77; then
32416	    skip writeproxy-ssh "$skipreason"
32417	    continue
32418	  fi
32419
32420	  # Save old roots.
32421	  PRIMARY_CVSROOT_DIRNAME_save=$PRIMARY_CVSROOT_DIRNAME
32422	  PRIMARY_CVSROOT_save=$PRIMARY_CVSROOT
32423	  SECONDARY_CVSROOT_DIRNAME_save=$SECONDARY_CVSROOT_DIRNAME
32424	  SECONDARY_CVSROOT_save=$SECONDARY_CVSROOT
32425
32426	  # Set new roots.
32427	  PRIMARY_CVSROOT_DIRNAME=$TESTDIR/primary_cvsroot
32428	  PRIMARY_CVSROOT=:ext:$host$PRIMARY_CVSROOT_DIRNAME
32429	  SECONDARY_CVSROOT_DIRNAME=$TESTDIR/writeproxy_cvsroot
32430	  SECONDARY_CVSROOT=":ext;Redirect=yes:$host$SECONDARY_CVSROOT_DIRNAME"
32431
32432	  # Initialize the primary repository
32433	  dotest writeproxy-ssh-init-1 "$testcvs -d$PRIMARY_CVSROOT init"
32434	  mkdir writeproxy-ssh; cd writeproxy-ssh
32435	  mkdir primary; cd primary
32436	  dotest writeproxy-ssh-init-2 "$testcvs -Qd$PRIMARY_CVSROOT co CVSROOT"
32437	  cd CVSROOT
32438	  cat >>loginfo <<EOF
32439ALL $RSYNC -gopr --delete $PRIMARY_CVSROOT_DIRNAME/ $SECONDARY_CVSROOT_DIRNAME
32440EOF
32441	  cat >>loginfo <<EOF
32442ALL echo Referrer=%R; cat >/dev/null
32443EOF
32444	  cat >>config <<EOF
32445PrimaryServer=$PRIMARY_CVSROOT
32446EOF
32447	  dotest writeproxy-ssh-init-3 \
32448"$testcvs -Q ci -mconfigure-writeproxy-ssh" \
32449"Referrer=NONE"
32450
32451	  # And now the secondary.
32452	  $RSYNC -gopr $PRIMARY_CVSROOT_DIRNAME/ $SECONDARY_CVSROOT_DIRNAME
32453
32454	  # Checkout from secondary
32455	  #
32456	  # For now, move the primary root out of the way to satisfy
32457	  # ourselves that the data is coming from the secondary.
32458	  mv $PRIMARY_CVSROOT_DIRNAME $TESTDIR/save-root
32459
32460	  # Checkin to secondary
32461	  cd ../..
32462	  save_CVSROOT=$CVSROOT
32463	  CVSROOT=$SECONDARY_CVSROOT
32464	  export CVSROOT
32465	  dotest writeproxy-ssh-1 "$testcvs -Q co -ldtop ."
32466	  CVSROOT=$save_CVSROOT
32467	  export CVSROOT
32468	  cd top
32469	  mkdir firstdir
32470
32471	  # Have to move the primary root back before we can perform write
32472	  # operations.
32473	  mv $TESTDIR/save-root $PRIMARY_CVSROOT_DIRNAME
32474
32475	  dotest writeproxy-ssh-2 "$testcvs -Q add firstdir" \
32476"Referrer=:ext:$username@$hostname$SECONDARY_CVSROOT_DIRNAME"
32477
32478	  cd firstdir
32479	  echo now you see me >file1
32480	  dotest writeproxy-ssh-3 "$testcvs -Q add file1"
32481	  dotest writeproxy-ssh-4 "$testcvs -Q ci -mfirst-file file1" \
32482"Referrer=:ext:$username@$hostname$SECONDARY_CVSROOT_DIRNAME"
32483
32484	  dokeep
32485	  cd ../../..
32486	  rm -r writeproxy-ssh
32487	  rm -rf $PRIMARY_CVSROOT_DIRNAME $SECONDARY_CVSROOT_DIRNAME
32488	  PRIMARY_CVSROOT_DIRNAME=$PRIMARY_CVSROOT_DIRNAME_save
32489	  PRIMARY_CVSROOT=$PRIMARY_CVSROOT_save
32490	  SECONDARY_CVSROOT_DIRNAME=$SECONDARY_CVSROOT_DIRNAME_save
32491	  SECONDARY_CVSROOT=$SECONDARY_CVSROOT_save
32492	  ;;
32493
32494
32495
32496	writeproxy-ssh-noredirect)
32497	  # Various tests for a read-only CVS mirror set up as a write-proxy
32498	  # for a central server accessed via the :ext: method.
32499	  #
32500	  # Mostly these tests are intended to set up for the final test which
32501	  # verifies that the server registers the referrer.
32502	  if $remote; then :; else
32503	    remoteonly writeproxy-ssh-noredirect
32504	    continue
32505	  fi
32506
32507	  require_rsh "$CVS_RSH"
32508	  if test $? -eq 77; then
32509	    skip writeproxy-ssh-noredirect "$skipreason"
32510	    continue
32511	  fi
32512
32513	  require_rsync
32514	  if test $? -eq 77; then
32515	    skip writeproxy-ssh-noredirect "$skipreason"
32516	    continue
32517	  fi
32518
32519	  # Save old roots.
32520	  PRIMARY_CVSROOT_DIRNAME_save=$PRIMARY_CVSROOT_DIRNAME
32521	  PRIMARY_CVSROOT_save=$PRIMARY_CVSROOT
32522	  SECONDARY_CVSROOT_DIRNAME_save=$SECONDARY_CVSROOT_DIRNAME
32523	  SECONDARY_CVSROOT_save=$SECONDARY_CVSROOT
32524
32525	  # Set new roots.
32526	  PRIMARY_CVSROOT_DIRNAME=$TESTDIR/primary_cvsroot
32527	  PRIMARY_CVSROOT=:ext:$host$PRIMARY_CVSROOT_DIRNAME
32528	  SECONDARY_CVSROOT_DIRNAME=$TESTDIR/writeproxy_cvsroot
32529	  SECONDARY_CVSROOT=":ext;Redirect=no:$host$PRIMARY_CVSROOT_DIRNAME"
32530
32531	  # Initialize the primary repository
32532	  dotest writeproxy-ssh-noredirect-init-1 \
32533"$testcvs -d$PRIMARY_CVSROOT init"
32534	  mkdir writeproxy-ssh-noredirect; cd writeproxy-ssh-noredirect
32535	  mkdir primary; cd primary
32536	  dotest writeproxy-ssh-noredirect-init-2 \
32537"$testcvs -Qd$PRIMARY_CVSROOT co CVSROOT"
32538	  cd CVSROOT
32539	  cat >>loginfo <<EOF
32540ALL $RSYNC -gopr --delete $PRIMARY_CVSROOT_DIRNAME/ $SECONDARY_CVSROOT_DIRNAME
32541EOF
32542	  cat >>loginfo <<EOF
32543ALL echo Referrer=%R; cat >/dev/null
32544EOF
32545	  cat >>config <<EOF
32546PrimaryServer=$PRIMARY_CVSROOT
32547EOF
32548	  dotest writeproxy-ssh-noredirect-init-3 \
32549"$testcvs -Q ci -mconfigure-writeproxy-ssh-noredirect" \
32550"Referrer=NONE"
32551
32552	  # And now the secondary.
32553	  $RSYNC -gopr $PRIMARY_CVSROOT_DIRNAME/ $SECONDARY_CVSROOT_DIRNAME
32554
32555	  # Wrap the CVS server to allow --primary-root to be set by the
32556	  # secondary.
32557	  cat <<EOF >$TESTDIR/writeproxy-secondary-wrapper
32558#! $TESTSHELL
32559CVS_SERVER=$TESTDIR/writeproxy-primary-wrapper
32560export CVS_SERVER
32561
32562# No need to check the PID of the last client since we are testing with
32563# Redirect disabled.
32564proot_arg="--allow-root=$SECONDARY_CVSROOT_DIRNAME"
32565exec $CVS_SERVER \$proot_arg "\$@"
32566EOF
32567	  cat <<EOF >$TESTDIR/writeproxy-primary-wrapper
32568#! $TESTSHELL
32569if test -n "\$CVS_SERVER_LOG"; then
32570	CVS_SERVER_LOG=$TMPDIR/cvsprimarylog; export CVS_SERVER_LOG
32571fi
32572exec $CVS_SERVER "\$@"
32573EOF
32574
32575	  CVS_SERVER_save=$CVS_SERVER
32576	  CVS_SERVER_secondary=$TESTDIR/writeproxy-secondary-wrapper
32577	  CVS_SERVER=$CVS_SERVER_secondary
32578
32579	  chmod a+x $TESTDIR/writeproxy-secondary-wrapper \
32580	            $TESTDIR/writeproxy-primary-wrapper
32581
32582	  # Checkout from secondary
32583	  #
32584	  # For now, move the primary root out of the way to satisfy
32585	  # ourselves that the data is coming from the secondary.
32586	  mv $PRIMARY_CVSROOT_DIRNAME $TESTDIR/save-root
32587
32588	  # Checkin to secondary
32589	  cd ../..
32590	  dotest writeproxy-ssh-noredirect-1 \
32591"$testcvs -qd '$SECONDARY_CVSROOT' co -ldtop ."
32592
32593	  cd top
32594	  mkdir firstdir
32595
32596	  # Have to move the primary root back before we can perform write
32597	  # operations.
32598	  mv $TESTDIR/save-root $PRIMARY_CVSROOT_DIRNAME
32599
32600	  dotest writeproxy-ssh-noredirect-2 "$testcvs -Q add firstdir" \
32601"Referrer=NONE"
32602
32603	  cd firstdir
32604	  echo now you see me >file1
32605	  dotest writeproxy-ssh-noredirect-3 "$testcvs -Q add file1"
32606	  dotest writeproxy-ssh-noredirect-4 \
32607"$testcvs -Q ci -mfirst-file file1" \
32608"Referrer=NONE"
32609
32610	  dokeep
32611	  cd ../../..
32612	  rm -r writeproxy-ssh-noredirect
32613	  rm -rf $PRIMARY_CVSROOT_DIRNAME $SECONDARY_CVSROOT_DIRNAME
32614	  PRIMARY_CVSROOT_DIRNAME=$PRIMARY_CVSROOT_DIRNAME_save
32615	  PRIMARY_CVSROOT=$PRIMARY_CVSROOT_save
32616	  SECONDARY_CVSROOT_DIRNAME=$SECONDARY_CVSROOT_DIRNAME_save
32617	  SECONDARY_CVSROOT=$SECONDARY_CVSROOT_save
32618	  rm $TESTDIR/writeproxy-secondary-wrapper \
32619	     $TESTDIR/writeproxy-primary-wrapper
32620	  CVS_SERVER=$CVS_SERVER_save
32621	  ;;
32622
32623
32624
32625	trace)
32626	  # Check that there are no core dumps lurking in the trace
32627	  # options.
32628
32629	  # Perform some cleanup for normalized testing...
32630	  rm ${CVSROOT_DIRNAME}/CVSROOT/history
32631	  rm -f ${CVSROOT_DIRNAME}/CVSROOT/cvsignore
32632	  rm -f ${CVSROOT_DIRNAME}/CVSROOT/cvsignore,v
32633
32634	  # checkout the trace option
32635
32636	  mkdir trace && cd trace
32637	  mkdir imp && cd imp
32638	  touch file1
32639
32640	  dotest_sort trace-1 "${testcvs} -t -t -t init" \
32641"  *-> Lock_Cleanup()
32642  *-> RCS_checkout (access,v, , , , \.#[0-9][0-9]*)
32643  *-> RCS_checkout (aclconfig,v, , , , \.#[0-9][0-9]*)
32644  *-> RCS_checkout (checkoutlist,v, , , , \.#[0-9][0-9]*)
32645  *-> RCS_checkout (commitinfo,v, , , , \.#[0-9][0-9]*)
32646  *-> RCS_checkout (config,v, , , , \.#[0-9][0-9]*)
32647  *-> RCS_checkout (cvswrappers,v, , , , \.#[0-9][0-9]*)
32648  *-> RCS_checkout (group,v, , , , \.#[0-9][0-9]*)
32649  *-> RCS_checkout (loginfo,v, , , , \.#[0-9][0-9]*)
32650  *-> RCS_checkout (modules,v, , , , \.#[0-9][0-9]*)
32651  *-> RCS_checkout (notify,v, , , , \.#[0-9][0-9]*)
32652  *-> RCS_checkout (postadmin,v, , , , \.#[0-9][0-9]*)
32653  *-> RCS_checkout (postproxy,v, , , , \.#[0-9][0-9]*)
32654  *-> RCS_checkout (posttag,v, , , , \.#[0-9][0-9]*)
32655  *-> RCS_checkout (postwatch,v, , , , \.#[0-9][0-9]*)
32656  *-> RCS_checkout (preproxy,v, , , , \.#[0-9][0-9]*)
32657  *-> RCS_checkout (rcsinfo,v, , , , \.#[0-9][0-9]*)
32658  *-> RCS_checkout (taginfo,v, , , , \.#[0-9][0-9]*)
32659  *-> RCS_checkout (verifymsg,v, , , , \.#[0-9][0-9]*)
32660  *-> Simple_Lock_Cleanup()
32661  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
32662  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
32663  *-> remove_locks()
32664  *-> unlink_file(\.#[0-9][0-9]*)
32665  *-> unlink_file(\.#[0-9][0-9]*)
32666  *-> unlink_file(\.#[0-9][0-9]*)
32667  *-> unlink_file(\.#[0-9][0-9]*)
32668  *-> unlink_file(\.#[0-9][0-9]*)
32669  *-> unlink_file(\.#[0-9][0-9]*)
32670  *-> unlink_file(\.#[0-9][0-9]*)
32671  *-> unlink_file(\.#[0-9][0-9]*)
32672  *-> unlink_file(\.#[0-9][0-9]*)
32673  *-> unlink_file(\.#[0-9][0-9]*)
32674  *-> unlink_file(\.#[0-9][0-9]*)
32675  *-> unlink_file(\.#[0-9][0-9]*)
32676  *-> unlink_file(\.#[0-9][0-9]*)
32677  *-> unlink_file(\.#access)
32678  *-> unlink_file(\.#aclconfig)
32679  *-> unlink_file(\.#checkoutlist)
32680  *-> unlink_file(\.#commitinfo)
32681  *-> unlink_file(\.#config)
32682  *-> unlink_file(\.#cvswrappers)
32683  *-> unlink_file(\.#group)
32684  *-> unlink_file(\.#loginfo)
32685  *-> unlink_file(\.#modules)
32686  *-> unlink_file(\.#notify)
32687  *-> unlink_file(\.#postadmin)
32688  *-> unlink_file(\.#postproxy)
32689  *-> unlink_file(\.#posttag)
32690  *-> unlink_file(\.#postwatch)
32691  *-> unlink_file(\.#preproxy)
32692  *-> unlink_file(\.#rcsinfo)
32693  *-> unlink_file(\.#taginfo)
32694  *-> unlink_file(\.#verifymsg)
32695  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32696  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )" \
32697"
32698  *-> Forking server: ${CVS_SERVER} server
32699  *-> main loop with CVSROOT=${CVSROOT}
32700  *-> parse_cvsroot ( ${CVSROOT} )
32701  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32702  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32703  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32704S -> CVS_SERVER_SLEEP not set\.
32705S -> Lock_Cleanup()
32706S -> Lock_Cleanup()
32707S -> RCS_checkout (access,v, , , , \.#[0-9][0-9]*)
32708S -> RCS_checkout (aclconfig,v, , , , \.#[0-9][0-9]*)
32709S -> RCS_checkout (checkoutlist,v, , , , \.#[0-9][0-9]*)
32710S -> RCS_checkout (commitinfo,v, , , , \.#[0-9][0-9]*)
32711S -> RCS_checkout (config,v, , , , \.#[0-9][0-9]*)
32712S -> RCS_checkout (cvswrappers,v, , , , \.#[0-9][0-9]*)
32713S -> RCS_checkout (group,v, , , , \.#[0-9][0-9]*)
32714S -> RCS_checkout (loginfo,v, , , , \.#[0-9][0-9]*)
32715S -> RCS_checkout (modules,v, , , , \.#[0-9][0-9]*)
32716S -> RCS_checkout (notify,v, , , , \.#[0-9][0-9]*)
32717S -> RCS_checkout (postadmin,v, , , , \.#[0-9][0-9]*)
32718S -> RCS_checkout (postproxy,v, , , , \.#[0-9][0-9]*)
32719S -> RCS_checkout (posttag,v, , , , \.#[0-9][0-9]*)
32720S -> RCS_checkout (postwatch,v, , , , \.#[0-9][0-9]*)
32721S -> RCS_checkout (preproxy,v, , , , \.#[0-9][0-9]*)
32722S -> RCS_checkout (rcsinfo,v, , , , \.#[0-9][0-9]*)
32723S -> RCS_checkout (taginfo,v, , , , \.#[0-9][0-9]*)
32724S -> RCS_checkout (verifymsg,v, , , , \.#[0-9][0-9]*)
32725S -> Simple_Lock_Cleanup()
32726S -> Simple_Lock_Cleanup()
32727S -> do_cvs_command (init)
32728S -> remove_locks()
32729S -> remove_locks()
32730S -> server_cleanup()
32731S -> server_cleanup()
32732S -> server_notify()
32733S -> unlink_file(\.#[0-9][0-9]*)
32734S -> unlink_file(\.#[0-9][0-9]*)
32735S -> unlink_file(\.#[0-9][0-9]*)
32736S -> unlink_file(\.#[0-9][0-9]*)
32737S -> unlink_file(\.#[0-9][0-9]*)
32738S -> unlink_file(\.#[0-9][0-9]*)
32739S -> unlink_file(\.#[0-9][0-9]*)
32740S -> unlink_file(\.#[0-9][0-9]*)
32741S -> unlink_file(\.#[0-9][0-9]*)
32742S -> unlink_file(\.#[0-9][0-9]*)
32743S -> unlink_file(\.#[0-9][0-9]*)
32744S -> unlink_file(\.#[0-9][0-9]*)
32745S -> unlink_file(\.#[0-9][0-9]*)
32746S -> unlink_file(\.#access)
32747S -> unlink_file(\.#aclconfig)
32748S -> unlink_file(\.#checkoutlist)
32749S -> unlink_file(\.#commitinfo)
32750S -> unlink_file(\.#config)
32751S -> unlink_file(\.#cvswrappers)
32752S -> unlink_file(\.#group)
32753S -> unlink_file(\.#loginfo)
32754S -> unlink_file(\.#modules)
32755S -> unlink_file(\.#notify)
32756S -> unlink_file(\.#postadmin)
32757S -> unlink_file(\.#postproxy)
32758S -> unlink_file(\.#posttag)
32759S -> unlink_file(\.#postwatch)
32760S -> unlink_file(\.#preproxy)
32761S -> unlink_file(\.#rcsinfo)
32762S -> unlink_file(\.#taginfo)
32763S -> unlink_file(\.#verifymsg)" \
32764
32765	  dotest_sort trace-2 \
32766"${testcvs} -t -t -t import -mimport trace MYVENDOR version-1" \
32767"
32768
32769  *-> Lock_Cleanup()
32770  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/loginfo, trace, ALL)
32771  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/verifymsg, trace, not ALL)
32772  *-> Simple_Lock_Cleanup()
32773  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
32774  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
32775  *-> remove_locks()
32776  *-> safe_location( where=(null) )
32777  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32778  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32779N trace/file1
32780No conflicts created by this import" \
32781"
32782
32783
32784  *-> Forking server: ${CVS_SERVER} server
32785  *-> Sending file \`file1' to server
32786  *-> main loop with CVSROOT=${CVSROOT}
32787  *-> parse_cvsroot ( ${CVSROOT} )
32788  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32789  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32790  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32791N trace/file1
32792No conflicts created by this import
32793S -> CVS_SERVER_SLEEP not set\.
32794S -> Lock_Cleanup()
32795S -> Lock_Cleanup()
32796S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/loginfo, trace, ALL)
32797S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/verifymsg, trace, not ALL)
32798S -> Simple_Lock_Cleanup()
32799S -> Simple_Lock_Cleanup()
32800S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
32801S -> do_cvs_command (import)
32802S -> remove_locks()
32803S -> remove_locks()
32804S -> safe_location( where=(null) )
32805S -> serve_directory (\.)
32806S -> server_cleanup()
32807S -> server_cleanup()
32808S -> server_notify()"
32809
32810	  cd ..
32811	  rm -fr imp
32812
32813	  dotest_sort trace-3 "${testcvs} -t -t -t co trace" \
32814"  *callerdat=${PFMT}, argc=0, argv=${PFMT},
32815  *direntproc=${PFMT}, dirleavproc=${PFMT},
32816  *dosrcs=1, repository_in=${CVSROOT_DIRNAME}/trace )
32817  *local=0, which=3, aflag=0,
32818  *locktype=1, update_preload=trace
32819  *-> Create_Admin
32820  *-> Create_Admin (\., trace, ${CVSROOT_DIRNAME}/trace, , , 0, 0, 1)
32821  *-> Leaving do_recursion ( frame=${PFMT} )
32822  *-> Leaving do_recursion ( frame=${PFMT} )
32823  *-> Lock_Cleanup()
32824  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, , , file1)
32825  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
32826  *-> Register(file1, 1\.1\.1\.1, ${DATE}, ,  )
32827  *-> Simple_Lock_Cleanup()
32828  *-> Simple_Lock_Cleanup()
32829  *-> Write_Template (trace, ${CVSROOT_DIRNAME}/trace)
32830  *-> chmod(file1,[0-7][0-7]*)
32831  *-> do_module (trace, Updating, NULL, NULL)
32832  *-> do_recursion ( frame=${PFMT} )
32833  *-> do_recursion ( frame=${PFMT} )
32834  *-> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
32835  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
32836  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
32837  *-> lock_simple_remove()
32838  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
32839  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
32840  *-> remove_locks()
32841  *-> rename(CVS/Entries\.Backup,CVS/Entries)
32842  *-> safe_location( where=(null) )
32843  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
32844  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
32845  *-> unlink_file(\./CVS/Entries\.Static)
32846  *-> unlink_file(\./CVS/Tag)
32847  *-> unlink_file(CVS/Entries\.Log)
32848  *-> unlink_file_dir(CVS/,,file1)
32849  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32850  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32851  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32852  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32853  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32854  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32855  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32856U trace/file1
32857${SPROG} checkout: Updating trace" \
32858"
32859  *callerdat=${PFMT}, argc=0, argv=${PFMT},
32860  *direntproc=${PFMT}, dirleavproc=${PFMT},
32861  *dosrcs=1, repository_in=${CVSROOT_DIRNAME}/trace )
32862  *local=0, which=3, aflag=0,
32863  *locktype=1, update_preload=trace
32864  *-> Create_Admin
32865  *-> Create_Admin (trace, trace, ${CVSROOT_DIRNAME}/trace, , , 0, 0, 1)
32866  *-> Forking server: ${CVS_SERVER} server
32867  *-> Register(file1, 1\.1\.1\.1, ${DATE}, ,  )
32868  *-> main loop with CVSROOT=${CVSROOT}
32869  *-> parse_cvsroot ( ${CVSROOT} )
32870  *-> rename(\.new\.file1,file1)
32871  *-> rename(CVS/Entries\.Backup,CVS/Entries)
32872  *-> safe_location( where=(null) )
32873  *-> unlink_file(CVS/Entries\.Log)
32874  *-> unlink_file(CVS/Entries\.Static)
32875  *-> unlink_file(CVS/Tag)
32876  *-> unlink_file(CVS/Template)
32877  *-> unlink_file(trace/CVS/Tag)
32878  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32879  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32880  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32881  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32882S -> CVS_SERVER_SLEEP not set\.
32883S -> Create_Admin
32884S -> Create_Admin (\., trace, ${CVSROOT_DIRNAME}/trace, , , 0, 0, 1)
32885S -> Leaving do_recursion ( frame=${PFMT} )
32886S -> Leaving do_recursion ( frame=${PFMT} )
32887S -> Lock_Cleanup()
32888S -> Lock_Cleanup()
32889S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/rcsinfo, trace, ALL)
32890S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, , , (function))
32891S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
32892S -> Register(file1, 1\.1\.1\.1, , ,  )
32893S -> Simple_Lock_Cleanup()
32894S -> Simple_Lock_Cleanup()
32895S -> Simple_Lock_Cleanup()
32896S -> Write_Template (trace, ${CVSROOT_DIRNAME}/trace)
32897S -> dirswitch (\., ${CVSROOT_DIRNAME})
32898S -> dirswitch (\., ${CVSROOT_DIRNAME})
32899S -> do_cvs_command (checkout)
32900S -> do_module (trace, Updating, NULL, NULL)
32901S -> do_module (trace, Updating, NULL, NULL)
32902S -> do_recursion ( frame=${PFMT} )
32903S -> do_recursion ( frame=${PFMT} )
32904S -> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
32905S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
32906S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
32907S -> lock_simple_remove()
32908S -> remove_locks()
32909S -> remove_locks()
32910S -> rename(CVS/Entries\.Backup,CVS/Entries)
32911S -> safe_location( where=(null) )
32912S -> serve_directory (\.)
32913S -> serve_directory (\.)
32914S -> server_cleanup()
32915S -> server_cleanup()
32916S -> server_notify()
32917S -> server_register(file1, 1\.1\.1\.1, , , , , )
32918S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
32919S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
32920S -> unlink_file(\./CVS/Entries\.Static)
32921S -> unlink_file(\./CVS/Tag)
32922S -> unlink_file(CVS/Entries\.Log)
32923S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32924S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32925S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32926S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32927S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32928U trace/file1
32929${SPROG} checkout: Updating trace"
32930
32931	  cd trace
32932	  mkdir subdir
32933	  dotest_sort trace-4 "${testcvs} -t -t -t add subdir" \
32934"  *-> Create_Admin
32935  *-> Create_Admin (\., subdir, ${CVSROOT_DIRNAME}/trace/subdir, , , 0, 0, 1)
32936  *-> Lock_Cleanup()
32937  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/loginfo, trace/subdir, ALL)
32938  *-> Simple_Lock_Cleanup()
32939  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
32940  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
32941  *-> remove_locks()
32942  *-> rename(CVS/Entries\.Backup,CVS/Entries)
32943  *-> unlink_file(\./CVS/Tag)
32944  *-> unlink_file(${CVSROOT_DIRNAME}/trace/subdir/CVS/fileattr)
32945  *-> unlink_file(CVS/Entries\.Log)
32946  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32947  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32948  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32949Directory ${CVSROOT_DIRNAME}/trace/subdir added to the repository" \
32950"
32951  *callerdat=${PFMT}, argc=1, argv=${PFMT},
32952  *direntproc=${PFMT}, dirleavproc=${PFMT},
32953  *dosrcs=0, repository_in=(null) )
32954  *local=0, which=1, aflag=0,
32955  *locktype=0, update_preload=(null)
32956  *-> Create_Admin
32957  *-> Create_Admin (subdir, subdir, ${CVSROOT_DIRNAME}/trace/subdir, , , 0, 0, 1)
32958  *-> Forking server: ${CVS_SERVER} server
32959  *-> Leaving do_recursion ( frame=${PFMT} )
32960  *-> Leaving do_recursion ( frame=${PFMT} )
32961  *-> do_recursion ( frame=${PFMT} )
32962  *-> do_recursion ( frame=${PFMT} )
32963  *-> main loop with CVSROOT=${CVSROOT}
32964  *-> parse_cvsroot ( ${CVSROOT} )
32965  *-> rename(CVS/Entries\.Backup,CVS/Entries)
32966${DOTSTAR}  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
32967  *-> unlink_file(CVS/Entries\.Log)
32968${DOTSTAR}  *-> unlink_file(CVS/Template)
32969  *-> unlink_file(subdir/CVS/Tag)
32970  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32971  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32972  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32973  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32974  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32975  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32976  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32977  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32978  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32979  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32980  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
32981${DOTSTAR}Directory ${CVSROOT_DIRNAME}/trace/subdir added to the repository
32982S -> CVS_SERVER_SLEEP not set\.
32983S -> Lock_Cleanup()
32984S -> Lock_Cleanup()
32985S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/loginfo, trace/subdir, ALL)
32986S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/rcsinfo, trace/subdir, ALL)
32987S -> Simple_Lock_Cleanup()
32988S -> Simple_Lock_Cleanup()
32989S -> Write_Template (subdir, ${CVSROOT_DIRNAME}/trace/subdir)
32990S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
32991S -> dirswitch (subdir, ${CVSROOT_DIRNAME}/trace/subdir)
32992S -> do_cvs_command (add)
32993S -> remove_locks()
32994S -> remove_locks()
32995S -> rename(CVS/Entries\.Backup,CVS/Entries)
32996S -> rename(CVS/Entries\.Backup,CVS/Entries)
32997S -> serve_directory (\.)
32998S -> serve_directory (subdir)
32999S -> server_cleanup()
33000S -> server_cleanup()
33001S -> server_notify()
33002S -> unlink_file(${CVSROOT_DIRNAME}/trace/subdir/CVS/fileattr)
33003S -> unlink_file(CVS/Entries\.Log)
33004S -> unlink_file(CVS/Entries\.Log)
33005S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33006S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )"
33007	  touch file2
33008	  dotest_sort trace-5 "${testcvs} -t -t -t add file2" \
33009"  *-> Lock_Cleanup()
33010  *-> Register(file2, 0, Initial file2, ,  )
33011  *-> Simple_Lock_Cleanup()
33012  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
33013  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
33014  *-> remove_locks()
33015  *-> rename(CVS/Entries\.Backup,CVS/Entries)
33016  *-> unlink_file(CVS/Entries\.Log)
33017  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33018  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33019  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33020${SPROG} add: scheduling file \`file2' for addition
33021${SPROG} add: use \`${SPROG} commit' to add this file permanently" \
33022"
33023  *callerdat=${PFMT}, argc=1, argv=${PFMT},
33024  *direntproc=${PFMT}, dirleavproc=${PFMT},
33025  *dosrcs=0, repository_in=(null) )
33026  *local=0, which=1, aflag=0,
33027  *locktype=0, update_preload=(null)
33028  *-> Forking server: ${CVS_SERVER} server
33029  *-> Leaving do_recursion ( frame=${PFMT} )
33030  *-> Register(file2, 0, dummy timestamp, ,  )
33031  *-> do_recursion ( frame=${PFMT} )
33032  *-> main loop with CVSROOT=${CVSROOT}
33033  *-> parse_cvsroot ( ${CVSROOT} )
33034  *-> rename(CVS/Entries\.Backup,CVS/Entries)
33035${DOTSTAR}  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33036  *-> unlink_file(CVS/Entries\.Log)
33037${DOTSTAR}  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33038  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33039  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33040  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33041  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33042  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33043  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33044${DOTSTAR}S -> CVS_SERVER_SLEEP not set\.
33045S -> Lock_Cleanup()
33046S -> Lock_Cleanup()
33047S -> Register(file2, 0, Initial file2, ,  )
33048S -> Simple_Lock_Cleanup()
33049S -> Simple_Lock_Cleanup()
33050S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
33051S -> do_cvs_command (add)
33052S -> remove_locks()
33053S -> remove_locks()
33054S -> rename(CVS/Entries\.Backup,CVS/Entries)
33055S -> serve_directory (\.)
33056S -> server_cleanup()
33057S -> server_cleanup()
33058S -> server_notify()
33059S -> server_register(file2, 0, Initial file2, , , , )
33060S -> unlink_file(CVS/Entries\.Log)
33061S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33062${SPROG} add: scheduling file \`file2' for addition
33063${SPROG} add: use \`${SPROG} commit' to add this file permanently"
33064	  dotest_sort trace-6 "${testcvs} -t -t -t ci -mnew-file file2" \
33065"  *callerdat=${PFMT}, argc=1, argv=${PFMT},
33066  *callerdat=${PFMT}, argc=1, argv=${PFMT},
33067  *callerdat=${PFMT}, argc=1, argv=${PFMT},
33068  *direntproc=${PFMT}, dirleavproc=${PFMT},
33069  *direntproc=${PFMT}, dirleavproc=${PFMT},
33070  *direntproc=${PFMT}, dirleavproc=${PFMT},
33071  *dosrcs=0, repository_in=(null) )
33072  *dosrcs=1, repository_in=(null) )
33073  *dosrcs=1, repository_in=(null) )
33074  *local=0, which=1, aflag=0,
33075  *local=0, which=1, aflag=0,
33076  *local=0, which=1, aflag=0,
33077  *locktype=0, update_preload=(null)
33078  *locktype=0, update_preload=(null)
33079  *locktype=2, update_preload=(null)
33080  *-> Leaving do_recursion ( frame=${PFMT} )
33081  *-> Leaving do_recursion ( frame=${PFMT} )
33082  *-> Leaving do_recursion ( frame=${PFMT} )
33083  *-> Lock_Cleanup()
33084  *-> Lock_Cleanup()
33085  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/commitinfo, trace, ALL)
33086  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/loginfo, trace, ALL)
33087  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/verifymsg, trace, not ALL)
33088  *-> Promotable_Lock ()
33089  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file2,v, 1, , , (function))
33090  *-> RCS_cmp_file( ${CVSROOT_DIRNAME}/trace/file2,v, 1, (null), , file2 )
33091  *-> Register(file2, 1\.1, ${DATE}, ,  )
33092  *-> Simple_Lock_Cleanup()
33093  *-> Simple_Lock_Cleanup()
33094  *-> Simple_Lock_Cleanup()
33095  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
33096  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
33097  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33098  *-> do_recursion ( frame=${PFMT} )
33099  *-> do_recursion ( frame=${PFMT} )
33100  *-> do_recursion ( frame=${PFMT} )
33101  *-> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
33102  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
33103  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33104  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33105  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33106  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
33107  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33108  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
33109  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
33110  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
33111  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
33112  *-> lock_simple_remove()
33113  *-> lock_simple_remove()
33114  *-> lock_tree_promotably (1, argv, 0, 1, 0)
33115  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
33116  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
33117  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
33118  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
33119  *-> promotable_lock(${CVSROOT_DIRNAME}/trace)
33120  *-> rcs_cleanup()
33121  *-> readers_exist (${CVSROOT_DIRNAME}/trace)
33122  *-> remove_locks()
33123  *-> remove_locks()
33124  *-> rename(${CVSROOT_DIRNAME}/trace/,file2,,${CVSROOT_DIRNAME}/trace/file2,v)
33125  *-> rename(${CVSROOT_DIRNAME}/trace/,file2,,${CVSROOT_DIRNAME}/trace/file2,v)
33126  *-> rename(CVS/Entries\.Backup,CVS/Entries)
33127  *-> set_lock (${CVSROOT_DIRNAME}/trace, 0)
33128  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33129  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33130  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33131  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33132  *-> unlink_file(CVS/Base/file2)
33133  *-> unlink_file(CVS/Entries\.Log)
33134  *-> unlink_file(CVS/file2,t)
33135  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33136  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33137  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33138  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33139  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33140  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33141  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33142  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33143  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33144  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33145  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33146  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33147  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33148  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33149  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33150  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33151  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33152  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33153  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33154${CVSROOT_DIRNAME}/trace/file2,v  <--  file2
33155initial revision: 1\.1" \
33156"
33157  *callerdat=${PFMT}, argc=1, argv=${PFMT},
33158  *callerdat=${PFMT}, argc=1, argv=${PFMT},
33159  *callerdat=${PFMT}, argc=1, argv=${PFMT},
33160  *callerdat=${PFMT}, argc=1, argv=${PFMT},
33161  *callerdat=${PFMT}, argc=1, argv=${PFMT},
33162  *direntproc=${PFMT}, dirleavproc=${PFMT},
33163  *direntproc=${PFMT}, dirleavproc=${PFMT},
33164  *direntproc=${PFMT}, dirleavproc=${PFMT},
33165  *direntproc=${PFMT}, dirleavproc=${PFMT},
33166  *direntproc=${PFMT}, dirleavproc=${PFMT},
33167  *dosrcs=0, repository_in=(null) )
33168  *dosrcs=0, repository_in=(null) )
33169  *dosrcs=0, repository_in=(null) )
33170  *dosrcs=1, repository_in=(null) )
33171  *dosrcs=1, repository_in=(null) )
33172  *local=0, which=1, aflag=0,
33173  *local=0, which=1, aflag=0,
33174  *local=0, which=1, aflag=0,
33175  *local=0, which=1, aflag=0,
33176  *local=0, which=1, aflag=0,
33177  *locktype=0, update_preload=(null)
33178  *locktype=0, update_preload=(null)
33179  *locktype=0, update_preload=(null)
33180  *locktype=0, update_preload=(null)
33181  *locktype=2, update_preload=(null)
33182  *-> Forking server: ${CVS_SERVER} server
33183  *-> Leaving do_recursion ( frame=${PFMT} )
33184  *-> Leaving do_recursion ( frame=${PFMT} )
33185  *-> Register(file2, 1\.1, ${DATE}, ,  )
33186  *-> Sending file \`file2' to server
33187  *-> do_recursion ( frame=${PFMT} )
33188  *-> do_recursion ( frame=${PFMT} )
33189  *-> main loop with CVSROOT=${CVSROOT}
33190  *-> parse_cvsroot ( ${CVSROOT} )
33191  *-> rename(CVS/Entries\.Backup,CVS/Entries)
33192  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33193  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33194  *-> unlink_file(CVS/Base/file2)
33195  *-> unlink_file(CVS/Entries\.Log)
33196  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33197  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33198  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33199  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33200  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33201  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33202  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33203  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33204  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33205  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33206${CVSROOT_DIRNAME}/trace/file2,v  <--  file2
33207S -> CVS_SERVER_SLEEP not set\.
33208S -> Leaving do_recursion ( frame=${PFMT} )
33209S -> Leaving do_recursion ( frame=${PFMT} )
33210S -> Leaving do_recursion ( frame=${PFMT} )
33211S -> Lock_Cleanup()
33212S -> Lock_Cleanup()
33213S -> Lock_Cleanup()
33214S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/commitinfo, trace, ALL)
33215S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/loginfo, trace, ALL)
33216S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/verifymsg, trace, not ALL)
33217S -> Promotable_Lock ()
33218S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file2,v, 1, , , (function))
33219S -> RCS_cmp_file( ${CVSROOT_DIRNAME}/trace/file2,v, 1, (null), , file2 )
33220S -> Register(file2, 1\.1, ${DATE}, ,  )
33221S -> Simple_Lock_Cleanup()
33222S -> Simple_Lock_Cleanup()
33223S -> Simple_Lock_Cleanup()
33224S -> Simple_Lock_Cleanup()
33225S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
33226S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
33227S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33228S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
33229S -> do_cvs_command (commit)
33230S -> do_recursion ( frame=${PFMT} )
33231S -> do_recursion ( frame=${PFMT} )
33232S -> do_recursion ( frame=${PFMT} )
33233S -> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
33234S -> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
33235S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33236S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33237S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33238S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
33239S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33240S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
33241S -> lock_name (${CVSROOT_DIRNAME}/trace, )
33242S -> lock_name (${CVSROOT_DIRNAME}/trace, )
33243S -> lock_name (${CVSROOT_DIRNAME}/trace, )
33244S -> lock_simple_remove()
33245S -> lock_simple_remove()
33246S -> lock_tree_promotably (1, argv, 0, 1, 0)
33247S -> promotable_exists (${CVSROOT_DIRNAME}/trace)
33248S -> promotable_exists (${CVSROOT_DIRNAME}/trace)
33249S -> promotable_lock(${CVSROOT_DIRNAME}/trace)
33250S -> rcs_cleanup()
33251S -> readers_exist (${CVSROOT_DIRNAME}/trace)
33252S -> remove_locks()
33253S -> remove_locks()
33254S -> remove_locks()
33255S -> rename(${CVSROOT_DIRNAME}/trace/,file2,,${CVSROOT_DIRNAME}/trace/file2,v)
33256S -> rename(${CVSROOT_DIRNAME}/trace/,file2,,${CVSROOT_DIRNAME}/trace/file2,v)
33257S -> rename(CVS/Entries\.Backup,CVS/Entries)
33258S -> serve_directory (\.)
33259S -> server_cleanup()
33260S -> server_cleanup()
33261S -> server_notify()
33262S -> server_pathname_check (file2)
33263S -> server_pathname_check (file2)
33264S -> server_pathname_check (file2)
33265S -> server_register(file2, 1\.1, ${DATE}, , , , )
33266S -> set_lock (${CVSROOT_DIRNAME}/trace, 0)
33267S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33268S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33269S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33270S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33271S -> unlink_file(CVS/Entries\.Log)
33272S -> unlink_file(CVS/file2,t)
33273S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33274S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33275S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33276S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33277S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33278S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33279S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33280S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33281S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33282S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33283S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33284S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33285S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33286S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33287S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33288S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33289S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33290initial revision: 1\.1"
33291	  dotest_sort trace-7 "${testcvs} -t -t -t tag bp" \
33292"  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33293  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33294  *direntproc=${PFMT}, dirleavproc=${PFMT},
33295  *direntproc=${PFMT}, dirleavproc=${PFMT},
33296  *dosrcs=1, repository_in= )
33297  *dosrcs=1, repository_in= )
33298  *local=0, which=1, aflag=0,
33299  *local=0, which=1, aflag=0,
33300  *locktype=1, update_preload=(null)
33301  *locktype=2, update_preload=(null)
33302  *local_specified=0, mname=(null), msg=(null) )
33303  *mwhere=(null), mfile=(null), shorten=0,
33304  *-> Leaving do_recursion ( frame=${PFMT} )
33305  *-> Leaving do_recursion ( frame=${PFMT} )
33306  *-> Leaving do_recursion ( frame=${PFMT} )
33307  *-> Leaving do_recursion ( frame=${PFMT} )
33308  *-> Leaving do_recursion ( frame=${PFMT} )
33309  *-> Leaving do_recursion ( frame=${PFMT} )
33310  *-> Lock_Cleanup()
33311  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/taginfo, trace, ALL)
33312  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
33313  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace/subdir)
33314  *-> Simple_Lock_Cleanup()
33315  *-> Simple_Lock_Cleanup()
33316  *-> Simple_Lock_Cleanup()
33317  *-> Simple_Lock_Cleanup()
33318  *-> Simple_Lock_Cleanup()
33319  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, (null))
33320  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, (null))
33321  *-> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.pfl\.\*, (null))
33322  *-> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.\*, (null))
33323  *-> check_fileproc ( ${CVSROOT_DIRNAME}/trace, file1, ${CVSROOT_DIRNAME}/trace/file1,v )
33324  *-> check_fileproc ( ${CVSROOT_DIRNAME}/trace, file2, ${CVSROOT_DIRNAME}/trace/file2,v )
33325  *-> do_recursion ( frame=${PFMT} )
33326  *-> do_recursion ( frame=${PFMT} )
33327  *-> do_recursion ( frame=${PFMT} )
33328  *-> do_recursion ( frame=${PFMT} )
33329  *-> do_recursion ( frame=${PFMT} )
33330  *-> do_recursion ( frame=${PFMT} )
33331  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
33332  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace/subdir)
33333  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33334  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33335  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33336  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33337  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
33338  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
33339  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
33340  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33341  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33342  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33343  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33344  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
33345  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
33346  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
33347  *-> lock_simple_remove()
33348  *-> lock_simple_remove()
33349  *-> lock_simple_remove()
33350  *-> lock_simple_remove()
33351  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
33352  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
33353  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
33354  *-> promotable_exists (${CVSROOT_DIRNAME}/trace/subdir)
33355  *-> rcs_cleanup()
33356  *-> readers_exist (${CVSROOT_DIRNAME}/trace)
33357  *-> readers_exist (${CVSROOT_DIRNAME}/trace/subdir)
33358  *-> remove_locks()
33359  *-> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
33360  *-> rename(${CVSROOT_DIRNAME}/trace/,file2,,${CVSROOT_DIRNAME}/trace/file2,v)
33361  *-> rename(CVS/Entries\.Backup,CVS/Entries)
33362  *-> rtag_proc ( argc=1, argv=${PFMT}, xwhere=(null),
33363  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33364  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33365  *-> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
33366  *-> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
33367  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33368  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33369  *-> unlink_file(CVS/Entries\.Log)
33370  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33371  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33372  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33373  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33374  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33375  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33376  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33377  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33378  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33379  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33380  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33381  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33382  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33383  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33384  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33385  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33386  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33387  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33388  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33389  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33390  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33391  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33392  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33393  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33394  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33395  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33396  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33397  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33398  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33399T file1
33400T file2
33401${SPROG} tag: Tagging \.
33402${SPROG} tag: Tagging subdir" \
33403"
33404  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33405  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33406  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33407  *direntproc=${PFMT}, dirleavproc=${PFMT},
33408  *direntproc=${PFMT}, dirleavproc=${PFMT},
33409  *direntproc=${PFMT}, dirleavproc=${PFMT},
33410  *dosrcs=0, repository_in=(null) )
33411  *dosrcs=1, repository_in= )
33412  *dosrcs=1, repository_in= )
33413  *local=0, which=1, aflag=0,
33414  *local=0, which=1, aflag=0,
33415  *local=0, which=1, aflag=0,
33416  *locktype=0, update_preload=(null)
33417  *locktype=1, update_preload=(null)
33418  *locktype=2, update_preload=(null)
33419  *local_specified=0, mname=(null), msg=(null) )
33420  *mwhere=(null), mfile=(null), shorten=0,
33421  *-> Forking server: ${CVS_SERVER} server
33422  *-> Leaving do_recursion ( frame=${PFMT} )
33423  *-> Leaving do_recursion ( frame=${PFMT} )
33424  *-> Leaving do_recursion ( frame=${PFMT} )
33425  *-> do_recursion ( frame=${PFMT} )
33426  *-> do_recursion ( frame=${PFMT} )
33427  *-> do_recursion ( frame=${PFMT} )
33428  *-> main loop with CVSROOT=${CVSROOT}
33429  *-> parse_cvsroot ( ${CVSROOT} )
33430  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33431  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33432  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33433  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33434  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33435  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33436  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33437  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33438  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33439  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33440  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33441  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33442  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33443S -> CVS_SERVER_SLEEP not set\.
33444S -> Leaving do_recursion ( frame=${PFMT} )
33445S -> Leaving do_recursion ( frame=${PFMT} )
33446S -> Leaving do_recursion ( frame=${PFMT} )
33447S -> Leaving do_recursion ( frame=${PFMT} )
33448S -> Leaving do_recursion ( frame=${PFMT} )
33449S -> Leaving do_recursion ( frame=${PFMT} )
33450S -> Lock_Cleanup()
33451S -> Lock_Cleanup()
33452S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/taginfo, trace, ALL)
33453S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
33454S -> Reader_Lock(${CVSROOT_DIRNAME}/trace/subdir)
33455S -> Simple_Lock_Cleanup()
33456S -> Simple_Lock_Cleanup()
33457S -> Simple_Lock_Cleanup()
33458S -> Simple_Lock_Cleanup()
33459S -> Simple_Lock_Cleanup()
33460S -> Simple_Lock_Cleanup()
33461S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, (null))
33462S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, (null))
33463S -> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.pfl\.\*, (null))
33464S -> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.\*, (null))
33465S -> check_fileproc ( ${CVSROOT_DIRNAME}/trace, file1, ${CVSROOT_DIRNAME}/trace/file1,v )
33466S -> check_fileproc ( ${CVSROOT_DIRNAME}/trace, file2, ${CVSROOT_DIRNAME}/trace/file2,v )
33467S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
33468S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
33469S -> dirswitch (subdir, ${CVSROOT_DIRNAME}/trace/subdir)
33470S -> do_cvs_command (tag)
33471S -> do_recursion ( frame=${PFMT} )
33472S -> do_recursion ( frame=${PFMT} )
33473S -> do_recursion ( frame=${PFMT} )
33474S -> do_recursion ( frame=${PFMT} )
33475S -> do_recursion ( frame=${PFMT} )
33476S -> do_recursion ( frame=${PFMT} )
33477S -> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
33478S -> lock_dir_for_write (${CVSROOT_DIRNAME}/trace/subdir)
33479S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33480S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33481S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33482S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33483S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
33484S -> lock_name (${CVSROOT_DIRNAME}/trace, )
33485S -> lock_name (${CVSROOT_DIRNAME}/trace, )
33486S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33487S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33488S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33489S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33490S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
33491S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
33492S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
33493S -> lock_simple_remove()
33494S -> lock_simple_remove()
33495S -> lock_simple_remove()
33496S -> lock_simple_remove()
33497S -> promotable_exists (${CVSROOT_DIRNAME}/trace)
33498S -> promotable_exists (${CVSROOT_DIRNAME}/trace/subdir)
33499S -> rcs_cleanup()
33500S -> readers_exist (${CVSROOT_DIRNAME}/trace)
33501S -> readers_exist (${CVSROOT_DIRNAME}/trace/subdir)
33502S -> remove_locks()
33503S -> remove_locks()
33504S -> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
33505S -> rename(${CVSROOT_DIRNAME}/trace/,file2,,${CVSROOT_DIRNAME}/trace/file2,v)
33506S -> rename(CVS/Entries\.Backup,CVS/Entries)
33507S -> rename(CVS/Entries\.Backup,CVS/Entries)
33508S -> rtag_proc ( argc=1, argv=${PFMT}, xwhere=(null),
33509S -> serve_directory (\.)
33510S -> serve_directory (\.)
33511S -> serve_directory (subdir)
33512S -> server_cleanup()
33513S -> server_cleanup()
33514S -> server_notify()
33515S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33516S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33517S -> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
33518S -> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
33519S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33520S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33521S -> unlink_file(CVS/Entries\.Log)
33522S -> unlink_file(CVS/Entries\.Log)
33523S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33524S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33525S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33526S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33527S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33528S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33529S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33530S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33531S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33532S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33533S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33534S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33535S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33536S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33537S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33538S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33539S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33540S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33541S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33542S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33543S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33544S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33545S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33546S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33547S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33548S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33549S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33550S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33551T file1
33552T file2
33553${SPROG} tag: Tagging \.
33554${SPROG} tag: Tagging subdir"
33555
33556	  dotest_sort trace-8 "${testcvs} -t -t -t tag -b branch1" \
33557"  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33558  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33559  *direntproc=${PFMT}, dirleavproc=${PFMT},
33560  *direntproc=${PFMT}, dirleavproc=${PFMT},
33561  *dosrcs=1, repository_in= )
33562  *dosrcs=1, repository_in= )
33563  *local=0, which=1, aflag=0,
33564  *local=0, which=1, aflag=0,
33565  *locktype=1, update_preload=(null)
33566  *locktype=2, update_preload=(null)
33567  *local_specified=0, mname=(null), msg=(null) )
33568  *mwhere=(null), mfile=(null), shorten=0,
33569  *-> Leaving do_recursion ( frame=${PFMT} )
33570  *-> Leaving do_recursion ( frame=${PFMT} )
33571  *-> Leaving do_recursion ( frame=${PFMT} )
33572  *-> Leaving do_recursion ( frame=${PFMT} )
33573  *-> Leaving do_recursion ( frame=${PFMT} )
33574  *-> Leaving do_recursion ( frame=${PFMT} )
33575  *-> Lock_Cleanup()
33576  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/taginfo, trace, ALL)
33577  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
33578  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace/subdir)
33579  *-> Simple_Lock_Cleanup()
33580  *-> Simple_Lock_Cleanup()
33581  *-> Simple_Lock_Cleanup()
33582  *-> Simple_Lock_Cleanup()
33583  *-> Simple_Lock_Cleanup()
33584  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, (null))
33585  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, (null))
33586  *-> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.pfl\.\*, (null))
33587  *-> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.\*, (null))
33588  *-> check_fileproc ( ${CVSROOT_DIRNAME}/trace, file1, ${CVSROOT_DIRNAME}/trace/file1,v )
33589  *-> check_fileproc ( ${CVSROOT_DIRNAME}/trace, file2, ${CVSROOT_DIRNAME}/trace/file2,v )
33590  *-> do_recursion ( frame=${PFMT} )
33591  *-> do_recursion ( frame=${PFMT} )
33592  *-> do_recursion ( frame=${PFMT} )
33593  *-> do_recursion ( frame=${PFMT} )
33594  *-> do_recursion ( frame=${PFMT} )
33595  *-> do_recursion ( frame=${PFMT} )
33596  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
33597  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace/subdir)
33598  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33599  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33600  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33601  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33602  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
33603  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
33604  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
33605  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33606  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33607  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33608  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33609  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
33610  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
33611  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
33612  *-> lock_simple_remove()
33613  *-> lock_simple_remove()
33614  *-> lock_simple_remove()
33615  *-> lock_simple_remove()
33616  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
33617  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
33618  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
33619  *-> promotable_exists (${CVSROOT_DIRNAME}/trace/subdir)
33620  *-> rcs_cleanup()
33621  *-> readers_exist (${CVSROOT_DIRNAME}/trace)
33622  *-> readers_exist (${CVSROOT_DIRNAME}/trace/subdir)
33623  *-> remove_locks()
33624  *-> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
33625  *-> rename(${CVSROOT_DIRNAME}/trace/,file2,,${CVSROOT_DIRNAME}/trace/file2,v)
33626  *-> rtag_proc ( argc=1, argv=${PFMT}, xwhere=(null),
33627  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33628  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33629  *-> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
33630  *-> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
33631  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33632  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33633  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33634  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33635  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33636  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33637  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33638  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33639  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33640  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33641  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33642  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33643  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33644  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33645  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33646  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33647  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33648  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33649  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33650  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33651  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33652  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33653  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33654  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33655  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33656  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33657  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33658  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33659  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33660  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33661  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33662  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33663  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33664T file1
33665T file2
33666${SPROG} tag: Tagging \.
33667${SPROG} tag: Tagging subdir" \
33668"
33669  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33670  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33671  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33672  *direntproc=${PFMT}, dirleavproc=${PFMT},
33673  *direntproc=${PFMT}, dirleavproc=${PFMT},
33674  *direntproc=${PFMT}, dirleavproc=${PFMT},
33675  *dosrcs=0, repository_in=(null) )
33676  *dosrcs=1, repository_in= )
33677  *dosrcs=1, repository_in= )
33678  *local=0, which=1, aflag=0,
33679  *local=0, which=1, aflag=0,
33680  *local=0, which=1, aflag=0,
33681  *locktype=0, update_preload=(null)
33682  *locktype=1, update_preload=(null)
33683  *locktype=2, update_preload=(null)
33684  *local_specified=0, mname=(null), msg=(null) )
33685  *mwhere=(null), mfile=(null), shorten=0,
33686  *-> Forking server: ${CVS_SERVER} server
33687  *-> Leaving do_recursion ( frame=${PFMT} )
33688  *-> Leaving do_recursion ( frame=${PFMT} )
33689  *-> Leaving do_recursion ( frame=${PFMT} )
33690  *-> do_recursion ( frame=${PFMT} )
33691  *-> do_recursion ( frame=${PFMT} )
33692  *-> do_recursion ( frame=${PFMT} )
33693  *-> main loop with CVSROOT=${CVSROOT}
33694  *-> parse_cvsroot ( ${CVSROOT} )
33695  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33696  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33697  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33698  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33699  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33700  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33701  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33702  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33703  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33704  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33705  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33706  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33707  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33708S -> CVS_SERVER_SLEEP not set\.
33709S -> Leaving do_recursion ( frame=${PFMT} )
33710S -> Leaving do_recursion ( frame=${PFMT} )
33711S -> Leaving do_recursion ( frame=${PFMT} )
33712S -> Leaving do_recursion ( frame=${PFMT} )
33713S -> Leaving do_recursion ( frame=${PFMT} )
33714S -> Leaving do_recursion ( frame=${PFMT} )
33715S -> Lock_Cleanup()
33716S -> Lock_Cleanup()
33717S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/taginfo, trace, ALL)
33718S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
33719S -> Reader_Lock(${CVSROOT_DIRNAME}/trace/subdir)
33720S -> Simple_Lock_Cleanup()
33721S -> Simple_Lock_Cleanup()
33722S -> Simple_Lock_Cleanup()
33723S -> Simple_Lock_Cleanup()
33724S -> Simple_Lock_Cleanup()
33725S -> Simple_Lock_Cleanup()
33726S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, (null))
33727S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, (null))
33728S -> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.pfl\.\*, (null))
33729S -> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.\*, (null))
33730S -> check_fileproc ( ${CVSROOT_DIRNAME}/trace, file1, ${CVSROOT_DIRNAME}/trace/file1,v )
33731S -> check_fileproc ( ${CVSROOT_DIRNAME}/trace, file2, ${CVSROOT_DIRNAME}/trace/file2,v )
33732S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
33733S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
33734S -> dirswitch (subdir, ${CVSROOT_DIRNAME}/trace/subdir)
33735S -> do_cvs_command (tag)
33736S -> do_recursion ( frame=${PFMT} )
33737S -> do_recursion ( frame=${PFMT} )
33738S -> do_recursion ( frame=${PFMT} )
33739S -> do_recursion ( frame=${PFMT} )
33740S -> do_recursion ( frame=${PFMT} )
33741S -> do_recursion ( frame=${PFMT} )
33742S -> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
33743S -> lock_dir_for_write (${CVSROOT_DIRNAME}/trace/subdir)
33744S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33745S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33746S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33747S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33748S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
33749S -> lock_name (${CVSROOT_DIRNAME}/trace, )
33750S -> lock_name (${CVSROOT_DIRNAME}/trace, )
33751S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33752S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33753S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33754S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33755S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
33756S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
33757S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
33758S -> lock_simple_remove()
33759S -> lock_simple_remove()
33760S -> lock_simple_remove()
33761S -> lock_simple_remove()
33762S -> promotable_exists (${CVSROOT_DIRNAME}/trace)
33763S -> promotable_exists (${CVSROOT_DIRNAME}/trace/subdir)
33764S -> rcs_cleanup()
33765S -> readers_exist (${CVSROOT_DIRNAME}/trace)
33766S -> readers_exist (${CVSROOT_DIRNAME}/trace/subdir)
33767S -> remove_locks()
33768S -> remove_locks()
33769S -> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
33770S -> rename(${CVSROOT_DIRNAME}/trace/,file2,,${CVSROOT_DIRNAME}/trace/file2,v)
33771S -> rename(CVS/Entries\.Backup,CVS/Entries)
33772S -> rename(CVS/Entries\.Backup,CVS/Entries)
33773S -> rtag_proc ( argc=1, argv=${PFMT}, xwhere=(null),
33774S -> serve_directory (\.)
33775S -> serve_directory (\.)
33776S -> serve_directory (subdir)
33777S -> server_cleanup()
33778S -> server_cleanup()
33779S -> server_notify()
33780S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33781S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33782S -> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
33783S -> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
33784S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33785S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33786S -> unlink_file(CVS/Entries\.Log)
33787S -> unlink_file(CVS/Entries\.Log)
33788S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33789S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33790S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33791S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33792S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33793S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33794S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33795S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33796S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33797S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33798S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33799S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33800S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33801S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33802S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33803S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33804S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33805S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33806S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33807S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33808S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33809S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33810S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33811S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33812S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33813S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33814S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33815S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33816S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33817S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33818T file1
33819T file2
33820${SPROG} tag: Tagging \.
33821${SPROG} tag: Tagging subdir"
33822	  dotest_sort trace-9 "${testcvs} -t -t -t log" \
33823"
33824
33825  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33826  *direntproc=${PFMT}, dirleavproc=${PFMT},
33827  *dosrcs=1, repository_in=(null) )
33828  *local=0, which=7, aflag=0,
33829  *locktype=1, update_preload=(null)
33830  *-> Leaving do_recursion ( frame=${PFMT} )
33831  *-> Leaving do_recursion ( frame=${PFMT} )
33832  *-> Leaving do_recursion ( frame=${PFMT} )
33833  *-> Lock_Cleanup()
33834  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
33835  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace/subdir)
33836  *-> Simple_Lock_Cleanup()
33837  *-> Simple_Lock_Cleanup()
33838  *-> Simple_Lock_Cleanup()
33839  *-> do_recursion ( frame=${PFMT} )
33840  *-> do_recursion ( frame=${PFMT} )
33841  *-> do_recursion ( frame=${PFMT} )
33842  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33843  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33844  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33845  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33846  *-> lock_simple_remove()
33847  *-> lock_simple_remove()
33848  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
33849  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
33850  *-> remove_locks()
33851  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
33852  *-> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
33853  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33854  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33855  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33856  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33857  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33858  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33859  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33860  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33861  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33862  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33863  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33864  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33865  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33866  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33867  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33868  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33869  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33870  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33871  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33872  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33873  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33874 MYVENDOR: 1\.1\.1
33875 bp: 1\.1
33876 bp: 1\.1\.1\.1
33877 branch1: 1\.1\.0\.2
33878 branch1: 1\.1\.1\.1\.0\.2
33879 version-1: 1\.1\.1\.1
33880----------------------------
33881----------------------------
33882----------------------------
33883=============================================================================
33884=============================================================================
33885Initial revision
33886RCS file: ${CVSROOT_DIRNAME}/trace/file1,v
33887RCS file: ${CVSROOT_DIRNAME}/trace/file2,v
33888Working file: file1
33889Working file: file2
33890access list:
33891access list:
33892branch:
33893branch: 1\.1\.1
33894branches:  1\.1\.1;
33895${SPROG} log: Logging \.
33896${SPROG} log: Logging subdir
33897date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
33898date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}0 -0;  commitid: ${commitid};
33899date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
33900description:
33901description:
33902head: 1\.1
33903head: 1\.1
33904import
33905keyword substitution: kv
33906keyword substitution: kv
33907locks: strict
33908locks: strict
33909new-file
33910revision 1\.1
33911revision 1\.1
33912revision 1\.1\.1\.1
33913symbolic names:
33914symbolic names:
33915total revisions: 1; selected revisions: 1
33916total revisions: 2; selected revisions: 2" \
33917"
33918
33919
33920  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33921  *callerdat=${PFMT}, argc=0, argv=${PFMT},
33922  *direntproc=${PFMT}, dirleavproc=${PFMT},
33923  *direntproc=${PFMT}, dirleavproc=${PFMT},
33924  *dosrcs=0, repository_in=(null) )
33925  *dosrcs=1, repository_in=(null) )
33926  *local=0, which=1, aflag=0,
33927  *local=0, which=7, aflag=0,
33928  *locktype=0, update_preload=(null)
33929  *locktype=1, update_preload=(null)
33930  *-> Forking server: ${CVS_SERVER} server
33931  *-> Leaving do_recursion ( frame=${PFMT} )
33932  *-> Leaving do_recursion ( frame=${PFMT} )
33933  *-> Leaving do_recursion ( frame=${PFMT} )
33934  *-> do_recursion ( frame=${PFMT} )
33935  *-> do_recursion ( frame=${PFMT} )
33936  *-> do_recursion ( frame=${PFMT} )
33937  *-> main loop with CVSROOT=${CVSROOT}
33938  *-> parse_cvsroot ( ${CVSROOT} )
33939  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
33940  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33941  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33942  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33943  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33944  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33945  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33946  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33947  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33948  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33949  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33950  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33951  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
33952 MYVENDOR: 1\.1\.1
33953 bp: 1\.1
33954 bp: 1\.1\.1\.1
33955 branch1: 1\.1\.0\.2
33956 branch1: 1\.1\.1\.1\.0\.2
33957 version-1: 1\.1\.1\.1
33958----------------------------
33959----------------------------
33960----------------------------
33961=============================================================================
33962=============================================================================
33963Initial revision
33964RCS file: ${CVSROOT_DIRNAME}/trace/file1,v
33965RCS file: ${CVSROOT_DIRNAME}/trace/file2,v
33966S -> CVS_SERVER_SLEEP not set\.
33967S -> Leaving do_recursion ( frame=${PFMT} )
33968S -> Leaving do_recursion ( frame=${PFMT} )
33969S -> Leaving do_recursion ( frame=${PFMT} )
33970S -> Lock_Cleanup()
33971S -> Lock_Cleanup()
33972S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
33973S -> Reader_Lock(${CVSROOT_DIRNAME}/trace/subdir)
33974S -> Simple_Lock_Cleanup()
33975S -> Simple_Lock_Cleanup()
33976S -> Simple_Lock_Cleanup()
33977S -> Simple_Lock_Cleanup()
33978S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
33979S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
33980S -> dirswitch (subdir, ${CVSROOT_DIRNAME}/trace/subdir)
33981S -> do_cvs_command (log)
33982S -> do_recursion ( frame=${PFMT} )
33983S -> do_recursion ( frame=${PFMT} )
33984S -> do_recursion ( frame=${PFMT} )
33985S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
33986S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33987S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
33988S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
33989S -> lock_simple_remove()
33990S -> lock_simple_remove()
33991S -> remove_locks()
33992S -> remove_locks()
33993S -> rename(CVS/Entries\.Backup,CVS/Entries)
33994S -> rename(CVS/Entries\.Backup,CVS/Entries)
33995S -> serve_directory (\.)
33996S -> serve_directory (\.)
33997S -> serve_directory (subdir)
33998S -> server_cleanup()
33999S -> server_cleanup()
34000S -> server_notify()
34001S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34002S -> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
34003S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34004S -> unlink_file(CVS/Entries\.Log)
34005S -> unlink_file(CVS/Entries\.Log)
34006S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34007S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34008S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34009S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34010S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34011S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34012S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34013S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34014S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34015S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34016S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34017S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34018S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34019S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34020S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34021S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34022S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34023S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34024S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34025Working file: file1
34026Working file: file2
34027access list:
34028access list:
34029branch:
34030branch: 1\.1\.1
34031branches:  1\.1\.1;
34032${SPROG} log: Logging \.
34033${SPROG} log: Logging subdir
34034date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
34035date: ${ISO8601DATE};  author: ${username};  state: Exp;  lines: ${PLUS}0 -0;  commitid: ${commitid};
34036date: ${ISO8601DATE};  author: ${username};  state: Exp;  commitid: ${commitid};
34037description:
34038description:
34039head: 1\.1
34040head: 1\.1
34041import
34042keyword substitution: kv
34043keyword substitution: kv
34044locks: strict
34045locks: strict
34046new-file
34047revision 1\.1
34048revision 1\.1
34049revision 1\.1\.1\.1
34050symbolic names:
34051symbolic names:
34052total revisions: 1; selected revisions: 1
34053total revisions: 2; selected revisions: 2"
34054
34055	  dotest_sort trace-10 "${testcvs} -t -t -t annotate file1" \
34056"
34057  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34058  *direntproc=${PFMT}, dirleavproc=${PFMT},
34059  *dosrcs=1, repository_in= )
34060  *local=0, which=1, aflag=0,
34061  *locktype=1, update_preload=(null)
34062  *-> Leaving do_recursion ( frame=${PFMT} )
34063  *-> Lock_Cleanup()
34064  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34065  *-> Simple_Lock_Cleanup()
34066  *-> Simple_Lock_Cleanup()
34067  *-> do_recursion ( frame=${PFMT} )
34068  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34069  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34070  *-> lock_simple_remove()
34071  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
34072  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
34073  *-> remove_locks()
34074  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34075  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34076  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34077  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34078  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34079  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34080\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
34081Annotations for file1" \
34082"
34083
34084  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34085  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34086  *direntproc=${PFMT}, dirleavproc=${PFMT},
34087  *direntproc=${PFMT}, dirleavproc=${PFMT},
34088  *dosrcs=0, repository_in=(null) )
34089  *dosrcs=1, repository_in= )
34090  *local=0, which=1, aflag=0,
34091  *local=0, which=1, aflag=0,
34092  *locktype=0, update_preload=(null)
34093  *locktype=1, update_preload=(null)
34094  *-> Forking server: ${CVS_SERVER} server
34095  *-> Leaving do_recursion ( frame=${PFMT} )
34096  *-> do_recursion ( frame=${PFMT} )
34097  *-> main loop with CVSROOT=${CVSROOT}
34098  *-> parse_cvsroot ( ${CVSROOT} )
34099  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34100  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34101  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34102  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34103  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34104  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34105\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
34106Annotations for file1
34107S -> CVS_SERVER_SLEEP not set\.
34108S -> Leaving do_recursion ( frame=${PFMT} )
34109S -> Lock_Cleanup()
34110S -> Lock_Cleanup()
34111S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34112S -> Simple_Lock_Cleanup()
34113S -> Simple_Lock_Cleanup()
34114S -> Simple_Lock_Cleanup()
34115S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
34116S -> do_cvs_command (annotate)
34117S -> do_recursion ( frame=${PFMT} )
34118S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34119S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34120S -> lock_simple_remove()
34121S -> remove_locks()
34122S -> remove_locks()
34123S -> serve_directory (\.)
34124S -> server_cleanup()
34125S -> server_cleanup()
34126S -> server_notify()
34127S -> server_pathname_check (file1)
34128S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34129S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34130S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34131S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )"
34132
34133	  dotest_sort \
34134trace-11 "${testcvs} -t -t -t rtag -r bp -b branch2 trace" \
34135"  *aflag=0, repository=${CVSROOT_DIRNAME}/trace )
34136  *callerdat=${PFMT}, argc=0, argv=${PFMT},
34137  *callerdat=${PFMT}, argc=0, argv=${PFMT},
34138  *callerdat=${PFMT}, argc=0, argv=${PFMT},
34139  *direntproc=${PFMT}, dirleavproc=${PFMT},
34140  *direntproc=${PFMT}, dirleavproc=${PFMT},
34141  *direntproc=${PFMT}, dirleavproc=${PFMT},
34142  *dosrcs=1, repository_in=${CVSROOT_DIRNAME}/trace )
34143  *dosrcs=1, repository_in=${CVSROOT_DIRNAME}/trace )
34144  *dosrcs=1, repository_in=${CVSROOT_DIRNAME}/trace )
34145  *local=0, which=6, aflag=0,
34146  *local=0, which=6, aflag=0,
34147  *local=0, which=6, aflag=0,
34148  *locktype=1, update_preload=(null)
34149  *locktype=1, update_preload=trace
34150  *locktype=2, update_preload=trace
34151  *local_specified=0, mname=trace, msg=Tagging )
34152  *mwhere=(null), mfile=(null), shorten=0,
34153  *-> Leaving do_recursion ( frame=${PFMT} )
34154  *-> Leaving do_recursion ( frame=${PFMT} )
34155  *-> Leaving do_recursion ( frame=${PFMT} )
34156  *-> Leaving do_recursion ( frame=${PFMT} )
34157  *-> Leaving do_recursion ( frame=${PFMT} )
34158  *-> Leaving do_recursion ( frame=${PFMT} )
34159  *-> Leaving do_recursion ( frame=${PFMT} )
34160  *-> Leaving do_recursion ( frame=${PFMT} )
34161  *-> Leaving do_recursion ( frame=${PFMT} )
34162  *-> Lock_Cleanup()
34163  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/taginfo, trace, ALL)
34164  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34165  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34166  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace/subdir)
34167  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace/subdir)
34168  *-> Simple_Lock_Cleanup()
34169  *-> Simple_Lock_Cleanup()
34170  *-> Simple_Lock_Cleanup()
34171  *-> Simple_Lock_Cleanup()
34172  *-> Simple_Lock_Cleanup()
34173  *-> Simple_Lock_Cleanup()
34174  *-> Simple_Lock_Cleanup()
34175  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, (null))
34176  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, (null))
34177  *-> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.pfl\.\*, (null))
34178  *-> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.\*, (null))
34179  *-> check_fileproc ( ${CVSROOT_DIRNAME}/trace, trace/file1, ${CVSROOT_DIRNAME}/trace/file1,v )
34180  *-> check_fileproc ( ${CVSROOT_DIRNAME}/trace, trace/file2, ${CVSROOT_DIRNAME}/trace/file2,v )
34181  *-> do_module (trace, Tagging, NULL, branch2)
34182  *-> do_recursion ( frame=${PFMT} )
34183  *-> do_recursion ( frame=${PFMT} )
34184  *-> do_recursion ( frame=${PFMT} )
34185  *-> do_recursion ( frame=${PFMT} )
34186  *-> do_recursion ( frame=${PFMT} )
34187  *-> do_recursion ( frame=${PFMT} )
34188  *-> do_recursion ( frame=${PFMT} )
34189  *-> do_recursion ( frame=${PFMT} )
34190  *-> do_recursion ( frame=${PFMT} )
34191  *-> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
34192  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
34193  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace/subdir)
34194  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34195  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34196  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34197  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34198  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34199  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34200  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
34201  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
34202  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
34203  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
34204  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
34205  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
34206  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
34207  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34208  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34209  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
34210  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
34211  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
34212  *-> lock_simple_remove()
34213  *-> lock_simple_remove()
34214  *-> lock_simple_remove()
34215  *-> lock_simple_remove()
34216  *-> lock_simple_remove()
34217  *-> lock_simple_remove()
34218  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
34219  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
34220  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
34221  *-> promotable_exists (${CVSROOT_DIRNAME}/trace/subdir)
34222  *-> rcs_cleanup()
34223  *-> readers_exist (${CVSROOT_DIRNAME}/trace)
34224  *-> readers_exist (${CVSROOT_DIRNAME}/trace/subdir)
34225  *-> remove_locks()
34226  *-> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
34227  *-> rename(${CVSROOT_DIRNAME}/trace/,file2,,${CVSROOT_DIRNAME}/trace/file2,v)
34228  *-> rtag_proc ( argc=1, argv=${PFMT}, xwhere=(null),
34229  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34230  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34231  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34232  *-> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
34233  *-> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
34234  *-> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
34235  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34236  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34237  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34238  *-> tag_check_valid ( name=bp, argc=0, argv=${PFMT}, local=0,
34239  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34240  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34241  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34242  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34243  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34244  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34245  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34246  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34247  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34248  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34249  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34250  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34251  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34252  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34253  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34254  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34255  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34256  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34257  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34258  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34259  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34260  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34261  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34262  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34263  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34264  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34265  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34266  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34267  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34268  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34269  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34270${SPROG} rtag: Tagging trace
34271${SPROG} rtag: Tagging trace/subdir" \
34272"
34273  *aflag=0, repository=${CVSROOT_DIRNAME}/trace )
34274  *callerdat=${PFMT}, argc=0, argv=${PFMT},
34275  *callerdat=${PFMT}, argc=0, argv=${PFMT},
34276  *callerdat=${PFMT}, argc=0, argv=${PFMT},
34277  *direntproc=${PFMT}, dirleavproc=${PFMT},
34278  *direntproc=${PFMT}, dirleavproc=${PFMT},
34279  *direntproc=${PFMT}, dirleavproc=${PFMT},
34280  *dosrcs=1, repository_in=${CVSROOT_DIRNAME}/trace )
34281  *dosrcs=1, repository_in=${CVSROOT_DIRNAME}/trace )
34282  *dosrcs=1, repository_in=${CVSROOT_DIRNAME}/trace )
34283  *local=0, which=6, aflag=0,
34284  *local=0, which=6, aflag=0,
34285  *local=0, which=6, aflag=0,
34286  *locktype=1, update_preload=(null)
34287  *locktype=1, update_preload=trace
34288  *locktype=2, update_preload=trace
34289  *local_specified=0, mname=trace, msg=Tagging )
34290  *mwhere=(null), mfile=(null), shorten=0,
34291  *-> Forking server: ${CVS_SERVER} server
34292  *-> main loop with CVSROOT=${CVSROOT}
34293  *-> parse_cvsroot ( ${CVSROOT} )
34294  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34295  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34296  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34297S -> CVS_SERVER_SLEEP not set\.
34298S -> Leaving do_recursion ( frame=${PFMT} )
34299S -> Leaving do_recursion ( frame=${PFMT} )
34300S -> Leaving do_recursion ( frame=${PFMT} )
34301S -> Leaving do_recursion ( frame=${PFMT} )
34302S -> Leaving do_recursion ( frame=${PFMT} )
34303S -> Leaving do_recursion ( frame=${PFMT} )
34304S -> Leaving do_recursion ( frame=${PFMT} )
34305S -> Leaving do_recursion ( frame=${PFMT} )
34306S -> Leaving do_recursion ( frame=${PFMT} )
34307S -> Lock_Cleanup()
34308S -> Lock_Cleanup()
34309S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/taginfo, trace, ALL)
34310S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34311S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34312S -> Reader_Lock(${CVSROOT_DIRNAME}/trace/subdir)
34313S -> Reader_Lock(${CVSROOT_DIRNAME}/trace/subdir)
34314S -> Simple_Lock_Cleanup()
34315S -> Simple_Lock_Cleanup()
34316S -> Simple_Lock_Cleanup()
34317S -> Simple_Lock_Cleanup()
34318S -> Simple_Lock_Cleanup()
34319S -> Simple_Lock_Cleanup()
34320S -> Simple_Lock_Cleanup()
34321S -> Simple_Lock_Cleanup()
34322S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, (null))
34323S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, (null))
34324S -> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.pfl\.\*, (null))
34325S -> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.\*, (null))
34326S -> check_fileproc ( ${CVSROOT_DIRNAME}/trace, trace/file1, ${CVSROOT_DIRNAME}/trace/file1,v )
34327S -> check_fileproc ( ${CVSROOT_DIRNAME}/trace, trace/file2, ${CVSROOT_DIRNAME}/trace/file2,v )
34328S -> do_cvs_command (rtag)
34329S -> do_module (trace, Tagging, NULL, branch2)
34330S -> do_recursion ( frame=${PFMT} )
34331S -> do_recursion ( frame=${PFMT} )
34332S -> do_recursion ( frame=${PFMT} )
34333S -> do_recursion ( frame=${PFMT} )
34334S -> do_recursion ( frame=${PFMT} )
34335S -> do_recursion ( frame=${PFMT} )
34336S -> do_recursion ( frame=${PFMT} )
34337S -> do_recursion ( frame=${PFMT} )
34338S -> do_recursion ( frame=${PFMT} )
34339S -> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
34340S -> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
34341S -> lock_dir_for_write (${CVSROOT_DIRNAME}/trace/subdir)
34342S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34343S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34344S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34345S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34346S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34347S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34348S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
34349S -> lock_name (${CVSROOT_DIRNAME}/trace, )
34350S -> lock_name (${CVSROOT_DIRNAME}/trace, )
34351S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
34352S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
34353S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
34354S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
34355S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34356S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34357S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
34358S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
34359S -> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
34360S -> lock_simple_remove()
34361S -> lock_simple_remove()
34362S -> lock_simple_remove()
34363S -> lock_simple_remove()
34364S -> lock_simple_remove()
34365S -> lock_simple_remove()
34366S -> promotable_exists (${CVSROOT_DIRNAME}/trace)
34367S -> promotable_exists (${CVSROOT_DIRNAME}/trace/subdir)
34368S -> rcs_cleanup()
34369S -> readers_exist (${CVSROOT_DIRNAME}/trace)
34370S -> readers_exist (${CVSROOT_DIRNAME}/trace/subdir)
34371S -> remove_locks()
34372S -> remove_locks()
34373S -> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
34374S -> rename(${CVSROOT_DIRNAME}/trace/,file2,,${CVSROOT_DIRNAME}/trace/file2,v)
34375S -> rtag_proc ( argc=1, argv=${PFMT}, xwhere=(null),
34376S -> server_cleanup()
34377S -> server_cleanup()
34378S -> server_notify()
34379S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34380S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34381S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34382S -> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
34383S -> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
34384S -> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
34385S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34386S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34387S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34388S -> tag_check_valid ( name=bp, argc=0, argv=${PFMT}, local=0,
34389S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34390S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34391S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34392S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34393S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34394S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34395S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34396S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34397S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34398S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34399S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34400S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34401S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34402S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34403S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34404S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34405S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34406S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34407S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34408S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34409S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34410S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34411S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34412S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34413S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34414S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34415S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34416S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34417S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34418${SPROG} rtag: Tagging trace
34419${SPROG} rtag: Tagging trace/subdir"
34420
34421	  dotest_sort trace-12 "${testcvs} -t -t -t status file1" \
34422"
34423
34424  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34425  *direntproc=${PFMT}, dirleavproc=${PFMT},
34426  *dosrcs=1, repository_in=(null) )
34427  *local=0, which=1, aflag=0,
34428  *locktype=1, update_preload=(null)
34429   Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/trace/file1,v
34430   Sticky Date:  (none)
34431   Sticky Options: (none)
34432   Sticky Tag:  (none)
34433   Working revision: 1\.1\.1\.1 ${DATE}
34434  *-> Leaving do_recursion ( frame=${PFMT} )
34435  *-> Lock_Cleanup()
34436  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34437  *-> Simple_Lock_Cleanup()
34438  *-> Simple_Lock_Cleanup()
34439  *-> do_recursion ( frame=${PFMT} )
34440  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34441  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34442  *-> lock_simple_remove()
34443  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
34444  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
34445  *-> remove_locks()
34446  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34447  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34448  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34449  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34450  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34451  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34452===================================================================
34453File: file1  *Status: Up-to-date" \
34454"
34455
34456
34457  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34458  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34459  *direntproc=${PFMT}, dirleavproc=${PFMT},
34460  *direntproc=${PFMT}, dirleavproc=${PFMT},
34461  *dosrcs=0, repository_in=(null) )
34462  *dosrcs=1, repository_in=(null) )
34463  *local=0, which=1, aflag=0,
34464  *local=0, which=1, aflag=0,
34465  *locktype=0, update_preload=(null)
34466  *locktype=1, update_preload=(null)
34467   Repository revision: 1\.1\.1\.1 ${CVSROOT_DIRNAME}/trace/file1,v
34468   Sticky Date:  (none)
34469   Sticky Options: (none)
34470   Sticky Tag:  (none)
34471   Working revision: 1\.1\.1\.1
34472  *-> Forking server: ${CVS_SERVER} server
34473  *-> Leaving do_recursion ( frame=${PFMT} )
34474  *-> do_recursion ( frame=${PFMT} )
34475  *-> main loop with CVSROOT=${CVSROOT}
34476  *-> parse_cvsroot ( ${CVSROOT} )
34477  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34478  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34479  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34480  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34481  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34482  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34483===================================================================
34484File: file1  *Status: Up-to-date
34485S -> CVS_SERVER_SLEEP not set\.
34486S -> Leaving do_recursion ( frame=${PFMT} )
34487S -> Lock_Cleanup()
34488S -> Lock_Cleanup()
34489S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34490S -> Simple_Lock_Cleanup()
34491S -> Simple_Lock_Cleanup()
34492S -> Simple_Lock_Cleanup()
34493S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
34494S -> do_cvs_command (status)
34495S -> do_recursion ( frame=${PFMT} )
34496S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34497S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34498S -> lock_simple_remove()
34499S -> remove_locks()
34500S -> remove_locks()
34501S -> serve_directory (\.)
34502S -> server_cleanup()
34503S -> server_cleanup()
34504S -> server_notify()
34505S -> server_pathname_check (file1)
34506S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34507S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34508S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34509S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )"
34510
34511	  echo foo >> file1
34512	  dotest_sort trace-13 "${testcvs} -t -t -t up -C file1" \
34513"  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34514  *direntproc=${PFMT}, dirleavproc=${PFMT},
34515  *dosrcs=1, repository_in=(null) )
34516  *local=0, which=3, aflag=0,
34517  *locktype=1, update_preload=(null)
34518  *-> Leaving do_recursion ( frame=${PFMT} )
34519  *-> Lock_Cleanup()
34520  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, , , (function))
34521  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, , , file1)
34522  *-> RCS_cmp_file( ${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, (null), , file1 )
34523  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34524  *-> Register(file1, 1\.1\.1\.1, ${DATE}, ,  )
34525  *-> Simple_Lock_Cleanup()
34526  *-> Simple_Lock_Cleanup()
34527  *-> chmod(file1,[0-7][0-7]*)
34528  *-> copy(file1,\.#file1\.1\.1\.1\.1)
34529  *-> do_recursion ( frame=${PFMT} )
34530  *-> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
34531  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34532  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34533  *-> lock_simple_remove()
34534  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
34535  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
34536  *-> remove_locks()
34537  *-> rename(CVS/Entries\.Backup,CVS/Entries)
34538  *-> rename(file1,CVS/,,file1)
34539  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34540  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34541  *-> unlink_file(CVS/Entries\.Log)
34542  *-> unlink_file_dir(CVS/,,file1)
34543  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34544  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34545  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34546  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34547  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34548(Locally modified file1 moved to \.#file1\.1\.1\.1\.1)
34549U file1" \
34550"
34551  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34552  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34553  *direntproc=${PFMT}, dirleavproc=${PFMT},
34554  *direntproc=${PFMT}, dirleavproc=${PFMT},
34555  *dosrcs=0, repository_in=(null) )
34556  *dosrcs=1, repository_in=(null) )
34557  *local=0, which=1, aflag=0,
34558  *local=0, which=3, aflag=0,
34559  *locktype=0, update_preload=(null)
34560  *locktype=1, update_preload=(null)
34561  *-> Forking server: ${CVS_SERVER} server
34562  *-> Leaving do_recursion ( frame=${PFMT} )
34563  *-> Register(file1, 1\.1\.1\.1, ${DATE}, ,  )
34564  *-> copy(file1,\.#file1\.1\.1\.1\.1)
34565  *-> do_recursion ( frame=${PFMT} )
34566  *-> main loop with CVSROOT=${CVSROOT}
34567  *-> parse_cvsroot ( ${CVSROOT} )
34568  *-> rename(\.new\.file1,file1)
34569  *-> rename(CVS/Entries\.Backup,CVS/Entries)
34570  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34571  *-> unlink_file(CVS/Entries\.Log)
34572  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34573  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34574  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34575  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34576  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34577  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34578  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34579(Locally modified file1 moved to \.#file1\.1\.1\.1\.1)
34580S -> CVS_SERVER_SLEEP not set\.
34581S -> Leaving do_recursion ( frame=${PFMT} )
34582S -> Lock_Cleanup()
34583S -> Lock_Cleanup()
34584S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, , , (function))
34585S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34586S -> Register(file1, 1\.1\.1\.1, M, ,  )
34587S -> Simple_Lock_Cleanup()
34588S -> Simple_Lock_Cleanup()
34589S -> Simple_Lock_Cleanup()
34590S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
34591S -> do_cvs_command (update)
34592S -> do_recursion ( frame=${PFMT} )
34593S -> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
34594S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34595S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34596S -> lock_simple_remove()
34597S -> remove_locks()
34598S -> remove_locks()
34599S -> rename(CVS/Entries\.Backup,CVS/Entries)
34600S -> serve_directory (\.)
34601S -> server_cleanup()
34602S -> server_cleanup()
34603S -> server_notify()
34604S -> server_pathname_check (file1)
34605S -> server_register(file1, 1\.1\.1\.1, M, , , , )
34606S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34607S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34608S -> unlink_file(CVS/Entries\.Log)
34609S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34610S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34611S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34612U file1"
34613	  echo foo >> file1
34614	  dotest_sort trace-14 "${testcvs} -t -t -t ci -madd-data file1" \
34615"  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34616  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34617  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34618  *direntproc=${PFMT}, dirleavproc=${PFMT},
34619  *direntproc=${PFMT}, dirleavproc=${PFMT},
34620  *direntproc=${PFMT}, dirleavproc=${PFMT},
34621  *dosrcs=0, repository_in=(null) )
34622  *dosrcs=1, repository_in=(null) )
34623  *dosrcs=1, repository_in=(null) )
34624  *local=0, which=1, aflag=0,
34625  *local=0, which=1, aflag=0,
34626  *local=0, which=1, aflag=0,
34627  *locktype=0, update_preload=(null)
34628  *locktype=0, update_preload=(null)
34629  *locktype=2, update_preload=(null)
34630  *-> Leaving do_recursion ( frame=${PFMT} )
34631  *-> Leaving do_recursion ( frame=${PFMT} )
34632  *-> Leaving do_recursion ( frame=${PFMT} )
34633  *-> Lock_Cleanup()
34634  *-> Lock_Cleanup()
34635  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/commitinfo, trace, ALL)
34636  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/loginfo, trace, ALL)
34637  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/verifymsg, trace, not ALL)
34638  *-> Promotable_Lock ()
34639  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, , , , (function))
34640  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1, , -ko, ${tempname})
34641  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, , , (function))
34642  *-> RCS_cmp_file( ${CVSROOT_DIRNAME}/trace/file1,v, (null), (null), , file1 )
34643  *-> RCS_cmp_file( ${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, (null), , file1 )
34644  *-> Register(file1, 1\.2, ${DATE}, ,  )
34645  *-> Simple_Lock_Cleanup()
34646  *-> Simple_Lock_Cleanup()
34647  *-> Simple_Lock_Cleanup()
34648  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
34649  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
34650  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34651  *-> do_recursion ( frame=${PFMT} )
34652  *-> do_recursion ( frame=${PFMT} )
34653  *-> do_recursion ( frame=${PFMT} )
34654  *-> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
34655  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
34656  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34657  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34658  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34659  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
34660  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34661  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
34662  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
34663  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
34664  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
34665  *-> lock_simple_remove()
34666  *-> lock_simple_remove()
34667  *-> lock_tree_promotably (1, argv, 0, 1, 0)
34668  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
34669  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
34670  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
34671  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
34672  *-> promotable_lock(${CVSROOT_DIRNAME}/trace)
34673  *-> rcs_cleanup()
34674  *-> readers_exist (${CVSROOT_DIRNAME}/trace)
34675  *-> remove_locks()
34676  *-> remove_locks()
34677  *-> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
34678  *-> rename(CVS/Entries\.Backup,CVS/Entries)
34679  *-> set_lock (${CVSROOT_DIRNAME}/trace, 0)
34680  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34681  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34682  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34683  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34684  *-> unlink_file(${tempname})
34685  *-> unlink_file(${tempname})
34686  *-> unlink_file(CVS/Base/file1)
34687  *-> unlink_file(CVS/Entries\.Log)
34688  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34689  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34690  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34691  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34692  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34693  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34694  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34695  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34696  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34697  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34698  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34699  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34700  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34701  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34702  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34703  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34704  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34705  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34706${CVSROOT_DIRNAME}/trace/file1,v  <--  file1
34707new revision: 1\.2; previous revision: 1\.1" \
34708"
34709  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34710  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34711  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34712  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34713  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34714  *direntproc=${PFMT}, dirleavproc=${PFMT},
34715  *direntproc=${PFMT}, dirleavproc=${PFMT},
34716  *direntproc=${PFMT}, dirleavproc=${PFMT},
34717  *direntproc=${PFMT}, dirleavproc=${PFMT},
34718  *direntproc=${PFMT}, dirleavproc=${PFMT},
34719  *dosrcs=0, repository_in=(null) )
34720  *dosrcs=0, repository_in=(null) )
34721  *dosrcs=0, repository_in=(null) )
34722  *dosrcs=1, repository_in=(null) )
34723  *dosrcs=1, repository_in=(null) )
34724  *local=0, which=1, aflag=0,
34725  *local=0, which=1, aflag=0,
34726  *local=0, which=1, aflag=0,
34727  *local=0, which=1, aflag=0,
34728  *local=0, which=1, aflag=0,
34729  *locktype=0, update_preload=(null)
34730  *locktype=0, update_preload=(null)
34731  *locktype=0, update_preload=(null)
34732  *locktype=0, update_preload=(null)
34733  *locktype=2, update_preload=(null)
34734  *-> Forking server: ${CVS_SERVER} server
34735  *-> Leaving do_recursion ( frame=${PFMT} )
34736  *-> Leaving do_recursion ( frame=${PFMT} )
34737  *-> Register(file1, 1\.2, ${DATE}, ,  )
34738  *-> Sending file \`file1' to server
34739  *-> do_recursion ( frame=${PFMT} )
34740  *-> do_recursion ( frame=${PFMT} )
34741  *-> main loop with CVSROOT=${CVSROOT}
34742  *-> parse_cvsroot ( ${CVSROOT} )
34743  *-> rename(CVS/Entries\.Backup,CVS/Entries)
34744  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34745  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34746  *-> unlink_file(CVS/Base/file1)
34747  *-> unlink_file(CVS/Entries\.Log)
34748  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34749  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34750  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34751  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34752  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34753  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34754  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34755  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34756  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34757  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34758${CVSROOT_DIRNAME}/trace/file1,v  <--  file1
34759S -> CVS_SERVER_SLEEP not set\.
34760S -> Leaving do_recursion ( frame=${PFMT} )
34761S -> Leaving do_recursion ( frame=${PFMT} )
34762S -> Leaving do_recursion ( frame=${PFMT} )
34763S -> Lock_Cleanup()
34764S -> Lock_Cleanup()
34765S -> Lock_Cleanup()
34766S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/commitinfo, trace, ALL)
34767S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/loginfo, trace, ALL)
34768S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/verifymsg, trace, not ALL)
34769S -> Promotable_Lock ()
34770S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, , , , (function))
34771S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1, , -ko, ${tempname})
34772S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, , , (function))
34773S -> RCS_cmp_file( ${CVSROOT_DIRNAME}/trace/file1,v, (null), (null), , file1 )
34774S -> RCS_cmp_file( ${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, (null), , file1 )
34775S -> Register(file1, 1\.2, ${DATE}, ,  )
34776S -> Simple_Lock_Cleanup()
34777S -> Simple_Lock_Cleanup()
34778S -> Simple_Lock_Cleanup()
34779S -> Simple_Lock_Cleanup()
34780S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
34781S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
34782S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34783S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
34784S -> do_cvs_command (commit)
34785S -> do_recursion ( frame=${PFMT} )
34786S -> do_recursion ( frame=${PFMT} )
34787S -> do_recursion ( frame=${PFMT} )
34788S -> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
34789S -> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
34790S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34791S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34792S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34793S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
34794S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34795S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
34796S -> lock_name (${CVSROOT_DIRNAME}/trace, )
34797S -> lock_name (${CVSROOT_DIRNAME}/trace, )
34798S -> lock_name (${CVSROOT_DIRNAME}/trace, )
34799S -> lock_simple_remove()
34800S -> lock_simple_remove()
34801S -> lock_tree_promotably (1, argv, 0, 1, 0)
34802S -> promotable_exists (${CVSROOT_DIRNAME}/trace)
34803S -> promotable_exists (${CVSROOT_DIRNAME}/trace)
34804S -> promotable_lock(${CVSROOT_DIRNAME}/trace)
34805S -> rcs_cleanup()
34806S -> readers_exist (${CVSROOT_DIRNAME}/trace)
34807S -> remove_locks()
34808S -> remove_locks()
34809S -> remove_locks()
34810S -> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
34811S -> rename(CVS/Entries\.Backup,CVS/Entries)
34812S -> serve_directory (\.)
34813S -> server_cleanup()
34814S -> server_cleanup()
34815S -> server_notify()
34816S -> server_pathname_check (file1)
34817S -> server_pathname_check (file1)
34818S -> server_pathname_check (file1)
34819S -> server_register(file1, 1\.2, ${DATE}, , , , )
34820S -> set_lock (${CVSROOT_DIRNAME}/trace, 0)
34821S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34822S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34823S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34824S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34825S -> unlink_file(${tempname})
34826S -> unlink_file(${tempname})
34827S -> unlink_file(CVS/Entries\.Log)
34828S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34829S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34830S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34831S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34832S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34833S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34834S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34835S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34836S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34837S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34838S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34839S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34840S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34841S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34842S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34843S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34844new revision: 1\.2; previous revision: 1\.1"
34845
34846	  dotest_fail_sort trace-15 "${testcvs} -t -t -t diff -r1.1 file1" \
34847"  *aflag=0, repository= )
34848  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34849  *direntproc=${PFMT}, dirleavproc=${PFMT},
34850  *dosrcs=1, repository_in=(null) )
34851  *local=0, which=7, aflag=0,
34852  *locktype=1, update_preload=(null)
34853  *-> Leaving do_recursion ( frame=${PFMT} )
34854  *-> Lock_Cleanup()
34855  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1, , , ${tempname})
34856  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.2, , , (function))
34857  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.2, , , ${tempname})
34858  *-> RCS_cmp_file( ${CVSROOT_DIRNAME}/trace/file1,v, 1\.1, 1\.2, , file1 )
34859  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34860  *-> Simple_Lock_Cleanup()
34861  *-> Simple_Lock_Cleanup()
34862  *-> diff_file_nodiff (file1, 3)
34863  *-> do_recursion ( frame=${PFMT} )
34864  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34865  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34866  *-> lock_simple_remove()
34867  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
34868  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
34869  *-> remove_locks()
34870  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34871  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34872  *-> tag_check_valid ( name=1\.1, argc=1, argv=${PFMT}, local=0,
34873  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34874  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34875  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34876  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
348770a1
34878===================================================================
34879> foo
34880Index: file1
34881RCS file: ${CVSROOT_DIRNAME}/trace/file1,v
34882diff -r1\.1 -r1\.2
34883retrieving revision 1\.1
34884retrieving revision 1\.2" \
34885"
34886  *aflag=0, repository= )
34887  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34888  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34889  *direntproc=${PFMT}, dirleavproc=${PFMT},
34890  *direntproc=${PFMT}, dirleavproc=${PFMT},
34891  *dosrcs=0, repository_in=(null) )
34892  *dosrcs=1, repository_in=(null) )
34893  *local=0, which=1, aflag=0,
34894  *local=0, which=7, aflag=0,
34895  *locktype=0, update_preload=(null)
34896  *locktype=1, update_preload=(null)
34897  *-> Forking server: ${CVS_SERVER} server
34898  *-> Leaving do_recursion ( frame=${PFMT} )
34899  *-> do_recursion ( frame=${PFMT} )
34900  *-> main loop with CVSROOT=${CVSROOT}
34901  *-> parse_cvsroot ( ${CVSROOT} )
34902  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34903  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34904  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34905  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34906  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34907  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
349080a1
34909===================================================================
34910> foo
34911Index: file1
34912RCS file: ${CVSROOT_DIRNAME}/trace/file1,v
34913S -> CVS_SERVER_SLEEP not set\.
34914S -> Leaving do_recursion ( frame=${PFMT} )
34915S -> Lock_Cleanup()
34916S -> Lock_Cleanup()
34917S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1, , , ${tempname})
34918S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.2, , , (function))
34919S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.2, , , ${tempname})
34920S -> RCS_cmp_file( ${CVSROOT_DIRNAME}/trace/file1,v, 1\.1, 1\.2, , file1 )
34921S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34922S -> Simple_Lock_Cleanup()
34923S -> Simple_Lock_Cleanup()
34924S -> Simple_Lock_Cleanup()
34925S -> diff_file_nodiff (file1, 3)
34926S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
34927S -> do_cvs_command (diff)
34928S -> do_recursion ( frame=${PFMT} )
34929S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34930S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34931S -> lock_simple_remove()
34932S -> remove_locks()
34933S -> remove_locks()
34934S -> serve_directory (\.)
34935S -> server_cleanup()
34936S -> server_cleanup()
34937S -> server_notify()
34938S -> server_pathname_check (file1)
34939S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34940S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34941S -> tag_check_valid ( name=1\.1, argc=1, argv=${PFMT}, local=0,
34942S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34943S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34944diff -r1\.1 -r1\.2
34945retrieving revision 1\.1
34946retrieving revision 1\.2"
34947
34948	  dotest_sort trace-16 "${testcvs} -t -t -t rdiff -rbp trace/file1" \
34949"  *aflag=0, repository=${CVSROOT_DIRNAME}/trace )
34950  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34951  *direntproc=${PFMT}, dirleavproc=${PFMT},
34952  *dosrcs=1, repository_in=${CVSROOT_DIRNAME}/trace )
34953  *local=0, which=6, aflag=0,
34954  *locktype=1, update_preload=trace
34955  *-> Leaving do_recursion ( frame=${PFMT} )
34956  *-> Lock_Cleanup()
34957  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, bp, , ${tempname})
34958  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.2, , , ${tempname})
34959  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
34960  *-> Simple_Lock_Cleanup()
34961  *-> Simple_Lock_Cleanup()
34962  *-> do_module (trace/file1, Patching, NULL, NULL)
34963  *-> do_recursion ( frame=${PFMT} )
34964  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
34965  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
34966  *-> lock_simple_remove()
34967  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
34968  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
34969  *-> patch_proc ( (null), (null), (null), 0, 0, trace/file1, Patching )
34970  *-> remove_locks()
34971  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
34972  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
34973  *-> tag_check_valid ( name=bp, argc=1, argv=${PFMT}, local=0,
34974  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34975  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34976  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34977  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34978\*\*\* 0 \*\*\*\*
34979\*\*\* trace/file1:1\.1\.1\.1 ${DATE}
34980\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
34981${PLUS} foo
34982--- 1 ----
34983--- trace/file1 ${DATE}
34984Index: trace/file1
34985diff -c trace/file1:1\.1\.1\.1 trace/file1:1\.2" \
34986"
34987  *aflag=0, repository=${CVSROOT_DIRNAME}/trace )
34988  *callerdat=${PFMT}, argc=1, argv=${PFMT},
34989  *direntproc=${PFMT}, dirleavproc=${PFMT},
34990  *dosrcs=1, repository_in=${CVSROOT_DIRNAME}/trace )
34991  *local=0, which=6, aflag=0,
34992  *locktype=1, update_preload=trace
34993  *-> Forking server: ${CVS_SERVER} server
34994  *-> main loop with CVSROOT=${CVSROOT}
34995  *-> parse_cvsroot ( ${CVSROOT} )
34996  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34997  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34998  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
34999\*\*\* 0 \*\*\*\*
35000\*\*\* trace/file1:1\.1\.1\.1 ${DATE}
35001\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
35002${PLUS} foo
35003--- 1 ----
35004--- trace/file1 ${DATE}
35005Index: trace/file1
35006S -> CVS_SERVER_SLEEP not set\.
35007S -> Leaving do_recursion ( frame=${PFMT} )
35008S -> Lock_Cleanup()
35009S -> Lock_Cleanup()
35010S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.1\.1\.1, bp, , ${tempname})
35011S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.2, , , ${tempname})
35012S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
35013S -> Simple_Lock_Cleanup()
35014S -> Simple_Lock_Cleanup()
35015S -> Simple_Lock_Cleanup()
35016S -> do_cvs_command (rdiff)
35017S -> do_module (trace/file1, Patching, NULL, NULL)
35018S -> do_recursion ( frame=${PFMT} )
35019S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35020S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
35021S -> lock_simple_remove()
35022S -> patch_proc ( (null), (null), (null), 0, 0, trace/file1, Patching )
35023S -> remove_locks()
35024S -> remove_locks()
35025S -> server_cleanup()
35026S -> server_cleanup()
35027S -> server_notify()
35028S -> server_pathname_check (file1)
35029S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
35030S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35031S -> tag_check_valid ( name=bp, argc=1, argv=${PFMT}, local=0,
35032S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35033S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35034diff -c trace/file1:1\.1\.1\.1 trace/file1:1\.2"
35035
35036	  dotest_sort trace-17 "${testcvs} -t -t -t rm -f file1" \
35037"  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35038  *direntproc=${PFMT}, dirleavproc=${PFMT},
35039  *dosrcs=1, repository_in=(null) )
35040  *local=0, which=1, aflag=0,
35041  *locktype=1, update_preload=(null)
35042  *-> Leaving do_recursion ( frame=${PFMT} )
35043  *-> Lock_Cleanup()
35044  *-> Reader_Lock(${CVSROOT_DIRNAME}/trace)
35045  *-> Register(file1, -1\.2, ${DATE}, ,  )
35046  *-> Simple_Lock_Cleanup()
35047  *-> Simple_Lock_Cleanup()
35048  *-> do_recursion ( frame=${PFMT} )
35049  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35050  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
35051  *-> lock_simple_remove()
35052  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
35053  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
35054  *-> remove_locks()
35055  *-> rename(CVS/Entries\.Backup,CVS/Entries)
35056  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
35057  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35058  *-> unlink_file(CVS/Entries\.Log)
35059  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35060  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35061  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35062  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35063  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35064${SPROG} remove: scheduling \`file1' for removal
35065${SPROG} remove: use \`${SPROG} commit' to remove this file permanently" \
35066"
35067  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35068  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35069  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35070  *direntproc=${PFMT}, dirleavproc=${PFMT},
35071  *direntproc=${PFMT}, dirleavproc=${PFMT},
35072  *direntproc=${PFMT}, dirleavproc=${PFMT},
35073  *dosrcs=0, repository_in=(null) )
35074  *dosrcs=0, repository_in=(null) )
35075  *dosrcs=1, repository_in=(null) )
35076  *local=0, which=1, aflag=0,
35077  *local=0, which=1, aflag=0,
35078  *local=0, which=1, aflag=0,
35079  *locktype=0, update_preload=(null)
35080  *locktype=0, update_preload=(null)
35081  *locktype=1, update_preload=(null)
35082  *-> Forking server: ${CVS_SERVER} server
35083  *-> Leaving do_recursion ( frame=${PFMT} )
35084  *-> Leaving do_recursion ( frame=${PFMT} )
35085  *-> Register(file1, -1\.2, dummy timestamp, ,  )
35086  *-> do_recursion ( frame=${PFMT} )
35087  *-> do_recursion ( frame=${PFMT} )
35088  *-> main loop with CVSROOT=${CVSROOT}
35089  *-> parse_cvsroot ( ${CVSROOT} )
35090  *-> rename(CVS/Entries\.Backup,CVS/Entries)
35091  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35092  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35093  *-> unlink_file(CVS/Entries\.Log)
35094  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35095  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35096  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35097  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35098  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35099  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35100  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35101  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35102  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35103S -> CVS_SERVER_SLEEP not set\.
35104S -> Leaving do_recursion ( frame=${PFMT} )
35105S -> Lock_Cleanup()
35106S -> Lock_Cleanup()
35107S -> Reader_Lock(${CVSROOT_DIRNAME}/trace)
35108S -> Register(file1, -1\.2, , ,  )
35109S -> Simple_Lock_Cleanup()
35110S -> Simple_Lock_Cleanup()
35111S -> Simple_Lock_Cleanup()
35112S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
35113S -> do_cvs_command (remove)
35114S -> do_recursion ( frame=${PFMT} )
35115S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35116S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
35117S -> lock_simple_remove()
35118S -> remove_locks()
35119S -> remove_locks()
35120S -> rename(CVS/Entries\.Backup,CVS/Entries)
35121S -> serve_directory (\.)
35122S -> server_cleanup()
35123S -> server_cleanup()
35124S -> server_notify()
35125S -> server_pathname_check (file1)
35126S -> server_register(file1, -1\.2, , , , , )
35127S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
35128S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35129S -> unlink_file(CVS/Entries\.Log)
35130S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35131S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35132S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35133${SPROG} remove: scheduling \`file1' for removal
35134${SPROG} remove: use \`${SPROG} commit' to remove this file permanently"
35135
35136	  dotest_sort trace-18 "${testcvs} -t -t -t ci -mremove file1" \
35137"  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35138  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35139  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35140  *direntproc=${PFMT}, dirleavproc=${PFMT},
35141  *direntproc=${PFMT}, dirleavproc=${PFMT},
35142  *direntproc=${PFMT}, dirleavproc=${PFMT},
35143  *dosrcs=0, repository_in=(null) )
35144  *dosrcs=1, repository_in=(null) )
35145  *dosrcs=1, repository_in=(null) )
35146  *local=0, which=1, aflag=0,
35147  *local=0, which=1, aflag=0,
35148  *local=0, which=1, aflag=0,
35149  *locktype=0, update_preload=(null)
35150  *locktype=0, update_preload=(null)
35151  *locktype=2, update_preload=(null)
35152  *-> Leaving do_recursion ( frame=${PFMT} )
35153  *-> Leaving do_recursion ( frame=${PFMT} )
35154  *-> Leaving do_recursion ( frame=${PFMT} )
35155  *-> Lock_Cleanup()
35156  *-> Lock_Cleanup()
35157  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/commitinfo, trace, ALL)
35158  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/loginfo, trace, ALL)
35159  *-> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/verifymsg, trace, not ALL)
35160  *-> Promotable_Lock ()
35161  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, , , , file1)
35162  *-> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.2, , -ko, ${tempname})
35163  *-> Scratch_Entry(file1)
35164  *-> Simple_Lock_Cleanup()
35165  *-> Simple_Lock_Cleanup()
35166  *-> Simple_Lock_Cleanup()
35167  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs.pfl\.${hostname}\.[0-9][0-9]*)
35168  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs.pfl\.${hostname}\.[0-9][0-9]*)
35169  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, #cvs.rfl\.${hostname}\.[0-9][0-9]*)
35170  *-> do_recursion ( frame=${PFMT} )
35171  *-> do_recursion ( frame=${PFMT} )
35172  *-> do_recursion ( frame=${PFMT} )
35173  *-> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
35174  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
35175  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35176  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35177  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35178  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
35179  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
35180  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
35181  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
35182  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
35183  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
35184  *-> lock_simple_remove()
35185  *-> lock_simple_remove()
35186  *-> lock_tree_promotably (1, argv, 0, 1, 0)
35187  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
35188  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
35189  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
35190  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
35191  *-> promotable_lock(${CVSROOT_DIRNAME}/trace)
35192  *-> rcs_cleanup()
35193  *-> readers_exist (${CVSROOT_DIRNAME}/trace)
35194  *-> remove_locks()
35195  *-> remove_locks()
35196  *-> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
35197  *-> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
35198  *-> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
35199  *-> rename(CVS/Entries\.Backup,CVS/Entries)
35200  *-> set_lock (${CVSROOT_DIRNAME}/trace, 0)
35201  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
35202  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35203  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35204  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35205  *-> unlink_file(${tempname})
35206  *-> unlink_file(${tempname})
35207  *-> unlink_file(CVS/Entries\.Log)
35208  *-> unlink_file(file1)
35209  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35210  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35211  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35212  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35213  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35214  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35215  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35216  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35217  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35218  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35219  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35220  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35221  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35222  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35223  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35224  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35225  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35226  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35227  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35228  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35229  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35230  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35231  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35232  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35233  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35234  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35235  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35236  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35237  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35238  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35239${CVSROOT_DIRNAME}/trace/file1,v  <--  file1
35240new revision: delete; previous revision: 1\.2" \
35241"
35242  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35243  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35244  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35245  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35246  *callerdat=${PFMT}, argc=1, argv=${PFMT},
35247  *direntproc=${PFMT}, dirleavproc=${PFMT},
35248  *direntproc=${PFMT}, dirleavproc=${PFMT},
35249  *direntproc=${PFMT}, dirleavproc=${PFMT},
35250  *direntproc=${PFMT}, dirleavproc=${PFMT},
35251  *direntproc=${PFMT}, dirleavproc=${PFMT},
35252  *dosrcs=0, repository_in=(null) )
35253  *dosrcs=0, repository_in=(null) )
35254  *dosrcs=0, repository_in=(null) )
35255  *dosrcs=1, repository_in=(null) )
35256  *dosrcs=1, repository_in=(null) )
35257  *local=0, which=1, aflag=0,
35258  *local=0, which=1, aflag=0,
35259  *local=0, which=1, aflag=0,
35260  *local=0, which=1, aflag=0,
35261  *local=0, which=1, aflag=0,
35262  *locktype=0, update_preload=(null)
35263  *locktype=0, update_preload=(null)
35264  *locktype=0, update_preload=(null)
35265  *locktype=0, update_preload=(null)
35266  *locktype=2, update_preload=(null)
35267  *-> Forking server: ${CVS_SERVER} server
35268  *-> Leaving do_recursion ( frame=${PFMT} )
35269  *-> Leaving do_recursion ( frame=${PFMT} )
35270  *-> Scratch_Entry(file1)
35271  *-> do_recursion ( frame=${PFMT} )
35272  *-> do_recursion ( frame=${PFMT} )
35273  *-> main loop with CVSROOT=${CVSROOT}
35274  *-> parse_cvsroot ( ${CVSROOT} )
35275  *-> rename(CVS/Entries\.Backup,CVS/Entries)
35276  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35277  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35278  *-> unlink_file(CVS/Entries\.Log)
35279  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35280  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35281  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35282  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35283  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35284  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35285  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35286  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35287  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35288  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35289${CVSROOT_DIRNAME}/trace/file1,v  <--  file1
35290S -> CVS_SERVER_SLEEP not set\.
35291S -> Leaving do_recursion ( frame=${PFMT} )
35292S -> Leaving do_recursion ( frame=${PFMT} )
35293S -> Leaving do_recursion ( frame=${PFMT} )
35294S -> Lock_Cleanup()
35295S -> Lock_Cleanup()
35296S -> Lock_Cleanup()
35297S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/commitinfo, trace, ALL)
35298S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/loginfo, trace, ALL)
35299S -> Parse_Info (${CVSROOT_DIRNAME}/CVSROOT/verifymsg, trace, not ALL)
35300S -> Promotable_Lock ()
35301S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, , , , file1)
35302S -> RCS_checkout (${CVSROOT_DIRNAME}/trace/file1,v, 1\.2, , -ko, ${tempname})
35303S -> Scratch_Entry(file1)
35304S -> Simple_Lock_Cleanup()
35305S -> Simple_Lock_Cleanup()
35306S -> Simple_Lock_Cleanup()
35307S -> Simple_Lock_Cleanup()
35308S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs.pfl\.${hostname}\.[0-9][0-9]*)
35309S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs.pfl\.${hostname}\.[0-9][0-9]*)
35310S -> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, #cvs.rfl\.${hostname}\.[0-9][0-9]*)
35311S -> dirswitch (\., ${CVSROOT_DIRNAME}/trace)
35312S -> do_cvs_command (commit)
35313S -> do_recursion ( frame=${PFMT} )
35314S -> do_recursion ( frame=${PFMT} )
35315S -> do_recursion ( frame=${PFMT} )
35316S -> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
35317S -> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
35318S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35319S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35320S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35321S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
35322S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
35323S -> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
35324S -> lock_name (${CVSROOT_DIRNAME}/trace, )
35325S -> lock_name (${CVSROOT_DIRNAME}/trace, )
35326S -> lock_name (${CVSROOT_DIRNAME}/trace, )
35327S -> lock_simple_remove()
35328S -> lock_simple_remove()
35329S -> lock_tree_promotably (1, argv, 0, 1, 0)
35330S -> promotable_exists (${CVSROOT_DIRNAME}/trace)
35331S -> promotable_exists (${CVSROOT_DIRNAME}/trace)
35332S -> promotable_lock(${CVSROOT_DIRNAME}/trace)
35333S -> rcs_cleanup()
35334S -> readers_exist (${CVSROOT_DIRNAME}/trace)
35335S -> remove_locks()
35336S -> remove_locks()
35337S -> remove_locks()
35338S -> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
35339S -> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
35340S -> rename(${CVSROOT_DIRNAME}/trace/,file1,,${CVSROOT_DIRNAME}/trace/file1,v)
35341S -> rename(CVS/Entries\.Backup,CVS/Entries)
35342S -> serve_directory (\.)
35343S -> server_cleanup()
35344S -> server_cleanup()
35345S -> server_notify()
35346S -> server_pathname_check (file1)
35347S -> server_pathname_check (file1)
35348S -> server_pathname_check (file1)
35349S -> set_lock (${CVSROOT_DIRNAME}/trace, 0)
35350S -> set_lock (${CVSROOT_DIRNAME}/trace, 1)
35351S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35352S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35353S -> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35354S -> unlink_file(${tempname})
35355S -> unlink_file(${tempname})
35356S -> unlink_file(CVS/Entries\.Log)
35357S -> unlink_file(file1)
35358S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35359S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35360S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35361S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35362S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35363S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35364S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35365S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35366S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35367S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35368S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35369S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35370S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35371S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35372S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35373S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35374S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35375S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35376S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35377S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35378S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35379S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35380S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35381S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35382S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35383S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35384S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35385S -> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35386done
35387new revision: delete; previous revision: 1\.2"
35388
35389	  # SGI IRIX seems to have problems with the stdout and stderr
35390	  # mix for this test, so separate them.
35391	  dotest_sort trace-19 "${testcvs} -t -t -t history file1 2>stderr19" \
35392"O ${ISODATE} ${username} trace =trace= ${TESTDIR}/trace/\*" \
35393"O ${ISODATE} ${username} trace =trace= <remote>/\*"
35394	  dotest_sort trace-19stderr "sort < stderr19" \
35395"  *-> Lock_Cleanup()
35396  *-> Simple_Lock_Cleanup()
35397  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
35398  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
35399  *-> remove_locks()
35400  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35401  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )" \
35402"
35403  *-> Forking server: ${CVS_SERVER} server
35404  *-> main loop with CVSROOT=${CVSROOT}
35405  *-> parse_cvsroot ( ${CVSROOT} )
35406  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35407  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35408  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35409S -> CVS_SERVER_SLEEP not set\.
35410S -> Lock_Cleanup()
35411S -> Lock_Cleanup()
35412S -> Simple_Lock_Cleanup()
35413S -> Simple_Lock_Cleanup()
35414S -> do_cvs_command (history)
35415S -> remove_locks()
35416S -> remove_locks()
35417S -> server_cleanup()
35418S -> server_cleanup()
35419S -> server_notify()"
35420	  rm stderr19
35421
35422	  cd ..
35423	  dotest_sort \
35424trace-20 "echo yes | ${testcvs} -t -t -t release -d trace" \
35425"  *callerdat=${PFMT}, argc=0, argv=${PFMT},
35426  *callerdat=${PFMT}, argc=0, argv=${PFMT},
35427  *callerdat=${PFMT}, argc=0, argv=${PFMT},
35428  *direntproc=${PFMT}, dirleavproc=${PFMT},
35429  *direntproc=${PFMT}, dirleavproc=${PFMT},
35430  *direntproc=${PFMT}, dirleavproc=${PFMT},
35431  *dosrcs=0, repository_in=(null) )
35432  *dosrcs=0, repository_in=(null) )
35433  *dosrcs=0, repository_in=(null) )
35434  *local=0, which=1, aflag=0,
35435  *local=0, which=1, aflag=0,
35436  *local=0, which=1, aflag=0,
35437  *locktype=0, update_preload=(null)
35438  *locktype=0, update_preload=(null)
35439  *locktype=2, update_preload=(null)
35440  *-> Leaving do_recursion ( frame=${PFMT} )
35441  *-> Leaving do_recursion ( frame=${PFMT} )
35442  *-> Leaving do_recursion ( frame=${PFMT} )
35443  *-> Leaving do_recursion ( frame=${PFMT} )
35444  *-> Leaving do_recursion ( frame=${PFMT} )
35445  *-> Leaving do_recursion ( frame=${PFMT} )
35446  *-> Leaving do_recursion ( frame=${PFMT} )
35447  *-> Leaving do_recursion ( frame=${PFMT} )
35448  *-> Leaving do_recursion ( frame=${PFMT} )
35449  *-> Lock_Cleanup()
35450  *-> Lock_Cleanup()
35451  *-> Promotable_Lock ()
35452  *-> Simple_Lock_Cleanup()
35453  *-> Simple_Lock_Cleanup()
35454  *-> Simple_Lock_Cleanup()
35455  *-> Simple_Lock_Cleanup()
35456  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
35457  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
35458  *-> _lock_exists (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.\*, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
35459  *-> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
35460  *-> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.pfl\.\*, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
35461  *-> _lock_exists (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.\*, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
35462  *-> do_recursion ( frame=${PFMT} )
35463  *-> do_recursion ( frame=${PFMT} )
35464  *-> do_recursion ( frame=${PFMT} )
35465  *-> do_recursion ( frame=${PFMT} )
35466  *-> do_recursion ( frame=${PFMT} )
35467  *-> do_recursion ( frame=${PFMT} )
35468  *-> do_recursion ( frame=${PFMT} )
35469  *-> do_recursion ( frame=${PFMT} )
35470  *-> do_recursion ( frame=${PFMT} )
35471  *-> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
35472  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace)
35473  *-> lock_dir_for_write (${CVSROOT_DIRNAME}/trace/subdir)
35474  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35475  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35476  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.lock)
35477  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
35478  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
35479  *-> lock_name (${CVSROOT_DIRNAME}/trace, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
35480  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
35481  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
35482  *-> lock_name (${CVSROOT_DIRNAME}/trace, )
35483  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
35484  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
35485  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.lock)
35486  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.pfl\.${hostname}\.[0-9][0-9]*)
35487  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.rfl\.${hostname}\.[0-9][0-9]*)
35488  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, #cvs\.wfl\.${hostname}\.[0-9][0-9]*)
35489  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
35490  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
35491  *-> lock_name (${CVSROOT_DIRNAME}/trace/subdir, )
35492  *-> lock_simple_remove()
35493  *-> lock_simple_remove()
35494  *-> lock_simple_remove()
35495  *-> lock_simple_remove()
35496  *-> lock_tree_promotably (0, argv, 0, 1, 0)
35497  *-> main loop with CVSROOT=${CVSROOT_DIRNAME}
35498  *-> parse_cvsroot ( ${CVSROOT_DIRNAME} )
35499  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
35500  *-> promotable_exists (${CVSROOT_DIRNAME}/trace)
35501  *-> promotable_exists (${CVSROOT_DIRNAME}/trace/subdir)
35502  *-> promotable_exists (${CVSROOT_DIRNAME}/trace/subdir)
35503  *-> promotable_lock(${CVSROOT_DIRNAME}/trace)
35504  *-> promotable_lock(${CVSROOT_DIRNAME}/trace/subdir)
35505  *-> readers_exist (${CVSROOT_DIRNAME}/trace)
35506  *-> readers_exist (${CVSROOT_DIRNAME}/trace/subdir)
35507  *-> remove_locks()
35508  *-> remove_locks()
35509  *-> run_popen(${testcvs} -n -q -d ${CVSROOT_DIRNAME} update,r)
35510  *-> set_lock (${CVSROOT_DIRNAME}/trace, 0)
35511  *-> set_lock (${CVSROOT_DIRNAME}/trace, 1)
35512  *-> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 0)
35513  *-> set_lock (${CVSROOT_DIRNAME}/trace/subdir, 1)
35514  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35515  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35516  *-> unlink_file_dir(trace)
35517  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35518  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35519  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35520  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35521  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35522  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35523  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35524  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35525  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35526  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35527  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35528  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35529  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35530  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35531  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35532  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35533  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35534  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35535  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35536  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35537  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35538  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35539  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35540  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35541  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35542  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35543  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35544Are you sure you want to release (and delete) directory \`trace':   *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35545You have \[0\] altered files in this repository\." \
35546"
35547  *callerdat=${PFMT}, argc=0, argv=${PFMT},
35548  *callerdat=${PFMT}, argc=0, argv=${PFMT},
35549  *direntproc=${PFMT}, dirleavproc=${PFMT},
35550  *direntproc=${PFMT}, dirleavproc=${PFMT},
35551  *dosrcs=0, repository_in=(null) )
35552  *dosrcs=0, repository_in=(null) )
35553  *local=0, which=1, aflag=0,
35554  *local=0, which=1, aflag=0,
35555  *locktype=0, update_preload=(null)
35556  *locktype=0, update_preload=(null)
35557  *-> Forking server: ${CVS_SERVER} server
35558  *-> Leaving do_recursion ( frame=${PFMT} )
35559  *-> Leaving do_recursion ( frame=${PFMT} )
35560  *-> Leaving do_recursion ( frame=${PFMT} )
35561  *-> Leaving do_recursion ( frame=${PFMT} )
35562  *-> Leaving do_recursion ( frame=${PFMT} )
35563  *-> Leaving do_recursion ( frame=${PFMT} )
35564  *-> do_recursion ( frame=${PFMT} )
35565  *-> do_recursion ( frame=${PFMT} )
35566  *-> do_recursion ( frame=${PFMT} )
35567  *-> do_recursion ( frame=${PFMT} )
35568  *-> do_recursion ( frame=${PFMT} )
35569  *-> do_recursion ( frame=${PFMT} )
35570  *-> main loop with CVSROOT=${CVSROOT}
35571  *-> parse_cvsroot ( ${CVSROOT} )
35572  *-> run_popen(${testcvs} -n -q -d ${CVSROOT} update,r)
35573  *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35574  *-> unlink_file_dir(trace)
35575  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35576  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35577  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35578  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35579  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35580  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35581  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35582  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35583  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35584  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35585  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35586  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35587  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35588  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35589  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35590  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35591  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35592  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35593  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35594  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35595  *-> walklist ( list=${PFMT}, proc=${PFMT}, closure=${PFMT} )
35596Are you sure you want to release (and delete) directory \`trace':   *-> start_recursion ( fileproc=${PFMT}, filesdoneproc=${PFMT},
35597S -> CVS_SERVER_SLEEP not set\.
35598S -> Lock_Cleanup()
35599S -> Lock_Cleanup()
35600S -> Simple_Lock_Cleanup()
35601S -> Simple_Lock_Cleanup()
35602S -> do_cvs_command (release)
35603S -> fopen(${CVSROOT_DIRNAME}/CVSROOT/history,a)
35604S -> remove_locks()
35605S -> remove_locks()
35606S -> server_cleanup()
35607S -> server_cleanup()
35608S -> server_notify()
35609S -> server_notify()
35610S -> server_notify()
35611You have \[0\] altered files in this repository\."
35612
35613	  dokeep
35614	  cd ..
35615	  rm -fr trace
35616	  modify_repo rm -fr $CVSROOT_DIRNAME/trace
35617	  ;;
35618
35619
35620
35621	*)
35622	   echo $what is not the name of a test -- ignored
35623	   ;;
35624	esac
35625
35626    # Sanity check sanity.sh.  :)
35627    #
35628    # Test our exit directory so that tests that exit in an incorrect directory
35629    # are noticed during single test runs.
35630    #
35631    # FIXME?
35632    # Sparc Solaris 9 is dereferencing paths here as if /bin/pwd were
35633    # called when /tmp is a symlink.  This might be a new problem with this
35634    # test, but since this was recently tested I think it more likely to be
35635    # A Solaris issue.
35636    if test "x$TESTDIR" != "x`pwd`"; then
35637	    fail "cleanup: PWD != TESTDIR (\``pwd`' != \`$TESTDIR')"
35638    fi
35639
35640    # Test that the last test didn't overwrite any write proxy configuration
35641    # which may be in place.
35642    if $proxy; then
35643	problem=false
35644	for file in \
35645	            $SECONDARY_CVSROOT_DIRNAME/CVSROOT/config \
35646	            $CVSROOT_DIRNAME/CVSROOT/config \
35647		    $SECONDARY_CVSROOT_DIRNAME/CVSROOT/loginfo \
35648	            $CVSROOT_DIRNAME/CVSROOT/loginfo \
35649	            $SECONDARY_CVSROOT_DIRNAME/CVSROOT/postadmin \
35650	            $CVSROOT_DIRNAME/CVSROOT/postadmin \
35651	            $SECONDARY_CVSROOT_DIRNAME/CVSROOT/posttag \
35652	            $CVSROOT_DIRNAME/CVSROOT/posttag \
35653	            $SECONDARY_CVSROOT_DIRNAME/CVSROOT/postwatch \
35654	            $CVSROOT_DIRNAME/CVSROOT/postwatch; do
35655	    if cmp $file $TESTDIR/`basename $file`-clean >/dev/null 2>&1; then
35656		:;
35657	    else
35658		echo "\`$file' and \`$TESTDIR/`basename $file`-clean' differ." \
35659		     >>$LOGFILE
35660		problem=:
35661	    fi
35662	done
35663	if $problem; then
35664	    fail "cleanup: write proxy configuration not preserved"
35665	fi
35666    fi
35667
35668    if $remote && test "$servercvs_orig" != "$servercvs" >/dev/null 2>&1; then
35669	fail "test slagged \$servercvs"
35670    fi
35671
35672    # Reset val-tags to a pristine state.
35673    if test -s $CVSROOT_DIRNAME/CVSROOT/val-tags; then
35674       modify_repo ":" > $CVSROOT_DIRNAME/CVSROOT/val-tags
35675    fi
35676    verify_tmp_empty "post $what"
35677
35678done # The big loop
35679
35680# Set up summary data for output.
35681skippedoutput=
35682warningsoutput=
35683extendedinfo=
35684if test $skipped -ne 0; then
35685  skippedoutput="$skipped test group"
35686  if test $skipped -ne 1; then
35687    skippedoutput="${skippedoutput}s"
35688  fi
35689  skippedoutput="$skippedoutput skipped"
35690fi
35691if test $warnings -ne 0; then
35692  warningsoutput="$warnings test"
35693  if test $warnings -ne 1; then
35694    warningsoutput="${warningsoutput}s"
35695  fi
35696  warningsoutput="$warningsoutput passed with warnings"
35697fi
35698if test -n "$skippedoutput" || test -n "$warningsoutput"; then
35699  extendedinfo=" ("
35700  if test -n "$skippedoutput"; then
35701    extendedinfo="$extendedinfo$skippedoutput"
35702  fi
35703  if test -n "$skippedoutput" && test -n "$warningsoutput"; then
35704    extendedinfo="$extendedinfo and "
35705  fi
35706  if test -n "$warningsoutput"; then
35707    extendedinfo="$extendedinfo$warningsoutput"
35708  fi
35709  extendedinfo="$extendedinfo)"
35710fi
35711
35712echo "OK, all $passed tests passed$extendedinfo."
35713
35714# TODO:
35715# * Test `cvs update -d foo' (where foo does not exist).
35716# * Test `cvs update foo bar' (where foo and bar are both from the
35717#   same directory in the repository).  Suppose one is a branch--make
35718#   sure that both directories get updated with the respective correct
35719#   thing.
35720# * `cvs update ../foo'.  Also ../../foo ./../foo foo/../../bar /foo/bar
35721#   foo/.././../bar foo/../bar etc.
35722# * Test all flags in modules file.
35723#   Test that ciprog gets run both on checkin in that directory, or a
35724#     higher-level checkin which recurses into it.
35725# * Test operations on a directory that contains other directories but has
35726#   no files of its own.
35727# * -t global option
35728# * cvs rm followed by cvs add or vice versa (with no checkin in between).
35729# * cvs rm twice (should be a nice error message).
35730# * -P option to checkout--(a) refrains from checking out new empty dirs,
35731#   (b) prunes empty dirs already there.
35732# * Test that cvs -d `hostname`:${TESTDIR}/non/existent co foo
35733#   gives an appropriate error (e.g.
35734#     Cannot access ${TESTDIR}/non-existent/CVSROOT
35735#     No such file or directory).
35736#   (like basica-9, but for remote).
35737# * Test ability to send notifications in response to watches.  (currently
35738#   hard to test because CVS doesn't send notifications if username is the
35739#   same).
35740# * Test the contents of adm files other than Root and Repository.
35741#   Entries seems the next most important thing.
35742# * Test the following compatibility issues:
35743#   - The filler fields in "D" entries in CVS/Entries get preserved
35744#     (per cvs.texinfo).
35745#   - Unrecognized entry types in CVS/Entries get ignored (looks like
35746#     this needs to be documented in cvs.texinfo, but is not)
35747#   - Test that unrecognized files in CVS directories (e.g. CVS/Foobar)
35748#     are ignored (per cvs.texinfo).
35749#   - Test 'cvs history' with symlinks in the path to the working directory.
35750#   - Remove most of the CVS_SERVER stuff after a reasonable amount of time.
35751#     The "fork" & "client" series of tests should be left.  4/2/00, CVS
35752#     1.11.0.1 was altered so that it would default to program_name (set from
35753#     argv[0]) rather than "cvs", but I'd like this script to work on legacy
35754#     versions of CVS for awhile.
35755#   - Testsuite doesn't work with usernames over eight characters in length.
35756#     Fix it.
35757# End of TODO list.
35758
35759# Exit if keep set
35760dokeep
35761
35762# Remove the test directory, but first change out of it.
35763if $TIMING; then
35764    echo "exiting without removing test dir in order to preserve timing information."
35765else
35766    cd `dirname $TESTDIR`
35767    rm -rf $TESTDIR
35768fi
35769
35770# end of sanity.sh
35771