diff options
Diffstat (limited to 'contrib/cvs/src')
28 files changed, 3295 insertions, 720 deletions
diff --git a/contrib/cvs/src/ChangeLog b/contrib/cvs/src/ChangeLog index f483a7b..727332c 100644 --- a/contrib/cvs/src/ChangeLog +++ b/contrib/cvs/src/ChangeLog @@ -1,3 +1,807 @@ +2002-04-17 Derek Price <oberon@umich.edu> + + * version.h: Regenerated for 1.11.2. + +2002-04-03 Derek Price <oberon@umich.edu> + + * stamp-h2.in: Regenerate with recent version of Autoconf. + +2002-04-03 Derek Price <oberon@umich.edu> + + * sanity.sh (TR): Send the stderr of one of the tool setup (tr) tests + to /dev/null to avoid spurious output on some operating systems + (notably Mac OS X). + +2002-03-22 Larry Jones <larry.jones@sdrc.com> + + * sanity.sh (rcslib): Correct new tests to use ${testcvs} instead + of cvs. + +2002-03-21 Derek Price <oberon@umich.edu> + + * vers_ts.c (time_stamp): Return the timestamp for the newer of the + link and the link's source when the file is a link. + (Patch from RedHat cvs-1.11.1p1-7 SRPM.) + + * sanity.sh (rcslib): Test for same. + +2002-03-17 Larry Jones <larry.jones@sdrc.com> + + * log.c (cvslog, log_fileproc): Add -S option to suppress head or + file name if no revisions selected. + * sanity.sh (log): New tests for above. + +2002-03-13 Derek Price <oberon@umich.edu> + + * main.c (usg): Correct a spelling mistake in a comment. + (Thanks to Matt Kraai <kraai@alumni.cmu.edu>.) + +2002-03-09 Larry Jones <larry.jones@sdrc.com> + + * import.c (import): Change the suggested merge message to use + rev tags instead of the branch tag with a date. + * sanity.sh (import, importb): Change to match. + + * remove.c (remove_fileproc): Disallow removing files with sticky + dates for the same reason we already disallow sticky numeric tags. + * sanity.sh (sticky): New test for above. + +2002-02-27 Larry Jones <larry.jones@sdrc.com> + + * diff.c (diff_fileproc): Treat dead revisions as nonexistent. + +2002-02-26 Larry Jones <larry.jones@sdrc.com> + + * diff.c (diff): Remove -V and --paginate options: they aren't valid. + (diff_usage): Document all the diff options. + +2002-02-13 Larry Jones <larry.jones@sdrc.com> + + * rcs.c (RCS_gettag): Do not interpret an empty tag as HEAD (nothing + else does and I don't see any documentation that says it should). + (translate_symtag): Break out of loop at end of symbols to prevent + looping forever when tag is "". + (Reported by Alain ENOUT <aln00@udcast.com> + via Eric Gillespie <epg@pretzelnet.org>.) + +2002-02-11 Larry Jones <larry.jones@sdrc.com> + + * server.c (server_cleanup): Set buf_to_net back to blocking mode + and flush it (in case there are any error messages pending) before + shutting down buf_from_net and again right before shutting it down. + +2002-02-08 Larry Jones <larry.jones@sdrc.com> + + * main.c (lookup_command_attribute): Throw a fatal error if the + command is not found. + * server.c (server_tag): Use the correct command name. + +2002-01-30 Larry Jones <larry.jones@sdrc.com> + + * error.h (error_exit): Remove unintended prototype. + + * server.c (serve_root): Remove check for impossible condition. + (serve_init): Save and restore current_parsed_root. + +2002-01-29 Larry Jones <larry.jones@sdrc.com> + + * error.h (error_exit): Declare __noreturn__ to avoid spurious + warnings. + + * server.c (serve_root): If the specified root doesn't match the + pserver root, return before changing current_parsed_root to prevent + subsequent commands from accessing an unchecked root directory. + (server_init): Check specified root against the pserver root and + complain if they don't match. Also, if there are pending errors, + print them and return before changing current_parsed_root to prevent + subsequent commands from accessing an unchecked root directory. + * sanity.sh (pserver): New tests for above. + +2002-01-10 Larry Jones <larry.jones@sdrc.com> + + * log.c (log_version_requested): Change :: in revision spec to be + exclusive just on the low end (so -r tag1::tag2 gives revisions + after tag1 but up to and including tag2), which is much more useful + than the previous (exclusive at both ends) behavior. + (log_usage): Update to match. + * sanity.sh (log): Update to match. + +2002-01-02 Larry Jones <larry.jones@sdrc.com> + + * server.c (LOG_DAEMON): Define if needed. + (Patch from John David Anglin <dave@hiauly1.hia.nrc.ca>.) + + * server.c (pserver_authenticate_connection): Add a specific error + message for EOF at protocol start and syslog if available. + * sanity.sh (pserver-bufinit): Update to match. + +2001-12-10 Larry Jones <larry.jones@sdrc.com> + + * log.c (log_usage): Note that -r and -d take lists, not just a + single specification. + (log_expand_revlist): Don't dereference null pointers when one end + of a revision range is a non-existent tag. + +2001-12-03 Larry Jones <larry.jones@sdrc.com> + + * annotate.c (annotate, annotate_fileproc): Don't annotate binary + files unless new -F option given. + * sanity.sh (basica, ann, ann-id, rcs, keywordlog, tagdate): Update + to match. + +2001-11-30 Larry Jones <larry.jones@sdrc.com> + + * admin.c (admin): Allow unrestricted usage of -q in addition to -k. + +2001-10-25 Larry Jones <larry.jones@sdrc.com> + + * log.c (log_expand_revlist): Make erroneous or inconsistent revision + specs select no revisions rather than all revisions. + +2001-10-23 Larry Jones <larry.jones@sdrc.com> + + * import.c (add_rcs_file): Don't put an expand entry into the file + for the default expansion mode (kv). + * wrapper.c (wrap_send, wrap_unparse_rcs_options): Process entries + with default expansion mode since they may be needed to avoid matching + a more general entry later. + (wrap_add): Set rcsOption to NULL for default (kv). + (wrap_add_entry): Use structure assignment to copy entries rather + that copying members by hand. + * sanity.sh (binwrap3): Revise to test wrapper entries that don't + specify any non-default options but just prevent matching later, + more general entries. + +2001-10-02 Larry Jones <larry.jones@sdrc.com> + + * rcs.c (RCS_fully_parse): Add revision number to more error messages. + +2001-09-27 Larry Jones <larry.jones@sdrc.com> + + * rcs.c (RCS_fully_parse, RCS_getdeltatext): Add the missing revision + number to the "mismatch" error message. + + * sanity.sh (multiroot2-9a): Update to match changes to lock.c. + +2001-09-26 Larry Jones <larry.jones@sdrc.com> + + * lock.c (Lock_Cleanup, Reader_Lock, write_lock): Add trace messages. + +2001-09-24 Derek Price <dprice@collab.net> + + * find_names.c (add_entries_proc): Leave closure specified as such in the + function definition for clarity. + + * find_names.c (Find_Names): Use 'closure' feature of walklist() + to eliminate the static variable. + (add_entries_proc): Expect closure to be the file list. + (Patch from Alexey Mahotkin <alexm@hsys.msk.ru>.) + +2001-09-19 Derek Price <dprice@collab.net> + + * rcs.c (rcsbuf_valpolish_internal): Restore one of the + "if ( ... ) abort();" sequences since it seems to check the validity of + the RCS file rather than for a programming error. Also added a FIXME + comment to the effect that we should explain the RCS file error to the + user as such if it is such. + (Thanks to Larry Jones <scjones@sdrc.com>.) + +2001-09-19 Derek Price <dprice@collab.net> + + * rcs.c (rcsbuf_getkey, rcsbuf_valpolish_internal): Replace some code + of the form "if ( ... ) abort();" with equivalent calls to assert(). + +2001-09-17 Derek Price <dprice@collab.net> + + * myndbm.c (mydbm_load_file): Fix buffer overflow error and make error + messages more informative. + * sanity.sh (modules6): New test. + (Original report from Taska <taska@collab.net> and others.) + +2001-09-14 Derek Price <dprice@collab.net> + + * logmsg.c (do_verify): Dispose memory when finished with it. + +2001-09-07 Larry Jones <larry.jones@sdrc.com> + + * mkmodules.c (notify_contents): In the example, move the %s to + the end since many, if not most, versions of mail insist on + options coming before addresses. + +2001-09-06 Derek Price <dprice@collab.net> + + * login.c (login): Deal with NULL return value from getpass. + +2001-09-04 Derek Price <dprice@collab.net> + + * Makefile.in: Regenerated with automake 1.5. + * stamp-h2.in: Ditto. + +2001-09-04 Derek Price <dprice@collab.net> + + * main.c (main): Fix empty CVSROOT message to specify `valid' instead + of `legal'. + +2001-09-04 Derek Price <dprice@collab.net> + + * server.c (pserver_authenticate_connection): Back out changes from the + 30th and... + * getline.c (getstr): init the buffer instead. + +2001-08-31 Derek Price <dprice@collab.net> + + * Makefile.in: Backed out accidental commit from yesterday. + +2001-08-30 Derek Price <dprice@collab.net> + + * server.c (pserver_authenticate_connection): Don't print from the + NULL pointer in the error message string in the case where the client + didn't send any data. + * sanity.sh (pserver): Test for this case. + (Report from Mark Welch <mark@collab.net>). + +2001-08-24 Derek Price <dprice@collab.net> + + * logmsg.c (do_editor): Add comment and assertion. + * import.c (import): Don't call do_editor with a repository argument + in client mode. + (Report and original patch from darkness <darkness@invado.com>.) + +2001-08-24 Larry Jones <larry.jones@sdrc.com> + + * log.c (log_expand_revlist): Arrange for nil revision specs to + select nothing instead of everything. + * sanity.sh (log): New tests for above. + +2001-08-24 Derek Price <dprice@collab.net> + + * parseinfo.c (Parse_Info): Change the function name in the trace + and add the client/server string. + +2001-08-24 Derek Price <dprice@collab.net> + + * Implement RereadLogAfterVerify CVSROOT/config option to control + FreeBSD read-write of log messages in the verification script. + * logmsg.c: RereadLogAfterVerify defaults to LOGMSG_REREAD_NEVER + to preserve the status quo. + * parseinfo.c (parse_config): Add parsing for RereadLogAfterVerify + option. Possible values are: no | never | yes | always | stat + * cvs.h: Add extern for RereadLogAfterVerify and new value macros + LOGMSG_REREAD_NEVER, LOGMSG_REREAD_ALWAYS, LOGMSG_REREAD_STAT for + its values. + (Patch from Mark D. Baushke <mdb@cvshome.org>.) + + * Apply changes from FreeBSD cvs sources to implement a read-write + user-defined verification script. + * logmsg.c (do_verify): Update do_verify to expect a pointer + to the saved message. The log file passed to the verifymsg_script + should be re-read after the user-defined verification script has + been run. The user-defined verification script is allowed to + modify the message. This allows the script to add extra + information to the log message or to remove template lines that + are not needed. + * cvs.h: Update prototype for do_verify prototype to expect a + pointer to the saved_message. + * commit.c (commit, commit_fileproc, commit_direntproc): Update + calls to do_verify as the saved_message arg is now read-write. + * import.c (import): Update calls to do_verify as the + saved_message arg is now read-write. + * sanity.sh (info-v4-[12]): Rename the old info-v4 test to info-v5 + and add a new info-v4 test case have the verification script + modify the log message to test the above changes. + (Patch from Mark D. Baushke <mdb@cvshome.org>.) + + * logmsg.c: Change RereadLogAfterVerify default to always. + (do_verify): Reformat and make minor fixes to Mark's patch. + * mkmodules.c (config_constants): Add comment about + RereadLogAfterVerify. + * sanity.sh (info-rereadlog): Rename the tests from Mark's patch and + reformat them a bit. + +2001-08-23 Derek Price <dprice@collab.net> + + * sanity.sh (info): Demonstrate that the verifymsg scripts can + sometimes, but not always, retreive information on which directory is + being committed to. + +2001-08-22 Derek Price <dprice@collab.net> + + * logmsg.c: Back out the last change - the repository which is passed + in is actually the directory and changes with each call to do_verify. + If a verifymsg script is using `pwd`, this could change the operation. + * cvs.h: Ditto. + * commit.c: Ditto. + * import.c: Ditto. + +2001-08-22 Derek Price <dprice@collab.net> + + * logmsg.c (do_editor): Return reused_message. + (do_verify): Don't verify the same log message more than once. + * cvs.h: Update prototypes for do_verify and do_editor. + * commit.c (commit_fileproc, commit_direntproc): Use the new functionality. + * import.c (import): Ditto. + +2001-08-22 Derek Price <dprice@collab.net> + + * logmsg.c (do_verify): Remove an unecessary "else" clause following an + exit and unindent the former contents. + +2001-08-22 Derek Price <dprice@collab.net> + + * commit.c (commit): Don't call do_verify in client mode since we know + do_verify will just return anyhow. + +2001-08-20 Derek Price <dprice@collab.net> + + * Makefile.am (cvs_SOURCES): Add version.c and version.h. + (BUILT_SOURCES): Add version.h. + (Maintainer Targets): Remove version.h. + * version.c: Remove @VERSION@ dependant bits. + * version.c.in: Removed. + * version.h.in: New file. + (Original patch from Alexey Mahotkin <alexm@hsys.msk.ru>.) + + * Makefile.am: Various modifications to make Automake, make dist, and + windows targets work like they are supposed to. + * version.h: New (generated) file. + + * Makefile.in: Regenerated. + +2001-08-09 Derek Price <dprice@collab.net> + + * client.c (socket_buffer_shutdown): Use recv instead of read and + return 0 on success. + (Patch from "Manfred Klug" <manklu@web.de>.) + +2001-08-09 Derek Price <dprice@collab.net> + + * buffer.c (stdio_buffer_shutdown): Assume the buffer is not a socket + when NO_SOCKET_TO_FD is defined. + * client.c (make_bufs_from_fds): Add is_sock argument and remove fstat + call and reference to S_ISSOCK since these functions aren't available + under Windows. + (connect_to_forked_server, connect_to_pserver, start_tcp_server, + start_server, start_rsh_server): Use new argument. + (Patch from "Manfred Klug" <manklu@web.de>.) + + * buffer.c (stdio_buffer_shutdown): Various reformattings, fix bug + where rsh pipes weren't being closed. + +2001-08-09 Derek Price <dprice@collab.net> + + * sanity.sh (rmadd, rm-update-message, join-two-branch, + ignore-on-branch): Change a few references to `cvs' to `$PROG'. + +2001-08-07 Derek Price <dprice@collab.net> + + * build_src.com: Add annotate.c/annotate.obj,verify, correct zlib name. + * patch.c: VMS time_t appears to be unsigned. Add a cast when testing + for (time_t)-1. + * subr.c: #else,#endif for no symlinks should be moved. + (Patch from Mike Marciniszyn <Mike.Marciniszyn@sanchez.com>.) + +2001-08-06 Derek Price <dprice@collab.net> + + * Makefile.in: Regenerated. + +2001-08-01 Derek Price <dprice@collab.net> + + * diff.c (diff): Send long option for side-by-side diffs to the server + rather than '-y', for backwards compatibility with old servers. + (Original patch from Peter Mathiasson <peter@mathiasson.nu>.) + +2001-07-19 Larry Jones <larry.jones@sdrc.com> + + * mkmodules.c (cvswrappers_contents): Remove -t/-f since they're + disabled in wrapper.c. + + * checkout.c (checkout): Don't complain about checking out into the + repository when piping output. + (Reported by der Mouse <mouse@Rodents.Montreal.QC.CA>.) + * sanity.sh (checkout_repository): New tests for above. + +2001-07-10 Larry Jones <larry.jones@sdrc.com> + + * sanity.sh (importc-7): Now works correctly in local mode. + + * commit.c (commit_dirleaveproc): We're still in the directory when + this is called, so the first argument to Name_Repository needs to + be NULL, not dir. + * sanity.sh (rmadd): New tests for above. + + * commit.c (commit): Reword error messages for committing as root. + +2001-07-08 Larry Jones <larry.jones@sdrc.com> + + * rcs.c (RCS_checkout): Correct scanf format to allow for trailing + NUL terminator. + * update.c (special_file_mismatch): Ditto. + (Reported by Pekka Savola <pekkas@netcore.fi>.) + +2001-07-05 Larry Jones <larry.jones@sdrc.com> + + * client.c, root.c: Fix -Wall warnings. + + * buffer.c: #include socket header to declare shutdown(). + + * rcs.c (rcsbuf_open): Use getpagesize() instead of sysconf() for + portability. + (RCS_copydeltas, rcsbuf_fill): Fix -Wall warnings. + +2001-07-04 Derek Price <dprice@collab.net> + + * Makefile.in: Regenerated with new Automake release candidate 1.4h. + +2001-07-03 Derek Price <dprice@collab.net> + + * rcs.c (rcsbuf_open): Reduce memory consumption still further by not + mmapping the entire file when pos is specified. + (rcsbuf_cache_open): Add FIXME comment wrt read-only mmaps and rcsbuf + caching. + +2001-07-03 Derek Price <dprice@collab.net> + + * rcs.c (rcsbuf_open): Use mmap when possible to reduce memory + consumption, especially with large (e.g. binary) files. + (rcsbuf_close): Call munmap. + (rcsbuf_getkey): Remove the buffer fill code when using mmap. + (rcsbuf_getrevnum): Ditto. + (rcsbuf_fill): Remove this function when using mmap. + (rcsbuf_cache_open): Mostly don't use this function with mmap. + (RCS_copydeltas): Don't depend on the file pointer with mmap. + + * stamp-h2.in: Regenerated. + +2001-07-03 Derek Price <dprice@collab.net> + + * update.c: Indent compiler directives. + +2001-07-02 Larry Jones <larry.jones@sdrc.com> + + * import.c (update_rcs_file): Use -kb instead of -ko when comparing + binary files. + (Reported by Gyula Faller <gfaller@graphisoft.hu>.) + +2001-06-28 Larry Jones <larry.jones@sdrc.com> + + * checkout.c (checkout): Explicitly initialize all the static options + so that multiple calls work right. Also fix potential memory leaks. + (Reported by Dr. Dieter Maurer <dieter@sz-sb.de>.) + +2001-06-28 Derek Price <dprice@collab.net> + + * Makefile.in: Regenerated with new version of Automake. + +2001-06-28 Larry Jones <larry.jones@sdrc.com> + + * checkout.c (checkout): Set history_name for export as well as + checkout. + (checkout_proc): Use it. + + * checkout.c (safe_location): Add missing argument in error message. + +2001-06-26 Larry Jones <larry.jones@sdrc.com> + + * recurse.c (start_recursion): Use strip_trailing_slashes instead + of doing it by hand. + + * server.c (pserver_authenticate_connection): Don't clear out + descrambled_password until *after* it's (potentially) logged. + (Reported by Eric Hanchrow <offby1@blarg.net>.) + +2001-06-25 Larry Jones <larry.jones@sdrc.com> + + * recurse.c (start_recursion): Deal with at least some of the cases + where trailing slashes cause confusion. + (Reported by Malcolm Fernandes <fernande@redback.com>.) + * sanity.sh (basica, basicb): Tweak existing tests to check this. + +2001-06-22 Larry Jones <larry.jones@sdrc.com> + + * sanity.sh (modules5): New tests with -d on command line. + +2001-06-21 Larry Jones <larry.jones@sdrc.com> + + * modules.c (do_module): Use run_module_prog and server_active to + determine when to call server_prog instead of using server_expanding + so that we get the right paths in the replies as long as we take + mwhere into account in addition to where. + (Reported by Pascal Bourguignon <pjb@informatimago.com>.) + * server.c (server_prog): Use protocol pipe instead of buf_to_net. + * sanity.sh (modules5): Remove FIXCVS comment and update to match. + * server.c, server.h: Remove server_expanding since now unused. + +2001-06-21 Larry Jones <larry.jones@sdrc.com> + for Stephen Rasku <stephen@tgivan.com> + + * admin.c: Corrected spelling mistakes in help. + +2001-06-20 Derek Price <dprice@collab.net> + + * client.c (socket_buffer_shutdown): Fix untested typos. + (Reported by "Jerzy Kaczorowski" <jerzyk@wndtabs.com>.) + + * buffer.c (stdio_buffer_shutdown): Put the call to SHUTDOWN_SERVER in + the correct place. + +2001-06-20 Derek Price <dprice@collab.net> + + * logmsg.c (do_editor): Abort in the case that the file has only + comment lines. + (Original patch from Mark Valentine <mark@thuvia.demon.co.uk>.) + + * logmsg.c (do_editor): Fix rare memory leak. + * sanity.sh (editor): Add tests for aborted log messages. + +2001-06-20 Larry Jones <larry.jones@sdrc.com> + + * server.c (switch_to_user): Only set $CVS_USER if + AUTH_SERVER_SUPPORT is defined. + (Reported by Nalin Dahyabhai <nalin@blade.devel.redhat.com>.) + +2001-06-13 Derek Price <dprice@collab.net> + + * client.c: Fix incorrect fixed-size buffer usage in + connect_to_gserver(). + (Minor changes to a patch from Alexey Mahotkin <alexm@hsys.msk.ru>.) + +2001-06-11 Derek Price <dprice@collab.net> + + * main.c (main): Always print $CVSROOT when parse_cvsroot fails. + * root.c (parse_cvsroot): Tidy error messages and provide more + consistent behavior. + * sanity.sh (crerepos): Adapt to new error messages. + (Suggested by Alexey Mahotkin <alexm@hsys.msk.ru>.) + +2001-06-08 Derek Price <dprice@collab.net> + + * sanity.sh (tagf-28): Use $CVSROOT_DIRNAME. + +2001-06-07 Larry Jones <larry.jones@sdrc.com> + + * rcs.c (RCS_unlock): Reverse kj's change of 1999-10-18: a bare -u + should never break locks, you have to specify a specific revision + to do that. Also add an informative message for a bare -u when + the user doesn't hold any locks. + * commit.c (unlockrcs): Make RCS_unlock quiet, like RCS_lock. + * sanity.sh (rmadd-24): Update to match. + + * sanity.sh (crerepos-6a): Set CVS_RSH for ${testcvs}, not for + dotest_fail. Allow for "broken pipe" rather than "end of file". + +2001-06-07 Derek Price <dprice@collab.net> + + * sanity.sh (tagf): Use $CVSROOT_DIRNAME rather than + /tmp/cvs-sanity/cvsroot. + +2001-06-06 Derek Price <dprice@collab.net> + + (Reformatting, bug fixes, tests, and comments to a + patch from Stephen Cameron <steve.cameron@compaq.com>.) + + * tag.c: (rtag_fileproc, rtag_delete, tag_fileproc) + Changed behavior of "cvs tag -F", "cvs tag -d", "cvs rtag -F" + and "cvs rtag -d" so that they will not disturb existing + branch tags unless a new "-B" option is given. + * sanity.sh (tagf-16 - tagf-33): Added tests for new -B option + to "cvs tag" and "cvs rtag" + +2001-06-06 Derek Price <dprice@collab.net> + + * sanity.sh (crerepos-6a): Set CVS_RSH=false and only for the actual + test call at Larry's suggestion. Also, test the error message since + it's fixed now. + +2001-06-05 Larry Jones <larry.jones@sdrc.com> + + * rcs.c (RCS_unlock): Note when breaking someone else's lock. + (Reported by MURVAI-BUZOGANY Laszlo + <Laszlo.MURVAI-BUZOGANY@gt-systems.hu>.) + * sanity.sh (reserved-14): Update to match. + +2001-06-05 Derek Price <dprice@collab.net> + + * sanity.sh (crerepos-6a): Set CVS_RSH=/bin/false... this is a local + mode only test anyhow. + (Thanks to Larry Jones and Morgan Burke <morgan@sitka.triumf.ca>.) + +2001-05-31 Derek Price <dprice@collab.net> + + * sanity.sh (rcs2-7): Add today to the list of failure dates for rcs2-7 + in the hopes that the data will eventually prove useful to someone + motivated enough to fix the problem. + +2001-05-30 Derek Price <dprice@collab.net> + + * stamp-h2.in: Regenerated. + +2001-05-30 Derek Price <dprice@collab.net> + + * *: Various bug fixes and comments for the following + patch from Donald Sharp <sharpd@cisco.com>: + + * checkout.c (safe_location): cvs co -d <directory> still had + failure modes from the way the -d option works. + * sanity.sh: Misc error message resynching. + +2001-05-29 Derek Price <dprice@collab.net> + + * Makefile.am (cvs_SOURCES): Add root.h. + + * Makefile.in: Regenerated. + * stamp-h2.in: Regenerated. + +2001-05-29 Derek Price <dprice@collab.net> + + * checkout.c (safe_location): Correct formatting. + +2001-05-29 Derek Price <dprice@collab.net> + + * root.c (parse_cvsroot): Fix a comment. + +2001-05-26 Larry Jones <larry.jones@sdrc.com> + + * checkout.c (safe_location): Use old-style definition to keep + non-ANSI compilers happy. + + * sanity.sh (check_respository): Use ${CVSROOT_DIRNAME} instead + of /tmp/cvs-sanity/cvsroot. + +2001-05-25 Larry Jones <larry.jones@sdrc.com> + + * sanity.sh (modules5): Add sleep to script to help avoid out of + order messages. + + * filesubr.c (mkdir_if_needed): Return 1 if the directory exists + reguardless of what errno is set to. + (Reported by "Robinson, Greg" <greg.robinson@dsto.defence.gov.au>.) + +2001-05-25 Derek Price <dprice@collab.net> + for Donald Sharp <sharpd@cisco.com> + + * checkout.c: Modified safe_location() to refuse checkout if + the -d option to co specifies inside of the repository. + * import.c: New parameter to safe_location needed to be added. + * cvs.h: New parameter to safe_location needed to be added. + * sanity.sh: Test case to test for failure mode. + +2001-05-23 Larry Jones <larry.jones@sdrc.com> + + * checkout.c (checkout_proc): Don't build top_level_admin directory + when exporting. + (Reported by Tony Byrne <tonyb@directski.com>.) + +2001-05-21 Derek Price <dprice@collab.net> + + * client.c: Fix a mispelling in a comment. + (Patch from Alexey Mahotkin <alexm@hsys.msk.ru>). + +2001-05-05 Larry Jones <larry.jones@sdrc.com> + + * login.c (password_entry_operation): Only warn if unable to open + .cvspass for reading: may be initial login and it doesn't exist yet. + +2001-05-15 Derek Price <dprice@collab.net> + + * client.c (start_tcp_server): Use the struct sockaddr_in declared in + the function. + (Reported by Emil Isberg <isberg@dynarc.se>.) + +2001-05-05 Larry Jones <larry.jones@sdrc.com> + + * annotate.c (annotate): Pass local to do_module and rannotate_proc + so that -l actually works. + * log.c (cvslog): Ditto. + * patch.c (patch): Ditto; make local local instead of global. + (patch_proc): Use local_specified parameter instead of global. + * tag.c (cvstag, rtag_proc): Ditto. + +2001-05-05 Larry Jones <larry.jones@sdrc.com> + + * client.h: Declare "struct buffer" outside prototype for __STDC__ + compilers. + +2001-05-04 Derek Price <dprice@collab.net> + + * client.c: General refactoring. Removed several global variables in + favor of passing locals and/or dynamic evaluation. + (recv_line): Removed this function. + (make_bufs_from_fds): New function with factored code. + (connect_to_forked_server): New prototype. Use new functions. + (connect_to_pserver): New prototype. Use new functions. + (connect_to_gserver): New prototype. Use new API. + (auth_server): Factored this portion of the pserver code so it can be + shared. Rewrote to use buffers rather than depending on a socket. + (start_rsh_server): New prototype. Use new API. + (start_tcp_server): New prototype. Use new API. + (start_server): Factor some code. Use new API. + * client.h: New prototypes. + * cvs.h: Gratuitous reformatting. Use new root.h. + * login.c (login): Use new connect_to_pserver API. + * root.h: New file. Contains some code that used to be in cvs.h. + +2001-05-04 Derek Price <dprice@collab.net> + + * client.c: Gratuitous reformatting. + * client.h: Ditto. + +2001-05-04 Derek Price <dprice@collab.net> + + * zlib.c (compress_buffer_shutdown_input): Use new buffer shutdown + prototype. + (compress_buffer_shutdown_output): Ditto. + (Thanks to Pavel Roskin <proski@gnu.org>.) + +2001-05-03 Derek Price <dprice@collab.net> + + * buffer.c (struct stdio_buffer_closure): New structure to hold a + FILE * and the child's PID when necessary. + (stdio_buffer_initialize): Change proto to accept PID. Set up new + closure. Pass new stdio_buffer_shutdown to buf_initialize. + (stdio_buffer_input): Use new closure. + (stdio_buffer_output): Ditto. + (stdio_buffer_flush): Ditto. + (stdio_buffer_shutdown): New function. Teach buffer to close itself. + (packetizing_buffer_shutdown): Use new buffer shutdown proto. + * buffer.h (struct buffer): New buffer shutdown proto. + (stdio_buffer_initialize): New proto. + * client.c (log_buffer_shutdown): Use new proto. + (socket_buffer_initialize): Pass shutdown func. + (socket_buffer_shutdown): New function. + * server.c (get_responses_and_close): Remove most of the guts. Rely + on the buffer shutdown function from now on. + (start_rsh_server): Return child PID. + +2001-05-03 Larry Jones <larry.jones@sdrc.com> + + * history.c (history_write): Handle the case where the user's home + directory doesn't exist gracefully instead of erroring out. + (Reported by David Hoover <dhoover@cadence.com>.) + +2001-05-03 Derek Price <dprice@collab.net> + + * cvs.h: s/allocate_and_strcat/xrealloc_and_strcat/ since that is what + I wrote in the ChangeLog, oh, so long ago. + * diff.c (diff): Ditto. + * subr.c (allocate_and_strcat, xrealloc_and_strcat): Ditto. + +2001-05-02 Larry Jones <larry.jones@sdrc.com> + + * rcs.c (RCS_getdate): Handle the (unusual!) case where we + can't find any revisions at all. + (Reported by Ryan Grow <rgrow@Dbdoctor.net>.) + +2001-04-30 Larry Jones <larry.jones@sdrc.com> + + * sanity.sh (multiroot2-9a): Rename (from multiroot2-9) to avoid + duplicate names; fix to work without SERVER_SUPPORT defined. + (Reported by Pavel Roskin <proski@gnu.org>.) + +2001-04-29 Derek Price <dprice@collab.net> + + * Makefile.am (check-local): Make dependent on localcheck and + remotecheck and move old check target... + (localcheck): here. + + * Makefile.in: Regenerated. + +2001-04-27 Larry Jones <larry.jones@sdrc.com> + + * sanity.sh (pserver): Add tests for readers and writers. + +2001-04-27 Derek Price <dprice@collab.net> + + * sanity.sh (version-2r): Update to handle patch releases in version + numbers. + +2001-04-27 Derek Price <dprice@collab.net> + + * version.c: Regenerated. + +2001-04-27 Derek Price <dprice@collab.net> + + * version.c: Regenerated. + 2001-04-27 Larry Jones <larry.jones@sdrc.com> * main.c (lookup_command_attribute): Lookup specified command, not diff --git a/contrib/cvs/src/Makefile.am b/contrib/cvs/src/Makefile.am index 768d4f8..2020141 100644 --- a/contrib/cvs/src/Makefile.am +++ b/contrib/cvs/src/Makefile.am @@ -75,6 +75,7 @@ cvs_SOURCES = \ subr.c \ tag.c \ update.c \ + version.c \ vers_ts.c \ watch.c \ wrapper.c \ @@ -89,15 +90,18 @@ cvs_SOURCES = \ hash.h \ myndbm.h \ rcs.h \ + root.h \ server.h \ update.h \ + version.h \ watch.h + +BUILT_SOURCES = version.h + cvs_LDADD = \ ../diff/libdiff.a \ ../lib/libcvs.a \ - ../zlib/libz.a \ - version.o -cvs_EXTRA_DIST = version.c + ../zlib/libz.a # extra clean targets # wish this could be distclean-hdr-local but it's not part of automake @@ -105,18 +109,18 @@ DISTCLEANFILES = options.h-SAVED check.log check.plog # General EXTRA_DIST = \ - $(cvs_EXTRA_DIST) \ .cvsignore \ ChangeLog-9194 \ ChangeLog-9395 \ ChangeLog-96 \ ChangeLog-97 \ build_src.com \ - sanity.sh \ - version.c \ - version.c.in + sanity.sh + +check-local: localcheck remotecheck -check-local: +.PHONY: localcheck +localcheck: $(SHELL) $(srcdir)/sanity.sh `pwd`/cvs .PHONY: remotecheck @@ -125,20 +129,6 @@ remotecheck: all ## MAINTAINER Targets -# version.c -# - build this here so that we can distribute it -# - version.c needs to be updated only once, since it depends on -# configure.in, not on the results of a 'configure' run. -# - It is guaranteed (with GNU Make) that when the version in configure.in -# is changed, acversion.m4 is built only after the new version number is -# propagated to the Makefile. (Libtool uses the same guarantee.) -# - need the explicit version.o dependency or else make won't match -# $(srcdir)/version.c when looking for a dependency for version.c -version.o: $(srcdir)/version.c -$(srcdir)/version.c: $(srcdir)/version.c.in $(top_srcdir)/configure.in - sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/version.c.in >$(srcdir)/version.tc - mv $(srcdir)/version.tc $(srcdir)/version.c - # for backwards compatibility with the old makefiles .PHONY: realclean realclean: maintainer-clean diff --git a/contrib/cvs/src/Makefile.in b/contrib/cvs/src/Makefile.in index c80deab..a4d5966 100644 --- a/contrib/cvs/src/Makefile.in +++ b/contrib/cvs/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4e from Makefile.am. +# Makefile.in generated automatically by automake 1.5 from Makefile.am. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -45,11 +45,9 @@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = .. ACLOCAL = @ACLOCAL@ @@ -63,7 +61,6 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ - NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : @@ -75,25 +72,22 @@ AWK = @AWK@ CC = @CC@ CSH = @CSH@ DEPDIR = @DEPDIR@ -ETAGS = @ETAGS@ -ETAGS_INCLUDE_OPTION = @ETAGS_INCLUDE_OPTION@ +EXEEXT = @EXEEXT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@ KRB4 = @KRB4@ LN_S = @LN_S@ -MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PERL = @PERL@ PR = @PR@ PS2PDF = @PS2PDF@ RANLIB = @RANLIB@ ROFF = @ROFF@ -STRIP = @STRIP@ TEXI2DVI = @TEXI2DVI@ VERSION = @VERSION@ YACC = @YACC@ -_am_include = @_am_include@ -_am_quote = @_am_quote@ +am__include = @am__include@ +am__quote = @am__quote@ includeopt = @includeopt@ install_sh = @install_sh@ @@ -159,6 +153,7 @@ cvs_SOURCES = \ subr.c \ tag.c \ update.c \ + version.c \ vers_ts.c \ watch.c \ wrapper.c \ @@ -173,17 +168,20 @@ cvs_SOURCES = \ hash.h \ myndbm.h \ rcs.h \ + root.h \ server.h \ update.h \ + version.h \ watch.h + +BUILT_SOURCES = version.h + cvs_LDADD = \ ../diff/libdiff.a \ ../lib/libcvs.a \ - ../zlib/libz.a \ - version.o + ../zlib/libz.a -cvs_EXTRA_DIST = version.c # extra clean targets # wish this could be distclean-hdr-local but it's not part of automake @@ -191,23 +189,18 @@ DISTCLEANFILES = options.h-SAVED check.log check.plog # General EXTRA_DIST = \ - $(cvs_EXTRA_DIST) \ .cvsignore \ ChangeLog-9194 \ ChangeLog-9395 \ ChangeLog-96 \ ChangeLog-97 \ build_src.com \ - sanity.sh \ - version.c \ - version.c.in + sanity.sh -EXEEXT = -OBJEXT = o subdir = src mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h options.h -CONFIG_CLEAN_FILES = cvsbug +CONFIG_CLEAN_FILES = cvsbug version.h bin_PROGRAMS = cvs$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) @@ -226,26 +219,19 @@ am_cvs_OBJECTS = add.$(OBJEXT) admin.$(OBJEXT) annotate.$(OBJEXT) \ recurse.$(OBJEXT) release.$(OBJEXT) remove.$(OBJEXT) \ repos.$(OBJEXT) root.$(OBJEXT) run.$(OBJEXT) scramble.$(OBJEXT) \ server.$(OBJEXT) status.$(OBJEXT) subr.$(OBJEXT) tag.$(OBJEXT) \ - update.$(OBJEXT) vers_ts.$(OBJEXT) watch.$(OBJEXT) \ - wrapper.$(OBJEXT) zlib.$(OBJEXT) + update.$(OBJEXT) version.$(OBJEXT) vers_ts.$(OBJEXT) \ + watch.$(OBJEXT) wrapper.$(OBJEXT) zlib.$(OBJEXT) cvs_OBJECTS = $(am_cvs_OBJECTS) -cvs_DEPENDENCIES = ../diff/libdiff.a ../lib/libcvs.a ../zlib/libz.a \ - version.o +cvs_DEPENDENCIES = ../diff/libdiff.a ../lib/libcvs.a ../zlib/libz.a cvs_LDFLAGS = SCRIPTS = $(bin_SCRIPTS) -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CFLAGS = @CFLAGS@ -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I. DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ -DIST_SOURCES = $(cvs_SOURCES) depcomp = $(SHELL) $(top_srcdir)/depcomp @AMDEP_TRUE@DEP_FILES = $(DEPDIR)/add.Po $(DEPDIR)/admin.Po \ @AMDEP_TRUE@ $(DEPDIR)/annotate.Po $(DEPDIR)/buffer.Po \ @@ -272,28 +258,30 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp @AMDEP_TRUE@ $(DEPDIR)/server.Po $(DEPDIR)/status.Po \ @AMDEP_TRUE@ $(DEPDIR)/subr.Po $(DEPDIR)/tag.Po \ @AMDEP_TRUE@ $(DEPDIR)/update.Po $(DEPDIR)/vers_ts.Po \ -@AMDEP_TRUE@ $(DEPDIR)/watch.Po $(DEPDIR)/wrapper.Po \ -@AMDEP_TRUE@ $(DEPDIR)/zlib.Po +@AMDEP_TRUE@ $(DEPDIR)/version.Po $(DEPDIR)/watch.Po \ +@AMDEP_TRUE@ $(DEPDIR)/wrapper.Po $(DEPDIR)/zlib.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(cvs_SOURCES) DIST_COMMON = ./stamp-h2.in ChangeLog Makefile.am Makefile.in cvsbug.in \ - options.h.in + options.h.in version.h.in SOURCES = $(cvs_SOURCES) -OBJECTS = $(am_cvs_OBJECTS) -all: options.h +all: $(BUILT_SOURCES) options.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj - $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && \ CONFIG_HEADERS= CONFIG_LINKS= \ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status - options.h: stamp-h2 @if test ! -f $@; then \ rm -f stamp-h2; \ @@ -321,12 +309,16 @@ distclean-hdr: -rm -f options.h cvsbug: $(top_builddir)/config.status cvsbug.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status +version.h: $(top_builddir)/config.status version.h.in + cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ @@ -342,8 +334,7 @@ uninstall-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -cvs$(EXEEXT): $(cvs_OBJECTS) $(cvs_DEPENDENCIES) +cvs$(EXEEXT): $(cvs_OBJECTS) $(cvs_DEPENDENCIES) @rm -f cvs$(EXEEXT) $(LINK) $(cvs_LDFLAGS) $(cvs_OBJECTS) $(cvs_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @@ -374,6 +365,78 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/add.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/admin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/annotate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/buffer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/checkin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/checkout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/classify.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/commit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/create_adm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/cvsrc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/diff.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/edit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/entries.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/expand_path.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fileattr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/filesubr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/find_names.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/hardlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/hash.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/history.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/ignore.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/import.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/login.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/logmsg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/mkmodules.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/modules.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/myndbm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/no_diff.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/parseinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/patch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/rcs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/rcscmds.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/recurse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/release.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/remove.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/repos.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/root.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/run.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/scramble.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/status.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/subr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/tag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/update.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/vers_ts.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/version.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/watch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/wrapper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/zlib.Po@am__quote@ + +distclean-depend: + -rm -rf $(DEPDIR) + +.c.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + +.c.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` +CCDEPMODE = @CCDEPMODE@ +uninstall-info-am: + tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -390,93 +453,21 @@ TAGS: $(HEADERS) $(SOURCES) options.h.in $(TAGS_DEPENDENCIES) \ tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ - unique=`for i in $$list @CONFIG@; do \ + unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)options.h.in$$unique$(LISP)$$tags" \ - || $(ETAGS) $(ETAGS_ARGS) $$tags options.h.in $$unique $(LISP) + || etags $(ETAGS_ARGS) $$tags options.h.in $$unique $(LISP) GTAGS: here=`CDPATH=: && cd $(top_builddir) && pwd` \ && cd $(top_srcdir) \ - && gtags -i $$here + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID - -@_am_include@ @_am_quote@$(DEPDIR)/add.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/admin.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/annotate.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/buffer.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/checkin.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/checkout.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/classify.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/client.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/commit.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/create_adm.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/cvsrc.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/diff.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/edit.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/entries.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/error.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/expand_path.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/fileattr.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/filesubr.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/find_names.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/hardlink.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/hash.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/history.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/ignore.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/import.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/lock.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/log.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/login.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/logmsg.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/main.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/mkmodules.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/modules.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/myndbm.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/no_diff.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/parseinfo.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/patch.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/rcs.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/rcscmds.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/recurse.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/release.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/remove.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/repos.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/root.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/run.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/scramble.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/server.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/status.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/subr.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/tag.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/update.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/vers_ts.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/watch.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/wrapper.Po@_am_quote@ -@_am_include@ @_am_quote@$(DEPDIR)/zlib.Po@_am_quote@ - -distclean-depend: - -rm -rf $(DEPDIR) - -CCDEPMODE = @CCDEPMODE@ - -.c.o: - source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ - depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ - $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< - -.c.obj: - source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ - depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ - $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c -o $@ `cygpath -w $<` - + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -485,7 +476,11 @@ distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ - d=$(srcdir); \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ @@ -512,24 +507,22 @@ install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am - install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install - + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." - -rm -f Makefile.in + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am @@ -539,11 +532,11 @@ distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-hdr distclean-tags -dvi: +dvi: dvi-am dvi-am: -info: +info: info-am info-am: @@ -551,7 +544,7 @@ install-data-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS -install-info: +install-info: install-info-am install-man: @@ -565,45 +558,35 @@ mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic -uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS - -.PHONY: all all-am check check-am check-local clean clean-binPROGRAMS \ - clean-generic distclean distclean-compile distclean-depend \ - distclean-generic distclean-hdr distclean-tags distdir dvi \ - dvi-am info info-am install install-am install-binPROGRAMS \ - install-binSCRIPTS install-data install-data-am install-exec \ - install-exec-am install-info install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ +uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ + uninstall-info-am + +.PHONY: GTAGS all all-am check check-am check-local clean \ + clean-binPROGRAMS clean-generic distclean distclean-compile \ + distclean-depend distclean-generic distclean-hdr distclean-tags \ + distdir dvi dvi-am info info-am install install-am \ + install-binPROGRAMS install-binSCRIPTS install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-binSCRIPTS + uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-info-am -check-local: +check-local: localcheck remotecheck + +.PHONY: localcheck +localcheck: $(SHELL) $(srcdir)/sanity.sh `pwd`/cvs .PHONY: remotecheck remotecheck: all $(SHELL) $(srcdir)/sanity.sh -r `pwd`/cvs -# version.c -# - build this here so that we can distribute it -# - version.c needs to be updated only once, since it depends on -# configure.in, not on the results of a 'configure' run. -# - It is guaranteed (with GNU Make) that when the version in configure.in -# is changed, acversion.m4 is built only after the new version number is -# propagated to the Makefile. (Libtool uses the same guarantee.) -# - need the explicit version.o dependency or else make won't match -# $(srcdir)/version.c when looking for a dependency for version.c -version.o: $(srcdir)/version.c -$(srcdir)/version.c: $(srcdir)/version.c.in $(top_srcdir)/configure.in - sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/version.c.in >$(srcdir)/version.tc - mv $(srcdir)/version.tc $(srcdir)/version.c - # for backwards compatibility with the old makefiles .PHONY: realclean realclean: maintainer-clean - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/contrib/cvs/src/admin.c b/contrib/cvs/src/admin.c index 359bedf..2a35d71 100644 --- a/contrib/cvs/src/admin.c +++ b/contrib/cvs/src/admin.c @@ -31,12 +31,12 @@ static const char *const admin_usage[] = "\t (all names if omitted).\n", "\t-I Run interactively.\n", "\t-k subst Set keyword substitution mode:\n", - "\t kv (Default) Substitue keyword and value.\n", - "\t kvl Substitue keyword, value, and locker (if any).\n", - "\t k Substitue keyword only.\n", + "\t kv (Default) Substitute keyword and value.\n", + "\t kvl Substitute keyword, value, and locker (if any).\n", + "\t k Substitute keyword only.\n", "\t o Preserve original string.\n", "\t b Like o, but mark file as binary.\n", - "\t v Substitue value only.\n", + "\t v Substitute value only.\n", "\t-l[rev] Lock revision (latest revision on branch,\n", "\t latest revision on trunk if omitted).\n", "\t-L Set strict locking.\n", @@ -169,7 +169,7 @@ admin (argc, argv) while ((c = getopt (argc, argv, "+ib::c:a:A:e::l::u::LUn:N:m:o:s:t::IqxV:k:")) != -1) { - if (c != 'k') + if (c != 'k' && c != 'q') only_k_option = 0; switch (c) diff --git a/contrib/cvs/src/annotate.c b/contrib/cvs/src/annotate.c index 827619d..41acdf7 100644 --- a/contrib/cvs/src/annotate.c +++ b/contrib/cvs/src/annotate.c @@ -17,6 +17,7 @@ /* Options from the command line. */ static int force_tag_match = 1; +static int force_binary = 0; static char *tag = NULL; static int tag_validated; static char *date = NULL; @@ -30,10 +31,11 @@ static int rannotate_proc PROTO((int argc, char **argv, char *xwhere, static const char *const annotate_usage[] = { - "Usage: %s %s [-lRf] [-r rev] [-D date] [files...]\n", + "Usage: %s %s [-lRfF] [-r rev] [-D date] [files...]\n", "\t-l\tLocal directory only, no recursion.\n", "\t-R\tProcess directories recursively.\n", "\t-f\tUse head revision if tag/date not found.\n", + "\t-F\tAnnotate binary files.\n", "\t-r rev\tAnnotate file as of specified revision/tag.\n", "\t-D date\tAnnotate file as of specified date.\n", "(Specify the --help global option for a list of other help options)\n", @@ -58,7 +60,7 @@ annotate (argc, argv) usage (annotate_usage); optind = 0; - while ((c = getopt (argc, argv, "+lr:D:fR")) != -1) + while ((c = getopt (argc, argv, "+lr:D:fFR")) != -1) { switch (c) { @@ -77,6 +79,9 @@ annotate (argc, argv) case 'f': force_tag_match = 0; break; + case 'F': + force_binary = 1; + break; case '?': default: usage (annotate_usage); @@ -100,6 +105,8 @@ annotate (argc, argv) send_arg ("-l"); if (!force_tag_match) send_arg ("-f"); + if (force_binary) + send_arg ("-F"); option_with_arg ("-r", tag); if (date) client_senddate (date); @@ -128,14 +135,14 @@ annotate (argc, argv) for (i = 0; i < argc; i++) { err += do_module (db, argv[i], MISC, "Annotating", rannotate_proc, - (char *) NULL, 0, 0, 0, 0, (char *) NULL); + (char *) NULL, 0, local, 0, 0, (char *) NULL); } close_module (db); } else { err = rannotate_proc (argc + 1, argv - 1, (char *) NULL, - (char *) NULL, (char *) NULL, 0, 0, (char *) NULL, + (char *) NULL, (char *) NULL, 0, local, (char *) NULL, (char *) NULL); } @@ -251,7 +258,7 @@ annotate_fileproc (callerdat, finfo) void *callerdat; struct file_info *finfo; { - char *version; + char *expand, *version; if (finfo->rcs == NULL) return (1); @@ -259,19 +266,28 @@ annotate_fileproc (callerdat, finfo) if (finfo->rcs->flags & PARTIAL) RCS_reparsercsfile (finfo->rcs, (FILE **) NULL, (struct rcsbuffer *) NULL); + expand = RCS_getexpand (finfo->rcs); version = RCS_getversion (finfo->rcs, tag, date, force_tag_match, (int *) NULL); + if (version == NULL) return 0; /* Distinguish output for various files if we are processing several files. */ - cvs_outerr ("Annotations for ", 0); + cvs_outerr ("\nAnnotations for ", 0); cvs_outerr (finfo->fullname, 0); cvs_outerr ("\n***************\n", 0); - RCS_deltas (finfo->rcs, (FILE *) NULL, (struct rcsbuffer *) NULL, - version, RCS_ANNOTATE, NULL, NULL, NULL, NULL); + if (!force_binary && expand && expand[0] == 'b') + { + cvs_outerr ("Skipping binary file -- -F not specified.\n", 0); + } + else + { + RCS_deltas (finfo->rcs, (FILE *) NULL, (struct rcsbuffer *) NULL, + version, RCS_ANNOTATE, NULL, NULL, NULL, NULL); + } free (version); return 0; } diff --git a/contrib/cvs/src/buffer.c b/contrib/cvs/src/buffer.c index 8f90545..0c13cde 100644 --- a/contrib/cvs/src/buffer.c +++ b/contrib/cvs/src/buffer.c @@ -6,6 +6,12 @@ #if defined (SERVER_SUPPORT) || defined (CLIENT_SUPPORT) +#ifdef HAVE_WINSOCK_H +# include <winsock.h> +#else +# include <sys/socket.h> +#endif + /* OS/2 doesn't have EIO. FIXME: this whole notion of turning a different error into EIO strikes me as pretty dubious. */ #if !defined (EIO) @@ -28,7 +34,7 @@ buf_initialize (input, output, flush, block, shutdown, memory, closure) int (*output) PROTO((void *, const char *, int, int *)); int (*flush) PROTO((void *)); int (*block) PROTO((void *, int)); - int (*shutdown) PROTO((void *)); + int (*shutdown) PROTO((struct buffer *)); void (*memory) PROTO((struct buffer *)); void *closure; { @@ -73,7 +79,7 @@ buf_nonio_initialize (memory) (int (*) PROTO((void *, const char *, int, int *))) NULL, (int (*) PROTO((void *))) NULL, (int (*) PROTO((void *, int))) NULL, - (int (*) PROTO((void *))) NULL, + (int (*) PROTO((struct buffer *))) NULL, memory, (void *) NULL)); } @@ -1198,7 +1204,7 @@ buf_shutdown (buf) struct buffer *buf; { if (buf->shutdown) - return (*buf->shutdown) (buf->closure); + return (*buf->shutdown) (buf); return 0; } @@ -1210,22 +1216,35 @@ buf_shutdown (buf) static int stdio_buffer_input PROTO((void *, char *, int, int, int *)); static int stdio_buffer_output PROTO((void *, const char *, int, int *)); static int stdio_buffer_flush PROTO((void *)); +static int stdio_buffer_shutdown PROTO((struct buffer *buf)); /* Initialize a buffer built on a stdio FILE. */ +struct stdio_buffer_closure +{ + FILE *fp; + int child_pid; +}; + struct buffer * -stdio_buffer_initialize (fp, input, memory) +stdio_buffer_initialize (fp, child_pid, input, memory) FILE *fp; + int child_pid; int input; void (*memory) PROTO((struct buffer *)); { + struct stdio_buffer_closure *bc = malloc (sizeof (*bc)); + + bc->fp = fp; + bc->child_pid = child_pid; + return buf_initialize (input ? stdio_buffer_input : NULL, input ? NULL : stdio_buffer_output, input ? NULL : stdio_buffer_flush, (int (*) PROTO((void *, int))) NULL, - (int (*) PROTO((void *))) NULL, + stdio_buffer_shutdown, memory, - (void *) fp); + (void *) bc); } /* The buffer input function for a buffer built on a stdio FILE. */ @@ -1238,7 +1257,7 @@ stdio_buffer_input (closure, data, need, size, got) int size; int *got; { - FILE *fp = (FILE *) closure; + struct stdio_buffer_closure *bc = (struct stdio_buffer_closure *) closure; int nbytes; /* Since stdio does its own buffering, we don't worry about @@ -1248,11 +1267,11 @@ stdio_buffer_input (closure, data, need, size, got) { int ch; - ch = getc (fp); + ch = getc (bc->fp); if (ch == EOF) { - if (feof (fp)) + if (feof (bc->fp)) return -1; else if (errno == 0) return EIO; @@ -1265,12 +1284,12 @@ stdio_buffer_input (closure, data, need, size, got) return 0; } - nbytes = fread (data, 1, need, fp); + nbytes = fread (data, 1, need, bc->fp); if (nbytes == 0) { *got = 0; - if (feof (fp)) + if (feof (bc->fp)) return -1; else if (errno == 0) return EIO; @@ -1292,7 +1311,7 @@ stdio_buffer_output (closure, data, have, wrote) int have; int *wrote; { - FILE *fp = (FILE *) closure; + struct stdio_buffer_closure *bc = (struct stdio_buffer_closure *) closure; *wrote = 0; @@ -1300,7 +1319,7 @@ stdio_buffer_output (closure, data, have, wrote) { int nbytes; - nbytes = fwrite (data, 1, have, fp); + nbytes = fwrite (data, 1, have, bc->fp); if (nbytes != have) { @@ -1324,9 +1343,9 @@ static int stdio_buffer_flush (closure) void *closure; { - FILE *fp = (FILE *) closure; + struct stdio_buffer_closure *bc = (struct stdio_buffer_closure *) closure; - if (fflush (fp) != 0) + if (fflush (bc->fp) != 0) { if (errno == 0) return EIO; @@ -1337,6 +1356,116 @@ stdio_buffer_flush (closure) return 0; } + + +static int +stdio_buffer_shutdown (buf) + struct buffer *buf; +{ + struct stdio_buffer_closure *bc = (struct stdio_buffer_closure *) buf->closure; + struct stat s; + int closefp = 1; + + /* Must be a pipe or a socket. What could go wrong? */ + assert (fstat ( fileno (bc->fp), &s ) != -1); + + /* Flush the buffer if we can */ + if (buf->flush) + { + buf_flush (buf, 1); + buf->flush = NULL; + } + + if (buf->input) + { + if (! buf_empty_p (buf) + || getc (bc->fp) != EOF) + { +# ifdef SERVER_SUPPORT + if (server_active) + /* FIXME: This should probably be sysloged since it doesn't + * have anywhere else to go at this point. + */ + error (0, 0, "dying gasps from client unexpected"); + else +#endif + error (0, 0, "dying gasps from %s unexpected", current_parsed_root->hostname); + } + else if (ferror (bc->fp)) + { +# ifdef SERVER_SUPPORT + if (server_active) + /* FIXME: This should probably be sysloged since it doesn't + * have anywhere else to go at this point. + */ + error (0, errno, "reading from client"); + else +#endif + error (0, errno, "reading from %s", current_parsed_root->hostname); + } + +# ifdef SHUTDOWN_SERVER + if (current_parsed_root->method != server_method) +# endif +# ifndef NO_SOCKET_TO_FD + { + /* shutdown() sockets */ + if (S_ISSOCK(s.st_mode)) + shutdown ( fileno (bc->fp), 0); + } +# endif /* NO_SOCKET_TO_FD */ +# ifdef START_RSH_WITH_POPEN_RW + /* Can't be set with SHUTDOWN_SERVER defined */ + else if (pclose (bc->fp) == EOF) + { + error (1, errno, "closing connection to %s", + current_parsed_root->hostname); + closefp = 0; + } +# endif /* START_RSH_WITH_POPEN_RW */ + + buf->input = NULL; + } + else if (buf->output) + { +# ifdef SHUTDOWN_SERVER + /* FIXME: Should have a SHUTDOWN_SERVER_INPUT & + * SHUTDOWN_SERVER_OUTPUT + */ + if (current_parsed_root->method == server_method) + SHUTDOWN_SERVER ( fileno (bc->fp) ); + else +# endif +# ifndef NO_SOCKET_TO_FD + /* shutdown() sockets */ + if (S_ISSOCK(s.st_mode)) + shutdown ( fileno (bc->fp), 1); +# else + { + /* I'm not sure I like this empty block, but the alternative + * is a another nested NO_SOCKET_TO_FD switch above. + */ + } +# endif /* NO_SOCKET_TO_FD */ + + buf->output = NULL; + } + + if (closefp && fclose (bc->fp) == EOF) + error (1, errno, + "closing down connection to %s", + current_parsed_root->hostname); + + /* If we were talking to a process, make sure it exited */ + if (bc->child_pid + && waitpid (bc->child_pid, (int *) 0, 0) == -1) + error (1, errno, "waiting for process %d", bc->child_pid); + + return 0; +} + + + /* Certain types of communication input and output data in packets, where each packet is translated in some fashion. The packetizing buffer type supports that, given a buffer which handles lower level @@ -1398,7 +1527,7 @@ static int packetizing_buffer_input PROTO((void *, char *, int, int, int *)); static int packetizing_buffer_output PROTO((void *, const char *, int, int *)); static int packetizing_buffer_flush PROTO((void *)); static int packetizing_buffer_block PROTO((void *, int)); -static int packetizing_buffer_shutdown PROTO((void *)); +static int packetizing_buffer_shutdown PROTO((struct buffer *)); /* Create a packetizing buffer. */ @@ -1763,10 +1892,10 @@ packetizing_buffer_block (closure, block) /* Shut down a packetizing buffer. */ static int -packetizing_buffer_shutdown (closure) - void *closure; +packetizing_buffer_shutdown (buf) + struct buffer *buf; { - struct packetizing_buffer *pb = (struct packetizing_buffer *) closure; + struct packetizing_buffer *pb = (struct packetizing_buffer *) buf->closure; return buf_shutdown (pb->buf); } diff --git a/contrib/cvs/src/buffer.h b/contrib/cvs/src/buffer.h index 0556781..ebf1b7a 100644 --- a/contrib/cvs/src/buffer.h +++ b/contrib/cvs/src/buffer.h @@ -61,7 +61,7 @@ struct buffer appropriate should be done at this point. This may be NULL. It should return 0 on success, or an errno code. This entry point exists for the compression code. */ - int (*shutdown) PROTO((void *closure)); + int (*shutdown) PROTO((struct buffer *)); /* This field is passed to the INPUT, OUTPUT, and BLOCK functions. */ void *closure; @@ -105,13 +105,13 @@ extern struct buffer *buf_initialize PROTO((int (*) (void *, char *, int, int, int *), int (*) (void *), int (*) (void *, int), - int (*) (void *), + int (*) (struct buffer *), void (*) (struct buffer *), void *)); extern void buf_free PROTO((struct buffer *)); extern struct buffer *buf_nonio_initialize PROTO((void (*) (struct buffer *))); extern struct buffer *stdio_buffer_initialize - PROTO((FILE *, int, void (*) (struct buffer *))); + PROTO((FILE *, int, int, void (*) (struct buffer *))); extern struct buffer *compress_buffer_initialize PROTO((struct buffer *, int, int, void (*) (struct buffer *))); extern struct buffer *packetizing_buffer_initialize diff --git a/contrib/cvs/src/client.h b/contrib/cvs/src/client.h index b4d404a..d7f3392 100644 --- a/contrib/cvs/src/client.h +++ b/contrib/cvs/src/client.h @@ -15,32 +15,36 @@ extern int cvsencrypt; /* Whether the connection should use per-packet authentication. */ extern int cvsauthenticate; -#ifdef ENCRYPTION +#ifdef __STDC__ +struct buffer; +#endif + +# ifdef ENCRYPTION -#ifdef HAVE_KERBEROS +# ifdef HAVE_KERBEROS /* We can't declare the arguments without including krb.h, and I don't want to do that in every file. */ extern struct buffer *krb_encrypt_buffer_initialize (); -#endif /* HAVE_KERBEROS */ +# endif /* HAVE_KERBEROS */ -#ifdef HAVE_GSSAPI +# ifdef HAVE_GSSAPI /* Set this to turn on GSSAPI encryption. */ extern int cvs_gssapi_encrypt; -#endif /* HAVE_GSSAPI */ +# endif /* HAVE_GSSAPI */ -#endif /* ENCRYPTION */ +# endif /* ENCRYPTION */ -#ifdef HAVE_GSSAPI +# ifdef HAVE_GSSAPI /* We can't declare the arguments without including gssapi.h, and I don't want to do that in every file. */ extern struct buffer *cvs_gssapi_wrap_buffer_initialize (); -#endif /* HAVE_GSSAPI */ +# endif /* HAVE_GSSAPI */ #endif /* defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT) */ @@ -54,22 +58,30 @@ extern int server_started; /* Is the -P option to checkout or update specified? */ extern int client_prune_dirs; -#ifdef AUTH_CLIENT_SUPPORT +# ifdef AUTH_CLIENT_SUPPORT extern int use_authenticating_server; -void connect_to_pserver PROTO ((int *tofdp, int* fromfdp, int verify_only, - int do_gssapi)); -# ifndef CVS_AUTH_PORT -# define CVS_AUTH_PORT 2401 -# endif /* CVS_AUTH_PORT */ -#endif /* AUTH_CLIENT_SUPPORT */ - -#if defined (AUTH_SERVER_SUPPORT) || (defined (SERVER_SUPPORT) && defined (HAVE_GSSAPI)) +void connect_to_pserver PROTO ((cvsroot_t *, + struct buffer **, + struct buffer **, + int, int )); +# ifndef CVS_AUTH_PORT +# define CVS_AUTH_PORT 2401 +# endif /* CVS_AUTH_PORT */ +# endif /* AUTH_CLIENT_SUPPORT */ + +# if HAVE_KERBEROS +# ifndef CVS_PORT +# define CVS_PORT 1999 +# endif +# endif /* HAVE_KERBEROS */ + +# if defined (AUTH_SERVER_SUPPORT) || (defined (SERVER_SUPPORT) && defined (HAVE_GSSAPI)) extern void pserver_authenticate_connection PROTO ((void)); -#endif +# endif -#if defined (SERVER_SUPPORT) && defined (HAVE_KERBEROS) +# if defined (SERVER_SUPPORT) && defined (HAVE_KERBEROS) extern void kserver_authenticate_connection PROTO ((void)); -#endif +# endif /* Talking to the server. */ void send_to_server PROTO((char *str, size_t len)); @@ -94,7 +106,7 @@ send_file_names PROTO((int argc, char **argv, unsigned int flags)); /* Flags for send_file_names. */ /* Expand wild cards? */ -#define SEND_EXPAND_WILD 1 +# define SEND_EXPAND_WILD 1 /* * Send Repository, Modified and Entry. argc and argv contain only @@ -106,10 +118,10 @@ send_files PROTO((int argc, char **argv, int local, int aflag, unsigned int flags)); /* Flags for send_files. */ -#define SEND_BUILD_DIRS 1 -#define SEND_FORCE 2 -#define SEND_NO_CONTENTS 4 -#define BACKUP_MODIFIED_FILES 8 +# define SEND_BUILD_DIRS 1 +# define SEND_FORCE 2 +# define SEND_NO_CONTENTS 4 +# define BACKUP_MODIFIED_FILES 8 /* Send an argument to the remote server. */ void diff --git a/contrib/cvs/src/error.h b/contrib/cvs/src/error.h index c7268ce..1c8471d 100644 --- a/contrib/cvs/src/error.h +++ b/contrib/cvs/src/error.h @@ -32,8 +32,9 @@ /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __format__ format -# define __printf__ printf +# define __format__ format +# define __printf__ printf +# define __noreturn__ noreturn # endif #endif @@ -46,7 +47,11 @@ void error (); /* Exit due to an error. Similar to error (1, 0, "message"), but call it in the case where the message has already been printed. */ -extern void error_exit PROTO ((void)); +#ifdef __STDC__ +void error_exit (void) __attribute__ ((__noreturn__)); +#else +void error_exit (); +#endif /* If non-zero, error will use the CVS protocol to report error messages. This will only be set in the CVS server parent process; diff --git a/contrib/cvs/src/find_names.c b/contrib/cvs/src/find_names.c index e34232e..751ac67 100644 --- a/contrib/cvs/src/find_names.c +++ b/contrib/cvs/src/find_names.c @@ -24,8 +24,6 @@ static int find_rcs PROTO((char *dir, List * list)); static int add_subdir_proc PROTO((Node *, void *)); static int register_subdir_proc PROTO((Node *, void *)); -static List *filelist; - /* * add the key from entry on entries list to the files list */ @@ -37,6 +35,7 @@ add_entries_proc (node, closure) { Entnode *entnode; Node *fnode; + List *filelist = (List *) closure; entnode = (Entnode *) node->data; if (entnode->type != ENT_FILE) @@ -66,7 +65,7 @@ Find_Names (repository, which, aflag, optentries) List *files; /* make a list for the files */ - files = filelist = getlist (); + files = getlist (); /* look at entries (if necessary) */ if (which & W_LOCAL) @@ -76,7 +75,7 @@ Find_Names (repository, which, aflag, optentries) if (entries != NULL) { /* walk the entries file adding elements to the files list */ - (void) walklist (entries, add_entries_proc, NULL); + (void) walklist (entries, add_entries_proc, files); /* if our caller wanted the entries list, return it; else free it */ if (optentries != NULL) diff --git a/contrib/cvs/src/history.c b/contrib/cvs/src/history.c index 4979398..40b5e14 100644 --- a/contrib/cvs/src/history.c +++ b/contrib/cvs/src/history.c @@ -770,11 +770,8 @@ history_write (type, update_dir, revs, name, repository) if (save_cwd (&cwd)) error_exit (); - if ( CVS_CHDIR (pwdir) < 0) - error (1, errno, "can't chdir(%s)", pwdir); - homedir = xgetwd (); - if (homedir == NULL) - error (1, errno, "can't getwd in %s", pwdir); + if ( CVS_CHDIR (pwdir) < 0 || (homedir = xgetwd ()) == NULL) + homedir = pwdir; if (restore_cwd (&cwd, NULL)) error_exit (); @@ -786,7 +783,9 @@ history_write (type, update_dir, revs, name, repository) PrCurDir += i; /* Point to '/' separator */ tilde = "~"; } - free (homedir); + + if (homedir != pwdir) + free (homedir); } } } diff --git a/contrib/cvs/src/log.c b/contrib/cvs/src/log.c index 1930ae5..ad780bb 100644 --- a/contrib/cvs/src/log.c +++ b/contrib/cvs/src/log.c @@ -84,6 +84,9 @@ struct log_data /* Nonzero if the -b option was seen, meaning that only revisions on the default branch should be printed. */ int default_branch; + /* Nonzero if the -S option was seen, meaning that the header/name + should be suppressed if no revisions are selected. */ + int sup_header; /* If not NULL, the value given for the -r option, which lists sets of revisions to be printed. */ struct option_revlist *revlist; @@ -150,18 +153,20 @@ static const char *const log_usage[] = "\t-h\tOnly print header.\n", "\t-t\tOnly print header and descriptive text.\n", "\t-N\tDo not list tags.\n", + "\t-S\tDo not print name/header if no revisions selected.\n", "\t-b\tOnly list revisions on the default branch.\n", - "\t-r[revisions]\tSpecify revision(s)s to list.\n", + "\t-r[revisions]\tA comma-separated list of revisions to print:\n", "\t rev1:rev2 Between rev1 and rev2, including rev1 and rev2.\n", - "\t rev1::rev2 Between rev1 and rev2, excluding rev1 and rev2.\n", + "\t rev1::rev2 Between rev1 and rev2, excluding rev1.\n", "\t rev: rev and following revisions on the same branch.\n", "\t rev:: After rev on the same branch.\n", "\t :rev rev and previous revisions on the same branch.\n", - "\t ::rev Before rev on the same branch.\n", + "\t ::rev rev and previous revisions on the same branch.\n", "\t rev Just rev.\n", "\t branch All revisions on the branch.\n", "\t branch. The last revision on the branch.\n", - "\t-d dates\tSpecify dates (D1<D2 for range, D for latest before).\n", + "\t-d dates\tA semicolon-separated list of dates\n", + "\t \t(D1<D2 for range, D for latest before).\n", "\t-s states\tOnly list revisions with specified states.\n", "\t-w[logins]\tOnly list revisions checked in by specified logins.\n", "(Specify the --help global option for a list of other help options)\n", @@ -228,7 +233,7 @@ cvslog (argc, argv) prl = &log_data.revlist; optind = 0; - while ((c = getopt (argc, argv, "+bd:hlNRr::s:tw::")) != -1) + while ((c = getopt (argc, argv, "+bd:hlNSRr::s:tw::")) != -1) { switch (c) { @@ -247,6 +252,9 @@ cvslog (argc, argv) case 'N': log_data.notags = 1; break; + case 'S': + log_data.sup_header = 1; + break; case 'R': log_data.nameonly = 1; break; @@ -336,6 +344,8 @@ cvslog (argc, argv) send_arg("-l"); if (log_data.notags) send_arg("-N"); + if (log_data.sup_header) + send_arg("-S"); if (log_data.nameonly) send_arg("-R"); if (log_data.long_header) @@ -405,14 +415,14 @@ cvslog (argc, argv) for (i = 0; i < argc; i++) { err += do_module (db, argv[i], MISC, "Logging", rlog_proc, - (char *) NULL, 0, 0, 0, 0, (char *) NULL); + (char *) NULL, 0, local, 0, 0, (char *) NULL); } close_module (db); } else { err = rlog_proc (argc + 1, argv - 1, (char *) NULL, - (char *) NULL, (char *) NULL, 0, 0, (char *) NULL, + (char *) NULL, (char *) NULL, 0, local, (char *) NULL, (char *) NULL); } @@ -782,6 +792,7 @@ log_fileproc (callerdat, finfo) { struct log_data *log_data = (struct log_data *) callerdat; Node *p; + int selrev = -1; RCSNode *rcsfile; char buf[50]; struct revlist *revlist; @@ -811,6 +822,38 @@ log_fileproc (callerdat, finfo) return (1); } + if (log_data->sup_header || !log_data->nameonly) + { + + /* We will need all the information in the RCS file. */ + RCS_fully_parse (rcsfile); + + /* Turn any symbolic revisions in the revision list into numeric + revisions. */ + revlist = log_expand_revlist (rcsfile, log_data->revlist, + log_data->default_branch); + if (log_data->sup_header || (!log_data->header && !log_data->long_header)) + { + log_data_and_rcs.log_data = log_data; + log_data_and_rcs.revlist = revlist; + log_data_and_rcs.rcs = rcsfile; + + /* If any single dates were specified, we need to identify the + revisions they select. Each one selects the single + revision, which is otherwise selected, of that date or + earlier. The log_fix_singledate routine will fill in the + start date for each specific revision. */ + if (log_data->singledatelist != NULL) + walklist (rcsfile->versions, log_fix_singledate, + (void *) &log_data_and_rcs); + + selrev = walklist (rcsfile->versions, log_count_print, + (void *) &log_data_and_rcs); + if (log_data->sup_header && selrev == 0) return 0; + } + + } + if (log_data->nameonly) { cvs_output (rcsfile->path, 0); @@ -818,14 +861,6 @@ log_fileproc (callerdat, finfo) return 0; } - /* We will need all the information in the RCS file. */ - RCS_fully_parse (rcsfile); - - /* Turn any symbolic revisions in the revision list into numeric - revisions. */ - revlist = log_expand_revlist (rcsfile, log_data->revlist, - log_data->default_branch); - /* The output here is intended to be exactly compatible with the output of rlog. I'm not sure whether this code should be here or in rcs.c; I put it here because it is specific to the log @@ -907,25 +942,10 @@ log_fileproc (callerdat, finfo) sprintf (buf, "%d", walklist (rcsfile->versions, log_count, NULL)); cvs_output (buf, 0); - if (! log_data->header && ! log_data->long_header) + if (selrev >= 0) { cvs_output (";\tselected revisions: ", 0); - - log_data_and_rcs.log_data = log_data; - log_data_and_rcs.revlist = revlist; - log_data_and_rcs.rcs = rcsfile; - - /* If any single dates were specified, we need to identify the - revisions they select. Each one selects the single - revision, which is otherwise selected, of that date or - earlier. The log_fix_singledate routine will fill in the - start date for each specific revision. */ - if (log_data->singledatelist != NULL) - walklist (rcsfile->versions, log_fix_singledate, - (void *) &log_data_and_rcs); - - sprintf (buf, "%d", walklist (rcsfile->versions, log_count_print, - (void *) &log_data_and_rcs)); + sprintf (buf, "%d", selrev); cvs_output (buf, 0); } @@ -1029,24 +1049,25 @@ log_expand_revlist (rcs, revlist, default_branch) { branch = RCS_whatbranch (rcs, r->first); if (branch == NULL) + nr->first = NULL; + else { - error (0, 0, "warning: `%s' is not a branch in `%s'", - r->first, rcs->path); - free (nr); - continue; + nr->first = RCS_getbranch (rcs, branch, 1); + free (branch); } - nr->first = RCS_getbranch (rcs, branch, 1); - free (branch); } if (nr->first == NULL) { - error (0, 0, "warning: no revision `%s' in `%s'", + error (0, 0, "warning: no branch `%s' in `%s'", r->first, rcs->path); - free (nr); - continue; + nr->last = NULL; + nr->fields = 0; + } + else + { + nr->last = xstrdup (nr->first); + nr->fields = numdots (nr->first) + 1; } - nr->last = xstrdup (nr->first); - nr->fields = numdots (nr->first) + 1; } else { @@ -1062,12 +1083,11 @@ log_expand_revlist (rcs, revlist, default_branch) { error (0, 0, "warning: no revision `%s' in `%s'", r->first, rcs->path); - free (nr); - continue; } } - if (r->last == r->first) + if (r->last == r->first || (r->last != NULL && r->first != NULL && + strcmp (r->last, r->first) == 0)) nr->last = xstrdup (nr->first); else if (r->last == NULL || isdigit ((unsigned char) r->last[0])) nr->last = xstrdup (r->last); @@ -1081,10 +1101,6 @@ log_expand_revlist (rcs, revlist, default_branch) { error (0, 0, "warning: no revision `%s' in `%s'", r->last, rcs->path); - if (nr->first != NULL) - free (nr->first); - free (nr); - continue; } } @@ -1092,7 +1108,7 @@ log_expand_revlist (rcs, revlist, default_branch) does. This code is a bit cryptic for my tastes, but keeping the same implementation as rlog ensures a certain degree of compatibility. */ - if (r->first == NULL) + if (r->first == NULL && nr->last != NULL) { nr->fields = numdots (nr->last) + 1; if (nr->fields < 2) @@ -1106,7 +1122,7 @@ log_expand_revlist (rcs, revlist, default_branch) strcpy (cp, ".0"); } } - else if (r->last == NULL) + else if (r->last == NULL && nr->first != NULL) { nr->fields = numdots (nr->first) + 1; nr->last = xstrdup (nr->first); @@ -1120,7 +1136,7 @@ log_expand_revlist (rcs, revlist, default_branch) *cp = '\0'; } } - else + else if (nr->first != NULL && nr->last != NULL) { nr->fields = numdots (nr->first) + 1; if (nr->fields != numdots (nr->last) + 1 @@ -1132,11 +1148,12 @@ log_expand_revlist (rcs, revlist, default_branch) "invalid branch or revision pair %s:%s in `%s'", r->first, r->last, rcs->path); free (nr->first); + nr->first = NULL; free (nr->last); - free (nr); - continue; + nr->last = NULL; + nr->fields = 0; } - if (version_compare (nr->first, nr->last, nr->fields) > 0) + else if (version_compare (nr->first, nr->last, nr->fields) > 0) { char *tmp; @@ -1145,6 +1162,8 @@ log_expand_revlist (rcs, revlist, default_branch) nr->last = tmp; } } + else + nr->fields = 0; } nr->next = NULL; @@ -1288,11 +1307,9 @@ log_version_requested (log_data, revlist, rcs, vnode) for (r = revlist; r != NULL; r = r->next) { if (vfields == r->fields + (r->fields & 1) && - (r->inclusive ? - version_compare (v, r->first, r->fields) >= 0 - && version_compare (v, r->last, r->fields) <= 0 : - version_compare (v, r->first, r->fields) > 0 - && version_compare (v, r->last, r->fields) < 0)) + (r->inclusive ? version_compare (v, r->first, r->fields) >= 0 : + version_compare (v, r->first, r->fields) > 0) + && version_compare (v, r->last, r->fields) <= 0) { return 1; } diff --git a/contrib/cvs/src/modules.c b/contrib/cvs/src/modules.c index d349530..b161e94 100644 --- a/contrib/cvs/src/modules.c +++ b/contrib/cvs/src/modules.c @@ -657,19 +657,19 @@ module `%s' is a request for a file in a module which is not a directory", } #endif - /* write out the checkin/update prog files if necessary */ -#ifdef SERVER_SUPPORT - if (err == 0 && !noexec && m_type == CHECKOUT && server_expanding) - { - if (checkin_prog != NULL) - server_prog (where ? where : mname, checkin_prog, PROG_CHECKIN); - if (update_prog != NULL) - server_prog (where ? where : mname, update_prog, PROG_UPDATE); - } - else -#endif + /* run/write out the checkin/update prog files if necessary */ if (err == 0 && !noexec && m_type == CHECKOUT && run_module_prog) { +#ifdef SERVER_SUPPORT + if (server_active) { + if (checkin_prog != NULL) + server_prog (where ? where : mwhere ? mwhere : mname, checkin_prog, PROG_CHECKIN); + if (update_prog != NULL) + server_prog (where ? where : mwhere ? mwhere : mname, update_prog, PROG_UPDATE); + } + else + { +#endif FILE *fp; if (checkin_prog != NULL) @@ -686,6 +686,9 @@ module `%s' is a request for a file in a module which is not a directory", if (fclose (fp) == EOF) error (1, errno, "cannot close %s", CVSADM_UPROG); } +#ifdef SERVER_SUPPORT + } +#endif } /* cd back to where we started */ diff --git a/contrib/cvs/src/myndbm.c b/contrib/cvs/src/myndbm.c index 7795f66..600b3aa 100644 --- a/contrib/cvs/src/myndbm.c +++ b/contrib/cvs/src/myndbm.c @@ -19,7 +19,7 @@ #ifdef MY_NDBM -static void mydbm_load_file PROTO ((FILE *, List *)); +static void mydbm_load_file PROTO ((FILE *, List *, char *)); /* Returns NULL on error in which case errno has been set to indicate the error. Can also call error() itself. */ @@ -44,7 +44,7 @@ mydbm_open (file, flags, mode) if (fp != NULL) { - mydbm_load_file (fp, db->dbm_list); + mydbm_load_file (fp, db->dbm_list, file); if (fclose (fp) < 0) error (0, errno, "cannot close %s", file); } @@ -195,9 +195,10 @@ mydbm_store (db, key, value, flags) } static void -mydbm_load_file (fp, list) +mydbm_load_file (fp, list, filename) FILE *fp; List *list; + char *filename; /* Used in error messages. */ { char *line = NULL; size_t line_size; @@ -206,14 +207,17 @@ mydbm_load_file (fp, list) char *cp, *vp; int cont; int line_length; + int line_num; value_allocated = 1; value = xmalloc (value_allocated); cont = 0; + line_num=0; while ((line_length = getstr (&line, &line_size, fp, '\012', 0, GETLINE_NO_LIMIT)) >= 0) { + line_num++; if (line_length > 0 && line[line_length - 1] == '\012') { /* Strip the newline. */ @@ -280,21 +284,28 @@ mydbm_load_file (fp, list) kp = vp; while (*vp && !isspace ((unsigned char) *vp)) vp++; - *vp++ = '\0'; /* NULL terminate the key */ + if (*vp) + *vp++ = '\0'; /* NULL terminate the key */ p->type = NDBMNODE; p->key = xstrdup (kp); while (*vp && isspace ((unsigned char) *vp)) vp++; /* skip whitespace to value */ if (*vp == '\0') { - error (0, 0, "warning: NULL value for key `%s'", p->key); + if (!really_quiet) + error (0, 0, + "warning: NULL value for key `%s' at line %d of `%s'", + p->key, line_num, filename); freenode (p); continue; } p->data = xstrdup (vp); if (addnode (list, p) == -1) { - error (0, 0, "duplicate key found for `%s'", p->key); + if (!really_quiet) + error (0, 0, + "duplicate key found for `%s' at line %d of `%s'", + p->key, line_num, filename); freenode (p); } } diff --git a/contrib/cvs/src/parseinfo.c b/contrib/cvs/src/parseinfo.c index 7efd638..e0eb3a5 100644 --- a/contrib/cvs/src/parseinfo.c +++ b/contrib/cvs/src/parseinfo.c @@ -65,7 +65,12 @@ Parse_Info (infofile, repository, callproc, all) srepos = Short_Repository (repository); if (trace) - (void) fprintf (stderr, " -> ParseInfo(%s, %s, %s)\n", + (void) fprintf (stderr, "%s-> Parse_Info (%s, %s, %s)\n", +#ifdef SERVER_SUPPORT + server_active ? "S" : " ", +#else + "", +#endif infopath, srepos, all ? "ALL" : "not ALL"); /* search the info file for lines that match */ @@ -384,6 +389,15 @@ warning: this CVS does not support PreservePermissions"); strcpy (logHistory, p); } } + else if (strcmp (line, "RereadLogAfterVerify") == 0) + { + if (strcmp (p, "no") == 0 || strcmp (p, "never") == 0) + RereadLogAfterVerify = LOGMSG_REREAD_NEVER; + else if (strcmp (p, "yes") == 0 || strcmp (p, "always") == 0) + RereadLogAfterVerify = LOGMSG_REREAD_ALWAYS; + else if (strcmp (p, "stat") == 0) + RereadLogAfterVerify = LOGMSG_REREAD_STAT; + } else { /* We may be dealing with a keyword which was added in a diff --git a/contrib/cvs/src/patch.c b/contrib/cvs/src/patch.c index 5a20877..8852f3d 100644 --- a/contrib/cvs/src/patch.c +++ b/contrib/cvs/src/patch.c @@ -28,7 +28,6 @@ static int patch_proc PROTO((int argc, char **argv, char *xwhere, static int force_tag_match = 1; static int patch_short = 0; static int toptwo_diffs = 0; -static int local = 0; static char *options = NULL; static char *rev1 = NULL; static int rev1_validated = 0; @@ -65,6 +64,7 @@ patch (argc, argv) char **argv; { register int i; + int local = 0; int c; int err = 0; DBM *db; @@ -343,19 +343,19 @@ patch_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified, if (rev1 != NULL && !rev1_validated) { - tag_check_valid (rev1, argc - 1, argv + 1, local, 0, NULL); + tag_check_valid (rev1, argc - 1, argv + 1, local_specified, 0, NULL); rev1_validated = 1; } if (rev2 != NULL && !rev2_validated) { - tag_check_valid (rev2, argc - 1, argv + 1, local, 0, NULL); + tag_check_valid (rev2, argc - 1, argv + 1, local_specified, 0, NULL); rev2_validated = 1; } /* start the recursion processor */ err = start_recursion (patch_fileproc, (FILESDONEPROC) NULL, patch_dirproc, (DIRLEAVEPROC) NULL, NULL, - argc - 1, argv + 1, local, + argc - 1, argv + 1, local_specified, which, 0, 1, where, 1); free (where); @@ -432,7 +432,7 @@ patch_fileproc (callerdat, finfo) if (!date1) date1 = xmalloc (MAXDATELEN); *date1 = '\0'; - if (RCS_getrevtime (rcsfile, vers_head, date1, 1) == -1) + if (RCS_getrevtime (rcsfile, vers_head, date1, 1) == (time_t)-1) { if (!really_quiet) error (0, 0, "cannot find date in rcs file %s revision %s", diff --git a/contrib/cvs/src/remove.c b/contrib/cvs/src/remove.c index 63b61d3..691d141 100644 --- a/contrib/cvs/src/remove.c +++ b/contrib/cvs/src/remove.c @@ -235,6 +235,14 @@ remove_fileproc (callerdat, finfo) cannot remove file `%s' which has a numeric sticky tag of `%s'", finfo->fullname, vers->tag); } + else if (vers->date != NULL) + { + /* Commit will just give an error, and so there seems to be + little reason to allow the remove. */ + error (0, 0, "\ +cannot remove file `%s' which has a sticky date of `%s'", + finfo->fullname, vers->date); + } else { char *fname; diff --git a/contrib/cvs/src/root.c b/contrib/cvs/src/root.c index 2d1261d..1a6d648 100644 --- a/contrib/cvs/src/root.c +++ b/contrib/cvs/src/root.c @@ -387,7 +387,7 @@ parse_cvsroot (root_in) if (! (p = strchr (method, ':'))) { - error (0, 0, "bad CVSroot: %s", root_in); + error (0, 0, "No closing `:' on method in CVSROOT."); free (cvsroot_save); goto error_exit; } @@ -412,7 +412,7 @@ parse_cvsroot (root_in) newroot->method = fork_method; else { - error (0, 0, "unknown method in CVSroot: %s", root_in); + error (0, 0, "Unknown method (`%s') in CVSROOT.", method); free (cvsroot_save); goto error_exit; } @@ -420,7 +420,7 @@ parse_cvsroot (root_in) else { /* If the method isn't specified, assume - SERVER_METHOD/EXT_METHOD if the string contains a colon or + SERVER_METHOD/EXT_METHOD if the string looks like a relative path or LOCAL_METHOD otherwise. */ newroot->method = ((*cvsroot_copy != '/' && strchr (cvsroot_copy, '/')) @@ -447,8 +447,7 @@ parse_cvsroot (root_in) */ if ((p = strchr (cvsroot_copy, '/')) == NULL) { - error (0, 0, "CVSROOT (\"%s\")", root_in); - error (0, 0, "requires a path spec"); + error (0, 0, "CVSROOT requires a path spec:"); error (0, 0, ":(gserver|kserver|pserver):[[user][:password]@]host[:[port]]/path"); error (0, 0, "[:(ext|server):][[user]@]host[:]/path"); free (cvsroot_save); @@ -497,20 +496,18 @@ parse_cvsroot (root_in) { if (!isdigit(*q++)) { - error(0, 0, "CVSROOT (\"%s\")", root_in); - error(0, 0, "may only specify a positive, non-zero, integer port (not \"%s\").", + error (0, 0, "CVSROOT may only specify a positive, non-zero, integer port (not `%s').", p); - error(0, 0, "perhaps you entered a relative pathname?"); + error (0, 0, "Perhaps you entered a relative pathname?"); free (cvsroot_save); goto error_exit; } } if ((newroot->port = atoi (p)) <= 0) { - error (0, 0, "CVSROOT (\"%s\")", root_in); - error(0, 0, "may only specify a positive, non-zero, integer port (not \"%s\").", + error (0, 0, "CVSROOT may only specify a positive, non-zero, integer port (not `%s').", p); - error(0, 0, "perhaps you entered a relative pathname?"); + error (0, 0, "Perhaps you entered a relative pathname?"); free (cvsroot_save); goto error_exit; } @@ -540,9 +537,8 @@ parse_cvsroot (root_in) #if ! defined (CLIENT_SUPPORT) && ! defined (DEBUG) if (newroot->method != local_method) { - error (0, 0, "CVSROOT \"%s\"", root_in); - error (0, 0, "is set for a remote access method but your"); - error (0, 0, "CVS executable doesn't support it"); + error (0, 0, "CVSROOT is set for a remote access method but your"); + error (0, 0, "CVS executable doesn't support it."); goto error_exit; } #endif @@ -550,16 +546,15 @@ parse_cvsroot (root_in) #if ! defined (SERVER_SUPPORT) && ! defined (DEBUG) if (newroot->method == fork_method) { - error (0, 0, "CVSROOT \"%s\"", root_in); - error (0, 0, "is set to use the :fork: access method but your"); - error (0, 0, "CVS executable doesn't support it"); + error (0, 0, "CVSROOT is set to use the :fork: access method but your"); + error (0, 0, "CVS executable doesn't support it."); goto error_exit; } #endif if (newroot->username && ! newroot->hostname) { - error (0, 0, "missing hostname in CVSROOT: \"%s\"", root_in); + error (0, 0, "Missing hostname in CVSROOT."); goto error_exit; } @@ -571,9 +566,8 @@ parse_cvsroot (root_in) case local_method: if (newroot->username || newroot->hostname) { - error (0, 0, "can't specify hostname and username in CVSROOT"); - error (0, 0, "(\"%s\")", root_in); - error (0, 0, "when using local access method"); + error (0, 0, "Can't specify hostname and username in CVSROOT"); + error (0, 0, "when using local access method."); goto error_exit; } /* cvs.texinfo has always told people that CVSROOT must be an @@ -583,8 +577,9 @@ parse_cvsroot (root_in) error. */ if (!isabsolute (newroot->directory)) { - error (0, 0, "CVSROOT \"%s\" must be an absolute pathname", + error (0, 0, "CVSROOT must be an absolute pathname (not `%s')", newroot->directory); + error (0, 0, "when using local access method."); goto error_exit; } no_port = 1; @@ -596,15 +591,15 @@ parse_cvsroot (root_in) name is absolute -- let the server do it. */ if (newroot->username || newroot->hostname) { - error (0, 0, "can't specify hostname and username in CVSROOT"); - error (0, 0, "(\"%s\")", root_in); - error (0, 0, "when using fork access method"); + error (0, 0, "Can't specify hostname and username in CVSROOT"); + error (0, 0, "when using fork access method."); goto error_exit; } if (!isabsolute (newroot->directory)) { - error (0, 0, "CVSROOT \"%s\" must be an absolute pathname", + error (0, 0, "CVSROOT must be an absolute pathname (not `%s')", newroot->directory); + error (0, 0, "when using fork access method."); goto error_exit; } no_port = 1; @@ -612,9 +607,8 @@ parse_cvsroot (root_in) break; case kserver_method: #ifndef HAVE_KERBEROS - error (0, 0, "CVSROOT \"%s\"", root_in); - error (0, 0, "is set for a kerberos access method but your"); - error (0, 0, "CVS executable doesn't support it"); + error (0, 0, "CVSROOT is set for a kerberos access method but your"); + error (0, 0, "CVS executable doesn't support it."); goto error_exit; #else check_hostname = 1; @@ -622,9 +616,8 @@ parse_cvsroot (root_in) #endif case gserver_method: #ifndef HAVE_GSSAPI - error (0, 0, "CVSROOT \"%s\"", root_in); - error (0, 0, "is set for a GSSAPI access method but your"); - error (0, 0, "CVS executable doesn't support it"); + error (0, 0, "CVSROOT is set for a GSSAPI access method but your"); + error (0, 0, "CVS executable doesn't support it."); goto error_exit; #else check_hostname = 1; @@ -639,6 +632,8 @@ parse_cvsroot (root_in) case pserver_method: check_hostname = 1; break; + default: + error (1, 0, "Invalid method found in parse_cvsroot"); } if (no_password && newroot->password) @@ -650,7 +645,7 @@ parse_cvsroot (root_in) if (check_hostname && !newroot->hostname) { - error (0, 0, "didn't specify hostname in CVSROOT: %s", root_in); + error (0, 0, "Didn't specify hostname in CVSROOT."); goto error_exit; } @@ -663,7 +658,7 @@ parse_cvsroot (root_in) if (*newroot->directory == '\0') { - error (0, 0, "missing directory in CVSROOT: %s", root_in); + error (0, 0, "Missing directory in CVSROOT."); goto error_exit; } diff --git a/contrib/cvs/src/root.h b/contrib/cvs/src/root.h new file mode 100644 index 0000000..afe79b6 --- /dev/null +++ b/contrib/cvs/src/root.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2001, Derek Price and others + * Copyright (c) 1992, Brian Berliner and Jeff Polk + * Copyright (c) 1989-1992, Brian Berliner + * + * You may distribute under the terms of the GNU General Public License as + * specified in the README file that comes with the CVS kit. + */ + +/* CVSroot data structures */ + +/* Access method specified in CVSroot. */ +typedef enum { + null_method, + local_method, + server_method, + pserver_method, + kserver_method, + gserver_method, + ext_method, + fork_method +} CVSmethod; +extern char *method_names[]; /* change this in root.c if you change + the enum above */ + +typedef struct cvsroot_s { + char *original; /* the complete source CVSroot string */ + CVSmethod method; /* one of the enum values above */ + char *username; /* the username or NULL if method == local */ + char *password; /* the username or NULL if method == local */ + char *hostname; /* the hostname or NULL if method == local */ + int port; /* the port or zero if method == local */ + char *directory; /* the directory name */ +#ifdef CLIENT_SUPPORT + unsigned char isremote; /* nonzero if we are doing remote access */ +#endif /* CLIENT_SUPPORT */ +} cvsroot_t; diff --git a/contrib/cvs/src/sanity.sh b/contrib/cvs/src/sanity.sh index 727e33a..22c1a98 100755 --- a/contrib/cvs/src/sanity.sh +++ b/contrib/cvs/src/sanity.sh @@ -398,7 +398,7 @@ else fi # now make sure that tr works on NULs -if $EXPR `echo "123" | ${TR} '2' '\0'` : "123" >/dev/null; then +if $EXPR `echo "123" | ${TR} '2' '\0'` : "123" >/dev/null 2>&1; then TR=`find_tool tr` if test -z "$TR" ; then echo 'Warning: you are using a version of tr which does not correctly' @@ -674,9 +674,10 @@ if test x"$*" = x; then tests="${tests} new newb conflicts conflicts2 conflicts3" tests="${tests} clean" # Checking out various places (modules, checkout -d, &c) - tests="${tests} modules modules2 modules3 modules4 modules5" + tests="${tests} modules modules2 modules3 modules4 modules5 modules6" tests="${tests} mkmodules-temp-file-removal" tests="${tests} cvsadm emptydir abspath toplevel toplevel2" + tests="${tests} checkout_repository" # Log messages, error messages. tests="${tests} mflag editor errmsg1 errmsg2 adderrmsg" # Watches, binary files, history browsing, &c. @@ -1599,8 +1600,8 @@ Specify the --help option for further information about CVS' if $remote; then dotest version-2r "${testcvs} version" \ -'Client: Concurrent Versions System (CVS) [0-9.]* (client/server) -Server: Concurrent Versions System (CVS) [0-9.]* (client/server)' +'Client: Concurrent Versions System (CVS) [0-9p.]* (client/server) +Server: Concurrent Versions System (CVS) [0-9p.]* (client/server)' else dotest version-2 "${testcvs} version" \ 'Concurrent Versions System (CVS) [0-9.]*.*' @@ -1633,6 +1634,8 @@ Server: Concurrent Versions System (CVS) [0-9.]* (client/server)' dotest basica-1a0 "${testcvs} -q update" '' dotest basica-1a1 "${testcvs} -q diff -c" '' dotest basica-1a2 "${testcvs} -q status" '' + dotest basica-1a3 "${testcvs} -q update ." '' + dotest basica-1a4 "${testcvs} -q update ./" '' mkdir sdir # Remote CVS gives the "cannot open CVS/Entries" error, which is @@ -1719,7 +1722,7 @@ done" dotest_fail basica-nonexist "${testcvs} -q ci nonexist" \ "${PROG}"' [a-z]*: nothing known about `nonexist'\'' '"${PROG}"' \[[a-z]* aborted\]: correct above errors first!' - dotest basica-8 "${testcvs} -q update" '' + dotest basica-8 "${testcvs} -q update ." '' # Test the -f option to ci cd sdir/ssdir @@ -1754,7 +1757,7 @@ ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile new revision: 3\.1\.2\.1; previous revision: 3\.1 done" # now get rid of the sticky tag and go back to the trunk - dotest basica-8a5 "${testcvs} -q up -A" "[UP] ssfile" + dotest basica-8a5 "${testcvs} -q up -A ./" "[UP] ssfile" cd ../.. dotest basica-8b "${testcvs} -q diff -r1.2 -r1.3" \ @@ -1784,7 +1787,8 @@ ${PROG} [a-z]*: invalid context length argument" "${PROG} \[[a-z]* aborted\]: ${TESTDIR}/nonexist/CVSROOT: .*" dotest basica-10 "${testcvs} annotate" \ -'Annotations for sdir/ssdir/ssfile +' +Annotations for sdir/ssdir/ssfile \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.1 .'"${username}"' *[0-9a-zA-Z-]*.: ssfile 1\.2 .'"${username}"' *[0-9a-zA-Z-]*.: ssfile line 2' @@ -1799,7 +1803,7 @@ ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently" ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v <-- ssfile new revision: delete; previous revision: 3\.1 done" - dotest basica-r3 "${testcvs} -q up -p -r 3.1 ssfile >ssfile" "" + dotest basica-r3 "${testcvs} -q up -p -r 3.1 ./ssfile >ssfile" "" dotest basica-r4 "${testcvs} add ssfile" \ "${PROG} [a-z]*: re-adding file ssfile (in place of dead revision 3\.2) ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently" @@ -1874,7 +1878,7 @@ revision 1\.1 date: [0-9/]* [0-9:]*; author: ${username}; state: Exp; add-it =============================================================================" - dotest basica-o8 "${testcvs} -q update -p -r 1.1 ssfile" "ssfile" + dotest basica-o8 "${testcvs} -q update -p -r 1.1 ./ssfile" "ssfile" cd ../.. cd .. @@ -2070,7 +2074,7 @@ sfile2 starts" "U sub1/sub2/Emptydir/sfile1 U sub1/sub2/sdir2/sfile2" cd sub1 - dotest basicb-12 "${testcvs} -q update" '' + dotest basicb-12 "${testcvs} -q update ./." '' touch xx dotest basicb-13 "${testcvs} add xx" fixme cd .. @@ -4641,7 +4645,7 @@ C file4" file=x echo >$file dotest rm-update-message-setup-2 "$testcvs -q add $file" \ -"$PROG [a-z]*: use .cvs commit. to add this file permanently" +"$PROG [a-z]*: use .$PROG commit. to add this file permanently" dotest rm-update-message-setup-3 "$testcvs -q ci -mcreate $file" \ "RCS file: $CVSROOT_DIRNAME/rm-update-message/$file,v done @@ -4823,8 +4827,7 @@ done" "Checking in file5; ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5 ${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/file5,v: revision 4\.8 too low; must be higher than 7\.1 -${PROG} [a-z]*: could not check in file5 -7\.1 unlocked" +${PROG} [a-z]*: could not check in file5" dotest rmadd-24a "${testcvs} -q ci -r 8.4 -m change file5" \ "Checking in file5; ${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5 @@ -4842,6 +4845,69 @@ File: file5 Status: Up-to-date Sticky Date: (none) Sticky Options: (none)" + # now try forced revision with recursion + mkdir sub + dotest rmadd-26 "${testcvs} -q add sub" \ +"Directory ${CVSROOT_DIRNAME}/first-dir/sub added to the repository" + echo hello >sub/subfile + dotest rmadd-27 "${testcvs} -q add sub/subfile" \ +"${PROG} [a-z]*: use .$PROG commit. to add this file permanently" + + dotest rmadd-28 "${testcvs} -q ci -m. sub" \ +"RCS file: ${CVSROOT_DIRNAME}/first-dir/sub/subfile,v +done +Checking in sub/subfile; +${CVSROOT_DIRNAME}/first-dir/sub/subfile,v <-- subfile +initial revision: 1\.1 +done" + + # lose the branch + dotest rmadd-29 "${testcvs} -q up -A" \ +"${PROG} [a-z]*: file3 is no longer in the repository +${PROG} [a-z]*: file4 is no longer in the repository" + + # -f disables recursion + dotest rmadd-30 "${testcvs} -q ci -f -r9 -m." \ +"Checking in file1; +${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 +new revision: 9\.1; previous revision: 7\.1 +done +Checking in file2; +${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2 +new revision: 9\.1; previous revision: 7\.1 +done +Checking in file5; +${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5 +new revision: 9\.1; previous revision: 8\.4 +done" + + # add -R to force recursion + dotest rmadd-31 "${testcvs} -q ci -f -r9 -R -m." \ +"Checking in file1; +${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 +new revision: 9\.2; previous revision: 9\.1 +done +Checking in file2; +${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2 +new revision: 9\.2; previous revision: 9\.1 +done +Checking in file5; +${CVSROOT_DIRNAME}/first-dir/file5,v <-- file5 +new revision: 9\.2; previous revision: 9\.1 +done +Checking in sub/subfile; +${CVSROOT_DIRNAME}/first-dir/sub/subfile,v <-- subfile +new revision: 9\.1; previous revision: 1\.1 +done" + + if $remote; then + # as noted above, remote doesn't set a sticky tag + : + else + dotest rmadd-32 "cat CVS/Tag" "T9" + dotest rmadd-33 "cat sub/CVS/Tag" "T9" + fi + cd ../.. rm -r 1 rm -rf ${CVSROOT_DIRNAME}/first-dir @@ -5685,7 +5751,7 @@ done" ;; tagf) - # More tagging tests, including using tag -F to convert a + # More tagging tests, including using tag -F -B to convert a # branch tag to a regular tag and recovering thereof. # Setup; check in first-dir/file1 @@ -5729,11 +5795,16 @@ Checking in file2; ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2 new revision: 1\.1\.2\.1; previous revision: 1\.1 done" - # Here we make it a non-branch tag. Some think this should - # be an error. But if -F means "I want to put this tag here, - # never mind whether there was a tag of that name before", then - # an error wouldn't fit. - dotest tagf-8 "${testcvs} -q tag -F br" "T file1 + # Here we try to make it a non-branch tag, but will + # succeed in getting only warnings, even with -F + # because converting a branch tag to non-branch + # is potentially catastrophic. + dotest tagf-8a "${testcvs} -q tag -F br" \ +"${PROG} [a-z]*: file1: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\\.2\.1\. +${PROG} [a-z]*: file2: Not moving branch tag .br. from 1\.1\.2\.1 to 1\.1\.2\.1\." + # however, if we *really* are sure we want to move a branch tag, + # "-F -B" will do the trick + dotest tagf-8 "${testcvs} -q tag -F -B br" "T file1 T file2" echo moremod >> file1 echo moremod >> file2 @@ -5792,6 +5863,106 @@ Checking in file2; ${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2 new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1 done" + # try accidentally deleting branch tag, "tag -d" + dotest_fail tagf-16 "${testcvs} tag -d br" \ +"${PROG} [a-z]*: Untagging \. +${PROG} [a-z]*: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\. +${PROG} [a-z]*: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\." + # try accidentally deleting branch tag, "rtag -d" + dotest_fail tagf-17 "${testcvs} rtag -d br first-dir" \ +"${PROG} [a-z]*: Untagging first-dir +${PROG} [a-z]*: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file1,v.\. +${PROG} [a-z]*: Not removing branch tag .br. from .${CVSROOT_DIRNAME}/first-dir/file2,v.\." + # try accidentally converting branch tag to non-branch tag "tag -F" + dotest tagf-18 "${testcvs} tag -r1.1 -F br file1" \ +"${PROG} [a-z]*: file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\." + # try accidentally converting branch tag to non-branch tag "rtag -F" + dotest tagf-19 "${testcvs} rtag -r1.1 -F br first-dir" \ +"${PROG} [a-z]*: Tagging first-dir +${PROG} [a-z]*: first-dir/file1: Not moving branch tag .br. from 1\.1\.4\.1 to 1\.1\. +${PROG} [a-z]*: first-dir/file2: Not moving branch tag .br. from 1\.1\.2\.2 to 1\.1\." + # create a non-branch tag + dotest tagf-20 "${testcvs} rtag regulartag first-dir" \ +"${PROG} [a-z]*: Tagging first-dir" + # try accidentally converting non-branch tag to branch tag (tag -F -B -b) + dotest tagf-21 "${testcvs} tag -F -B -b regulartag file1" \ +"${PROG} [a-z]*: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1\.0\.2 due to .-B. option\." + # try accidentally converting non-branch tag to branch rtag (rtag -F -B -b) + dotest tagf-22 "${testcvs} rtag -F -B -b regulartag first-dir" \ +"${PROG} [a-z]*: Tagging first-dir +${PROG} [a-z]*: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.6 due to .-B. option\. +${PROG} [a-z]*: first-dir/file2: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.0\.4 due to .-B. option\." + # Try accidentally deleting non-branch: (tag -d -B) + dotest_fail tagf-23 "${testcvs} tag -d -B regulartag file1" \ +"${PROG} [a-z]*: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\." + # Try accidentally deleting non-branch: (rtag -d -B) + dotest_fail tagf-24 \ + "${testcvs} rtag -d -B regulartag first-dir" \ +"${PROG} [a-z]*: Untagging first-dir +${PROG} [a-z]*: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file1,v. due to .-B. option\. +${PROG} [a-z]*: Not removing non-branch tag .regulartag. from .${CVSROOT_DIRNAME}/first-dir/file2,v. due to .-B. option\." + + # the following tests (throught the next commit) keep moving the same + # tag back and forth between 1.1.6 & 1.1.8 in file1 and between + # 1.1.4 and 1.1.6 in file2 since nothing was checked in on some of + # these branches and CVS only tracks branches via tags unless they contain data. + + # try intentionally converting non-branch tag to branch tag (tag -F -b) + dotest tagf-25a "${testcvs} tag -F -b regulartag file1" "T file1" + # try intentionally moving a branch tag to a newly created branch (tag -F -b -B) + dotest tagf-25b "${testcvs} tag -F -B -b -r1.1 regulartag file1" \ +"T file1" + # try intentionally converting mixed tags to branch tags (rtag -F -b) + dotest tagf-26a "${testcvs} rtag -F -b regulartag first-dir" \ +"${PROG} [a-z]*: Tagging first-dir +${PROG} [a-z]*: first-dir/file1: Not moving branch tag .regulartag. from 1\.1 to 1\.1\.0\.8\." + # try intentionally converting a branch to a new branch tag (rtag -F -b -B) + dotest tagf-26b "${testcvs} rtag -F -B -b -r1.1 regulartag first-dir" \ +"${PROG} [a-z]*: Tagging first-dir" + # update to our new branch + dotest tagf-27 "${testcvs} update -r regulartag" \ +"${PROG} [a-z]*: Updating \. +U file1 +U file2" + # commit some changes and see that all rev numbers look right + echo changes >> file1 + echo changes >> file2 + dotest tagf-28 "${testcvs} ci -m changes" \ +"${PROG} [a-z]*: Examining \. +Checking in file1; +${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 +new revision: 1\.1\.8\.1; previous revision: 1\.1 +done +Checking in file2; +${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2 +new revision: 1\.1\.6\.1; previous revision: 1\.1 +done" + # try intentional branch to non-branch (tag -F -B) + dotest tagf-29 "${testcvs} tag -F -B -r1.1 regulartag file1" \ +"T file1" + # try non-branch to non-branch (tag -F -B) + dotest tagf-29a "${testcvs} tag -F -B -r br regulartag file1" \ +"${PROG} [a-z]*: file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\." + # try mixed-branch to non-branch (rtag -F -B ) + dotest tagf-29b "${testcvs} rtag -F -B -r br regulartag first-dir" \ +"${PROG} [a-z]*: Tagging first-dir +${PROG} [a-z]*: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1 to 1\.1\.4\.1 due to .-B. option\." + # at this point, regulartag is a regular tag within + # file1 and file2 + + # try intentional branch to non-branch (rtag -F -B) + dotest tagf-30 "${testcvs} rtag -F -B -r1.1 br first-dir" \ +"${PROG} [a-z]*: Tagging first-dir" + # create a branch tag so we can try to delete it. + dotest tagf-31 "${testcvs} rtag -b brtag first-dir" \ +"${PROG} [a-z]*: Tagging first-dir" + + # try intentinal deletion of branch tag (tag -d -B) + dotest tagf-32 "${testcvs} tag -d -B brtag file1" "D file1" + # try intentinal deletion of branch tag (rtag -d -B) + dotest tagf-33 "${testcvs} rtag -d -B brtag first-dir" \ +"${PROG} [a-z]*: Untagging first-dir" + cd ../.. rm -r 1 @@ -6014,6 +6185,49 @@ new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1 done" dotest rcslib-symlink-4 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \ ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v" + + # CVS was failing to check both the symlink and the file + # for timestamp changes for a while. Test that. + rm file1 + if $remote; then + dotest rcslib-symlink-3ar "${testcvs} -q up file1" "U file1" + else + dotest rcslib-symlink-3a "${testcvs} -q up file1" \ +"${PROG} [a-z]*: warning: file1 was lost +U file1" + fi + echo "This is a change" >> file1 + dotest rcslib-symlink-3b "${testcvs} ci -m because file1" \ +"Checking in file1; +${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 +new revision: 1\.1\.2\.[0-9]*; previous revision: 1\.1\.2\.[0-9]* +done" + dotest rcslib-symlink-3c "${testcvs} update file2" "[UP] file2" + + echo some new text >file3 + dotest rcslib-symlink-3d "${testcvs} -Q add file3" '' + dotest rcslib-symlink-3e "${testcvs} -Q ci -mtest file3" \ +"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v +done +Checking in file3; +${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3 +new revision: 1\.1\.2\.1; previous revision: 1\.1 +done" + rm ${CVSROOT_DIRNAME}/first-dir/file2,v + dotest rcslib-symlink-3f "ln -s Attic/file3,v ${CVSROOT_DIRNAME}/first-dir/file2,v" + dotest rcslib-symlink-3g "${testcvs} update file2" "U file2" + + # restore the link to file1 for the following tests + dotest rcslib-symlink-3i "${testcvs} -Q rm -f file3" '' + dotest rcslib-symlink-3j "${testcvs} -Q ci -mwhatever file3" \ +"Removing file3; +${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3 +new revision: delete; previous revision: 1\.1\.2\.1 +done" + rm ${CVSROOT_DIRNAME}/first-dir/file2,v + rm -f ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v + dotest rcslib-symlink-3h "ln -s file1,v ${CVSROOT_DIRNAME}/first-dir/file2,v" + # Test 5 reveals a problem with having symlinks in the # repository. CVS will try to tag both of the files # separately. After processing one, it will do the same @@ -6024,7 +6238,7 @@ done" dotest rcslib-symlink-5 "${testcvs} tag the_tag" \ "${PROG} [a-z]*: Tagging . T file1 -W file2 : the_tag already exists on version 1.1.2.1 : NOT MOVING tag to version 1.1.2.2" +W file2 : the_tag already exists on version 1.1.2.3 : NOT MOVING tag to version 1.1.2.1" dotest rcslib-symlink-6 "ls -l $CVSROOT_DIRNAME/first-dir/file2,v" \ ".*$CVSROOT_DIRNAME/first-dir/file2,v -> file1,v" @@ -6294,7 +6508,7 @@ done" " - ${PROG} checkout -jvendor-branch:yesterday -jvendor-branch first-dir + ${PROG} checkout -j<prev_rel_tag> -jjunk-2_0 first-dir 2 conflicts created by this import. C first-dir/imported-f1 C first-dir/imported-f2 @@ -6404,7 +6618,7 @@ No conflicts created by this import" " - ${PROG} -d ${CVSROOT} checkout -jfreemunger:yesterday -jfreemunger first-dir + ${PROG} -d ${CVSROOT} checkout -j<prev_rel_tag> -jfreemunger-1_0 first-dir 2 conflicts created by this import. C first-dir/file1 C first-dir/file2 @@ -6529,27 +6743,12 @@ ${PROG} [a-z]*: Updating bdir/subdir" "${testcvs} -q rtag -b -r release wip_test first-dir" "" dotest importc-6 "${testcvs} -q update -r wip_test" "M cdir/cfile" - if $remote; then - # Remote doesn't have the bug in the first place. - dotest importc-7r "${testcvs} -q ci -m modify -r wip_test" \ + # This used to fail in local mode + dotest importc-7 "${testcvs} -q ci -m modify -r wip_test" \ "Checking in cdir/cfile; ${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v <-- cfile new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1 done" - else - # This checkin should just succeed. That it doesn't is a - # bug (CVS 1.9.16 through the present seem to have it; CVS - # 1.9 did not). - dotest_fail importc-7 "${testcvs} -q ci -m modify -r wip_test" \ -"${PROG} [a-z]*: in directory adir/sub1/ssdir: -${PROG} \[[a-z]* aborted\]: there is no version here; do .${PROG} checkout. first" - # The workaround is to leave off the "-r wip_test". - dotest importc-7a "${testcvs} -q ci -m modify" \ -"Checking in cdir/cfile; -${CVSROOT_DIRNAME}/first-dir/cdir/cfile,v <-- cfile -new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1 -done" - fi # TODO: should also be testing "import -d" when we update # an existing file. @@ -7091,7 +7290,7 @@ U first-dir/file2 U first-dir/file8' cd first-dir dotest join-twobranch-2 "${testcvs} -q update -rbr2 -jbranch" \ -"cvs [a-z]*: file1 is no longer in the repository +"$PROG [a-z]*: file1 is no longer in the repository U file1 U file2 RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v @@ -8509,6 +8708,7 @@ fish" # -d: modules, modules3, cvsadm # -i, -o, -u, -e, -t: modules5 # slashes in module names: modules3 + # invalid module definitions: modules6 ############################################################ # These tests are to make sure that administrative files get @@ -9440,9 +9640,13 @@ U CVSROOT/rcsinfo U CVSROOT/taginfo U CVSROOT/verifymsg" + # FIXCVS: The sleep in the following script helps avoid out of + # order messages, but we really need to figure out how to fix + # cvs to prevent them in the first place. for i in checkin checkout update export tag; do cat >> ${CVSROOT_DIRNAME}/$i.sh <<EOF #! /bin/sh +sleep 1 echo "$i script invoked in \`pwd\`" echo "args: \$@" EOF @@ -9466,12 +9670,13 @@ ${PROG} [a-z]*: Rebuilding administrative file database" cd .. rm -rf first-dir + # Test that real modules check out to realmodule/a, not subdir/a. if $remote; then dotest modules5-8 "${testcvs} co realmodule" \ "U realmodule/a ${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule.. -checkout script invoked in .* +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* args: realmodule" else dotest modules5-8 "${testcvs} co realmodule" \ @@ -9484,11 +9689,11 @@ args: realmodule" dotest_fail modules5-10 "test -f realmodule/b" "" if $remote; then dotest modules5-11 "${testcvs} -q co realmodule" \ -"checkout script invoked in .* +"checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* args: realmodule" dotest modules5-12 "${testcvs} -q update" \ "${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. -update script invoked in /.*/realmodule +update script invoked in ${tmp}/cvs-serv[0-9a-z]*/realmodule args: ${CVSROOT_DIRNAME}/first-dir/subdir" echo "change" >>realmodule/a dotest modules5-13 "${testcvs} -q ci -m." \ @@ -9497,7 +9702,7 @@ ${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a new revision: 1\.2; previous revision: 1\.1 done ${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkin\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. -checkin script invoked in /.*/realmodule +checkin script invoked in ${tmp}/cvs-serv[0-9a-z]*/realmodule args: ${CVSROOT_DIRNAME}/first-dir/subdir" else dotest modules5-11 "${testcvs} -q co realmodule" \ @@ -9523,12 +9728,12 @@ Are you sure you want to release (and delete) directory .realmodule.: " dotest modules5-15 "${testcvs} -q rtag -Dnow MYTAG realmodule" \ "tag script invoked in ${TESTDIR}/1 args: realmodule MYTAG" \ -"tag script invoked in $tmp/cvs-serv[0-9a-z]* +"tag script invoked in ${tmp}/cvs-serv[0-9a-z]* args: realmodule MYTAG" if $remote; then dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \ "U realmodule/a -export script invoked in .* +export script invoked in ${tmp}/cvs-serv[0-9a-z]* args: realmodule" else dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \ @@ -9536,57 +9741,87 @@ args: realmodule" export script invoked in ${TESTDIR}/1 args: realmodule" fi + rm -r realmodule dotest_fail modules5-17 "${testcvs} co realmodule/a" \ "${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \ "${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory '"${PROG}"' \[[a-z]* aborted\]: cannot expand modules' - # FIXCVS: The client gets confused in these cases and tries to - # store the scripts in the wrong places. - if $remote; then :; else - # Now test the ability to check out a single file from a directory + # Now test the ability to check out a single file from a directory + if $remote; then + dotest modules5-18 "${testcvs} co dirmodule/a" \ +"U dirmodule/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule.. +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: dirmodule" + else dotest modules5-18 "${testcvs} co dirmodule/a" \ "U dirmodule/a ${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule.. checkout script invoked in ${TESTDIR}/1 args: dirmodule" - dotest modules5-19 "test -d dirmodule && test -f dirmodule/a" "" - dotest_fail modules5-20 "test -f dirmodule/b" "" - dotest modules5-21 "echo yes | ${testcvs} release -d dirmodule" \ + fi + dotest modules5-19 "test -d dirmodule && test -f dirmodule/a" "" + dotest_fail modules5-20 "test -f dirmodule/b" "" + dotest modules5-21 "echo yes | ${testcvs} release -d dirmodule" \ "You have \[0\] altered files in this repository\. Are you sure you want to release (and delete) directory .dirmodule.: " - # Now test the ability to correctly reject a non-existent filename. - # For maximum studliness we would check that an error message is - # being output. - # We accept a zero exit status because it is what CVS does - # (Dec 95). Probably the exit status should be nonzero, - # however. + # Now test the ability to correctly reject a non-existent filename. + # For maximum studliness we would check that an error message is + # being output. + # We accept a zero exit status because it is what CVS does + # (Dec 95). Probably the exit status should be nonzero, + # however. + if $remote; then + dotest modules5-22 "${testcvs} co dirmodule/nonexist" \ +"${PROG} [a-z]*: warning: new-born dirmodule/nonexist has disappeared +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule.. +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: dirmodule" + else dotest modules5-22 "${testcvs} co dirmodule/nonexist" \ "${PROG} [a-z]*: warning: new-born dirmodule/nonexist has disappeared ${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule.. checkout script invoked in ${TESTDIR}/1 args: dirmodule" + fi + # We tolerate the creation of the dirmodule directory, since that + # is what CVS does, not because we view that as preferable to not + # creating it. + dotest_fail modules5-23 "test -f dirmodule/a || test -f dirmodule/b" "" + rm -r dirmodule - # We tolerate the creation of the dirmodule directory, since that - # is what CVS does, not because we view that as preferable to not - # creating it. - dotest_fail modules5-23 "test -f dirmodule/a || test -f dirmodule/b" "" - rm -r dirmodule - - # Now test that a module using -d checks out to the specified - # directory. + # Now test that a module using -d checks out to the specified + # directory. + if $remote; then + dotest modules5-24 "${testcvs} -q co namedmodule" \ +"U nameddir/a +U nameddir/b +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: nameddir" + else dotest modules5-24 "${testcvs} -q co namedmodule" \ "U nameddir/a U nameddir/b checkout script invoked in ${TESTDIR}/1 args: nameddir" - dotest modules5-25 "test -f nameddir/a && test -f nameddir/b" "" - echo add line >>nameddir/a - # This seems suspicious: when we checkout an existing directory, - # the checkout script gets executed in addition to the update - # script. Is that by design or accident? + fi + dotest modules5-25 "test -f nameddir/a && test -f nameddir/b" "" + echo add line >>nameddir/a + # This seems suspicious: when we checkout an existing directory, + # the checkout script gets executed in addition to the update + # script. Is that by design or accident? + if $remote; then + dotest modules5-26 "${testcvs} -q co namedmodule" \ +"M nameddir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${tmp}/cvs-serv[0-9a-z]*/nameddir +args: ${CVSROOT_DIRNAME}/first-dir/subdir +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: nameddir" + else dotest modules5-26 "${testcvs} -q co namedmodule" \ "M nameddir/a ${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. @@ -9594,7 +9829,18 @@ update script invoked in ${TESTDIR}/1/nameddir args: ${CVSROOT_DIRNAME}/first-dir/subdir checkout script invoked in ${TESTDIR}/1 args: nameddir" - rm nameddir/a + fi + rm nameddir/a + + if $remote; then + dotest modules5-27 "${testcvs} -q co namedmodule" \ +"U nameddir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${tmp}/cvs-serv[0-9a-z]*/nameddir +args: ${CVSROOT_DIRNAME}/first-dir/subdir +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: nameddir" + else dotest modules5-27 "${testcvs} -q co namedmodule" \ "U nameddir/a ${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. @@ -9602,15 +9848,248 @@ update script invoked in ${TESTDIR}/1/nameddir args: ${CVSROOT_DIRNAME}/first-dir/subdir checkout script invoked in ${TESTDIR}/1 args: nameddir" - dotest modules5-28 "echo yes | ${testcvs} release -d nameddir" \ + fi + dotest modules5-28 "echo yes | ${testcvs} release -d nameddir" \ "You have \[0\] altered files in this repository\. Are you sure you want to release (and delete) directory .nameddir.: " + + # Now try the same tests with -d on command line + # FIXCVS? The manual says the modules programs get the module name, + # but they really get the directory name. + if $remote; then + dotest modules5-29 "${testcvs} co -d mydir realmodule" \ +"U mydir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir.. +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: mydir" + else + dotest modules5-29 "${testcvs} co -d mydir realmodule" \ +"U mydir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir.. +checkout script invoked in ${TESTDIR}/1 +args: mydir" + fi + dotest modules5-30 "test -d mydir && test -f mydir/a" "" + dotest_fail modules5-31 "test -d realmodule || test -f mydir/b" "" + if $remote; then + dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \ +"checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: mydir" + dotest modules5-33 "${testcvs} -q update" \ +"${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${tmp}/cvs-serv[0-9a-z]*/mydir +args: ${CVSROOT_DIRNAME}/first-dir/subdir" + echo "change" >>mydir/a + dotest modules5-34 "${testcvs} -q ci -m." \ +"Checking in mydir/a; +${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a +new revision: 1\.3; previous revision: 1\.2 +done +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkin\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +checkin script invoked in ${tmp}/cvs-serv[0-9a-z]*/mydir +args: ${CVSROOT_DIRNAME}/first-dir/subdir" + else + dotest modules5-32 "${testcvs} -q co -d mydir realmodule" \ +"checkout script invoked in ${TESTDIR}/1 +args: mydir" + dotest modules5-33 "${testcvs} -q update" \ +"${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${TESTDIR}/1/mydir +args: ${CVSROOT_DIRNAME}/first-dir/subdir" + echo "change" >>mydir/a + dotest modules5-34 "${testcvs} -q ci -m." \ +"Checking in mydir/a; +${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a +new revision: 1\.3; previous revision: 1\.2 +done +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkin\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +checkin script invoked in ${TESTDIR}/1/mydir +args: ${CVSROOT_DIRNAME}/first-dir/subdir" + fi + dotest modules5-35 "echo yes | ${testcvs} release -d mydir" \ +"You have \[0\] altered files in this repository\. +Are you sure you want to release (and delete) directory .mydir.: " + if $remote; then + dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \ +"tag script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: realmodule MYTAG2" + dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \ +"U mydir/a +export script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: mydir" + else + dotest modules5-36 "${testcvs} -q rtag -Dnow MYTAG2 realmodule" \ +"tag script invoked in ${TESTDIR}/1 +args: realmodule MYTAG2" + dotest modules5-37 "${testcvs} -q export -r MYTAG2 -d mydir realmodule" \ +"U mydir/a +export script invoked in ${TESTDIR}/1 +args: mydir" + fi + rm -r mydir + + # Now test the ability to check out a single file from a directory + if $remote; then + dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \ +"U mydir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir.. +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: mydir" + else + dotest modules5-38 "${testcvs} co -d mydir dirmodule/a" \ +"U mydir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir.. +checkout script invoked in ${TESTDIR}/1 +args: mydir" + fi + dotest modules5-39 "test -d mydir && test -f mydir/a" "" + dotest_fail modules5-40 "test -d dirmodule || test -f mydir/b" "" + dotest modules5-41 "echo yes | ${testcvs} release -d mydir" \ +"You have \[0\] altered files in this repository\. +Are you sure you want to release (and delete) directory .mydir.: " + + # Now test the ability to correctly reject a non-existent filename. + # For maximum studliness we would check that an error message is + # being output. + # We accept a zero exit status because it is what CVS does + # (Dec 95). Probably the exit status should be nonzero, + # however. + if $remote; then + dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \ +"${PROG} [a-z]*: warning: new-born mydir/nonexist has disappeared +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir.. +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: mydir" + else + dotest modules5-42 "${testcvs} co -d mydir dirmodule/nonexist" \ +"${PROG} [a-z]*: warning: new-born mydir/nonexist has disappeared +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .mydir.. +checkout script invoked in ${TESTDIR}/1 +args: mydir" + fi + # We tolerate the creation of the mydir directory, since that + # is what CVS does, not because we view that as preferable to not + # creating it. + dotest_fail modules5-43 "test -f mydir/a || test -f mydir/b" "" + rm -r mydir + + if $remote; then + dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \ +"U mydir/a +U mydir/b +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: mydir" + else + dotest modules5-44 "${testcvs} -q co -d mydir namedmodule" \ +"U mydir/a +U mydir/b +checkout script invoked in ${TESTDIR}/1 +args: mydir" + fi + dotest modules5-45 "test -f mydir/a && test -f mydir/b" "" + dotest_fail modules5-46 "test -d namedir" + echo add line >>mydir/a + # This seems suspicious: when we checkout an existing directory, + # the checkout script gets executed in addition to the update + # script. Is that by design or accident? + if $remote; then + dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \ +"M mydir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${tmp}/cvs-serv[0-9a-z]*/mydir +args: ${CVSROOT_DIRNAME}/first-dir/subdir +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: mydir" + else + dotest modules5-47 "${testcvs} -q co -d mydir namedmodule" \ +"M mydir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${TESTDIR}/1/mydir +args: ${CVSROOT_DIRNAME}/first-dir/subdir +checkout script invoked in ${TESTDIR}/1 +args: mydir" fi + rm mydir/a + + if $remote; then + dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \ +"U mydir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${tmp}/cvs-serv[0-9a-z]*/mydir +args: ${CVSROOT_DIRNAME}/first-dir/subdir +checkout script invoked in ${tmp}/cvs-serv[0-9a-z]* +args: mydir" + else + dotest modules5-48 "${testcvs} -q co -d mydir namedmodule" \ +"U mydir/a +${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir.. +update script invoked in ${TESTDIR}/1/mydir +args: ${CVSROOT_DIRNAME}/first-dir/subdir +checkout script invoked in ${TESTDIR}/1 +args: mydir" + fi + dotest modules5-49 "echo yes | ${testcvs} release -d mydir" \ +"You have \[0\] altered files in this repository\. +Are you sure you want to release (and delete) directory .mydir.: " cd .. rm -rf 1 ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/*.sh ;; + modules6) + # + # Test invalid module definitions + # + # See the header comment for the `modules' test for an index of + # the complete suite of modules tests. + # + + # + # There was a bug in CVS through 1.11.1p1 where a bad module name + # would cause the previous line to be parsed as the module + # definition. This test proves this doesn't happen anymore. + # + mkdir modules6 + cd modules6 + dotest module6-setup-1 "${testcvs} -Q co CVSROOT" "" + cd CVSROOT + echo "longmodulename who cares" >modules + echo "badname" >>modules + # This test almost isn't setup since it generates the error message + # we are looking for if `-Q' isn't specified, but I want to test the + # filename in the message later. + dotest modules6-setup-2 "${testcvs} -Q ci -mbad-modules" \ +"Checking in modules; +${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules +new revision: [0-9.]*; previous revision: [0-9.]* +done +${PROG} [a-z]*: Rebuilding administrative file database" + + # Here's where CVS would report not being able to find `lename' + cd .. + dotest_fail modules6-1 "${testcvs} -q co badname" \ +"${PROG} [a-z]*: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules. +${PROG} [a-z]*: cannot find module .badname. - ignored" \ +"${PROG} [a-z]*: warning: NULL value for key .badname. at line 2 of .${CVSROOT_DIRNAME}/CVSROOT/modules. +${PROG} [a-z]*: cannot find module .badname. - ignored +${PROG} \[checkout aborted\]: cannot expand modules" + + # cleanup + cd CVSROOT + echo "# empty modules file" >modules + dotest modules6-cleanup-1 "${testcvs} -Q ci -mempty-modules" \ +"Checking in modules; +${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules +new revision: [0-9.]*; previous revision: [0-9.]* +done +${PROG} [a-z]*: Rebuilding administrative file database" + cd ../.. + + if $keep; then :; else + rm -r modules6 + fi + ;; + mkmodules-temp-file-removal) # When a file listed in checkoutlist doesn't exist, cvs-1.10.4 # would fail to remove the CVSROOT/.#[0-9]* temporary file it @@ -10759,8 +11238,7 @@ U dir/dir2d2-2/sub2d2-2/file2-2" ################################################## dotest_fail cvsadm-2d3-1 "${testcvs} co -d dir/dir2 1mod" \ -"${PROG} [a-z]*: cannot chdir to dir: No such file or directory -${PROG} [a-z]*: ignoring module 1mod" +"${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .dir.: No such file or directory" if $remote; then :; else # Remote can't handle this, even with the "mkdir dir". @@ -11269,12 +11747,11 @@ U ${TESTDIR}/1/file1" # this is the behavior of CVS 1.9 and earlier. if $remote; then :; else dotest_fail abspath-3.1 "${testcvs} co -d ${TESTDIR}/1/2 mod1" \ -"${PROG} [a-z]*: cannot chdir to 1: No such file or directory -${PROG} [a-z]*: ignoring module mod1" +"${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .${TESTDIR}/1.: No such file or directory" fi dotest_fail abspath-3.2 "${testcvs} co -d 1/2 mod1" \ -"${PROG} [a-z]*: cannot chdir to 1: No such file or directory -${PROG} [a-z]*: ignoring module mod1" +"${PROG} \[checkout aborted\]: could not change directory to requested checkout directory .1.: No such file or directory" + mkdir 1 if $remote; then @@ -11282,8 +11759,7 @@ ${PROG} [a-z]*: ignoring module mod1" # a bug, it should only need to exist on the client side. # See also cvsadm-2d3. dotest_fail abspath-3a "${testcvs} co -d 1/2 mod1" \ -"${PROG} [a-z]*: cannot chdir to 1: No such file or directory -${PROG} [a-z]*: ignoring module mod1" +"${PROG} \[server aborted\]: could not change directory to requested checkout directory .1.: No such file or directory" cd 1 dotest abspath-3a-try2 "${testcvs} co -d 2 mod1" \ "${PROG} [a-z]*: Updating 2 @@ -11652,6 +12128,21 @@ ${PROG} [a-z]*: Rebuilding administrative file database" rm -rf ${CVSROOT_DIRNAME}/top-dir ${CVSROOT_DIRNAME}/second-dir ;; + checkout_repository) + dotest_fail check_repository-1 "${testcvs} co -d ${CVSROOT_DIRNAME} CVSROOT" \ +"${PROG} \[checkout aborted\]: Cannot check out files into the repository itself" + cd ${CVSROOT_DIRNAME} + dotest_fail check_repository-2 "${testcvs} co CVSROOT" \ +"${PROG} \[checkout aborted\]: Cannot check out files into the repository itself" + dotest check_repository-3 "${testcvs} co -p CVSROOT/modules >/dev/null" \ +"=================================================================== +Checking out CVSROOT/modules +RCS: ${CVSROOT_DIRNAME}/CVSROOT/modules,v +VERS: 1\.[0-9]* +\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*" + cd ${TESTDIR} + ;; + mflag) for message in '' ' ' ' ' ' test' ; do @@ -11874,6 +12365,63 @@ xCVS: Tag: br xCVS: file2 xCVS: ---------------------------------------------------------------------- =============================================================================" + + # Test CVS's response to an unchanged log message + cat >${TESTDIR}/editme <<EOF +#!${TESTSHELL} +sleep 1 +exit 0 +EOF + chmod +x ${TESTDIR}/editme + dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \ +" +Log message unchanged or not specified +a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs +Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user" + + # Test CVS's response to an empty log message + cat >${TESTDIR}/editme <<EOF +#!${TESTSHELL} +sleep 1 +cat /dev/null >\$1 +exit 0 +EOF + chmod +x ${TESTDIR}/editme + dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \ +" +Log message unchanged or not specified +a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs +Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user" + + # Test CVS's response to a log message with one blank line + cat >${TESTDIR}/editme <<EOF +#!${TESTSHELL} +sleep 1 +echo >\$1 +exit 0 +EOF + chmod +x ${TESTDIR}/editme + dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \ +" +Log message unchanged or not specified +a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs +Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user" + + # Test CVS's response to a log message with only comments + cat >${TESTDIR}/editme <<EOF +#!${TESTSHELL} +sleep 1 +cat \$1 >${TESTDIR}/edit.new +mv ${TESTDIR}/edit.new \$1 +exit 0 +EOF + chmod +x ${TESTDIR}/editme + dotest_fail editor-emptylog-1 "echo a |${testcvs} -e ${TESTDIR}/editme ci -f file1" \ +" +Log message unchanged or not specified +a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs +Action: (continue) ${PROG} \[[a-z]* aborted\]: aborted by user" + cd ../.. rm -r 1 rm ${TESTDIR}/editme @@ -12931,7 +13479,7 @@ Are you sure you want to release (and delete) directory .second-dir': " cd setup echo file1 >file1 dotest ignore-on-branch-setup-2 "$testcvs -q add file1" \ -"$PROG [a-z]*: use .cvs commit. to add this file permanently" +"$PROG [a-z]*: use .$PROG commit. to add this file permanently" dotest ignore-on-branch-setup-3 "$testcvs -q ci -mfile1 file1" \ "RCS file: $CVSROOT_DIRNAME/ignore-on-branch/file1,v done @@ -12942,7 +13490,7 @@ done" dotest ignore-on-branch-setup-4 "$testcvs -q tag -b branch" 'T file1' echo file2 >file2 dotest ignore-on-branch-setup-5 "$testcvs -q add file2" \ -"$PROG [a-z]*: use .cvs commit. to add this file permanently" +"$PROG [a-z]*: use .$PROG commit. to add this file permanently" dotest ignore-on-branch-setup-6 "$testcvs -q ci -mtrunk file2" \ "RCS file: $CVSROOT_DIRNAME/ignore-on-branch/file2,v done @@ -12973,7 +13521,7 @@ T file1' dotest ignore-on-branch-3 "$testcvs -q tag -b branch2" 'T file1' fi dotest ignore-on-branch-4 "$testcvs -q add file2" \ -"$PROG [a-z]*: use .cvs commit. to add this file permanently" +"$PROG [a-z]*: use .$PROG commit. to add this file permanently" dotest ignore-on-branch-5 "$testcvs -q ci -mbranch file2" \ "Checking in file2; $CVSROOT_DIRNAME/ignore-on-branch/file2,v <-- file2 @@ -13830,33 +14378,45 @@ File: foo\.exe Status: Up-to-date mkdir binwrap3/sub2 mkdir binwrap3/sub2/subsub - echo "*.c0 -k 'b'" > binwrap3/.cvswrappers + echo "bar*" > binwrap3/.cvswrappers + echo "*.c0 -k 'b'" >> binwrap3/.cvswrappers echo "whatever -k 'b'" >> binwrap3/.cvswrappers echo ${binwrap3_text} > binwrap3/foo-b.c0 + echo ${binwrap3_text} > binwrap3/bar-t.c0 echo ${binwrap3_text} > binwrap3/foo-b.sb + echo ${binwrap3_text} > binwrap3/foo-t.sb echo ${binwrap3_text} > binwrap3/foo-t.c1 echo ${binwrap3_text} > binwrap3/foo-t.st - echo "*.c1 -k 'b'" > binwrap3/sub1/.cvswrappers + echo "bar* -k 'kv'" > binwrap3/sub1/.cvswrappers + echo "*.c1 -k 'b'" >> binwrap3/sub1/.cvswrappers echo "whatever -k 'b'" >> binwrap3/sub1/.cvswrappers echo ${binwrap3_text} > binwrap3/sub1/foo-b.c1 + echo ${binwrap3_text} > binwrap3/sub1/bar-t.c1 echo ${binwrap3_text} > binwrap3/sub1/foo-b.sb + echo ${binwrap3_text} > binwrap3/sub1/foo-t.sb echo ${binwrap3_text} > binwrap3/sub1/foo-t.c0 echo ${binwrap3_text} > binwrap3/sub1/foo-t.st - echo "*.st -k 'b'" > binwrap3/sub2/.cvswrappers + echo "bar*" > binwrap3/sub2/.cvswrappers + echo "*.st -k 'b'" >> binwrap3/sub2/.cvswrappers echo ${binwrap3_text} > binwrap3/sub2/foo-b.sb + echo ${binwrap3_text} > binwrap3/sub2/foo-t.sb echo ${binwrap3_text} > binwrap3/sub2/foo-b.st + echo ${binwrap3_text} > binwrap3/sub2/bar-t.st echo ${binwrap3_text} > binwrap3/sub2/foo-t.c0 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c1 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c2 echo ${binwrap3_text} > binwrap3/sub2/foo-t.c3 - echo "*.c3 -k 'b'" > binwrap3/sub2/subsub/.cvswrappers + echo "bar* -k 'kv'" > binwrap3/sub2/subsub/.cvswrappers + echo "*.c3 -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers echo "foo -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers echo "c0* -k 'b'" >> binwrap3/sub2/subsub/.cvswrappers echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-b.c3 + echo ${binwrap3_text} > binwrap3/sub2/subsub/bar-t.c3 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-b.sb + echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.sb echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c0 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c1 echo ${binwrap3_text} > binwrap3/sub2/subsub/foo-t.c2 @@ -13868,7 +14428,8 @@ File: foo\.exe Status: Up-to-date # This destroys anything currently in cvswrappers, but # presumably other tests will take care of it themselves if # they use cvswrappers: - echo "foo*.sb -k 'b'" > cvswrappers + echo "foo-t.sb" > cvswrappers + echo "foo*.sb -k 'b'" >> cvswrappers dotest binwrap3-2 "${testcvs} -q ci -m cvswrappers-mod" \ "Checking in cvswrappers; ${CVSROOT_DIRNAME}/CVSROOT/cvswrappers,v <-- cvswrappers @@ -13941,6 +14502,12 @@ done" dotest binwrap3-top4 "grep foo-t.st ./CVS/Entries" \ "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//" + dotest binwrap3-top5 "grep foo-t.sb ./CVS/Entries" \ + "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//" + + dotest binwrap3-top6 "grep bar-t.c0 ./CVS/Entries" \ + "/bar-t.c0/1.1.1.1/[A-Za-z0-9 :]*//" + dotest binwrap3-sub1-1 "grep foo-b.c1 sub1/CVS/Entries" \ "/foo-b.c1/1.1.1.1/[A-Za-z0-9 :]*/-kb/" @@ -13953,6 +14520,12 @@ done" dotest binwrap3-sub1-4 "grep foo-t.st sub1/CVS/Entries" \ "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//" + dotest binwrap3-sub1-5 "grep foo-t.sb sub1/CVS/Entries" \ + "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//" + + dotest binwrap3-sub1-6 "grep bar-t.c1 sub1/CVS/Entries" \ + "/bar-t.c1/1.1.1.1/[A-Za-z0-9 :]*//" + dotest binwrap3-sub2-1 "grep foo-b.sb sub2/CVS/Entries" \ "/foo-b.sb/1.1.1.1/[A-Za-z0-9 :]*/-kb/" @@ -13971,6 +14544,12 @@ done" dotest binwrap3-sub2-6 "grep foo-t.c3 sub2/CVS/Entries" \ "/foo-t.c3/1.1.1.1/[A-Za-z0-9 :]*//" + dotest binwrap3-sub2-7 "grep foo-t.sb sub2/CVS/Entries" \ + "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//" + + dotest binwrap3-sub2-8 "grep bar-t.st sub2/CVS/Entries" \ + "/bar-t.st/1.1.1.1/[A-Za-z0-9 :]*//" + dotest binwrap3-subsub1 "grep foo-b.c3 sub2/subsub/CVS/Entries" \ "/foo-b.c3/1.1.1.1/[A-Za-z0-9 :]*/-kb/" @@ -13989,6 +14568,12 @@ done" dotest binwrap3-subsub6 "grep foo-t.st sub2/subsub/CVS/Entries" \ "/foo-t.st/1.1.1.1/[A-Za-z0-9 :]*//" + dotest binwrap3-subsub7 "grep foo-t.sb sub2/subsub/CVS/Entries" \ + "/foo-t.sb/1.1.1.1/[A-Za-z0-9 :]*//" + + dotest binwrap3-subsub8 "grep bar-t.c3 sub2/subsub/CVS/Entries" \ + "/bar-t.c3/1.1.1.1/[A-Za-z0-9 :]*//" + dotest binwrap3-sub2-add1 "grep file1.newbin sub2/CVS/Entries" \ "/file1.newbin/1.1/[A-Za-z0-9 :]*/-kb/" dotest binwrap3-sub2-add2 "grep file1.txt sub2/CVS/Entries" \ @@ -14212,14 +14797,33 @@ ${PROG} [a-z]*: Rebuilding administrative file database" #!${TESTSHELL} if head -1 < \$1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then exit 0 +elif head -1 < \$1 | grep '^BugId:[ ]*new$' > /dev/null; then + echo A new bugid was found. >> \$1 + exit 0 else echo "No BugId found." sleep 1 exit 1 fi EOF - chmod +x ${TESTDIR}/vscript - echo "^first-dir ${TESTDIR}/vscript" >>verifymsg + cat >${TESTDIR}/vscript2 <<EOF +#!${TESTSHELL} +if test -f CVS/Repository; then + repo=\`cat CVS/Repository\` +else + repo=\`pwd\` +fi +echo \$repo +if echo "\$repo" |grep yet-another/ >/dev/null 2>&1; then + exit 1 +else + exit 0 +fi +EOF + chmod +x ${TESTDIR}/vscript* + echo "^first-dir/yet-another\\(/\\|\$\\) ${TESTDIR}/vscript2" >>verifymsg + echo "^first-dir\\(/\\|\$\\) ${TESTDIR}/vscript" >>verifymsg + # first test the directory independant verifymsg dotest info-v1 "${testcvs} -q ci -m add-verification" \ "Checking in verifymsg; ${CVSROOT_DIRNAME}/CVSROOT/verifymsg,v <-- verifymsg @@ -14242,6 +14846,8 @@ EOF ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 new revision: 1\.4; previous revision: 1\.3 done" + rm ${TESTDIR}/comment.tmp + cd .. mkdir another-dir cd another-dir @@ -14250,18 +14856,142 @@ done" "${testcvs} import -m bogus first-dir/another x y" \ "No BugId found\. ${PROG} \[[a-z]* aborted\]: Message verification failed" + + # now verify that directory dependent verifymsgs work + dotest info-v5 \ + "${testcvs} import -m bogus first-dir/yet-another x y" \ +"${TESTDIR}/wnt/another-dir +N first-dir/yet-another/file2 + +No conflicts created by this import" \ +"${CVSROOT_DIRNAME}/first-dir/yet-another +N first-dir/yet-another/file2 + +No conflicts created by this import" + + # FIXMECVS + # + # note that in the local case the error message is the same as + # info-v5 + # + # This means that the verifymsg scripts cannot reliably and + # consistantly obtain information on which directory is being + # committed to. Thus it is currently useless for them to be + # running in every dir. They should either be run once or + # directory information should be passed. + if $remote; then + dotest_fail info-v6r \ + "${testcvs} import -m bogus first-dir/yet-another/and-another x y" \ +"${CVSROOT_DIRNAME}/first-dir/yet-another/and-another +${PROG} \[[a-z]* aborted\]: Message verification failed" + else + dotest info-v6 \ + "${testcvs} import -m bogus first-dir/yet-another/and-another x y" \ +"${TESTDIR}/wnt/another-dir +N first-dir/yet-another/and-another/file2 + +No conflicts created by this import" + fi rm file2 cd .. rmdir another-dir cd CVSROOT + echo "RereadLogAfterVerify=always" >>config + dotest info-rereadlog-1 "${testcvs} -q ci -m add-RereadLogAfterVerify=always" \ +"Checking in config; +${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config +new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* +done +${PROG} [a-z]*: Rebuilding administrative file database" + cd ../first-dir + echo line3 >>file1 + cat >${TESTDIR}/comment.tmp <<EOF +BugId: new +See what happens next. +EOF + dotest info-reread-2 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \ +"Checking in file1; +${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 +new revision: 1\.5; previous revision: 1\.4 +done" + dotest info-reread-3 "${testcvs} -q log -N -r1.5 file1" " +.* +BugId: new +See what happens next. +A new bugid was found. +=============================================================================" + + cd ../CVSROOT + grep -v "RereadLogAfterVerify" config > config.new + mv config.new config + echo "RereadLogAfterVerify=stat" >>config + dotest info-reread-4 "${testcvs} -q ci -m add-RereadLogAfterVerify=stat" \ +"Checking in config; +${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config +new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* +done +${PROG} [a-z]*: Rebuilding administrative file database" + cd ../first-dir + echo line4 >>file1 + cat >${TESTDIR}/comment.tmp <<EOF +BugId: new +See what happens next with stat. +EOF + dotest info-reread-5 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \ +"Checking in file1; +${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 +new revision: 1\.6; previous revision: 1\.5 +done" + dotest info-reread-6 "${testcvs} -q log -N -r1.6 file1" " +.* +BugId: new +See what happens next with stat. +A new bugid was found. +=============================================================================" + + cd ../CVSROOT + grep -v "RereadLogAfterVerify" config > config.new + mv config.new config + echo "RereadLogAfterVerify=never" >>config + dotest info-reread-7 "${testcvs} -q ci -m add-RereadLogAfterVerify=never" \ +"Checking in config; +${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config +new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* +done +${PROG} [a-z]*: Rebuilding administrative file database" + cd ../first-dir + echo line5 >>file1 + cat >${TESTDIR}/comment.tmp <<EOF +BugId: new +See what happens next. +EOF + dotest info-reread-8 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \ +"Checking in file1; +${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 +new revision: 1\.7; previous revision: 1\.6 +done" + dotest info-reread-6 "${testcvs} -q log -N -r1.7 file1" " +.* +BugId: new +See what happens next. +=============================================================================" + cd .. + + cd CVSROOT echo '# do nothing' >verifymsg + echo '# defaults' >config dotest info-cleanup-verifymsg "${testcvs} -q ci -m nuke-verifymsg" \ -"Checking in verifymsg; +"Checking in config; +${CVSROOT_DIRNAME}/CVSROOT/config,v <-- config +new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* +done +Checking in verifymsg; ${CVSROOT_DIRNAME}/CVSROOT/verifymsg,v <-- verifymsg new revision: 1\.[0-9]*; previous revision: 1\.[0-9]* done ${PROG} [a-z]*: Rebuilding administrative file database" + rm ${TESTDIR}/vscript* cd .. dotest_fail info-cleanup-0 "${testcvs} -n release -d CVSROOT" \ @@ -14531,9 +15261,11 @@ U file1' dotest log-1 "${testcvs} -q co first-dir" '' cd first-dir echo 'first revision' > file1 - dotest log-2 "${testcvs} add file1" \ -"${PROG}"' [a-z]*: scheduling file `file1'\'' for addition -'"${PROG}"' [a-z]*: use .'"${PROG}"' commit. to add this file permanently' + echo 'first revision' > file2 + dotest log-2 "${testcvs} add file1 file2" \ +"${PROG} [a-z]*: scheduling file .file1. for addition +${PROG} [a-z]*: scheduling file .file2. for addition +${PROG} [a-z]*: use .${PROG} commit. to add these files permanently" # While we're at it, check multi-line comments, input from file, # and trailing whitespace trimming @@ -14548,26 +15280,47 @@ done Checking in file1; ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 initial revision: 1\.1 +done +RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v +done +Checking in file2; +${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2 +initial revision: 1\.1 done" rm -f ${TESTDIR}/comment.tmp echo 'second revision' > file1 - dotest log-4 "${testcvs} -q ci -m2 file1" \ + echo 'second revision' > file2 + dotest log-4 "${testcvs} -q ci -m2 file1 file2" \ "Checking in file1; ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 new revision: 1\.2; previous revision: 1\.1 +done +Checking in file2; +${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2 +new revision: 1\.2; previous revision: 1\.1 done" dotest log-5 "${testcvs} -q tag -b branch file1" 'T file1' + dotest log-5a "${testcvs} -q tag tag1 file2" 'T file2' echo 'third revision' > file1 - dotest log-6 "${testcvs} -q ci -m3 file1" \ + echo 'third revision' > file2 + dotest log-6 "${testcvs} -q ci -m3 file1 file2" \ "Checking in file1; ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 new revision: 1\.3; previous revision: 1\.2 +done +Checking in file2; +${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2 +new revision: 1\.3; previous revision: 1\.2 done" - dotest log-7 "${testcvs} -q update -r branch" '[UP] file1' + dotest log-6a "${testcvs} -q tag tag2 file2" 'T file2' + + dotest log-7 "${testcvs} -q update -r branch" \ +"[UP] file1 +${PROG} [a-z]*: file2 is no longer in the repository" echo 'first branch revision' > file1 dotest log-8 "${testcvs} -q ci -m1b file1" \ @@ -14587,23 +15340,23 @@ done" # Set up a bunch of shell variables to make the later tests # easier to describe.= - log_header=" + log_header1=" RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v Working file: file1 head: 1\.3 branch: locks: strict access list:" - rlog_header=" + rlog_header1=" RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v head: 1\.3 branch: locks: strict access list:" - log_tags='symbolic names: + log_tags1='symbolic names: tag: 1\.2\.2\.1 branch: 1\.2\.0\.2' - log_header2='keyword substitution: kv' + log_keyword='keyword substitution: kv' log_dash='---------------------------- revision' log_date="date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;" @@ -14631,9 +15384,9 @@ ${log_date}${log_lines} # Now, finally, test the log output. dotest log-11 "${testcvs} log file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 5 description: ${log_rev3} @@ -14644,8 +15397,8 @@ ${log_rev1b} ${log_trailer}" dotest log-12 "${testcvs} log -N file1" \ -"${log_header} -${log_header2} +"${log_header1} +${log_keyword} total revisions: 5; selected revisions: 5 description: ${log_rev3} @@ -14656,9 +15409,9 @@ ${log_rev1b} ${log_trailer}" dotest log-13 "${testcvs} log -b file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 3 description: ${log_rev3} @@ -14667,18 +15420,18 @@ ${log_rev1} ${log_trailer}" dotest log-14 "${testcvs} log -r file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-14a "${testcvs} log -rHEAD file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} @@ -14689,9 +15442,9 @@ ${log_trailer}" # might be confusing itself). dotest_fail log-14b "${testcvs} log -r HEAD file1" \ "${PROG} [a-z]*: nothing known about HEAD -${log_header} -${log_tags} -${log_header2} +${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} @@ -14700,50 +15453,50 @@ ${log_trailer}" # Check that unusual syntax works correctly. dotest log-14c "${testcvs} log -r: file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-14d "${testcvs} log -r, file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-14e "${testcvs} log -r. file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-14f "${testcvs} log -r:: file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 0 description: ${log_trailer}" dotest log-15 "${testcvs} log -r1.2 file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev2} ${log_trailer}" dotest log-16 "${testcvs} log -r1.2.2 file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev2b} @@ -14753,9 +15506,9 @@ ${log_trailer}" # This test would fail with the old invocation of rlog, but it # works with the builtin log support. dotest log-17 "${testcvs} log -rbranch file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev2b} @@ -14763,9 +15516,9 @@ ${log_rev1b} ${log_trailer}" dotest log-18 "${testcvs} log -r1.2.2. file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev2b} @@ -14774,9 +15527,9 @@ ${log_trailer}" # Multiple -r options are undocumented; see comments in # cvs.texinfo about whether they should be deprecated. dotest log-18a "${testcvs} log -r1.2.2.2 -r1.3:1.3 file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev3} @@ -14786,18 +15539,18 @@ ${log_trailer}" # This test would fail with the old invocation of rlog, but it # works with the builtin log support. dotest log-19 "${testcvs} log -rbranch. file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev2b} ${log_trailer}" dotest log-20 "${testcvs} log -r1.2: file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev3} @@ -14805,18 +15558,18 @@ ${log_rev2} ${log_trailer}" dotest log-20a "${testcvs} log -r1.2:: file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-21 "${testcvs} log -r:1.2 file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev2} @@ -14824,18 +15577,19 @@ ${log_rev1} ${log_trailer}" dotest log-21a "${testcvs} log -r::1.2 file1" \ -"${log_header} -${log_tags} -${log_header2} -total revisions: 5; selected revisions: 1 +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 5; selected revisions: 2 description: +${log_rev2} ${log_rev1} ${log_trailer}" dotest log-22 "${testcvs} log -r1.1:1.2 file1" \ -"${log_header} -${log_tags} -${log_header2} +"${log_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev2} @@ -14843,28 +15597,30 @@ ${log_rev1} ${log_trailer}" dotest log-22a "${testcvs} log -r1.1::1.2 file1" \ -"${log_header} -${log_tags} -${log_header2} -total revisions: 5; selected revisions: 0 +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 5; selected revisions: 1 description: +${log_rev2} ${log_trailer}" dotest log-22b "${testcvs} log -r1.1::1.3 file1" \ -"${log_header} -${log_tags} -${log_header2} -total revisions: 5; selected revisions: 1 +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 5; selected revisions: 2 description: +${log_rev3} ${log_rev2} ${log_trailer}" # Now the same tests but with rlog dotest log-r11 "${testcvs} rlog first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 5 description: ${log_rev3} @@ -14875,8 +15631,8 @@ ${log_rev1b} ${log_trailer}" dotest log-r12 "${testcvs} rlog -N first-dir/file1" \ -"${rlog_header} -${log_header2} +"${rlog_header1} +${log_keyword} total revisions: 5; selected revisions: 5 description: ${log_rev3} @@ -14887,9 +15643,9 @@ ${log_rev1b} ${log_trailer}" dotest log-r13 "${testcvs} rlog -b first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 3 description: ${log_rev3} @@ -14898,18 +15654,18 @@ ${log_rev1} ${log_trailer}" dotest log-r14 "${testcvs} rlog -r first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-r14a "${testcvs} rlog -rHEAD first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} @@ -14917,59 +15673,59 @@ ${log_trailer}" dotest_fail log-r14b "${testcvs} rlog -r HEAD first-dir/file1" \ "${PROG} [a-z]*: cannot find module .HEAD. - ignored -${rlog_header} -${log_tags} -${log_header2} +${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-r14c "${testcvs} rlog -r: first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-r14d "${testcvs} rlog -r, first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-r14e "${testcvs} rlog -r. first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-r14f "${testcvs} rlog -r:: first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 0 description: ${log_trailer}" dotest log-r15 "${testcvs} rlog -r1.2 first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev2} ${log_trailer}" dotest log-r16 "${testcvs} rlog -r1.2.2 first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev2b} @@ -14977,9 +15733,9 @@ ${log_rev1b} ${log_trailer}" dotest log-r17 "${testcvs} rlog -rbranch first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev2b} @@ -14987,18 +15743,18 @@ ${log_rev1b} ${log_trailer}" dotest log-r18 "${testcvs} rlog -r1.2.2. first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev2b} ${log_trailer}" dotest log-r18a "${testcvs} rlog -r1.2.2.2 -r1.3:1.3 first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev3} @@ -15006,18 +15762,18 @@ ${log_rev2b} ${log_trailer}" dotest log-r19 "${testcvs} rlog -rbranch. first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev2b} ${log_trailer}" dotest log-r20 "${testcvs} rlog -r1.2: first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev3} @@ -15025,18 +15781,18 @@ ${log_rev2} ${log_trailer}" dotest log-r20a "${testcvs} rlog -r1.2:: first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 1 description: ${log_rev3} ${log_trailer}" dotest log-r21 "${testcvs} rlog -r:1.2 first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev2} @@ -15044,18 +15800,19 @@ ${log_rev1} ${log_trailer}" dotest log-r21a "${testcvs} rlog -r::1.2 first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} -total revisions: 5; selected revisions: 1 +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 5; selected revisions: 2 description: +${log_rev2} ${log_rev1} ${log_trailer}" dotest log-r22 "${testcvs} rlog -r1.1:1.2 first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} +"${rlog_header1} +${log_tags1} +${log_keyword} total revisions: 5; selected revisions: 2 description: ${log_rev2} @@ -15063,51 +15820,375 @@ ${log_rev1} ${log_trailer}" dotest log-r22a "${testcvs} rlog -r1.1::1.2 first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} -total revisions: 5; selected revisions: 0 +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 5; selected revisions: 1 description: +${log_rev2} ${log_trailer}" dotest log-r22b "${testcvs} rlog -r1.1::1.3 first-dir/file1" \ -"${rlog_header} -${log_tags} +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 5; selected revisions: 2 +description: +${log_rev3} +${log_rev2} +${log_trailer}" + + # Test when head is dead + + dotest log-d0 "${testcvs} -q up -A" \ +"[UP] file1 +U file2" + dotest log-d1 "${testcvs} -q rm -f file1" \ +"${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently" + dotest log-d2 "${testcvs} -q ci -m4" \ +"Removing file1; +${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1 +new revision: delete; previous revision: 1\.3 +done" + + log_header1=" +RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v +Working file: file1 +head: 1\.4 +branch: +locks: strict +access list:" + rlog_header1=" +RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v +head: 1\.4 +branch: +locks: strict +access list:" + log_header2=" +RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v +Working file: file2 +head: 1\.3 +branch: +locks: strict +access list:" + rlog_header2=" +RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v +head: 1\.3 +branch: +locks: strict +access list:" + log_tags2='symbolic names: + tag2: 1\.3 + tag1: 1\.2' + log_rev4="${log_dash} 1\.4 +date: [0-9/]* [0-9:]*; author: ${username}; state: dead; lines: ${PLUS}0 -0 +4" + log_rev22="${log_dash} 1\.2 +${log_date}${log_lines} +2" + + dotest log-d3 "${testcvs} log -rbranch file1" \ +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_rev2b} +${log_rev1b} +${log_trailer}" + dotest log-rd3 "${testcvs} rlog -rbranch first-dir/file1" \ +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_rev2b} +${log_rev1b} +${log_trailer}" + dotest log-d4 "${testcvs} -q log -rbranch" \ +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_rev2b} +${log_rev1b} +${log_trailer} +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v. ${log_header2} -total revisions: 5; selected revisions: 1 +${log_tags2} +${log_keyword} +total revisions: 3; selected revisions: 0 +description: +${log_trailer}" + dotest log-d4a "${testcvs} -q log -t -rbranch" \ +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 6 +description: +${log_trailer} +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v. +${log_header2} +${log_tags2} +${log_keyword} +total revisions: 3 +description: +${log_trailer}" + dotest log-d4b "${testcvs} -q log -tS -rbranch" \ +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 description: +${log_trailer} +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v." + dotest log-d4c "${testcvs} -q log -h -rbranch" \ +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 6 +${log_trailer} +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v. +${log_header2} +${log_tags2} +${log_keyword} +total revisions: 3 +${log_trailer}" + dotest log-d4d "${testcvs} -q log -hS -rbranch" \ +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +${log_trailer} +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v." + dotest log-d4e "${testcvs} -q log -R -rbranch" \ +"${CVSROOT_DIRNAME}/first-dir/Attic/file1,v +${CVSROOT_DIRNAME}/first-dir/file2,v" + dotest log-d4f "${testcvs} -q log -R -S -rbranch" \ +"${CVSROOT_DIRNAME}/first-dir/Attic/file1,v +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v." + dotest log-rd4 "${testcvs} -q rlog -rbranch first-dir" \ +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_rev2b} +${log_rev1b} +${log_trailer} +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v. +${rlog_header2} +${log_tags2} +${log_keyword} +total revisions: 3; selected revisions: 0 +description: +${log_trailer}" + dotest log-rd4a "${testcvs} -q rlog -t -rbranch first-dir" \ +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 6 +description: +${log_trailer} +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v. +${rlog_header2} +${log_tags2} +${log_keyword} +total revisions: 3 +description: +${log_trailer}" + dotest log-rd4b "${testcvs} -q rlog -St -rbranch first-dir" \ +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_trailer} +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v." + dotest log-rd4c "${testcvs} -q rlog -h -rbranch first-dir" \ +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 6 +${log_trailer} +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v. +${rlog_header2} +${log_tags2} +${log_keyword} +total revisions: 3 +${log_trailer}" + dotest log-rd4d "${testcvs} -q rlog -Sh -rbranch first-dir" \ +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +${log_trailer} +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v." + dotest log-rd4e "${testcvs} -q rlog -R -rbranch first-dir" \ +"${CVSROOT_DIRNAME}/first-dir/Attic/file1,v +${CVSROOT_DIRNAME}/first-dir/file2,v" + dotest log-rd4f "${testcvs} -q rlog -R -S -rbranch first-dir" \ +"${CVSROOT_DIRNAME}/first-dir/Attic/file1,v +${PROG} [a-z]*: warning: no revision .branch. in .${CVSROOT_DIRNAME}/first-dir/file2,v." + dotest log-d5 "${testcvs} log -r1.2.2.1:1.2.2.2 file1" \ +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_rev2b} +${log_rev1b} +${log_trailer}" + dotest log-rd5 "${testcvs} rlog -r1.2.2.1:1.2.2.2 first-dir/file1" \ +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_rev2b} +${log_rev1b} +${log_trailer}" + dotest log-d6 "${testcvs} -q log -r1.2.2.1:1.2.2.2" \ +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_rev2b} +${log_rev1b} +${log_trailer} +${log_header2} +${log_tags2} +${log_keyword} +total revisions: 3; selected revisions: 0 +description: +${log_trailer}" + dotest log-rd6 "${testcvs} -q rlog -r1.2.2.1:1.2.2.2 first-dir" \ +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_rev2b} +${log_rev1b} +${log_trailer} +${rlog_header2} +${log_tags2} +${log_keyword} +total revisions: 3; selected revisions: 0 +description: +${log_trailer}" + dotest log-d7 "${testcvs} log -r1.2:1.3 file1" \ +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_rev3} +${log_rev2} +${log_trailer}" + dotest log-rd7 "${testcvs} -q rlog -r1.2:1.3 first-dir/file1" \ +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 2 +description: +${log_rev3} ${log_rev2} ${log_trailer}" + dotest log-d8 "${testcvs} -q log -rtag1:tag2" \ +"${PROG} [a-z]*: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v. +${PROG} [a-z]*: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v. +${log_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 0 +description: +${log_trailer} +${log_header2} +${log_tags2} +${log_keyword} +total revisions: 3; selected revisions: 2 +description: +${log_rev3} +${log_rev22} +${log_trailer}" + dotest log-d8a "${testcvs} -q log -rtag1:tag2 -S" \ +"${PROG} [a-z]*: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v. +${PROG} [a-z]*: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v. +${log_header2} +${log_tags2} +${log_keyword} +total revisions: 3; selected revisions: 2 +description: +${log_rev3} +${log_rev22} +${log_trailer}" + dotest log-rd8 "${testcvs} -q rlog -rtag1:tag2 first-dir" \ +"${PROG} [a-z]*: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v. +${PROG} [a-z]*: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v. +${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 6; selected revisions: 0 +description: +${log_trailer} +${rlog_header2} +${log_tags2} +${log_keyword} +total revisions: 3; selected revisions: 2 +description: +${log_rev3} +${log_rev22} +${log_trailer}" + dotest log-rd8a "${testcvs} -q rlog -rtag1:tag2 -S first-dir" \ +"${PROG} [a-z]*: warning: no revision .tag1. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v. +${PROG} [a-z]*: warning: no revision .tag2. in .${CVSROOT_DIRNAME}/first-dir/Attic/file1,v. +${rlog_header2} +${log_tags2} +${log_keyword} +total revisions: 3; selected revisions: 2 +description: +${log_rev3} +${log_rev22} +${log_trailer}" + + dotest log-d99 "${testcvs} -q up -rbranch" \ +"[UP] file1 +${PROG} [a-z]*: file2 is no longer in the repository" # Now test outdating revisions dotest log-o0 "${testcvs} admin -o 1.2.2.2:: file1" \ -"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v +"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v done" dotest log-o1 "${testcvs} admin -o ::1.2.2.1 file1" \ -"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v +"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v done" dotest log-o2 "${testcvs} admin -o 1.2.2.1:: file1" \ -"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v +"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file1,v deleting revision 1\.2\.2\.2 done" dotest log-o3 "${testcvs} log file1" \ -"${log_header} -${log_tags} -${log_header2} -total revisions: 4; selected revisions: 4 +"${log_header1} +${log_tags1} +${log_keyword} +total revisions: 5; selected revisions: 5 description: +${log_rev4} ${log_rev3} ${log_rev2} ${log_rev1} ${log_rev1b} ${log_trailer}" dotest log-ro3 "${testcvs} rlog first-dir/file1" \ -"${rlog_header} -${log_tags} -${log_header2} -total revisions: 4; selected revisions: 4 +"${rlog_header1} +${log_tags1} +${log_keyword} +total revisions: 5; selected revisions: 5 description: +${log_rev4} ${log_rev3} ${log_rev2} ${log_rev1} @@ -15115,6 +16196,7 @@ ${log_rev1b} ${log_trailer}" dotest log-o4 "${testcvs} -q update -p -r 1.2.2.1 file1" \ "first branch revision" + cd .. rm -r first-dir rm -rf ${CVSROOT_DIRNAME}/first-dir @@ -15364,7 +16446,8 @@ done" # fairly bogus, but it is the longstanding behavior for # whatever that is worth. dotest ann-10 "${testcvs} ann" \ -"Annotations for file1 +" +Annotations for file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.1 (${username} *[0-9a-zA-Z-]*): this 1\.1 (${username} *[0-9a-zA-Z-]*): is @@ -15376,7 +16459,8 @@ done" 1\.2 (${username} *[0-9a-zA-Z-]*): blank 1\.2 (${username} *[0-9a-zA-Z-]*): line" dotest ann-11 "${testcvs} ann -r br" \ -"Annotations for file1 +" +Annotations for file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.1 (${username} *[0-9a-zA-Z-]*): this 1\.1 (${username} *[0-9a-zA-Z-]*): is @@ -15392,7 +16476,8 @@ done" # FIXCVS: shouldn't "-r 1.2.0.2" be the same as "-r br"? dotest ann-12 "${testcvs} ann -r 1.2.0.2 file1" "" dotest ann-13 "${testcvs} ann -r 1.2.2 file1" \ -"Annotations for file1 +" +Annotations for file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.1 (${username} *[0-9a-zA-Z-]*): this 1\.1 (${username} *[0-9a-zA-Z-]*): is @@ -15413,7 +16498,8 @@ done" cd ../.. rm -r 1 dotest ann-r10 "${testcvs} rann first-dir" \ -"Annotations for first-dir/file1 +" +Annotations for first-dir/file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.1 (${username} *[0-9a-zA-Z-]*): this 1\.1 (${username} *[0-9a-zA-Z-]*): is @@ -15425,7 +16511,8 @@ done" 1\.2 (${username} *[0-9a-zA-Z-]*): blank 1\.2 (${username} *[0-9a-zA-Z-]*): line" dotest ann-r11 "${testcvs} rann -r br first-dir" \ -"Annotations for first-dir/file1 +" +Annotations for first-dir/file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.1 (${username} *[0-9a-zA-Z-]*): this 1\.1 (${username} *[0-9a-zA-Z-]*): is @@ -15440,7 +16527,8 @@ done" 1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content" dotest ann-r12 "${testcvs} rann -r 1.2.0.2 first-dir/file1" "" dotest ann-r13 "${testcvs} rann -r 1.2.2 first-dir/file1" \ -"Annotations for first-dir/file1 +" +Annotations for first-dir/file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.1 (${username} *[0-9a-zA-Z-]*): this 1\.1 (${username} *[0-9a-zA-Z-]*): is @@ -15496,7 +16584,8 @@ done" # The version number after $file,v should be `1.2'. # 1.9.28.1 puts `1.1' there. dotest ann-id-6 "$testcvs -Q ann $file" \ -"Annotations for $file +" +Annotations for $file \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1.2 ($username *[0-9a-zA-Z-]*): "'\$'"Id: $file,v 1.1 [0-9/]* [0-9:]* $username Exp "'\$'" 1.2 ($username *[0-9a-zA-Z-]*): line2" @@ -15594,36 +16683,41 @@ ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then # manner of things and the server better protect itself. dotest_fail crerepos-6a-r \ "${testcvs} -q -d :ext:`hostname`:../crerepos get ." \ -"${PROG} [a-z]*: CVSROOT (\":ext:${hostname}:\.\./crerepos\") -${PROG} [a-z]*: may only specify a positive, non-zero, integer port (not \"\.\.\")\. -${PROG} [a-z]*: perhaps you entered a relative pathname${QUESTION} -${PROG} \[[a-z]* aborted\]: Bad CVSROOT\." +"${PROG} [a-z]*: CVSROOT may only specify a positive, non-zero, integer port (not .\.\..)\. +${PROG} [a-z]*: Perhaps you entered a relative pathname${QUESTION} +${PROG} \[[a-z]* aborted\]: Bad CVSROOT: .:ext:${hostname}:\.\./crerepos.\." cd .. rm -r 1 mkdir 1; cd 1 dotest_fail crerepos-6b-r \ "${testcvs} -d :ext:`hostname`:crerepos init" \ -"${PROG} [a-z]*: CVSROOT (\":ext:${hostname}:crerepos\") -${PROG} [a-z]*: requires a path spec +"${PROG} [a-z]*: CVSROOT requires a path spec: ${PROG} [a-z]*: :(gserver|kserver|pserver):\[\[user\]\[:password\]@\]host\[:\[port\]\]/path ${PROG} [a-z]*: \[:(ext|server):\]\[\[user\]@\]host\[:\]/path -${PROG} \[[a-z]* aborted\]: Bad CVSROOT\." +${PROG} \[[a-z]* aborted\]: Bad CVSROOT: .:ext:${hostname}:crerepos.\." cd .. rm -r 1 else # local # Test that CVS rejects a relative path in CVSROOT. + mkdir 1; cd 1 - # piping the output of this test to /dev/null since we have no way of knowing - # what error messages different rsh implementations will output. - dotest_fail crerepos-6a "${testcvs} -q -d ../crerepos get . >/dev/null 2>&1" "" + # Set CVS_RSH=false since ocassionally (e.g. when CVS_RSH=ssh on + # some systems) some rsh implementations will block because they + # can look up '..' and want to ask the user about the unknown host + # key or somesuch. Which error message we get depends on whether + # false finishes running before we try to talk to it or not. + dotest_fail crerepos-6a "CVS_RSH=false ${testcvs} -q -d ../crerepos get ." \ +"$PROG \[[a-z]* aborted\]: end of file from server (consult above messages if any)" \ +"$PROG \[[a-z]* aborted\]: received broken pipe signal" cd .. rm -r 1 mkdir 1; cd 1 dotest_fail crerepos-6b "${testcvs} -d crerepos init" \ -"${PROG} [a-z]*: CVSROOT \"crerepos\" must be an absolute pathname -${PROG} \[[a-z]* aborted\]: Bad CVSROOT\." +"${PROG} [a-z]*: CVSROOT must be an absolute pathname (not .crerepos.) +${PROG} [a-z]*: when using local access method\. +${PROG} \[[a-z]* aborted\]: Bad CVSROOT: .crerepos.\." cd .. rm -r 1 fi # end of tests to be skipped for remote @@ -15877,7 +16971,8 @@ add file1 # last two digits of the year. Make sure it does that rather # than some bogosity like "100". dotest rcs-4a "${testcvs} annotate file1" \ -"Annotations for file1 +" +Annotations for file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.1 (kingdon 24-Nov-96): This is the first line 1\.2 (kingdon 24-Nov-96): This is the third line @@ -16255,7 +17350,7 @@ EOF # # Hmm, if this test is run on the 31st of the month, and 100 # months from now is a month with only 30 days (e.g. run on - # 31 May 1999), it seems to fail. + # 31 May 1999, 31 May 2001), it seems to fail. # # Sigh. dotest rcs2-7 "${testcvs} -q update -p -D '100 months' file1" \ @@ -17518,8 +18613,7 @@ U file2" # Now try with a numeric revision. dotest sticky-21 "${testcvs} -q update -r 1.1 file1" "U file1" - rm file1 - dotest sticky-22 "${testcvs} rm file1" \ + dotest sticky-22 "${testcvs} rm -f file1" \ "${PROG} [a-z]*: cannot remove file .file1. which has a numeric sticky tag of .1\.1." # The old behavior was that remove allowed this and then commit # gave an error, which was somewhat hard to clear. I mean, you @@ -17528,11 +18622,19 @@ U file2" # why CVS should have a concept of conflict that arises, not from # parallel development, but from CVS's own sticky tags. + # Ditto with a sticky date. + # # I'm kind of surprised that the "file1 was lost" doesn't crop # up elsewhere in the testsuite. It is a long-standing # discrepency between local and remote CVS and should probably # be cleaned up at some point. - dotest sticky-23 "${testcvs} -q update -A" \ + dotest sticky-23 "${testcvs} -q update -Dnow file1" \ +"${PROG} [a-z]*: warning: file1 was lost +U file1" "U file1" + dotest sticky-24 "${testcvs} rm -f file1" \ +"${PROG} [a-z]*: cannot remove file .file1. which has a sticky date of .[0-9.]*." + + dotest sticky-25 "${testcvs} -q update -A" \ "${PROG} [a-z]*: warning: file1 was lost U file1" "U file1" @@ -17923,7 +19025,8 @@ xx" # The same issue occurs with annotate and other keywords, # I think, although it is particularly noticeable for $Log. dotest keywordlog-22 "${testcvs} ann -r br file1" \ -"Annotations for file1 +" +Annotations for file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.3 (${username} *[0-9a-zA-Z-]*): initial 1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'" @@ -17933,7 +19036,8 @@ xx" 1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx 1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): br-change" dotest keywordlog-23 "${testcvs} ann -r HEAD file1" \ -"Annotations for file1 +" +Annotations for file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.3 (${username} *[0-9a-zA-Z-]*): initial 1\.5 (${username} *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'" @@ -18396,12 +19500,14 @@ done" # Now for annotate cd ../1/first-dir dotest tagdate-16 "${testcvs} annotate -rbr2 -D'1 minute ago'" \ -"Annotations for file1 +" +Annotations for file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.1\.4\.1 (${username} *[0-9a-zA-Z-]*): br2-1" dotest tagdate-17 "${testcvs} annotate -rbr2 -Dnow" \ -"Annotations for file1 +" +Annotations for file1 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1\.1\.4\.2 (${username} *[0-9a-zA-Z-]*): br2-2" @@ -19601,6 +20707,7 @@ ${PROG} \[[a-z]* aborted\]: Revision 1\.1 is already locked by fred" dotest reserved-14 "${testcvs} admin -u1.1 a-lock" \ "RCS file: ${CVSROOT_DIRNAME}/first-dir/a-lock,v +${PROG} [a-z]*: ${CVSROOT_DIRNAME}/first-dir/a-lock,v: revision 1\.1 locked by fred; breaking lock 1\.1 unlocked done" dotest reserved-15 "${testcvs} -q ci -m success a-lock" \ @@ -21856,13 +22963,22 @@ ${PROG} server: Updating dir1/sdir/ssdir" # messages are subject to out-of-order bugs (this one is hard # to work around). if $remote; then :; else - dotest multiroot2-9 "${testcvs} -t update" \ -" -> main loop with CVSROOT=${TESTDIR}/root1 + dotest multiroot2-9a "${testcvs} -t update" \ +" *-> main loop with CVSROOT=${TESTDIR}/root1 ${PROG} update: Updating \. + *-> Reader_Lock(${TESTDIR}/root1) + *-> Lock_Cleanup() ${PROG} update: Updating dir1 - -> main loop with CVSROOT=${TESTDIR}/root2 + *-> Reader_Lock(${TESTDIR}/root1/dir1) + *-> Lock_Cleanup() + *-> main loop with CVSROOT=${TESTDIR}/root2 ${PROG} update: Updating dir1/sdir -${PROG} update: Updating dir1/sdir/ssdir" + *-> Reader_Lock(${TESTDIR}/root2/sdir) + *-> Lock_Cleanup() +${PROG} update: Updating dir1/sdir/ssdir + *-> Reader_Lock(${TESTDIR}/root2/sdir/ssdir) + *-> Lock_Cleanup() + *-> Lock_Cleanup()" fi dotest multiroot2-9 "${testcvs} -q tag tag1" \ @@ -22340,6 +23456,32 @@ Root ${TESTDIR}/1 noop EOF + dotest pserver-5a "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +E Protocol error: init says \"${TESTDIR}/2\" but pserver says \"${CVSROOT_DIRNAME}\" +error " <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +testme +Ay::'d +END AUTH REQUEST +init ${TESTDIR}/2 +EOF + dotest_fail pserver-5b "test -d ${TESTDIR}/2" '' + + dotest pserver-5c "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +E init xxx must be an absolute pathname +error " <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +testme +Ay::'d +END AUTH REQUEST +init xxx +EOF + dotest_fail pserver-5d "test -d xxx" '' + dotest_fail pserver-6 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ "I HATE YOU" <<EOF BEGIN AUTH REQUEST @@ -22419,6 +23561,251 @@ Amquiteunabletocomeupwithinterestingpasswordsanymore END AUTH REQUEST EOF + # The following tests are for read-only access + + # Check that readers can only read, everyone else can write + + cat >${CVSROOT_DIRNAME}/CVSROOT/readers <<EOF +anonymous +EOF + + dotest pserver-14 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +M Concurrent Versions System (CVS) .* +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +anonymous +Ay::'d +END AUTH REQUEST +Root ${CVSROOT_DIRNAME} +version +EOF + + dotest pserver-15 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +E ${PROG} \\[server aborted\\]: .init. requires write access to the repository +error " <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +anonymous +Ay::'d +END AUTH REQUEST +init ${CVSROOT_DIRNAME} +EOF + + dotest pserver-16 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +M Concurrent Versions System (CVS) .* +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +testme +Ay::'d +END AUTH REQUEST +Root ${CVSROOT_DIRNAME} +version +EOF + + dotest pserver-17 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +testme +Ay::'d +END AUTH REQUEST +init ${CVSROOT_DIRNAME} +EOF + + dotest pserver-18 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +M Concurrent Versions System (CVS) .* +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +${username} +Ay::'d +END AUTH REQUEST +Root ${CVSROOT_DIRNAME} +version +EOF + + dotest pserver-19 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +${username} +Anything +END AUTH REQUEST +init ${CVSROOT_DIRNAME} +EOF + + # Check that writers can write, everyone else can only read + # even if not listed in readers + + cat >${CVSROOT_DIRNAME}/CVSROOT/writers <<EOF +testme +EOF + + dotest pserver-20 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +M Concurrent Versions System (CVS) .* +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +anonymous +Ay::'d +END AUTH REQUEST +Root ${CVSROOT_DIRNAME} +version +EOF + + dotest pserver-21 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +E ${PROG} \\[server aborted\\]: .init. requires write access to the repository +error " <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +anonymous +Ay::'d +END AUTH REQUEST +init ${CVSROOT_DIRNAME} +EOF + + dotest pserver-22 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +M Concurrent Versions System (CVS) .* +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +testme +Ay::'d +END AUTH REQUEST +Root ${CVSROOT_DIRNAME} +version +EOF + + dotest pserver-23 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +testme +Ay::'d +END AUTH REQUEST +init ${CVSROOT_DIRNAME} +EOF + + dotest pserver-24 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +M Concurrent Versions System (CVS) .* +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +${username} +Ay::'d +END AUTH REQUEST +Root ${CVSROOT_DIRNAME} +version +EOF + + dotest pserver-25 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +E ${PROG} \\[server aborted\\]: .init. requires write access to the repository +error " <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +${username} +Anything +END AUTH REQUEST +init ${CVSROOT_DIRNAME} +EOF + + # Should work the same without readers + + rm ${CVSROOT_DIRNAME}/CVSROOT/readers + + dotest pserver-26 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +M Concurrent Versions System (CVS) .* +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +anonymous +Ay::'d +END AUTH REQUEST +Root ${CVSROOT_DIRNAME} +version +EOF + + dotest pserver-27 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +E ${PROG} \\[server aborted\\]: .init. requires write access to the repository +error " <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +anonymous +Ay::'d +END AUTH REQUEST +init ${CVSROOT_DIRNAME} +EOF + + dotest pserver-28 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +M Concurrent Versions System (CVS) .* +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +testme +Ay::'d +END AUTH REQUEST +Root ${CVSROOT_DIRNAME} +version +EOF + + dotest pserver-29 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +testme +Ay::'d +END AUTH REQUEST +init ${CVSROOT_DIRNAME} +EOF + + dotest pserver-30 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +M Concurrent Versions System (CVS) .* +ok" <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +${username} +Ay::'d +END AUTH REQUEST +Root ${CVSROOT_DIRNAME} +version +EOF + + dotest pserver-31 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \ +"${DOTSTAR} LOVE YOU +E ${PROG} \\[server aborted\\]: .init. requires write access to the repository +error " <<EOF +BEGIN AUTH REQUEST +${CVSROOT_DIRNAME} +${username} +Anything +END AUTH REQUEST +init ${CVSROOT_DIRNAME} +EOF + + # pserver used to try and print from the NULL pointer + # in this error message in this case + dotest_fail pserver-bufinit "${testcvs} pserver" \ +"$PROG \[pserver aborted\]: bad auth protocol start: EOF" </dev/null + # Clean up. echo "# comments only" >config dotest pserver-cleanup-1 "${testcvs} -q ci -m config-it" \ @@ -22429,7 +23816,7 @@ done ${PROG} [a-z]*: Rebuilding administrative file database" cd ../.. rm -r 1 - rm ${CVSROOT_DIRNAME}/CVSROOT/passwd + rm ${CVSROOT_DIRNAME}/CVSROOT/passwd ${CVSROOT_DIRNAME}/CVSROOT/writers fi # skip the whole thing for local ;; diff --git a/contrib/cvs/src/server.h b/contrib/cvs/src/server.h index caeff8a..31f23d51 100644 --- a/contrib/cvs/src/server.h +++ b/contrib/cvs/src/server.h @@ -24,7 +24,6 @@ * server-specific functions. */ extern int server_active; -extern int server_expanding; /* Server functions exported to the rest of CVS. */ diff --git a/contrib/cvs/src/subr.c b/contrib/cvs/src/subr.c index 8211a77..75f26cb 100644 --- a/contrib/cvs/src/subr.c +++ b/contrib/cvs/src/subr.c @@ -123,7 +123,7 @@ expand_string (strptr, n, newsize) /* *STR is a pointer to a malloc'd string. *LENP is its allocated length. Add SRC to the end of it, reallocating if necessary. */ void -allocate_and_strcat (str, lenp, src) +xrealloc_and_strcat (str, lenp, src) char **str; size_t *lenp; const char *src; @@ -742,9 +742,6 @@ resolve_symlink (filename) But that would require editing each filesubr.c and so the expedient hack seems to be looking at HAVE_READLINK. */ newname = xreadlink (*filename); -#else - error (1, 0, "internal error: islink doesn't like readlink"); -#endif if (isabsolute (newname)) { @@ -762,6 +759,9 @@ resolve_symlink (filename) free (*filename); *filename = fullnewname; } +#else + error (1, 0, "internal error: islink doesn't like readlink"); +#endif } } diff --git a/contrib/cvs/src/tag.c b/contrib/cvs/src/tag.c index a2883c8..0b93e09 100644 --- a/contrib/cvs/src/tag.c +++ b/contrib/cvs/src/tag.c @@ -40,7 +40,7 @@ static char *date = NULL; static char *symtag; /* tag to add or delete */ static int delete_flag; /* adding a tag by default */ static int branch_mode; /* make an automagic "branch" tag */ -static int local; /* recursive by default */ +static int disturb_branch_tags = 0; /* allow -F,-d to disturb branch tags */ static int force_tag_match = 1; /* force tag to match by default */ static int force_tag_move; /* don't force tag to move by default */ static int check_uptodate; /* no uptodate-check by default */ @@ -63,12 +63,13 @@ struct master_lists static List *mtlist; static List *tlist; -static const char rtag_opts[] = "+abdFflnQqRr:D:"; +static const char rtag_opts[] = "+aBbdFflnQqRr:D:"; static const char *const rtag_usage[] = { "Usage: %s %s [-abdFflnR] [-r rev|-D date] tag modules...\n", "\t-a\tClear tag from removed files that would not otherwise be tagged.\n", "\t-b\tMake the tag a \"branch\" tag, allowing concurrent development.\n", + "\t-B\tAllows -F and -d to disturb branch tags. Use with extreme care.\n", "\t-d\tDelete the given tag.\n", "\t-F\tMove tag if it already exists.\n", "\t-f\tForce a head revision match if tag/date not found.\n", @@ -81,11 +82,12 @@ static const char *const rtag_usage[] = NULL }; -static const char tag_opts[] = "+bcdFflQqRr:D:"; +static const char tag_opts[] = "+BbcdFflQqRr:D:"; static const char *const tag_usage[] = { "Usage: %s %s [-bcdFflR] [-r rev|-D date] tag [files...]\n", "\t-b\tMake the tag a \"branch\" tag, allowing concurrent development.\n", + "\t-B\tAllows -F and -d to disturb branch tags. Use with extreme care.\n", "\t-c\tCheck that working files are unmodified.\n", "\t-d\tDelete the given tag.\n", "\t-F\tMove tag if it already exists.\n", @@ -103,6 +105,7 @@ cvstag (argc, argv) int argc; char **argv; { + int local = 0; /* recursive by default */ int c; int err = 0; int run_module_prog = 1; @@ -123,6 +126,9 @@ cvstag (argc, argv) case 'b': branch_mode = 1; break; + case 'B': + disturb_branch_tags = 1; + break; case 'c': check_uptodate = 1; break; @@ -196,6 +202,8 @@ cvstag (argc, argv) send_arg("-a"); if (branch_mode) send_arg("-b"); + if (disturb_branch_tags) + send_arg("-B"); if (check_uptodate) send_arg("-c"); if (delete_flag) @@ -252,14 +260,14 @@ cvstag (argc, argv) (date ? date : "A"))), symtag, argv[i], ""); err += do_module (db, argv[i], TAG, delete_flag ? "Untagging" : "Tagging", - rtag_proc, (char *) NULL, 0, 0, run_module_prog, + rtag_proc, (char *) NULL, 0, local, run_module_prog, 0, symtag); } close_module (db); } else { - err = rtag_proc (argc + 1, argv - 1, NULL, NULL, NULL, 0, 0, NULL, + err = rtag_proc (argc + 1, argv - 1, NULL, NULL, NULL, 0, local, NULL, NULL); } @@ -362,7 +370,7 @@ rtag_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified, if (numtag != NULL && !numtag_validated) { - tag_check_valid (numtag, argc - 1, argv + 1, local, 0, repository); + tag_check_valid (numtag, argc - 1, argv + 1, local_specified, 0, repository); numtag_validated = 1; } @@ -372,7 +380,7 @@ rtag_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified, mtlist = getlist(); err = start_recursion (check_fileproc, check_filesdoneproc, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, - argc - 1, argv + 1, local, which, 0, 1, + argc - 1, argv + 1, local_specified, which, 0, 1, where, 1); if (err) @@ -387,13 +395,13 @@ rtag_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified, cached in do_recursion isn't stale by the time we get around to using it to rewrite the RCS file in the callback, and this is the easiest way to accomplish that. */ - lock_tree_for_write (argc - 1, argv + 1, local, which, 0); + lock_tree_for_write (argc - 1, argv + 1, local_specified, which, 0); /* start the recursion processor */ err = start_recursion (is_rtag ? rtag_fileproc : tag_fileproc, (FILESDONEPROC) NULL, tag_dirproc, (DIRLEAVEPROC) NULL, NULL, argc - 1, argv + 1, - local, which, 0, 0, where, 1); + local_specified, which, 0, 0, where, 1); Lock_Cleanup (); dellist (&mtlist); if (where != NULL) @@ -738,6 +746,21 @@ rtag_fileproc (callerdat, finfo) branch_mode ? "branch" : "version", rev); free (oversion); free (version); + if (branch_mode) free(rev); + return (0); + } + else /* force_tag_move is set and... */ + if ((isbranch && !disturb_branch_tags) || + (!isbranch && disturb_branch_tags)) + { + error(0,0, "%s: Not moving %s tag `%s' from %s to %s%s.", + finfo->fullname, + isbranch ? "branch" : "non-branch", + symtag, oversion, rev, + isbranch ? "" : " due to `-B' option"); + if (branch_mode) free(rev); + free (oversion); + free (version); return (0); } free (oversion); @@ -779,7 +802,7 @@ rtag_delete (rcsfile) RCSNode *rcsfile; { char *version; - int retcode; + int retcode, isbranch; if (numtag) { @@ -796,6 +819,20 @@ rtag_delete (rcsfile) return (0); free (version); + + isbranch = RCS_nodeisbranch (rcsfile, symtag); + if ((isbranch && !disturb_branch_tags) || + (!isbranch && disturb_branch_tags)) + { + if (!quiet) + error(0, 0, + "Not removing %s tag `%s' from `%s'%s.", + isbranch ? "branch" : "non-branch", + symtag, rcsfile->path, + isbranch ? "" : " due to `-B' option"); + return (1); + } + if ((retcode = RCS_deltag(rcsfile, symtag)) != 0) { if (!quiet) @@ -843,6 +880,7 @@ tag_fileproc (callerdat, finfo) if (delete_flag) { + int isbranch; /* * If -d is specified, "force_tag_match" is set, so that this call to * RCS_getversion() will return a NULL version string if the symbolic @@ -861,6 +899,20 @@ tag_fileproc (callerdat, finfo) } free (version); + isbranch = RCS_nodeisbranch (finfo->rcs, symtag); + if ((isbranch && !disturb_branch_tags) || + (!isbranch && disturb_branch_tags)) + { + if (!quiet) + error(0, 0, + "Not removing %s tag `%s' from `%s'%s.", + isbranch ? "branch" : "non-branch", + symtag, vers->srcfile->path, + isbranch ? "" : " due to `-B' option"); + freevers_ts (&vers); + return (1); + } + if ((retcode = RCS_deltag(vers->srcfile, symtag)) != 0) { if (!quiet) @@ -973,6 +1025,20 @@ tag_fileproc (callerdat, finfo) freevers_ts (&vers); return (0); } + else /* force_tag_move == 1 and... */ + if ((isbranch && !disturb_branch_tags) || + (!isbranch && disturb_branch_tags)) + { + error(0,0, "%s: Not moving %s tag `%s' from %s to %s%s.", + finfo->fullname, + isbranch ? "branch" : "non-branch", + symtag, oversion, rev, + isbranch ? "" : " due to `-B' option"); + free (oversion); + if (branch_mode) free(rev); + freevers_ts (&vers); + return (0); + } free (oversion); } diff --git a/contrib/cvs/src/vers_ts.c b/contrib/cvs/src/vers_ts.c index 5524bab..c41affd 100644 --- a/contrib/cvs/src/vers_ts.c +++ b/contrib/cvs/src/vers_ts.c @@ -339,13 +339,22 @@ time_stamp (file) { struct stat sb; char *cp; - char *ts; + char *ts = NULL; + time_t mtime = 0L; - if (CVS_LSTAT (file, &sb) < 0) + if (!CVS_LSTAT (file, &sb)) { - ts = NULL; + mtime = sb.st_mtime; } - else + /* If it's a symlink, return whichever is the newest mtime of + the link and its target, for safety. + */ + if (!CVS_STAT (file, &sb)) + { + if (mtime < sb.st_mtime) + mtime = sb.st_mtime; + } + if (mtime) { struct tm *tm_p; struct tm local_tm; diff --git a/contrib/cvs/src/version.c b/contrib/cvs/src/version.c new file mode 100644 index 0000000..aba91ae --- /dev/null +++ b/contrib/cvs/src/version.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 1994 david d `zoo' zuhn + * Copyright (c) 1994 Free Software Foundation, Inc. + * Copyright (c) 1992, Brian Berliner and Jeff Polk + * Copyright (c) 1989-1992, Brian Berliner + * + * You may distribute under the terms of the GNU General Public License as + * specified in the README file that comes with this CVS source distribution. + * + * version.c - the CVS version number + */ + +#include "cvs.h" +#include "version.h" + +#ifdef CLIENT_SUPPORT +#ifdef SERVER_SUPPORT +char *config_string = " (client/server)\n"; +#else +char *config_string = " (client)\n"; +#endif +#else +#ifdef SERVER_SUPPORT +char *config_string = " (server)\n"; +#else +char *config_string = "\n"; +#endif +#endif + + + +static const char *const version_usage[] = +{ + "Usage: %s %s\n", + NULL +}; + + + +/* + * Output a version string for the client and server. + * + * This function will output the simple version number (for the '--version' + * option) or the version numbers of the client and server (using the 'version' + * command). + */ +int +version (argc, argv) + int argc; + char **argv; +{ + int err = 0; + + if (argc == -1) + usage (version_usage); + +#ifdef CLIENT_SUPPORT + if (current_parsed_root && current_parsed_root->isremote) + (void) fputs ("Client: ", stdout); +#endif + + /* Having the year here is a good idea, so people have + some idea of how long ago their version of CVS was + released. */ + (void) fputs (version_string, stdout); + (void) fputs (config_string, stdout); + +#ifdef CLIENT_SUPPORT + if (current_parsed_root && current_parsed_root->isremote) + { + (void) fputs ("Server: ", stdout); + start_server (); + if (supported_request ("version")) + send_to_server ("version\012", 0); + else + { + send_to_server ("noop\012", 0); + fputs ("(unknown)\n", stdout); + } + err = get_responses_and_close (); + } +#endif + return err; +} + diff --git a/contrib/cvs/src/version.h.in b/contrib/cvs/src/version.h.in new file mode 100644 index 0000000..48580cb --- /dev/null +++ b/contrib/cvs/src/version.h.in @@ -0,0 +1,15 @@ +/* -*- c -*- + * + * Copyright (c) 1992, Brian Berliner and Jeff Polk + * Copyright (c) 1989-1992, Brian Berliner + * + * You may distribute under the terms of the GNU General Public License as + * specified in the README file that comes with the CVS kit. + */ + +#ifndef VERSION_H +#define VERSION_H 1 + +#define version_string "Concurrent Versions System (CVS) @VERSION@" + +#endif /* VERSION_H */ diff --git a/contrib/cvs/src/wrapper.c b/contrib/cvs/src/wrapper.c index 039590a..bb071b1 100644 --- a/contrib/cvs/src/wrapper.c +++ b/contrib/cvs/src/wrapper.c @@ -178,14 +178,14 @@ wrap_send () and (more importantly) where we found it. */ error (0, 0, "\ -m wrapper option is not supported remotely; ignored"); + send_to_server ("Argument -W\012Argument ", 0); + send_to_server (wrap_list[i]->wildCard, 0); + send_to_server (" -k '", 0); if (wrap_list[i]->rcsOption != NULL) - { - send_to_server ("Argument -W\012Argument ", 0); - send_to_server (wrap_list[i]->wildCard, 0); - send_to_server (" -k '", 0); send_to_server (wrap_list[i]->rcsOption, 0); - send_to_server ("'\012", 0); - } + else + send_to_server ("kv", 0); + send_to_server ("'\012", 0); } } #endif /* CLIENT_SUPPORT */ @@ -216,32 +216,28 @@ wrap_unparse_rcs_options (line, first_call_p) if (first_call_p) i = 0; - for (; i < wrap_count + wrap_tempcount; ++i) - { - if (wrap_list[i]->rcsOption != NULL) - { - *line = xmalloc (strlen (wrap_list[i]->wildCard) - + strlen ("\t") - + strlen (" -k '") - + strlen (wrap_list[i]->rcsOption) - + strlen ("'") - + 1); /* leave room for '\0' */ - - strcpy (*line, wrap_list[i]->wildCard); - strcat (*line, " -k '"); - strcat (*line, wrap_list[i]->rcsOption); - strcat (*line, "'"); - - /* We're going to miss the increment because we return, so - do it by hand. */ - ++i; - - return; - } + if (i >= wrap_count + wrap_tempcount) { + *line = NULL; + return; } - *line = NULL; - return; + *line = xmalloc (strlen (wrap_list[i]->wildCard) + + strlen ("\t") + + strlen (" -k '") + + (wrap_list[i]->rcsOption != NULL ? + strlen (wrap_list[i]->rcsOption) : 2) + + strlen ("'") + + 1); /* leave room for '\0' */ + + strcpy (*line, wrap_list[i]->wildCard); + strcat (*line, " -k '"); + if (wrap_list[i]->rcsOption != NULL) + strcat (*line, wrap_list[i]->rcsOption); + else + strcat (*line, "kv"); + strcat (*line, "'"); + + ++i; } #endif /* SERVER_SUPPORT || CLIENT_SUPPORT */ @@ -438,7 +434,7 @@ wrap_add (line, isTemp) case 'k': if (e.rcsOption) free (e.rcsOption); - e.rcsOption = xstrdup (temp); + e.rcsOption = strcmp (temp, "kv") ? xstrdup (temp) : NULL; break; default: break; @@ -471,11 +467,7 @@ wrap_add_entry(e, temp) x=(temp ? wrap_count+(wrap_tempcount++):(wrap_count++)); wrap_list[x]=(WrapperEntry *)xmalloc(sizeof(WrapperEntry)); - wrap_list[x]->wildCard=e->wildCard; - wrap_list[x]->fromcvsFilter=e->fromcvsFilter; - wrap_list[x]->tocvsFilter=e->tocvsFilter; - wrap_list[x]->mergeMethod=e->mergeMethod; - wrap_list[x]->rcsOption = e->rcsOption; + *wrap_list[x]=*e; } /* Return 1 if the given filename is a wrapper filename */ diff --git a/contrib/cvs/src/zlib.c b/contrib/cvs/src/zlib.c index 3bfc542..1fc7a72 100644 --- a/contrib/cvs/src/zlib.c +++ b/contrib/cvs/src/zlib.c @@ -51,8 +51,8 @@ static int compress_buffer_input PROTO((void *, char *, int, int, int *)); static int compress_buffer_output PROTO((void *, const char *, int, int *)); static int compress_buffer_flush PROTO((void *)); static int compress_buffer_block PROTO((void *, int)); -static int compress_buffer_shutdown_input PROTO((void *)); -static int compress_buffer_shutdown_output PROTO((void *)); +static int compress_buffer_shutdown_input PROTO((struct buffer *)); +static int compress_buffer_shutdown_output PROTO((struct buffer *)); /* Report an error from one of the zlib functions. */ @@ -355,10 +355,10 @@ compress_buffer_block (closure, block) /* Shut down an input buffer. */ static int -compress_buffer_shutdown_input (closure) - void *closure; +compress_buffer_shutdown_input (buf) + struct buffer *buf; { - struct compress_buffer *cb = (struct compress_buffer *) closure; + struct compress_buffer *cb = (struct compress_buffer *) buf->closure; int zstatus; /* Pick up any trailing data, such as the checksum. */ @@ -387,10 +387,10 @@ compress_buffer_shutdown_input (closure) /* Shut down an output buffer. */ static int -compress_buffer_shutdown_output (closure) - void *closure; +compress_buffer_shutdown_output (buf) + struct buffer *buf; { - struct compress_buffer *cb = (struct compress_buffer *) closure; + struct compress_buffer *cb = (struct compress_buffer *) buf->closure; int zstatus, status; do |