[Only reason for not checking this in now is that it should wait until after Halibut, as there is no hurry. -kingdon] 1998-08-08 Jim Kingdon * sanity.sh (rcsinfo): New test, for CVSROOT/rcsinfo. Index: sanity.sh =================================================================== RCS file: /home2/cvsroot/ccvs/src/sanity.sh,v retrieving revision 1.415 diff -u -r1.415 sanity.sh --- sanity.sh 1998/08/06 19:13:25 1.415 +++ sanity.sh 1998/08/08 21:41:10 @@ -563,7 +563,7 @@ tests="${tests} modules modules2 modules3 modules4" tests="${tests} cvsadm emptydir abspath toplevel toplevel2" # Log messages, error messages. - tests="${tests} mflag editor errmsg1 errmsg2" + tests="${tests} mflag editor rcsinfo errmsg1 errmsg2 rcsinfo" # Watches, binary files, history browsing, &c. tests="${tests} devcom devcom2 devcom3 watch4" tests="${tests} unedit-without-baserev" @@ -8368,8 +8368,9 @@ editor) # More tests of log messages, in this case the ability to # run an external editor. + # Other tests: + # rcsinfo - EDITOR, CVSEDITOR, CVSROOT/rcsinfo # TODO: - # * also test $EDITOR, $CVSEDITOR, &c. # * test what happens if up-to-date check fails. # Our "editor" puts "x" at the start of each line, so we @@ -8543,6 +8544,162 @@ cd ../.. rm -r 1 rm ${TESTDIR}/editme + rm -rf ${CVSROOT_DIRNAME}/first-dir + ;; + + rcsinfo) + # Tests of the CVSROOT/rcsinfo file. See the comment at the + # "info" tests for a full list of administrative file tests. + # See "editor" and other tests for more log message tests. + + # Our "editor" puts "x" at the start of each line. No need to + # preserve the "CVS:" lines, the "editor" test already + # dealt with that. + cat >${TESTDIR}/editme <${TESTDIR}/edit.new +echo 'make sure we edit something' >> ${TESTDIR}/edit.new +mv ${TESTDIR}/edit.new \$1 +exit 0 +EOF + chmod +x ${TESTDIR}/editme + + mkdir 1; cd 1 + dotest rcsinfo-1 "${testcvs} -q co -l ." "" + dotest rcsinfo-2 "${testcvs} -q update -d CVSROOT" \ +"U CVSROOT${DOTSTAR}" + cd CVSROOT + echo "^ ${TESTDIR}/template" >>rcsinfo + echo 'this is a template for rcsinfo' >${TESTDIR}/template + dotest rcsinfo-3 "${testcvs} -q ci -m modify-rcsinfo" \ +"Checking in rcsinfo; +${TESTDIR}/cvsroot/CVSROOT/rcsinfo,v <-- rcsinfo +new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* +done +${PROG} [a-z]*: Rebuilding administrative file database" + cd .. + + mkdir first-dir + dotest rcsinfo-4 "${testcvs} add first-dir" \ +"Directory ${TESTDIR}/cvsroot/first-dir added to the repository" + # For remote, we need to check out the directory afresh + # for it to get CVS/Template. + cd .. + mkdir 2; cd 2 + dotest rcsinfo-5 "${testcvs} -q co -l ." "" + dotest rcsinfo-6 "${testcvs} -q update -d first-dir" "" + + cd first-dir + echo file1 > file1 + dotest rcsinfo-6 "${testcvs} add file1" \ +"${PROG} [a-z]*: scheduling file .file1. for addition +${PROG} [a-z]*: use .${PROG} commit. to add this file permanently" + # Note that the VISUAL environment variable is not + # documented by cvs.texinfo. Might be nice to phase it + # out, I don't know. What does POSIX say? + # + # We definately don't want to get into the issue of whether + # VISUAL overrides EDITOR or vice-versa. Do note that + # CVSEDITOR overrides EDITOR (this is documented and quite + # sensible). + unset VISUAL + EDITOR=${TESTDIR}/no-such-editor + export EDITOR + CVSEDITOR=${TESTDIR}/editme + export CVSEDITOR + dotest rcsinfo-7 "${testcvs} -q ci" \ +"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v +done +Checking in file1; +${TESTDIR}/cvsroot/first-dir/file1,v <-- file1 +initial revision: 1\.1 +done" + unset CVSEDITOR + + cd .. + echo add line >>first-dir/file1 + EDITOR=${TESTDIR}/editme + export EDITOR + dotest rcsinfo-8 "${testcvs} -q ci first-dir" \ +"Checking in first-dir/file1; +${TESTDIR}/cvsroot/first-dir/file1,v <-- file1 +new revision: 1\.2; previous revision: 1\.1 +done" + unset EDITOR + + # Note that for local, the pathname in rcsinfo matches where + # we check in (that is, it can be "^first-dir" and even + # "cvs ci first-dir" from one level up will get it). For + # remote it matches the directory from which we check in (I + # think) (for whatever reason, the "cvs ci first-dir" case + # doesn't get it). + # Changing "^first-dir" to "^" didn't seem to help; I'm not + # sure why. + # + # Note the bit about "Working file:" including the directory. + # Interestingly enough, CVS 1.7 managed to tweak its arguments + # to "rlog" to the point where it gets the same behavior. + if test "$remote" = yes; then + dotest rcsinfo-log-file1 "${testcvs} log -N first-dir/file1" " +RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v +Working file: first-dir/file1 +head: 1\.2 +branch: +locks: strict +access list: +keyword substitution: kv +total revisions: 2; selected revisions: 2 +description: +---------------------------- +revision 1\.2 +date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0 +x +make sure we edit something +---------------------------- +revision 1\.1 +date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; +x +xthis is a template for rcsinfo +make sure we edit something +=============================================================================" + else + dotest rcsinfo-log-file1 "${testcvs} log -N first-dir/file1" " +RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v +Working file: first-dir/file1 +head: 1\.2 +branch: +locks: strict +access list: +keyword substitution: kv +total revisions: 2; selected revisions: 2 +description: +---------------------------- +revision 1\.2 +date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; lines: ${PLUS}1 -0 +x +xthis is a template for rcsinfo +make sure we edit something +---------------------------- +revision 1\.1 +date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; +x +xthis is a template for rcsinfo +make sure we edit something +=============================================================================" + fi + cd ../1 + cd CVSROOT + echo '# do nothing' >rcsinfo + dotest rcsinfo-cleanup-1 "${testcvs} -q ci -m cleanup-rcsinfo" \ +"Checking in rcsinfo; +${TESTDIR}/cvsroot/CVSROOT/rcsinfo,v <-- rcsinfo +new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* +done +${PROG} [a-z]*: Rebuilding administrative file database" + cd ../.. + rm -r 1 2 + rm ${TESTDIR}/editme ${TESTDIR}/template rm -rf ${CVSROOT_DIRNAME}/first-dir ;;