summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2008-01-13 05:49:32 +0000
committerobrien <obrien@FreeBSD.org>2008-01-13 05:49:32 +0000
commitdef79099e7c2ca2b773aa94d5b80c571dec9460f (patch)
tree9a6cba0f4384569a2eee18bf74577d8fd41aa2c7 /contrib/cvs/src
parent0526761d4d99d34d2de093998c7ccd3f82695651 (diff)
parent55b663837dd12bbe5836969ac2a3f052a9028ea5 (diff)
downloadFreeBSD-src-def79099e7c2ca2b773aa94d5b80c571dec9460f.zip
FreeBSD-src-def79099e7c2ca2b773aa94d5b80c571dec9460f.tar.gz
This commit was generated by cvs2svn to compensate for changes in r175261,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/cvs/src')
-rw-r--r--contrib/cvs/src/ChangeLog1088
-rw-r--r--contrib/cvs/src/Makefile.am8
-rw-r--r--contrib/cvs/src/Makefile.in274
-rw-r--r--contrib/cvs/src/add.c58
-rw-r--r--contrib/cvs/src/admin.c34
-rw-r--r--contrib/cvs/src/annotate.c10
-rw-r--r--contrib/cvs/src/buffer.h14
-rw-r--r--contrib/cvs/src/checkin.c14
-rw-r--r--contrib/cvs/src/classify.c22
-rw-r--r--contrib/cvs/src/client.h19
-rw-r--r--contrib/cvs/src/create_adm.c9
-rw-r--r--contrib/cvs/src/cvsrc.c11
-rw-r--r--contrib/cvs/src/edit.c36
-rw-r--r--contrib/cvs/src/expand_path.c173
-rw-r--r--contrib/cvs/src/fileattr.c3
-rw-r--r--contrib/cvs/src/find_names.c9
-rw-r--r--contrib/cvs/src/hardlink.c6
-rw-r--r--contrib/cvs/src/hardlink.h2
-rw-r--r--contrib/cvs/src/hash.c7
-rw-r--r--contrib/cvs/src/hash.h7
-rw-r--r--contrib/cvs/src/history.c77
-rw-r--r--contrib/cvs/src/history.h6
-rw-r--r--contrib/cvs/src/ignore.c27
-rw-r--r--contrib/cvs/src/modules.c15
-rw-r--r--contrib/cvs/src/myndbm.c8
-rw-r--r--contrib/cvs/src/myndbm.h14
-rw-r--r--contrib/cvs/src/no_diff.c11
-rw-r--r--contrib/cvs/src/release.c37
-rw-r--r--contrib/cvs/src/remove.c9
-rw-r--r--contrib/cvs/src/repos.c9
-rw-r--r--contrib/cvs/src/root.c56
-rw-r--r--contrib/cvs/src/root.h22
-rw-r--r--contrib/cvs/src/run.c160
-rwxr-xr-xcontrib/cvs/src/sanity.sh2647
-rw-r--r--contrib/cvs/src/server.h18
-rw-r--r--contrib/cvs/src/stack.c7
-rw-r--r--contrib/cvs/src/stack.h5
-rw-r--r--contrib/cvs/src/status.c31
-rw-r--r--contrib/cvs/src/subr.c63
-rw-r--r--contrib/cvs/src/vers_ts.c64
-rw-r--r--contrib/cvs/src/version.c14
-rw-r--r--contrib/cvs/src/watch.c23
-rw-r--r--contrib/cvs/src/wrapper.c10
-rw-r--r--contrib/cvs/src/zlib.c16
44 files changed, 4211 insertions, 942 deletions
diff --git a/contrib/cvs/src/ChangeLog b/contrib/cvs/src/ChangeLog
index 87caf76..822f86d 100644
--- a/contrib/cvs/src/ChangeLog
+++ b/contrib/cvs/src/ChangeLog
@@ -1,3 +1,1075 @@
+2006-06-08 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (conflicts4): Test that the client honors Empty-conflicts.
+
+ * server.c (requests): Add "Empty-conflicts" marker.
+ * client.c (send_fileproc): Send contents of all files with conflicts
+ unless the server can handle the conflict marker in the Entry.
+
+ * sanity.sh (conflicts4): New tests.
+ (Original patch from Mark D. Baushke <mdb@gnu.org>.)
+
+2006-06-07 Mark D. Baushke <mdb@gnu.org>
+
+ * modules.c (my_module): Remove unused variable xvalue.
+ [Fixes NetBSD coverity cid-705.]
+
+2006-05-31 Mark D. Baushke <mdb@gnu.org>
+
+ * add.c (add): Fix memory leak.
+ [Fixes NetBSD coverity cid-3751.]
+ (add_directory): Fix memory leak.
+ [Fixes NetBSD coverity cid-3640.]
+
+ * checkin.c (Checkin): Avoid possible NULL dereference.
+ [Fixes NetBSD coverity cid-2425.]
+
+ * client.c (auth_server): Fix memory leak.
+ [Fixes NetBSD coverity cid-3404.]
+
+ * commit.c (remove_file): Fix memory leak.
+ [Fixes NetBSD coverity cid-3752.]
+
+ * rcs.c (RCS_checkin): Add assert (tip).
+ [Fixes NetBSD coverity cid-2424.]
+
+2006-05-26 Mark D. Baushke <mdb@gnu.org>
+
+ * add.c (add): Do not leak memory.
+ [Fixes NetBSD coverity cid-2199.]
+
+ * edit.c (onoff_fileproc): Do not leak memory.
+ [Fixes NetBSD coverity cid-2201.]
+
+ * edit.c (onoff_filesdoneproc): Do not leak memory.
+ [Fixes NetBSD coverity cid-2202.]
+
+ * lock.c (readers_exist): Add assert (lockdir).
+ [Fixes NetBSD coverity cid-2411.]
+
+ * rcs.c (RCS_findlock_or_tip): Do not leak memory.
+ [Fixes NetBSD coverity cid-2198.]
+
+ * rcs.c (RCS_getdate): Avoid possible NULL dereference.
+ [Fixes NetBSD coverity cid-2412.]
+
+ * server.c (serve_sticky): Do not leak file descriptors.
+ [Fixes NetBSD coverity cid-2197.]
+
+ * server.c (do_cvs_command): Do not leak memory.
+ [Fixes NetBSD coverity cid-2204.]
+
+ * tag.c (add_to_val_tags): Do not leak memory.
+ [Fixes NetBSD coverity cid-2071.]
+
+2006-05-25 Derek Price <derek@ximbiot.com>
+
+ * client.c (start_rsh_server): Default rsh client to RSH_DFLT. Remove
+ verbose comment attempting to justify the previous default.
+
+2006-05-24 Larry Jones <lawrence.jones@ugs.com>
+
+ * sanity.sh: Add -v|--verbose option to echo test names. Clean
+ up help message.
+ Remove val-tags files for cleanup instead of truncating since the
+ truncation code doesn't work right on Solaris. Always use -f when
+ removing val-tags.
+
+2006-05-22 Derek Price <derek@ximbiot.com>
+
+ * rcs.c (RCS_reparsercsfile, RCS_fully_parse, RCS_checkout, RCS_deltas,
+ RCS_getdeltatext, RCS_copydeltas): Verify input revision numbers.
+ (rcs6): Update to compensate.
+
+ * sanity.sh (rcs6): New test.
+
+2006-05-16 Derek Price <derek@ximbiot.com>
+
+ * main.c: Update copyright for 2006.
+
+2006-05-12 Mark D. Baushke <mdb@gnu.org>
+
+ * log.c (log_expand_revlist): Add assert (r->first). It should
+ only be possible for both r->first == NULL && r->last == NULL
+ which would have been handled.
+ [Fixes NetBSD coverity cid-1063.]
+
+ * server.c (do_cvs_command): Protect close (dev_null_fd) against
+ invalid fd value in error_exit.
+ [Fixes NetBSD coverity cid-1307.]
+
+ * rcs.c (RCS_isdead): Assert that the first argument is not NULL.
+ [Fixes NetBSD coverity cid-1058.]
+
+ * commit.c (checkaddfile): Do not dereference NULL on call to
+ error().
+ [Fixes NetBSD coverity cid-1061.]
+
+ * log.c (cvslog): Assert p->start && p->end instead of masking the
+ problem.
+ * server.c (server_updated): Assert findnode_fn results instead of
+ masking the problem.
+
+ * add.c (add_directory): Revert previous change. The xstrdup()
+ function already deals a NULL argument.
+ * client.c (handle_mt): Ditto.
+ * entries.c (Entnode_Create): Ditto.
+ (Entries_Open): Ditto.
+ * logmsg.c (fmt_proc): Ditto.
+ * vers_ts.c (Version_TS): Ditto.
+
+2006-05-11 Mark D. Baushke <mdb@gnu.org>
+
+ * add.c (add_directory): Protect tag from NULL dereference.
+ [Fixes NetBSD cid-1054.]
+
+ * client.c (handle_mt): Deal with missing text argument.
+ [Fixes NetBSD cid-924.]
+
+ * entries.c (Entnode_Create): Protect date, tag and ts_conflict
+ from possible NULL dereference.
+ [Fixes NetBSD coverity cid-994, cid-995, cid-1055, cid-1057.]
+
+ * entries.c (Entries_Open): Protect dirtag and dirdate from
+ possible NULL dereference.
+ [Fixes NetBSD coverity cid-996.]
+
+ * log.c (cvslog): Validate start and end args to
+ date_to_internet().
+ [Fixes NetBSD coverity cid-2427 and cid-2428.]
+
+ * logmsg.c (fmt_proc): Protect li->tag from NULL dereference.
+ [Fixes NetBSD coverity cid-997.]
+
+ * vers_ts.c (Version_TS): Protect tag and vers_ts->tag from NULL
+ dereference.
+ [Fixes NetBSD coverity cid-1053.]
+
+2006-05-04 Mark D. Baushke <mdb@gnu.org>
+
+ * filesubr.c (cvs_temp_file): Avoid keeping pointers to free()'d
+ storage laying around.
+ * commit.c (commit): Handle possible NULL filename values
+ returned from cvs_temp_file().
+ * filesubr.c (cvs_temp_name): Ditto.
+ * import.c (import): Ditto.
+ * login.c (password_entry_operation): Ditto.
+ * logmsg.c (do_verify): Ditto.
+ * patch.c (patch_fileproc): Ditto.
+ [Fixes NetBSD coverity cid-2545.]
+
+ * buffer.c (packetizing_buffer_output): Initialize outdata.
+ [Fixes NetBSD coverity cid-2474.]
+
+ * server.c (server_updated): Check for NULL return from
+ findnode_fn(). [Fixes NetBSD coverity cid-1352.]
+
+2006-04-19 Larry Jones <lawrence.jones@ugs.com>
+
+ * history.c (sort_order): Back out previous change - not needed.
+
+2006-04-15 Larry Jones <lawrence.jones@ugs.com>
+
+ * history.c (sort_order): Add prototype.
+ * server.c (template_proc): Add prototype and make args const.
+ * update.c (RegisterMerge): Make static to match prototype.
+
+2006-04-07 Derek Price <derek@ximbiot.com>
+
+ * client.c (strto_file_size): New function which checks for errors when
+ parsing protocol input.
+ (read_counted_file, update_entries, handle_mbinary): Use new function.
+ Remove FIXME.
+ (Thanks to a report from Brendan Harrison
+ <brendan.harrison@klocwork.com>.)
+
+ * client.c (send_a_repository): Add assertion.
+ (Thanks to an incorrect report from Brendan Harrison
+ <brendan.harrison@klocwork.com>.)
+
+2006-04-06 Derek Price <derek@ximbiot.com>
+
+ * filesubr.c (last_component, expand_wild), rcs.c (RCS_deltas,
+ RCS_rewrite), server.c (server_checked_in): Add assertions.
+ (Thanks to an incorrect report from Brendan Harrison
+ <brendan.harrison@klocwork.com>.)
+
+2006-03-31 Mark D. Baushke <mdb@gnu.org>
+
+ * cvsrc.c (read_cvsrc): Deal with \r\n (DOS) line endings in
+ .cvsrc files.
+
+2006-03-07 Derek Price <derek@ximbiot.com>
+
+ * tag.c (rtag_proc): Search the Attic when -F is used.
+ * sanity.sh (tests): Run death-rtag.
+ (death-rtag): Expect success.
+
+ * sanity.sh (death-rtag): Add failing force tag move test.
+
+2006-03-06 Derek Price <derek@ximbiot.com>
+
+ * tag.c (rtag_proc): Always search in the attic when -r is used.
+
+ * sanity.sh (death-rtag): New test.
+ (Original report from C. Michael Pilato <cmpilato@collab.net>.)
+
+2006-03-01 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh: Set MALLOC_CHECK_ in hopes of exposing common memory
+ errors when CVS is linked with glibc 2.x.
+
+2006-02-27 Derek Price <derek@ximbiot.com>
+
+ * lock.c (internal_lock): Back out previous change, we don't change
+ user visible output on stable unless absolutely necessary.
+
+ * lock.c (internal_lock): Improve error message.
+
+2006-02-26 Derek Price <derek@ximbiot.com>
+
+ * client.c (call_in_directory): Remove unneeded code.
+ * sanity.sh (toplevel-12): Compensate by failing to expect a redundant
+ error message.
+
+2006-02-24 Mark D. Baushke <mdb@gnu.org>
+
+ * client.c (gzip_level): Move to...
+ * main.c (gzip_level): ...here.
+ (main): Revert previous change in '-z' argument processing and
+ remove CLIENT_SUPPORT ifdef/endif.
+ * sanity.h (crerepos-6a): Deal with --disable-client output.
+
+ * main.c (main): Validate the gzip compression level for
+ --disable-client configurations.
+
+2006-02-13 Derek Price <derek@ximbiot.com>
+
+ * server.c (do_cvs_command): Skip server_cleanup in the child process.
+
+ * sanity.sh (sshstdio-6): Rewrite using more portable sed script.
+
+2006-02-02 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (sshstdio): Attempt to ignore spurious SSH output.
+
+ * main.c (main), release.c (release), server.c (do_cvs_command): Always
+ call the cleanup hooks before exit.
+
+2006-02-01 Derek Price <derek@ximbiot.com>
+
+ * tag.c (add_to_val_tags): When a tag turns out to exist in the db when
+ it isn't expected, release the lock.
+
+ * history.c (save_user, save_file, save_mod, read_hrecs): Avoid
+ overflow.
+
+2006-01-30 Derek Price <derek@ximbiot.com>
+
+ * server.c (do_cvs_command): Set flow control pipe to blocking mode
+ before waiting for it to close.
+ (set_block_fd): New function.
+ (Original patch from Garrett Rooney <grooney@collab.net>.)
+
+2006-01-13 Larry Jones <lawrence.jones@ugs.com>
+
+ * mkmodules.c (config_contents): Change SystemAuth to yes to match
+ the default value. Add missing newline in RereadLogAfterVerify.
+
+2006-01-09 Larry Jones <lawrence.jones@ugs.com>
+
+ * commit.c (remove_file): Record correct revision in history file.
+ (Reported by Chris Reed <cr@progress.com>.)
+
+2005-12-07 Derek Price <derek@ximbiot.com>
+
+ * client.c (start_server), root.c (method_names), root.h (CVSmethod):
+ Handle :extssh: as a kindness to Eclipse users.
+ (Suggestion from Joseph P. Skudlarek <Jskud@Jskud.com>.)
+
+2005-12-06 Mark D. Baushke <mdb@gnu.org>
+
+ * buffer.c (stdio_buffer_shutdown): No longer assert() the
+ fstat(). Use error (0, ...) instead of error (1, ...) to avoid
+ infinite loops. (patch #4678)
+ Patch adapted from "Allan L. Bazinet" <allan.bazinet@gmail.com>
+
+2005-11-10 Larry Jones <lawrence.jones@ugs.com>
+
+ * commit.c (commit): Complain about obsolete -n option if not in
+ server mode.
+
+2005-11-09 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (pserver-4.2): Accept a "no such sytem user" message when
+ a root attempt is made.
+
+2005-09-30 Larry Jones <lawrence.jones@ugs.com>
+
+ * expand_path.c (expand_path): Fix memory leaks.
+
+2005-09-29 Paul Eggert <eggert@CS.UCLA.EDU>
+ Derek Price <derek@ximbiot.com>
+
+ * client.c (handle_m, handle_e): Remove incomplete workaround for
+ O_NONBLOCK problem; no longer needed because of the fix below.
+ (start_rsh_server): We need the O_NONBLOCK fix, so pass 'true' to
+ piped_child to enable the workaround.
+ * cvs.h (piped_child): New bool argument saying whether O_NONBLOCK
+ fix is needed. All uses changed.
+ * run.c (work_around_openssh_glitch): New function.
+ (piped_child): Use it if the fix is requested. Avoid call call to
+ vfork with undefined behavior.
+
+2005-09-26 Conrad T. Pino <Conrad@Pino.com>
+
+ * rcs.c: Use "#ifdef HAVE_FSYNC" just like every where else.
+
+2005-09-25 Derek Price <derek@ximbiot.com>
+
+ * rcs.c (rcs_internal_unlockfile): Fsync files before renaming them.
+ Patch from Rahul Bhargava <rahul@wandisco.com>.
+
+2005-09-24 Derek Price <derek@ximbiot.com>
+
+ * update.c (merge_file): Check for RCS_checkout errors.
+
+2005-09-23 Larry Jones <lawrence.jones@ugs.com>
+
+ * checkout.c (export_usage): Note that -r requires a tag.
+
+2005-09-22 Larry Jones <lawrence.jones@ugs.com>
+
+ * patch.c (patch_usage): Document -k option.
+
+2005-09-22 Derek Price <derek@ximbiot.com>
+
+ * classify.c (Classify_File): If a file had a conflict and the
+ timestamp hasn't changed, it still has a conflict. Add comment about
+ how T_MODIFIED could later turn out to have conflict markers and why
+ it should not be checked in this function.
+ * client.c (send_fileproc): Don't send contents for files known to have
+ conflicts unless this is for `cvs diff'.
+ * commit.c (check_fileproc): T_CONFLICT should be handled like
+ T_MODIFIED, since force could be requested. Simplify logic since
+ T_CONFLICT can now be trusted.
+ * cvs.h (file_has_conflict): Remove proto.
+ * rcs.c (RCS_Checkout): Comment noexec behavior in header block.
+ * server.c (serve_unchanged, serve_is_modified): Handle conflicts.
+ * status.c (status_fileproc): Trust T_CONFLICT to simplify.
+ * subr.c (file_has_conflict): Removed.
+ * update.c (update_fileproc): Trust T_CONFLICT.
+ (RegisterMerge): New function factored from...
+ (merge_file, join_file): ...these two functions.
+ * vers_ts.c (time_stamp_server): Handle = conflict timestamps in server
+ entdata.
+ * sanity.sh (files-12): Account for slight behavior improvement.
+ (status, conflicts, mwrap): Account for corrected behavior.
+ (join-readonly-conflict-10): Correct comment.
+ (binfiles-con1b): New test for correct behavior.
+
+2005-09-19 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (modules5-8): Rename...
+ (modules5-8r): ...to this and comment Mac OS X failure.
+ Comment Solaris 9 failure below with a `FIXME?' tag.
+
+ * sanity.sh: Remove previous hack in favor of setting TESTDIR on
+ Solaris (and Mac OS X) until problem is solved correctly.
+
+2005-09-15 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh: Use /bin/pwd to verify current dir since Solaris 9 is
+ sometimes resolving symlinked paths.
+
+2005-09-14 Derek Price <derek@ximbiot.com>
+
+ * edit.c (edit_usage, unedit_usage, editors_usage), watch.c
+ (watch_usage, watchers_usage): Add quotes and reword for clarity and
+ consistency.
+
+ * edit.c (edit_usage): Add missing syntax. Reword description for
+ clarity. Mention default behavior.
+
+2005-09-13 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh: Split $username into $username & $username8. Rename
+ $author as $anyusername.
+
+2005-09-12 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (binfiles-con1b): Back out accidental addition.
+
+ * sanity.sh (username): Cut $username down to 8 characters when longer,
+ since that is all that appears in output.
+
+2005-09-07 Derek Price <derek@ximbiot.com>
+
+ Close <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=14462>.
+ * rcs.c (RCS_parse): Free variable *after* using it for the last time.
+
+2005-09-06 Derek Price <derek@ximbiot.com>
+
+ * rcs.c (RCS_putdtree): Remove unused variable.
+
+2005-09-06 Mark D. Baushke <mdb@gnu.org>
+
+ Close <https://savannah.nongnu.org/bugs/?func=detailitem&item_id=14435>.
+ * rcs.c (RCS_putdtree): Avoid stack overflow which may be
+ possible with excessive recursive calls to RCS_putdtree().
+ (Patch from Serg Masyutin.)
+
+2005-09-03 Derek Price <derek@ximbiot.com>
+
+ * add.c (add_usage): Standardize usage message somewhat.
+
+2005-09-02 Larry Jones <lawrence.jones@ugs.com>
+
+ * commit.c (checkaddfile): Improve error messages for lock_RCS failure.
+ * release.c (release): Improve error message for pclose failure.
+
+ * root.h (struct cvsroot_s): Always declare isremote to simplify
+ other code. Simplify referencing code.
+ * root.c (new_cvsroot_t): Always initialize isremote.
+ * server.h: Always declare server_active to simplify other code.
+ Simplify referencing code.
+ * server.c: Always define server_active.
+
+2005-09-01 Derek Price <derek@ximbiot.com>
+
+ * main.c, wrapper.c: Update links.
+
+2005-09-01 Derek Price <derek@ximbiot.com>
+
+ * recurse.c: Update bug report email address.
+
+2005-08-30 Larry Jones <lawrence.jones@ugs.com>
+
+ * import.c (import_descend): Lock repository directory during import.
+
+2005-07-12 Derek Price <derek@ximbiot.com>
+
+ * buffer.c, buffer.h, client.h, expand_path.c, history.c, myndbm.h,
+ release.c: Add copyright notices.
+
+2005-07-11 Derek Price <derek@ximbiot.com>
+
+ * buffer.c, buffer.h, client.h, expand_path.c, history.c, myndbm.h,
+ release.c: Update license notices.
+
+2005-06-22 Larry Jones <lawrence.jones@ugs.com>
+
+ * vers_ts (Version_TS): Don't allow command line keyword expansion
+ modes to override binary mode.
+ * sanity.sh (): Tests for the above.
+ (Merged from trunk.)
+
+2005-06-06 Conrad T. Pino <Conrad@Pino.com>
+
+ * cvs.h: Reverse patch committed 2005-05-27 by Conrad T. Pino.
+ * run.c: Reverse patch committed 2005-05-27 by Conrad T. Pino.
+
+2005-06-02 Derek Price <derek@ximbiot.com>
+
+ * zlib.c (compress_buffer_shutdown_input): Don't attempt to read EOF
+ from the client during shutdown. It might never be sent.
+ * sanity.sh (abspath2): Test for this.
+
+2005-05-31 Derek Price <derek@ximbiot.com>
+ for Alexander Taler <alex@0--0.org>
+
+ * rcscmds.c: Change type of call_diff_argc_allocated from int to
+ size_t, to match the prototype of run_add_arg_p(). This fixes a
+ bus error in OpenBSD 3.6 sparc64.
+
+2005-05-27 Conrad T. Pino <Conrad@Pino.com>
+
+ * cvs.h: Replace "run_arg" function with "#define run_arg run_add_arg",
+ add "run_add_arg" prototype, change "piped_child" prototype to be same
+ as feature branch to reflect "(os2,src,windows-NT)/run.c" changes.
+ * run.c: Remove "run_arg" to synchronize with "../windows-NT/run.c".
+ Function "run_add_arg" scope was "static" and is now "extern" scope.
+ Synchronize "piped_child" function arguments with feature branch.
+
+2005-05-27 Derek Price <derek@ximbiot.com>
+
+ * client.c (send_arg): Make arg const.
+ (send_option_string): Rename to...
+ (send_options): ...this and accept argc/argv in place of string.
+ * client.h: Update protos to match the changes to client.c.
+ * cvs.h (RCS_exec_rcsdiff, diff_exec): Update protos.
+ (run_add_arg_p, run_arg_free_p): New protos.
+ * diff.c (opts, opts_allocated): Replace with...
+ (diff_argv, diff_argc, diff_arg_allocated): ...these.
+ (add_diff_args): New convenience function.
+ (diff): Use new constructs and APIs.
+ * patch.c (patch_fileproc, RCS_checkin, RCS_delete_revs), rcscmds.c
+ (call_diff_add_arg, call_diff_setup, RCS_merge, RCS_exec_rcsdiff,
+ diff_exec, RCS_output_diff_options), update.c (patch_file): Use new
+ APIs.
+ * run.c (run_add_arg_p, run_arg_free_p): New functions.
+ (run_argc_allocated): Make size_t.
+ (run_setup, run_add_arg): Use new functions.
+ * sanity.sh: Accomodate above changes.
+ (rcslib-diffrgx-3): Slip in test for space splitting.
+
+2005-05-02 Derek Price <derek@ximbiot.com>
+
+ Remove unnecessary level of indirection.
+ * lock.c (L_HISTORY_LOCK, L_VAL_TAGS_LOCK): Remove macros.
+ (internal_lock, internal_clear_lock): Accept lock as argument.
+ (history_lock, clear_history_lock, val_tags_lock, clear_val_tags_lock):
+ Replace old macro arg with an actual lock pointer.
+
+2005-05-02 Derek Price <derek@ximbiot.com>
+
+ * lock.c (internal_lock, internal_clear_lock): Add protos.
+ (history_lock, val_tags_lock): Return the chartered true/false status.
+
+2005-05-02 Derek Price <derek@ximbiot.com>
+
+ * cvs.h (CVSHISTLCK): Rename macro to...
+ (CVSHISTORYLCK): ...this.
+ (CVSVALTAGSLCK): New macro.
+ (val_tags_lock, clear_val_tags_lock): New functions.
+ * lock.c (global_val_tags_lock): New global.
+ (Lock_Cleanup): Clean up after val-tags lock if necessary.
+ (L_HISTORY_LOCK, L_VAL_TAGS_LOCK): New local macros.
+ (internal_lock, internal_clear_lock, val_tags_lock,
+ clear_val_tags_lock): New functions.
+ (history_lock, clear_history_lock): Use new internal functions.
+ * tag.c (is_in_val_tags, add_to_val_tags): New functions using the
+ write-lock for val-tags and factored from...
+ (tag_check_valid): ...this function.
+ * sanity.sh (lockfiles-22): Add val-tags lock test.
+
+2005-04-28 Derek Price <derek@ximbiot.com>
+
+ * cvs.h (history_lock, clear_history_lock): New protos.
+ * lock.c (struct lock): Add lockdirname.
+ (global_history_lock): New global.
+ (global_read_lock): Initialize.
+ (lock_name): Handle const args.
+ (lock_simple_remove): Factor out code in favor of clear_lock call.
+ (set_lock): Handle variable lockdirname.
+ (lock_filesdoneproc): Set new lockdirname.
+ (history_lock, clear_history_lock): New functions.
+ (clear_lock): Avoid segfault on missing lock.
+ (Lock_Cleanup): Clean up history locks when necessary.
+ * history.c (history_write): Use new lock.
+ * sanity.sh (lockfiles-20): Test new lock.
+
+2005-04-28 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (lockfiles): Port some locking tests over from 1.12.x.
+
+2005-04-28 Derek Price <derek@ximbiot.com>
+
+ * lock.c (clear_lock): Improve comment.
+
+2005-04-28 Derek Price <derek@ximbiot.com>
+
+ * lock.c (struct lock): Store lockdir name.
+ (masterlock): Remove global.
+ (remove_lock_files, clear_lock, set_lock): Update to compensate.
+
+2005-04-20 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (rcs5): Minor cosmetic change.
+
+2005-04-20 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (tests): Add rcs4.
+ (rcs5): Add comments.
+
+2005-04-20 Derek Price <derek@ximbiot.com>
+
+ * rcs.c (expand_keywords): Avoid buffer overflow.
+ (Original patch from Stewart Brodie <stewart@eh.org>.)
+
+ * sanity.sh (rcs5): New tests for the above.
+
+2005-03-17 Derek Price <derek@ximbiot.com>
+
+ * login.c (password_entry_parseline): Avoid using uninitialized
+ variable.
+ * rcs.c (RCS_deltas): Avoid buffer overflow.
+ (RCS_checkout): Avoid using uninitialized loglen.
+ * patch.c (patch_fileproc): Free original pointer, not one that may
+ have been incremented.
+ (Thanks to report from Alen Zukich <alen.zukich@klocwork.com>.)
+
+2005-03-17 Derek Price <derek@ximbiot.com>
+
+ * commit.c (checkaddfile): Avoid dereferencing a NULL pointer in
+ response to a rare error.
+ * admin.c (admin_fileproc), log.c (log_expand_revlist), mkmodules.c
+ (checkout_file), rcs.c (RCS_getdate, RCS_deltas, RCS_findlock_or_tip,
+ RCS_tag2rev): Avoid dereferencing NULL pointer.
+ (Thanks to report from Alen Zukich <alen.zukich@klocwork.com>.)
+
+2005-03-17 Derek Price <derek@ximbiot.com>
+
+ * rcs.c (RCS_reparsercsfile): Avoid memory leak.
+ (Thanks to report from Alen Zukich <alen.zukich@klocwork.com>.)
+
+2005-03-17 Derek Price <derek@ximbiot.com>
+
+ * log.c (log_expand_revlist): Suppress message and not error handling
+ when really_quiet.
+
+2005-03-17 Derek Price <derek@ximbiot.com>
+
+ * client.c (call_in_directory): Put function call after var decls.
+
+2005-03-16 Derek Price <derek@ximbiot.com>
+
+ * client.c (call_in_directory), commit.c (commit_filesdoneproc), log.c
+ (log_expand_revlist, log_version), logmsg.c (logfile_write), modules
+ (my_module), no_diff.c (No_Difference), parseinfo.c (Parse_Info), rcs.c
+ (RCS_deltas, RCS_checkin, RCS_addbranch, do_locks, do_symbols),
+ rcscmds.c (RCS_merge), root.c (parse_cvsroot, normalize_cvsroot),
+ update.c (merge_file): Verify assumptions via assertions.
+ (Thanks to (probably) incorrect reports from Alen Zukich
+ <alen.zukich@klocwork.com>.)
+
+2005-03-16 Derek Price <derek@ximbiot.com>
+
+ * server.c (create_adm_p, serve_entry), tag.c (rtag_proc): Avoid memory
+ leaks.
+ (Thanks to report from Alen Zukich <alen.zukich@klocwork.com>.)
+
+2005-03-15 Mark D. Baushke <mdb@cvshome.org>
+
+ * history.c (select_hrec): Avoid possible memory leak.
+
+2005-03-15 Derek Price <derek@ximbiot.com>
+
+ * patch.c (patch_proc): Avoid memory leak.
+ (Thanks to report from Alen Zukich <alen.zukich@klocwork.com>.)
+
+2005-03-11 Mark D. Baushke <mdb@cvshome.org>
+
+ * modules.c (my_module): Protect against free (NULL) code path.
+
+2005-03-11 Derek Price <derek@ximbiot.com>
+
+ * annotate.c (rannotate_proc), fileattr.c (fileattr_write), rcs.c
+ (RCS_deltas), server.c (check_repository_password), update.c (update):
+ Avoid memory leaks.
+ (Thanks to report from Alen Zukich <alen.zukich@klocwork.com>.)
+
+2005-03-09 Derek Price <derek@ximbiot.com>
+
+ * add.c (add, add_directory), buffer.c (allocate_buffer_datas),
+ client.c (update_entries), commit.c (checkaddfile), entries.c
+ (Entries_Open), fileattr.c (fileattr_read), ignore.c (ign_add),
+ import.c (import), main.c (main), parseinfo.c (parse_config), rcs.c
+ (RCS_reparsercsfile, RCS_getbranchpoint, RCS_checkout,
+ RCS_delete_revs, apply_rcs_changes): Avoid memory leaks.
+ (Thanks to report from Alen Zukich <alen.zukich@klocwork.com>.)
+
+ * hardlink.c, hardlink.h: Avoid compiling entire contents of these
+ files w/o preserve permissions support.
+
+2005-03-09 Mark D. Baushke <mdb@cvshome.org>
+
+ * history.c (history, save_file): Cleanup the API to match the
+ comments.
+
+2005-02-27 Jim Meyering <jim@meyering.net>
+
+ * login.c (password_entry_operation): Exit nonzero when
+ failing to close a just-appended-to .cvspass file.
+
+2005-02-26 Larry Jones <lawrence.jones@ugs.com>
+
+ * release.c (release): Remove unneeded code.
+
+2005-02-22 Derek Price <derek@ximbiot.com>
+
+ * edit.c: Load watch settings before setting new ones with
+ `cvs watch on/off'.
+ (Original patch from Jim Hyslop <jhyslop@ieee.org>.)
+
+ * sanity.sh (watch6): New tests for same.
+ (Outline from Jim Hyslop <jhyslop@ieee.org>.)
+
+2005-02-21 Mark D. Baushke <mdb@cvshome.org>
+
+ * import.c (import): Avoid using assert with side effects it may
+ be configured away using NDEBUG.
+ (Patch from Frank Hemer <frank@hemer.org>.)
+
+2005-02-08 Derek Price <derek@ximbiot.com>
+
+ * build_src.com: Build stack.c on VMS.
+ (Suggestion from Piet Schuermans <pschuermans@mac.com>.)
+
+2005-02-01 Larry Jones <lawrence.jones@ugs.com>
+
+ * log.c (log_fileproc, log_expand_revlist): Add support for BASE tag.
+ * sanity.sh (log): New tests for above.
+
+2005-01-31 Derek Price <derek@ximbiot.com>
+
+ * main.c: Update year in copyright notice to match GNU standards.
+ * sanity.sh (version-1): Update to match.
+
+2005-01-31 Derek Price <derek@ximbiot.com>
+
+ * main.c: Rephrase --version message.
+ * sanity.sh (version-1): Update to match.
+
+2005-01-31 Derek Price <derek@ximbiot.com>
+
+ * Makefile.am, add.c, admin.c, annotate.c, checkin.c, checkout.c,
+ classify.c, commit.c, create_adm.c, cvs.h, cvsrc.c, diff.c, entries.c,
+ find_names.c, hash.c, hash.h, history.h, import.c, lock.c, log.c,
+ login.c, logmsg.c, main.c, mkmodules.c, modules.c, myndbm.c, no_diff.c,
+ parseinfo.c, patch.c, rcs.c, rcs.h, rcscmds.c, recurse.c, remove.c,
+ repos.c, root.c, root.h, server.h, stack.c, stack.h, status.c, subr.c,
+ tag.c, update.c, vers_ts.c, version.c: Update copyright notices.
+
+2005-01-29 Derek Price <derek@ximbiot.com>
+
+ * log.c (log_usage): Add note about using -S with revision info
+ supression and selection.
+ (Suggestion from Dan Peterson <dbpete@aol.com>.)
+
+2004-12-19 Larry Jones <lawrence.jones@ugs.com>
+
+ * expand_path.c (expand_path): Rewrite using offsets instead of
+ pointers to simplify and avoid reallocation bugs.
+ (Inspired by Jeremy Bopp <jeremy@motive.com>.)
+
+2004-12-09 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (tests): Add modules7.
+
+2004-12-09 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (modules7): New test group.
+ (Based on a patch from Mark D. Baushke <mdb@cvshome.org>, based on a
+ report from Richard Verhoeven <Richard_Verhoeven@WestLB.de>.)
+
+2004-11-18 Mark D. Baushke <mdb@cvshome.org>
+
+ * checkout.c (checkout_proc): Passing the repository to
+ tag_check_valid seems to stop the assertion failure in recurse.c
+ do_recursion.
+ * sanity.sh (basic2-21a): Removed.
+ (basic2-21b): Fixed.
+
+2004-11-17 Mark D. Baushke <mdb@cvshome.org>
+
+ * sanity.sh (basic2-21a): The val-tags file should have
+ at least 'rtagged-by-head y' in it.
+ (basic2-21b): New test showing a cvs bug when val-tags
+ is not properly updated.
+ (Report from "John Elgin" <John@JCElgin.com>.)
+
+2004-11-17 Mark D. Baushke <mdb@cvshome.org>
+
+ * client.c (handle_m, handle_e): Winsock is returning
+ SOCK_ERRNO == WSAENOTSOCK for select() problems and not
+ setting errno. Do not bother with printing an error from a
+ select() that is not returning an non-zero errno.
+ (Report from Conrad T. Pino <Conrad@Pino.com>.)
+
+2004-11-10 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh: Maintain pass/skip/warn status and output at end.
+ (usage): Note new functionality of -e.
+ (warn): New function.
+ (verify_tmp_empty): Warn instead of failing. Delete turds if warn()
+ doesn't exit.
+
+2004-11-10 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (verify_tmp_empty): New function.
+ (dotest_internal_*): Call verify_tmp_empty as needed.
+
+2004-11-09 Mark D. Baushke <mdb@cvshome.org>
+
+ * sanity.sh: Backport find_tool changes from 1.12.9.1.
+ (SEARCHPATH): New list of PATH directories to search.
+ (Which): Use $SEARCHPATH. Support -a switch.
+ (badtools,set_bad_tool,is_bad_tool): Keep track of tools that do
+ not work for us.
+ (version_test): Obtain the version of tools under test if
+ possible.
+ (tool_find): Rewrite. API changed to allow a list of
+ tests to be used against a list of possible command names found on
+ the SEARCHPATH.
+ (id_tool_test): Check that 'id -u' and 'id -un' work.
+ (expr_tooltest1): Check for NextStep 3.3 expr bug.
+ (expr_tooltest2): Check for SunOS expr multi-line pattern bug.
+ (expr_create_bar): Create a test file for expr testing.
+ (expr_tooltest3): Use it and test for big multi-line identity
+ matches.
+ (expr_set_ENDANCHOR): Find and set the right value for ENDANCHOR.
+ (expr_set_DOTSTAR): Find and set the right value for DOTSTAR.
+ (expr_tooltest_DOTSTAR): Ensure that DOTSTAR works with big
+ matches.
+ (tr_tooltest1): Verify that tr handles NUL bytes.
+ (awk_tooltest1): Verify that awk the BEGIN clause works properly.
+ (awk_tooltest2): Verify that print %c format item works properly.
+
+2004-11-02 Mark D. Baushke <mdb@cvshome.org>
+
+ * filesubr.c (MAXSIZE): New macro.
+ (xreadlink): Ensure initial buffer size does not exceed MAXSIZE.
+ Avoid cast. If readlink fails with buffer size just under MAXSIZE,
+ try again with MAXSIZE.
+
+2004-11-02 Mark D. Baushke <mdb@cvshome.org>
+
+ * filesubr.c (xreadlink): AIX and HP-UX readlink() returns ERANGE
+ when there is not enough room in the buffer.
+
+2004-11-01 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (rcslib): Fix typo in path.
+
+2004-11-01 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (rcslib): Test a link to a path longer than 128
+ characters.
+
+2004-10-29 Derek Price <derek@ximbiot.com>
+
+ * filesubr.c (xreadlink): Make sure allocation is tried once at the
+ maximum buffer size. Protect against overflow.
+
+2004-10-29 Mark D. Baushke <mdb@cvshome.org>
+
+ * filesubr.c (SIZE_MAX, SSIZE_MAX): Use #include "xsize.h" instead.
+ (xreadlink): Use xrealloc instead of xmalloc/free.
+
+2004-10-29 Mark D. Baushke <mdb@cvshome.org>
+
+ * filesubr.c (SIZE_MAX, SSIZE_MAX): New constants.
+ (xreadlink): Deal with symlinks longer than 127 bytes.
+ (Problem reported as issue 190 by Gottfried Ganssauge
+ <gotti@cvshome.org>.)
+
+2004-10-28 Mark D. Baushke <mdb@cvshome.org>
+
+ * release.c (release): Allow builds of cvs with --disable-server
+ --disable-client both used for local installation configuration.
+ * root.c (Name_Root): Ditto.
+ * update.c (checkout_file): Ditto.
+ (Problem reported by Jean Olivier Caron <jecar@mlab.t.u-tokyo.ac.jp>.)
+
+2004-10-27 Mark D. Baushke <mdb@cvshome.org>
+
+ * cvs.h (RCS_FLAGS_USETIME): New flag.
+ * rcs.c (RCS_checkin): Add citime argument.
+ * rcs.h (RCS_checkin): Ditto.
+ * checkin.c (Checkin): Pass new RCS_checkin argument.
+ * commit.c (remove_file, checkaddfile): Ditto.
+ * import.c (add_rev): Ditto.
+
+ * sanity.sh (tagdate): Delete tagdate-19b as an incorrect test.
+
+2004-10-27 Mark D. Baushke <mdb@cvshome.org>
+
+ * sanity.sh (tagdate): Provide more output.
+
+2004-10-26 Mark D. Baushke <mdb@cvshome.org>
+
+ * commit.c (checkaddfile): Create a dead version for a new file
+ added to a branch. Fixes FIXCVS for tagdate tests.
+ * sanity.sh (tagdate): Update to expect correct results.
+ (death2, branch-after-import, join, ignore-on-branch): Ditto.
+
+2004-10-26 Derek Price <derek@ximbiot.com>
+
+ * client.c (connect_to_gserver): Avoid truncating error messages from
+ the GSSAPI server.
+ (Report from Dan Peterson <dbpete@aol.com>.)
+
+2004-10-26 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (import-quirks): Test an even branch number.
+
+2004-10-25 Derek Price <derek@ximbiot.com>
+
+ * import.c (import): Repair regex for regressions introduced in last
+ commit.
+ * sanity.sh (import-quirks): Test a few branch numbers import shouldn't
+ have a problem with.
+
+2004-10-25 Derek Price <derek@ximbiot.com>
+
+ * import.c (import): Anchor and simplify branch verification regex.
+ * sanity.sh (import-quirks): Test another pattern that should fail.
+
+2004-10-25 Mark D. Baushke <mdb@cvshome.org>
+
+ * sanity.sh (tagdate): Added some additional tests and FIXCVS
+ comments for dealing properly with a 'cvs add' of a file to
+ a branch that already exists on the mainline.
+ (Problem reported by Renny Barrett <rbarrett@curamsoftware.com>.)
+
+ * sanity.sh (getrlogdate): New shell function.
+ (tagdate-{13,14,16}): Use it to avoid 'sleep 60' by using
+ the exact 1.1.4.1 timestamp for tagdate-14 and tagdate-16.
+
+2004-10-22 Mark D. Baushke <mdb@cvshome.org>
+
+ * sanity.sh (tagdate): Fix typo.
+
+2004-10-19 Derek Price <derek@ximbiot.com>
+
+ * add.c (add): Avoid attempting to resurrect a dead rev 1.1.
+ * sanity.sh (resurrection): Add test for the above.
+ (Report from Dan Peterson <dbpete@aol.com>.)
+
+2004-10-14 Derek Price <derek@ximbiot.com>
+
+ * import.c (import): Verify branch specifications more thoroughly.
+ * sanity.sh (importb): Adapt to new error message.
+ (import-quirks): New test.
+
+2004-10-04 Derek Price <derek@ximbiot.com>
+
+ * cvs.h (CVSROOT_DFLT): Undef rather than defining to NULL.
+ * main.c (main): Untangle parsing of CVSROOT, eliminating several
+ variables in the process. Simplify xmalloc/sprintf with asnprintf.
+
+2004-10-01 Mark D. Baushke <mdb@cvshome.org>
+
+ * main.c (main): Initialize CVSroot before it is used.
+ (Report and patch by Martin Neitzel <neitzel@sco.gaertner.de>.)
+ * sanity.sh (status): Test it.
+
+2004-09-25 Mark D. Baushke <mdb@cvshome.org>
+
+ * sanity.sh (parseroot2): Correct two test names. Restore CVSROOT.
+
+ * sanity.sh (parseroot2): Expand dokeep inline.
+
+2004-09-24 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (tests): Add parseroot2.
+
+2004-09-24 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (parseroot2): New test for root parsing consistency.
+ (Original patch from Alexander Taler <dissent@cvshome.org>.)
+
+ * cvs.h (Name_Root, free_cvsroot_t, parse_cvsroot, local_cvsroot,
+ Create_Root, root_allow_add, root_allow_free, root_allow_ok): Move
+ these protos to...
+ * root.h: ...here.
+ * client.c (arg_should_not_be_sent_to_server), recurse.c
+ (start_recusrion, do_recursion): Use new Name_Root API.
+ * main.c (current_root): Remove global.
+ (set_root_directory): Set current_parsed_root directly.
+ (main): Use new Name_Root API. Restore deletion of root directories
+ list.
+ * root.c (Name_Root): Return a parsed cvsroot_t rather than a string.
+
+2004-09-23 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (depends_on_ssh, sshstdio): Don't use skip() to skip
+ remote-only tests.
+
+2004-09-23 Mark D. Baushke <mdb@cvshome.org>
+
+ * server.c (cvs_output, cvs_output_binary): fflush (stderr)
+ here to avoid problems with 'cvs status 2>&1'.
+ (Report by Frank Hemer <frank@hemer.org>.)
+
+2004-09-23 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (crerepos, sshstdio): Minor modifications to make use of
+ the new depends_on_?sh API.
+
+2004-09-23 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh: Accept new -e option to interpret non-fatal calls to skip
+ as errors.
+ (skip, depends_on_rsh, depends_on_ssh): New functions.
+
+2004-09-12 Mark D. Baushke <mdb@cvshome.org>
+
+ * rcs.c (RCS_checkout): Allow noexec to do checkouts when
+ server_active is true.
+ * sanity.sh (join7): Test above change (fixes a FIXCVS).
+
+2004-09-08 Mark D. Baushke <mdb@cvshome.org>
+
+ * sanity.sh (join7): Fix if-then-else conditional.
+
+ * server.c (server_updated): Deal with cvs -n update -jt1 -jt2
+ "protocol error: uncounted data discarded" problem.
+ * sanity.sh (join7): New test for this case.
+
+2004-08-24 Derek Price <derek@ximbiot.com>
+
+ * recurse.c (start_recursion): Don't shorten //. to / (use //).
+
+2004-08-24 Derek Price <derek@ximbiot.com>
+
+ * recurse.c (start_recursion): Strip trailing CWD indirections on
+ repository.
+ * sanity.sh (rstar-toplevel): Update to account for new behavior.
+ (Report from Dan Peterson <dbpete@aol.com>.)
+
+2004-08-24 Mark D. Baushke <mdb@cvshome.org>
+
+ * recurse.c (do_recursion): Correct test for calling
+ server_pause_check to occur when locktype != CVS_LOCK_WRITE.
+ (Patch suggested by Ian Lance Taylor <ian@wasabisystems.com>
+ in bug#198).
+
+2004-08-24 Derek Price <derek@ximbiot.com>
+
+ * rcs.c (translate_symtag): Prevent infinite loop.
+ * tag.c (tag_check_valid): Check tag syntax before searching for tags.
+ * sanity.sh (tag-space): Some tests for the above.
+ (Report from Dan Peterson <dbpete@aol.com>.)
+
+2004-08-24 Mark D. Baushke <mdb@cvshome.org>
+
+ * ignore.c (ignore_directory): Include the terminating NUL
+ character in the directory name comparison to avoid matching
+ substrings of directories by accident.
+ (Report and suggested fix from James E Wilson
+ <wilson@specifixinc.com>.)
+ * sanity.sh (modules4): Add some more tests testing the above
+ change.
+
+2004-08-17 Mark D. Baushke <mdb@cvshome.org>
+
+ * sanity.sh (sshstdio): Fix comment typo plus gratuitous
+ reformatting.
+
+ * client.c (handle_m): Workaround to deal with stdio getting put
+ into non-blocking via redirection of stderr and interaction with
+ ssh on some platforms. On those boxes, stdio can put stdout
+ unexpectedly into non-blocking mode which may lead to fwrite() or
+ fflush() failing with EAGAIN, but cvs not checking for the error.
+ (Patch suggested by Frank Hemer <frank@hemer.org>.)
+
+ * client.c (handle_e): Similar fix for stderr.
+ * sanity.sh (sshstdio): New test for non-blocking stdio via ssh.
+
+2004-08-11 Derek Price <derek@ximbiot.com>
+
+ * sanity.sh (basicc): Work around a problem in Linux 2.2 & Bash 2.05b
+ which prevents a `cd ..' from a deleted directory from working.
+ (Original patch from Matthew Ogilvie <mmo9317bd@mailcan.com>.)
+
+2004-06-22 Derek Price <derek@ximbiot.com>
+
+ * wrapper.c: Add explicit "void" return type to "wrap_clean_fmt_str"
+ definition.
+ (Patch from Conrad T. Pino <Conrad@Pino.com>.)
+
2004-06-09 Derek Price <derek@ximbiot.com>
* commit.c, filesubr.c, history.c, server.c, wrapper.c: Various
@@ -531,7 +1603,7 @@
* tag.c (tag_fileproc): Ditto.
* update.c (checkout_file): Ditto.
* server.c (server_updated): Do not buf_free (filebuf) here.
-
+
2004-02-13 Larry Jones <lawrence.jones@ugsplm.com>
* rcs.c (locate_rcs): Remove unused variables.
@@ -749,7 +1821,7 @@
"Protocol error: uncounted data discarded" messages in some
circumstances.
(Problem reported by "Jim.Hyslop" <Jim.Hyslop@Leitch.com>.)
-
+
2003-12-03 Derek Price <derek@ximbiot.com>
* sanity.sh (recase-8csss): rename to...
@@ -945,7 +2017,7 @@
CVSROOT files being in the way since the client skips destination
validity checks since it should be rare that a client is running
in client/server mode on the server and CVS has no current way to
- check if it is running on the server.
+ check if it is running on the server.
(check_repository-3): Test renamed to checkout_repository-3.
(dottedroot): New test to check that a CVSROOT with a "." in the
name will work.
@@ -1005,7 +2077,7 @@
2003-10-25 Mark D. Baushke <mdb@cvshome.org>
* sanity.sh (parseroot): Perform this test in a subdirectory.
- It should avoid problems on case-insensitive systems where
+ It should avoid problems on case-insensitive systems where
CVSROOT and cvsroot are the same directory (eg, MacOS X).
2003-10-24 Derek Price <derek@ximbiot.com>
@@ -1025,7 +2097,7 @@
* sanity.sh (join6): New testcase for above.
(Suggested by Paul Edwards, from somewhere in Australia.)
(import): Fix collateral damage.
-
+
2003-10-23 Derek Price <derek@ximbiot.com>
* sanity.sh (fail): Refer the user to the `TESTS' and `check.log' files
@@ -1046,7 +2118,7 @@
exists.
(Reported by Rodolfo Schulz de Lima <rodolfo@rodsoft.org>.)
* sanity.sh (admin): Test these changes.
-
+
2003-10-17 Mark D. Baushke <mdb@cvshome.org>
* admin.c (admin_fileproc): Force tag match on admin
@@ -1653,7 +2725,7 @@
rtag' as various parts of cvs "know" how to automatically branch files
(eg: cvs add). Trying to remember state is getting "Too Hard (TM)")
* sanity.sh (branches3): Test the CVS_LOCAL_BRANCH_NUM feature.
-
+
2003-03-04 Derek Price <derek@ximbiot.com>
* history.c (history_write): Remove unneeded O_CREAT in the call to
@@ -1708,7 +2780,7 @@
This bug was discovered and fixed for FreeBSD cvs. See v 1.21 of
<http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/cvs/src/rcs.c.diff>
- for more information.
+ for more information.
* sanity.sh (rcs4): Tests for same.
(Patch from Mark D. Baushke <mdb@cvshome.org>.)
diff --git a/contrib/cvs/src/Makefile.am b/contrib/cvs/src/Makefile.am
index c0ab617..63e6b18 100644
--- a/contrib/cvs/src/Makefile.am
+++ b/contrib/cvs/src/Makefile.am
@@ -1,8 +1,10 @@
## Process this file with automake to produce Makefile.in
# Makefile for GNU CVS program.
-# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+#
+# Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+#
+# Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+# and others.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/contrib/cvs/src/Makefile.in b/contrib/cvs/src/Makefile.in
index c3aa0fc..3765523 100644
--- a/contrib/cvs/src/Makefile.in
+++ b/contrib/cvs/src/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,9 +15,11 @@
@SET_MAKE@
# Makefile for GNU CVS program.
-# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+#
+# Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+#
+# Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+# and others.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -29,6 +31,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
+
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@@ -36,7 +39,6 @@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
-
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
@@ -50,6 +52,55 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+bin_PROGRAMS = cvs$(EXEEXT)
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/cvsbug.in ChangeLog
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = cvsbug
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_cvs_OBJECTS = add.$(OBJEXT) admin.$(OBJEXT) annotate.$(OBJEXT) \
+ buffer.$(OBJEXT) checkin.$(OBJEXT) checkout.$(OBJEXT) \
+ classify.$(OBJEXT) client.$(OBJEXT) commit.$(OBJEXT) \
+ create_adm.$(OBJEXT) cvsrc.$(OBJEXT) diff.$(OBJEXT) \
+ edit.$(OBJEXT) entries.$(OBJEXT) error.$(OBJEXT) \
+ expand_path.$(OBJEXT) fileattr.$(OBJEXT) filesubr.$(OBJEXT) \
+ find_names.$(OBJEXT) hardlink.$(OBJEXT) hash.$(OBJEXT) \
+ history.$(OBJEXT) ignore.$(OBJEXT) import.$(OBJEXT) \
+ lock.$(OBJEXT) log.$(OBJEXT) login.$(OBJEXT) logmsg.$(OBJEXT) \
+ main.$(OBJEXT) mkmodules.$(OBJEXT) modules.$(OBJEXT) \
+ myndbm.$(OBJEXT) no_diff.$(OBJEXT) parseinfo.$(OBJEXT) \
+ patch.$(OBJEXT) rcs.$(OBJEXT) rcscmds.$(OBJEXT) \
+ recurse.$(OBJEXT) release.$(OBJEXT) remove.$(OBJEXT) \
+ repos.$(OBJEXT) root.$(OBJEXT) run.$(OBJEXT) \
+ scramble.$(OBJEXT) server.$(OBJEXT) stack.$(OBJEXT) \
+ status.$(OBJEXT) subr.$(OBJEXT) tag.$(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
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(bin_SCRIPTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(cvs_SOURCES)
+DIST_SOURCES = $(cvs_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
@@ -105,7 +156,6 @@ RANLIB = @RANLIB@
ROFF = @ROFF@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
-
SHELL = /bin/sh
STRIP = @STRIP@
TEXI2DVI = @TEXI2DVI@
@@ -120,6 +170,8 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
@@ -133,6 +185,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
+mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
@@ -140,6 +193,7 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+with_default_rsh = @with_default_rsh@
# $(includeopt) is CVS specific and set by configure
# FIXME - This includes line is dependant on its order. This means there is
@@ -147,8 +201,6 @@ target_alias = @target_alias@
# try and remove naming ocnflicts and fix Automake to allow particular includes
# to be attached only to particular object files. Short term fix is either or.
INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/diff -I$(top_srcdir)/zlib $(includeopt)
-
-bin_PROGRAMS = cvs
bin_SCRIPTS = cvsbug
# The cvs executable
@@ -224,7 +276,6 @@ cvs_SOURCES = \
update.h \
watch.h
-
cvs_LDADD = \
../diff/libdiff.a \
../lib/libcvs.a \
@@ -245,99 +296,51 @@ EXTRA_DIST = \
build_src.com \
sanity.sh
-subdir = src
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = cvsbug
-bin_PROGRAMS = cvs$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS)
-
-am_cvs_OBJECTS = add.$(OBJEXT) admin.$(OBJEXT) annotate.$(OBJEXT) \
- buffer.$(OBJEXT) checkin.$(OBJEXT) checkout.$(OBJEXT) \
- classify.$(OBJEXT) client.$(OBJEXT) commit.$(OBJEXT) \
- create_adm.$(OBJEXT) cvsrc.$(OBJEXT) diff.$(OBJEXT) \
- edit.$(OBJEXT) entries.$(OBJEXT) error.$(OBJEXT) \
- expand_path.$(OBJEXT) fileattr.$(OBJEXT) filesubr.$(OBJEXT) \
- find_names.$(OBJEXT) hardlink.$(OBJEXT) hash.$(OBJEXT) \
- history.$(OBJEXT) ignore.$(OBJEXT) import.$(OBJEXT) \
- lock.$(OBJEXT) log.$(OBJEXT) login.$(OBJEXT) logmsg.$(OBJEXT) \
- main.$(OBJEXT) mkmodules.$(OBJEXT) modules.$(OBJEXT) \
- myndbm.$(OBJEXT) no_diff.$(OBJEXT) parseinfo.$(OBJEXT) \
- patch.$(OBJEXT) rcs.$(OBJEXT) rcscmds.$(OBJEXT) \
- recurse.$(OBJEXT) release.$(OBJEXT) remove.$(OBJEXT) \
- repos.$(OBJEXT) root.$(OBJEXT) run.$(OBJEXT) scramble.$(OBJEXT) \
- server.$(OBJEXT) stack.$(OBJEXT) status.$(OBJEXT) \
- subr.$(OBJEXT) tag.$(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
-cvs_LDFLAGS =
-SCRIPTS = $(bin_SCRIPTS)
-
-
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/add.Po ./$(DEPDIR)/admin.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/annotate.Po ./$(DEPDIR)/buffer.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/checkin.Po ./$(DEPDIR)/checkout.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/classify.Po ./$(DEPDIR)/client.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/commit.Po ./$(DEPDIR)/create_adm.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/cvsrc.Po ./$(DEPDIR)/diff.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/edit.Po ./$(DEPDIR)/entries.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/error.Po ./$(DEPDIR)/expand_path.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/fileattr.Po ./$(DEPDIR)/filesubr.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/find_names.Po ./$(DEPDIR)/hardlink.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/hash.Po ./$(DEPDIR)/history.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/ignore.Po ./$(DEPDIR)/import.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/lock.Po ./$(DEPDIR)/log.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/login.Po ./$(DEPDIR)/logmsg.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/mkmodules.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/modules.Po ./$(DEPDIR)/myndbm.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/no_diff.Po ./$(DEPDIR)/parseinfo.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/patch.Po ./$(DEPDIR)/rcs.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/rcscmds.Po ./$(DEPDIR)/recurse.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/release.Po ./$(DEPDIR)/remove.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/repos.Po ./$(DEPDIR)/root.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/run.Po ./$(DEPDIR)/scramble.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/server.Po ./$(DEPDIR)/stack.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/status.Po ./$(DEPDIR)/subr.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/tag.Po ./$(DEPDIR)/update.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/vers_ts.Po ./$(DEPDIR)/version.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/watch.Po ./$(DEPDIR)/wrapper.Po \
-@AMDEP_TRUE@ ./$(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 $@
-DIST_SOURCES = $(cvs_SOURCES)
-DIST_COMMON = $(srcdir)/Makefile.in ChangeLog Makefile.am cvsbug.in
-SOURCES = $(cvs_SOURCES)
-
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
-Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-cvsbug: $(top_builddir)/config.status cvsbug.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+cvsbug: $(top_builddir)/config.status $(srcdir)/cvsbug.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(bindir)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
- $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
@@ -345,8 +348,8 @@ uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@@ -354,16 +357,15 @@ clean-binPROGRAMS:
cvs$(EXEEXT): $(cvs_OBJECTS) $(cvs_DEPENDENCIES)
@rm -f cvs$(EXEEXT)
$(LINK) $(cvs_LDFLAGS) $(cvs_OBJECTS) $(cvs_LDADD) $(LIBS)
-binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(bindir)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \
- $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \
+ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
else :; fi; \
done
@@ -371,12 +373,12 @@ uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
+ -rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@@ -438,36 +440,20 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zlib.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
-@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-@am__fastdepCC_TRUE@ fi
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
-@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-@am__fastdepCC_TRUE@ fi
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
uninstall-info-am:
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
-
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
@@ -476,6 +462,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
+tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -487,10 +474,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
-
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -513,10 +501,6 @@ GTAGS:
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
@@ -530,7 +514,7 @@ distdir: $(DISTFILES)
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
@@ -549,9 +533,10 @@ check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-local
check: check-am
all-am: Makefile $(PROGRAMS) $(SCRIPTS)
-
installdirs:
- $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -571,7 +556,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@@ -591,6 +576,8 @@ dvi: dvi-am
dvi-am:
+html: html-am
+
info: info-am
info-am:
@@ -628,14 +615,15 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
clean-binPROGRAMS clean-generic ctags distclean \
distclean-compile distclean-generic 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 pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-binPROGRAMS \
- uninstall-binSCRIPTS uninstall-info-am
+ dvi-am html html-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 pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS \
+ uninstall-info-am
check-local: localcheck remotecheck
diff --git a/contrib/cvs/src/add.c b/contrib/cvs/src/add.c
index 4f3f55e..820121b 100644
--- a/contrib/cvs/src/add.c
+++ b/contrib/cvs/src/add.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (c) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
@@ -37,8 +42,9 @@ static int build_entry PROTO((const char *repository, const char *user,
static const char *const add_usage[] =
{
"Usage: %s %s [-k rcs-kflag] [-m message] files...\n",
- "\t-k\tUse \"rcs-kflag\" to add the file with the specified kflag.\n",
- "\t-m\tUse \"message\" for the creation log.\n",
+ "\t-k rcs-kflag\tUse \"rcs-kflag\" to add the file with the specified\n",
+ "\t\t\tkflag.\n",
+ "\t-m message\tUse \"message\" for the creation log.\n",
"(Specify the --help global option for a list of other help options)\n",
NULL
};
@@ -75,12 +81,12 @@ add (argc, argv)
switch (c)
{
case 'k':
- if (options)
- free (options);
+ if (options) free (options);
options = RCS_check_kflag (optarg);
break;
case 'm':
+ if (message) free (message);
message = xstrdup (optarg);
break;
case '?':
@@ -155,11 +161,17 @@ add (argc, argv)
int j;
if (argc == 0)
+ {
/* We snipped out all the arguments in the above sanity
check. We can just forget the whole thing (and we
better, because if we fired up the server and passed it
nothing, it would spit back a usage message). */
+ if (options)
+ free (options);
+ if (message)
+ free (message);
return err;
+ }
start_server ();
ign_setup ();
@@ -469,7 +481,25 @@ same name already exists in the repository.");
char *prev = previous_rev (vers->srcfile,
vers->vn_rcs);
int status;
- assert (prev != NULL);
+ if (prev == NULL)
+ {
+ /* There is no previous revision. Either:
+ *
+ * * Revision 1.1 was dead, as when a file was
+ * inititially added on a branch,
+ *
+ * or
+ *
+ * * All previous revisions have been deleted.
+ * For instance, via `admin -o'.
+ */
+ if (!really_quiet)
+ error (0, 0,
+"File `%s' has no previous revision to resurrect.",
+ finfo.fullname);
+ free (prev);
+ goto skip_this_file;
+ }
if (!quiet)
error (0, 0,
"Resurrecting file `%s' from revision %s.",
@@ -665,6 +695,8 @@ cannot resurrect %s; RCS file removed by second party", finfo.fullname);
server_checked_in (finfo.file, finfo.update_dir, repository);
#endif
}
+
+skip_this_file:
free (repository);
Entries_Close (entries);
@@ -745,11 +777,7 @@ add_directory (finfo)
error (0, errno, "cannot chdir to %s", finfo->fullname);
return 1;
}
-#ifdef SERVER_SUPPORT
if (!server_active && isfile (CVSADM))
-#else
- if (isfile (CVSADM))
-#endif
{
error (0, 0, "%s/%s already exists", finfo->fullname, CVSADM);
goto out;
@@ -818,7 +846,10 @@ add_directory (finfo)
fileattr_write ();
fileattr_free ();
if (attrs != NULL)
+ {
free (attrs);
+ attrs = NULL;
+ }
/*
* Set up an update list with a single title node for Update_Logfile
@@ -838,9 +869,7 @@ add_directory (finfo)
dellist (&ulist);
}
-#ifdef SERVER_SUPPORT
if (!server_active)
-#endif
Create_Admin (".", finfo->fullname, rcsdir, tag, date, nonbranch, 0, 1);
if (tag)
free (tag);
@@ -858,6 +887,8 @@ add_directory (finfo)
free (rcsdir);
free (message);
+ if (attrs != NULL)
+ free (attrs);
return 0;
@@ -865,6 +896,7 @@ out:
if (restore_cwd (&cwd, NULL))
error_exit ();
free_cwd (&cwd);
+ if (message) free (message);
if (rcsdir != NULL)
free (rcsdir);
return 0;
diff --git a/contrib/cvs/src/admin.c b/contrib/cvs/src/admin.c
index 05067b8..186e27c 100644
--- a/contrib/cvs/src/admin.c
+++ b/contrib/cvs/src/admin.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (c) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
@@ -379,17 +384,13 @@ admin (argc, argv)
/* The use of `cvs admin -k' is unrestricted. However, any other
option is restricted if the group CVS_ADMIN_GROUP exists on the
server. */
- if (
-# ifdef CLIENT_SUPPORT
- /* This is only "secure" on the server, since the user could edit the
- * RCS file on a local host, but some people like this kind of
- * check anyhow. The alternative would be to check only when
- * (server_active) rather than when not on the client.
- */
- !current_parsed_root->isremote &&
-# endif /* CLIENT_SUPPORT */
- !only_k_option
- && (grp = getgrnam(CVS_ADMIN_GROUP)) != NULL)
+ /* This is only "secure" on the server, since the user could edit the
+ * RCS file on a local host, but some people like this kind of
+ * check anyhow. The alternative would be to check only when
+ * (server_active) rather than when not on the client.
+ */
+ if (!current_parsed_root->isremote && !only_k_option &&
+ (grp = getgrnam(CVS_ADMIN_GROUP)) != NULL)
{
#ifdef HAVE_GETGROUPS
gid_t *grps;
@@ -816,6 +817,13 @@ admin_fileproc (callerdat, finfo)
{
tag = xstrdup (arg + 2);
rev = RCS_head (rcs);
+ if (!rev)
+ {
+ error (0, 0, "No head revision in archive file `%s'.",
+ rcs->path);
+ status = 1;
+ continue;
+ }
}
else
{
diff --git a/contrib/cvs/src/annotate.c b/contrib/cvs/src/annotate.c
index 8bf330f..d6d0acc 100644
--- a/contrib/cvs/src/annotate.c
+++ b/contrib/cvs/src/annotate.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (c) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
@@ -222,6 +227,7 @@ rannotate_proc (argc, argv, xwhere, mwhere, mfile, shorten, local, mname, msg)
{
error (0, errno, "cannot chdir to %s", repository);
free (repository);
+ free (where);
return (1);
}
/* End section which is identical to patch_proc. */
diff --git a/contrib/cvs/src/buffer.h b/contrib/cvs/src/buffer.h
index 11d9aeb..3459058 100644
--- a/contrib/cvs/src/buffer.h
+++ b/contrib/cvs/src/buffer.h
@@ -1,3 +1,17 @@
+/*
+ * Copyright (C) 1996-2005 The Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
/* Declarations concerning the buffer data structure. */
#if defined (SERVER_SUPPORT) || defined (CLIENT_SUPPORT)
diff --git a/contrib/cvs/src/checkin.c b/contrib/cvs/src/checkin.c
index 938b717..06d431f 100644
--- a/contrib/cvs/src/checkin.c
+++ b/contrib/cvs/src/checkin.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
@@ -60,7 +65,7 @@ Checkin (type, finfo, rev, tag, options, message)
*/
assert (finfo->rcs != NULL);
- switch (RCS_checkin (finfo->rcs, finfo->file, message, rev,
+ switch (RCS_checkin (finfo->rcs, finfo->file, message, rev, 0,
RCS_FLAGS_KEEPFILE))
{
case 0: /* everything normal */
@@ -74,7 +79,8 @@ Checkin (type, finfo, rev, tag, options, message)
changes is if the file contains RCS keywords. So we if
we are not expanding RCS keywords, we are done. */
- if (strcmp (options, "-V4") == 0) /* upgrade to V5 now */
+ if (options != NULL
+ && strcmp (options, "-V4") == 0) /* upgrade to V5 now */
options[0] = '\0';
/* FIXME: If PreservePermissions is on, RCS_cmp_file is
diff --git a/contrib/cvs/src/classify.c b/contrib/cvs/src/classify.c
index 7ce8235..8bb471d 100644
--- a/contrib/cvs/src/classify.c
+++ b/contrib/cvs/src/classify.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
@@ -279,7 +284,9 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
error (0, 0, "warning: %s was lost", finfo->fullname);
ret = T_CHECKOUT;
}
- else if (strcmp (vers->ts_user, vers->ts_rcs) == 0)
+ else if (!strcmp (vers->ts_user,
+ vers->ts_conflict
+ ? vers->ts_conflict : vers->ts_rcs))
{
/*
@@ -293,6 +300,8 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
if (vers->entdata->options &&
strcmp (vers->entdata->options, vers->options) != 0)
ret = T_CHECKOUT;
+ else if (vers->ts_conflict)
+ ret = T_CONFLICT;
else
{
sticky_ck (finfo, aflag, vers);
@@ -313,6 +322,13 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
else
ret = T_NEEDS_MERGE;
#else
+ /* Files with conflict markers and new timestamps fall through
+ * here, but they need to. T_CONFLICT is an error in
+ * commit_fileproc, whereas T_CONFLICT with conflict markers
+ * is caught but only warned about. Similarly, update_fileproc
+ * currently reregisters a file that was conflicted but lost
+ * its markers.
+ */
ret = T_MODIFIED;
sticky_ck (finfo, aflag, vers);
#endif
diff --git a/contrib/cvs/src/client.h b/contrib/cvs/src/client.h
index cdc880e..3a99f4f 100644
--- a/contrib/cvs/src/client.h
+++ b/contrib/cvs/src/client.h
@@ -1,3 +1,17 @@
+/*
+ * Copyright (C) 1994-2005 The Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
/* Interface between the client and the rest of CVS. */
/* Stuff shared with the server. */
@@ -119,11 +133,10 @@ send_files PROTO((int argc, char **argv, int local, int aflag,
/* Send an argument to the remote server. */
void
-send_arg PROTO((char *string));
+send_arg PROTO((const char *string));
/* Send a string of single-char options to the remote server, one by one. */
-void
-send_option_string PROTO((char *string));
+void send_options PROTO ((int argc, char * const *argv));
extern void send_a_repository PROTO ((const char *, const char *,
const char *));
diff --git a/contrib/cvs/src/create_adm.c b/contrib/cvs/src/create_adm.c
index bccb4a2..ccf744f 100644
--- a/contrib/cvs/src/create_adm.c
+++ b/contrib/cvs/src/create_adm.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
diff --git a/contrib/cvs/src/cvsrc.c b/contrib/cvs/src/cvsrc.c
index 9aed694..60de909 100644
--- a/contrib/cvs/src/cvsrc.c
+++ b/contrib/cvs/src/cvsrc.c
@@ -1,5 +1,10 @@
/*
- * Copyright (c) 1993 david d zuhn
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1993 david d zuhn
*
* Written by david d `zoo' zuhn while at Cygnus Support
*
@@ -120,9 +125,9 @@ read_cvsrc (argc, argv, cmdname)
if (found)
{
/* skip over command in the options line */
- for (optstart = strtok (line + command_len, "\t \n");
+ for (optstart = strtok (line + command_len, "\t \n\r");
optstart;
- optstart = strtok (NULL, "\t \n"))
+ optstart = strtok (NULL, "\t \n\r"))
{
new_argv [new_argc++] = xstrdup (optstart);
diff --git a/contrib/cvs/src/edit.c b/contrib/cvs/src/edit.c
index fe4c21f..4b1804a 100644
--- a/contrib/cvs/src/edit.c
+++ b/contrib/cvs/src/edit.c
@@ -32,7 +32,10 @@ onoff_fileproc (callerdat, finfo)
void *callerdat;
struct file_info *finfo;
{
+ char *watched = fileattr_get0 (finfo->file, "_watched");
fileattr_set (finfo->file, "_watched", turning_on ? "" : NULL);
+ if (watched != NULL)
+ free (watched);
return 0;
}
@@ -50,7 +53,12 @@ onoff_filesdoneproc (callerdat, err, repository, update_dir, entries)
List *entries;
{
if (setting_default)
+ {
+ char *watched = fileattr_get0 (NULL, "_watched");
fileattr_set (NULL, "_watched", turning_on ? "" : NULL);
+ if (watched != NULL)
+ free (watched);
+ }
return err;
}
@@ -357,12 +365,12 @@ edit_fileproc (callerdat, finfo)
static const char *const edit_usage[] =
{
- "Usage: %s %s [-lR] [files...]\n",
- "-l: Local directory only, not recursive\n",
- "-R: Process directories recursively\n",
- "-a: Specify what actions for temporary watch, one of\n",
- " edit,unedit,commit,all,none\n",
- "(Specify the --help global option for a list of other help options)\n",
+ "Usage: %s %s [-lR] [-a <action>]... [<file>]...\n",
+ "-l\tLocal directory only, not recursive.\n",
+ "-R\tProcess directories recursively (default).\n",
+ "-a\tSpecify action to register for temporary watch, one of:\n",
+ " \t`edit', `unedit', `commit', `all', or `none' (defaults to `all').\n",
+ "(Specify the --help global option for a list of other help options.)\n",
NULL
};
@@ -572,10 +580,10 @@ unedit_fileproc (callerdat, finfo)
static const char *const unedit_usage[] =
{
- "Usage: %s %s [-lR] [files...]\n",
- "-l: Local directory only, not recursive\n",
- "-R: Process directories recursively\n",
- "(Specify the --help global option for a list of other help options)\n",
+ "Usage: %s %s [-lR] [<file>]...\n",
+ "-l\tLocal directory only, not recursive.\n",
+ "-R\tProcess directories recursively (default).\n",
+ "(Specify the --help global option for a list of other help options.)\n",
NULL
};
@@ -1041,10 +1049,10 @@ notify_check (repository, update_dir)
static const char *const editors_usage[] =
{
- "Usage: %s %s [-lR] [files...]\n",
- "\t-l\tProcess this directory only (not recursive).\n",
- "\t-R\tProcess directories recursively.\n",
- "(Specify the --help global option for a list of other help options)\n",
+ "Usage: %s %s [-lR] [<file>]...\n",
+ "-l\tProcess this directory only (not recursive).\n",
+ "-R\tProcess directories recursively (default).\n",
+ "(Specify the --help global option for a list of other help options.)\n",
NULL
};
diff --git a/contrib/cvs/src/expand_path.c b/contrib/cvs/src/expand_path.c
index 5aa1063..1c960f3 100644
--- a/contrib/cvs/src/expand_path.c
+++ b/contrib/cvs/src/expand_path.c
@@ -1,5 +1,17 @@
/* expand_path.c -- expand environmental variables in passed in string
*
+ * Copyright (C) 1995-2005 The Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
* The main routine is expand_path(), it is the routine that handles
* the '~' character in four forms:
* ~name
@@ -97,16 +109,14 @@ expand_path (name, file, line)
const char *file;
int line;
{
- const char *s;
- char *d;
+ size_t s, d, p;
+ char *e;
char *mybuf = NULL;
size_t mybuf_size = 0;
char *buf = NULL;
size_t buf_size = 0;
- size_t doff;
-
char *result;
/* Sorry this routine is so ugly; it is a head-on collision
@@ -117,82 +127,74 @@ expand_path (name, file, line)
thusly. */
/* First copy from NAME to MYBUF, expanding $<foo> as we go. */
- s = name;
- d = mybuf;
- doff = d - mybuf;
- expand_string (&mybuf, &mybuf_size, doff + 1);
- d = mybuf + doff;
- while ((*d++ = *s))
+ s = d = 0;
+ while (name[s] != '\0')
{
- if (*s++ == '$')
+ if (name[s] == '$')
{
- char *p = d;
- char *e;
- int flag = (*s == '{');
-
- doff = d - mybuf;
- expand_string (&mybuf, &mybuf_size, doff + 1);
- d = mybuf + doff;
- for (; (*d++ = *s); s++)
+ p = d;
+ if (name[++s] == '{')
+ {
+ while (name[++s] != '}' && name[s] != '\0')
+ {
+ expand_string (&mybuf, &mybuf_size, p + 1);
+ mybuf[p++] = name[s];
+ }
+ if (name[s] != '\0') ++s;
+ }
+ else
{
- if (flag
- ? *s =='}'
- : isalnum ((unsigned char) *s) == 0 && *s != '_')
- break;
- doff = d - mybuf;
- expand_string (&mybuf, &mybuf_size, doff + 1);
- d = mybuf + doff;
+ while (isalnum ((unsigned char) name[s]) || name[s] == '_')
+ {
+ expand_string (&mybuf, &mybuf_size, p + 1);
+ mybuf[p++] = name[s++];
+ }
}
- *--d = '\0';
- e = expand_variable (&p[flag], file, line);
+ expand_string (&mybuf, &mybuf_size, p + 1);
+ mybuf[p] = '\0';
+ e = expand_variable (mybuf + d, file, line);
if (e)
{
- doff = d - mybuf;
- expand_string (&mybuf, &mybuf_size, doff + 1);
- d = mybuf + doff;
- for (d = &p[-1]; (*d++ = *e++);)
- {
- doff = d - mybuf;
- expand_string (&mybuf, &mybuf_size, doff + 1);
- d = mybuf + doff;
- }
- --d;
- if (flag && *s)
- s++;
+ p = strlen(e);
+ expand_string (&mybuf, &mybuf_size, d + p);
+ memcpy(mybuf + d, e, p);
+ d += p;
}
else
/* expand_variable has already printed an error message. */
goto error_exit;
}
- doff = d - mybuf;
- expand_string (&mybuf, &mybuf_size, doff + 1);
- d = mybuf + doff;
+ else
+ {
+ expand_string (&mybuf, &mybuf_size, d + 1);
+ mybuf[d++] = name[s++];
+ }
}
- doff = d - mybuf;
- expand_string (&mybuf, &mybuf_size, doff + 1);
- d = mybuf + doff;
- *d = '\0';
+ expand_string (&mybuf, &mybuf_size, d + 1);
+ mybuf[d++] = '\0';
/* Then copy from MYBUF to BUF, expanding ~. */
- s = mybuf;
- d = buf;
+ s = d = 0;
/* If you don't want ~username ~/ to be expanded simply remove
* This entire if statement including the else portion
*/
- if (*s++ == '~')
+ if (mybuf[s] == '~')
{
- char *t;
- char *p, *pstart;
- pstart = p = xstrdup (s);
- if (*pstart=='/' || *pstart==0)
- t = get_homedir ();
+ p = d;
+ while (mybuf[++s] != '/' && mybuf[s] != '\0')
+ {
+ expand_string (&buf, &buf_size, p + 1);
+ buf[p++] = name[s];
+ }
+ expand_string (&buf, &buf_size, p + 1);
+ buf[p] = '\0';
+
+ if (p == d)
+ e = get_homedir ();
else
{
#ifdef GETPWNAM_MISSING
- for (; *p!='/' && *p; p++)
- ;
- *p = 0;
if (line != 0)
error (0, 0,
"%s:%d:tilde expansion not supported on this system",
@@ -200,57 +202,34 @@ expand_path (name, file, line)
else
error (0, 0, "%s:tilde expansion not supported on this system",
file);
- return NULL;
+ goto error_exit;
#else
struct passwd *ps;
- for (; *p!='/' && *p; p++)
- ;
- *p = 0;
- ps = getpwnam (pstart);
- if (ps == 0)
+ ps = getpwnam (buf + d);
+ if (ps == NULL)
{
if (line != 0)
error (0, 0, "%s:%d: no such user %s",
- file, line, pstart);
+ file, line, buf + d);
else
- error (0, 0, "%s: no such user %s", file, pstart);
- return NULL;
+ error (0, 0, "%s: no such user %s", file, buf + d);
+ goto error_exit;
}
- t = ps->pw_dir;
+ e = ps->pw_dir;
#endif
}
- if (t == NULL)
+ if (e == NULL)
error (1, 0, "cannot find home directory");
- doff = d - buf;
- expand_string (&buf, &buf_size, doff + 1);
- d = buf + doff;
- while ((*d++ = *t++))
- {
- doff = d - buf;
- expand_string (&buf, &buf_size, doff + 1);
- d = buf + doff;
- }
- --d;
- s+=p-pstart;
- free (pstart);
- }
- else
- --s;
- /* Kill up to here */
- doff = d - buf;
- expand_string (&buf, &buf_size, doff + 1);
- d = buf + doff;
- while ((*d++ = *s++))
- {
- doff = d - buf;
- expand_string (&buf, &buf_size, doff + 1);
- d = buf + doff;
+ p = strlen(e);
+ expand_string (&buf, &buf_size, d + p);
+ memcpy(buf + d, e, p);
+ d += p;
}
- doff = d - buf;
- expand_string (&buf, &buf_size, doff + 1);
- d = buf + doff;
- *d = '\0';
+ /* Kill up to here */
+ p = strlen(mybuf + s) + 1;
+ expand_string (&buf, &buf_size, d + p);
+ memcpy(buf + d, mybuf + s, p);
/* OK, buf contains the value we want to return. Clean up and return
it. */
diff --git a/contrib/cvs/src/fileattr.c b/contrib/cvs/src/fileattr.c
index 9b10851..ca6bd0e 100644
--- a/contrib/cvs/src/fileattr.c
+++ b/contrib/cvs/src/fileattr.c
@@ -139,6 +139,7 @@ fileattr_read ()
"file attribute database corruption: tab missing in %s",
fname);
++p;
+ if (fileattr_default_attrs) free (fileattr_default_attrs);
fileattr_default_attrs = xstrdup (p);
}
else
@@ -589,6 +590,7 @@ fileattr_write ()
{
error (0, errno, "cannot make directory %s", repname);
(void) umask (omask);
+ free (fname);
free (repname);
return;
}
@@ -600,6 +602,7 @@ fileattr_write ()
{
error (0, errno, "cannot write %s", fname);
(void) umask (omask);
+ free (fname);
return;
}
}
diff --git a/contrib/cvs/src/find_names.c b/contrib/cvs/src/find_names.c
index cff0de1..5bfd895 100644
--- a/contrib/cvs/src/find_names.c
+++ b/contrib/cvs/src/find_names.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
diff --git a/contrib/cvs/src/hardlink.c b/contrib/cvs/src/hardlink.c
index 5cd9c37..ed05033 100644
--- a/contrib/cvs/src/hardlink.c
+++ b/contrib/cvs/src/hardlink.c
@@ -11,7 +11,9 @@
/* Collect and manage hardlink info associated with a particular file. */
#include "cvs.h"
-#include "hardlink.h"
+
+#ifdef PRESERVE_PERMISSIONS_SUPPORT
+# include "hardlink.h"
/* The structure currently used to manage hardlink info is a list.
Therefore, most of the functions which manipulate hardlink data
@@ -302,4 +304,4 @@ find_checkedout_proc (node, data)
return 0;
}
-
+#endif /* PRESERVE_PERMISSIONS_SUPPORT */
diff --git a/contrib/cvs/src/hardlink.h b/contrib/cvs/src/hardlink.h
index f9df344..b227968 100644
--- a/contrib/cvs/src/hardlink.h
+++ b/contrib/cvs/src/hardlink.h
@@ -17,6 +17,7 @@
when files are being checked out or updated. It is used only when
hardlinked files are being checked out. */
+#ifdef PRESERVE_PERMISSIONS_SUPPORT
struct hardlink_info
{
Ctype status; /* as returned from Classify_File() */
@@ -31,3 +32,4 @@ void update_hardlink_info PROTO ((const char *));
List *list_linked_files_on_disk PROTO ((char *));
int compare_linkage_lists PROTO ((List *, List *));
int find_checkedout_proc PROTO ((Node *, void *));
+#endif /* PRESERVE_PERMISSIONS_SUPPORT */
diff --git a/contrib/cvs/src/hash.c b/contrib/cvs/src/hash.c
index 4a97784..d9bc12c 100644
--- a/contrib/cvs/src/hash.c
+++ b/contrib/cvs/src/hash.c
@@ -1,5 +1,10 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS source distribution.
diff --git a/contrib/cvs/src/hash.h b/contrib/cvs/src/hash.h
index edfee46..a31fc5d 100644
--- a/contrib/cvs/src/hash.h
+++ b/contrib/cvs/src/hash.h
@@ -1,5 +1,10 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS source distribution.
diff --git a/contrib/cvs/src/history.c b/contrib/cvs/src/history.c
index 154c2de..78fa0fe 100644
--- a/contrib/cvs/src/history.c
+++ b/contrib/cvs/src/history.c
@@ -1,9 +1,18 @@
/*
+ * Copyright (C) 1994-2005 The Free Software Foundation, Inc.
*
- * You may distribute under the terms of the GNU General Public License
- * as specified in the README file that comes with the CVS 1.0 kit.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
*
- * **************** History of Users and Module ****************
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/* **************** History of Users and Module ****************
*
* LOGGING: Append record to "${CVSROOT}/CVSROOTADM/CVSROOTADM_HISTORY".
*
@@ -236,7 +245,7 @@ static short tz_local;
static time_t tz_seconds_east_of_GMT;
static char *tz_name = "+0000";
-char *logHistory = ALL_HISTORY_REC_TYPES;
+char *logHistory;
/* -r, -t, or -b options, malloc'd. These are "" if the option in
question is not specified or is overridden by another option. The
@@ -257,24 +266,24 @@ static struct hrec *last_backto;
we do. */
static char *rec_types;
-static int hrec_count;
-static int hrec_max;
+static size_t hrec_count;
+static size_t hrec_max;
static char **user_list; /* Ptr to array of ptrs to user names */
-static int user_max; /* Number of elements allocated */
-static int user_count; /* Number of elements used */
+static size_t user_max; /* Number of elements allocated */
+static size_t user_count; /* Number of elements used */
static struct file_list_str
{
char *l_file;
char *l_module;
} *file_list; /* Ptr to array file name structs */
-static int file_max; /* Number of elements allocated */
-static int file_count; /* Number of elements used */
+static size_t file_max; /* Number of elements allocated */
+static size_t file_count; /* Number of elements used */
static char **mod_list; /* Ptr to array of ptrs to module names */
-static int mod_max; /* Number of elements allocated */
-static int mod_count; /* Number of elements used */
+static size_t mod_max; /* Number of elements allocated */
+static size_t mod_count; /* Number of elements used */
static char *histfile; /* Ptr to the history file name */
@@ -442,7 +451,7 @@ history (argc, argv)
backto = xstrdup (optarg);
break;
case 'f': /* For specified file */
- save_file ("", optarg, (char *) NULL);
+ save_file (NULL, optarg, NULL);
break;
case 'm': /* Full module report */
if (!module_report++) report_count++;
@@ -451,7 +460,7 @@ history (argc, argv)
save_module (optarg);
break;
case 'p': /* For specified directory */
- save_file (optarg, "", (char *) NULL);
+ save_file (optarg, NULL, NULL);
break;
case 'r': /* Since specified Tag/Rev */
if (since_date || *since_tag || *backto)
@@ -534,7 +543,7 @@ history (argc, argv)
argc -= optind;
argv += optind;
for (i = 0; i < argc; i++)
- save_file ("", argv[i], (char *) NULL);
+ save_file (NULL, argv[i], NULL);
/* ================ Now analyze the arguments a bit */
@@ -724,9 +733,10 @@ history_write (type, update_dir, revs, name, repository)
* readonlyfs.
*/
return;
- if ( strchr(logHistory, type) == NULL )
+ if (strchr (logHistory, type) == NULL)
return;
- fname = xmalloc (strlen (current_parsed_root->directory) + sizeof (CVSROOTADM)
+ fname = xmalloc (strlen (current_parsed_root->directory)
+ + sizeof (CVSROOTADM)
+ sizeof (CVSROOTADM_HISTORY) + 3);
(void) sprintf (fname, "%s/%s/%s", current_parsed_root->directory,
CVSROOTADM, CVSROOTADM_HISTORY);
@@ -752,6 +762,11 @@ history_write (type, update_dir, revs, name, repository)
CLIENT_SERVER_STR, fname);
if (noexec)
goto out;
+
+ if (!history_lock (current_parsed_root->directory))
+ /* history_lock() will already have printed an error on failure. */
+ goto out;
+
fd = CVS_OPEN (fname, O_WRONLY | O_APPEND | OPEN_BINARY, 0666);
if (fd < 0)
{
@@ -789,7 +804,7 @@ history_write (type, update_dir, revs, name, repository)
if (save_cwd (&cwd))
error_exit ();
- if ( CVS_CHDIR (pwdir) < 0 || (homedir = xgetwd ()) == NULL)
+ if (CVS_CHDIR (pwdir) < 0 || (homedir = xgetwd ()) == NULL)
homedir = pwdir;
if (restore_cwd (&cwd, NULL))
@@ -896,6 +911,7 @@ history_write (type, update_dir, revs, name, repository)
error (1, errno, "cannot close history file: %s", fname);
free (workdir);
out:
+ clear_history_lock ();
free (fname);
}
@@ -910,7 +926,8 @@ save_user (name)
if (user_count == user_max)
{
user_max = xsum (user_max, USER_INCREMENT);
- if (size_overflow_p (xtimes (user_max, sizeof (char *))))
+ if (user_count == user_max
+ || size_overflow_p (xtimes (user_max, sizeof (char *))))
{
error (0, 0, "save_user: too many users");
return;
@@ -944,7 +961,8 @@ save_file (dir, name, module)
if (file_count == file_max)
{
file_max = xsum (file_max, FILE_INCREMENT);
- if (size_overflow_p (xtimes (file_max, sizeof (*fl))))
+ if (file_count == file_max
+ || size_overflow_p (xtimes (file_max, sizeof (*fl))))
{
error (0, 0, "save_file: too many files");
return;
@@ -952,7 +970,9 @@ save_file (dir, name, module)
file_list = xrealloc (file_list, xtimes (file_max, sizeof (*fl)));
}
fl = &file_list[file_count++];
- fl->l_file = cp = xmalloc (strlen (dir) + strlen (name) + 2);
+ fl->l_file = cp = xmalloc (dir ? strlen (dir) : 0
+ + name ? strlen (name) : 0
+ + 2);
fl->l_module = module;
if (dir && *dir)
@@ -989,7 +1009,8 @@ save_module (module)
if (mod_count == mod_max)
{
mod_max = xsum (mod_max, MODULE_INCREMENT);
- if (size_overflow_p (xtimes (mod_max, sizeof (char *))))
+ if (mod_count == mod_max
+ || size_overflow_p (xtimes (mod_max, sizeof (char *))))
{
error (0, 0, "save_module: too many modules");
return;
@@ -1142,9 +1163,13 @@ read_hrecs (fname)
{
struct hrec *old_head = hrec_head;
- hrec_max += HREC_INCREMENT;
- hrec_head = xrealloc ((char *) hrec_head,
- hrec_max * sizeof (struct hrec));
+ hrec_max = xsum (hrec_max, HREC_INCREMENT);
+ if (hrec_count == hrec_max
+ || size_overflow_p (xtimes (hrec_max, sizeof (struct hrec))))
+ error (1, 0, "Too many history records in history file.");
+
+ hrec_head = xrealloc (hrec_head,
+ xtimes (hrec_max, sizeof (struct hrec)));
if (last_since_tag)
last_since_tag = hrec_head + (last_since_tag - old_head);
if (last_backto)
@@ -1393,6 +1418,8 @@ select_hrec (hr)
if (within (cp, cp2))
{
hr->mod = fl->l_module;
+ if (cmpfile != NULL)
+ free (cmpfile);
break;
}
if (cmpfile != NULL)
diff --git a/contrib/cvs/src/history.h b/contrib/cvs/src/history.h
index fd65951..dadc421 100644
--- a/contrib/cvs/src/history.h
+++ b/contrib/cvs/src/history.h
@@ -1,6 +1,8 @@
/*
- * Copyright (c) 2003, Derek Price, Ximbiot <http://ximbiot.com>,
- * and the Free Software Foundation
+ * Copyright (C) 2003-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 2003-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
*
* You may distribute under the terms of the GNU General Public License
* as specified in the README file that comes with the CVS source
diff --git a/contrib/cvs/src/ignore.c b/contrib/cvs/src/ignore.c
index e9bcf79..65b2260 100644
--- a/contrib/cvs/src/ignore.c
+++ b/contrib/cvs/src/ignore.c
@@ -65,13 +65,11 @@ ign_setup ()
ign_add (tmp, 0);
free (tmp);
-#ifdef CLIENT_SUPPORT
/* The client handles another way, by (after it does its own ignore file
processing, and only if !ign_inhibit_server), letting the server
know about the files and letting it decide whether to ignore
them based on CVSROOOTADM_IGNORE. */
if (!current_parsed_root->isremote)
-#endif
{
char *file = xmalloc (strlen (current_parsed_root->directory) + sizeof (CVSROOTADM)
+ sizeof (CVSROOTADM_IGNORE) + 10);
@@ -237,10 +235,25 @@ ign_add (ign, hold)
free (ign_list[i]);
ign_hold = -1;
}
- s_ign_list = (char **) xmalloc (ign_count * sizeof (char *));
- for (i = 0; i < ign_count; i++)
- s_ign_list[i] = ign_list[i];
- s_ign_count = ign_count;
+ if (s_ign_list)
+ {
+ /* Don't save the ignore list twice - if there are two
+ * bangs in a local .cvsignore file then we don't want to
+ * save the new list the first bang created.
+ *
+ * We still need to free the "new" ignore list.
+ */
+ for (i = 0; i < ign_count; i++)
+ free (ign_list[i]);
+ }
+ else
+ {
+ /* Save the ignore list for later. */
+ s_ign_list = xmalloc (ign_count * sizeof (char *));
+ for (i = 0; i < ign_count; i++)
+ s_ign_list[i] = ign_list[i];
+ s_ign_count = ign_count;
+ }
ign_count = 1;
/* Always ignore the "CVS" directory. */
ign_list[0] = xstrdup ("CVS");
@@ -331,7 +344,7 @@ ignore_directory (name)
i = dir_ign_current;
while (i--)
{
- if (strncmp (name, dir_ign_list[i], strlen (dir_ign_list[i])) == 0)
+ if (strncmp (name, dir_ign_list[i], strlen (dir_ign_list[i])+1) == 0)
return 1;
}
diff --git a/contrib/cvs/src/modules.c b/contrib/cvs/src/modules.c
index a784a86..eed551e 100644
--- a/contrib/cvs/src/modules.c
+++ b/contrib/cvs/src/modules.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source
@@ -131,7 +136,6 @@ my_module (db, mname, m_type, msg, callback_proc, where, shorten,
char *mwhere = NULL;
char *mfile = NULL;
char *spec_opt = NULL;
- char *xvalue = NULL;
int alias = 0;
datum key, val;
char *cp;
@@ -371,6 +375,7 @@ my_module (db, mname, m_type, msg, callback_proc, where, shorten,
/* mwhere gets just the module name */
mwhere = xstrdup (mname);
mfile = cp + 1;
+ assert (strlen (mfile));
/* put the / back in mname */
*cp = '/';
@@ -744,7 +749,7 @@ module `%s' is a request for a file in a module which is not a directory",
err += run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL);
free (expanded_path);
}
- free (real_prog);
+ if (real_prog) free (real_prog);
}
}
@@ -765,8 +770,6 @@ module `%s' is a request for a file in a module which is not a directory",
if (value != NULL)
free (value);
- if (xvalue != NULL)
- free (xvalue);
return (err);
}
diff --git a/contrib/cvs/src/myndbm.c b/contrib/cvs/src/myndbm.c
index a5afcce..cb99cc2 100644
--- a/contrib/cvs/src/myndbm.c
+++ b/contrib/cvs/src/myndbm.c
@@ -1,5 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
diff --git a/contrib/cvs/src/myndbm.h b/contrib/cvs/src/myndbm.h
index 2bce739..de23519 100644
--- a/contrib/cvs/src/myndbm.h
+++ b/contrib/cvs/src/myndbm.h
@@ -1,3 +1,17 @@
+/*
+ * Copyright (C) 1994-2005 The Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
#ifdef MY_NDBM
#define DBLKSIZ 4096
diff --git a/contrib/cvs/src/no_diff.c b/contrib/cvs/src/no_diff.c
index ebddcd3..45847a1 100644
--- a/contrib/cvs/src/no_diff.c
+++ b/contrib/cvs/src/no_diff.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
@@ -15,6 +20,7 @@
*/
#include "cvs.h"
+#include <assert.h>
int
No_Difference (finfo, vers)
@@ -71,6 +77,7 @@ No_Difference (finfo, vers)
/* update the entdata pointer in the vers_ts structure */
p = findnode (finfo->entries, finfo->file);
+ assert (p);
vers->entdata = p->data;
ret = 0;
diff --git a/contrib/cvs/src/release.c b/contrib/cvs/src/release.c
index 2d8c72c..27a16c0 100644
--- a/contrib/cvs/src/release.c
+++ b/contrib/cvs/src/release.c
@@ -1,4 +1,18 @@
/*
+ * Copyright (C) 1994-2005 The Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/*
* Release: "cancel" a checkout in the history log.
*
* - Enter a line in the history log indicating the "release". - If asked to,
@@ -67,7 +81,6 @@ release (argc, argv)
{
FILE *fp;
int i, c;
- char *repository;
char *line = NULL;
size_t line_allocated = 0;
char *update_cmd;
@@ -124,8 +137,12 @@ release (argc, argv)
+ 1 + 3 + 3 + 16 + 1);
sprintf (update_cmd, "%s %s%s-n -q -d %s update",
program_path,
+#if defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT)
cvsauthenticate ? "-a " : "",
cvsencrypt ? "-x " : "",
+#else
+ "", "",
+#endif
current_parsed_root->original);
#ifdef CLIENT_SUPPORT
@@ -173,11 +190,9 @@ release (argc, argv)
continue;
}
- repository = Name_Repository ((char *) NULL, (char *) NULL);
-
if (!really_quiet)
{
- int line_length;
+ int line_length, status;
/* The "release" command piggybacks on "update", which
does the real work of finding out if anything is not
@@ -204,10 +219,10 @@ release (argc, argv)
complain and go on to the next arg. Especially, we do
not want to delete the local copy, since it's obviously
not what the user thinks it is. */
- if ((pclose (fp)) != 0)
+ status = pclose (fp);
+ if (status != 0)
{
- error (0, 0, "unable to release `%s'", thisarg);
- free (repository);
+ error (0, 0, "unable to release `%s' (%d)", thisarg, status);
if (restore_cwd (&cwd, NULL))
error_exit ();
continue;
@@ -222,7 +237,6 @@ release (argc, argv)
{
(void) fprintf (stderr, "** `%s' aborted by user choice.\n",
cvs_cmd_name);
- free (repository);
if (restore_cwd (&cwd, NULL))
error_exit ();
continue;
@@ -236,9 +250,8 @@ release (argc, argv)
CVS/Entries file in the wrong directory. See release-17
through release-23. */
- free (repository);
if (restore_cwd (&cwd, NULL))
- exit (EXIT_FAILURE);
+ error_exit ();
if (1
#ifdef CLIENT_SUPPORT
@@ -255,7 +268,7 @@ release (argc, argv)
argv[2] = NULL;
err += unedit (argc, argv);
if (restore_cwd (&cwd, NULL))
- exit (EXIT_FAILURE);
+ error_exit ();
}
#ifdef CLIENT_SUPPORT
@@ -293,7 +306,7 @@ release (argc, argv)
err += get_server_responses ();
if (restore_cwd (&cwd, NULL))
- exit (EXIT_FAILURE);
+ error_exit ();
}
#endif /* CLIENT_SUPPORT */
}
diff --git a/contrib/cvs/src/remove.c b/contrib/cvs/src/remove.c
index 2a3545a..a09cfd4 100644
--- a/contrib/cvs/src/remove.c
+++ b/contrib/cvs/src/remove.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
diff --git a/contrib/cvs/src/repos.c b/contrib/cvs/src/repos.c
index 2c7a3bc..202d92d 100644
--- a/contrib/cvs/src/repos.c
+++ b/contrib/cvs/src/repos.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
diff --git a/contrib/cvs/src/root.c b/contrib/cvs/src/root.c
index 05aa0bd..8e2380f 100644
--- a/contrib/cvs/src/root.c
+++ b/contrib/cvs/src/root.c
@@ -1,6 +1,10 @@
/*
- * Copyright (c) 1992, Mark D. Baushke
- * Copyright (c) 2002, Derek R. Price
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Poritons Copyright (c) 1992, Mark D. Baushke
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS source distribution.
@@ -11,6 +15,7 @@
*/
#include "cvs.h"
+#include <assert.h>
#include "getline.h"
/* Printable names for things in the current_parsed_root->method enum variable.
@@ -18,18 +23,19 @@
const char method_names[][16] = {
"undefined", "local", "server (rsh)", "pserver",
- "kserver", "gserver", "ext", "fork"
+ "kserver", "gserver", "ext", "extssh", "fork"
};
#ifndef DEBUG
-char *
+cvsroot_t *
Name_Root (dir, update_dir)
- char *dir;
- char *update_dir;
+ const char *dir;
+ const char *update_dir;
{
FILE *fpin;
- char *ret, *xupdate_dir;
+ cvsroot_t *ret;
+ const char *xupdate_dir;
char *root = NULL;
size_t root_allocated = 0;
char *tmp;
@@ -87,7 +93,7 @@ Name_Root (dir, update_dir)
goto out;
}
fclose (fpin);
- cp = root + (len - 1);
+ cp = root + len - 1;
if (*cp == '\n')
*cp = '\0'; /* strip the newline */
@@ -96,43 +102,34 @@ Name_Root (dir, update_dir)
* absolute pathname or specify a remote server.
*/
- if (
-#ifdef CLIENT_SUPPORT
- (strchr (root, ':') == NULL) &&
-#endif
- ! isabsolute (root))
+ ret = parse_cvsroot (root);
+ if (ret == NULL)
{
error (0, 0, "in directory %s:", xupdate_dir);
error (0, 0,
- "ignoring %s because it does not contain an absolute pathname.",
+ "ignoring %s because it does not contain a valid root.",
CVSADM_ROOT);
- ret = NULL;
goto out;
}
-#ifdef CLIENT_SUPPORT
- if ((strchr (root, ':') == NULL) && !isdir (root))
-#else /* ! CLIENT_SUPPORT */
- if (!isdir (root))
-#endif /* CLIENT_SUPPORT */
+ if (!ret->isremote && !isdir (ret->directory))
{
error (0, 0, "in directory %s:", xupdate_dir);
error (0, 0,
"ignoring %s because it specifies a non-existent repository %s",
CVSADM_ROOT, root);
+ free_cvsroot_t (ret);
ret = NULL;
goto out;
}
- /* allocate space to return and fill it in */
- strip_trailing_slashes (root);
- ret = xstrdup (root);
+
out:
free (cvsadm);
free (tmp);
if (root != NULL)
free (root);
- return (ret);
+ return ret;
}
@@ -293,6 +290,7 @@ new_cvsroot_t ()
newroot->original = NULL;
newroot->method = null_method;
+ newroot->isremote = 0;
#ifdef CLIENT_SUPPORT
newroot->username = NULL;
newroot->password = NULL;
@@ -301,7 +299,6 @@ new_cvsroot_t ()
newroot->directory = NULL;
newroot->proxy_hostname = NULL;
newroot->proxy_port = 0;
- newroot->isremote = 0;
#endif /* CLIENT_SUPPORT */
return newroot;
@@ -376,6 +373,8 @@ parse_cvsroot (root_in)
int check_hostname, no_port, no_password;
#endif /* CLIENT_SUPPORT */
+ assert (root_in);
+
/* allocate some space */
newroot = new_cvsroot_t();
@@ -411,7 +410,7 @@ parse_cvsroot (root_in)
* We don't handle these, but we like to try and warn the user that
* they are being ignored.
*/
- if (p = strchr (method, ';'))
+ if ((p = strchr (method, ';')) != NULL)
{
*p++ = '\0';
if (!really_quiet)
@@ -457,10 +456,7 @@ parse_cvsroot (root_in)
: local_method);
}
-#ifdef CLIENT_SUPPORT
newroot->isremote = (newroot->method != local_method);
-#endif /* CLIENT_SUPPORT */
-
if ((newroot->method != local_method)
&& (newroot->method != fork_method))
@@ -743,6 +739,8 @@ normalize_cvsroot (root)
char *p, *hostname, *username;
char port_s[64];
+ assert (root && root->hostname && root->directory);
+
/* get the appropriate port string */
sprintf (port_s, "%d", get_cvs_port_number (root));
diff --git a/contrib/cvs/src/root.h b/contrib/cvs/src/root.h
index b812eef..b6edec4 100644
--- a/contrib/cvs/src/root.h
+++ b/contrib/cvs/src/root.h
@@ -1,7 +1,11 @@
/*
- * Copyright (c) 2001, Derek Price and others
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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.
@@ -18,6 +22,7 @@ typedef enum {
kserver_method,
gserver_method,
ext_method,
+ extssh_method,
fork_method
} CVSmethod;
extern const char method_names[][16]; /* change this in root.c if you change
@@ -27,6 +32,7 @@ typedef struct cvsroot_s {
char *original; /* The complete source CVSroot string. */
CVSmethod method; /* One of the enum values above. */
char *directory; /* The directory name. */
+ unsigned char isremote; /* Nonzero if we are doing remote access. */
#ifdef CLIENT_SUPPORT
char *username; /* The username or NULL if method == local. */
char *password; /* The password or NULL if method == local. */
@@ -37,6 +43,14 @@ typedef struct cvsroot_s {
* used.
*/
int proxy_port; /* The port of the proxy or zero, as above. */
- unsigned char isremote; /* Nonzero if we are doing remote access. */
#endif /* CLIENT_SUPPORT */
} cvsroot_t;
+
+cvsroot_t *Name_Root PROTO((const char *dir, const char *update_dir));
+void free_cvsroot_t PROTO((cvsroot_t *root_in));
+cvsroot_t *parse_cvsroot PROTO((const char *root));
+cvsroot_t *local_cvsroot PROTO((const char *dir));
+void Create_Root PROTO((const char *dir, const char *rootdir));
+void root_allow_add PROTO ((char *));
+void root_allow_free PROTO ((void));
+int root_allow_ok PROTO ((char *));
diff --git a/contrib/cvs/src/run.c b/contrib/cvs/src/run.c
index b03d683..98ae911 100644
--- a/contrib/cvs/src/run.c
+++ b/contrib/cvs/src/run.c
@@ -36,7 +36,19 @@ extern char *strtok ();
*/
static char **run_argv;
static int run_argc;
-static int run_argc_allocated;
+static size_t run_argc_allocated;
+
+
+
+void
+run_arg_free_p (int argc, char **argv)
+{
+ int i;
+ for (i = 0; i < argc; i++)
+ free (argv[i]);
+}
+
+
/* VARARGS */
void
@@ -44,18 +56,10 @@ run_setup (prog)
const char *prog;
{
char *cp;
- int i;
char *run_prog;
/* clean out any malloc'ed values from run_argv */
- for (i = 0; i < run_argc; i++)
- {
- if (run_argv[i])
- {
- free (run_argv[i]);
- run_argv[i] = (char *) 0;
- }
- }
+ run_arg_free_p (run_argc, run_argv);
run_argc = 0;
run_prog = xstrdup (prog);
@@ -73,22 +77,35 @@ run_arg (s)
run_add_arg (s);
}
-static void
-run_add_arg (s)
+
+
+void
+run_add_arg_p (iargc, iarg_allocated, iargv, s)
+ int *iargc;
+ size_t *iarg_allocated;
+ char ***iargv;
const char *s;
{
/* allocate more argv entries if we've run out */
- if (run_argc >= run_argc_allocated)
+ if (*iargc >= *iarg_allocated)
{
- run_argc_allocated += 50;
- run_argv = (char **) xrealloc ((char *) run_argv,
- run_argc_allocated * sizeof (char **));
+ *iarg_allocated += 50;
+ *iargv = xrealloc (*iargv, *iarg_allocated * sizeof (char **));
}
if (s)
- run_argv[run_argc++] = xstrdup (s);
+ (*iargv)[(*iargc)++] = xstrdup (s);
else
- run_argv[run_argc] = (char *) 0; /* not post-incremented on purpose! */
+ (*iargv)[*iargc] = NULL; /* not post-incremented on purpose! */
+}
+
+
+
+static void
+run_add_arg (s)
+ const char *s;
+{
+ run_add_arg_p (&run_argc, &run_argc_allocated, &run_argv, s);
}
@@ -400,11 +417,107 @@ run_popen (cmd, mode)
return (popen (cmd, mode));
}
+
+
+/* Work around an OpenSSH problem: it can put its standard file
+ descriptors into nonblocking mode, which will mess us up if we
+ share file descriptions with it. The simplest workaround is
+ to create an intervening process between OpenSSH and the
+ actual stderr. */
+
+static void
+work_around_openssh_glitch (void)
+{
+ pid_t pid;
+ int stderr_pipe[2];
+ struct stat sb;
+
+ /* Do nothing unless stderr is a file that is affected by
+ nonblocking mode. */
+ if (!(fstat (STDERR_FILENO, &sb) == 0
+ && (S_ISFIFO (sb.st_mode) || S_ISSOCK (sb.st_mode)
+ || S_ISCHR (sb.st_mode) || S_ISBLK (sb.st_mode))))
+ return;
+
+ if (pipe (stderr_pipe) < 0)
+ error (1, errno, "cannot create pipe");
+ pid = fork ();
+ if (pid < 0)
+ error (1, errno, "cannot fork");
+ if (pid != 0)
+ {
+ /* Still in child of original process. Act like "cat -u". */
+ char buf[1 << 13];
+ ssize_t inbytes;
+ pid_t w;
+ int status;
+
+ if (close (stderr_pipe[1]) < 0)
+ error (1, errno, "cannot close pipe");
+
+ while ((inbytes = read (stderr_pipe[0], buf, sizeof buf)) != 0)
+ {
+ size_t outbytes = 0;
+
+ if (inbytes < 0)
+ {
+ if (errno == EINTR)
+ continue;
+ error (1, errno, "reading from pipe");
+ }
+
+ do
+ {
+ ssize_t w = write (STDERR_FILENO,
+ buf + outbytes, inbytes - outbytes);
+ if (w < 0)
+ {
+ if (errno == EINTR)
+ w = 0;
+ if (w < 0)
+ _exit (1);
+ }
+ outbytes += w;
+ }
+ while (inbytes != outbytes);
+ }
+
+ /* Done processing output from grandchild. Propagate
+ its exit status back to the parent. */
+ while ((w = waitpid (pid, &status, 0)) == -1 && errno == EINTR)
+ continue;
+ if (w < 0)
+ error (1, errno, "waiting for child");
+ if (!WIFEXITED (status))
+ {
+ if (WIFSIGNALED (status))
+ raise (WTERMSIG (status));
+ error (1, errno, "child did not exit cleanly");
+ }
+ _exit (WEXITSTATUS (status));
+ }
+
+ /* Grandchild of original process. */
+ if (close (stderr_pipe[0]) < 0)
+ error (1, errno, "cannot close pipe");
+
+ if (stderr_pipe[1] != STDERR_FILENO)
+ {
+ if (dup2 (stderr_pipe[1], STDERR_FILENO) < 0)
+ error (1, errno, "cannot dup2 pipe");
+ if (close (stderr_pipe[1]) < 0)
+ error (1, errno, "cannot close pipe");
+ }
+}
+
+
+
int
-piped_child (command, tofdp, fromfdp)
+piped_child (command, tofdp, fromfdp, fix_stderr)
const char **command;
int *tofdp;
int *fromfdp;
+ int fix_stderr;
{
int pid;
int to_child_pipe[2];
@@ -422,11 +535,7 @@ piped_child (command, tofdp, fromfdp)
setmode (from_child_pipe[1], O_BINARY);
#endif
-#ifdef HAVE_VFORK
- pid = vfork ();
-#else
pid = fork ();
-#endif
if (pid < 0)
error (1, errno, "cannot fork");
if (pid == 0)
@@ -440,7 +549,10 @@ piped_child (command, tofdp, fromfdp)
if (dup2 (from_child_pipe[1], STDOUT_FILENO) < 0)
error (1, errno, "cannot dup2 pipe");
- /* Okay to cast out const below - execvp don't return anyhow. */
+ if (fix_stderr)
+ work_around_openssh_glitch ();
+
+ /* Okay to cast out const below - execvp don't return nohow. */
execvp ((char *)command[0], (char **)command);
error (1, errno, "cannot exec %s", command[0]);
}
diff --git a/contrib/cvs/src/sanity.sh b/contrib/cvs/src/sanity.sh
index acbb8d0..ae0580e 100755
--- a/contrib/cvs/src/sanity.sh
+++ b/contrib/cvs/src/sanity.sh
@@ -22,7 +22,7 @@
usage ()
{
echo "Usage: `basename $0` --help"
- echo "Usage: `basename $0` [-klr] [-f FROM-TEST] [-h HOSTNAME] CVS-TO-TEST [TESTS-TO-RUN...]"
+ echo "Usage: `basename $0` [-eklrv] [-f FROM-TEST] [-h HOSTNAME] CVS-TO-TEST [TESTS-TO-RUN...]"
}
exit_usage ()
@@ -35,22 +35,27 @@ exit_help ()
{
usage
echo
- echo "-H|--help display this text"
- echo "-l|--link-root"
- echo " test CVS using a symlink to a real CVSROOT"
- echo "-r|--remote test remote instead of local cvs"
+ echo "-H|--help Display this text."
+ echo "-e|--skipfail Treat tests that would otherwise be nonfatally skipped"
+ echo " for reasons like missing tools as failures, exiting"
+ echo " with an error message. Also treat warnings as"
+ echo " failures."
+ echo "-f FROM-TEST Run TESTS-TO-RUN, skipping all tests in the list before"
+ echo " FROM-TEST."
echo "-h HOSTNAME Use :ext:HOSTNAME to run remote tests rather than"
echo " :fork:. Implies --remote and assumes that \$TESTDIR"
echo " resolves to the same directory on both the client and"
echo " the server."
- echo "-k|--keep try to keep directories created by individual tests"
- echo " around, exiting after the first test which supports"
- echo " --keep"
- echo "-f FROM-TEST run TESTS-TO-RUN, skipping all tests in the list before"
- echo " FROM-TEST"
+ echo "-k|--keep Try to keep directories created by individual tests"
+ echo " around, exiting after the first test which supports"
+ echo " --keep."
+ echo "-l|--link-root"
+ echo " Test CVS using a symlink to a real CVSROOT."
+ echo "-r|--remote Test remote instead of local cvs."
+ echo "-v|--verbose List test names as they are executed."
echo
- echo "CVS-TO-TEST the path to the CVS executable to be tested"
- echo "TESTS-TO-RUN the names of the tests to run (defaults to all tests)"
+ echo "CVS-TO-TEST The path to the CVS executable to be tested."
+ echo "TESTS-TO-RUN The names of the tests to run (defaults to all tests)."
exit 2
}
@@ -59,6 +64,10 @@ exit_help ()
# required to make this script work properly.
unset CVSREAD
+# This will cause malloc to run slower but should also catch some common errors
+# when CVS is linked with glibc 2.x.
+MALLOC_CHECK_=2; export MALLOC_CHECK_
+
# We want to invoke a predictable set of i18n behaviors, not whatever
# the user running this script might have set.
# In particular:
@@ -71,6 +80,14 @@ LC_ALL=C
export LC_ALL
+#
+# Initialize the test counts.
+#
+passed=0
+skipped=0
+warnings=0
+
+
#
# read our options
@@ -80,7 +97,9 @@ unset remotehost
keep=false
linkroot=false
remote=false
-while getopts f:h:Hklr-: option ; do
+skipfail=false
+verbose=false
+while getopts ef:h:Hklrv-: option ; do
# convert the long opts to short opts
if test x$option = x-; then
case "$OPTARG" in
@@ -100,12 +119,23 @@ while getopts f:h:Hklr-: option ; do
option=k;
OPTARG=
;;
+ s|sk|ski|skip|skipf|skipfa|skipfai|skipfail)
+ option=e
+ OPTARG=
+ ;;
+ v|ve|ver|verb|verbo|verbos|verbose)
+ option=v
+ OPTARG=
+ ;;
*)
option=\?
OPTARG=
esac
fi
case "$option" in
+ e)
+ skipfail=:
+ ;;
f)
fromtest="$OPTARG"
;;
@@ -133,6 +163,9 @@ while getopts f:h:Hklr-: option ; do
r)
remote=:
;;
+ v)
+ verbose=:
+ ;;
\?)
exit_usage
;;
@@ -183,7 +216,8 @@ echo 'This test should produce no other output than this message, and a final "O
echo '(Note that the test can take an hour or more to run and periodically stops'
echo 'for as long as one minute. Do not assume there is a problem just because'
echo 'nothing seems to happen for a long time. If you cannot live without'
-echo "running status, try the command: \`tail -f check.log' from another window.)"
+echo 'running status, use the -v option or try the command:'
+echo "\`tail -f check.log' from another window.)"
# Regexp to match what CVS will call itself in output that it prints.
# FIXME: we don't properly quote this--if the name contains . we'll
@@ -191,11 +225,7 @@ echo "running status, try the command: \`tail -f check.log' from another window.
# special characters we are probably in big trouble.
PROG=`basename ${testcvs}`
-# Regexp to match an author name. I'm not really sure what characters
-# should be here. a-zA-Z obviously. People complained when 0-9 were
-# not allowed in usernames. Other than that I'm not sure.
-username="[-a-zA-Z0-9][-a-zA-Z0-9]*"
-author="[-a-zA-Z0-9][-a-zA-Z0-9]*"
+# Match the hostname
hostname="[-_.a-zA-Z0-9]*"
# Regexp to match the name of a temporary file (from cvs_temp_name).
@@ -211,11 +241,41 @@ RFCDATE_EPOCH="1 Jan 1970 00:00:00 -0000"
# than diff does
DATE="[a-zA-Z]* [a-zA-Z]* [ 1-3][0-9] [0-9:]* [0-9]*"
+# Which directories should Which and find_tool search for executables?
+SEARCHPATH=$PATH:/usr/local/bin:/usr/contrib/bin:/usr/contrib:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin:/sw/bin:/usr/pkg/bin
+
+# Do not assume that `type -p cmd` is portable
+# Usage: Which [-a] [-x|-f|-r] prog [$SEARCHPATH:/with/directories:/to/search]
+Which() {
+ # Optional first argument for file type, defaults to -x.
+ # Second argument is the file or directory to be found.
+ # Third argument is the PATH to search.
+ # By default, print only the first file that matches,
+ # -a will cause all matches to be printed.
+ notevery=:
+ if [ "x$1" = "x-a" ]; then notevery=false; shift; fi
+ case "$1" in
+ -*) t=$1; shift ;;
+ *) t=-x ;;
+ esac
+ case "$1" in
+ # FIXME: Someday this may need to be fixed
+ # to deal better with C:\some\path\to\ssh values...
+ /*) test $t $1 && echo $1 ;;
+ *) for d in `IFS=:; echo ${2-$SEARCHPATH}`
+ do
+ test $t $d/$1 && { echo $d/$1; if $notevery; then break; fi; }
+ done
+ ;;
+ esac
+}
+
+
# On cygwin32, we may not have /bin/sh.
if test -r /bin/sh; then
TESTSHELL="/bin/sh"
else
- TESTSHELL=`type -p sh 2>/dev/null`
+ TESTSHELL=`Which -f sh`
if test ! -r "$TESTSHELL"; then
TESTSHELL="/bin/sh"
fi
@@ -245,6 +305,12 @@ fi
# which makes for a lot of failed `tail -f' attempts.
touch check.log
+# Workaround any X11Forwarding by ssh. Otherwise this text:
+# Warning: No xauth data; using fake authentication data for X11 forwarding.
+# has been known to end up in the test results below
+# causing the test to fail.
+[ -n "$DISPLAY" ] && unset DISPLAY
+
# The default value of /tmp/cvs-sanity for TESTDIR is dubious,
# because it loses if two people/scripts try to run the tests
# at the same time. Some possible solutions:
@@ -326,40 +392,103 @@ fi
: ${ID=id}
: ${TR=tr}
+# Keep track of tools that are found, but do NOT work as we hope
+# in order to avoid them in future
+badtools=
+set_bad_tool ()
+{
+ badtools=$badtools:$1
+}
+is_bad_tool ()
+{
+ case ":$badtools:" in *:$1:*) return 0 ;; *) return 1 ; esac
+}
+
+version_test ()
+{
+ vercmd=$1
+ verbad=:
+ if RES=`$vercmd --version </dev/null 2>&1`; then
+ if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
+ echo "$RES"
+ verbad=false
+ fi
+ fi
+ if $verbad; then
+ echo "The command \`$vercmd' does not support the --version option."
+ fi
+ # It does not really matter that --version is not supported
+ return 0
+}
+
+# Try to find a tool that satisfies all of the tests.
+# Usage: list:of:colon:separated:alternatives test1 test2 test3 test4...
+# Example: find_tool awk:gawk:nawk awk_tooltest1 awk_tooltest2
find_tool ()
{
- GLOCS="`echo $PATH | sed 's/:/ /g'` /usr/local/bin /usr/contrib/bin /usr/gnu/bin /local/bin /local/gnu/bin /gnu/bin"
+ default_TOOL=$1
+ echo find_tool: ${1+"$@"} >>$LOGFILE
+ cmds="`IFS=:; echo $1`"; shift; tooltests="${1+$@}"
+ if test -z "$tooltests"; then tooltests=version_test; fi
+ clist=; for cmd in $cmds; do clist="$clist `Which -a $cmd`"; done
+ # Make sure the default tool is just the first real command name
+ for default_TOOL in $clist `IFS=:; echo $default_TOOL`; do break; done
TOOL=""
- for path in $GLOCS ; do
- if test -x $path/g$1 ; then
- RES="`$path/g$1 --version </dev/null 2>/dev/null`"
- if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
- TOOL=$path/g$1
- break
+ for trytool in $clist ; do
+ pass=:
+ for tooltest in $tooltests; do
+ result=`eval $tooltest $trytool`
+ rc=$?
+ echo "Running $tooltest $trytool" >>$LOGFILE
+ if test -n "$result"; then
+ echo "$result" >>$LOGFILE
fi
- fi
- if test -x $path/$1 ; then
- RES="`$path/$1 --version </dev/null 2>/dev/null`"
- if test "X$RES" != "X--version" && test "X$RES" != "X" ; then
- TOOL=$path/$1
- break
+ if test "$rc" = "0"; then
+ echo "PASS: $tooltest $trytool" >>$LOGFILE
+ elif test "$rc" = "77"; then
+ echo "MARGINAL: $tooltest $trytool; rc=$rc" >>$LOGFILE
+ TOOL=$trytool
+ pass=false
+ else
+ set_bad_tool $trytool
+ echo "FAIL: $tooltest $trytool; rc=$rc" >>$LOGFILE
+ pass=false
fi
+ done
+ if $pass; then
+ echo $trytool
+ return 0
fi
done
- if test -z "$TOOL"; then
- :
+ if test -n "$TOOL"; then
+ echo "Notice: The default version of \`$default_TOOL' is defective." >>$LOGFILE
+ echo "using \`$TOOL' and hoping for the best." >>$LOGFILE
+ echo "Notice: The default version of \`$default_TOOL' is defective." >&2
+ echo "using \`$TOOL' and hoping for the best." >&2
+ echo $TOOL
else
- echo "Notice: The default version of \`$1' is defective, using" >&2
- echo "\`$TOOL' instead." >&2
+ echo $default_TOOL
fi
- echo "$TOOL"
}
+id_tool_test ()
+{
+ id=$1
+ if $id -u >/dev/null 2>&1 && $id -un >/dev/null 2>&1; then
+ return 0
+ else
+ echo "Running these tests requires an \`id' program that understands the"
+ echo "-u and -n flags. Make sure that such an id (GNU, or many but not"
+ echo "all vendor-supplied versions) is in your path."
+ return 1
+ fi
+}
+
+ID=`find_tool id version_test id_tool_test`
+echo "Using ID=$ID" >>$LOGFILE
+
# You can't run CVS as root; print a nice error message here instead
# of somewhere later, after making a mess.
-#
-# FIXME - find_tool() finds the 'gid' from GNU id-utils if I pull 'id' out of
-# my path.
for pass in false :; do
case "`$ID -u 2>/dev/null`" in
"0")
@@ -367,18 +496,6 @@ for pass in false :; do
exit 1
;;
- "")
- if $pass; then :; else
- ID=`find_tool id`
- fi
- if $pass || test -z "$ID" ; then
- echo "Running these tests requires an \`id' program that understands the" >&2
- echo "-u and -n flags. Make sure that such an id (GNU, or many but not" >&2
- echo "all vendor-supplied versions) is in your path." >&2
- exit 1
- fi
- ;;
-
*)
break
;;
@@ -386,63 +503,70 @@ for pass in false :; do
done
# Cause NextStep 3.3 users to lose in a more graceful fashion.
-if $EXPR 'abc
+expr_tooltest1 ()
+{
+expr=$1
+if $expr 'abc
def' : 'abc
def' >/dev/null; then
- : good, it works
+ # good, it works
+ return 0
else
- EXPR=`find_tool expr`
- if test -z "$EXPR" ; then
- echo 'Running these tests requires an "expr" program that can handle' >&2
- echo 'multi-line patterns. Make sure that such an expr (GNU, or many but' >&2
- echo 'not all vendor-supplied versions) is in your path.' >&2
- exit 1
- fi
+ echo 'Running these tests requires an "expr" program that can handle'
+ echo 'multi-line patterns. Make sure that such an expr (GNU, or many but'
+ echo 'not all vendor-supplied versions) is in your path.'
+ return 1
fi
+}
# Warn SunOS, SysVr3.2, etc., users that they may be partially losing
# if we can't find a GNU expr to ease their troubles...
-if $EXPR 'a
+expr_tooltest2 ()
+{
+expr=$1
+if $expr 'a
b' : 'a
c' >/dev/null; then
- EXPR=`find_tool expr`
- if test -z "$EXPR" ; then
- echo 'Warning: you are using a version of expr that does not correctly'
- echo 'match multi-line patterns. Some tests may spuriously pass or fail.'
- echo 'You may wish to make sure GNU expr is in your path.'
- EXPR=expr
- fi
+ echo 'Warning: you are using a version of expr that does not correctly'
+ echo 'match multi-line patterns. Some tests may spuriously pass or fail.'
+ echo 'You may wish to make sure GNU expr is in your path.'
+ return 1
else
- : good, it works
+ return 0
fi
+}
-# More SunOS lossage...
+expr_create_bar ()
+{
echo 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >${TESTDIR}/foo
cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
cat ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar ${TESTDIR}/bar >${TESTDIR}/foo
cat ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo ${TESTDIR}/foo >${TESTDIR}/bar
-if $EXPR "`cat ${TESTDIR}/bar`" : "`cat ${TESTDIR}/bar`" >/dev/null; then
+rm -f ${TESTDIR}/foo
+}
+
+expr_tooltest3 ()
+{
+expr=$1
+# More SunOS lossage...
+test ! -f ${TESTDIR}/bar && expr_create_bar
+if $expr "`cat ${TESTDIR}/bar`" : "`cat ${TESTDIR}/bar`" >/dev/null; then
: good, it works
else
- EXPR=`find_tool expr`
- if test -z "$EXPR" ; then
- echo 'Warning: you are using a version of expr that does not correctly'
- echo 'match large patterns. Some tests may spuriously pass or fail.'
- echo 'You may wish to make sure GNU expr is in your path.'
- EXPR=expr
- fi
+ echo 'Warning: you are using a version of expr that does not correctly'
+ echo 'match large patterns. Some tests may spuriously pass or fail.'
+ echo 'You may wish to make sure GNU expr is in your path.'
+ return 1
fi
-if $EXPR "`cat ${TESTDIR}/bar`x" : "`cat ${TESTDIR}/bar`y" >/dev/null; then
- EXPR=`find_tool expr`
- if test -z "$EXPR" ; then
- echo 'Warning: you are using a version of expr that does not correctly'
- echo 'match large patterns. Some tests may spuriously pass or fail.'
- echo 'You may wish to make sure GNU expr is in your path.'
- EXPR=expr
- fi
-else
- : good, it works
+if $expr "`cat ${TESTDIR}/bar`x" : "`cat ${TESTDIR}/bar`y" >/dev/null; then
+ echo 'Warning: you are using a version of expr that does not correctly'
+ echo 'match large patterns. Some tests may spuriously pass or fail.'
+ echo 'You may wish to make sure GNU expr is in your path.'
+ return 1
fi
+# good, it works
+return 0
+}
# That we should have to do this is total bogosity, but GNU expr
# version 1.9.4-1.12 uses the emacs definition of "$" instead of the unix
@@ -450,10 +574,18 @@ fi
# next release of GNU expr after 1.12 (but we still have to cater to the old
# ones for some time because they are in many linux distributions).
ENDANCHOR="$"
-if $EXPR 'abc
+expr_set_ENDANCHOR ()
+{
+expr=$1
+ENDANCHOR="$"
+if $expr 'abc
def' : 'abc$' >/dev/null; then
ENDANCHOR='\'\'
+ echo "Notice: An ENDANCHOR of dollar does not work."
+ echo "Using a workaround for GNU expr versions 1.9.4 thru 1.12"
fi
+return 0
+}
# Work around another GNU expr (version 1.10-1.12) bug/incompatibility.
# "." doesn't appear to match a newline (it does with SunOS 4.1.3 expr).
@@ -464,28 +596,53 @@ fi
# next release of GNU expr after 1.12 (but we still have to cater to the old
# ones for some time because they are in many linux distributions).
DOTSTAR='.*'
-if $EXPR 'abc
+expr_set_DOTSTAR ()
+{
+expr=$1
+DOTSTAR='.*'
+if $expr 'abc
def' : "a${DOTSTAR}f" >/dev/null; then
: good, it works
else
DOTSTAR='\(.\|
\)*'
+ echo "Notice: DOTSTAR changed from sane \`.*' value to \`$DOTSTAR\`"
+ echo "to workaround GNU expr version 1.10 thru 1.12 bug where \`.'"
+ echo "does not match a newline."
fi
+return 0
+}
# Now that we have DOTSTAR, make sure it works with big matches
-if $EXPR "`cat ${TESTDIR}/bar`" : "${DOTSTAR}xyzABC${DOTSTAR}$" >/dev/null; then
- : good, it works
+expr_tooltest_DOTSTAR ()
+{
+expr=$1
+test ! -f ${TESTDIR}/bar && expr_create_bar
+if $expr "`cat ${TESTDIR}/bar`" : "${DOTSTAR}xyzABC${DOTSTAR}$" >/dev/null; then
+ # good, it works
+ return 0
else
- EXPR=`find_tool expr`
- if test -z "$EXPR" ; then
- echo 'Warning: you are using a version of expr that does not correctly'
- echo 'match large patterns. Some tests may spuriously pass or fail.'
- echo 'You may wish to make sure GNU expr is in your path.'
- EXPR=expr
- fi
+ echo 'Warning: you are using a version of expr that does not correctly'
+ echo 'match large patterns. Some tests may spuriously pass or fail.'
+ echo 'You may wish to make sure GNU expr is in your path.'
+ return 77
fi
+}
+
+EXPR=`find_tool ${EXPR}:gexpr \
+ version_test expr_tooltest1 expr_tooltest2 expr_tooltest3 \
+expr_set_ENDANCHOR expr_set_DOTSTAR expr_tooltest_DOTSTAR`
+
+# Set the ENDANCHOR and DOTSTAR for the chosen expr version.
+expr_set_ENDANCHOR ${EXPR} >/dev/null
+expr_tooltest_DOTSTAR ${EXPR} >/dev/null
-rm -f ${TESTDIR}/foo ${TESTDIR}/bar
+echo "Using EXPR=$EXPR" >>$LOGFILE
+echo "Using ENDANCHOR=$ENDANCHOR" >>$LOGFILE
+echo "Using DOTSTAR=$DOTSTAR" >>$LOGFILE
+
+# Cleanup
+rm -f ${TESTDIR}/bar
# Work around yet another GNU expr (version 1.10) bug/incompatibility.
# "+" is a special character, yet for unix expr (e.g. SunOS 4.1.3)
@@ -519,22 +676,151 @@ else
exit 1
fi
+# Only 8 characters of $username appear in some output.
+if test `echo $username |wc -c` -gt 8; then
+ username8=`echo $username |sed 's/^\(........\).*/\1/'`
+else
+ username8=$username
+fi
+
+# Rarely, we need to match any username, not just the name of the user
+# running this test.
+#
+# I'm not really sure what characters should be here. a-zA-Z obviously.
+# People complained when 0-9 were not allowed in usernames. Other than that
+# I'm not sure.
+anyusername="[-a-zA-Z0-9][-a-zA-Z0-9]*"
+
# now make sure that tr works on NULs
-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'
- echo 'handle NUL bytes. Some tests may spuriously pass or fail.'
- echo 'You may wish to make sure GNU tr is in your path.'
- TR=tr
- fi
+tr_tooltest1 ()
+{
+tr=$1
+if $EXPR `echo "123" | $tr '2' '\0'` : "123" >/dev/null 2>&1; then
+ echo 'Warning: you are using a version of tr which does not correctly'
+ echo 'handle NUL bytes. Some tests may spuriously pass or fail.'
+ echo 'You may wish to make sure GNU tr is in your path.'
+ return 77
+fi
+# good, it works
+return 0
+}
+
+TR=`find_tool ${TR}:gtr version_test tr_tooltest1`
+echo "Using TR=$TR" >>$LOGFILE
+
+# Awk testing
+
+awk_tooltest1 ()
+{
+awk=$1
+$awk 'BEGIN {printf("one\ntwo\nthree\nfour\nfive\nsix")}' </dev/null >abc
+if $EXPR "`cat abc`" : \
+'one
+two
+three
+four
+five
+six'; then
+ rm abc
+ return 0
else
- : good, it works
+ rm abc
+ echo "Notice: awk BEGIN clause or printf is not be working properly."
+ return 1
+fi
+}
+
+# Format item %c check
+awk_tooltest2 ()
+{
+awk=$1
+$awk 'BEGIN { printf "%c%c%c", 2, 3, 4 }' </dev/null \
+ | ${TR} '\002\003\004' '123' >abc
+if $EXPR "`cat abc`" : "123" ; then
+ : good, found it
+else
+ echo "Notice: awk format %c string may not be working properly."
+ rm abc
+ return 77
fi
+rm abc
+return 0
+}
+
+AWK=`find_tool gawk:nawk:awk version_test awk_tooltest1 awk_tooltest2`
+echo "Using AWK=$AWK" >>$LOGFILE
+
+# Test that $1 works as a remote shell. If so, set $host, $CVS_RSH, &
+# $save_CVS_RSH to match and return 0. Otherwise, set $skipreason and return
+# 77.
+depends_on_rsh ()
+{
+ host=${remotehost-"`hostname`"}
+ result=`$1 $host 'echo test'`
+ rc=$?
+ if test $? != 0 || test "x$result" != "xtest"; then
+ skipreason="\`$1 $host' failed rc=$rc result=$result"
+ return 77
+ fi
+
+ save_CVS_RSH=$CVS_RSH
+ CVS_RSH=$1; export CVS_RSH
+ return 0
+}
+
+# Find a usable SSH. When a usable ssh is found, set $host, $CVS_RSH, and
+# $save_CVS_RSH and return 0. Otherwise, set $skipreason and return 77.
+depends_on_ssh ()
+{
+ case "$CVS_RSH" in
+ *ssh*|*putty*)
+ tryssh=`Which $CVS_RSH`
+ if [ ! -n "$tryssh" ]; then
+ skipreason="Unable to find CVS_RSH=$CVS_RSH executable"
+ return 77
+ elif [ ! -x "$tryssh" ]; then
+ skipreason="Unable to execute $tryssh program"
+ return 77
+ fi
+ ;;
+ *)
+ # Look in the user's PATH for "ssh"
+ tryssh=`Which ssh`
+ if test ! -r "$tryssh"; then
+ skipreason="Unable to find ssh program"
+ return 77
+ fi
+ ;;
+ esac
+
+ depends_on_rsh "$tryssh"
+ return $?
+}
pass ()
{
echo "PASS: $1" >>${LOGFILE}
+ passed=`expr $passed + 1`
+}
+
+skip ()
+{
+ if $skipfail; then
+ fail "$1${2+ ($2)}"
+ else
+ echo "SKIP: $1${2+ ($2)}" >>$LOGFILE
+ fi
+ skipped=`expr $skipped + 1`
+}
+
+warn ()
+{
+ if $skipfail; then
+ fail "$1${2+ ($2)}"
+ else
+ echo "WARNING: $1${2+ ($2)}" >>$LOGFILE
+ fi
+ warnings=`expr $warnings + 1`
}
fail ()
@@ -545,6 +831,28 @@ fail ()
exit 1
}
+verify_tmp_empty ()
+{
+ # Test our temp directory for cvs-serv* directories and cvsXXXXXX temp
+ # files. We would like to not leave any behind.
+ if $remote && ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
+ # A true value means ls found files/directories with these names.
+ # Give the server some time to finish, then retry.
+ sleep 1
+ if ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
+ warn "$1" "Found cvs-serv* directories in $TMPDIR."
+ # The above will exit if $skipfail
+ rm -rf $TMPDIR/cvs-serv*
+ fi
+ fi
+ if ls $TMPDIR/cvs?????? >/dev/null 2>&1; then
+ # A true value means ls found files/directories with these names.
+ warn "$1" "Found cvsXXXXXX temp files in $TMPDIR."
+ # The above will exit if $skipfail
+ rm -f ls $TMPDIR/cvs??????
+ fi
+}
+
# See dotest and dotest_fail for explanation (this is the parts
# of the implementation common to the two).
dotest_internal ()
@@ -562,14 +870,17 @@ dotest_internal ()
# surely use a somewhat non-specific pattern).
cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
pass "$1"
+ verify_tmp_empty "$1"
# expr can't distinguish between "zero characters matched" and "no match",
# so special-case it.
elif test -z "$3" && test ! -s ${TESTDIR}/dotest.tmp; then
pass "$1"
+ verify_tmp_empty "$1"
elif test x"$4" != x; then
if $EXPR "`cat ${TESTDIR}/dotest.tmp`" : "$4${ENDANCHOR}" >/dev/null; then
cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
pass "$1"
+ verify_tmp_empty "$1"
else
echo "** expected: " >>${LOGFILE}
echo "$3" >>${LOGFILE}
@@ -644,17 +955,20 @@ dotest_internal_debug ()
fail "$1"
else
pass "$1"
+ verify_tmp_empty "$1"
fi
else
echo "$3" > ${TESTDIR}/dotest.exp
if dotest_line_by_line "$1" "$2"; then
pass "$1"
+ verify_tmp_empty "$1"
else
if test x"$4" != x; then
mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex1
echo "$4" > ${TESTDIR}/dotest.exp
if dotest_line_by_line "$1" "$2"; then
pass "$1"
+ verify_tmp_empty "$1"
else
mv ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.ex2
echo "** expected: " >>${LOGFILE}
@@ -716,6 +1030,7 @@ dotest_lit ()
cat >${TESTDIR}/dotest.exp
if cmp ${TESTDIR}/dotest.exp ${TESTDIR}/dotest.tmp >/dev/null 2>&1; then
pass "$1"
+ verify_tmp_empty "$1"
else
echo "** expected: " >>${LOGFILE}
cat ${TESTDIR}/dotest.exp >>${LOGFILE}
@@ -754,6 +1069,19 @@ dotest_sort ()
dotest_internal "$@"
}
+# A function for fetching the timestamp of a revison of a file
+getrlogdate () {
+ ${testcvs} -n rlog -N ${1+"$@"} |
+ while read token value; do
+ case "$token" in
+ date:)
+ echo $value | sed "s,;.*,,"
+ break;
+ ;;
+ esac
+ done
+}
+
# Avoid picking up any stray .cvsrc, etc., from the user running the tests
mkdir home
HOME=${TESTDIR}/home; export HOME
@@ -773,30 +1101,31 @@ RCSINIT=; export RCSINIT
if test x"$*" = x; then
# Basic/miscellaneous functionality
tests="version basica basicb basicc basic1 deep basic2"
- tests="${tests} parseroot files spacefiles commit-readonly"
+ tests="${tests} parseroot parseroot2 files spacefiles commit-readonly"
tests="${tests} commit-add-missing"
tests="${tests} status"
# Branching, tagging, removing, adding, multiple directories
tests="${tests} rdiff rdiff-short"
- tests="${tests} rdiff2 diff diffnl death death2"
+ tests="${tests} rdiff2 diff diffnl death death2 death-rtag"
tests="${tests} rm-update-message rmadd rmadd2 rmadd3 resurrection"
- tests="${tests} dirs dirs2 branches branches2 tagc tagf"
+ tests="${tests} dirs dirs2 branches branches2 tagc tagf tag-space"
tests="${tests} rcslib multibranch import importb importc import-CVS"
+ tests="$tests import-quirks"
tests="${tests} update-p import-after-initial branch-after-import"
- tests="${tests} join join2 join3 join4 join5 join6"
+ tests="${tests} join join2 join3 join4 join5 join6 join7"
tests="${tests} join-readonly-conflict join-admin join-admin-2"
tests="${tests} join-rm"
- tests="${tests} new newb conflicts conflicts2 conflicts3"
+ tests="${tests} new newb conflicts conflicts2 conflicts3 conflicts4"
tests="${tests} clean"
# Checking out various places (modules, checkout -d, &c)
tests="${tests} modules modules2 modules3 modules4 modules5 modules6"
- tests="${tests} mkmodules co-d"
+ tests="${tests} modules7 mkmodules co-d"
tests="${tests} cvsadm emptydir abspath abspath2 toplevel toplevel2"
tests="${tests} rstar-toplevel trailingslashes checkout_repository"
# Log messages, error messages.
tests="${tests} mflag editor errmsg1 errmsg2 adderrmsg opterrmsg"
# Watches, binary files, history browsing, &c.
- tests="${tests} devcom devcom2 devcom3 watch4 watch5"
+ tests="${tests} devcom devcom2 devcom3 watch4 watch5 watch6"
tests="${tests} unedit-without-baserev"
tests="${tests} ignore ignore-on-branch binfiles binfiles2 binfiles3"
tests="${tests} mcopy binwrap binwrap2"
@@ -804,7 +1133,9 @@ if test x"$*" = x; then
tests="${tests} serverpatch log log2 logopt ann ann-id"
# Repository Storage (RCS file format, CVS lock files, creating
# a repository without "cvs init", &c).
- tests="${tests} crerepos rcs rcs2 rcs3 lockfiles backuprecover"
+ tests="${tests} crerepos rcs rcs2 rcs3 rcs4 rcs5 rcs6"
+ tests="$tests lockfiles backuprecover"
+ tests="${tests} sshstdio"
# More history browsing, &c.
tests="${tests} history"
tests="${tests} big modes modes2 modes3 stamps"
@@ -1757,6 +2088,11 @@ for what in $tests; do
continue
fi
fi
+
+ if $verbose; then
+ echo "$what:"
+ fi
+
case $what in
version)
@@ -1766,8 +2102,11 @@ for what in $tests; do
'
Concurrent Versions System (CVS) [0-9.]*.*
-Copyright (c) [-0-9]* Brian Berliner, david d .zoo. zuhn,
- Jeff Polk, and other authors
+Copyright (C) [0-9]* Free Software Foundation, Inc.
+
+Senior active maintainers include Larry Jones, Derek R. Price,
+and Mark D. Baushke. Please see the AUTHORS and README files from the CVS
+distribution kit for a complete list of contributors and copyrights.
CVS may be copied only under the terms of the GNU General Public License,
a copy of which can be found with the CVS distribution kit.
@@ -1895,7 +2234,7 @@ ${PLUS} ssfile line 2"
===================================================================
RCS file: ${CVSROOT_DIRNAME}/first-dir/sdir/ssdir/ssfile,v
retrieving revision 1\.1
-diff -c -C3isacrowd -r1\.1 ssfile
+diff -c -C 3isacrowd -r1\.1 ssfile
${PROG} diff: invalid context length argument"
dotest basica-7 "${testcvs} -q ci -m modify-it" \
"Checking in sdir/ssdir/ssfile;
@@ -1992,8 +2331,8 @@ done"
'
Annotations for sdir/ssdir/ssfile
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1 .'"${username}"' *[0-9a-zA-Z-]*.: ssfile
-1\.2 .'"${username}"' *[0-9a-zA-Z-]*.: ssfile line 2'
+1\.1 .'"$username8"' *[0-9a-zA-Z-]*.: ssfile
+1\.2 .'"$username8"' *[0-9a-zA-Z-]*.: ssfile line 2'
# Test resurrecting with strange revision numbers
cd sdir/ssdir
@@ -2381,7 +2720,8 @@ ${PROG} update: Updating second-dir"
# On Linux 2.2 systems, the cwd may be gone, so we recreate it
# to allow basicc-11 to actually happen
if test ! -d ../first-dir; then
- cd ..
+ # Apparently `cd ..' doesn't work with Linux 2.2 & Bash 2.05b.
+ cd $TESTDIR/1
mkdir ./first-dir
cd ./first-dir
fi
@@ -2389,8 +2729,7 @@ ${PROG} update: Updating second-dir"
"" "${PROG} release: deletion of directory \./\. failed: .*"
dotest basicc-11a "test -d ../second-dir" ""
- cd ..
- cd ..
+ cd ../..
mkdir 2; cd 2
dotest basicc-12 "${testcvs} -Q co ." ""
@@ -3433,7 +3772,17 @@ Are you sure you want to release (and delete) directory .first-dir.: "
"${PROG} rtag: Tagging first-dir
${PROG} rtag: Tagging first-dir/dir1
${PROG} rtag: Tagging first-dir/dir1/dir2"
-
+ # The next test used to cause an assert failure
+ # something like:
+ # cvs: ./recurse.c:667: do_recursion: Assertion `repository != ((void *)0)' failed.
+ dotest basic2-21b "${testcvs} co -p -r rtagged-by-head first-dir/file6" \
+"===================================================================
+Checking out first-dir/file6
+RCS: $CVSROOT_DIRNAME/first-dir/file6,v
+VERS: 1\.2
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
+file6
+file6"
# tag by tag
dotest basic2-22 "${testcvs} rtag -r rtagged-by-head rtagged-by-tag first-dir" \
"${PROG} rtag: Tagging first-dir
@@ -3772,6 +4121,8 @@ $PROG logout: Entry not found\."
rm -r 1
;;
+
+
files)
# Test of how we specify files on the command line
# (recurse.c and that sort of thing). Vaguely similar to
@@ -3847,26 +4198,25 @@ ${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
done"
if $remote; then
+ # FIXCVS:
# This is a bug, looks like that toplevel_repos cruft in
# client.c is coming back to haunt us.
# May want to think about the whole issue, toplevel_repos
# has always been crufty and trying to patch it up again
# might be a mistake.
- dotest_fail files-12 \
+ dotest files-12 \
"${testcvs} commit -f -m test ./sdir/ssdir/.file ./.file" \
-"${PROG} commit: Up-to-date check failed for .\.file'
-${PROG} \[commit aborted\]: correct above errors first!"
+"Checking in \./sdir/ssdir/\.file;
+${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
+new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
+done"
# Sync up the version numbers so that the rest of the
# tests don't need to expect different numbers based
# local or remote.
dotest files-12-workaround \
-"${testcvs} commit -f -m test sdir/ssdir/.file .file" \
-"Checking in sdir/ssdir/\.file;
-${CVSROOT_DIRNAME}/first-dir/dir/sdir/ssdir/Attic/\.file,v <-- \.file
-new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
-done
-Checking in \.file;
+"${testcvs} commit -f -m test .file" \
+"Checking in \.file;
${CVSROOT_DIRNAME}/first-dir/dir/Attic/\.file,v <-- \.file
new revision: 1\.1\.2\.3; previous revision: 1\.1\.2\.2
done"
@@ -4053,7 +4403,7 @@ C tfile"
# Now note our status
dotest status-1 "${testcvs} status tfile" \
"===================================================================
-File: tfile Status: File had conflicts on merge
+File: tfile Status: Unresolved Conflict
Working revision: 1\.2.*
Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
@@ -4086,6 +4436,21 @@ File: tfile Status: Locally Modified
Sticky Date: (none)
Sticky Options: (none)"
+ # Check that there are no problems just using CVS/Root too.
+ save_CVSROOT=$CVSROOT
+ unset CVSROOT
+ dotest status-3a "${testcvs} status tfile" \
+"===================================================================
+File: tfile Status: Locally Modified
+
+ Working revision: 1\.2.*
+ Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/tfile,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ CVSROOT=$save_CVSROOT
+ export CVSROOT
+
# FIXCVS:
# Update is supposed to re-Register() the file when it
# finds resolved conflicts:
@@ -4477,7 +4842,7 @@ done"
===================================================================
RCS file: ${CVSROOT_DIRNAME}/first-dir/abc,v
retrieving revision 1\.2
-diff --ifdef=HAVE_WINSOCK_H -r1\.2 abc
+diff --ifdef HAVE_WINSOCK_H -r1\.2 abc
#ifndef HAVE_WINSOCK_H
extern int gethostname ();
#else /\* HAVE_WINSOCK_H \*/
@@ -5248,7 +5613,7 @@ ${PROG} update: file4 is no longer in the repository"
dotest death2-16 "${testcvs} -q commit -m add" \
"Checking in file2;
${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
-new revision: 1\.1\.2\.1; previous revision: 1\.1
+new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
done"
# Add a new file on the branch.
@@ -5398,6 +5763,103 @@ C file4"
cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
;;
+
+
+ death-rtag)
+ # This documents a bug in CVS that prevents rtag from tagging files
+ # in the Attic.
+ mkdir $CVSROOT_DIRNAME/death-rtag
+ dotest death-rtag-init-1 "$testcvs -Q co death-rtag"
+ cd death-rtag
+ echo "This is the file foo" > foo
+ echo "This is the file bar" > bar
+ dotest death-rtag-init-2 "$testcvs -Q add foo bar"
+ dotest death-rtag-init-3 "$testcvs -Q ci -m 'Add foo and bar.'" \
+"RCS file: $CVSROOT_DIRNAME/death-rtag/bar,v
+done
+Checking in bar;
+$CVSROOT_DIRNAME/death-rtag/bar,v <-- bar
+initial revision: 1\.[0-9]*
+done
+RCS file: $CVSROOT_DIRNAME/death-rtag/foo,v
+done
+Checking in foo;
+$CVSROOT_DIRNAME/death-rtag/foo,v <-- foo
+initial revision: 1\.[0-9]*
+done"
+ dotest death-rtag-init-5 "$testcvs -Q tag -b mybranch"
+
+ dotest death-rtag-1 "$testcvs -q rtag -rmybranch willtag death-rtag"
+ dotest death-rtag-2 "$testcvs -Q rm -f foo"
+ dotest death-rtag-3 "$testcvs -Q ci -m 'Remove foo.'" \
+"Removing foo;
+$CVSROOT_DIRNAME/death-rtag/foo,v <-- foo
+new revision: delete; previous revision: 1\.[0-9]*
+done"
+ # commit something on the branch so that the moving tag is visible.
+ dotest death-rtag-3.2 "$testcvs -Q up -rmybranch"
+ echo some branch content >>foo
+ echo some branch content >>bar
+ dotest death-rtag-3.3 "$testcvs -Q ci -m 'Change foo.'" \
+"Checking in bar;
+$CVSROOT_DIRNAME/death-rtag/bar,v <-- bar
+new revision: 1\.1\.2\.1; previous revision: 1\.1
+done
+Checking in foo;
+$CVSROOT_DIRNAME/death-rtag/Attic/foo,v <-- foo
+new revision: 1\.1\.2\.1; previous revision: 1\.1
+done"
+ dotest death-rtag-3.4 \
+"$testcvs -q rtag -rmybranch wontmove death-rtag"
+ dotest death-rtag-3.5 "$testcvs -q rtag -F wontmove death-rtag"
+
+ cd ..
+ # Removing -f below avoids this bug.
+ dotest death-rtag-4 "$testcvs -q rtag -frmybranch wonttag death-rtag"
+
+ # When the bug existed, `wonttag' would not have been present in
+ # foo,v.
+ #
+ # A second bug prevented `wontmove' from moving from the branch to
+ # the dead revision on the trunk (death-rtag-3.4 & death-rtag-3.5).
+ dotest death-rtag-5 "$testcvs -q rlog death-rtag" \
+"
+RCS file: $CVSROOT_DIRNAME/death-rtag/bar,v
+head: 1.[0-9]*
+branch:
+locks: strict
+access list:
+symbolic names:
+ wonttag: 1\.1\.2\.1
+ wontmove: 1\.1
+ willtag: 1\.1
+ mybranch: 1\.1.0\.2
+keyword substitution: kv
+$DOTSTAR
+RCS file: $CVSROOT_DIRNAME/death-rtag/Attic/foo,v
+head: 1.[0-9]*
+branch:
+locks: strict
+access list:
+symbolic names:
+ wonttag: 1\.1\.2\.1
+ wontmove: 1\.2
+ willtag: 1\.1
+ mybranch: 1\.1.0\.2
+keyword substitution: kv
+$DOTSTAR"
+
+ if $keep; then
+ echo Keeping $TESTDIR and exiting due to --keep
+ exit 0
+ fi
+
+ rm -r death-rtag
+ rm -rf $CVSROOT_DIRNAME/death-rtag
+ ;;
+
+
+
rm-update-message)
# FIXME
# local CVS prints a warning message when update notices a missing
@@ -5860,8 +6322,8 @@ done"
dotest resurrection-init5 "$testcvs -Q rm -f file1"
- # The first test is that `cvs add' will resurrect a file before it
- # has been committed.
+ # The first test is that `cvs add' will resurrect a file before its
+ # removal has been committed.
dotest_sort resurrection-1 "$testcvs add file1" \
"U file1
$PROG add: file1, version 1\.1, resurrected"
@@ -5909,6 +6371,24 @@ $PROG add: use 'cvs commit' to add this file permanently"
$CVSROOT_DIRNAME/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
done"
+
+ # The next few tests verify that an attempted resurrection of a file
+ # with no previous revision on the trunk fails.
+ touch file2
+ dotest resurrection-9 "$testcvs -Q add file2"
+ dotest resurrection-10 "$testcvs -Q ci -mnew-file2" \
+"RCS file: $CVSROOT_DIRNAME/first-dir/Attic/file2,v
+done
+Checking in file2;
+$CVSROOT_DIRNAME/first-dir/Attic/file2,v <-- file2
+new revision: 1\.1\.2\.1; previous revision: 1\.1
+done"
+ dotest resurrection-11 "$testcvs -Q up -A"
+
+ # This command once caused an assertion failure.
+ dotest resurrection-12 "$testcvs add file2" \
+"$PROG add: File \`file2' has no previous revision to resurrect\."
+
if $keep; then
echo Keeping $TESTDIR and exiting due to --keep
exit 0
@@ -7009,6 +7489,160 @@ ${PROG} rtag: first-dir/file1: Not moving non-branch tag .regulartag. from 1\.1
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
+ tag-space)
+ # Test tags with spaces in the names.
+ #
+ # Prior to releases 1.11.18 & 1.12.10, some commands used with
+ # tags with spaces in the names could hang CVS.
+
+ # Setup; check in first-dir/file1
+ mkdir 1; cd 1
+ dotest tag-space-init-1 "$testcvs -q co -l ."
+ mkdir first-dir
+ dotest tag-space-init-2 "$testcvs add first-dir" \
+"Directory $CVSROOT_DIRNAME/first-dir added to the repository"
+ cd first-dir
+ touch file1
+ dotest tag-space-init-3 "$testcvs add file1" \
+"$PROG add: scheduling file \`file1' for addition
+$PROG add: use '$PROG commit' to add this file permanently"
+ dotest tag-space-init-4 "$testcvs -Q ci -m add" \
+"RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
+done
+Checking in file1;
+$CVSROOT_DIRNAME/first-dir/file1,v <-- file1
+initial revision: 1\.1
+done"
+
+ # Reportedly, the following two tags make it past WinCVS.
+ dotest_fail tag-space-1 "$testcvs tag ' spacetag '" \
+"$PROG \[tag aborted\]: tag \` spacetag ' must start with a letter"
+ dotest_fail tag-space-2 "$testcvs tag 'spacetag '" \
+"$PROG \[tag aborted\]: tag \`spacetag ' has non-visible graphic characters"
+
+ if $remote; then
+ # Verify that this isn't a client check.
+ dotest tag-space-3 "$testcvs server" \
+"E $PROG \[tag aborted\]: tag \` spacetag ' must start with a letter
+error " <<EOF
+Root $CVSROOT_DIRNAME
+UseUnchanged
+Argument --
+Argument spacetag
+Directory .
+$CVSROOT_DIRNAME/first-dir
+Entry /file1/1.1///
+Unchanged file1
+tag
+EOF
+
+ dotest tag-space-4 "$testcvs server" \
+"E $PROG \[tag aborted\]: tag \`spacetag ' has non-visible graphic characters
+error " <<EOF
+Root $CVSROOT_DIRNAME
+UseUnchanged
+Argument --
+Argument spacetag
+Directory .
+$CVSROOT_DIRNAME/first-dir
+Entry /file1/1.1///
+Unchanged file1
+tag
+EOF
+ fi # $remote
+
+ # Any number of normal tags and branches were handled correctly.
+ dotest tag-space-5 "$testcvs -Q tag t1"
+ dotest tag-space-5b "$testcvs -Q tag t2"
+ dotest tag-space-5c "$testcvs -Q tag -b b1"
+
+ cd ../..
+ mkdir 2; cd 2
+
+ # But once a vendor branch exists, it's all over.
+ mkdir project; cd project
+ touch file1
+ dotest tag-space-init-4 \
+"$testcvs -Q import -mimport second-dir VENDOR RELEASE"
+
+ cd ..
+
+ dotest_fail tag-space-6 "$testcvs -Q co -r ' spacetag ' first-dir" \
+"$PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter"
+
+ # But when any files were imported, this test hung prior to CVS
+ # versions 1.11.18 & 1.12.10.
+ dotest_fail tag-space-7 "$testcvs -Q co -r ' spacetag ' second-dir" \
+"$PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter"
+
+ if $remote; then
+ # I based the client input in the next two tests on actual input
+ # from WinCVS 1.2.
+ dotest tag-space-8 "$testcvs server" \
+"E $PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter
+error " <<EOF
+Root $CVSROOT_DIRNAME
+Argument -P
+Argument -r
+Argument spacetag
+Argument first-dir
+Directory .
+$CVSROOT_DIRNAME
+co
+EOF
+
+ # Verify the test is not on the client side.
+ dotest tag-space-9 "$testcvs server" \
+"E $PROG \[checkout aborted\]: tag \` spacetag ' must start with a letter
+error " <<EOF
+Root $CVSROOT_DIRNAME
+Argument -P
+Argument -r
+Argument spacetag
+Argument second-dir
+Directory .
+$CVSROOT_DIRNAME
+co
+EOF
+ fi # $remote
+
+ dotest tag-space-10 "$testcvs -Q co second-dir"
+ cd second-dir
+
+ # This test would also hang.
+ dotest_fail tag-space-11 "$testcvs -Q up -r ' spacetag '" \
+"$PROG \[update aborted\]: tag \` spacetag ' must start with a letter"
+
+ if $remote; then
+ dotest tag-space-12 "$testcvs server" \
+"E $PROG \[update aborted\]: tag \` spacetag ' must start with a letter
+error " <<EOF
+Root $CVSROOT_DIRNAME
+Argument -r
+Argument spacetag
+Argument -u
+Argument --
+Directory .
+$CVSROOT_DIRNAME
+Unchanged file1
+update
+EOF
+ fi # $remote
+
+ # I'm skipping tests for other commands that may have had the same
+ # problem. Hopefully, if a new issue arises, one of the above tests
+ # will catch the problem.
+
+ if $keep; then
+ echo Keeping $TESTDIR and exiting due to --keep
+ exit 0
+ fi
+
+ cd ../..
+ rm -r 1 2
+ rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/second-dir
+ ;;
+
rcslib)
# Test librarification of RCS.
# First: test whether `cvs diff' handles $Name expansion
@@ -7115,12 +7749,12 @@ mumble;
}
EOF
# Use dotest_fail because exit status from `cvs diff' must be 1.
- dotest_fail rcslib-diffrgx-3 "${testcvs} diff -c -F'.*(' rgx.c" \
+ dotest_fail rcslib-diffrgx-3 "${testcvs} diff -c -F'.* (' rgx.c" \
"Index: rgx\.c
===================================================================
RCS file: ${CVSROOT_DIRNAME}/first-dir/rgx\.c,v
retrieving revision 1\.1
-diff -c -F\.\*( -r1\.1 rgx\.c
+diff -c -F \.\* ( -r1\.1 rgx\.c
\*\*\* rgx\.c ${RFCDATE} 1\.1
--- rgx\.c ${RFCDATE}
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* test_regex (whiz, bang)
@@ -7334,15 +7968,59 @@ done"
"${PROG} rtag: could not read RCS file for file2
${PROG} rtag: could not read RCS file for first-dir/file2
${PROG} rtag: could not read RCS file for first-dir/file2"
- cd ..
- cd ..
+ # Restore file1 for the next test.
+ dotest rcslib-long-symlink-init-1 "$testcvs -Q up -A"
+ dotest rcslib-long-symlink-init-2 "$testcvs -Q add file1"
+ dotest rcslib-long-symlink-init-3 "$testcvs -Q ci -mback" \
+"Checking in file1;
+$CVSROOT_DIRNAME/first-dir/file1,v <-- file1
+new revision: 1\.4; previous revision: 1\.3
+done"
+
+ cd ../.. # $TESTDIR
+
+ # CVS has a hard-coded default link path size of 127 characters.
+ # Make sure it knows how to exceed that.
+ longpath=$CVSROOT_DIRNAME
+ count=0
+ while test $count -lt 10; do
+ count=`expr $count + 1`
+ longpath=$longpath/123456789012345678901234567890
+ mkdir $longpath
+ done
+ cp $CVSROOT_DIRNAME/first-dir/file1,v $longpath
+ mkdir $CVSROOT_DIRNAME/second-dir
+
+ # Switch as for rcslib-symlink-1
+ if test -n "$remotehost"; then
+ dotest rcslib-long-symlink-1rh \
+"$CVS_RSH $remotehost 'ln -s $longpath/file1,v $CVSROOT_DIRNAME/second-dir/fileX,v'"
+ else
+ dotest rcslib-long-symlink-1 \
+"ln -s $longpath/file1,v $CVSROOT_DIRNAME/second-dir/fileX,v"
+ fi
+
+ dotest rcslib-long-symlink-2 "$testcvs co second-dir" \
+"$PROG checkout: Updating second-dir
+U second-dir/fileX"
+
+ cd second-dir
+ echo change-it >>fileX
+
+ # Writes actually cause symlinks to be resolved.
+ dotest rcslib-long-symlink-3 "$testcvs -q ci -mwrite-it" \
+"Checking in fileX;
+$CVSROOT_DIRNAME/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/123456789012345678901234567890/file1,v <-- fileX
+new revision: 1\.5; previous revision: 1\.4
+done"
if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
+ cd ..
# Must remove the symlink first. Samba doesn't appear to show
# broken symlink across the SMB share, and rm -rf by itself
# will remove file1,v first and leave file2,v a broken link and the
@@ -7353,10 +8031,12 @@ ${PROG} rtag: could not read RCS file for first-dir/file2"
# rcslib-symlink-3j works fine, but the next one doesn't unless run
# remotely under Cygwin and using a TESTDIR on a Samba share.
if test -n "$remotehost"; then
- $CVS_RSH $remotehost "rm -f ${CVSROOT_DIRNAME}/first-dir/file2,v"
+ $CVS_RSH $remotehost \
+"rm -f $CVSROOT_DIRNAME/first-dir/file2,v $CVSROOT_DIRNAME/second-dir/fileX,v"
fi
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- rm -r first-dir 2
+ rm -rf $CVSROOT_DIRNAME/first-dir $CVSROOT_DIRNAME/second-dir \
+ $CVSROOT_DIRNAME/123456789012345678901234567890
+ rm -r first-dir second-dir 2
;;
multibranch)
@@ -7457,6 +8137,7 @@ modify-on-br1
# head -- intended to test vendor branches and HEAD,
# although it doesn't really do it yet.
# import-CVS -- refuse to import directories named "CVS".
+ # import-quirks -- short tests of import quirks.
# import
mkdir import-dir ; cd import-dir
@@ -7717,7 +8398,8 @@ Use the following command to help the merge:"
echo 'my own stuff' >mine2.c
dotest_fail importb-3 \
"${testcvs} import -m add -b 1 second-dir dummy really_dumb_y" \
-"${PROG} \[[a-z]* aborted\]: Only branches with two dots are supported: 1"
+"$PROG \[import aborted\]: Only numeric branch specifications with two dots are
+supported by import, not \`1'\. For example: \`1\.1\.1'\."
: when we implement main-branch import, should be \
"N second-dir/mine1\.c
N second-dir/mine2\.c
@@ -7935,6 +8617,72 @@ $PROG import: Importing $CVSROOT_DIRNAME/import-CVS/sdir"
rm -rf $CVSROOT_DIRNAME/import-CVS
;;
+
+
+ import-quirks)
+ # Short tests of quirky import behavior.
+ #
+ # For a list of other import tests with short descriptions, see the
+ # comment header of the "import" test.
+ mkdir import-quirks
+ cd import-quirks
+ touch file1 file2 file3
+
+ # CVS prior to 1.11.18 and 1.12.10 used to happily import to
+ # "branch 1.1", creating RCS archives with revisions like,
+ # "1.1..1". That double-dot is *not* a typo.
+ dotest_fail import-quirks-1 \
+"$testcvs import -b1.1. -mbad-bad-bad import-quirks VB RT" \
+"$PROG \[import aborted\]: Only numeric branch specifications with two dots are
+supported by import, not \`1\.1\.'\. For example: \`1\.1\.1'\."
+
+ dotest_fail import-quirks-2 \
+"$testcvs import -b1.1.1.. -mbad-bad-bad import-quirks VB RT" \
+"$PROG \[import aborted\]: Only numeric branch specifications with two dots are
+supported by import, not \`1\.1\.1\.\.'\. For example: \`1\.1\.1'\."
+
+ # Try a few odd numbers. This is hardly comprehensive.
+ dotest_sort import-quirks-2 \
+"$testcvs import -b10.10.101 -mthis-ones-ok import-quirks-2 VB RT" \
+"
+
+N import-quirks-2/file1
+N import-quirks-2/file2
+N import-quirks-2/file3
+No conflicts created by this import"
+
+ dotest_sort import-quirks-3 \
+"$testcvs import -b2345678901.2345678901.2345678901 -mthis-ones-ok import-quirks-3 VB RT" \
+"
+
+N import-quirks-3/file1
+N import-quirks-3/file2
+N import-quirks-3/file3
+No conflicts created by this import"
+
+ dotest_sort import-quirks-4 \
+"$testcvs import -b1.1.2 -mthis-ones-ok import-quirks-4 VB RT" \
+"
+
+N import-quirks-4/file1
+N import-quirks-4/file2
+N import-quirks-4/file3
+No conflicts created by this import"
+
+ if $keep; then
+ echo Keeping $TESTDIR and exiting due to --keep
+ exit 0
+ fi
+
+ cd ..
+ rm -r import-quirks
+ rm -rf $CVSROOT_DIRNAME/import-quirks-2 \
+ $CVSROOT_DIRNAME/import-quirks-3 \
+ $CVSROOT_DIRNAME/import-quirks-4
+ ;;
+
+
+
import-after-initial)
# Properly handle the case in which the first version of a
# file is created by a regular cvs add and commit, and there
@@ -8041,7 +8789,7 @@ ${PROG} add: use .${PROG} commit. to add this file permanently"
"${testcvs} commit -m cvs-add file2" \
"Checking in file2;
${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
-new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
+new revision: 1\.1\.1\.1\.2\.2; previous revision: 1\.1\.1\.1\.2\.1
done"
if $keep; then
@@ -8337,7 +9085,7 @@ new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file2;
${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
-new revision: 1\.1\.2\.1; previous revision: 1\.1
+new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
done
Removing file3;
${CVSROOT_DIRNAME}/first-dir/file3,v <-- file3
@@ -8424,8 +9172,8 @@ M file4'
U first-dir/file2
RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
retrieving revision 1\.1
-retrieving revision 1\.1\.2\.1
-Merging differences between 1\.1 and 1\.1\.2\.1 into file2
+retrieving revision 1\.1\.2\.2
+Merging differences between 1\.1 and 1\.1\.2\.2 into file2
U first-dir/file3
${PROG} checkout: scheduling first-dir/file3 for removal
U first-dir/file4
@@ -8459,8 +9207,8 @@ U first-dir/file7'
"U file1
RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
retrieving revision 1\.1
-retrieving revision 1\.1\.2\.1
-Merging differences between 1\.1 and 1\.1\.2\.1 into file2
+retrieving revision 1\.1\.2\.2
+Merging differences between 1\.1 and 1\.1\.2\.2 into file2
${PROG} update: scheduling file3 for removal
M file4
${PROG} update: file file4 is locally modified, but has been removed in revision branch
@@ -8498,8 +9246,8 @@ T file7"
"U file1
RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
retrieving revision 1.1
-retrieving revision 1.1.2.1
-Merging differences between 1.1 and 1.1.2.1 into file2
+retrieving revision 1.1.2.2
+Merging differences between 1.1 and 1.1.2.2 into file2
${PROG} update: scheduling file3 for removal
${PROG} update: file file4 has been modified, but has been removed in revision branch
U file8
@@ -8532,8 +9280,8 @@ U file1
U file2
RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
retrieving revision 1\.1
-retrieving revision 1\.1\.2\.1
-Merging differences between 1\.1 and 1\.1\.2\.1 into file2
+retrieving revision 1\.1\.2\.2
+Merging differences between 1\.1 and 1\.1\.2\.2 into file2
U file3
${PROG} update: scheduling file3 for removal
U file4
@@ -9335,6 +10083,66 @@ U temp2\.txt
rm -rf ${CVSROOT_DIRNAME}/join6
;;
+ join7)
+ # This test deals with joins that happen with the -n switch
+ mkdir join7; cd join7
+ mkdir impdir; cd impdir
+ echo aaa >temp.txt
+ echo bbb >>temp.txt
+ echo ccc >>temp.txt
+ dotest join7-1 \
+"${testcvs} -Q import -minitial join7 vendor vers-1" \
+""
+ cd ..
+ dotest join7-2 "${testcvs} -Q co join7" ""
+ cd join7
+ echo ddd >> temp.txt
+ dotest join7-3 "${testcvs} -Q ci -madded-line temp.txt" \
+"Checking in temp.txt;
+$CVSROOT_DIRNAME/join7/temp.txt,v <-- temp.txt
+new revision: 1\.2; previous revision: 1\.1
+done"
+ cd ../impdir
+ echo aaaa >temp.txt
+ echo bbbb >>temp.txt
+ echo ccc >>temp.txt
+ echo eee >>temp.txt
+ dotest join7-4 \
+"${testcvs} -Q import -minitial join7 vendor vers-2" \
+""
+ cd ../join7
+ dotest join7-5 \
+"${testcvs} -n update -jvers-1 -jvers-2 temp.txt" \
+"RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.2
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
+rcsmerge: warning: conflicts during merge"
+ touch temp.txt
+ dotest join7-6 "${testcvs} -n update -jvers-1 -jvers-2 temp.txt" \
+"RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.2
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
+rcsmerge: warning: conflicts during merge" \
+"RCS file: $CVSROOT_DIRNAME/join7/temp.txt,v
+retrieving revision 1\.1\.1\.1
+retrieving revision 1\.1\.1\.2
+Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into temp.txt
+rcsmerge: warning: conflicts during merge"
+
+ if $keep; then
+ echo Keeping ${TESTDIR} and exiting due to --keep
+ exit 0
+ fi
+
+ cd ../..
+ rm -r join7
+ rm -rf $CVSROOT_DIRNAME/join7
+ ;;
+
+
+
join-readonly-conflict)
# Previously, only tests 1 & 11 were being tested. I added the
# intermediate dotest's to try and diagnose a different failure
@@ -9397,7 +10205,7 @@ C $file"
# (and read-only) .# file for writing.
echo conflict > $file
- # verify that the backup file is writable
+ # verify that the backup file is not writable
if test -w ".#$file.1.1"; then
fail "join-readonly-conflict-10 : .#$file.1.1 is writable"
else
@@ -9985,7 +10793,7 @@ C a"
dotest conflicts-status-1 "${testcvs} status a" \
"===================================================================
-File: a Status: File had conflicts on merge
+File: a Status: Unresolved Conflict
Working revision: 1\.2.*
Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/a,v
@@ -10522,6 +11330,129 @@ done"
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
+ conflicts4)
+ mkdir conflicts4; cd conflicts4
+ mkdir 1; cd 1
+ dotest conflicts4-1 "$testcvs -q co -l ."
+ mkdir first-dir
+ dotest conflicts4-2 "${testcvs} add first-dir" \
+"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
+ cd ..
+ mkdir 2; cd 2
+ dotest conflicts4-3 "${testcvs} -q co -l first-dir" ''
+ cd ../1/first-dir
+ echo baseline >file1
+ dotest conflicts4-4 "${testcvs} -q add file1" \
+"$PROG add: use .$PROG commit. to add this file permanently"
+ dotest conflicts4-5 "${testcvs} -q ci -m add-it" \
+"RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
+done
+Checking in file1;
+$CVSROOT_DIRNAME/first-dir/file1,v <-- file1
+initial revision: 1\.1
+done"
+ cd ../../2/first-dir
+ dotest conflicts4-6 "${testcvs} -q update" "U file1"
+ # Make a local change
+ echo wibble2 >> file1
+ dotest conflicts4-7 "${testcvs} -q ci -m update2" \
+"Checking in file1;
+$CVSROOT_DIRNAME/first-dir/file1,v <-- file1
+new revision: 1\.2; previous revision: 1\.1
+done"
+ cd ../../1/first-dir
+ echo wibble1 >>file1
+ dotest conflicts4-8 "${testcvs} -Q update" \
+"RCS file: $CVSROOT_DIRNAME/first-dir/file1,v
+retrieving revision 1\.1
+retrieving revision 1\.2
+Merging differences between 1\.1 and 1\.2 into file1
+rcsmerge: warning: conflicts during merge
+cvs update: conflicts found in file1"
+ dotest_fail conflicts4-9 "${testcvs} -q update" \
+"C file1"
+
+ if $remote; then
+ cat >$TESTDIR/conflicts4/serveme <<EOF
+#!$TESTSHELL
+# This is admittedly a bit cheezy, in the sense that we make lots
+# of assumptions about what the client is going to send us.
+# We don't mention Repository, because current clients don't require it.
+# Sending these at our own pace, rather than waiting for the client to
+# make the requests, is bogus, but hopefully we can get away with it.
+echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update Global_option"
+echo "ok"
+echo "MT text C "
+echo "MT fname file1"
+echo "MT newline"
+echo "error "
+cat >$TESTDIR/conflicts4/client.out
+EOF
+ # Cygwin. Pthffffffffft!
+ if test -n "$remotehost"; then
+ $CVS_RSH $remotehost "chmod +x $TESTDIR/conflicts4/serveme"
+ else
+ chmod +x $TESTDIR/conflicts4/serveme
+ fi
+ save_CVS_SERVER=$CVS_SERVER
+ CVS_SERVER=$TESTDIR/conflicts4/serveme; export CVS_SERVER
+ dotest_fail conflicts4-10r "$testcvs -q up" "C file1"
+ dotest conflicts4-11r "cat $TESTDIR/conflicts4/client.out" \
+"$DOTSTAR
+Argument --
+Directory .
+$CVSROOT_DIRNAME/first-dir
+Entry /file1/1.2/+=//
+Modified file1
+u=rw,g=rw,o=r
+59
+baseline
+""<<<<<<< file1
+wibble1
+""=======
+wibble2
+"">>>>>>> 1.2
+update"
+
+ cat >$TESTDIR/conflicts4/serveme <<EOF
+#!$TESTSHELL
+# This is admittedly a bit cheezy, in the sense that we make lots
+# of assumptions about what the client is going to send us.
+# We don't mention Repository, because current clients don't require it.
+# Sending these at our own pace, rather than waiting for the client to
+# make the requests, is bogus, but hopefully we can get away with it.
+echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update Global_option Empty-conflicts"
+echo "ok"
+echo "MT text C "
+echo "MT fname file1"
+echo "MT newline"
+echo "error "
+cat >$TESTDIR/conflicts4/client.out
+EOF
+
+ dotest_fail conflicts4-12r "$testcvs -q up" "C file1"
+ dotest conflicts4-13r "cat $TESTDIR/conflicts4/client.out" \
+"$DOTSTAR
+Argument --
+Directory .
+$CVSROOT_DIRNAME/first-dir
+Entry /file1/1.2/+=//
+Unchanged file1
+update"
+
+ CVS_SERVER=$save_CVS_SERVER; export CVS_SERVER
+ fi
+
+ if $keep; then
+ echo Keeping $TESTDIR and exiting due to --keep
+ exit 0
+ fi
+
+ cd ../../..
+ rm -rf conflicts4
+ rm -rf $CVSROOT_DIRNAME/first-dir
+ ;;
+
clean)
# Test update -C (overwrite local mods w/ repository copies)
mkdir 1; cd 1
@@ -11430,9 +12361,10 @@ done"
"Directory ${CVSROOT_DIRNAME}/first-dir added to the repository"
cd first-dir
- mkdir subdir
- dotest modules4-3 "${testcvs} add subdir" \
-"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository"
+ mkdir subdir subdir_long
+ dotest modules4-3 "${testcvs} add subdir subdir_long" \
+"Directory ${CVSROOT_DIRNAME}/first-dir/subdir added to the repository
+Directory ${CVSROOT_DIRNAME}/first-dir/subdir_long added to the repository"
echo file1 > file1
dotest modules4-4 "${testcvs} add file1" \
@@ -11444,7 +12376,12 @@ done"
"${PROG}"' add: scheduling file `subdir/file2'\'' for addition
'"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
- dotest modules4-6 "${testcvs} -q ci -m add-it" \
+ echo file3 > subdir_long/file3
+ dotest modules4-6 "${testcvs} add subdir_long/file3" \
+"${PROG}"' add: scheduling file `subdir_long/file3'\'' for addition
+'"${PROG}"' add: use .'"${PROG}"' commit. to add this file permanently'
+
+ dotest modules4-7 "${testcvs} -q ci -m add-it" \
"RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
done
Checking in file1;
@@ -11456,19 +12393,26 @@ done
Checking in subdir/file2;
${CVSROOT_DIRNAME}/first-dir/subdir/file2,v <-- file2
initial revision: 1\.1
+done
+RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir_long/file3,v
+done
+Checking in subdir_long/file3;
+${CVSROOT_DIRNAME}/first-dir/subdir_long/file3,v <-- file3
+initial revision: 1\.1
done"
cd ..
- dotest modules4-7 "${testcvs} -q update -d CVSROOT" \
+ dotest modules4-8 "${testcvs} -q update -d CVSROOT" \
"U CVSROOT${DOTSTAR}"
cd CVSROOT
cat >modules <<EOF
all -a first-dir
some -a !first-dir/subdir first-dir
+other -a !first-dir/subdir !first-dir/subdir_long first-dir
somewhat -a first-dir !first-dir/subdir
EOF
- dotest modules4-8 "${testcvs} -q ci -m add-modules" \
+ dotest modules4-9 "${testcvs} -q ci -m add-modules" \
"Checking in modules;
${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
@@ -11479,39 +12423,56 @@ ${PROG} commit: Rebuilding administrative file database"
cd ..
mkdir 2; cd 2
- dotest modules4-9 "${testcvs} -q co all" \
+ dotest modules4-10 "${testcvs} -q co all" \
"U first-dir/file1
-U first-dir/subdir/file2"
+U first-dir/subdir/file2
+U first-dir/subdir_long/file3"
rm -r first-dir
- dotest modules4-10 "${testcvs} -q co some" "U first-dir/file1"
- dotest_fail modules4-11 "test -d first-dir/subdir" ''
+ dotest modules4-11 "${testcvs} -q co some" \
+"U first-dir/file1
+U first-dir/subdir_long/file3"
+ dotest_fail modules4-12 "test -d first-dir/subdir" ''
+ dotest modules4-13 "test -d first-dir/subdir_long" ''
rm -r first-dir
if $remote; then
# But remote seems to do it the other way.
- dotest modules4-11a "${testcvs} -q co somewhat" "U first-dir/file1"
- dotest_fail modules4-11b "test -d first-dir/subdir" ''
+ dotest modules4-14r-1 "${testcvs} -q co somewhat" \
+"U first-dir/file1
+U first-dir/subdir_long/file3"
+ dotest_fail modules4-14r-2 "test -d first-dir/subdir" ''
+ dotest modules4-14r-3 "test -d first-dir/subdir_long" ''
else
# This is strange behavior, in that the order of the
# "!first-dir/subdir" and "first-dir" matter, and it isn't
# clear that they should. I suspect it is long-standing
# strange behavior but I haven't verified that.
- dotest modules4-11a "${testcvs} -q co somewhat" \
+ dotest modules4-14-1 "${testcvs} -q co somewhat" \
"U first-dir/file1
-U first-dir/subdir/file2"
+U first-dir/subdir/file2
+U first-dir/subdir_long/file3"
+ dotest modules4-14-2 "test -d first-dir/subdir" ''
+ dotest modules4-14-3 "test -d first-dir/subdir_long" ''
fi
rm -r first-dir
+ dotest modules4-15 "${testcvs} -q co other" \
+"U first-dir/file1"
+ dotest_fail modules4-16 "test -d first-dir/subdir" ''
+ dotest_fail modules4-17 "test -d first-dir/subdir_long" ''
+ rm -r first-dir
+
cd ..
rm -r 2
- dotest modules4-12 "${testcvs} rtag tag some" \
+ dotest modules4-18 "${testcvs} rtag tag some" \
"${PROG} rtag: Tagging first-dir
-${PROG} rtag: Ignoring first-dir/subdir"
+${PROG} rtag: Ignoring first-dir/subdir
+${PROG} rtag: Tagging first-dir/subdir_long"
cd 1/first-dir/subdir
- dotest modules4-13 "${testcvs} log file2" "
+ dotest modules4-19 "${testcvs} log file2" "
RCS file: ${CVSROOT_DIRNAME}/first-dir/subdir/file2,v
Working file: file2
head: 1\.1
@@ -11528,6 +12489,11 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
add-it
============================================================================="
+ if $keep; then
+ echo Keeping $TESTDIR and exiting due to --keep
+ exit 0
+ fi
+
cd ../../..
rm -r 1
@@ -11623,7 +12589,14 @@ ${PROG} commit: Rebuilding administrative file database"
# Test that real modules check out to realmodule/a, not subdir/a.
if $remote; then
- dotest modules5-8 "${testcvs} co realmodule" \
+ # FIXCVS?
+ # Mac OSX 10.3 (Darwin ppc-osx1 5.5) fails here when $TMPDIR
+ # contains a symlink (it does not fail the local modules5-8).
+ # Since no other platforms are exhibiting the same problem, I
+ # suspect an issue with OSX and fork() or the like dereferencing
+ # the symlink, but it is possible it is something that could be
+ # fixed or worked around in CVS.
+ dotest modules5-8r "$testcvs co realmodule" \
"U realmodule/a
${PROG} checkout: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
checkout script invoked in ${TMPDIR}/cvs-serv[0-9a-z]*
@@ -11992,6 +12965,78 @@ ${PROG} commit: Rebuilding administrative file database"
fi
;;
+
+
+ modules7)
+ #
+ # Test tag problems vs an empty CVSROOT/val-tags file
+ #
+ # See the header comment for the `modules' test for an index of
+ # the complete suite of modules tests.
+ #
+ mkdir modules7
+ cd modules7
+ dotest modules7-1 "$testcvs -Q co -d top ."
+ cd top
+ mkdir zero one
+ dotest modules7-2 "$testcvs -Q add zero one"
+ cd one
+ echo 'file1 contents' > file1
+ dotest modules7-2 "$testcvs -Q add file1"
+ dotest modules7-3 "$testcvs -Q ci -mnew file1" \
+"RCS file: $CVSROOT_DIRNAME/one/file1,v
+done
+Checking in file1;
+$CVSROOT_DIRNAME/one/file1,v <-- file1
+initial revision: 1\.1
+done"
+ dotest modules7-4 "$testcvs -Q tag mytag file1"
+ cd ../CVSROOT
+ echo 'all -a zero one' > modules
+ dotest modules7-5 "$testcvs -Q ci -mall-module" \
+"Checking in modules;
+$CVSROOT_DIRNAME/CVSROOT/modules,v <-- modules
+new revision: [0-9.]*; previous revision: [0-9.]*
+done
+$PROG commit: Rebuilding administrative file database"
+ cd ../..
+ mkdir myexport
+ cd myexport
+ # FIXCVS: The export should NOT be aborted here
+ dotest_fail modules7-6 "$testcvs export -rmytag all" \
+"$PROG \[export aborted\]: no such tag mytag"
+ cd ..
+ rm -fr myexport
+ mkdir myexport
+ cd myexport
+ # FIXCVS: Workaround is to have mytag listed in val-tags
+ echo 'mytag y' > $CVSROOT_DIRNAME/CVSROOT/val-tags
+ dotest modules7-7 "$testcvs export -rmytag all" \
+"$PROG export: Updating zero
+$PROG export: Updating one
+U one/file1"
+ dotest modules7-8 'cat one/file1' 'file1 contents'
+
+ if $keep; then
+ echo Keeping $TESTDIR and exiting due to --keep
+ exit 0
+ fi
+
+ # cleanup
+ cd ../top/CVSROOT
+ echo "# empty modules file" >modules
+ dotest modules7-cleanup-1 "$testcvs -Q ci -mempty-modules" \
+"Checking in modules;
+$CVSROOT_DIRNAME/CVSROOT/modules,v <-- modules
+new revision: [0-9.]*; previous revision: [0-9.]*
+done
+$PROG commit: Rebuilding administrative file database"
+ cd ../../..
+ rm -fr modules7
+ rm -rf $CVSROOT_DIRNAME/zero $CVSROOT_DIRNAME/one
+ ;;
+
+
mkmodules)
# When a file listed in checkoutlist doesn't exist, cvs-1.10.4
# would fail to remove the CVSROOT/.#[0-9]* temporary file it
@@ -13651,7 +14696,11 @@ ${PROG} \[checkout aborted\]: than the 0 which Max-dotdot specified"
# cvs checkout: warning: cannot make directory CVS in /: Permission denied
# cvs [checkout aborted]: cannot make directory /foo: Permission denied
# $
- dotest_fail abspath2-1 "${testcvs} co /foo" \
+ #
+ # The -z9 in this test also checks for an old server bug where the
+ # server would block indefinitely attempting to read an EOF from the
+ # client in the compression buffer shutdown routine.
+ dotest_fail abspath2-1 "$testcvs -z9 co /foo" \
"$PROG \[checkout aborted\]: Absolute module reference invalid: \`/foo'" \
"$PROG \[server aborted\]: Absolute module reference invalid: \`/foo'
$PROG \[checkout aborted\]: end of file from server (consult above messages if any)"
@@ -13772,7 +14821,6 @@ U top-dir/file1"
"${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
${PROG} checkout: Updating top-dir" \
"${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
-${PROG} checkout: warning: cannot make directory CVS in \.: Permission denied
${PROG} checkout: in directory \.:
${PROG} checkout: cannot open CVS/Entries for reading: No such file or directory
${PROG} checkout: Updating top-dir"
@@ -13893,14 +14941,14 @@ ${PROG} commit: Rebuilding administrative file database"
rstar-toplevel)
- # FIXCVS:
- # This test confirms a bug that exists in the r* commands currently
- # when run against the top-level project.
+ # This test used to confirm a bug that existed in the r* commands
+ # run against the top-level project prior to CVS 1.11.18 & 1.12.10.
#
- # The assertion failure is something like:
+ # The assertion failure was something like:
# do_recursion: Assertion \`strstr (repository, \"/\./\") == ((void \*)0)' failed\..*"
- dotest_fail rstar-toplevel-1 "$testcvs rlog ." \
-"${DOTSTAR}ssertion.*failed${DOTSTAR}" "${DOTSTAR}failed assertion${DOTSTAR}"
+ dotest rstar-toplevel-1 "$testcvs -q rlog ." \
+"
+RCS file: $CVSROOT_DIRNAME/CVSROOT$DOTSTAR"
if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
@@ -14798,7 +15846,7 @@ U first-dir/abc'
# Now do it again, after removing the val-tags file created
# by devcom-t1 to force CVS to search the repository
# containing CVS directories.
- rm ${CVSROOT_DIRNAME}/CVSROOT/val-tags
+ rm -f ${CVSROOT_DIRNAME}/CVSROOT/val-tags
mkdir 3
cd 3
dotest devcom-t3 "${testcvs} -q co -rtag first-dir" \
@@ -15183,6 +16231,94 @@ done"
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
+
+
+ watch6)
+ # Check that `cvs watch on' does not reset the fileattr file.
+ mkdir watch6; cd watch6
+
+ dotest watch6-setup-1 "$testcvs -Q co -ldtop ."
+ cd top
+ mkdir watch6
+ dotest watch6-setup-2 "$testcvs -Q add watch6"
+
+ cd ..
+ dotest watch6-setup-3 "$testcvs -Q co watch6"
+ cd watch6
+
+ mkdir subdir
+ dotest watch6-setup-4 "$testcvs -Q add subdir"
+ cd subdir
+
+ # START watch add/remove sequence
+ dotest watch6-1 "$testcvs -Q watch add"
+ dotest watch6-2 \
+"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
+
+ dotest watch6-3 "$testcvs watch on"
+ dotest watch6-4 \
+"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
+ dotest watch6-5 \
+"grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
+
+ dotest watch6-6 "$testcvs watch off"
+ dotest watch6-7 \
+"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
+ dotest_fail watch6-8 \
+"grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
+
+ dotest watch6-9 "$testcvs watch remove"
+ dotest_fail watch6-10 \
+"test -d $CVSROOT_DIRNAME/test-directory/subdir/CVS"
+ dotest_fail watch6-11 \
+"test -f $CVSROOT_DIRNAME/test-directory/subdir/CVS/fileattr"
+ # END watch add/remove sequence
+
+ echo Hi there >afile
+ dotest watch6-12 "$testcvs -Q add afile"
+ dotest watch6-13 "$testcvs ci -m 'A file' afile" \
+"RCS file: $CVSROOT_DIRNAME/watch6/subdir/afile,v
+done
+Checking in afile;
+$CVSROOT_DIRNAME/watch6/subdir/afile,v <-- afile
+initial revision: 1\.1
+done"
+
+ # START watch add/remove sequence
+ dotest watch6-14 "$testcvs -Q watch add"
+ dotest watch6-15 \
+"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
+
+ dotest watch6-16 "$testcvs watch on"
+ dotest watch6-17 \
+"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
+ dotest watch6-18 \
+"grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
+
+ dotest watch6-19 "$testcvs watch off"
+ dotest watch6-20 \
+"grep '_watchers' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
+ dotest_fail watch6-21 \
+"grep '_watched' $CVSROOT_DIRNAME/watch6/subdir/CVS/fileattr >/dev/null"
+
+ dotest watch6-22 "$testcvs watch remove"
+ dotest_fail watch6-23 \
+"test -d $CVSROOT_DIRNAME/test-directory/subdir/CVS"
+ dotest_fail watch6-24 \
+"test -f $CVSROOT_DIRNAME/test-directory/subdir/CVS/fileattr"
+ # END watch add/remove sequence
+
+ if $keep; then
+ echo Keeping $TESTDIR and exiting due to --keep
+ exit 0
+ fi
+ cd ../../..
+ rm -r watch6
+ rm -rf $CVSROOT_DIRNAME/watch6
+ ;;
+
+
+
unedit-without-baserev)
mkdir 1; cd 1
module=x
@@ -15465,7 +16601,7 @@ T file1'
dotest ignore-on-branch-5 "$testcvs -q ci -mbranch file2" \
"Checking in file2;
$CVSROOT_DIRNAME/ignore-on-branch/file2,v <-- file2
-new revision: 1\.1\.2\.1; previous revision: 1\.1
+new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
done"
dotest ignore-on-branch-6 "$testcvs -q up -rbranch2" \
"${PROG} update: file2 is no longer in the repository"
@@ -15523,6 +16659,24 @@ File: binfile Status: Up-to-date
Sticky Date: (none)
Sticky Options: -kb"
+ # Test that "-kk" does not override "-kb"
+ cd ../..
+ mkdir 2a; cd 2a
+ dotest binfiles-5.5a0 "${testcvs} -q co -kk first-dir" 'U first-dir/binfile'
+ cd first-dir
+ # Testing that sticky options is -kb is the closest thing we have
+ # to testing that binary files work right on non-unix machines
+ # (until there is automated testing for such machines, of course).
+ dotest binfiles-5.5a1 "${testcvs} status binfile" \
+"===================================================================
+File: binfile Status: Up-to-date
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: -kb"
+
# Test whether the default options from the RCS file are
# also used when operating on files instead of whole
# directories
@@ -15542,6 +16696,22 @@ File: binfile Status: Up-to-date
Sticky Options: -kb"
cd ../..
rm -r 3
+ # test that "-kk" does not override "-kb"
+ mkdir 3; cd 3
+ dotest binfiles-5.5c0 "${testcvs} -q co -kk first-dir/binfile" \
+'U first-dir/binfile'
+ cd first-dir
+ dotest binfiles-5.5c1 "${testcvs} status binfile" \
+"===================================================================
+File: binfile Status: Up-to-date
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/binfile,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: -kb"
+ cd ../..
+ rm -r 3
cd 2/first-dir
cp ../../1/binfile2.dat binfile
@@ -15564,11 +16734,13 @@ done"
cd ../../2/first-dir
echo 'edits in dir 2' >binfile
dotest binfiles-con1 "${testcvs} -q update" \
-"U binfile
-${PROG} update: nonmergeable file needs merge
+"$PROG update: nonmergeable file needs merge
${PROG} update: revision 1\.3 from repository is now in binfile
${PROG} update: file from working directory is now in \.#binfile\.1\.2
C binfile"
+
+ dotest_fail binfiles-con1b "$testcvs -q up" "C binfile"
+
dotest binfiles-con2 "cmp binfile ../../1/binfile.dat" ''
dotest binfiles-con3 "cat .#binfile.1.2" 'edits in dir 2'
@@ -15582,9 +16754,11 @@ done"
dotest binfiles-con5 "${testcvs} -q update" '[UP] binfile'
dotest binfiles-9 "${testcvs} -q update -A" ''
- dotest binfiles-10 "${testcvs} -q update -kk" '[UP] binfile'
+ # "-kk" no longer does anything with "-kb"
+ dotest binfiles-10 "${testcvs} -q update -kk" ''
dotest binfiles-11 "${testcvs} -q update" ''
- dotest binfiles-12 "${testcvs} -q update -A" '[UP] binfile'
+ # "-kk" no longer does anything with "-kb"
+ dotest binfiles-12 "${testcvs} -q update -A" ''
dotest binfiles-13 "${testcvs} -q update -A" ''
cd ../..
@@ -16590,27 +17764,13 @@ done"
cd ../..
cd m1/first-dir
echo "changed in m1" >aa
- if $remote; then
- # The tagged text code swallows up "U aa" but isn't yet up to
- # trying to figure out how it interacts with the "C aa" and
- # other stuff. The whole deal of having both is pretty iffy.
- dotest mwrap-7 "${testcvs} -nq update" \
+ dotest mwrap-7 "$testcvs -nq update" \
"${PROG} update: nonmergeable file needs merge
${PROG} update: revision 1\.2 from repository is now in aa
${PROG} update: file from working directory is now in \.#aa\.1\.1
-C aa
-U aa"
- else
- dotest mwrap-7 "${testcvs} -nq update" \
-"U aa
-${PROG} update: nonmergeable file needs merge
-${PROG} update: revision 1\.2 from repository is now in aa
-${PROG} update: file from working directory is now in \.#aa\.1\.1
C aa"
- fi
dotest mwrap-8 "${testcvs} -q update" \
-"U aa
-${PROG} update: nonmergeable file needs merge
+"$PROG update: nonmergeable file needs merge
${PROG} update: revision 1\.2 from repository is now in aa
${PROG} update: file from working directory is now in \.#aa\.1\.1
C aa"
@@ -17594,6 +18754,28 @@ ${log_rev3}
${log_rev2}
${log_trailer}"
+ # Test BASE pseudotag
+ dotest log-23 "${testcvs} log -rBASE file1" \
+"${log_header1}
+${log_tags1}
+${log_keyword}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev2b}
+${log_trailer}"
+
+ dotest log-24 "${testcvs} -q up -r1.2 file1" "[UP] file1"
+ dotest log-25 "${testcvs} log -rBASE file1" \
+"${log_header1}
+${log_tags1}
+${log_keyword}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev2}
+${log_trailer}"
+
+ dotest log-26 "${testcvs} -q up -rbranch file1" "[UP] file1"
+
# Now the same tests but with rlog
dotest log-r11 "${testcvs} rlog first-dir/file1" \
@@ -17817,6 +18999,26 @@ ${log_rev3}
${log_rev2}
${log_trailer}"
+ # Test BASE pseudotag
+ dotest log-r23 "${testcvs} rlog -rBASE first-dir/file1" \
+"${PROG} rlog: warning: no revision .BASE. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
+${rlog_header1}
+${log_tags1}
+${log_keyword}
+total revisions: 5; selected revisions: 0
+description:
+${log_trailer}"
+
+ dotest log-r24 "${testcvs} -q up -r1.2 file1" "[UP] file1"
+ dotest log-r25 "${testcvs} rlog -rBASE first-dir/file1" \
+"${PROG} rlog: warning: no revision .BASE. in .${CVSROOT_DIRNAME}/first-dir/file1,v.
+${rlog_header1}
+${log_tags1}
+${log_keyword}
+total revisions: 5; selected revisions: 0
+description:
+${log_trailer}"
+
# Test when head is dead
dotest log-d0 "${testcvs} -q up -A" \
@@ -18428,47 +19630,47 @@ done"
"
Annotations for file1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1 (${username} *[0-9a-zA-Z-]*): this
-1\.1 (${username} *[0-9a-zA-Z-]*): is
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.3 (${username} *[0-9a-zA-Z-]*): trunk file
-1\.2 (${username} *[0-9a-zA-Z-]*):
-1\.2 (${username} *[0-9a-zA-Z-]*): with
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.2 (${username} *[0-9a-zA-Z-]*): blank
-1\.2 (${username} *[0-9a-zA-Z-]*): line"
+1\.1 ($username8 *[0-9a-zA-Z-]*): this
+1\.1 ($username8 *[0-9a-zA-Z-]*): is
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.3 ($username8 *[0-9a-zA-Z-]*): trunk file
+1\.2 ($username8 *[0-9a-zA-Z-]*):
+1\.2 ($username8 *[0-9a-zA-Z-]*): with
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.2 ($username8 *[0-9a-zA-Z-]*): blank
+1\.2 ($username8 *[0-9a-zA-Z-]*): line"
dotest ann-11 "${testcvs} ann -r br" \
"
Annotations for file1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1 (${username} *[0-9a-zA-Z-]*): this
-1\.1 (${username} *[0-9a-zA-Z-]*): is
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.1 (${username} *[0-9a-zA-Z-]*): file
-1\.2 (${username} *[0-9a-zA-Z-]*):
-1\.2 (${username} *[0-9a-zA-Z-]*): with
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.2 (${username} *[0-9a-zA-Z-]*): blank
-1\.2 (${username} *[0-9a-zA-Z-]*): line
-1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
-1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
+1\.1 ($username8 *[0-9a-zA-Z-]*): this
+1\.1 ($username8 *[0-9a-zA-Z-]*): is
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.1 ($username8 *[0-9a-zA-Z-]*): file
+1\.2 ($username8 *[0-9a-zA-Z-]*):
+1\.2 ($username8 *[0-9a-zA-Z-]*): with
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.2 ($username8 *[0-9a-zA-Z-]*): blank
+1\.2 ($username8 *[0-9a-zA-Z-]*): line
+1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): and some
+1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): branched content"
# 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
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1 (${username} *[0-9a-zA-Z-]*): this
-1\.1 (${username} *[0-9a-zA-Z-]*): is
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.1 (${username} *[0-9a-zA-Z-]*): file
-1\.2 (${username} *[0-9a-zA-Z-]*):
-1\.2 (${username} *[0-9a-zA-Z-]*): with
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.2 (${username} *[0-9a-zA-Z-]*): blank
-1\.2 (${username} *[0-9a-zA-Z-]*): line
-1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
-1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
+1\.1 ($username8 *[0-9a-zA-Z-]*): this
+1\.1 ($username8 *[0-9a-zA-Z-]*): is
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.1 ($username8 *[0-9a-zA-Z-]*): file
+1\.2 ($username8 *[0-9a-zA-Z-]*):
+1\.2 ($username8 *[0-9a-zA-Z-]*): with
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.2 ($username8 *[0-9a-zA-Z-]*): blank
+1\.2 ($username8 *[0-9a-zA-Z-]*): line
+1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): and some
+1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): branched content"
dotest_fail ann-14 "${testcvs} ann -r bill-clintons-chastity file1" \
"${PROG} \[annotate aborted\]: no such tag bill-clintons-chastity"
@@ -18480,46 +19682,46 @@ Annotations for file1
"
Annotations for first-dir/file1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1 (${username} *[0-9a-zA-Z-]*): this
-1\.1 (${username} *[0-9a-zA-Z-]*): is
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.3 (${username} *[0-9a-zA-Z-]*): trunk file
-1\.2 (${username} *[0-9a-zA-Z-]*):
-1\.2 (${username} *[0-9a-zA-Z-]*): with
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.2 (${username} *[0-9a-zA-Z-]*): blank
-1\.2 (${username} *[0-9a-zA-Z-]*): line"
+1\.1 ($username8 *[0-9a-zA-Z-]*): this
+1\.1 ($username8 *[0-9a-zA-Z-]*): is
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.3 ($username8 *[0-9a-zA-Z-]*): trunk file
+1\.2 ($username8 *[0-9a-zA-Z-]*):
+1\.2 ($username8 *[0-9a-zA-Z-]*): with
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.2 ($username8 *[0-9a-zA-Z-]*): blank
+1\.2 ($username8 *[0-9a-zA-Z-]*): line"
dotest ann-r11 "${testcvs} rann -r br first-dir" \
"
Annotations for first-dir/file1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1 (${username} *[0-9a-zA-Z-]*): this
-1\.1 (${username} *[0-9a-zA-Z-]*): is
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.1 (${username} *[0-9a-zA-Z-]*): file
-1\.2 (${username} *[0-9a-zA-Z-]*):
-1\.2 (${username} *[0-9a-zA-Z-]*): with
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.2 (${username} *[0-9a-zA-Z-]*): blank
-1\.2 (${username} *[0-9a-zA-Z-]*): line
-1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
-1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
+1\.1 ($username8 *[0-9a-zA-Z-]*): this
+1\.1 ($username8 *[0-9a-zA-Z-]*): is
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.1 ($username8 *[0-9a-zA-Z-]*): file
+1\.2 ($username8 *[0-9a-zA-Z-]*):
+1\.2 ($username8 *[0-9a-zA-Z-]*): with
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.2 ($username8 *[0-9a-zA-Z-]*): blank
+1\.2 ($username8 *[0-9a-zA-Z-]*): line
+1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): and some
+1\.2\.2\.1 ($username8 *[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
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1 (${username} *[0-9a-zA-Z-]*): this
-1\.1 (${username} *[0-9a-zA-Z-]*): is
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.1 (${username} *[0-9a-zA-Z-]*): file
-1\.2 (${username} *[0-9a-zA-Z-]*):
-1\.2 (${username} *[0-9a-zA-Z-]*): with
-1\.2 (${username} *[0-9a-zA-Z-]*): a
-1\.2 (${username} *[0-9a-zA-Z-]*): blank
-1\.2 (${username} *[0-9a-zA-Z-]*): line
-1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): and some
-1\.2\.2\.1 (${username} *[0-9a-zA-Z-]*): branched content"
+1\.1 ($username8 *[0-9a-zA-Z-]*): this
+1\.1 ($username8 *[0-9a-zA-Z-]*): is
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.1 ($username8 *[0-9a-zA-Z-]*): file
+1\.2 ($username8 *[0-9a-zA-Z-]*):
+1\.2 ($username8 *[0-9a-zA-Z-]*): with
+1\.2 ($username8 *[0-9a-zA-Z-]*): a
+1\.2 ($username8 *[0-9a-zA-Z-]*): blank
+1\.2 ($username8 *[0-9a-zA-Z-]*): line
+1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): and some
+1\.2\.2\.1 ($username8 *[0-9a-zA-Z-]*): branched content"
dotest_fail ann-r14 "${testcvs} rann -r bill-clintons-chastity first-dir/file1" \
"${PROG} \[rannotate aborted\]: no such tag bill-clintons-chastity"
@@ -18566,8 +19768,8 @@ done"
"
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"
+1.2 ($username8 *[0-9a-zA-Z-]*): "'\$'"Id: $file,v 1.1 [0-9/]* [0-9:]* $username Exp "'\$'"
+1.2 ($username8 *[0-9a-zA-Z-]*): line2"
cd ../..
rm -rf 1
@@ -18585,24 +19787,22 @@ Annotations for $file
# local.
if $remote; then
+ # Use :ext: rather than :fork:. Most of the tests use :fork:,
+ # so we want to make sure that we test :ext: _somewhere_.
+ # Make sure 'rsh' works first.
+ depends_on_rsh "$CVS_RSH"
+ if test $? -eq 77; then
+ skip crerepos "$skipreason"
+ continue
+ fi
+
# For remote, just create the repository. We don't yet do
# the various other tests above for remote but that should be
# changed.
mkdir crerepos
mkdir crerepos/CVSROOT
- # Use :ext: rather than :fork:. Most of the tests use :fork:,
- # so we want to make sure that we test :ext: _somewhere_.
-
- # Maybe a bit dubious in the sense that people need to
- # have rsh working to run the tests, but at least it
- # isn't inetd :-). Might want to think harder about this -
- # maybe try :ext:, and if it fails, print a (single, nice)
- # message and fall back to :fork:. Maybe testing :ext:
- # with our own CVS_RSH rather than worrying about a system one
- # would do the trick.
-
- # Make sure server ignores real ${HOME}/.cvsrc:
+ # Make sure server ignores real ${HOME}/.cvsrc:
cat >$TESTDIR/cvs-setHome <<EOF
#!/bin/sh
HOME=$HOME
@@ -18613,20 +19813,7 @@ EOF
# Note that we set CVS_SERVER at the beginning.
CVS_SERVER=$TESTDIR/cvs-setHome; export CVS_SERVER
-
- if test -n "$remotehost"; then
- CREREPOS_ROOT=:ext:$remotehost${TESTDIR}/crerepos
- else
- CREREPOS_ROOT=:ext:`hostname`:${TESTDIR}/crerepos
- fi
-
- # If we're going to do remote testing, make sure 'rsh' works first.
- host="`hostname`"
- if test "x`${CVS_RSH} $host -n 'echo hi'`" != "xhi"; then
- echo "ERROR: cannot test remote CVS, because \`${CVS_RSH} $host' fails." >&2
- exit 1
- fi
-
+ CREREPOS_ROOT=:ext:$host$TESTDIR/crerepos
else
# First, if the repository doesn't exist at all...
@@ -18704,8 +19891,10 @@ ${PROG} \[[a-z]* aborted\]: Bad CVSROOT: .:ext:${hostname}:crerepos.\."
# 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} \[checkout aborted\]: end of file from server (consult above messages if any)" \
-"${PROG} \[checkout aborted\]: received broken pipe signal"
+"${PROG} \[checkout aborted\]: .*" \
+"${PROG} checkout: CVSROOT is set for a remote access method but your
+${PROG} checkout: CVS executable doesn't support it\.
+${PROG} \[checkout aborted\]: Bad CVSROOT: .\.\./crerepos.\."
cd ..
rm -r 1
@@ -19514,6 +20703,125 @@ File: file1 Status: Up-to-date
rm -rf ${CVSROOT_DIRNAME}/rcs4-dir
;;
+
+
+ rcs5)
+ # Some tests of the $Log keyword and log message without a trailing
+ # EOL. This used to look ugly and, in the worst case, could cause
+ # a seg fault due to a buffer overflow.
+ #
+ # Note that it should not be possible to create this situation via a
+ # CVS server (and any client), since the server itself inserts the
+ # trailing EOL onto log messages that are missing one. Still, we
+ # shouldn't segfault due to a corrupt RCS file and I think that a log
+ # message without the trailing EOL doesn't actually violate the RCS
+ # spec, though it doesn't appear to be possible to create such a log
+ # message using RCS 5.7.
+
+ mkdir $CVSROOT_DIRNAME/rcs5
+ cat <<\EOF >$CVSROOT_DIRNAME/rcs5/file1,v
+head 1.1;
+access;
+symbols;
+locks;
+expand kv;
+
+1.1 date 2007.03.20.04.03.02; author jeremiah; state Ext; branches; next;
+
+desc
+@@
+
+1.1
+log
+@he always had very fine wine@
+text
+@line1
+/*
+EOF
+echo ' * Revision history: $''Log$' >>$CVSROOT_DIRNAME/rcs5/file1,v
+ cat <<\EOF >>$CVSROOT_DIRNAME/rcs5/file1,v
+ */
+line5
+@
+EOF
+
+ mkdir rcs5
+ cd rcs5
+ dotest rcs5-1 "$testcvs -Q co rcs5"
+ dotest rcs5-2 "cat rcs5/file1" \
+"line1
+/\\*
+ \\* Revision history: "'\$'"Log: file1,v "'\$'"
+ \\* Revision history: Revision 1\.1 2007/03/20 04:03:02 jeremiah
+ \\* Revision history: he always had very fine wine
+ \\* Revision history:
+ \\*/
+line5"
+
+ cd ..
+ rm -r rcs5
+ rm -rf $CVSROOT_DIRNAME/rcs5
+ ;;
+
+
+
+ rcs6)
+ # Test that CVS notices a specific type of corruption in the RCS
+ # archive. In the past, this type of corruption had turned up after
+ # a user ineptly attempted to delete a revision from an arcvhive
+ # manually.
+ mkdir rcs6; cd rcs6
+
+ # Make the project.
+ dotest rcs6-init-1 "$testcvs -Q co -ld top .; cd top"
+ mkdir rcs6
+ dotest rcs6-init-2 "$testcvs -Q add rcs6"
+ cd rcs6
+
+ # Populate it.
+ echo some words >afile
+ dotest rcs6-init-3 "$testcvs -Q add afile"
+ dotest rcs6-init-4 "$testcvs -Q ci -mnewfile afile" \
+"RCS file: $CVSROOT_DIRNAME/rcs6/afile,v
+done
+Checking in afile;
+$CVSROOT_DIRNAME/rcs6/afile,v <-- afile
+initial revision: 1\.1
+done"
+ echo more words >>afile
+ dotest rcs6-init-5 "$testcvs -Q ci -mrev2 afile" \
+"Checking in afile;
+$CVSROOT_DIRNAME/rcs6/afile,v <-- afile
+new revision: 1\.2; previous revision: 1\.1
+done"
+
+ # Corrupt the archive.
+ sed -e '8,12d' \
+ -e 's/^head 1\.2/head 1.1/' \
+ <$CVSROOT_DIRNAME/rcs6/afile,v \
+ >$CVSROOT_DIRNAME/rcs6/cfile,v
+
+ # Update used to work.
+ dotest_fail rcs6-1 "$testcvs -q up" \
+"$PROG \[update aborted\]: Expected head revision 1\.1, found 1\.2\."
+
+ # Then a commit hosed the archive further without any warnings.
+ # Updating to an old revision (e.g. 1.1) would have reported the
+ # corruption. A second commit would have deleted data from the
+ # file.
+
+ if $keep; then
+ echo Keeping $TESTDIR and exiting due to --keep
+ exit 0
+ fi
+
+ cd ../../..
+ rm -r rcs6
+ rm -rf $CVSROOT_DIRNAME/rcs6
+ ;;
+
+
+
lockfiles)
# Tests of CVS lock files.
# TODO-maybe: Add a test where we arrange for a loginfo
@@ -19583,6 +20891,86 @@ ${PROG} \[update aborted\]: cannot stat ${TESTDIR}/locks: No such file or direct
dotest lockfiles-8 "${testcvs} -q update" ""
dotest lockfiles-9 "${testcvs} -q co -l ." ""
+ ###
+ ### There are race conditions in the following tests, but hopefully
+ ### the 5 seconds the first process waits to remove the lockdir and
+ ### the 30 seconds CVS waits betweens checks will be significant
+ ### enough to render the case moot.
+ ###
+ # Considers the following cases:
+ #
+ # Lock Present
+ # Operation Allowed (case #)
+ #
+ # Read Write
+ # _______ ______
+ # Read |Yes (1) No (3)
+ # Write |No (7) No (9)
+ #
+ # Tests do not appear in same ordering as table. The odd numbering
+ # scheme maintains correspondance with a larger table on 1.12.x:
+ # 1. Read when read locks are present...
+ # 3. Don't read when write locks present...
+ # 7. Don't write when read locks are present...
+ # 9. Don't write when write locks are present...
+
+ # 3. Don't read when write locks present...
+ mkdir "$TESTDIR/locks/first-dir/#cvs.lock"
+ (sleep 5; rmdir "$TESTDIR/locks/first-dir/#cvs.lock")&
+ dotest lockfiles-10 "$testcvs -q co -l first-dir" \
+"$PROG checkout: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir
+$PROG checkout: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir"
+
+ # 1. Read when read locks are present...
+ touch "$TESTDIR/locks/first-dir/#cvs.rfl.test.lock"
+ dotest lockfiles-11 "$testcvs -q co -l first-dir"
+ rm "$TESTDIR/locks/first-dir/#cvs.rfl.test.lock"
+
+ # 7. Don't write when read locks are present...
+ echo I always have trouble coming up with witty text for the test files >>first-dir/sdir/ssdir/file1
+ touch "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.rfl.test.lock"
+ (sleep 5; rm "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.rfl.test.lock")&
+ dotest lockfiles-13 "$testcvs -q ci -mconflict first-dir" \
+"$PROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
+$PROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
+Checking in first-dir/sdir/ssdir/file1;
+$CVSROOT_DIRNAME/first-dir/sdir/ssdir/file1,v <-- file1
+new revision: 1\.2; previous revision: 1\.1
+done"
+
+ # 9. Don't write when write locks are present...
+ echo yet this poem would probably only give longfellow bile >>first-dir/sdir/ssdir/file1
+ mkdir "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.lock"
+ (sleep 5; rmdir "$TESTDIR/locks/first-dir/sdir/ssdir/#cvs.lock")&
+ dotest lockfiles-19 "$testcvs -q ci -mnot-up-to-date first-dir" \
+"$PROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
+$PROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/first-dir/sdir/ssdir
+Checking in first-dir/sdir/ssdir/file1;
+$CVSROOT_DIRNAME/first-dir/sdir/ssdir/file1,v <-- file1
+new revision: 1\.3; previous revision: 1\.2
+done"
+
+ # 10. Don't write when history locks are present...
+ echo have you ever heard a poem quite so vile\? >>first-dir/sdir/ssdir/file1
+ mkdir "$TESTDIR/locks/CVSROOT/#cvs.history.lock"
+ (sleep 5; rmdir "$TESTDIR/locks/CVSROOT/#cvs.history.lock")&
+ dotest lockfiles-20 "$testcvs -q ci -mnot-up-to-date first-dir" \
+"Checking in first-dir/sdir/ssdir/file1;
+$CVSROOT_DIRNAME/first-dir/sdir/ssdir/file1,v <-- file1
+new revision: 1\.4; previous revision: 1\.3
+done
+$PROG commit: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/CVSROOT
+$PROG commit: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/CVSROOT"
+
+ dotest lockfiles-21 "$testcvs -Q tag newtag first-dir"
+
+ rm -f $CVSROOT_DIRNAME/CVSROOT/val-tags
+ mkdir "$TESTDIR/locks/CVSROOT/#cvs.val-tags.lock"
+ (sleep 5; rmdir "$TESTDIR/locks/CVSROOT/#cvs.val-tags.lock")&
+ dotest lockfiles-22 "$testcvs -q up -r newtag first-dir" \
+"$PROG update: \[[0-9:]*\] waiting for $username's lock in $CVSROOT_DIRNAME/CVSROOT
+$PROG update: \[[0-9:]*\] obtained lock in $CVSROOT_DIRNAME/CVSROOT"
+
cd CVSROOT
echo "# nobody here but us comments" >config
dotest lockfiles-cleanup-1 "${testcvs} -q ci -m config-it" \
@@ -19892,6 +21280,149 @@ done"
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
+
+
+ sshstdio)
+ # CVS_RSH=ssh can have a problem with a non-blocking stdio
+ # in some cases. So, this test is all about testing :ext:
+ # with CVS_RSH=ssh. The problem is that not all machines
+ # will necessarily have ssh available, so be prepared to
+ # skip this test.
+
+ # Are we able to run find and use an ssh?
+ if $remote; then :; else
+ continue
+ fi
+
+ depends_on_ssh
+ if test $? -eq 77; then
+ skip sshstdio "$skipreason"
+ continue
+ fi
+
+ SSHSTDIO_ROOT=:ext:$host$CVSROOT_DIRNAME
+
+ mkdir sshstdio; cd sshstdio
+ dotest sshstdio-1 "$testcvs -d $SSHSTDIO_ROOT -q co -l ."
+ mkdir first-dir
+ dotest sshstdio-2 "$testcvs add first-dir" \
+ "Directory $CVSROOT_DIRNAME/first-dir added to the repository"
+ cd first-dir
+ a='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+ c='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+ # Generate 1024 lines of $a
+ cnt=0
+ echo $a > aaa
+ while [ $cnt -lt 5 ] ; do
+ cnt=`expr $cnt + 1` ;
+ mv aaa aaa.old
+ cat aaa.old aaa.old aaa.old aaa.old > aaa
+ done
+ dotest sshstdio-3 "$testcvs -q add aaa" \
+"$PROG add: use .$PROG commit. to add this file permanently"
+ dotest sshstdio-4 "$testcvs -q ci -mcreate aaa" \
+"RCS file: $CVSROOT_DIRNAME/first-dir/aaa,v
+done
+Checking in aaa;
+$CVSROOT_DIRNAME/first-dir/aaa,v <-- aaa
+initial revision: 1\.1
+done"
+ # replace lines 1, 512, 513, 1024 with $c
+ sed 510q < aaa > aaa.old
+ (echo $c; cat aaa.old; echo $c; \
+ echo $c; cat aaa.old; echo $c) > aaa
+ dotest sshstdio-5 "$testcvs -q ci -mmodify-it aaa" \
+"Checking in aaa;
+$CVSROOT_DIRNAME/first-dir/aaa,v <-- aaa
+new revision: 1\.2; previous revision: 1\.1
+done"
+ cat > wrapper.sh <<EOF
+#!$TESTSHELL
+exec "\$@" 2>&1 < /dev/null | cat
+EOF
+ chmod +x wrapper.sh
+ ./wrapper.sh \
+ $testcvs -z5 -Q diff --side-by-side -W 500 -r 1.1 -r 1.2 \
+ aaa \
+ |sed -e \
+'/^Write failed flushing stdout buffer\. $/d;
+ /^write stdout: Broken pipe $/d;
+ :retry;
+ /Write failed flushing stdout buffer\. $/{
+ N;
+ s/Write failed flushing stdout buffer\. \n//;
+ b retry;
+}
+ /write stdout: Broken pipe $/{
+ N;
+ s/write stdout: Broken pipe \n//;
+ b retry;
+}' \
+ > wrapper.dif
+
+ $testcvs -z5 -Q diff --side-by-side -W 500 -r 1.1 -r 1.2 \
+ aaa > good.dif
+
+ dotest sshstdio-6 "cmp wrapper.dif good.dif"
+
+ if $keep; then
+ echo Keeping $TESTDIR and exiting due to --keep
+ exit 0
+ fi
+
+ cd ../..
+ CVS_RSH=$save_CVS_RSH; export CVS_RSH
+ rm -r sshstdio
+ rm -rf $CVSROOT_DIRNAME/first-dir
+ ;;
+
+
+
+ parseroot2)
+ # Test some :ext: roots for consistancy.
+ if $remote; then :; else
+ continue
+ fi
+
+ depends_on_rsh "$CVS_RSH"
+ if test $? -eq 77; then
+ skip parseroot2 "$skipreason"
+ continue
+ fi
+
+ # Test checking out and subsequently updating with some different
+ # CVSROOTs.
+
+ # A standard case, hostname:dirname.
+ mkdir parseroot2; cd parseroot2
+ save_CVSROOT=$CVSROOT
+ CVSROOT=$host:$CVSROOT_DIRNAME
+ dotest parseroot2-1 "$testcvs -Q co CVSROOT"
+ cd CVSROOT
+ dotest parseroot2-2 "$testcvs -Q up"
+ cd ..
+
+ # A degenerate remote case, just the server name and the directory
+ # name, with no :'s to help parsing. It can be mistaken for a
+ # relative directory name.
+ rm -r CVSROOT
+ CVSROOT=$host$CVSROOT_DIRNAME
+ dotest parseroot2-3 "$testcvs -Q co CVSROOT"
+ cd CVSROOT
+ dotest parseroot2-4 "$testcvs -Q up"
+
+ if $keep; then
+ echo Keeping $TESTDIR and exiting due to --keep
+ exit 0
+ fi
+
+ cd ../..
+ CVSROOT=$save_CVSROOT
+ rm -r parseroot2
+ ;;
+
+
+
history)
# CVSROOT/history tests:
# history: various "cvs history" invocations
@@ -21226,24 +22757,24 @@ xx"
"
Annotations for file1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.3 (${username} *[0-9a-zA-Z-]*): initial
-1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'"
-1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
-1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx First log line
-1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx Second log line
-1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): xx
-1\.4\.2\.1 (${username} *[0-9a-zA-Z-]*): br-change"
+1\.3 ($username8 *[0-9a-zA-Z-]*): initial
+1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'"
+1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): xx Revision 1\.4 [0-9/]* [0-9:]* $username
+1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): xx First log line
+1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): xx Second log line
+1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): xx
+1\.4\.2\.1 ($username8 *[0-9a-zA-Z-]*): br-change"
dotest keywordlog-23 "${testcvs} ann -r HEAD file1" \
"
Annotations for file1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.3 (${username} *[0-9a-zA-Z-]*): initial
-1\.5 (${username} *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'"
-1\.5 (${username} *[0-9a-zA-Z-]*): xx Revision 1\.4 [0-9/]* [0-9:]* ${username}
-1\.5 (${username} *[0-9a-zA-Z-]*): xx First log line
-1\.5 (${username} *[0-9a-zA-Z-]*): xx Second log line
-1\.5 (${username} *[0-9a-zA-Z-]*): xx
-1\.5 (${username} *[0-9a-zA-Z-]*): change"
+1\.3 ($username8 *[0-9a-zA-Z-]*): initial
+1\.5 ($username8 *[0-9a-zA-Z-]*): xx "'\$'"Log: file1,v "'\$'"
+1\.5 ($username8 *[0-9a-zA-Z-]*): xx Revision 1\.4 [0-9/]* [0-9:]* $username
+1\.5 ($username8 *[0-9a-zA-Z-]*): xx First log line
+1\.5 ($username8 *[0-9a-zA-Z-]*): xx Second log line
+1\.5 ($username8 *[0-9a-zA-Z-]*): xx
+1\.5 ($username8 *[0-9a-zA-Z-]*): change"
cd ../..
#
@@ -21508,8 +23039,7 @@ diff -r1\.2 file1
# Here's the problem... shouldn't -kk a binary file...
rm file1
dotest keyword2-13 "${testcvs} -q update -A -kk -j branch" \
-"U binfile\.dat
-${PROG} update: warning: file1 was lost
+"${PROG} update: warning: file1 was lost
U file1
RCS file: ${CVSROOT_DIRNAME}/first-dir/file1,v
retrieving revision 1\.1
@@ -21524,13 +23054,13 @@ ${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done"
- dotest_fail keyword2-15 "cmp binfile.dat ../binfile.dat" \
-"binfile\.dat \.\./binfile\.dat differ: char 13, line 2"
+ # "-kk" no longer corrupts binary files
+ dotest keyword2-15 "cmp binfile.dat ../binfile.dat" ''
# Okay, restore everything and make CVS try and merge a binary file...
+ # "-kk" no longer affects binary files
dotest keyword2-16 "${testcvs} -q update -A" \
-"[UP] binfile.dat
-[UP] file1"
+"[UP] file1"
dotest keyword2-17 "${testcvs} -q tag -b branch2" \
"T binfile\.dat
T file1"
@@ -21543,16 +23073,15 @@ T file1"
${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v <-- binfile\.dat
new revision: 1\.1\.4\.1; previous revision: 1\.1
done"
+ # "-kk" no longer affects binary files
+
+ # XXXX: do not ask, why we get the "U binfile.dat" line twice
+ # looks like a bug!
dotest keyword2-20 "${testcvs} -q update -A -kk -j branch2" \
"U binfile\.dat
-RCS file: ${CVSROOT_DIRNAME}/first-dir/binfile\.dat,v
-retrieving revision 1\.1
-retrieving revision 1\.1\.4\.1
-Merging differences between 1\.1 and 1\.1\.4\.1 into binfile\.dat
+U binfile\.dat
U file1"
- # Yep, it's broke, 'cept for that gal in Hodunk who uses -kk
- # so that some files only merge when she says so. Time to clean up...
cd ../..
rm -r 1
rm -rf ${CVSROOT_DIRNAME}/first-dir
@@ -21744,6 +23273,8 @@ done"
# for checkout and update as well.
#
mkdir 1; cd 1
+ save_TZ=$TZ
+ TZ=UTC; export TZ
dotest tagdate-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest tagdate-2 "${testcvs} add first-dir" \
@@ -21761,6 +23292,8 @@ Checking in file1;
${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
initial revision: 1\.1
done"
+ date_T1=`getrlogdate -r1.1 first-dir/file1`
+
dotest tagdate-5 "${testcvs} -q tag -b br1" "T file1"
dotest tagdate-6 "${testcvs} -q tag -b br2" "T file1"
echo trunk-2 >file1
@@ -21769,6 +23302,8 @@ done"
${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
done"
+ date_T2=`getrlogdate -r1.2 first-dir/file1`
+
# We are testing -r -D where br1 is a (magic) branch without
# any revisions. First the case where br2 doesn't have any
# revisions either:
@@ -21780,6 +23315,7 @@ done"
${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.4\.1; previous revision: 1\.1
done"
+ date_T3=`getrlogdate -r1.1.4.1 first-dir/file1`
# Then the case where br2 does have revisions:
dotest tagdate-11 "${testcvs} -q update -p -r br1 -D now" "trunk-1"
@@ -21789,52 +23325,397 @@ done"
"${PROG} \[update aborted\]: argument to join may not contain a date specifier without a tag"
# And check export
- # Wish some shorter sleep interval would suffice, but I need to
- # guarantee that the point in time specified by the argument to -D
- # in tagdate-14 and tagdate-16
- # falls in the space of time between commits to br2 and I
- # figure 60 seconds is probably a large enough range to
- # account for most network file system delays and such...
- # as it stands, it takes between 1 and 2 seconds between
- # calling CVS on my machine and the -D argument being used to
- # recall the file revision and this timing will certainly vary
- # by several seconds between machines - dependant on CPUspeeds,
- # I/O speeds, load, etc.
- sleep 60
-
echo br2-2 >file1
dotest tagdate-13 "${testcvs} -q ci -m modify-2-on-br2" \
"Checking in file1;
${CVSROOT_DIRNAME}/first-dir/file1,v <-- file1
new revision: 1\.1\.4\.2; previous revision: 1\.1\.4\.1
done"
+ date_T4=`getrlogdate -r1.1.4.2 first-dir/file1`
+
cd ../..
- mkdir 2; cd
- dotest tagdate-14 "${testcvs} -q export -r br2 -D'1 minute ago' first-dir" \
+ mkdir 2; cd 2
+ dotest tagdate-14 "${testcvs} -q export -r br2 -D'$date_T3' first-dir" \
"[UP] first-dir/file1"
dotest tagdate-15 "cat first-dir/file1" "br2-1"
# Now for annotate
cd ../1/first-dir
- dotest tagdate-16 "${testcvs} annotate -rbr2 -D'1 minute ago'" \
+ dotest tagdate-16 "${testcvs} annotate -rbr2 -D'$date_T3'" \
"
Annotations for file1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1\.4\.1 (${username} *[0-9a-zA-Z-]*): br2-1"
+1\.1\.4\.1 ($username8 *[0-9a-zA-Z-]*): br2-1"
dotest tagdate-17 "${testcvs} annotate -rbr2 -Dnow" \
"
Annotations for file1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1\.4\.2 (${username} *[0-9a-zA-Z-]*): br2-2"
+1\.1\.4\.2 ($username8 *[0-9a-zA-Z-]*): br2-2"
+
+ # Now check to see what happens when we add files to br2 and trunk
+ echo br2-1 > file3
+ dotest tagdate-18 "${testcvs} add file3" \
+"${PROG} add: scheduling file \`file3' for addition on branch \`br2'
+${PROG} add: use .${PROG} commit. to add this file permanently"
+ dotest tagdate-19 "${testcvs} -q ci -m add file3" \
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
+done
+Checking in file3;
+${CVSROOT_DIRNAME}/first-dir/Attic/file3,v <-- file3
+new revision: 1\.1\.2\.1; previous revision: 1\.1
+done"
+ date_T5=`getrlogdate -r1.1 first-dir/file3`
+ date_T6=`getrlogdate -r1.1.2.1 first-dir/file3`
+
+ cd ../..
+ mkdir 3; cd 3
+ dotest tagdate-20 "${testcvs} -Q co first-dir" ''
+ cd first-dir
+ echo trunk-1 > file2
+ dotest tagdate-21 "${testcvs} add file2" \
+"${PROG} add: scheduling file .file2. for addition
+${PROG} add: use .${PROG} commit. to add this file permanently"
+ dotest tagdate-22 "${testcvs} -q ci -m add file2" \
+"RCS file: ${CVSROOT_DIRNAME}/first-dir/file2,v
+done
+Checking in file2;
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
+initial revision: 1\.1
+done"
+ date_T7=`getrlogdate -r1.1 first-dir/file2`
+ echo "trunk-2" >file2
+ dotest tagdate-23 "${testcvs} -q ci -m update file2" \
+"Checking in file2;
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
+new revision: 1\.2; previous revision: 1\.1
+done"
+ date_T8=`getrlogdate -r1.2 first-dir/file2`
+
+ cd ../../1/first-dir
+ echo br2-1 > file2
+ dotest tagdate-24 "${testcvs} add file2" \
+"${PROG} add: scheduling file \`file2' for addition on branch \`br2'
+${PROG} add: use .${PROG} commit. to add this file permanently"
+ dotest tagdate-25 "${testcvs} -q ci -m add file2" \
+"Checking in file2;
+${CVSROOT_DIRNAME}/first-dir/file2,v <-- file2
+new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
+done"
+ date_T9=`getrlogdate -r1.2.2.2 first-dir/file2`
+ cd ../..
+
+ # Time Rev Branch Comments
+ # T0 trunk first-dir created
+ # T1 1.1 trunk first-dir/file1 committed "trunk-1"
+ # br1 branch created
+ # br2 branch created
+ # T2 1.2 trunk first-dir/file1 committed "trunk-2"
+ # T3 1.1.4.1 br2 first-dir/file1 committed "br2-1"
+ # +60s
+ # T4 1.1.4.2 br2 first-dir/file1 committed "br2-2"
+ # T5 1.1 trunk first-dir/file3 dead
+ # T6 1.1.2.1 br2 first-dir/file3 committed "br2-1"
+ # T7 1.1 trunk first-dir/file2 committed "trunk-1"
+ # T8 1.2 trunk first-dir/file2 committed "trunk-2"
+ # T8 1.2.2.1 br2 first-dir/file2 dead
+ # T9 1.2.2.2 br2 first-dir/file2 committed "br2-1"
+ #
+
+ mkdir 4; cd 4
+ (echo Dates for tagdate-26-* are:;\
+ echo " date_T1='$date_T1'";\
+ echo " date_T2='$date_T2'";\
+ echo " date_T3='$date_T3'";\
+ echo " date_T4='$date_T4'";\
+ echo " date_T5='$date_T5'";\
+ echo " date_T6='$date_T6'";\
+ echo " date_T7='$date_T7'";\
+ echo " date_T8='$date_T8'";\
+ echo " date_T9='$date_T9'") >>$LOGFILE
+ dotest tagdate-26-trunk-t1 \
+"${testcvs} co -D'$date_T1' -d first-dir-trunk-t1 first-dir" \
+"${PROG} checkout: Updating first-dir-trunk-t1
+U first-dir-trunk-t1/file1"
+ dotest tagdate-26-br2-t1 \
+"${testcvs} co -r br2 -D'$date_T1' -d first-dir-br2-t1 first-dir" \
+"${PROG} checkout: Updating first-dir-br2-t1
+U first-dir-br2-t1/file1"
+ dotest tagdate-26-trunk-t2 \
+"${testcvs} co -D'$date_T2' -d first-dir-trunk-t2 first-dir" \
+"${PROG} checkout: Updating first-dir-trunk-t2
+U first-dir-trunk-t2/file1"
+ dotest tagdate-26-br2-t2 \
+"${testcvs} co -r br2 -D'$date_T2' -d first-dir-br2-t2 first-dir" \
+"${PROG} checkout: Updating first-dir-br2-t2
+U first-dir-br2-t2/file1"
+ dotest tagdate-26-br2-t3 \
+"${testcvs} co -r br2 -D'$date_T3' -d first-dir-br2-t3 first-dir" \
+"${PROG} checkout: Updating first-dir-br2-t3
+U first-dir-br2-t3/file1"
+ dotest tagdate-26-br2-t4 \
+"${testcvs} co -r br2 -D'$date_T4' -d first-dir-br2-t4 first-dir" \
+"${PROG} checkout: Updating first-dir-br2-t4
+U first-dir-br2-t4/file1"
+ dotest tagdate-26-br2-t6 \
+"${testcvs} co -r br2 -D'$date_T6' -d first-dir-br2-t6 first-dir" \
+"${PROG} checkout: Updating first-dir-br2-t6
+U first-dir-br2-t6/file1
+U first-dir-br2-t6/file3"
+ dotest tagdate-26-trunk-t7 \
+"${testcvs} co -D'$date_T7' -d first-dir-trunk-t7 first-dir" \
+"${PROG} checkout: Updating first-dir-trunk-t7
+U first-dir-trunk-t7/file1
+U first-dir-trunk-t7/file2"
+ dotest tagdate-26-br2-t7 \
+"${testcvs} co -r br2 -D'$date_T7' -d first-dir-br2-t7 first-dir" \
+"${PROG} checkout: Updating first-dir-br2-t7
+U first-dir-br2-t7/file1
+U first-dir-br2-t7/file3"
+ dotest tagdate-26-trunk-t8 \
+"${testcvs} co -D'$date_T8' -d first-dir-trunk-t8 first-dir" \
+"${PROG} checkout: Updating first-dir-trunk-t8
+U first-dir-trunk-t8/file1
+U first-dir-trunk-t8/file2"
+ dotest tagdate-26-br2-t8 \
+"${testcvs} co -r br2 -D'$date_T8' -d first-dir-br2-t8 first-dir" \
+"${PROG} checkout: Updating first-dir-br2-t8
+U first-dir-br2-t8/file1
+U first-dir-br2-t8/file3"
+ dotest tagdate-26-br2-t9 \
+"${testcvs} co -r br2 -D'$date_T9' -d first-dir-br2-t9 first-dir" \
+"${PROG} checkout: Updating first-dir-br2-t9
+U first-dir-br2-t9/file1
+U first-dir-br2-t9/file2
+U first-dir-br2-t9/file3"
+ dotest tagdate-27-trunk-t1 \
+"${testcvs} status first-dir-trunk-t1" \
+"${PROG} status: Examining first-dir-trunk-t1
+===================================================================
+File: file1 Status: Up-to-date
+
+ Working revision: 1\.1[^.]*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: (none)
+ Sticky Date: [0-9.]*
+ Sticky Options: (none)"
+ dotest tagdate-27-br2-t1 \
+"${testcvs} status first-dir-br2-t1" \
+"${PROG} status: Examining first-dir-br2-t1
+===================================================================
+File: file1 Status: Needs Patch
+
+ Working revision: 1\.1[^.]*
+ Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: br2 (branch: 1\.1\.4)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ dotest tagdate-27-trunk-t2 \
+"${testcvs} status first-dir-trunk-t2" \
+"${PROG} status: Examining first-dir-trunk-t2
+===================================================================
+File: file1 Status: Up-to-date
+
+ Working revision: 1\.2[^.]*
+ Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: (none)
+ Sticky Date: [0-9.]*
+ Sticky Options: (none)"
+ dotest tagdate-27-br2-t2 \
+"${testcvs} status first-dir-br2-t2" \
+"${PROG} status: Examining first-dir-br2-t2
+===================================================================
+File: file1 Status: Needs Patch
+
+ Working revision: 1\.1[^.]*
+ Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: br2 (branch: 1\.1\.4)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ dotest tagdate-27-br2-t3 \
+"${testcvs} status first-dir-br2-t3" \
+"${PROG} status: Examining first-dir-br2-t3
+===================================================================
+File: file1 Status: Needs Patch
+
+ Working revision: 1\.1\.4\.1[^.]*
+ Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: br2 (branch: 1\.1\.4)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ dotest tagdate-27-br2-t4 \
+"${testcvs} status first-dir-br2-t4" \
+"${PROG} status: Examining first-dir-br2-t4
+===================================================================
+File: file1 Status: Up-to-date
+
+ Working revision: 1\.1\.4\.2[^.]*
+ Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: br2 (branch: 1\.1\.4)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ dotest tagdate-27-br2-t6 \
+"${testcvs} status first-dir-br2-t6" \
+"${PROG} status: Examining first-dir-br2-t6
+===================================================================
+File: file1 Status: Up-to-date
+
+ Working revision: 1\.1\.4\.2[^.]*
+ Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: br2 (branch: 1\.1\.4)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file3 Status: Up-to-date
+
+ Working revision: 1\.1\.2\.1[^.]*
+ Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
+ Sticky Tag: br2 (branch: 1\.1\.2)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ dotest tagdate-27-trunk-t7 \
+"${testcvs} status first-dir-trunk-t7" \
+"${PROG} status: Examining first-dir-trunk-t7
+===================================================================
+File: file1 Status: Up-to-date
+
+ Working revision: 1\.2[^.]*
+ Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: (none)
+ Sticky Date: [0-9.]*
+ Sticky Options: (none)
+
+===================================================================
+File: file2 Status: Up-to-date
+
+ Working revision: 1\.1[^.]*
+ Repository revision: 1\.1 ${CVSROOT_DIRNAME}/first-dir/file2,v
+ Sticky Tag: (none)
+ Sticky Date: [0-9.]*
+ Sticky Options: (none)"
+ dotest tagdate-27-br2-t7 \
+"${testcvs} status first-dir-br2-t7" \
+"${PROG} status: Examining first-dir-br2-t7
+===================================================================
+File: file1 Status: Up-to-date
+
+ Working revision: 1\.1\.4\.2[^.]*
+ Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: br2 (branch: 1\.1\.4)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file3 Status: Up-to-date
+
+ Working revision: 1\.1\.2\.1[^.]*
+ Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
+ Sticky Tag: br2 (branch: 1\.1\.2)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ dotest tagdate-27-trunk-t8 \
+"${testcvs} status first-dir-trunk-t8" \
+"${PROG} status: Examining first-dir-trunk-t8
+===================================================================
+File: file1 Status: Up-to-date
+
+ Working revision: 1\.2[^.]*
+ Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: (none)
+ Sticky Date: [0-9.]*
+ Sticky Options: (none)
+
+===================================================================
+File: file2 Status: Up-to-date
+
+ Working revision: 1\.2[^.]*
+ Repository revision: 1\.2 ${CVSROOT_DIRNAME}/first-dir/file2,v
+ Sticky Tag: (none)
+ Sticky Date: [0-9.]*
+ Sticky Options: (none)"
+ dotest tagdate-27-br2-t8 \
+"${testcvs} status first-dir-br2-t8" \
+"${PROG} status: Examining first-dir-br2-t8
+===================================================================
+File: file1 Status: Up-to-date
+
+ Working revision: 1\.1\.4\.2[^.]*
+ Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: br2 (branch: 1\.1\.4)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file3 Status: Up-to-date
+
+ Working revision: 1\.1\.2\.1[^.]*
+ Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
+ Sticky Tag: br2 (branch: 1\.1\.2)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ dotest tagdate-27-br2-t9 \
+"${testcvs} status first-dir-br2-t9" \
+"${PROG} status: Examining first-dir-br2-t9
+===================================================================
+File: file1 Status: Up-to-date
+
+ Working revision: 1\.1\.4\.2[^.]*
+ Repository revision: 1\.1\.4\.2 ${CVSROOT_DIRNAME}/first-dir/file1,v
+ Sticky Tag: br2 (branch: 1\.1\.4)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file2 Status: Up-to-date
+
+ Working revision: 1\.2\.2\.2[^.]*
+ Repository revision: 1\.2\.2\.2 ${CVSROOT_DIRNAME}/first-dir/file2,v
+ Sticky Tag: br2 (branch: 1\.2\.2)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file3 Status: Up-to-date
+
+ Working revision: 1\.1\.2\.1[^.]*
+ Repository revision: 1\.1\.2\.1 ${CVSROOT_DIRNAME}/first-dir/Attic/file3,v
+ Sticky Tag: br2 (branch: 1\.1\.2)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+
+ # Now check the contents of the files
+ dotest tagdate-28-trunk-t1 'cat first-dir-trunk-t1/file1' 'trunk-1'
+ dotest tagdate-28-br2-t1 'cat first-dir-br2-t1/file1' 'trunk-1'
+ dotest tagdate-28-trunk-t2 'cat first-dir-trunk-t2/file1' 'trunk-2'
+ dotest tagdate-28-br2-t2 'cat first-dir-br2-t2/file1' 'trunk-1'
+ dotest tagdate-28-br2-t3 'cat first-dir-br2-t3/file1' 'br2-1'
+ dotest tagdate-28-br2-t4 'cat first-dir-br2-t4/file1' 'br2-2'
+ dotest tagdate-28-br2-t6a 'cat first-dir-br2-t6/file1' "br2-2"
+ dotest tagdate-28-br2-t6b 'cat first-dir-br2-t6/file3' "br2-1"
+ dotest tagdate-28-trunk-t7a 'cat first-dir-trunk-t7/file1' "trunk-2"
+ dotest tagdate-28-trunk-t7b 'cat first-dir-trunk-t7/file2' "trunk-1"
+ dotest tagdate-28-br2-t7a 'cat first-dir-br2-t7/file1' "br2-2"
+ dotest tagdate-28-br2-t7b 'cat first-dir-br2-t7/file3' "br2-1"
+ dotest tagdate-28-trunk-t8a 'cat first-dir-trunk-t8/file1' "trunk-2"
+ dotest tagdate-28-trunk-t8b 'cat first-dir-trunk-t8/file2' "trunk-2"
+ dotest tagdate-28-br2-t8a 'cat first-dir-br2-t8/file1' "br2-2"
+ dotest tagdate-28-br2-t8c 'cat first-dir-br2-t8/file3' "br2-1"
+ dotest tagdate-28-br2-t9a 'cat first-dir-br2-t9/file1' "br2-2"
+ dotest tagdate-28-br2-t9b 'cat first-dir-br2-t9/file2' "br2-1"
+ dotest tagdate-28-br2-t9c 'cat first-dir-br2-t9/file3' "br2-1"
+ cd ..
+
+ unset date_T1 date_T2 date_T3 date_T4 date_T5
+ unset date_T6 date_T7 date_T8 date_T9
+ TZ=$save_TZ
if $keep; then
echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
- cd ../..
- rm -r 1 2
+ rm -r 1 2 3 4
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -23143,13 +25024,13 @@ add
cat >${TESTDIR}/lockme <<EOF
#!${TESTSHELL}
-line=\`grep <\$1/\$2,v 'locks ${author}:1\.[0-9];'\`
+line=\`grep <\$1/\$2,v 'locks $anyusername:1\.[0-9];'\`
if test -z "\$line"; then
# It isn't locked
exit 0
else
- user=\`echo \$line | sed -e 's/locks \\(${author}\\):[0-9.]*;.*/\\1/'\`
- version=\`echo \$line | sed -e 's/locks ${author}:\\([0-9.]*\\);.*/\\1/'\`
+ user=\`echo \$line | sed -e 's/locks \\($anyusername\\):[0-9.]*;.*/\\1/'\`
+ version=\`echo \$line | sed -e 's/locks $anyusername:\\([0-9.]*\\);.*/\\1/'\`
echo "\$user has file a-lock locked for version \$version" >&2
exit 1
fi
@@ -26496,9 +28377,13 @@ Root ${CVSROOT_DIRNAME}
noop
EOF
+ # The "no such system user" error is occurring on at least one of
+ # our BSD 2.0.2 nightly test platforms.
dotest_fail pserver-4.2 \
"${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
-"error 0: root not allowed" <<EOF
+"error 0: root not allowed" \
+"E Fatal error, aborting\.
+error 0 root: no such system user" <<EOF
BEGIN AUTH REQUEST
${CVSROOT_DIRNAME}
dontroot
@@ -27596,28 +29481,56 @@ done"
#
# Test our exit directory so that tests that exit in an incorrect directory
# are noticed during single test runs.
+ #
+ # FIXME?
+ # Sparc Solaris 9 is dereferencing paths here as if /bin/pwd were
+ # called when /tmp is a symlink. This might be a new problem with this
+ # test, but since this was recently tested I think it more likely to be
+ # A Solaris issue.
if test "x$TESTDIR" != "x`pwd`"; then
fail "cleanup: PWD != TESTDIR (\``pwd`' != \`$TESTDIR')"
fi
- # Test our temp directory for cvs-serv* directories and cvsXXXXXX temp
- # files. We would like to not leave any behind.
- if $remote && ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
- # A true value means ls found files/directories with these names.
- # Give the server some time to finish, then retry.
- sleep 1
- if ls $TMPDIR/cvs-serv* >/dev/null 2>&1; then
- fail "Found cvs-serv* directories in $TMPDIR."
- fi
- fi
- if ls $TMPDIR/cvs?????? >/dev/null 2>&1; then
- # A true value means ls found files/directories with these names.
- fail "Found cvsXXXXXX temp files in $TMPDIR."
- fi
+ # Reset val-tags to a pristine state.
+ rm -f $CVSROOT_DIRNAME/CVSROOT/val-tags
+
+ verify_tmp_empty "post $what"
done # The big loop
-echo "OK, all tests completed."
+# Set up summary data for output.
+skippedoutput=
+warningsoutput=
+extendedinfo=
+if test $skipped -ne 0; then
+ skippedoutput="$skipped test group"
+ if test $skipped -ne 1; then
+ skippedoutput="${skippedoutput}s"
+ fi
+ skippedoutput="$skippedoutput skipped"
+fi
+if test $warnings -ne 0; then
+ warningsoutput="$warnings test"
+ if test $warnings -ne 1; then
+ warningsoutput="${warningsoutput}s"
+ fi
+ warningsoutput="$warningsoutput passed with warnings"
+fi
+if test -n "$skippedoutput" || test -n "$warningsoutput"; then
+ extendedinfo=" ("
+ if test -n "$skippedoutput"; then
+ extendedinfo="$extendedinfo$skippedoutput"
+ fi
+ if test -n "$skippedoutput" && test -n "$warningsoutput"; then
+ extendedinfo="$extendedinfo and "
+ fi
+ if test -n "$warningsoutput"; then
+ extendedinfo="$extendedinfo$warningsoutput"
+ fi
+ extendedinfo="$extendedinfo)"
+fi
+
+echo "OK, all $passed tests passed$extendedinfo."
# TODO:
# * Test `cvs update -d foo' (where foo does not exist).
diff --git a/contrib/cvs/src/server.h b/contrib/cvs/src/server.h
index 20152d8..4c32386 100644
--- a/contrib/cvs/src/server.h
+++ b/contrib/cvs/src/server.h
@@ -1,8 +1,8 @@
/*
- * Copyright (c) 2003 The Free Software Foundation.
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
*
- * Portions Copyright (c) 2003 Derek Price
- * and Ximbiot <http://ximbiot.com>,
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS kit.
@@ -21,6 +21,12 @@
/*
+ * Nonzero if we are using the server. Used by various places to call
+ * server-specific functions.
+ */
+extern int server_active;
+
+/*
* Expand to `S', ` ', or the empty string. Used in `%s-> ...' trace printfs.
*/
#ifdef SERVER_SUPPORT
@@ -31,12 +37,6 @@
#ifdef SERVER_SUPPORT
-/*
- * Nonzero if we are using the server. Used by various places to call
- * server-specific functions.
- */
-extern int server_active;
-
/* Server functions exported to the rest of CVS. */
/* Run the server. */
diff --git a/contrib/cvs/src/stack.c b/contrib/cvs/src/stack.c
index edba905..22a1088 100644
--- a/contrib/cvs/src/stack.c
+++ b/contrib/cvs/src/stack.c
@@ -1,7 +1,8 @@
/*
- * Copyright (c) 2004, Free Software Foundation,
- * Derek Price,
- * & Ximbiot <http://ximbiot.com>.
+ * Copyright (C) 2004-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 2004-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS source distribution.
diff --git a/contrib/cvs/src/stack.h b/contrib/cvs/src/stack.h
index 49ebdf8..822010b 100644
--- a/contrib/cvs/src/stack.h
+++ b/contrib/cvs/src/stack.h
@@ -1,7 +1,6 @@
/*
- * Copyright (c) 2004, Free Software Foundation,
- * Derek Price,
- * & Ximbiot <http://ximbiot.com>.
+ * Copyright (c) 2004-2005 The Free Software Foundation,
+ * Derek Price, and Ximbiot <http://ximbiot.com>.
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS source distribution.
diff --git a/contrib/cvs/src/status.c b/contrib/cvs/src/status.c
index 2e2957e..7a828ae 100644
--- a/contrib/cvs/src/status.c
+++ b/contrib/cvs/src/status.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
@@ -141,9 +146,6 @@ status_fileproc (callerdat, finfo)
sstat = "Needs Patch";
break;
case T_CONFLICT:
- /* I _think_ that "unresolved" is correct; that if it has
- been resolved then the status will change. But I'm not
- sure about that. */
sstat = "Unresolved Conflict";
break;
case T_ADDED:
@@ -153,9 +155,7 @@ status_fileproc (callerdat, finfo)
sstat = "Locally Removed";
break;
case T_MODIFIED:
- if ( vers->ts_conflict
- && ( file_has_conflict ( finfo, vers->ts_conflict )
- || file_has_markers ( finfo ) ) )
+ if (file_has_markers (finfo))
sstat = "File had conflicts on merge";
else
/* Note that we do not re Register() the file when we spot
@@ -206,20 +206,15 @@ status_fileproc (callerdat, finfo)
}
else if (vers->vn_user[0] == '0' && vers->vn_user[1] == '\0')
cvs_output (" Working revision:\tNew file!\n", 0);
-#ifdef SERVER_SUPPORT
- else if (server_active)
- {
- cvs_output (" Working revision:\t", 0);
- cvs_output (vers->vn_user, 0);
- cvs_output ("\n", 0);
- }
-#endif
else
{
cvs_output (" Working revision:\t", 0);
cvs_output (vers->vn_user, 0);
- cvs_output ("\t", 0);
- cvs_output (vers->ts_rcs, 0);
+ if (!server_active)
+ {
+ cvs_output ("\t", 0);
+ cvs_output (vers->ts_rcs, 0);
+ }
cvs_output ("\n", 0);
}
diff --git a/contrib/cvs/src/subr.c b/contrib/cvs/src/subr.c
index da8d478..faa988a 100644
--- a/contrib/cvs/src/subr.c
+++ b/contrib/cvs/src/subr.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
@@ -319,7 +324,6 @@ increment_revnum (rev)
const char *rev;
{
char *newrev, *p;
- int lastfield;
size_t len = strlen (rev);
newrev = xmalloc (len + 2);
@@ -645,59 +649,6 @@ make_message_rcslegal (message)
-/*
- * file_has_conflict
- *
- * This function compares the timestamp of a file with ts_conflict set
- * to the timestamp on the actual file and returns TRUE or FALSE based
- * on the results.
- *
- * This function does not check for actual markers in the file and
- * file_has_markers() function should be called when that is interesting.
- *
- * ASSUMPTIONS
- * The ts_conflict field is not NULL.
- *
- * RETURNS
- * TRUE ts_conflict matches the current timestamp.
- * FALSE The ts_conflict field does not match the file's
- * timestamp.
- */
-int
-file_has_conflict (finfo, ts_conflict)
- const struct file_info *finfo;
- const char *ts_conflict;
-{
- char *filestamp;
- int retcode;
-
- /* If ts_conflict is NULL, there was no merge since the last
- * commit and there can be no conflict.
- */
- assert (ts_conflict);
-
- /*
- * If the timestamp has changed and no
- * conflict indicators are found, it isn't a
- * conflict any more.
- */
-
-#ifdef SERVER_SUPPORT
- if (server_active)
- retcode = ts_conflict[0] == '=';
- else
-#endif /* SERVER_SUPPORT */
- {
- filestamp = time_stamp (finfo->file);
- retcode = !strcmp (ts_conflict, filestamp);
- free (filestamp);
- }
-
- return retcode;
-}
-
-
-
/* Does the file FINFO contain conflict markers? The whole concept
of looking at the contents of the file to figure out whether there are
unresolved conflicts is kind of bogus (people do want to manage files
diff --git a/contrib/cvs/src/vers_ts.c b/contrib/cvs/src/vers_ts.c
index 69eaa4c..2115dd5 100644
--- a/contrib/cvs/src/vers_ts.c
+++ b/contrib/cvs/src/vers_ts.c
@@ -1,6 +1,11 @@
/*
- * Copyright (c) 1992, Brian Berliner and Jeff Polk
- * Copyright (c) 1989-1992, Brian Berliner
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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 source distribution.
@@ -35,6 +40,7 @@ Version_TS (finfo, options, tag, date, force_tag_match, set_time)
Vers_TS *vers_ts;
struct stickydirtag *sdtp;
Entnode *entdata;
+ char *rcsexpand = NULL;
#ifdef UTIME_EXPECTS_WRITABLE
int change_it_back = 0;
@@ -106,30 +112,39 @@ Version_TS (finfo, options, tag, date, force_tag_match, set_time)
}
}
+ /* Always look up the RCS keyword mode when we have an RCS archive. It
+ * will either be needed as a default or to avoid allowing the -k options
+ * specified on the command line from overriding binary mode (-kb).
+ */
+ if (finfo->rcs != NULL)
+ rcsexpand = RCS_getexpand (finfo->rcs);
+
/*
* -k options specified on the command line override (and overwrite)
- * options stored in the entries file
+ * options stored in the entries file and default options from the RCS
+ * archive, except for binary mode (-kb).
*/
if (options && *options != '\0')
- vers_ts->options = xstrdup (options);
- else if (!vers_ts->options || *vers_ts->options == '\0')
{
- if (finfo->rcs != NULL)
- {
- /* If no keyword expansion was specified on command line,
- use whatever was in the rcs file (if there is one). This
- is how we, if we are the server, tell the client whether
- a file is binary. */
- char *rcsexpand = RCS_getexpand (finfo->rcs);
- if (rcsexpand != NULL)
- {
- if (vers_ts->options != NULL)
- free (vers_ts->options);
- vers_ts->options = xmalloc (strlen (rcsexpand) + 3);
- strcpy (vers_ts->options, "-k");
- strcat (vers_ts->options, rcsexpand);
- }
- }
+ if (vers_ts->options != NULL)
+ free (vers_ts->options);
+ if (rcsexpand != NULL && strcmp (rcsexpand, "b") == 0)
+ vers_ts->options = xstrdup ("-kb");
+ else
+ vers_ts->options = xstrdup (options);
+ }
+ else if ((!vers_ts->options || *vers_ts->options == '\0')
+ && rcsexpand != NULL)
+ {
+ /* If no keyword expansion was specified on command line,
+ use whatever was in the rcs file (if there is one). This
+ is how we, if we are the server, tell the client whether
+ a file is binary. */
+ if (vers_ts->options != NULL)
+ free (vers_ts->options);
+ vers_ts->options = xmalloc (strlen (rcsexpand) + 3);
+ strcpy (vers_ts->options, "-k");
+ strcat (vers_ts->options, rcsexpand);
}
if (!vers_ts->options)
vers_ts->options = xstrdup ("");
@@ -287,6 +302,13 @@ time_stamp_server (file, vers_ts, entdata)
else if (entdata->timestamp
&& entdata->timestamp[0] == '=')
mark_unchanged (vers_ts);
+ else if (entdata->conflict
+ && entdata->conflict[0] == '=')
+ {
+ /* These just need matching content. Might as well minimize it. */
+ vers_ts->ts_user = xstrdup ("");
+ vers_ts->ts_conflict = xstrdup ("");
+ }
else if (entdata->timestamp
&& (entdata->timestamp[0] == 'M'
|| entdata->timestamp[0] == 'D')
diff --git a/contrib/cvs/src/version.c b/contrib/cvs/src/version.c
index 8c76a16..09f99f4 100644
--- a/contrib/cvs/src/version.c
+++ b/contrib/cvs/src/version.c
@@ -1,8 +1,12 @@
/*
- * 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
+ * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
+ *
+ * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
+ * and others.
+ *
+ * Portions Copyright (C) 1994 david d `zoo' zuhn
+ * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
+ * Portions 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.
@@ -53,10 +57,8 @@ version (argc, argv)
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
diff --git a/contrib/cvs/src/watch.c b/contrib/cvs/src/watch.c
index 58442c4..0ef987c 100644
--- a/contrib/cvs/src/watch.c
+++ b/contrib/cvs/src/watch.c
@@ -18,14 +18,13 @@
const char *const watch_usage[] =
{
"Usage: %s %s {on|off|add|remove} [-lR] [-a <action>]... [<path>]...\n",
- "on/off: turn on/off read-only checkouts of files\n",
- "add/remove: add or remove notification on actions\n",
- "-l (on/off/add/remove): Local directory only, not recursive\n",
- "-R (on/off/add/remove): Process directories recursively (default)\n",
- "-a (add/remove): Specify what actions, one of\n",
- " edit,unedit,commit,all,none (defaults to all, multiple -a\n",
- " options are permitted)\n",
- "(Specify the --help global option for a list of other help options)\n",
+ "on/off: Turn on/off read-only checkouts of files.\n",
+ "add/remove: Add or remove notification on actions.\n",
+ "-l (on/off/add/remove): Local directory only, not recursive.\n",
+ "-R (on/off/add/remove): Process directories recursively (default).\n",
+ "-a (add/remove): Specify what actions, one of: `edit', `unedit',\n",
+ " `commit', `all', or `none' (defaults to `all').\n",
+ "(Specify the --help global option for a list of other help options.)\n",
NULL
};
@@ -407,10 +406,10 @@ watch (argc, argv)
static const char *const watchers_usage[] =
{
- "Usage: %s %s [-lR] [files...]\n",
- "\t-l\tProcess this directory only (not recursive).\n",
- "\t-R\tProcess directories recursively.\n",
- "(Specify the --help global option for a list of other help options)\n",
+ "Usage: %s %s [-lR] [<file>]...\n",
+ "-l\tProcess this directory only (not recursive).\n",
+ "-R\tProcess directories recursively (default).\n",
+ "(Specify the --help global option for a list of other help options.)\n",
NULL
};
diff --git a/contrib/cvs/src/wrapper.c b/contrib/cvs/src/wrapper.c
index 548b3a5..512e96c 100644
--- a/contrib/cvs/src/wrapper.c
+++ b/contrib/cvs/src/wrapper.c
@@ -93,9 +93,7 @@ void wrap_setup()
else
wrap_setup_already_done = 1;
-#ifdef CLIENT_SUPPORT
if (!current_parsed_root->isremote)
-#endif
{
char *file;
@@ -240,6 +238,7 @@ wrap_unparse_rcs_options (line, first_call_p)
* Remove fmt str specifier other than %% or %s. And allow
* only max_s %s specifiers
*/
+void
wrap_clean_fmt_str(char *fmt, int max_s)
{
while (*fmt) {
@@ -257,7 +256,6 @@ wrap_clean_fmt_str(char *fmt, int max_s)
}
fmt++;
}
- return;
}
/*
@@ -418,7 +416,8 @@ wrap_add (line, isTemp)
switch(opt){
case 'f':
/* Before this is reenabled, need to address the problem in
- commit.c (see http://www.cvshome.org/docs/infowrapper.html). */
+ commit.c (see
+ http://ximbiot.com/cvs/cvshome/docs/infowrapper.html). */
error (1, 0,
"-t/-f wrappers not supported by this version of CVS");
@@ -432,7 +431,8 @@ wrap_add (line, isTemp)
break;
case 't':
/* Before this is reenabled, need to address the problem in
- commit.c (see http://www.cvshome.org/docs/infowrapper.html). */
+ commit.c (see
+ http://ximbiot.com/cvs/cvshome/docs/infowrapper.html). */
error (1, 0,
"-t/-f wrappers not supported by this version of CVS");
diff --git a/contrib/cvs/src/zlib.c b/contrib/cvs/src/zlib.c
index 32c95e5..46ed0e6 100644
--- a/contrib/cvs/src/zlib.c
+++ b/contrib/cvs/src/zlib.c
@@ -361,18 +361,10 @@ compress_buffer_shutdown_input (buf)
struct compress_buffer *cb = (struct compress_buffer *) buf->closure;
int zstatus;
- /* Pick up any trailing data, such as the checksum. */
- while (1)
- {
- int status, nread;
- char buf[100];
-
- status = compress_buffer_input (cb, buf, 0, sizeof buf, &nread);
- if (status == -1)
- break;
- if (status != 0)
- return status;
- }
+ /* Don't make any attempt to pick up trailing data since we are shutting
+ * down. If the client doesn't know we are shutting down, we might not
+ * see the EOF we are expecting.
+ */
zstatus = inflateEnd (&cb->zstr);
if (zstatus != Z_OK)
OpenPOWER on IntegriCloud