PageRenderTime 120ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 2ms

/contrib/cvs/src/sanity.sh

https://bitbucket.org/freebsd/freebsd-head/
Shell | 15696 lines | 12386 code | 1394 blank | 1916 comment | 457 complexity | cceaf0e0b88c0126424fe2fefc488af9 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, BSD-3-Clause, LGPL-2.0, LGPL-2.1, BSD-2-Clause, 0BSD, JSON, AGPL-1.0, GPL-2.0
  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. # usage:
  21. usage ()
  22. {
  23. echo "Usage: `basename $0` --help"
  24. echo "Usage: `basename $0` [-eklrv] [-f FROM-TEST] [-h HOSTNAME] CVS-TO-TEST [TESTS-TO-RUN...]"
  25. }
  26. exit_usage ()
  27. {
  28. usage 1>&2
  29. exit 2
  30. }
  31. exit_help ()
  32. {
  33. usage
  34. echo
  35. echo "-H|--help Display this text."
  36. echo "-e|--skipfail Treat tests that would otherwise be nonfatally skipped"
  37. echo " for reasons like missing tools as failures, exiting"
  38. echo " with an error message. Also treat warnings as"
  39. echo " failures."
  40. echo "-f FROM-TEST Run TESTS-TO-RUN, skipping all tests in the list before"
  41. echo " FROM-TEST."
  42. echo "-h HOSTNAME Use :ext:HOSTNAME to run remote tests rather than"
  43. echo " :fork:. Implies --remote and assumes that \$TESTDIR"
  44. echo " resolves to the same directory on both the client and"
  45. echo " the server."
  46. echo "-k|--keep Try to keep directories created by individual tests"
  47. echo " around, exiting after the first test which supports"
  48. echo " --keep."
  49. echo "-l|--link-root"
  50. echo " Test CVS using a symlink to a real CVSROOT."
  51. echo "-r|--remote Test remote instead of local cvs."
  52. echo "-v|--verbose List test names as they are executed."
  53. echo
  54. echo "CVS-TO-TEST The path to the CVS executable to be tested."
  55. echo "TESTS-TO-RUN The names of the tests to run (defaults to all tests)."
  56. exit 2
  57. }
  58. # See TODO list at end of file.
  59. # required to make this script work properly.
  60. unset CVSREAD
  61. # This will cause malloc to run slower but should also catch some common errors
  62. # when CVS is linked with glibc 2.x.
  63. MALLOC_CHECK_=2; export MALLOC_CHECK_
  64. # We want to invoke a predictable set of i18n behaviors, not whatever
  65. # the user running this script might have set.
  66. # In particular:
  67. # 'sort' and tabs and spaces (LC_COLLATE).
  68. # Messages from getopt (LC_MESSAGES) (in the future, CVS itself might
  69. # also alter its messages based on LC_MESSAGES).
  70. LANG=C
  71. export LANG
  72. LC_ALL=C
  73. export LC_ALL
  74. #
  75. # Initialize the test counts.
  76. #
  77. passed=0
  78. skipped=0
  79. warnings=0
  80. #
  81. # read our options
  82. #
  83. unset fromtest
  84. unset remotehost
  85. keep=false
  86. linkroot=false
  87. remote=false
  88. skipfail=false
  89. verbose=false
  90. while getopts ef:h:Hklrv-: option ; do
  91. # convert the long opts to short opts
  92. if test x$option = x-; then
  93. case "$OPTARG" in
  94. [hH]|[hH][eE]|[hH][eE][lL]|[hH][eE][lL][pP])
  95. option=H;
  96. OPTARG=
  97. ;;
  98. [kK]|[kK][eE]|[kK][eE][eE]|[kK][eE][eE][pP])
  99. option=k;
  100. OPTARG=
  101. ;;
  102. l|li|lin|link|link-|link-r]|link-ro|link-roo|link-root)
  103. option=l;
  104. OPTARG=
  105. ;;
  106. [rR]|[rR][eE]|[rR][eE][mM]|[rR][eE][mM][oO]|[rR][eE][mM][oO][tT]|[rR][eE][mM][oO][tT][eE])
  107. option=k;
  108. OPTARG=
  109. ;;
  110. s|sk|ski|skip|skipf|skipfa|skipfai|skipfail)
  111. option=e
  112. OPTARG=
  113. ;;
  114. v|ve|ver|verb|verbo|verbos|verbose)
  115. option=v
  116. OPTARG=
  117. ;;
  118. *)
  119. option=\?
  120. OPTARG=
  121. esac
  122. fi
  123. case "$option" in
  124. e)
  125. skipfail=:
  126. ;;
  127. f)
  128. fromtest="$OPTARG"
  129. ;;
  130. h)
  131. # Set a remotehost to run the remote tests on via :ext:
  132. # Implies `-r' and assumes that $TESTDIR resolves to the same
  133. # directory on the client and the server.
  134. remotehost="$OPTARG"
  135. remote=:
  136. ;;
  137. H)
  138. exit_help
  139. ;;
  140. k)
  141. # The -k (keep) option will eventually cause all the tests to
  142. # leave around the contents of the /tmp directory; right now only
  143. # some implement it. Not originally intended to be useful with
  144. # more than one test, but this should work if each test uses a
  145. # uniquely named dir (use the name of the test).
  146. keep=:
  147. ;;
  148. l)
  149. linkroot=:
  150. ;;
  151. r)
  152. remote=:
  153. ;;
  154. v)
  155. verbose=:
  156. ;;
  157. \?)
  158. exit_usage
  159. ;;
  160. esac
  161. done
  162. # boot the arguments we used above
  163. while test $OPTIND -gt 1 ; do
  164. shift
  165. OPTIND=`expr $OPTIND - 1`
  166. done
  167. # Use full path for CVS executable, so that CVS_SERVER gets set properly
  168. # for remote.
  169. case $1 in
  170. "")
  171. exit_usage
  172. ;;
  173. /*)
  174. testcvs=$1
  175. ;;
  176. *)
  177. testcvs=`pwd`/$1
  178. ;;
  179. esac
  180. shift
  181. # If $remotehost is set, warn if $TESTDIR isn't since we are pretty sure
  182. # that its default value of `/tmp/cvs-sanity' will not resolve to the same
  183. # directory on two different machines.
  184. if test -n "$remotehost" && test -z "$TESTDIR"; then
  185. echo "WARNING: CVS server hostname is set and \$TESTDIR is not. If" >&2
  186. echo "$remotehost is not the local machine, then it is unlikely that" >&2
  187. echo "the default value assigned to \$TESTDIR will resolve to the same" >&2
  188. echo "directory on both this client and the CVS server." >&2
  189. fi
  190. ###
  191. ### GUTS
  192. ###
  193. # "debugger"
  194. #set -x
  195. echo 'This test should produce no other output than this message, and a final "OK".'
  196. echo '(Note that the test can take an hour or more to run and periodically stops'
  197. echo 'for as long as one minute. Do not assume there is a problem just because'
  198. echo 'nothing seems to happen for a long time. If you cannot live without'
  199. echo 'running status, use the -v option or try the command:'
  200. echo "\`tail -f check.log' from another window.)"
  201. # Regexp to match what CVS will call itself in output that it prints.
  202. # FIXME: we don't properly quote this--if the name contains . we'll
  203. # just spuriously match a few things; if the name contains other regexp
  204. # special characters we are probably in big trouble.
  205. PROG=`basename ${testcvs}`
  206. # Match the hostname
  207. hostname="[-_.a-zA-Z0-9]*"
  208. # Regexp to match the name of a temporary file (from cvs_temp_name).
  209. # This appears in certain diff output.
  210. tempname="[-a-zA-Z0-9/.%_]*"
  211. # Regexp to match a date in RFC822 format (as amended by RFC1123).
  212. RFCDATE="[a-zA-Z0-9 ][a-zA-Z0-9 ]* [0-9:][0-9:]* -0000"
  213. RFCDATE_EPOCH="1 Jan 1970 00:00:00 -0000"
  214. # Regexp to match a date in standard Unix format as used by rdiff
  215. # FIXCVS: There's no reason for rdiff to use a different date format
  216. # than diff does
  217. DATE="[a-zA-Z]* [a-zA-Z]* [ 1-3][0-9] [0-9:]* [0-9]*"
  218. # Which directories should Which and find_tool search for executables?
  219. SEARCHPATH=$PATH:/usr/local/bin:/usr/contrib/bin:/usr/contrib:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin:/sw/bin:/usr/pkg/bin
  220. # Do not assume that `type -p cmd` is portable
  221. # Usage: Which [-a] [-x|-f|-r] prog [$SEARCHPATH:/with/directories:/to/search]
  222. Which() {
  223. # Optional first argument for file type, defaults to -x.
  224. # Second argument is the file or directory to be found.
  225. # Third argument is the PATH to search.
  226. # By default, print only the first file that matches,
  227. # -a will cause all matches to be printed.
  228. notevery=:
  229. if [ "x$1" = "x-a" ]; then notevery=false; shift; fi
  230. case "$1" in
  231. -*) t=$1; shift ;;
  232. *) t=-x ;;
  233. esac
  234. case "$1" in
  235. # FIXME: Someday this may need to be fixed
  236. # to deal better with C:\some\path\to\ssh values...
  237. /*) test $t $1 && echo $1 ;;
  238. *) for d in `IFS=:; echo ${2-$SEARCHPATH}`
  239. do
  240. test $t $d/$1 && { echo $d/$1; if $notevery; then break; fi; }
  241. done
  242. ;;
  243. esac
  244. }
  245. # On cygwin32, we may not have /bin/sh.
  246. if test -r /bin/sh; then
  247. TESTSHELL="/bin/sh"
  248. else
  249. TESTSHELL=`Which -f sh`
  250. if test ! -r "$TESTSHELL"; then
  251. TESTSHELL="/bin/sh"
  252. fi
  253. fi
  254. # FIXME: try things (what things? checkins?) without -m.
  255. #
  256. # Some of these tests are written to expect -Q. But testing with
  257. # -Q is kind of bogus, it is not the way users actually use CVS (usually).
  258. # So new tests probably should invoke ${testcvs} directly, rather than ${CVS}.
  259. # and then they've obviously got to do something with the output....
  260. #
  261. CVS="${testcvs} -Q"
  262. LOGFILE=`pwd`/check.log
  263. # Save the previous log in case the person running the tests decides
  264. # they want to look at it. The extension ".plog" is chosen for consistency
  265. # with dejagnu.
  266. if test -f check.log; then
  267. mv check.log check.plog
  268. fi
  269. # Create the log file so check.log can be tailed almost immediately after
  270. # this script is started. Otherwise it can take up to a minute or two before
  271. # the log file gets created when $remotehost is specified on some systems,
  272. # which makes for a lot of failed `tail -f' attempts.
  273. touch check.log
  274. # Workaround any X11Forwarding by ssh. Otherwise this text:
  275. # Warning: No xauth data; using fake authentication data for X11 forwarding.
  276. # has been known to end up in the test results below
  277. # causing the test to fail.
  278. [ -n "$DISPLAY" ] && unset DISPLAY
  279. # The default value of /tmp/cvs-sanity for TESTDIR is dubious,
  280. # because it loses if two people/scripts try to run the tests
  281. # at the same time. Some possible solutions:
  282. # 1. Use /tmp/cvs-test$$. One disadvantage is that the old
  283. # cvs-test* directories would pile up, because they wouldn't
  284. # necessarily get removed.
  285. # 2. Have everyone/everything running the testsuite set
  286. # TESTDIR to some appropriate directory.
  287. # 3. Have the default value of TESTDIR be some variation of
  288. # `pwd`/cvs-sanity. The biggest problem here is that we have
  289. # been fairly careful to test that CVS prints in messages the
  290. # actual pathnames that we pass to it, rather than a different
  291. # pathname for the same directory, as may come out of `pwd`.
  292. # So this would be lost if everything was `pwd`-based. I suppose
  293. # if we wanted to get baroque we could start making symlinks
  294. # to ensure the two are different.
  295. : ${CVS_RSH=rsh}; export CVS_RSH
  296. if test -n "$remotehost"; then
  297. # We need to set $tmp on the server since $TMPDIR is compared against
  298. # messages generated by the server.
  299. tmp=`$CVS_RSH $remotehost 'cd /tmp; /bin/pwd || pwd' 2>/dev/null`
  300. if test $? != 0; then
  301. echo "$CVS_RSH $remotehost failed." >&2
  302. exit 1
  303. fi
  304. else
  305. tmp=`(cd /tmp; /bin/pwd || pwd) 2>/dev/null`
  306. fi
  307. # Now:
  308. # 1) Set TESTDIR if it's not set already
  309. # 2) Remove any old test remnants
  310. # 3) Create $TESTDIR
  311. # 4) Normalize TESTDIR with `cd && (/bin/pwd || pwd)`
  312. # (This will match CVS output later)
  313. : ${TESTDIR=$tmp/cvs-sanity}
  314. # clean any old remnants (we need the chmod because some tests make
  315. # directories read-only)
  316. if test -d ${TESTDIR}; then
  317. chmod -R a+wx ${TESTDIR}
  318. rm -rf ${TESTDIR}
  319. fi
  320. # These exits are important. The first time I tried this, if the `mkdir && cd`
  321. # failed then the build directory would get blown away. Some people probably
  322. # wouldn't appreciate that.
  323. mkdir ${TESTDIR} || exit 1
  324. cd ${TESTDIR} || exit 1
  325. # Ensure $TESTDIR is absolute
  326. if echo "${TESTDIR}" |grep '^[^/]'; then
  327. # Don't resolve this unless we have to. This keeps symlinks intact. This
  328. # is important at least when testing using -h $remotehost, because the same
  329. # value for $TESTDIR must resolve to the same directory on the client and
  330. # the server and we likely used Samba, and possibly symlinks, to do this.
  331. TESTDIR=`(/bin/pwd || pwd) 2>/dev/null`
  332. fi
  333. if test -z "${TESTDIR}" || echo "${TESTDIR}" |grep '^[^/]'; then
  334. echo "Unable to resolve TESTDIR to an absolute directory." >&2
  335. exit 1
  336. fi
  337. cd ${TESTDIR}
  338. # Now set $TMPDIR if the user hasn't overridden it.
  339. #
  340. # We use a $TMPDIR under $TESTDIR by default so that two tests may be run at
  341. # the same time without bumping heads without requiring the user to specify
  342. # more than $TESTDIR. See the test for leftover cvs-serv* directories near the
  343. # end of this script at the end of "The big loop".
  344. : ${TMPDIR=$TESTDIR/tmp}
  345. export TMPDIR
  346. if test -d $TMPDIR; then :; else
  347. mkdir $TMPDIR
  348. fi
  349. # Make sure various tools work the way we expect, or try to find
  350. # versions that do.
  351. : ${AWK=awk}
  352. : ${EXPR=expr}
  353. : ${ID=id}
  354. : ${TR=tr}
  355. # Keep track of tools that are found, but do NOT work as we hope
  356. # in order to avoid them in future
  357. badtools=
  358. set_bad_tool ()
  359. {
  360. badtools=$badtools:$1
  361. }
  362. is_bad_tool ()
  363. {
  364. case ":$badtools:" in *:$1:*) return 0 ;; *) return 1 ; esac
  365. }
  366. version_test ()
  367. {
  368. vercmd=$1
  369. verbad=:
  370. if RES=`$vercmd --version </dev/null 2>&1`; then
  371. if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
  372. echo "$RES"
  373. verbad=false
  374. fi
  375. fi
  376. if $verbad; then
  377. echo "The command \`$vercmd' does not support the --version option."
  378. fi
  379. # It does not really matter that --version is not supported
  380. return 0
  381. }
  382. # Try to find a tool that satisfies all of the tests.
  383. # Usage: list:of:colon:separated:alternatives test1 test2 test3 test4...
  384. # Example: find_tool awk:gawk:nawk awk_tooltest1 awk_tooltest2
  385. find_tool ()
  386. {
  387. default_TOOL=$1
  388. echo find_tool: ${1+"$@"} >>$LOGFILE
  389. cmds="`IFS=:; echo $1`"; shift; tooltests="${1+$@}"
  390. if test -z "$tooltests"; then tooltests=version_test; fi
  391. clist=; for cmd in $cmds; do clist="$clist `Which -a $cmd`"; done
  392. # Make sure the default tool is just the first real command name
  393. for default_TOOL in $clist `IFS=:; echo $default_TOOL`; do break; done
  394. TOOL=""
  395. for trytool in $clist ; do
  396. pass=:
  397. for tooltest in $tooltests; do
  398. result=`eval $tooltest $trytool`
  399. rc=$?
  400. echo "Running $tooltest $trytool" >>$LOGFILE
  401. if test -n "$result"; then
  402. echo "$result" >>$LOGFILE
  403. fi
  404. if test "$rc" = "0"; then
  405. echo "PASS: $tooltest $trytool" >>$LOGFILE
  406. elif test "$rc" = "77"; then
  407. echo "MARGINAL: $tooltest $trytool; rc=$rc" >>$LOGFILE
  408. TOOL=$trytool
  409. pass=false
  410. else
  411. set_bad_tool $trytool
  412. echo "FAIL: $tooltest $trytool; rc=$rc" >>$LOGFILE
  413. pass=false
  414. fi
  415. done
  416. if $pass; then
  417. echo $trytool
  418. return 0
  419. fi
  420. done
  421. if test -n "$TOOL"; then
  422. echo "Notice: The default version of \`$default_TOOL' is defective." >>$LOGFILE
  423. echo "using \`$TOOL' and hoping for the best." >>$LOGFILE
  424. echo "Notice: The default version of \`$default_TOOL' is defective." >&2
  425. echo "using \`$TOOL' and hoping for the best." >&2
  426. echo $TOOL
  427. else
  428. echo $default_TOOL
  429. fi
  430. }
  431. id_tool_test ()
  432. {
  433. id=$1
  434. if $id -u >/dev/null 2>&1 && $id -un >/dev/null 2>&1; then
  435. return 0
  436. else
  437. echo "Running these tests requires an \`id' program that understands the"
  438. echo "-u and -n flags. Make sure that such an id (GNU, or many but not"
  439. echo "all vendor-supplied versions) is in your path."
  440. return 1
  441. fi
  442. }
  443. ID=`find_tool id version_test id_tool_test`
  444. echo "Using ID=$ID" >>$LOGFILE
  445. # You can't run CVS as root; print a nice error message here instead
  446. # of somewhere later, after making a mess.
  447. for pass in false :; do
  448. case "`$ID -u 2>/dev/null`" in
  449. "0")
  450. echo "Test suite does not work correctly when run as root" >&2
  451. exit 1
  452. ;;
  453. *)
  454. break
  455. ;;
  456. esac
  457. done
  458. # Cause NextStep 3.3 users to lose in a more graceful fashion.
  459. expr_tooltest1 ()
  460. {
  461. expr=$1
  462. if $expr 'abc
  463. def' : 'abc
  464. def' >/dev/null; then
  465. # good, it works
  466. return 0
  467. else
  468. echo 'Running these tests requires an "expr" program that can handle'
  469. echo 'multi-line patterns. Make sure that such an expr (GNU, or many but'
  470. echo 'not all vendor-supplied versions) is in your path.'
  471. return 1
  472. fi
  473. }
  474. # Warn SunOS, SysVr3.2, etc., users that they may be partially losing
  475. # if we can't find a GNU expr to ease their troubles...
  476. expr_tooltest2 ()
  477. {
  478. expr=$1
  479. if $expr 'a
  480. b' : 'a
  481. c' >/dev/null; then
  482. echo 'WARNING: you are using a version of expr that does not correctly'
  483. echo 'match multi-line patterns. Some tests may spuriously pass or fail.'
  484. echo 'You may wish to make sure GNU expr is in your path.'
  485. return 1
  486. else
  487. return 0
  488. fi
  489. }
  490. expr_create_bar ()
  491. {
  492. echo 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >${TESTDIR}/foo
  493. cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
  494. cat ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar >${TESTDIR}/foo
  495. cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
  496. rm -f ${TESTDIR}/foo
  497. }
  498. expr_tooltest3 ()
  499. {
  500. expr=$1
  501. # More SunOS lossage...
  502. test ! -f ${TESTDIR}/bar && expr_create_bar
  503. if $expr "`cat ${TESTDIR}/bar`" : "`cat ${TESTDIR}/bar`" >/dev/null; then
  504. : good, it works
  505. else
  506. echo 'WARNING: you are using a version of expr that does not correctly'
  507. echo 'match large patterns. Some tests may spuriously pass or fail.'
  508. echo 'You may wish to make sure GNU expr is in your path.'
  509. return 1
  510. fi
  511. if $expr "`cat ${TESTDIR}/bar`x" : "`cat ${TESTDIR}/bar`y" >/dev/null; then
  512. echo 'WARNING: you are using a version of expr that does not correctly'
  513. echo 'match large patterns. Some tests may spuriously pass or fail.'
  514. echo 'You may wish to make sure GNU expr is in your path.'
  515. return 1
  516. fi
  517. # good, it works
  518. return 0
  519. }
  520. # That we should have to do this is total bogosity, but GNU expr
  521. # version 1.9.4-1.12 uses the emacs definition of "$" instead of the unix
  522. # (e.g. SunOS 4.1.3 expr) one. Rumor has it this will be fixed in the
  523. # next release of GNU expr after 1.12 (but we still have to cater to the old
  524. # ones for some time because they are in many linux distributions).
  525. ENDANCHOR="$"
  526. expr_set_ENDANCHOR ()
  527. {
  528. expr=$1
  529. ENDANCHOR="$"
  530. if $expr 'abc
  531. def' : 'abc$' >/dev/null; then
  532. ENDANCHOR='\'\'
  533. echo "Notice: An ENDANCHOR of dollar does not work."
  534. echo "Using a workaround for GNU expr versions 1.9.4 thru 1.12"
  535. fi
  536. return 0
  537. }
  538. # Work around another GNU expr (version 1.10-1.12) bug/incompatibility.
  539. # "." doesn't appear to match a newline (it does with SunOS 4.1.3 expr).
  540. # Note that the workaround is not a complete equivalent of .* because
  541. # the first parenthesized expression in the regexp must match something
  542. # in order for expr to return a successful exit status.
  543. # Rumor has it this will be fixed in the
  544. # next release of GNU expr after 1.12 (but we still have to cater to the old
  545. # ones for some time because they are in many linux distributions).
  546. DOTSTAR='.*'
  547. expr_set_DOTSTAR ()
  548. {
  549. expr=$1
  550. DOTSTAR='.*'
  551. if $expr 'abc
  552. def' : "a${DOTSTAR}f" >/dev/null; then
  553. : good, it works
  554. else
  555. DOTSTAR='\(.\|
  556. \)*'
  557. echo "Notice: DOTSTAR changed from sane \`.*' value to \`$DOTSTAR\`"
  558. echo "to workaround GNU expr version 1.10 thru 1.12 bug where \`.'"
  559. echo "does not match a newline."
  560. fi
  561. return 0
  562. }
  563. # Now that we have DOTSTAR, make sure it works with big matches
  564. expr_tooltest_DOTSTAR ()
  565. {
  566. expr=$1
  567. test ! -f ${TESTDIR}/bar && expr_create_bar
  568. if $expr "`cat ${TESTDIR}/bar`" : "${DOTSTAR}xyzABC${DOTSTAR}$" >/dev/null; then
  569. # good, it works
  570. return 0
  571. else
  572. echo 'WARNING: you are using a version of expr that does not correctly'
  573. echo 'match large patterns. Some tests may spuriously pass or fail.'
  574. echo 'You may wish to make sure GNU expr is in your path.'
  575. return 77
  576. fi
  577. }
  578. # FreeBSD 5.2 and 6.1 support 'expr [-e] expression'
  579. # They get confused unless '--' is used before the expressions
  580. # when those expressions begin with a '-' character, such as the
  581. # output of an ls -l command. The EXPR_COMPAT environment variable may
  582. # be used to go back to the non-POSIX behavior as an alternative.
  583. # (GNU expr appears to accept the '--' argument and work correctly or
  584. # not have it and still get the results we want.)
  585. exprDASHDASH='false'
  586. expr_set_DASHDASH ()
  587. {
  588. expr=$1
  589. exprDASHDASH='false'
  590. # Not POSIX, but works on a lot of expr versions.
  591. if $expr "-rw-rw-r--" : "-rw-rw-r--" >/dev/null 2>&1; then
  592. # good, it works
  593. return 0
  594. else
  595. # Do things in the POSIX manner.
  596. if $expr -- "-rw-rw-r--" : "-rw-rw-r--" >/dev/null 2>&1; then
  597. exprDASHDASH=':'
  598. return 0
  599. else
  600. echo 'WARNING: Your $expr does not correctly handle'
  601. echo 'leading "-" characters in regular expressions to'
  602. echo 'be matched. You may wish to see if there is an'
  603. echo 'environment variable or other setting to allow'
  604. echo 'POSIX functionality to be enabled.'
  605. return 77
  606. fi
  607. fi
  608. }
  609. EXPR=`find_tool ${EXPR}:gexpr \
  610. version_test expr_tooltest1 expr_tooltest2 expr_tooltest3 \
  611. expr_set_ENDANCHOR expr_set_DOTSTAR expr_tooltest_DOTSTAR`
  612. # Set the ENDANCHOR and DOTSTAR for the chosen expr version.
  613. expr_set_ENDANCHOR ${EXPR} >/dev/null
  614. expr_tooltest_DOTSTAR ${EXPR} >/dev/null
  615. # Is $EXPR a POSIX or non-POSIX implementation
  616. # with regard to command-line arguments?
  617. expr_set_DASHDASH ${EXPR}
  618. $exprDASHDASH && EXPR="$EXPR --"
  619. echo "Using EXPR=$EXPR" >>$LOGFILE
  620. echo "Using ENDANCHOR=$ENDANCHOR" >>$LOGFILE
  621. echo "Using DOTSTAR=$DOTSTAR" >>$LOGFILE
  622. # Cleanup
  623. rm -f ${TESTDIR}/bar
  624. # Work around yet another GNU expr (version 1.10) bug/incompatibility.
  625. # "+" is a special character, yet for unix expr (e.g. SunOS 4.1.3)
  626. # it is not. I doubt that POSIX allows us to use \+ and assume it means
  627. # (non-special) +, so here is another workaround
  628. # Rumor has it this will be fixed in the
  629. # next release of GNU expr after 1.12 (but we still have to cater to the old
  630. # ones for some time because they are in many linux distributions).
  631. PLUS='+'
  632. if $EXPR 'a +b' : "a ${PLUS}b" >/dev/null; then
  633. : good, it works
  634. else
  635. PLUS='\+'
  636. fi
  637. # Likewise, for ?
  638. QUESTION='?'
  639. if $EXPR 'a?b' : "a${QUESTION}b" >/dev/null; then
  640. : good, it works
  641. else
  642. QUESTION='\?'
  643. fi
  644. # Now test the username to make sure it contains only valid characters
  645. username=`$ID -un`
  646. if $EXPR "${username}" : "${username}" >/dev/null; then
  647. : good, it works
  648. else
  649. echo "Test suite does not work correctly when run by a username" >&2
  650. echo "containing regular expression meta-characters." >&2
  651. exit 1
  652. fi
  653. # Only 8 characters of $username appear in some output.
  654. if test `echo $username |wc -c` -gt 8; then
  655. username8=`echo $username |sed 's/^\(........\).*/\1/'`
  656. else
  657. username8=$username
  658. fi
  659. # Rarely, we need to match any username, not just the name of the user
  660. # running this test.
  661. #
  662. # I'm not really sure what characters should be here. a-zA-Z obviously.
  663. # People complained when 0-9 were not allowed in usernames. Other than that
  664. # I'm not sure.
  665. anyusername="[-a-zA-Z0-9][-a-zA-Z0-9]*"
  666. # now make sure that tr works on NULs
  667. tr_tooltest1 ()
  668. {
  669. tr=$1
  670. if $EXPR `echo "123" | $tr '2' '\0'` : "123" >/dev/null 2>&1; then
  671. echo 'Warning: you are using a version of tr which does not correctly'
  672. echo 'handle NUL bytes. Some tests may spuriously pass or fail.'
  673. echo 'You may wish to make sure GNU tr is in your path.'
  674. return 77
  675. fi
  676. # good, it works
  677. return 0
  678. }
  679. TR=`find_tool ${TR}:gtr version_test tr_tooltest1`
  680. echo "Using TR=$TR" >>$LOGFILE
  681. # Awk testing
  682. awk_tooltest1 ()
  683. {
  684. awk=$1
  685. $awk 'BEGIN {printf("one\ntwo\nthree\nfour\nfive\nsix")}' </dev/null >abc
  686. if $EXPR "`cat abc`" : \
  687. 'one
  688. two
  689. three
  690. four
  691. five
  692. six'; then
  693. rm abc
  694. return 0
  695. else
  696. rm abc
  697. echo "Notice: awk BEGIN clause or printf is not be working properly."
  698. return 1
  699. fi
  700. }
  701. # Format item %c check
  702. awk_tooltest2 ()
  703. {
  704. awk=$1
  705. $awk 'BEGIN { printf "%c%c%c", 2, 3, 4 }' </dev/null \
  706. | ${TR} '\002\003\004' '123' >abc
  707. if $EXPR "`cat abc`" : "123" ; then
  708. : good, found it
  709. else
  710. echo "Notice: awk format %c string may not be working properly."
  711. rm abc
  712. return 77
  713. fi
  714. rm abc
  715. return 0
  716. }
  717. AWK=`find_tool gawk:nawk:awk version_test awk_tooltest1 awk_tooltest2`
  718. echo "Using AWK=$AWK" >>$LOGFILE
  719. # Test that $1 works as a remote shell. If so, set $host, $CVS_RSH, &
  720. # $save_CVS_RSH to match and return 0. Otherwise, set $skipreason and return
  721. # 77.
  722. depends_on_rsh ()
  723. {
  724. host=${remotehost-"`hostname`"}
  725. result=`$1 $host 'echo test'`
  726. rc=$?
  727. if test $? != 0 || test "x$result" != "xtest"; then
  728. skipreason="\`$1 $host' failed rc=$rc result=$result"
  729. return 77
  730. fi
  731. save_CVS_RSH=$CVS_RSH
  732. CVS_RSH=$1; export CVS_RSH
  733. return 0
  734. }
  735. # Find a usable SSH. When a usable ssh is found, set $host, $CVS_RSH, and
  736. # $save_CVS_RSH and return 0. Otherwise, set $skipreason and return 77.
  737. depends_on_ssh ()
  738. {
  739. case "$CVS_RSH" in
  740. *ssh*|*putty*)
  741. tryssh=`Which $CVS_RSH`
  742. if [ ! -n "$tryssh" ]; then
  743. skipreason="Unable to find CVS_RSH=$CVS_RSH executable"
  744. return 77
  745. elif [ ! -x "$tryssh" ]; then
  746. skipreason="Unable to execute $tryssh program"
  747. return 77
  748. fi
  749. ;;
  750. *)
  751. # Look in the user's PATH for "ssh"
  752. tryssh=`Which ssh`
  753. if test ! -r "$tryssh"; then
  754. skipreason="Unable to find ssh program"
  755. return 77
  756. fi
  757. ;;
  758. esac
  759. depends_on_rsh "$tryssh"
  760. return $?
  761. }
  762. pass ()
  763. {
  764. echo "PASS: $1" >>${LOGFILE}
  765. passed=`expr $passed + 1`
  766. }
  767. # Like skip(), but don't fail when $skipfail is set.
  768. skip_always ()
  769. {
  770. echo "SKIP: $1${2+ ($2)}" >>$LOGFILE
  771. skipped=`expr $skipped + 1`
  772. }
  773. skip ()
  774. {
  775. if $skipfail; then
  776. fail "$1${2+ ($2)}"
  777. else
  778. echo "SKIP: $1${2+ ($2)}" >>$LOGFILE
  779. fi
  780. skipped=`expr $skipped + 1`
  781. }
  782. warn ()
  783. {
  784. if $skipfail; then
  785. fail "$1${2+ ($2)}"
  786. else
  787. echo "WARNING: $1${2+ ($2)}" >>$LOGFILE
  788. fi
  789. warnings=`expr $warnings + 1`
  790. }
  791. # Convenience function for skipping tests run only in local mode.
  792. localonly ()
  793. {
  794. skip_always $1 "only tested in local mode"
  795. }
  796. fail ()
  797. {
  798. echo "FAIL: $1" | tee -a ${LOGFILE}
  799. echo "*** Please see the \`TESTS' and \`check.log' files for more information." >&2
  800. # This way the tester can go and see what remnants were left
  801. exit 1
  802. }
  803. verify_tmp_empty ()
  804. {
  805. # Test our temp directory for cvs-serv* directories and cvsXXXXXX temp
  806. # files. We would like to not leave any behind.
  807. if $remote && ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
  808. # A true value means ls found files/directories with these names.
  809. # Give the server some time to finish, then retry.
  810. sleep 1
  811. if ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
  812. warn "$1" "Found cvs-serv* directories in $TMPDIR."
  813. # The above will exit if $skipfail
  814. rm -rf $TMPDIR/cvs-serv*
  815. fi
  816. fi
  817. if ls $TMPDIR/cvs?????? >/dev/null 2>&1; then
  818. # A true value means ls found files/directories with these names.
  819. warn "$1" "Found cvsXXXXXX temp files in $TMPDIR."
  820. # The above will exit if $skipfail
  821. rm -f ls $TMPDIR/cvs??????
  822. fi
  823. }
  824. # Restore changes to CVSROOT admin files.
  825. restore_adm ()
  826. {
  827. rm -rf $CVSROOT_DIRNAME/CVSROOT
  828. cp -Rp $TESTDIR/CVSROOT.save $CVSROOT_DIRNAME/CVSROOT
  829. }
  830. # See dotest and dotest_fail for explanation (this is the parts
  831. # of the implementation common to the two).
  832. dotest_internal ()
  833. {
  834. if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$3${ENDANCHOR}" >/dev/null; then
  835. # Why, I hear you ask, do we write this to the logfile
  836. # even when the test passes? The reason is that the test
  837. # may give us the regexp which we were supposed to match,
  838. # but sometimes it may be useful to look at the exact
  839. # text which was output. For example, suppose one wants
  840. # to grep for a particular warning, and make _sure_ that
  841. # CVS never hits it (even in cases where the tests might
  842. # match it with .*). Or suppose one wants to see the exact
  843. # date format output in a certain case (where the test will
  844. # surely use a somewhat non-specific pattern).
  845. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  846. pass "$1"
  847. verify_tmp_empty "$1"
  848. # expr can't distinguish between "zero characters matched" and "no match",
  849. # so special-case it.
  850. elif test -z "$3" && test ! -s ${TESTDIR}/dotest.tmp; then
  851. pass "$1"
  852. verify_tmp_empty "$1"
  853. elif test x"$4" != x; then
  854. if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$4${ENDANCHOR}" >/dev/null; then
  855. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  856. pass "$1"
  857. verify_tmp_empty "$1"
  858. else
  859. echo "** expected: " >>${LOGFILE}
  860. echo "$3" >>${LOGFILE}
  861. echo "$3" > ${TESTDIR}/dotest.ex1
  862. echo "** or: " >>${LOGFILE}
  863. echo "$4" >>${LOGFILE}
  864. echo "$4" > ${TESTDIR}/dotest.ex2
  865. echo "** got: " >>${LOGFILE}
  866. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  867. fail "$1"
  868. fi
  869. else
  870. echo "** expected: " >>${LOGFILE}
  871. echo "$3" >>${LOGFILE}
  872. echo "$3" > ${TESTDIR}/dotest.exp
  873. echo "** got: " >>${LOGFILE}
  874. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  875. fail "$1"
  876. fi
  877. }
  878. dotest_all_in_one ()
  879. {
  880. if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : \
  881. "`cat ${TESTDIR}/dotest.exp`" >/dev/null; then
  882. return 0
  883. fi
  884. return 1
  885. }
  886. # WARNING: this won't work with REs that match newlines....
  887. #
  888. dotest_line_by_line ()
  889. {
  890. line=1
  891. while [ $line -le `wc -l <${TESTDIR}/dotest.tmp` ] ; do
  892. if $EXPR "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" : \
  893. "`sed -n ${line}p ${TESTDIR}/dotest.exp`" >/dev/null; then
  894. :
  895. elif test -z "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" &&
  896. test -z "`sed -n ${line}p ${TESTDIR}/dotest.exp`"; then
  897. :
  898. else
  899. echo "Line $line:" >> ${LOGFILE}
  900. echo "**** expected: " >>${LOGFILE}
  901. sed -n ${line}p ${TESTDIR}/dotest.exp >>${LOGFILE}
  902. echo "**** got: " >>${LOGFILE}
  903. sed -n ${line}p ${TESTDIR}/dotest.tmp >>${LOGFILE}
  904. unset line
  905. return 1
  906. fi
  907. line=`expr $line + 1`
  908. done
  909. unset line
  910. return 0
  911. }
  912. # If you are having trouble telling which line of a multi-line
  913. # expression is not being matched, replace calls to dotest_internal()
  914. # with calls to this function:
  915. #
  916. dotest_internal_debug ()
  917. {
  918. if test -z "$3"; then
  919. if test -s ${TESTDIR}/dotest.tmp; then
  920. echo "** expected: " >>${LOGFILE}
  921. echo "$3" >>${LOGFILE}
  922. echo "$3" > ${TESTDIR}/dotest.exp
  923. rm -f ${TESTDIR}/dotest.ex2
  924. echo "** got: " >>${LOGFILE}
  925. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  926. fail "$1"
  927. else
  928. pass "$1"
  929. verify_tmp_empty "$1"
  930. fi
  931. else
  932. echo "$3" > ${TESTDIR}/dotest.exp
  933. if dotest_line_by_line "$1" "$2"; then
  934. pass "$1"
  935. verify_tmp_empty "$1"
  936. else
  937. if test x"$4" != x; then
  938. mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex1
  939. echo "$4" > ${TESTDIR}/dotest.exp
  940. if dotest_line_by_line "$1" "$2"; then
  941. pass "$1"
  942. verify_tmp_empty "$1"
  943. else
  944. mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex2
  945. echo "** expected: " >>${LOGFILE}
  946. echo "$3" >>${LOGFILE}
  947. echo "** or: " >>${LOGFILE}
  948. echo "$4" >>${LOGFILE}
  949. echo "** got: " >>${LOGFILE}
  950. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  951. fail "$1"
  952. fi
  953. else
  954. echo "** expected: " >>${LOGFILE}
  955. echo "$3" >>${LOGFILE}
  956. echo "** got: " >>${LOGFILE}
  957. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  958. fail "$1"
  959. fi
  960. fi
  961. fi
  962. }
  963. # Usage:
  964. # dotest TESTNAME COMMAND OUTPUT [OUTPUT2]
  965. # TESTNAME is the name used in the log to identify the test.
  966. # COMMAND is the command to run; for the test to pass, it exits with
  967. # exitstatus zero.
  968. # OUTPUT is a regexp which is compared against the output (stdout and
  969. # stderr combined) from the test. It is anchored to the start and end
  970. # of the output, so should start or end with ".*" if that is what is desired.
  971. # Trailing newlines are stripped from the command's actual output before
  972. # matching against OUTPUT.
  973. # If OUTPUT2 is specified and the output matches it, then it is also
  974. # a pass (partial workaround for the fact that some versions of expr
  975. # lack \|).
  976. dotest ()
  977. {
  978. rm -f ${TESTDIR}/dotest.ex? 2>&1
  979. eval "$2" >${TESTDIR}/dotest.tmp 2>&1
  980. status=$?
  981. if test "$status" != 0; then
  982. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  983. echo "exit status was $status" >>${LOGFILE}
  984. fail "$1"
  985. fi
  986. dotest_internal "$@"
  987. }
  988. # Like dotest except only 2 args and result must exactly match stdin
  989. dotest_lit ()
  990. {
  991. rm -f ${TESTDIR}/dotest.ex? 2>&1
  992. eval "$2" >${TESTDIR}/dotest.tmp 2>&1
  993. status=$?
  994. if test "$status" != 0; then
  995. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  996. echo "exit status was $status" >>${LOGFILE}
  997. fail "$1"
  998. fi
  999. cat >${TESTDIR}/dotest.exp
  1000. if cmp ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.tmp >/dev/null 2>&1; then
  1001. pass "$1"
  1002. verify_tmp_empty "$1"
  1003. else
  1004. echo "** expected: " >>${LOGFILE}
  1005. cat ${TESTDIR}/dotest.exp >>${LOGFILE}
  1006. echo "** got: " >>${LOGFILE}
  1007. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  1008. fail "$1"
  1009. fi
  1010. }
  1011. # Like dotest except exitstatus should be nonzero.
  1012. dotest_fail ()
  1013. {
  1014. rm -f ${TESTDIR}/dotest.ex? 2>&1
  1015. eval "$2" >${TESTDIR}/dotest.tmp 2>&1
  1016. status=$?
  1017. if test "$status" = 0; then
  1018. cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
  1019. echo "exit status was $status" >>${LOGFILE}
  1020. fail "$1"
  1021. fi
  1022. dotest_internal "$@"
  1023. }
  1024. # Like dotest except output is sorted.
  1025. dotest_sort ()
  1026. {
  1027. rm -f ${TESTDIR}/dotest.ex? 2>&1
  1028. eval "$2" >${TESTDIR}/dotest.tmp1 2>&1
  1029. status=$?
  1030. if test "$status" != 0; then
  1031. cat ${TESTDIR}/dotest.tmp1 >>${LOGFILE}
  1032. echo "exit status was $status" >>${LOGFILE}
  1033. fail "$1"
  1034. fi
  1035. ${TR} ' ' ' ' < ${TESTDIR}/dotest.tmp1 | sort > ${TESTDIR}/dotest.tmp
  1036. dotest_internal "$@"
  1037. }
  1038. # A function for fetching the timestamp of a revison of a file
  1039. getrlogdate () {
  1040. ${testcvs} -n rlog -N ${1+"$@"} |
  1041. while read token value; do
  1042. case "$token" in
  1043. date:)
  1044. echo $value | sed "s,;.*,,"
  1045. break;
  1046. ;;
  1047. esac
  1048. done
  1049. }
  1050. # Avoid picking up any stray .cvsrc, etc., from the user running the tests
  1051. mkdir home
  1052. HOME=${TESTDIR}/home; export HOME
  1053. # Make sure this variable is not defined to anything that would
  1054. # change the format of rcs dates. Otherwise people using e.g.,
  1055. # RCSINIT=-zLT get lots of spurious failures.
  1056. RCSINIT=; export RCSINIT
  1057. # Remaining arguments are the names of tests to run.
  1058. #
  1059. # The testsuite is broken up into (hopefully manageably-sized)
  1060. # independently runnable tests, so that one can quickly get a result
  1061. # from a cvs or testsuite change, and to facilitate understanding the
  1062. # tests.
  1063. if test x"$*" = x; then
  1064. # Basic/miscellaneous functionality
  1065. tests="version basica basicb basicc basic1 deep basic2"
  1066. tests="${tests} parseroot parseroot2 files spacefiles commit-readonly"
  1067. tests="${tests} commit-add-missing"
  1068. tests="$tests add-restricted"
  1069. tests="${tests} status"
  1070. # Branching, tagging, removing, adding, multiple directories
  1071. tests="${tests} rdiff rdiff-short"
  1072. tests="${tests} rdiff2 diff diffnl death death2 death-rtag"
  1073. tests="${tests} rm-update-message rmadd rmadd2 rmadd3 resurrection"
  1074. tests="${tests} dirs dirs2 branches branches2 tagc tagf "
  1075. tests="${tests} tag-log tag-space"
  1076. tests="${tests} rcslib multibranch import importb importc import-CVS"
  1077. tests="$tests import-quirks"
  1078. tests="${tests} update-p import-after-initial branch-after-import"
  1079. tests="${tests} join join2 join3 join4 join5 join6 join7 join8 join9"
  1080. tests="${tests} join-readonly-conflict join-admin join-admin-2"
  1081. tests="${tests} join-rm"
  1082. tests="${tests} new newb conflicts conflicts2 conflicts3 conflicts4"
  1083. tests="${tests} clean"
  1084. # Checking out various places (modules, checkout -d, &c)
  1085. tests="${tests} modules modules2 modules3 modules4 modules5 modules6"
  1086. tests="${tests} modules7 mkmodules co-d"
  1087. tests="${tests} cvsadm emptydir abspath abspath2 toplevel toplevel2"
  1088. tests="${tests} rstar-toplevel trailingslashes checkout_repository"
  1089. # Log messages, error messages.
  1090. tests="${tests} mflag editor errmsg1 errmsg2 adderrmsg opterrmsg"
  1091. # Watches, binary files, history browsing, &c.
  1092. tests="${tests} devcom devcom2 devcom3 watch4 watch5 watch6"
  1093. tests="${tests} unedit-without-baserev"
  1094. tests="${tests} ignore ignore-on-branch binfiles binfiles2 binfiles3"
  1095. tests="${tests} mcopy binwrap binwrap2"
  1096. tests="${tests} binwrap3 mwrap info taginfo config"
  1097. tests="${tests} serverpatch log log2 logopt ann ann-id"
  1098. # Repository Storage (RCS file format, CVS lock files, creating
  1099. # a repository without "cvs init", &c).
  1100. tests="${tests} crerepos crerepos-extssh rcs rcs2 rcs3 rcs4 rcs5 rcs6"
  1101. tests="$tests lockfiles backuprecover"
  1102. tests="${tests} sshstdio"
  1103. # More history browsing, &c.
  1104. tests="${tests} history"
  1105. tests="${tests} big modes modes2 modes3 stamps"
  1106. # PreservePermissions stuff: permissions, symlinks et al.
  1107. # tests="${tests} perms symlinks symlinks2 hardlinks"
  1108. # More tag and branch tests, keywords.
  1109. tests="${tests} sticky keyword keywordlog keywordname keyword2"
  1110. tests="${tests} head tagdate multibranch2 tag8k"
  1111. # "cvs admin", reserved checkouts.
  1112. tests="${tests} admin reserved"
  1113. # Nuts and bolts of diffing/merging (diff library, &c)
  1114. tests="${tests} diffmerge1 diffmerge2"
  1115. # Release of multiple directories
  1116. tests="${tests} release"
  1117. tests="${tests} recase"
  1118. # Multiple root directories and low-level protocol tests.
  1119. tests="${tests} multiroot multiroot2 multiroot3 multiroot4"
  1120. tests="$tests rmroot reposmv pserver server server2 server3"
  1121. tests="$tests client client2"
  1122. tests="${tests} dottedroot fork commit-d"
  1123. else
  1124. tests="$*"
  1125. fi
  1126. # Now check the -f argument for validity.
  1127. if test -n "$fromtest"; then
  1128. # Don't allow spaces - they are our delimiters in tests
  1129. count=0
  1130. for sub in $fromtest; do
  1131. count=`expr $count + 1`
  1132. done
  1133. if test $count != 1; then
  1134. echo "No such test \`$fromtest'." >&2
  1135. exit 2
  1136. fi
  1137. # make sure it is in $tests
  1138. case " $tests " in
  1139. *" $fromtest "*)
  1140. ;;
  1141. *)
  1142. echo "No such test \`$fromtest'." >&2
  1143. exit 2
  1144. ;;
  1145. esac
  1146. fi
  1147. # a simple function to compare directory contents
  1148. #
  1149. # Returns: 0 for same, 1 for different
  1150. #
  1151. directory_cmp ()
  1152. {
  1153. OLDPWD=`pwd`
  1154. DIR_1=$1
  1155. DIR_2=$2
  1156. cd $DIR_1
  1157. find . -print | fgrep -v /CVS | sort > $TESTDIR/dc$$d1
  1158. # go back where we were to avoid symlink hell...
  1159. cd $OLDPWD
  1160. cd $DIR_2
  1161. find . -print | fgrep -v /CVS | sort > $TESTDIR/dc$$d2
  1162. if diff $TESTDIR/dc$$d1 $TESTDIR/dc$$d2 >/dev/null 2>&1
  1163. then
  1164. :
  1165. else
  1166. return 1
  1167. fi
  1168. cd $OLDPWD
  1169. while read a
  1170. do
  1171. if test -f $DIR_1/"$a" ; then
  1172. cmp -s $DIR_1/"$a" $DIR_2/"$a"
  1173. if test $? -ne 0 ; then
  1174. return 1
  1175. fi
  1176. fi
  1177. done < $TESTDIR/dc$$d1
  1178. rm -f $TESTDIR/dc$$*
  1179. return 0
  1180. }
  1181. #
  1182. # The following 4 functions are used by the diffmerge1 test case. They set up,
  1183. # respectively, the four versions of the files necessary:
  1184. #
  1185. # 1. Ancestor revisions.
  1186. # 2. "Your" changes.
  1187. # 3. "My" changes.
  1188. # 4. Expected merge result.
  1189. #
  1190. # Create ancestor revisions for diffmerge1
  1191. diffmerge_create_older_files() {
  1192. # This test case was supplied by Noah Friedman:
  1193. cat >testcase01 <<EOF
  1194. // Button.java
  1195. package random.application;
  1196. import random.util.*;
  1197. public class Button
  1198. {
  1199. /* Instantiates a Button with origin (0, 0) and zero width and height.
  1200. * You must call an initializer method to properly initialize the Button.
  1201. */
  1202. public Button ()
  1203. {
  1204. super ();
  1205. _titleColor = Color.black;
  1206. _disabledTitleColor = Color.gray;
  1207. _titleFont = Font.defaultFont ();
  1208. }
  1209. /* Convenience constructor for instantiating a Button with
  1210. * bounds x, y, width, and height. Equivalent to
  1211. * foo = new Button ();
  1212. * foo.init (x, y, width, height);
  1213. */
  1214. public Button (int x, int y, int width, int height)
  1215. {
  1216. this ();
  1217. init (x, y, width, height);
  1218. }
  1219. }
  1220. EOF
  1221. # This test case was supplied by Jacob Burckhardt:
  1222. cat >testcase02 <<EOF
  1223. a
  1224. a
  1225. a
  1226. a
  1227. a
  1228. EOF
  1229. # This test case was supplied by Karl Tomlinson who also wrote the
  1230. # patch which lets CVS correctly handle this and several other cases:
  1231. cat >testcase03 <<EOF
  1232. x
  1233. s
  1234. a
  1235. b
  1236. s
  1237. y
  1238. EOF
  1239. # This test case was supplied by Karl Tomlinson:
  1240. cat >testcase04 <<EOF
  1241. s
  1242. x
  1243. m
  1244. m
  1245. x
  1246. s
  1247. v
  1248. s
  1249. x
  1250. m
  1251. m
  1252. x
  1253. s
  1254. EOF
  1255. # This test case was supplied by Karl Tomlinson:
  1256. cat >testcase05 <<EOF
  1257. s
  1258. x
  1259. m
  1260. m
  1261. x
  1262. x
  1263. x
  1264. x
  1265. x
  1266. x
  1267. x
  1268. x
  1269. x
  1270. x
  1271. s
  1272. s
  1273. s
  1274. s
  1275. s
  1276. s
  1277. s
  1278. s
  1279. s
  1280. s
  1281. v
  1282. EOF
  1283. # This test case was supplied by Jacob Burckhardt:
  1284. cat >testcase06 <<EOF
  1285. g
  1286. i
  1287. EOF
  1288. # This test is supposed to verify that the horizon lines are the same
  1289. # for both 2-way diffs, but unfortunately, it does not fail with the
  1290. # old version of cvs. However, Karl Tomlinson still thought it would
  1291. # be good to test it anyway:
  1292. cat >testcase07 <<EOF
  1293. h
  1294. f
  1295. g
  1296. r
  1297. i
  1298. i
  1299. EOF
  1300. # This test case was supplied by Jacob Burckhardt:
  1301. cat >testcase08 <<EOF
  1302. Both changes move this line to the end of the file.
  1303. no
  1304. changes
  1305. here
  1306. First change will delete this line.
  1307. First change will also delete this line.
  1308. no
  1309. changes
  1310. here
  1311. Second change will change it here.
  1312. no
  1313. changes
  1314. here
  1315. EOF
  1316. # This test case was supplied by Jacob Burckhardt. Note that I do not
  1317. # think cvs has ever failed with this case, but I include it anyway,
  1318. # since I think it is a hard case. It is hard because Peter Miller's
  1319. # fmerge utility fails on it:
  1320. cat >testcase09 <<EOF
  1321. m
  1322. a
  1323. {
  1324. }
  1325. b
  1326. {
  1327. }
  1328. EOF
  1329. # This test case was supplied by Martin Dorey and simplified by Jacob
  1330. # Burckhardt:
  1331. cat >testcase10 <<EOF
  1332. petRpY ( MtatRk );
  1333. fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
  1334. MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
  1335. OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
  1336. Bloke_GttpfIRte_MtpeaL ( &acI );
  1337. MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
  1338. {
  1339. fV ( Y < 16 )
  1340. {
  1341. petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
  1342. Y * jfle_Uecopd_MfJe_fY_Mectopk,
  1343. jfle_Uecopd_MfJe_fY_Mectopk,
  1344. nRVVep ) );
  1345. }
  1346. elke
  1347. {
  1348. petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
  1349. ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
  1350. jfle_Uecopd_MfJe_fY_Mectopk,
  1351. nRVVep ) );
  1352. }
  1353. }
  1354. /****************************************************************************
  1355. * *
  1356. * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
  1357. * *
  1358. ****************************************************************************/
  1359. MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
  1360. {
  1361. MTGTXM MtatRk = Zy;
  1362. MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
  1363. petRpY ( MtatRk );
  1364. }
  1365. HfkQipfte ( waYdle, /* waYdle */
  1366. waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
  1367. (coYkt RfYt8*) nRVVep, /* nRVVep */
  1368. 0, /* MRrepVlRoRk KfxoYfkL */
  1369. beYgtz /* nEtek to Apfte */
  1370. );
  1371. petRpY ( Zy );
  1372. }
  1373. EOF
  1374. }
  1375. # Create "your" revisions for diffmerge1
  1376. diffmerge_create_your_files() {
  1377. # remove the Button() method
  1378. cat >testcase01 <<\EOF
  1379. // Button.java
  1380. package random.application;
  1381. import random.util.*;
  1382. public class Button
  1383. {
  1384. /* Instantiates a Button with origin (0, 0) and zero width and height.
  1385. * You must call an initializer method to properly initialize the Button.
  1386. */
  1387. public Button ()
  1388. {
  1389. super ();
  1390. _titleColor = Color.black;
  1391. _disabledTitleColor = Color.gray;
  1392. _titleFont = Font.defaultFont ();
  1393. }
  1394. }
  1395. EOF
  1396. cat >testcase02 <<\EOF
  1397. y
  1398. a
  1399. a
  1400. a
  1401. a
  1402. EOF
  1403. cat >testcase03 <<\EOF
  1404. x
  1405. s
  1406. a
  1407. b
  1408. s
  1409. b
  1410. s
  1411. y
  1412. EOF
  1413. cat >testcase04 <<\EOF
  1414. s
  1415. m
  1416. s
  1417. v
  1418. s
  1419. m
  1420. s
  1421. EOF
  1422. cat >testcase05 <<\EOF
  1423. v
  1424. s
  1425. m
  1426. s
  1427. s
  1428. s
  1429. s
  1430. s
  1431. s
  1432. s
  1433. s
  1434. s
  1435. s
  1436. v
  1437. EOF
  1438. # Test case 6 and test case 7 both use the same input files, but they
  1439. # order the input files differently. In one case, a certain file is
  1440. # used as the older file, but in the other test case, that same file
  1441. # is used as the file which has changes. I could have put echo
  1442. # commands here, but since the echo lines would be the same as those
  1443. # in the previous function, I decided to save space and avoid repeating
  1444. # several lines of code. Instead, I merely swap the files:
  1445. mv testcase07 tmp
  1446. mv testcase06 testcase07
  1447. mv tmp testcase06
  1448. # Make the date newer so that cvs thinks that the files are changed:
  1449. touch testcase06 testcase07
  1450. cat >testcase08 <<\EOF
  1451. no
  1452. changes
  1453. here
  1454. First change has now added this in.
  1455. no
  1456. changes
  1457. here
  1458. Second change will change it here.
  1459. no
  1460. changes
  1461. here
  1462. Both changes move this line to the end of the file.
  1463. EOF
  1464. cat >testcase09 <<\EOF
  1465. m
  1466. a
  1467. {
  1468. }
  1469. b
  1470. {
  1471. }
  1472. c
  1473. {
  1474. }
  1475. EOF
  1476. cat >testcase10 <<\EOF
  1477. fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
  1478. petRpY ( MtatRk );
  1479. fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
  1480. fV ( jfle_Uecopd_KRLIep < 16 )
  1481. {
  1482. MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
  1483. }
  1484. elke
  1485. {
  1486. MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
  1487. fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
  1488. MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
  1489. OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
  1490. Bloke_GttpfIRte_MtpeaL ( &acI );
  1491. MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
  1492. {
  1493. MTGTXM MtatRk = Zy;
  1494. fV ( Y < 16 )
  1495. {
  1496. petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
  1497. Y * jfle_Uecopd_MfJe_fY_Mectopk,
  1498. jfle_Uecopd_MfJe_fY_Mectopk,
  1499. nRVVep ) );
  1500. }
  1501. elke
  1502. {
  1503. petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
  1504. ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
  1505. jfle_Uecopd_MfJe_fY_Mectopk,
  1506. nRVVep ) );
  1507. }
  1508. petRpY ( MtatRk );
  1509. }
  1510. /****************************************************************************
  1511. * *
  1512. * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
  1513. * *
  1514. ****************************************************************************/
  1515. MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
  1516. {
  1517. MTGTXM MtatRk = Zy;
  1518. MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
  1519. petRpY ( MtatRk );
  1520. }
  1521. HfkQipfte ( waYdle, /* waYdle */
  1522. waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
  1523. (coYkt RfYt8*) nRVVep, /* nRVVep */
  1524. 0, /* MRrepVlRoRk KfxoYfkL */
  1525. beYgtz /* nEtek to Apfte */
  1526. );
  1527. petRpY ( Zy );
  1528. }
  1529. EOF
  1530. }
  1531. # Create "my" revisions for diffmerge1
  1532. diffmerge_create_my_files() {
  1533. # My working copy still has the Button() method, but I
  1534. # comment out some code at the top of the class.
  1535. cat >testcase01 <<\EOF
  1536. // Button.java
  1537. package random.application;
  1538. import random.util.*;
  1539. public class Button
  1540. {
  1541. /* Instantiates a Button with origin (0, 0) and zero width and height.
  1542. * You must call an initializer method to properly initialize the Button.
  1543. */
  1544. public Button ()
  1545. {
  1546. super ();
  1547. // _titleColor = Color.black;
  1548. // _disabledTitleColor = Color.gray;
  1549. // _titleFont = Font.defaultFont ();
  1550. }
  1551. /* Convenience constructor for instantiating a Button with
  1552. * bounds x, y, width, and height. Equivalent to
  1553. * foo = new Button ();
  1554. * foo.init (x, y, width, height);
  1555. */
  1556. public Button (int x, int y, int width, int height)
  1557. {
  1558. this ();
  1559. init (x, y, width, height);
  1560. }
  1561. }
  1562. EOF
  1563. cat >testcase02 <<\EOF
  1564. a
  1565. a
  1566. a
  1567. a
  1568. m
  1569. EOF
  1570. cat >testcase03 <<\EOF
  1571. x
  1572. s
  1573. c
  1574. s
  1575. b
  1576. s
  1577. y
  1578. EOF
  1579. cat >testcase04 <<\EOF
  1580. v
  1581. s
  1582. x
  1583. m
  1584. m
  1585. x
  1586. s
  1587. v
  1588. s
  1589. x
  1590. m
  1591. m
  1592. x
  1593. s
  1594. v
  1595. EOF
  1596. # Note that in test case 5, there are no changes in the "mine"
  1597. # section, which explains why there is no command here which writes to
  1598. # file testcase05.
  1599. # no changes for testcase06
  1600. # The two branches make the same changes:
  1601. cp ../yours/testcase07 .
  1602. cat >testcase08 <<\EOF
  1603. no
  1604. changes
  1605. here
  1606. First change will delete this line.
  1607. First change will also delete this line.
  1608. no
  1609. changes
  1610. here
  1611. Second change has now changed it here.
  1612. no
  1613. changes
  1614. here
  1615. Both changes move this line to the end of the file.
  1616. EOF
  1617. cat >testcase09 <<\EOF
  1618. m
  1619. a
  1620. {
  1621. }
  1622. b
  1623. {
  1624. }
  1625. c
  1626. {
  1627. }
  1628. EOF
  1629. cat >testcase10 <<\EOF
  1630. petRpY ( MtatRk );
  1631. fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
  1632. MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
  1633. OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
  1634. Bloke_GttpfIRte_MtpeaL ( &acI );
  1635. MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
  1636. {
  1637. fV ( Y < 16 )
  1638. {
  1639. petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
  1640. Y * jfle_Uecopd_MfJe_fY_Mectopk,
  1641. jfle_Uecopd_MfJe_fY_Mectopk,
  1642. nRVVep ) );
  1643. }
  1644. elke
  1645. {
  1646. petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
  1647. ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
  1648. jfle_Uecopd_MfJe_fY_Mectopk,
  1649. nRVVep ) );
  1650. }
  1651. }
  1652. /****************************************************************************
  1653. * *
  1654. * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
  1655. * *
  1656. ****************************************************************************/
  1657. MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
  1658. {
  1659. MTGTXM MtatRk = Zy;
  1660. MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
  1661. petRpY ( MtatRk );
  1662. }
  1663. HfkQipfte ( waYdle, /* waYdle */
  1664. waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
  1665. (coYkt RfYt8*) nRVVep, /* nRVVep */
  1666. beYgtz /* nEtek to Apfte */
  1667. );
  1668. petRpY ( Zy );
  1669. }
  1670. EOF
  1671. }
  1672. # Create expected results of merge for diffmerge1
  1673. diffmerge_create_expected_files() {
  1674. cat >testcase01 <<\EOF
  1675. // Button.java
  1676. package random.application;
  1677. import random.util.*;
  1678. public class Button
  1679. {
  1680. /* Instantiates a Button with origin (0, 0) and zero width and height.
  1681. * You must call an initializer method to properly initialize the Button.
  1682. */
  1683. public Button ()
  1684. {
  1685. super ();
  1686. // _titleColor = Color.black;
  1687. // _disabledTitleColor = Color.gray;
  1688. // _titleFont = Font.defaultFont ();
  1689. }
  1690. }
  1691. EOF
  1692. cat >testcase02 <<\EOF
  1693. y
  1694. a
  1695. a
  1696. a
  1697. m
  1698. EOF
  1699. cat >testcase03 <<\EOF
  1700. x
  1701. s
  1702. c
  1703. s
  1704. b
  1705. s
  1706. b
  1707. s
  1708. y
  1709. EOF
  1710. cat >testcase04 <<\EOF
  1711. v
  1712. s
  1713. m
  1714. s
  1715. v
  1716. s
  1717. m
  1718. s
  1719. v
  1720. EOF
  1721. # Since there are no changes in the "mine" section, just take exactly
  1722. # the version in the "yours" section:
  1723. cp ../yours/testcase05 .
  1724. cp ../yours/testcase06 .
  1725. # Since the two branches make the same changes, the result should be
  1726. # the same as both branches. Here, I happen to pick yours to copy from,
  1727. # but I could have also picked mine, since the source of the copy is
  1728. # the same in either case. However, the mine has already been
  1729. # altered by the update command, so don't use it. Instead, use the
  1730. # yours section which has not had an update on it and so is unchanged:
  1731. cp ../yours/testcase07 .
  1732. cat >testcase08 <<\EOF
  1733. no
  1734. changes
  1735. here
  1736. First change has now added this in.
  1737. no
  1738. changes
  1739. here
  1740. Second change has now changed it here.
  1741. no
  1742. changes
  1743. here
  1744. Both changes move this line to the end of the file.
  1745. EOF
  1746. cat >testcase09 <<\EOF
  1747. m
  1748. a
  1749. {
  1750. }
  1751. b
  1752. {
  1753. }
  1754. c
  1755. {
  1756. }
  1757. EOF
  1758. cat >testcase10 <<\EOF
  1759. fV ( BzQkV_URYYfYg ) (*jfle_Uecopdk)[0].jfle_Uecopd_KRLIep = ZpfgfYal_jUK;
  1760. petRpY ( MtatRk );
  1761. fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
  1762. fV ( jfle_Uecopd_KRLIep < 16 )
  1763. {
  1764. MtatRk = Uead_Ktz_qjT_jfle_Uecopd ( jfle_Uecopd_KRLIep, (uofd*)nRVVep );
  1765. }
  1766. elke
  1767. {
  1768. MtatRk = ZreY_GttpfIRte_MtpeaL ( qjT_jfle_Uecopdk, qjT_jfle_Uecopd_BoRYt, HGTG_TvFD, KXbb, KXbb, &acI );
  1769. fV ( MtatRk != Zy ) UDTXUK_DUUZU ( BGKT_ZFDK_qjT_HGTG );
  1770. MtatRk = MQfr_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_KRLIep * jfle_Uecopd_MfJe_fY_nEtek );
  1771. OjZy MtatRk = Uead_GttpfIRte_MtpeaL ( &acI, jfle_Uecopd_MfJe_fY_nEtek, nRVVep );
  1772. Bloke_GttpfIRte_MtpeaL ( &acI );
  1773. MTGTXM Uead_Ktz_qjT_jfle_Uecopd ( fYt Y, uofd *nRVVep )
  1774. {
  1775. MTGTXM MtatRk = Zy;
  1776. fV ( Y < 16 )
  1777. {
  1778. petRpY ( Uead_Mectopk ( noot_Uecopd.qVtHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
  1779. Y * jfle_Uecopd_MfJe_fY_Mectopk,
  1780. jfle_Uecopd_MfJe_fY_Mectopk,
  1781. nRVVep ) );
  1782. }
  1783. elke
  1784. {
  1785. petRpY ( Uead_Mectopk ( noot_Uecopd.qVtqfppHatabcY0 * noot_Uecopd.MectopkFepBlRktep +
  1786. ( Y - 16 ) * jfle_Uecopd_MfJe_fY_Mectopk,
  1787. jfle_Uecopd_MfJe_fY_Mectopk,
  1788. nRVVep ) );
  1789. }
  1790. petRpY ( MtatRk );
  1791. }
  1792. /****************************************************************************
  1793. * *
  1794. * Uead Mectopk ( Uelatfue to tze cRppeYt raptftfoY ) *
  1795. * *
  1796. ****************************************************************************/
  1797. MTGTXM Uead_Mectopk ( RfYt64 Mtapt_Mectop, RfYt64 KRL_Mectopk, uofd *nRVVep )
  1798. {
  1799. MTGTXM MtatRk = Zy;
  1800. MtatRk = Uead_HfkQ ( FaptftfoY_TaIle.Uelatfue_Mectop + Mtapt_Mectop, KRL_Mectopk, nRVVep );
  1801. petRpY ( MtatRk );
  1802. }
  1803. HfkQipfte ( waYdle, /* waYdle */
  1804. waYdleFok, /* ZVVket VpoL ktapt oV dfkQ */
  1805. (coYkt RfYt8*) nRVVep, /* nRVVep */
  1806. beYgtz /* nEtek to Apfte */
  1807. );
  1808. petRpY ( Zy );
  1809. }
  1810. EOF
  1811. }
  1812. # Echo a new CVSROOT based on $1, $remote, and $remotehost
  1813. newroot() {
  1814. if $remote; then
  1815. if test -n "$remotehost"; then
  1816. echo :ext:$remotehost$1
  1817. else
  1818. echo :fork:$1
  1819. fi
  1820. else
  1821. echo $1
  1822. fi
  1823. }
  1824. # Set up CVSROOT (the crerepos tests will test operating without CVSROOT set).
  1825. #
  1826. # Currently we test :fork: and :ext: (see crerepos test). There is a
  1827. # known difference between the two in modes-15 (see comments there).
  1828. #
  1829. # :ext: can be tested against a remote machine if:
  1830. #
  1831. # 1. $remotehost is set using the `-h' option to this script.
  1832. # 2. ${CVS_RSH=rsh} $remotehost works.
  1833. # 3. The path to $TESTDIR is the same on both machines (symlinks are okay)
  1834. # 4. The path to $testcvs is the same on both machines (symlinks are okay)
  1835. # or $CVS_SERVER is overridden in this script's environment to point to
  1836. # a working CVS exectuable on the remote machine.
  1837. #
  1838. # Testing :pserver: would be hard (inetd issues). (How about using tcpserver
  1839. # and some high port number? DRP)
  1840. # Allow CVS_SERVER to be overridden. This facilitates constructs like
  1841. # testing a local case-insensitive client against a remote case
  1842. # sensitive server and visa versa.
  1843. : ${CVS_SERVER=$testcvs}; export CVS_SERVER
  1844. # Use a name which will be different than CVSROOT on case insensitive
  1845. # filesystems (e.g., HFS+)
  1846. CVSROOTDIR=cvsrootdir
  1847. if $linkroot; then
  1848. mkdir ${TESTDIR}/realcvsroot
  1849. ln -s realcvsroot ${TESTDIR}/${CVSROOTDIR}
  1850. fi
  1851. CVSROOT_DIRNAME=${TESTDIR}/${CVSROOTDIR}
  1852. CVSROOT=`newroot $CVSROOT_DIRNAME`; export CVSROOT
  1853. ###
  1854. ### Init the repository.
  1855. ###
  1856. dotest init-1 "$testcvs -d$CVSROOT_DIRNAME init"
  1857. # Copy the admin files for restore_adm.
  1858. cp -Rp $CVSROOT_DIRNAME/CVSROOT $TESTDIR/CVSROOT.save
  1859. ###
  1860. ### The tests
  1861. ###
  1862. if $remote; then
  1863. localonly init-2
  1864. localonly init-3
  1865. else
  1866. dotest init-2 "$testcvs init"
  1867. dotest_fail init-3 "$testcvs -d $CVSROOT/sdir init" \
  1868. "$PROG \[init aborted\]: Cannot initialize repository under existing CVSROOT: \`$CVSROOT_DIRNAME'"
  1869. fi
  1870. ### The big loop
  1871. for what in $tests; do
  1872. if test -n "$fromtest" ; then
  1873. if test $fromtest = $what ; then
  1874. unset fromtest
  1875. else
  1876. continue
  1877. fi
  1878. fi
  1879. if $verbose; then
  1880. echo "$what:"
  1881. fi
  1882. case $what in
  1883. version)
  1884. # We've had cases where the version command started dumping core,
  1885. # so we might as well test it
  1886. dotest version-1 "${testcvs} --version" \
  1887. '
  1888. Concurrent Versions System (CVS) [0-9.]*.*
  1889. Copyright (C) [0-9]* Free Software Foundation, Inc.
  1890. Senior active maintainers include Larry Jones, Derek R. Price,
  1891. and Mark D. Baushke. Please see the AUTHORS and README files from the CVS
  1892. distribution kit for a complete list of contributors and copyrights.
  1893. CVS may be copied only under the terms of the GNU General Public License,
  1894. a copy of which can be found with the CVS distribution kit.
  1895. Specify the --help option for further information about CVS'
  1896. if $remote; then
  1897. dotest version-2r "${testcvs} version" \
  1898. 'Client: Concurrent Versions System (CVS) [0-9p.]* (client/server)
  1899. Server: Concurrent Versions System (CVS) [0-9p.]* (client/server)'
  1900. else
  1901. dotest version-2 "${testcvs} version" \
  1902. 'Concurrent Versions System (CVS) [0-9.]*.*'
  1903. fi
  1904. ;;
  1905. basica)
  1906. # Similar in spirit to some of the basic1, and basic2
  1907. # tests, but hopefully a lot faster. Also tests operating on
  1908. # files two directories down *without* operating on the parent dirs.
  1909. # Tests basica-0a and basica-0b provide the equivalent of the:
  1910. # mkdir ${CVSROOT_DIRNAME}/first-dir
  1911. # used by many of the tests. It is "more official" in the sense
  1912. # that is does everything through CVS; the reason most of the
  1913. # tests don't use it is mostly historical.
  1914. mkdir 1; cd 1
  1915. dotest basica-0a "${testcvs} -q co -l ." ''
  1916. mkdir first-dir
  1917. dotest basica-0b "${testcvs} add first-dir" \
  1918. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  1919. cd ..
  1920. rm -r 1
  1921. dotest basica-1 "${testcvs} -q co first-dir" ''
  1922. cd first-dir
  1923. # Test a few operations, to ensure they gracefully do
  1924. # nothing in an empty directory.
  1925. dotest basica-1a0 "${testcvs} -q update" ''
  1926. dotest basica-1a1 "${testcvs} -q diff -c" ''
  1927. dotest basica-1a2 "${testcvs} -q status" ''
  1928. dotest basica-1a3 "${testcvs} -q update ." ''
  1929. dotest basica-1a4 "${testcvs} -q update ./" ''
  1930. mkdir sdir
  1931. # Remote CVS gives the "cannot open CVS/Entries" error, which is
  1932. # clearly a bug, but not a simple one to fix.
  1933. dotest basica-1a10 "${testcvs} -n add sdir" \
  1934. "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository" \
  1935. "${PROG} add: cannot open CVS/Entries for reading: No such file or directory
  1936. Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
  1937. dotest_fail basica-1a11 \
  1938. "test -d ${CVSROOT_DIRNAME}/first-dir/sdir" ''
  1939. dotest basica-2 "${testcvs} add sdir" \
  1940. "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
  1941. cd sdir
  1942. mkdir ssdir
  1943. dotest basica-3 "${testcvs} add ssdir" \
  1944. "Directory ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir added to the repository"
  1945. cd ssdir
  1946. echo ssfile >ssfile
  1947. # Trying to commit it without a "cvs add" should be an error.
  1948. # The "use `cvs add' to create an entry" message is the one
  1949. # that I consider to be more correct, but local cvs prints the
  1950. # "nothing known" message and noone has gotten around to fixing it.
  1951. dotest_fail basica-notadded "${testcvs} -q ci ssfile" \
  1952. "${PROG} [a-z]*: use .${PROG} add. to create an entry for ssfile
  1953. ${PROG}"' \[[a-z]* aborted\]: correct above errors first!' \
  1954. "${PROG}"' [a-z]*: nothing known about `ssfile'\''
  1955. '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
  1956. dotest basica-4 "${testcvs} add ssfile" \
  1957. "${PROG}"' add: scheduling file `ssfile'\'' for addition
  1958. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  1959. dotest_fail basica-4a "${testcvs} tag tag0 ssfile" \
  1960. "${PROG} tag: nothing known about ssfile
  1961. ${PROG} "'\[tag aborted\]: correct the above errors first!'
  1962. cd ../..
  1963. dotest basica-5 "${testcvs} -q ci -m add-it" \
  1964. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  1965. done
  1966. Checking in sdir/ssdir/ssfile;
  1967. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  1968. initial revision: 1\.1
  1969. done"
  1970. dotest_fail basica-5a \
  1971. "${testcvs} -q tag BASE sdir/ssdir/ssfile" \
  1972. "${PROG} tag: Attempt to add reserved tag name BASE
  1973. ${PROG} \[tag aborted\]: failed to set tag BASE to revision 1\.1 in ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v"
  1974. dotest basica-5b "${testcvs} -q tag NOT_RESERVED" \
  1975. 'T sdir/ssdir/ssfile'
  1976. dotest basica-6 "${testcvs} -q update" ''
  1977. echo "ssfile line 2" >>sdir/ssdir/ssfile
  1978. dotest_fail basica-6.2 "${testcvs} -q diff -c" \
  1979. "Index: sdir/ssdir/ssfile
  1980. ===================================================================
  1981. RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  1982. retrieving revision 1\.1
  1983. diff -c -r1\.1 ssfile
  1984. \*\*\* sdir/ssdir/ssfile ${RFCDATE} 1\.1
  1985. --- sdir/ssdir/ssfile ${RFCDATE}
  1986. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  1987. \*\*\* 1 \*\*\*\*
  1988. --- 1,2 ----
  1989. ssfile
  1990. ${PLUS} ssfile line 2"
  1991. dotest_fail basica-6.3 "${testcvs} -q diff -c -rBASE" \
  1992. "Index: sdir/ssdir/ssfile
  1993. ===================================================================
  1994. RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  1995. retrieving revision 1\.1
  1996. diff -c -r1\.1 ssfile
  1997. \*\*\* sdir/ssdir/ssfile ${RFCDATE} 1\.1
  1998. --- sdir/ssdir/ssfile ${RFCDATE}
  1999. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  2000. \*\*\* 1 \*\*\*\*
  2001. --- 1,2 ----
  2002. ssfile
  2003. ${PLUS} ssfile line 2"
  2004. dotest_fail basica-6.4 "${testcvs} -q diff -c -rBASE -C3isacrowd" \
  2005. "Index: sdir/ssdir/ssfile
  2006. ===================================================================
  2007. RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2008. retrieving revision 1\.1
  2009. diff -c -C 3isacrowd -r1\.1 ssfile
  2010. ${PROG} diff: invalid context length argument"
  2011. dotest basica-7 "${testcvs} -q ci -m modify-it" \
  2012. "Checking in sdir/ssdir/ssfile;
  2013. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2014. new revision: 1\.2; previous revision: 1\.1
  2015. done"
  2016. dotest_fail basica-nonexist "${testcvs} -q ci nonexist" \
  2017. "${PROG}"' [a-z]*: nothing known about `nonexist'\''
  2018. '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
  2019. dotest basica-8 "${testcvs} -q update ." ''
  2020. # Test the -f option to ci
  2021. cd sdir/ssdir
  2022. dotest basica-8a0 "${testcvs} -q ci -m not-modified ssfile" ''
  2023. dotest basica-8a "${testcvs} -q ci -f -m force-it" \
  2024. "Checking in ssfile;
  2025. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2026. new revision: 1\.3; previous revision: 1\.2
  2027. done"
  2028. dotest basica-8a1 "${testcvs} -q ci -m bump-it -r 2.0" \
  2029. "Checking in ssfile;
  2030. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2031. new revision: 2\.0; previous revision: 1\.3
  2032. done"
  2033. dotest basica-8a1a "${testcvs} -q ci -m bump-it -r 2.9" \
  2034. "Checking in ssfile;
  2035. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2036. new revision: 2\.9; previous revision: 2\.0
  2037. done"
  2038. # Test string-based revion number increment rollover
  2039. dotest basica-8a1b "${testcvs} -q ci -m bump-it -f -r 2" \
  2040. "Checking in ssfile;
  2041. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2042. new revision: 2\.10; previous revision: 2\.9
  2043. done"
  2044. dotest basica-8a1c "${testcvs} -q ci -m bump-it -r 2.99" \
  2045. "Checking in ssfile;
  2046. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2047. new revision: 2\.99; previous revision: 2\.10
  2048. done"
  2049. # Test string-based revion number increment rollover
  2050. dotest basica-8a1d "${testcvs} -q ci -m bump-it -f -r 2" \
  2051. "Checking in ssfile;
  2052. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2053. new revision: 2\.100; previous revision: 2\.99
  2054. done"
  2055. dotest basica-8a1e "${testcvs} -q ci -m bump-it -r 2.1099" \
  2056. "Checking in ssfile;
  2057. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2058. new revision: 2\.1099; previous revision: 2\.100
  2059. done"
  2060. # Test string-based revion number increment rollover
  2061. dotest basica-8a1f "${testcvs} -q ci -m bump-it -f -r 2" \
  2062. "Checking in ssfile;
  2063. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2064. new revision: 2\.1100; previous revision: 2\.1099
  2065. done"
  2066. # -f should not be necessary, but it should be harmless.
  2067. # Also test the "-r 3" (rather than "-r 3.0") usage.
  2068. dotest basica-8a2 "${testcvs} -q ci -m bump-it -f -r 3" \
  2069. "Checking in ssfile;
  2070. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2071. new revision: 3\.1; previous revision: 2\.1100
  2072. done"
  2073. # Test using -r to create a branch
  2074. dotest_fail basica-8a3 "${testcvs} -q ci -m bogus -r 3.0.0" \
  2075. "Checking in ssfile;
  2076. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2077. ${PROG} commit: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: can't find branch point 3\.0
  2078. ${PROG} commit: could not check in ssfile"
  2079. dotest basica-8a4 "${testcvs} -q ci -m valid -r 3.1.2" \
  2080. "Checking in ssfile;
  2081. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2082. new revision: 3\.1\.2\.1; previous revision: 3\.1
  2083. done"
  2084. # Verify that this file remains unchanged since up -A should not
  2085. # change the contents here.
  2086. cp ssfile $TESTDIR/ssfile.sav
  2087. # now get rid of the sticky tag and go back to the trunk
  2088. dotest basica-8a5 "$testcvs -q up -A ./" '[UP] ssfile'
  2089. dotest basica-8a6 "cmp ssfile $TESTDIR/ssfile.sav"
  2090. rm $TESTDIR/ssfile.sav
  2091. cd ../..
  2092. dotest basica-8b "${testcvs} -q diff -r1.2 -r1.3"
  2093. dotest basica-8b1 "${testcvs} -q diff -r1.2 -r1.3 -C 3isacrowd"
  2094. # The .* here will normally be "No such file or directory",
  2095. # but if memory serves some systems (AIX?) have a different message.
  2096. : dotest_fail basica-9 \
  2097. "${testcvs} -q -d ${TESTDIR}/nonexist update" \
  2098. "${PROG}: cannot access cvs root ${TESTDIR}/nonexist: .*"
  2099. dotest_fail basica-9 \
  2100. "${testcvs} -q -d ${TESTDIR}/nonexist update" \
  2101. "${PROG} \[[a-z]* aborted\]: ${TESTDIR}/nonexist/CVSROOT: .*"
  2102. dotest basica-10 "${testcvs} annotate" \
  2103. '
  2104. Annotations for sdir/ssdir/ssfile
  2105. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  2106. 1\.1 .'"$username8"' *[0-9a-zA-Z-]*.: ssfile
  2107. 1\.2 .'"$username8"' *[0-9a-zA-Z-]*.: ssfile line 2'
  2108. # Test resurrecting with strange revision numbers
  2109. cd sdir/ssdir
  2110. dotest basica-r1 "${testcvs} rm -f ssfile" \
  2111. "${PROG} remove: scheduling .ssfile. for removal
  2112. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  2113. dotest basica-r2 "${testcvs} -q ci -m remove" \
  2114. "Removing ssfile;
  2115. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2116. new revision: delete; previous revision: 3\.1
  2117. done"
  2118. dotest basica-r3 "${testcvs} -q up -p -r 3.1 ./ssfile >ssfile" ""
  2119. dotest basica-r4 "${testcvs} add ssfile" \
  2120. "${PROG} add: Re-adding file .ssfile. (in place of dead revision 3\.2)\.
  2121. ${PROG} add: use .${PROG} commit. to add this file permanently"
  2122. dotest basica-r5 "${testcvs} -q ci -m resurrect" \
  2123. "Checking in ssfile;
  2124. ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile
  2125. new revision: 3\.3; previous revision: 3\.2
  2126. done"
  2127. cd ../..
  2128. # As long as we have a file with a few revisions, test
  2129. # a few "cvs admin -o" invocations.
  2130. cd sdir/ssdir
  2131. dotest_fail basica-o1 "${testcvs} admin -o 1.2::1.2" \
  2132. "${PROG} [a-z]*: while processing more than one file:
  2133. ${PROG} \[[a-z]* aborted\]: attempt to specify a numeric revision"
  2134. dotest basica-o2 "${testcvs} admin -o 1.2::1.2 ssfile" \
  2135. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2136. done"
  2137. dotest basica-o2a "${testcvs} admin -o 1.1::NOT_RESERVED ssfile" \
  2138. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2139. done"
  2140. dotest_fail basica-o2b "${testcvs} admin -o 1.1::NOT_EXIST ssfile" \
  2141. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2142. ${PROG} admin: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v: Revision NOT_EXIST doesn't exist.
  2143. ${PROG} admin: RCS file for .ssfile. not modified\."
  2144. dotest basica-o3 "${testcvs} admin -o 1.2::1.3 ssfile" \
  2145. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2146. done"
  2147. dotest basica-o4 "${testcvs} admin -o 3.1:: ssfile" \
  2148. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2149. deleting revision 3\.3
  2150. deleting revision 3\.2
  2151. done"
  2152. dotest basica-o5 "${testcvs} admin -o ::1.1 ssfile" \
  2153. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2154. done"
  2155. dotest basica-o5a "${testcvs} -n admin -o 1.2::3.1 ssfile" \
  2156. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2157. deleting revision 2\.1100
  2158. deleting revision 2\.1099
  2159. deleting revision 2\.100
  2160. deleting revision 2\.99
  2161. deleting revision 2\.10
  2162. deleting revision 2\.9
  2163. deleting revision 2\.0
  2164. deleting revision 1\.3
  2165. done"
  2166. dotest basica-o6 "${testcvs} admin -o 1.2::3.1 ssfile" \
  2167. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2168. deleting revision 2\.1100
  2169. deleting revision 2\.1099
  2170. deleting revision 2\.100
  2171. deleting revision 2\.99
  2172. deleting revision 2\.10
  2173. deleting revision 2\.9
  2174. deleting revision 2\.0
  2175. deleting revision 1\.3
  2176. done"
  2177. dotest basica-o6a "${testcvs} admin -o 3.1.2: ssfile" \
  2178. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2179. deleting revision 3\.1\.2\.1
  2180. done"
  2181. dotest basica-o7 "${testcvs} log -N ssfile" "
  2182. RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
  2183. Working file: ssfile
  2184. head: 3\.1
  2185. branch:
  2186. locks: strict
  2187. access list:
  2188. keyword substitution: kv
  2189. total revisions: 3; selected revisions: 3
  2190. description:
  2191. ----------------------------
  2192. revision 3\.1
  2193. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
  2194. bump-it
  2195. ----------------------------
  2196. revision 1\.2
  2197. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
  2198. modify-it
  2199. ----------------------------
  2200. revision 1\.1
  2201. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  2202. add-it
  2203. ============================================================================="
  2204. dotest basica-o8 "${testcvs} -q update -p -r 1.1 ./ssfile" "ssfile"
  2205. cd ../..
  2206. cd ..
  2207. rm -rf ${CVSROOT_DIRNAME}/first-dir
  2208. rm -r first-dir
  2209. ;;
  2210. basicb)
  2211. # More basic tests, including non-branch tags and co -d.
  2212. mkdir 1; cd 1
  2213. dotest basicb-0a "${testcvs} -q co -l ." ''
  2214. touch topfile
  2215. dotest basicb-0b "${testcvs} add topfile" \
  2216. "${PROG} add: scheduling file .topfile. for addition
  2217. ${PROG} add: use .${PROG} commit. to add this file permanently"
  2218. dotest basicb-0c "${testcvs} -q ci -m add-it topfile" \
  2219. "RCS file: ${CVSROOT_DIRNAME}/topfile,v
  2220. done
  2221. Checking in topfile;
  2222. ${CVSROOT_DIRNAME}/topfile,v <-- topfile
  2223. initial revision: 1\.1
  2224. done"
  2225. cd ..
  2226. rm -r 1
  2227. mkdir 2; cd 2
  2228. dotest basicb-0d "${testcvs} -q co -l ." "U topfile"
  2229. # Now test the ability to run checkout on an existing working
  2230. # directory without having it lose its mind. I don't know
  2231. # whether this is tested elsewhere in sanity.sh. A more elaborate
  2232. # test might also have modified files, make sure it works if
  2233. # the modules file was modified to add new directories to the
  2234. # module, and such.
  2235. dotest basicb-0d0 "${testcvs} -q co -l ." ""
  2236. mkdir first-dir
  2237. dotest basicb-0e "${testcvs} add first-dir" \
  2238. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  2239. cd ..
  2240. rm -r 2
  2241. dotest basicb-1 "${testcvs} -q co first-dir" ''
  2242. # The top-level CVS directory is not created by default.
  2243. # I'm leaving basicb-1a and basicb-1b untouched, mostly, in
  2244. # case we decide that the default should be reversed...
  2245. dotest_fail basicb-1a "test -d CVS" ''
  2246. dotest basicb-1c "cat first-dir/CVS/Repository" "first-dir"
  2247. cd first-dir
  2248. # Note that the name Emptydir is chosen to test that CVS just
  2249. # treats it like any other directory name. It should be
  2250. # special only when it is directly in $CVSROOT/CVSROOT.
  2251. mkdir Emptydir sdir2
  2252. dotest basicb-2 "${testcvs} add Emptydir sdir2" \
  2253. "Directory ${CVSROOT_DIRNAME}/first-dir/Emptydir added to the repository
  2254. Directory ${CVSROOT_DIRNAME}/first-dir/sdir2 added to the repository"
  2255. cd Emptydir
  2256. echo sfile1 starts >sfile1
  2257. dotest basicb-2a10 "${testcvs} -n add sfile1" \
  2258. "${PROG} add: scheduling file .sfile1. for addition
  2259. ${PROG} add: use .${PROG} commit. to add this file permanently"
  2260. dotest basicb-2a11 "${testcvs} status sfile1" \
  2261. "${PROG} status: use .${PROG} add. to create an entry for sfile1
  2262. ===================================================================
  2263. File: sfile1 Status: Unknown
  2264. Working revision: No entry for sfile1
  2265. Repository revision: No revision control file"
  2266. dotest basicb-3 "${testcvs} add sfile1" \
  2267. "${PROG} add: scheduling file .sfile1. for addition
  2268. ${PROG} add: use .${PROG} commit. to add this file permanently"
  2269. dotest basicb-3a1 "${testcvs} status sfile1" \
  2270. "===================================================================
  2271. File: sfile1 Status: Locally Added
  2272. Working revision: New file!
  2273. Repository revision: No revision control file
  2274. Sticky Tag: (none)
  2275. Sticky Date: (none)
  2276. Sticky Options: (none)"
  2277. cd ../sdir2
  2278. echo sfile2 starts >sfile2
  2279. dotest basicb-4 "${testcvs} add sfile2" \
  2280. "${PROG} add: scheduling file .sfile2. for addition
  2281. ${PROG} add: use .${PROG} commit. to add this file permanently"
  2282. dotest basicb-4a "${testcvs} -q ci CVS" \
  2283. "${PROG} [a-z]*: warning: directory CVS specified in argument
  2284. ${PROG} [a-z]*: but CVS uses CVS for its own purposes; skipping CVS directory"
  2285. cd ..
  2286. dotest basicb-5 "${testcvs} -q ci -m add" \
  2287. "RCS file: ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v
  2288. done
  2289. Checking in Emptydir/sfile1;
  2290. ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v <-- sfile1
  2291. initial revision: 1\.1
  2292. done
  2293. RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
  2294. done
  2295. Checking in sdir2/sfile2;
  2296. ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v <-- sfile2
  2297. initial revision: 1\.1
  2298. done"
  2299. echo sfile1 develops >Emptydir/sfile1
  2300. dotest basicb-6 "${testcvs} -q ci -m modify" \
  2301. "Checking in Emptydir/sfile1;
  2302. ${CVSROOT_DIRNAME}/first-dir/Emptydir/sfile1,v <-- sfile1
  2303. new revision: 1\.2; previous revision: 1\.1
  2304. done"
  2305. dotest basicb-7 "${testcvs} -q tag release-1" 'T Emptydir/sfile1
  2306. T sdir2/sfile2'
  2307. echo not in time for release-1 >sdir2/sfile2
  2308. dotest basicb-8 "${testcvs} -q ci -m modify-2" \
  2309. "Checking in sdir2/sfile2;
  2310. ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v <-- sfile2
  2311. new revision: 1\.2; previous revision: 1\.1
  2312. done"
  2313. # See if CVS can correctly notice when an invalid numeric
  2314. # revision is specified.
  2315. # Commented out until we get around to fixing CVS
  2316. : dotest basicb-8a0 "${testcvs} diff -r 1.5 -r 1.7 sfile2" 'error msg'
  2317. cd ..
  2318. # Test that we recurse into the correct directory when checking
  2319. # for existing files, even if co -d is in use.
  2320. touch first-dir/extra
  2321. dotest basicb-cod-1 "${testcvs} -q co -d first-dir1 first-dir" \
  2322. 'U first-dir1/Emptydir/sfile1
  2323. U first-dir1/sdir2/sfile2'
  2324. rm -r first-dir1
  2325. rm -r first-dir
  2326. # FIXME? basicb-9 used to check things out like this:
  2327. # U newdir/Emptydir/sfile1
  2328. # U newdir/sdir2/sfile2
  2329. # but that's difficult to do. The whole "shorten" thing
  2330. # is pretty bogus, because it will break on things
  2331. # like "cvs co foo/bar baz/quux". Unless there's some
  2332. # pretty detailed expansion and analysis of the command-line
  2333. # arguments, we shouldn't do "shorten" stuff at all.
  2334. dotest basicb-9 \
  2335. "${testcvs} -q co -d newdir -r release-1 first-dir/Emptydir first-dir/sdir2" \
  2336. 'U newdir/first-dir/Emptydir/sfile1
  2337. U newdir/first-dir/sdir2/sfile2'
  2338. # basicb-9a and basicb-9b: see note about basicb-1a
  2339. dotest_fail basicb-9a "test -d CVS" ''
  2340. dotest basicb-9c "cat newdir/CVS/Repository" "\."
  2341. dotest basicb-9d "cat newdir/first-dir/CVS/Repository" \
  2342. "${CVSROOT_DIRNAME}/first-dir" \
  2343. "first-dir"
  2344. dotest basicb-9e "cat newdir/first-dir/Emptydir/CVS/Repository" \
  2345. "${CVSROOT_DIRNAME}/first-dir/Emptydir" \
  2346. "first-dir/Emptydir"
  2347. dotest basicb-9f "cat newdir/first-dir/sdir2/CVS/Repository" \
  2348. "${CVSROOT_DIRNAME}/first-dir/sdir2" \
  2349. "first-dir/sdir2"
  2350. dotest basicb-10 "cat newdir/first-dir/Emptydir/sfile1 newdir/first-dir/sdir2/sfile2" \
  2351. "sfile1 develops
  2352. sfile2 starts"
  2353. rm -r newdir
  2354. # Hmm, this might be a case for CVSNULLREPOS, but CVS doesn't
  2355. # seem to deal with it...
  2356. if false; then
  2357. dotest basicb-11 "${testcvs} -q co -d sub1/sub2 first-dir" \
  2358. "U sub1/sub2/Emptydir/sfile1
  2359. U sub1/sub2/sdir2/sfile2"
  2360. cd sub1
  2361. dotest basicb-12 "${testcvs} -q update ./." ''
  2362. touch xx
  2363. dotest basicb-13 "${testcvs} add xx" fixme
  2364. cd ..
  2365. rm -r sub1
  2366. # to test: sub1/sub2/sub3
  2367. fi # end of tests commented out.
  2368. # Create a second directory.
  2369. mkdir 1
  2370. cd 1
  2371. dotest basicb-14 "${testcvs} -q co -l ." 'U topfile'
  2372. mkdir second-dir
  2373. dotest basicb-15 "${testcvs} add second-dir" \
  2374. "Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
  2375. cd second-dir
  2376. touch aa
  2377. dotest basicb-16 "${testcvs} add aa" \
  2378. "${PROG} add: scheduling file .aa. for addition
  2379. ${PROG} add: use .${PROG} commit. to add this file permanently"
  2380. dotest basicb-17 "${testcvs} -q ci -m add" \
  2381. "RCS file: ${CVSROOT_DIRNAME}/second-dir/aa,v
  2382. done
  2383. Checking in aa;
  2384. ${CVSROOT_DIRNAME}/second-dir/aa,v <-- aa
  2385. initial revision: 1\.1
  2386. done"
  2387. cd ..
  2388. # Try to remove all revisions in a file.
  2389. dotest_fail basicb-o1 "${testcvs} admin -o1.1 topfile" \
  2390. "RCS file: ${CVSROOT_DIRNAME}/topfile,v
  2391. deleting revision 1\.1
  2392. ${PROG} \[admin aborted\]: attempt to delete all revisions"
  2393. dotest basicb-o2 "${testcvs} -q update -d first-dir" \
  2394. "U first-dir/Emptydir/sfile1
  2395. U first-dir/sdir2/sfile2"
  2396. dotest_fail basicb-o3 \
  2397. "${testcvs} admin -o1.1:1.2 first-dir/sdir2/sfile2" \
  2398. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir2/sfile2,v
  2399. deleting revision 1\.2
  2400. deleting revision 1\.1
  2401. ${PROG} \[admin aborted\]: attempt to delete all revisions"
  2402. cd ..
  2403. rm -r 1
  2404. mkdir 1; cd 1
  2405. # Note that -H is an illegal option.
  2406. # I suspect that the choice between "illegal" and "invalid"
  2407. # depends on the user's environment variables, the phase
  2408. # of the moon (weirdness with optind), and who knows what else.
  2409. # I've been seeing "illegal"...
  2410. dotest_fail basicb-21 "${testcvs} -q admin -H" \
  2411. "admin: illegal option -- H
  2412. ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information" \
  2413. "admin: invalid option -- H
  2414. ${PROG} \[admin aborted\]: specify ${PROG} -H admin for usage information"
  2415. cd ..
  2416. rmdir 1
  2417. if $keep; then
  2418. echo Keeping ${TESTDIR} and exiting due to --keep
  2419. exit 0
  2420. fi
  2421. rm -rf ${CVSROOT_DIRNAME}/first-dir
  2422. rm -rf ${CVSROOT_DIRNAME}/second-dir
  2423. rm -f ${CVSROOT_DIRNAME}/topfile,v
  2424. ;;
  2425. basicc)
  2426. # More tests of basic/miscellaneous functionality.
  2427. mkdir 1; cd 1
  2428. dotest_fail basicc-1 "${testcvs} diff" \
  2429. "${PROG} [a-z]*: in directory \.:
  2430. ${PROG} \[[a-z]* aborted\]: there is no version here; run .${PROG} checkout. first"
  2431. dotest basicc-2 "${testcvs} -q co -l ." ''
  2432. mkdir first-dir second-dir
  2433. dotest basicc-3 "${testcvs} add first-dir second-dir" \
  2434. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
  2435. Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
  2436. # Old versions of CVS often didn't create this top-level CVS
  2437. # directory in the first place. I think that maybe the only
  2438. # way to get it to work currently is to let CVS create it,
  2439. # and then blow it away (don't complain if it does not
  2440. # exist). But that is perfectly legal; people who are used
  2441. # to the old behavior especially may be interested.
  2442. # FIXME: this test is intended for the TopLevelAdmin=yes case;
  2443. # should adjust/move it accordingly.
  2444. rm -rf CVS
  2445. dotest basicc-4 "echo *" "first-dir second-dir"
  2446. dotest basicc-5 "${testcvs} update" \
  2447. "${PROG} update: Updating first-dir
  2448. ${PROG} update: Updating second-dir" \
  2449. "${PROG} update: Updating \.
  2450. ${PROG} update: Updating first-dir
  2451. ${PROG} update: Updating second-dir"
  2452. cd first-dir
  2453. dotest basicc-6 "${testcvs} release -d" ""
  2454. dotest basicc-7 "test -d ../first-dir" ""
  2455. # The Linux 2.2 kernel lets you delete ".". That's OK either way,
  2456. # the point is that CVS must not mess with anything *outside* "."
  2457. # the way that CVS 1.10 and older tried to.
  2458. dotest basicc-8 "${testcvs} -Q release -d ." \
  2459. "" "${PROG} release: deletion of directory \. failed: .*"
  2460. dotest basicc-9 "test -d ../second-dir" ""
  2461. # For CVS to make a syntactic check for "." wouldn't suffice.
  2462. # On Linux 2.2 systems, the cwd may be gone, so we recreate it
  2463. # to allow basicc-11 to actually happen
  2464. if test ! -d ../first-dir; then
  2465. # Apparently `cd ..' doesn't work with Linux 2.2 & Bash 2.05b.
  2466. cd $TESTDIR/1
  2467. mkdir ./first-dir
  2468. cd ./first-dir
  2469. fi
  2470. dotest basicc-11 "${testcvs} -Q release -d ./." \
  2471. "" "${PROG} release: deletion of directory \./\. failed: .*"
  2472. dotest basicc-11a "test -d ../second-dir" ""
  2473. cd ../..
  2474. mkdir 2; cd 2
  2475. dotest basicc-12 "${testcvs} -Q co ." ""
  2476. # actual entries can be in either Entries or Entries.log, do
  2477. # an update to get them consolidated into Entries
  2478. dotest basicc-12a "${testcvs} -Q up" ""
  2479. dotest basicc-12b "cat CVS/Entries" \
  2480. "D/CVSROOT////
  2481. D/first-dir////
  2482. D/second-dir////"
  2483. dotest basicc-13 "echo *" "CVS CVSROOT first-dir second-dir"
  2484. dotest basicc-14 "${testcvs} -Q release first-dir second-dir" ""
  2485. # a normal release shouldn't affect the Entries file
  2486. dotest basicc-14b "cat CVS/Entries" \
  2487. "D/CVSROOT////
  2488. D/first-dir////
  2489. D/second-dir////"
  2490. # FIXCVS: but release -d probably should
  2491. dotest basicc-15 "${testcvs} -Q release -d first-dir second-dir" ""
  2492. dotest basicc-16 "echo *" "CVS CVSROOT"
  2493. dotest basicc-17 "cat CVS/Entries" \
  2494. "D/CVSROOT////
  2495. D/first-dir////
  2496. D/second-dir////"
  2497. # FIXCVS: if not, update should notice the missing directories
  2498. # and update Entries accordingly
  2499. dotest basicc-18 "${testcvs} -Q up" ""
  2500. dotest basicc-19 "cat CVS/Entries" \
  2501. "D/CVSROOT////
  2502. D/first-dir////
  2503. D/second-dir////"
  2504. cd ..
  2505. rm -r 1 2
  2506. rm -rf ${CVSROOT_DIRNAME}/first-dir
  2507. ;;
  2508. basic1)
  2509. # first dive - add a files, first singly, then in a group.
  2510. mkdir ${CVSROOT_DIRNAME}/first-dir
  2511. mkdir basic1; cd basic1
  2512. # check out an empty directory
  2513. dotest basic1-1 "${testcvs} -q co first-dir" ''
  2514. cd first-dir
  2515. echo file2 >file2
  2516. echo file3 >file3
  2517. echo file4 >file4
  2518. echo file5 >file5
  2519. dotest basic1-14-add-add "${testcvs} add file2 file3 file4 file5" \
  2520. "${PROG} add: scheduling file \`file2' for addition
  2521. ${PROG} add: scheduling file \`file3' for addition
  2522. ${PROG} add: scheduling file \`file4' for addition
  2523. ${PROG} add: scheduling file \`file5' for addition
  2524. ${PROG} add: use .${PROG} commit. to add these files permanently"
  2525. dotest basic1-15-add-add \
  2526. "${testcvs} -q update file2 file3 file4 file5" \
  2527. "A file2
  2528. A file3
  2529. A file4
  2530. A file5"
  2531. dotest basic1-16-add-add "${testcvs} -q update" \
  2532. "A file2
  2533. A file3
  2534. A file4
  2535. A file5"
  2536. dotest basic1-17-add-add "${testcvs} -q status" \
  2537. "===================================================================
  2538. File: file2 Status: Locally Added
  2539. Working revision: New file!
  2540. Repository revision: No revision control file
  2541. Sticky Tag: (none)
  2542. Sticky Date: (none)
  2543. Sticky Options: (none)
  2544. ===================================================================
  2545. File: file3 Status: Locally Added
  2546. Working revision: New file!
  2547. Repository revision: No revision control file
  2548. Sticky Tag: (none)
  2549. Sticky Date: (none)
  2550. Sticky Options: (none)
  2551. ===================================================================
  2552. File: file4 Status: Locally Added
  2553. Working revision: New file!
  2554. Repository revision: No revision control file
  2555. Sticky Tag: (none)
  2556. Sticky Date: (none)
  2557. Sticky Options: (none)
  2558. ===================================================================
  2559. File: file5 Status: Locally Added
  2560. Working revision: New file!
  2561. Repository revision: No revision control file
  2562. Sticky Tag: (none)
  2563. Sticky Date: (none)
  2564. Sticky Options: (none)"
  2565. dotest basic1-18-add-add "${testcvs} -q log" \
  2566. "${PROG} log: file2 has been added, but not committed
  2567. ${PROG} log: file3 has been added, but not committed
  2568. ${PROG} log: file4 has been added, but not committed
  2569. ${PROG} log: file5 has been added, but not committed"
  2570. cd ..
  2571. dotest basic1-21-add-add "${testcvs} -q update" \
  2572. "A first-dir/file2
  2573. A first-dir/file3
  2574. A first-dir/file4
  2575. A first-dir/file5"
  2576. # FIXCVS? Shouldn't this read first-dir/file2 instead of file2?
  2577. dotest basic1-22-add-add "${testcvs} log first-dir" \
  2578. "${PROG} log: Logging first-dir
  2579. ${PROG} log: file2 has been added, but not committed
  2580. ${PROG} log: file3 has been added, but not committed
  2581. ${PROG} log: file4 has been added, but not committed
  2582. ${PROG} log: file5 has been added, but not committed"
  2583. dotest basic1-23-add-add "${testcvs} status first-dir" \
  2584. "${PROG} status: Examining first-dir
  2585. ===================================================================
  2586. File: file2 Status: Locally Added
  2587. Working revision: New file!
  2588. Repository revision: No revision control file
  2589. Sticky Tag: (none)
  2590. Sticky Date: (none)
  2591. Sticky Options: (none)
  2592. ===================================================================
  2593. File: file3 Status: Locally Added
  2594. Working revision: New file!
  2595. Repository revision: No revision control file
  2596. Sticky Tag: (none)
  2597. Sticky Date: (none)
  2598. Sticky Options: (none)
  2599. ===================================================================
  2600. File: file4 Status: Locally Added
  2601. Working revision: New file!
  2602. Repository revision: No revision control file
  2603. Sticky Tag: (none)
  2604. Sticky Date: (none)
  2605. Sticky Options: (none)
  2606. ===================================================================
  2607. File: file5 Status: Locally Added
  2608. Working revision: New file!
  2609. Repository revision: No revision control file
  2610. Sticky Tag: (none)
  2611. Sticky Date: (none)
  2612. Sticky Options: (none)"
  2613. dotest basic1-24-add-add "${testcvs} update first-dir" \
  2614. "${PROG} update: Updating first-dir
  2615. A first-dir/file2
  2616. A first-dir/file3
  2617. A first-dir/file4
  2618. A first-dir/file5"
  2619. dotest basic1-27-add-add "${testcvs} co first-dir" \
  2620. "${PROG} checkout: Updating first-dir
  2621. A first-dir/file2
  2622. A first-dir/file3
  2623. A first-dir/file4
  2624. A first-dir/file5"
  2625. cd first-dir
  2626. dotest basic1-14-add-ci \
  2627. "${testcvs} commit -m test file2 file3 file4 file5" \
  2628. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  2629. done
  2630. Checking in file2;
  2631. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  2632. initial revision: 1\.1
  2633. done
  2634. RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
  2635. done
  2636. Checking in file3;
  2637. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  2638. initial revision: 1\.1
  2639. done
  2640. RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
  2641. done
  2642. Checking in file4;
  2643. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  2644. initial revision: 1\.1
  2645. done
  2646. RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
  2647. done
  2648. Checking in file5;
  2649. ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
  2650. initial revision: 1\.1
  2651. done"
  2652. dotest basic1-15-add-ci \
  2653. "${testcvs} -q update file2 file3 file4 file5" ''
  2654. dotest basic1-16-add-ci "${testcvs} -q update" ''
  2655. dotest basic1-17-add-ci "${testcvs} -q status" \
  2656. "===================================================================
  2657. File: file2 Status: Up-to-date
  2658. Working revision: 1\.1.*
  2659. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
  2660. Sticky Tag: (none)
  2661. Sticky Date: (none)
  2662. Sticky Options: (none)
  2663. ===================================================================
  2664. File: file3 Status: Up-to-date
  2665. Working revision: 1\.1.*
  2666. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file3,v
  2667. Sticky Tag: (none)
  2668. Sticky Date: (none)
  2669. Sticky Options: (none)
  2670. ===================================================================
  2671. File: file4 Status: Up-to-date
  2672. Working revision: 1\.1.*
  2673. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file4,v
  2674. Sticky Tag: (none)
  2675. Sticky Date: (none)
  2676. Sticky Options: (none)
  2677. ===================================================================
  2678. File: file5 Status: Up-to-date
  2679. Working revision: 1\.1.*
  2680. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file5,v
  2681. Sticky Tag: (none)
  2682. Sticky Date: (none)
  2683. Sticky Options: (none)"
  2684. # The "log" tests and friends probably already test the output
  2685. # from log quite adequately.
  2686. # Note: using dotest fails here. It seems to be related
  2687. # to the output being sufficiently large (Red Hat 4.1).
  2688. # dotest basic1-18-add-ci "${testcvs} log" "${DOTSTAR}"
  2689. if ${testcvs} -q log >>${LOGFILE}; then
  2690. pass basic1-18-add-ci
  2691. else
  2692. pass basic1-18-add-ci
  2693. fi
  2694. cd ..
  2695. dotest basic1-21-add-ci "${testcvs} -q update" ''
  2696. # See test basic1-18-add-ci for explanation of non-use of dotest.
  2697. if ${testcvs} -q log first-dir >>${LOGFILE}; then
  2698. pass basic1-22-add-ci
  2699. else
  2700. pass basic1-22-add-ci
  2701. fi
  2702. # At least for the moment I am going to consider 17-add-ci
  2703. # an adequate test of the output here.
  2704. # See test basic1-18-add-ci for explanation of non-use of dotest.
  2705. if ${testcvs} -q status first-dir >>${LOGFILE}; then
  2706. pass basic1-23-add-ci
  2707. else
  2708. pass basic1-23-add-ci
  2709. fi
  2710. dotest basic1-24-add-ci "${testcvs} -q update first-dir" ''
  2711. dotest basic1-27-add-ci "${testcvs} -q co first-dir" ''
  2712. cd first-dir
  2713. rm file2 file3 file4 file5
  2714. dotest basic1-14-rm-rm "${testcvs} rm file2 file3 file4 file5" \
  2715. "${PROG} remove: scheduling .file2. for removal
  2716. ${PROG} remove: scheduling .file3. for removal
  2717. ${PROG} remove: scheduling .file4. for removal
  2718. ${PROG} remove: scheduling .file5. for removal
  2719. ${PROG} remove: use .${PROG} commit. to remove these files permanently"
  2720. # 15-rm-rm was commented out. Why?
  2721. dotest basic1-15-rm-rm \
  2722. "${testcvs} -q update file2 file3 file4 file5" \
  2723. "R file2
  2724. R file3
  2725. R file4
  2726. R file5"
  2727. dotest basic1-16-rm-rm "${testcvs} -q update" \
  2728. "R file2
  2729. R file3
  2730. R file4
  2731. R file5"
  2732. dotest basic1-17-rm-rm "${testcvs} -q status" \
  2733. "===================================================================
  2734. File: no file file2 Status: Locally Removed
  2735. Working revision: -1\.1.*
  2736. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
  2737. Sticky Tag: (none)
  2738. Sticky Date: (none)
  2739. Sticky Options: (none)
  2740. ===================================================================
  2741. File: no file file3 Status: Locally Removed
  2742. Working revision: -1\.1.*
  2743. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file3,v
  2744. Sticky Tag: (none)
  2745. Sticky Date: (none)
  2746. Sticky Options: (none)
  2747. ===================================================================
  2748. File: no file file4 Status: Locally Removed
  2749. Working revision: -1\.1.*
  2750. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file4,v
  2751. Sticky Tag: (none)
  2752. Sticky Date: (none)
  2753. Sticky Options: (none)
  2754. ===================================================================
  2755. File: no file file5 Status: Locally Removed
  2756. Working revision: -1\.1.*
  2757. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file5,v
  2758. Sticky Tag: (none)
  2759. Sticky Date: (none)
  2760. Sticky Options: (none)"
  2761. # Would be nice to test that real logs appear (with dead state
  2762. # and all), either here or someplace like log2 tests.
  2763. if ${testcvs} -q log >>${LOGFILE}; then
  2764. pass basic1-18-rm-rm
  2765. else
  2766. fail basic1-18-rm-rm
  2767. fi
  2768. cd ..
  2769. dotest basic1-21-rm-rm "${testcvs} -q update" \
  2770. "R first-dir/file2
  2771. R first-dir/file3
  2772. R first-dir/file4
  2773. R first-dir/file5"
  2774. if ${testcvs} -q log first-dir >>${LOGFILE}; then
  2775. pass basic1-22-rm-rm
  2776. else
  2777. fail basic1-22-rm-rm
  2778. fi
  2779. if ${testcvs} -q status first-dir >>${LOGFILE}; then
  2780. pass basic1-23-rm-rm
  2781. else
  2782. fail basic1-23-rm-rm
  2783. fi
  2784. dotest basic1-24-rm-rm "${testcvs} -q update first-dir" \
  2785. "R first-dir/file2
  2786. R first-dir/file3
  2787. R first-dir/file4
  2788. R first-dir/file5"
  2789. dotest basic1-27-rm-rm "${testcvs} -q co first-dir" \
  2790. "R first-dir/file2
  2791. R first-dir/file3
  2792. R first-dir/file4
  2793. R first-dir/file5"
  2794. cd first-dir
  2795. dotest basic1-14-rm-ci "${testcvs} -q commit -m test" \
  2796. "Removing file2;
  2797. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  2798. new revision: delete; previous revision: 1\.1
  2799. done
  2800. Removing file3;
  2801. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  2802. new revision: delete; previous revision: 1\.1
  2803. done
  2804. Removing file4;
  2805. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  2806. new revision: delete; previous revision: 1\.1
  2807. done
  2808. Removing file5;
  2809. ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
  2810. new revision: delete; previous revision: 1\.1
  2811. done"
  2812. dotest basic1-15-rm-ci \
  2813. "${testcvs} -q update file2 file3 file4 file5" ''
  2814. dotest basic1-16-rm-ci "${testcvs} -q update" ''
  2815. dotest basic1-17-rm-ci "${testcvs} -q status" ''
  2816. # Would be nice to test that real logs appear (with dead state
  2817. # and all), either here or someplace like log2 tests.
  2818. if ${testcvs} -q log >>${LOGFILE}; then
  2819. pass basic1-18-rm-ci
  2820. else
  2821. fail basic1-18-rm-ci
  2822. fi
  2823. cd ..
  2824. dotest basic1-21-rm-ci "${testcvs} -q update" ''
  2825. if ${testcvs} -q log first-dir >>${LOGFILE}; then
  2826. pass basic1-22-rm-ci
  2827. else
  2828. fail basic1-22-rm-ci
  2829. fi
  2830. if ${testcvs} -q status first-dir >>${LOGFILE}; then
  2831. pass basic1-23-rm-ci
  2832. else
  2833. fail basic1-23-rm-ci
  2834. fi
  2835. dotest basic1-24-rm-ci "${testcvs} -q update first-dir" ''
  2836. dotest basic1-27-rm-ci "${testcvs} -q co first-dir" ''
  2837. cd first-dir
  2838. # All the files are removed, so nothing gets tagged.
  2839. dotest basic1-28 "${testcvs} -q tag first-dive" ''
  2840. cd ..
  2841. cd ..
  2842. if $keep; then
  2843. echo Keeping ${TESTDIR} and exiting due to --keep
  2844. exit 0
  2845. fi
  2846. rm -r basic1
  2847. rm -rf ${CVSROOT_DIRNAME}/first-dir
  2848. ;;
  2849. deep)
  2850. # Test the ability to operate on directories nested rather deeply.
  2851. mkdir ${CVSROOT_DIRNAME}/first-dir
  2852. dotest deep-1 "${testcvs} -q co first-dir" ''
  2853. cd first-dir
  2854. for i in dir1 dir2 dir3 dir4 dir5 dir6 dir7 dir8; do
  2855. mkdir $i
  2856. dotest deep-2-$i "${testcvs} add $i" \
  2857. "Directory ${CVSROOT_DIRNAME}/first-dir/dir1[/dir0-9]* added to the repository"
  2858. cd $i
  2859. echo file1 >file1
  2860. dotest deep-3-$i "${testcvs} add file1" \
  2861. "${PROG}"' add: scheduling file `file1'\'' for addition
  2862. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  2863. done
  2864. cd ../../../../../../../../..
  2865. dotest_lit deep-4 "${testcvs} -q ci -m add-them first-dir" <<HERE
  2866. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file1,v
  2867. done
  2868. Checking in first-dir/dir1/file1;
  2869. ${CVSROOT_DIRNAME}/first-dir/dir1/file1,v <-- file1
  2870. initial revision: 1.1
  2871. done
  2872. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file1,v
  2873. done
  2874. Checking in first-dir/dir1/dir2/file1;
  2875. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file1,v <-- file1
  2876. initial revision: 1.1
  2877. done
  2878. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/file1,v
  2879. done
  2880. Checking in first-dir/dir1/dir2/dir3/file1;
  2881. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/file1,v <-- file1
  2882. initial revision: 1.1
  2883. done
  2884. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/file1,v
  2885. done
  2886. Checking in first-dir/dir1/dir2/dir3/dir4/file1;
  2887. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/file1,v <-- file1
  2888. initial revision: 1.1
  2889. done
  2890. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v
  2891. done
  2892. Checking in first-dir/dir1/dir2/dir3/dir4/dir5/file1;
  2893. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
  2894. initial revision: 1.1
  2895. done
  2896. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v
  2897. done
  2898. Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1;
  2899. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
  2900. initial revision: 1.1
  2901. done
  2902. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v
  2903. done
  2904. Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1;
  2905. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
  2906. initial revision: 1.1
  2907. done
  2908. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v
  2909. done
  2910. Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1;
  2911. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
  2912. initial revision: 1.1
  2913. done
  2914. HERE
  2915. cd first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
  2916. rm file1
  2917. dotest deep-4a0 "${testcvs} rm file1" \
  2918. "${PROG} remove: scheduling .file1. for removal
  2919. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  2920. dotest deep-4a1 "${testcvs} -q ci -m rm-it" "Removing file1;
  2921. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
  2922. new revision: delete; previous revision: 1\.1
  2923. done"
  2924. cd ../../..
  2925. dotest deep-4a2 "${testcvs} -q update -P dir6/dir7" ''
  2926. # Should be using "test -e" if that is portable enough.
  2927. dotest_fail deep-4a3 "test -d dir6/dir7/dir8" ''
  2928. # Test that if we remove the working directory, CVS does not
  2929. # recreate it. (I realize that this behavior is what the
  2930. # users expect, but in the longer run we might want to
  2931. # re-think it. The corresponding behavior for a file is that
  2932. # CVS *will* recreate it, and we might want to make it so
  2933. # that "cvs release -d" is the way to delete the directory
  2934. # and have it stay gone -kingdon, Oct1996).
  2935. rm -r dir6
  2936. dotest deep-4b0a "${testcvs} -q diff" ''
  2937. dotest deep-4b0b "${testcvs} -q ci" ''
  2938. dotest deep-4b1 "${testcvs} -q update" ''
  2939. dotest deep-4b2 "${testcvs} -q update -d -P" \
  2940. 'U dir6/file1
  2941. U dir6/dir7/file1'
  2942. # Test what happens if one uses -P when there are files removed
  2943. # but not committed.
  2944. cd dir6/dir7
  2945. dotest deep-rm1 "${testcvs} rm -f file1" \
  2946. "${PROG} remove: scheduling .file1. for removal
  2947. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  2948. cd ..
  2949. dotest deep-rm2 "${testcvs} -q update -d -P" 'R dir7/file1'
  2950. dotest deep-rm3 "test -d dir7" ''
  2951. dotest deep-rm4 "${testcvs} -q ci -m rm-it" "Removing dir7/file1;
  2952. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
  2953. new revision: delete; previous revision: 1\.1
  2954. done"
  2955. dotest deep-rm5 "${testcvs} -q update -d -P" ''
  2956. dotest_fail deep-rm6 "test -d dir7" ''
  2957. # Test rm -f -R.
  2958. cd ../..
  2959. dotest deep-rm7 "${testcvs} rm -f -R dir5" \
  2960. "${PROG} remove: Removing dir5
  2961. ${PROG} remove: scheduling .dir5/file1. for removal
  2962. ${PROG} remove: Removing dir5/dir6
  2963. ${PROG} remove: scheduling .dir5/dir6/file1. for removal
  2964. ${PROG} remove: use .${PROG} commit. to remove these files permanently"
  2965. dotest deep-rm8 "${testcvs} -q ci -m rm-it" \
  2966. "Removing dir5/file1;
  2967. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
  2968. new revision: delete; previous revision: 1\.1
  2969. done
  2970. Removing dir5/dir6/file1;
  2971. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
  2972. new revision: delete; previous revision: 1\.1
  2973. done"
  2974. dotest deep-rm9 "${testcvs} -q update -d -P" ''
  2975. dotest_fail deep-rm10 "test -d dir5"
  2976. cd ../../../../..
  2977. if echo "yes" | ${testcvs} release -d first-dir >>${LOGFILE}; then
  2978. pass deep-5
  2979. else
  2980. fail deep-5
  2981. fi
  2982. rm -rf ${CVSROOT_DIRNAME}/first-dir
  2983. ;;
  2984. basic2)
  2985. # Test rtag, import, history, various miscellaneous operations
  2986. # NOTE: this section has reached the size and
  2987. # complexity where it is getting to be a good idea to
  2988. # add new tests to a new section rather than
  2989. # continuing to piggyback them onto the tests here.
  2990. # First empty the history file
  2991. rm ${CVSROOT_DIRNAME}/CVSROOT/history
  2992. touch ${CVSROOT_DIRNAME}/CVSROOT/history
  2993. ### XXX maybe should use 'cvs imprt -b1 -m new-module first-dir F F1' in an
  2994. ### empty directory to do this instead of hacking directly into $CVSROOT
  2995. mkdir ${CVSROOT_DIRNAME}/first-dir
  2996. dotest basic2-1 "${testcvs} -q co first-dir" ''
  2997. for i in first-dir dir1 dir2 ; do
  2998. if test ! -d $i ; then
  2999. mkdir $i
  3000. dotest basic2-2-$i "${testcvs} add $i" \
  3001. "Directory ${CVSROOT_DIRNAME}/.*/$i added to the repository"
  3002. fi
  3003. cd $i
  3004. for j in file6 file7; do
  3005. echo $j > $j
  3006. done
  3007. dotest basic2-3-$i "${testcvs} add file6 file7" \
  3008. "${PROG} add: scheduling file .file6. for addition
  3009. ${PROG} add: scheduling file .file7. for addition
  3010. ${PROG} add: use .${PROG} commit. to add these files permanently"
  3011. done
  3012. cd ../../..
  3013. dotest basic2-4 "${testcvs} update first-dir" \
  3014. "${PROG} update: Updating first-dir
  3015. A first-dir/file6
  3016. A first-dir/file7
  3017. ${PROG} update: Updating first-dir/dir1
  3018. A first-dir/dir1/file6
  3019. A first-dir/dir1/file7
  3020. ${PROG} update: Updating first-dir/dir1/dir2
  3021. A first-dir/dir1/dir2/file6
  3022. A first-dir/dir1/dir2/file7"
  3023. # fixme: doesn't work right for added files.
  3024. dotest basic2-5 "${testcvs} log first-dir" \
  3025. "${PROG} log: Logging first-dir
  3026. ${PROG} log: file6 has been added, but not committed
  3027. ${PROG} log: file7 has been added, but not committed
  3028. ${PROG} log: Logging first-dir/dir1
  3029. ${PROG} log: file6 has been added, but not committed
  3030. ${PROG} log: file7 has been added, but not committed
  3031. ${PROG} log: Logging first-dir/dir1/dir2
  3032. ${PROG} log: file6 has been added, but not committed
  3033. ${PROG} log: file7 has been added, but not committed"
  3034. dotest basic2-6 "${testcvs} status first-dir" \
  3035. "${PROG} status: Examining first-dir
  3036. ===================================================================
  3037. File: file6 Status: Locally Added
  3038. Working revision: New file!
  3039. Repository revision: No revision control file
  3040. Sticky Tag: (none)
  3041. Sticky Date: (none)
  3042. Sticky Options: (none)
  3043. ===================================================================
  3044. File: file7 Status: Locally Added
  3045. Working revision: New file!
  3046. Repository revision: No revision control file
  3047. Sticky Tag: (none)
  3048. Sticky Date: (none)
  3049. Sticky Options: (none)
  3050. ${PROG} status: Examining first-dir/dir1
  3051. ===================================================================
  3052. File: file6 Status: Locally Added
  3053. Working revision: New file!
  3054. Repository revision: No revision control file
  3055. Sticky Tag: (none)
  3056. Sticky Date: (none)
  3057. Sticky Options: (none)
  3058. ===================================================================
  3059. File: file7 Status: Locally Added
  3060. Working revision: New file!
  3061. Repository revision: No revision control file
  3062. Sticky Tag: (none)
  3063. Sticky Date: (none)
  3064. Sticky Options: (none)
  3065. ${PROG} status: Examining first-dir/dir1/dir2
  3066. ===================================================================
  3067. File: file6 Status: Locally Added
  3068. Working revision: New file!
  3069. Repository revision: No revision control file
  3070. Sticky Tag: (none)
  3071. Sticky Date: (none)
  3072. Sticky Options: (none)
  3073. ===================================================================
  3074. File: file7 Status: Locally Added
  3075. Working revision: New file!
  3076. Repository revision: No revision control file
  3077. Sticky Tag: (none)
  3078. Sticky Date: (none)
  3079. Sticky Options: (none)"
  3080. # XXX why is this commented out???
  3081. # if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
  3082. # pass 34
  3083. # else
  3084. # fail 34
  3085. # fi
  3086. dotest basic2-8 "${testcvs} -q ci -m 'second dive' first-dir" \
  3087. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
  3088. done
  3089. Checking in first-dir/file6;
  3090. ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
  3091. initial revision: 1\.1
  3092. done
  3093. RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
  3094. done
  3095. Checking in first-dir/file7;
  3096. ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
  3097. initial revision: 1\.1
  3098. done
  3099. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
  3100. done
  3101. Checking in first-dir/dir1/file6;
  3102. ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v <-- file6
  3103. initial revision: 1\.1
  3104. done
  3105. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
  3106. done
  3107. Checking in first-dir/dir1/file7;
  3108. ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v <-- file7
  3109. initial revision: 1\.1
  3110. done
  3111. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
  3112. done
  3113. Checking in first-dir/dir1/dir2/file6;
  3114. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v <-- file6
  3115. initial revision: 1\.1
  3116. done
  3117. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
  3118. done
  3119. Checking in first-dir/dir1/dir2/file7;
  3120. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v <-- file7
  3121. initial revision: 1\.1
  3122. done"
  3123. dotest basic2-9 "${testcvs} tag second-dive first-dir" \
  3124. "${PROG} tag: Tagging first-dir
  3125. T first-dir/file6
  3126. T first-dir/file7
  3127. ${PROG} tag: Tagging first-dir/dir1
  3128. T first-dir/dir1/file6
  3129. T first-dir/dir1/file7
  3130. ${PROG} tag: Tagging first-dir/dir1/dir2
  3131. T first-dir/dir1/dir2/file6
  3132. T first-dir/dir1/dir2/file7"
  3133. # third dive - in bunch o' directories, add bunch o' files,
  3134. # delete some, change some.
  3135. for i in first-dir dir1 dir2 ; do
  3136. cd $i
  3137. # modify a file
  3138. echo file6 >>file6
  3139. # delete a file
  3140. rm file7
  3141. dotest basic2-10-$i "${testcvs} rm file7" \
  3142. "${PROG} remove: scheduling .file7. for removal
  3143. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  3144. # and add a new file
  3145. echo file14 >file14
  3146. dotest basic2-11-$i "${testcvs} add file14" \
  3147. "${PROG} add: scheduling file .file14. for addition
  3148. ${PROG} add: use .${PROG} commit. to add this file permanently"
  3149. done
  3150. cd ../../..
  3151. dotest basic2-12 "${testcvs} update first-dir" \
  3152. "${PROG} update: Updating first-dir
  3153. A first-dir/file14
  3154. M first-dir/file6
  3155. R first-dir/file7
  3156. ${PROG} update: Updating first-dir/dir1
  3157. A first-dir/dir1/file14
  3158. M first-dir/dir1/file6
  3159. R first-dir/dir1/file7
  3160. ${PROG} update: Updating first-dir/dir1/dir2
  3161. A first-dir/dir1/dir2/file14
  3162. M first-dir/dir1/dir2/file6
  3163. R first-dir/dir1/dir2/file7"
  3164. # FIXME: doesn't work right for added files
  3165. dotest basic2-13 "${testcvs} log first-dir" \
  3166. "${PROG} log: Logging first-dir
  3167. ${PROG} log: file14 has been added, but not committed
  3168. RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
  3169. Working file: first-dir/file6
  3170. head: 1\.1
  3171. branch:
  3172. locks: strict
  3173. access list:
  3174. symbolic names:
  3175. second-dive: 1\.1
  3176. keyword substitution: kv
  3177. total revisions: 1; selected revisions: 1
  3178. description:
  3179. ----------------------------
  3180. revision 1\.1
  3181. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  3182. second dive
  3183. =============================================================================
  3184. RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
  3185. Working file: first-dir/file7
  3186. head: 1\.1
  3187. branch:
  3188. locks: strict
  3189. access list:
  3190. symbolic names:
  3191. second-dive: 1\.1
  3192. keyword substitution: kv
  3193. total revisions: 1; selected revisions: 1
  3194. description:
  3195. ----------------------------
  3196. revision 1\.1
  3197. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  3198. second dive
  3199. =============================================================================
  3200. ${PROG} log: Logging first-dir/dir1
  3201. ${PROG} log: file14 has been added, but not committed
  3202. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
  3203. Working file: first-dir/dir1/file6
  3204. head: 1\.1
  3205. branch:
  3206. locks: strict
  3207. access list:
  3208. symbolic names:
  3209. second-dive: 1\.1
  3210. keyword substitution: kv
  3211. total revisions: 1; selected revisions: 1
  3212. description:
  3213. ----------------------------
  3214. revision 1\.1
  3215. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  3216. second dive
  3217. =============================================================================
  3218. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
  3219. Working file: first-dir/dir1/file7
  3220. head: 1\.1
  3221. branch:
  3222. locks: strict
  3223. access list:
  3224. symbolic names:
  3225. second-dive: 1\.1
  3226. keyword substitution: kv
  3227. total revisions: 1; selected revisions: 1
  3228. description:
  3229. ----------------------------
  3230. revision 1\.1
  3231. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  3232. second dive
  3233. =============================================================================
  3234. ${PROG} log: Logging first-dir/dir1/dir2
  3235. ${PROG} log: file14 has been added, but not committed
  3236. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
  3237. Working file: first-dir/dir1/dir2/file6
  3238. head: 1\.1
  3239. branch:
  3240. locks: strict
  3241. access list:
  3242. symbolic names:
  3243. second-dive: 1\.1
  3244. keyword substitution: kv
  3245. total revisions: 1; selected revisions: 1
  3246. description:
  3247. ----------------------------
  3248. revision 1\.1
  3249. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  3250. second dive
  3251. =============================================================================
  3252. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
  3253. Working file: first-dir/dir1/dir2/file7
  3254. head: 1\.1
  3255. branch:
  3256. locks: strict
  3257. access list:
  3258. symbolic names:
  3259. second-dive: 1\.1
  3260. keyword substitution: kv
  3261. total revisions: 1; selected revisions: 1
  3262. description:
  3263. ----------------------------
  3264. revision 1\.1
  3265. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  3266. second dive
  3267. ============================================================================="
  3268. dotest basic2-14 "${testcvs} status first-dir" \
  3269. "${PROG} status: Examining first-dir
  3270. ===================================================================
  3271. File: file14 Status: Locally Added
  3272. Working revision: New file!
  3273. Repository revision: No revision control file
  3274. Sticky Tag: (none)
  3275. Sticky Date: (none)
  3276. Sticky Options: (none)
  3277. ===================================================================
  3278. File: file6 Status: Locally Modified
  3279. Working revision: 1\.1.*
  3280. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file6,v
  3281. Sticky Tag: (none)
  3282. Sticky Date: (none)
  3283. Sticky Options: (none)
  3284. ===================================================================
  3285. File: no file file7 Status: Locally Removed
  3286. Working revision: -1\.1.*
  3287. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file7,v
  3288. Sticky Tag: (none)
  3289. Sticky Date: (none)
  3290. Sticky Options: (none)
  3291. ${PROG} status: Examining first-dir/dir1
  3292. ===================================================================
  3293. File: file14 Status: Locally Added
  3294. Working revision: New file!
  3295. Repository revision: No revision control file
  3296. Sticky Tag: (none)
  3297. Sticky Date: (none)
  3298. Sticky Options: (none)
  3299. ===================================================================
  3300. File: file6 Status: Locally Modified
  3301. Working revision: 1\.1.*
  3302. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v
  3303. Sticky Tag: (none)
  3304. Sticky Date: (none)
  3305. Sticky Options: (none)
  3306. ===================================================================
  3307. File: no file file7 Status: Locally Removed
  3308. Working revision: -1\.1.*
  3309. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v
  3310. Sticky Tag: (none)
  3311. Sticky Date: (none)
  3312. Sticky Options: (none)
  3313. ${PROG} status: Examining first-dir/dir1/dir2
  3314. ===================================================================
  3315. File: file14 Status: Locally Added
  3316. Working revision: New file!
  3317. Repository revision: No revision control file
  3318. Sticky Tag: (none)
  3319. Sticky Date: (none)
  3320. Sticky Options: (none)
  3321. ===================================================================
  3322. File: file6 Status: Locally Modified
  3323. Working revision: 1\.1.*
  3324. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v
  3325. Sticky Tag: (none)
  3326. Sticky Date: (none)
  3327. Sticky Options: (none)
  3328. ===================================================================
  3329. File: no file file7 Status: Locally Removed
  3330. Working revision: -1\.1.*
  3331. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v
  3332. Sticky Tag: (none)
  3333. Sticky Date: (none)
  3334. Sticky Options: (none)"
  3335. # XXX why is this commented out?
  3336. # if ${CVS} diff -u first-dir >> ${LOGFILE} || test $? = 1 ; then
  3337. # pass 42
  3338. # else
  3339. # fail 42
  3340. # fi
  3341. dotest basic2-16 "${testcvs} ci -m 'third dive' first-dir" \
  3342. "${PROG} [a-z]*: Examining first-dir
  3343. ${PROG} [a-z]*: Examining first-dir/dir1
  3344. ${PROG} [a-z]*: Examining first-dir/dir1/dir2
  3345. RCS file: ${CVSROOT_DIRNAME}/first-dir/file14,v
  3346. done
  3347. Checking in first-dir/file14;
  3348. ${CVSROOT_DIRNAME}/first-dir/file14,v <-- file14
  3349. initial revision: 1\.1
  3350. done
  3351. Checking in first-dir/file6;
  3352. ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
  3353. new revision: 1\.2; previous revision: 1\.1
  3354. done
  3355. Removing first-dir/file7;
  3356. ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
  3357. new revision: delete; previous revision: 1\.1
  3358. done
  3359. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/file14,v
  3360. done
  3361. Checking in first-dir/dir1/file14;
  3362. ${CVSROOT_DIRNAME}/first-dir/dir1/file14,v <-- file14
  3363. initial revision: 1\.1
  3364. done
  3365. Checking in first-dir/dir1/file6;
  3366. ${CVSROOT_DIRNAME}/first-dir/dir1/file6,v <-- file6
  3367. new revision: 1\.2; previous revision: 1\.1
  3368. done
  3369. Removing first-dir/dir1/file7;
  3370. ${CVSROOT_DIRNAME}/first-dir/dir1/file7,v <-- file7
  3371. new revision: delete; previous revision: 1\.1
  3372. done
  3373. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v
  3374. done
  3375. Checking in first-dir/dir1/dir2/file14;
  3376. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file14,v <-- file14
  3377. initial revision: 1\.1
  3378. done
  3379. Checking in first-dir/dir1/dir2/file6;
  3380. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file6,v <-- file6
  3381. new revision: 1\.2; previous revision: 1\.1
  3382. done
  3383. Removing first-dir/dir1/dir2/file7;
  3384. ${CVSROOT_DIRNAME}/first-dir/dir1/dir2/file7,v <-- file7
  3385. new revision: delete; previous revision: 1\.1
  3386. done"
  3387. dotest basic2-17 "${testcvs} -q update first-dir" ''
  3388. dotest basic2-18 "${testcvs} tag third-dive first-dir" \
  3389. "${PROG} tag: Tagging first-dir
  3390. T first-dir/file14
  3391. T first-dir/file6
  3392. ${PROG} tag: Tagging first-dir/dir1
  3393. T first-dir/dir1/file14
  3394. T first-dir/dir1/file6
  3395. ${PROG} tag: Tagging first-dir/dir1/dir2
  3396. T first-dir/dir1/dir2/file14
  3397. T first-dir/dir1/dir2/file6"
  3398. dotest basic2-19 "echo yes | ${testcvs} release -d first-dir" \
  3399. "You have \[0\] altered files in this repository\.
  3400. Are you sure you want to release (and delete) directory .first-dir.: "
  3401. # end of third dive
  3402. dotest_fail basic2-20 "test -d first-dir" ""
  3403. # now try some rtags
  3404. # rtag HEADS
  3405. dotest basic2-21 "${testcvs} rtag rtagged-by-head first-dir" \
  3406. "${PROG} rtag: Tagging first-dir
  3407. ${PROG} rtag: Tagging first-dir/dir1
  3408. ${PROG} rtag: Tagging first-dir/dir1/dir2"
  3409. # The next test used to cause an assert failure
  3410. # something like:
  3411. # cvs: ./recurse.c:667: do_recursion: Assertion `repository != ((void *)0)' failed.
  3412. dotest basic2-21b "${testcvs} co -p -r rtagged-by-head first-dir/file6" \
  3413. "===================================================================
  3414. Checking out first-dir/file6
  3415. RCS: $CVSROOT_DIRNAME/first-dir/file6,v
  3416. VERS: 1\.2
  3417. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  3418. file6
  3419. file6"
  3420. # tag by tag
  3421. dotest basic2-22 "${testcvs} rtag -r rtagged-by-head rtagged-by-tag first-dir" \
  3422. "${PROG} rtag: Tagging first-dir
  3423. ${PROG} rtag: Tagging first-dir/dir1
  3424. ${PROG} rtag: Tagging first-dir/dir1/dir2"
  3425. # tag by revision
  3426. dotest basic2-23 "${testcvs} rtag -r1.1 rtagged-by-revision first-dir" \
  3427. "${PROG} rtag: Tagging first-dir
  3428. ${PROG} rtag: Tagging first-dir/dir1
  3429. ${PROG} rtag: Tagging first-dir/dir1/dir2"
  3430. # rdiff by revision
  3431. dotest basic2-24 "${testcvs} rdiff -r1.1 -rrtagged-by-head first-dir" \
  3432. "${PROG} rdiff: Diffing first-dir
  3433. Index: first-dir/file6
  3434. diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
  3435. \*\*\* first-dir/file6:1\.1 ${DATE}
  3436. --- first-dir/file6 ${DATE}
  3437. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  3438. \*\*\* 1 \*\*\*\*
  3439. --- 1,2 ----
  3440. file6
  3441. ${PLUS} file6
  3442. Index: first-dir/file7
  3443. diff -c first-dir/file7:1\.1 first-dir/file7:removed
  3444. \*\*\* first-dir/file7:1.1 ${DATE}
  3445. --- first-dir/file7 ${DATE}
  3446. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  3447. \*\*\* 1 \*\*\*\*
  3448. - file7
  3449. --- 0 ----
  3450. ${PROG} rdiff: Diffing first-dir/dir1
  3451. Index: first-dir/dir1/file6
  3452. diff -c first-dir/dir1/file6:1\.1 first-dir/dir1/file6:1\.2
  3453. \*\*\* first-dir/dir1/file6:1\.1 ${DATE}
  3454. --- first-dir/dir1/file6 ${DATE}
  3455. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  3456. \*\*\* 1 \*\*\*\*
  3457. --- 1,2 ----
  3458. file6
  3459. ${PLUS} file6
  3460. Index: first-dir/dir1/file7
  3461. diff -c first-dir/dir1/file7:1\.1 first-dir/dir1/file7:removed
  3462. \*\*\* first-dir/dir1/file7:1\.1 ${DATE}
  3463. --- first-dir/dir1/file7 ${DATE}
  3464. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  3465. \*\*\* 1 \*\*\*\*
  3466. - file7
  3467. --- 0 ----
  3468. ${PROG} rdiff: Diffing first-dir/dir1/dir2
  3469. Index: first-dir/dir1/dir2/file6
  3470. diff -c first-dir/dir1/dir2/file6:1\.1 first-dir/dir1/dir2/file6:1\.2
  3471. \*\*\* first-dir/dir1/dir2/file6:1\.1 ${DATE}
  3472. --- first-dir/dir1/dir2/file6 ${DATE}
  3473. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  3474. \*\*\* 1 \*\*\*\*
  3475. --- 1,2 ----
  3476. file6
  3477. ${PLUS} file6
  3478. Index: first-dir/dir1/dir2/file7
  3479. diff -c first-dir/dir1/dir2/file7:1\.1 first-dir/dir1/dir2/file7:removed
  3480. \*\*\* first-dir/dir1/dir2/file7:1\.1 ${DATE}
  3481. --- first-dir/dir1/dir2/file7 ${DATE}
  3482. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  3483. \*\*\* 1 \*\*\*\*
  3484. - file7
  3485. --- 0 ----"
  3486. dotest basic2-24a "${testcvs} rdiff -l -r1.1 -rrtagged-by-head first-dir" \
  3487. "${PROG} rdiff: Diffing first-dir
  3488. Index: first-dir/file6
  3489. diff -c first-dir/file6:1\.1 first-dir/file6:1\.2
  3490. \*\*\* first-dir/file6:1\.1 ${DATE}
  3491. --- first-dir/file6 ${DATE}
  3492. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  3493. \*\*\* 1 \*\*\*\*
  3494. --- 1,2 ----
  3495. file6
  3496. ${PLUS} file6
  3497. Index: first-dir/file7
  3498. diff -c first-dir/file7:1\.1 first-dir/file7:removed
  3499. \*\*\* first-dir/file7:1.1 ${DATE}
  3500. --- first-dir/file7 ${DATE}
  3501. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  3502. \*\*\* 1 \*\*\*\*
  3503. - file7
  3504. --- 0 ----"
  3505. # now export by rtagged-by-head and rtagged-by-tag and compare.
  3506. dotest basic2-25 "${testcvs} export -r rtagged-by-head -d 1dir first-dir" \
  3507. "${PROG} export: Updating 1dir
  3508. U 1dir/file14
  3509. U 1dir/file6
  3510. ${PROG} export: Updating 1dir/dir1
  3511. U 1dir/dir1/file14
  3512. U 1dir/dir1/file6
  3513. ${PROG} export: Updating 1dir/dir1/dir2
  3514. U 1dir/dir1/dir2/file14
  3515. U 1dir/dir1/dir2/file6"
  3516. dotest_fail basic2-25a "test -d 1dir/CVS"
  3517. dotest_fail basic2-25b "test -d 1dir/dir1/CVS"
  3518. dotest_fail basic2-25c "test -d 1dir/dir1/dir2/CVS"
  3519. dotest basic2-26 "${testcvs} export -r rtagged-by-tag first-dir" \
  3520. "${PROG} export: Updating first-dir
  3521. U first-dir/file14
  3522. U first-dir/file6
  3523. ${PROG} export: Updating first-dir/dir1
  3524. U first-dir/dir1/file14
  3525. U first-dir/dir1/file6
  3526. ${PROG} export: Updating first-dir/dir1/dir2
  3527. U first-dir/dir1/dir2/file14
  3528. U first-dir/dir1/dir2/file6"
  3529. dotest_fail basic2-26a "test -d first-dir/CVS"
  3530. dotest_fail basic2-26b "test -d first-dir/dir1/CVS"
  3531. dotest_fail basic2-26c "test -d first-dir/dir1/dir2/CVS"
  3532. dotest basic2-27 "directory_cmp 1dir first-dir"
  3533. rm -r 1dir first-dir
  3534. # checkout by revision vs export by rtagged-by-revision and compare.
  3535. mkdir export-dir
  3536. dotest basic2-28 "${testcvs} export -rrtagged-by-revision -d export-dir first-dir" \
  3537. "${PROG} export: Updating export-dir
  3538. U export-dir/file14
  3539. U export-dir/file6
  3540. U export-dir/file7
  3541. ${PROG} export: Updating export-dir/dir1
  3542. U export-dir/dir1/file14
  3543. U export-dir/dir1/file6
  3544. U export-dir/dir1/file7
  3545. ${PROG} export: Updating export-dir/dir1/dir2
  3546. U export-dir/dir1/dir2/file14
  3547. U export-dir/dir1/dir2/file6
  3548. U export-dir/dir1/dir2/file7"
  3549. dotest_fail basic2-28a "test -d export-dir/CVS"
  3550. dotest_fail basic2-28b "test -d export-dir/dir1/CVS"
  3551. dotest_fail basic2-28c "test -d export-dir/dir1/dir2/CVS"
  3552. dotest basic2-29 "${testcvs} co -r1.1 first-dir" \
  3553. "${PROG} checkout: Updating first-dir
  3554. U first-dir/file14
  3555. U first-dir/file6
  3556. U first-dir/file7
  3557. ${PROG} checkout: Updating first-dir/dir1
  3558. U first-dir/dir1/file14
  3559. U first-dir/dir1/file6
  3560. U first-dir/dir1/file7
  3561. ${PROG} checkout: Updating first-dir/dir1/dir2
  3562. U first-dir/dir1/dir2/file14
  3563. U first-dir/dir1/dir2/file6
  3564. U first-dir/dir1/dir2/file7"
  3565. # directory copies are done in an oblique way in order to avoid a bug in sun's tmp filesystem.
  3566. mkdir first-dir.cpy ; (cd first-dir ; tar cf - . | (cd ../first-dir.cpy ; tar xf -))
  3567. dotest basic2-30 "directory_cmp first-dir export-dir"
  3568. # interrupt, while we've got a clean 1.1 here, let's import it
  3569. # into a couple of other modules.
  3570. cd export-dir
  3571. dotest_sort basic2-31 "${testcvs} import -m first-import second-dir first-immigration immigration1 immigration1_0" \
  3572. "
  3573. N second-dir/dir1/dir2/file14
  3574. N second-dir/dir1/dir2/file6
  3575. N second-dir/dir1/dir2/file7
  3576. N second-dir/dir1/file14
  3577. N second-dir/dir1/file6
  3578. N second-dir/dir1/file7
  3579. N second-dir/file14
  3580. N second-dir/file6
  3581. N second-dir/file7
  3582. No conflicts created by this import
  3583. ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/dir1
  3584. ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/dir1/dir2"
  3585. cd ..
  3586. dotest basic2-32 "${testcvs} export -r HEAD second-dir" \
  3587. "${PROG} export: Updating second-dir
  3588. U second-dir/file14
  3589. U second-dir/file6
  3590. U second-dir/file7
  3591. ${PROG} export: Updating second-dir/dir1
  3592. U second-dir/dir1/file14
  3593. U second-dir/dir1/file6
  3594. U second-dir/dir1/file7
  3595. ${PROG} export: Updating second-dir/dir1/dir2
  3596. U second-dir/dir1/dir2/file14
  3597. U second-dir/dir1/dir2/file6
  3598. U second-dir/dir1/dir2/file7"
  3599. dotest basic2-33 "directory_cmp first-dir second-dir"
  3600. rm -r second-dir
  3601. rm -r export-dir first-dir
  3602. mkdir first-dir
  3603. (cd first-dir.cpy ; tar cf - . | (cd ../first-dir ; tar xf -))
  3604. # update the top, cancelling sticky tags, retag, update other copy, compare.
  3605. cd first-dir
  3606. dotest basic2-34 "${testcvs} update -A -l *file*" \
  3607. "[UP] file6
  3608. ${PROG} update: file7 is no longer in the repository"
  3609. # If we don't delete the tag first, cvs won't retag it.
  3610. # This would appear to be a feature.
  3611. dotest basic2-35 "${testcvs} tag -l -d rtagged-by-revision" \
  3612. "${PROG} tag: Untagging \.
  3613. D file14
  3614. D file6"
  3615. dotest basic2-36 "${testcvs} tag -l rtagged-by-revision" \
  3616. "${PROG} tag: Tagging \.
  3617. T file14
  3618. T file6"
  3619. cd ..
  3620. mv first-dir 1dir
  3621. mv first-dir.cpy first-dir
  3622. cd first-dir
  3623. dotest basic2-37 "${testcvs} -q diff -u" ''
  3624. dotest basic2-38 "${testcvs} update" \
  3625. "${PROG} update: Updating .
  3626. ${PROG} update: Updating dir1
  3627. ${PROG} update: Updating dir1/dir2"
  3628. cd ..
  3629. #### FIXME: is this expected to work??? Need to investigate
  3630. #### and fix or remove the test.
  3631. # dotest basic2-39 "directory_cmp 1dir first-dir"
  3632. rm -r 1dir first-dir
  3633. # Test the cvs history command.
  3634. # The reason that there are two patterns rather than using
  3635. # \(${TESTDIR}\|<remote>\) is that we are trying to
  3636. # make this portable. Perhaps at some point we should
  3637. # ditch that notion and require GNU expr (or dejagnu or....)
  3638. # since it seems to be so painful.
  3639. # why are there two lines at the end of the local output
  3640. # which don't exist in the remote output? would seem to be
  3641. # a CVS bug.
  3642. dotest basic2-64 "${testcvs} his -x TOFWUPCGMAR -a" \
  3643. "O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= ${TESTDIR}/\*
  3644. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == ${TESTDIR}
  3645. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == ${TESTDIR}
  3646. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == ${TESTDIR}
  3647. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == ${TESTDIR}
  3648. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == ${TESTDIR}
  3649. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == ${TESTDIR}
  3650. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == ${TESTDIR}
  3651. M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TESTDIR}
  3652. R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TESTDIR}
  3653. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == ${TESTDIR}
  3654. M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == ${TESTDIR}
  3655. R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == ${TESTDIR}
  3656. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == ${TESTDIR}
  3657. M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == ${TESTDIR}
  3658. R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == ${TESTDIR}
  3659. F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= ${TESTDIR}/\*
  3660. T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
  3661. T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
  3662. T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
  3663. O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= ${TESTDIR}/\*
  3664. U [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TESTDIR}/first-dir
  3665. W [0-9-]* [0-9:]* ${PLUS}0000 ${username} file7 first-dir == ${TESTDIR}/first-dir" \
  3666. "O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= <remote>/\*
  3667. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == <remote>
  3668. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == <remote>
  3669. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == <remote>
  3670. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == <remote>
  3671. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == <remote>
  3672. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == <remote>
  3673. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == <remote>
  3674. M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
  3675. R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == <remote>
  3676. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == <remote>
  3677. M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == <remote>
  3678. R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == <remote>
  3679. A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == <remote>
  3680. M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == <remote>
  3681. R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == <remote>
  3682. F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= <remote>/\*
  3683. T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
  3684. T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
  3685. T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
  3686. O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= <remote>/\*
  3687. P [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
  3688. W [0-9-]* [0-9:]* ${PLUS}0000 ${username} file7 first-dir == <remote>"
  3689. rm -rf ${CVSROOT_DIRNAME}/first-dir
  3690. rm -rf ${CVSROOT_DIRNAME}/second-dir
  3691. ;;
  3692. parseroot)
  3693. mkdir 1; cd 1
  3694. # Test odd cases involving CVSROOT. At the moment, that means we
  3695. # are testing roots with '/'s on the end, which CVS should parse off.
  3696. CVSROOT_save=${CVSROOT}
  3697. CVSROOT="${CVSROOT}/////"
  3698. dotest parseroot-1 "${testcvs} -q co CVSROOT/modules" \
  3699. "U CVSROOT/modules"
  3700. dotest parseroot-2 "${testcvs} -q ci -fmnull-change CVSROOT/modules" \
  3701. "Checking in CVSROOT/modules;
  3702. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  3703. new revision: 1\.2; previous revision: 1\.1
  3704. done
  3705. ${PROG} commit: Rebuilding administrative file database"
  3706. if $remote; then
  3707. # I only test these when testing remote in case CVS was compiled
  3708. # without client support.
  3709. # logout does not try to contact the server.
  3710. CVSROOT=":pserver;proxy=localhost;proxyport=8080:localhost/dev/null"
  3711. dotest parseroot-3r "$testcvs -d'$CVSROOT' logout" \
  3712. "$PROG logout: WARNING: Ignoring method options found in CVSROOT: \`proxy=localhost;proxyport=8080'\.
  3713. $PROG logout: Use CVS version 1\.12\.7 or later to handle method options\.
  3714. Logging out of :pserver:$username@localhost:2401/dev/null
  3715. $PROG logout: warning: failed to open $HOME/\.cvspass for reading: No such file or directory
  3716. $PROG logout: Entry not found\."
  3717. fi
  3718. if $keep; then
  3719. echo Keeping $TESTDIR and exiting due to --keep
  3720. exit 0
  3721. fi
  3722. CVSROOT=$CVSROOT_save
  3723. cd ..
  3724. rm -r 1
  3725. ;;
  3726. files)
  3727. # Test of how we specify files on the command line
  3728. # (recurse.c and that sort of thing). Vaguely similar to
  3729. # tests like basic* and deep. See modules and such tests
  3730. # for what happens when we throw in modules and co -d, &c.
  3731. # This particular test is fairly carefully crafted, to spot
  3732. # one particular issue with remote.
  3733. mkdir 1; cd 1
  3734. dotest files-1 "${testcvs} -q co -l ." ""
  3735. mkdir first-dir
  3736. dotest files-2 "${testcvs} add first-dir" \
  3737. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  3738. cd first-dir
  3739. touch tfile
  3740. dotest files-3 "${testcvs} add tfile" \
  3741. "${PROG} add: scheduling file .tfile. for addition
  3742. ${PROG} add: use .${PROG} commit. to add this file permanently"
  3743. dotest files-4 "${testcvs} -q ci -m add" \
  3744. "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
  3745. done
  3746. Checking in tfile;
  3747. ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
  3748. initial revision: 1\.1
  3749. done"
  3750. dotest files-5 "${testcvs} -q tag -b C" "T tfile"
  3751. dotest files-6 "$testcvs -q update -r C" "U tfile"
  3752. mkdir dir
  3753. dotest files-7 "${testcvs} add dir" \
  3754. "Directory ${CVSROOT_DIRNAME}/first-dir/dir added to the repository
  3755. --> Using per-directory sticky tag .C'"
  3756. cd dir
  3757. touch .file
  3758. dotest files-6 "${testcvs} add .file" \
  3759. "${PROG} add: scheduling file .\.file' for addition on branch .C.
  3760. ${PROG} add: use .${PROG} commit. to add this file permanently"
  3761. mkdir sdir
  3762. dotest files-7 "${testcvs} add sdir" \
  3763. "Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir added to the repository
  3764. --> Using per-directory sticky tag .C'"
  3765. cd sdir
  3766. mkdir ssdir
  3767. dotest files-8 "${testcvs} add ssdir" \
  3768. "Directory ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir added to the repository
  3769. --> Using per-directory sticky tag .C'"
  3770. cd ssdir
  3771. touch .file
  3772. dotest files-9 "${testcvs} add .file" \
  3773. "${PROG} add: scheduling file .\.file' for addition on branch .C.
  3774. ${PROG} add: use .${PROG} commit. to add this file permanently"
  3775. cd ../..
  3776. dotest files-10 "${testcvs} -q ci -m test" \
  3777. "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v
  3778. done
  3779. Checking in \.file;
  3780. ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
  3781. new revision: 1\.1\.2\.1; previous revision: 1\.1
  3782. done
  3783. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v
  3784. done
  3785. Checking in sdir/ssdir/\.file;
  3786. ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
  3787. new revision: 1\.1\.2\.1; previous revision: 1\.1
  3788. done"
  3789. dotest files-11 \
  3790. "${testcvs} commit -m test -f ./.file ./sdir/ssdir/.file" \
  3791. "Checking in \.file;
  3792. ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
  3793. new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
  3794. done
  3795. Checking in \./sdir/ssdir/\.file;
  3796. ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
  3797. new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
  3798. done"
  3799. if $remote; then
  3800. # FIXCVS:
  3801. # This is a bug, looks like that toplevel_repos cruft in
  3802. # client.c is coming back to haunt us.
  3803. # May want to think about the whole issue, toplevel_repos
  3804. # has always been crufty and trying to patch it up again
  3805. # might be a mistake.
  3806. dotest files-12 \
  3807. "${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
  3808. "Checking in \./sdir/ssdir/\.file;
  3809. ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
  3810. new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
  3811. done"
  3812. # Sync up the version numbers so that the rest of the
  3813. # tests don't need to expect different numbers based
  3814. # local or remote.
  3815. dotest files-12-workaround \
  3816. "${testcvs} commit -f -m test .file" \
  3817. "Checking in \.file;
  3818. ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
  3819. new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
  3820. done"
  3821. else
  3822. dotest files-12 \
  3823. "${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
  3824. "Checking in \./sdir/ssdir/\.file;
  3825. ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
  3826. new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
  3827. done
  3828. Checking in \.file;
  3829. ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
  3830. new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
  3831. done"
  3832. fi
  3833. dotest files-13 \
  3834. "${testcvs} commit -fmtest ./sdir/../sdir/ssdir/..///ssdir/.file" \
  3835. "Checking in \./sdir/\.\./sdir/ssdir/\.\.///ssdir/\.file;
  3836. ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
  3837. new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
  3838. done"
  3839. if $remote; then
  3840. dotest files-14 \
  3841. "${testcvs} commit -fmtest ../../first-dir/dir/.file" \
  3842. "Checking in \.\./\.\./first-dir/dir/\.file;
  3843. ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- .file
  3844. new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
  3845. done"
  3846. else
  3847. dotest files-14 \
  3848. "${testcvs} commit -fmtest ../../first-dir/dir/.file" \
  3849. "Checking in \.\./\.\./first-dir/dir/\.file;
  3850. ${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
  3851. new revision: 1\.1\.2\.4; previous revision: 1\.1\.2\.3
  3852. done"
  3853. fi
  3854. cd ../../..
  3855. rm -r 1
  3856. rm -rf ${CVSROOT_DIRNAME}/first-dir
  3857. ;;
  3858. spacefiles)
  3859. # More filename tests, in particular spaces in file names.
  3860. # (it might be better to just change a few of the names in
  3861. # basica or some other test instead, always good to keep the
  3862. # testsuite concise).
  3863. mkdir 1; cd 1
  3864. dotest spacefiles-1 "${testcvs} -q co -l ." ""
  3865. touch ./-c
  3866. dotest spacefiles-2 "${testcvs} add -- -c" \
  3867. "${PROG} add: scheduling file .-c. for addition
  3868. ${PROG} add: use .${PROG} commit. to add this file permanently"
  3869. dotest spacefiles-3 "${testcvs} -q ci -m add" \
  3870. "RCS file: ${CVSROOT_DIRNAME}/-c,v
  3871. done
  3872. Checking in -c;
  3873. ${CVSROOT_DIRNAME}/-c,v <-- -c
  3874. initial revision: 1\.1
  3875. done"
  3876. mkdir 'first dir'
  3877. dotest spacefiles-4 "${testcvs} add 'first dir'" \
  3878. "Directory ${CVSROOT_DIRNAME}/first dir added to the repository"
  3879. mkdir ./-b
  3880. dotest spacefiles-5 "${testcvs} add -- -b" \
  3881. "Directory ${CVSROOT_DIRNAME}/-b added to the repository"
  3882. cd 'first dir'
  3883. touch 'a file'
  3884. dotest spacefiles-6 "${testcvs} add 'a file'" \
  3885. "${PROG} add: scheduling file .a file. for addition
  3886. ${PROG} add: use .${PROG} commit. to add this file permanently"
  3887. dotest spacefiles-7 "${testcvs} -q ci -m add" \
  3888. "RCS file: ${CVSROOT_DIRNAME}/first dir/a file,v
  3889. done
  3890. Checking in a file;
  3891. ${CVSROOT_DIRNAME}/first dir/a file,v <-- a file
  3892. initial revision: 1\.1
  3893. done"
  3894. dotest spacefiles-8 "${testcvs} -q tag new-tag" "T a file"
  3895. cd ../..
  3896. mkdir 2; cd 2
  3897. dotest spacefiles-10 "${testcvs} co -- -b" \
  3898. "${PROG} checkout: Updating -b"
  3899. dotest spacefiles-11 "${testcvs} -q co -- -c" "U \./-c"
  3900. rm ./-c
  3901. dotest spacefiles-13 "${testcvs} -q co 'first dir'" \
  3902. "U first dir/a file"
  3903. cd ..
  3904. mkdir 3; cd 3
  3905. dotest spacefiles-14 "${testcvs} -q co 'first dir/a file'" \
  3906. "U first dir/a file"
  3907. cd ..
  3908. rm -r 1 2 3
  3909. rm -rf "${CVSROOT_DIRNAME}/first dir"
  3910. rm -r ${CVSROOT_DIRNAME}/-b
  3911. rm -f ${CVSROOT_DIRNAME}/-c,v
  3912. ;;
  3913. commit-readonly)
  3914. mkdir 1; cd 1
  3915. module=x
  3916. : > junk
  3917. dotest commit-readonly-1 "$testcvs -Q import -m . $module X Y" ''
  3918. dotest commit-readonly-2 "$testcvs -Q co $module" ''
  3919. cd $module
  3920. file=m
  3921. # Include an rcs keyword to be expanded.
  3922. echo '$Id''$' > $file
  3923. dotest commit-readonly-3 "$testcvs add $file" \
  3924. "${PROG} add: scheduling file .$file. for addition
  3925. ${PROG} add: use .${PROG} commit. to add this file permanently"
  3926. dotest commit-readonly-4 "$testcvs -Q ci -m . $file" \
  3927. "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
  3928. done
  3929. Checking in $file;
  3930. ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
  3931. initial revision: 1\.1
  3932. done"
  3933. echo line2 >> $file
  3934. # Make the file read-only.
  3935. chmod a-w $file
  3936. dotest commit-readonly-5 "$testcvs -Q ci -m . $file" \
  3937. "Checking in $file;
  3938. ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
  3939. new revision: 1\.2; previous revision: 1\.1
  3940. done"
  3941. cd ../..
  3942. rm -rf 1
  3943. rm -rf ${CVSROOT_DIRNAME}/$module
  3944. ;;
  3945. status)
  3946. # This tests for a bug in the status command which failed to
  3947. # notice resolved conflicts.
  3948. mkdir status; cd status
  3949. dotest status-init-1 "${testcvs} -q co -l ." ""
  3950. mkdir first-dir
  3951. dotest status-init-2 "${testcvs} add first-dir" \
  3952. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  3953. cd first-dir
  3954. echo a line >tfile
  3955. dotest status-init-3 "${testcvs} add tfile" \
  3956. "${PROG} add: scheduling file .tfile. for addition
  3957. ${PROG} add: use .${PROG} commit. to add this file permanently"
  3958. dotest status-init-4 "${testcvs} -q ci -m add" \
  3959. "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
  3960. done
  3961. Checking in tfile;
  3962. ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
  3963. initial revision: 1\.1
  3964. done"
  3965. cd ..
  3966. dotest status-init-5 "${testcvs} -q co -dsecond-dir first-dir" \
  3967. "U second-dir/tfile"
  3968. cd second-dir
  3969. echo some junk >>tfile
  3970. dotest status-init-6 "${testcvs} -q ci -maline" \
  3971. "Checking in tfile;
  3972. ${CVSROOT_DIRNAME}/first-dir/tfile,v <-- tfile
  3973. new revision: 1\.2; previous revision: 1\.1
  3974. done"
  3975. cd ../first-dir
  3976. echo force a conflict >>tfile
  3977. dotest status-init-7 "${testcvs} -q up" \
  3978. "RCS file: ${CVSROOT_DIRNAME}/first-dir/tfile,v
  3979. retrieving revision 1\.1
  3980. retrieving revision 1\.2
  3981. Merging differences between 1\.1 and 1\.2 into tfile
  3982. rcsmerge: warning: conflicts during merge
  3983. ${PROG} update: conflicts found in tfile
  3984. C tfile"
  3985. # Now note our status
  3986. dotest status-1 "${testcvs} status tfile" \
  3987. "===================================================================
  3988. File: tfile Status: Unresolved Conflict
  3989. Working revision: 1\.2.*
  3990. Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
  3991. Sticky Tag: (none)
  3992. Sticky Date: (none)
  3993. Sticky Options: (none)"
  3994. # touch the file, leaving conflict markers in place
  3995. # and note our status
  3996. touch tfile
  3997. dotest status-2 "${testcvs} status tfile" \
  3998. "===================================================================
  3999. File: tfile Status: File had conflicts on merge
  4000. Working revision: 1\.2.*
  4001. Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
  4002. Sticky Tag: (none)
  4003. Sticky Date: (none)
  4004. Sticky Options: (none)"
  4005. # resolve the conflict
  4006. echo resolution >tfile
  4007. dotest status-3 "${testcvs} status tfile" \
  4008. "===================================================================
  4009. File: tfile Status: Locally Modified
  4010. Working revision: 1\.2.*
  4011. Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
  4012. Sticky Tag: (none)
  4013. Sticky Date: (none)
  4014. Sticky Options: (none)"
  4015. # Check that there are no problems just using CVS/Root too.
  4016. save_CVSROOT=$CVSROOT
  4017. unset CVSROOT
  4018. dotest status-3a "${testcvs} status tfile" \
  4019. "===================================================================
  4020. File: tfile Status: Locally Modified
  4021. Working revision: 1\.2.*
  4022. Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
  4023. Sticky Tag: (none)
  4024. Sticky Date: (none)
  4025. Sticky Options: (none)"
  4026. CVSROOT=$save_CVSROOT
  4027. export CVSROOT
  4028. # FIXCVS:
  4029. # Update is supposed to re-Register() the file when it
  4030. # finds resolved conflicts:
  4031. dotest status-4 "grep 'Result of merge' CVS/Entries" \
  4032. "/tfile/1\.2/Result of merge${PLUS}[a-zA-Z0-9 :]*//"
  4033. cd ..
  4034. mkdir fourth-dir
  4035. dotest status-init-8 "$testcvs add fourth-dir" \
  4036. "Directory $CVSROOT_DIRNAME/fourth-dir added to the repository"
  4037. cd fourth-dir
  4038. echo yet another line >t3file
  4039. dotest status-init-9 "$testcvs add t3file" \
  4040. "$PROG add: scheduling file .t3file. for addition
  4041. $PROG add: use .$PROG commit. to add this file permanently"
  4042. dotest status-init-10 "$testcvs -q ci -m add" \
  4043. "RCS file: $CVSROOT_DIRNAME/fourth-dir/t3file,v
  4044. done
  4045. Checking in t3file;
  4046. $CVSROOT_DIRNAME/fourth-dir/t3file,v <-- t3file
  4047. initial revision: 1\.1
  4048. done"
  4049. cd ../first-dir
  4050. mkdir third-dir
  4051. dotest status-init-11 "$testcvs add third-dir" \
  4052. "Directory $CVSROOT_DIRNAME/first-dir/third-dir added to the repository"
  4053. cd third-dir
  4054. echo another line >t2file
  4055. dotest status-init-12 "$testcvs add t2file" \
  4056. "$PROG add: scheduling file .t2file. for addition
  4057. $PROG add: use .$PROG commit. to add this file permanently"
  4058. dotest status-init-13 "$testcvs -q ci -m add" \
  4059. "RCS file: $CVSROOT_DIRNAME/first-dir/third-dir/t2file,v
  4060. done
  4061. Checking in t2file;
  4062. $CVSROOT_DIRNAME/first-dir/third-dir/t2file,v <-- t2file
  4063. initial revision: 1\.1
  4064. done"
  4065. dotest status-5 "$testcvs status ../tfile" \
  4066. "===================================================================
  4067. File: tfile Status: Locally Modified
  4068. Working revision: 1\.2.*
  4069. Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/tfile,v
  4070. Sticky Tag: (none)
  4071. Sticky Date: (none)
  4072. Sticky Options: (none)"
  4073. dotest status-6 "$testcvs status ../../fourth-dir/t3file" \
  4074. "===================================================================
  4075. File: t3file Status: Up-to-date
  4076. Working revision: 1\.1.*
  4077. Repository revision: 1\.1 $CVSROOT_DIRNAME/fourth-dir/t3file,v
  4078. Sticky Tag: (none)
  4079. Sticky Date: (none)
  4080. Sticky Options: (none)"
  4081. if $keep; then
  4082. echo Keeping $TESTDIR and exiting due to --keep
  4083. exit 0
  4084. fi
  4085. cd ../../..
  4086. rm -rf status
  4087. rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/fourth-dir
  4088. ;;
  4089. rdiff)
  4090. # Test rdiff
  4091. # XXX for now this is just the most essential test...
  4092. cd ${TESTDIR}
  4093. mkdir testimport
  4094. cd testimport
  4095. echo '$''Id$' > foo
  4096. echo '$''Name$' >> foo
  4097. echo '$''Id$' > bar
  4098. echo '$''Name$' >> bar
  4099. dotest_sort rdiff-1 \
  4100. "${testcvs} import -I ! -m test-import-with-keyword trdiff TRDIFF T1" \
  4101. '
  4102. N trdiff/bar
  4103. N trdiff/foo
  4104. No conflicts created by this import'
  4105. dotest rdiff-2 \
  4106. "${testcvs} co -ko trdiff" \
  4107. "${PROG} checkout: Updating trdiff
  4108. U trdiff/bar
  4109. U trdiff/foo"
  4110. cd trdiff
  4111. echo something >> foo
  4112. dotest rdiff-3 \
  4113. "${testcvs} ci -m added-something foo" \
  4114. "Checking in foo;
  4115. ${CVSROOT_DIRNAME}/trdiff/foo,v <-- foo
  4116. new revision: 1\.2; previous revision: 1\.1
  4117. done"
  4118. echo '#ident "@(#)trdiff:$''Name$:$''Id$"' > new
  4119. echo "new file" >> new
  4120. dotest rdiff-4 \
  4121. "${testcvs} add -m new-file-description new" \
  4122. "${PROG} add: scheduling file \`new' for addition
  4123. ${PROG} add: use .${PROG} commit. to add this file permanently"
  4124. dotest rdiff-5 \
  4125. "${testcvs} commit -m added-new-file new" \
  4126. "RCS file: ${CVSROOT_DIRNAME}/trdiff/new,v
  4127. done
  4128. Checking in new;
  4129. ${CVSROOT_DIRNAME}/trdiff/new,v <-- new
  4130. initial revision: 1\.1
  4131. done"
  4132. dotest rdiff-6 \
  4133. "${testcvs} tag local-v0" \
  4134. "${PROG} tag: Tagging .
  4135. T bar
  4136. T foo
  4137. T new"
  4138. dotest rdiff-7 \
  4139. "${testcvs} status -v foo" \
  4140. "===================================================================
  4141. File: foo Status: Up-to-date
  4142. Working revision: 1\.2.*
  4143. Repository revision: 1\.2 ${CVSROOT_DIRNAME}/trdiff/foo,v
  4144. Sticky Tag: (none)
  4145. Sticky Date: (none)
  4146. Sticky Options: -ko
  4147. Existing Tags:
  4148. local-v0 (revision: 1\.2)
  4149. T1 (revision: 1\.1\.1\.1)
  4150. TRDIFF (branch: 1\.1\.1)"
  4151. cd ..
  4152. rm -r trdiff
  4153. dotest rdiff-8 \
  4154. "${testcvs} rdiff -r T1 -r local-v0 trdiff" \
  4155. "${PROG}"' rdiff: Diffing trdiff
  4156. Index: trdiff/foo
  4157. diff -c trdiff/foo:1\.1\.1\.1 trdiff/foo:1\.2
  4158. \*\*\* trdiff/foo:1\.1\.1\.1 '"${DATE}"'
  4159. --- trdiff/foo '"${DATE}"'
  4160. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  4161. \*\*\* 1,2 \*\*\*\*
  4162. ! \$''Id: foo,v 1\.1\.1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$
  4163. ! \$''Name: T1 \$
  4164. --- 1,3 ----
  4165. ! \$''Id: foo,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
  4166. ! \$''Name: local-v0 \$
  4167. ! something
  4168. Index: trdiff/new
  4169. diff -c /dev/null trdiff/new:1\.1
  4170. \*\*\* /dev/null '"${DATE}"'
  4171. --- trdiff/new '"${DATE}"'
  4172. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  4173. \*\*\* 0 \*\*\*\*
  4174. --- 1,2 ----
  4175. '"${PLUS}"' #ident "@(#)trdiff:\$''Name: local-v0 \$:\$''Id: new,v 1\.1 [0-9/]* [0-9:]* '"${username}"' Exp \$"
  4176. '"${PLUS}"' new file'
  4177. if $keep; then
  4178. echo Keeping ${TESTDIR} and exiting due to --keep
  4179. exit 0
  4180. fi
  4181. cd ..
  4182. rm -r testimport
  4183. rm -rf ${CVSROOT_DIRNAME}/trdiff
  4184. ;;
  4185. rdiff-short)
  4186. # Test that the short patch behaves as expected
  4187. # 1) Added file.
  4188. # 2) Removed file.
  4189. # 3) Different revision number with no difference.
  4190. # 4) Different revision number with changes.
  4191. # 5) Against trunk.
  4192. # 6) Same revision number (no difference).
  4193. mkdir rdiff-short; cd rdiff-short
  4194. mkdir abc
  4195. dotest rdiff-short-init-1 \
  4196. "${testcvs} -q import -I ! -m initial-import abc vendor initial" \
  4197. '
  4198. No conflicts created by this import'
  4199. dotest rdiff-short-init-2 "${testcvs} -q get abc" ''
  4200. cd abc
  4201. echo "abc" >file1.txt
  4202. dotest rdiff-short-init-3 "${testcvs} add file1.txt" \
  4203. "${PROG} add: scheduling file .file1\.txt' for addition
  4204. ${PROG} add: use .${PROG} commit. to add this file permanently"
  4205. dotest rdiff-short-init-4 \
  4206. "${testcvs} commit -madd-file1 file1.txt" \
  4207. "RCS file: ${CVSROOT_DIRNAME}/abc/file1\.txt,v
  4208. done
  4209. Checking in file1\.txt;
  4210. ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
  4211. initial revision: 1\.1
  4212. done"
  4213. echo def >>file1.txt
  4214. dotest rdiff-short-init-5 \
  4215. "${testcvs} commit -mchange-file1 file1.txt" \
  4216. "Checking in file1\.txt;
  4217. ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
  4218. new revision: 1\.2; previous revision: 1\.1
  4219. done"
  4220. echo "abc" >file1.txt
  4221. dotest rdiff-short-init-6 \
  4222. "${testcvs} commit -mrestore-file1-rev1 file1.txt" \
  4223. "Checking in file1\.txt;
  4224. ${CVSROOT_DIRNAME}/abc/file1\.txt,v <-- file1\.txt
  4225. new revision: 1\.3; previous revision: 1\.2
  4226. done"
  4227. dotest rdiff-short-init-7 \
  4228. "${testcvs} tag -r 1.1 tag1 file1.txt" \
  4229. "T file1\.txt"
  4230. dotest rdiff-short-init-8 \
  4231. "${testcvs} tag -r 1.2 tag2 file1.txt" \
  4232. "T file1\.txt"
  4233. dotest rdiff-short-init-9 \
  4234. "${testcvs} tag -r 1.3 tag3 file1.txt" \
  4235. "T file1\.txt"
  4236. echo "abc" >file2.txt
  4237. dotest rdiff-short-init-10 \
  4238. "${testcvs} add file2.txt" \
  4239. "${PROG} add: scheduling file .file2\.txt' for addition
  4240. ${PROG} add: use .${PROG} commit. to add this file permanently"
  4241. dotest rdiff-add-remove-nodiff-init-11 \
  4242. "${testcvs} commit -madd-file2 file2.txt" \
  4243. "RCS file: ${CVSROOT_DIRNAME}/abc/file2\.txt,v
  4244. done
  4245. Checking in file2\.txt;
  4246. ${CVSROOT_DIRNAME}/abc/file2\.txt,v <-- file2\.txt
  4247. initial revision: 1\.1
  4248. done"
  4249. dotest rdiff-short-init-12 \
  4250. "${testcvs} tag -r 1.1 tag4 file2.txt" \
  4251. "T file2\.txt"
  4252. dotest rdiff-short-init-13 \
  4253. "${testcvs} tag -r 1.1 tag5 file2.txt" \
  4254. "T file2\.txt"
  4255. cd ../..
  4256. rm -fr rdiff-short
  4257. # 3) Different revision number with no difference.
  4258. dotest rdiff-short-no-real-change \
  4259. "${testcvs} -q rdiff -s -r tag1 -r tag3 abc"
  4260. # 4) Different revision number with changes.
  4261. dotest rdiff-short-real-change \
  4262. "${testcvs} -q rdiff -s -r tag1 -r tag2 abc" \
  4263. 'File abc/file1.txt changed from revision 1\.1 to 1\.2'
  4264. # 1) Added file.
  4265. # 2) Removed file.
  4266. dotest_sort rdiff-short-remove-add \
  4267. "${testcvs} -q rdiff -s -r tag2 -r tag4 abc" \
  4268. 'File abc/file1\.txt is removed; tag2 revision 1\.2
  4269. File abc/file2\.txt is new; tag4 revision 1\.1'
  4270. # 6) Same revision number (no difference).
  4271. dotest rdiff-short-no-change \
  4272. "${testcvs} -q rdiff -s -r tag4 -r tag5 abc"
  4273. # 5) Against trunk.
  4274. # Check that the messages change when we diff against the trunk
  4275. # rather than a tag or date.
  4276. dotest rdiff-short-against-trunk-1 \
  4277. "${testcvs} -q rdiff -s -rtag4 abc" \
  4278. "File abc/file1\.txt is new; current revision 1\.3"
  4279. dotest rdiff-short-against-trunk-2 \
  4280. "${testcvs} -q rdiff -s -rtag2 abc" \
  4281. "File abc/file1\.txt changed from revision 1\.2 to 1\.3
  4282. File abc/file2\.txt is new; current revision 1\.1"
  4283. rm -rf ${CVSROOT_DIRNAME}/abc
  4284. ;;
  4285. rdiff2)
  4286. # Test for the segv problem reported by James Cribb
  4287. # Somewhere to work
  4288. mkdir rdiff2; cd rdiff2
  4289. # Create a module "m" with files "foo" and "d/bar"
  4290. mkdir m; cd m
  4291. echo foo >foo
  4292. mkdir d
  4293. echo bar >d/bar
  4294. dotest_sort rdiff2-1 \
  4295. "${testcvs} -q import -I ! -m initial-import m vendor initial" \
  4296. '
  4297. N m/d/bar
  4298. N m/foo
  4299. No conflicts created by this import'
  4300. cd ..
  4301. rm -r m
  4302. # Remove "foo"
  4303. dotest rdiff2-2 "${testcvs} get m" \
  4304. "${PROG} checkout: Updating m
  4305. U m/foo
  4306. ${PROG} checkout: Updating m/d
  4307. U m/d/bar"
  4308. cd m
  4309. dotest rdiff2-3 "${testcvs} rm -f foo" \
  4310. "${PROG} remove: scheduling .foo. for removal
  4311. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  4312. dotest rdiff2-4 "${testcvs} commit -m Removed foo" \
  4313. "Removing foo;
  4314. ${CVSROOT_DIRNAME}/m/foo,v <-- foo
  4315. new revision: delete; previous revision: 1\.1\.1\.1
  4316. done"
  4317. # Modify "d/bar"
  4318. echo foo >d/bar
  4319. dotest rdiff2-5 "${testcvs} commit -m Changed d/bar" \
  4320. "Checking in d/bar;
  4321. ${CVSROOT_DIRNAME}/m/d/bar,v <-- bar
  4322. new revision: 1\.2; previous revision: 1\.1
  4323. done"
  4324. # Crash before showing d/bar diffs
  4325. dotest_fail rdiff2-6 "${testcvs} rdiff -t m" \
  4326. "${PROG} rdiff: Diffing m
  4327. ${PROG} rdiff: Diffing m/d
  4328. Index: m/d/bar
  4329. diff -c m/d/bar:1\.1\.1\.1 m/d/bar:1\.2
  4330. \*\*\* m/d/bar:1\.1\.1\.1 ${DATE}
  4331. --- m/d/bar ${DATE}
  4332. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  4333. \*\*\* 1 \*\*\*\*
  4334. ! bar
  4335. --- 1 ----
  4336. ! foo"
  4337. if $keep; then
  4338. echo Keeping ${TESTDIR} and exiting due to --keep
  4339. exit 0
  4340. fi
  4341. cd ../..
  4342. rm -rf rdiff2
  4343. rm -rf ${CVSROOT_DIRNAME}/m
  4344. ;;
  4345. diff)
  4346. # Various tests specific to the "cvs diff" command.
  4347. # Related tests:
  4348. # death2: -N
  4349. # rcslib: cvs diff and $Name.
  4350. # rdiff: cvs rdiff.
  4351. # diffmerge*: nuts and bolts (stuff within diff library)
  4352. mkdir 1; cd 1
  4353. dotest diff-1 "${testcvs} -q co -l ." ''
  4354. mkdir first-dir
  4355. dotest diff-2 "${testcvs} add first-dir" \
  4356. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  4357. cd first-dir
  4358. # diff is anomalous. Most CVS commands print the "nothing
  4359. # known" message (or worse yet, no message in some cases) but
  4360. # diff says "I know nothing". Shrug.
  4361. dotest_fail diff-3 "${testcvs} diff xyzpdq" \
  4362. "${PROG} diff: I know nothing about xyzpdq"
  4363. touch abc
  4364. dotest diff-4 "${testcvs} add abc" \
  4365. "${PROG} add: scheduling file .abc. for addition
  4366. ${PROG} add: use .${PROG} commit. to add this file permanently"
  4367. dotest diff-5 "${testcvs} -q ci -mtest" \
  4368. "RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4369. done
  4370. Checking in abc;
  4371. ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
  4372. initial revision: 1\.1
  4373. done"
  4374. echo "extern int gethostname ();" >abc
  4375. dotest diff-6 "${testcvs} -q ci -mtest" \
  4376. "Checking in abc;
  4377. ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
  4378. new revision: 1\.2; previous revision: 1\.1
  4379. done"
  4380. echo "#include <winsock.h>" >abc
  4381. # check the behavior of the --ifdef=MACRO option
  4382. dotest_fail diff-7 "${testcvs} -q diff --ifdef=HAVE_WINSOCK_H" \
  4383. "Index: abc
  4384. ===================================================================
  4385. RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4386. retrieving revision 1\.2
  4387. diff --ifdef HAVE_WINSOCK_H -r1\.2 abc
  4388. #ifndef HAVE_WINSOCK_H
  4389. extern int gethostname ();
  4390. #else /\* HAVE_WINSOCK_H \*/
  4391. #include <winsock\.h>
  4392. #endif /\* HAVE_WINSOCK_H \*/"
  4393. if $keep; then
  4394. echo Keeping ${TESTDIR} and exiting due to --keep
  4395. exit 0
  4396. fi
  4397. cd ../..
  4398. rm -rf ${CVSROOT_DIRNAME}/first-dir
  4399. rm -r 1
  4400. ;;
  4401. diffnl)
  4402. # Test handling of 'cvs diff' of files without newlines
  4403. mkdir 1; cd 1
  4404. dotest diffnl-000 "${testcvs} -q co -l ." ''
  4405. mkdir first-dir
  4406. dotest diffnl-001 "${testcvs} add first-dir" \
  4407. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  4408. cd first-dir
  4409. ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nfive\nsix")}' </dev/null >abc
  4410. dotest diffnl-002 "${testcvs} add abc" \
  4411. "${PROG} add: scheduling file .abc. for addition
  4412. ${PROG} add: use .${PROG} commit. to add this file permanently"
  4413. dotest diffnl-003 "${testcvs} -q ci -mtest" \
  4414. "RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4415. done
  4416. Checking in abc;
  4417. ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
  4418. initial revision: 1\.1
  4419. done"
  4420. # change to line near EOF
  4421. ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nsix")}' </dev/null >abc
  4422. dotest_fail diffnl-100 "${testcvs} diff abc" \
  4423. "Index: abc
  4424. ===================================================================
  4425. RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4426. retrieving revision 1\.1
  4427. diff -r1\.1 abc
  4428. 5d4
  4429. < five"
  4430. dotest_fail diffnl-101 "${testcvs} diff -u abc" \
  4431. "Index: abc
  4432. ===================================================================
  4433. RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4434. retrieving revision 1\.1
  4435. diff -u -r1\.1 abc
  4436. --- abc ${RFCDATE} 1\.1
  4437. +++ abc ${RFCDATE}
  4438. @@ -2,5 +2,4 @@
  4439. two
  4440. three
  4441. four
  4442. -five
  4443. six
  4444. \\\\ No newline at end of file"
  4445. dotest diffnl-102 "${testcvs} -q ci -mtest abc" \
  4446. "Checking in abc;
  4447. ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
  4448. new revision: 1\.2; previous revision: 1\.1
  4449. done"
  4450. # Change to last line
  4451. ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nseven")}' </dev/null >abc
  4452. dotest_fail diffnl-200 "${testcvs} diff abc" \
  4453. "Index: abc
  4454. ===================================================================
  4455. RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4456. retrieving revision 1\.2
  4457. diff -r1\.2 abc
  4458. 5c5
  4459. < six
  4460. \\\\ No newline at end of file
  4461. ---
  4462. > seven
  4463. \\\\ No newline at end of file"
  4464. dotest_fail diffnl-201 "${testcvs} diff -u abc" \
  4465. "Index: abc
  4466. ===================================================================
  4467. RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4468. retrieving revision 1\.2
  4469. diff -u -r1\.2 abc
  4470. --- abc ${RFCDATE} 1\.2
  4471. +++ abc ${RFCDATE}
  4472. @@ -2,4 +2,4 @@
  4473. two
  4474. three
  4475. four
  4476. -six
  4477. \\\\ No newline at end of file
  4478. +seven
  4479. \\\\ No newline at end of file"
  4480. dotest diffnl-202 "${testcvs} ci -mtest abc" \
  4481. "Checking in abc;
  4482. ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
  4483. new revision: 1\.3; previous revision: 1\.2
  4484. done"
  4485. # Addition of newline
  4486. echo "one
  4487. two
  4488. three
  4489. four
  4490. seven" > abc
  4491. dotest_fail diffnl-300 "${testcvs} diff abc" \
  4492. "Index: abc
  4493. ===================================================================
  4494. RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4495. retrieving revision 1\.3
  4496. diff -r1\.3 abc
  4497. 5c5
  4498. < seven
  4499. \\\\ No newline at end of file
  4500. ---
  4501. > seven"
  4502. dotest_fail diffnl-301 "${testcvs} diff -u abc" \
  4503. "Index: abc
  4504. ===================================================================
  4505. RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4506. retrieving revision 1\.3
  4507. diff -u -r1\.3 abc
  4508. --- abc ${RFCDATE} 1\.3
  4509. +++ abc ${RFCDATE}
  4510. @@ -2,4 +2,4 @@
  4511. two
  4512. three
  4513. four
  4514. -seven
  4515. \\\\ No newline at end of file
  4516. +seven"
  4517. dotest diffnl-302 "${testcvs} ci -mtest abc" \
  4518. "Checking in abc;
  4519. ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
  4520. new revision: 1\.4; previous revision: 1\.3
  4521. done"
  4522. # Removal of newline
  4523. ${AWK} 'BEGIN {printf("one\ntwo\nthree\nfour\nseven")}' </dev/null >abc
  4524. dotest_fail diffnl-400 "${testcvs} diff abc" \
  4525. "Index: abc
  4526. ===================================================================
  4527. RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4528. retrieving revision 1\.4
  4529. diff -r1\.4 abc
  4530. 5c5
  4531. < seven
  4532. ---
  4533. > seven
  4534. \\\\ No newline at end of file"
  4535. dotest_fail diffnl-401 "${testcvs} diff -u abc" \
  4536. "Index: abc
  4537. ===================================================================
  4538. RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  4539. retrieving revision 1\.4
  4540. diff -u -r1\.4 abc
  4541. --- abc ${RFCDATE} 1\.4
  4542. +++ abc ${RFCDATE}
  4543. @@ -2,4 +2,4 @@
  4544. two
  4545. three
  4546. four
  4547. -seven
  4548. +seven
  4549. \\\\ No newline at end of file"
  4550. cd ../..
  4551. rm -r 1
  4552. rm -rf ${CVSROOT_DIRNAME}/first-dir
  4553. ;;
  4554. death)
  4555. # next dive. test death support.
  4556. # NOTE: this section has reached the size and
  4557. # complexity where it is getting to be a good idea to
  4558. # add new death support tests to a new section rather
  4559. # than continuing to piggyback them onto the tests here.
  4560. mkdir ${CVSROOT_DIRNAME}/first-dir
  4561. if ${CVS} co first-dir ; then
  4562. pass 65
  4563. else
  4564. fail 65
  4565. fi
  4566. cd first-dir
  4567. # Create a directory with only dead files, to make sure CVS
  4568. # doesn't get confused by it.
  4569. mkdir subdir
  4570. dotest 65a0 "${testcvs} add subdir" \
  4571. "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
  4572. cd subdir
  4573. echo file in subdir >sfile
  4574. dotest 65a1 "${testcvs} add sfile" \
  4575. "${PROG}"' add: scheduling file `sfile'\'' for addition
  4576. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  4577. dotest 65a2 "${testcvs} -q ci -m add-it" \
  4578. "RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v
  4579. done
  4580. Checking in sfile;
  4581. ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
  4582. initial revision: 1\.1
  4583. done"
  4584. rm sfile
  4585. dotest 65a3 "${testcvs} rm sfile" \
  4586. "${PROG}"' remove: scheduling `sfile'\'' for removal
  4587. '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
  4588. dotest 65a4 "${testcvs} -q ci -m remove-it" \
  4589. "Removing sfile;
  4590. ${CVSROOT_DIRNAME}/first-dir/subdir/sfile,v <-- sfile
  4591. new revision: delete; previous revision: 1\.1
  4592. done"
  4593. cd ..
  4594. dotest 65a5 "${testcvs} -q update -P" ''
  4595. dotest_fail 65a6 "test -d subdir" ''
  4596. # add a file.
  4597. touch file1
  4598. if ${CVS} add file1 2>> ${LOGFILE}; then
  4599. pass 66
  4600. else
  4601. fail 66
  4602. fi
  4603. # commit
  4604. if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
  4605. pass 67
  4606. else
  4607. fail 67
  4608. fi
  4609. # remove
  4610. rm file1
  4611. if ${CVS} rm file1 2>> ${LOGFILE}; then
  4612. pass 68
  4613. else
  4614. fail 68
  4615. fi
  4616. # commit
  4617. if ${CVS} ci -m test >>${LOGFILE} ; then
  4618. pass 69
  4619. else
  4620. fail 69
  4621. fi
  4622. dotest_fail 69a0 "test -f file1" ''
  4623. # get the old contents of file1 back
  4624. if ${testcvs} update -p -r 1.1 file1 >file1 2>>${LOGFILE}; then
  4625. pass 69a1
  4626. else
  4627. fail 69a1
  4628. fi
  4629. dotest 69a2 "cat file1" ''
  4630. # create second file
  4631. touch file2
  4632. if ${CVS} add file1 file2 2>> ${LOGFILE}; then
  4633. pass 70
  4634. else
  4635. fail 70
  4636. fi
  4637. # commit
  4638. if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
  4639. pass 71
  4640. else
  4641. fail 71
  4642. fi
  4643. # log
  4644. if ${CVS} log file1 >> ${LOGFILE}; then
  4645. pass 72
  4646. else
  4647. fail 72
  4648. fi
  4649. # file4 will be dead at the time of branching and stay dead.
  4650. echo file4 > file4
  4651. dotest death-file4-add "${testcvs} add file4" \
  4652. "${PROG}"' add: scheduling file `file4'\'' for addition
  4653. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  4654. dotest death-file4-ciadd "${testcvs} -q ci -m add file4" \
  4655. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
  4656. done
  4657. Checking in file4;
  4658. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  4659. initial revision: 1\.1
  4660. done"
  4661. rm file4
  4662. dotest death-file4-rm "${testcvs} remove file4" \
  4663. "${PROG}"' remove: scheduling `file4'\'' for removal
  4664. '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
  4665. dotest death-file4-cirm "${testcvs} -q ci -m remove file4" \
  4666. "Removing file4;
  4667. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  4668. new revision: delete; previous revision: 1\.1
  4669. done"
  4670. # Tag the branchpoint.
  4671. dotest death-72a "${testcvs} -q tag bp_branch1" 'T file1
  4672. T file2'
  4673. # branch1
  4674. if ${CVS} tag -b branch1 ; then
  4675. pass 73
  4676. else
  4677. fail 73
  4678. fi
  4679. # and move to the branch.
  4680. if ${CVS} update -r branch1 ; then
  4681. pass 74
  4682. else
  4683. fail 74
  4684. fi
  4685. dotest_fail death-file4-3 "test -f file4" ''
  4686. # add a file in the branch
  4687. echo line1 from branch1 >> file3
  4688. if ${CVS} add file3 2>> ${LOGFILE}; then
  4689. pass 75
  4690. else
  4691. fail 75
  4692. fi
  4693. # commit
  4694. if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
  4695. pass 76
  4696. else
  4697. fail 76
  4698. fi
  4699. dotest death-76a0 \
  4700. "${testcvs} -q rdiff -r bp_branch1 -r branch1 first-dir" \
  4701. "Index: first-dir/file3
  4702. diff -c /dev/null first-dir/file3:1\.1\.2\.1
  4703. \*\*\* /dev/null ${DATE}
  4704. --- first-dir/file3 ${DATE}
  4705. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  4706. \*\*\* 0 \*\*\*\*
  4707. --- 1 ----
  4708. ${PLUS} line1 from branch1"
  4709. dotest death-76a1 \
  4710. "${testcvs} -q rdiff -r branch1 -r bp_branch1 first-dir" \
  4711. "Index: first-dir/file3
  4712. diff -c first-dir/file3:1\.1\.2\.1 first-dir/file3:removed
  4713. \*\*\* first-dir/file3:1\.1\.2\.1 ${DATE}
  4714. --- first-dir/file3 ${DATE}
  4715. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  4716. \*\*\* 1 \*\*\*\*
  4717. - line1 from branch1
  4718. --- 0 ----"
  4719. # remove
  4720. rm file3
  4721. if ${CVS} rm file3 2>> ${LOGFILE}; then
  4722. pass 77
  4723. else
  4724. fail 77
  4725. fi
  4726. # commit
  4727. if ${CVS} ci -m test >>${LOGFILE} ; then
  4728. pass 78
  4729. else
  4730. fail 78
  4731. fi
  4732. # add again
  4733. echo line1 from branch1 >> file3
  4734. if ${CVS} add file3 2>> ${LOGFILE}; then
  4735. pass 79
  4736. else
  4737. fail 79
  4738. fi
  4739. # commit
  4740. if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
  4741. pass 80
  4742. else
  4743. fail 80
  4744. fi
  4745. # change the first file
  4746. echo line2 from branch1 >> file1
  4747. # commit
  4748. if ${CVS} ci -m test >> ${LOGFILE} 2>&1; then
  4749. pass 81
  4750. else
  4751. fail 81
  4752. fi
  4753. # remove the second
  4754. rm file2
  4755. if ${CVS} rm file2 2>> ${LOGFILE}; then
  4756. pass 82
  4757. else
  4758. fail 82
  4759. fi
  4760. # commit
  4761. if ${CVS} ci -m test >>${LOGFILE}; then
  4762. pass 83
  4763. else
  4764. fail 83
  4765. fi
  4766. # back to the trunk.
  4767. if ${CVS} update -A 2>> ${LOGFILE}; then
  4768. pass 84
  4769. else
  4770. fail 84
  4771. fi
  4772. dotest_fail death-file4-4 "test -f file4" ''
  4773. if test -f file3 ; then
  4774. fail 85
  4775. else
  4776. pass 85
  4777. fi
  4778. # join
  4779. dotest 86 "${testcvs} -q update -j branch1" \
  4780. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  4781. retrieving revision 1\.3
  4782. retrieving revision 1\.3\.2\.1
  4783. Merging differences between 1\.3 and 1\.3\.2\.1 into file1
  4784. ${PROG} update: scheduling file2 for removal
  4785. U file3"
  4786. dotest_fail death-file4-5 "test -f file4" ''
  4787. if test -f file3 ; then
  4788. pass 87
  4789. else
  4790. fail 87
  4791. fi
  4792. # Make sure that we joined the correct change to file1
  4793. if echo line2 from branch1 | cmp - file1 >/dev/null; then
  4794. pass 87a
  4795. else
  4796. fail 87a
  4797. fi
  4798. # update
  4799. if ${CVS} update ; then
  4800. pass 88
  4801. else
  4802. fail 88
  4803. fi
  4804. # commit
  4805. dotest 89 "${testcvs} -q ci -m test" \
  4806. "Checking in file1;
  4807. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  4808. new revision: 1\.4; previous revision: 1\.3
  4809. done
  4810. Removing file2;
  4811. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  4812. new revision: delete; previous revision: 1\.1
  4813. done
  4814. Checking in file3;
  4815. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  4816. new revision: 1\.2; previous revision: 1\.1
  4817. done"
  4818. cd ..
  4819. mkdir 2
  4820. cd 2
  4821. dotest 89a "${testcvs} -q co first-dir" 'U first-dir/file1
  4822. U first-dir/file3'
  4823. cd ..
  4824. rm -r 2
  4825. cd first-dir
  4826. # remove first file.
  4827. rm file1
  4828. if ${CVS} rm file1 2>> ${LOGFILE}; then
  4829. pass 90
  4830. else
  4831. fail 90
  4832. fi
  4833. # commit
  4834. if ${CVS} ci -m test >>${LOGFILE}; then
  4835. pass 91
  4836. else
  4837. fail 91
  4838. fi
  4839. if test -f file1 ; then
  4840. fail 92
  4841. else
  4842. pass 92
  4843. fi
  4844. # typo; try to get to the branch and fail
  4845. dotest_fail 92.1a "${testcvs} update -r brnach1" \
  4846. "${PROG}"' \[update aborted\]: no such tag brnach1'
  4847. # Make sure we are still on the trunk
  4848. if test -f file1 ; then
  4849. fail 92.1b
  4850. else
  4851. pass 92.1b
  4852. fi
  4853. if test -f file3 ; then
  4854. pass 92.1c
  4855. else
  4856. fail 92.1c
  4857. fi
  4858. # back to branch1
  4859. if ${CVS} update -r branch1 2>> ${LOGFILE}; then
  4860. pass 93
  4861. else
  4862. fail 93
  4863. fi
  4864. dotest_fail death-file4-6 "test -f file4" ''
  4865. if test -f file1 ; then
  4866. pass 94
  4867. else
  4868. fail 94
  4869. fi
  4870. # and join
  4871. dotest 95 "$testcvs -q update -j HEAD" \
  4872. "$PROG update: file file1 has been removed in revision HEAD, but the destination is incompatibly modified
  4873. C file1
  4874. $PROG update: file file3 exists, but has been added in revision HEAD"
  4875. dotest_fail death-file4-7 "test -f file4" ''
  4876. # file2 should not have been recreated. It was
  4877. # deleted on the branch, and has not been modified on
  4878. # the trunk. That means that there have been no
  4879. # changes between the greatest common ancestor (the
  4880. # trunk version) and HEAD.
  4881. dotest_fail death-file2-1 "test -f file2" ''
  4882. cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
  4883. ;;
  4884. death2)
  4885. # More tests of death support.
  4886. mkdir ${CVSROOT_DIRNAME}/first-dir
  4887. dotest death2-1 "${testcvs} -q co first-dir" ''
  4888. cd first-dir
  4889. # Add two files on the trunk.
  4890. echo "first revision" > file1
  4891. echo "file4 first revision" > file4
  4892. dotest death2-2 "${testcvs} add file1 file4" \
  4893. "${PROG}"' add: scheduling file `file1'\'' for addition
  4894. '"${PROG}"' add: scheduling file `file4'\'' for addition
  4895. '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
  4896. dotest death2-3 "${testcvs} -q commit -m add" \
  4897. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  4898. done
  4899. Checking in file1;
  4900. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  4901. initial revision: 1\.1
  4902. done
  4903. RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
  4904. done
  4905. Checking in file4;
  4906. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  4907. initial revision: 1\.1
  4908. done"
  4909. # Make a branch and a non-branch tag.
  4910. dotest death2-4 "${testcvs} -q tag -b branch" \
  4911. 'T file1
  4912. T file4'
  4913. dotest death2-5 "${testcvs} -q tag tag" \
  4914. 'T file1
  4915. T file4'
  4916. # Switch over to the branch.
  4917. dotest death2-6 "$testcvs -q update -r branch" \
  4918. '[UP] file1
  4919. [UP] file4'
  4920. # Delete the file on the branch.
  4921. rm file1
  4922. dotest death2-7 "${testcvs} rm file1" \
  4923. "${PROG} remove: scheduling .file1. for removal
  4924. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  4925. # Test diff of the removed file before it is committed.
  4926. dotest_fail death2-diff-1 "${testcvs} -q diff file1" \
  4927. "${PROG} diff: file1 was removed, no comparison available"
  4928. dotest_fail death2-diff-2 "${testcvs} -q diff -N -c file1" \
  4929. "Index: file1
  4930. ===================================================================
  4931. RCS file: file1
  4932. diff -N file1
  4933. \*\*\* file1 ${RFCDATE} [0-9.]*
  4934. --- /dev/null ${RFCDATE_EPOCH}
  4935. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  4936. \*\*\* 1 \*\*\*\*
  4937. - first revision
  4938. --- 0 ----"
  4939. dotest death2-8 "${testcvs} -q ci -m removed" \
  4940. "Removing file1;
  4941. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  4942. new revision: delete; previous revision: 1\.1
  4943. done"
  4944. # Test diff of a dead file.
  4945. dotest_fail death2-diff-3 \
  4946. "${testcvs} -q diff -r1.1 -rbranch -c file1" \
  4947. "${PROG} diff: Tag branch refers to a dead (removed) revision in file .file1.\.
  4948. ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
  4949. # and in reverse
  4950. dotest_fail death2-diff-3a \
  4951. "${testcvs} -q diff -rbranch -r1.1 -c file1" \
  4952. "${PROG} diff: Tag branch refers to a dead (removed) revision in file .file1.\.
  4953. ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
  4954. dotest_fail death2-diff-4 \
  4955. "${testcvs} -q diff -r1.1 -rbranch -N -c file1" \
  4956. "Index: file1
  4957. ===================================================================
  4958. RCS file: file1
  4959. diff -N file1
  4960. \*\*\* file1 ${RFCDATE} [0-9.]*
  4961. --- /dev/null ${RFCDATE_EPOCH}
  4962. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  4963. \*\*\* 1 \*\*\*\*
  4964. - first revision
  4965. --- 0 ----"
  4966. # and in reverse
  4967. dotest_fail death2-diff-4a \
  4968. "${testcvs} -q diff -rbranch -r1.1 -N -c file1" \
  4969. "Index: file1
  4970. ===================================================================
  4971. RCS file: file1
  4972. diff -N file1
  4973. \*\*\* /dev/null ${RFCDATE_EPOCH}
  4974. --- file1 ${RFCDATE} [0-9.]*
  4975. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  4976. \*\*\* 0 \*\*\*\*
  4977. --- 1 ----
  4978. + first revision"
  4979. dotest_fail death2-diff-5 "${testcvs} -q diff -rtag -c ." \
  4980. "${PROG} diff: file1 no longer exists, no comparison available"
  4981. dotest_fail death2-diff-6 "${testcvs} -q diff -rtag -N -c ." \
  4982. "Index: file1
  4983. ===================================================================
  4984. RCS file: file1
  4985. diff -N file1
  4986. \*\*\* file1 [-a-zA-Z0-9: ]* [0-9.]*
  4987. --- /dev/null ${RFCDATE_EPOCH}
  4988. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  4989. \*\*\* 1 \*\*\*\*
  4990. - first revision
  4991. --- 0 ----"
  4992. # Test rdiff of a dead file.
  4993. dotest death2-rdiff-1 \
  4994. "${testcvs} -q rtag -rbranch rdiff-tag first-dir" ''
  4995. dotest death2-rdiff-2 "${testcvs} -q rdiff -rtag -rbranch first-dir" \
  4996. "Index: first-dir/file1
  4997. diff -c first-dir/file1:1\.1 first-dir/file1:removed
  4998. \*\*\* first-dir/file1:1\.1 [a-zA-Z0-9: ]*
  4999. --- first-dir/file1 [a-zA-Z0-9: ]*
  5000. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  5001. \*\*\* 1 \*\*\*\*
  5002. - first revision
  5003. --- 0 ----"
  5004. # Readd the file to the branch.
  5005. echo "second revision" > file1
  5006. dotest death2-9 "${testcvs} add file1" \
  5007. "${PROG}"' add: file `file1'\'' will be added on branch `branch'\'' from version 1\.1\.2\.1
  5008. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  5009. # Test diff of the added file before it is committed.
  5010. dotest_fail death2-diff-7 "${testcvs} -q diff file1" \
  5011. "${PROG} diff: file1 is a new entry, no comparison available"
  5012. dotest_fail death2-diff-8 "${testcvs} -q diff -N -c file1" \
  5013. "Index: file1
  5014. ===================================================================
  5015. RCS file: file1
  5016. diff -N file1
  5017. \*\*\* /dev/null ${RFCDATE_EPOCH}
  5018. --- file1 ${RFCDATE}
  5019. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  5020. \*\*\* 0 \*\*\*\*
  5021. --- 1 ----
  5022. ${PLUS} second revision"
  5023. dotest death2-10 "${testcvs} -q commit -m add" \
  5024. "Checking in file1;
  5025. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5026. new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
  5027. done"
  5028. # Delete file4 from the branch
  5029. dotest death2-10a "${testcvs} rm -f file4" \
  5030. "${PROG} remove: scheduling .file4. for removal
  5031. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  5032. dotest death2-10b "${testcvs} -q ci -m removed" \
  5033. "Removing file4;
  5034. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  5035. new revision: delete; previous revision: 1\.1
  5036. done"
  5037. # Back to the trunk.
  5038. dotest death2-11 "${testcvs} -q update -A" \
  5039. "[UP] file1
  5040. U file4"
  5041. # Add another file on the trunk.
  5042. echo "first revision" > file2
  5043. dotest death2-12 "${testcvs} add file2" \
  5044. "${PROG}"' add: scheduling file `file2'\'' for addition
  5045. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  5046. dotest death2-13 "${testcvs} -q commit -m add" \
  5047. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  5048. done
  5049. Checking in file2;
  5050. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  5051. initial revision: 1\.1
  5052. done"
  5053. # Modify file4 on the trunk.
  5054. echo "new file4 revision" > file4
  5055. dotest death2-13a "${testcvs} -q commit -m mod" \
  5056. "Checking in file4;
  5057. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  5058. new revision: 1\.2; previous revision: 1\.1
  5059. done"
  5060. # Back to the branch.
  5061. # The ``no longer in the repository'' message doesn't really
  5062. # look right to me, but that's what CVS currently prints for
  5063. # this case.
  5064. dotest death2-14 "${testcvs} -q update -r branch" \
  5065. "[UP] file1
  5066. ${PROG} update: file2 is no longer in the repository
  5067. ${PROG} update: file4 is no longer in the repository"
  5068. # Add a file on the branch with the same name.
  5069. echo "branch revision" > file2
  5070. dotest death2-15 "${testcvs} add file2" \
  5071. "${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
  5072. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  5073. dotest death2-16 "${testcvs} -q commit -m add" \
  5074. "Checking in file2;
  5075. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  5076. new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
  5077. done"
  5078. # Add a new file on the branch.
  5079. echo "first revision" > file3
  5080. dotest death2-17 "${testcvs} add file3" \
  5081. "${PROG}"' add: scheduling file `file3'\'' for addition on branch `branch'\''
  5082. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  5083. dotest death2-18 "${testcvs} -q commit -m add" \
  5084. "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
  5085. done
  5086. Checking in file3;
  5087. ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
  5088. new revision: 1\.1\.2\.1; previous revision: 1\.1
  5089. done"
  5090. # Test diff of a nonexistent tag
  5091. dotest_fail death2-diff-9 "${testcvs} -q diff -rtag -c file3" \
  5092. "${PROG} diff: tag tag is not in file file3"
  5093. dotest_fail death2-diff-10 "${testcvs} -q diff -rtag -N -c file3" \
  5094. "Index: file3
  5095. ===================================================================
  5096. RCS file: file3
  5097. diff -N file3
  5098. \*\*\* /dev/null ${RFCDATE_EPOCH}
  5099. --- file3 ${RFCDATE} [0-9.]*
  5100. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  5101. \*\*\* 0 \*\*\*\*
  5102. --- 1 ----
  5103. ${PLUS} first revision"
  5104. dotest_fail death2-diff-11 "${testcvs} -q diff -rtag -c ." \
  5105. "Index: file1
  5106. ===================================================================
  5107. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  5108. retrieving revision 1\.1
  5109. retrieving revision 1\.1\.2\.2
  5110. diff -c -r1\.1 -r1\.1\.2\.2
  5111. \*\*\* file1 ${RFCDATE} [0-9.]*
  5112. --- file1 ${RFCDATE} [0-9.]*
  5113. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  5114. \*\*\* 1 \*\*\*\*
  5115. ! first revision
  5116. --- 1 ----
  5117. ! second revision
  5118. ${PROG} diff: tag tag is not in file file2
  5119. ${PROG} diff: tag tag is not in file file3
  5120. ${PROG} diff: file4 no longer exists, no comparison available"
  5121. dotest_fail death2-diff-12 "${testcvs} -q diff -rtag -c -N ." \
  5122. "Index: file1
  5123. ===================================================================
  5124. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  5125. retrieving revision 1\.1
  5126. retrieving revision 1\.1\.2\.2
  5127. diff -c -r1\.1 -r1\.1\.2\.2
  5128. \*\*\* file1 ${RFCDATE} [0-9.]*
  5129. --- file1 ${RFCDATE} [0-9.]*
  5130. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  5131. \*\*\* 1 \*\*\*\*
  5132. ! first revision
  5133. --- 1 ----
  5134. ! second revision
  5135. Index: file2
  5136. ===================================================================
  5137. RCS file: file2
  5138. diff -N file2
  5139. \*\*\* /dev/null ${RFCDATE_EPOCH}
  5140. --- file2 ${RFCDATE} [0-9.]*
  5141. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  5142. \*\*\* 0 \*\*\*\*
  5143. --- 1 ----
  5144. ${PLUS} branch revision
  5145. Index: file3
  5146. ===================================================================
  5147. RCS file: file3
  5148. diff -N file3
  5149. \*\*\* /dev/null ${RFCDATE_EPOCH}
  5150. --- file3 ${RFCDATE} [0-9.]*
  5151. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  5152. \*\*\* 0 \*\*\*\*
  5153. --- 1 ----
  5154. ${PLUS} first revision
  5155. Index: file4
  5156. ===================================================================
  5157. RCS file: file4
  5158. diff -N file4
  5159. \*\*\* file4 ${RFCDATE} [0-9.]*
  5160. --- /dev/null ${RFCDATE_EPOCH}
  5161. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  5162. \*\*\* 1 \*\*\*\*
  5163. - file4 first revision
  5164. --- 0 ----"
  5165. # Switch to the nonbranch tag.
  5166. dotest death2-19 "${testcvs} -q update -r tag" \
  5167. "[UP] file1
  5168. ${PROG} update: file2 is no longer in the repository
  5169. ${PROG} update: file3 is no longer in the repository
  5170. U file4"
  5171. dotest_fail death2-20 "test -f file2"
  5172. # Make sure diff only reports appropriate files.
  5173. dotest_fail death2-diff-13 "${testcvs} -q diff -r rdiff-tag" \
  5174. "${PROG} diff: Tag rdiff-tag refers to a dead (removed) revision in file .file1.\.
  5175. ${PROG} diff: No comparison available\. Pass .-N. to .${PROG} diff.${QUESTION}"
  5176. dotest_fail death2-diff-14 "${testcvs} -q diff -r rdiff-tag -c -N" \
  5177. "Index: file1
  5178. ===================================================================
  5179. RCS file: file1
  5180. diff -N file1
  5181. \*\*\* /dev/null ${RFCDATE_EPOCH}
  5182. --- file1 ${RFCDATE} [0-9.]*
  5183. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  5184. \*\*\* 0 \*\*\*\*
  5185. --- 1 ----
  5186. ${PLUS} first revision"
  5187. # now back to the trunk
  5188. dotest death2-21 "$testcvs -q update -A" \
  5189. '[UP] file1
  5190. U file2
  5191. U file4'
  5192. # test merging with a dead file
  5193. dotest death2-22 "${testcvs} -q co first-dir" \
  5194. "U first-dir/file1
  5195. U first-dir/file2
  5196. U first-dir/file4"
  5197. cd first-dir
  5198. dotest death2-23 "${testcvs} rm -f file4" \
  5199. "${PROG} remove: scheduling .file4. for removal
  5200. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  5201. dotest death2-24 "${testcvs} -q ci -m removed file4" \
  5202. "Removing file4;
  5203. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  5204. new revision: delete; previous revision: 1\.2
  5205. done"
  5206. cd ..
  5207. echo "new stuff" >file4
  5208. dotest_fail death2-25 "${testcvs} up file4" \
  5209. "${PROG} update: conflict: file4 is modified but no longer in the repository
  5210. C file4"
  5211. cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
  5212. ;;
  5213. death-rtag)
  5214. # This documents a bug in CVS that prevents rtag from tagging files
  5215. # in the Attic.
  5216. mkdir $CVSROOT_DIRNAME/death-rtag
  5217. dotest death-rtag-init-1 "$testcvs -Q co death-rtag"
  5218. cd death-rtag
  5219. echo "This is the file foo" > foo
  5220. echo "This is the file bar" > bar
  5221. dotest death-rtag-init-2 "$testcvs -Q add foo bar"
  5222. dotest death-rtag-init-3 "$testcvs -Q ci -m 'Add foo and bar.'" \
  5223. "RCS file: $CVSROOT_DIRNAME/death-rtag/bar,v
  5224. done
  5225. Checking in bar;
  5226. $CVSROOT_DIRNAME/death-rtag/bar,v <-- bar
  5227. initial revision: 1\.[0-9]*
  5228. done
  5229. RCS file: $CVSROOT_DIRNAME/death-rtag/foo,v
  5230. done
  5231. Checking in foo;
  5232. $CVSROOT_DIRNAME/death-rtag/foo,v <-- foo
  5233. initial revision: 1\.[0-9]*
  5234. done"
  5235. dotest death-rtag-init-5 "$testcvs -Q tag -b mybranch"
  5236. dotest death-rtag-1 "$testcvs -q rtag -rmybranch willtag death-rtag"
  5237. dotest death-rtag-2 "$testcvs -Q rm -f foo"
  5238. dotest death-rtag-3 "$testcvs -Q ci -m 'Remove foo.'" \
  5239. "Removing foo;
  5240. $CVSROOT_DIRNAME/death-rtag/foo,v <-- foo
  5241. new revision: delete; previous revision: 1\.[0-9]*
  5242. done"
  5243. # commit something on the branch so that the moving tag is visible.
  5244. dotest death-rtag-3.2 "$testcvs -Q up -rmybranch"
  5245. echo some branch content >>foo
  5246. echo some branch content >>bar
  5247. dotest death-rtag-3.3 "$testcvs -Q ci -m 'Change foo.'" \
  5248. "Checking in bar;
  5249. $CVSROOT_DIRNAME/death-rtag/bar,v <-- bar
  5250. new revision: 1\.1\.2\.1; previous revision: 1\.1
  5251. done
  5252. Checking in foo;
  5253. $CVSROOT_DIRNAME/death-rtag/Attic/foo,v <-- foo
  5254. new revision: 1\.1\.2\.1; previous revision: 1\.1
  5255. done"
  5256. dotest death-rtag-3.4 \
  5257. "$testcvs -q rtag -rmybranch wontmove death-rtag"
  5258. dotest death-rtag-3.5 "$testcvs -q rtag -F wontmove death-rtag"
  5259. cd ..
  5260. # Removing -f below avoids this bug.
  5261. dotest death-rtag-4 "$testcvs -q rtag -frmybranch wonttag death-rtag"
  5262. # When the bug existed, `wonttag' would not have been present in
  5263. # foo,v.
  5264. #
  5265. # A second bug prevented `wontmove' from moving from the branch to
  5266. # the dead revision on the trunk (death-rtag-3.4 & death-rtag-3.5).
  5267. dotest death-rtag-5 "$testcvs -q rlog death-rtag" \
  5268. "
  5269. RCS file: $CVSROOT_DIRNAME/death-rtag/bar,v
  5270. head: 1.[0-9]*
  5271. branch:
  5272. locks: strict
  5273. access list:
  5274. symbolic names:
  5275. wonttag: 1\.1\.2\.1
  5276. wontmove: 1\.1
  5277. willtag: 1\.1
  5278. mybranch: 1\.1.0\.2
  5279. keyword substitution: kv
  5280. $DOTSTAR
  5281. RCS file: $CVSROOT_DIRNAME/death-rtag/Attic/foo,v
  5282. head: 1.[0-9]*
  5283. branch:
  5284. locks: strict
  5285. access list:
  5286. symbolic names:
  5287. wonttag: 1\.1\.2\.1
  5288. wontmove: 1\.2
  5289. willtag: 1\.1
  5290. mybranch: 1\.1.0\.2
  5291. keyword substitution: kv
  5292. $DOTSTAR"
  5293. if $keep; then
  5294. echo Keeping $TESTDIR and exiting due to --keep
  5295. exit 0
  5296. fi
  5297. rm -r death-rtag
  5298. rm -rf $CVSROOT_DIRNAME/death-rtag
  5299. ;;
  5300. rm-update-message)
  5301. # FIXME
  5302. # local CVS prints a warning message when update notices a missing
  5303. # file and client/server CVS doesn't. These should be identical.
  5304. mkdir rm-update-message; cd rm-update-message
  5305. mkdir $CVSROOT_DIRNAME/rm-update-message
  5306. dotest rm-update-message-setup-1 "$testcvs -q co rm-update-message" ''
  5307. cd rm-update-message
  5308. file=x
  5309. echo >$file
  5310. dotest rm-update-message-setup-2 "$testcvs -q add $file" \
  5311. "${PROG} add: use .${PROG} commit. to add this file permanently"
  5312. dotest rm-update-message-setup-3 "$testcvs -q ci -mcreate $file" \
  5313. "RCS file: $CVSROOT_DIRNAME/rm-update-message/$file,v
  5314. done
  5315. Checking in $file;
  5316. $CVSROOT_DIRNAME/rm-update-message/$file,v <-- $file
  5317. initial revision: 1\.1
  5318. done"
  5319. rm $file
  5320. dotest rm-update-message-1 "$testcvs up $file" \
  5321. "${PROG} update: warning: $file was lost
  5322. U $file"
  5323. cd ../..
  5324. if $keep; then :; else
  5325. rm -rf rm-update-message
  5326. rm -rf $CVSROOT_DIRNAME/rm-update-message
  5327. fi
  5328. ;;
  5329. rmadd)
  5330. # More tests of adding and removing files.
  5331. # In particular ci -r.
  5332. # Other ci -r tests:
  5333. # * editor-9: checking in a modified file,
  5334. # where "ci -r" means a branch.
  5335. # * basica-8a1: checking in a modified file with numeric revision.
  5336. # * basica-8a2: likewise.
  5337. # * keywordlog-4: adding a new file with numeric revision.
  5338. mkdir 1; cd 1
  5339. dotest rmadd-1 "${testcvs} -q co -l ." ''
  5340. mkdir first-dir
  5341. dotest rmadd-2 "${testcvs} add first-dir" \
  5342. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  5343. cd first-dir
  5344. echo first file1 >file1
  5345. dotest rmadd-3 "${testcvs} add file1" \
  5346. "${PROG} add: scheduling file .file1. for addition
  5347. ${PROG} add: use .${PROG} commit. to add this file permanently"
  5348. dotest_fail rmadd-4 "${testcvs} -q ci -r 1.2.2.4 -m add" \
  5349. "${PROG} commit: cannot add file .file1' with revision .1\.2\.2\.4'; must be on trunk
  5350. ${PROG} \[commit aborted\]: correct above errors first!"
  5351. dotest_fail rmadd-5 "${testcvs} -q ci -r 1.2.2 -m add" \
  5352. "${PROG} commit: cannot add file .file1' with revision .1\.2\.2'; must be on trunk
  5353. ${PROG} \[commit aborted\]: correct above errors first!"
  5354. dotest_fail rmadd-6 "${testcvs} -q ci -r mybranch -m add" \
  5355. "${PROG} \[commit aborted\]: no such tag mybranch"
  5356. # The thing with the trailing periods strikes me as a very
  5357. # bizarre behavior, but it would seem to be intentional
  5358. # (see commit.c). It probably could go away....
  5359. dotest rmadd-7 "${testcvs} -q ci -r 7.... -m add" \
  5360. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  5361. done
  5362. Checking in file1;
  5363. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5364. initial revision: 7\.1
  5365. done"
  5366. if $remote; then
  5367. # I guess remote doesn't set a sticky tag in this case.
  5368. # Kind of odd, in the sense that rmadd-24a does set one
  5369. # both local and remote.
  5370. dotest_fail rmadd-7a "test -f CVS/Tag"
  5371. echo T7 >CVS/Tag
  5372. else
  5373. dotest rmadd-7a "cat CVS/Tag" "T7"
  5374. fi
  5375. dotest rmadd-8 "${testcvs} -q tag -b mybranch" "T file1"
  5376. dotest rmadd-9 "${testcvs} -q tag mynonbranch" "T file1"
  5377. touch file2
  5378. # The previous "cvs ci -r" set a sticky tag of '7'. Seems a
  5379. # bit odd, and I guess commit.c (findmaxrev) makes '7' sticky
  5380. # tags unnecessary (?). I kind of suspect that it should be
  5381. # saying "sticky tag is not a branch" like keywordlog-4b.
  5382. # Or something.
  5383. dotest rmadd-10 "${testcvs} add file2" \
  5384. "${PROG} add: scheduling file .file2. for addition on branch .7'
  5385. ${PROG} add: use .${PROG} commit. to add this file permanently"
  5386. # As in the previous example, CVS is confused....
  5387. dotest rmadd-11 "${testcvs} -q ci -m add" \
  5388. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  5389. done
  5390. Checking in file2;
  5391. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  5392. initial revision: 7\.1
  5393. done"
  5394. dotest rmadd-12 "${testcvs} -q update -A" ""
  5395. touch file3
  5396. dotest rmadd-13 "${testcvs} add file3" \
  5397. "${PROG} add: scheduling file .file3. for addition
  5398. ${PROG} add: use .${PROG} commit. to add this file permanently"
  5399. # Huh? file2 is not up to date? Seems buggy to me....
  5400. dotest_fail rmadd-14 "${testcvs} -q ci -r mybranch -m add" \
  5401. "${PROG} commit: Up-to-date check failed for .file2'
  5402. ${PROG} \[commit aborted\]: correct above errors first!"
  5403. # Whatever, let's not let file2 distract us....
  5404. dotest rmadd-15 "${testcvs} -q ci -r mybranch -m add file3" \
  5405. "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
  5406. done
  5407. Checking in file3;
  5408. ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
  5409. new revision: 1\.1\.2\.1; previous revision: 1\.1
  5410. done"
  5411. touch file4
  5412. dotest rmadd-16 "${testcvs} add file4" \
  5413. "${PROG} add: scheduling file .file4. for addition
  5414. ${PROG} add: use .${PROG} commit. to add this file permanently"
  5415. # Same "Up-to-date check" issues as in rmadd-14.
  5416. # The "no such tag" thing is due to the fact that we only
  5417. # update val-tags when the tag is used (might be more of a
  5418. # bug than a feature, I dunno).
  5419. dotest_fail rmadd-17 \
  5420. "${testcvs} -q ci -r mynonbranch -m add file4" \
  5421. "${PROG} \[commit aborted\]: no such tag mynonbranch"
  5422. # Try to make CVS write val-tags.
  5423. dotest rmadd-18 "${testcvs} -q update -p -r mynonbranch file1" \
  5424. "first file1"
  5425. # Oops, -p suppresses writing val-tags (probably a questionable
  5426. # behavior).
  5427. dotest_fail rmadd-19 \
  5428. "${testcvs} -q ci -r mynonbranch -m add file4" \
  5429. "${PROG} \[commit aborted\]: no such tag mynonbranch"
  5430. # Now make CVS write val-tags for real.
  5431. dotest rmadd-20 "$testcvs -q update -r mynonbranch file1" '[UP] file1'
  5432. # Oops - CVS isn't distinguishing between a branch tag and
  5433. # a non-branch tag.
  5434. dotest rmadd-21 \
  5435. "${testcvs} -q ci -r mynonbranch -m add file4" \
  5436. "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file4,v
  5437. done
  5438. Checking in file4;
  5439. ${CVSROOT_DIRNAME}/first-dir/Attic/file4,v <-- file4
  5440. new revision: 1\.1\.2\.1; previous revision: 1\.1
  5441. done"
  5442. # OK, we add this one in a vanilla way, but then check in
  5443. # a modification with ci -r and sniff around for sticky tags.
  5444. echo file5 >file5
  5445. dotest rmadd-22 "${testcvs} add file5" \
  5446. "${PROG} add: scheduling file .file5. for addition
  5447. ${PROG} add: use .${PROG} commit. to add this file permanently"
  5448. if $remote; then
  5449. # Interesting bug (or missing feature) here. findmaxrev
  5450. # gets the major revision from the Entries. Well, remote
  5451. # doesn't send the entries for files which are not involved.
  5452. dotest rmadd-23r "${testcvs} -q ci -m add" \
  5453. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
  5454. done
  5455. Checking in file5;
  5456. ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
  5457. initial revision: 1\.1
  5458. done"
  5459. dotest rmadd-23-workaroundr \
  5460. "${testcvs} -q ci -r 7 -m bump-it file5" \
  5461. "Checking in file5;
  5462. ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
  5463. new revision: 7\.1; previous revision: 1\.1
  5464. done"
  5465. else
  5466. dotest rmadd-23 "${testcvs} -q ci -m add" \
  5467. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file5,v
  5468. done
  5469. Checking in file5;
  5470. ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
  5471. initial revision: 7\.1
  5472. done"
  5473. fi
  5474. echo change it >file5
  5475. dotest_fail rmadd-24 "${testcvs} -q ci -r 4.8 -m change file5" \
  5476. "Checking in file5;
  5477. ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
  5478. ${PROG} commit: ${CVSROOT_DIRNAME}/first-dir/file5,v: revision 4\.8 too low; must be higher than 7\.1
  5479. ${PROG} commit: could not check in file5"
  5480. dotest rmadd-24a "${testcvs} -q ci -r 8.4 -m change file5" \
  5481. "Checking in file5;
  5482. ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
  5483. new revision: 8\.4; previous revision: 7\.1
  5484. done"
  5485. # I'm not really sure that a sticky tag make sense here.
  5486. # It seems to be longstanding behavior for what that is worth.
  5487. dotest rmadd-25 "${testcvs} status file5" \
  5488. "===================================================================
  5489. File: file5 Status: Up-to-date
  5490. Working revision: 8\.4.*
  5491. Repository revision: 8\.4 ${CVSROOT_DIRNAME}/first-dir/file5,v
  5492. Sticky Tag: 8\.4
  5493. Sticky Date: (none)
  5494. Sticky Options: (none)"
  5495. # now try forced revision with recursion
  5496. mkdir sub
  5497. dotest rmadd-26 "${testcvs} -q add sub" \
  5498. "Directory ${CVSROOT_DIRNAME}/first-dir/sub added to the repository"
  5499. echo hello >sub/subfile
  5500. dotest rmadd-27 "${testcvs} -q add sub/subfile" \
  5501. "${PROG} add: use .${PROG} commit. to add this file permanently"
  5502. dotest rmadd-28 "${testcvs} -q ci -m. sub" \
  5503. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v
  5504. done
  5505. Checking in sub/subfile;
  5506. ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v <-- subfile
  5507. initial revision: 1\.1
  5508. done"
  5509. # lose the branch
  5510. dotest rmadd-29 "$testcvs -q up -A" \
  5511. "[UP] file1
  5512. $PROG update: file3 is no longer in the repository
  5513. $PROG update: file4 is no longer in the repository"
  5514. # -f disables recursion
  5515. dotest rmadd-30 "${testcvs} -q ci -f -r9 -m." \
  5516. "Checking in file1;
  5517. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5518. new revision: 9\.1; previous revision: 7\.1
  5519. done
  5520. Checking in file2;
  5521. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  5522. new revision: 9\.1; previous revision: 7\.1
  5523. done
  5524. Checking in file5;
  5525. ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
  5526. new revision: 9\.1; previous revision: 8\.4
  5527. done"
  5528. # add -R to force recursion
  5529. dotest rmadd-31 "${testcvs} -q ci -f -r9 -R -m." \
  5530. "Checking in file1;
  5531. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5532. new revision: 9\.2; previous revision: 9\.1
  5533. done
  5534. Checking in file2;
  5535. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  5536. new revision: 9\.2; previous revision: 9\.1
  5537. done
  5538. Checking in file5;
  5539. ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5
  5540. new revision: 9\.2; previous revision: 9\.1
  5541. done
  5542. Checking in sub/subfile;
  5543. ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v <-- subfile
  5544. new revision: 9\.1; previous revision: 1\.1
  5545. done"
  5546. if $remote; then
  5547. # as noted above, remote doesn't set a sticky tag
  5548. :
  5549. else
  5550. dotest rmadd-32 "cat CVS/Tag" "T9"
  5551. dotest rmadd-33 "cat sub/CVS/Tag" "T9"
  5552. fi
  5553. cd ../..
  5554. rm -r 1
  5555. rm -rf ${CVSROOT_DIRNAME}/first-dir
  5556. ;;
  5557. rmadd2)
  5558. # Tests of undoing commits, including in the presence of
  5559. # adding and removing files. See join for a list of -j tests.
  5560. mkdir 1; cd 1
  5561. dotest rmadd2-1 "${testcvs} -q co -l ." ''
  5562. mkdir first-dir
  5563. dotest rmadd2-2 "${testcvs} add first-dir" \
  5564. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  5565. cd first-dir
  5566. echo 'initial contents' >file1
  5567. dotest rmadd2-3 "${testcvs} add file1" \
  5568. "${PROG} add: scheduling file .file1. for addition
  5569. ${PROG} add: use .${PROG} commit. to add this file permanently"
  5570. dotest rmadd2-4 "${testcvs} -q ci -m add" \
  5571. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  5572. done
  5573. Checking in file1;
  5574. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5575. initial revision: 1\.1
  5576. done"
  5577. dotest rmadd2-4a "${testcvs} -Q tag tagone" ""
  5578. dotest rmadd2-5 "${testcvs} rm -f file1" \
  5579. "${PROG} remove: scheduling .file1. for removal
  5580. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  5581. dotest rmadd2-6 "${testcvs} -q ci -m remove" \
  5582. "Removing file1;
  5583. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5584. new revision: delete; previous revision: 1\.1
  5585. done"
  5586. dotest rmadd2-7 "${testcvs} -q update -j 1.2 -j 1.1 file1" "U file1"
  5587. dotest rmadd2-8 "${testcvs} -q ci -m readd" \
  5588. "Checking in file1;
  5589. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5590. new revision: 1\.3; previous revision: 1\.2
  5591. done"
  5592. echo 'new contents' >file1
  5593. dotest rmadd2-9 "${testcvs} -q ci -m modify" \
  5594. "Checking in file1;
  5595. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5596. new revision: 1\.4; previous revision: 1\.3
  5597. done"
  5598. dotest rmadd2-10 "${testcvs} -q update -j 1.4 -j 1.3 file1" \
  5599. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  5600. retrieving revision 1\.4
  5601. retrieving revision 1\.3
  5602. Merging differences between 1\.4 and 1\.3 into file1"
  5603. dotest rmadd2-11 "${testcvs} -q ci -m undo" \
  5604. "Checking in file1;
  5605. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5606. new revision: 1\.5; previous revision: 1\.4
  5607. done"
  5608. dotest rmadd2-12 "cat file1" "initial contents"
  5609. dotest rmadd2-13 "${testcvs} -q update -p -r 1.3" "initial contents"
  5610. # Hmm, might be a bit odd that this works even if 1.3 is not
  5611. # the head.
  5612. dotest rmadd2-14 "${testcvs} -q update -j 1.3 -j 1.2 file1" \
  5613. "${PROG} update: scheduling file1 for removal"
  5614. # Check that -p can get arbitrary revisions of a removed file
  5615. dotest rmadd2-14a "${testcvs} -q update -p" "initial contents"
  5616. dotest rmadd2-14b "${testcvs} -q update -p -r 1.5" "initial contents"
  5617. dotest rmadd2-14c "${testcvs} -q update -p -r 1.3" "initial contents"
  5618. dotest rmadd2-15 "${testcvs} -q ci -m re-remove" \
  5619. "Removing file1;
  5620. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5621. new revision: delete; previous revision: 1\.5
  5622. done"
  5623. dotest rmadd2-16 "${testcvs} log -h file1" "
  5624. RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
  5625. Working file: file1
  5626. head: 1\.6
  5627. branch:
  5628. locks: strict
  5629. access list:
  5630. symbolic names:
  5631. tagone: 1\.1
  5632. keyword substitution: kv
  5633. total revisions: 6
  5634. ============================================================================="
  5635. dotest rmadd2-17 "${testcvs} status -v file1" \
  5636. "===================================================================
  5637. File: no file file1 Status: Up-to-date
  5638. Working revision: No entry for file1
  5639. Repository revision: 1\.6 ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
  5640. Existing Tags:
  5641. tagone (revision: 1.1)"
  5642. cd ../..
  5643. rm -r 1
  5644. rm -rf ${CVSROOT_DIRNAME}/first-dir
  5645. ;;
  5646. rmadd3)
  5647. # This test demonstrates that CVS notices that file1 exists rather
  5648. # that deleting or writing over it after:
  5649. #
  5650. # cvs remove -f file1; touch file1; cvs add file1.
  5651. #
  5652. # According to the manual, this should work for:
  5653. #
  5654. # rm file1; cvs remove file1; cvs add file1
  5655. #
  5656. # but in past version of CVS, new content in file1 would be
  5657. # erroneously deleted when file1 reappeared between the remove and
  5658. # the add.
  5659. #
  5660. # Later versions of CVS would refuse to perform the add, but still
  5661. # allow a subsequent local commit to erase the file from the
  5662. # workspace, possibly losing data.
  5663. mkdir 1; cd 1
  5664. dotest rmadd3-init1 "${testcvs} -q co -l ." ''
  5665. mkdir first-dir
  5666. dotest rmadd3-init2 "${testcvs} add first-dir" \
  5667. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  5668. cd first-dir
  5669. echo initial content for file1 >file1
  5670. dotest rmadd3-init3 "${testcvs} add file1" \
  5671. "${PROG} add: scheduling file \`file1' for addition
  5672. ${PROG} add: use '${PROG} commit' to add this file permanently"
  5673. dotest rmadd3-init4 "${testcvs} -q ci -m add" \
  5674. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  5675. done
  5676. Checking in file1;
  5677. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5678. initial revision: 1\.1
  5679. done"
  5680. # Here begins the guts of this test, as detailed above.
  5681. dotest rmadd3-1 "${testcvs} rm -f file1" \
  5682. "${PROG} remove: scheduling \`file1' for removal
  5683. ${PROG} remove: use '${PROG} commit' to remove this file permanently"
  5684. # Now recreate the file:
  5685. echo desired future contents for file1 >file1
  5686. # And attempt to resurrect it at the same time:
  5687. dotest_fail rmadd3-2 "${testcvs} add file1" \
  5688. "${PROG} add: file1 should be removed and is still there (or is back again)"
  5689. # Now prove that commit knows that it shouldn't erase files.
  5690. dotest_fail rmadd3-3 "${testcvs} -q ci -m." \
  5691. "$PROG commit: \`file1' should be removed and is still there (or is back again)
  5692. $PROG \[commit aborted\]: correct above errors first!"
  5693. # Then these should pass too:
  5694. dotest rmadd3-4 "test -f file1"
  5695. dotest rmadd3-5 "cat file1" "desired future contents for file1"
  5696. if $keep; then
  5697. echo Keeping ${TESTDIR} and exiting due to --keep
  5698. exit 0
  5699. fi
  5700. cd ../..
  5701. rm -r 1
  5702. rm -rf ${CVSROOT_DIRNAME}/first-dir
  5703. ;;
  5704. resurrection)
  5705. # This test tests a few file resurrection scenarios.
  5706. mkdir 1; cd 1
  5707. dotest resurrection-init1 "$testcvs -q co -l ." ''
  5708. mkdir first-dir
  5709. dotest resurrection-init2 "$testcvs add first-dir" \
  5710. "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
  5711. cd first-dir
  5712. echo initial content for file1 >file1
  5713. dotest resurrection-init3 "$testcvs add file1" \
  5714. "$PROG add: scheduling file \`file1' for addition
  5715. $PROG add: use '$PROG commit' to add this file permanently"
  5716. dotest resurrection-init4 "$testcvs -q ci -m add" \
  5717. "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
  5718. done
  5719. Checking in file1;
  5720. $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
  5721. initial revision: 1\.1
  5722. done"
  5723. dotest resurrection-init5 "$testcvs -Q rm -f file1"
  5724. # The first test is that `cvs add' will resurrect a file before its
  5725. # removal has been committed.
  5726. dotest_sort resurrection-1 "$testcvs add file1" \
  5727. "U file1
  5728. $PROG add: file1, version 1\.1, resurrected"
  5729. dotest resurrection-2 "$testcvs -Q diff file1" ""
  5730. dotest resurrection-init6 "$testcvs -Q tag -b resurrection"
  5731. dotest resurrection-init7 "$testcvs -Q rm -f file1"
  5732. dotest resurrection-init8 "$testcvs -Q ci -mrm" \
  5733. "Removing file1;
  5734. $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
  5735. new revision: delete; previous revision: 1\.1
  5736. done"
  5737. # The next test is that CVS will resurrect a committed removal.
  5738. dotest_sort resurrection-3 "$testcvs add file1" \
  5739. "U file1
  5740. $PROG add: Re-adding file \`file1' (in place of dead revision 1\.2)\.
  5741. $PROG add: Resurrecting file \`file1' from revision 1\.1\.
  5742. $PROG add: use 'cvs commit' to add this file permanently"
  5743. dotest resurrection-4 "$testcvs -q diff -r1.1 file1" ""
  5744. dotest resurrection-5 "$testcvs -q ci -mreadd" \
  5745. "Checking in file1;
  5746. $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
  5747. new revision: 1\.3; previous revision: 1\.2
  5748. done"
  5749. dotest resurrection-init9 "$testcvs -Q up -rresurrection"
  5750. dotest resurrection-init10 "$testcvs -Q rm -f file1"
  5751. dotest resurrection-init11 "$testcvs -Q ci -mrm-on-resurrection" \
  5752. "Removing file1;
  5753. $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
  5754. new revision: delete; previous revision: 1\.1
  5755. done"
  5756. # The next test is that CVS will resurrect a committed removal to a
  5757. # branch.
  5758. dotest_sort resurrection-6 "$testcvs add file1" \
  5759. "U file1
  5760. $PROG add: Resurrecting file \`file1' from revision 1\.1\.
  5761. $PROG add: file \`file1' will be added on branch \`resurrection' from version 1\.1\.2\.1
  5762. $PROG add: use 'cvs commit' to add this file permanently"
  5763. dotest resurrection-7 "$testcvs -Q diff -r1.1 file1" ""
  5764. dotest resurrection-8 "$testcvs -q ci -mreadd" \
  5765. "Checking in file1;
  5766. $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
  5767. new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
  5768. done"
  5769. # The next few tests verify that an attempted resurrection of a file
  5770. # with no previous revision on the trunk fails.
  5771. touch file2
  5772. dotest resurrection-9 "$testcvs -Q add file2"
  5773. dotest resurrection-10 "$testcvs -Q ci -mnew-file2" \
  5774. "RCS file: $CVSROOT_DIRNAME/first-dir/Attic/file2,v
  5775. done
  5776. Checking in file2;
  5777. $CVSROOT_DIRNAME/first-dir/Attic/file2,v <-- file2
  5778. new revision: 1\.1\.2\.1; previous revision: 1\.1
  5779. done"
  5780. dotest resurrection-11 "$testcvs -Q up -A"
  5781. # This command once caused an assertion failure.
  5782. dotest resurrection-12 "$testcvs add file2" \
  5783. "$PROG add: File \`file2' has no previous revision to resurrect\."
  5784. if $keep; then
  5785. echo Keeping $TESTDIR and exiting due to --keep
  5786. exit 0
  5787. fi
  5788. cd ../..
  5789. rm -r 1
  5790. rm -rf $CVSROOT_DIRNAME/first-dir
  5791. ;;
  5792. dirs)
  5793. # Tests related to removing and adding directories.
  5794. # See also:
  5795. # conflicts (especially dir1 in conflicts-130): What happens if
  5796. # directory exists in repository and a non-CVS-controlled
  5797. # directory in the working directory?
  5798. # conflicts3-15. More cases, especially where CVS directory
  5799. # exists but without CVS/Repository and friends.
  5800. # conflicts3-22. Similar to conflicts-130 but there is a file
  5801. # in the directory.
  5802. # dirs2. Sort of similar to conflicts3-22 but somewhat different.
  5803. mkdir imp-dir; cd imp-dir
  5804. echo file1 >file1
  5805. mkdir sdir
  5806. echo sfile >sdir/sfile
  5807. dotest_sort dirs-1 \
  5808. "${testcvs} import -m import-it dir1 vend rel" "
  5809. N dir1/file1
  5810. N dir1/sdir/sfile
  5811. No conflicts created by this import
  5812. ${PROG} import: Importing ${CVSROOT_DIRNAME}/dir1/sdir"
  5813. cd ..
  5814. mkdir 1; cd 1
  5815. dotest dirs-2 "${testcvs} -Q co dir1" ""
  5816. # Various CVS administrators are in the habit of removing
  5817. # the repository directory for things they don't want any
  5818. # more. I've even been known to do it myself (on rare
  5819. # occasions). Not the usual recommended practice, but we want
  5820. # to try to come up with some kind of reasonable/documented/sensible
  5821. # behavior.
  5822. rm -rf ${CVSROOT_DIRNAME}/dir1/sdir
  5823. dotest dirs-3 "${testcvs} update" \
  5824. "${PROG} update: Updating dir1
  5825. ${PROG} update: Updating dir1/sdir
  5826. ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
  5827. ${PROG} update: skipping directory dir1/sdir"
  5828. dotest dirs-3a "${testcvs} update -d" \
  5829. "${PROG} update*: Updating dir1
  5830. ${PROG} update: Updating dir1/sdir
  5831. ${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
  5832. ${PROG} update: skipping directory dir1/sdir"
  5833. # If we say "yes", then CVS gives errors about not being able to
  5834. # create lock files.
  5835. # The fact that it says "skipping directory " rather than
  5836. # "skipping directory dir1/sdir" is some kind of bug.
  5837. dotest dirs-4 "echo no | ${testcvs} release -d dir1/sdir" \
  5838. "${PROG} update: cannot open directory ${CVSROOT_DIRNAME}/dir1/sdir: No such file or directory
  5839. ${PROG} update: skipping directory
  5840. You have \[0\] altered files in this repository\.
  5841. Are you sure you want to release (and delete) directory .dir1/sdir': .. .release' aborted by user choice."
  5842. # OK, if "cvs release" won't help, we'll try it the other way...
  5843. rm -r dir1/sdir
  5844. dotest dirs-5 "cat dir1/CVS/Entries" \
  5845. "/file1/1.1.1.1/[a-zA-Z0-9 :]*//
  5846. D/sdir////"
  5847. dotest dirs-6 "${testcvs} update" "${PROG} update: Updating dir1"
  5848. dotest dirs-7 "cat dir1/CVS/Entries" \
  5849. "/file1/1.1.1.1/[a-zA-Z0-9 :]*//
  5850. D/sdir////"
  5851. dotest dirs-8 "${testcvs} update -d dir1" \
  5852. "${PROG} update: Updating dir1"
  5853. cd ..
  5854. rm -r imp-dir 1
  5855. # clean up our repositories
  5856. rm -rf ${CVSROOT_DIRNAME}/dir1
  5857. ;;
  5858. dirs2)
  5859. # See "dirs" for a list of tests involving adding and
  5860. # removing directories.
  5861. mkdir 1; cd 1
  5862. dotest dirs2-1 "${testcvs} -q co -l ." ''
  5863. mkdir first-dir
  5864. dotest dirs2-2 "${testcvs} add first-dir" \
  5865. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  5866. cd first-dir
  5867. mkdir sdir
  5868. dotest dirs2-3 "${testcvs} add sdir" \
  5869. "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
  5870. touch sdir/file1
  5871. dotest dirs2-4 "${testcvs} add sdir/file1" \
  5872. "${PROG} add: scheduling file .sdir/file1. for addition
  5873. ${PROG} add: use .${PROG} commit. to add this file permanently"
  5874. dotest dirs2-5 "${testcvs} -q ci -m add" \
  5875. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v
  5876. done
  5877. Checking in sdir/file1;
  5878. ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v <-- file1
  5879. initial revision: 1\.1
  5880. done"
  5881. rm -r sdir/CVS
  5882. if $remote; then
  5883. # This is just like conflicts3-23
  5884. dotest_fail dirs2-6 "${testcvs} update -d" \
  5885. "${QUESTION} sdir
  5886. ${PROG} update: Updating \.
  5887. ${PROG} update: Updating sdir
  5888. ${PROG} update: move away sdir/file1; it is in the way
  5889. C sdir/file1"
  5890. rm sdir/file1
  5891. rm -r sdir/CVS
  5892. # This is where things are not just like conflicts3-23
  5893. dotest dirs2-7 "${testcvs} update -d" \
  5894. "${QUESTION} sdir
  5895. ${PROG} update: Updating \.
  5896. ${PROG} update: Updating sdir
  5897. U sdir/file1"
  5898. else
  5899. dotest dirs2-6 "${testcvs} update -d" \
  5900. "${PROG} update: Updating \.
  5901. ${QUESTION} sdir"
  5902. rm sdir/file1
  5903. dotest dirs2-7 "${testcvs} update -d" \
  5904. "${PROG} update: Updating \.
  5905. ${QUESTION} sdir"
  5906. fi
  5907. cd ../..
  5908. # Now, the same thing (more or less) on a branch.
  5909. mkdir 2; cd 2
  5910. dotest dirs2-8 "${testcvs} -q co first-dir" 'U first-dir/sdir/file1'
  5911. cd first-dir
  5912. dotest dirs2-9 "${testcvs} -q tag -b br" "T sdir/file1"
  5913. rm -r sdir/CVS
  5914. if $remote; then
  5915. # Cute little quirk of val-tags; if we don't recurse into
  5916. # the directories where the tag is defined, val-tags won't
  5917. # get updated.
  5918. dotest_fail dirs2-10 "${testcvs} update -d -r br" \
  5919. "${QUESTION} sdir
  5920. ${PROG} \[update aborted\]: no such tag br"
  5921. dotest dirs2-10ar \
  5922. "${testcvs} -q rdiff -u -r 1.1 -r br first-dir/sdir/file1"
  5923. dotest_fail dirs2-10-again "${testcvs} update -d -r br" \
  5924. "${QUESTION} sdir
  5925. ${PROG} update: Updating \.
  5926. ${PROG} update: Updating sdir
  5927. ${PROG} update: move away sdir/file1; it is in the way
  5928. C sdir/file1"
  5929. else
  5930. dotest_fail dirs2-10 "${testcvs} update -d -r br" \
  5931. "${PROG} update: in directory sdir:
  5932. ${PROG} \[update aborted\]: there is no version here; do '${PROG} checkout' first"
  5933. fi
  5934. cd ../..
  5935. # OK, the above tests make the situation somewhat harder
  5936. # than it might be, in the sense that they actually have a
  5937. # file which is alive on the branch we are updating. Let's
  5938. # try it where it is just a directory where all the files
  5939. # have been removed.
  5940. mkdir 3; cd 3
  5941. dotest dirs2-11 "${testcvs} -q co -r br first-dir" \
  5942. "U first-dir/sdir/file1"
  5943. cd first-dir
  5944. # Hmm, this doesn't mention the branch like add does. That's
  5945. # an odd non-orthogonality.
  5946. dotest dirs2-12 "${testcvs} rm -f sdir/file1" \
  5947. "${PROG} remove: scheduling .sdir/file1. for removal
  5948. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  5949. dotest dirs2-13 "${testcvs} -q ci -m remove" \
  5950. "Removing sdir/file1;
  5951. ${CVSROOT_DIRNAME}/first-dir/sdir/file1,v <-- file1
  5952. new revision: delete; previous revision: 1\.1
  5953. done"
  5954. cd ../../2/first-dir
  5955. if $remote; then
  5956. dotest dirs2-14 "${testcvs} update -d -r br" \
  5957. "${QUESTION} sdir/file1
  5958. ${PROG} update: Updating \.
  5959. ${PROG} update: Updating sdir"
  5960. else
  5961. dotest dirs2-14 "${testcvs} update -d -r br" \
  5962. "${PROG} update: Updating \.
  5963. ${QUESTION} sdir"
  5964. fi
  5965. cd ../..
  5966. rm -r 1 2 3
  5967. rm -rf ${CVSROOT_DIRNAME}/first-dir
  5968. ;;
  5969. branches)
  5970. # More branch tests, including branches off of branches
  5971. mkdir ${CVSROOT_DIRNAME}/first-dir
  5972. dotest branches-1 "${testcvs} -q co first-dir" ''
  5973. cd first-dir
  5974. echo 1:ancest >file1
  5975. echo 2:ancest >file2
  5976. echo 3:ancest >file3
  5977. echo 4:trunk-1 >file4
  5978. dotest branches-2 "${testcvs} add file1 file2 file3 file4" \
  5979. "${PROG}"' add: scheduling file `file1'\'' for addition
  5980. '"${PROG}"' add: scheduling file `file2'\'' for addition
  5981. '"${PROG}"' add: scheduling file `file3'\'' for addition
  5982. '"${PROG}"' add: scheduling file `file4'\'' for addition
  5983. '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
  5984. dotest branches-2a "${testcvs} -n -q ci -m dont-commit" ""
  5985. dotest_lit branches-3 "${testcvs} -q ci -m add-it" <<HERE
  5986. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  5987. done
  5988. Checking in file1;
  5989. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  5990. initial revision: 1.1
  5991. done
  5992. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  5993. done
  5994. Checking in file2;
  5995. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  5996. initial revision: 1.1
  5997. done
  5998. RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
  5999. done
  6000. Checking in file3;
  6001. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  6002. initial revision: 1.1
  6003. done
  6004. RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
  6005. done
  6006. Checking in file4;
  6007. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  6008. initial revision: 1.1
  6009. done
  6010. HERE
  6011. echo 4:trunk-2 >file4
  6012. dotest branches-3.2 "${testcvs} -q ci -m trunk-before-branch" \
  6013. "Checking in file4;
  6014. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  6015. new revision: 1\.2; previous revision: 1\.1
  6016. done"
  6017. # The "cvs log file4" in test branches-14.3 will test that we
  6018. # didn't really add the tag.
  6019. dotest branches-3.3 "${testcvs} -qn tag dont-tag" \
  6020. "T file1
  6021. T file2
  6022. T file3
  6023. T file4"
  6024. # Modify this file before branching, to deal with the case where
  6025. # someone is hacking along, says "oops, I should be doing this on
  6026. # a branch", and only then creates the branch.
  6027. echo 1:br1 >file1
  6028. dotest branches-4 "${testcvs} tag -b br1" "${PROG}"' tag: Tagging \.
  6029. T file1
  6030. T file2
  6031. T file3
  6032. T file4'
  6033. dotest branches-5 "$testcvs update -r br1" \
  6034. "$PROG update: Updating \.
  6035. M file1
  6036. [UP] file2
  6037. [UP] file3
  6038. [UP] file4"
  6039. echo 2:br1 >file2
  6040. echo 4:br1 >file4
  6041. dotest branches-6 "${testcvs} -q ci -m modify" \
  6042. "Checking in file1;
  6043. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  6044. new revision: 1\.1\.2\.1; previous revision: 1\.1
  6045. done
  6046. Checking in file2;
  6047. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  6048. new revision: 1\.1\.2\.1; previous revision: 1\.1
  6049. done
  6050. Checking in file4;
  6051. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  6052. new revision: 1\.2\.2\.1; previous revision: 1\.2
  6053. done"
  6054. dotest branches-7 "${testcvs} -q tag -b brbr" 'T file1
  6055. T file2
  6056. T file3
  6057. T file4'
  6058. dotest branches-8 "$testcvs -q update -r brbr" \
  6059. '[UP] file1
  6060. [UP] file2
  6061. [UP] file3
  6062. [UP] file4'
  6063. echo 1:brbr >file1
  6064. echo 4:brbr >file4
  6065. dotest branches-9 "${testcvs} -q ci -m modify" \
  6066. "Checking in file1;
  6067. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  6068. new revision: 1\.1\.2\.1\.2\.1; previous revision: 1\.1\.2\.1
  6069. done
  6070. Checking in file4;
  6071. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  6072. new revision: 1\.2\.2\.1\.2\.1; previous revision: 1\.2\.2\.1
  6073. done"
  6074. dotest branches-10 "cat file1 file2 file3 file4" '1:brbr
  6075. 2:br1
  6076. 3:ancest
  6077. 4:brbr'
  6078. dotest branches-11 "$testcvs -q update -r br1" \
  6079. 'U file1
  6080. [UP] file2
  6081. [UP] file3
  6082. U file4'
  6083. dotest branches-12 "cat file1 file2 file3 file4" '1:br1
  6084. 2:br1
  6085. 3:ancest
  6086. 4:br1'
  6087. echo 4:br1-2 >file4
  6088. dotest branches-12.2 "${testcvs} -q ci -m change-on-br1" \
  6089. "Checking in file4;
  6090. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  6091. new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
  6092. done"
  6093. dotest branches-13 "${testcvs} -q update -A" \
  6094. 'U file1
  6095. U file2
  6096. [UP] file3
  6097. U file4'
  6098. dotest branches-14 "cat file1 file2 file3 file4" '1:ancest
  6099. 2:ancest
  6100. 3:ancest
  6101. 4:trunk-2'
  6102. echo 4:trunk-3 >file4
  6103. dotest branches-14.2 \
  6104. "${testcvs} -q ci -m trunk-change-after-branch" \
  6105. "Checking in file4;
  6106. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  6107. new revision: 1\.3; previous revision: 1\.2
  6108. done"
  6109. dotest branches-14.3 "${testcvs} log file4" \
  6110. "
  6111. RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
  6112. Working file: file4
  6113. head: 1\.3
  6114. branch:
  6115. locks: strict
  6116. access list:
  6117. symbolic names:
  6118. brbr: 1\.2\.2\.1\.0\.2
  6119. br1: 1\.2\.0\.2
  6120. keyword substitution: kv
  6121. total revisions: 6; selected revisions: 6
  6122. description:
  6123. ----------------------------
  6124. revision 1\.3
  6125. date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
  6126. trunk-change-after-branch
  6127. ----------------------------
  6128. revision 1\.2
  6129. date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
  6130. branches: 1\.2\.2;
  6131. trunk-before-branch
  6132. ----------------------------
  6133. revision 1\.1
  6134. date: [0-9/: ]*; author: ${username}; state: Exp;
  6135. add-it
  6136. ----------------------------
  6137. revision 1\.2\.2\.2
  6138. date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
  6139. change-on-br1
  6140. ----------------------------
  6141. revision 1\.2\.2\.1
  6142. date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
  6143. branches: 1\.2\.2\.1\.2;
  6144. modify
  6145. ----------------------------
  6146. revision 1\.2\.2\.1\.2\.1
  6147. date: [0-9/: ]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
  6148. modify
  6149. ============================================================================="
  6150. dotest_fail branches-14.4 \
  6151. "${testcvs} diff -c -r 1.1 -r 1.3 file4" \
  6152. "Index: file4
  6153. ===================================================================
  6154. RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
  6155. retrieving revision 1\.1
  6156. retrieving revision 1\.3
  6157. diff -c -r1\.1 -r1\.3
  6158. \*\*\* file4 ${RFCDATE} 1\.1
  6159. --- file4 ${RFCDATE} 1\.3
  6160. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  6161. \*\*\* 1 \*\*\*\*
  6162. ! 4:trunk-1
  6163. --- 1 ----
  6164. ! 4:trunk-3"
  6165. dotest_fail branches-14.5 \
  6166. "${testcvs} diff -c -r 1.1 -r 1.2.2.1 file4" \
  6167. "Index: file4
  6168. ===================================================================
  6169. RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
  6170. retrieving revision 1\.1
  6171. retrieving revision 1\.2\.2\.1
  6172. diff -c -r1\.1 -r1\.2\.2\.1
  6173. \*\*\* file4 ${RFCDATE} 1\.1
  6174. --- file4 ${RFCDATE} 1\.2\.2\.1
  6175. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  6176. \*\*\* 1 \*\*\*\*
  6177. ! 4:trunk-1
  6178. --- 1 ----
  6179. ! 4:br1"
  6180. dotest branches-15 \
  6181. "${testcvs} update -j 1.1.2.1 -j 1.1.2.1.2.1 file1" \
  6182. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6183. retrieving revision 1\.1\.2\.1
  6184. retrieving revision 1\.1\.2\.1\.2\.1
  6185. Merging differences between 1\.1\.2\.1 and 1\.1\.2\.1\.2\.1 into file1
  6186. rcsmerge: warning: conflicts during merge"
  6187. dotest branches-16 "cat file1" '<<<<<<< file1
  6188. 1:ancest
  6189. [=]======
  6190. 1:brbr
  6191. [>]>>>>>> 1\.1\.2\.1\.2\.1'
  6192. dotest branches-o1 "${testcvs} -q admin -o ::brbr" \
  6193. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6194. done
  6195. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  6196. done
  6197. RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
  6198. done
  6199. RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
  6200. done"
  6201. cd ..
  6202. if $keep; then
  6203. echo Keeping ${TESTDIR} and exiting due to --keep
  6204. exit 0
  6205. fi
  6206. rm -rf ${CVSROOT_DIRNAME}/first-dir
  6207. rm -r first-dir
  6208. ;;
  6209. branches2)
  6210. # More branch tests.
  6211. # Test that when updating a new subdirectory in a directory
  6212. # which was checked out on a branch, the new subdirectory is
  6213. # created on the appropriate branch. Test this when joining
  6214. # as well.
  6215. mkdir ${CVSROOT_DIRNAME}/first-dir
  6216. mkdir trunk; cd trunk
  6217. # Create a file.
  6218. dotest branches2-1 "${testcvs} -q co first-dir"
  6219. cd first-dir
  6220. echo "file1 first revision" > file1
  6221. dotest branches2-2 "${testcvs} add file1" \
  6222. "${PROG} add: scheduling file .file1. for addition
  6223. ${PROG} add: use .${PROG} commit. to add this file permanently"
  6224. dotest branches2-3 "${testcvs} commit -m add file1" \
  6225. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6226. done
  6227. Checking in file1;
  6228. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  6229. initial revision: 1\.1
  6230. done"
  6231. # Tag the file.
  6232. dotest branches2-4 "${testcvs} -q tag tag1" 'T file1'
  6233. # Make two branches.
  6234. dotest branches2-5 "${testcvs} -q rtag -b -r tag1 b1 first-dir" ''
  6235. dotest branches2-6 "${testcvs} -q rtag -b -r tag1 b2 first-dir" ''
  6236. # Create some files and a subdirectory on branch b1.
  6237. cd ../..
  6238. mkdir b1; cd b1
  6239. dotest branches2-7 "${testcvs} -q co -r b1 first-dir" \
  6240. "U first-dir/file1"
  6241. cd first-dir
  6242. echo "file2 first revision" > file2
  6243. dotest branches2-8 "${testcvs} add file2" \
  6244. "${PROG}"' add: scheduling file `file2'\'' for addition on branch `b1'\''
  6245. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  6246. mkdir dir1
  6247. dotest branches2-9 "${testcvs} add dir1" \
  6248. "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository
  6249. --> Using per-directory sticky tag "'`'"b1'"
  6250. echo "file3 first revision" > dir1/file3
  6251. dotest branches2-10 "${testcvs} add dir1/file3" \
  6252. "${PROG}"' add: scheduling file `dir1/file3'\'' for addition on branch `b1'\''
  6253. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  6254. dotest branches2-11 "${testcvs} -q ci -madd ." \
  6255. "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v
  6256. done
  6257. Checking in file2;
  6258. ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v <-- file2
  6259. new revision: 1\.1\.2\.1; previous revision: 1\.1
  6260. done
  6261. RCS file: ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
  6262. done
  6263. Checking in dir1/file3;
  6264. ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v <-- file3
  6265. new revision: 1\.1\.2\.1; previous revision: 1\.1
  6266. done"
  6267. # Check out the second branch, and update the working
  6268. # directory to the first branch, to make sure the right
  6269. # happens with dir1.
  6270. cd ../..
  6271. mkdir b2; cd b2
  6272. dotest branches2-12 "${testcvs} -q co -r b2 first-dir" \
  6273. 'U first-dir/file1'
  6274. cd first-dir
  6275. dotest branches2-13 "${testcvs} update -d -r b1 dir1" \
  6276. "${PROG} update: Updating dir1
  6277. U dir1/file3"
  6278. dotest branches2-14 "${testcvs} -q status" \
  6279. "===================================================================
  6280. File: file1 Status: Up-to-date
  6281. Working revision: 1\.1.*
  6282. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
  6283. Sticky Tag: b2 (branch: 1\.1\.4)
  6284. Sticky Date: (none)
  6285. Sticky Options: (none)
  6286. ===================================================================
  6287. File: file3 Status: Up-to-date
  6288. Working revision: 1\.1\.2\.1.*
  6289. Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
  6290. Sticky Tag: b1 (branch: 1\.1\.2)
  6291. Sticky Date: (none)
  6292. Sticky Options: (none)"
  6293. # FIXME: Just clobbering the directory like this is a bit
  6294. # tacky, although people generally expect it to work. Maybe
  6295. # we should release it instead. We do it a few other places
  6296. # below as well.
  6297. rm -r dir1
  6298. dotest branches2-15 "${testcvs} update -d -j b1 dir1" \
  6299. "${PROG} update: Updating dir1
  6300. U dir1/file3"
  6301. # FIXCVS: The `No revision control file' stuff seems to be
  6302. # CVS's way of telling us that we're adding the file on a
  6303. # branch, and the file is not on that branch yet. This
  6304. # should be nicer.
  6305. dotest branches2-16 "${testcvs} -q status" \
  6306. "===================================================================
  6307. File: file1 Status: Up-to-date
  6308. Working revision: 1\.1.*
  6309. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
  6310. Sticky Tag: b2 (branch: 1\.1\.4)
  6311. Sticky Date: (none)
  6312. Sticky Options: (none)
  6313. ===================================================================
  6314. File: file3 Status: Locally Added
  6315. Working revision: New file!
  6316. Repository revision: No revision control file
  6317. Sticky Tag: b2 - MISSING from RCS file!
  6318. Sticky Date: (none)
  6319. Sticky Options: (none)"
  6320. cd ../../trunk/first-dir
  6321. dotest branches2-17 "${testcvs} update -d -P dir1" \
  6322. "${PROG} update: Updating dir1"
  6323. dotest_fail branches2-18 "test -d dir1"
  6324. dotest branches2-19 "${testcvs} update -d -P -r b1 dir1" \
  6325. "${PROG} update: Updating dir1
  6326. U dir1/file3"
  6327. dotest branches2-20 "${testcvs} -q status" \
  6328. "===================================================================
  6329. File: file1 Status: Up-to-date
  6330. Working revision: 1\.1.*
  6331. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
  6332. Sticky Tag: (none)
  6333. Sticky Date: (none)
  6334. Sticky Options: (none)
  6335. ===================================================================
  6336. File: file3 Status: Up-to-date
  6337. Working revision: 1\.1\.2\.1.*
  6338. Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
  6339. Sticky Tag: b1 (branch: 1\.1\.2)
  6340. Sticky Date: (none)
  6341. Sticky Options: (none)"
  6342. rm -r dir1
  6343. dotest branches2-21 "${testcvs} update -d -P -j b1 dir1" \
  6344. "${PROG} update: Updating dir1
  6345. U dir1/file3"
  6346. dotest branches2-22 "${testcvs} -q status" \
  6347. "===================================================================
  6348. File: file1 Status: Up-to-date
  6349. Working revision: 1\.1.*
  6350. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
  6351. Sticky Tag: (none)
  6352. Sticky Date: (none)
  6353. Sticky Options: (none)
  6354. ===================================================================
  6355. File: file3 Status: Locally Added
  6356. Working revision: New file!
  6357. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir1/Attic/file3,v
  6358. Sticky Tag: (none)
  6359. Sticky Date: (none)
  6360. Sticky Options: (none)"
  6361. cd ../..
  6362. rm -r b1 b2
  6363. # Check out branch b1 twice. Crate a new directory in one
  6364. # working directory, then do a cvs update in the other
  6365. # working directory and see if the tags are right.
  6366. mkdir b1a
  6367. mkdir b1b
  6368. cd b1b
  6369. dotest branches2-23 "${testcvs} -q co -r b1 first-dir" \
  6370. 'U first-dir/file1
  6371. U first-dir/file2
  6372. U first-dir/dir1/file3'
  6373. cd ../b1a
  6374. dotest branches2-24 "${testcvs} -q co -r b1 first-dir" \
  6375. 'U first-dir/file1
  6376. U first-dir/file2
  6377. U first-dir/dir1/file3'
  6378. cd first-dir
  6379. mkdir dir2
  6380. dotest branches2-25 "${testcvs} add dir2" \
  6381. "Directory ${CVSROOT_DIRNAME}/first-dir/dir2 added to the repository
  6382. --> Using per-directory sticky tag "'`'"b1'"
  6383. echo "file4 first revision" > dir2/file4
  6384. dotest branches2-26 "${testcvs} add dir2/file4" \
  6385. "${PROG}"' add: scheduling file `dir2/file4'\'' for addition on branch `b1'\''
  6386. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  6387. dotest branches2-27 "${testcvs} -q commit -madd" \
  6388. "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
  6389. done
  6390. Checking in dir2/file4;
  6391. ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v <-- file4
  6392. new revision: 1\.1\.2\.1; previous revision: 1\.1
  6393. done"
  6394. cd ../../b1b/first-dir
  6395. dotest branches2-28 "${testcvs} update -d dir2" \
  6396. "${PROG} update: Updating dir2
  6397. U dir2/file4"
  6398. cd dir2
  6399. dotest branches2-29 "${testcvs} -q status" \
  6400. "===================================================================
  6401. File: file4 Status: Up-to-date
  6402. Working revision: 1\.1\.2\.1.*
  6403. Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/dir2/Attic/file4,v
  6404. Sticky Tag: b1 (branch: 1\.1\.2)
  6405. Sticky Date: (none)
  6406. Sticky Options: (none)"
  6407. dotest branches2-30 "cat CVS/Tag" 'Tb1'
  6408. # Test update -A on a subdirectory
  6409. cd ..
  6410. rm -r dir2
  6411. dotest branches2-31 "${testcvs} update -A -d dir2" \
  6412. "${PROG} update: Updating dir2"
  6413. cd dir2
  6414. dotest branches2-32 "${testcvs} -q status" ''
  6415. dotest_fail branches2-33 "test -f CVS/Tag"
  6416. # Add a file on the trunk.
  6417. echo "file5 first revision" > file5
  6418. dotest branches2-34 "${testcvs} add file5" \
  6419. "${PROG}"' add: scheduling file `file5'\'' for addition
  6420. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  6421. dotest branches2-35 "${testcvs} -q commit -madd" \
  6422. "RCS file: ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
  6423. done
  6424. Checking in file5;
  6425. ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v <-- file5
  6426. initial revision: 1\.1
  6427. done"
  6428. cd ../../../trunk/first-dir
  6429. dotest branches2-36 "${testcvs} -q update -d dir2" 'U dir2/file5'
  6430. cd dir2
  6431. dotest branches2-37 "${testcvs} -q status" \
  6432. "===================================================================
  6433. File: file5 Status: Up-to-date
  6434. Working revision: 1\.1.*
  6435. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/dir2/file5,v
  6436. Sticky Tag: (none)
  6437. Sticky Date: (none)
  6438. Sticky Options: (none)"
  6439. dotest_fail branches2-38 "test -f CVS/status"
  6440. cd ../../..
  6441. rm -rf ${CVSROOT_DIRNAME}/first-dir
  6442. rm -r trunk b1a b1b
  6443. ;;
  6444. tagc)
  6445. # Test the tag -c option.
  6446. mkdir 1; cd 1
  6447. dotest tagc-1 "${testcvs} -q co -l ." ''
  6448. mkdir first-dir
  6449. dotest tagc-2 "${testcvs} add first-dir" \
  6450. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  6451. cd first-dir
  6452. touch file1 file2
  6453. dotest tagc-3 "${testcvs} add file1 file2" \
  6454. "${PROG} add: scheduling file .file1. for addition
  6455. ${PROG} add: scheduling file .file2. for addition
  6456. ${PROG} add: use .${PROG} commit. to add these files permanently"
  6457. dotest tagc-4 "${testcvs} -q ci -m add" \
  6458. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6459. done
  6460. Checking in file1;
  6461. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  6462. initial revision: 1\.1
  6463. done
  6464. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  6465. done
  6466. Checking in file2;
  6467. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  6468. initial revision: 1\.1
  6469. done"
  6470. dotest tagc-5 "${testcvs} -q tag -c tag1" \
  6471. "T file1
  6472. T file2"
  6473. touch file1 file2
  6474. dotest tagc-6 "${testcvs} -q tag -c tag2" \
  6475. "T file1
  6476. T file2"
  6477. # Avoid timestamp granularity bugs (FIXME: CVS should be
  6478. # doing the sleep, right?).
  6479. sleep 1
  6480. echo myedit >>file1
  6481. dotest tagc-6a "${testcvs} rm -f file2" \
  6482. "${PROG} remove: scheduling .file2. for removal
  6483. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  6484. touch file3
  6485. dotest tagc-6b "${testcvs} add file3" \
  6486. "${PROG} add: scheduling file .file3. for addition
  6487. ${PROG} add: use .${PROG} commit. to add this file permanently"
  6488. dotest_fail tagc-7 "${testcvs} -q tag -c tag3" \
  6489. "${PROG} tag: file1 is locally modified
  6490. ${PROG} tag: file2 is locally modified
  6491. ${PROG} tag: file3 is locally modified
  6492. ${PROG} \[tag aborted\]: correct the above errors first!"
  6493. cd ../..
  6494. mkdir 2
  6495. cd 2
  6496. dotest tagc-8 "${testcvs} -q co first-dir" \
  6497. "U first-dir/file1
  6498. U first-dir/file2"
  6499. cd ../1/first-dir
  6500. dotest tagc-9 "${testcvs} -q ci -m modify" \
  6501. "Checking in file1;
  6502. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  6503. new revision: 1\.2; previous revision: 1\.1
  6504. done
  6505. Removing file2;
  6506. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  6507. new revision: delete; previous revision: 1\.1
  6508. done
  6509. RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
  6510. done
  6511. Checking in file3;
  6512. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  6513. initial revision: 1\.1
  6514. done"
  6515. cd ../../2/first-dir
  6516. dotest tagc-10 "${testcvs} -q tag -c tag4" \
  6517. "${PROG} tag: file2 is no longer in the repository
  6518. T file1
  6519. T file2"
  6520. cd ../..
  6521. rm -r 1 2
  6522. rm -rf ${CVSROOT_DIRNAME}/first-dir
  6523. ;;
  6524. update-p)
  6525. # Make sure `cvs update -p -rT FILE' works from a branch when
  6526. # FILE is already on the trunk and is being added to that branch.
  6527. mkdir 1; cd 1
  6528. module=x
  6529. echo > unused-file
  6530. # Create the module.
  6531. dotest update-p-1 \
  6532. "$testcvs -Q import -m. $module X Y" ''
  6533. file=F
  6534. # Check it out and tag it.
  6535. dotest update-p-2 "$testcvs -Q co $module" ''
  6536. cd $module
  6537. dotest update-p-3 "$testcvs -Q tag -b B" ''
  6538. echo v1 > $file
  6539. dotest update-p-4 "$testcvs -Q add $file" ''
  6540. dotest update-p-5 "$testcvs -Q ci -m. $file" \
  6541. "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
  6542. done
  6543. Checking in $file;
  6544. ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
  6545. initial revision: 1\.1
  6546. done"
  6547. dotest update-p-6 "$testcvs -Q tag T $file" ''
  6548. dotest update-p-7 "$testcvs -Q update -rB" ''
  6549. # This merge effectively adds file F on branch B.
  6550. dotest update-p-8 "$testcvs -Q update -jT" ''
  6551. # Before the fix that prompted the addition of this test,
  6552. # the following command would fail with this diagnostic:
  6553. # cvs update: conflict: F created independently by second party
  6554. dotest update-p-9 "$testcvs update -p -rT $file" \
  6555. "===================================================================
  6556. Checking out $file
  6557. RCS: ${CVSROOT_DIRNAME}/$module/$file,v
  6558. VERS: 1\.1
  6559. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  6560. v1"
  6561. # Repeat the above, but with $file removed.
  6562. # This exercises a slightly different code path.
  6563. rm $file
  6564. # Before the fix that prompted the addition of this test,
  6565. # the following command would fail with this diagnostic:
  6566. # cvs update: warning: new-born F has disappeared
  6567. dotest update-p-10 "$testcvs update -p -rT $file" \
  6568. "===================================================================
  6569. Checking out $file
  6570. RCS: ${CVSROOT_DIRNAME}/$module/$file,v
  6571. VERS: 1\.1
  6572. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  6573. v1"
  6574. # Exercise yet another code path:
  6575. # the one that involves reviving a `dead' file.
  6576. # And a little more, for good measure...
  6577. touch new
  6578. dotest update-p-a1 "$testcvs -Q add new" ''
  6579. dotest update-p-a2 "$testcvs -Q update -p new" ''
  6580. dotest update-p-a3 "$testcvs -Q rm -f new" ''
  6581. # Both an update -A, *and* the following update are required
  6582. # to return to the state of being on the trunk with a $file
  6583. # that we can then remove.
  6584. dotest update-p-undead-0 "$testcvs update -A" \
  6585. "$PROG update: Updating \.
  6586. $PROG update: warning: new-born $file has disappeared
  6587. [UP] unused-file"
  6588. dotest update-p-undead-1 "$testcvs update" \
  6589. "${PROG} update: Updating \.
  6590. U $file"
  6591. dotest update-p-undead-2 "$testcvs -Q update -p -rT $file" v1
  6592. dotest update-p-undead-3 "$testcvs -Q rm -f $file" ''
  6593. dotest update-p-undead-4 "$testcvs -Q update -p -rT $file" v1
  6594. dotest update-p-undead-5 "$testcvs -Q ci -m. $file" \
  6595. "Removing $file;
  6596. ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
  6597. new revision: delete; previous revision: 1\.1
  6598. done"
  6599. dotest update-p-undead-6 "$testcvs -Q update -p -rT $file" v1
  6600. echo v2 > $file
  6601. dotest update-p-undead-7 "$testcvs -Q update -p -rT $file" v1
  6602. dotest update-p-undead-8 "$testcvs add $file" \
  6603. "${PROG} add: Re-adding file .$file. (in place of dead revision 1\.2)\.
  6604. ${PROG} add: use .${PROG} commit. to add this file permanently"
  6605. dotest update-p-undead-9 "$testcvs -Q update -p -rT $file" v1
  6606. cd ../..
  6607. rm -rf 1
  6608. rm -rf ${CVSROOT_DIRNAME}/$module
  6609. ;;
  6610. tagf)
  6611. # More tagging tests, including using tag -F -B to convert a
  6612. # branch tag to a regular tag and recovering thereof.
  6613. # Setup; check in first-dir/file1
  6614. mkdir 1; cd 1
  6615. dotest tagf-1 "${testcvs} -q co -l ." ''
  6616. mkdir first-dir
  6617. dotest tagf-2 "${testcvs} add first-dir" \
  6618. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  6619. cd first-dir
  6620. touch file1 file2
  6621. dotest tagf-3 "${testcvs} add file1 file2" \
  6622. "${PROG} add: scheduling file .file1. for addition
  6623. ${PROG} add: scheduling file .file2. for addition
  6624. ${PROG} add: use .${PROG} commit. to add these files permanently"
  6625. dotest tagf-4 "${testcvs} -q ci -m add" \
  6626. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6627. done
  6628. Checking in file1;
  6629. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  6630. initial revision: 1\.1
  6631. done
  6632. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  6633. done
  6634. Checking in file2;
  6635. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  6636. initial revision: 1\.1
  6637. done"
  6638. # Now create a branch and commit a revision there.
  6639. dotest tagf-5 "${testcvs} -q tag -b br" "T file1
  6640. T file2"
  6641. dotest tagf-6 "$testcvs -q update -r br" \
  6642. 'U file1
  6643. U file2'
  6644. echo brmod >> file1
  6645. echo brmod >> file2
  6646. dotest tagf-7 "${testcvs} -q ci -m modify" \
  6647. "Checking in file1;
  6648. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  6649. new revision: 1\.1\.2\.1; previous revision: 1\.1
  6650. done
  6651. Checking in file2;
  6652. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  6653. new revision: 1\.1\.2\.1; previous revision: 1\.1
  6654. done"
  6655. # Here we try to make it a non-branch tag, but will
  6656. # succeed in getting only warnings, even with -F
  6657. # because converting a branch tag to non-branch
  6658. # is potentially catastrophic.
  6659. dotest tagf-8a "${testcvs} -q tag -F br" \
  6660. "${PROG} tag: file1: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\\.2\.1\.
  6661. ${PROG} tag: file2: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\.2\.1\."
  6662. # however, if we *really* are sure we want to move a branch tag,
  6663. # "-F -B" will do the trick
  6664. dotest tagf-8 "${testcvs} -q tag -F -B br" "T file1
  6665. T file2"
  6666. echo moremod >> file1
  6667. echo moremod >> file2
  6668. dotest tagf-9 "${testcvs} -q status -v file1" \
  6669. "===================================================================
  6670. File: file1 Status: Locally Modified
  6671. Working revision: 1\.1\.2\.1.*
  6672. Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
  6673. Sticky Tag: br (revision: 1\.1\.2\.1)
  6674. Sticky Date: (none)
  6675. Sticky Options: (none)
  6676. Existing Tags:
  6677. br (revision: 1\.1\.2\.1)"
  6678. # Now, how do we recover?
  6679. dotest tagf-10 "${testcvs} -q tag -d br" "D file1
  6680. D file2"
  6681. # This creates a new branch, 1.1.4. See the code in RCS_magicrev
  6682. # which will notice that there is a (non-magic) 1.1.2 and thus
  6683. # skip that number.
  6684. dotest tagf-11 "${testcvs} -q tag -r 1.1 -b br file1" "T file1"
  6685. # Fix it with admin -n (cf admin-18, admin-26-4).
  6686. dotest tagf-12 "${testcvs} -q admin -nbr:1.1.2 file2" \
  6687. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  6688. done"
  6689. # Another variation on the file2 test would be to use two working
  6690. # directories so that the update -r br would need to
  6691. # a merge to get from 1.1.2.1 to the head of the 1.1.2 branch.
  6692. dotest tagf-13 "${testcvs} -q update -r br" \
  6693. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6694. retrieving revision 1\.1\.2\.1
  6695. retrieving revision 1\.1
  6696. Merging differences between 1\.1\.2\.1 and 1\.1 into file1
  6697. rcsmerge: warning: conflicts during merge
  6698. ${PROG} update: conflicts found in file1
  6699. C file1
  6700. M file2"
  6701. # CVS is giving a conflict because we are trying to get back to
  6702. # 1.1.4. I'm not sure why it is a conflict rather than just
  6703. # "M file1".
  6704. dotest tagf-14 "cat file1" \
  6705. "<<<<<<< file1
  6706. brmod
  6707. moremod
  6708. [=]======
  6709. [>]>>>>>> 1\.1"
  6710. echo resolve >file1
  6711. dotest tagf-15 "${testcvs} -q ci -m recovered" \
  6712. "Checking in file1;
  6713. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  6714. new revision: 1\.1\.4\.1; previous revision: 1\.1
  6715. done
  6716. Checking in file2;
  6717. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  6718. new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
  6719. done"
  6720. # try accidentally deleting branch tag, "tag -d"
  6721. dotest_fail tagf-16 "${testcvs} tag -d br" \
  6722. "${PROG} tag: Untagging \.
  6723. ${PROG} tag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\.
  6724. ${PROG} tag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\."
  6725. # try accidentally deleting branch tag, "rtag -d"
  6726. dotest_fail tagf-17 "${testcvs} rtag -d br first-dir" \
  6727. "${PROG} rtag: Untagging first-dir
  6728. ${PROG} rtag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\.
  6729. ${PROG} rtag: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\."
  6730. # try accidentally converting branch tag to non-branch tag "tag -F"
  6731. dotest tagf-18 "${testcvs} tag -r1.1 -F br file1" \
  6732. "${PROG} tag: file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\."
  6733. # try accidentally converting branch tag to non-branch tag "rtag -F"
  6734. dotest tagf-19 "${testcvs} rtag -r1.1 -F br first-dir" \
  6735. "${PROG} rtag: Tagging first-dir
  6736. ${PROG} rtag: first-dir/file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\.
  6737. ${PROG} rtag: first-dir/file2: Not moving branch tag .br. from 1\.1\.2\.2 to 1\.1\."
  6738. # create a non-branch tag
  6739. dotest tagf-20 "${testcvs} rtag regulartag first-dir" \
  6740. "${PROG} rtag: Tagging first-dir"
  6741. # try accidentally converting non-branch tag to branch tag (tag -F -B -b)
  6742. dotest tagf-21 "${testcvs} tag -F -B -b regulartag file1" \
  6743. "${PROG} tag: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1\.0\.2 due to .-B. option\."
  6744. # try accidentally converting non-branch tag to branch rtag (rtag -F -B -b)
  6745. dotest tagf-22 "${testcvs} rtag -F -B -b regulartag first-dir" \
  6746. "${PROG} rtag: Tagging first-dir
  6747. ${PROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.6 due to .-B. option\.
  6748. ${PROG} rtag: first-dir/file2: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.4 due to .-B. option\."
  6749. # Try accidentally deleting non-branch: (tag -d -B)
  6750. dotest_fail tagf-23 "${testcvs} tag -d -B regulartag file1" \
  6751. "${PROG} tag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\."
  6752. # Try accidentally deleting non-branch: (rtag -d -B)
  6753. dotest_fail tagf-24 \
  6754. "${testcvs} rtag -d -B regulartag first-dir" \
  6755. "${PROG} rtag: Untagging first-dir
  6756. ${PROG} rtag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\.
  6757. ${PROG} rtag: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file2,v. due to .-B. option\."
  6758. # the following tests (throught the next commit) keep moving the same
  6759. # tag back and forth between 1.1.6 & 1.1.8 in file1 and between
  6760. # 1.1.4 and 1.1.6 in file2 since nothing was checked in on some of
  6761. # these branches and CVS only tracks branches via tags unless they contain data.
  6762. # try intentionally converting non-branch tag to branch tag (tag -F -b)
  6763. dotest tagf-25a "${testcvs} tag -F -b regulartag file1" "T file1"
  6764. # try intentionally moving a branch tag to a newly created branch (tag -F -b -B)
  6765. dotest tagf-25b "${testcvs} tag -F -B -b -r1.1 regulartag file1" \
  6766. "T file1"
  6767. # try intentionally converting mixed tags to branch tags (rtag -F -b)
  6768. dotest tagf-26a "${testcvs} rtag -F -b regulartag first-dir" \
  6769. "${PROG} rtag: Tagging first-dir
  6770. ${PROG} rtag: first-dir/file1: Not moving branch tag .regulartag. from 1\.1 to 1\.1\.0\.8\."
  6771. # try intentionally converting a branch to a new branch tag (rtag -F -b -B)
  6772. dotest tagf-26b "${testcvs} rtag -F -B -b -r1.1 regulartag first-dir" \
  6773. "${PROG} rtag: Tagging first-dir"
  6774. # update to our new branch
  6775. dotest tagf-27 "${testcvs} update -r regulartag" \
  6776. "${PROG} update: Updating \.
  6777. U file1
  6778. U file2"
  6779. # commit some changes and see that all rev numbers look right
  6780. echo changes >> file1
  6781. echo changes >> file2
  6782. dotest tagf-28 "${testcvs} ci -m changes" \
  6783. "${PROG} [a-z]*: Examining \.
  6784. Checking in file1;
  6785. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  6786. new revision: 1\.1\.8\.1; previous revision: 1\.1
  6787. done
  6788. Checking in file2;
  6789. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  6790. new revision: 1\.1\.6\.1; previous revision: 1\.1
  6791. done"
  6792. # try intentional branch to non-branch (tag -F -B)
  6793. dotest tagf-29 "${testcvs} tag -F -B -r1.1 regulartag file1" \
  6794. "T file1"
  6795. # try non-branch to non-branch (tag -F -B)
  6796. dotest tagf-29a "${testcvs} tag -F -B -r br regulartag file1" \
  6797. "${PROG} tag: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\."
  6798. # try mixed-branch to non-branch (rtag -F -B )
  6799. dotest tagf-29b "${testcvs} rtag -F -B -r br regulartag first-dir" \
  6800. "${PROG} rtag: Tagging first-dir
  6801. ${PROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\."
  6802. # at this point, regulartag is a regular tag within
  6803. # file1 and file2
  6804. # try intentional branch to non-branch (rtag -F -B)
  6805. dotest tagf-30 "${testcvs} rtag -F -B -r1.1 br first-dir" \
  6806. "${PROG} rtag: Tagging first-dir"
  6807. # create a branch tag so we can try to delete it.
  6808. dotest tagf-31 "${testcvs} rtag -b brtag first-dir" \
  6809. "${PROG} rtag: Tagging first-dir"
  6810. # try intentinal deletion of branch tag (tag -d -B)
  6811. dotest tagf-32 "${testcvs} tag -d -B brtag file1" "D file1"
  6812. # try intentinal deletion of branch tag (rtag -d -B)
  6813. dotest tagf-33 "${testcvs} rtag -d -B brtag first-dir" \
  6814. "${PROG} rtag: Untagging first-dir"
  6815. cd ../..
  6816. rm -r 1
  6817. rm -rf ${CVSROOT_DIRNAME}/first-dir
  6818. ;;
  6819. tag-log)
  6820. # Test log output for tags
  6821. mkdir 1; cd 1
  6822. dotest tag-log-init-1 "$testcvs -q co -l ."
  6823. mkdir first-dir
  6824. dotest tag-log-init-2 "$testcvs add first-dir" \
  6825. "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
  6826. cd first-dir
  6827. touch file1
  6828. dotest tag-log-init-3 "$testcvs add file1" \
  6829. "${PROG}"' add: scheduling file `file1'\'' for addition
  6830. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  6831. dotest tag-log-init-4 "$testcvs -Q ci -m add" \
  6832. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6833. done
  6834. Checking in file1;
  6835. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  6836. initial revision: 1\.1
  6837. done"
  6838. dotest tag-log-1 "$testcvs -Q tag mytag file1" ''
  6839. dotest tag-log-2 "$testcvs log -N file1" \
  6840. "
  6841. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6842. Working file: file1
  6843. head: 1\.1
  6844. branch:
  6845. locks: strict
  6846. access list:
  6847. keyword substitution: kv
  6848. total revisions: 1; selected revisions: 1
  6849. description:
  6850. ----------------------------
  6851. revision 1\.1
  6852. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  6853. add
  6854. ============================================================================="
  6855. dotest tag-log-3 "$testcvs log -N -n file1" \
  6856. "
  6857. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6858. Working file: file1
  6859. head: 1\.1
  6860. branch:
  6861. locks: strict
  6862. access list:
  6863. symbolic names:
  6864. mytag: 1\.1
  6865. keyword substitution: kv
  6866. total revisions: 1; selected revisions: 1
  6867. description:
  6868. ----------------------------
  6869. revision 1\.1
  6870. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  6871. add
  6872. ============================================================================="
  6873. dotest tag-log-4 "$testcvs log file1" \
  6874. "
  6875. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6876. Working file: file1
  6877. head: 1\.1
  6878. branch:
  6879. locks: strict
  6880. access list:
  6881. symbolic names:
  6882. mytag: 1\.1
  6883. keyword substitution: kv
  6884. total revisions: 1; selected revisions: 1
  6885. description:
  6886. ----------------------------
  6887. revision 1\.1
  6888. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  6889. add
  6890. ============================================================================="
  6891. dotest tag-log-5 "$testcvs log -n file1" \
  6892. "
  6893. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  6894. Working file: file1
  6895. head: 1\.1
  6896. branch:
  6897. locks: strict
  6898. access list:
  6899. symbolic names:
  6900. mytag: 1\.1
  6901. keyword substitution: kv
  6902. total revisions: 1; selected revisions: 1
  6903. description:
  6904. ----------------------------
  6905. revision 1\.1
  6906. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  6907. add
  6908. ============================================================================="
  6909. cd ../..
  6910. rm -fr 1
  6911. rm -rf ${CVSROOT_DIRNAME}/first-dir
  6912. ;;
  6913. tag-space)
  6914. # Test tags with spaces in the names.
  6915. #
  6916. # Prior to releases 1.11.18 & 1.12.10, some commands used with
  6917. # tags with spaces in the names could hang CVS.
  6918. # Setup; check in first-dir/file1
  6919. mkdir 1; cd 1
  6920. dotest tag-space-init-1 "$testcvs -q co -l ."
  6921. mkdir first-dir
  6922. dotest tag-space-init-2 "$testcvs add first-dir" \
  6923. "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
  6924. cd first-dir
  6925. touch file1
  6926. dotest tag-space-init-3 "$testcvs add file1" \
  6927. "$PROG add: scheduling file \`file1' for addition
  6928. $PROG add: use '$PROG commit' to add this file permanently"
  6929. dotest tag-space-init-4 "$testcvs -Q ci -m add" \
  6930. "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
  6931. done
  6932. Checking in file1;
  6933. $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
  6934. initial revision: 1\.1
  6935. done"
  6936. # Reportedly, the following two tags make it past WinCVS.
  6937. dotest_fail tag-space-1 "$testcvs tag ' spacetag '" \
  6938. "$PROG \[tag aborted\]: tag \` spacetag ' must start with a letter"
  6939. dotest_fail tag-space-2 "$testcvs tag 'spacetag '" \
  6940. "$PROG \[tag aborted\]: tag \`spacetag ' has non-visible graphic characters"
  6941. if $remote; then
  6942. # Verify that this isn't a client check.
  6943. dotest tag-space-3 "$testcvs server" \
  6944. "E $PROG \[tag aborted\]: tag \` spacetag ' must start with a letter
  6945. error " <<EOF
  6946. Root $CVSROOT_DIRNAME
  6947. UseUnchanged
  6948. Argument --
  6949. Argument spacetag
  6950. Directory .
  6951. $CVSROOT_DIRNAME/first-dir
  6952. Entry /file1/1.1///
  6953. Unchanged file1
  6954. tag
  6955. EOF
  6956. dotest tag-space-4 "$testcvs server" \
  6957. "E $PROG \[tag aborted\]: tag \`spacetag ' has non-visible graphic characters
  6958. error " <<EOF
  6959. Root $CVSROOT_DIRNAME
  6960. UseUnchanged
  6961. Argument --
  6962. Argument spacetag
  6963. Directory .
  6964. $CVSROOT_DIRNAME/first-dir
  6965. Entry /file1/1.1///
  6966. Unchanged file1
  6967. tag
  6968. EOF
  6969. fi # $remote
  6970. # Any number of normal tags and branches were handled correctly.
  6971. dotest tag-space-5 "$testcvs -Q tag t1"
  6972. dotest tag-space-5b "$testcvs -Q tag t2"
  6973. dotest tag-space-5c "$testcvs -Q tag -b b1"
  6974. cd ../..
  6975. mkdir 2; cd 2
  6976. # But once a vendor branch exists, it's all over.
  6977. mkdir project; cd project
  6978. touch file1
  6979. dotest tag-space-init-4 \
  6980. "$testcvs -Q import -mimport second-dir VENDOR RELEASE"
  6981. cd ..
  6982. dotest_fail tag-space-6 "$testcvs -Q co -r ' spacetag ' first-dir" \
  6983. "$PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter"
  6984. # But when any files were imported, this test hung prior to CVS
  6985. # versions 1.11.18 & 1.12.10.
  6986. dotest_fail tag-space-7 "$testcvs -Q co -r ' spacetag ' second-dir" \
  6987. "$PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter"
  6988. if $remote; then
  6989. # I based the client input in the next two tests on actual input
  6990. # from WinCVS 1.2.
  6991. dotest tag-space-8 "$testcvs server" \
  6992. "E $PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter
  6993. error " <<EOF
  6994. Root $CVSROOT_DIRNAME
  6995. Argument -P
  6996. Argument -r
  6997. Argument spacetag
  6998. Argument first-dir
  6999. Directory .
  7000. $CVSROOT_DIRNAME
  7001. co
  7002. EOF
  7003. # Verify the test is not on the client side.
  7004. dotest tag-space-9 "$testcvs server" \
  7005. "E $PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter
  7006. error " <<EOF
  7007. Root $CVSROOT_DIRNAME
  7008. Argument -P
  7009. Argument -r
  7010. Argument spacetag
  7011. Argument second-dir
  7012. Directory .
  7013. $CVSROOT_DIRNAME
  7014. co
  7015. EOF
  7016. fi # $remote
  7017. dotest tag-space-10 "$testcvs -Q co second-dir"
  7018. cd second-dir
  7019. # This test would also hang.
  7020. dotest_fail tag-space-11 "$testcvs -Q up -r ' spacetag '" \
  7021. "$PROG \[update aborted\]: tag \` spacetag ' must start with a letter"
  7022. if $remote; then
  7023. dotest tag-space-12 "$testcvs server" \
  7024. "E $PROG \[update aborted\]: tag \` spacetag ' must start with a letter
  7025. error " <<EOF
  7026. Root $CVSROOT_DIRNAME
  7027. Argument -r
  7028. Argument spacetag
  7029. Argument -u
  7030. Argument --
  7031. Directory .
  7032. $CVSROOT_DIRNAME
  7033. Unchanged file1
  7034. update
  7035. EOF
  7036. fi # $remote
  7037. # I'm skipping tests for other commands that may have had the same
  7038. # problem. Hopefully, if a new issue arises, one of the above tests
  7039. # will catch the problem.
  7040. if $keep; then
  7041. echo Keeping $TESTDIR and exiting due to --keep
  7042. exit 0
  7043. fi
  7044. cd ../..
  7045. rm -r 1 2
  7046. rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/second-dir
  7047. ;;
  7048. rcslib)
  7049. # Test librarification of RCS.
  7050. # First: test whether `cvs diff' handles $Name expansion
  7051. # correctly. We diff two revisions with their symbolic tags;
  7052. # neither tag should be expanded in the output. Also diff
  7053. # one revision with the working copy.
  7054. mkdir ${CVSROOT_DIRNAME}/first-dir
  7055. dotest rcsdiff-1 "${testcvs} -q co first-dir" ''
  7056. cd first-dir
  7057. echo "I am the first foo, and my name is $""Name$." > foo.c
  7058. dotest rcsdiff-2 "${testcvs} add -m new-file foo.c" \
  7059. "${PROG} add: scheduling file .foo\.c. for addition
  7060. ${PROG} add: use .${PROG} commit. to add this file permanently"
  7061. dotest rcsdiff-3 "${testcvs} commit -m rev1 foo.c" \
  7062. "RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
  7063. done
  7064. Checking in foo\.c;
  7065. ${CVSROOT_DIRNAME}/first-dir/foo.c,v <-- foo\.c
  7066. initial revision: 1\.1
  7067. done"
  7068. dotest rcsdiff-4 "${testcvs} tag first foo.c" "T foo\.c"
  7069. dotest rcsdiff-5 "${testcvs} update -p -r first foo.c" \
  7070. "===================================================================
  7071. Checking out foo\.c
  7072. RCS: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
  7073. VERS: 1\.1
  7074. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  7075. I am the first foo, and my name is \$""Name: first \$\."
  7076. echo "I am the second foo, and my name is $""Name$." > foo.c
  7077. dotest rcsdiff-6 "${testcvs} commit -m rev2 foo.c" \
  7078. "Checking in foo\.c;
  7079. ${CVSROOT_DIRNAME}/first-dir/foo\.c,v <-- foo\.c
  7080. new revision: 1\.2; previous revision: 1\.1
  7081. done"
  7082. dotest rcsdiff-7 "${testcvs} tag second foo.c" "T foo\.c"
  7083. dotest rcsdiff-8 "${testcvs} update -p -r second foo.c" \
  7084. "===================================================================
  7085. Checking out foo\.c
  7086. RCS: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
  7087. VERS: 1\.2
  7088. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  7089. I am the second foo, and my name is \$""Name: second \$\."
  7090. dotest_fail rcsdiff-9 "${testcvs} diff -r first -r second" \
  7091. "${PROG} diff: Diffing \.
  7092. Index: foo\.c
  7093. ===================================================================
  7094. RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
  7095. retrieving revision 1\.1
  7096. retrieving revision 1\.2
  7097. diff -r1\.1 -r1\.2
  7098. 1c1
  7099. < I am the first foo, and my name is \$""Name: \$\.
  7100. ---
  7101. > I am the second foo, and my name is \$""Name: \$\."
  7102. echo "I am the once and future foo, and my name is $""Name$." > foo.c
  7103. dotest_fail rcsdiff-10 "${testcvs} diff -r first" \
  7104. "${PROG} diff: Diffing \.
  7105. Index: foo\.c
  7106. ===================================================================
  7107. RCS file: ${CVSROOT_DIRNAME}/first-dir/foo\.c,v
  7108. retrieving revision 1\.1
  7109. diff -r1\.1 foo\.c
  7110. 1c1
  7111. < I am the first foo, and my name is \$""Name: \$\.
  7112. ---
  7113. > I am the once and future foo, and my name is \$""Name\$\."
  7114. # Test handling of libdiff options. diff gets quite enough
  7115. # of a workout elsewhere in sanity.sh, so we assume that it's
  7116. # mostly working properly if it passes all the other tests.
  7117. # The main one we want to try is regex handling, since we are
  7118. # using CVS's regex matcher and not diff's.
  7119. cat >rgx.c <<EOF
  7120. test_regex (whiz, bang)
  7121. {
  7122. foo;
  7123. bar;
  7124. baz;
  7125. grumble;
  7126. }
  7127. EOF
  7128. dotest rcslib-diffrgx-1 "${testcvs} -q add -m '' rgx.c" \
  7129. "${PROG} add: use .${PROG} commit. to add this file permanently"
  7130. dotest rcslib-diffrgx-2 "${testcvs} -q ci -m '' rgx.c" \
  7131. "RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
  7132. done
  7133. Checking in rgx\.c;
  7134. ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v <-- rgx\.c
  7135. initial revision: 1\.1
  7136. done"
  7137. cat >rgx.c <<EOF
  7138. test_regex (whiz, bang)
  7139. {
  7140. foo;
  7141. bar;
  7142. baz;
  7143. mumble;
  7144. }
  7145. EOF
  7146. # Use dotest_fail because exit status from `cvs diff' must be 1.
  7147. dotest_fail rcslib-diffrgx-3 "${testcvs} diff -c -F'.* (' rgx.c" \
  7148. "Index: rgx\.c
  7149. ===================================================================
  7150. RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
  7151. retrieving revision 1\.1
  7152. diff -c -F \.\* ( -r1\.1 rgx\.c
  7153. \*\*\* rgx\.c ${RFCDATE} 1\.1
  7154. --- rgx\.c ${RFCDATE}
  7155. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* test_regex (whiz, bang)
  7156. \*\*\* 3,7 \*\*\*\*
  7157. foo;
  7158. bar;
  7159. baz;
  7160. ! grumble;
  7161. }
  7162. --- 3,7 ----
  7163. foo;
  7164. bar;
  7165. baz;
  7166. ! mumble;
  7167. }"
  7168. # Tests of rcsmerge/diff3. Merge operations get a good general
  7169. # workout elsewhere; we want to make sure that options are still
  7170. # handled properly. Try merging two branches with -kv, to test
  7171. # both -j and -k switches.
  7172. cd ..
  7173. rm -rf ${CVSROOT_DIRNAME}/first-dir
  7174. rm -r first-dir
  7175. mkdir 1; cd 1
  7176. dotest rcslib-merge-1 "${testcvs} -q co -l ." ""
  7177. mkdir first-dir
  7178. dotest rcslib-merge-2 "${testcvs} -q add first-dir" \
  7179. "Directory ${CVSROOT_DIRNAME}.*/first-dir added to the repository"
  7180. cd ..; rm -r 1
  7181. dotest rcslib-merge-3 "${testcvs} -q co first-dir" ""
  7182. cd first-dir
  7183. echo '$''Revision$' > file1
  7184. echo '2' >> file1
  7185. echo '3' >> file1
  7186. dotest rcslib-merge-4 "${testcvs} -q add file1" \
  7187. "${PROG} add: use .${PROG} commit. to add this file permanently"
  7188. dotest rcslib-merge-5 "${testcvs} -q commit -m '' file1" \
  7189. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  7190. done
  7191. Checking in file1;
  7192. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  7193. initial revision: 1\.1
  7194. done"
  7195. sed -e 's/2/two/' file1 > f; mv f file1
  7196. dotest rcslib-merge-6 "${testcvs} -q commit -m '' file1" \
  7197. "Checking in file1;
  7198. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  7199. new revision: 1\.2; previous revision: 1\.1
  7200. done"
  7201. dotest rcslib-merge-7 "${testcvs} -q tag -b -r 1.1 patch1" "T file1"
  7202. dotest rcslib-merge-8 "${testcvs} -q update -r patch1" "[UP] file1"
  7203. dotest rcslib-merge-9 "${testcvs} -q status" \
  7204. "===================================================================
  7205. File: file1 Status: Up-to-date
  7206. Working revision: 1\.1.*
  7207. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
  7208. Sticky Tag: patch1 (branch: 1\.1\.2)
  7209. Sticky Date: (none)
  7210. Sticky Options: (none)"
  7211. dotest rcslib-merge-10 "cat file1" \
  7212. '$''Revision: 1\.1 $
  7213. 2
  7214. 3'
  7215. sed -e 's/3/three/' file1 > f; mv f file1
  7216. dotest rcslib-merge-11 "${testcvs} -q commit -m '' file1" \
  7217. "Checking in file1;
  7218. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  7219. new revision: 1\.1\.2\.1; previous revision: 1\.1
  7220. done"
  7221. dotest rcslib-merge-12 "${testcvs} -q update -kv -j1.2" \
  7222. "U file1
  7223. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  7224. retrieving revision 1\.1
  7225. retrieving revision 1\.2
  7226. Merging differences between 1\.1 and 1\.2 into file1
  7227. rcsmerge: warning: conflicts during merge"
  7228. dotest rcslib-merge-13 "cat file1" \
  7229. "<<<<<<< file1
  7230. 1\.1\.2\.1
  7231. 2
  7232. three
  7233. [=]======
  7234. 1\.2
  7235. two
  7236. 3
  7237. [>]>>>>>> 1\.2"
  7238. # Test behavior of symlinks in the repository.
  7239. if test -n "$remotehost"; then
  7240. # Create the link on the remote system. This is because Cygwin's
  7241. # Windows support creates *.lnk files for Windows. When creating
  7242. # these in an SMB share from UNIX, these links won't work from the
  7243. # UNIX side.
  7244. dotest rcslib-symlink-1remotehost "${CVS_RSH} $remotehost 'ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
  7245. else
  7246. dotest rcslib-symlink-1 "ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
  7247. fi
  7248. dotest rcslib-symlink-2 "${testcvs} update file2" "U file2"
  7249. echo "This is a change" >> file2
  7250. dotest rcslib-symlink-3 "${testcvs} ci -m because file2" \
  7251. "Checking in file2;
  7252. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file2
  7253. new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
  7254. done"
  7255. # Switch as for rcslib-symlink-1
  7256. if test -n "$remotehost"; then
  7257. dotest rcslib-symlink-4 "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/file2,v'" \
  7258. ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
  7259. else
  7260. dotest rcslib-symlink-4 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
  7261. ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
  7262. fi
  7263. # CVS was failing to check both the symlink and the file
  7264. # for timestamp changes for a while. Test that.
  7265. rm file1
  7266. dotest rcslib-symlink-3a "${testcvs} -q up file1" \
  7267. "${PROG} update: warning: file1 was lost
  7268. U file1"
  7269. echo "This is a change" >> file1
  7270. dotest rcslib-symlink-3b "${testcvs} ci -m because file1" \
  7271. "Checking in file1;
  7272. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  7273. new revision: 1\.1\.2\.[0-9]*; previous revision: 1\.1\.2\.[0-9]*
  7274. done"
  7275. dotest rcslib-symlink-3c "${testcvs} update file2" "[UP] file2"
  7276. echo some new text >file3
  7277. dotest rcslib-symlink-3d "${testcvs} -Q add file3" ''
  7278. dotest rcslib-symlink-3e "${testcvs} -Q ci -mtest file3" \
  7279. "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
  7280. done
  7281. Checking in file3;
  7282. ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
  7283. new revision: 1\.1\.2\.1; previous revision: 1\.1
  7284. done"
  7285. rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v
  7286. # As for rcslib-symlink-1
  7287. if test -n "$remotehost"; then
  7288. dotest rcslib-symlink-3f "$CVS_RSH $remotehost 'ln -s Attic/file3,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
  7289. else
  7290. dotest rcslib-symlink-3f "ln -s Attic/file3,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
  7291. fi
  7292. dotest rcslib-symlink-3g "${testcvs} update file2" "U file2"
  7293. # restore the link to file1 for the following tests
  7294. dotest rcslib-symlink-3i "${testcvs} -Q rm -f file3" ''
  7295. dotest rcslib-symlink-3j "${testcvs} -Q ci -mwhatever file3" \
  7296. "Removing file3;
  7297. ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
  7298. new revision: delete; previous revision: 1\.1\.2\.1
  7299. done"
  7300. rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v
  7301. rm -f ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
  7302. # As for rcslib-symlink-1
  7303. if test -n "$remotehost"; then
  7304. dotest rcslib-symlink-3h "$CVS_RSH $remotehost 'ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v'"
  7305. else
  7306. dotest rcslib-symlink-3h "ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v"
  7307. fi
  7308. # Test 5 reveals a problem with having symlinks in the
  7309. # repository. CVS will try to tag both of the files
  7310. # separately. After processing one, it will do the same
  7311. # operation to the other, which is actually the same file,
  7312. # so the tag will already be there. FIXME: do we bother
  7313. # changing operations to notice cases like this? This
  7314. # strikes me as a difficult problem. -Noel
  7315. dotest rcslib-symlink-5 "${testcvs} tag the_tag" \
  7316. "${PROG} tag: Tagging .
  7317. T file1
  7318. W file2 : the_tag already exists on version 1.1.2.3 : NOT MOVING tag to version 1.1.2.1"
  7319. # As for rcslib-symlink-1
  7320. if test -n "$remotehost"; then
  7321. dotest rcslib-symlink-6 "$CVS_RSH $remotehost 'ls -l $CVSROOT_DIRNAME/first-dir/file2,v'" \
  7322. ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
  7323. else
  7324. dotest rcslib-symlink-6 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \
  7325. ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v"
  7326. fi
  7327. # Symlinks tend to interact poorly with the Attic.
  7328. cd ..
  7329. mkdir 2; cd 2
  7330. dotest rcslib-symlink-7 "${testcvs} -q co first-dir" \
  7331. "U first-dir/file1
  7332. U first-dir/file2"
  7333. cd first-dir
  7334. dotest rcslib-symlink-8 "${testcvs} rm -f file2" \
  7335. "${PROG} remove: scheduling .file2. for removal
  7336. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  7337. dotest rcslib-symlink-9 "${testcvs} -q ci -m rm-it" \
  7338. "Removing file2;
  7339. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file2
  7340. new revision: delete; previous revision: 1\.2
  7341. done"
  7342. # OK, why this message happens twice is relatively clear
  7343. # (the check_* and rtag_* calls to start_recursion).
  7344. # Why it happens a third time I didn't try to find out.
  7345. dotest rcslib-symlink-10 \
  7346. "${testcvs} -q rtag -b -r the_tag brtag first-dir" \
  7347. "${PROG} rtag: could not read RCS file for file2
  7348. ${PROG} rtag: could not read RCS file for first-dir/file2
  7349. ${PROG} rtag: could not read RCS file for first-dir/file2"
  7350. # Restore file1 for the next test.
  7351. dotest rcslib-long-symlink-init-1 "$testcvs -Q up -A"
  7352. dotest rcslib-long-symlink-init-2 "$testcvs -Q add file1"
  7353. dotest rcslib-long-symlink-init-3 "$testcvs -Q ci -mback" \
  7354. "Checking in file1;
  7355. $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
  7356. new revision: 1\.4; previous revision: 1\.3
  7357. done"
  7358. cd ../.. # $TESTDIR
  7359. # CVS has a hard-coded default link path size of 127 characters.
  7360. # Make sure it knows how to exceed that.
  7361. longpath=$CVSROOT_DIRNAME
  7362. count=0
  7363. while test $count -lt 10; do
  7364. count=`expr $count + 1`
  7365. longpath=$longpath/123456789012345678901234567890
  7366. mkdir $longpath
  7367. done
  7368. cp $CVSROOT_DIRNAME/first-dir/file1,v $longpath
  7369. mkdir $CVSROOT_DIRNAME/second-dir
  7370. # Switch as for rcslib-symlink-1
  7371. if test -n "$remotehost"; then
  7372. dotest rcslib-long-symlink-1rh \
  7373. "$CVS_RSH $remotehost 'ln -s $longpath/file1,v $CVSROOT_DIRNAME/second-dir/fileX,v'"
  7374. else
  7375. dotest rcslib-long-symlink-1 \
  7376. "ln -s $longpath/file1,v $CVSROOT_DIRNAME/second-dir/fileX,v"
  7377. fi
  7378. dotest rcslib-long-symlink-2 "$testcvs co second-dir" \
  7379. "$PROG checkout: Updating second-dir
  7380. U second-dir/fileX"
  7381. cd second-dir
  7382. echo change-it >>fileX
  7383. # Writes actually cause symlinks to be resolved.
  7384. dotest rcslib-long-symlink-3 "$testcvs -q ci -mwrite-it" \
  7385. "Checking in fileX;
  7386. $CVSROOT_DIRNAME/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/file1,v <-- fileX
  7387. new revision: 1\.5; previous revision: 1\.4
  7388. done"
  7389. if $keep; then
  7390. echo Keeping ${TESTDIR} and exiting due to --keep
  7391. exit 0
  7392. fi
  7393. cd ..
  7394. # Must remove the symlink first. Samba doesn't appear to show
  7395. # broken symlink across the SMB share, and rm -rf by itself
  7396. # will remove file1,v first and leave file2,v a broken link and the
  7397. # rm -rf will fail since it doesn't find file2,v and it still gets
  7398. # directory not empty errors removing cvsroot/first-dir.
  7399. #
  7400. # I'm not sure why I need to do this on $remotehost. The rm above
  7401. # rcslib-symlink-3j works fine, but the next one doesn't unless run
  7402. # remotely under Cygwin and using a TESTDIR on a Samba share.
  7403. if test -n "$remotehost"; then
  7404. $CVS_RSH $remotehost \
  7405. "rm -f $CVSROOT_DIRNAME/first-dir/file2,v $CVSROOT_DIRNAME/second-dir/fileX,v"
  7406. fi
  7407. rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/second-dir \
  7408. $CVSROOT_DIRNAME/123456789012345678901234567890
  7409. rm -r first-dir second-dir 2
  7410. ;;
  7411. multibranch)
  7412. # Test the ability to have several branchpoints coming off the
  7413. # same revision.
  7414. mkdir ${CVSROOT_DIRNAME}/first-dir
  7415. dotest multibranch-1 "${testcvs} -q co first-dir" ''
  7416. cd first-dir
  7417. echo 1:trunk-1 >file1
  7418. dotest multibranch-2 "${testcvs} add file1" \
  7419. "${PROG}"' add: scheduling file `file1'\'' for addition
  7420. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  7421. dotest_lit multibranch-3 "${testcvs} -q ci -m add-it" <<HERE
  7422. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  7423. done
  7424. Checking in file1;
  7425. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  7426. initial revision: 1.1
  7427. done
  7428. HERE
  7429. dotest multibranch-4 "${testcvs} tag -b br1" \
  7430. "${PROG} tag: Tagging \.
  7431. T file1"
  7432. dotest multibranch-5 "${testcvs} tag -b br2" \
  7433. "${PROG} tag: Tagging \.
  7434. T file1"
  7435. dotest multibranch-6 "$testcvs -q update -r br1" '[UP] file1'
  7436. echo on-br1 >file1
  7437. dotest multibranch-7 "${testcvs} -q ci -m modify-on-br1" \
  7438. "Checking in file1;
  7439. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  7440. new revision: 1\.1\.2\.1; previous revision: 1\.1
  7441. done"
  7442. dotest multibranch-8 "${testcvs} -q update -r br2" '[UP] file1'
  7443. echo br2 adds a line >>file1
  7444. dotest multibranch-9 "${testcvs} -q ci -m modify-on-br2" \
  7445. "Checking in file1;
  7446. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  7447. new revision: 1\.1\.4\.1; previous revision: 1\.1
  7448. done"
  7449. dotest multibranch-10 "${testcvs} -q update -r br1" '[UP] file1'
  7450. dotest multibranch-11 "cat file1" 'on-br1'
  7451. dotest multibranch-12 "${testcvs} -q update -r br2" '[UP] file1'
  7452. dotest multibranch-13 "cat file1" '1:trunk-1
  7453. br2 adds a line'
  7454. dotest multibranch-14 "${testcvs} log file1" \
  7455. "
  7456. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  7457. Working file: file1
  7458. head: 1\.1
  7459. branch:
  7460. locks: strict
  7461. access list:
  7462. symbolic names:
  7463. br2: 1\.1\.0\.4
  7464. br1: 1\.1\.0\.2
  7465. keyword substitution: kv
  7466. total revisions: 3; selected revisions: 3
  7467. description:
  7468. ----------------------------
  7469. revision 1\.1
  7470. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  7471. branches: 1\.1\.2; 1\.1\.4;
  7472. add-it
  7473. ----------------------------
  7474. revision 1\.1\.4\.1
  7475. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
  7476. modify-on-br2
  7477. ----------------------------
  7478. revision 1\.1\.2\.1
  7479. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
  7480. modify-on-br1
  7481. ============================================================================="
  7482. cd ..
  7483. if $keep; then
  7484. echo Keeping ${TESTDIR} and exiting due to --keep
  7485. exit 0
  7486. fi
  7487. rm -rf ${CVSROOT_DIRNAME}/first-dir
  7488. rm -r first-dir
  7489. ;;
  7490. import) # test death after import
  7491. # Tests of "cvs import":
  7492. # basic2
  7493. # rdiff -- imports with keywords
  7494. # import -- more tests of imports with keywords
  7495. # importb -- -b option.
  7496. # importc -- bunch o' files in bunch o' directories
  7497. # modules3
  7498. # mflag -- various -m messages
  7499. # ignore -- import and cvsignore
  7500. # binwrap -- import and -k wrappers
  7501. # info -- imports which are rejected by verifymsg
  7502. # head -- intended to test vendor branches and HEAD,
  7503. # although it doesn't really do it yet.
  7504. # import-CVS -- refuse to import directories named "CVS".
  7505. # import-quirks -- short tests of import quirks.
  7506. # import
  7507. mkdir import-dir ; cd import-dir
  7508. for i in 1 2 3 4 ; do
  7509. echo imported file"$i" > imported-f"$i"
  7510. done
  7511. # This directory should be on the default ignore list,
  7512. # so it shouldn't get imported.
  7513. mkdir RCS
  7514. echo ignore.me >RCS/ignore.me
  7515. echo 'import should not expand $''Id$' >>imported-f2
  7516. cp imported-f2 ../imported-f2-orig.tmp
  7517. dotest_sort import-96 \
  7518. "${testcvs} import -m first-import first-dir vendor-branch junk-1_0" \
  7519. "
  7520. I first-dir/RCS
  7521. N first-dir/imported-f1
  7522. N first-dir/imported-f2
  7523. N first-dir/imported-f3
  7524. N first-dir/imported-f4
  7525. No conflicts created by this import"
  7526. dotest import-96.5 "cmp ../imported-f2-orig.tmp imported-f2" ''
  7527. cd ..
  7528. # co
  7529. dotest import-97 "${testcvs} -q co first-dir" \
  7530. "U first-dir/imported-f1
  7531. U first-dir/imported-f2
  7532. U first-dir/imported-f3
  7533. U first-dir/imported-f4"
  7534. cd first-dir
  7535. for i in 1 2 3 4 ; do
  7536. dotest import-98-$i "test -f imported-f$i" ''
  7537. done
  7538. dotest_fail import-98.5 "test -d RCS" ''
  7539. # remove
  7540. rm imported-f1
  7541. dotest import-99 "${testcvs} rm imported-f1" \
  7542. "${PROG}"' remove: scheduling `imported-f1'\'' for removal
  7543. '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
  7544. # change
  7545. echo local-change >> imported-f2
  7546. # commit
  7547. dotest import-100 "${testcvs} ci -m local-changes" \
  7548. "${PROG} [a-z]*: Examining .
  7549. Removing imported-f1;
  7550. ${CVSROOT_DIRNAME}/first-dir/imported-f1,v <-- imported-f1
  7551. new revision: delete; previous revision: 1\.1\.1\.1
  7552. done
  7553. Checking in imported-f2;
  7554. ${CVSROOT_DIRNAME}/first-dir/imported-f2,v <-- imported-f2
  7555. new revision: 1\.2; previous revision: 1\.1
  7556. done"
  7557. # log
  7558. dotest import-101 "${testcvs} log imported-f1" \
  7559. "
  7560. RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/imported-f1,v
  7561. Working file: imported-f1
  7562. head: 1\.2
  7563. branch:
  7564. locks: strict
  7565. access list:
  7566. symbolic names:
  7567. junk-1_0: 1\.1\.1\.1
  7568. vendor-branch: 1\.1\.1
  7569. keyword substitution: kv
  7570. total revisions: 3; selected revisions: 3
  7571. description:
  7572. ----------------------------
  7573. revision 1\.2
  7574. date: [0-9/]* [0-9:]*; author: ${username}; state: dead; lines: ${PLUS}0 -0
  7575. local-changes
  7576. ----------------------------
  7577. revision 1\.1
  7578. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  7579. branches: 1\.1\.1;
  7580. Initial revision
  7581. ----------------------------
  7582. revision 1\.1\.1\.1
  7583. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
  7584. first-import
  7585. ============================================================================="
  7586. # update into the vendor branch.
  7587. dotest import-102 "$testcvs update -rvendor-branch" \
  7588. "$PROG update: Updating .
  7589. U imported-f1
  7590. [UP] imported-f2
  7591. [UP] imported-f3
  7592. [UP] imported-f4"
  7593. # remove file4 on the vendor branch
  7594. rm imported-f4
  7595. dotest import-103 "${testcvs} rm imported-f4" \
  7596. "${PROG}"' remove: scheduling `imported-f4'\'' for removal
  7597. '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
  7598. # commit
  7599. dotest import-104 \
  7600. "${testcvs} ci -m vendor-removed imported-f4" \
  7601. "Removing imported-f4;
  7602. ${CVSROOT_DIRNAME}/first-dir/imported-f4,v <-- imported-f4
  7603. new revision: delete; previous revision: 1\.1\.1\.1
  7604. done"
  7605. # update to main line
  7606. dotest import-105 "$testcvs -q update -A" \
  7607. "$PROG update: imported-f1 is no longer in the repository
  7608. [UP] imported-f2
  7609. [UP] imported-f3"
  7610. # second import - file4 deliberately unchanged
  7611. cd ../import-dir
  7612. for i in 1 2 3 ; do
  7613. echo rev 2 of file $i >> imported-f"$i"
  7614. done
  7615. cp imported-f2 ../imported-f2-orig.tmp
  7616. dotest_sort import-106 \
  7617. "${testcvs} import -m second-import first-dir vendor-branch junk-2_0" \
  7618. "
  7619. ${PROG} checkout -j<prev_rel_tag> -jjunk-2_0 first-dir
  7620. 2 conflicts created by this import.
  7621. C first-dir/imported-f1
  7622. C first-dir/imported-f2
  7623. I first-dir/RCS
  7624. U first-dir/imported-f3
  7625. U first-dir/imported-f4
  7626. Use the following command to help the merge:"
  7627. dotest import-106.5 "cmp ../imported-f2-orig.tmp imported-f2" \
  7628. ''
  7629. cd ..
  7630. rm imported-f2-orig.tmp
  7631. # co
  7632. dotest import-107 "${testcvs} co first-dir" \
  7633. "${PROG} checkout: Updating first-dir
  7634. [UP] first-dir/imported-f3
  7635. [UP] first-dir/imported-f4"
  7636. cd first-dir
  7637. dotest_fail import-108 "test -f imported-f1" ''
  7638. for i in 2 3 ; do
  7639. dotest import-109-$i "test -f imported-f$i" ''
  7640. done
  7641. # check vendor branch for file4
  7642. dotest import-110 "$testcvs -q update -rvendor-branch" \
  7643. 'U imported-f1
  7644. [UP] imported-f2
  7645. [UP] imported-f3
  7646. [UP] imported-f4'
  7647. dotest import-111 "test -f imported-f4" ''
  7648. # update to main line
  7649. dotest import-112 "$testcvs -q update -A" \
  7650. "$PROG update: imported-f1 is no longer in the repository
  7651. [UP] imported-f2
  7652. [UP] imported-f3
  7653. [UP] imported-f4"
  7654. cd ..
  7655. dotest import-113 \
  7656. "${testcvs} -q co -jjunk-1_0 -jjunk-2_0 first-dir" \
  7657. "${PROG} checkout: file first-dir/imported-f1 does not exist, but is present in revision junk-2_0
  7658. RCS file: ${CVSROOT_DIRNAME}/first-dir/imported-f2,v
  7659. retrieving revision 1\.1\.1\.1
  7660. retrieving revision 1\.1\.1\.2
  7661. Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into imported-f2
  7662. rcsmerge: warning: conflicts during merge
  7663. first-dir/imported-f3 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.2
  7664. first-dir/imported-f4 already contains the differences between 1\.1\.1\.1 and 1\.1\.1\.3"
  7665. cd first-dir
  7666. dotest_fail import-114 "test -f imported-f1" ''
  7667. for i in 2 3 ; do
  7668. dotest import-115-$i "test -f imported-f$i" ''
  7669. done
  7670. dotest import-116 'cat imported-f2' \
  7671. 'imported file2
  7672. [<]<<<<<< imported-f2
  7673. import should not expand \$''Id: imported-f2,v 1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
  7674. local-change
  7675. [=]======
  7676. import should not expand \$''Id: imported-f2,v 1\.1\.1\.2 [0-9/]* [0-9:]* '"${username}"' Exp \$
  7677. rev 2 of file 2
  7678. [>]>>>>>> 1\.1\.1\.2'
  7679. cd ..
  7680. rm -r first-dir
  7681. rm -rf ${CVSROOT_DIRNAME}/first-dir
  7682. rm -r import-dir
  7683. ;;
  7684. importb)
  7685. # More cvs import tests, especially -b option.
  7686. # OK, first we get some sources from the NetMunger project, and
  7687. # import them into the 1.1.1 vendor branch.
  7688. mkdir imp-dir
  7689. cd imp-dir
  7690. echo 'OpenMunger sources' >file1
  7691. echo 'OpenMunger sources' >file2
  7692. dotest_sort importb-1 \
  7693. "${testcvs} import -m add first-dir openmunger openmunger-1_0" \
  7694. "
  7695. N first-dir/file1
  7696. N first-dir/file2
  7697. No conflicts created by this import"
  7698. cd ..
  7699. rm -r imp-dir
  7700. # Now we put the sources we get from FreeMunger into 1.1.3
  7701. mkdir imp-dir
  7702. cd imp-dir
  7703. echo 'FreeMunger sources' >file1
  7704. echo 'FreeMunger sources' >file2
  7705. # Not completely sure how the conflict detection is supposed to
  7706. # be working here (haven't really thought about it).
  7707. # We use an explicit -d option to test that it is reflected
  7708. # in the suggested checkout.
  7709. dotest_sort importb-2 \
  7710. "${testcvs} -d ${CVSROOT} import -m add -b 1.1.3 first-dir freemunger freemunger-1_0" \
  7711. "
  7712. ${PROG} -d ${CVSROOT} checkout -j<prev_rel_tag> -jfreemunger-1_0 first-dir
  7713. 2 conflicts created by this import.
  7714. C first-dir/file1
  7715. C first-dir/file2
  7716. Use the following command to help the merge:"
  7717. cd ..
  7718. rm -r imp-dir
  7719. # Now a test of main branch import (into second-dir, not first-dir).
  7720. mkdir imp-dir
  7721. cd imp-dir
  7722. echo 'my own stuff' >mine1.c
  7723. echo 'my own stuff' >mine2.c
  7724. dotest_fail importb-3 \
  7725. "${testcvs} import -m add -b 1 second-dir dummy really_dumb_y" \
  7726. "$PROG \[import aborted\]: Only numeric branch specifications with two dots are
  7727. supported by import, not \`1'\. For example: \`1\.1\.1'\."
  7728. : when we implement main-branch import, should be \
  7729. "N second-dir/mine1\.c
  7730. N second-dir/mine2\.c
  7731. No conflicts created by this import"
  7732. cd ..
  7733. rm -r imp-dir
  7734. mkdir 1
  7735. cd 1
  7736. # when we implement main branch import, will want to
  7737. # add "second-dir" here.
  7738. dotest importb-4 "${testcvs} -q co first-dir" \
  7739. "U first-dir/file1
  7740. U first-dir/file2"
  7741. cd first-dir
  7742. dotest importb-5 "${testcvs} -q log file1" "
  7743. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  7744. Working file: file1
  7745. head: 1\.1
  7746. branch: 1\.1\.1
  7747. locks: strict
  7748. access list:
  7749. symbolic names:
  7750. freemunger-1_0: 1\.1\.3\.1
  7751. freemunger: 1\.1\.3
  7752. openmunger-1_0: 1\.1\.1\.1
  7753. openmunger: 1\.1\.1
  7754. keyword substitution: kv
  7755. total revisions: 3; selected revisions: 3
  7756. description:
  7757. ----------------------------
  7758. revision 1\.1
  7759. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  7760. branches: 1\.1\.1; 1\.1\.3;
  7761. Initial revision
  7762. ----------------------------
  7763. revision 1\.1\.3\.1
  7764. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -1
  7765. add
  7766. ----------------------------
  7767. revision 1\.1\.1\.1
  7768. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}0 -0
  7769. add
  7770. ============================================================================="
  7771. cd ../..
  7772. rm -r 1
  7773. rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
  7774. ;;
  7775. importc)
  7776. # Test importing a bunch o' files in a bunch o' directories.
  7777. # Also the -d option.
  7778. mkdir 1; cd 1
  7779. mkdir adir bdir cdir
  7780. mkdir adir/sub1 adir/sub2
  7781. mkdir adir/sub1/ssdir
  7782. mkdir bdir/subdir
  7783. touch adir/sub1/file1 adir/sub2/file2 adir/sub1/ssdir/ssfile
  7784. touch -t 197107040343 bdir/subdir/file1
  7785. touch -t 203412251801 cdir/cfile
  7786. dotest_sort importc-1 \
  7787. "${testcvs} import -d -m import-it first-dir vendor release" \
  7788. "
  7789. N first-dir/adir/sub1/file1
  7790. N first-dir/adir/sub1/ssdir/ssfile
  7791. N first-dir/adir/sub2/file2
  7792. N first-dir/bdir/subdir/file1
  7793. N first-dir/cdir/cfile
  7794. No conflicts created by this import
  7795. ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir
  7796. ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1
  7797. ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub1/ssdir
  7798. ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/adir/sub2
  7799. ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/bdir
  7800. ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/bdir/subdir
  7801. ${PROG} import: Importing ${CVSROOT_DIRNAME}/first-dir/cdir"
  7802. cd ..
  7803. mkdir 2; cd 2
  7804. dotest importc-2 "${testcvs} -q co first-dir" \
  7805. "U first-dir/adir/sub1/file1
  7806. U first-dir/adir/sub1/ssdir/ssfile
  7807. U first-dir/adir/sub2/file2
  7808. U first-dir/bdir/subdir/file1
  7809. U first-dir/cdir/cfile"
  7810. cd first-dir
  7811. dotest importc-3 "${testcvs} update adir/sub1" \
  7812. "${PROG} update: Updating adir/sub1
  7813. ${PROG} update: Updating adir/sub1/ssdir"
  7814. dotest importc-4 "${testcvs} update adir/sub1 bdir/subdir" \
  7815. "${PROG} update: Updating adir/sub1
  7816. ${PROG} update: Updating adir/sub1/ssdir
  7817. ${PROG} update: Updating bdir/subdir"
  7818. echo modify >>cdir/cfile
  7819. dotest importc-5 \
  7820. "${testcvs} -q rtag -b -r release wip_test first-dir" ""
  7821. dotest importc-6 "$testcvs -q update -r wip_test" \
  7822. 'U adir/sub1/file1
  7823. U adir/sub1/ssdir/ssfile
  7824. U adir/sub2/file2
  7825. U bdir/subdir/file1
  7826. M cdir/cfile'
  7827. # This used to fail in local mode
  7828. dotest importc-7 "${testcvs} -q ci -m modify -r wip_test" \
  7829. "Checking in cdir/cfile;
  7830. ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v <-- cfile
  7831. new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
  7832. done"
  7833. # TODO: should also be testing "import -d" when we update
  7834. # an existing file.
  7835. dotest importc-8 "${testcvs} -q log cdir/cfile" "
  7836. RCS file: ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v
  7837. Working file: cdir/cfile
  7838. head: 1\.1
  7839. branch: 1\.1\.1
  7840. locks: strict
  7841. access list:
  7842. symbolic names:
  7843. wip_test: 1\.1\.1\.1\.0\.2
  7844. release: 1\.1\.1\.1
  7845. vendor: 1\.1\.1
  7846. keyword substitution: kv
  7847. total revisions: 3; selected revisions: 3
  7848. description:
  7849. ----------------------------
  7850. revision 1\.1
  7851. date: 2034/12/2[4-6] [0-9][0-9]:01:[0-9][0-9]; author: ${username}; state: Exp;
  7852. branches: 1\.1\.1;
  7853. Initial revision
  7854. ----------------------------
  7855. revision 1\.1\.1\.1
  7856. date: 2034/12/2[4-6] [0-9][0-9]:01:[0-9][0-9]; author: ${username}; state: Exp; lines: ${PLUS}0 -0
  7857. branches: 1\.1\.1\.1\.2;
  7858. import-it
  7859. ----------------------------
  7860. revision 1\.1\.1\.1\.2\.1
  7861. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
  7862. modify
  7863. ============================================================================="
  7864. dotest importc-9 "${testcvs} -q log bdir/subdir/file1" "
  7865. RCS file: ${CVSROOT_DIRNAME}/first-dir/bdir/subdir/file1,v
  7866. Working file: bdir/subdir/file1
  7867. head: 1\.1
  7868. branch: 1\.1\.1
  7869. locks: strict
  7870. access list:
  7871. symbolic names:
  7872. wip_test: 1\.1\.1\.1\.0\.2
  7873. release: 1\.1\.1\.1
  7874. vendor: 1\.1\.1
  7875. keyword substitution: kv
  7876. total revisions: 2; selected revisions: 2
  7877. description:
  7878. ----------------------------
  7879. revision 1\.1
  7880. date: 1971/07/0[3-5] [0-9][0-9]:43:[0-9][0-9]; author: ${username}; state: Exp;
  7881. branches: 1\.1\.1;
  7882. Initial revision
  7883. ----------------------------
  7884. revision 1\.1\.1\.1
  7885. date: 1971/07/0[3-5] [0-9][0-9]:43:[0-9][0-9]; author: ${username}; state: Exp; lines: ${PLUS}0 -0
  7886. import-it
  7887. ============================================================================="
  7888. cd ..
  7889. # Now tests of absolute pathnames and .. as repository directory.
  7890. cd ../1
  7891. dotest_fail importc-10 \
  7892. "${testcvs} import -m imp ../other vendor release2" \
  7893. "${PROG} \[[a-z]* aborted\]: directory \.\./other not relative within the repository"
  7894. dotest_fail importc-11 \
  7895. "${testcvs} import -m imp ${TESTDIR}/other vendor release3" \
  7896. "${PROG} \[[a-z]* aborted\]: directory ${TESTDIR}/other not relative within the repository"
  7897. dotest_fail importc-12 "test -d ${TESTDIR}/other" ""
  7898. cd ..
  7899. rm -r 1 2
  7900. rm -rf ${CVSROOT_DIRNAME}/first-dir
  7901. ;;
  7902. import-CVS)
  7903. mkdir import-CVS
  7904. cd import-CVS
  7905. touch file1 file2 file3
  7906. dotest_fail import-CVS-1 "$testcvs import -mimport CVS vtag rtag" \
  7907. "$PROG import: The word \`CVS' is reserved by CVS and may not be used
  7908. $PROG \[import aborted\]: as a directory in a path or as a file name\."
  7909. dotest_fail import-CVS-1b \
  7910. "$testcvs import -mimport CVS-/CVS vtag rtag" \
  7911. "$PROG import: The word \`CVS' is reserved by CVS and may not be used
  7912. $PROG \[import aborted\]: as a directory in a path or as a file name\."
  7913. mkdir sdir
  7914. mkdir sdir/CVS
  7915. touch CVS sdir/CVS/file4 sdir/CVS/file5 sdir/file6 sdir/file7
  7916. # Calling the imported directory import-CVS is dual purpose in the
  7917. # following test. It makes sure the path test which matched above
  7918. # wasn't too strict.
  7919. dotest_sort import-CVS-2 \
  7920. "$testcvs import -I! -mimport import-CVS vtag rtag" \
  7921. "
  7922. I import-CVS/CVS
  7923. I import-CVS/sdir/CVS
  7924. N import-CVS/file1
  7925. N import-CVS/file2
  7926. N import-CVS/file3
  7927. N import-CVS/sdir/file6
  7928. N import-CVS/sdir/file7
  7929. No conflicts created by this import
  7930. $PROG import: Importing $CVSROOT_DIRNAME/import-CVS/sdir"
  7931. if $keep; then
  7932. echo Keeping ${TESTDIR} and exiting due to --keep
  7933. exit 0
  7934. fi
  7935. cd ..
  7936. rm -r import-CVS
  7937. rm -rf $CVSROOT_DIRNAME/import-CVS
  7938. ;;
  7939. import-quirks)
  7940. # Short tests of quirky import behavior.
  7941. #
  7942. # For a list of other import tests with short descriptions, see the
  7943. # comment header of the "import" test.
  7944. mkdir import-quirks
  7945. cd import-quirks
  7946. touch file1 file2 file3
  7947. # CVS prior to 1.11.18 and 1.12.10 used to happily import to
  7948. # "branch 1.1", creating RCS archives with revisions like,
  7949. # "1.1..1". That double-dot is *not* a typo.
  7950. dotest_fail import-quirks-1 \
  7951. "$testcvs import -b1.1. -mbad-bad-bad import-quirks VB RT" \
  7952. "$PROG \[import aborted\]: Only numeric branch specifications with two dots are
  7953. supported by import, not \`1\.1\.'\. For example: \`1\.1\.1'\."
  7954. dotest_fail import-quirks-2 \
  7955. "$testcvs import -b1.1.1.. -mbad-bad-bad import-quirks VB RT" \
  7956. "$PROG \[import aborted\]: Only numeric branch specifications with two dots are
  7957. supported by import, not \`1\.1\.1\.\.'\. For example: \`1\.1\.1'\."
  7958. # Try a few odd numbers. This is hardly comprehensive.
  7959. dotest_sort import-quirks-2 \
  7960. "$testcvs import -b10.10.101 -mthis-ones-ok import-quirks-2 VB RT" \
  7961. "
  7962. N import-quirks-2/file1
  7963. N import-quirks-2/file2
  7964. N import-quirks-2/file3
  7965. No conflicts created by this import"
  7966. dotest_sort import-quirks-3 \
  7967. "$testcvs import -b2345678901.2345678901.2345678901 -mthis-ones-ok import-quirks-3 VB RT" \
  7968. "
  7969. N import-quirks-3/file1
  7970. N import-quirks-3/file2
  7971. N import-quirks-3/file3
  7972. No conflicts created by this import"
  7973. dotest_sort import-quirks-4 \
  7974. "$testcvs import -b1.1.2 -mthis-ones-ok import-quirks-4 VB RT" \
  7975. "
  7976. N import-quirks-4/file1
  7977. N import-quirks-4/file2
  7978. N import-quirks-4/file3
  7979. No conflicts created by this import"
  7980. if $keep; then
  7981. echo Keeping $TESTDIR and exiting due to --keep
  7982. exit 0
  7983. fi
  7984. cd ..
  7985. rm -r import-quirks
  7986. rm -rf $CVSROOT_DIRNAME/import-quirks-2 \
  7987. $CVSROOT_DIRNAME/import-quirks-3 \
  7988. $CVSROOT_DIRNAME/import-quirks-4
  7989. ;;
  7990. import-after-initial)
  7991. # Properly handle the case in which the first version of a
  7992. # file is created by a regular cvs add and commit, and there
  7993. # is a subsequent cvs import of the same file. cvs update with
  7994. # a date tag must resort to searching the vendor branch only if
  7995. # the initial version of the file was created at the same time
  7996. # as the initial version on the vendor branch.
  7997. mkdir 1; cd 1
  7998. module=x
  7999. echo > unused-file
  8000. # Create the module.
  8001. dotest import-after-initial-1 \
  8002. "$testcvs -Q import -m. $module X Y" ''
  8003. file=m
  8004. # Check it out and add a file.
  8005. dotest import-after-initial-2 "$testcvs -Q co $module" ''
  8006. cd $module
  8007. echo original > $file
  8008. dotest import-after-initial-3 "${testcvs} -Q add $file" ""
  8009. dotest import-after-initial-4 "${testcvs} -Q ci -m. $file" \
  8010. "RCS file: ${CVSROOT_DIRNAME}/$module/$file,v
  8011. done
  8012. Checking in $file;
  8013. ${CVSROOT_DIRNAME}/$module/$file,v <-- $file
  8014. initial revision: 1\.1
  8015. done"
  8016. # Delay a little so the following import isn't done in the same
  8017. # second as the preceding commit.
  8018. sleep 2
  8019. # Do the first import of $file *after* $file already has an
  8020. # initial version.
  8021. mkdir sub
  8022. cd sub
  8023. echo newer-via-import > $file
  8024. dotest import-after-initial-5 \
  8025. "$testcvs -Q import -m. $module X Y2" ''
  8026. cd ..
  8027. # Sleep a second so we're sure to be after the second of the import.
  8028. sleep 1
  8029. dotest import-after-initial-6 \
  8030. "$testcvs -Q update -p -D now $file" 'original'
  8031. cd ../..
  8032. rm -rf 1
  8033. rm -rf ${CVSROOT_DIRNAME}/$module
  8034. ;;
  8035. branch-after-import)
  8036. # Test branching after an import via both cvs tag -b and
  8037. # cvs add to verify that the HEAD remains at 1.1.1.1
  8038. # This was a FreeBSD bug documented at the URL:
  8039. # http://www.freebsd.org/cgi/query-pr.cgi?pr=4033
  8040. mkdir branch-after-import
  8041. cd branch-after-import
  8042. # OK, first we get some sources from the NetMunger project,
  8043. # and import them into the 1.1.1 vendor branch.
  8044. mkdir imp-dir
  8045. cd imp-dir
  8046. echo 'OpenMunger sources' >file1
  8047. echo 'OpenMunger sources' >file2
  8048. dotest_sort branch-after-import-1 \
  8049. "${testcvs} import -m add first-dir openmunger openmunger-1_0" \
  8050. '
  8051. N first-dir/file1
  8052. N first-dir/file2
  8053. No conflicts created by this import'
  8054. cd ..
  8055. # Next checkout the new module
  8056. dotest branch-after-import-2 \
  8057. "${testcvs} -q co first-dir" \
  8058. 'U first-dir/file1
  8059. U first-dir/file2'
  8060. cd first-dir
  8061. # Branch tag the file1 and cvs add file2,
  8062. # the branch should remain the same in both cases
  8063. # such that a new import will not require a conflict
  8064. # resolution.
  8065. dotest branch-after-import-3 \
  8066. "${testcvs} tag -b TESTTOTRON file1" \
  8067. 'T file1'
  8068. dotest branch-after-import-4 \
  8069. "$testcvs -q update -r TESTTOTRON" \
  8070. "[UP] file1
  8071. $PROG update: file2 is no longer in the repository"
  8072. cp ../imp-dir/file2 .
  8073. dotest branch-after-import-5 \
  8074. "${testcvs} add file2" \
  8075. "${PROG} add: scheduling file .file2. for addition on branch .TESTTOTRON.
  8076. ${PROG} add: use .${PROG} commit. to add this file permanently"
  8077. dotest branch-after-import-6 \
  8078. "${testcvs} commit -m cvs-add file2" \
  8079. "Checking in file2;
  8080. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  8081. new revision: 1\.1\.1\.1\.2\.2; previous revision: 1\.1\.1\.1\.2\.1
  8082. done"
  8083. if $keep; then
  8084. echo Keeping ${TESTDIR} and exiting due to --keep
  8085. exit 0
  8086. fi
  8087. cd ../..
  8088. rm -r branch-after-import
  8089. rm -rf ${CVSROOT_DIRNAME}/first-dir
  8090. ;;
  8091. join)
  8092. # Test doing joins which involve adding and removing files.
  8093. # Variety of scenarios (see list below), in the context of:
  8094. # * merge changes from T1 to T2 into the main line
  8095. # * merge changes from branch 'branch' into the main line
  8096. # * merge changes from branch 'branch' into branch 'br2'.
  8097. # See also binfile2, which does similar things with binary files.
  8098. # See also join2, which tests joining (and update -A) on only
  8099. # a single file, rather than a directory.
  8100. # See also rmadd2, which tests -j cases not involving branches
  8101. # (e.g. undoing a commit)
  8102. # See also join3, which tests some cases involving the greatest
  8103. # common ancestor. Here is a list of tests according to branch
  8104. # topology:
  8105. #
  8106. # --->bp---->trunk too many to mention
  8107. # \----->branch
  8108. #
  8109. # /----->branch1
  8110. # --->bp---->trunk multibranch, multibranch2
  8111. # \----->branch2
  8112. #
  8113. # --->bp1----->bp2---->trunk join3
  8114. # \->br1 \->br2
  8115. #
  8116. # --->bp1----->trunk
  8117. # \----bp2---->branch branches
  8118. # \------>branch-of-branch
  8119. # We check merging changes from T1 to T2 into the main line.
  8120. # Here are the interesting cases I can think of:
  8121. # 1) File added between T1 and T2, not on main line.
  8122. # File should be marked for addition.
  8123. # 2) File added between T1 and T2, also added on main line.
  8124. # Conflict.
  8125. # 3) File removed between T1 and T2, unchanged on main line.
  8126. # File should be marked for removal.
  8127. # 4) File removed between T1 and T2, modified on main line.
  8128. # If mod checked in, file should be marked for removal.
  8129. # If mod still in working directory, conflict.
  8130. # 5) File removed between T1 and T2, was never on main line.
  8131. # Nothing should happen.
  8132. # 6) File removed between T1 and T2, also removed on main line.
  8133. # Nothing should happen.
  8134. # 7) File not added between T1 and T2, added on main line.
  8135. # Nothing should happen.
  8136. # 8) File not modified between T1 and T2, removed on main line.
  8137. # Nothing should happen.
  8138. # 9) File modified between T1 and T2, removed on main line.
  8139. # Conflict.
  8140. # 10) File was never on branch, removed on main line.
  8141. # Nothing should happen.
  8142. # We also check merging changes from a branch into the main
  8143. # line. Here are the interesting cases:
  8144. # 1) File added on branch, not on main line.
  8145. # File should be marked for addition.
  8146. # 2) File added on branch, also added on main line.
  8147. # Conflict.
  8148. # 3) File removed on branch, unchanged on main line.
  8149. # File should be marked for removal.
  8150. # 4) File removed on branch, modified on main line.
  8151. # Conflict.
  8152. # 5) File removed on branch, was never on main line.
  8153. # Nothing should happen.
  8154. # 6) File removed on branch, also removed on main line.
  8155. # Nothing should happen.
  8156. # 7) File added on main line, not added on branch.
  8157. # Nothing should happen.
  8158. # 8) File removed on main line, not modified on branch.
  8159. # Nothing should happen.
  8160. # 9) File modified on branch, removed on main line.
  8161. # Conflict.
  8162. # 10) File was never on branch, removed on main line.
  8163. # Nothing should happen.
  8164. # In the tests below, fileN represents case N in the above
  8165. # lists.
  8166. mkdir ${CVSROOT_DIRNAME}/first-dir
  8167. mkdir 1
  8168. cd 1
  8169. dotest join-1 "${testcvs} -q co first-dir" ''
  8170. cd first-dir
  8171. # Add two files.
  8172. echo 'first revision of file3' > file3
  8173. echo 'first revision of file4' > file4
  8174. echo 'first revision of file6' > file6
  8175. echo 'first revision of file8' > file8
  8176. echo 'first revision of file9' > file9
  8177. dotest join-2 "${testcvs} add file3 file4 file6 file8 file9" \
  8178. "${PROG}"' add: scheduling file `file3'\'' for addition
  8179. '"${PROG}"' add: scheduling file `file4'\'' for addition
  8180. '"${PROG}"' add: scheduling file `file6'\'' for addition
  8181. '"${PROG}"' add: scheduling file `file8'\'' for addition
  8182. '"${PROG}"' add: scheduling file `file9'\'' for addition
  8183. '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
  8184. dotest join-3 "${testcvs} -q commit -m add" \
  8185. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
  8186. done
  8187. Checking in file3;
  8188. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  8189. initial revision: 1\.1
  8190. done
  8191. RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
  8192. done
  8193. Checking in file4;
  8194. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  8195. initial revision: 1\.1
  8196. done
  8197. RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
  8198. done
  8199. Checking in file6;
  8200. ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
  8201. initial revision: 1\.1
  8202. done
  8203. RCS file: ${CVSROOT_DIRNAME}/first-dir/file8,v
  8204. done
  8205. Checking in file8;
  8206. ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
  8207. initial revision: 1\.1
  8208. done
  8209. RCS file: ${CVSROOT_DIRNAME}/first-dir/file9,v
  8210. done
  8211. Checking in file9;
  8212. ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
  8213. initial revision: 1\.1
  8214. done"
  8215. # Make a branch.
  8216. dotest join-4 "${testcvs} -q tag -b branch ." \
  8217. 'T file3
  8218. T file4
  8219. T file6
  8220. T file8
  8221. T file9'
  8222. # Add file2, file7, and file10, modify file4, and remove
  8223. # file6, file8, and file9.
  8224. echo 'first revision of file2' > file2
  8225. echo 'second revision of file4' > file4
  8226. echo 'first revision of file7' > file7
  8227. rm file6 file8 file9
  8228. echo 'first revision of file10' > file10
  8229. dotest join-5 "${testcvs} add file2 file7 file10" \
  8230. "${PROG}"' add: scheduling file `file2'\'' for addition
  8231. '"${PROG}"' add: scheduling file `file7'\'' for addition
  8232. '"${PROG}"' add: scheduling file `file10'\'' for addition
  8233. '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
  8234. dotest join-6 "${testcvs} rm file6 file8 file9" \
  8235. "${PROG}"' remove: scheduling `file6'\'' for removal
  8236. '"${PROG}"' remove: scheduling `file8'\'' for removal
  8237. '"${PROG}"' remove: scheduling `file9'\'' for removal
  8238. '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
  8239. dotest join-7 "${testcvs} -q ci -mx ." \
  8240. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
  8241. done
  8242. Checking in file10;
  8243. ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
  8244. initial revision: 1\.1
  8245. done
  8246. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  8247. done
  8248. Checking in file2;
  8249. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  8250. initial revision: 1\.1
  8251. done
  8252. Checking in file4;
  8253. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  8254. new revision: 1\.2; previous revision: 1\.1
  8255. done
  8256. Removing file6;
  8257. ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
  8258. new revision: delete; previous revision: 1\.1
  8259. done
  8260. RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
  8261. done
  8262. Checking in file7;
  8263. ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
  8264. initial revision: 1\.1
  8265. done
  8266. Removing file8;
  8267. ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
  8268. new revision: delete; previous revision: 1\.1
  8269. done
  8270. Removing file9;
  8271. ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
  8272. new revision: delete; previous revision: 1\.1
  8273. done"
  8274. # Remove file10
  8275. dotest join-7a "${testcvs} rm -f file10" \
  8276. "${PROG}"' remove: scheduling `file10'\'' for removal
  8277. '"${PROG}"' remove: use .'"${PROG}"' commit. to remove this file permanently'
  8278. dotest join-7b "${testcvs} -q ci -mx ." \
  8279. "Removing file10;
  8280. ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
  8281. new revision: delete; previous revision: 1\.1
  8282. done"
  8283. # Check out the branch.
  8284. cd ../..
  8285. mkdir 2
  8286. cd 2
  8287. dotest join-8 "${testcvs} -q co -r branch first-dir" \
  8288. 'U first-dir/file3
  8289. U first-dir/file4
  8290. U first-dir/file6
  8291. U first-dir/file8
  8292. U first-dir/file9'
  8293. cd first-dir
  8294. # Modify the files on the branch, so that T1 is not an
  8295. # ancestor of the main line, and add file5
  8296. echo 'first branch revision of file3' > file3
  8297. echo 'first branch revision of file4' > file4
  8298. echo 'first branch revision of file5' > file5
  8299. echo 'first branch revision of file6' > file6
  8300. echo 'first branch revision of file9' > file9
  8301. dotest join-9 "${testcvs} add file5" \
  8302. "${PROG}"' add: scheduling file `file5'\'' for addition on branch `branch'\''
  8303. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  8304. dotest join-10 "${testcvs} -q ci -mx ." \
  8305. "Checking in file3;
  8306. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  8307. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8308. done
  8309. Checking in file4;
  8310. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  8311. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8312. done
  8313. RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v
  8314. done
  8315. Checking in file5;
  8316. ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
  8317. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8318. done
  8319. Checking in file6;
  8320. ${CVSROOT_DIRNAME}/first-dir/Attic/file6,v <-- file6
  8321. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8322. done
  8323. Checking in file9;
  8324. ${CVSROOT_DIRNAME}/first-dir/Attic/file9,v <-- file9
  8325. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8326. done"
  8327. # Tag the current revisions on the branch.
  8328. dotest join-11 "${testcvs} -q tag T1 ." \
  8329. 'T file3
  8330. T file4
  8331. T file5
  8332. T file6
  8333. T file8
  8334. T file9'
  8335. # Add file1 and file2, modify file9, and remove the other files.
  8336. echo 'first branch revision of file1' > file1
  8337. echo 'first branch revision of file2' > file2
  8338. echo 'second branch revision of file9' > file9
  8339. rm file3 file4 file5 file6
  8340. dotest join-12 "${testcvs} add file1 file2" \
  8341. "${PROG}"' add: scheduling file `file1'\'' for addition on branch `branch'\''
  8342. '"${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
  8343. '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
  8344. dotest join-13 "${testcvs} rm file3 file4 file5 file6" \
  8345. "${PROG}"' remove: scheduling `file3'\'' for removal
  8346. '"${PROG}"' remove: scheduling `file4'\'' for removal
  8347. '"${PROG}"' remove: scheduling `file5'\'' for removal
  8348. '"${PROG}"' remove: scheduling `file6'\'' for removal
  8349. '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
  8350. dotest join-14 "${testcvs} -q ci -mx ." \
  8351. "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
  8352. done
  8353. Checking in file1;
  8354. ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v <-- file1
  8355. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8356. done
  8357. Checking in file2;
  8358. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  8359. new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
  8360. done
  8361. Removing file3;
  8362. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  8363. new revision: delete; previous revision: 1\.1\.2\.1
  8364. done
  8365. Removing file4;
  8366. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  8367. new revision: delete; previous revision: 1\.1\.2\.1
  8368. done
  8369. Removing file5;
  8370. ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
  8371. new revision: delete; previous revision: 1\.1\.2\.1
  8372. done
  8373. Removing file6;
  8374. ${CVSROOT_DIRNAME}/first-dir/Attic/file6,v <-- file6
  8375. new revision: delete; previous revision: 1\.1\.2\.1
  8376. done
  8377. Checking in file9;
  8378. ${CVSROOT_DIRNAME}/first-dir/Attic/file9,v <-- file9
  8379. new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
  8380. done"
  8381. # Tag the current revisions on the branch.
  8382. dotest join-15 "${testcvs} -q tag T2 ." \
  8383. 'T file1
  8384. T file2
  8385. T file8
  8386. T file9'
  8387. # Do a checkout with a merge.
  8388. cd ../..
  8389. mkdir 3
  8390. cd 3
  8391. dotest join-16 "$testcvs -q co -jT1 -jT2 first-dir" \
  8392. "U first-dir/file1
  8393. U first-dir/file2
  8394. $PROG checkout: file first-dir/file2 exists, but has been added in revision T2
  8395. U first-dir/file3
  8396. $PROG checkout: scheduling first-dir/file3 for removal
  8397. U first-dir/file4
  8398. $PROG checkout: file first-dir/file4 has been removed in revision T2, but the destination is incompatibly modified
  8399. C first-dir/file4
  8400. U first-dir/file7
  8401. $PROG checkout: file first-dir/file9 does not exist, but is present in revision T2"
  8402. # Verify that the right changes have been scheduled.
  8403. cd first-dir
  8404. dotest_fail join-17 "$testcvs -q update" \
  8405. 'A file1
  8406. R file3
  8407. C file4'
  8408. # Modify file4 locally, and do an update with a merge.
  8409. cd ../../1/first-dir
  8410. echo 'third revision of file4' > file4
  8411. dotest join-18 "$testcvs -q update -jT1 -jT2 ." \
  8412. "U file1
  8413. $PROG update: file file2 exists, but has been added in revision T2
  8414. $PROG update: scheduling file3 for removal
  8415. M file4
  8416. $PROG update: file file4 has been removed in revision T2, but the destination is incompatibly modified
  8417. C file4
  8418. $PROG update: file file9 does not exist, but is present in revision T2"
  8419. # Verify that the right changes have been scheduled.
  8420. dotest_fail join-19 "$testcvs -q update" \
  8421. 'A file1
  8422. R file3
  8423. C file4'
  8424. # Do a checkout with a merge from a single revision.
  8425. # FIXME: CVS currently gets this wrong. file2 has been
  8426. # added on both the branch and the main line, and so should
  8427. # be regarded as a conflict. However, given the way that
  8428. # CVS sets up the RCS file, there is no way to distinguish
  8429. # this case from the case of file2 having existed before the
  8430. # branch was made. This could be fixed by reserving
  8431. # a revision somewhere, perhaps 1.1, as an always dead
  8432. # revision which can be used as the source for files added
  8433. # on branches.
  8434. cd ../../3
  8435. rm -r first-dir
  8436. dotest join-20 "$testcvs -q co -jbranch first-dir" \
  8437. "U first-dir/file1
  8438. U first-dir/file2
  8439. RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
  8440. retrieving revision 1\.1
  8441. retrieving revision 1\.1\.2\.2
  8442. Merging differences between 1\.1 and 1\.1\.2\.2 into file2
  8443. U first-dir/file3
  8444. $PROG checkout: scheduling first-dir/file3 for removal
  8445. U first-dir/file4
  8446. $PROG checkout: file first-dir/file4 has been removed in revision branch, but the destination is incompatibly modified
  8447. C first-dir/file4
  8448. U first-dir/file7
  8449. $PROG checkout: file first-dir/file9 does not exist, but is present in revision branch"
  8450. # Verify that the right changes have been scheduled.
  8451. # The M file2 line is a bug; see above join-20.
  8452. cd first-dir
  8453. dotest_fail join-21 "$testcvs -q update" \
  8454. 'A file1
  8455. M file2
  8456. R file3
  8457. C file4'
  8458. # Checkout the main line again.
  8459. cd ../../1
  8460. rm -r first-dir
  8461. dotest join-22 "${testcvs} -q co first-dir" \
  8462. 'U first-dir/file2
  8463. U first-dir/file3
  8464. U first-dir/file4
  8465. U first-dir/file7'
  8466. # Modify file4 locally, and do an update with a merge from a
  8467. # single revision.
  8468. # The file2 handling is a bug; see above join-20.
  8469. cd first-dir
  8470. echo 'third revision of file4' > file4
  8471. dotest join-23 "$testcvs -q update -jbranch ." \
  8472. "U file1
  8473. RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
  8474. retrieving revision 1\.1
  8475. retrieving revision 1\.1\.2\.2
  8476. Merging differences between 1\.1 and 1\.1\.2\.2 into file2
  8477. $PROG update: scheduling file3 for removal
  8478. M file4
  8479. $PROG update: file file4 has been removed in revision branch, but the destination is incompatibly modified
  8480. C file4
  8481. $PROG update: file file9 does not exist, but is present in revision branch"
  8482. # Verify that the right changes have been scheduled.
  8483. # The M file2 line is a bug; see above join-20
  8484. dotest_fail join-24 "$testcvs -q update" \
  8485. 'A file1
  8486. M file2
  8487. R file3
  8488. C file4'
  8489. cd ..
  8490. # Checkout the main line again and make a new branch which we
  8491. # merge to.
  8492. rm -r first-dir
  8493. dotest join-25 "${testcvs} -q co first-dir" \
  8494. 'U first-dir/file2
  8495. U first-dir/file3
  8496. U first-dir/file4
  8497. U first-dir/file7'
  8498. cd first-dir
  8499. dotest join-26 "${testcvs} -q tag -b br2" \
  8500. "T file2
  8501. T file3
  8502. T file4
  8503. T file7"
  8504. dotest join-27 "$testcvs -q update -r br2" \
  8505. '[UP] file2
  8506. [UP] file3
  8507. [UP] file4
  8508. [UP] file7'
  8509. # The handling of file8 and file9 here look fishy to me. I don't
  8510. # see why it should be different from the case where we merge to
  8511. # the trunk (e.g. join-23).
  8512. dotest join-28 "$testcvs -q update -j branch" \
  8513. "U file1
  8514. RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
  8515. retrieving revision 1\.1
  8516. retrieving revision 1\.1\.2\.2
  8517. Merging differences between 1\.1 and 1\.1\.2\.2 into file2
  8518. $PROG update: scheduling file3 for removal
  8519. $PROG update: file file4 has been removed in revision branch, but the destination is incompatibly modified
  8520. C file4
  8521. U file8
  8522. U file9"
  8523. # Verify that the right changes have been scheduled.
  8524. dotest_fail join-29 "$testcvs -q update" \
  8525. "A file1
  8526. M file2
  8527. R file3
  8528. C file4
  8529. A file8
  8530. A file9"
  8531. # Checkout the mainline again to try updating and merging between two
  8532. # branches in the same step
  8533. # this seems a likely scenario - the user finishes up on branch and
  8534. # updates to br2 and merges in the same step - and there was a bug
  8535. # once that if the file was removed in the update then it wouldn't be
  8536. # readded in the merge
  8537. cd ..
  8538. rm -rf first-dir
  8539. dotest join-twobranch-1 "${testcvs} -q co -rbranch first-dir" \
  8540. 'U first-dir/file1
  8541. U first-dir/file2
  8542. U first-dir/file8
  8543. U first-dir/file9'
  8544. cd first-dir
  8545. dotest join-twobranch-2 "$testcvs -q update -rbr2 -jbranch" \
  8546. "$PROG update: file1 is no longer in the repository
  8547. U file1
  8548. U file2
  8549. RCS file: $CVSROOT_DIRNAME/first-dir/file2,v
  8550. retrieving revision 1\.1
  8551. retrieving revision 1\.1\.2\.2
  8552. Merging differences between 1\.1 and 1\.1\.2\.2 into file2
  8553. U file3
  8554. $PROG update: scheduling file3 for removal
  8555. U file4
  8556. $PROG update: file file4 has been removed in revision branch, but the destination is incompatibly modified
  8557. C file4
  8558. U file7
  8559. $PROG update: file8 is no longer in the repository
  8560. U file8
  8561. $PROG update: file9 is no longer in the repository
  8562. U file9"
  8563. # Verify that the right changes have been scheduled.
  8564. dotest_fail join-twobranch-3 "$testcvs -q update" \
  8565. "A file1
  8566. M file2
  8567. R file3
  8568. C file4
  8569. A file8
  8570. A file9"
  8571. # Checkout the mainline again to try merging from the trunk
  8572. # to a branch.
  8573. cd ..
  8574. rm -r first-dir
  8575. dotest join-30 "${testcvs} -q co first-dir" \
  8576. 'U first-dir/file2
  8577. U first-dir/file3
  8578. U first-dir/file4
  8579. U first-dir/file7'
  8580. cd first-dir
  8581. # Tag the current revisions on the trunk.
  8582. dotest join-31 "${testcvs} -q tag T3 ." \
  8583. 'T file2
  8584. T file3
  8585. T file4
  8586. T file7'
  8587. # Modify file7.
  8588. echo 'second revision of file7' > file7
  8589. dotest join-32 "${testcvs} -q ci -mx ." \
  8590. "Checking in file7;
  8591. ${CVSROOT_DIRNAME}/first-dir/file7,v <-- file7
  8592. new revision: 1\.2; previous revision: 1\.1
  8593. done"
  8594. # And Tag again.
  8595. dotest join-33 "${testcvs} -q tag T4 ." \
  8596. 'T file2
  8597. T file3
  8598. T file4
  8599. T file7'
  8600. # Now update branch to T3.
  8601. cd ../../2/first-dir
  8602. dotest join-34 "${testcvs} -q up -jT3" \
  8603. "${PROG} update: file file4 does not exist, but is present in revision T3
  8604. U file7"
  8605. # Verify that the right changes have been scheduled.
  8606. dotest join-35 "${testcvs} -q update" \
  8607. 'A file7'
  8608. # Now update to T4.
  8609. # This is probably a bug, although in this particular case it just
  8610. # happens to do the right thing; see above join-20.
  8611. dotest join-36 "${testcvs} -q up -j T3 -j T4" \
  8612. "A file7
  8613. RCS file: ${CVSROOT_DIRNAME}/first-dir/file7,v
  8614. retrieving revision 1\.1
  8615. retrieving revision 1\.2
  8616. Merging differences between 1\.1 and 1\.2 into file7"
  8617. # Verify that the right changes have been scheduled.
  8618. dotest join-37 "${testcvs} -q update" \
  8619. 'A file7'
  8620. cd ../..
  8621. rm -r 1 2 3
  8622. rm -rf ${CVSROOT_DIRNAME}/first-dir
  8623. ;;
  8624. join2)
  8625. # More joining tests.
  8626. # First the usual setup; create a directory first-dir, a file
  8627. # first-dir/file1, and a branch br1.
  8628. mkdir 1; cd 1
  8629. dotest join2-1 "${testcvs} -q co -l ." ''
  8630. mkdir first-dir
  8631. dotest join2-2 "${testcvs} add first-dir" \
  8632. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  8633. cd first-dir
  8634. echo 'initial contents of file1' >file1
  8635. dotest join2-3 "${testcvs} add file1" \
  8636. "${PROG} add: scheduling file .file1. for addition
  8637. ${PROG} add: use .${PROG} commit. to add this file permanently"
  8638. dotest join2-4 "${testcvs} -q ci -m add" \
  8639. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  8640. done
  8641. Checking in file1;
  8642. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  8643. initial revision: 1\.1
  8644. done"
  8645. dotest join2-5 "${testcvs} -q tag -b br1" "T file1"
  8646. dotest join2-6 "$testcvs -q update -r br1" '[UP] file1'
  8647. echo 'modify on branch' >>file1
  8648. touch bradd
  8649. dotest join2-6a "${testcvs} add bradd" \
  8650. "${PROG} add: scheduling file .bradd. for addition on branch .br1.
  8651. ${PROG} add: use .${PROG} commit. to add this file permanently"
  8652. dotest join2-7 "${testcvs} -q ci -m modify" \
  8653. "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
  8654. done
  8655. Checking in bradd;
  8656. ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v <-- bradd
  8657. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8658. done
  8659. Checking in file1;
  8660. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  8661. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8662. done"
  8663. # Here is the unusual/pathological part. We switch back to
  8664. # the trunk *for file1 only*, not for the whole directory.
  8665. dotest join2-8 "${testcvs} -q update -A file1" '[UP] file1'
  8666. dotest join2-9 "${testcvs} -q status file1" \
  8667. "===================================================================
  8668. File: file1 Status: Up-to-date
  8669. Working revision: 1\.1.*
  8670. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
  8671. Sticky Tag: (none)
  8672. Sticky Date: (none)
  8673. Sticky Options: (none)"
  8674. dotest join2-10 "cat CVS/Tag" "Tbr1"
  8675. dotest join2-11 "${testcvs} -q update -j br1 file1" \
  8676. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  8677. retrieving revision 1\.1
  8678. retrieving revision 1\.1\.2\.1
  8679. Merging differences between 1\.1 and 1\.1\.2\.1 into file1"
  8680. dotest join2-12 "cat file1" "initial contents of file1
  8681. modify on branch"
  8682. # We should have no sticky tag on file1
  8683. dotest join2-13 "${testcvs} -q status file1" \
  8684. "===================================================================
  8685. File: file1 Status: Locally Modified
  8686. Working revision: 1\.1.*
  8687. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
  8688. Sticky Tag: (none)
  8689. Sticky Date: (none)
  8690. Sticky Options: (none)"
  8691. dotest join2-14 "cat CVS/Tag" "Tbr1"
  8692. # And the checkin should go to the trunk
  8693. dotest join2-15 "${testcvs} -q ci -m modify file1" \
  8694. "Checking in file1;
  8695. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  8696. new revision: 1\.2; previous revision: 1\.1
  8697. done"
  8698. # OK, the above is all well and good and has worked for some
  8699. # time. Now try the case where the file had been added on
  8700. # the branch.
  8701. dotest join2-16 "${testcvs} -q update -r br1" "[UP] file1"
  8702. # The workaround is to update the whole directory.
  8703. # The non-circumvented version won't work. The reason is that
  8704. # update removes the entry from CVS/Entries, so of course we get
  8705. # the tag from CVS/Tag and not Entries. I suppose maybe
  8706. # we could invent some new format in Entries which would handle
  8707. # this, but doing so, and handling it properly throughout
  8708. # CVS, would be a lot of work and I'm not sure this case justifies
  8709. # it.
  8710. dotest join2-17-circumvent "${testcvs} -q update -A" \
  8711. "${PROG} update: bradd is no longer in the repository
  8712. [UP] file1"
  8713. : dotest join2-17 "${testcvs} -q update -A bradd" \
  8714. "${PROG} update: warning: bradd is not (any longer) pertinent"
  8715. dotest join2-18 "${testcvs} -q update -j br1 bradd" "U bradd"
  8716. dotest join2-19 "${testcvs} -q status bradd" \
  8717. "===================================================================
  8718. File: bradd Status: Locally Added
  8719. Working revision: New file!
  8720. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/bradd,v
  8721. Sticky Tag: (none)
  8722. Sticky Date: (none)
  8723. Sticky Options: (none)"
  8724. dotest join2-20 "${testcvs} -q ci -m modify bradd" \
  8725. "Checking in bradd;
  8726. ${CVSROOT_DIRNAME}/first-dir/bradd,v <-- bradd
  8727. new revision: 1\.2; previous revision: 1\.1
  8728. done"
  8729. cd ../..
  8730. rm -r 1
  8731. rm -rf ${CVSROOT_DIRNAME}/first-dir
  8732. ;;
  8733. join3)
  8734. # See "join" for a list of other joining/branching tests.
  8735. # First the usual setup; create a directory first-dir, a file
  8736. # first-dir/file1, and a branch br1.
  8737. mkdir 1; cd 1
  8738. dotest join3-1 "${testcvs} -q co -l ." ''
  8739. mkdir first-dir
  8740. dotest join3-2 "${testcvs} add first-dir" \
  8741. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  8742. cd first-dir
  8743. echo 'initial contents of file1' >file1
  8744. dotest join3-3 "${testcvs} add file1" \
  8745. "${PROG} add: scheduling file .file1. for addition
  8746. ${PROG} add: use .${PROG} commit. to add this file permanently"
  8747. dotest join3-4 "${testcvs} -q ci -m add" \
  8748. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  8749. done
  8750. Checking in file1;
  8751. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  8752. initial revision: 1\.1
  8753. done"
  8754. dotest join3-5 "${testcvs} -q tag -b br1" "T file1"
  8755. dotest join3-6 "$testcvs -q update -r br1" '[UP] file1'
  8756. echo 'br1:line1' >>file1
  8757. dotest join3-7 "${testcvs} -q ci -m modify" \
  8758. "Checking in file1;
  8759. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  8760. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8761. done"
  8762. # Now back to the trunk for:
  8763. # another revision and another branch for file1.
  8764. # add file2, which will exist on trunk and br2 but not br1.
  8765. dotest join3-8 "${testcvs} -q update -A" "[UP] file1"
  8766. echo 'trunk:line1' > file2
  8767. dotest join3-8a "${testcvs} add file2" \
  8768. "${PROG} add: scheduling file .file2. for addition
  8769. ${PROG} add: use .${PROG} commit. to add this file permanently"
  8770. echo 'trunk:line1' >>file1
  8771. dotest join3-9 "${testcvs} -q ci -m modify" \
  8772. "Checking in file1;
  8773. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  8774. new revision: 1\.2; previous revision: 1\.1
  8775. done
  8776. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  8777. done
  8778. Checking in file2;
  8779. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  8780. initial revision: 1\.1
  8781. done"
  8782. dotest join3-10 "${testcvs} -q tag -b br2" "T file1
  8783. T file2"
  8784. # Before we actually have any revision on br2, let's try a join
  8785. dotest join3-11 "${testcvs} -q update -r br1" "[UP] file1
  8786. ${PROG} update: file2 is no longer in the repository"
  8787. dotest join3-12 "${testcvs} -q update -j br2" \
  8788. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  8789. retrieving revision 1\.1
  8790. retrieving revision 1\.2
  8791. Merging differences between 1\.1 and 1\.2 into file1
  8792. rcsmerge: warning: conflicts during merge
  8793. U file2"
  8794. dotest join3-13 "cat file1" \
  8795. "initial contents of file1
  8796. [<]<<<<<< file1
  8797. br1:line1
  8798. [=]======
  8799. trunk:line1
  8800. [>]>>>>>> 1\.2"
  8801. rm file1
  8802. # OK, we'll try the same thing with a revision on br2.
  8803. dotest join3-14 "${testcvs} -q update -r br2 file1" \
  8804. "${PROG} update: warning: file1 was lost
  8805. U file1" "U file1"
  8806. echo 'br2:line1' >>file1
  8807. dotest join3-15 "${testcvs} -q ci -m modify file1" \
  8808. "Checking in file1;
  8809. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  8810. new revision: 1\.2\.2\.1; previous revision: 1\.2
  8811. done"
  8812. # OK, now we can join br2 to br1
  8813. dotest join3-16 "${testcvs} -q update -r br1 file1" "[UP] file1"
  8814. # It may seem odd, to merge a higher branch into a lower
  8815. # branch, but in fact CVS defines the ancestor as 1.1
  8816. # and so it merges both the 1.1->1.2 and 1.2->1.2.2.1 changes.
  8817. # This seems like a reasonably plausible behavior.
  8818. dotest join3-17 "${testcvs} -q update -j br2 file1" \
  8819. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  8820. retrieving revision 1\.1
  8821. retrieving revision 1\.2\.2\.1
  8822. Merging differences between 1\.1 and 1\.2\.2\.1 into file1
  8823. rcsmerge: warning: conflicts during merge"
  8824. dotest join3-18 "cat file1" \
  8825. "initial contents of file1
  8826. [<]<<<<<< file1
  8827. br1:line1
  8828. [=]======
  8829. trunk:line1
  8830. br2:line1
  8831. [>]>>>>>> 1\.2\.2\.1"
  8832. cd ../..
  8833. rm -r 1
  8834. rm -rf ${CVSROOT_DIRNAME}/first-dir
  8835. ;;
  8836. join4)
  8837. # Like join, but with local (uncommitted) modifications.
  8838. mkdir ${CVSROOT_DIRNAME}/first-dir
  8839. mkdir 1
  8840. cd 1
  8841. dotest join4-1 "${testcvs} -q co first-dir" ''
  8842. cd first-dir
  8843. # Add two files.
  8844. echo 'first revision of file3' > file3
  8845. echo 'first revision of file4' > file4
  8846. echo 'first revision of file6' > file6
  8847. echo 'first revision of file8' > file8
  8848. echo 'first revision of file9' > file9
  8849. dotest join4-2 "${testcvs} add file3 file4 file6 file8 file9" \
  8850. "${PROG}"' add: scheduling file `file3'\'' for addition
  8851. '"${PROG}"' add: scheduling file `file4'\'' for addition
  8852. '"${PROG}"' add: scheduling file `file6'\'' for addition
  8853. '"${PROG}"' add: scheduling file `file8'\'' for addition
  8854. '"${PROG}"' add: scheduling file `file9'\'' for addition
  8855. '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
  8856. dotest join4-3 "${testcvs} -q commit -m add" \
  8857. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file3,v
  8858. done
  8859. Checking in file3;
  8860. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  8861. initial revision: 1\.1
  8862. done
  8863. RCS file: ${CVSROOT_DIRNAME}/first-dir/file4,v
  8864. done
  8865. Checking in file4;
  8866. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  8867. initial revision: 1\.1
  8868. done
  8869. RCS file: ${CVSROOT_DIRNAME}/first-dir/file6,v
  8870. done
  8871. Checking in file6;
  8872. ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
  8873. initial revision: 1\.1
  8874. done
  8875. RCS file: ${CVSROOT_DIRNAME}/first-dir/file8,v
  8876. done
  8877. Checking in file8;
  8878. ${CVSROOT_DIRNAME}/first-dir/file8,v <-- file8
  8879. initial revision: 1\.1
  8880. done
  8881. RCS file: ${CVSROOT_DIRNAME}/first-dir/file9,v
  8882. done
  8883. Checking in file9;
  8884. ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
  8885. initial revision: 1\.1
  8886. done"
  8887. # Make a branch.
  8888. dotest join4-4 "${testcvs} -q tag -b branch ." \
  8889. 'T file3
  8890. T file4
  8891. T file6
  8892. T file8
  8893. T file9'
  8894. # Add file10
  8895. echo 'first revision of file10' > file10
  8896. dotest join4-7a "${testcvs} add file10" \
  8897. "${PROG}"' add: scheduling file `file10'\'' for addition
  8898. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  8899. dotest join4-7b "${testcvs} -q ci -mx ." \
  8900. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file10,v
  8901. done
  8902. Checking in file10;
  8903. ${CVSROOT_DIRNAME}/first-dir/file10,v <-- file10
  8904. initial revision: 1\.1
  8905. done"
  8906. # Add file2 and file7, modify file4, and remove
  8907. # file6, file8, file9, and file10.
  8908. echo 'first revision of file2' > file2
  8909. echo 'second revision of file4' > file4
  8910. echo 'first revision of file7' > file7
  8911. rm file6 file8 file9 file10
  8912. dotest join4-5 "${testcvs} add file2 file7" \
  8913. "${PROG}"' add: scheduling file `file2'\'' for addition
  8914. '"${PROG}"' add: scheduling file `file7'\'' for addition
  8915. '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
  8916. dotest join4-6 "${testcvs} rm file6 file8 file9 file10" \
  8917. "${PROG}"' remove: scheduling `file6'\'' for removal
  8918. '"${PROG}"' remove: scheduling `file8'\'' for removal
  8919. '"${PROG}"' remove: scheduling `file9'\'' for removal
  8920. '"${PROG}"' remove: scheduling `file10'\'' for removal
  8921. '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
  8922. # Check out the branch.
  8923. cd ../..
  8924. mkdir 2
  8925. cd 2
  8926. dotest join4-8 "${testcvs} -q co -r branch first-dir" \
  8927. 'U first-dir/file3
  8928. U first-dir/file4
  8929. U first-dir/file6
  8930. U first-dir/file8
  8931. U first-dir/file9'
  8932. cd first-dir
  8933. # Modify the files on the branch, so that T1 is not an
  8934. # ancestor of the main line, and add file5
  8935. echo 'first branch revision of file3' > file3
  8936. echo 'first branch revision of file4' > file4
  8937. echo 'first branch revision of file5' > file5
  8938. echo 'first branch revision of file6' > file6
  8939. echo 'first branch revision of file9' > file9
  8940. dotest join4-9 "${testcvs} add file5" \
  8941. "${PROG}"' add: scheduling file `file5'\'' for addition on branch `branch'\''
  8942. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  8943. dotest join4-10 "${testcvs} -q ci -mx ." \
  8944. "Checking in file3;
  8945. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  8946. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8947. done
  8948. Checking in file4;
  8949. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  8950. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8951. done
  8952. RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v
  8953. done
  8954. Checking in file5;
  8955. ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
  8956. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8957. done
  8958. Checking in file6;
  8959. ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
  8960. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8961. done
  8962. Checking in file9;
  8963. ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
  8964. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8965. done"
  8966. # Tag the current revisions on the branch.
  8967. dotest join4-11 "${testcvs} -q tag T1 ." \
  8968. 'T file3
  8969. T file4
  8970. T file5
  8971. T file6
  8972. T file8
  8973. T file9'
  8974. # Add file1 and file2, modify file9, and remove the other files.
  8975. echo 'first branch revision of file1' > file1
  8976. echo 'first branch revision of file2' > file2
  8977. echo 'second branch revision of file9' > file9
  8978. rm file3 file4 file5 file6
  8979. dotest join4-12 "${testcvs} add file1 file2" \
  8980. "${PROG}"' add: scheduling file `file1'\'' for addition on branch `branch'\''
  8981. '"${PROG}"' add: scheduling file `file2'\'' for addition on branch `branch'\''
  8982. '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
  8983. dotest join4-13 "${testcvs} rm file3 file4 file5 file6" \
  8984. "${PROG}"' remove: scheduling `file3'\'' for removal
  8985. '"${PROG}"' remove: scheduling `file4'\'' for removal
  8986. '"${PROG}"' remove: scheduling `file5'\'' for removal
  8987. '"${PROG}"' remove: scheduling `file6'\'' for removal
  8988. '"${PROG}"' remove: use .'"${PROG}"' commit. to remove these files permanently'
  8989. dotest join4-14 "${testcvs} -q ci -mx ." \
  8990. "RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v
  8991. done
  8992. Checking in file1;
  8993. ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v <-- file1
  8994. new revision: 1\.1\.2\.1; previous revision: 1\.1
  8995. done
  8996. RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v
  8997. done
  8998. Checking in file2;
  8999. ${CVSROOT_DIRNAME}/first-dir/Attic/file2,v <-- file2
  9000. new revision: 1\.1\.2\.1; previous revision: 1\.1
  9001. done
  9002. Removing file3;
  9003. ${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
  9004. new revision: delete; previous revision: 1\.1\.2\.1
  9005. done
  9006. Removing file4;
  9007. ${CVSROOT_DIRNAME}/first-dir/file4,v <-- file4
  9008. new revision: delete; previous revision: 1\.1\.2\.1
  9009. done
  9010. Removing file5;
  9011. ${CVSROOT_DIRNAME}/first-dir/Attic/file5,v <-- file5
  9012. new revision: delete; previous revision: 1\.1\.2\.1
  9013. done
  9014. Removing file6;
  9015. ${CVSROOT_DIRNAME}/first-dir/file6,v <-- file6
  9016. new revision: delete; previous revision: 1\.1\.2\.1
  9017. done
  9018. Checking in file9;
  9019. ${CVSROOT_DIRNAME}/first-dir/file9,v <-- file9
  9020. new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
  9021. done"
  9022. # Tag the current revisions on the branch.
  9023. dotest join4-15 "${testcvs} -q tag T2 ." \
  9024. 'T file1
  9025. T file2
  9026. T file8
  9027. T file9'
  9028. # Modify file4 locally, and do an update with a merge.
  9029. cd ../../1/first-dir
  9030. echo 'third revision of file4' > file4
  9031. dotest join4-18 "$testcvs -q update -jT1 -jT2 ." \
  9032. "U file1
  9033. R file10
  9034. A file2
  9035. $PROG update: file file2 exists, but has been added in revision T2
  9036. $PROG update: scheduling file3 for removal
  9037. M file4
  9038. $PROG update: file file4 has been removed in revision T2, but the destination is incompatibly modified
  9039. C file4
  9040. R file6
  9041. A file7
  9042. R file8
  9043. R file9
  9044. $PROG update: file file9 does not exist, but is present in revision T2"
  9045. # Verify that the right changes have been scheduled.
  9046. dotest_fail join4-19 "${testcvs} -q update" \
  9047. 'A file1
  9048. R file10
  9049. A file2
  9050. R file3
  9051. C file4
  9052. R file6
  9053. A file7
  9054. R file8
  9055. R file9'
  9056. cd ../..
  9057. rm -r 1 2
  9058. rm -rf ${CVSROOT_DIRNAME}/first-dir
  9059. ;;
  9060. join5)
  9061. # This test verifies that CVS can handle filenames starting with a
  9062. # dash (`-') properly. What used to happen was that CVS handled it
  9063. # just fine, until it went to pass them as arguments to the diff
  9064. # library, at which point it neglected to pass `--' before the file
  9065. # list, causing the diff library to attempt to interpret the file
  9066. # name as an argument.
  9067. mkdir join5; cd join5
  9068. mkdir 1; cd 1
  9069. dotest join5-init-1 "${testcvs} -Q co -l ."
  9070. mkdir join5
  9071. dotest join5-init-2 "${testcvs} -Q add join5"
  9072. cd join5
  9073. echo "there once was a file from harrisburg" >-file
  9074. echo "who's existance it seems was quiteabsurd" >>-file
  9075. dotest join5-init-3 "${testcvs} -Q add -- -file"
  9076. dotest join5-init-4 "${testcvs} -q ci -minitial" \
  9077. "RCS file: ${CVSROOT_DIRNAME}/join5/-file,v
  9078. done
  9079. Checking in -file;
  9080. ${CVSROOT_DIRNAME}/join5/-file,v <-- -file
  9081. initial revision: 1\.1
  9082. done"
  9083. cd ../..
  9084. mkdir 2; cd 2
  9085. dotest join5-init-5 "${testcvs} -Q co join5"
  9086. cd join5
  9087. echo "it tested for free" >>-file
  9088. echo "when paid it should be" >>-file
  9089. dotest join5-init-4 "${testcvs} -q ci -msecond" \
  9090. "Checking in -file;
  9091. ${CVSROOT_DIRNAME}/join5/-file,v <-- -file
  9092. new revision: 1\.2; previous revision: 1\.1
  9093. done"
  9094. cd ../..
  9095. cd 1/join5
  9096. echo "but maybe it could charge bytheword" >>-file
  9097. # This is the test that used to spew complaints from diff3:
  9098. dotest join5 "${testcvs} up" \
  9099. "${PROG} update: Updating \.
  9100. RCS file: ${CVSROOT_DIRNAME}/join5/-file,v
  9101. retrieving revision 1\.1
  9102. retrieving revision 1\.2
  9103. Merging differences between 1\.1 and 1\.2 into -file
  9104. rcsmerge: warning: conflicts during merge
  9105. ${PROG} update: conflicts found in -file
  9106. C -file"
  9107. cd ../..
  9108. if $keep; then
  9109. echo Keeping ${TESTDIR} and exiting due to --keep
  9110. exit 0
  9111. fi
  9112. cd ..
  9113. rm -r join5
  9114. rm -rf ${CVSROOT_DIRNAME}/join5
  9115. ;;
  9116. join6)
  9117. mkdir join6; cd join6
  9118. mkdir 1; cd 1
  9119. dotest join6-init-1 "${testcvs} -Q co -l ."
  9120. mkdir join6
  9121. dotest join6-init-2 "${testcvs} -Q add join6"
  9122. cd join6
  9123. echo aaa >temp.txt
  9124. echo bbb >>temp.txt
  9125. echo ccc >>temp.txt
  9126. dotest join6-1 "${testcvs} -Q add temp.txt"
  9127. dotest join6-2 "${testcvs} -q commit -minitial temp.txt" \
  9128. "RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
  9129. done
  9130. Checking in temp\.txt;
  9131. ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
  9132. initial revision: 1\.1
  9133. done"
  9134. cp temp.txt temp2.txt
  9135. echo ddd >>temp.txt
  9136. dotest join6-3 "${testcvs} -q commit -madd temp.txt" \
  9137. "Checking in temp\.txt;
  9138. ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
  9139. new revision: 1\.2; previous revision: 1\.1
  9140. done"
  9141. # The case where the merge target is up-to-date and its base revision
  9142. # matches the second argument to -j: CVS doesn't bother attempting
  9143. # the merge since it already knows that the target contains the
  9144. # change.
  9145. dotest join6-3.3 "${testcvs} update -j1.1 -j1.2 temp.txt" \
  9146. "temp\.txt already contains the differences between 1\.1 and 1\.2"
  9147. dotest join6-3.4 "${testcvs} diff temp.txt" ""
  9148. # The case where the merge target is modified but already contains
  9149. # the change.
  9150. echo bbb >temp.txt
  9151. echo ccc >>temp.txt
  9152. echo ddd >>temp.txt
  9153. dotest join6-3.5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
  9154. "M temp\.txt
  9155. RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
  9156. retrieving revision 1\.1
  9157. retrieving revision 1\.2
  9158. Merging differences between 1\.1 and 1\.2 into temp\.txt
  9159. temp\.txt already contains the differences between 1\.1 and 1\.2"
  9160. dotest_fail join6-3.6 "${testcvs} diff temp.txt" \
  9161. "Index: temp\.txt
  9162. ===================================================================
  9163. RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
  9164. retrieving revision 1\.2
  9165. diff -r1\.2 temp.txt
  9166. 1d0
  9167. < aaa"
  9168. cp temp2.txt temp.txt
  9169. dotest_fail join6-4 "${testcvs} diff temp.txt" \
  9170. "Index: temp.txt
  9171. ===================================================================
  9172. RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
  9173. retrieving revision 1\.2
  9174. diff -r1\.2 temp\.txt
  9175. 4d3
  9176. < ddd"
  9177. dotest join6-5 "${testcvs} update -j1.1 -j1.2 temp.txt" \
  9178. "M temp\.txt
  9179. RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
  9180. retrieving revision 1\.1
  9181. retrieving revision 1\.2
  9182. Merging differences between 1\.1 and 1\.2 into temp\.txt"
  9183. dotest join6-6 "${testcvs} diff temp.txt" ""
  9184. mv temp.txt temp3.txt
  9185. dotest join6-7 "sed 's/ddd/dddd/' < temp3.txt > temp.txt" ""
  9186. dotest join6-8 "${testcvs} update -j1.1 -j1.2 temp.txt" \
  9187. "M temp\.txt
  9188. RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
  9189. retrieving revision 1\.1
  9190. retrieving revision 1\.2
  9191. Merging differences between 1\.1 and 1\.2 into temp\.txt
  9192. rcsmerge: warning: conflicts during merge"
  9193. dotest_fail join6-9 "${testcvs} diff temp.txt" \
  9194. "Index: temp\.txt
  9195. ===================================================================
  9196. RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
  9197. retrieving revision 1\.2
  9198. diff -r1\.2 temp\.txt
  9199. 3a4,6
  9200. > <<<<<<< temp\.txt
  9201. > dddd
  9202. > =======
  9203. 4a8
  9204. > >>>>>>> 1\.2"
  9205. cp temp2.txt temp.txt
  9206. dotest join6-10 "${testcvs} -q ci -m del temp.txt" \
  9207. "Checking in temp\.txt;
  9208. ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
  9209. new revision: 1\.3; previous revision: 1\.2
  9210. done"
  9211. cp temp3.txt temp.txt
  9212. dotest_fail join6-11 "${testcvs} diff temp.txt" \
  9213. "Index: temp\.txt
  9214. ===================================================================
  9215. RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
  9216. retrieving revision 1\.3
  9217. diff -r1\.3 temp\.txt
  9218. 3a4
  9219. > ddd"
  9220. dotest join6-12 "${testcvs} update -j1.2 -j1.3 temp.txt" \
  9221. "M temp\.txt
  9222. RCS file: ${CVSROOT_DIRNAME}/join6/temp\.txt,v
  9223. retrieving revision 1\.2
  9224. retrieving revision 1\.3
  9225. Merging differences between 1\.2 and 1\.3 into temp\.txt"
  9226. dotest join6-13 "${testcvs} diff temp.txt" ""
  9227. # The case where the merge target wasn't created until after the
  9228. # first tag was applied
  9229. rm temp2.txt temp3.txt
  9230. dotest join6-20 "${testcvs} -q tag -r1.1 t1" \
  9231. "T temp.txt"
  9232. echo xxx >temp2.txt
  9233. dotest join6-21 "${testcvs} -Q add temp2.txt"
  9234. dotest join6-22 "${testcvs} -q ci -m." \
  9235. "RCS file: ${CVSROOT_DIRNAME}/join6/temp2.txt,v
  9236. done
  9237. Checking in temp2\.txt;
  9238. ${CVSROOT_DIRNAME}/join6/temp2\.txt,v <-- temp2\.txt
  9239. initial revision: 1\.1
  9240. done"
  9241. dotest join6-23 "${testcvs} -q tag t2" \
  9242. "T temp.txt
  9243. T temp2.txt"
  9244. echo xxx >>temp.txt
  9245. dotest join6-24 "${testcvs} -q ci -m." \
  9246. "Checking in temp\.txt;
  9247. ${CVSROOT_DIRNAME}/join6/temp.txt,v <-- temp\.txt
  9248. new revision: 1\.4; previous revision: 1\.3
  9249. done"
  9250. dotest join6-25 "${testcvs} -q up -jt1 -jt2" \
  9251. "RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
  9252. retrieving revision 1\.1
  9253. retrieving revision 1\.3
  9254. Merging differences between 1\.1 and 1\.3 into temp.txt
  9255. temp.txt already contains the differences between 1\.1 and 1\.3
  9256. temp2.txt already contains the differences between creation and 1\.1"
  9257. # Now for my next trick: delete the file, recreate it, and
  9258. # try to merge
  9259. dotest join6-30 "${testcvs} -q rm -f temp2.txt" \
  9260. "${PROG} remove: use .${PROG} commit. to remove this file permanently"
  9261. dotest join6-31 "${testcvs} -q ci -m. temp2.txt" \
  9262. "Removing temp2\.txt;
  9263. ${CVSROOT_DIRNAME}/join6/temp2\.txt,v <-- temp2\.txt
  9264. new revision: delete; previous revision: 1\.1
  9265. done"
  9266. echo new >temp2.txt
  9267. # FIXCVS: Local and remote really shouldn't be different and there
  9268. # really shouldn't be two different status lines for temp2.txt
  9269. if $remote; then
  9270. dotest_fail join6-32 "${testcvs} -q up -jt1 -jt2" \
  9271. "? temp2\.txt
  9272. RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
  9273. retrieving revision 1\.1
  9274. retrieving revision 1\.3
  9275. Merging differences between 1\.1 and 1\.3 into temp.txt
  9276. temp.txt already contains the differences between 1\.1 and 1\.3
  9277. ${PROG} update: move away \./temp2\.txt; it is in the way
  9278. C temp2\.txt"
  9279. else
  9280. dotest join6-32 "${testcvs} -q up -jt1 -jt2" \
  9281. "RCS file: ${CVSROOT_DIRNAME}/join6/temp.txt,v
  9282. retrieving revision 1\.1
  9283. retrieving revision 1\.3
  9284. Merging differences between 1\.1 and 1\.3 into temp.txt
  9285. temp.txt already contains the differences between 1\.1 and 1\.3
  9286. ${PROG} update: use .${PROG} add. to create an entry for temp2\.txt
  9287. U temp2\.txt
  9288. ? temp2\.txt"
  9289. fi
  9290. cd ../../..
  9291. if $keep; then
  9292. echo Keeping ${TESTDIR} and exiting due to --keep
  9293. exit 0
  9294. fi
  9295. rm -r join6
  9296. rm -rf ${CVSROOT_DIRNAME}/join6
  9297. ;;
  9298. join7)
  9299. # This test deals with joins that happen with the -n switch
  9300. mkdir join7; cd join7
  9301. mkdir impdir; cd impdir
  9302. echo aaa >temp.txt
  9303. echo bbb >>temp.txt
  9304. echo ccc >>temp.txt
  9305. dotest join7-1 \
  9306. "${testcvs} -Q import -minitial join7 vendor vers-1" \
  9307. ""
  9308. cd ..
  9309. dotest join7-2 "${testcvs} -Q co join7" ""
  9310. cd join7
  9311. echo ddd >> temp.txt
  9312. dotest join7-3 "${testcvs} -Q ci -madded-line temp.txt" \
  9313. "Checking in temp.txt;
  9314. $CVSROOT_DIRNAME/join7/temp.txt,v <-- temp.txt
  9315. new revision: 1\.2; previous revision: 1\.1
  9316. done"
  9317. cd ../impdir
  9318. echo aaaa >temp.txt
  9319. echo bbbb >>temp.txt
  9320. echo ccc >>temp.txt
  9321. echo eee >>temp.txt
  9322. dotest join7-4 \
  9323. "${testcvs} -Q import -minitial join7 vendor vers-2" \
  9324. ""
  9325. cd ../join7
  9326. dotest join7-5 \
  9327. "${testcvs} -n update -jvers-1 -jvers-2 temp.txt" \
  9328. "RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
  9329. retrieving revision 1\.1\.1\.1
  9330. retrieving revision 1\.1\.1\.2
  9331. Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
  9332. rcsmerge: warning: conflicts during merge"
  9333. touch temp.txt
  9334. dotest join7-6 "${testcvs} -n update -jvers-1 -jvers-2 temp.txt" \
  9335. "RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
  9336. retrieving revision 1\.1\.1\.1
  9337. retrieving revision 1\.1\.1\.2
  9338. Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
  9339. rcsmerge: warning: conflicts during merge" \
  9340. "RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
  9341. retrieving revision 1\.1\.1\.1
  9342. retrieving revision 1\.1\.1\.2
  9343. Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
  9344. rcsmerge: warning: conflicts during merge"
  9345. if $keep; then
  9346. echo Keeping ${TESTDIR} and exiting due to --keep
  9347. exit 0
  9348. fi
  9349. cd ../..
  9350. rm -r join7
  9351. rm -rf $CVSROOT_DIRNAME/join7
  9352. ;;
  9353. join8)
  9354. # In this test case, we have 2 projects, one called "pvcs" and one
  9355. # called "project". The "pvcs" project has modified the file, while
  9356. # the "project" project has caused a deletion. When "project" is
  9357. # merged into "pvcs", we expect CVS to detect a conflict.
  9358. mkdir join8; cd join8
  9359. mkdir combine
  9360. mkdir base
  9361. mkdir pvcs
  9362. mkdir project
  9363. echo "aaa" >base/file.txt
  9364. echo "bbb" >pvcs/file.txt
  9365. echo "ccc" >project/xxx.txt
  9366. cd base
  9367. dotest join8-1 \
  9368. "$testcvs import -b 1.1.101 -ko -m 'base import' join8 base base-1" \
  9369. "N join8/file\.txt
  9370. No conflicts created by this import"
  9371. cd ../pvcs
  9372. dotest join8-2 \
  9373. "$testcvs import -b 1.1.201 -ko -m 'pvcs import' join8 pvcs pvcs-1" \
  9374. "C join8/file\.txt
  9375. 1 conflicts created by this import.
  9376. Use the following command to help the merge:
  9377. $PROG checkout -j<prev_rel_tag> -jpvcs-1 join8"
  9378. cd ../project
  9379. dotest join8-3 \
  9380. "$testcvs import -b 1.1.301 -ko -m 'project import' join8 project project-1" \
  9381. "N join8/xxx\.txt
  9382. No conflicts created by this import"
  9383. cd ..
  9384. dotest join8-4 \
  9385. "$testcvs checkout -r pvcs-1 -j base-1 -j project-1 -d combine join8" \
  9386. "$PROG checkout: Updating combine
  9387. U combine/file\.txt
  9388. $PROG checkout: file combine/file\.txt has been removed in revision project-1, but the destination is incompatibly modified
  9389. C combine/file.txt
  9390. U combine/xxx\.txt"
  9391. dotest join8-5 \
  9392. "$testcvs -Q up -pr base-1 combine/file.txt >combine/file.txt"
  9393. dotest join8-6 \
  9394. "$testcvs up -j base-1 -j project-1 combine" \
  9395. "$PROG update: Updating combine
  9396. M combine/file\.txt
  9397. $PROG update: scheduling combine/file\.txt for removal
  9398. A combine/xxx\.txt
  9399. $PROG update: file combine/xxx\.txt exists, but has been added in revision project-1"
  9400. cd ..
  9401. if $keep; then
  9402. echo Keeping $TESTDIR and exiting due to --keep
  9403. exit 0
  9404. fi
  9405. rm -r join8
  9406. rm -rf $CVSROOT_DIRNAME/join8
  9407. ;;
  9408. join9)
  9409. # In this test case, we have 2 projects, one called "pvcs" and one
  9410. # called "project". The "pvcs" project has not modified the file,
  9411. # while the "project" project has caused a deletion. When "project"
  9412. # is merged into "pvcs", we expect CVS to remove the file without
  9413. # fuss, as there is no conflict.
  9414. mkdir join9; cd join9
  9415. mkdir combine
  9416. mkdir base
  9417. mkdir pvcs
  9418. mkdir project
  9419. echo "aaa" >base/file.txt
  9420. echo "aaa" >pvcs/file.txt
  9421. echo "ccc" >project/xxx.txt
  9422. cd base
  9423. dotest join9-1 \
  9424. "$testcvs import -b 1.1.101 -ko -m 'base import' join9 base base-1" \
  9425. "N join9/file\.txt
  9426. No conflicts created by this import"
  9427. cd ../pvcs
  9428. dotest join9-2 \
  9429. "$testcvs import -b 1.1.201 -ko -m 'pvcs import' join9 pvcs pvcs-1" \
  9430. "C join9/file\.txt
  9431. 1 conflicts created by this import.
  9432. Use the following command to help the merge:
  9433. $PROG checkout -j<prev_rel_tag> -jpvcs-1 join9"
  9434. cd ../project
  9435. dotest join9-3 \
  9436. "$testcvs import -b 1.1.301 -ko -m 'project import' join9 project project-1" \
  9437. "N join9/xxx\.txt
  9438. No conflicts created by this import"
  9439. cd ..
  9440. dotest join9-4 \
  9441. "$testcvs checkout -r pvcs-1 -j base-1 -j project-1 -d combine join9" \
  9442. "$PROG checkout: Updating combine
  9443. U combine/file\.txt
  9444. $PROG checkout: scheduling combine/file\.txt for removal
  9445. U combine/xxx\.txt"
  9446. cd ..
  9447. if $keep; then
  9448. echo Keeping $TESTDIR and exiting due to --keep
  9449. exit 0
  9450. fi
  9451. rm -r join9
  9452. rm -rf $CVSROOT_DIRNAME/join9
  9453. ;;
  9454. join-readonly-conflict)
  9455. # Previously, only tests 1 & 11 were being tested. I added the
  9456. # intermediate dotest's to try and diagnose a different failure
  9457. #
  9458. # Demonstrate that cvs-1.9.29 can fail on 2nd and subsequent
  9459. # conflict-evoking join attempts.
  9460. # Even with that version of CVS, This test failed only in
  9461. # client-server mode, and would have been noticed in normal
  9462. # operation only for files that were read-only (either due to
  9463. # use of cvs' global -r option, setting the CVSREAD envvar,
  9464. # or use of watch lists).
  9465. mkdir join-readonly-conflict; cd join-readonly-conflict
  9466. dotest join-readonly-conflict-1 "$testcvs -q co -l ." ''
  9467. module=join-readonly-conflict
  9468. mkdir $module
  9469. $testcvs -q add $module >>$LOGFILE 2>&1
  9470. cd $module
  9471. file=m
  9472. echo trunk > $file
  9473. dotest join-readonly-conflict-2 "$testcvs -Q add $file" ''
  9474. dotest join-readonly-conflict-3 "$testcvs -q ci -m . $file" \
  9475. "RCS file: $CVSROOT_DIRNAME/$module/$file,v
  9476. done
  9477. Checking in $file;
  9478. $CVSROOT_DIRNAME/$module/$file,v <-- $file
  9479. initial revision: 1\.1
  9480. done"
  9481. dotest join-readonly-conflict-4 "$testcvs tag -b B $file" "T $file"
  9482. dotest join-readonly-conflict-5 "$testcvs -q update -rB $file" \
  9483. "[UP] $file"
  9484. echo branch B > $file
  9485. dotest join-readonly-conflict-6 "$testcvs -q ci -m . $file" \
  9486. "Checking in $file;
  9487. $CVSROOT_DIRNAME/$module/$file,v <-- $file
  9488. new revision: 1\.1\.2\.1; previous revision: 1\.1
  9489. done"
  9490. rm $file
  9491. dotest join-readonly-conflict-7 "$testcvs -Q update -A $file" ''
  9492. # Make sure $file is read-only. This can happen more realistically
  9493. # via patch -- which could be used to apply a delta, yet would
  9494. # preserve a file's read-only permissions.
  9495. echo conflict > $file; chmod u-w $file
  9496. dotest join-readonly-conflict-8 "$testcvs update -r B $file" \
  9497. "RCS file: $CVSROOT_DIRNAME/$module/$file,v
  9498. retrieving revision 1\.1
  9499. retrieving revision 1\.1\.2\.1
  9500. Merging differences between 1\.1 and 1\.1\.2\.1 into $file
  9501. rcsmerge: warning: conflicts during merge
  9502. ${PROG} update: conflicts found in $file
  9503. C $file"
  9504. # restore to the trunk
  9505. rm -f $file
  9506. dotest join-readonly-conflict-9 "$testcvs -Q update -A $file" ''
  9507. # This one would fail because cvs couldn't open the existing
  9508. # (and read-only) .# file for writing.
  9509. echo conflict > $file
  9510. # verify that the backup file is not writable
  9511. if test -w ".#$file.1.1"; then
  9512. fail "join-readonly-conflict-10 : .#$file.1.1 is writable"
  9513. else
  9514. pass "join-readonly-conflict-10"
  9515. fi
  9516. dotest join-readonly-conflict-11 "$testcvs update -r B $file" \
  9517. "RCS file: $CVSROOT_DIRNAME/$module/$file,v
  9518. retrieving revision 1\.1
  9519. retrieving revision 1\.1\.2\.1
  9520. Merging differences between 1\.1 and 1\.1\.2\.1 into $file
  9521. rcsmerge: warning: conflicts during merge
  9522. ${PROG} update: conflicts found in $file
  9523. C m"
  9524. cd ../..
  9525. if $keep; then :; else
  9526. rm -rf join-readonly-conflict
  9527. rm -rf $CVSROOT_DIRNAME/$module
  9528. fi
  9529. ;;
  9530. join-admin)
  9531. mkdir 1; cd 1
  9532. dotest join-admin-1 "$testcvs -q co -l ." ''
  9533. module=x
  9534. mkdir $module
  9535. $testcvs -q add $module >>$LOGFILE 2>&1
  9536. cd $module
  9537. # Create a file so applying the first tag works.
  9538. echo foo > a
  9539. $testcvs -Q add a > /dev/null 2>&1
  9540. $testcvs -Q ci -m. a > /dev/null 2>&1
  9541. $testcvs -Q tag -b B
  9542. $testcvs -Q tag -b M1
  9543. echo '$''Id$' > b
  9544. $testcvs -Q add b > /dev/null 2>&1
  9545. $testcvs -Q ci -m. b > /dev/null 2>&1
  9546. $testcvs -Q tag -b M2
  9547. $testcvs -Q update -r B
  9548. $testcvs -Q update -kk -jM1 -jM2
  9549. $testcvs -Q ci -m. b >/dev/null 2>&1
  9550. $testcvs -Q update -A
  9551. # Verify that the -kk flag from the update did not
  9552. # propagate to the repository.
  9553. dotest join-admin-1 "$testcvs status b" \
  9554. "===================================================================
  9555. File: b Status: Up-to-date
  9556. Working revision: 1\.1.*
  9557. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/x/b,v
  9558. Sticky Tag: (none)
  9559. Sticky Date: (none)
  9560. Sticky Options: (none)"
  9561. cd ../..
  9562. rm -rf 1
  9563. rm -rf ${CVSROOT_DIRNAME}/$module
  9564. ;;
  9565. join-admin-2)
  9566. # Show that when a merge (via update -kk -jtag1 -jtag2) first
  9567. # removes a file, then modifies another containing an $Id...$ line,
  9568. # the resulting file contains the unexpanded `$Id.$' string, as
  9569. # -kk requires.
  9570. mkdir 1; cd 1
  9571. dotest join-admin-2-1 "$testcvs -q co -l ." ''
  9572. module=x
  9573. mkdir $module
  9574. dotest join-admin-2-2 "$testcvs -q add $module" \
  9575. "Directory ${CVSROOT_DIRNAME}/x added to the repository"
  9576. cd $module
  9577. # Create a file so applying the first tag works.
  9578. echo '$''Id$' > e0
  9579. cp e0 e
  9580. dotest join-admin-2-3 "$testcvs -Q add e" ''
  9581. dotest join-admin-2-4 "$testcvs -Q ci -m. e" \
  9582. "RCS file: ${CVSROOT_DIRNAME}/x/e,v
  9583. done
  9584. Checking in e;
  9585. ${CVSROOT_DIRNAME}/x/e,v <-- e
  9586. initial revision: 1\.1
  9587. done"
  9588. dotest join-admin-2-5 "$testcvs -Q tag -b T" '' "${QUESTION} e0"
  9589. dotest join-admin-2-6 "$testcvs -Q update -r T" '' "${QUESTION} e0"
  9590. cp e0 e
  9591. dotest join-admin-2-7 "$testcvs -Q ci -m. e" \
  9592. "Checking in e;
  9593. ${CVSROOT_DIRNAME}/x/e,v <-- e
  9594. new revision: 1\.1\.2\.1; previous revision: 1\.1
  9595. done"
  9596. dotest join-admin-2-8 "$testcvs -Q update -A" '' "${QUESTION} e0"
  9597. dotest join-admin-2-9 "$testcvs -Q tag -b M1" '' "${QUESTION} e0"
  9598. echo '$''Id$' > b
  9599. dotest join-admin-2-10 "$testcvs -Q add b" ''
  9600. cp e0 e
  9601. dotest join-admin-2-11 "$testcvs -Q ci -m. b e" \
  9602. "RCS file: ${CVSROOT_DIRNAME}/x/b,v
  9603. done
  9604. Checking in b;
  9605. ${CVSROOT_DIRNAME}/x/b,v <-- b
  9606. initial revision: 1\.1
  9607. done
  9608. Checking in e;
  9609. ${CVSROOT_DIRNAME}/x/e,v <-- e
  9610. new revision: 1\.2; previous revision: 1\.1
  9611. done"
  9612. dotest join-admin-2-12 "$testcvs -Q tag -b M2" '' "${QUESTION} e0"
  9613. dotest join-admin-2-13 "$testcvs -Q update -r T" '' "${QUESTION} e0"
  9614. dotest join-admin-2-14 "$testcvs update -kk -jM1 -jM2" \
  9615. "${PROG} update: Updating .
  9616. U b
  9617. U e
  9618. RCS file: ${CVSROOT_DIRNAME}/x/e,v
  9619. retrieving revision 1\.1
  9620. retrieving revision 1\.2
  9621. Merging differences between 1\.1 and 1\.2 into e
  9622. e already contains the differences between 1\.1 and 1\.2
  9623. ${QUESTION} e0" \
  9624. "${QUESTION} e0
  9625. ${PROG} update: Updating .
  9626. U b
  9627. U e
  9628. RCS file: ${CVSROOT_DIRNAME}/x/e,v
  9629. retrieving revision 1\.1
  9630. retrieving revision 1\.2
  9631. Merging differences between 1\.1 and 1\.2 into e
  9632. e already contains the differences between 1\.1 and 1\.2"
  9633. # Verify that the $Id.$ string is not expanded.
  9634. dotest join-admin-2-15 "cat e" '$''Id$'
  9635. cd ../..
  9636. rm -rf 1
  9637. rm -rf ${CVSROOT_DIRNAME}/$module
  9638. ;;
  9639. join-rm)
  9640. # This first half of this test checks that a single-argument merge
  9641. # from a branch is capable of removing files.
  9642. #
  9643. # The second half verifies that an update to another location with an
  9644. # uncommitted removal will transfer the destination branch of the
  9645. # removal.
  9646. module=join-rm
  9647. mkdir $module; cd $module
  9648. dotest join-rm-init-1 "$testcvs -q co -l ." ''
  9649. mkdir $module
  9650. dotest join-rm-init-2 "$testcvs -q add $module" \
  9651. "Directory $CVSROOT_DIRNAME/$module added to the repository"
  9652. cd $module
  9653. # add some files.
  9654. touch a b c d e f g
  9655. dotest join-rm-init-3 "$testcvs -Q add a b c d e f g"
  9656. dotest join-rm-init-4 "$testcvs -Q ci -m add-em" \
  9657. "RCS file: $CVSROOT_DIRNAME/join-rm/a,v
  9658. done
  9659. Checking in a;
  9660. $CVSROOT_DIRNAME/join-rm/a,v <-- a
  9661. initial revision: 1\.1
  9662. done
  9663. RCS file: $CVSROOT_DIRNAME/join-rm/b,v
  9664. done
  9665. Checking in b;
  9666. $CVSROOT_DIRNAME/join-rm/b,v <-- b
  9667. initial revision: 1\.1
  9668. done
  9669. RCS file: $CVSROOT_DIRNAME/join-rm/c,v
  9670. done
  9671. Checking in c;
  9672. $CVSROOT_DIRNAME/join-rm/c,v <-- c
  9673. initial revision: 1\.1
  9674. done
  9675. RCS file: $CVSROOT_DIRNAME/join-rm/d,v
  9676. done
  9677. Checking in d;
  9678. $CVSROOT_DIRNAME/join-rm/d,v <-- d
  9679. initial revision: 1\.1
  9680. done
  9681. RCS file: $CVSROOT_DIRNAME/join-rm/e,v
  9682. done
  9683. Checking in e;
  9684. $CVSROOT_DIRNAME/join-rm/e,v <-- e
  9685. initial revision: 1\.1
  9686. done
  9687. RCS file: $CVSROOT_DIRNAME/join-rm/f,v
  9688. done
  9689. Checking in f;
  9690. $CVSROOT_DIRNAME/join-rm/f,v <-- f
  9691. initial revision: 1\.1
  9692. done
  9693. RCS file: $CVSROOT_DIRNAME/join-rm/g,v
  9694. done
  9695. Checking in g;
  9696. $CVSROOT_DIRNAME/join-rm/g,v <-- g
  9697. initial revision: 1\.1
  9698. done"
  9699. # create the branch and update to it
  9700. dotest join-rm-init-5 "$testcvs -Q tag -b br"
  9701. dotest join-rm-init-6 "$testcvs -Q up -rbr"
  9702. # remove a few files from the branch
  9703. dotest join-rm-init-7 "$testcvs -Q rm -f b d g"
  9704. dotest join-rm-init-8 "$testcvs -Q ci -mrm" \
  9705. "Removing b;
  9706. $CVSROOT_DIRNAME/join-rm/b,v <-- b
  9707. new revision: delete; previous revision: 1\.1
  9708. done
  9709. Removing d;
  9710. $CVSROOT_DIRNAME/join-rm/d,v <-- d
  9711. new revision: delete; previous revision: 1\.1
  9712. done
  9713. Removing g;
  9714. $CVSROOT_DIRNAME/join-rm/g,v <-- g
  9715. new revision: delete; previous revision: 1\.1
  9716. done"
  9717. # update to the trunk
  9718. dotest join-rm-init-9 "$testcvs -Q up -A"
  9719. # now for the test - try and merge the removals.
  9720. dotest join-rm-1 "$testcvs -q up -jbr" \
  9721. "$PROG update: scheduling b for removal
  9722. $PROG update: scheduling d for removal
  9723. $PROG update: scheduling g for removal"
  9724. # And make sure the merge took
  9725. dotest join-rm-2 "$testcvs -qn up" \
  9726. "R b
  9727. R d
  9728. R g"
  9729. dotest join-rm-3 "$testcvs -q ci -m 'save the merge'" \
  9730. "Removing b;
  9731. $CVSROOT_DIRNAME/join-rm/b,v <-- b
  9732. new revision: delete; previous revision: 1\.1
  9733. done
  9734. Removing d;
  9735. $CVSROOT_DIRNAME/join-rm/d,v <-- d
  9736. new revision: delete; previous revision: 1\.1
  9737. done
  9738. Removing g;
  9739. $CVSROOT_DIRNAME/join-rm/g,v <-- g
  9740. new revision: delete; previous revision: 1\.1
  9741. done"
  9742. # and verify that it was the head revision which was removed.
  9743. dotest join-rm-4 "$testcvs -q log b" "
  9744. RCS file: $CVSROOT_DIRNAME/join-rm/Attic/b,v
  9745. Working file: b
  9746. head: 1\.2
  9747. branch:
  9748. locks: strict
  9749. access list:
  9750. symbolic names:
  9751. br: 1\.1\.0\.2
  9752. keyword substitution: kv
  9753. total revisions: 3; selected revisions: 3
  9754. description:
  9755. ----------------------------
  9756. revision 1\.2
  9757. date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: ${PLUS}0 -0
  9758. save the merge
  9759. ----------------------------
  9760. revision 1\.1
  9761. date: [0-9/]* [0-9:]*; author: $username; state: Exp;
  9762. branches: 1.1.2;
  9763. add-em
  9764. ----------------------------
  9765. revision 1\.1\.2\.1
  9766. date: [0-9/]* [0-9:]*; author: $username; state: dead; lines: ${PLUS}0 -0
  9767. rm
  9768. ============================================================================="
  9769. # go back to the branch to set up for the second set of tests
  9770. dotest join-rm-init-10 "$testcvs -Q up -rbr"
  9771. dotest join-rm-init-11 "$testcvs -Q rm -f a"
  9772. dotest join-rm-init-12 "$testcvs -Q ci -m rma" \
  9773. "Removing a;
  9774. $CVSROOT_DIRNAME/join-rm/a,v <-- a
  9775. new revision: delete; previous revision: 1\.1
  9776. done"
  9777. # now the test: update to the trunk
  9778. #
  9779. # FIXCVS: This update should merge the removal to the trunk. It does
  9780. # not.
  9781. dotest join-rm-5 "$testcvs -q up -A" \
  9782. 'U a
  9783. U c
  9784. U e
  9785. U f'
  9786. # and verify that there is no sticky tag
  9787. dotest join-rm-6 "$testcvs status a" \
  9788. "===================================================================
  9789. File: a Status: Up-to-date
  9790. Working revision: 1\.1.*
  9791. Repository revision: 1\.1 $CVSROOT_DIRNAME/join-rm/a,v
  9792. Sticky Tag: (none)
  9793. Sticky Date: (none)
  9794. Sticky Options: (none)"
  9795. if $keep; then
  9796. echo Keeping $TESTDIR and exiting due to --keep
  9797. exit 0
  9798. fi
  9799. cd ../..
  9800. rm -rf $CVSROOT_DIRNAME/$module
  9801. rm -r $module
  9802. ;;
  9803. new) # look for stray "no longer pertinent" messages.
  9804. mkdir ${CVSROOT_DIRNAME}/first-dir
  9805. if ${CVS} co first-dir ; then
  9806. pass 117
  9807. else
  9808. fail 117
  9809. fi
  9810. cd first-dir
  9811. touch a
  9812. if ${CVS} add a 2>>${LOGFILE}; then
  9813. pass 118
  9814. else
  9815. fail 118
  9816. fi
  9817. if ${CVS} ci -m added >>${LOGFILE} 2>&1; then
  9818. pass 119
  9819. else
  9820. fail 119
  9821. fi
  9822. rm a
  9823. if ${CVS} rm a 2>>${LOGFILE}; then
  9824. pass 120
  9825. else
  9826. fail 120
  9827. fi
  9828. if ${CVS} ci -m removed >>${LOGFILE} ; then
  9829. pass 121
  9830. else
  9831. fail 121
  9832. fi
  9833. if ${CVS} update -A 2>&1 | grep longer ; then
  9834. fail 122
  9835. else
  9836. pass 122
  9837. fi
  9838. if ${CVS} update -rHEAD 2>&1 | grep longer ; then
  9839. fail 123
  9840. else
  9841. pass 123
  9842. fi
  9843. cd ..
  9844. rm -r first-dir
  9845. rm -rf ${CVSROOT_DIRNAME}/first-dir
  9846. ;;
  9847. newb)
  9848. # Test removing a file on a branch and then checking it out.
  9849. # We call this "newb" only because it, like the "new" tests,
  9850. # has something to do with "no longer pertinent" messages.
  9851. # Not necessarily the most brilliant nomenclature.
  9852. # Create file 'a'.
  9853. mkdir ${CVSROOT_DIRNAME}/first-dir
  9854. dotest newb-123a "${testcvs} -q co first-dir" ''
  9855. cd first-dir
  9856. touch a
  9857. dotest newb-123b "${testcvs} add a" \
  9858. "${PROG} add: scheduling file .a. for addition
  9859. ${PROG} add: use .${PROG} commit. to add this file permanently"
  9860. dotest newb-123c "${testcvs} -q ci -m added" \
  9861. "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
  9862. done
  9863. Checking in a;
  9864. ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
  9865. initial revision: 1\.1
  9866. done"
  9867. # Make a branch.
  9868. dotest newb-123d "${testcvs} -q tag -b branch" "T a"
  9869. # Check out the branch.
  9870. cd ..
  9871. rm -r first-dir
  9872. mkdir 1
  9873. cd 1
  9874. dotest newb-123e "${testcvs} -q co -r branch first-dir" \
  9875. "U first-dir/a"
  9876. # Remove 'a' on another copy of the branch.
  9877. cd ..
  9878. mkdir 2
  9879. cd 2
  9880. dotest newb-123f "${testcvs} -q co -r branch first-dir" \
  9881. "U first-dir/a"
  9882. cd first-dir
  9883. rm a
  9884. dotest newb-123g "${testcvs} rm a" \
  9885. "${PROG} remove: scheduling .a. for removal
  9886. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  9887. dotest newb-123h "${testcvs} -q ci -m removed" \
  9888. "Removing a;
  9889. ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
  9890. new revision: delete; previous revision: 1\.1
  9891. done"
  9892. # Check out the file on the branch. This should report
  9893. # that the file is not pertinent, but it should not
  9894. # say anything else.
  9895. cd ..
  9896. rm -r first-dir
  9897. dotest newb-123i "${testcvs} -q co -r branch first-dir/a" \
  9898. "${PROG} checkout: warning: first-dir/a is not (any longer) pertinent"
  9899. # Update the other copy, and make sure that a is removed.
  9900. cd ../1/first-dir
  9901. # "Entry Invalid" is a rather strange output here. Something like
  9902. # "Removed in Repository" would make more sense.
  9903. dotest newb-123j0 "${testcvs} status a" \
  9904. "${PROG} status: a is no longer in the repository
  9905. ===================================================================
  9906. File: a Status: Entry Invalid
  9907. Working revision: 1\.1.*
  9908. Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/a,v
  9909. Sticky Tag: branch (branch: 1\.1\.2)
  9910. Sticky Date: (none)
  9911. Sticky Options: (none)"
  9912. dotest newb-123j "${testcvs} -q update" \
  9913. "${PROG} update: a is no longer in the repository"
  9914. if test -f a; then
  9915. fail newb-123k
  9916. else
  9917. pass newb-123k
  9918. fi
  9919. cd ../..
  9920. rm -r 1 2
  9921. rm -rf ${CVSROOT_DIRNAME}/first-dir
  9922. ;;
  9923. conflicts)
  9924. mkdir ${CVSROOT_DIRNAME}/first-dir
  9925. mkdir 1
  9926. cd 1
  9927. dotest conflicts-124 "${testcvs} -q co first-dir" ''
  9928. cd first-dir
  9929. touch a
  9930. dotest conflicts-125 "${testcvs} add a" \
  9931. "${PROG} add: scheduling file .a. for addition
  9932. ${PROG} add: use .${PROG} commit. to add this file permanently"
  9933. dotest conflicts-126 "${testcvs} -q ci -m added" \
  9934. "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
  9935. done
  9936. Checking in a;
  9937. ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
  9938. initial revision: 1\.1
  9939. done"
  9940. cd ../..
  9941. mkdir 2
  9942. cd 2
  9943. dotest conflicts-126.5 "${testcvs} co -p first-dir" \
  9944. "${PROG} checkout: Updating first-dir
  9945. ===================================================================
  9946. Checking out first-dir/a
  9947. RCS: ${CVSROOT_DIRNAME}/first-dir/a,v
  9948. VERS: 1\.1
  9949. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
  9950. if ${CVS} co first-dir ; then
  9951. pass 127
  9952. else
  9953. fail 127
  9954. fi
  9955. cd first-dir
  9956. if test -f a; then
  9957. pass 127a
  9958. else
  9959. fail 127a
  9960. fi
  9961. cd ../../1/first-dir
  9962. echo add a line >>a
  9963. mkdir dir1
  9964. dotest conflicts-127b "${testcvs} add dir1" \
  9965. "Directory ${CVSROOT_DIRNAME}/first-dir/dir1 added to the repository"
  9966. dotest conflicts-128 "${testcvs} -q ci -m changed" \
  9967. "Checking in a;
  9968. ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
  9969. new revision: 1\.2; previous revision: 1\.1
  9970. done"
  9971. cd ../..
  9972. # Similar to conflicts-126.5, but now the file has nonempty
  9973. # contents.
  9974. mkdir 3
  9975. cd 3
  9976. dotest conflicts-128.5 "${testcvs} co -p -l first-dir" \
  9977. "${PROG} checkout: Updating first-dir
  9978. ===================================================================
  9979. Checking out first-dir/a
  9980. RCS: ${CVSROOT_DIRNAME}/first-dir/a,v
  9981. VERS: 1\.2
  9982. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  9983. add a line"
  9984. cd ..
  9985. rmdir 3
  9986. # Now go over the to the other working directory and
  9987. # start testing conflicts
  9988. cd 2/first-dir
  9989. echo add a conflicting line >>a
  9990. dotest_fail conflicts-129 "${testcvs} -q ci -m changed" \
  9991. "${PROG}"' commit: Up-to-date check failed for `a'\''
  9992. '"${PROG}"' \[commit aborted\]: correct above errors first!'
  9993. mkdir dir1
  9994. mkdir sdir
  9995. dotest conflicts-status-0 "${testcvs} status a" \
  9996. "===================================================================
  9997. File: a Status: Needs Merge
  9998. Working revision: 1\.1.*
  9999. Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
  10000. Sticky Tag: (none)
  10001. Sticky Date: (none)
  10002. Sticky Options: (none)"
  10003. dotest conflicts-129a "${testcvs} -nq update a" \
  10004. "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
  10005. retrieving revision 1\.1
  10006. retrieving revision 1\.2
  10007. Merging differences between 1\.1 and 1\.2 into a
  10008. rcsmerge: warning: conflicts during merge
  10009. ${PROG} update: conflicts found in a
  10010. C a"
  10011. dotest conflicts-130 "${testcvs} -q update" \
  10012. "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
  10013. retrieving revision 1\.1
  10014. retrieving revision 1\.2
  10015. Merging differences between 1\.1 and 1\.2 into a
  10016. rcsmerge: warning: conflicts during merge
  10017. ${PROG} update: conflicts found in a
  10018. C a
  10019. ${QUESTION} dir1
  10020. ${QUESTION} sdir" \
  10021. "${QUESTION} dir1
  10022. ${QUESTION} sdir
  10023. RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
  10024. retrieving revision 1\.1
  10025. retrieving revision 1\.2
  10026. Merging differences between 1\.1 and 1\.2 into a
  10027. rcsmerge: warning: conflicts during merge
  10028. ${PROG} update: conflicts found in a
  10029. C a"
  10030. rmdir dir1 sdir
  10031. dotest conflicts-status-1 "${testcvs} status a" \
  10032. "===================================================================
  10033. File: a Status: Unresolved Conflict
  10034. Working revision: 1\.2.*
  10035. Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
  10036. Sticky Tag: (none)
  10037. Sticky Date: (none)
  10038. Sticky Options: (none)"
  10039. dotest_fail conflicts-131 "${testcvs} -q ci -m try" \
  10040. "${PROG} commit: file .a. had a conflict and has not been modified
  10041. ${PROG} \[commit aborted\]: correct above errors first!"
  10042. # Try to check in the file with the conflict markers in it.
  10043. # Make sure we detect any one of the three conflict markers
  10044. mv a aa
  10045. grep '^<<<<<<<' aa >a
  10046. dotest conflicts-status-2 "${testcvs} -nq ci -m try a" \
  10047. "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
  10048. grep '^=======' aa >a
  10049. dotest conflicts-status-3 "${testcvs} -nq ci -m try a" \
  10050. "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
  10051. grep '^>>>>>>>' aa >a
  10052. dotest conflicts-status-4 "${testcvs} -qn ci -m try a" \
  10053. "${PROG} commit: warning: file .a. seems to still contain conflict indicators"
  10054. mv aa a
  10055. echo lame attempt at resolving it >>a
  10056. dotest conflicts-status-5 "${testcvs} status a" \
  10057. "===================================================================
  10058. File: a Status: File had conflicts on merge
  10059. Working revision: 1\.2.*
  10060. Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
  10061. Sticky Tag: (none)
  10062. Sticky Date: (none)
  10063. Sticky Options: (none)"
  10064. dotest conflicts-132 "${testcvs} -q ci -m try" \
  10065. "${PROG} commit: warning: file .a. seems to still contain conflict indicators
  10066. Checking in a;
  10067. ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
  10068. new revision: 1\.3; previous revision: 1\.2
  10069. done"
  10070. # OK, the user saw the warning (good user), and now
  10071. # resolves it for real.
  10072. echo resolve conflict >a
  10073. dotest conflicts-status-6 "${testcvs} status a" \
  10074. "===================================================================
  10075. File: a Status: Locally Modified
  10076. Working revision: 1\.3.*
  10077. Repository revision: 1\.3 ${CVSROOT_DIRNAME}/first-dir/a,v
  10078. Sticky Tag: (none)
  10079. Sticky Date: (none)
  10080. Sticky Options: (none)"
  10081. dotest conflicts-133 "${testcvs} -q ci -m resolved" \
  10082. "Checking in a;
  10083. ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
  10084. new revision: 1\.4; previous revision: 1\.3
  10085. done"
  10086. dotest conflicts-status-7 "${testcvs} status a" \
  10087. "===================================================================
  10088. File: a Status: Up-to-date
  10089. Working revision: 1\.4.*
  10090. Repository revision: 1\.4 ${CVSROOT_DIRNAME}/first-dir/a,v
  10091. Sticky Tag: (none)
  10092. Sticky Date: (none)
  10093. Sticky Options: (none)"
  10094. # Now test that we can add a file in one working directory
  10095. # and have an update in another get it.
  10096. cd ../../1/first-dir
  10097. echo abc >abc
  10098. if ${testcvs} add abc >>${LOGFILE} 2>&1; then
  10099. pass 134
  10100. else
  10101. fail 134
  10102. fi
  10103. if ${testcvs} ci -m 'add abc' abc >>${LOGFILE} 2>&1; then
  10104. pass 135
  10105. else
  10106. fail 135
  10107. fi
  10108. cd ../../2
  10109. mkdir first-dir/dir1 first-dir/sdir
  10110. dotest conflicts-136 "${testcvs} -q update first-dir" \
  10111. '[UP] first-dir/abc
  10112. '"${QUESTION}"' first-dir/dir1
  10113. '"${QUESTION}"' first-dir/sdir' \
  10114. ''"${QUESTION}"' first-dir/dir1
  10115. '"${QUESTION}"' first-dir/sdir
  10116. [UP] first-dir/abc'
  10117. dotest conflicts-137 'test -f first-dir/abc' ''
  10118. rmdir first-dir/dir1 first-dir/sdir
  10119. # Now test something similar, but in which the parent directory
  10120. # (not the directory in question) has the Entries.Static flag
  10121. # set.
  10122. cd ../1/first-dir
  10123. mkdir subdir
  10124. if ${testcvs} add subdir >>${LOGFILE}; then
  10125. pass 138
  10126. else
  10127. fail 138
  10128. fi
  10129. cd ../..
  10130. mkdir 3
  10131. cd 3
  10132. if ${testcvs} -q co first-dir/abc first-dir/subdir \
  10133. >>${LOGFILE}; then
  10134. pass 139
  10135. else
  10136. fail 139
  10137. fi
  10138. cd ../1/first-dir/subdir
  10139. echo sss >sss
  10140. if ${testcvs} add sss >>${LOGFILE} 2>&1; then
  10141. pass 140
  10142. else
  10143. fail 140
  10144. fi
  10145. if ${testcvs} ci -m adding sss >>${LOGFILE} 2>&1; then
  10146. pass 140
  10147. else
  10148. fail 140
  10149. fi
  10150. cd ../../../3/first-dir
  10151. if ${testcvs} -q update >>${LOGFILE}; then
  10152. pass 141
  10153. else
  10154. fail 141
  10155. fi
  10156. if test -f subdir/sss; then
  10157. pass 142
  10158. else
  10159. fail 142
  10160. fi
  10161. cd ../..
  10162. rm -r 1 2 3 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
  10163. ;;
  10164. conflicts2)
  10165. # More conflicts tests; separate from conflicts to keep each
  10166. # test a manageable size.
  10167. mkdir ${CVSROOT_DIRNAME}/first-dir
  10168. mkdir 1
  10169. cd 1
  10170. dotest conflicts2-142a1 "${testcvs} -q co first-dir" ''
  10171. cd first-dir
  10172. touch a abc
  10173. dotest conflicts2-142a2 "${testcvs} add a abc" \
  10174. "${PROG} add: scheduling file .a. for addition
  10175. ${PROG} add: scheduling file .abc. for addition
  10176. ${PROG} add: use .${PROG} commit. to add these files permanently"
  10177. dotest conflicts2-142a3 "${testcvs} -q ci -m added" \
  10178. "RCS file: ${CVSROOT_DIRNAME}/first-dir/a,v
  10179. done
  10180. Checking in a;
  10181. ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
  10182. initial revision: 1\.1
  10183. done
  10184. RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
  10185. done
  10186. Checking in abc;
  10187. ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
  10188. initial revision: 1\.1
  10189. done"
  10190. cd ../..
  10191. mkdir 2
  10192. cd 2
  10193. dotest conflicts2-142a4 "${testcvs} -q co first-dir" 'U first-dir/a
  10194. U first-dir/abc'
  10195. cd ..
  10196. # BEGIN TESTS USING THE FILE A
  10197. # FIXME: would be cleaner to separate them out into their own
  10198. # tests; conflicts2 is getting long.
  10199. # Now test that if one person modifies and commits a
  10200. # file and a second person removes it, it is a
  10201. # conflict
  10202. cd 1/first-dir
  10203. echo modify a >>a
  10204. dotest conflicts2-142b2 "${testcvs} -q ci -m modify-a" \
  10205. "Checking in a;
  10206. ${CVSROOT_DIRNAME}/first-dir/a,v <-- a
  10207. new revision: 1\.2; previous revision: 1\.1
  10208. done"
  10209. cd ../../2/first-dir
  10210. rm a
  10211. dotest conflicts2-142b3 "${testcvs} rm a" \
  10212. "${PROG} remove: scheduling .a. for removal
  10213. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  10214. dotest_fail conflicts2-142b4 "${testcvs} -q update" \
  10215. "${PROG} update: conflict: removed a was modified by second party
  10216. C a"
  10217. # Resolve the conflict by deciding not to remove the file
  10218. # after all.
  10219. dotest_sort conflicts2-142b5 "${testcvs} add a" "U a
  10220. ${PROG} add: a, version 1\.1, resurrected"
  10221. dotest conflicts2-142b5b1 "$testcvs status a" \
  10222. "===================================================================
  10223. File: a Status: Needs Patch
  10224. Working revision: 1\.1.*
  10225. Repository revision: 1\.2 $CVSROOT_DIRNAME/first-dir/a,v
  10226. Sticky Tag: (none)
  10227. Sticky Date: (none)
  10228. Sticky Options: (none)"
  10229. dotest conflicts2-142b6 "${testcvs} -q update" 'U a'
  10230. # Now one level up.
  10231. cd ..
  10232. dotest conflicts2-142b7 "${testcvs} rm -f first-dir/a" \
  10233. "${PROG} remove: scheduling .first-dir/a. for removal
  10234. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  10235. if $remote; then
  10236. # Haven't investigated this one.
  10237. dotest_fail conflicts2-142b8r "$testcvs add first-dir/a" \
  10238. "${PROG} add: in directory \.:
  10239. ${PROG} \[add aborted\]: there is no version here; do '${PROG} checkout' first"
  10240. cd first-dir
  10241. else
  10242. dotest conflicts2-142b8 "${testcvs} add first-dir/a" \
  10243. "U first-dir/a
  10244. ${PROG} add: first-dir/a, version 1\.2, resurrected"
  10245. cd first-dir
  10246. # Now recover from the damage that the 142b8 test did.
  10247. dotest conflicts2-142b9 "${testcvs} rm -f a" \
  10248. "${PROG} remove: scheduling .a. for removal
  10249. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  10250. fi
  10251. dotest_sort conflicts2-142b10 "${testcvs} add a" "U a
  10252. ${PROG} add: a, version 1\.2, resurrected"
  10253. # As with conflicts2-142b6, check that things are normal again.
  10254. dotest conflicts2-142b11 "${testcvs} -q update" ''
  10255. cd ../..
  10256. # END TESTS USING THE FILE A
  10257. # Now test that if one person removes a file and
  10258. # commits it, and a second person removes it, is it
  10259. # not a conflict.
  10260. cd 1/first-dir
  10261. rm abc
  10262. dotest conflicts2-142c0 "${testcvs} rm abc" \
  10263. "${PROG} remove: scheduling .abc. for removal
  10264. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  10265. dotest conflicts2-142c1 "${testcvs} -q ci -m remove-abc" \
  10266. "Removing abc;
  10267. ${CVSROOT_DIRNAME}/first-dir/abc,v <-- abc
  10268. new revision: delete; previous revision: 1\.1
  10269. done"
  10270. cd ../../2/first-dir
  10271. rm abc
  10272. dotest conflicts2-142c2 "${testcvs} rm abc" \
  10273. "${PROG} remove: scheduling .abc. for removal
  10274. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  10275. dotest conflicts2-142c3 "${testcvs} update" \
  10276. "${PROG} update: Updating \."
  10277. cd ../..
  10278. # conflicts2-142d*: test that if one party adds a file, and another
  10279. # party has a file of the same name, cvs notices
  10280. cd 1/first-dir
  10281. touch aa.c
  10282. echo 'contents unchanged' >same.c
  10283. dotest conflicts2-142d0 "${testcvs} add aa.c same.c" \
  10284. "${PROG} add: scheduling file .aa\.c. for addition
  10285. ${PROG} add: scheduling file .same\.c. for addition
  10286. ${PROG} add: use .${PROG} commit. to add these files permanently"
  10287. dotest conflicts2-142d1 "${testcvs} -q ci -m added" \
  10288. "RCS file: ${CVSROOT_DIRNAME}/first-dir/aa\.c,v
  10289. done
  10290. Checking in aa\.c;
  10291. ${CVSROOT_DIRNAME}/first-dir/aa\.c,v <-- aa\.c
  10292. initial revision: 1\.1
  10293. done
  10294. RCS file: ${CVSROOT_DIRNAME}/first-dir/same\.c,v
  10295. done
  10296. Checking in same\.c;
  10297. ${CVSROOT_DIRNAME}/first-dir/same\.c,v <-- same\.c
  10298. initial revision: 1\.1
  10299. done"
  10300. cd ../../2/first-dir
  10301. echo "don't you dare obliterate this text" >aa.c
  10302. echo 'contents unchanged' >same.c
  10303. # Note the discrepancy between local and remote in the handling
  10304. # of same.c. I kind
  10305. # of suspect that the local CVS behavior is the more useful one
  10306. # although I do sort of wonder whether we should make people run
  10307. # cvs add just to get them in that habit (also, trying to implement
  10308. # the local CVS behavior for remote without the cvs add seems
  10309. # pretty difficult).
  10310. if $remote; then
  10311. dotest_fail conflicts2-142d2 "${testcvs} -q update" \
  10312. "${QUESTION} aa\.c
  10313. ${QUESTION} same\.c
  10314. ${PROG} update: move away \./aa\.c; it is in the way
  10315. C aa\.c
  10316. ${PROG} update: move away \./same\.c; it is in the way
  10317. C same\.c"
  10318. else
  10319. dotest_fail conflicts2-142d2 "${testcvs} -q update" \
  10320. "${PROG} [a-z]*: move away aa\.c; it is in the way
  10321. C aa\.c
  10322. U same\.c"
  10323. fi
  10324. dotest conflicts2-142d3 "${testcvs} -q status aa.c" \
  10325. "${PROG} status: move away aa\.c; it is in the way
  10326. ===================================================================
  10327. File: aa\.c Status: Unresolved Conflict
  10328. Working revision: No entry for aa\.c
  10329. Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/aa\.c,v"
  10330. # Could also be testing the case in which the cvs add happened
  10331. # before the commit by the other user.
  10332. # This message seems somewhat bogus. I mean, parallel development
  10333. # means that we get to work in parallel if we choose, right? And
  10334. # then at commit time it would be a conflict.
  10335. dotest_fail conflicts2-142d4 "${testcvs} -q add aa.c" \
  10336. "${PROG} add: aa.c added independently by second party"
  10337. # The user might want to see just what the conflict is.
  10338. # Don't bother, diff seems to kind of lose its mind, with or
  10339. # without -N. This is a CVS bug(s).
  10340. #dotest conflicts2-142d5 "${testcvs} -q diff -r HEAD -N aa.c" fixme
  10341. # Now: "how can the user resolve this conflict", I hear you cry.
  10342. # Well, one way is to forget about the file in the working
  10343. # directory.
  10344. # Since it didn't let us do the add in conflicts2-142d4, there
  10345. # is no need to run cvs rm here.
  10346. #dotest conflicts2-142d6 "${testcvs} -q rm -f aa.c" fixme
  10347. dotest conflicts2-142d6 "rm aa.c" ''
  10348. dotest conflicts2-142d7 "${testcvs} -q update aa.c" "U aa\.c"
  10349. dotest conflicts2-142d8 "cat aa.c" ''
  10350. # The other way is to use the version from the working directory
  10351. # instead of the version from the repository. Unfortunately,
  10352. # there doesn't seem to be any particularly clear way to do
  10353. # this (?).
  10354. cd ../..
  10355. rm -r 1 2; rm -rf ${CVSROOT_DIRNAME}/first-dir
  10356. ;;
  10357. conflicts3)
  10358. # More tests of conflicts and/or multiple working directories
  10359. # in general.
  10360. mkdir 1; cd 1
  10361. dotest conflicts3-1 "${testcvs} -q co -l ." ''
  10362. mkdir first-dir
  10363. dotest conflicts3-2 "${testcvs} add first-dir" \
  10364. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  10365. cd ..
  10366. mkdir 2; cd 2
  10367. dotest conflicts3-3 "${testcvs} -q co -l first-dir" ''
  10368. cd ../1/first-dir
  10369. touch file1 file2
  10370. dotest conflicts3-4 "${testcvs} add file1 file2" \
  10371. "${PROG} add: scheduling file .file1. for addition
  10372. ${PROG} add: scheduling file .file2. for addition
  10373. ${PROG} add: use .${PROG} commit. to add these files permanently"
  10374. dotest conflicts3-5 "${testcvs} -q ci -m add-them" \
  10375. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  10376. done
  10377. Checking in file1;
  10378. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  10379. initial revision: 1\.1
  10380. done
  10381. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  10382. done
  10383. Checking in file2;
  10384. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  10385. initial revision: 1\.1
  10386. done"
  10387. cd ../../2/first-dir
  10388. # Check that -n doesn't make CVS lose its mind as it creates
  10389. # (or rather, doesn't) a new file.
  10390. dotest conflicts3-6 "${testcvs} -nq update" \
  10391. "U file1
  10392. U file2"
  10393. dotest_fail conflicts3-7 "test -f file1" ''
  10394. dotest conflicts3-8 "${testcvs} -q update" \
  10395. "U file1
  10396. U file2"
  10397. dotest conflicts3-9 "test -f file2" ''
  10398. # OK, now remove two files at once
  10399. dotest conflicts3-10 "${testcvs} rm -f file1 file2" \
  10400. "${PROG} remove: scheduling .file1. for removal
  10401. ${PROG} remove: scheduling .file2. for removal
  10402. ${PROG} remove: use .${PROG} commit. to remove these files permanently"
  10403. dotest conflicts3-11 "${testcvs} -q ci -m remove-them" \
  10404. "Removing file1;
  10405. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  10406. new revision: delete; previous revision: 1\.1
  10407. done
  10408. Removing file2;
  10409. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  10410. new revision: delete; previous revision: 1\.1
  10411. done"
  10412. cd ../../1/first-dir
  10413. dotest conflicts3-12 "${testcvs} -n -q update" \
  10414. "${PROG} update: file1 is no longer in the repository
  10415. ${PROG} update: file2 is no longer in the repository"
  10416. dotest conflicts3-13 "${testcvs} -q update" \
  10417. "${PROG} update: file1 is no longer in the repository
  10418. ${PROG} update: file2 is no longer in the repository"
  10419. # OK, now add a directory to both working directories
  10420. # and see that CVS doesn't lose its mind.
  10421. mkdir sdir
  10422. dotest conflicts3-14 "${testcvs} add sdir" \
  10423. "Directory ${CVSROOT_DIRNAME}/first-dir/sdir added to the repository"
  10424. touch sdir/sfile
  10425. dotest conflicts3-14a "${testcvs} add sdir/sfile" \
  10426. "${PROG} add: scheduling file .sdir/sfile. for addition
  10427. ${PROG} add: use .${PROG} commit. to add this file permanently"
  10428. dotest conflicts3-14b "${testcvs} -q ci -m add" \
  10429. "RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v
  10430. done
  10431. Checking in sdir/sfile;
  10432. ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v <-- sfile
  10433. initial revision: 1\.1
  10434. done"
  10435. cd ../../2/first-dir
  10436. # Create a CVS directory without the proper administrative
  10437. # files in it. This can happen for example if you hit ^C
  10438. # in the middle of a checkout.
  10439. mkdir sdir
  10440. mkdir sdir/CVS
  10441. # OK, in the local case CVS sees that the directory exists
  10442. # in the repository and recurses into it. In the remote case
  10443. # CVS can't see the repository and has no way of knowing
  10444. # that sdir is even a directory (stat'ing everything would be
  10445. # too slow). The remote behavior makes more sense to me (but
  10446. # would this affect other cases?).
  10447. if $remote; then
  10448. dotest conflicts3-15 "${testcvs} -q update" \
  10449. "${QUESTION} sdir"
  10450. else
  10451. dotest conflicts3-15 "${testcvs} -q update" \
  10452. "${QUESTION} sdir
  10453. ${PROG} update: ignoring sdir (CVS/Repository missing)"
  10454. touch sdir/CVS/Repository
  10455. dotest conflicts3-16 "${testcvs} -q update" \
  10456. "${QUESTION} sdir
  10457. ${PROG} update: ignoring sdir (CVS/Entries missing)"
  10458. cd ..
  10459. dotest conflicts3-16a "${testcvs} -q update first-dir" \
  10460. "${QUESTION} first-dir/sdir
  10461. ${PROG} update: ignoring first-dir/sdir (CVS/Entries missing)"
  10462. cd first-dir
  10463. fi
  10464. rm -r sdir
  10465. # OK, now the same thing, but the directory doesn't exist
  10466. # in the repository.
  10467. mkdir newdir
  10468. mkdir newdir/CVS
  10469. dotest conflicts3-17 "${testcvs} -q update" "${QUESTION} newdir"
  10470. echo "D/newdir////" >> CVS/Entries
  10471. dotest conflicts3-18 "${testcvs} -q update" \
  10472. "${PROG} [a-z]*: ignoring newdir (CVS/Repository missing)"
  10473. touch newdir/CVS/Repository
  10474. dotest conflicts3-19 "${testcvs} -q update" \
  10475. "${PROG} [a-z]*: ignoring newdir (CVS/Entries missing)"
  10476. cd ..
  10477. dotest conflicts3-20 "${testcvs} -q update first-dir" \
  10478. "${PROG} [a-z]*: ignoring first-dir/newdir (CVS/Entries missing)"
  10479. cd first-dir
  10480. rm -r newdir
  10481. # The previous tests have left CVS/Entries in something of a mess.
  10482. # While we "should" be able to deal with that (maybe), for now
  10483. # we just start over.
  10484. cd ..
  10485. rm -r first-dir
  10486. dotest conflicts3-20a "${testcvs} -q co -l first-dir" ''
  10487. cd first-dir
  10488. dotest conflicts3-21 "${testcvs} -q update -d sdir" "U sdir/sfile"
  10489. rm -r sdir/CVS
  10490. dotest conflicts3-22 "${testcvs} -q update" "${QUESTION} sdir"
  10491. if $remote; then
  10492. dotest_fail conflicts3-23 "${testcvs} -q update -PdA" \
  10493. "${QUESTION} sdir
  10494. ${PROG} update: move away sdir/sfile; it is in the way
  10495. C sdir/sfile"
  10496. else
  10497. dotest conflicts3-23 "${testcvs} -q update -PdA" \
  10498. "${QUESTION} sdir"
  10499. fi
  10500. # Not that it should really affect much, but let's do the case
  10501. # where sfile has been removed. For example, suppose that sdir
  10502. # had been a CVS-controlled directory which was then removed
  10503. # by removing each file (and using update -P or some such). Then
  10504. # suppose that the build process creates an sdir directory which
  10505. # is not supposed to be under CVS.
  10506. rm -r sdir
  10507. dotest conflicts3-24 "${testcvs} -q update -d sdir" "U sdir/sfile"
  10508. rm sdir/sfile
  10509. dotest conflicts3-25 "${testcvs} rm sdir/sfile" \
  10510. "${PROG} remove: scheduling .sdir/sfile. for removal
  10511. ${PROG} remove: use .${PROG} commit. to remove this file permanently"
  10512. dotest conflicts3-26 "${testcvs} ci -m remove sdir/sfile" \
  10513. "Removing sdir/sfile;
  10514. ${CVSROOT_DIRNAME}/first-dir/sdir/sfile,v <-- sfile
  10515. new revision: delete; previous revision: 1\.1
  10516. done"
  10517. rm -r sdir/CVS
  10518. dotest conflicts3-27 "${testcvs} -q update" "${QUESTION} sdir"
  10519. dotest conflicts3-28 "${testcvs} -q update -PdA" \
  10520. "${QUESTION} sdir"
  10521. cd ../..
  10522. rm -r 1 2
  10523. rm -rf ${CVSROOT_DIRNAME}/first-dir
  10524. ;;
  10525. conflicts4)
  10526. mkdir conflicts4; cd conflicts4
  10527. mkdir 1; cd 1
  10528. dotest conflicts4-1 "$testcvs -q co -l ."
  10529. mkdir first-dir
  10530. dotest conflicts4-2 "${testcvs} add first-dir" \
  10531. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  10532. cd ..
  10533. mkdir 2; cd 2
  10534. dotest conflicts4-3 "${testcvs} -q co -l first-dir" ''
  10535. cd ../1/first-dir
  10536. echo baseline >file1
  10537. dotest conflicts4-4 "${testcvs} -q add file1" \
  10538. "$PROG add: use .$PROG commit. to add this file permanently"
  10539. dotest conflicts4-5 "${testcvs} -q ci -m add-it" \
  10540. "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
  10541. done
  10542. Checking in file1;
  10543. $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
  10544. initial revision: 1\.1
  10545. done"
  10546. cd ../../2/first-dir
  10547. dotest conflicts4-6 "${testcvs} -q update" "U file1"
  10548. # Make a local change
  10549. echo wibble2 >> file1
  10550. dotest conflicts4-7 "${testcvs} -q ci -m update2" \
  10551. "Checking in file1;
  10552. $CVSROOT_DIRNAME/first-dir/file1,v <-- file1
  10553. new revision: 1\.2; previous revision: 1\.1
  10554. done"
  10555. cd ../../1/first-dir
  10556. echo wibble1 >>file1
  10557. dotest conflicts4-8 "${testcvs} -Q update" \
  10558. "RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
  10559. retrieving revision 1\.1
  10560. retrieving revision 1\.2
  10561. Merging differences between 1\.1 and 1\.2 into file1
  10562. rcsmerge: warning: conflicts during merge
  10563. cvs update: conflicts found in file1"
  10564. dotest_fail conflicts4-9 "${testcvs} -q update" \
  10565. "C file1"
  10566. if $remote; then
  10567. cat >$TESTDIR/conflicts4/serveme <<EOF
  10568. #!$TESTSHELL
  10569. # This is admittedly a bit cheezy, in the sense that we make lots
  10570. # of assumptions about what the client is going to send us.
  10571. # We don't mention Repository, because current clients don't require it.
  10572. # Sending these at our own pace, rather than waiting for the client to
  10573. # make the requests, is bogus, but hopefully we can get away with it.
  10574. echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update Global_option"
  10575. echo "ok"
  10576. echo "MT text C "
  10577. echo "MT fname file1"
  10578. echo "MT newline"
  10579. echo "error "
  10580. cat >$TESTDIR/conflicts4/client.out
  10581. EOF
  10582. # Cygwin. Pthffffffffft!
  10583. if test -n "$remotehost"; then
  10584. $CVS_RSH $remotehost "chmod +x $TESTDIR/conflicts4/serveme"
  10585. else
  10586. chmod +x $TESTDIR/conflicts4/serveme
  10587. fi
  10588. save_CVS_SERVER=$CVS_SERVER
  10589. CVS_SERVER=$TESTDIR/conflicts4/serveme; export CVS_SERVER
  10590. dotest_fail conflicts4-10r "$testcvs -q up" "C file1"
  10591. dotest conflicts4-11r "cat $TESTDIR/conflicts4/client.out" \
  10592. "$DOTSTAR
  10593. Argument --
  10594. Directory .
  10595. $CVSROOT_DIRNAME/first-dir
  10596. Entry /file1/1.2/$PLUS=//
  10597. Modified file1
  10598. u=.*,g=.*,o=.*
  10599. 59
  10600. baseline
  10601. ""<<<<<<< file1
  10602. wibble1
  10603. ""=======
  10604. wibble2
  10605. "">>>>>>> 1.2
  10606. update"
  10607. cat >$TESTDIR/conflicts4/serveme <<EOF
  10608. #!$TESTSHELL
  10609. # This is admittedly a bit cheezy, in the sense that we make lots
  10610. # of assumptions about what the client is going to send us.
  10611. # We don't mention Repository, because current clients don't require it.
  10612. # Sending these at our own pace, rather than waiting for the client to
  10613. # make the requests, is bogus, but hopefully we can get away with it.
  10614. echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update Global_option Empty-conflicts"
  10615. echo "ok"
  10616. echo "MT text C "
  10617. echo "MT fname file1"
  10618. echo "MT newline"
  10619. echo "error "
  10620. cat >$TESTDIR/conflicts4/client.out
  10621. EOF
  10622. dotest_fail conflicts4-12r "$testcvs -q up" "C file1"
  10623. dotest conflicts4-13r "cat $TESTDIR/conflicts4/client.out" \
  10624. "$DOTSTAR
  10625. Argument --
  10626. Directory .
  10627. $CVSROOT_DIRNAME/first-dir
  10628. Entry /file1/1.2/$PLUS=//
  10629. Unchanged file1
  10630. update"
  10631. CVS_SERVER=$save_CVS_SERVER; export CVS_SERVER
  10632. fi
  10633. if $keep; then
  10634. echo Keeping $TESTDIR and exiting due to --keep
  10635. exit 0
  10636. fi
  10637. cd ../../..
  10638. rm -rf conflicts4
  10639. rm -rf $CVSROOT_DIRNAME/first-dir
  10640. ;;
  10641. clean)
  10642. # Test update -C (overwrite local mods w/ repository copies)
  10643. mkdir 1; cd 1
  10644. dotest clean-1 "${testcvs} -q co -l ." ''
  10645. mkdir first-dir
  10646. dotest clean-2 "${testcvs} add first-dir" \
  10647. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  10648. cd first-dir
  10649. echo "The usual boring test text." > cleanme.txt
  10650. dotest clean-3 "${testcvs} add cleanme.txt" \
  10651. "${PROG} add: scheduling file .cleanme\.txt. for addition
  10652. ${PROG} add: use .${PROG} commit. to add this file permanently"
  10653. dotest clean-4 "${testcvs} -q ci -m clean-3" \
  10654. "RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
  10655. done
  10656. Checking in cleanme\.txt;
  10657. ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v <-- cleanme\.txt
  10658. initial revision: 1\.1
  10659. done"
  10660. # Okay, preparation is done, now test.
  10661. # Check that updating an unmodified copy works.
  10662. dotest clean-5 "${testcvs} -q update" ''
  10663. # Check that updating -C an unmodified copy works.
  10664. dotest clean-6 "${testcvs} -q update -C" ''
  10665. # Check that updating a modified copy works.
  10666. echo "fish" >> cleanme.txt
  10667. dotest clean-7 "${testcvs} -q update" 'M cleanme\.txt'
  10668. # Check that updating -C a modified copy works.
  10669. dotest clean-8 "${testcvs} -q update -C" \
  10670. "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
  10671. U cleanme\.txt"
  10672. # And check that the backup copy really was made.
  10673. dotest clean-9 "cat .#cleanme.txt.1.1" \
  10674. "The usual boring test text\.
  10675. fish"
  10676. # Do it all again, this time naming the file explicitly.
  10677. rm .#cleanme.txt.1.1
  10678. dotest clean-10 "${testcvs} -q update cleanme.txt" ''
  10679. dotest clean-11 "${testcvs} -q update -C cleanme.txt" ''
  10680. echo "bluegill" >> cleanme.txt
  10681. dotest clean-12 "${testcvs} -q update cleanme.txt" 'M cleanme\.txt'
  10682. dotest clean-13 "${testcvs} -q update -C cleanme.txt" \
  10683. "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
  10684. U cleanme\.txt"
  10685. # And check that the backup copy really was made.
  10686. dotest clean-14 "cat .#cleanme.txt.1.1" \
  10687. "The usual boring test text\.
  10688. bluegill"
  10689. # Now try with conflicts
  10690. cd ..
  10691. dotest clean-15 "${testcvs} -q co -d second-dir first-dir" \
  10692. 'U second-dir/cleanme\.txt'
  10693. cd second-dir
  10694. echo "conflict test" >> cleanme.txt
  10695. dotest clean-16 "${testcvs} -q ci -m." \
  10696. "Checking in cleanme\.txt;
  10697. ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v <-- cleanme\.txt
  10698. new revision: 1\.2; previous revision: 1\.1
  10699. done"
  10700. cd ../first-dir
  10701. echo "fish" >> cleanme.txt
  10702. dotest clean-17 "${testcvs} -nq update" \
  10703. "RCS file: ${CVSROOT_DIRNAME}/first-dir/cleanme\.txt,v
  10704. retrieving revision 1\.1
  10705. retrieving revision 1\.2
  10706. Merging differences between 1\.1 and 1\.2 into cleanme\.txt
  10707. rcsmerge: warning: conflicts during merge
  10708. ${PROG} update: conflicts found in cleanme\.txt
  10709. C cleanme\.txt"
  10710. dotest clean-18 "${testcvs} -q update -C" \
  10711. "(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
  10712. U cleanme\.txt"
  10713. dotest clean-19 "cat .#cleanme.txt.1.1" \
  10714. "The usual boring test text\.
  10715. fish"
  10716. # Done. Clean up.
  10717. cd ../..
  10718. rm -rf 1
  10719. rm -rf ${CVSROOT_DIRNAME}/first-dir
  10720. ;;
  10721. modules)
  10722. # Tests of various ways to define and use modules.
  10723. # Roadmap to various modules tests:
  10724. # -a:
  10725. # error on incorrect placement: modules
  10726. # error combining with other options: modules2-a*
  10727. # infinite loops: modules148a1.1 - modules148a1.2
  10728. # use to specify a file more than once: modules3
  10729. # use with ! feature: modules4
  10730. # regular modules: modules, modules2, cvsadm
  10731. # ampersand modules: modules2
  10732. # -s: modules.
  10733. # -d: modules, modules3, cvsadm
  10734. # -i, -o, -u, -e, -t: modules5
  10735. # slashes in module names: modules3
  10736. # invalid module definitions: modules6
  10737. ############################################################
  10738. # These tests are to make sure that administrative files get
  10739. # rebuilt, regardless of how and where files are checked
  10740. # out.
  10741. ############################################################
  10742. # Check out the whole repository
  10743. mkdir 1; cd 1
  10744. dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/checkoutlist
  10745. U CVSROOT/commitinfo
  10746. U CVSROOT/config
  10747. U CVSROOT/cvswrappers
  10748. U CVSROOT/editinfo
  10749. U CVSROOT/loginfo
  10750. U CVSROOT/modules
  10751. U CVSROOT/notify
  10752. U CVSROOT/rcsinfo
  10753. U CVSROOT/taginfo
  10754. U CVSROOT/verifymsg'
  10755. echo "# made a change" >>CVSROOT/modules
  10756. dotest modules-1d "${testcvs} -q ci -m add-modules" \
  10757. "Checking in CVSROOT/modules;
  10758. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  10759. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  10760. done
  10761. ${PROG} commit: Rebuilding administrative file database"
  10762. cd ..
  10763. rm -rf 1
  10764. ############################################################
  10765. # Check out CVSROOT
  10766. mkdir 1; cd 1
  10767. dotest modules-2 "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist
  10768. U CVSROOT/commitinfo
  10769. U CVSROOT/config
  10770. U CVSROOT/cvswrappers
  10771. U CVSROOT/editinfo
  10772. U CVSROOT/loginfo
  10773. U CVSROOT/modules
  10774. U CVSROOT/notify
  10775. U CVSROOT/rcsinfo
  10776. U CVSROOT/taginfo
  10777. U CVSROOT/verifymsg'
  10778. echo "# made a change" >>CVSROOT/modules
  10779. dotest modules-2d "${testcvs} -q ci -m add-modules" \
  10780. "Checking in CVSROOT/modules;
  10781. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  10782. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  10783. done
  10784. ${PROG} commit: Rebuilding administrative file database"
  10785. cd ..
  10786. rm -rf 1
  10787. ############################################################
  10788. # Check out CVSROOT in some other directory
  10789. mkdir ${CVSROOT_DIRNAME}/somedir
  10790. mkdir 1; cd 1
  10791. dotest modules-3 "${testcvs} -q co somedir" ''
  10792. cd somedir
  10793. dotest modules-3d "${testcvs} -q co CVSROOT" 'U CVSROOT/checkoutlist
  10794. U CVSROOT/commitinfo
  10795. U CVSROOT/config
  10796. U CVSROOT/cvswrappers
  10797. U CVSROOT/editinfo
  10798. U CVSROOT/loginfo
  10799. U CVSROOT/modules
  10800. U CVSROOT/notify
  10801. U CVSROOT/rcsinfo
  10802. U CVSROOT/taginfo
  10803. U CVSROOT/verifymsg'
  10804. echo "# made a change" >>CVSROOT/modules
  10805. dotest modules-3g "${testcvs} -q ci -m add-modules" \
  10806. "Checking in CVSROOT/modules;
  10807. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  10808. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  10809. done
  10810. ${PROG} commit: Rebuilding administrative file database"
  10811. cd ../..
  10812. rm -rf 1
  10813. rm -rf ${CVSROOT_DIRNAME}/somedir
  10814. ############################################################
  10815. # end rebuild tests
  10816. ############################################################
  10817. mkdir ${CVSROOT_DIRNAME}/first-dir
  10818. mkdir 1
  10819. cd 1
  10820. dotest modules-143 "${testcvs} -q co first-dir" ""
  10821. cd first-dir
  10822. mkdir subdir
  10823. dotest modules-143a "${testcvs} add subdir" \
  10824. "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
  10825. cd subdir
  10826. mkdir ssdir
  10827. dotest modules-143b "${testcvs} add ssdir" \
  10828. "Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
  10829. touch a b
  10830. dotest modules-144 "${testcvs} add a b" \
  10831. "${PROG} add: scheduling file .a. for addition
  10832. ${PROG} add: scheduling file .b. for addition
  10833. ${PROG} add: use .${PROG} commit. to add these files permanently"
  10834. dotest modules-145 "${testcvs} ci -m added" \
  10835. "${PROG} [a-z]*: Examining .
  10836. ${PROG} [a-z]*: Examining ssdir
  10837. RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/a,v
  10838. done
  10839. Checking in a;
  10840. ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
  10841. initial revision: 1\.1
  10842. done
  10843. RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/b,v
  10844. done
  10845. Checking in b;
  10846. ${CVSROOT_DIRNAME}/first-dir/subdir/b,v <-- b
  10847. initial revision: 1\.1
  10848. done"
  10849. cd ..
  10850. dotest modules-146 "${testcvs} -q co CVSROOT" \
  10851. "U CVSROOT/checkoutlist
  10852. U CVSROOT/commitinfo
  10853. U CVSROOT/config
  10854. U CVSROOT/cvswrappers
  10855. U CVSROOT/editinfo
  10856. U CVSROOT/loginfo
  10857. U CVSROOT/modules
  10858. U CVSROOT/notify
  10859. U CVSROOT/rcsinfo
  10860. U CVSROOT/taginfo
  10861. U CVSROOT/verifymsg"
  10862. # Here we test that CVS can deal with CVSROOT (whose repository
  10863. # is at top level) in the same directory as subdir (whose repository
  10864. # is a subdirectory of first-dir). TODO: Might want to check that
  10865. # files can actually get updated in this state.
  10866. dotest modules-147 "${testcvs} -q update" ""
  10867. cat >CVSROOT/modules <<EOF
  10868. realmodule first-dir/subdir a
  10869. dirmodule first-dir/subdir
  10870. namedmodule -d nameddir first-dir/subdir
  10871. aliasmodule -a first-dir/subdir/a
  10872. aliasnested -a first-dir/subdir/ssdir
  10873. topfiles -a first-dir/file1 first-dir/file2
  10874. world -a .
  10875. statusmod -s Mungeable
  10876. # Check for ability to block infinite loops.
  10877. infinitealias -a infinitealias
  10878. # Prior to 1.11.12 & 1.12.6, the infinite alias loop check didn't strip
  10879. # slashes or work if a module called a module which then called itself
  10880. # (A -> A was blocked, but not A -> B -> A or deeper).
  10881. infinitealias2 -a infinitealias2/
  10882. infinitealias3 -a infinitealias4/
  10883. infinitealias4 -a aliasmodule infinitealias5
  10884. infinitealias5 -a infinitealias3/
  10885. # Options must come before arguments. It is possible this should
  10886. # be relaxed at some point (though the result would be bizarre for
  10887. # -a); for now test the current behavior.
  10888. bogusalias first-dir/subdir/a -a
  10889. EOF
  10890. dotest modules-148 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
  10891. "Checking in CVSROOT/modules;
  10892. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  10893. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  10894. done
  10895. ${PROG} commit: Rebuilding administrative file database"
  10896. cd ..
  10897. # The "statusmod" module contains an error; trying to use it
  10898. # will produce "modules file missing directory" I think.
  10899. # However, that shouldn't affect the ability of "cvs co -c" or
  10900. # "cvs co -s" to do something reasonable with it.
  10901. dotest modules-148a0 "${testcvs} co -c" 'aliasmodule -a first-dir/subdir/a
  10902. aliasnested -a first-dir/subdir/ssdir
  10903. bogusalias first-dir/subdir/a -a
  10904. dirmodule first-dir/subdir
  10905. infinitealias -a infinitealias
  10906. infinitealias2 -a infinitealias2/
  10907. infinitealias3 -a infinitealias4/
  10908. infinitealias4 -a aliasmodule infinitealias5
  10909. infinitealias5 -a infinitealias3/
  10910. namedmodule -d nameddir first-dir/subdir
  10911. realmodule first-dir/subdir a
  10912. statusmod -s Mungeable
  10913. topfiles -a first-dir/file1 first-dir/file2
  10914. world -a \.'
  10915. # There is code in modules.c:save_d which explicitly skips
  10916. # modules defined with -a, which is why aliasmodule is not
  10917. # listed.
  10918. dotest modules-148a1 "${testcvs} co -s" \
  10919. 'statusmod Mungeable
  10920. bogusalias NONE first-dir/subdir/a -a
  10921. dirmodule NONE first-dir/subdir
  10922. namedmodule NONE first-dir/subdir
  10923. realmodule NONE first-dir/subdir a'
  10924. # Check that infinite loops are avoided
  10925. dotest modules-148a1.1 "${testcvs} co infinitealias" \
  10926. "$PROG checkout: module \`infinitealias' in modules file contains infinite loop" \
  10927. "$PROG server: module \`infinitealias' in modules file contains infinite loop
  10928. $PROG checkout: module \`infinitealias' in modules file contains infinite loop"
  10929. # Prior to 1.11.12 & 1.12.6, the inifinte alias loop check did not
  10930. # strip slashes.
  10931. dotest modules-148a1.2 "${testcvs} co infinitealias2" \
  10932. "$PROG checkout: module \`infinitealias2' in modules file contains infinite loop" \
  10933. "$PROG server: module \`infinitealias2' in modules file contains infinite loop
  10934. $PROG checkout: module \`infinitealias2' in modules file contains infinite loop"
  10935. # Prior to 1.11.12 & 1.12.6, the inifinte alias loop check did not
  10936. # notice when A -> B -> A, it only noticed A -> A.
  10937. dotest modules-148a1.3 "${testcvs} co infinitealias3/" \
  10938. "$PROG checkout: module \`infinitealias3' in modules file contains infinite loop" \
  10939. "$PROG server: module \`infinitealias3' in modules file contains infinite loop
  10940. $PROG checkout: module \`infinitealias3' in modules file contains infinite loop"
  10941. # Test that real modules check out to realmodule/a, not subdir/a.
  10942. dotest modules-149a1 "${testcvs} co realmodule" "U realmodule/a"
  10943. dotest modules-149a2 "test -d realmodule && test -f realmodule/a" ""
  10944. dotest_fail modules-149a3 "test -f realmodule/b" ""
  10945. dotest modules-149a4 "${testcvs} -q co realmodule" ""
  10946. dotest modules-149a5 "echo yes | ${testcvs} release -d realmodule" \
  10947. "You have \[0\] altered files in this repository\.
  10948. Are you sure you want to release (and delete) directory .realmodule.: "
  10949. dotest_fail modules-149b1 "${testcvs} co realmodule/a" \
  10950. "${PROG}"' checkout: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
  10951. "${PROG}"' server: module `realmodule/a'\'' is a request for a file in a module which is not a directory
  10952. '"${PROG}"' \[checkout aborted\]: cannot expand modules'
  10953. # Now test the ability to check out a single file from a directory
  10954. dotest modules-150c "${testcvs} co dirmodule/a" "U dirmodule/a"
  10955. dotest modules-150d "test -d dirmodule && test -f dirmodule/a" ""
  10956. dotest_fail modules-150e "test -f dirmodule/b" ""
  10957. dotest modules-150f "echo yes | ${testcvs} release -d dirmodule" \
  10958. "You have \[0\] altered files in this repository\.
  10959. Are you sure you want to release (and delete) directory .dirmodule.: "
  10960. # Now test the ability to correctly reject a non-existent filename.
  10961. # For maximum studliness we would check that an error message is
  10962. # being output.
  10963. # We accept a zero exit status because it is what CVS does
  10964. # (Dec 95). Probably the exit status should be nonzero,
  10965. # however.
  10966. dotest modules-150g1 "${testcvs} co dirmodule/nonexist" \
  10967. "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared"
  10968. # We tolerate the creation of the dirmodule directory, since that
  10969. # is what CVS does, not because we view that as preferable to not
  10970. # creating it.
  10971. dotest_fail modules-150g2 "test -f dirmodule/a || test -f dirmodule/b" ""
  10972. rm -r dirmodule
  10973. # Now test that a module using -d checks out to the specified
  10974. # directory.
  10975. dotest modules-150h1 "${testcvs} -q co namedmodule" \
  10976. 'U nameddir/a
  10977. U nameddir/b'
  10978. dotest modules-150h2 "test -f nameddir/a && test -f nameddir/b" ""
  10979. echo add line >>nameddir/a
  10980. dotest modules-150h3 "${testcvs} -q co namedmodule" 'M nameddir/a'
  10981. rm nameddir/a
  10982. dotest modules-150h4 "${testcvs} -q co namedmodule" 'U nameddir/a'
  10983. dotest modules-150h99 "echo yes | ${testcvs} release -d nameddir" \
  10984. "You have \[0\] altered files in this repository\.
  10985. Are you sure you want to release (and delete) directory .nameddir.: "
  10986. # Now test that alias modules check out to subdir/a, not
  10987. # aliasmodule/a.
  10988. dotest modules-151 "${testcvs} co aliasmodule" ""
  10989. dotest_fail modules-152 "test -d aliasmodule" ""
  10990. echo abc >>first-dir/subdir/a
  10991. dotest modules-153 "${testcvs} -q co aliasmodule" "M first-dir/subdir/a"
  10992. cd ..
  10993. rm -r 1
  10994. mkdir 2
  10995. cd 2
  10996. dotest modules-155a0 "${testcvs} co aliasnested" \
  10997. "${PROG} checkout: Updating first-dir/subdir/ssdir"
  10998. dotest modules-155a1 "test -d first-dir" ''
  10999. dotest modules-155a2 "test -d first-dir/subdir" ''
  11000. dotest modules-155a3 "test -d first-dir/subdir/ssdir" ''
  11001. # Test that nothing extraneous got created.
  11002. dotest modules-155a4 "ls" "first-dir" \
  11003. "CVS
  11004. first-dir"
  11005. cd ..
  11006. rm -r 2
  11007. # Test checking out everything.
  11008. mkdir 1
  11009. cd 1
  11010. dotest modules-155b "${testcvs} -q co world" \
  11011. "U CVSROOT/${DOTSTAR}
  11012. U first-dir/subdir/a
  11013. U first-dir/subdir/b"
  11014. cd ..
  11015. rm -r 1
  11016. # Test checking out a module which lists at least two
  11017. # specific files twice. At one time, this failed over
  11018. # remote CVS.
  11019. mkdir 1
  11020. cd 1
  11021. dotest modules-155c1 "${testcvs} -q co first-dir" \
  11022. "U first-dir/subdir/a
  11023. U first-dir/subdir/b"
  11024. cd first-dir
  11025. echo 'first revision' > file1
  11026. echo 'first revision' > file2
  11027. dotest modules-155c2 "${testcvs} add file1 file2" \
  11028. "${PROG}"' add: scheduling file `file1'\'' for addition
  11029. '"${PROG}"' add: scheduling file `file2'\'' for addition
  11030. '"${PROG}"' add: use .'"${PROG}"' commit. to add these files permanently'
  11031. dotest modules-155c3 "${testcvs} -q ci -m add-it" \
  11032. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  11033. done
  11034. Checking in file1;
  11035. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  11036. initial revision: 1\.1
  11037. done
  11038. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  11039. done
  11040. Checking in file2;
  11041. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  11042. initial revision: 1\.1
  11043. done"
  11044. cd ..
  11045. rm -r first-dir
  11046. dotest modules-155c4 "${testcvs} -q co topfiles" \
  11047. "U first-dir/file1
  11048. U first-dir/file2"
  11049. dotest modules-155c5 "${testcvs} -q co topfiles" ""
  11050. # Make sure the right thing happens if we remove a file.
  11051. cd first-dir
  11052. dotest modules-155c6 "${testcvs} -q rm -f file1" \
  11053. "${PROG} remove: use .${PROG} commit. to remove this file permanently"
  11054. dotest modules-155c7 "${testcvs} -q ci -m remove-it" \
  11055. "Removing file1;
  11056. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  11057. new revision: delete; previous revision: 1\.1
  11058. done"
  11059. cd ..
  11060. rm -r first-dir
  11061. dotest modules-155c8 "${testcvs} -q co topfiles" \
  11062. "${PROG} checkout: warning: first-dir/file1 is not (any longer) pertinent
  11063. U first-dir/file2"
  11064. cd ..
  11065. rm -r 1
  11066. rm -rf ${CVSROOT_DIRNAME}/first-dir
  11067. ;;
  11068. modules2)
  11069. # More tests of modules, in particular the & feature.
  11070. mkdir 1; cd 1
  11071. dotest modules2-setup-1 "${testcvs} -q co -l ." ''
  11072. mkdir first-dir second-dir third-dir
  11073. dotest modules2-setup-2 \
  11074. "${testcvs} add first-dir second-dir third-dir" \
  11075. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository
  11076. Directory ${CVSROOT_DIRNAME}/second-dir added to the repository
  11077. Directory ${CVSROOT_DIRNAME}/third-dir added to the repository"
  11078. cd third-dir
  11079. touch file3
  11080. dotest modules2-setup-3 "${testcvs} add file3" \
  11081. "${PROG} add: scheduling file .file3. for addition
  11082. ${PROG} add: use .${PROG} commit. to add this file permanently"
  11083. dotest modules2-setup-4 "${testcvs} -q ci -m add file3" \
  11084. "RCS file: ${CVSROOT_DIRNAME}/third-dir/file3,v
  11085. done
  11086. Checking in file3;
  11087. ${CVSROOT_DIRNAME}/third-dir/file3,v <-- file3
  11088. initial revision: 1\.1
  11089. done"
  11090. cd ../..
  11091. rm -r 1
  11092. mkdir 1
  11093. cd 1
  11094. dotest modules2-1 "${testcvs} -q co CVSROOT/modules" \
  11095. 'U CVSROOT/modules'
  11096. cd CVSROOT
  11097. cat >> modules << EOF
  11098. ampermodule &first-dir &second-dir
  11099. combmodule third-dir file3 &first-dir
  11100. ampdirmod -d newdir &first-dir &second-dir
  11101. badmod -d newdir
  11102. messymod first-dir &messymodchild
  11103. messymodchild -d sdir/child second-dir
  11104. EOF
  11105. # Depending on whether the user also ran the modules test
  11106. # we will be checking in revision 1.2 or 1.3.
  11107. dotest modules2-2 "${testcvs} -q ci -m add-modules" \
  11108. "Checking in modules;
  11109. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  11110. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  11111. done
  11112. ${PROG} commit: Rebuilding administrative file database"
  11113. cd ..
  11114. dotest modules2-3 "${testcvs} -q co ampermodule" ''
  11115. dotest modules2-4 "test -d ampermodule/first-dir" ''
  11116. dotest modules2-5 "test -d ampermodule/second-dir" ''
  11117. # Test ability of cvs release to handle multiple arguments
  11118. # See comment at "release" for list of other cvs release tests.
  11119. cd ampermodule
  11120. if ${testcvs} release -d first-dir second-dir <<EOF >>${LOGFILE}
  11121. yes
  11122. yes
  11123. EOF
  11124. then
  11125. pass modules2-6
  11126. else
  11127. fail modules2-6
  11128. fi
  11129. dotest_fail modules2-7 "test -d first-dir" ''
  11130. dotest_fail modules2-8 "test -d second-dir" ''
  11131. cd ..
  11132. # There used to be a nasty-hack that made CVS skip creation of the
  11133. # module dir (in this case ampermodule) when -n was specified
  11134. dotest modules2-ampermod-1 "${testcvs} -q co -n ampermodule" ''
  11135. dotest modules2-ampermod-2 "test -d ampermodule/first-dir" ''
  11136. dotest modules2-ampermod-3 "test -d ampermodule/second-dir" ''
  11137. # Test release of a module
  11138. if echo yes |${testcvs} release -d ampermodule >>${LOGFILE}; then
  11139. pass modules2-ampermod-release-1
  11140. else
  11141. fail modules2-ampermod-release-1
  11142. fi
  11143. dotest_fail modules2-ampermod-release-2 "test -d ampermodule" ''
  11144. # and the '-n' test again, but in conjunction with '-d'
  11145. dotest modules2-ampermod-4 "${testcvs} -q co -n -d newname ampermodule" ''
  11146. dotest modules2-ampermod-5 "test -d newname/first-dir" ''
  11147. dotest modules2-ampermod-6 "test -d newname/second-dir" ''
  11148. rm -rf newname
  11149. # Now we create another directory named first-dir and make
  11150. # sure that CVS doesn't get them mixed up.
  11151. mkdir first-dir
  11152. # Note that this message should say "Updating ampermodule/first-dir"
  11153. # I suspect. This is a long-standing behavior/bug....
  11154. dotest modules2-9 "${testcvs} co ampermodule" \
  11155. "${PROG} checkout: Updating first-dir
  11156. ${PROG} checkout: Updating second-dir"
  11157. touch ampermodule/first-dir/amper1
  11158. cd ampermodule
  11159. dotest modules2-10 "${testcvs} add first-dir/amper1" \
  11160. "${PROG} add: scheduling file .first-dir/amper1. for addition
  11161. ${PROG} add: use .${PROG} commit. to add this file permanently"
  11162. cd ..
  11163. # As with the "Updating xxx" message, the "U first-dir/amper1"
  11164. # message (instead of "U ampermodule/first-dir/amper1") is
  11165. # rather fishy.
  11166. dotest modules2-12 "${testcvs} co ampermodule" \
  11167. "${PROG} checkout: Updating first-dir
  11168. A first-dir/amper1
  11169. ${PROG} checkout: Updating second-dir"
  11170. if $remote; then
  11171. dotest modules2-13 "${testcvs} -q ci -m add-it ampermodule" \
  11172. "RCS file: ${CVSROOT_DIRNAME}/first-dir/amper1,v
  11173. done
  11174. Checking in ampermodule/first-dir/amper1;
  11175. ${CVSROOT_DIRNAME}/first-dir/amper1,v <-- amper1
  11176. initial revision: 1\.1
  11177. done"
  11178. else
  11179. # Trying this as above led to a "protocol error" message.
  11180. # Work around this bug.
  11181. cd ampermodule
  11182. dotest modules2-13 "${testcvs} -q ci -m add-it" \
  11183. "RCS file: ${CVSROOT_DIRNAME}/first-dir/amper1,v
  11184. done
  11185. Checking in first-dir/amper1;
  11186. ${CVSROOT_DIRNAME}/first-dir/amper1,v <-- amper1
  11187. initial revision: 1\.1
  11188. done"
  11189. cd ..
  11190. fi
  11191. cd ..
  11192. rm -r 1
  11193. # Now test the "combmodule" module (combining regular modules
  11194. # and ampersand modules in the same module definition).
  11195. mkdir 1; cd 1
  11196. dotest modules2-14 "${testcvs} co combmodule" \
  11197. "U combmodule/file3
  11198. ${PROG} checkout: Updating first-dir
  11199. U first-dir/amper1"
  11200. dotest modules2-15 "test -f combmodule/file3" ""
  11201. dotest modules2-16 "test -f combmodule/first-dir/amper1" ""
  11202. cd combmodule
  11203. rm -r first-dir
  11204. # At least for now there is no way to tell CVS that
  11205. # some files/subdirectories come from one repository directory,
  11206. # and others from another.
  11207. # This seems like a pretty sensible behavior to me, in the
  11208. # sense that first-dir doesn't "really" exist within
  11209. # third-dir, so CVS just acts as if there is nothing there
  11210. # to do.
  11211. dotest modules2-17 "${testcvs} update -d" \
  11212. "${PROG} update: Updating \."
  11213. cd ..
  11214. dotest modules2-18 "${testcvs} -q co combmodule" \
  11215. "U first-dir/amper1"
  11216. dotest modules2-19 "test -f combmodule/first-dir/amper1" ""
  11217. cd ..
  11218. rm -r 1
  11219. # Now test the "ampdirmod" and "badmod" modules to be sure that
  11220. # options work with ampersand modules but don't prevent the
  11221. # "missing directory" error message.
  11222. mkdir 1; cd 1
  11223. dotest modules2-20 "${testcvs} co ampdirmod" \
  11224. "${PROG} checkout: Updating first-dir
  11225. U first-dir/amper1
  11226. ${PROG} checkout: Updating second-dir"
  11227. dotest modules2-21 "test -f newdir/first-dir/amper1" ""
  11228. dotest modules2-22 "test -d newdir/second-dir" ""
  11229. dotest_fail modules2-23 "${testcvs} co badmod" \
  11230. "${PROG} checkout: modules file missing directory for module badmod" \
  11231. "${PROG} server: modules file missing directory for module badmod
  11232. ${PROG} \[checkout aborted\]: cannot expand modules"
  11233. cd ..
  11234. rm -r 1
  11235. # Confirm that a rename with added depth nested in an ampersand
  11236. # module works.
  11237. mkdir 1; cd 1
  11238. dotest modules2-nestedrename-1 "${testcvs} -q co messymod" \
  11239. "U messymod/amper1"
  11240. dotest modules2-nestedrename-2 "test -d messymod/sdir" ''
  11241. dotest modules2-nestedrename-3 "test -d messymod/sdir/CVS" ''
  11242. dotest modules2-nestedrename-4 "test -d messymod/sdir/child" ''
  11243. dotest modules2-nestedrename-5 "test -d messymod/sdir/child/CVS" ''
  11244. cd ..; rm -r 1
  11245. # FIXME: client/server has a bug. It should be working like a local
  11246. # repository in this case, but fails to check out the second module
  11247. # in the list when a branch is specified.
  11248. mkdir 1; cd 1
  11249. dotest modules2-ampertag-setup-1 \
  11250. "${testcvs} -Q rtag tag first-dir second-dir third-dir" \
  11251. ''
  11252. dotest modules2-ampertag-1 "${testcvs} -q co -rtag ampermodule" \
  11253. "U first-dir/amper1"
  11254. if $remote; then
  11255. dotest_fail modules2-ampertag-2 "test -d ampermodule/second-dir" ''
  11256. dotest_fail modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
  11257. else
  11258. dotest modules2-ampertag-2 "test -d ampermodule/second-dir" ''
  11259. dotest modules2-ampertag-3 "test -d ampermodule/second-dir/CVS" ''
  11260. fi
  11261. cd ..; rm -r 1
  11262. # Test for tag files when an ampermod is renamed with more path
  11263. # elements than it started with.
  11264. #
  11265. # FIXME: This is currently broken in the remote case, possibly only
  11266. # because the messymodchild isn't being checked out at all.
  11267. mkdir 1; cd 1
  11268. # dotest modules2-tagfiles-setup-1 \
  11269. #"${testcvs} -Q rtag -b branch first-dir second-dir" \
  11270. #''
  11271. dotest modules2-tagfiles-1 "${testcvs} -q co -rtag messymod" \
  11272. "U messymod/amper1"
  11273. if $remote; then
  11274. dotest_fail modules2-tagfiles-2r "test -d messymod/sdir" ''
  11275. else
  11276. dotest modules2-tagfiles-2 "cat messymod/sdir/CVS/Tag" 'Ttag'
  11277. fi
  11278. cd ..; rm -r 1
  11279. # Test that CVS gives an error if one combines -a with
  11280. # other options.
  11281. # Probably would be better to break this out into a separate
  11282. # test. Although it is short, it shares no files/state with
  11283. # the rest of the modules2 tests.
  11284. mkdir 1; cd 1
  11285. dotest modules2-a0.5 "${testcvs} -q co CVSROOT/modules" \
  11286. 'U CVSROOT/modules'
  11287. cd CVSROOT
  11288. echo 'aliasopt -a -d onedir first-dir' >modules
  11289. dotest modules2-a0 "${testcvs} -q ci -m add-modules" \
  11290. "Checking in modules;
  11291. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  11292. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  11293. done
  11294. ${PROG} commit: Rebuilding administrative file database"
  11295. cd ..
  11296. dotest_fail modules2-a1 "${testcvs} -q co aliasopt" \
  11297. "${PROG} checkout: -a cannot be specified in the modules file along with other options" \
  11298. "${PROG} server: -a cannot be specified in the modules file along with other options
  11299. ${PROG} \[checkout aborted\]: cannot expand modules"
  11300. cd ..; rm -r 1
  11301. # Clean up.
  11302. rm -rf ${CVSROOT_DIRNAME}/first-dir
  11303. rm -rf ${CVSROOT_DIRNAME}/second-dir
  11304. rm -rf ${CVSROOT_DIRNAME}/third-dir
  11305. ;;
  11306. modules3)
  11307. # More tests of modules, in particular what happens if several
  11308. # modules point to the same file.
  11309. # First just set up a directory first-dir and a file file1 in it.
  11310. mkdir 1; cd 1
  11311. dotest modules3-0 "${testcvs} -q co -l ." ''
  11312. mkdir first-dir
  11313. dotest modules3-1 "${testcvs} add first-dir" \
  11314. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  11315. cd first-dir
  11316. echo file1 >file1
  11317. dotest modules3-2 "${testcvs} add file1" \
  11318. "${PROG} add: scheduling file \`file1' for addition
  11319. ${PROG} add: use '${PROG} commit' to add this file permanently"
  11320. dotest modules3-3 "${testcvs} -q ci -m add-it" \
  11321. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  11322. done
  11323. Checking in file1;
  11324. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  11325. initial revision: 1\.1
  11326. done"
  11327. cd ..
  11328. dotest modules3-4 "${testcvs} -q update -d CVSROOT" \
  11329. "U CVSROOT${DOTSTAR}"
  11330. cd CVSROOT
  11331. cat >modules <<EOF
  11332. mod1 -a first-dir/file1
  11333. bigmod -a mod1 first-dir/file1
  11334. namednest -d src/sub/dir first-dir
  11335. nestdeeper -d src/sub1/sub2/sub3/dir first-dir
  11336. nestshallow -d src/dir second-dir/suba/subb
  11337. path/in/modules &mod1
  11338. another/path/test -d another/path/test first-dir
  11339. EOF
  11340. dotest modules3-5 "${testcvs} -q ci -m add-modules" \
  11341. "Checking in modules;
  11342. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  11343. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  11344. done
  11345. ${PROG} commit: Rebuilding administrative file database"
  11346. cd ..
  11347. dotest modules3-6 "${testcvs} -q co bigmod" ''
  11348. rm -r first-dir
  11349. dotest modules3-7 "${testcvs} -q co bigmod" 'U first-dir/file1'
  11350. cd ..
  11351. rm -r 1
  11352. mkdir 1; cd 1
  11353. mkdir suba
  11354. mkdir suba/subb
  11355. # This fails to work remote (it doesn't notice the directories,
  11356. # I suppose because they contain no files). Bummer, especially
  11357. # considering this is a documented technique and everything.
  11358. dotest modules3-7a \
  11359. "${testcvs} import -m add-dirs second-dir tag1 tag2" \
  11360. "${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/suba
  11361. ${PROG} import: Importing ${CVSROOT_DIRNAME}/second-dir/suba/subb
  11362. No conflicts created by this import" "
  11363. No conflicts created by this import"
  11364. cd ..; rm -r 1
  11365. mkdir 1; cd 1
  11366. dotest modules3-7b "${testcvs} co second-dir" \
  11367. "${PROG} checkout: Updating second-dir
  11368. ${PROG} checkout: Updating second-dir/suba
  11369. ${PROG} checkout: Updating second-dir/suba/subb" \
  11370. "${PROG} checkout: Updating second-dir"
  11371. if $remote; then
  11372. cd second-dir
  11373. mkdir suba
  11374. dotest modules3-7-workaround1 "${testcvs} add suba" \
  11375. "Directory ${CVSROOT_DIRNAME}/second-dir/suba added to the repository"
  11376. cd suba
  11377. mkdir subb
  11378. dotest modules3-7-workaround2 "${testcvs} add subb" \
  11379. "Directory ${CVSROOT_DIRNAME}/second-dir/suba/subb added to the repository"
  11380. cd ../..
  11381. fi
  11382. cd second-dir/suba/subb
  11383. touch fileb
  11384. dotest modules3-7c "${testcvs} add fileb" \
  11385. "${PROG} add: scheduling file .fileb. for addition
  11386. ${PROG} add: use .${PROG} commit. to add this file permanently"
  11387. dotest modules3-7d "${testcvs} -q ci -m add-it" \
  11388. "RCS file: ${CVSROOT_DIRNAME}/second-dir/suba/subb/fileb,v
  11389. done
  11390. Checking in fileb;
  11391. ${CVSROOT_DIRNAME}/second-dir/suba/subb/fileb,v <-- fileb
  11392. initial revision: 1\.1
  11393. done"
  11394. cd ../../..
  11395. cd ..; rm -r 1
  11396. mkdir 1
  11397. cd 1
  11398. dotest modules3-8 "${testcvs} -q co namednest" \
  11399. 'U src/sub/dir/file1'
  11400. dotest modules3-9 "test -f src/sub/dir/file1" ''
  11401. cd ..
  11402. rm -r 1
  11403. # Try the same thing, but with the directories nested even
  11404. # deeper (deeply enough so they are nested more deeply than
  11405. # the number of directories from / to ${TESTDIR}).
  11406. mkdir 1
  11407. cd 1
  11408. dotest modules3-10 "${testcvs} -q co nestdeeper" \
  11409. 'U src/sub1/sub2/sub3/dir/file1'
  11410. dotest modules3-11 "test -f src/sub1/sub2/sub3/dir/file1" ''
  11411. # While we are doing things like twisted uses of '/' (e.g.
  11412. # modules3-12), try this one.
  11413. if $remote; then
  11414. dotest_fail modules3-11b \
  11415. "${testcvs} -q update ${TESTDIR}/1/src/sub1/sub2/sub3/dir/file1" \
  11416. "absolute pathname .${TESTDIR}/1/src/sub1/sub2/sub3/dir. illegal for server"
  11417. fi # end of remote-only tests
  11418. cd ..
  11419. rm -r 1
  11420. # This one is almost too twisted for words. The pathname output
  11421. # in the message from "co" doesn't include the "path/in/modules",
  11422. # but those directories do get created (with no CVSADM except
  11423. # in "modules" which has a CVSNULLREPOS).
  11424. # I'm not sure anyone is relying on this nonsense or whether we
  11425. # need to keep doing it, but it is what CVS currently does...
  11426. # Skip it for remote; the remote code has the good sense to
  11427. # not deal with it (on the minus side it gives
  11428. # "internal error: repository string too short." (CVS 1.9) or
  11429. # "warning: server is not creating directories one at a time" (now)
  11430. # instead of a real error).
  11431. # I'm tempted to just make it a fatal error to have '/' in a
  11432. # module name. But see comments at modules3-16.
  11433. if $remote; then :; else
  11434. mkdir 1; cd 1
  11435. dotest modules3-12 "${testcvs} -q co path/in/modules" \
  11436. "U first-dir/file1"
  11437. dotest modules3-13 "test -f path/in/modules/first-dir/file1" ''
  11438. cd ..; rm -r 1
  11439. fi # end of tests skipped for remote
  11440. # Now here is where it used to get seriously bogus.
  11441. mkdir 1; cd 1
  11442. dotest modules3-14 \
  11443. "${testcvs} -q rtag tag1 path/in/modules" ''
  11444. # CVS used to create this even though rtag should *never* affect
  11445. # the directory current when it is called!
  11446. dotest_fail modules3-15 "test -d path/in/modules" ''
  11447. # Just for trivia's sake, rdiff was not similarly vulnerable
  11448. # because it passed 0 for run_module_prog to do_module.
  11449. cd ..; rm -r 1
  11450. # Some people seem to want this to work. I still suspect there
  11451. # are dark corners in slashes in module names. This probably wants
  11452. # more thought before we start hacking on CVS (one way or the other)
  11453. # or documenting this.
  11454. mkdir 2; cd 2
  11455. dotest modules3-16 "${testcvs} -q co another/path/test" \
  11456. "U another/path/test/file1"
  11457. dotest modules3-17 "cat another/path/test/file1" 'file1'
  11458. cd ..; rm -r 2
  11459. rm -rf ${CVSROOT_DIRNAME}/first-dir
  11460. rm -rf ${CVSROOT_DIRNAME}/second-dir
  11461. ;;
  11462. modules4)
  11463. # Some tests using the modules file with aliases that
  11464. # exclude particular directories.
  11465. mkdir 1; cd 1
  11466. dotest modules4-1 "${testcvs} -q co -l ." ''
  11467. mkdir first-dir
  11468. dotest modules4-2 "${testcvs} add first-dir" \
  11469. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  11470. cd first-dir
  11471. mkdir subdir subdir_long
  11472. dotest modules4-3 "${testcvs} add subdir subdir_long" \
  11473. "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository
  11474. Directory ${CVSROOT_DIRNAME}/first-dir/subdir_long added to the repository"
  11475. echo file1 > file1
  11476. dotest modules4-4 "${testcvs} add file1" \
  11477. "${PROG}"' add: scheduling file `file1'\'' for addition
  11478. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  11479. echo file2 > subdir/file2
  11480. dotest modules4-5 "${testcvs} add subdir/file2" \
  11481. "${PROG}"' add: scheduling file `subdir/file2'\'' for addition
  11482. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  11483. echo file3 > subdir_long/file3
  11484. dotest modules4-6 "${testcvs} add subdir_long/file3" \
  11485. "${PROG}"' add: scheduling file `subdir_long/file3'\'' for addition
  11486. '"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
  11487. dotest modules4-7 "${testcvs} -q ci -m add-it" \
  11488. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  11489. done
  11490. Checking in file1;
  11491. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  11492. initial revision: 1\.1
  11493. done
  11494. RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
  11495. done
  11496. Checking in subdir/file2;
  11497. ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v <-- file2
  11498. initial revision: 1\.1
  11499. done
  11500. RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir_long/file3,v
  11501. done
  11502. Checking in subdir_long/file3;
  11503. ${CVSROOT_DIRNAME}/first-dir/subdir_long/file3,v <-- file3
  11504. initial revision: 1\.1
  11505. done"
  11506. cd ..
  11507. dotest modules4-8 "${testcvs} -q update -d CVSROOT" \
  11508. "U CVSROOT${DOTSTAR}"
  11509. cd CVSROOT
  11510. cat >modules <<EOF
  11511. all -a first-dir
  11512. some -a !first-dir/subdir first-dir
  11513. other -a !first-dir/subdir !first-dir/subdir_long first-dir
  11514. somewhat -a first-dir !first-dir/subdir
  11515. EOF
  11516. dotest modules4-9 "${testcvs} -q ci -m add-modules" \
  11517. "Checking in modules;
  11518. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  11519. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  11520. done
  11521. ${PROG} commit: Rebuilding administrative file database"
  11522. cd ..
  11523. cd ..
  11524. mkdir 2; cd 2
  11525. dotest modules4-10 "${testcvs} -q co all" \
  11526. "U first-dir/file1
  11527. U first-dir/subdir/file2
  11528. U first-dir/subdir_long/file3"
  11529. rm -r first-dir
  11530. dotest modules4-11 "${testcvs} -q co some" \
  11531. "U first-dir/file1
  11532. U first-dir/subdir_long/file3"
  11533. dotest_fail modules4-12 "test -d first-dir/subdir" ''
  11534. dotest modules4-13 "test -d first-dir/subdir_long" ''
  11535. rm -r first-dir
  11536. if $remote; then
  11537. # But remote seems to do it the other way.
  11538. dotest modules4-14r-1 "${testcvs} -q co somewhat" \
  11539. "U first-dir/file1
  11540. U first-dir/subdir_long/file3"
  11541. dotest_fail modules4-14r-2 "test -d first-dir/subdir" ''
  11542. dotest modules4-14r-3 "test -d first-dir/subdir_long" ''
  11543. else
  11544. # This is strange behavior, in that the order of the
  11545. # "!first-dir/subdir" and "first-dir" matter, and it isn't
  11546. # clear that they should. I suspect it is long-standing
  11547. # strange behavior but I haven't verified that.
  11548. dotest modules4-14-1 "${testcvs} -q co somewhat" \
  11549. "U first-dir/file1
  11550. U first-dir/subdir/file2
  11551. U first-dir/subdir_long/file3"
  11552. dotest modules4-14-2 "test -d first-dir/subdir" ''
  11553. dotest modules4-14-3 "test -d first-dir/subdir_long" ''
  11554. fi
  11555. rm -r first-dir
  11556. dotest modules4-15 "${testcvs} -q co other" \
  11557. "U first-dir/file1"
  11558. dotest_fail modules4-16 "test -d first-dir/subdir" ''
  11559. dotest_fail modules4-17 "test -d first-dir/subdir_long" ''
  11560. rm -r first-dir
  11561. cd ..
  11562. rm -r 2
  11563. dotest modules4-18 "${testcvs} rtag tag some" \
  11564. "${PROG} rtag: Tagging first-dir
  11565. ${PROG} rtag: Ignoring first-dir/subdir
  11566. ${PROG} rtag: Tagging first-dir/subdir_long"
  11567. cd 1/first-dir/subdir
  11568. dotest modules4-19 "${testcvs} log file2" "
  11569. RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
  11570. Working file: file2
  11571. head: 1\.1
  11572. branch:
  11573. locks: strict
  11574. access list:
  11575. symbolic names:
  11576. keyword substitution: kv
  11577. total revisions: 1; selected revisions: 1
  11578. description:
  11579. ----------------------------
  11580. revision 1\.1
  11581. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  11582. add-it
  11583. ============================================================================="
  11584. if $keep; then
  11585. echo Keeping $TESTDIR and exiting due to --keep
  11586. exit 0
  11587. fi
  11588. cd ../../..
  11589. rm -r 1
  11590. rm -rf ${CVSROOT_DIRNAME}/first-dir
  11591. ;;
  11592. modules5)
  11593. # Test module programs
  11594. mkdir ${CVSROOT_DIRNAME}/first-dir
  11595. mkdir 1
  11596. cd 1
  11597. dotest modules5-1 "${testcvs} -q co first-dir" ""
  11598. cd first-dir
  11599. mkdir subdir
  11600. dotest modules5-2 "${testcvs} add subdir" \
  11601. "Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
  11602. cd subdir
  11603. mkdir ssdir
  11604. dotest modules5-3 "${testcvs} add ssdir" \
  11605. "Directory ${CVSROOT_DIRNAME}/first-dir/subdir/ssdir added to the repository"
  11606. touch a b
  11607. dotest modules5-4 "${testcvs} add a b" \
  11608. "${PROG} add: scheduling file .a. for addition
  11609. ${PROG} add: scheduling file .b. for addition
  11610. ${PROG} add: use .${PROG} commit. to add these files permanently"
  11611. dotest modules5-5 "${testcvs} ci -m added" \
  11612. "${PROG} [a-z]*: Examining .
  11613. ${PROG} [a-z]*: Examining ssdir
  11614. RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/a,v
  11615. done
  11616. Checking in a;
  11617. ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
  11618. initial revision: 1\.1
  11619. done
  11620. RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/b,v
  11621. done
  11622. Checking in b;
  11623. ${CVSROOT_DIRNAME}/first-dir/subdir/b,v <-- b
  11624. initial revision: 1\.1
  11625. done"
  11626. cd ..
  11627. dotest modules5-6 "${testcvs} -q co CVSROOT" \
  11628. "U CVSROOT/checkoutlist
  11629. U CVSROOT/commitinfo
  11630. U CVSROOT/config
  11631. U CVSROOT/cvswrappers
  11632. U CVSROOT/editinfo
  11633. U CVSROOT/loginfo
  11634. U CVSROOT/modules
  11635. U CVSROOT/notify
  11636. U CVSROOT/rcsinfo
  11637. U CVSROOT/taginfo
  11638. U CVSROOT/verifymsg"
  11639. # FIXCVS: The sleep in the following script helps avoid out of
  11640. # order messages, but we really need to figure out how to fix
  11641. # cvs to prevent them in the first place.
  11642. for i in checkout export tag; do
  11643. cat >> ${CVSROOT_DIRNAME}/$i.sh <<EOF
  11644. #! /bin/sh
  11645. sleep 1
  11646. echo "$i script invoked in \`pwd\`"
  11647. echo "args: \$@"
  11648. EOF
  11649. # Cygwin doesn't set premissions correctly over the Samba share.
  11650. if test -n "$remotehost"; then
  11651. $CVS_RSH $remotehost "chmod +x ${CVSROOT_DIRNAME}/$i.sh"
  11652. else
  11653. chmod +x ${CVSROOT_DIRNAME}/$i.sh
  11654. fi
  11655. done
  11656. OPTS="-o${CVSROOT_DIRNAME}/checkout.sh -e ${CVSROOT_DIRNAME}/export.sh -t${CVSROOT_DIRNAME}/tag.sh"
  11657. cat >CVSROOT/modules <<EOF
  11658. realmodule ${OPTS} first-dir/subdir a
  11659. dirmodule ${OPTS} first-dir/subdir
  11660. namedmodule -d nameddir ${OPTS} first-dir/subdir
  11661. EOF
  11662. dotest modules5-7 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
  11663. "" \
  11664. "Checking in CVSROOT/modules;
  11665. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  11666. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  11667. done
  11668. ${PROG} commit: Rebuilding administrative file database"
  11669. cd ..
  11670. rm -rf first-dir
  11671. # Test that real modules check out to realmodule/a, not subdir/a.
  11672. if $remote; then
  11673. # FIXCVS?
  11674. # Mac OSX 10.3 (Darwin ppc-osx1 5.5) fails here when $TMPDIR
  11675. # contains a symlink (it does not fail the local modules5-8).
  11676. # Since no other platforms are exhibiting the same problem, I
  11677. # suspect an issue with OSX and fork() or the like dereferencing
  11678. # the symlink, but it is possible it is something that could be
  11679. # fixed or worked around in CVS.
  11680. dotest modules5-8r "$testcvs co realmodule" \
  11681. "U realmodule/a
  11682. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
  11683. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11684. args: realmodule"
  11685. else
  11686. dotest modules5-8 "${testcvs} co realmodule" \
  11687. "U realmodule/a
  11688. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
  11689. checkout script invoked in ${TESTDIR}/1
  11690. args: realmodule"
  11691. fi
  11692. dotest modules5-9 "test -d realmodule && test -f realmodule/a" ""
  11693. dotest_fail modules5-10 "test -f realmodule/b" ""
  11694. if $remote; then
  11695. dotest modules5-11 "${testcvs} -q co realmodule" \
  11696. "checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11697. args: realmodule"
  11698. dotest modules5-12 "${testcvs} -q update" ''
  11699. echo "change" >>realmodule/a
  11700. dotest modules5-13 "${testcvs} -q ci -m." \
  11701. "Checking in realmodule/a;
  11702. ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
  11703. new revision: 1\.2; previous revision: 1\.1
  11704. done"
  11705. else
  11706. dotest modules5-11 "${testcvs} -q co realmodule" \
  11707. "checkout script invoked in ${TESTDIR}/1
  11708. args: realmodule"
  11709. dotest modules5-12 "${testcvs} -q update" ''
  11710. echo "change" >>realmodule/a
  11711. dotest modules5-13 "${testcvs} -q ci -m." \
  11712. "Checking in realmodule/a;
  11713. ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
  11714. new revision: 1\.2; previous revision: 1\.1
  11715. done"
  11716. fi
  11717. dotest modules5-14 "echo yes | ${testcvs} release -d realmodule" \
  11718. "You have \[0\] altered files in this repository\.
  11719. Are you sure you want to release (and delete) directory .realmodule.: "
  11720. dotest modules5-15 "${testcvs} -q rtag -Dnow MYTAG realmodule" \
  11721. "tag script invoked in ${TESTDIR}/1
  11722. args: realmodule MYTAG" \
  11723. "tag script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11724. args: realmodule MYTAG"
  11725. if $remote; then
  11726. dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
  11727. "U realmodule/a
  11728. export script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11729. args: realmodule"
  11730. else
  11731. dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
  11732. "U realmodule/a
  11733. export script invoked in ${TESTDIR}/1
  11734. args: realmodule"
  11735. fi
  11736. rm -r realmodule
  11737. dotest_fail modules5-17 "${testcvs} co realmodule/a" \
  11738. "${PROG}"' checkout: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
  11739. "${PROG}"' server: module `realmodule/a'\'' is a request for a file in a module which is not a directory
  11740. '"${PROG}"' \[checkout aborted\]: cannot expand modules'
  11741. # Now test the ability to check out a single file from a directory
  11742. if $remote; then
  11743. dotest modules5-18 "${testcvs} co dirmodule/a" \
  11744. "U dirmodule/a
  11745. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
  11746. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11747. args: dirmodule"
  11748. else
  11749. dotest modules5-18 "${testcvs} co dirmodule/a" \
  11750. "U dirmodule/a
  11751. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
  11752. checkout script invoked in ${TESTDIR}/1
  11753. args: dirmodule"
  11754. fi
  11755. dotest modules5-19 "test -d dirmodule && test -f dirmodule/a" ""
  11756. dotest_fail modules5-20 "test -f dirmodule/b" ""
  11757. dotest modules5-21 "echo yes | ${testcvs} release -d dirmodule" \
  11758. "You have \[0\] altered files in this repository\.
  11759. Are you sure you want to release (and delete) directory .dirmodule.: "
  11760. # Now test the ability to correctly reject a non-existent filename.
  11761. # For maximum studliness we would check that an error message is
  11762. # being output.
  11763. # We accept a zero exit status because it is what CVS does
  11764. # (Dec 95). Probably the exit status should be nonzero,
  11765. # however.
  11766. if $remote; then
  11767. dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
  11768. "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared
  11769. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
  11770. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11771. args: dirmodule"
  11772. else
  11773. dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
  11774. "${PROG} checkout: warning: new-born dirmodule/nonexist has disappeared
  11775. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
  11776. checkout script invoked in ${TESTDIR}/1
  11777. args: dirmodule"
  11778. fi
  11779. # We tolerate the creation of the dirmodule directory, since that
  11780. # is what CVS does, not because we view that as preferable to not
  11781. # creating it.
  11782. dotest_fail modules5-23 "test -f dirmodule/a || test -f dirmodule/b" ""
  11783. rm -r dirmodule
  11784. # Now test that a module using -d checks out to the specified
  11785. # directory.
  11786. if $remote; then
  11787. dotest modules5-24 "${testcvs} -q co namedmodule" \
  11788. "U nameddir/a
  11789. U nameddir/b
  11790. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11791. args: nameddir"
  11792. else
  11793. dotest modules5-24 "${testcvs} -q co namedmodule" \
  11794. "U nameddir/a
  11795. U nameddir/b
  11796. checkout script invoked in ${TESTDIR}/1
  11797. args: nameddir"
  11798. fi
  11799. dotest modules5-25 "test -f nameddir/a && test -f nameddir/b" ""
  11800. echo add line >>nameddir/a
  11801. # This seems suspicious: when we checkout an existing directory,
  11802. # the checkout script gets executed in addition to the update
  11803. # script. Is that by design or accident?
  11804. if $remote; then
  11805. dotest modules5-26 "${testcvs} -q co namedmodule" \
  11806. "M nameddir/a
  11807. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11808. args: nameddir"
  11809. else
  11810. dotest modules5-26 "${testcvs} -q co namedmodule" \
  11811. "M nameddir/a
  11812. checkout script invoked in ${TESTDIR}/1
  11813. args: nameddir"
  11814. fi
  11815. rm nameddir/a
  11816. if $remote; then
  11817. dotest modules5-27 "${testcvs} -q co namedmodule" \
  11818. "U nameddir/a
  11819. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11820. args: nameddir"
  11821. else
  11822. dotest modules5-27 "${testcvs} -q co namedmodule" \
  11823. "U nameddir/a
  11824. checkout script invoked in ${TESTDIR}/1
  11825. args: nameddir"
  11826. fi
  11827. dotest modules5-28 "echo yes | ${testcvs} release -d nameddir" \
  11828. "You have \[0\] altered files in this repository\.
  11829. Are you sure you want to release (and delete) directory .nameddir.: "
  11830. # Now try the same tests with -d on command line
  11831. # FIXCVS? The manual says the modules programs get the module name,
  11832. # but they really get the directory name.
  11833. if $remote; then
  11834. dotest modules5-29 "${testcvs} co -d mydir realmodule" \
  11835. "U mydir/a
  11836. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
  11837. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11838. args: mydir"
  11839. else
  11840. dotest modules5-29 "${testcvs} co -d mydir realmodule" \
  11841. "U mydir/a
  11842. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
  11843. checkout script invoked in ${TESTDIR}/1
  11844. args: mydir"
  11845. fi
  11846. dotest modules5-30 "test -d mydir && test -f mydir/a" ""
  11847. dotest_fail modules5-31 "test -d realmodule || test -f mydir/b" ""
  11848. if $remote; then
  11849. dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \
  11850. "checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11851. args: mydir"
  11852. dotest modules5-33 "${testcvs} -q update" ''
  11853. echo "change" >>mydir/a
  11854. dotest modules5-34 "${testcvs} -q ci -m." \
  11855. "Checking in mydir/a;
  11856. ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
  11857. new revision: 1\.3; previous revision: 1\.2
  11858. done"
  11859. else
  11860. dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \
  11861. "checkout script invoked in ${TESTDIR}/1
  11862. args: mydir"
  11863. dotest modules5-33 "${testcvs} -q update" ''
  11864. echo "change" >>mydir/a
  11865. dotest modules5-34 "${testcvs} -q ci -m." \
  11866. "Checking in mydir/a;
  11867. ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
  11868. new revision: 1\.3; previous revision: 1\.2
  11869. done"
  11870. fi
  11871. dotest modules5-35 "echo yes | ${testcvs} release -d mydir" \
  11872. "You have \[0\] altered files in this repository\.
  11873. Are you sure you want to release (and delete) directory .mydir.: "
  11874. if $remote; then
  11875. dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \
  11876. "tag script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11877. args: realmodule MYTAG2"
  11878. dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \
  11879. "U mydir/a
  11880. export script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11881. args: mydir"
  11882. else
  11883. dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \
  11884. "tag script invoked in ${TESTDIR}/1
  11885. args: realmodule MYTAG2"
  11886. dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \
  11887. "U mydir/a
  11888. export script invoked in ${TESTDIR}/1
  11889. args: mydir"
  11890. fi
  11891. rm -r mydir
  11892. # Now test the ability to check out a single file from a directory
  11893. if $remote; then
  11894. dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \
  11895. "U mydir/a
  11896. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
  11897. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11898. args: mydir"
  11899. else
  11900. dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \
  11901. "U mydir/a
  11902. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
  11903. checkout script invoked in ${TESTDIR}/1
  11904. args: mydir"
  11905. fi
  11906. dotest modules5-39 "test -d mydir && test -f mydir/a" ""
  11907. dotest_fail modules5-40 "test -d dirmodule || test -f mydir/b" ""
  11908. dotest modules5-41 "echo yes | ${testcvs} release -d mydir" \
  11909. "You have \[0\] altered files in this repository\.
  11910. Are you sure you want to release (and delete) directory .mydir.: "
  11911. # Now test the ability to correctly reject a non-existent filename.
  11912. # For maximum studliness we would check that an error message is
  11913. # being output.
  11914. # We accept a zero exit status because it is what CVS does
  11915. # (Dec 95). Probably the exit status should be nonzero,
  11916. # however.
  11917. if $remote; then
  11918. dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \
  11919. "${PROG} checkout: warning: new-born mydir/nonexist has disappeared
  11920. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
  11921. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11922. args: mydir"
  11923. else
  11924. dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \
  11925. "${PROG} checkout: warning: new-born mydir/nonexist has disappeared
  11926. ${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir..
  11927. checkout script invoked in ${TESTDIR}/1
  11928. args: mydir"
  11929. fi
  11930. # We tolerate the creation of the mydir directory, since that
  11931. # is what CVS does, not because we view that as preferable to not
  11932. # creating it.
  11933. dotest_fail modules5-43 "test -f mydir/a || test -f mydir/b" ""
  11934. rm -r mydir
  11935. if $remote; then
  11936. dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \
  11937. "U mydir/a
  11938. U mydir/b
  11939. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11940. args: mydir"
  11941. else
  11942. dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \
  11943. "U mydir/a
  11944. U mydir/b
  11945. checkout script invoked in ${TESTDIR}/1
  11946. args: mydir"
  11947. fi
  11948. dotest modules5-45 "test -f mydir/a && test -f mydir/b" ""
  11949. dotest_fail modules5-46 "test -d namedir"
  11950. echo add line >>mydir/a
  11951. # This seems suspicious: when we checkout an existing directory,
  11952. # the checkout script gets executed in addition to the update
  11953. # script. Is that by design or accident?
  11954. if $remote; then
  11955. dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \
  11956. "M mydir/a
  11957. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11958. args: mydir"
  11959. else
  11960. dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \
  11961. "M mydir/a
  11962. checkout script invoked in ${TESTDIR}/1
  11963. args: mydir"
  11964. fi
  11965. rm mydir/a
  11966. if $remote; then
  11967. dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \
  11968. "U mydir/a
  11969. checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
  11970. args: mydir"
  11971. else
  11972. dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \
  11973. "U mydir/a
  11974. checkout script invoked in ${TESTDIR}/1
  11975. args: mydir"
  11976. fi
  11977. dotest modules5-49 "echo yes | ${testcvs} release -d mydir" \
  11978. "You have \[0\] altered files in this repository\.
  11979. Are you sure you want to release (and delete) directory .mydir.: "
  11980. cd ..
  11981. rm -rf 1 ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/*.sh
  11982. ;;
  11983. modules6)
  11984. #
  11985. # Test invalid module definitions
  11986. #
  11987. # See the header comment for the `modules' test for an index of
  11988. # the complete suite of modules tests.
  11989. #
  11990. #
  11991. # There was a bug in CVS through 1.11.1p1 where a bad module name
  11992. # would cause the previous line to be parsed as the module
  11993. # definition. This test proves this doesn't happen anymore.
  11994. #
  11995. mkdir modules6
  11996. cd modules6
  11997. dotest module6-setup-1 "${testcvs} -Q co CVSROOT" ""
  11998. cd CVSROOT
  11999. echo "longmodulename who cares" >modules
  12000. echo "badname" >>modules
  12001. # This test almost isn't setup since it generates the error message
  12002. # we are looking for if `-Q' isn't specified, but I want to test the
  12003. # filename in the message later.
  12004. dotest modules6-setup-2 "${testcvs} -Q ci -mbad-modules" \
  12005. "Checking in modules;
  12006. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  12007. new revision: [0-9.]*; previous revision: [0-9.]*
  12008. done
  12009. ${PROG} commit: Rebuilding administrative file database"
  12010. # Here's where CVS would report not being able to find `lename'
  12011. cd ..
  12012. dotest_fail modules6-1 "${testcvs} -q co badname" \
  12013. "${PROG} checkout: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules.
  12014. ${PROG} checkout: cannot find module .badname. - ignored" \
  12015. "${PROG} server: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules.
  12016. ${PROG} server: cannot find module .badname. - ignored
  12017. ${PROG} \[checkout aborted\]: cannot expand modules"
  12018. # cleanup
  12019. cd CVSROOT
  12020. echo "# empty modules file" >modules
  12021. dotest modules6-cleanup-1 "${testcvs} -Q ci -mempty-modules" \
  12022. "Checking in modules;
  12023. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  12024. new revision: [0-9.]*; previous revision: [0-9.]*
  12025. done
  12026. ${PROG} commit: Rebuilding administrative file database"
  12027. cd ../..
  12028. if $keep; then :; else
  12029. rm -r modules6
  12030. fi
  12031. ;;
  12032. modules7)
  12033. #
  12034. # Test tag problems vs an empty CVSROOT/val-tags file
  12035. #
  12036. # See the header comment for the `modules' test for an index of
  12037. # the complete suite of modules tests.
  12038. #
  12039. mkdir modules7
  12040. cd modules7
  12041. dotest modules7-1 "$testcvs -Q co -d top ."
  12042. cd top
  12043. mkdir zero one
  12044. dotest modules7-2 "$testcvs -Q add zero one"
  12045. cd one
  12046. echo 'file1 contents' > file1
  12047. dotest modules7-2 "$testcvs -Q add file1"
  12048. dotest modules7-3 "$testcvs -Q ci -mnew file1" \
  12049. "RCS file: $CVSROOT_DIRNAME/one/file1,v
  12050. done
  12051. Checking in file1;
  12052. $CVSROOT_DIRNAME/one/file1,v <-- file1
  12053. initial revision: 1\.1
  12054. done"
  12055. dotest modules7-4 "$testcvs -Q tag mytag file1"
  12056. cd ../CVSROOT
  12057. echo 'all -a zero one' > modules
  12058. dotest modules7-5 "$testcvs -Q ci -mall-module" \
  12059. "Checking in modules;
  12060. $CVSROOT_DIRNAME/CVSROOT/modules,v <-- modules
  12061. new revision: [0-9.]*; previous revision: [0-9.]*
  12062. done
  12063. $PROG commit: Rebuilding administrative file database"
  12064. cd ../..
  12065. mkdir myexport
  12066. cd myexport
  12067. # FIXCVS: The export should NOT be aborted here
  12068. dotest_fail modules7-6 "$testcvs export -rmytag all" \
  12069. "$PROG \[export aborted\]: no such tag mytag"
  12070. cd ..
  12071. rm -fr myexport
  12072. mkdir myexport
  12073. cd myexport
  12074. # FIXCVS: Workaround is to have mytag listed in val-tags
  12075. echo 'mytag y' > $CVSROOT_DIRNAME/CVSROOT/val-tags
  12076. dotest modules7-7 "$testcvs export -rmytag all" \
  12077. "$PROG export: Updating zero
  12078. $PROG export: Updating one
  12079. U one/file1"
  12080. dotest modules7-8 'cat one/file1' 'file1 contents'
  12081. if $keep; then
  12082. echo Keeping $TESTDIR and exiting due to --keep
  12083. exit 0
  12084. fi
  12085. # cleanup
  12086. cd ../top/CVSROOT
  12087. echo "# empty modules file" >modules
  12088. dotest modules7-cleanup-1 "$testcvs -Q ci -mempty-modules" \
  12089. "Checking in modules;
  12090. $CVSROOT_DIRNAME/CVSROOT/modules,v <-- modules
  12091. new revision: [0-9.]*; previous revision: [0-9.]*
  12092. done
  12093. $PROG commit: Rebuilding administrative file database"
  12094. cd ../../..
  12095. rm -fr modules7
  12096. rm -rf $CVSROOT_DIRNAME/zero $CVSROOT_DIRNAME/one
  12097. ;;
  12098. mkmodules)
  12099. # When a file listed in checkoutlist doesn't exist, cvs-1.10.4
  12100. # would fail to remove the CVSROOT/.#[0-9]* temporary file it
  12101. # creates while mkmodules is in the process of trying to check
  12102. # out the missing file.
  12103. mkdir 1; cd 1
  12104. dotest mkmodules-temp-file-removal-1 "${testcvs} -Q co CVSROOT" ''
  12105. cd CVSROOT
  12106. echo no-such-file >> checkoutlist
  12107. dotest mkmodules-temp-file-removal-2 "${testcvs} -Q ci -m. checkoutlist" \
  12108. "Checking in checkoutlist;
  12109. $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
  12110. new revision: 1\.2; previous revision: 1\.1
  12111. done
  12112. ${PROG} commit: Rebuilding administrative file database"
  12113. dotest mkmodules-temp-file-removal-3 "echo $CVSROOT_DIRNAME/CVSROOT/.#[0-9]*" \
  12114. "$CVSROOT_DIRNAME/CVSROOT/\.#\[0-9\]\*"
  12115. # Versions 1.11.6 & 1.12.1 and earlier of CVS printed most of the
  12116. # white space included before error messages in checkoutlist.
  12117. echo "no-such-file Failed to update no-such-file." >checkoutlist
  12118. dotest mkmodules-error-message-1 "${testcvs} -Q ci -m. checkoutlist" \
  12119. "Checking in checkoutlist;
  12120. $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
  12121. new revision: 1\.3; previous revision: 1\.2
  12122. done
  12123. ${PROG} commit: Rebuilding administrative file database
  12124. ${PROG} commit: Failed to update no-such-file\."
  12125. # Versions 1.11.6 & 1.12.1 and earlier of CVS used the error string
  12126. # from the checkoutlist file as the format string passed to error()'s
  12127. # printf. Check that this is no longer the case by verifying that
  12128. # printf format patterns remain unchanged.
  12129. echo "no-such-file Failed to update %s %lx times because %s happened %d times." >checkoutlist
  12130. dotest mkmodules-error-message-2 "${testcvs} -Q ci -m. checkoutlist" \
  12131. "Checking in checkoutlist;
  12132. $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
  12133. new revision: 1\.4; previous revision: 1\.3
  12134. done
  12135. ${PROG} commit: Rebuilding administrative file database
  12136. ${PROG} commit: Failed to update %s %lx times because %s happened %d times\."
  12137. dotest mkmodules-cleanup-1 "${testcvs} -Q up -pr1.1 checkoutlist >checkoutlist"
  12138. dotest mkmodules-cleanup-2 "${testcvs} -Q ci -m. checkoutlist" \
  12139. "Checking in checkoutlist;
  12140. $CVSROOT_DIRNAME/CVSROOT/checkoutlist,v <-- checkoutlist
  12141. new revision: 1\.5; previous revision: 1\.4
  12142. done
  12143. ${PROG} commit: Rebuilding administrative file database"
  12144. cd ../..
  12145. rm -rf 1
  12146. ;;
  12147. co-d)
  12148. # Some tests of various permutations of co-d when directories exist
  12149. # and checkouts lengthen.
  12150. #
  12151. # Interestingly enough, these same tests pass when the directory
  12152. # lengthening happens via the modules file. Go figure.
  12153. module=co-d
  12154. mkdir $module; cd $module
  12155. mkdir top; cd top
  12156. dotest co-d-init-1 "$testcvs -Q co -l ."
  12157. mkdir $module
  12158. dotest co-d-init-2 "$testcvs -Q add $module"
  12159. cd $module
  12160. echo content >file1
  12161. echo different content >file2
  12162. dotest co-d-init-3 "$testcvs -Q add file1 file2"
  12163. dotest co-d-init-4 "$testcvs -Q ci -madd-em" \
  12164. "RCS file: $CVSROOT_DIRNAME/co-d/file1,v
  12165. done
  12166. Checking in file1;
  12167. $CVSROOT_DIRNAME/co-d/file1,v <-- file1
  12168. initial revision: 1\.1
  12169. done
  12170. RCS file: $CVSROOT_DIRNAME/co-d/file2,v
  12171. done
  12172. Checking in file2;
  12173. $CVSROOT_DIRNAME/co-d/file2,v <-- file2
  12174. initial revision: 1\.1
  12175. done"
  12176. cd ../..
  12177. mkdir 2; cd 2
  12178. dotest co-d-1 "$testcvs -q co -d dir $module" \
  12179. "U dir/file1
  12180. U dir/file2"
  12181. dotest co-d-1.2 "cat dir/CVS/Repository" "$module"
  12182. # FIXCVS: This should work. Correct expected result:
  12183. #
  12184. #"U dir2/sdir/file1
  12185. #U dir2/sdir/file2"
  12186. dotest_fail co-d-2 "$testcvs -q co -d dir2/sdir $module" \
  12187. "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir2': No such file or directory"
  12188. # FIXCVS:
  12189. # dotest co-d-2.2 "cat dir4/CVS/Repository" "CVSROOT/Emptydir"
  12190. # dotest co-d-2.3 "cat dir5/CVS/Repository" "$module"
  12191. mkdir dir3
  12192. dotest co-d-3 "$testcvs -q co -d dir3 $module" \
  12193. "U dir3/file1
  12194. U dir3/file2"
  12195. dotest co-d-3.2 "cat dir3/CVS/Repository" "$module"
  12196. if $remote; then
  12197. # FIXCVS: As for co-d-2.
  12198. mkdir dir4
  12199. dotest_fail co-d-4r "$testcvs -q co -d dir4/sdir $module" \
  12200. "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir4': No such file or directory"
  12201. # FIXCVS: As for co-d-2.
  12202. mkdir dir5
  12203. mkdir dir5/sdir
  12204. dotest_fail co-d-5r "$testcvs -q co -d dir5/sdir $module" \
  12205. "$PROG \[checkout aborted\]: could not change directory to requested checkout directory \`dir5': No such file or directory"
  12206. else
  12207. mkdir dir4
  12208. dotest co-d-4 "$testcvs -q co -d dir4/sdir $module" \
  12209. "U dir4/sdir/file1
  12210. U dir4/sdir/file2"
  12211. # CVS only creates administration directories for directories it
  12212. # creates, and the last portion of the path passed to -d
  12213. # regardless.
  12214. dotest_fail co-d-4.2 "test -d dir4/CVS"
  12215. dotest co-d-4.3 "cat dir4/sdir/CVS/Repository" "$module"
  12216. mkdir dir5
  12217. mkdir dir5/sdir
  12218. dotest co-d-5 "$testcvs -q co -d dir5/sdir $module" \
  12219. "U dir5/sdir/file1
  12220. U dir5/sdir/file2"
  12221. # CVS only creates administration directories for directories it
  12222. # creates, and the last portion of the path passed to -d
  12223. # regardless.
  12224. dotest_fail co-d-5.2 "test -d dir5/CVS"
  12225. dotest co-d-5.3 "cat dir5/sdir/CVS/Repository" "$module"
  12226. fi
  12227. # clean up
  12228. if $keep; then
  12229. echo Keeping ${TESTDIR} and exiting due to --keep
  12230. exit 0
  12231. fi
  12232. cd ../..
  12233. rm -rf $CVSROOT_DIRNAME/$module
  12234. rm -r $module
  12235. ;;
  12236. cvsadm)
  12237. # These test check the content of CVS' administrative
  12238. # files as they are checked out in various configurations.
  12239. # (As a side note, I'm not using the "-q" flag in any of
  12240. # this code, which should provide some extra checking for
  12241. # those messages which don't seem to be checked thoroughly
  12242. # anywhere else.) To do a thorough test, we need to make
  12243. # a bunch of modules in various configurations.
  12244. #
  12245. # <1mod> is a directory at the top level of cvsroot
  12246. # ``foo bar''
  12247. # <2mod> is a directory at the second level of cvsroot
  12248. # ``foo bar/baz''
  12249. # <1d1mod> is a directory at the top level which is
  12250. # checked out into another directory
  12251. # ``foo -d bar baz''
  12252. # <1d2mod> is a directory at the second level which is
  12253. # checked out into another directory
  12254. # ``foo -d bar baz/quux''
  12255. # <2d1mod> is a directory at the top level which is
  12256. # checked out into a directory that is two deep
  12257. # ``foo -d bar/baz quux''
  12258. # <2d2mod> is a directory at the second level which is
  12259. # checked out into a directory that is two deep
  12260. # ``foo -d bar/baz quux''
  12261. #
  12262. # The tests do each of these types separately and in twos.
  12263. # We also repeat each test -d flag for 1-deep and 2-deep
  12264. # directories.
  12265. #
  12266. # Each test should check the output for the Repository
  12267. # file, since that is the one which varies depending on
  12268. # the directory and how it was checked out.
  12269. #
  12270. # Yes, this is verbose, but at least it's very thorough.
  12271. # convenience variables
  12272. REP=${CVSROOT}
  12273. # First, set TopLevelAdmin=yes so we're sure to get
  12274. # top-level CVS directories.
  12275. mkdir 1; cd 1
  12276. dotest cvsadm-setup-1 "${testcvs} -q co CVSROOT/config" \
  12277. "U CVSROOT/config"
  12278. cd CVSROOT
  12279. echo "TopLevelAdmin=yes" >config
  12280. dotest cvsadm-setup-2 "${testcvs} -q ci -m yes-top-level" \
  12281. "Checking in config;
  12282. ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
  12283. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  12284. done
  12285. ${PROG} commit: Rebuilding administrative file database"
  12286. cd ../..
  12287. rm -r 1
  12288. # Second, check out the modules file and edit it.
  12289. mkdir 1; cd 1
  12290. dotest cvsadm-1 "${testcvs} co CVSROOT/modules" \
  12291. "U CVSROOT/modules"
  12292. # Test CVS/Root once. Since there is only one part of
  12293. # the code which writes CVS/Root files (Create_Admin),
  12294. # there is no point in testing this every time.
  12295. dotest cvsadm-1a "cat CVS/Root" ${REP}
  12296. dotest cvsadm-1b "cat CVS/Repository" "\."
  12297. dotest cvsadm-1c "cat CVSROOT/CVS/Root" ${REP}
  12298. dotest cvsadm-1d "cat CVSROOT/CVS/Repository" "CVSROOT"
  12299. # All of the defined module names begin with a number.
  12300. # All of the top-level directory names begin with "dir".
  12301. # All of the subdirectory names begin with "sub".
  12302. # All of the top-level modules begin with "mod".
  12303. echo "# Module defs for cvsadm tests" > CVSROOT/modules
  12304. echo "1mod mod1" >> CVSROOT/modules
  12305. echo "1mod-2 mod1-2" >> CVSROOT/modules
  12306. echo "2mod mod2/sub2" >> CVSROOT/modules
  12307. echo "2mod-2 mod2-2/sub2-2" >> CVSROOT/modules
  12308. echo "1d1mod -d dir1d1 mod1" >> CVSROOT/modules
  12309. echo "1d1mod-2 -d dir1d1-2 mod1-2" >> CVSROOT/modules
  12310. echo "1d2mod -d dir1d2 mod2/sub2" >> CVSROOT/modules
  12311. echo "1d2mod-2 -d dir1d2-2 mod2-2/sub2-2" >> CVSROOT/modules
  12312. echo "2d1mod -d dir2d1/sub2d1 mod1" >> CVSROOT/modules
  12313. echo "2d1mod-2 -d dir2d1-2/sub2d1-2 mod1-2" >> CVSROOT/modules
  12314. echo "2d2mod -d dir2d2/sub2d2 mod2/sub2" >> CVSROOT/modules
  12315. echo "2d2mod-2 -d dir2d2-2/sub2d2-2 mod2-2/sub2-2" >> CVSROOT/modules
  12316. dotest cvsadm-1e "${testcvs} ci -m add-modules" \
  12317. "${PROG} [a-z]*: Examining .
  12318. ${PROG} [a-z]*: Examining CVSROOT
  12319. Checking in CVSROOT/modules;
  12320. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  12321. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  12322. done
  12323. ${PROG} commit: Rebuilding administrative file database" \
  12324. "${PROG} commit: Examining .
  12325. ${PROG} commit: Examining CVSROOT"
  12326. rm -rf CVS CVSROOT;
  12327. # Create the various modules
  12328. dotest cvsadm-2 "${testcvs} -q co -l ." ''
  12329. mkdir mod1
  12330. mkdir mod1-2
  12331. mkdir mod2
  12332. mkdir mod2/sub2
  12333. mkdir mod2-2
  12334. mkdir mod2-2/sub2-2
  12335. dotest cvsadm-2a "${testcvs} add mod1 mod1-2 mod2 mod2/sub2 mod2-2 mod2-2/sub2-2" \
  12336. "Directory ${CVSROOT_DIRNAME}/mod1 added to the repository
  12337. Directory ${CVSROOT_DIRNAME}/mod1-2 added to the repository
  12338. Directory ${CVSROOT_DIRNAME}/mod2 added to the repository
  12339. Directory ${CVSROOT_DIRNAME}/mod2/sub2 added to the repository
  12340. Directory ${CVSROOT_DIRNAME}/mod2-2 added to the repository
  12341. Directory ${CVSROOT_DIRNAME}/mod2-2/sub2-2 added to the repository"
  12342. # Populate the directories for the halibut
  12343. echo "file1" > mod1/file1
  12344. echo "file1-2" > mod1-2/file1-2
  12345. echo "file2" > mod2/sub2/file2
  12346. echo "file2-2" > mod2-2/sub2-2/file2-2
  12347. dotest cvsadm-2aa "${testcvs} add mod1/file1 mod1-2/file1-2 mod2/sub2/file2 mod2-2/sub2-2/file2-2" \
  12348. "${PROG} add: scheduling file .mod1/file1. for addition
  12349. ${PROG} add: scheduling file .mod1-2/file1-2. for addition
  12350. ${PROG} add: scheduling file .mod2/sub2/file2. for addition
  12351. ${PROG} add: scheduling file .mod2-2/sub2-2/file2-2. for addition
  12352. ${PROG} add: use .${PROG} commit. to add these files permanently"
  12353. dotest cvsadm-2b "${testcvs} ci -m yup mod1 mod1-2 mod2 mod2-2" \
  12354. "${PROG} [a-z]*: Examining mod1
  12355. ${PROG} [a-z]*: Examining mod1-2
  12356. ${PROG} [a-z]*: Examining mod2
  12357. ${PROG} [a-z]*: Examining mod2/sub2
  12358. ${PROG} [a-z]*: Examining mod2-2
  12359. ${PROG} [a-z]*: Examining mod2-2/sub2-2
  12360. RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
  12361. done
  12362. Checking in mod1/file1;
  12363. ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
  12364. initial revision: 1.1
  12365. done
  12366. RCS file: ${CVSROOT_DIRNAME}/mod1-2/file1-2,v
  12367. done
  12368. Checking in mod1-2/file1-2;
  12369. ${CVSROOT_DIRNAME}/mod1-2/file1-2,v <-- file1-2
  12370. initial revision: 1.1
  12371. done
  12372. RCS file: ${CVSROOT_DIRNAME}/mod2/sub2/file2,v
  12373. done
  12374. Checking in mod2/sub2/file2;
  12375. ${CVSROOT_DIRNAME}/mod2/sub2/file2,v <-- file2
  12376. initial revision: 1.1
  12377. done
  12378. RCS file: ${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v
  12379. done
  12380. Checking in mod2-2/sub2-2/file2-2;
  12381. ${CVSROOT_DIRNAME}/mod2-2/sub2-2/file2-2,v <-- file2-2
  12382. initial revision: 1.1
  12383. done"
  12384. # Finished creating the modules -- clean up.
  12385. rm -rf CVS mod1 mod1-2 mod2 mod2-2
  12386. # Done.
  12387. ##################################################
  12388. ## Start the dizzying array of possibilities.
  12389. ## Begin with each module type separately.
  12390. ##################################################
  12391. # Pattern -- after each checkout, first check the top-level
  12392. # CVS directory. Then, check the directories in numerical
  12393. # order.
  12394. dotest cvsadm-3 "${testcvs} co 1mod" \
  12395. "${PROG} checkout: Updating 1mod
  12396. U 1mod/file1"
  12397. dotest cvsadm-3b "cat CVS/Repository" "\."
  12398. dotest cvsadm-3d "cat 1mod/CVS/Repository" "mod1"
  12399. rm -rf CVS 1mod
  12400. dotest cvsadm-4 "${testcvs} co 2mod" \
  12401. "${PROG} checkout: Updating 2mod
  12402. U 2mod/file2"
  12403. dotest cvsadm-4b "cat CVS/Repository" "\."
  12404. dotest cvsadm-4d "cat 2mod/CVS/Repository" "mod2/sub2"
  12405. rm -rf CVS 2mod
  12406. dotest cvsadm-5 "${testcvs} co 1d1mod" \
  12407. "${PROG} checkout: Updating dir1d1
  12408. U dir1d1/file1"
  12409. dotest cvsadm-5b "cat CVS/Repository" "\."
  12410. dotest cvsadm-5d "cat dir1d1/CVS/Repository" "mod1"
  12411. rm -rf CVS dir1d1
  12412. dotest cvsadm-6 "${testcvs} co 1d2mod" \
  12413. "${PROG} checkout: Updating dir1d2
  12414. U dir1d2/file2"
  12415. dotest cvsadm-6b "cat CVS/Repository" "\."
  12416. dotest cvsadm-6d "cat dir1d2/CVS/Repository" "mod2/sub2"
  12417. rm -rf CVS dir1d2
  12418. dotest cvsadm-7 "${testcvs} co 2d1mod" \
  12419. "${PROG} checkout: Updating dir2d1/sub2d1
  12420. U dir2d1/sub2d1/file1"
  12421. dotest cvsadm-7b "cat CVS/Repository" "\."
  12422. dotest cvsadm-7d "cat dir2d1/CVS/Repository" "\."
  12423. dotest cvsadm-7f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
  12424. rm -rf CVS dir2d1
  12425. dotest cvsadm-8 "${testcvs} co 2d2mod" \
  12426. "${PROG} checkout: Updating dir2d2/sub2d2
  12427. U dir2d2/sub2d2/file2"
  12428. dotest cvsadm-8b "cat CVS/Repository" "\."
  12429. dotest cvsadm-8d "cat dir2d2/CVS/Repository" "mod2"
  12430. dotest cvsadm-8f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  12431. rm -rf CVS dir2d2
  12432. ##################################################
  12433. ## You are in a shell script of twisted little
  12434. ## module combination statements, all alike.
  12435. ##################################################
  12436. ### 1mod
  12437. dotest cvsadm-9 "${testcvs} co 1mod 1mod-2" \
  12438. "${PROG} checkout: Updating 1mod
  12439. U 1mod/file1
  12440. ${PROG} checkout: Updating 1mod-2
  12441. U 1mod-2/file1-2"
  12442. # the usual for the top level
  12443. dotest cvsadm-9b "cat CVS/Repository" "\."
  12444. # the usual for 1mod
  12445. dotest cvsadm-9d "cat 1mod/CVS/Repository" "mod1"
  12446. # the usual for 1mod copy
  12447. dotest cvsadm-9f "cat 1mod-2/CVS/Repository" "mod1-2"
  12448. rm -rf CVS 1mod 1mod-2
  12449. # 1mod 2mod redmod bluemod
  12450. dotest cvsadm-10 "${testcvs} co 1mod 2mod" \
  12451. "${PROG} checkout: Updating 1mod
  12452. U 1mod/file1
  12453. ${PROG} checkout: Updating 2mod
  12454. U 2mod/file2"
  12455. # the usual for the top level
  12456. dotest cvsadm-10b "cat CVS/Repository" "\."
  12457. # the usual for 1mod
  12458. dotest cvsadm-10d "cat 1mod/CVS/Repository" "mod1"
  12459. # the usual for 2dmod
  12460. dotest cvsadm-10f "cat 2mod/CVS/Repository" "mod2/sub2"
  12461. rm -rf CVS 1mod 2mod
  12462. dotest cvsadm-11 "${testcvs} co 1mod 1d1mod" \
  12463. "${PROG} checkout: Updating 1mod
  12464. U 1mod/file1
  12465. ${PROG} checkout: Updating dir1d1
  12466. U dir1d1/file1"
  12467. # the usual for the top level
  12468. dotest cvsadm-11b "cat CVS/Repository" "\."
  12469. # the usual for 1mod
  12470. dotest cvsadm-11d "cat 1mod/CVS/Repository" "mod1"
  12471. # the usual for 1d1mod
  12472. dotest cvsadm-11f "cat dir1d1/CVS/Repository" "mod1"
  12473. rm -rf CVS 1mod dir1d1
  12474. dotest cvsadm-12 "${testcvs} co 1mod 1d2mod" \
  12475. "${PROG} checkout: Updating 1mod
  12476. U 1mod/file1
  12477. ${PROG} checkout: Updating dir1d2
  12478. U dir1d2/file2"
  12479. # the usual for the top level
  12480. dotest cvsadm-12b "cat CVS/Repository" "\."
  12481. # the usual for 1mod
  12482. dotest cvsadm-12d "cat 1mod/CVS/Repository" "mod1"
  12483. # the usual for 1d2mod
  12484. dotest cvsadm-12f "cat dir1d2/CVS/Repository" "mod2/sub2"
  12485. rm -rf CVS 1mod dir1d2
  12486. dotest cvsadm-13 "${testcvs} co 1mod 2d1mod" \
  12487. "${PROG} checkout: Updating 1mod
  12488. U 1mod/file1
  12489. ${PROG} checkout: Updating dir2d1/sub2d1
  12490. U dir2d1/sub2d1/file1"
  12491. # the usual for the top level
  12492. dotest cvsadm-13b "cat CVS/Repository" "\."
  12493. # the usual for 1mod
  12494. dotest cvsadm-13d "cat 1mod/CVS/Repository" "mod1"
  12495. # the usual for 2d1mod
  12496. dotest cvsadm-13f "cat dir2d1/CVS/Repository" "\."
  12497. dotest cvsadm-13h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
  12498. rm -rf CVS 1mod dir2d1
  12499. dotest cvsadm-14 "${testcvs} co 1mod 2d2mod" \
  12500. "${PROG} checkout: Updating 1mod
  12501. U 1mod/file1
  12502. ${PROG} checkout: Updating dir2d2/sub2d2
  12503. U dir2d2/sub2d2/file2"
  12504. # the usual for the top level
  12505. dotest cvsadm-14b "cat CVS/Repository" "\."
  12506. # the usual for 1mod
  12507. dotest cvsadm-14d "cat 1mod/CVS/Repository" "mod1"
  12508. # the usual for 2d2mod
  12509. dotest cvsadm-14f "cat dir2d2/CVS/Repository" "mod2"
  12510. dotest cvsadm-14h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  12511. rm -rf CVS 1mod dir2d2
  12512. ### 2mod
  12513. dotest cvsadm-15 "${testcvs} co 2mod 2mod-2" \
  12514. "${PROG} checkout: Updating 2mod
  12515. U 2mod/file2
  12516. ${PROG} checkout: Updating 2mod-2
  12517. U 2mod-2/file2-2"
  12518. # the usual for the top level
  12519. dotest cvsadm-15b "cat CVS/Repository" "\."
  12520. # the usual for 2mod
  12521. dotest cvsadm-15d "cat 2mod/CVS/Repository" "mod2/sub2"
  12522. # the usual for 2mod copy
  12523. dotest cvsadm-15f "cat 2mod-2/CVS/Repository" "mod2-2/sub2-2"
  12524. rm -rf CVS 2mod 2mod-2
  12525. dotest cvsadm-16 "${testcvs} co 2mod 1d1mod" \
  12526. "${PROG} checkout: Updating 2mod
  12527. U 2mod/file2
  12528. ${PROG} checkout: Updating dir1d1
  12529. U dir1d1/file1"
  12530. # the usual for the top level
  12531. dotest cvsadm-16b "cat CVS/Repository" "\."
  12532. # the usual for 2mod
  12533. dotest cvsadm-16d "cat 2mod/CVS/Repository" "mod2/sub2"
  12534. # the usual for 1d1mod
  12535. dotest cvsadm-16f "cat dir1d1/CVS/Repository" "mod1"
  12536. rm -rf CVS 2mod dir1d1
  12537. dotest cvsadm-17 "${testcvs} co 2mod 1d2mod" \
  12538. "${PROG} checkout: Updating 2mod
  12539. U 2mod/file2
  12540. ${PROG} checkout: Updating dir1d2
  12541. U dir1d2/file2"
  12542. # the usual for the top level
  12543. dotest cvsadm-17b "cat CVS/Repository" "\."
  12544. # the usual for 2mod
  12545. dotest cvsadm-17d "cat 2mod/CVS/Repository" "mod2/sub2"
  12546. # the usual for 1d2mod
  12547. dotest cvsadm-17f "cat dir1d2/CVS/Repository" "mod2/sub2"
  12548. rm -rf CVS 2mod dir1d2
  12549. dotest cvsadm-18 "${testcvs} co 2mod 2d1mod" \
  12550. "${PROG} checkout: Updating 2mod
  12551. U 2mod/file2
  12552. ${PROG} checkout: Updating dir2d1/sub2d1
  12553. U dir2d1/sub2d1/file1"
  12554. # the usual for the top level
  12555. dotest cvsadm-18b "cat CVS/Repository" "\."
  12556. # the usual for 2mod
  12557. dotest cvsadm-18d "cat 2mod/CVS/Repository" "mod2/sub2"
  12558. # the usual for 2d1mod
  12559. dotest cvsadm-18f "cat dir2d1/CVS/Repository" "\."
  12560. dotest cvsadm-18h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
  12561. rm -rf CVS 2mod dir2d1
  12562. dotest cvsadm-19 "${testcvs} co 2mod 2d2mod" \
  12563. "${PROG} checkout: Updating 2mod
  12564. U 2mod/file2
  12565. ${PROG} checkout: Updating dir2d2/sub2d2
  12566. U dir2d2/sub2d2/file2"
  12567. # the usual for the top level
  12568. dotest cvsadm-19b "cat CVS/Repository" "\."
  12569. # the usual for 2mod
  12570. dotest cvsadm-19d "cat 2mod/CVS/Repository" "mod2/sub2"
  12571. # the usual for 2d2mod
  12572. dotest cvsadm-19f "cat dir2d2/CVS/Repository" "mod2"
  12573. dotest cvsadm-19h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  12574. rm -rf CVS 2mod dir2d2
  12575. ### 1d1mod
  12576. dotest cvsadm-20 "${testcvs} co 1d1mod 1d1mod-2" \
  12577. "${PROG} checkout: Updating dir1d1
  12578. U dir1d1/file1
  12579. ${PROG} checkout: Updating dir1d1-2
  12580. U dir1d1-2/file1-2"
  12581. # the usual for the top level
  12582. dotest cvsadm-20b "cat CVS/Repository" "\."
  12583. # the usual for 1d1mod
  12584. dotest cvsadm-20d "cat dir1d1/CVS/Repository" "mod1"
  12585. # the usual for 1d1mod copy
  12586. dotest cvsadm-20f "cat dir1d1-2/CVS/Repository" "mod1-2"
  12587. rm -rf CVS dir1d1 dir1d1-2
  12588. dotest cvsadm-21 "${testcvs} co 1d1mod 1d2mod" \
  12589. "${PROG} checkout: Updating dir1d1
  12590. U dir1d1/file1
  12591. ${PROG} checkout: Updating dir1d2
  12592. U dir1d2/file2"
  12593. # the usual for the top level
  12594. dotest cvsadm-21b "cat CVS/Repository" "\."
  12595. # the usual for 1d1mod
  12596. dotest cvsadm-21d "cat dir1d1/CVS/Repository" "mod1"
  12597. # the usual for 1d2mod
  12598. dotest cvsadm-21f "cat dir1d2/CVS/Repository" "mod2/sub2"
  12599. rm -rf CVS dir1d1 dir1d2
  12600. dotest cvsadm-22 "${testcvs} co 1d1mod 2d1mod" \
  12601. "${PROG} checkout: Updating dir1d1
  12602. U dir1d1/file1
  12603. ${PROG} checkout: Updating dir2d1/sub2d1
  12604. U dir2d1/sub2d1/file1"
  12605. # the usual for the top level
  12606. dotest cvsadm-22b "cat CVS/Repository" "\."
  12607. # the usual for 1d1mod
  12608. dotest cvsadm-22d "cat dir1d1/CVS/Repository" "mod1"
  12609. # the usual for 2d1mod
  12610. dotest cvsadm-22f "cat dir2d1/CVS/Repository" "\."
  12611. dotest cvsadm-22h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
  12612. rm -rf CVS dir1d1 dir2d1
  12613. dotest cvsadm-23 "${testcvs} co 1d1mod 2d2mod" \
  12614. "${PROG} checkout: Updating dir1d1
  12615. U dir1d1/file1
  12616. ${PROG} checkout: Updating dir2d2/sub2d2
  12617. U dir2d2/sub2d2/file2"
  12618. # the usual for the top level
  12619. dotest cvsadm-23b "cat CVS/Repository" "\."
  12620. # the usual for 1d1mod
  12621. dotest cvsadm-23d "cat dir1d1/CVS/Repository" "mod1"
  12622. # the usual for 2d2mod
  12623. dotest cvsadm-23f "cat dir2d2/CVS/Repository" "mod2"
  12624. dotest cvsadm-23h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  12625. rm -rf CVS dir1d1 dir2d2
  12626. ### 1d2mod
  12627. dotest cvsadm-24 "${testcvs} co 1d2mod 1d2mod-2" \
  12628. "${PROG} checkout: Updating dir1d2
  12629. U dir1d2/file2
  12630. ${PROG} checkout: Updating dir1d2-2
  12631. U dir1d2-2/file2-2"
  12632. # the usual for the top level
  12633. dotest cvsadm-24b "cat CVS/Repository" "\."
  12634. # the usual for 1d2mod
  12635. dotest cvsadm-24d "cat dir1d2/CVS/Repository" "mod2/sub2"
  12636. # the usual for 1d2mod copy
  12637. dotest cvsadm-24f "cat dir1d2-2/CVS/Repository" "mod2-2/sub2-2"
  12638. rm -rf CVS dir1d2 dir1d2-2
  12639. dotest cvsadm-25 "${testcvs} co 1d2mod 2d1mod" \
  12640. "${PROG} checkout: Updating dir1d2
  12641. U dir1d2/file2
  12642. ${PROG} checkout: Updating dir2d1/sub2d1
  12643. U dir2d1/sub2d1/file1"
  12644. # the usual for the top level
  12645. dotest cvsadm-25b "cat CVS/Repository" "\."
  12646. # the usual for 1d2mod
  12647. dotest cvsadm-25d "cat dir1d2/CVS/Repository" "mod2/sub2"
  12648. # the usual for 2d1mod
  12649. dotest cvsadm-25f "cat dir2d1/CVS/Repository" "\."
  12650. dotest cvsadm-25h "cat dir2d1/sub2d1/CVS/Repository" "mod1"
  12651. rm -rf CVS dir1d2 dir2d1
  12652. dotest cvsadm-26 "${testcvs} co 1d2mod 2d2mod" \
  12653. "${PROG} checkout: Updating dir1d2
  12654. U dir1d2/file2
  12655. ${PROG} checkout: Updating dir2d2/sub2d2
  12656. U dir2d2/sub2d2/file2"
  12657. # the usual for the top level
  12658. dotest cvsadm-26b "cat CVS/Repository" "\."
  12659. # the usual for 1d2mod
  12660. dotest cvsadm-26d "cat dir1d2/CVS/Repository" "mod2/sub2"
  12661. # the usual for 2d2mod
  12662. dotest cvsadm-26f "cat dir2d2/CVS/Repository" "mod2"
  12663. dotest cvsadm-26h "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  12664. rm -rf CVS dir1d2 dir2d2
  12665. # 2d1mod
  12666. dotest cvsadm-27 "${testcvs} co 2d1mod 2d1mod-2" \
  12667. "${PROG} checkout: Updating dir2d1/sub2d1
  12668. U dir2d1/sub2d1/file1
  12669. ${PROG} checkout: Updating dir2d1-2/sub2d1-2
  12670. U dir2d1-2/sub2d1-2/file1-2"
  12671. # the usual for the top level
  12672. dotest cvsadm-27b "cat CVS/Repository" "\."
  12673. # the usual for 2d1mod
  12674. dotest cvsadm-27d "cat dir2d1/CVS/Repository" "\."
  12675. dotest cvsadm-27f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
  12676. # the usual for 2d1mod
  12677. dotest cvsadm-27h "cat dir2d1-2/CVS/Repository" "\."
  12678. dotest cvsadm-27j "cat dir2d1-2/sub2d1-2/CVS/Repository" "mod1-2"
  12679. rm -rf CVS dir2d1 dir2d1-2
  12680. dotest cvsadm-28 "${testcvs} co 2d1mod 2d2mod" \
  12681. "${PROG} checkout: Updating dir2d1/sub2d1
  12682. U dir2d1/sub2d1/file1
  12683. ${PROG} checkout: Updating dir2d2/sub2d2
  12684. U dir2d2/sub2d2/file2"
  12685. # the usual for the top level
  12686. dotest cvsadm-28b "cat CVS/Repository" "\."
  12687. # the usual for 2d1mod
  12688. dotest cvsadm-28d "cat dir2d1/CVS/Repository" "\."
  12689. dotest cvsadm-28f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
  12690. # the usual for 2d2mod
  12691. dotest cvsadm-28h "cat dir2d2/CVS/Repository" "mod2"
  12692. dotest cvsadm-28j "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  12693. rm -rf CVS dir2d1 dir2d2
  12694. # 2d2mod
  12695. dotest cvsadm-29 "${testcvs} co 2d2mod 2d2mod-2" \
  12696. "${PROG} checkout: Updating dir2d2/sub2d2
  12697. U dir2d2/sub2d2/file2
  12698. ${PROG} checkout: Updating dir2d2-2/sub2d2-2
  12699. U dir2d2-2/sub2d2-2/file2-2"
  12700. # the usual for the top level
  12701. dotest cvsadm-29b "cat CVS/Repository" "\."
  12702. # the usual for 2d2mod
  12703. dotest cvsadm-29d "cat dir2d2/CVS/Repository" "mod2"
  12704. dotest cvsadm-29f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  12705. # the usual for 2d2mod
  12706. dotest cvsadm-29h "cat dir2d2-2/CVS/Repository" "mod2-2"
  12707. dotest cvsadm-29j "cat dir2d2-2/sub2d2-2/CVS/Repository" \
  12708. "mod2-2/sub2-2"
  12709. rm -rf CVS dir2d2 dir2d2-2
  12710. ##################################################
  12711. ## And now, all of that again using the "-d" flag
  12712. ## on the command line.
  12713. ##################################################
  12714. dotest cvsadm-1d3 "${testcvs} co -d dir 1mod" \
  12715. "${PROG} checkout: Updating dir
  12716. U dir/file1"
  12717. dotest cvsadm-1d3b "cat CVS/Repository" "\."
  12718. dotest cvsadm-1d3d "cat dir/CVS/Repository" "mod1"
  12719. rm -rf CVS dir
  12720. dotest cvsadm-1d4 "${testcvs} co -d dir 2mod" \
  12721. "${PROG} checkout: Updating dir
  12722. U dir/file2"
  12723. dotest cvsadm-1d4b "cat CVS/Repository" "\."
  12724. dotest cvsadm-1d4d "cat dir/CVS/Repository" "mod2/sub2"
  12725. rm -rf CVS dir
  12726. dotest cvsadm-1d5 "${testcvs} co -d dir 1d1mod" \
  12727. "${PROG} checkout: Updating dir
  12728. U dir/file1"
  12729. dotest cvsadm-1d5b "cat CVS/Repository" "\."
  12730. dotest cvsadm-1d5d "cat dir/CVS/Repository" "mod1"
  12731. rm -rf CVS dir
  12732. dotest cvsadm-1d6 "${testcvs} co -d dir 1d2mod" \
  12733. "${PROG} checkout: Updating dir
  12734. U dir/file2"
  12735. dotest cvsadm-1d6b "cat CVS/Repository" "\."
  12736. dotest cvsadm-1d6d "cat dir/CVS/Repository" "mod2/sub2"
  12737. rm -rf CVS dir
  12738. dotest cvsadm-1d7 "${testcvs} co -d dir 2d1mod" \
  12739. "${PROG} checkout: Updating dir
  12740. U dir/file1"
  12741. dotest cvsadm-1d7b "cat CVS/Repository" "\."
  12742. dotest cvsadm-1d7d "cat dir/CVS/Repository" "mod1"
  12743. rm -rf CVS dir
  12744. dotest cvsadm-1d8 "${testcvs} co -d dir 2d2mod" \
  12745. "${PROG} checkout: Updating dir
  12746. U dir/file2"
  12747. dotest cvsadm-1d8b "cat CVS/Repository" "\."
  12748. dotest cvsadm-1d8d "cat dir/CVS/Repository" "mod2/sub2"
  12749. rm -rf CVS dir
  12750. ##################################################
  12751. ## Los Combonaciones
  12752. ##################################################
  12753. ### 1mod
  12754. dotest cvsadm-1d9 "${testcvs} co -d dir 1mod 1mod-2" \
  12755. "${PROG} checkout: Updating dir/1mod
  12756. U dir/1mod/file1
  12757. ${PROG} checkout: Updating dir/1mod-2
  12758. U dir/1mod-2/file1-2"
  12759. # the usual for the top level
  12760. dotest cvsadm-1d9b "cat CVS/Repository" "\."
  12761. # the usual for the dir level
  12762. dotest cvsadm-1d9d "cat dir/CVS/Repository" "\."
  12763. # the usual for 1mod
  12764. dotest cvsadm-1d9f "cat dir/1mod/CVS/Repository" "mod1"
  12765. # the usual for 1mod copy
  12766. dotest cvsadm-1d9h "cat dir/1mod-2/CVS/Repository" "mod1-2"
  12767. rm -rf CVS dir
  12768. # 1mod 2mod redmod bluemod
  12769. dotest cvsadm-1d10 "${testcvs} co -d dir 1mod 2mod" \
  12770. "${PROG} checkout: Updating dir/1mod
  12771. U dir/1mod/file1
  12772. ${PROG} checkout: Updating dir/2mod
  12773. U dir/2mod/file2"
  12774. dotest cvsadm-1d10b "cat CVS/Repository" "\."
  12775. # the usual for the dir level
  12776. dotest cvsadm-1d10d "cat dir/CVS/Repository" "\."
  12777. # the usual for 1mod
  12778. dotest cvsadm-1d10f "cat dir/1mod/CVS/Repository" "mod1"
  12779. # the usual for 2dmod
  12780. dotest cvsadm-1d10h "cat dir/2mod/CVS/Repository" "mod2/sub2"
  12781. rm -rf CVS dir
  12782. dotest cvsadm-1d11 "${testcvs} co -d dir 1mod 1d1mod" \
  12783. "${PROG} checkout: Updating dir/1mod
  12784. U dir/1mod/file1
  12785. ${PROG} checkout: Updating dir/dir1d1
  12786. U dir/dir1d1/file1"
  12787. dotest cvsadm-1d11b "cat CVS/Repository" "\."
  12788. # the usual for the dir level
  12789. dotest cvsadm-1d11d "cat dir/CVS/Repository" "\."
  12790. # the usual for 1mod
  12791. dotest cvsadm-1d11f "cat dir/1mod/CVS/Repository" "mod1"
  12792. # the usual for 1d1mod
  12793. dotest cvsadm-1d11h "cat dir/dir1d1/CVS/Repository" "mod1"
  12794. rm -rf CVS dir
  12795. dotest cvsadm-1d12 "${testcvs} co -d dir 1mod 1d2mod" \
  12796. "${PROG} checkout: Updating dir/1mod
  12797. U dir/1mod/file1
  12798. ${PROG} checkout: Updating dir/dir1d2
  12799. U dir/dir1d2/file2"
  12800. dotest cvsadm-1d12b "cat CVS/Repository" "\."
  12801. # the usual for the dir level
  12802. dotest cvsadm-1d12d "cat dir/CVS/Repository" "\."
  12803. # the usual for 1mod
  12804. dotest cvsadm-1d12f "cat dir/1mod/CVS/Repository" "mod1"
  12805. # the usual for 1d2mod
  12806. dotest cvsadm-1d12h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
  12807. rm -rf CVS dir
  12808. dotest cvsadm-1d13 "${testcvs} co -d dir 1mod 2d1mod" \
  12809. "${PROG} checkout: Updating dir/1mod
  12810. U dir/1mod/file1
  12811. ${PROG} checkout: Updating dir/dir2d1/sub2d1
  12812. U dir/dir2d1/sub2d1/file1"
  12813. dotest cvsadm-1d13b "cat CVS/Repository" "\."
  12814. # the usual for the dir level
  12815. dotest cvsadm-1d13d "cat dir/CVS/Repository" "\."
  12816. # the usual for 1mod
  12817. dotest cvsadm-1d13f "cat dir/1mod/CVS/Repository" "mod1"
  12818. # the usual for 2d1mod
  12819. dotest cvsadm-1d13h "cat dir/dir2d1/CVS/Repository" "\."
  12820. dotest cvsadm-1d13j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
  12821. rm -rf CVS dir
  12822. dotest cvsadm-1d14 "${testcvs} co -d dir 1mod 2d2mod" \
  12823. "${PROG} checkout: Updating dir/1mod
  12824. U dir/1mod/file1
  12825. ${PROG} checkout: Updating dir/dir2d2/sub2d2
  12826. U dir/dir2d2/sub2d2/file2"
  12827. dotest cvsadm-1d14b "cat CVS/Repository" "\."
  12828. # the usual for the dir level
  12829. dotest cvsadm-1d14d "cat dir/CVS/Repository" "\."
  12830. # the usual for 1mod
  12831. dotest cvsadm-1d14f "cat dir/1mod/CVS/Repository" "mod1"
  12832. # the usual for 2d2mod
  12833. dotest cvsadm-1d14h "cat dir/dir2d2/CVS/Repository" "mod2"
  12834. dotest cvsadm-1d14j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  12835. rm -rf CVS dir
  12836. ### 2mod
  12837. dotest cvsadm-1d15 "${testcvs} co -d dir 2mod 2mod-2" \
  12838. "${PROG} checkout: Updating dir/2mod
  12839. U dir/2mod/file2
  12840. ${PROG} checkout: Updating dir/2mod-2
  12841. U dir/2mod-2/file2-2"
  12842. dotest cvsadm-1d15b "cat CVS/Repository" "\."
  12843. # the usual for the dir level
  12844. dotest cvsadm-1d15d "cat dir/CVS/Repository" "mod2"
  12845. # the usual for 2mod
  12846. dotest cvsadm-1d15f "cat dir/2mod/CVS/Repository" "mod2/sub2"
  12847. # the usual for 2mod copy
  12848. dotest cvsadm-1d15h "cat dir/2mod-2/CVS/Repository" "mod2-2/sub2-2"
  12849. rm -rf CVS dir
  12850. dotest cvsadm-1d16 "${testcvs} co -d dir 2mod 1d1mod" \
  12851. "${PROG} checkout: Updating dir/2mod
  12852. U dir/2mod/file2
  12853. ${PROG} checkout: Updating dir/dir1d1
  12854. U dir/dir1d1/file1"
  12855. dotest cvsadm-1d16b "cat CVS/Repository" "\."
  12856. # the usual for the dir level
  12857. dotest cvsadm-1d16d "cat dir/CVS/Repository" "mod2"
  12858. # the usual for 2mod
  12859. dotest cvsadm-1d16f "cat dir/2mod/CVS/Repository" "mod2/sub2"
  12860. # the usual for 1d1mod
  12861. dotest cvsadm-1d16h "cat dir/dir1d1/CVS/Repository" "mod1"
  12862. rm -rf CVS dir
  12863. dotest cvsadm-1d17 "${testcvs} co -d dir 2mod 1d2mod" \
  12864. "${PROG} checkout: Updating dir/2mod
  12865. U dir/2mod/file2
  12866. ${PROG} checkout: Updating dir/dir1d2
  12867. U dir/dir1d2/file2"
  12868. dotest cvsadm-1d17b "cat CVS/Repository" "\."
  12869. # the usual for the dir level
  12870. dotest cvsadm-1d17d "cat dir/CVS/Repository" "mod2"
  12871. # the usual for 2mod
  12872. dotest cvsadm-1d17f "cat dir/2mod/CVS/Repository" "mod2/sub2"
  12873. # the usual for 1d2mod
  12874. dotest cvsadm-1d17h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
  12875. rm -rf CVS dir
  12876. dotest cvsadm-1d18 "${testcvs} co -d dir 2mod 2d1mod" \
  12877. "${PROG} checkout: Updating dir/2mod
  12878. U dir/2mod/file2
  12879. ${PROG} checkout: Updating dir/dir2d1/sub2d1
  12880. U dir/dir2d1/sub2d1/file1"
  12881. dotest cvsadm-1d18b "cat CVS/Repository" "\."
  12882. # the usual for the dir level
  12883. dotest cvsadm-1d18d "cat dir/CVS/Repository" "mod2"
  12884. # the usual for 2mod
  12885. dotest cvsadm-1d18f "cat dir/2mod/CVS/Repository" "mod2/sub2"
  12886. # the usual for 2d1mod
  12887. dotest cvsadm-1d18h "cat dir/dir2d1/CVS/Repository" "\."
  12888. dotest cvsadm-1d18j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
  12889. rm -rf CVS dir
  12890. dotest cvsadm-1d19 "${testcvs} co -d dir 2mod 2d2mod" \
  12891. "${PROG} checkout: Updating dir/2mod
  12892. U dir/2mod/file2
  12893. ${PROG} checkout: Updating dir/dir2d2/sub2d2
  12894. U dir/dir2d2/sub2d2/file2"
  12895. dotest cvsadm-1d19b "cat CVS/Repository" "\."
  12896. # the usual for the dir level
  12897. dotest cvsadm-1d19d "cat dir/CVS/Repository" "mod2"
  12898. # the usual for 2mod
  12899. dotest cvsadm-1d19f "cat dir/2mod/CVS/Repository" "mod2/sub2"
  12900. # the usual for 2d2mod
  12901. dotest cvsadm-1d19h "cat dir/dir2d2/CVS/Repository" "mod2"
  12902. dotest cvsadm-1d19j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  12903. rm -rf CVS dir
  12904. ### 1d1mod
  12905. dotest cvsadm-1d20 "${testcvs} co -d dir 1d1mod 1d1mod-2" \
  12906. "${PROG} checkout: Updating dir/dir1d1
  12907. U dir/dir1d1/file1
  12908. ${PROG} checkout: Updating dir/dir1d1-2
  12909. U dir/dir1d1-2/file1-2"
  12910. dotest cvsadm-1d20b "cat CVS/Repository" "\."
  12911. # the usual for the dir level
  12912. dotest cvsadm-1d20d "cat dir/CVS/Repository" "\."
  12913. # the usual for 1d1mod
  12914. dotest cvsadm-1d20f "cat dir/dir1d1/CVS/Repository" "mod1"
  12915. # the usual for 1d1mod copy
  12916. dotest cvsadm-1d20h "cat dir/dir1d1-2/CVS/Repository" "mod1-2"
  12917. rm -rf CVS dir
  12918. dotest cvsadm-1d21 "${testcvs} co -d dir 1d1mod 1d2mod" \
  12919. "${PROG} checkout: Updating dir/dir1d1
  12920. U dir/dir1d1/file1
  12921. ${PROG} checkout: Updating dir/dir1d2
  12922. U dir/dir1d2/file2"
  12923. dotest cvsadm-1d21b "cat CVS/Repository" "\."
  12924. # the usual for the dir level
  12925. dotest cvsadm-1d21d "cat dir/CVS/Repository" "\."
  12926. # the usual for 1d1mod
  12927. dotest cvsadm-1d21f "cat dir/dir1d1/CVS/Repository" "mod1"
  12928. # the usual for 1d2mod
  12929. dotest cvsadm-1d21h "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
  12930. rm -rf CVS dir
  12931. dotest cvsadm-1d22 "${testcvs} co -d dir 1d1mod 2d1mod" \
  12932. "${PROG} checkout: Updating dir/dir1d1
  12933. U dir/dir1d1/file1
  12934. ${PROG} checkout: Updating dir/dir2d1/sub2d1
  12935. U dir/dir2d1/sub2d1/file1"
  12936. dotest cvsadm-1d22b "cat CVS/Repository" "\."
  12937. # the usual for the dir level
  12938. dotest cvsadm-1d22d "cat dir/CVS/Repository" "\."
  12939. # the usual for 1d1mod
  12940. dotest cvsadm-1d22f "cat dir/dir1d1/CVS/Repository" "mod1"
  12941. # the usual for 2d1mod
  12942. dotest cvsadm-1d22h "cat dir/dir2d1/CVS/Repository" "\."
  12943. dotest cvsadm-1d22j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
  12944. rm -rf CVS dir
  12945. dotest cvsadm-1d23 "${testcvs} co -d dir 1d1mod 2d2mod" \
  12946. "${PROG} checkout: Updating dir/dir1d1
  12947. U dir/dir1d1/file1
  12948. ${PROG} checkout: Updating dir/dir2d2/sub2d2
  12949. U dir/dir2d2/sub2d2/file2"
  12950. dotest cvsadm-1d23b "cat CVS/Repository" "\."
  12951. # the usual for the dir level
  12952. dotest cvsadm-1d23d "cat dir/CVS/Repository" "\."
  12953. # the usual for 1d1mod
  12954. dotest cvsadm-1d23f "cat dir/dir1d1/CVS/Repository" "mod1"
  12955. # the usual for 2d2mod
  12956. dotest cvsadm-1d23h "cat dir/dir2d2/CVS/Repository" "mod2"
  12957. dotest cvsadm-1d23j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  12958. rm -rf CVS dir
  12959. ### 1d2mod
  12960. dotest cvsadm-1d24 "${testcvs} co -d dir 1d2mod 1d2mod-2" \
  12961. "${PROG} checkout: Updating dir/dir1d2
  12962. U dir/dir1d2/file2
  12963. ${PROG} checkout: Updating dir/dir1d2-2
  12964. U dir/dir1d2-2/file2-2"
  12965. dotest cvsadm-1d24b "cat CVS/Repository" "\."
  12966. # the usual for the dir level
  12967. dotest cvsadm-1d24d "cat dir/CVS/Repository" "mod2"
  12968. # the usual for 1d2mod
  12969. dotest cvsadm-1d24f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
  12970. # the usual for 1d2mod copy
  12971. dotest cvsadm-1d24h "cat dir/dir1d2-2/CVS/Repository" "mod2-2/sub2-2"
  12972. rm -rf CVS dir
  12973. dotest cvsadm-1d25 "${testcvs} co -d dir 1d2mod 2d1mod" \
  12974. "${PROG} checkout: Updating dir/dir1d2
  12975. U dir/dir1d2/file2
  12976. ${PROG} checkout: Updating dir/dir2d1/sub2d1
  12977. U dir/dir2d1/sub2d1/file1"
  12978. dotest cvsadm-1d25b "cat CVS/Repository" "\."
  12979. # the usual for the dir level
  12980. dotest cvsadm-1d25d "cat dir/CVS/Repository" "mod2"
  12981. # the usual for 1d2mod
  12982. dotest cvsadm-1d25f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
  12983. # the usual for 2d1mod
  12984. dotest cvsadm-1d25h "cat dir/dir2d1/CVS/Repository" "\."
  12985. dotest cvsadm-1d25j "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
  12986. rm -rf CVS dir
  12987. dotest cvsadm-1d26 "${testcvs} co -d dir 1d2mod 2d2mod" \
  12988. "${PROG} checkout: Updating dir/dir1d2
  12989. U dir/dir1d2/file2
  12990. ${PROG} checkout: Updating dir/dir2d2/sub2d2
  12991. U dir/dir2d2/sub2d2/file2"
  12992. dotest cvsadm-1d26b "cat CVS/Repository" "\."
  12993. # the usual for the dir level
  12994. dotest cvsadm-1d26d "cat dir/CVS/Repository" "mod2"
  12995. # the usual for 1d2mod
  12996. dotest cvsadm-1d26f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
  12997. # the usual for 2d2mod
  12998. dotest cvsadm-1d26h "cat dir/dir2d2/CVS/Repository" "mod2"
  12999. dotest cvsadm-1d26j "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  13000. rm -rf CVS dir
  13001. # 2d1mod
  13002. dotest cvsadm-1d27 "${testcvs} co -d dir 2d1mod 2d1mod-2" \
  13003. "${PROG} checkout: Updating dir/dir2d1/sub2d1
  13004. U dir/dir2d1/sub2d1/file1
  13005. ${PROG} checkout: Updating dir/dir2d1-2/sub2d1-2
  13006. U dir/dir2d1-2/sub2d1-2/file1-2"
  13007. dotest cvsadm-1d27b "cat CVS/Repository" "\."
  13008. # the usual for the dir level
  13009. dotest cvsadm-1d27d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
  13010. # the usual for 2d1mod
  13011. dotest cvsadm-1d27f "cat dir/dir2d1/CVS/Repository" "\."
  13012. dotest cvsadm-1d27h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
  13013. # the usual for 2d1mod
  13014. dotest cvsadm-1d27j "cat dir/dir2d1-2/CVS/Repository" "\."
  13015. dotest cvsadm-1d27l "cat dir/dir2d1-2/sub2d1-2/CVS/Repository" \
  13016. "mod1-2"
  13017. rm -rf CVS dir
  13018. dotest cvsadm-1d28 "${testcvs} co -d dir 2d1mod 2d2mod" \
  13019. "${PROG} checkout: Updating dir/dir2d1/sub2d1
  13020. U dir/dir2d1/sub2d1/file1
  13021. ${PROG} checkout: Updating dir/dir2d2/sub2d2
  13022. U dir/dir2d2/sub2d2/file2"
  13023. dotest cvsadm-1d28b "cat CVS/Repository" "\."
  13024. # the usual for the dir level
  13025. dotest cvsadm-1d28d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
  13026. # the usual for 2d1mod
  13027. dotest cvsadm-1d28f "cat dir/dir2d1/CVS/Repository" "\."
  13028. dotest cvsadm-1d28h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
  13029. # the usual for 2d2mod
  13030. dotest cvsadm-1d28j "cat dir/dir2d2/CVS/Repository" "mod2"
  13031. dotest cvsadm-1d28l "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  13032. rm -rf CVS dir
  13033. # 2d2mod
  13034. dotest cvsadm-1d29 "${testcvs} co -d dir 2d2mod 2d2mod-2" \
  13035. "${PROG} checkout: Updating dir/dir2d2/sub2d2
  13036. U dir/dir2d2/sub2d2/file2
  13037. ${PROG} checkout: Updating dir/dir2d2-2/sub2d2-2
  13038. U dir/dir2d2-2/sub2d2-2/file2-2"
  13039. dotest cvsadm-1d29b "cat CVS/Repository" "\."
  13040. # the usual for the dir level
  13041. dotest cvsadm-1d29d "cat dir/CVS/Repository" "\."
  13042. # the usual for 2d2mod
  13043. dotest cvsadm-1d29f "cat dir/dir2d2/CVS/Repository" "mod2"
  13044. dotest cvsadm-1d29h "cat dir/dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  13045. # the usual for 2d2mod
  13046. dotest cvsadm-1d29j "cat dir/dir2d2-2/CVS/Repository" "mod2-2"
  13047. dotest cvsadm-1d29l "cat dir/dir2d2-2/sub2d2-2/CVS/Repository" \
  13048. "mod2-2/sub2-2"
  13049. rm -rf CVS dir
  13050. ##################################################
  13051. ## And now, some of that again using the "-d" flag
  13052. ## on the command line, but use a longer path.
  13053. ##################################################
  13054. dotest_fail cvsadm-2d3-1 "${testcvs} co -d dir/dir2 1mod" \
  13055. "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .dir.: No such file or directory"
  13056. if $remote; then :; else
  13057. # Remote can't handle this, even with the "mkdir dir".
  13058. # This was also true of CVS 1.9.
  13059. mkdir dir
  13060. dotest cvsadm-2d3 "${testcvs} co -d dir/dir2 1mod" \
  13061. "${PROG} checkout: Updating dir/dir2
  13062. U dir/dir2/file1"
  13063. dotest cvsadm-2d3b "cat CVS/Repository" "\."
  13064. dotest_fail cvsadm-2d3d "test -f dir/CVS/Repository" ""
  13065. dotest cvsadm-2d3f "cat dir/dir2/CVS/Repository" "mod1"
  13066. rm -rf CVS dir
  13067. mkdir dir
  13068. dotest cvsadm-2d4 "${testcvs} co -d dir/dir2 2mod" \
  13069. "${PROG} checkout: Updating dir/dir2
  13070. U dir/dir2/file2"
  13071. dotest cvsadm-2d4b "cat CVS/Repository" "\."
  13072. dotest cvsadm-2d4f "cat dir/dir2/CVS/Repository" "mod2/sub2"
  13073. rm -rf CVS dir
  13074. mkdir dir
  13075. dotest cvsadm-2d5 "${testcvs} co -d dir/dir2 1d1mod" \
  13076. "${PROG} checkout: Updating dir/dir2
  13077. U dir/dir2/file1"
  13078. dotest cvsadm-2d5b "cat CVS/Repository" "\."
  13079. dotest cvsadm-2d5f "cat dir/dir2/CVS/Repository" "mod1"
  13080. rm -rf CVS dir
  13081. mkdir dir
  13082. dotest cvsadm-2d6 "${testcvs} co -d dir/dir2 1d2mod" \
  13083. "${PROG} checkout: Updating dir/dir2
  13084. U dir/dir2/file2"
  13085. dotest cvsadm-2d6b "cat CVS/Repository" "\."
  13086. dotest cvsadm-2d6f "cat dir/dir2/CVS/Repository" "mod2/sub2"
  13087. rm -rf CVS dir
  13088. mkdir dir
  13089. dotest cvsadm-2d7 "${testcvs} co -d dir/dir2 2d1mod" \
  13090. "${PROG} checkout: Updating dir/dir2
  13091. U dir/dir2/file1"
  13092. dotest cvsadm-2d7b "cat CVS/Repository" "\."
  13093. dotest cvsadm-2d7f "cat dir/dir2/CVS/Repository" "mod1"
  13094. rm -rf CVS dir
  13095. mkdir dir
  13096. dotest cvsadm-2d8 "${testcvs} co -d dir/dir2 2d2mod" \
  13097. "${PROG} checkout: Updating dir/dir2
  13098. U dir/dir2/file2"
  13099. dotest cvsadm-2d8b "cat CVS/Repository" "\."
  13100. dotest cvsadm-2d8f "cat dir/dir2/CVS/Repository" "mod2/sub2"
  13101. rm -rf CVS dir
  13102. ##################################################
  13103. ## And now, a few of those tests revisited to
  13104. ## test the behavior of the -N flag.
  13105. ##################################################
  13106. dotest cvsadm-N3 "${testcvs} co -N 1mod" \
  13107. "${PROG} checkout: Updating 1mod
  13108. U 1mod/file1"
  13109. dotest cvsadm-N3b "cat CVS/Repository" "\."
  13110. dotest cvsadm-N3d "cat 1mod/CVS/Repository" "mod1"
  13111. rm -rf CVS 1mod
  13112. dotest cvsadm-N4 "${testcvs} co -N 2mod" \
  13113. "${PROG} checkout: Updating 2mod
  13114. U 2mod/file2"
  13115. dotest cvsadm-N4b "cat CVS/Repository" "\."
  13116. dotest cvsadm-N4d "cat 2mod/CVS/Repository" "mod2/sub2"
  13117. rm -rf CVS 2mod
  13118. dotest cvsadm-N5 "${testcvs} co -N 1d1mod" \
  13119. "${PROG} checkout: Updating dir1d1
  13120. U dir1d1/file1"
  13121. dotest cvsadm-N5b "cat CVS/Repository" "\."
  13122. dotest cvsadm-N5d "cat dir1d1/CVS/Repository" "mod1"
  13123. rm -rf CVS dir1d1
  13124. dotest cvsadm-N6 "${testcvs} co -N 1d2mod" \
  13125. "${PROG} checkout: Updating dir1d2
  13126. U dir1d2/file2"
  13127. dotest cvsadm-N6b "cat CVS/Repository" "\."
  13128. dotest cvsadm-N6d "cat dir1d2/CVS/Repository" "mod2/sub2"
  13129. rm -rf CVS dir1d2
  13130. dotest cvsadm-N7 "${testcvs} co -N 2d1mod" \
  13131. "${PROG} checkout: Updating dir2d1/sub2d1
  13132. U dir2d1/sub2d1/file1"
  13133. dotest cvsadm-N7b "cat CVS/Repository" "\."
  13134. dotest cvsadm-N7d "cat dir2d1/CVS/Repository" "\."
  13135. dotest cvsadm-N7f "cat dir2d1/sub2d1/CVS/Repository" "mod1"
  13136. rm -rf CVS dir2d1
  13137. dotest cvsadm-N8 "${testcvs} co -N 2d2mod" \
  13138. "${PROG} checkout: Updating dir2d2/sub2d2
  13139. U dir2d2/sub2d2/file2"
  13140. dotest cvsadm-N8b "cat CVS/Repository" "\."
  13141. dotest cvsadm-N8d "cat dir2d2/CVS/Repository" "mod2"
  13142. dotest cvsadm-N8f "cat dir2d2/sub2d2/CVS/Repository" "mod2/sub2"
  13143. rm -rf CVS dir2d2
  13144. ## the ones in one-deep directories
  13145. dotest cvsadm-N1d3 "${testcvs} co -N -d dir 1mod" \
  13146. "${PROG} checkout: Updating dir/1mod
  13147. U dir/1mod/file1"
  13148. dotest cvsadm-N1d3b "cat CVS/Repository" "\."
  13149. dotest cvsadm-N1d3d "cat dir/CVS/Repository" "\."
  13150. dotest cvsadm-N1d3f "cat dir/1mod/CVS/Repository" "mod1"
  13151. rm -rf CVS dir
  13152. dotest cvsadm-N1d4 "${testcvs} co -N -d dir 2mod" \
  13153. "${PROG} checkout: Updating dir/2mod
  13154. U dir/2mod/file2"
  13155. dotest cvsadm-N1d4b "cat CVS/Repository" "\."
  13156. dotest cvsadm-N1d4d "cat dir/CVS/Repository" "mod2"
  13157. dotest cvsadm-N1d4f "cat dir/2mod/CVS/Repository" "mod2/sub2"
  13158. rm -rf CVS dir
  13159. dotest cvsadm-N1d5 "${testcvs} co -N -d dir 1d1mod" \
  13160. "${PROG} checkout: Updating dir/dir1d1
  13161. U dir/dir1d1/file1"
  13162. dotest cvsadm-N1d5b "cat CVS/Repository" "\."
  13163. dotest cvsadm-N1d5d "cat dir/CVS/Repository" "\."
  13164. dotest cvsadm-N1d5d "cat dir/dir1d1/CVS/Repository" "mod1"
  13165. rm -rf CVS dir
  13166. dotest cvsadm-N1d6 "${testcvs} co -N -d dir 1d2mod" \
  13167. "${PROG} checkout: Updating dir/dir1d2
  13168. U dir/dir1d2/file2"
  13169. dotest cvsadm-N1d6b "cat CVS/Repository" "\."
  13170. dotest cvsadm-N1d6d "cat dir/CVS/Repository" "mod2"
  13171. dotest cvsadm-N1d6f "cat dir/dir1d2/CVS/Repository" "mod2/sub2"
  13172. rm -rf CVS dir
  13173. dotest cvsadm-N1d7 "${testcvs} co -N -d dir 2d1mod" \
  13174. "${PROG} checkout: Updating dir/dir2d1/sub2d1
  13175. U dir/dir2d1/sub2d1/file1"
  13176. dotest cvsadm-N1d7b "cat CVS/Repository" "\."
  13177. dotest cvsadm-N1d7d "cat dir/CVS/Repository" "CVSROOT/Emptydir"
  13178. dotest cvsadm-N1d7f "cat dir/dir2d1/CVS/Repository" "\."
  13179. dotest cvsadm-N1d7h "cat dir/dir2d1/sub2d1/CVS/Repository" "mod1"
  13180. rm -rf CVS dir
  13181. dotest cvsadm-N1d8 "${testcvs} co -N -d dir 2d2mod" \
  13182. "${PROG} checkout: Updating dir/dir2d2/sub2d2
  13183. U dir/dir2d2/sub2d2/file2"
  13184. dotest cvsadm-N1d8b "cat CVS/Repository" "\."
  13185. dotest cvsadm-N1d8d "cat dir/CVS/Repository" "\."
  13186. dotest cvsadm-N1d8d "cat dir/dir2d2/CVS/Repository" "mod2"
  13187. dotest cvsadm-N1d8d "cat dir/dir2d2/sub2d2/CVS/Repository" \
  13188. "mod2/sub2"
  13189. rm -rf CVS dir
  13190. ## the ones in two-deep directories
  13191. mkdir dir
  13192. dotest cvsadm-N2d3 "${testcvs} co -N -d dir/dir2 1mod" \
  13193. "${PROG} checkout: Updating dir/dir2/1mod
  13194. U dir/dir2/1mod/file1"
  13195. dotest cvsadm-N2d3b "cat CVS/Repository" "\."
  13196. dotest cvsadm-N2d3f "cat dir/dir2/CVS/Repository" "\."
  13197. dotest cvsadm-N2d3h "cat dir/dir2/1mod/CVS/Repository" "mod1"
  13198. rm -rf CVS dir
  13199. mkdir dir
  13200. dotest cvsadm-N2d4 "${testcvs} co -N -d dir/dir2 2mod" \
  13201. "${PROG} checkout: Updating dir/dir2/2mod
  13202. U dir/dir2/2mod/file2"
  13203. dotest cvsadm-N2d4b "cat CVS/Repository" "\."
  13204. dotest cvsadm-N2d4f "cat dir/dir2/CVS/Repository" "mod2"
  13205. dotest cvsadm-N2d4h "cat dir/dir2/2mod/CVS/Repository" "mod2/sub2"
  13206. rm -rf CVS dir
  13207. mkdir dir
  13208. dotest cvsadm-N2d5 "${testcvs} co -N -d dir/dir2 1d1mod" \
  13209. "${PROG} checkout: Updating dir/dir2/dir1d1
  13210. U dir/dir2/dir1d1/file1"
  13211. dotest cvsadm-N2d5b "cat CVS/Repository" "\."
  13212. dotest cvsadm-N2d5f "cat dir/dir2/CVS/Repository" "\."
  13213. dotest cvsadm-N2d5h "cat dir/dir2/dir1d1/CVS/Repository" "mod1"
  13214. rm -rf CVS dir
  13215. mkdir dir
  13216. dotest cvsadm-N2d6 "${testcvs} co -N -d dir/dir2 1d2mod" \
  13217. "${PROG} checkout: Updating dir/dir2/dir1d2
  13218. U dir/dir2/dir1d2/file2"
  13219. dotest cvsadm-N2d6b "cat CVS/Repository" "\."
  13220. dotest cvsadm-N2d6f "cat dir/dir2/CVS/Repository" "mod2"
  13221. dotest cvsadm-N2d6h "cat dir/dir2/dir1d2/CVS/Repository" "mod2/sub2"
  13222. rm -rf CVS dir
  13223. mkdir dir
  13224. dotest cvsadm-N2d7 "${testcvs} co -N -d dir/dir2 2d1mod" \
  13225. "${PROG} checkout: Updating dir/dir2/dir2d1/sub2d1
  13226. U dir/dir2/dir2d1/sub2d1/file1"
  13227. dotest cvsadm-N2d7b "cat CVS/Repository" "\."
  13228. dotest cvsadm-N2d7f "cat dir/dir2/CVS/Repository" "CVSROOT/Emptydir"
  13229. dotest cvsadm-N2d7g "cat dir/dir2/dir2d1/CVS/Repository" "\."
  13230. dotest cvsadm-N2d7h "cat dir/dir2/dir2d1/sub2d1/CVS/Repository" \
  13231. "mod1"
  13232. rm -rf CVS dir
  13233. mkdir dir
  13234. dotest cvsadm-N2d8 "${testcvs} co -N -d dir/dir2 2d2mod" \
  13235. "${PROG} checkout: Updating dir/dir2/dir2d2/sub2d2
  13236. U dir/dir2/dir2d2/sub2d2/file2"
  13237. dotest cvsadm-N2d8b "cat CVS/Repository" "\."
  13238. dotest cvsadm-N2d8f "cat dir/dir2/CVS/Repository" "\."
  13239. dotest cvsadm-N2d8h "cat dir/dir2/dir2d2/CVS/Repository" "mod2"
  13240. dotest cvsadm-N2d8j "cat dir/dir2/dir2d2/sub2d2/CVS/Repository" \
  13241. "mod2/sub2"
  13242. rm -rf CVS dir
  13243. fi # end of tests to be skipped for remote
  13244. ##################################################
  13245. ## That's enough of that, thank you very much.
  13246. ##################################################
  13247. dotest cvsadm-cleanup-1 "${testcvs} -q co CVSROOT/config" \
  13248. "U CVSROOT/config"
  13249. cd CVSROOT
  13250. echo "# empty file" >config
  13251. dotest cvsadm-cleanup-2 "${testcvs} -q ci -m cvsadm-cleanup" \
  13252. "Checking in config;
  13253. ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
  13254. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  13255. done
  13256. ${PROG} commit: Rebuilding administrative file database"
  13257. cd ..
  13258. rm -rf CVSROOT CVS
  13259. # remove our junk
  13260. cd ..
  13261. rm -rf 1
  13262. rm -rf ${CVSROOT_DIRNAME}/1mod
  13263. rm -rf ${CVSROOT_DIRNAME}/1mod-2
  13264. rm -rf ${CVSROOT_DIRNAME}/2mod
  13265. rm -rf ${CVSROOT_DIRNAME}/2mod-2
  13266. rm -rf ${CVSROOT_DIRNAME}/mod1
  13267. rm -rf ${CVSROOT_DIRNAME}/mod1-2
  13268. rm -rf ${CVSROOT_DIRNAME}/mod2
  13269. rm -rf ${CVSROOT_DIRNAME}/mod2-2
  13270. ;;
  13271. emptydir)
  13272. # Various tests of the Emptydir (CVSNULLREPOS) code. See also:
  13273. # cvsadm: tests of Emptydir in various module definitions
  13274. # basicb: Test that "Emptydir" is non-special in ordinary contexts
  13275. mkdir 1; cd 1
  13276. dotest emptydir-1 "${testcvs} co CVSROOT/modules" \
  13277. "U CVSROOT/modules"
  13278. echo "# Module defs for emptydir tests" > CVSROOT/modules
  13279. echo "2d1mod -d dir2d1/sub/sub2d1 mod1" >> CVSROOT/modules
  13280. echo "2d1moda -d dir2d1/suba moda/modasub" >> CVSROOT/modules
  13281. echo "2d1modb -d dir2d1/suba mod1" >> CVSROOT/modules
  13282. echo "comb -a 2d1modb 2d1moda" >> CVSROOT/modules
  13283. dotest emptydir-2 "${testcvs} ci -m add-modules" \
  13284. "${PROG} [a-z]*: Examining CVSROOT
  13285. Checking in CVSROOT/modules;
  13286. ${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
  13287. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  13288. done
  13289. ${PROG} commit: Rebuilding administrative file database" \
  13290. "${PROG} commit: Examining CVSROOT"
  13291. rm -rf CVS CVSROOT
  13292. mkdir ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda
  13293. # Populate. Not sure we really need to do this.
  13294. dotest emptydir-3 "${testcvs} -q co -l ." ""
  13295. dotest emptydir-3a "${testcvs} co mod1 moda" \
  13296. "${PROG} checkout: Updating mod1
  13297. ${PROG} checkout: Updating moda"
  13298. echo "file1" > mod1/file1
  13299. mkdir moda/modasub
  13300. dotest emptydir-3b "${testcvs} add moda/modasub" \
  13301. "Directory ${CVSROOT_DIRNAME}/moda/modasub added to the repository"
  13302. echo "filea" > moda/modasub/filea
  13303. dotest emptydir-4 "${testcvs} add mod1/file1 moda/modasub/filea" \
  13304. "${PROG} add: scheduling file .mod1/file1. for addition
  13305. ${PROG} add: scheduling file .moda/modasub/filea. for addition
  13306. ${PROG} add: use .${PROG} commit. to add these files permanently"
  13307. dotest emptydir-5 "${testcvs} -q ci -m yup" \
  13308. "RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
  13309. done
  13310. Checking in mod1/file1;
  13311. ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
  13312. initial revision: 1\.1
  13313. done
  13314. RCS file: ${CVSROOT_DIRNAME}/moda/modasub/filea,v
  13315. done
  13316. Checking in moda/modasub/filea;
  13317. ${CVSROOT_DIRNAME}/moda/modasub/filea,v <-- filea
  13318. initial revision: 1\.1
  13319. done"
  13320. rm -rf mod1 moda CVS
  13321. # End Populate.
  13322. dotest emptydir-6 "${testcvs} co 2d1mod" \
  13323. "${PROG} checkout: Updating dir2d1/sub/sub2d1
  13324. U dir2d1/sub/sub2d1/file1"
  13325. cd dir2d1
  13326. touch emptyfile
  13327. # It doesn't make any sense to add a file (or do much of anything
  13328. # else) in Emptydir; Emptydir is a placeholder indicating that
  13329. # the working directory doesn't correspond to anything in
  13330. # the repository.
  13331. dotest_fail emptydir-7 "${testcvs} add emptyfile" \
  13332. "${PROG} \[add aborted\]: cannot add to ${CVSROOT_DIRNAME}/CVSROOT/Emptydir"
  13333. mkdir emptydir
  13334. dotest_fail emptydir-8 "${testcvs} add emptydir" \
  13335. "${PROG} \[[a-z]* aborted\]: cannot add to ${CVSROOT_DIRNAME}/CVSROOT/Emptydir"
  13336. cd ..
  13337. rm -rf CVS dir2d1
  13338. # OK, while we have an Emptydir around, test a few obscure
  13339. # things about it.
  13340. mkdir edir; cd edir
  13341. dotest emptydir-9 "${testcvs} -q co -l CVSROOT" \
  13342. "U CVSROOT${DOTSTAR}"
  13343. cd CVSROOT
  13344. dotest_fail emptydir-10 "test -d Emptydir" ''
  13345. # This tests the code in find_dirs which skips Emptydir.
  13346. dotest emptydir-11 "${testcvs} -q -n update -d -P" ''
  13347. cd ../..
  13348. rm -r edir
  13349. cd ..
  13350. # Now start playing with moda.
  13351. mkdir 2; cd 2
  13352. dotest emptydir-12 "${testcvs} -q co 2d1moda" \
  13353. "U dir2d1/suba/filea"
  13354. # OK, this is the crux of the matter. This used to show "Emptydir",
  13355. # but everyone seemed to think it should show "moda". This
  13356. # usually works better, but not always as shown by the following
  13357. # test.
  13358. dotest emptydir-13 "cat dir2d1/CVS/Repository" "moda"
  13359. dotest_fail emptydir-14 "${testcvs} co comb" \
  13360. "${PROG} checkout: existing repository ${CVSROOT_DIRNAME}/moda/modasub does not match ${CVSROOT_DIRNAME}/mod1
  13361. ${PROG} checkout: ignoring module 2d1modb
  13362. ${PROG} checkout: Updating dir2d1/suba"
  13363. dotest emptydir-15 "cat dir2d1/CVS/Repository" "moda"
  13364. cd ..
  13365. # Test the effect of a non-cvs directory already existing with the
  13366. # same name as one in the modules file.
  13367. mkdir 3; cd 3
  13368. mkdir dir2d1
  13369. dotest emptydir-16 "${testcvs} co 2d1mod" \
  13370. "${PROG} checkout: Updating dir2d1/sub/sub2d1
  13371. U dir2d1/sub/sub2d1/file1"
  13372. dotest emptydir-17 "test -d dir2d1/CVS"
  13373. # clean up
  13374. if $keep; then
  13375. echo Keeping ${TESTDIR} and exiting due to --keep
  13376. exit 0
  13377. fi
  13378. cd ..
  13379. rm -r 1 2 3
  13380. rm -rf ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda
  13381. # I guess for the moment the convention is going to be
  13382. # that we don't need to remove ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
  13383. ;;
  13384. abspath)
  13385. # These tests test the thituations thin thwitch thoo theck
  13386. # things thout twith thabsolute thaths. Threally.
  13387. #
  13388. # CHECKOUTS
  13389. #
  13390. # Create a few modules to use
  13391. mkdir ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/mod2
  13392. dotest abspath-1a "${testcvs} co mod1 mod2" \
  13393. "${PROG} checkout: Updating mod1
  13394. ${PROG} checkout: Updating mod2"
  13395. # Populate the module
  13396. echo "file1" > mod1/file1
  13397. echo "file2" > mod2/file2
  13398. cd mod1
  13399. dotest abspath-1ba "${testcvs} add file1" \
  13400. "${PROG} add: scheduling file .file1. for addition
  13401. ${PROG} add: use .${PROG} commit. to add this file permanently"
  13402. cd ..
  13403. cd mod2
  13404. dotest abspath-1bb "${testcvs} add file2" \
  13405. "${PROG} add: scheduling file .file2. for addition
  13406. ${PROG} add: use .${PROG} commit. to add this file permanently"
  13407. cd ..
  13408. dotest abspath-1c "${testcvs} ci -m yup mod1 mod2" \
  13409. "${PROG} [a-z]*: Examining mod1
  13410. ${PROG} [a-z]*: Examining mod2
  13411. RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
  13412. done
  13413. Checking in mod1/file1;
  13414. ${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
  13415. initial revision: 1.1
  13416. done
  13417. RCS file: ${CVSROOT_DIRNAME}/mod2/file2,v
  13418. done
  13419. Checking in mod2/file2;
  13420. ${CVSROOT_DIRNAME}/mod2/file2,v <-- file2
  13421. initial revision: 1.1
  13422. done"
  13423. # Finished creating the module -- clean up.
  13424. rm -rf CVS mod1 mod2
  13425. # Done.
  13426. # Try checking out the module in a local directory
  13427. if $remote; then
  13428. dotest_fail abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
  13429. "${PROG} \[checkout aborted\]: absolute pathname .${TESTDIR}/1. illegal for server"
  13430. dotest abspath-2a-try2 "${testcvs} co -d 1 mod1" \
  13431. "${PROG} checkout: Updating 1
  13432. U 1/file1"
  13433. else
  13434. dotest abspath-2a "${testcvs} co -d ${TESTDIR}/1 mod1" \
  13435. "${PROG} checkout: Updating ${TESTDIR}/1
  13436. U ${TESTDIR}/1/file1"
  13437. fi # remote workaround
  13438. dotest abspath-2b "cat ${TESTDIR}/1/CVS/Repository" "mod1"
  13439. # Done. Clean up.
  13440. rm -rf ${TESTDIR}/1
  13441. # Now try in a subdirectory. We're not covering any more
  13442. # code here, but we might catch a future error if someone
  13443. # changes the checkout code.
  13444. # Note that for the same reason that the shell command
  13445. # "touch 1/2/3" requires directories 1 and 1/2 to already
  13446. # exist, we expect ${TESTDIR}/1 to already exist. I believe
  13447. # this is the behavior of CVS 1.9 and earlier.
  13448. if $remote; then :; else
  13449. dotest_fail abspath-3.1 "${testcvs} co -d ${TESTDIR}/1/2 mod1" \
  13450. "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .${TESTDIR}/1.: No such file or directory"
  13451. fi
  13452. dotest_fail abspath-3.2 "${testcvs} co -d 1/2 mod1" \
  13453. "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .1.: No such file or directory"
  13454. mkdir 1
  13455. if $remote; then
  13456. # The server wants the directory to exist, but that is
  13457. # a bug, it should only need to exist on the client side.
  13458. # See also cvsadm-2d3.
  13459. dotest_fail abspath-3a "${testcvs} co -d 1/2 mod1" \
  13460. "${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .1.: No such file or directory"
  13461. cd 1
  13462. dotest abspath-3a-try2 "${testcvs} co -d 2 mod1" \
  13463. "${PROG} checkout: Updating 2
  13464. U 2/file1"
  13465. cd ..
  13466. rm -rf 1/CVS
  13467. else
  13468. dotest abspath-3a "${testcvs} co -d ${TESTDIR}/1/2 mod1" \
  13469. "${PROG} checkout: Updating ${TESTDIR}/1/2
  13470. U ${TESTDIR}/1/2/file1"
  13471. fi # remote workaround
  13472. dotest abspath-3b "cat ${TESTDIR}/1/2/CVS/Repository" "mod1"
  13473. # For all the same reasons that we want "1" to already
  13474. # exist, we don't to mess with it to traverse it, for
  13475. # example by creating a CVS directory.
  13476. dotest_fail abspath-3c "test -d ${TESTDIR}/1/CVS" ''
  13477. # Done. Clean up.
  13478. rm -rf ${TESTDIR}/1
  13479. # Now try someplace where we don't have permission.
  13480. mkdir ${TESTDIR}/barf
  13481. chmod -w ${TESTDIR}/barf
  13482. dotest_fail abspath-4r "${testcvs} co -d ${TESTDIR}/barf/sub mod1" \
  13483. "${PROG} \[checkout aborted\]: absolute pathname .${TESTDIR}/barf/sub. illegal for server" \
  13484. "${PROG} \[checkout aborted\]: cannot make directory sub: Permission denied"
  13485. chmod +w ${TESTDIR}/barf
  13486. rmdir ${TESTDIR}/barf
  13487. # Done. Nothing to clean up.
  13488. # Try checking out two modules into the same directory.
  13489. if $remote; then
  13490. dotest abspath-5ar "${testcvs} co -d 1 mod1 mod2" \
  13491. "${PROG} checkout: Updating 1/mod1
  13492. U 1/mod1/file1
  13493. ${PROG} checkout: Updating 1/mod2
  13494. U 1/mod2/file2"
  13495. else
  13496. dotest abspath-5a "${testcvs} co -d ${TESTDIR}/1 mod1 mod2" \
  13497. "${PROG} checkout: Updating ${TESTDIR}/1/mod1
  13498. U ${TESTDIR}/1/mod1/file1
  13499. ${PROG} checkout: Updating ${TESTDIR}/1/mod2
  13500. U ${TESTDIR}/1/mod2/file2"
  13501. fi # end remote workaround
  13502. dotest abspath-5b "cat ${TESTDIR}/1/CVS/Repository" "\."
  13503. dotest abspath-5c "cat ${TESTDIR}/1/mod1/CVS/Repository" "mod1"
  13504. dotest abspath-5d "cat ${TESTDIR}/1/mod2/CVS/Repository" "mod2"
  13505. # Done. Clean up.
  13506. rm -rf ${TESTDIR}/1
  13507. # Try checking out the top-level module.
  13508. if $remote; then
  13509. dotest abspath-6ar "${testcvs} co -d 1 ." \
  13510. "${PROG} checkout: Updating 1
  13511. ${PROG} checkout: Updating 1/CVSROOT
  13512. ${DOTSTAR}
  13513. ${PROG} checkout: Updating 1/mod1
  13514. U 1/mod1/file1
  13515. ${PROG} checkout: Updating 1/mod2
  13516. U 1/mod2/file2"
  13517. else
  13518. dotest abspath-6a "${testcvs} co -d ${TESTDIR}/1 ." \
  13519. "${PROG} checkout: Updating ${TESTDIR}/1
  13520. ${PROG} checkout: Updating ${TESTDIR}/1/CVSROOT
  13521. ${DOTSTAR}
  13522. ${PROG} checkout: Updating ${TESTDIR}/1/mod1
  13523. U ${TESTDIR}/1/mod1/file1
  13524. ${PROG} checkout: Updating ${TESTDIR}/1/mod2
  13525. U ${TESTDIR}/1/mod2/file2"
  13526. fi # end of remote workaround
  13527. dotest abspath-6b "cat ${TESTDIR}/1/CVS/Repository" "\."
  13528. dotest abspath-6c "cat ${TESTDIR}/1/CVSROOT/CVS/Repository" "CVSROOT"
  13529. dotest abspath-6c "cat ${TESTDIR}/1/mod1/CVS/Repository" "mod1"
  13530. dotest abspath-6d "cat ${TESTDIR}/1/mod2/CVS/Repository" "mod2"
  13531. # Done. Clean up.
  13532. rm -rf ${TESTDIR}/1
  13533. # Test that an absolute pathname to some other directory
  13534. # doesn't mess with the current working directory.
  13535. mkdir 1
  13536. cd 1
  13537. if $remote; then
  13538. dotest_fail abspath-7ar "${testcvs} -q co -d ../2 mod2" \
  13539. "${PROG} checkout: protocol error: .\.\./2. contains more leading \.\.
  13540. ${PROG} \[checkout aborted\]: than the 0 which Max-dotdot specified"
  13541. cd ..
  13542. dotest abspath-7a-try2r "${testcvs} -q co -d 2 mod2" \
  13543. "U 2/file2"
  13544. cd 1
  13545. else
  13546. dotest abspath-7a "${testcvs} -q co -d ${TESTDIR}/2 mod2" \
  13547. "U ${TESTDIR}/2/file2"
  13548. fi # remote workaround
  13549. dotest abspath-7b "ls" ""
  13550. dotest abspath-7c "${testcvs} -q co mod1" \
  13551. "U mod1/file1"
  13552. cd mod1
  13553. if $remote; then
  13554. cd ../..
  13555. dotest abspath-7dr "${testcvs} -q co -d 3 mod2" \
  13556. "U 3/file2"
  13557. cd 1/mod1
  13558. else
  13559. dotest abspath-7d "${testcvs} -q co -d ${TESTDIR}/3 mod2" \
  13560. "U ${TESTDIR}/3/file2"
  13561. fi # remote workaround
  13562. dotest abspath-7e "${testcvs} -q update -d" ""
  13563. cd ../..
  13564. rm -r 1 2 3
  13565. #
  13566. # FIXME: do other functions here (e.g. update /tmp/foo)
  13567. #
  13568. # Finished with all tests. Remove the module.
  13569. rm -rf ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/mod2
  13570. ;;
  13571. abspath2)
  13572. # More absolute path checks. The following used to attempt to create
  13573. # directories in /:
  13574. #
  13575. # $ cvs -d:fork:/cvsroot co /foo
  13576. # cvs checkout: warning: cannot make directory CVS in /: Permission denied
  13577. # cvs [checkout aborted]: cannot make directory /foo: Permission denied
  13578. # $
  13579. #
  13580. # The -z9 in this test also checks for an old server bug where the
  13581. # server would block indefinitely attempting to read an EOF from the
  13582. # client in the compression buffer shutdown routine.
  13583. dotest_fail abspath2-1 "$testcvs -z9 co /foo" \
  13584. "$PROG \[checkout aborted\]: Absolute module reference invalid: \`/foo'" \
  13585. "$PROG \[server aborted\]: Absolute module reference invalid: \`/foo'
  13586. $PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
  13587. ;;
  13588. toplevel)
  13589. # test the feature that cvs creates a CVS subdir also for
  13590. # the toplevel directory
  13591. # First set the TopLevelAdmin setting.
  13592. mkdir 1; cd 1
  13593. dotest toplevel-1a "${testcvs} -q co CVSROOT/config" \
  13594. "U CVSROOT/config"
  13595. cd CVSROOT
  13596. echo "TopLevelAdmin=yes" >config
  13597. dotest toplevel-1b "${testcvs} -q ci -m yes-top-level" \
  13598. "Checking in config;
  13599. ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
  13600. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  13601. done
  13602. ${PROG} commit: Rebuilding administrative file database"
  13603. cd ../..
  13604. rm -r 1
  13605. mkdir 1; cd 1
  13606. dotest toplevel-1 "${testcvs} -q co -l ." ''
  13607. mkdir top-dir second-dir
  13608. dotest toplevel-2 "${testcvs} add top-dir second-dir" \
  13609. "Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
  13610. Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
  13611. cd top-dir
  13612. touch file1
  13613. dotest toplevel-3 "${testcvs} add file1" \
  13614. "${PROG} add: scheduling file .file1. for addition
  13615. ${PROG} add: use .${PROG} commit. to add this file permanently"
  13616. dotest toplevel-4 "${testcvs} -q ci -m add" \
  13617. "RCS file: ${CVSROOT_DIRNAME}/top-dir/file1,v
  13618. done
  13619. Checking in file1;
  13620. ${CVSROOT_DIRNAME}/top-dir/file1,v <-- file1
  13621. initial revision: 1\.1
  13622. done"
  13623. cd ..
  13624. cd second-dir
  13625. touch file2
  13626. dotest toplevel-3s "${testcvs} add file2" \
  13627. "${PROG} add: scheduling file .file2. for addition
  13628. ${PROG} add: use .${PROG} commit. to add this file permanently"
  13629. dotest toplevel-4s "${testcvs} -q ci -m add" \
  13630. "RCS file: ${CVSROOT_DIRNAME}/second-dir/file2,v
  13631. done
  13632. Checking in file2;
  13633. ${CVSROOT_DIRNAME}/second-dir/file2,v <-- file2
  13634. initial revision: 1\.1
  13635. done"
  13636. cd ../..
  13637. rm -r 1; mkdir 1; cd 1
  13638. dotest toplevel-5 "${testcvs} co top-dir" \
  13639. "${PROG} checkout: Updating top-dir
  13640. U top-dir/file1"
  13641. dotest toplevel-6 "${testcvs} update top-dir" \
  13642. "${PROG} update: Updating top-dir"
  13643. dotest toplevel-7 "${testcvs} update" \
  13644. "${PROG} update: Updating \.
  13645. ${PROG} update: Updating top-dir"
  13646. dotest toplevel-8 "${testcvs} update -d top-dir" \
  13647. "${PROG} update: Updating top-dir"
  13648. # There is some sentiment that
  13649. # "${PROG} update: Updating \.
  13650. # ${PROG} update: Updating top-dir"
  13651. # is correct but it isn't clear why that would be correct instead
  13652. # of the remote CVS behavior (which also updates CVSROOT).
  13653. #
  13654. # The DOTSTAR matches of a bunch of lines like
  13655. # "U CVSROOT/checkoutlist". Trying to match them more precisely
  13656. # seemed to cause trouble. For example CVSROOT/cvsignore will
  13657. # be present or absent depending on whether we ran the "ignore"
  13658. # test or not.
  13659. dotest toplevel-9 "${testcvs} update -d" \
  13660. "${PROG} update: Updating \.
  13661. ${PROG} update: Updating CVSROOT
  13662. ${DOTSTAR}
  13663. ${PROG} update: Updating top-dir"
  13664. cd ..
  13665. rm -r 1; mkdir 1; cd 1
  13666. dotest toplevel-10 "${testcvs} co top-dir" \
  13667. "${PROG} checkout: Updating top-dir
  13668. U top-dir/file1"
  13669. # This tests more or less the same thing, in a particularly
  13670. # "real life" example.
  13671. dotest toplevel-11 "${testcvs} -q update -d second-dir" \
  13672. "U second-dir/file2"
  13673. # Now remove the CVS directory (people may do this manually,
  13674. # especially if they formed their habits with CVS
  13675. # 1.9 and older, which didn't create it. Or perhaps the working
  13676. # directory itself was created with 1.9 or older).
  13677. rm -r CVS
  13678. # Now set the permissions so we can't recreate it.
  13679. if test -n "$remotehost"; then
  13680. # Cygwin again.
  13681. $CVS_RSH $remotehost "chmod -w $TESTDIR/1"
  13682. else
  13683. chmod -w ../1
  13684. fi
  13685. # Now see whether CVS has trouble because it can't create CVS.
  13686. # First string is for local, second is for remote.
  13687. dotest toplevel-12 "${testcvs} co top-dir" \
  13688. "${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
  13689. ${PROG} checkout: Updating top-dir" \
  13690. "${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
  13691. ${PROG} checkout: in directory \.:
  13692. ${PROG} checkout: cannot open CVS/Entries for reading: No such file or directory
  13693. ${PROG} checkout: Updating top-dir"
  13694. chmod +w ../1
  13695. dotest toplevel-cleanup-1 "${testcvs} -q co CVSROOT/config" \
  13696. "U CVSROOT/config"
  13697. cd CVSROOT
  13698. echo "# empty file" >config
  13699. dotest toplevel-cleanup-2 "${testcvs} -q ci -m toplevel-cleanup" \
  13700. "Checking in config;
  13701. ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
  13702. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  13703. done
  13704. ${PROG} commit: Rebuilding administrative file database"
  13705. cd ../..
  13706. rm -r 1
  13707. rm -rf ${CVSROOT_DIRNAME}/top-dir ${CVSROOT_DIRNAME}/second-dir
  13708. ;;
  13709. toplevel2)
  13710. # Similar to toplevel, but test the case where TopLevelAdmin=no.
  13711. # First set the TopLevelAdmin setting.
  13712. mkdir 1; cd 1
  13713. dotest toplevel2-1a "${testcvs} -q co CVSROOT/config" \
  13714. "U CVSROOT/config"
  13715. cd CVSROOT
  13716. echo "TopLevelAdmin=no" >config
  13717. dotest toplevel2-1b "${testcvs} -q ci -m no-top-level" \
  13718. "Checking in config;
  13719. ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
  13720. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  13721. done
  13722. ${PROG} commit: Rebuilding administrative file database"
  13723. cd ../..
  13724. rm -r 1
  13725. # Now set up some directories and subdirectories
  13726. mkdir 1; cd 1
  13727. dotest toplevel2-1 "${testcvs} -q co -l ." ''
  13728. mkdir top-dir second-dir
  13729. dotest toplevel2-2 "${testcvs} add top-dir second-dir" \
  13730. "Directory ${CVSROOT_DIRNAME}/top-dir added to the repository
  13731. Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
  13732. cd top-dir
  13733. touch file1
  13734. dotest toplevel2-3 "${testcvs} add file1" \
  13735. "${PROG} add: scheduling file .file1. for addition
  13736. ${PROG} add: use .${PROG} commit. to add this file permanently"
  13737. dotest toplevel2-4 "${testcvs} -q ci -m add" \
  13738. "RCS file: ${CVSROOT_DIRNAME}/top-dir/file1,v
  13739. done
  13740. Checking in file1;
  13741. ${CVSROOT_DIRNAME}/top-dir/file1,v <-- file1
  13742. initial revision: 1\.1
  13743. done"
  13744. cd ..
  13745. cd second-dir
  13746. touch file2
  13747. dotest toplevel2-3s "${testcvs} add file2" \
  13748. "${PROG} add: scheduling file .file2. for addition
  13749. ${PROG} add: use .${PROG} commit. to add this file permanently"
  13750. dotest toplevel2-4s "${testcvs} -q ci -m add" \
  13751. "RCS file: ${CVSROOT_DIRNAME}/second-dir/file2,v
  13752. done
  13753. Checking in file2;
  13754. ${CVSROOT_DIRNAME}/second-dir/file2,v <-- file2
  13755. initial revision: 1\.1
  13756. done"
  13757. cd ../..
  13758. rm -r 1; mkdir 1; cd 1
  13759. dotest toplevel2-5 "${testcvs} co top-dir" \
  13760. "${PROG} checkout: Updating top-dir
  13761. U top-dir/file1"
  13762. dotest toplevel2-6 "${testcvs} update top-dir" \
  13763. "${PROG} update: Updating top-dir"
  13764. dotest toplevel2-7 "${testcvs} update" \
  13765. "${PROG} update: Updating top-dir"
  13766. dotest toplevel2-8 "${testcvs} update -d top-dir" \
  13767. "${PROG} update: Updating top-dir"
  13768. # Contrast this with toplevel-9, which has TopLevelAdmin=yes.
  13769. dotest toplevel2-9 "${testcvs} update -d" \
  13770. "${PROG} update: Updating top-dir"
  13771. cd ..
  13772. rm -r 1; mkdir 1; cd 1
  13773. dotest toplevel2-10 "${testcvs} co top-dir" \
  13774. "${PROG} checkout: Updating top-dir
  13775. U top-dir/file1"
  13776. # This tests more or less the same thing, in a particularly
  13777. # "real life" example. With TopLevelAdmin=yes, this command
  13778. # would give us second-dir and CVSROOT directories too.
  13779. dotest toplevel2-11 "${testcvs} -q update -d" ""
  13780. dotest toplevel2-cleanup-1 "${testcvs} -q co CVSROOT/config" \
  13781. "U CVSROOT/config"
  13782. cd CVSROOT
  13783. echo "# empty file" >config
  13784. dotest toplevel2-cleanup-2 "${testcvs} -q ci -m toplevel2-cleanup" \
  13785. "Checking in config;
  13786. ${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config
  13787. new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
  13788. done
  13789. ${PROG} commit: Rebuilding administrative file database"
  13790. cd ../..
  13791. rm -r 1
  13792. rm -rf ${CVSROOT_DIRNAME}/top-dir ${CVSROOT_DIRNAME}/second-dir
  13793. ;;
  13794. rstar-toplevel)
  13795. # This test used to confirm a bug that existed in the r* commands
  13796. # run against the top-level project prior to CVS 1.11.18 & 1.12.10.
  13797. #
  13798. # The assertion failure was something like:
  13799. # do_recursion: Assertion \`strstr (repository, \"/\./\") == ((void \*)0)' failed\..*"
  13800. dotest rstar-toplevel-1 "$testcvs -q rlog ." \
  13801. "
  13802. RCS file: $CVSROOT_DIRNAME/CVSROOT$DOTSTAR"
  13803. if $keep; then
  13804. echo Keeping ${TESTDIR} and exiting due to --keep
  13805. exit 0
  13806. fi
  13807. ;;
  13808. trailingslashes)
  13809. # Some tests of CVS's reactions to path specifications containing
  13810. # trailing slashes.
  13811. mkdir trailingslashes; cd trailingslashes
  13812. dotest trailingslashes-init-1 "$testcvs -Q co -ldt ."
  13813. dotest trailingslashes-init-2 "$testcvs -Q co -dt2 ."
  13814. cd t
  13815. echo "Ahh'll be baaack." >topfile
  13816. dotest trailingslashes-init-3 "$testcvs -Q add topfile"
  13817. dotest trailingslashes-init-4 "$testcvs -Q ci -mto-top" \
  13818. "RCS file: $CVSROOT_DIRNAME/topfile,v
  13819. done
  13820. Checking in topfile;
  13821. $CVSROOT_DIRNAME/topfile,v <-- topfile
  13822. initial revision: 1\.1
  13823. done"
  13824. # First, demonstrate the usual case.
  13825. cd ../t2
  13826. dotest trailingslashes-1 "$testcvs -q up CVSROOT"
  13827. dotest_fail trailingslashes-1a "test -f topfile"
  13828. # Now the one that used to fail in remote mode prior to 1.11.24
  13829. # & 1.12.14. Formerly TODO item #205.
  13830. dotest trailingslashes-2 "$testcvs -q up CVSROOT/"
  13831. dotest_fail trailingslashes-2a "test -f topfile"
  13832. if $keep; then
  13833. echo Keeping $TESTDIR and exiting due to --keep
  13834. exit 0
  13835. fi
  13836. cd ../..
  13837. rm -rf trailingslashes $CVSROOT_DIRNAME/topfile,v
  13838. ;;
  13839. checkout_repository)
  13840. dotest_fail checkout_repository-1 \
  13841. "${testcvs} co -d ${CVSROOT_DIRNAME} CVSROOT" \
  13842. "${PROG} \[checkout aborted\]: Cannot check out files into the repository itself" \
  13843. "${PROG} \[checkout aborted\]: absolute pathname \`${CVSROOT_DIRNAME}' illegal for server"
  13844. # The behavior of the client/server test below should be correct.
  13845. # The CVS client currently has no way of knowing that the client and
  13846. # server are the same machine and thus skips the $CVSROOT checks.
  13847. # I think checking for this case in CVS would be bloat since this
  13848. # should be a fairly rare occurance.
  13849. cd ${CVSROOT_DIRNAME}
  13850. dotest_fail checkout_repository-2 "${testcvs} co CVSROOT" \
  13851. "${PROG} \[checkout aborted\]: Cannot check out files into the repository itself" \
  13852. "${PROG} checkout: Updating CVSROOT
  13853. ${PROG} checkout: move away CVSROOT/checkoutlist; it is in the way
  13854. C CVSROOT/checkoutlist
  13855. ${PROG} checkout: move away CVSROOT/commitinfo; it is in the way
  13856. C CVSROOT/commitinfo
  13857. ${PROG} checkout: move away CVSROOT/config; it is in the way
  13858. C CVSROOT/config
  13859. ${PROG} checkout: move away CVSROOT/cvswrappers; it is in the way
  13860. C CVSROOT/cvswrappers
  13861. ${PROG} checkout: move away CVSROOT/editinfo; it is in the way
  13862. C CVSROOT/editinfo
  13863. ${PROG} checkout: move away CVSROOT/loginfo; it is in the way
  13864. C CVSROOT/loginfo
  13865. ${PROG} checkout: move away CVSROOT/modules; it is in the way
  13866. C CVSROOT/modules
  13867. ${PROG} checkout: move away CVSROOT/notify; it is in the way
  13868. C CVSROOT/notify
  13869. ${PROG} checkout: move away CVSROOT/rcsinfo; it is in the way
  13870. C CVSROOT/rcsinfo
  13871. ${PROG} checkout: move away CVSROOT/taginfo; it is in the way
  13872. C CVSROOT/taginfo
  13873. ${PROG} checkout: move away CVSROOT/verifymsg; it is in the way
  13874. C CVSROOT/verifymsg"
  13875. dotest checkout_repository-3 \
  13876. "${testcvs} co -p CVSROOT/modules >/dev/null" \
  13877. "===================================================================
  13878. Checking out CVSROOT/modules
  13879. RCS: ${CVSROOT_DIRNAME}/CVSROOT/modules,v
  13880. VERS: 1\.[0-9]*
  13881. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
  13882. cd ${TESTDIR}
  13883. ;;
  13884. mflag)
  13885. for message in '' ' ' '
  13886. ' ' test' ; do
  13887. # Set up
  13888. mkdir a-dir; cd a-dir
  13889. # Test handling of -m during import
  13890. echo testa >>test
  13891. if ${testcvs} import -m "$message" a-dir A A1 >>${LOGFILE} 2>&1;then
  13892. pass 156
  13893. else
  13894. fail 156
  13895. fi
  13896. # Must import twice since the first time uses inline code that
  13897. # avoids RCS call.
  13898. echo testb >>test
  13899. if ${testcvs} import -m "$message" a-dir A A2 >>${LOGFILE} 2>&1;then
  13900. pass 157
  13901. else
  13902. fail 157
  13903. fi
  13904. # Test handling of -m during ci
  13905. cd ..; rm -r a-dir
  13906. if ${testcvs} co a-dir >>${LOGFILE} 2>&1; then
  13907. pass 158
  13908. else
  13909. fail 158
  13910. fi
  13911. cd a-dir
  13912. echo testc >>test
  13913. if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
  13914. pass 159
  13915. else
  13916. fail 159
  13917. fi
  13918. # Test handling of -m during rm/ci
  13919. rm test;
  13920. if ${testcvs} rm test >>${LOGFILE} 2>&1; then
  13921. pass 160
  13922. else
  13923. fail 160
  13924. fi
  13925. if ${testcvs} ci -m "$message" >>${LOGFILE} 2>&1; then
  13926. pass 161
  13927. else
  13928. fail 161
  13929. fi
  13930. # Clean up
  13931. cd ..
  13932. rm -r a-dir
  13933. rm -rf ${CVSROOT_DIRNAME}/a-dir
  13934. done
  13935. ;;
  13936. editor)
  13937. # More tests of log messages, in this case the ability to
  13938. # run an external editor.
  13939. # TODO:
  13940. # * also test $EDITOR, $CVSEDITOR, &c.
  13941. # * test what happens if up-to-date check fails.
  13942. # Our "editor" puts "x" at the start of each line, so we
  13943. # can see the "CVS:" lines.
  13944. cat >${TESTDIR}/editme <<EOF
  13945. #!${TESTSHELL}
  13946. sleep 1
  13947. sed <\$1 -e 's/^/x/' >${TESTDIR}/edit.new
  13948. mv ${TESTDIR}/edit.new \$1
  13949. exit 0
  13950. EOF
  13951. chmod +x ${TESTDIR}/editme
  13952. mkdir 1; cd 1
  13953. dotest editor-1 "${testcvs} -q co -l ." ''
  13954. mkdir first-dir
  13955. dotest editor-2 "${testcvs} add first-dir" \
  13956. "Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
  13957. cd first-dir
  13958. touch file1 file2
  13959. dotest editor-3 "${testcvs} add file1 file2" \
  13960. "${PROG} add: scheduling file .file1. for addition
  13961. ${PROG} add: scheduling file .file2. for addition
  13962. ${PROG} add: use .${PROG} commit. to add these files permanently"
  13963. dotest editor-4 "${testcvs} -e ${TESTDIR}/editme -q ci" \
  13964. "RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  13965. done
  13966. Checking in file1;
  13967. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  13968. initial revision: 1\.1
  13969. done
  13970. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  13971. done
  13972. Checking in file2;
  13973. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  13974. initial revision: 1\.1
  13975. done"
  13976. dotest editor-5 "${testcvs} -q tag -b br" "T file1
  13977. T file2"
  13978. dotest editor-6 "$testcvs -q update -r br" \
  13979. 'U file1
  13980. U file2'
  13981. echo modify >>file1
  13982. dotest editor-7 "${testcvs} -e ${TESTDIR}/editme -q ci" \
  13983. "Checking in file1;
  13984. ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
  13985. new revision: 1\.1\.2\.1; previous revision: 1\.1
  13986. done"
  13987. # OK, now we want to make sure "ci -r" puts in the branch
  13988. # where appropriate. Note that we can check in on the branch
  13989. # without being on the branch, because there is not a revision
  13990. # already on the branch. If there were a revision on the branch,
  13991. # CVS would correctly give an up-to-date check failed.
  13992. dotest editor-8 "$testcvs -q update -A" \
  13993. 'U file1
  13994. U file2'
  13995. echo add a line >>file2
  13996. dotest editor-9 "${testcvs} -q -e ${TESTDIR}/editme ci -rbr file2" \
  13997. "Checking in file2;
  13998. ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
  13999. new revision: 1\.1\.2\.1; previous revision: 1\.1
  14000. done"
  14001. dotest editor-log-file1 "${testcvs} log -N file1" "
  14002. RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
  14003. Working file: file1
  14004. head: 1\.1
  14005. branch:
  14006. locks: strict
  14007. access list:
  14008. keyword substitution: kv
  14009. total revisions: 2; selected revisions: 2
  14010. description:
  14011. ----------------------------
  14012. revision 1\.1
  14013. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  14014. branches: 1\.1\.2;
  14015. xCVS: ----------------------------------------------------------------------
  14016. xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
  14017. xCVS:
  14018. xCVS: Committing in .
  14019. xCVS:
  14020. xCVS: Added Files:
  14021. xCVS: file1 file2
  14022. xCVS: ----------------------------------------------------------------------
  14023. ----------------------------
  14024. revision 1\.1\.2\.1
  14025. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
  14026. xCVS: ----------------------------------------------------------------------
  14027. xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
  14028. xCVS:
  14029. xCVS: Committing in .
  14030. xCVS:
  14031. xCVS: Modified Files:
  14032. xCVS: Tag: br
  14033. xCVS: file1
  14034. xCVS: ----------------------------------------------------------------------
  14035. ============================================================================="
  14036. # The only difference between the two expect strings is the
  14037. # presence or absence of "Committing in ." for 1.1.2.1.
  14038. dotest editor-log-file2 "${testcvs} log -N file2" "
  14039. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  14040. Working file: file2
  14041. head: 1\.1
  14042. branch:
  14043. locks: strict
  14044. access list:
  14045. keyword substitution: kv
  14046. total revisions: 2; selected revisions: 2
  14047. description:
  14048. ----------------------------
  14049. revision 1\.1
  14050. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  14051. branches: 1\.1\.2;
  14052. xCVS: ----------------------------------------------------------------------
  14053. xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
  14054. xCVS:
  14055. xCVS: Committing in .
  14056. xCVS:
  14057. xCVS: Added Files:
  14058. xCVS: file1 file2
  14059. xCVS: ----------------------------------------------------------------------
  14060. ----------------------------
  14061. revision 1\.1\.2\.1
  14062. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
  14063. xCVS: ----------------------------------------------------------------------
  14064. xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
  14065. xCVS:
  14066. xCVS: Modified Files:
  14067. xCVS: Tag: br
  14068. xCVS: file2
  14069. xCVS: ----------------------------------------------------------------------
  14070. =============================================================================" "
  14071. RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
  14072. Working file: file2
  14073. head: 1\.1
  14074. branch:
  14075. locks: strict
  14076. access list:
  14077. keyword substitution: kv
  14078. total revisions: 2; selected revisions: 2
  14079. description:
  14080. ----------------------------
  14081. revision 1\.1
  14082. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
  14083. branches: 1\.1\.2;
  14084. xCVS: ----------------------------------------------------------------------
  14085. xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
  14086. xCVS:
  14087. xCVS: Committing in .
  14088. xCVS:
  14089. xCVS: Added Files:
  14090. xCVS: file1 file2
  14091. xCVS: ----------------------------------------------------------------------
  14092. ----------------------------
  14093. revision 1\.1\.2\.1
  14094. date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0
  14095. xCVS: ----------------------------------------------------------------------
  14096. xCVS: Enter Log. Lines beginning with .CVS:. are removed automatically
  14097. xCVS:
  14098. xCVS: Committing in .
  14099. xCVS:
  14100. xCVS: Modified Files:
  14101. xCVS: Tag: br
  14102. xCVS: file2
  14103. xCVS: ----------------------------------------------------------------------
  14104. ============================================================================="
  14105. # Test CVS's response to an unchanged log message
  14106. cat >${TESTDIR}/editme <<EOF
  14107. #!${TESTSHELL}
  14108. sleep 1
  14109. exit 0
  14110. EOF
  14111. chmod +x ${TESTDIR}/editme
  14112. dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
  14113. "
  14114. Log message unchanged or not specified
  14115. a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
  14116. Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
  14117. # Test CVS's response to an empty log message
  14118. cat >${TESTDIR}/editme <<EOF
  14119. #!${TESTSHELL}
  14120. sleep 1
  14121. cat /dev/null >\$1
  14122. exit 0
  14123. EOF
  14124. chmod +x ${TESTDIR}/editme
  14125. dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
  14126. "
  14127. Log message unchanged or not specified
  14128. a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
  14129. Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
  14130. # Test CVS's response to a log message with one blank line
  14131. cat >${TESTDIR}/editme <<EOF
  14132. #!${TESTSHELL}
  14133. sleep 1
  14134. echo >\$1
  14135. exit 0
  14136. EOF
  14137. chmod +x ${TESTDIR}/editme
  14138. dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \
  14139. "
  14140. Log message unchanged or not specified
  14141. a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
  14142. Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user"
  14143. # Test CVS's response to a log message with only comments
  14144. cat >${TESTDIR}/editme <<EOF
  14145. #!${TESTSHELL}
  14146. sleep 1
  14147. cat \$1 >${TESTDIR}/edit.new
  14148. mv ${TESTDIR}/edit.new \$1
  14149. exit 0
  14150. EOF
  14151. chmod +x ${TESTD