summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-10-02 06:33:59 +0000
committerpeter <peter@FreeBSD.org>2000-10-02 06:33:59 +0000
commite0aa09eb3434450a9aec24a6f4b2694077991e45 (patch)
tree1034d2dbfc90e7d206ec12b655f538011f0538e6 /contrib/cvs/src
parent991f1fafc7262d5e8dc1dd47c5863e0e2a351dff (diff)
parent590c411955d6975551ffeaf41d7faf4b26f836d1 (diff)
downloadFreeBSD-src-e0aa09eb3434450a9aec24a6f4b2694077991e45.zip
FreeBSD-src-e0aa09eb3434450a9aec24a6f4b2694077991e45.tar.gz
This commit was generated by cvs2svn to compensate for changes in r66525,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/cvs/src')
-rw-r--r--contrib/cvs/src/ChangeLog1101
-rw-r--r--contrib/cvs/src/Makefile.in6
-rw-r--r--contrib/cvs/src/add.c39
-rw-r--r--contrib/cvs/src/admin.c119
-rw-r--r--contrib/cvs/src/checkout.c127
-rw-r--r--contrib/cvs/src/client.h1
-rw-r--r--contrib/cvs/src/create_adm.c6
-rw-r--r--contrib/cvs/src/edit.c23
-rw-r--r--contrib/cvs/src/entries.c5
-rw-r--r--contrib/cvs/src/error.c9
-rw-r--r--contrib/cvs/src/fileattr.c19
-rw-r--r--contrib/cvs/src/hardlink.c15
-rw-r--r--contrib/cvs/src/hash.c9
-rw-r--r--contrib/cvs/src/hash.h4
-rw-r--r--contrib/cvs/src/history.c184
-rw-r--r--contrib/cvs/src/ignore.c31
-rw-r--r--contrib/cvs/src/log.c249
-rw-r--r--contrib/cvs/src/modules.c202
-rw-r--r--contrib/cvs/src/myndbm.c3
-rw-r--r--contrib/cvs/src/parseinfo.c43
-rw-r--r--contrib/cvs/src/patch.c31
-rw-r--r--contrib/cvs/src/release.c2
-rw-r--r--contrib/cvs/src/remove.c1
-rw-r--r--contrib/cvs/src/repos.c12
-rw-r--r--contrib/cvs/src/root.c69
-rw-r--r--contrib/cvs/src/rtag.c24
-rw-r--r--contrib/cvs/src/run.c12
-rwxr-xr-xcontrib/cvs/src/sanity.sh2034
-rw-r--r--contrib/cvs/src/subr.c58
-rw-r--r--contrib/cvs/src/tag.c16
-rw-r--r--contrib/cvs/src/vers_ts.c15
-rw-r--r--contrib/cvs/src/version.c48
-rw-r--r--contrib/cvs/src/watch.c1
-rw-r--r--contrib/cvs/src/zlib.c4
34 files changed, 3293 insertions, 1229 deletions
diff --git a/contrib/cvs/src/ChangeLog b/contrib/cvs/src/ChangeLog
index 0d18891..a33464d 100644
--- a/contrib/cvs/src/ChangeLog
+++ b/contrib/cvs/src/ChangeLog
@@ -1,3 +1,1104 @@
+2000-09-19 Larry Jones <larry.jones@sdrc.com>
+
+ * version.c: Version 1.11.
+
+2000-09-07 Larry Jones <larry.jones@sdrc.com>
+
+ * Makefile.in: Use @bindir@, @libdir@, @infodir@, and @mandir@
+ from autoconf.
+
+2000-08-23 Larry Jones <larry.jones@sdrc.com>
+
+ * mkmodules.c (init): Create an empty val-tags file if it doesn't
+ already exist to avoid problems with users not having sufficient
+ permissions to create it later.
+
+2000-09-06 Jim Kingdon <jkingdon@dhcp-net200-89.su.valinux.com>
+
+ * main.c (lookup_command_attribute): Add "release" to commands
+ which can be done by a read-only user.
+
+2000-08-23 Larry Jones <larry.jones@sdrc.com>
+
+ * repos.c (Name_Repository): Use pathname_levels to detect attempts
+ to get above the repository instead of checking for leading ..
+ which isn't reliable.
+ * sanity.sh (multiroot3-12 to multiroot3-15): New tests for above.
+
+2000-08-21 Larry Jones <larry.jones@sdrc.com>
+
+ * rcs.c (expand_keywords): Handle the unusual case of log == NULL.
+ (Reported by Craig Metz <cmetz@inner.net>.)
+
+2000-08-01 Larry Jones <larry.jones@sdrc.com>
+
+ * subr.c (pathname_levels): Fix bug that miscounts adjacent
+ slashes.
+ (Patch submitted by Tanaka Akira <akr@m17n.org>.)
+
+ * loginc.c (login): If available, use getpassphrase instead of
+ getpass to support long passwords on Solaris.
+
+2000-07-28 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (server_noop): Avoid do_cvs_command() overhead.
+ (requests): Make noop RQ_ROOTLESS.
+
+2000-07-27 Noel Cragg <noel@red-bean.com>
+
+ * root.c (parse_cvsroot): change fork method to behave like other
+ remote methods -- let the server check that the repository
+ directory is an absolute pathname.
+
+2000-07-27 Larry Jones <larry.jones@sdrc.com>
+
+ * lock.c (set_lock): Include actual lock directory in error message.
+ * sanity.sh (multiroot3-10): Change to match.
+
+ * sanity.sh (client-3): Allow for a potential "broken pipe".
+
+2000-07-26 Larry Jones <larry.jones@sdrc.com>
+
+ * commit.c (commit_filesdoneproc): Flush stdout before running script.
+ * modules.c (do_module): Ditto.
+ * update.c (update_dirleave_proc): Ditto.
+ * server.c (do_cvs_command): Give input from the protocol pipe
+ precedence over input from stdout/stderr. There's no particularly
+ good justification for this other than helping to avoid out-of-order
+ messages in sanity.sh.
+
+ * admin.c (admin_usage): Add the supported options.
+
+ * sanity.sh (info): Try to avoid out-of-order messages.
+
+ * sanity.sh (info): Fix problems when running twice in a row.
+
+2000-07-17 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (modules5-7, cvsadm-1e, emptydir-2): Allow for a nil
+ commit (can happen if the test is run twice in a row).
+
+2000-07-19 Pavel Roskin <proski@gnu.org>
+ and Larry Jones <larry.jones@sdrc.com>
+
+ * mkmodules.c (config_contents): Add a commented out example for
+ LockDir. Don't suggest PreservePermissions unless it's enabled.
+
+2000-07-17 Larry Jones <larry.jones@sdrc.com>
+
+ * login.c (get_cvs_password): Handle malformed ~/.cvspass more
+ gracefully.
+
+2000-07-12 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (modules5): New tests for module programs.
+
+2000-07-11 Larry Jones <larry.jones@sdrc.com>
+
+ * filesubr.c (copy_file, xcmp): Handle systems (like Plan 9) that
+ don't support mknod() and/or st_rdev.
+ * import.c (add_rcs_file): Ditto.
+ * rcs.c (RCS_checkout, RCS_checkin): Ditto.
+ * update.c (special_file_mismatch): Ditto.
+
+2000-07-10 Larry Jones <larry.jones@sdrc.com>
+
+ * zlib.c (gunzip_and_write): Fix type clashes.
+
+ * main.c (main): Remove unused variables.
+
+2000-07-10 Jim Meyering <meyering@lucent.com>
+
+ When a command like `cvs update -kk -jT1 -jT2' creates a new file
+ (because it had the T2 tag, but not T1), the subsequent commit of
+ that just-added file would effectively set the admin `-kk' option
+ for that file in the repository.
+
+ * update.c (join_file): Rename global-shadowing local `options'
+ to `t_options'.
+ Set file-scoped global `options' to NULL just before
+ check-out.
+ * sanity.sh (join-admin): New test for this.
+
+2000-07-08 Larry Jones <larry.jones@sdrc.com>
+
+ * version.c, cvs.h (version): New function.
+ * main.c (cmds[]): Add version command to invoke it.
+ (main): Also use it in -v.
+ * server.c (serve_version): New function.
+ (requests[]): Add version command to invoke it.
+
+2000-07-06 Karl Fogel <kfogel@red-bean.com>
+
+ * sanity.sh (pserver-14): remove this test for portability
+ reasons (it was only recently added for the 2000-07-04 change).
+
+2000-07-06 Larry Jones <larry.jones@sdrc.com>
+
+ sanity.sh (modules-148): Don't test for specific revisions.
+
+ * main.c (main): Catch SIGABRT to try to clean up after assertion
+ failures. Don't bother SIG_register'ing Lock_Cleanup because
+ main_cleanup calls it indirectly anyway.
+ * patch.c (patch): Catch SIGABRT.
+ * rcs.c (rcs_internal_lockfile): Ditto.
+ * server.c (server): Ditto.
+
+ * fileattr.c (fileattr_write): Don't delete the unrecog_head list
+ when writing...
+ (fileattr_free): Delete it when freeing!
+
+2000-07-05 Larry Jones <larry.jones@sdrc.com>
+
+ * admin.c (admin): Handle -t in client so reading from files works
+ correctly in client/server mode.
+ * sanity.sh (log2): Update to match.
+
+2000-07-04 Karl Fogel <kfogel@red-bean.com>
+
+ * server.c (pserver_authenticate_connection): use new
+ getline_safe() during authentication phase, to avoid a
+ denial-of-service attack in which client sends arbitrary
+ amounts of data with no newlines.
+ (Reported by <jpmg@eng.cam.ac.uk>.)
+
+ * sanity.sh: new test pserver-14 for above.
+
+ * myndbm.c: #include getline.h.
+ (mydbm_load_file): pass new GETLINE_NO_LIMIT flag to getstr().
+
+2000-07-03 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (modules): Rewrite using dotest. Add "modules-"
+ prefix to test names.
+
+2000-06-28 Larry Jones <larry.jones@sdrc.com>
+
+ * error.c (error_exit): Call rcs_cleanup () to release any rcs locks.
+ * rcs.c, rcs.h (rcs_cleanup): Make public, close file before trying
+ to remove (some systems won't remove open files).
+ (RCS_putdtree): Don't worry about cleaning up before call error
+ since it now does it for us.
+ (rcs_internal_lockfile, rcs_internal_unlockfile): Keep track of
+ lock file fd for rcs_cleanup ().
+
+ * client.c (handle_set_checkin_prog, handle_set_update_prog):
+ Just ignore the request when exporting.
+
+2000-06-27 Larry Jones <larry.jones@sdrc.com>
+
+ * create_adm.c, cvs.h (Create_Admin): Add dotemplate argument.
+ Change all callers.
+ * checkout.c (checkout_proc): Don't create CVS/Template if
+ exporting.
+
+2000-06-26 Pavel Roskin <proski@gnu.org>
+ and Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (switch_to_user): Only set CVS_Username if
+ AUTH_SERVER_SUPPORT is defined.
+
+2000-06-23 Larry Jones <larry.jones@sdrc.com>
+
+ * client.c (send_dirent_proc): Don't allocate ignlist if you're
+ going to skip the directory (plugs memory leak).
+ (send_dirleave_proc): New function.
+ (send_files): Use it (plugs memory leak).
+ * root.c (root_allow_free): Plug memory leaks.
+ * server.c (serve_directory, serve_notify, check_password,
+ pserver_authenticate_connection): Ditto.
+ * update.c (update): Ditto.
+
+ This completes the memory leak shoot-out -- the Purify'ed version
+ of CVS now runs the entire test suite, both local and remote (except
+ for remote crerepos, which causes Purify to choke) with *no* memory
+ leaks.
+
+ * server.c (pserver_authenticate_connection): Don't free null pointer.
+
+2000-06-21 Larry Jones <larry.jones@sdrc.com>
+
+ * client.c (update_entries, get_responses_and_close): Plug memory leaks.
+ * commit.c (find_fileproc, commit): Ditto.
+ * import.c (import): Ditto.
+ * log.c (cvslog): Ditto.
+ * recurse.c (start_recursion): Ditto.
+ * remove.c (cvsremove): Ditto.
+ * server.c (fd_buffer_initialize, server_notify, do_cvs_command): Ditto.
+ (fd_buffer_shutdown): New function.
+
+2000-06-20 Larry Jones <larry.jones@sdrc.com>
+
+ * root.c (parse_cvsroot): Put the terminating NUL byte into the
+ string *before* copying it, not after. :-(
+
+2000-06-19 Larry Jones <larry.jones@sdrc.com>
+
+ * main.c (main): Plug memory leaks.
+ * root.c (parse_cvsroot, set_local_cvsroot): Ditto.
+ * server.c (serve_root): Ditto.
+
+2000-06-16 Larry Jones <larry.jones@sdrc.com>
+
+ * fileattr.c (fileattr_read): Plug memory leak.
+ * rcs.c (RCS_whatbranch): Ditto.
+ * update.c (update_dirleave_proc): Ditto.
+
+ * ignore.c (ign_dir_add): Duplicate string so caller can free.
+
+ * modules.c (do_module): Don't write into dbm's memory!
+
+2000-06-15 Larry Jones <larry.jones@sdrc.com>
+
+ * checkout.c (checkout_proc): Fix non-ANSI code in call to
+ findslash(), minor cleanups.
+
+2000-06-14 Larry Jones <larry.jones@sdrc.com>
+
+ * tag.c (val_direntproc): Return R_PROCESS instead of 0.
+
+ * client.c (update_entries): Fix type clash calling gunzip_and_write().
+ * server.c (receive_file): Fix type clash calling gunzip_and_write().
+ (server_updated): Fix type clash calling buf_output().
+ * error.c (error): Make buf char instead of unsigned char to avoid
+ type clashes.
+
+ * modules.c (do_module): Change callback_proc to pass argc by
+ value instead of by reference: callback procs shouldn't be
+ messing with the callers argc/argv, it makes correct memory
+ management impossible. Plug memory leaks.
+ * cvs.h: Change to match.
+ * checkout.c (checkout_proc): Ditto; use a local argv array instead
+ of messing with caller's.
+ * modules.c (callback_proc): Ditto.
+ * patch.c (patch_proc): Ditto; use a local argv array instead
+ of messing with caller's.
+ * rtag.c (rtag_proc): Ditto; use a local argv array instead
+ of messing with caller's.
+ * server.c (expand_proc): Ditto.
+ * subr.c (line2argv): Change initial argv_allocated back to 1.
+
+ * checkout.c (findslash): Fix non-ANSI code.
+
+ * sanity.sh (modes3): Fix test names.
+
+2000-06-13 Larry Jones <larry.jones@sdrc.com>
+
+ * add.c (add): Plug memory leaks.
+ * admin.c (admin_fileproc): Ditto.
+ * checkout.c (build_dirs_and_chdir): Ditto.
+ * edit.c (editors_fileproc): Ditto.
+ * log.c (cvslog, log_parse_revlist, log_parse_date): Ditto.
+ * rcs.c (RCS_addaccess): Ditto.
+ * tag.c (check_fileproc): Ditto.
+ * vers_ts.c (Version_TS): Ditto.
+ * watch.c (watchers_fileproc): Ditto.
+
+2000-06-12 Larry Jones <larry.jones@sdrc.com>
+
+ * rcs.c (rcsbuf_valword): Set rcsbuf->vlen to keep rcsbuf_valcopy()
+ from allocating more memory than needed for @ strings. Don't declare
+ unless PRESERVE_PERMISSIONS_SUPPORT (since not defined).
+
+ * rcs.c (RCS_abandon): New function to abandon changes.
+ * rcs.h: Declare it.
+ * admin.c (admin_fileproc): Use it instead of RCS_reparsercsfile.
+
+ * commit.c (commit_fileproc): Fix memory leaks.
+ * patch.c (patch_fileproc): Ditto.
+ * rcs.c (RCS_nodeisbranch, RCS_copydeltas): Ditto.
+ * tag.c (tag_fileproc): Ditto.
+ * update.c (update): Ditto.
+
+2000-06-09 Larry Jones <larry.jones@sdrc.com>
+
+ * rcs.c (RCS_reparsercsfile, RCS_fully_parse, getdelta,
+ RCS_getdeltatext): Handle newphrases with composite values.
+ (rcsbuf_getkey): Don't remove @s in composite values -- it makes
+ it impossible to parse the value! Set special flag to indicate
+ a composite value.
+ (rcsbuf_valcopy, rcsbuf_valpolish_internal): Handle composite values.
+ (putrcsfield): Write composite values.
+ (RCS_checkin): Set node types in other_delta list.
+ * hash.h: Add RCSCMPFLD.
+ * hash.c (nodetypestring): Ditto.
+
+ * rcs.c (getdelta): Never allocate space for value, just return
+ pointer into rcsbuf (fixes memory leaks). Use rcsbuf_getkey to
+ read a key and value and then parse the value if needed rather
+ than trying to read it in bits and pieces with rcsbuf_getid,
+ rcsbuf_getstring, and rcsbuf_getword.
+ (RCS_reparsercsfile): Change callers to compensate.
+ (rcsbuf_valcmp, rcsbuf_valword): New functions.
+ (rcsbuf_getid, rcsbuf_getstring, rcsbuf_getword): Deleted.
+ * sanity.sh (rcs3-1): Now get slightly different error message.
+
+2000-06-08 Larry Jones <larry.jones@sdrc.com>
+
+ * main.c (usg): Update CVS home page URL.
+
+ * main.c (main): Provide an actual error message for an unknown
+ command in addition to the usage message.
+
+2000-06-07 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (serve_root, dirswitch, serve_repository,
+ serve_static_directory, serve_sticky, receive_partial_file,
+ receive_file, serve_modified, server_write_entries, serve_notify,
+ serve_checkin_prog, serve_update_prog, server): Don't set
+ pending_error before calling alloc_pending, it makes it fail;
+ use alloc_pending instead of malloc when reasonable; be sure to
+ save errno before calling functions that might change it.
+ (Patch submitted by Dietmar Petras <dietmar.petras@elsa.de>.)
+
+2000-06-03 Larry Jones <larry.jones@sdrc.com>
+
+ * commit.c (checkaddfile): Plug memory leak.
+ * rcs.c (RCS_checkin): Plug memory leaks.
+ * server.c (do_cvs_command): Plug file descriptor leaks.
+ * tag.c (check_fileproc): Plug memory leak.
+
+2000-05-26 Larry Jones <larry.jones@sdrc.com>
+
+ * recurse.c (unroll_files_proc): Plug memory leak.
+
+ * recurse.c (addfile): Fix nonportable pointer cast.
+
+ * rcs.c (rcsbuf_getstring, rcsbuf_getword, getdelta): Plug memory
+ leaks.
+
+2000-05-25 Larry Jones <larry.jones@sdrc.com>
+
+ * checkout.c (checkout, build_one_dir, checkout_proc): Move m_type
+ to file scope and use it instead of continually doing strcmp on
+ command_name.
+ (build_one_dir, checkout_proc): Don't allow export if CVSADM
+ directory already exists.
+
+2000-05-23 Larry Jones <larry.jones@sdrc.com>
+
+ * rcs.c (RCS_checkin, RCS_cmp_file): Plug memory leaks. (Patch
+ submitted by Chris G. Demetriou <cgd@sibyte.com>.)
+
+2000-05-20 Ian Lance Taylor <ian@zembu.com>
+
+ * client.c (connect_to_gserver): Handle server error messages
+ reasonably.
+
+2000-05-19 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (requests): Make Global_option RQ_ROOTLESS so it can be
+ used with init.
+
+2000-05-18 Larry Jones <larry.jones@sdrc.com>
+
+ * client.c (start_server): Don't do encryption, authentication,
+ compression, or case insensitivity when doing init because init
+ is ROOTLESS and they're not.
+
+ * client.c (connect_to_pserver): Include repository and username in
+ authorization failed message -- if a directory tree crosses multiple
+ repositories, it can be quite difficult for the user to figure out
+ which one is the problem.
+
+2000-05-17 Larry Jones <larry.jones@sdrc.com>
+
+ * main.c (main): Use full set of options when looking for -f to
+ avoid misparsing options that take values (previously, -sVAR=foo
+ was incorrectly parsed as though it were -s -V -A -R -= -f -o -o
+ because it didn't know that -s takes a value).
+ * sanity.sh (info-6b): New test for above.
+
+ * sanity.sh (conflicts-status): Fix tests so they work remotely, too.
+
+2000-05-17 Jim Meyering <meyering@lucent.com>
+
+ * sanity.sh (TESTDIR): Fix braino in last change:
+ cd to /tmp before invoking pwd.
+
+ * sanity.sh: Set TESTDIR so that `make check' passes even when /tmp
+ is a symlink.
+ (join-36): Use $TESTDIR rather than hard-coding `/tmp/cvs-sanity'.
+ (conflicts-132): Remove unnecessary `rm aa'.
+
+2000-05-16 Jim Kingdon <kingdon@redhat.com>
+
+ * cvs.h, checkout.c (safe_location): Make extern.
+ * import.c (import): Call it rather than reimplementing
+ (incompletely) the same check.
+
+2000-05-16 Larry Jones <larry.jones@sdrc.com>
+
+ * rcs.h, subr.c (file_has_markers): Check for any of the three
+ conflict marker lines, not just one.
+ * sanity.sh (conflicts-status): New tests for above.
+ * sanity.sh: Revise to avoid tripping the above check when merging
+ changes into sanity.sh itself.
+
+2000-05-15 Larry Jones <larry.jones@sdrc.com>
+
+ * update.c (join_file): When registering the result of the merge,
+ make sure that the version number is valid (vers->vn_rcs may be
+ null if the file doesn't exist on the branch yet). (Patch submitted
+ by Robert de Vries <rhdv@rhdv.cistron.nl>.)
+ * update.c (join_file): Correct diagnostics (previous change was not
+ correct -- the file *does* exist in the specified revision, it just
+ doesn't exist in the sandbox).
+ * sanity.sh (import-113, join): New tests and changes for above.
+
+2000-05-04 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh: Look for a useful id program. Since we're getting
+ the real username for some tests anyway, use it for all the
+ tests instead of a generic regular expression that may or may
+ not match the actual username.
+
+2000-05-04 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c: More error messages.
+
+2000-05-02 Donald Sharp <sharpd@cisco.com>
+ and Larry Jones <larry.jones@sdrc.com>
+
+ * history.c (report_hrecs): Added code to print out year instead of
+ just month/day.
+ * sanity.sh (basic2-64, history): Update to match.
+
+2000-04-19 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (dirswitch): Set pending_error_text in addition to
+ pending_error to aid in problem determination.
+
+2000-03-23 Larry Jones <larry.jones@sdrc.com>
+
+ * mkmodules.c (mkmodules): Return without doing anything if noexec
+ is set to avoid trashing existing files.
+
+2000-03-23 Larry Jones <larry.jones@sdrc.com>
+
+ * main.c: Alphabetize cmds[] and cmd_usage[] and add server
+ commands to cmd_usage[].
+
+2000-03-21 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (client-1): May get "Broken pipe" message from the
+ "server" in addition to the expected output.
+
+2000-03-17 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (switch_to_user): Set CVS_Username if it hasn't already
+ been set elsewhere. (Patch submitted by Gordon Matzigkeit
+ <gord@fig.org>).
+
+2000-03-13 Larry Jones <larry.jones@sdrc.com>
+
+ * parseinfo.c: Add extern to logHistory declaration. (Reported by
+ <John.Tytgat@aaug.net>.)
+ (parse_config): Reformat logHistory code.
+
+2000-03-10 Larry Jones <larry.jones@sdrc.com>
+
+ * add.c (add): Don't try to set cvsroot_len until after checking
+ for help only -- CVSroot_directory isn't set in that case.
+
+2000-03-03 Larry Jones <larry.jones@sdrc.com>
+
+ * mkmodules.c (init): Use mkdir_if_needed to create CVSROOT/Emptydir
+ so we don't fail if run multiple times. (Reported by KOIE Hidetaka
+ <hide@koie.org>.)
+ * sanity.sh (1a): New test for above.
+
+2000-03-02 Larry Jones <larry.jones@sdrc.com>
+
+ * main.c: Use identical #if's in the command table and the code
+ for pserver and kserver to prevent "peculiar" configurations from
+ having really perverse behavior because the command table entries
+ are present but the related code isn't.
+
+2000-03-01 Larry Jones <larry.jones@sdrc.com>
+
+ * import.c (import): Don't allow importing the repository.
+ * sanity.sh (errmsg2-20, errmsg2-21): New tests for above.
+
+2000-03-01 Larry Jones <larry.jones@sdrc.com>
+
+ * main.c (main): Update year in copyright message.
+
+2000-03-01 Larry Jones <larry.jones@sdrc.com>
+
+ * logmsg.c (do_editor): Correct previous change.
+
+2000-02-29 Larry Jones <larry.jones@sdrc.com>
+
+ * logmsg.c (do_editor): When reading temp file, check that message
+ buffer is large enough to hold the next line and expand if needed.
+
+2000-02-28 Larry Jones <larry.jones@sdrc.com>
+
+ * commit.c (commit): Use get_file() to read log file correctly
+ and in text mode rather than binary mode.
+
+ * subr.c (get_file): Ignore bufsize if buf is NULL. Include
+ terminating NUL byte when estimating required buffer size.
+
+2000-02-28 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (find_tool): New function to replace duplicated code.
+
+2000-02-25 Larry Jones <larry.jones@sdrc.com>
+
+ * import.c (add_rcs_file): Don't abort just because lstat fails.
+
+2000-02-16 Jim Meyering <meyering@lucent.com>
+
+ Avoid race condition whereby a catchable signal could
+ end up corrupting the repository.
+ * commit.c (checkaddfile): Put a critical section around the code
+ that handles the first commit on the trunk of a file that's already
+ been committed on a branch.
+ * cvs.h (Sig_inCrSect): Declare new function.
+
+2000-02-21 Karl Fogel <kfogel@red-bean.com>
+
+ * main.c (main): still check for repository, but not history file
+ (correction to 2000-02-18 change -- that's what I get for
+ believing the comment rather than the code).
+
+2000-02-21 K.J. Paradise <kj@sourcegear.com>
+
+ * history.c mkmodules.c parseinfo.c: control which actions
+ get logged to the cvs history file via CVSROOT/config file
+ and LogHistory keyword. (John P Cavanaugh <cavanaug@sr.hp.com>)
+
+2000-02-18 Karl Fogel <kfogel@red-bean.com>
+
+ * history.c (history_write): don't die if history file not
+ writable, just warn (unless `really_quiet') and skip out.
+
+ * main.c (main): don't bother checking if history file is
+ writable.
+
+ * server.c (serve_root): same.
+
+2000-02-17 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (perms symlinks symlinks2 hardlinks): Don't run by
+ default since PreservePermissions code is now disabled.
+
+2000-02-17 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (import-113): Revise to match Jim Meyering's fix.
+
+2000-02-16 Larry Jones <larry.jones@sdrc.com>
+
+ * add.c (add): Don't allow adding files or directories to Emptydir.
+ (Patch submitted by Chris Cameron <chris.cameron@ot.co.nz>.)
+ * sanity.sh (emptydir): Revise (emptydir-7 and emptydir-8) for this.
+
+2000-02-16 Jim Meyering <meyering@lucent.com>
+
+ * update.c (join_file): Correct typo in diagnostic:
+ change `file %s is present...' to `file %s is not present...'.
+
+2000-02-10 Larry Jones <larry.jones@sdrc.com>
+
+ * parseinfo.c (Parse_Info): Treat matching lines with bad expansions
+ as errors rather than just ignoring.
+
+2000-02-10 Larry Jones <larry.jones@sdrc.com>
+
+ * edit.c (edit): Check for invalid characters in hostname and CurDir.
+ (Reported by "Andrew S. Townley" <atownley@informix.com>.)
+ * sanity.sh (devcom2): New tests for above.
+
+2000-02-10 Larry Jones <larry.jones@sdrc.com>
+
+ * cvs.h: Always #include "server.h" to prevent compile errors when
+ neither CLIENT_SUPPORT nor SERVER_SUPPORT is defined.
+ (Reported by "Crow, Ian" <ian.crow@linklaters.com>.)
+ * log.c (send_one, send_arg_list): Only define when CLIENT_SUPPORT
+ is defined to prevent link errors.
+
+ * server.c (server): Always create a new temporary directory, don't
+ try to reuse an existing one since we might not have correct
+ permissions. Also, include directory name in error messages.
+
+2000-01-29 Jim Kingdon <http://developer.redhat.com/>
+
+ * ignore.c (ignore_files): Correctly set errno to 0 when we go
+ back to the top of the loop. Fixes spurious errors like "cvs
+ update: error reading current directory: No such file or
+ directory".
+
+2000-01-26 Larry Jones <larry.jones@sdrc.com>
+
+ * run.c (run_exec): Conditionalize K.J.'s change so that it only
+ applies when SETXID_SUPPORT is defined since some platforms don't
+ have setegid().
+
+2000-01-26 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh: Make TESTDIR earlier then use it to check for versions
+ of expr that don't work right with long expressions.
+
+ * sanity.sh (dotest_line_by_line): Have wc read from stdin so it
+ doesn't output the file name and confuse expr. Make the output a
+ bit less verbose and easier to read.
+
+2000-01-24 K.J. Paradise <kj@sourcegear.com>
+
+ * run.c :> prevents a user from creating a privileged shell from the
+ text editor when the SETXID_SUPPORT option is selected. This came from
+ Bob Colle <bcolle@ilx.com>, and is his completely.
+
+2000-01-22 Jim Kingdon <http://developer.redhat.com/>
+
+ * sanity.sh (emptydir): Add a case in which one might hope for a
+ non-Emptydir result, but which result?
+
+2000-01-18 Larry Jones <larry.jones@sdrc.com>
+
+ * main.c (main): Allow -z0 to disable gzip compression.
+
+2000-01-17 Larry Jones <larry.jones@sdrc.com> for
+ K.J. Paradise (kj@sourcegear.com)
+
+ * version.c: Push version number to 1.10.8.1.
+
+ * version.c: Version 1.10.8.
+
+2000-01-17 Larry Jones <larry.jones@sdrc.com>
+
+ * mkmodules.c (init): Create CVSROOT/Emptydir to avoid problems
+ with users not having sufficient permissions to create it later.
+
+2000-01-04 Larry Jones <larry.jones@sdrc.com>
+
+ * client.c (get_responses_and_close): Simplify time-stamp race
+ avoidance code.
+ * commit.c (commit): Ditto.
+ * update.c (do_update): Ditto.
+ (Prompted by patch submitted by Pavel Roskin
+ <pavel_roskin@geocities.com>.)
+
+ * hardlink.c: sizeof (char) is 1, by definition.
+ * logmsg.c: Ditto.
+ * rcs.c: Ditto.
+
+2000-01-03 Karl Fogel <kfogel@red-bean.com>
+
+ * filesubr.c, subr.c (backup_file): moved this function from
+ filesubr.c to subr.c, at JimK's suggestion.
+
+2000-01-03 Jim Kingdon <http://developer.redhat.com/>
+
+ * sanity.sh (clean): Test the contents of the .#cleanme.txt.1.1
+ file, not just its existence.
+
+2000-01-03 Karl Fogel <kfogel@red-bean.com>
+
+ * cvs.h, filesubr.c (backup_file): use `const' for suffix too;
+ correct suffix length calculation and appending behavior; discard
+ unnecessary `void' cast. Thanks to Jim Meyering for noticing.
+
+2000-01-03 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (clean): Fix up expected output.
+
+2000-01-02 John P Cavanaugh <cavanaug@sr.hp.com>
+ and Karl Fogel <kfogel@red-bean.com>
+
+ New -C option to update: overwrites local changes with clean
+ copies from the repository. (This is an unreversion of the
+ 1999-12-10 change, further modified to work remotely.)
+
+ * client.h (BACKUP_MODIFIED_FILES): new #define.
+
+ * client.c (struct send_data): new element `backup_modified'.
+ (send_files): set above element if BACKUP_MODIFIED_FILES flag is
+ present.
+
+ * filesubr.c (backup_file): new function.
+
+ * cvs.h: prototype for new function `backup_file'.
+
+ * update.c (toss_local_changes): new file-scoped global.
+ (update): set toss_local_changes if -C flag seen. If
+ client_active, send "-C" to server, and set SEND_NO_CONTENTS and
+ BACKUP_MODIFIED_FILES flags before calling send_files().
+
+ (update_fileproc): if file is modified and toss_local_changes is
+ set, then back the file up and then check out a fresh copy from
+ the repository. Also, fixed indentation and formatting for a
+ particularly bad stretch of code near (but unrelated to) these
+ changes.
+
+ * sanity.sh: new test `clean', for update -C option.
+
+1999-12-29 Jim Kingdon <http://developer.redhat.com/>
+
+ * history.c (read_hrecs): st_blksize is unsigned long, not int.
+ This isn't just cosmetic - getting it wrong will cause coredumps
+ and such on 64 bit machines.
+
+ * import.c (import_descend), ignore.c (ignore_files): Placate gcc
+ -Wall by parenthesizing foo || (bar && baz).
+
+1999-12-24 Larry Jones <larry.jones@sdrc.com>
+
+ * release.c (release): Use fputs to echo lines from update instead
+ of printf to avoid problems with lines containing "%". (Reported
+ by Jean-Luc Simard <Jean-Luc.Simard@matrox.com>.)
+
+ * history.c (read_hrecs): Allocate a single 2-block buffer instead
+ of allocating and freeing a buffer for each block.
+ (fill_hrec): Remove redundant code.
+ (select_hrec): Plug memory leak.
+
+1999-12-22 Larry Jones <larry.jones@sdrc.com>
+
+ * history.c (history): For "modified" or "checkout", sort on
+ file if user specified -l, even if user also specified a date-
+ oriented flag.
+ * sanity.sh (history): Update to match; add new tests.
+
+1999-12-15 Pavel Roskin <pavel_roskin@geocities.com>
+ and Larry Jones <larry.jones@sdrc.com>
+
+ * lock.c (lock_name): fixed assertion failure for the
+ top-level CVS directory when LockDir is used
+ * sanity.sh (lockfiles-9): new test for this case
+
+1999-12-11 Karl Fogel <kfogel@red-bean.com>
+
+ * Revert previous change -- it doesn't work remotely yet.
+
+1999-12-10 John P Cavanaugh <cavanaug@sr.hp.com>
+ and Karl Fogel <kfogel@red-bean.com>
+
+ * update.c: new -C option to update, overwrites local changes with
+ clean copies from the repository.
+ Also, fixed indentation and formatting for a particularly bad
+ stretch of code near these changes in update_fileproc().
+
+ * sanity.sh: test new update -C option.
+
+1999-12-10 Larry Jones <larry.jones@sdrc.com>
+
+ * commit.c (remove_file): Call history_write with update_dir NULL
+ like Checkin() does for add and modify.
+ * sanity.sh (basic2-64): Update to match, add "R" records to expected
+ remote output.
+
+1999-12-09 K.J. Paradise (kj@sourcegear.com)
+
+ * history.c, commit.c, sanity.sh: found (I think) final
+ cause of seg fault in history command. Also, added the "R"
+ history functionality. Fixed basic2-64 so it looks correct for
+ the change.
+
+1999-11-30 K.J. Paradise (kj@sourcegear.com)
+
+ * history.c: fixed seg fault caused by 11-03 changes.
+ off by one in block memory allocations.
+
+1999-11-29 Karl Fogel <kfogel@red-bean.com>
+
+ * login.c (logout): free `tmp_name' when done.
+ Correct a comment.
+
+1999-11-29 Larry Jones <larry.jones@sdrc.com>
+
+ * cvs.h, error.c, import.c: Rename fperror to avoid name clash
+ on LynxOS. (Reported by Markus Braun <MarkusBraun@gmx.de>.)
+
+1999-11-23 Larry Jones <larry.jones@sdrc.com>
+
+ * checkout.c (checkout_proc): Split declaration and initialization
+ of rp to placate neurotic compilers that gripe about jumping past
+ an initialization, even when the variable is not subsequently used.
+
+1999-11-19 Larry Jones <larry.jones@sdrc.com>
+
+ * server.c (switch_to_user): Correct setgid error messages.
+
+1999-11-19 Karl Fogel <kfogel@red-bean.com>
+
+ * edit.c (unedit_usage, unedit): new struct, use it. Now "cvs
+ unedit" prints an accurate usage message (formerly it printed the
+ message for "cvs edit", even though the two commands do not have
+ identical usages).
+
+1999-11-19 Larry Jones <larry.jones@sdrc.com>
+
+ * history.c: Move -e documentation from Flags to Reports.
+ (history): Add -e to list of report types in error message.
+
+ * history.c (history): Process file arguments before client/server
+ processing so they get sent to the server.
+ * sanity.sh (history): New tests for above. (Also remove comments
+ about variable spacing -- history output is in variable-width
+ columns with exactly one space between.)
+
+1999-11-19 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh: Reestablish check for running as root (using ``id -u''
+ instead of ``whoami'').
+
+ * sanity.sh(dotest, dotest_lit, dotest_fail, dotest_status,
+ dotest_sort): Eval the command so quoting and pipes work right.
+ (spacefiles, dirs, rcslib, modules, unedit-without-baserev,
+ ignore, rcs, rcs2, history, tagdate, pserver, server, server2)
+ Simplify various tests based on above.
+
+1999-11-19 Karl Fogel <kfogel@red-bean.com>
+
+ * mkmodules.c (init): make history file world-writeable after
+ creating it, since it needs to be writeable for virtually any
+ CVS operation.
+
+1999-11-10 Jim Kingdon <http://developer.redhat.com/>
+
+ * admin.c: Revert change to add -H command option. The help
+ invocation is "cvs -H admin" not "cvs admin -H" (see cvs.texinfo,
+ basicb-21 in sanity.sh; fix to cvs.1)
+
+1999-11-08 Jim Kingdon <http://developer.redhat.com/>
+
+ * log.c (cvslog): If client_active, send options to the server
+ based on our parsed options rather than trying to send the exact
+ strings specified (using canonical forms, like RFC822/1123
+ dates, in the protocol is just cleaner).
+ (send_one, send_arg_list): New functions, helpers for above.
+ * sanity.sh (logopt-6a): New test, for this fix.
+
+1999-11-09 K.J. Paradise <kj@sourcegear.com>
+
+ * admin.c: made the -H option do what it is documented to
+ do. a
+
+1999-11-08 Tom Tromey <tromey@cygnus.com>
+
+ * client.c (connect_to_gserver): Print more error text if gssapi
+ initialization fails. From Assar Westerlund <assar@sics.se>.
+
+1999-11-06 Larry Jones <larry.jones@sdrc.com>
+
+ *sanity.sh(rcs3-5): Remote output can be out-of-order, so need a
+ more general pattern to match the assertion failure.
+
+1999-11-05 K.J. Paradise (kj@sourcegear.com)
+
+ * history.c: Added a trap to verify that if a
+ read(file, buffer,blocksize) returns less than blocksize,
+ that we really are at the end of the file. I can't easily
+ come up with a test case where this code gets touched, so
+ it may cause problems. All sanity tests still pass though.
+
+1999-11-05 Jim Kingdon <http://developer.redhat.com/>
+
+ * sanity.sh (logopt): New test, for Larry's fix.
+ * sanity.sh (log-18a, rcs-15 to rcs-19): New tests, to test -d
+ and -r more thoroughly.
+
+1999-11-05 Larry Jones <larry.jones@sdrc.com>
+
+ * log.c (cvslog): Fix -s and -d with spaces on client side.
+ (log_usage): Revert Karl's change once again.
+ sanity.sh(rcs3-5): No longer get different results from local
+ and client/server.
+
+1999-11-04 Karl Fogel <kfogel@red-bean.com>
+
+ * log.c (log_usage): Revert Jim Kingdon's reversion of my change
+ of 1999-11-03. Allowing a space between option and argument
+ results in lossage; here is a reproduction recipe: run this from
+ the top of a remote copy of the cvs source tree
+
+ cvs log -d '>1999-03-01' > log-out.with-space
+
+ and then run this (note there's no space after -d now):
+
+ cvs log -d'>1999-03-01' > log-out.no-space
+
+ The resulting files differ; furthermore, a glance at the output of
+ cvs shows that the first command failed to recurse into
+ subdirectories. Until this misbehavior can be fixed in the source
+ code, the documentation should reflect the true state of affairs:
+ if one simply omits the space, everything works fine.
+
+1999-11-04 Jim Kingdon <http://developer.redhat.com/>
+
+ * log.c (log_usage): Revert Karl's change regarding -d and
+ -s. A space is allowed (see sanity.sh for example).
+
+1999-11-03 K.J. Paradise (kj@sourcegear.com>
+
+ * history.c: cleaned up my prior change a bit, per Larry Jones'
+ comments, and John O'Conner's additional comments about bits of
+ non MS-Visual C++ compliancy of my code.
+
+1999-11-04 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh: Check that tr that correctly handles NULs; if not, try
+ to find a version that does; if none can be found, warn user.
+ Also fix warnings for defective expr.
+
+1999-11-04 Karl Fogel <kfogel@red-bean.com>
+
+ Changes for empty/random passwords in anon pserver access:
+
+ * server.c (check_repository_password): if password empty, grant
+ access no matter what password is received; this is so anon CVS no
+ longer requires a password but remains backwards-compatible with
+ all those clients out there.
+
+ * client.c (connect_to_pserver): proceed with login even if
+ password not found in .cvspass file -- just use empty string as
+ password. And if such a login fails, print a descriptive error.
+
+ * login.c (get_cvs_password): don't complain if file or password
+ not found. That condition is no longer a showstopper, now that
+ empty passwords are permissible.
+ Cleaned up conditional chaining a bit, too.
+
+ * sanity.sh (pserver-9, pserver-10, pserver-11, pserver-12,
+ pserver-13): new tests, about empty-password pserver access.
+
+1999-11-03 K.J. Paradise (kj@sourcegear.com>
+
+ * history.c: modify parsing routines to parse the history
+ file a block at a time, rather than all at once. This allows
+ people with large history files and small amount of memory
+ to still get some functionality out of the history file.
+
+1999-11-03 Karl Fogel <kfogel@red-bean.com>
+
+ * log.c (log_usage): correct usage message for -d and -s options.
+ Because the space between the option letter and its argument has
+ been eliminated, I capitalized the argument portion to distinguish
+ it from the option letter. This makes it slightly inconsistent
+ with other such usage summaries, but at least it is now both
+ correct and readable.
+
+1999-10-22 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (dotest_sort): Old versions of tr don't understand \t
+ so use a literal tab instead.
+
+1999-10-21 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (dotest_sort): Convert any tabs in the output into spaces
+ before sorting to avoid POSIX.2 sort weirdness.
+ (import-106, importb-2): Change expected output per above.
+
+1999-10-18 K.J. Paradise <kj@sourcegear.com>
+
+ Bug: users 'stan' and 'cartman' both have full read/write access
+ to the cvs repository. 'cartman' does a 'cvs admin -l foo.c'.
+ 'stan' then does a 'cvs admin -u foo.c'. The lock wouldn't be
+ removed, and no warning/error would be given. This is now fixed.
+ * rcs.c:(c.6157) remove caller/user check on the multiple lock
+ detection routines. Sanity.sh runs with no errors after this fix.
+
+1999-10-14 Larry Jones <larry.jones@sdrc.com>
+
+ Make "cvs admin -e" (with no list of users) work:
+ * admin.c (admin): Remove error message.
+ (admin_fileproc): If no args for -e, call RCS_delaccess with NULL user.
+ * rcs.c (RCS_delaccess): Interpret NULL user as request to delete
+ entire access list.
+ * sanity.sh (admin-19a-*): Test.
+
+1999-09-29 Larry Jones <larry.jones@sdrc.com>
+
+ * entries.c (Subdirs_Known): Use entfilename when opening CVSADM_ENTLOG
+ like everywhere else. Although this isn't strictly necessary (since
+ we immediately close it again), it keeps the code consistent and fixes
+ a bug where an open error reported the wrong file name.
+
+1999-09-16 Larry Jones <larry.jones@sdrc.com>
+
+ * log.c (log_parse_revlist): Handle peculiar revision specs like
+ "-r.", "-r:", and "-r," correctly. (Thanks to Pavel Roskin
+ <pavel_roskin@geocities.com> for submitting a patch, this fix is
+ somewhat different.)
+ * sanity.sh (log): New tests for above.
+
+1999-09-15 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (basica-8b1): New test to check fix for bad diff options
+ causing cvs to crash.
+
+1999-09-02 Larry Jones <larry.jones@sdrc.com>
+
+ * modules.c (do_module): Handle case where module definition has
+ options and special options but no directory; fix potential problems
+ running off beginning of string while stripping trailing blanks.
+ * sanity.sh (modules2): New tests for above.
+
+1999-08-26 Larry Jones <larry.jones@sdrc.com>
+
+ * lock.c (lock_name): Remove side-effects from assert() expression
+ since they won't occur if NDEBUG is defined (not that that's a good
+ thing to do). (Reported by KOIE Hidetaka <hide@koie.org>.)
+
+1999-08-25 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh: Use "${AWK}" instead of "awk" to make it easier for
+ people to use nawk/gawk/etc.; use an explicit "-print" with find
+ since some older version don't assume it; rename tests to avoid
+ duplicate importc-8. (Changes along these lines suggested by
+ Chris Cameron <chris.cameron@ot.co.nz>.)
+
+1999-08-24 Larry Jones <larry.jones@sdrc.com>
+
+ * commit.c (check_fileproc): Don't crash when a file has no
+ repository, just treat it as unknown. (Reported by Stefaan
+ Diericx <stefaan.diericx@argenta.be>.)
+ * sanity.sh (errmsg2): New tests, for this fix.
+
+1999-08-18 Larry Jones <larry.jones@sdrc.com>
+
+ * update.c (special_file_mismatch): Initialize *_hardlinks to
+ avoid trying to free garbage later on. (Reported by Jan
+ Scheffczyk <herta@Xterminator.StudFB.UniBw-Muenchen.de>.)
+
+1999-08-17 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh (basicc-11): Older versions of sh don't understand
+ ``if ! test...''. (Patch submitted by David J N Begley
+ <david@avarice.nepean.uws.edu.au>.)
+
+1999-08-17 Larry Jones <larry.jones@sdrc.com>
+
+ * client.c, hardlink.c, hash.c, hash.h, main.c, recurse.c: Change
+ enum constant UNKNOWN to avoid conflicts on HPUX 11.0. (Reported
+ by Laurent Duperval <laurent.duperval@cgi.ca>.)
+
+1999-08-16 Larry Jones <larry.jones@sdrc.com>
+
+ client.c: Eliminate redundant #if. (Patch submitted by Assar
+ Westerlund <assar@sics.se>.)
+
+1999-07-30 Larry Jones <larry.jones@sdrc.com>
+
+ * rcs.c (RCS_checkin): Terminate cleanly if RCS_addbranch fails
+ rather than blithely continuing on and crashing.
+ * sanity.sh (basica): New tests, for this fix.
+
+1999-07-29 Larry Jones <larry.jones@sdrc.com>
+
+ * import.c (add_rcs_file): change "cannot lstat" message to include
+ userfile (the actual file causing the problem) instead of user
+ (which may or may not be the same).
+
+1999-07-29 Eric Sink <eric@sourcegear.com>
+
+ * version.c: Push version number to 1.10.7.1.
+
+ * version.c: Version 1.10.7.
+
1999-07-28 Eric Sink <eric@sourcegear.com>
* sanity.sh: before running basicc-11, we need to see if
diff --git a/contrib/cvs/src/Makefile.in b/contrib/cvs/src/Makefile.in
index 7cbdca7..d09b0cb 100644
--- a/contrib/cvs/src/Makefile.in
+++ b/contrib/cvs/src/Makefile.in
@@ -22,13 +22,13 @@ prefix = @prefix@
exec_prefix = @exec_prefix@
# Where to install the executables.
-bindir = $(exec_prefix)/bin
+bindir = @bindir@
# Where to put the system-wide .cvsrc file
-libdir = $(prefix)/lib
+libdir = @libdir@
# Where to put the manual pages.
-mandir = $(prefix)/man
+mandir = @mandir@
# Use cp if you don't have install.
INSTALL = @INSTALL@
diff --git a/contrib/cvs/src/add.c b/contrib/cvs/src/add.c
index db1f527..dbefda5 100644
--- a/contrib/cvs/src/add.c
+++ b/contrib/cvs/src/add.c
@@ -59,6 +59,7 @@ add (argc, argv)
/* Nonzero if we found a slash, and are thus adding files in a
subdirectory. */
int found_slash = 0;
+ size_t cvsroot_len;
if (argc == 1 || argc == -1)
usage (add_usage);
@@ -92,6 +93,8 @@ add (argc, argv)
if (argc <= 0)
usage (add_usage);
+ cvsroot_len = strlen (CVSroot_directory);
+
/* First some sanity checks. I know that the CVS case is (sort of)
also handled by add_directory, but we need to check here so the
client won't get all confused in send_file_names. */
@@ -157,7 +160,11 @@ add (argc, argv)
start_server ();
ign_setup ();
- if (options) send_arg(options);
+ if (options)
+ {
+ send_arg (options);
+ free (options);
+ }
option_with_arg ("-m", message);
/* If !found_slash, refrain from sending "Directory", for
@@ -219,6 +226,17 @@ add (argc, argv)
/* find the repository associated with our current dir */
repository = Name_Repository (NULL, update_dir);
+ /* don't add stuff to Emptydir */
+ if (strncmp (repository, CVSroot_directory, cvsroot_len) == 0
+ && ISDIRSEP (repository[cvsroot_len])
+ && strncmp (repository + cvsroot_len + 1,
+ CVSROOTADM,
+ sizeof CVSROOTADM - 1) == 0
+ && ISDIRSEP (repository[cvsroot_len + sizeof CVSROOTADM])
+ && strcmp (repository + cvsroot_len + sizeof CVSROOTADM + 1,
+ CVSNULLREPOS) == 0)
+ error (1, 0, "cannot add to %s", repository);
+
/* before we do anything else, see if we have any
per-directory tags */
ParseTag (&tag, &date, &nonbranch);
@@ -227,7 +245,7 @@ add (argc, argv)
sprintf (rcsdir, "%s/%s", repository, p);
Create_Admin (p, argv[i], rcsdir, tag, date,
- nonbranch, 0);
+ nonbranch, 0, 1);
if (found_slash)
send_a_repository ("", repository, update_dir);
@@ -304,6 +322,17 @@ add (argc, argv)
/* Find the repository associated with our current dir. */
repository = Name_Repository (NULL, finfo.update_dir);
+ /* don't add stuff to Emptydir */
+ if (strncmp (repository, CVSroot_directory, cvsroot_len) == 0
+ && ISDIRSEP (repository[cvsroot_len])
+ && strncmp (repository + cvsroot_len + 1,
+ CVSROOTADM,
+ sizeof CVSROOTADM - 1) == 0
+ && ISDIRSEP (repository[cvsroot_len + sizeof CVSROOTADM])
+ && strcmp (repository + cvsroot_len + sizeof CVSROOTADM + 1,
+ CVSNULLREPOS) == 0)
+ error (1, 0, "cannot add to %s", repository);
+
entries = Entries_Open (0, NULL);
finfo.repository = repository;
@@ -619,6 +648,8 @@ cannot resurrect %s; RCS file removed by second party", finfo.fullname);
if (message)
free (message);
+ if (options)
+ free (options);
return (err);
}
@@ -769,10 +800,8 @@ add_directory (finfo)
#ifdef SERVER_SUPPORT
if (!server_active)
- Create_Admin (".", finfo->fullname, rcsdir, tag, date, nonbranch, 0);
-#else
- Create_Admin (".", finfo->fullname, rcsdir, tag, date, nonbranch, 0);
#endif
+ Create_Admin (".", finfo->fullname, rcsdir, tag, date, nonbranch, 0, 1);
if (tag)
free (tag);
if (date)
diff --git a/contrib/cvs/src/admin.c b/contrib/cvs/src/admin.c
index c5af96e..637663a 100644
--- a/contrib/cvs/src/admin.c
+++ b/contrib/cvs/src/admin.c
@@ -22,7 +22,45 @@ static int admin_fileproc PROTO ((void *callerdat, struct file_info *finfo));
static const char *const admin_usage[] =
{
- "Usage: %s %s rcs-options files...\n",
+ "Usage: %s %s [options] files...\n",
+ "\t-a users Append (comma-separated) user names to access list.\n",
+ "\t-A file Append another file's access list.\n",
+ "\t-b[rev] Set default branch (highest branch on trunk if omitted).\n",
+ "\t-c string Set comment leader.\n",
+ "\t-e[users] Remove (comma-separated) user names from access list\n",
+ "\t (all names if omitted).\n",
+ "\t-I Run interactively.\n",
+ "\t-k subst Set keyword substitution mode:\n",
+ "\t kv (Default) Substitue keyword and value.\n",
+ "\t kvl Substitue keyword, value, and locker (if any).\n",
+ "\t k Substitue keyword only.\n",
+ "\t o Preserve original string.\n",
+ "\t b Like o, but mark file as binary.\n",
+ "\t v Substitue value only.\n",
+ "\t-l[rev] Lock revision (latest revision on branch,\n",
+ "\t latest revision on trunk if omitted).\n",
+ "\t-L Set strict locking.\n",
+ "\t-m rev:msg Replace revision's log message.\n",
+ "\t-n tag[:[rev]] Tag branch or revision. If :rev is omitted,\n",
+ "\t delete the tag; if rev is omitted, tag the latest\n",
+ "\t revision on the default branch.\n",
+ "\t-N tag[:[rev]] Same as -n except override existing tag.\n",
+ "\t-o range Delete (outdate) specified range of revisions:\n",
+ "\t rev1::rev2 Between rev1 and rev2, excluding rev1 and rev2.\n",
+ "\t rev:: After rev on the same branch.\n",
+ "\t ::rev Before rev on the same branch.\n",
+ "\t rev Just rev.\n",
+ "\t rev1:rev2 Between rev1 and rev2, including rev1 and rev2.\n",
+ "\t rev: rev and following revisions on the same branch.\n",
+ "\t :rev rev and previous revisions on the same branch.\n",
+ "\t-q Run quietly.\n",
+ "\t-s state[:rev] Set revision state (latest revision on branch,\n",
+ "\t latest revision on trunk if omitted).\n",
+ "\t-t[file] Get descriptive text from file (stdin if omitted).\n",
+ "\t-t-string Set descriptive text.\n",
+ "\t-u[rev] Unlock the revision (latest revision on branch,\n",
+ "\t latest revision on trunk if omitted).\n",
+ "\t-U Unset strict locking.\n",
"(Specify the --help global option for a list of other help options)\n",
NULL
};
@@ -53,9 +91,7 @@ struct admin_data
/* Keyword substitution mode (-k), e.g. "-kb". */
char *kflag;
- /* Description (-t). See sanity.sh for various moanings about
- files and stdin and such. "" if -t specified without an
- argument. It is "-t" followed by the argument. */
+ /* Description (-t). */
char *desc;
/* Interactive (-I). Problematic with client/server. */
@@ -191,11 +227,6 @@ admin (argc, argv)
break;
case 'e':
- if (optarg == NULL)
- {
- error (1, 0,
- "removing entire access list not yet implemented");
- }
arg_add (&admin_data, 'e', optarg);
break;
@@ -287,13 +318,15 @@ admin (argc, argv)
error (0, 0, "duplicate 't' option");
goto usage_error;
}
- if (optarg == NULL)
- admin_data.desc = xstrdup ("-t");
+ if (optarg != NULL && optarg[0] == '-')
+ admin_data.desc = xstrdup (optarg + 1);
else
{
- admin_data.desc = xmalloc (strlen (optarg) + 5);
- strcpy (admin_data.desc, "-t");
- strcat (admin_data.desc, optarg);
+ size_t bufsize = 0;
+ size_t len;
+
+ get_file (optarg, optarg, "r", &admin_data.desc,
+ &bufsize, &len);
}
break;
@@ -417,7 +450,26 @@ admin (argc, argv)
if (admin_data.delete_revs != NULL)
send_arg (admin_data.delete_revs);
if (admin_data.desc != NULL)
- send_arg (admin_data.desc);
+ {
+ char *p = admin_data.desc;
+ send_to_server ("Argument -t-", 0);
+ while (*p)
+ {
+ if (*p == '\n')
+ {
+ send_to_server ("\012Argumentx ", 0);
+ ++p;
+ }
+ else
+ {
+ char *q = strchr (p, '\n');
+ if (q == NULL) q = p + strlen (p);
+ send_to_server (p, q - p);
+ p = q;
+ }
+ }
+ send_to_server ("\012", 1);
+ }
if (admin_data.quiet)
send_arg ("-q");
if (admin_data.kflag != NULL)
@@ -598,20 +650,7 @@ admin_fileproc (callerdat, finfo)
if (admin_data->desc != NULL)
{
free (rcs->desc);
- rcs->desc = NULL;
- if (admin_data->desc[2] == '-')
- rcs->desc = xstrdup (admin_data->desc + 3);
- else
- {
- char *descfile = admin_data->desc + 2;
- size_t bufsize = 0;
- size_t len;
-
- /* If -t specified with no argument, read from stdin. */
- if (*descfile == '\0')
- descfile = NULL;
- get_file (descfile, descfile, "r", &rcs->desc, &bufsize, &len);
- }
+ rcs->desc = xstrdup (admin_data->desc);
}
if (admin_data->kflag != NULL)
{
@@ -642,6 +681,8 @@ admin_fileproc (callerdat, finfo)
if (arg[1] == 'a')
for (u = 0; u < argc; ++u)
RCS_addaccess (rcs, users[u]);
+ else if (argc == 0)
+ RCS_delaccess (rcs, NULL);
else
for (u = 0; u < argc; ++u)
RCS_delaccess (rcs, users[u]);
@@ -748,20 +789,24 @@ admin_fileproc (callerdat, finfo)
rev = xstrdup (p);
}
revnum = RCS_gettag (rcs, rev, 0, NULL);
- free (rev);
if (revnum != NULL)
+ {
n = findnode (rcs->versions, revnum);
- if (revnum == NULL || n == NULL)
+ free (revnum);
+ }
+ else
+ n = NULL;
+ if (n == NULL)
{
error (0, 0,
"%s: can't set state of nonexisting revision %s",
rcs->path,
rev);
- if (revnum != NULL)
- free (revnum);
+ free (rev);
status = 1;
continue;
}
+ free (rev);
delta = (RCSVers *) n->data;
free (delta->state);
delta->state = tag;
@@ -788,6 +833,7 @@ admin_fileproc (callerdat, finfo)
msg = p;
n = findnode (rcs->versions, rev);
+ free (rev);
delta = (RCSVers *) n->data;
if (delta->text == NULL)
{
@@ -823,12 +869,7 @@ admin_fileproc (callerdat, finfo)
additional message is to make it clear that the previous problems
caused CVS to forget about the idea of modifying the RCS file. */
error (0, 0, "cannot modify RCS file for `%s'", finfo->file);
-
- /* Upon failure, we want to abandon any changes made to the
- RCS data structure. Forcing a reparse does the trick,
- but leaks memory and is kludgey. Should we export
- free_rcsnode_contents for this purpose? */
- RCS_reparsercsfile (rcs, (FILE **) NULL, (struct rcsbuffer *) NULL);
+ RCS_abandon (rcs);
}
exitfunc:
diff --git a/contrib/cvs/src/checkout.c b/contrib/cvs/src/checkout.c
index a7d942f..1a66b5b 100644
--- a/contrib/cvs/src/checkout.c
+++ b/contrib/cvs/src/checkout.c
@@ -37,11 +37,10 @@
#include "cvs.h"
static char *findslash PROTO((char *start, char *p));
-static int checkout_proc PROTO((int *pargc, char **argv, char *where,
+static int checkout_proc PROTO((int argc, char **argv, char *where,
char *mwhere, char *mfile, int shorten,
int local_specified, char *omodule,
char *msg));
-static int safe_location PROTO((void));
static const char *const checkout_usage[] =
{
@@ -95,6 +94,7 @@ static char *join_rev2 = NULL;
static int join_tags_validated = 0;
static char *preload_update_dir = NULL;
static char *history_name = NULL;
+static enum mtype m_type;
int
checkout (argc, argv)
@@ -111,7 +111,6 @@ checkout (argc, argv)
char *where = NULL;
char *valid_options;
const char *const *valid_usage;
- enum mtype m_type;
/*
* A smaller subset of options are allowed for the export command, which
@@ -233,7 +232,7 @@ checkout (argc, argv)
if (where && pipeout)
error (1, 0, "-d and -p are mutually exclusive");
- if (strcmp (command_name, "export") == 0)
+ if (m_type == EXPORT)
{
if (!tag && !date)
error (1, 0, "must specify a tag or date");
@@ -294,7 +293,7 @@ checkout (argc, argv)
send_arg("-A");
if (!shorten)
send_arg("-N");
- if (checkout_prune_dirs && strcmp (command_name, "export") != 0)
+ if (checkout_prune_dirs && m_type == CHECKOUT)
send_arg("-P");
client_prune_dirs = checkout_prune_dirs;
if (cat)
@@ -325,10 +324,7 @@ checkout (argc, argv)
client_nonexpanded_setup ();
}
- send_to_server (strcmp (command_name, "export") == 0 ?
- "export\012" : "co\012",
- 0);
-
+ send_to_server (m_type == EXPORT ? "export\012" : "co\012", 0);
return get_responses_and_close ();
}
#endif /* CLIENT_SUPPORT */
@@ -355,7 +351,7 @@ checkout (argc, argv)
/* If we will be calling history_write, work out the name to pass
it. */
- if (strcmp (command_name, "export") != 0 && !pipeout)
+ if (m_type == CHECKOUT && !pipeout)
{
if (tag && date)
{
@@ -379,7 +375,10 @@ checkout (argc, argv)
return (err);
}
-static int
+/* FIXME: This is and emptydir_name are in checkout.c for historical
+ reasons, probably want to move them. */
+
+int
safe_location ()
{
char *current;
@@ -455,7 +454,12 @@ build_one_dir (repository, dirpath, sticky)
{
FILE *fp;
- if (!isfile (CVSADM) && strcmp (command_name, "export") != 0)
+ if (isfile (CVSADM))
+ {
+ if (m_type == EXPORT)
+ error (1, 0, "cannot export into a working directory");
+ }
+ else if (m_type == CHECKOUT)
{
/* I suspect that this check could be omitted. */
if (!isdir (repository))
@@ -471,7 +475,7 @@ build_one_dir (repository, dirpath, sticky)
then rewrite it later via WriteTag, once
we've had a chance to call RCS_nodeisbranch
on each file. */
- 0, 1))
+ 0, 1, 1))
return;
if (!noexec)
@@ -492,9 +496,9 @@ build_one_dir (repository, dirpath, sticky)
*/
/* ARGSUSED */
static int
-checkout_proc (pargc, argv, where_orig, mwhere, mfile, shorten,
+checkout_proc (argc, argv, where_orig, mwhere, mfile, shorten,
local_specified, omodule, msg)
- int *pargc;
+ int argc;
char **argv;
char *where_orig;
char *mwhere;
@@ -504,6 +508,7 @@ checkout_proc (pargc, argv, where_orig, mwhere, mfile, shorten,
char *omodule;
char *msg;
{
+ char *myargv[2];
int err = 0;
int which;
char *cp;
@@ -665,26 +670,10 @@ checkout_proc (pargc, argv, where_orig, mwhere, mfile, shorten,
{
/* It's a file, which means we have to screw around with
argv. */
-
- int i;
-
-
- /* Paranoia check. */
-
- if (*pargc > 1)
- {
- error (0, 0, "checkout_proc: trashing argv elements!");
- for (i = 1; i < *pargc; i++)
- {
- error (0, 0, "checkout_proc: argv[%d] `%s'",
- i, argv[i]);
- }
- }
-
- for (i = 1; i < *pargc; i++)
- free (argv[i]);
- argv[1] = xstrdup (mfile);
- (*pargc) = 2;
+ myargv[0] = argv[0];
+ myargv[1] = mfile;
+ argc = 2;
+ argv = myargv;
}
free (path);
}
@@ -745,7 +734,7 @@ internal error: %s doesn't start with %s in checkout_proc",
NT, &c, if the user specifies '\'. Likewise for the call
to findslash. */
cp = where + strlen (where);
- while (1)
+ while (cp > where)
{
struct dir_to_build *new;
@@ -761,7 +750,7 @@ internal error: %s doesn't start with %s in checkout_proc",
last path element we create should be the top-level
directory. */
- if (cp - where)
+ if (cp > where)
{
strncpy (new->dirpath, where, cp - where);
new->dirpath[cp - where] = '\0';
@@ -769,7 +758,7 @@ internal error: %s doesn't start with %s in checkout_proc",
else
{
/* where should always be at least one character long. */
- assert (strlen (where));
+ assert (where[0] != '\0');
strcpy (new->dirpath, "/");
}
new->next = head;
@@ -841,10 +830,11 @@ internal error: %s doesn't start with %s in checkout_proc",
{
/* It's a directory in the repository! */
- char *rp = strrchr (reposcopy, '/');
+ char *rp;
/* We'll always be below CVSROOT, but check for
paranoia's sake. */
+ rp = strrchr (reposcopy, '/');
if (rp == NULL)
error (1, 0,
"internal error: %s doesn't contain a slash",
@@ -890,7 +880,7 @@ internal error: %s doesn't start with %s in checkout_proc",
{
/* It may be argued that we shouldn't set any sticky
bits for the top-level repository. FIXME? */
- build_one_dir (CVSroot_directory, ".", *pargc <= 1);
+ build_one_dir (CVSroot_directory, ".", argc <= 1);
#ifdef SERVER_SUPPORT
/* We _always_ want to have a top-level admin
@@ -912,7 +902,7 @@ internal error: %s doesn't start with %s in checkout_proc",
contain a CVS subdir yet, but all the others contain
CVS and Entries.Static files */
- if (build_dirs_and_chdir (head, *pargc <= 1) != 0)
+ if (build_dirs_and_chdir (head, argc <= 1) != 0)
{
error (0, 0, "ignoring module %s", omodule);
err = 1;
@@ -925,14 +915,15 @@ internal error: %s doesn't start with %s in checkout_proc",
{
FILE *fp;
- if (!noexec && *pargc > 1)
+ if (!noexec && argc > 1)
{
/* I'm not sure whether this check is redundant. */
if (!isdir (repository))
error (1, 0, "there is no repository %s", repository);
Create_Admin (".", preload_update_dir, repository,
- (char *) NULL, (char *) NULL, 0, 0);
+ (char *) NULL, (char *) NULL, 0, 0,
+ m_type == CHECKOUT);
fp = open_file (CVSADM_ENTSTAT, "w+");
if (fclose(fp) == EOF)
error(1, errno, "cannot close %s", CVSADM_ENTSTAT);
@@ -955,13 +946,16 @@ internal error: %s doesn't start with %s in checkout_proc",
then rewrite it later via WriteTag, once
we've had a chance to call RCS_nodeisbranch
on each file. */
- 0, 0);
+ 0, 0, m_type == CHECKOUT);
}
}
else
{
char *repos;
+ if (m_type == EXPORT)
+ error (1, 0, "cannot export into working directory");
+
/* get the contents of the previously existing repository */
repos = Name_Repository ((char *) NULL, preload_update_dir);
if (fncmp (repository, repos) != 0)
@@ -993,7 +987,7 @@ internal error: %s doesn't start with %s in checkout_proc",
which = W_REPOS;
if (tag != NULL && !tag_validated)
{
- tag_check_valid (tag, *pargc - 1, argv + 1, 0, aflag, NULL);
+ tag_check_valid (tag, argc - 1, argv + 1, 0, aflag, NULL);
tag_validated = 1;
}
}
@@ -1002,7 +996,7 @@ internal error: %s doesn't start with %s in checkout_proc",
which = W_LOCAL | W_REPOS;
if (tag != NULL && !tag_validated)
{
- tag_check_valid (tag, *pargc - 1, argv + 1, 0, aflag,
+ tag_check_valid (tag, argc - 1, argv + 1, 0, aflag,
repository);
tag_validated = 1;
}
@@ -1014,10 +1008,10 @@ internal error: %s doesn't start with %s in checkout_proc",
if (! join_tags_validated)
{
if (join_rev1 != NULL)
- tag_check_valid_join (join_rev1, *pargc - 1, argv + 1, 0, aflag,
+ tag_check_valid_join (join_rev1, argc - 1, argv + 1, 0, aflag,
repository);
if (join_rev2 != NULL)
- tag_check_valid_join (join_rev2, *pargc - 1, argv + 1, 0, aflag,
+ tag_check_valid_join (join_rev2, argc - 1, argv + 1, 0, aflag,
repository);
join_tags_validated = 1;
}
@@ -1027,12 +1021,12 @@ internal error: %s doesn't start with %s in checkout_proc",
* update recursion processor. We will be recursive unless either local
* only was specified, or we were passed arguments
*/
- if (!(local_specified || *pargc > 1))
+ if (!(local_specified || argc > 1))
{
- if (strcmp (command_name, "export") != 0 && !pipeout)
+ if (m_type == CHECKOUT && !pipeout)
history_write ('O', preload_update_dir, history_name, where,
repository);
- else if (strcmp (command_name, "export") == 0 && !pipeout)
+ else if (m_type == EXPORT && !pipeout)
history_write ('E', preload_update_dir, tag ? tag : date, where,
repository);
err += do_update (0, (char **) NULL, options, tag, date,
@@ -1050,7 +1044,7 @@ internal error: %s doesn't start with %s in checkout_proc",
/* we are only doing files, so register them */
entries = Entries_Open (0, NULL);
- for (i = 1; i < *pargc; i++)
+ for (i = 1; i < argc; i++)
{
char *line;
Vers_TS *vers;
@@ -1087,12 +1081,12 @@ internal error: %s doesn't start with %s in checkout_proc",
}
/* Don't log "export", just regular "checkouts" */
- if (strcmp (command_name, "export") != 0 && !pipeout)
+ if (m_type == CHECKOUT && !pipeout)
history_write ('O', preload_update_dir, history_name, where,
repository);
/* go ahead and call update now that everything is set */
- err += do_update (*pargc - 1, argv + 1, options, tag, date,
+ err += do_update (argc - 1, argv + 1, options, tag, date,
force_tag_match, local_specified, 1 /* update -d */,
aflag, checkout_prune_dirs, pipeout, which, join_rev1,
join_rev2, preload_update_dir);
@@ -1109,15 +1103,13 @@ findslash (start, p)
char *start;
char *p;
{
- while (p >= start && *p != '/')
- p--;
- /* FIXME: indexing off the start of the array like this is *NOT*
- OK according to ANSI, and will break some of the time on certain
- segmented architectures. */
- if (p < start)
- return (NULL);
- else
- return (p);
+ for (;;)
+ {
+ if (*p == '/') return p;
+ if (p == start) break;
+ --p;
+ }
+ return NULL;
}
/* Return a newly malloc'd string containing a pathname for CVSNULLREPOS,
@@ -1185,5 +1177,14 @@ build_dirs_and_chdir (dirs, sticky)
}
out:
+ while (dirs != NULL)
+ {
+ if (dirs->repository != NULL)
+ free (dirs->repository);
+ nextdir = dirs->next;
+ free (dirs->dirpath);
+ free (dirs);
+ dirs = nextdir;
+ }
return retval;
}
diff --git a/contrib/cvs/src/client.h b/contrib/cvs/src/client.h
index c323cf3..b4d404a 100644
--- a/contrib/cvs/src/client.h
+++ b/contrib/cvs/src/client.h
@@ -109,6 +109,7 @@ send_files PROTO((int argc, char **argv, int local, int aflag,
#define SEND_BUILD_DIRS 1
#define SEND_FORCE 2
#define SEND_NO_CONTENTS 4
+#define BACKUP_MODIFIED_FILES 8
/* Send an argument to the remote server. */
void
diff --git a/contrib/cvs/src/create_adm.c b/contrib/cvs/src/create_adm.c
index 7f8f581..878b058 100644
--- a/contrib/cvs/src/create_adm.c
+++ b/contrib/cvs/src/create_adm.c
@@ -22,7 +22,8 @@
don't print warnings; all errors are fatal then. */
int
-Create_Admin (dir, update_dir, repository, tag, date, nonbranch, warn)
+Create_Admin (dir, update_dir, repository, tag, date, nonbranch, warn,
+ dotemplate)
char *dir;
char *update_dir;
char *repository;
@@ -30,6 +31,7 @@ Create_Admin (dir, update_dir, repository, tag, date, nonbranch, warn)
char *date;
int nonbranch;
int warn;
+ int dotemplate;
{
FILE *fout;
char *cp;
@@ -168,7 +170,7 @@ Create_Admin (dir, update_dir, repository, tag, date, nonbranch, warn)
WriteTag (dir, tag, date, nonbranch, update_dir, repository);
#ifdef SERVER_SUPPORT
- if (server_active)
+ if (server_active && dotemplate)
{
server_template (update_dir, repository);
}
diff --git a/contrib/cvs/src/edit.c b/contrib/cvs/src/edit.c
index 59d363c..df649b6 100644
--- a/contrib/cvs/src/edit.c
+++ b/contrib/cvs/src/edit.c
@@ -427,6 +427,15 @@ edit (argc, argv)
setting_tcommit = 1;
}
+ if (strpbrk (hostname, "+,>;=\t\n") != NULL)
+ error (1, 0,
+ "host name (%s) contains an invalid character (+,>;=\\t\\n)",
+ hostname);
+ if (strpbrk (CurDir, "+,>;=\t\n") != NULL)
+ error (1, 0,
+"current directory (%s) contains an invalid character (+,>;=\\t\\n)",
+ CurDir);
+
/* No need to readlock since we aren't doing anything to the
repository. */
err = start_recursion (edit_fileproc, (FILESDONEPROC) NULL,
@@ -553,6 +562,15 @@ unedit_fileproc (callerdat, finfo)
return 0;
}
+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",
+ NULL
+};
+
int
unedit (argc, argv)
int argc;
@@ -563,7 +581,7 @@ unedit (argc, argv)
int err;
if (argc == -1)
- usage (edit_usage);
+ usage (unedit_usage);
optind = 0;
while ((c = getopt (argc, argv, "+lR")) != -1)
@@ -578,7 +596,7 @@ unedit (argc, argv)
break;
case '?':
default:
- usage (edit_usage);
+ usage (unedit_usage);
break;
}
}
@@ -1060,6 +1078,7 @@ editors_fileproc (callerdat, finfo)
cvs_output ("\n", 1);
}
out:;
+ free (them);
return 0;
}
diff --git a/contrib/cvs/src/entries.c b/contrib/cvs/src/entries.c
index 7e258a9..14163bb 100644
--- a/contrib/cvs/src/entries.c
+++ b/contrib/cvs/src/entries.c
@@ -807,7 +807,8 @@ Subdirs_Known (entries)
if (!noexec)
{
/* Create Entries.Log so that Entries_Close will do something. */
- fp = CVS_FOPEN (CVSADM_ENTLOG, "a");
+ entfilename = CVSADM_ENTLOG;
+ fp = CVS_FOPEN (entfilename, "a");
if (fp == NULL)
{
int save_errno = errno;
@@ -821,7 +822,7 @@ Subdirs_Known (entries)
else
{
if (fclose (fp) == EOF)
- error (1, errno, "cannot close %s", CVSADM_ENTLOG);
+ error (1, errno, "cannot close %s", entfilename);
}
}
}
diff --git a/contrib/cvs/src/error.c b/contrib/cvs/src/error.c
index 64b686c..fe5877f 100644
--- a/contrib/cvs/src/error.c
+++ b/contrib/cvs/src/error.c
@@ -64,7 +64,8 @@ extern char *strerror ();
void
error_exit PROTO ((void))
{
- Lock_Cleanup();
+ rcs_cleanup ();
+ Lock_Cleanup ();
#ifdef SERVER_SUPPORT
if (server_active)
server_cleanup (0);
@@ -122,7 +123,7 @@ error (status, errnum, message, va_alist)
int num;
unsigned int unum;
int ch;
- unsigned char buf[100];
+ char buf[100];
cvs_outerr (program_name, 0);
if (command_name && *command_name)
@@ -201,9 +202,9 @@ error (status, errnum, message, va_alist)
/* VARARGS */
void
#if defined (HAVE_VPRINTF) && defined (__STDC__)
-fperror (FILE *fp, int status, int errnum, char *message, ...)
+fperrmsg (FILE *fp, int status, int errnum, char *message, ...)
#else
-fperror (fp, status, errnum, message, va_alist)
+fperrmsg (fp, status, errnum, message, va_alist)
FILE *fp;
int status;
int errnum;
diff --git a/contrib/cvs/src/fileattr.c b/contrib/cvs/src/fileattr.c
index 4042d2a..bae03a6 100644
--- a/contrib/cvs/src/fileattr.c
+++ b/contrib/cvs/src/fileattr.c
@@ -126,7 +126,7 @@ fileattr_read ()
any line other than the first for that filename. This
is the way that CVS has behaved since file attributes
were first introduced. */
- free (newnode);
+ freenode (newnode);
}
else if (line[0] == 'D')
{
@@ -513,6 +513,7 @@ fileattr_write ()
FILE *fp;
char *fname;
mode_t omask;
+ struct unrecog *p;
if (!attrs_modified)
return;
@@ -616,17 +617,10 @@ fileattr_write ()
}
/* Then any other attributes. */
- while (unrecog_head != NULL)
+ for (p = unrecog_head; p != NULL; p = p->next)
{
- struct unrecog *p;
-
- p = unrecog_head;
fputs (p->line, fp);
fputs ("\012", fp);
-
- unrecog_head = p->next;
- free (p->line);
- free (p);
}
if (fclose (fp) < 0)
@@ -649,4 +643,11 @@ fileattr_free ()
if (fileattr_default_attrs != NULL)
free (fileattr_default_attrs);
fileattr_default_attrs = NULL;
+ while (unrecog_head)
+ {
+ struct unrecog *p = unrecog_head;
+ unrecog_head = p->next;
+ free (p->line);
+ free (p);
+ }
}
diff --git a/contrib/cvs/src/hardlink.c b/contrib/cvs/src/hardlink.c
index 046cf3a..309d27f 100644
--- a/contrib/cvs/src/hardlink.c
+++ b/contrib/cvs/src/hardlink.c
@@ -63,7 +63,7 @@ lookup_file_by_inode (filepath)
/* inodestr contains the hexadecimal representation of an
inode, so it requires two bytes of text to represent
each byte of the inode number. */
- inodestr = (char *) xmalloc (2*sizeof(ino_t)*sizeof(char) + 1);
+ inodestr = (char *) xmalloc (2*sizeof(ino_t) + 1);
if (stat (file, &sb) < 0)
{
if (existence_error (errno))
@@ -85,7 +85,7 @@ lookup_file_by_inode (filepath)
if (hp == NULL)
{
hp = getnode ();
- hp->type = UNKNOWN;
+ hp->type = NT_UNKNOWN;
hp->key = inodestr;
hp->data = (char *) getlist();
hp->delproc = dellist;
@@ -100,7 +100,7 @@ lookup_file_by_inode (filepath)
if (p == NULL)
{
p = getnode();
- p->type = UNKNOWN;
+ p->type = NT_UNKNOWN;
p->key = xstrdup (filepath);
p->data = NULL;
(void) addnode ((List *) hp->data, p);
@@ -128,7 +128,7 @@ update_hardlink_info (file)
/* file is a relative pathname; assume it's from the current
working directory. */
char *dir = xgetwd();
- path = xmalloc (sizeof(char) * (strlen(dir) + strlen(file) + 2));
+ path = xmalloc (strlen(dir) + strlen(file) + 2);
sprintf (path, "%s/%s", dir, file);
free (dir);
}
@@ -176,8 +176,7 @@ list_linked_files_on_disk (file)
else
{
char *dir = xgetwd();
- path = (char *) xmalloc (sizeof(char) *
- (strlen(dir) + strlen(file) + 2));
+ path = (char *) xmalloc (strlen(dir) + strlen(file) + 2);
sprintf (path, "%s/%s", dir, file);
free (dir);
}
@@ -193,7 +192,7 @@ list_linked_files_on_disk (file)
/* inodestr contains the hexadecimal representation of an
inode, so it requires two bytes of text to represent
each byte of the inode number. */
- inodestr = (char *) xmalloc (2*sizeof(ino_t)*sizeof(char) + 1);
+ inodestr = (char *) xmalloc (2*sizeof(ino_t) + 1);
sprintf (inodestr, "%lx", (unsigned long) sb.st_ino);
/* Make sure the files linked to this inode are sorted. */
@@ -280,7 +279,7 @@ find_checkedout_proc (node, data)
/* Look at this file in the hardlist and see whether the checked_out
field is 1, meaning that it has been checked out during this CVS run. */
path = (char *)
- xmalloc (sizeof(char) * (strlen (dir) + strlen (node->key) + 2));
+ xmalloc (strlen (dir) + strlen (node->key) + 2);
sprintf (path, "%s/%s", dir, node->key);
link = lookup_file_by_inode (path);
free (path);
diff --git a/contrib/cvs/src/hash.c b/contrib/cvs/src/hash.c
index af000ac..7e562b8 100644
--- a/contrib/cvs/src/hash.c
+++ b/contrib/cvs/src/hash.c
@@ -102,7 +102,7 @@ dellist (listp)
{
/* put the nodes into the cache */
#ifndef NOCACHE
- p->type = UNKNOWN;
+ p->type = NT_UNKNOWN;
p->next = nodecache;
nodecache = p;
#else
@@ -147,7 +147,7 @@ getnode ()
/* always make it clean */
memset ((char *) p, 0, sizeof (Node));
- p->type = UNKNOWN;
+ p->type = NT_UNKNOWN;
return (p);
}
@@ -211,7 +211,7 @@ freenode (p)
/* then put it in the cache */
#ifndef NOCACHE
- p->type = UNKNOWN;
+ p->type = NT_UNKNOWN;
p->next = nodecache;
nodecache = p;
#else
@@ -456,7 +456,7 @@ nodetypestring (type)
Ntype type;
{
switch (type) {
- case UNKNOWN: return("UNKNOWN");
+ case NT_UNKNOWN: return("UNKNOWN");
case HEADER: return("HEADER");
case ENTRIES: return("ENTRIES");
case FILES: return("FILES");
@@ -470,6 +470,7 @@ nodetypestring (type)
case FILEATTR: return("FILEATTR");
case VARIABLE: return("VARIABLE");
case RCSFIELD: return("RCSFIELD");
+ case RCSCMPFLD: return("RCSCMPFLD");
}
return("<trash>");
diff --git a/contrib/cvs/src/hash.h b/contrib/cvs/src/hash.h
index 06867a7..f98353d 100644
--- a/contrib/cvs/src/hash.h
+++ b/contrib/cvs/src/hash.h
@@ -16,9 +16,9 @@
*/
enum ntype
{
- UNKNOWN, HEADER, ENTRIES, FILES, LIST, RCSNODE,
+ NT_UNKNOWN, HEADER, ENTRIES, FILES, LIST, RCSNODE,
RCSVERS, DIRS, UPDATE, LOCK, NDBMNODE, FILEATTR,
- VARIABLE, RCSFIELD
+ VARIABLE, RCSFIELD, RCSCMPFLD
};
typedef enum ntype Ntype;
diff --git a/contrib/cvs/src/history.c b/contrib/cvs/src/history.c
index bc7d1a6..9f66e86 100644
--- a/contrib/cvs/src/history.c
+++ b/contrib/cvs/src/history.c
@@ -195,7 +195,7 @@ static struct hrec
} *hrec_head;
-static char *fill_hrec PROTO((char *line, struct hrec * hr));
+static void fill_hrec PROTO((char *line, struct hrec * hr));
static int accept_hrec PROTO((struct hrec * hr, struct hrec * lr));
static int select_hrec PROTO((struct hrec * hr));
static int sort_order PROTO((const PTR l, const PTR r));
@@ -233,6 +233,8 @@ static short tz_local;
static time_t tz_seconds_east_of_GMT;
static char *tz_name = "+0000";
+char *logHistory = ALL_REC_TYPES;
+
/* -r, -t, or -b options, malloc'd. These are "" if the option in
question is not specified or is overridden by another option. The
main reason for using "" rather than NULL is historical. Together
@@ -288,9 +290,9 @@ static const char *const history_usg[] =
" -o Checked out modules\n",
" -m <module> Look for specified module (repeatable)\n",
" -x [TOEFWUCGMAR] Extract by record type\n",
+ " -e Everything (same as -x, but all record types)\n",
" Flags:\n",
" -a All users (Default is self)\n",
- " -e Everything (same as -x, but all record types)\n",
" -l Last modified (committed or modified report)\n",
" -w Working directory must match\n",
" Options:\n",
@@ -523,13 +525,17 @@ history (argc, argv)
break;
}
}
- c = optind; /* Save the handled option count */
+ argc -= optind;
+ argv += optind;
+ for (i = 0; i < argc; i++)
+ save_file ("", argv[i], (char *) NULL);
+
/* ================ Now analyze the arguments a bit */
if (!report_count)
v_checkout++;
else if (report_count > 1)
- error (1, 0, "Only one report type allowed from: \"-Tcomx\".");
+ error (1, 0, "Only one report type allowed from: \"-Tcomxe\".");
#ifdef CLIENT_SUPPORT
if (client_active)
@@ -613,7 +619,8 @@ history (argc, argv)
* If the user has not specified a date oriented flag ("Since"), sort
* by Repository/file before date. Default is "just" date.
*/
- if (!since_date && !*since_rev && !*since_tag && !*backto)
+ if (last_entry
+ || (!since_date && !*since_rev && !*since_tag && !*backto))
{
repos_sort++;
file_sort++;
@@ -642,7 +649,8 @@ history (argc, argv)
/* See comments in "modified" above */
if (!last_entry && user_list)
user_sort++;
- if (!since_date && !*since_rev && !*since_tag && !*backto)
+ if (last_entry
+ || (!since_date && !*since_rev && !*since_tag && !*backto))
file_sort++;
}
@@ -657,11 +665,6 @@ history (argc, argv)
(void) strcat (rec_types, "T");
}
- argc -= c;
- argv += c;
- for (i = 0; i < argc; i++)
- save_file ("", argv[i], (char *) NULL);
-
if (histfile)
fname = xstrdup (histfile);
else
@@ -673,7 +676,11 @@ history (argc, argv)
}
read_hrecs (fname);
- qsort ((PTR) hrec_head, hrec_count, sizeof (struct hrec), sort_order);
+ if(hrec_count>0)
+ {
+ qsort ((PTR) hrec_head, hrec_count,
+ sizeof (struct hrec), sort_order);
+ }
report_hrecs ();
free (fname);
if (since_date != NULL)
@@ -706,6 +713,8 @@ history_write (type, update_dir, revs, name, repository)
if (logoff) /* History is turned off by cmd line switch */
return;
+ if ( strchr(logHistory, type) == NULL )
+ return;
fname = xmalloc (strlen (CVSroot_directory) + sizeof (CVSROOTADM)
+ sizeof (CVSROOTADM_HISTORY) + 10);
(void) sprintf (fname, "%s/%s/%s", CVSroot_directory,
@@ -725,7 +734,14 @@ history_write (type, update_dir, revs, name, repository)
goto out;
fd = CVS_OPEN (fname, O_WRONLY | O_APPEND | O_CREAT | OPEN_BINARY, 0666);
if (fd < 0)
- error (1, errno, "cannot open history file: %s", fname);
+ {
+ if (! really_quiet)
+ {
+ error (0, errno, "warning: cannot write to history file %s",
+ fname);
+ }
+ goto out;
+ }
repos = Short_Repository (repository);
@@ -965,27 +981,26 @@ expand_modules ()
*
* Split it into 7 parts and drop the parts into a "struct hrec".
* Return a pointer to the character following the newline.
+ *
*/
-#define NEXT_BAR(here) do { while (isspace((unsigned char) *line)) line++; hr->here = line; while ((c = *line++) && c != '|') ; if (!c) return(rtn); *(line - 1) = '\0'; } while (0)
+#define NEXT_BAR(here) do { while (isspace(*line)) line++; hr->here = line; while ((c = *line++) && c != '|') ; if (!c) return; *(line - 1) = '\0'; } while (0)
-static char *
+static void
fill_hrec (line, hr)
char *line;
struct hrec *hr;
{
- char *cp, *rtn;
+ char *cp;
int c;
int off;
static int idx = 0;
unsigned long date;
memset ((char *) hr, 0, sizeof (*hr));
+
while (isspace ((unsigned char) *line))
line++;
- if (!(rtn = strchr (line, '\n')))
- return ("");
- *rtn++ = '\0';
hr->type = line++;
(void) sscanf (line, "%lx", &date);
@@ -993,7 +1008,7 @@ fill_hrec (line, hr)
while (*line && strchr ("0123456789abcdefABCDEF", *line))
line++;
if (*line == '\0')
- return (rtn);
+ return;
line++;
NEXT_BAR (user);
@@ -1012,27 +1027,38 @@ fill_hrec (line, hr)
if (strchr ("FOET", *(hr->type)))
hr->mod = line;
- NEXT_BAR (file); /* This returns ptr to next line or final '\0' */
- return (rtn); /* If it falls through, go on to next record */
+ NEXT_BAR (file);
}
+
+#ifndef STAT_BLOCKSIZE
+#if HAVE_ST_BLKSIZE
+#define STAT_BLOCKSIZE(s) (s).st_blksize
+#else
+#define STAT_BLOCKSIZE(s) (4 * 1024)
+#endif
+#endif
+
+
/* read_hrecs's job is to read the history file and fill in all the "hrec"
* (history record) array elements with the ones we need to print.
*
* Logic:
- * - Read the whole history file into a single buffer.
- * - Walk through the buffer, parsing lines out of the buffer.
- * 1. Split line into pointer and integer fields in the "next" hrec.
- * 2. Apply tests to the hrec to see if it is wanted.
- * 3. If it *is* wanted, bump the hrec pointer down by one.
+ * - Read a block from the file.
+ * - Walk through the block parsing line into hr records.
+ * - if the hr isn't used, free its strings, if it is, bump the hrec counter
+ * - at the end of a block, copy the end of the current block to the start
+ * of space for the next block, then read in the next block. If we get less
+ * than the whole block, we're done.
*/
static void
read_hrecs (fname)
char *fname;
{
- char *cp, *cp2;
- int i, fd;
- struct hrec *hr;
+ unsigned char *cpstart, *cp, *nl;
+ char *hrline;
+ int i;
+ int fd;
struct stat st_buf;
if ((fd = CVS_OPEN (fname, O_RDONLY | OPEN_BINARY)) < 0)
@@ -1041,54 +1067,75 @@ read_hrecs (fname)
if (fstat (fd, &st_buf) < 0)
error (1, errno, "can't stat history file");
- /* Exactly enough space for lines data */
- if (!(i = st_buf.st_size))
+ if (!(st_buf.st_size))
error (1, 0, "history file is empty");
- cp = xmalloc (i + 2);
- if (read (fd, cp, i) != i)
- error (1, errno, "cannot read log file");
- (void) close (fd);
-
- if (*(cp + i - 1) != '\n')
- {
- *(cp + i) = '\n'; /* Make sure last line ends in '\n' */
- i++;
- }
- *(cp + i) = '\0';
- for (cp2 = cp; cp2 - cp < i; cp2++)
- {
- if (*cp2 != '\n' && !isprint ((unsigned char) *cp2))
- *cp2 = ' ';
- }
+ cpstart = xmalloc (2 * STAT_BLOCKSIZE(st_buf));
+ cpstart[0] = '\0';
+ cp = cpstart;
hrec_max = HREC_INCREMENT;
- hrec_head = (struct hrec *) xmalloc (hrec_max * sizeof (struct hrec));
+ hrec_head = xmalloc (hrec_max * sizeof (struct hrec));
- while (*cp)
+ for (;;)
{
+ for (nl = cp; *nl && *nl != '\n'; nl++)
+ if (!isprint(*nl)) *nl = ' ';
+
+ if (!*nl)
+ {
+ if (nl - cp >= STAT_BLOCKSIZE(st_buf))
+ {
+ error(1, 0, "history line too long (> %lu)",
+ (unsigned long) STAT_BLOCKSIZE(st_buf));
+ }
+ if (nl > cp)
+ memmove (cpstart, cp, nl - cp);
+ nl = cpstart + (nl - cp);
+ cp = cpstart;
+ i = read (fd, nl, STAT_BLOCKSIZE(st_buf));
+ if (i > 0)
+ {
+ nl[i] = '\0';
+ continue;
+ }
+ if (i < 0)
+ error (1, errno, "error reading history file");
+ if (nl == cp) break;
+ nl[1] = '\0';
+ }
+ *nl = '\0';
+
if (hrec_count == hrec_max)
{
struct hrec *old_head = hrec_head;
hrec_max += HREC_INCREMENT;
- hrec_head = (struct hrec *) xrealloc ((char *) hrec_head,
- hrec_max * sizeof (struct hrec));
- if (hrec_head != old_head)
- {
- if (last_since_tag)
- last_since_tag = hrec_head + (last_since_tag - old_head);
- if (last_backto)
- last_backto = hrec_head + (last_backto - old_head);
- }
+ hrec_head = xrealloc ((char *) hrec_head,
+ hrec_max * sizeof (struct hrec));
+ if (last_since_tag)
+ last_since_tag = hrec_head + (last_since_tag - old_head);
+ if (last_backto)
+ last_backto = hrec_head + (last_backto - old_head);
}
- hr = hrec_head + hrec_count;
- cp = fill_hrec (cp, hr); /* cp == next line or '\0' at end of buffer */
+ /* fill_hrec dates from when history read the entire
+ history file in one chunk, and then records were pulled out
+ by pointing to the various parts of this big chunk. This is
+ why there are ugly hacks here: I don't want to completely
+ re-write the whole history stuff right now. */
- if (select_hrec (hr))
+ hrline = xstrdup ((char *)cp);
+ fill_hrec (hrline, &hrec_head[hrec_count]);
+ if (select_hrec (&hrec_head[hrec_count]))
hrec_count++;
+ else
+ free(hrline);
+
+ cp = nl + 1;
}
+ free (cpstart);
+ close (fd);
/* Special selection problem: If "since_tag" is set, we have saved every
* record from the 1st occurrence of "since_tag", when we want to save
@@ -1169,11 +1216,10 @@ select_hrec (hr)
if (since_date)
{
char *ourdate = date_from_time_t (hr->date);
-
- if (RCS_datecmp (ourdate, since_date) < 0)
- return (0);
-
+ count = RCS_datecmp (ourdate, since_date);
free (ourdate);
+ if (count < 0)
+ return (0);
}
else if (*since_rev)
{
@@ -1426,9 +1472,9 @@ report_hrecs ()
else
tm = localtime (&(lr->date));
- (void) printf ("%c %02d/%02d %02d:%02d %s %-*s", ty, tm->tm_mon + 1,
- tm->tm_mday, tm->tm_hour, tm->tm_min, tz_name,
- user_len, lr->user);
+ (void) printf ("%c %04d-%02d-%02d %02d:%02d %s %-*s", ty,
+ tm->tm_year+1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour,
+ tm->tm_min, tz_name, user_len, lr->user);
workdir = xmalloc (strlen (lr->dir) + strlen (lr->end) + 10);
(void) sprintf (workdir, "%s%s", lr->dir, lr->end);
diff --git a/contrib/cvs/src/ignore.c b/contrib/cvs/src/ignore.c
index df08017..4ea61ad 100644
--- a/contrib/cvs/src/ignore.c
+++ b/contrib/cvs/src/ignore.c
@@ -333,9 +333,7 @@ ign_dir_add (name)
(dir_ign_max + 1) * sizeof (char *));
}
- dir_ign_list[dir_ign_current] = name;
-
- dir_ign_current += 1 ;
+ dir_ign_list[dir_ign_current++] = xstrdup (name);
}
@@ -414,9 +412,9 @@ ignore_files (ilist, entries, update_dir, proc)
{
file = dp->d_name;
if (strcmp (file, ".") == 0 || strcmp (file, "..") == 0)
- continue;
+ goto continue_loop;
if (findnode_fn (ilist, file) != NULL)
- continue;
+ goto continue_loop;
if (subdirs)
{
Node *node;
@@ -437,14 +435,14 @@ ignore_files (ilist, entries, update_dir, proc)
dir = isdir (p);
free (p);
if (dir)
- continue;
+ goto continue_loop;
}
}
/* We could be ignoring FIFOs and other files which are neither
regular files nor directories here. */
if (ign_name (file))
- continue;
+ goto continue_loop;
if (
#ifdef DT_DIR
@@ -455,9 +453,12 @@ ignore_files (ilist, entries, update_dir, proc)
if (
#ifdef DT_DIR
- dp->d_type == DT_DIR || dp->d_type == DT_UNKNOWN &&
+ dp->d_type == DT_DIR
+ || (dp->d_type == DT_UNKNOWN && S_ISDIR (sb.st_mode))
+#else
+ S_ISDIR (sb.st_mode)
#endif
- S_ISDIR(sb.st_mode))
+ )
{
if (! subdirs)
{
@@ -468,7 +469,7 @@ ignore_files (ilist, entries, update_dir, proc)
if (isdir (temp))
{
free (temp);
- continue;
+ goto continue_loop;
}
free (temp);
}
@@ -476,16 +477,20 @@ ignore_files (ilist, entries, update_dir, proc)
#ifdef S_ISLNK
else if (
#ifdef DT_DIR
- dp->d_type == DT_LNK || dp->d_type == DT_UNKNOWN &&
+ dp->d_type == DT_LNK
+ || (dp->d_type == DT_UNKNOWN && S_ISLNK(sb.st_mode))
+#else
+ S_ISLNK (sb.st_mode)
#endif
- S_ISLNK(sb.st_mode))
+ )
{
- continue;
+ goto continue_loop;
}
#endif
}
(*proc) (file, xdir);
+ continue_loop:
errno = 0;
}
if (errno != 0)
diff --git a/contrib/cvs/src/log.c b/contrib/cvs/src/log.c
index 398d650..2e230e3 100644
--- a/contrib/cvs/src/log.c
+++ b/contrib/cvs/src/log.c
@@ -149,6 +149,47 @@ static const char *const log_usage[] =
NULL
};
+#ifdef CLIENT_SUPPORT
+
+/* Helper function for send_arg_list. */
+static int send_one PROTO ((Node *, void *));
+
+static int
+send_one (node, closure)
+ Node *node;
+ void *closure;
+{
+ char *option = (char *) closure;
+
+ send_to_server ("Argument ", 0);
+ send_to_server (option, 0);
+ if (strcmp (node->key, "@@MYSELF") == 0)
+ /* It is a bare -w option. Note that we must send it as
+ -w rather than messing with getcaller() or something (which on
+ the client will return garbage). */
+ ;
+ else
+ send_to_server (node->key, 0);
+ send_to_server ("\012", 0);
+ return 0;
+}
+
+/* For each element in ARG, send an argument consisting of OPTION
+ concatenated with that element. */
+static void send_arg_list PROTO ((char *, List *));
+
+static void
+send_arg_list (option, arg)
+ char *option;
+ List *arg;
+{
+ if (arg == NULL)
+ return;
+ walklist (arg, send_one, (void *)option);
+}
+
+#endif
+
int
cvslog (argc, argv)
int argc;
@@ -158,12 +199,13 @@ cvslog (argc, argv)
int err = 0;
int local = 0;
struct log_data log_data;
- struct option_revlist *rl, **prl;
+ struct option_revlist **prl;
if (argc == -1)
usage (log_usage);
memset (&log_data, 0, sizeof log_data);
+ prl = &log_data.revlist;
optind = 0;
while ((c = getopt (argc, argv, "+bd:hlNRr::s:tw::")) != -1)
@@ -189,12 +231,8 @@ cvslog (argc, argv)
log_data.nameonly = 1;
break;
case 'r':
- rl = log_parse_revlist (optarg);
- for (prl = &log_data.revlist;
- *prl != NULL;
- prl = &(*prl)->next)
- ;
- *prl = rl;
+ *prl = log_parse_revlist (optarg);
+ prl = &(*prl)->next;
break;
case 's':
log_parse_list (&log_data.statelist, optarg);
@@ -206,7 +244,7 @@ cvslog (argc, argv)
if (optarg != NULL)
log_parse_list (&log_data.authorlist, optarg);
else
- log_parse_list (&log_data.authorlist, getcaller ());
+ log_parse_list (&log_data.authorlist, "@@MYSELF");
break;
case '?':
default:
@@ -220,18 +258,97 @@ cvslog (argc, argv)
#ifdef CLIENT_SUPPORT
if (client_active)
{
- int i;
+ struct datelist *p;
+ struct option_revlist *rp;
+ char datetmp[MAXDATELEN];
/* We're the local client. Fire up the remote server. */
start_server ();
ign_setup ();
- for (i = 1; i < argc && argv[i][0] == '-'; i++)
- send_arg (argv[i]);
+ if (log_data.default_branch)
+ send_arg ("-b");
+
+ while (log_data.datelist != NULL)
+ {
+ p = log_data.datelist;
+ log_data.datelist = p->next;
+ send_to_server ("Argument -d\012", 0);
+ send_to_server ("Argument ", 0);
+ date_to_internet (datetmp, p->start);
+ send_to_server (datetmp, 0);
+ if (p->inclusive)
+ send_to_server ("<=", 0);
+ else
+ send_to_server ("<", 0);
+ date_to_internet (datetmp, p->end);
+ send_to_server (datetmp, 0);
+ send_to_server ("\012", 0);
+ if (p->start)
+ free (p->start);
+ if (p->end)
+ free (p->end);
+ free (p);
+ }
+ while (log_data.singledatelist != NULL)
+ {
+ p = log_data.singledatelist;
+ log_data.singledatelist = p->next;
+ send_to_server ("Argument -d\012", 0);
+ send_to_server ("Argument ", 0);
+ date_to_internet (datetmp, p->end);
+ send_to_server (datetmp, 0);
+ send_to_server ("\012", 0);
+ if (p->end)
+ free (p->end);
+ free (p);
+ }
+
+ if (log_data.header)
+ send_arg ("-h");
+ if (local)
+ send_arg("-l");
+ if (log_data.notags)
+ send_arg("-N");
+ if (log_data.nameonly)
+ send_arg("-R");
+ if (log_data.long_header)
+ send_arg("-t");
+
+ while (log_data.revlist != NULL)
+ {
+ rp = log_data.revlist;
+ log_data.revlist = rp->next;
+ send_to_server ("Argument -r", 0);
+ if (rp->branchhead)
+ {
+ if (rp->first != NULL)
+ send_to_server (rp->first, 0);
+ send_to_server (".", 1);
+ }
+ else
+ {
+ if (rp->first != NULL)
+ send_to_server (rp->first, 0);
+ send_to_server (":", 1);
+ if (rp->last != NULL)
+ send_to_server (rp->last, 0);
+ }
+ send_to_server ("\012", 0);
+ if (rp->first)
+ free (rp->first);
+ if (rp->last)
+ free (rp->last);
+ free (rp);
+ }
+ send_arg_list ("-s", log_data.statelist);
+ dellist (&log_data.statelist);
+ send_arg_list ("-w", log_data.authorlist);
+ dellist (&log_data.authorlist);
- send_files (argc - i, argv + i, local, 0, SEND_NO_CONTENTS);
- send_file_names (argc - i, argv + i, SEND_EXPAND_WILD);
+ send_files (argc - optind, argv + optind, local, 0, SEND_NO_CONTENTS);
+ send_file_names (argc - optind, argv + optind, SEND_EXPAND_WILD);
send_to_server ("log\012", 0);
err = get_responses_and_close ();
@@ -239,11 +356,50 @@ cvslog (argc, argv)
}
#endif
+ /* OK, now that we know we are local/server, we can resolve @@MYSELF
+ into our user name. */
+ if (findnode (log_data.authorlist, "@@MYSELF") != NULL)
+ log_parse_list (&log_data.authorlist, getcaller ());
+
err = start_recursion (log_fileproc, (FILESDONEPROC) NULL, log_dirproc,
(DIRLEAVEPROC) NULL, (void *) &log_data,
argc - optind, argv + optind, local,
W_LOCAL | W_REPOS | W_ATTIC, 0, 1,
(char *) NULL, 1);
+
+ while (log_data.revlist)
+ {
+ struct option_revlist *rl = log_data.revlist->next;
+ if (log_data.revlist->first)
+ free (log_data.revlist->first);
+ if (log_data.revlist->last)
+ free (log_data.revlist->last);
+ free (log_data.revlist);
+ log_data.revlist = rl;
+ }
+ while (log_data.datelist)
+ {
+ struct datelist *nd = log_data.datelist->next;
+ if (log_data.datelist->start)
+ free (log_data.datelist->start);
+ if (log_data.datelist->end)
+ free (log_data.datelist->end);
+ free (log_data.datelist);
+ log_data.datelist = nd;
+ }
+ while (log_data.singledatelist)
+ {
+ struct datelist *nd = log_data.singledatelist->next;
+ if (log_data.singledatelist->start)
+ free (log_data.singledatelist->start);
+ if (log_data.singledatelist->end)
+ free (log_data.singledatelist->end);
+ free (log_data.singledatelist);
+ log_data.singledatelist = nd;
+ }
+ dellist (&log_data.statelist);
+ dellist (&log_data.authorlist);
+
return (err);
}
@@ -255,77 +411,65 @@ static struct option_revlist *
log_parse_revlist (argstring)
const char *argstring;
{
- char *copy;
+ char *orig_copy, *copy;
struct option_revlist *ret, **pr;
/* Unfortunately, rlog accepts -r without an argument to mean that
latest revision on the default branch, so we must support that
for compatibility. */
if (argstring == NULL)
- {
- ret = (struct option_revlist *) xmalloc (sizeof *ret);
- ret->first = NULL;
- ret->last = NULL;
- ret->next = NULL;
- ret->branchhead = 0;
- return ret;
- }
+ argstring = "";
ret = NULL;
pr = &ret;
/* Copy the argument into memory so that we can change it. We
don't want to change the argument because, at least as of this
- writing, we will use it if we send the arguments to the server.
- We never bother to free up our copy. */
- copy = xstrdup (argstring);
+ writing, we will use it if we send the arguments to the server. */
+ orig_copy = copy = xstrdup (argstring);
while (copy != NULL)
{
char *comma;
- char *cp;
- char *first, *last;
struct option_revlist *r;
comma = strchr (copy, ',');
if (comma != NULL)
*comma++ = '\0';
- first = copy;
- cp = strchr (copy, ':');
- if (cp == NULL)
- last = copy;
- else
- {
- *cp++ = '\0';
- last = cp;
- }
-
- if (*first == '\0')
- first = NULL;
- if (*last == '\0')
- last = NULL;
-
r = (struct option_revlist *) xmalloc (sizeof *r);
r->next = NULL;
- r->first = first;
- r->last = last;
- if (first != last
- || first[strlen (first) - 1] != '.')
- {
- r->branchhead = 0;
- }
+ r->first = copy;
+ r->branchhead = 0;
+ r->last = strchr (copy, ':');
+ if (r->last != NULL)
+ *r->last++ = '\0';
else
{
- r->branchhead = 1;
- first[strlen (first) - 1] = '\0';
+ r->last = r->first;
+ if (r->first[0] != '\0' && r->first[strlen (r->first) - 1] == '.')
+ {
+ r->branchhead = 1;
+ r->first[strlen (r->first) - 1] = '\0';
+ }
}
+ if (*r->first == '\0')
+ r->first = NULL;
+ if (*r->last == '\0')
+ r->last = NULL;
+
+ if (r->first != NULL)
+ r->first = xstrdup (r->first);
+ if (r->last != NULL)
+ r->last = xstrdup (r->last);
+
*pr = r;
pr = &r->next;
copy = comma;
}
+ free (orig_copy);
return ret;
}
@@ -342,8 +486,7 @@ log_parse_date (log_data, argstring)
/* Copy the argument into memory so that we can change it. We
don't want to change the argument because, at least as of this
writing, we will use it if we send the arguments to the server. */
- copy = xstrdup (argstring);
- orig_copy = copy;
+ orig_copy = copy = xstrdup (argstring);
while (copy != NULL)
{
struct datelist *nd, **pd;
diff --git a/contrib/cvs/src/modules.c b/contrib/cvs/src/modules.c
index 9907cc8..0381ec9 100644
--- a/contrib/cvs/src/modules.c
+++ b/contrib/cvs/src/modules.c
@@ -120,10 +120,9 @@ do_module (db, mname, m_type, msg, callback_proc, where,
int modargc;
int xmodargc;
char **modargv;
- char **xmodargv;
+ char **xmodargv = NULL;
/* Found entry from modules file, including options and such. */
char *value = NULL;
- char *zvalue = NULL;
char *mwhere = NULL;
char *mfile = NULL;
char *spec_opt = NULL;
@@ -186,25 +185,21 @@ do_module (db, mname, m_type, msg, callback_proc, where,
val.dptr = NULL;
if (val.dptr != NULL)
{
- /* null terminate the value XXX - is this space ours? */
- val.dptr[val.dsize] = '\0';
+ /* copy and null terminate the value */
+ value = xmalloc (val.dsize + 1);
+ memcpy (value, val.dptr, val.dsize);
+ value[val.dsize] = '\0';
/* If the line ends in a comment, strip it off */
- if ((cp = strchr (val.dptr, '#')) != NULL)
- {
- do
- *cp-- = '\0';
- while (isspace ((unsigned char) *cp));
- }
+ if ((cp = strchr (value, '#')) != NULL)
+ *cp = '\0';
else
- {
- /* Always strip trailing spaces */
- cp = strchr (val.dptr, '\0');
- while (cp > val.dptr && isspace ((unsigned char) *--cp))
- *cp = '\0';
- }
+ cp = value + val.dsize;
+
+ /* Always strip trailing spaces */
+ while (cp > value && isspace ((unsigned char) *--cp))
+ *cp = '\0';
- value = val.dptr;
mwhere = xstrdup (mname);
goto found;
}
@@ -297,7 +292,7 @@ do_module (db, mname, m_type, msg, callback_proc, where,
error_exit ();
cwd_saved = 1;
- err += callback_proc (&modargc, modargv, where, mwhere, mfile,
+ err += callback_proc (modargc, modargv, where, mwhere, mfile,
shorten,
local_specified, mname, msg);
@@ -332,17 +327,20 @@ do_module (db, mname, m_type, msg, callback_proc, where,
{
char *cp2;
- /* null terminate the value XXX - is this space ours? */
- val.dptr[val.dsize] = '\0';
+ /* copy and null terminate the value */
+ value = xmalloc (val.dsize + 1);
+ memcpy (value, val.dptr, val.dsize);
+ value[val.dsize] = '\0';
/* If the line ends in a comment, strip it off */
- if ((cp2 = strchr (val.dptr, '#')) != NULL)
- {
- do
- *cp2-- = '\0';
- while (isspace ((unsigned char) *cp2));
- }
- value = val.dptr;
+ if ((cp2 = strchr (value, '#')) != NULL)
+ *cp2 = '\0';
+ else
+ cp2 = value + val.dsize;
+
+ /* Always strip trailing spaces */
+ while (cp2 > value && isspace ((unsigned char) *--cp2))
+ *cp2 = '\0';
/* mwhere gets just the module name */
mwhere = xstrdup (mname);
@@ -375,11 +373,7 @@ do_module (db, mname, m_type, msg, callback_proc, where,
error_exit ();
cwd_saved = 1;
- /* copy value to our own string since if we go recursive we'll be
- really screwed if we do another dbm lookup */
assert (value != NULL);
- zvalue = xstrdup (value);
- value = zvalue;
/* search the value for the special delimiter and save for later */
if ((cp = strchr (value, CVSMODULE_SPEC)) != NULL)
@@ -387,62 +381,9 @@ do_module (db, mname, m_type, msg, callback_proc, where,
*cp = '\0'; /* null out the special char */
spec_opt = cp + 1; /* save the options for later */
- if (cp != value) /* strip whitespace if necessary */
- while (isspace ((unsigned char) *--cp))
- *cp = '\0';
-
- if (cp == value)
- {
- /*
- * we had nothing but special options, so skip arg
- * parsing and regular stuff entirely
- *
- * If there were only special ones though, we must
- * make the appropriate directory and cd to it
- */
- char *dir;
-
- /* XXX - XXX - MAJOR HACK - DO NOT SHIP - this needs to
- be !pipeout, but we don't know that here yet */
- if (!run_module_prog)
- goto out;
-
- dir = where ? where : mname;
- /* XXX - think about making null repositories at each dir here
- instead of just at the bottom */
- make_directories (dir);
- if ( CVS_CHDIR (dir) < 0)
- {
- error (0, errno, "cannot chdir to %s", dir);
- spec_opt = NULL;
- err++;
- goto out;
- }
- if (!isfile (CVSADM))
- {
- char *nullrepos;
-
- nullrepos = emptydir_name ();
-
- Create_Admin (".", dir,
- nullrepos, (char *) NULL, (char *) NULL, 0, 0);
- if (!noexec)
- {
- FILE *fp;
-
- fp = open_file (CVSADM_ENTSTAT, "w+");
- if (fclose (fp) == EOF)
- error (1, errno, "cannot close %s", CVSADM_ENTSTAT);
-#ifdef SERVER_SUPPORT
- if (server_active)
- server_set_entstat (dir, nullrepos);
-#endif
- }
- free (nullrepos);
- }
- out:
- goto do_special;
- }
+ /* strip whitespace if necessary */
+ while (cp > value && isspace ((unsigned char) *--cp))
+ *cp = '\0';
}
/* don't do special options only part of a module was specified */
@@ -460,7 +401,8 @@ do_module (db, mname, m_type, msg, callback_proc, where,
/* Put the value on a line with XXX prepended for getopt to eat */
line = xmalloc (strlen (value) + 10);
- (void) sprintf (line, "%s %s", "XXX", value);
+ strcpy(line, "XXX ");
+ strcpy(line + 4, value);
/* turn the line into an argv[] array */
line2argv (&xmodargc, &xmodargv, line, " \t");
@@ -478,56 +420,56 @@ do_module (db, mname, m_type, msg, callback_proc, where,
alias = 1;
break;
case 'd':
- nonalias_opt = 1;
if (mwhere)
free (mwhere);
mwhere = xstrdup (optarg);
+ nonalias_opt = 1;
break;
case 'i':
- nonalias_opt = 1;
if (checkin_prog)
free (checkin_prog);
checkin_prog = xstrdup (optarg);
+ nonalias_opt = 1;
break;
case 'l':
- nonalias_opt = 1;
local_specified = 1;
+ nonalias_opt = 1;
break;
case 'o':
- nonalias_opt = 1;
if (checkout_prog)
free (checkout_prog);
checkout_prog = xstrdup (optarg);
+ nonalias_opt = 1;
break;
case 'e':
- nonalias_opt = 1;
if (export_prog)
free (export_prog);
export_prog = xstrdup (optarg);
+ nonalias_opt = 1;
break;
case 't':
- nonalias_opt = 1;
if (tag_prog)
free (tag_prog);
tag_prog = xstrdup (optarg);
+ nonalias_opt = 1;
break;
case 'u':
- nonalias_opt = 1;
if (update_prog)
free (update_prog);
update_prog = xstrdup (optarg);
+ nonalias_opt = 1;
break;
case '?':
error (0, 0,
"modules file has invalid option for key %s value %s",
- key.dptr, val.dptr);
+ key.dptr, value);
err++;
goto do_module_return;
}
}
modargc -= optind;
modargv += optind;
- if (modargc == 0)
+ if (modargc == 0 && spec_opt == NULL)
{
error (0, 0, "modules file missing directory for module %s", mname);
++err;
@@ -575,15 +517,66 @@ module `%s' is a request for a file in a module which is not a directory",
}
/* otherwise, process this module */
- err += callback_proc (&modargc, modargv, where, mwhere, mfile, shorten,
- local_specified, mname, msg);
+ if (modargc > 0)
+ {
+ err += callback_proc (modargc, modargv, where, mwhere, mfile, shorten,
+ local_specified, mname, msg);
+ }
+ else
+ {
+ /*
+ * we had nothing but special options, so we must
+ * make the appropriate directory and cd to it
+ */
+ char *dir;
+
+ /* XXX - XXX - MAJOR HACK - DO NOT SHIP - this needs to
+ be !pipeout, but we don't know that here yet */
+ if (!run_module_prog)
+ goto do_special;
- free_names (&xmodargc, xmodargv);
+ dir = where ? where : (mwhere ? mwhere : mname);
+ /* XXX - think about making null repositories at each dir here
+ instead of just at the bottom */
+ make_directories (dir);
+ if ( CVS_CHDIR (dir) < 0)
+ {
+ error (0, errno, "cannot chdir to %s", dir);
+ spec_opt = NULL;
+ err++;
+ goto do_special;
+ }
+ if (!isfile (CVSADM))
+ {
+ char *nullrepos;
+
+ nullrepos = emptydir_name ();
+
+ Create_Admin (".", dir,
+ nullrepos, (char *) NULL, (char *) NULL, 0, 0, 1);
+ if (!noexec)
+ {
+ FILE *fp;
+
+ fp = open_file (CVSADM_ENTSTAT, "w+");
+ if (fclose (fp) == EOF)
+ error (1, errno, "cannot close %s", CVSADM_ENTSTAT);
+#ifdef SERVER_SUPPORT
+ if (server_active)
+ server_set_entstat (dir, nullrepos);
+#endif
+ }
+ free (nullrepos);
+ }
+ }
/* if there were special include args, process them now */
do_special:
+ free_names (&xmodargc, xmodargv);
+ xmodargv = NULL;
+
/* blow off special options if -l was specified */
if (local_specified)
spec_opt = NULL;
@@ -635,7 +628,7 @@ module `%s' is a request for a file in a module which is not a directory",
/* strip whitespace off the end */
do
*cp = '\0';
- while (isspace ((unsigned char) *--cp));
+ while (cp > spec_opt && isspace ((unsigned char) *--cp));
}
else
next_opt = NULL;
@@ -745,6 +738,7 @@ module `%s' is a request for a file in a module which is not a directory",
cvs_output (": Executing '", 0);
run_print (stdout);
cvs_output ("'\n", 0);
+ cvs_flushout ();
}
err += run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL);
free (expanded_path);
@@ -755,6 +749,8 @@ module `%s' is a request for a file in a module which is not a directory",
do_module_return:
/* clean up */
+ if (xmodargv != NULL)
+ free_names (&xmodargc, xmodargv);
if (mwhere)
free (mwhere);
if (checkin_prog)
@@ -769,8 +765,8 @@ module `%s' is a request for a file in a module which is not a directory",
free (update_prog);
if (cwd_saved)
free_cwd (&cwd);
- if (zvalue != NULL)
- free (zvalue);
+ if (value != NULL)
+ free (value);
if (xvalue != NULL)
free (xvalue);
diff --git a/contrib/cvs/src/myndbm.c b/contrib/cvs/src/myndbm.c
index f674ac1..7795f66 100644
--- a/contrib/cvs/src/myndbm.c
+++ b/contrib/cvs/src/myndbm.c
@@ -211,7 +211,8 @@ mydbm_load_file (fp, list)
value = xmalloc (value_allocated);
cont = 0;
- while ((line_length = getstr (&line, &line_size, fp, '\012', 0)) >= 0)
+ while ((line_length =
+ getstr (&line, &line_size, fp, '\012', 0, GETLINE_NO_LIMIT)) >= 0)
{
if (line_length > 0 && line[line_length - 1] == '\012')
{
diff --git a/contrib/cvs/src/parseinfo.c b/contrib/cvs/src/parseinfo.c
index 1c1ab70..0bf6d3c 100644
--- a/contrib/cvs/src/parseinfo.c
+++ b/contrib/cvs/src/parseinfo.c
@@ -10,6 +10,8 @@
#include "getline.h"
#include <assert.h>
+extern char *logHistory;
+
/*
* Parse the INFOFILE file for the specified REPOSITORY. Invoke CALLPROC for
* the first line in the file that matches the REPOSITORY, or if ALL != 0, any lines
@@ -32,7 +34,7 @@ Parse_Info (infofile, repository, callproc, all)
char *default_value = NULL;
char *expanded_value= NULL;
int callback_done, line_number;
- char *cp, *exp, *value, *srepos;
+ char *cp, *exp, *value, *srepos, bad;
const char *regex_err;
if (CVSroot_original == NULL)
@@ -110,10 +112,6 @@ Parse_Info (infofile, repository, callproc, all)
if (expanded_value != NULL)
free (expanded_value);
expanded_value = expand_path (value, infofile, line_number);
- if (!expanded_value)
- {
- continue;
- }
/*
* At this point, exp points to the regular expression, and value
@@ -127,9 +125,10 @@ Parse_Info (infofile, repository, callproc, all)
{
/* Is it OK to silently ignore all but the last DEFAULT
expression? */
- if (default_value != NULL)
+ if (default_value != NULL && default_value != &bad)
free (default_value);
- default_value = xstrdup (expanded_value);
+ default_value = (expanded_value != NULL ?
+ xstrdup (expanded_value) : &bad);
continue;
}
@@ -140,11 +139,13 @@ Parse_Info (infofile, repository, callproc, all)
*/
if (strcmp (exp, "ALL") == 0)
{
- if (all)
- err += callproc (repository, expanded_value);
- else
+ if (!all)
error(0, 0, "Keyword `ALL' is ignored at line %d in %s file",
line_number, infofile);
+ else if (expanded_value != NULL)
+ err += callproc (repository, expanded_value);
+ else
+ err++;
continue;
}
@@ -163,7 +164,10 @@ Parse_Info (infofile, repository, callproc, all)
continue; /* no match */
/* it did, so do the callback and note that we did one */
- err += callproc (repository, expanded_value);
+ if (expanded_value != NULL)
+ err += callproc (repository, expanded_value);
+ else
+ err++;
callback_done = 1;
}
if (ferror (fp_info))
@@ -173,10 +177,15 @@ Parse_Info (infofile, repository, callproc, all)
/* if we fell through and didn't callback at all, do the default */
if (callback_done == 0 && default_value != NULL)
- err += callproc (repository, default_value);
+ {
+ if (default_value != &bad)
+ err += callproc (repository, default_value);
+ else
+ err++;
+ }
/* free up space if necessary */
- if (default_value != NULL)
+ if (default_value != NULL && default_value != &bad)
free (default_value);
if (expanded_value != NULL)
free (expanded_value);
@@ -367,6 +376,14 @@ warning: this CVS does not support PreservePermissions");
opendir it or something, but I don't see any particular
reason to do that now rather than waiting until lock.c. */
}
+ else if (strcmp (line, "LogHistory") == 0)
+ {
+ if (strcmp (p, "all") != 0)
+ {
+ logHistory=malloc(strlen (p) + 1);
+ strcpy (logHistory, p);
+ }
+ }
else
{
/* We may be dealing with a keyword which was added in a
diff --git a/contrib/cvs/src/patch.c b/contrib/cvs/src/patch.c
index f16a331..9aa26f3 100644
--- a/contrib/cvs/src/patch.c
+++ b/contrib/cvs/src/patch.c
@@ -20,7 +20,7 @@ static Dtype patch_dirproc PROTO ((void *callerdat, char *dir,
char *repos, char *update_dir,
List *entries));
static int patch_fileproc PROTO ((void *callerdat, struct file_info *finfo));
-static int patch_proc PROTO((int *pargc, char **argv, char *xwhere,
+static int patch_proc PROTO((int argc, char **argv, char *xwhere,
char *mwhere, char *mfile, int shorten,
int local_specified, char *mname, char *msg));
@@ -230,6 +230,9 @@ patch (argc, argv)
#endif
/* clean up if we get a signal */
+#ifdef SIGABRT
+ (void) SIG_register (SIGABRT, patch_cleanup);
+#endif
#ifdef SIGHUP
(void) SIG_register (SIGHUP, patch_cleanup);
#endif
@@ -261,9 +264,9 @@ patch (argc, argv)
*/
/* ARGSUSED */
static int
-patch_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified,
+patch_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified,
mname, msg)
- int *pargc;
+ int argc;
char **argv;
char *xwhere;
char *mwhere;
@@ -273,6 +276,7 @@ patch_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified,
char *mname;
char *msg;
{
+ char *myargv[2];
int err = 0;
int which;
char *repository;
@@ -314,13 +318,10 @@ patch_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified,
}
else
{
- int i;
-
- /* a file means muck argv */
- for (i = 1; i < *pargc; i++)
- free (argv[i]);
- argv[1] = xstrdup (mfile);
- (*pargc) = 2;
+ myargv[0] = argv[0];
+ myargv[1] = mfile;
+ argc = 2;
+ argv = myargv;
}
free (path);
}
@@ -341,19 +342,19 @@ patch_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified,
if (rev1 != NULL && !rev1_validated)
{
- tag_check_valid (rev1, *pargc - 1, argv + 1, local, 0, NULL);
+ tag_check_valid (rev1, argc - 1, argv + 1, local, 0, NULL);
rev1_validated = 1;
}
if (rev2 != NULL && !rev2_validated)
{
- tag_check_valid (rev2, *pargc - 1, argv + 1, local, 0, NULL);
+ tag_check_valid (rev2, argc - 1, argv + 1, local, 0, NULL);
rev2_validated = 1;
}
/* start the recursion processor */
err = start_recursion (patch_fileproc, (FILESDONEPROC) NULL, patch_dirproc,
(DIRLEAVEPROC) NULL, NULL,
- *pargc - 1, argv + 1, local,
+ argc - 1, argv + 1, local,
which, 0, 1, where, 1);
free (where);
@@ -735,6 +736,10 @@ failed to read diff file header %s for %s: end of file", tmpfile3, rcs);
tmpfile1 = tmpfile2 = tmpfile3 = NULL;
out2:
+ if (vers_tag != NULL)
+ free (vers_tag);
+ if (vers_head != NULL)
+ free (vers_head);
if (rcs != NULL)
free (rcs);
return (ret);
diff --git a/contrib/cvs/src/release.c b/contrib/cvs/src/release.c
index ca7945b..06d582f 100644
--- a/contrib/cvs/src/release.c
+++ b/contrib/cvs/src/release.c
@@ -190,7 +190,7 @@ release (argc, argv)
{
if (strchr ("MARCZ", *line))
c++;
- (void) printf (line);
+ (void) fputs (line, stdout);
}
if (line_length < 0 && !feof (fp))
error (0, errno, "cannot read from subprocess");
diff --git a/contrib/cvs/src/remove.c b/contrib/cvs/src/remove.c
index 2dacdf1..f0055d9 100644
--- a/contrib/cvs/src/remove.c
+++ b/contrib/cvs/src/remove.c
@@ -103,6 +103,7 @@ cvsremove (argc, argv)
/* FIXME: Can't we set SEND_NO_CONTENTS here? Needs investigation. */
send_files (argc, argv, local, 0, 0);
send_file_names (argc, argv, 0);
+ free_names (&argc, argv);
send_to_server ("remove\012", 0);
return get_responses_and_close ();
}
diff --git a/contrib/cvs/src/repos.c b/contrib/cvs/src/repos.c
index 2738665..bc2b4be 100644
--- a/contrib/cvs/src/repos.c
+++ b/contrib/cvs/src/repos.c
@@ -106,12 +106,6 @@ Name_Repository (dir, update_dir)
* one by tacking on the CVSROOT environment variable. If the CVSROOT
* environment variable is not set, die now.
*/
- if (strcmp (repos, "..") == 0 || strncmp (repos, "../", 3) == 0)
- {
- error (0, 0, "in directory %s:", xupdate_dir);
- error (0, 0, "`..'-relative repositories are not supported.");
- error (1, 0, "illegal source repository");
- }
if (! isabsolute(repos))
{
char *newrepos;
@@ -123,6 +117,12 @@ Name_Repository (dir, update_dir)
error (0, 0, "or specify the '-d' option to %s.", program_name);
error (1, 0, "illegal repository setting");
}
+ if (pathname_levels (repos) > 0)
+ {
+ error (0, 0, "in directory %s:", xupdate_dir);
+ error (0, 0, "`..'-relative repositories are not supported.");
+ error (1, 0, "illegal source repository");
+ }
newrepos = xmalloc (strlen (CVSroot_directory) + strlen (repos) + 10);
(void) sprintf (newrepos, "%s/%s", CVSroot_directory, repos);
free (repos);
diff --git a/contrib/cvs/src/root.c b/contrib/cvs/src/root.c
index d88c6f4..81859c8 100644
--- a/contrib/cvs/src/root.c
+++ b/contrib/cvs/src/root.c
@@ -174,9 +174,9 @@ Create_Root (dir, rootdir)
directories. Then we can check against them when a remote user
hands us a CVSROOT directory. */
-static unsigned int root_allow_count;
+static int root_allow_count;
static char **root_allow_vector;
-static unsigned int root_allow_size;
+static int root_allow_size;
void
root_allow_add (arg)
@@ -233,8 +233,7 @@ void
root_allow_free ()
{
if (root_allow_vector != NULL)
- free (root_allow_vector);
- root_allow_count = 0;
+ free_names (&root_allow_count, root_allow_vector);
root_allow_size = 0;
}
@@ -242,7 +241,7 @@ int
root_allow_ok (arg)
char *arg;
{
- unsigned int i;
+ int i;
if (root_allow_count == 0)
{
@@ -295,7 +294,7 @@ parse_cvsroot (CVSroot)
char *CVSroot;
{
static int cvsroot_parsed = 0;
- char *cvsroot_copy, *p;
+ char *cvsroot_copy, *cvsroot_save, *p;
int check_hostname;
/* Don't go through the trouble twice. */
@@ -305,10 +304,19 @@ parse_cvsroot (CVSroot)
return 0;
}
+ if (CVSroot_original != NULL)
+ free (CVSroot_original);
+ if (CVSroot_directory != NULL)
+ free (CVSroot_directory);
+ if (CVSroot_username != NULL)
+ free (CVSroot_username);
+ if (CVSroot_hostname != NULL)
+ free (CVSroot_hostname);
+
CVSroot_original = xstrdup (CVSroot);
- cvsroot_copy = xstrdup (CVSroot);
+ cvsroot_save = cvsroot_copy = xstrdup (CVSroot);
- if ((*cvsroot_copy == ':'))
+ if (*cvsroot_copy == ':')
{
char *method = ++cvsroot_copy;
@@ -324,6 +332,7 @@ parse_cvsroot (CVSroot)
if (! (p = strchr (method, ':')))
{
error (0, 0, "bad CVSroot: %s", CVSroot);
+ free (cvsroot_save);
return 1;
}
*p = '\0';
@@ -348,6 +357,7 @@ parse_cvsroot (CVSroot)
else
{
error (0, 0, "unknown method in CVSroot: %s", CVSroot);
+ free (cvsroot_save);
return 1;
}
}
@@ -378,19 +388,19 @@ parse_cvsroot (CVSroot)
{
/* Check to see if there is a username in the string. */
- if ((p = strchr (cvsroot_copy, '@')))
+ if ((p = strchr (cvsroot_copy, '@')) != NULL)
{
- CVSroot_username = cvsroot_copy;
*p = '\0';
+ CVSroot_username = xstrdup (cvsroot_copy);
cvsroot_copy = ++p;
if (*CVSroot_username == '\0')
CVSroot_username = NULL;
}
- if ((p = strchr (cvsroot_copy, ':')))
+ if ((p = strchr (cvsroot_copy, ':')) != NULL)
{
- CVSroot_hostname = cvsroot_copy;
*p = '\0';
+ CVSroot_hostname = xstrdup (cvsroot_copy);
cvsroot_copy = ++p;
if (*CVSroot_hostname == '\0')
@@ -398,7 +408,8 @@ parse_cvsroot (CVSroot)
}
}
- CVSroot_directory = cvsroot_copy;
+ CVSroot_directory = xstrdup(cvsroot_copy);
+ free (cvsroot_save);
#if ! defined (CLIENT_SUPPORT) && ! defined (DEBUG)
if (CVSroot_method != local_method)
@@ -422,12 +433,10 @@ parse_cvsroot (CVSroot)
switch (CVSroot_method)
{
case local_method:
- case fork_method:
if (CVSroot_username || CVSroot_hostname)
{
error (0, 0, "can't specify hostname and username in CVSROOT");
- error (0, 0, "when using %s access method",
- CVSroot_method == local_method ? "local" : "fork");
+ error (0, 0, "when using local access method");
error (0, 0, "(%s)", CVSroot);
return 1;
}
@@ -440,6 +449,18 @@ parse_cvsroot (CVSroot)
error (1, 0, "CVSROOT %s must be an absolute pathname",
CVSroot_directory);
break;
+ case fork_method:
+ /* We want :fork: to behave the same as other remote access
+ methods. Therefore, don't check to see that the repository
+ name is absolute -- let the server do it. */
+ if (CVSroot_username || CVSroot_hostname)
+ {
+ error (0, 0, "can't specify hostname and username in CVSROOT");
+ error (0, 0, "when using fork access method");
+ error (0, 0, "(%s)", CVSroot);
+ return 1;
+ }
+ break;
case kserver_method:
#ifndef HAVE_KERBEROS
error (0, 0, "Your CVSROOT is set for a kerberos access method");
@@ -488,18 +509,24 @@ parse_cvsroot (CVSroot)
/* Set up the global CVSroot* variables as if we're using the local
- repository DIR. DIR must point to storage which will last for the
- rest of the CVS invocation (for example, the caller might malloc it
- and never free it, or free it just before exiting CVS). */
+ repository DIR. */
void
set_local_cvsroot (dir)
char *dir;
{
- CVSroot_original = dir;
+ if (CVSroot_original != NULL)
+ free (CVSroot_original);
+ CVSroot_original = xstrdup(dir);
CVSroot_method = local_method;
- CVSroot_directory = CVSroot_original;
+ if (CVSroot_directory != NULL)
+ free (CVSroot_directory);
+ CVSroot_directory = xstrdup(dir);
+ if (CVSroot_username != NULL)
+ free (CVSroot_username);
CVSroot_username = NULL;
+ if (CVSroot_hostname != NULL)
+ free (CVSroot_hostname);
CVSroot_hostname = NULL;
client_active = 0;
}
diff --git a/contrib/cvs/src/rtag.c b/contrib/cvs/src/rtag.c
index 5fd825f..bc14d88 100644
--- a/contrib/cvs/src/rtag.c
+++ b/contrib/cvs/src/rtag.c
@@ -29,7 +29,7 @@ static int rtag_fileproc PROTO ((void *callerdat, struct file_info *finfo));
static int rtag_filesdoneproc PROTO ((void *callerdat, int err,
char *repos, char *update_dir,
List *entries));
-static int rtag_proc PROTO((int *pargc, char **argv, char *xwhere,
+static int rtag_proc PROTO((int argc, char **argv, char *xwhere,
char *mwhere, char *mfile, int shorten,
int local_specified, char *mname, char *msg));
static int rtag_delete PROTO((RCSNode *rcsfile));
@@ -222,9 +222,9 @@ rtag (argc, argv)
*/
/* ARGSUSED */
static int
-rtag_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified,
+rtag_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified,
mname, msg)
- int *pargc;
+ int argc;
char **argv;
char *xwhere;
char *mwhere;
@@ -236,6 +236,7 @@ rtag_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified,
{
/* Begin section which is identical to patch_proc--should this
be abstracted out somehow? */
+ char *myargv[2];
int err = 0;
int which;
char *repository;
@@ -277,13 +278,10 @@ rtag_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified,
}
else
{
- int i;
-
- /* a file means muck argv */
- for (i = 1; i < *pargc; i++)
- free (argv[i]);
- argv[1] = xstrdup (mfile);
- (*pargc) = 2;
+ myargv[0] = argv[0];
+ myargv[1] = mfile;
+ argc = 2;
+ argv = myargv;
}
free (path);
}
@@ -305,7 +303,7 @@ rtag_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified,
if (numtag != NULL && !numtag_validated)
{
- tag_check_valid (numtag, *pargc - 1, argv + 1, local, 0, NULL);
+ tag_check_valid (numtag, argc - 1, argv + 1, local, 0, NULL);
numtag_validated = 1;
}
@@ -315,7 +313,7 @@ rtag_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified,
mtlist = getlist();
err = start_recursion (check_fileproc, check_filesdoneproc,
(DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL,
- *pargc - 1, argv + 1, local, which, 0, 1,
+ argc - 1, argv + 1, local, which, 0, 1,
where, 1);
if (err)
@@ -326,7 +324,7 @@ rtag_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified,
/* start the recursion processor */
err = start_recursion (rtag_fileproc, rtag_filesdoneproc, rtag_dirproc,
(DIRLEAVEPROC) NULL, NULL,
- *pargc - 1, argv + 1, local,
+ argc - 1, argv + 1, local,
which, 0, 0, where, 1);
free (where);
dellist(&mtlist);
diff --git a/contrib/cvs/src/run.c b/contrib/cvs/src/run.c
index 41f4457..d382cef 100644
--- a/contrib/cvs/src/run.c
+++ b/contrib/cvs/src/run.c
@@ -207,6 +207,18 @@ run_exec (stin, stout, sterr, flags)
(void) close (sherr);
}
+#ifdef SETXID_SUPPORT
+ /*
+ ** This prevents a user from creating a privileged shell
+ ** from the text editor when the SETXID_SUPPORT option is selected.
+ */
+ if (!strcmp (run_argv[0], Editor) && setegid (getgid ()))
+ {
+ error (0, errno, "cannot set egid to gid");
+ _exit (127);
+ }
+#endif
+
/* dup'ing is done. try to run it now */
(void) execvp (run_argv[0], run_argv);
error (0, errno, "cannot exec %s", run_argv[0]);
diff --git a/contrib/cvs/src/sanity.sh b/contrib/cvs/src/sanity.sh
index 6130289..84e67cc 100755
--- a/contrib/cvs/src/sanity.sh
+++ b/contrib/cvs/src/sanity.sh
@@ -25,21 +25,6 @@
# See TODO list at end of file.
-# You can't run CVS as root; print a nice error message here instead
-# of somewhere later, after making a mess.
-# Commented out because:
-# (1) whoami is not portable. If memory serves the POSIX way is "id -un".
-# ("logname" or "who am i" are similar but different--they have more to
-# do with who logged in on your tty than your uid).
-# (2) This definition of "root" doesn't quite match CVS's (which is based
-# on uid 0, not username "root").
-#case "`whoami`" in
-# "root" )
-# echo "sanity.sh: test suite does not work correctly when run as root" >&2
-# exit 1
-# ;;
-#esac
-
# required to make this script work properly.
unset CVSREAD
@@ -68,7 +53,8 @@ export LC_ALL
# So this would be lost if everything was `pwd`-based. I suppose
# if we wanted to get baroque we could start making symlinks
# to ensure the two are different.
-TESTDIR=${TESTDIR:-/tmp/cvs-sanity}
+tmp=`(cd /tmp; /bin/pwd || pwd) 2>/dev/null`
+: ${TESTDIR=$tmp/cvs-sanity}
# "debugger"
#set -x
@@ -121,6 +107,7 @@ PROG=`basename ${testcvs}`
# 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]*"
# Regexp to match the name of a temporary file (from cvs_temp_name).
# This appears in certain diff output.
@@ -154,34 +141,87 @@ if test -f check.log; then
mv check.log check.plog
fi
-GEXPRLOCS="`echo $PATH | sed 's/:/ /g'` /usr/local/bin /usr/contrib/bin /usr/gnu/bin /local/bin /local/gnu/bin /gun/bin"
+# clean any old remnants (we need the chmod because some tests make
+# directories read-only)
+if test -d ${TESTDIR}; then
+ chmod -R a+wx ${TESTDIR}
+ rm -rf ${TESTDIR}
+fi
+mkdir ${TESTDIR}
+cd ${TESTDIR}
-EXPR=expr
+# Make sure various tools work the way we expect, or try to find
+# versions that do.
+: ${AWK=awk}
+: ${EXPR=expr}
+: ${ID=id}
+: ${TR=tr}
-# Cause NextStep 3.3 users to lose in a more graceful fashion.
-if $EXPR 'abc
-def' : 'abc
-def' >/dev/null; then
- : good, it works
-else
- for path in $GEXPRLOCS ; do
- if test -x $path/gexpr ; then
- if test "X`$path/gexpr --version`" != "X--version" ; then
- EXPR=$path/gexpr
+find_tool ()
+{
+ GLOCS="`echo $PATH | sed 's/:/ /g'` /usr/local/bin /usr/contrib/bin /usr/gnu/bin /local/bin /local/gnu/bin /gun/bin"
+ TOOL=""
+ for path in $GLOCS ; do
+ if test -x $path/g$1 ; then
+ if test "X`$path/g$1 --version`" != "X--version" ; then
+ TOOL=$path/g$1
break
fi
fi
- if test -x $path/expr ; then
- if test "X`$path/expr --version`" != "X--version" ; then
- EXPR=$path/expr
+ if test -x $path/$1 ; then
+ if test "X`$path/$1 --version`" != "X--version" ; then
+ TOOL=$path/$1
break
fi
fi
done
+ if test -z "$TOOL"; then
+ :
+ else
+ echo "Notice: The default version of $1 is defective, using" >&2
+ echo "$TOOL instead." >&2
+ fi
+ echo "$TOOL"
+}
+
+# You can't run CVS as root; print a nice error message here instead
+# of somewhere later, after making a mess.
+case "`$ID -u`" in
+ "0")
+ echo "Test suite does not work correctly when run as root" >&2
+ exit 1
+ ;;
+
+ "")
+ ID=`find_tool id`
+ if 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
+ ;;
+esac
+username=`$ID -un`
+if $EXPR "${username}" : "${username}" >/dev/null; then
+ : good, it works
+else
+ echo "Test suite does not work correctly when run by a username" >&2
+ echo "containing regular expression meta-characters." >&2
+ exit 1
+fi
+
+# Cause NextStep 3.3 users to lose in a more graceful fashion.
+if $EXPR 'abc
+def' : 'abc
+def' >/dev/null; then
+ : good, it works
+else
+ EXPR=`find_tool expr`
if test -z "$EXPR" ; then
- 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.'
+ 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
fi
@@ -191,20 +231,7 @@ fi
if $EXPR 'a
b' : 'a
c' >/dev/null; then
- for path in $GEXPRLOCS ; do
- if test -x $path/gexpr ; then
- if test "X`$path/gexpr --version`" != "X--version" ; then
- EXPR=$path/gexpr
- break
- fi
- fi
- if test -x $path/expr ; then
- if test "X`$path/expr --version`" != "X--version" ; then
- EXPR=$path/expr
- break
- fi
- fi
- done
+ EXPR=`find_tool expr`
if test -z "$EXPR" ; then
echo 'Warning: you are using a version of expr which does not correctly'
echo 'match multi-line patterns. Some tests may spuriously pass.'
@@ -215,6 +242,35 @@ else
: good, it works
fi
+# More SunOS lossage...
+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
+ : good, it works
+else
+ EXPR=`find_tool expr`
+ if test -z "$EXPR" ; then
+ echo 'Warning: you are using a version of expr which does not correctly'
+ echo 'match large patterns. Some tests may spuriously fail.'
+ echo 'You may wish to make sure GNU expr is in your path.'
+ EXPR=expr
+ fi
+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 which does not correctly'
+ echo 'match large patterns. Some tests may spuriously pass.'
+ echo 'You may wish to make sure GNU expr is in your path.'
+ EXPR=expr
+ fi
+else
+ : good, it works
+fi
+rm -f ${TESTDIR}/foo ${TESTDIR}/bar
+
# 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
# (e.g. SunOS 4.1.3 expr) one. Rumor has it this will be fixed in the
@@ -265,6 +321,19 @@ else
QUESTION='\?'
fi
+# now make sure that tr works on NULs
+if $EXPR `echo "123" | ${TR} '2' '\0'` : "123" >/dev/null; 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
+else
+ : good, it works
+fi
+
pass ()
{
echo "PASS: $1" >>${LOGFILE}
@@ -359,15 +428,15 @@ dotest_all_in_one ()
dotest_line_by_line ()
{
line=1
- while [ $line -le `wc -l ${TESTDIR}/dotest.tmp` ] ; do
- echo "$line matched \c" >>$LOGFILE
+ while [ $line -le `wc -l <${TESTDIR}/dotest.tmp` ] ; do
if $EXPR "`sed -n ${line}p ${TESTDIR}/dotest.tmp`" : \
"`sed -n ${line}p ${TESTDIR}/dotest.exp`" >/dev/null; then
:
else
- echo "**** expected line: " >>${LOGFILE}
+ echo "Line $line:" >> ${LOGFILE}
+ echo "**** expected: " >>${LOGFILE}
sed -n ${line}p ${TESTDIR}/dotest.exp >>${LOGFILE}
- echo "**** got line: " >>${LOGFILE}
+ echo "**** got: " >>${LOGFILE}
sed -n ${line}p ${TESTDIR}/dotest.tmp >>${LOGFILE}
unset line
return 1
@@ -443,7 +512,7 @@ dotest_internal_debug ()
dotest ()
{
rm -f ${TESTDIR}/dotest.ex? 2>&1
- if $2 >${TESTDIR}/dotest.tmp 2>&1; then
+ if eval "$2" >${TESTDIR}/dotest.tmp 2>&1; then
: so far so good
else
status=$?
@@ -458,7 +527,7 @@ dotest ()
dotest_lit ()
{
rm -f ${TESTDIR}/dotest.ex? 2>&1
- if $2 >${TESTDIR}/dotest.tmp 2>&1; then
+ if eval "$2" >${TESTDIR}/dotest.tmp 2>&1; then
: so far so good
else
status=$?
@@ -482,7 +551,7 @@ dotest_lit ()
dotest_fail ()
{
rm -f ${TESTDIR}/dotest.ex? 2>&1
- if $2 >${TESTDIR}/dotest.tmp 2>&1; then
+ if eval "$2" >${TESTDIR}/dotest.tmp 2>&1; then
status=$?
cat ${TESTDIR}/dotest.tmp >>${LOGFILE}
echo "exit status was $status" >>${LOGFILE}
@@ -497,7 +566,7 @@ dotest_fail ()
# Like dotest except second argument is the required exitstatus.
dotest_status ()
{
- $3 >${TESTDIR}/dotest.tmp 2>&1
+ eval "$3" >${TESTDIR}/dotest.tmp 2>&1
status=$?
if test "$status" = "$2"; then
: so far so good
@@ -513,7 +582,7 @@ dotest_status ()
dotest_sort ()
{
rm -f ${TESTDIR}/dotest.ex? 2>&1
- if $2 >${TESTDIR}/dotest.tmp1 2>&1; then
+ if eval "$2" >${TESTDIR}/dotest.tmp1 2>&1; then
: so far so good
else
status=$?
@@ -521,18 +590,10 @@ dotest_sort ()
echo "exit status was $status" >>${LOGFILE}
fail "$1"
fi
- sort < ${TESTDIR}/dotest.tmp1 > ${TESTDIR}/dotest.tmp
+ ${TR} ' ' ' ' < ${TESTDIR}/dotest.tmp1 | sort > ${TESTDIR}/dotest.tmp
dotest_internal "$@"
}
-# clean any old remnants (we need the chmod because some tests make
-# directories read-only)
-if test -d ${TESTDIR}; then
- chmod -R a+wx ${TESTDIR}
- rm -rf ${TESTDIR}
-fi
-mkdir ${TESTDIR}
-cd ${TESTDIR}
# This will show up in cvs history output where it prints the working
# directory. It should *not* appear in any cvs output referring to the
# repository; cvs should use the name of the repository as specified.
@@ -573,10 +634,11 @@ if test x"$*" = x; then
tests="${tests} branches branches2 tagc tagf"
tests="${tests} rcslib multibranch import importb importc"
tests="${tests} import-after-initial"
- tests="${tests} join join2 join3 join-readonly-conflict"
+ tests="${tests} join join2 join3 join-readonly-conflict join-admin"
tests="${tests} new newb conflicts conflicts2 conflicts3"
+ tests="${tests} clean"
# Checking out various places (modules, checkout -d, &c)
- tests="${tests} modules modules2 modules3 modules4"
+ tests="${tests} modules modules2 modules3 modules4 modules5"
tests="${tests} mkmodules-temp-file-removal"
tests="${tests} cvsadm emptydir abspath toplevel toplevel2"
# Log messages, error messages.
@@ -587,7 +649,7 @@ if test x"$*" = x; then
tests="${tests} ignore binfiles binfiles2 binfiles3"
tests="${tests} mcopy binwrap binwrap2"
tests="${tests} binwrap3 mwrap info taginfo config"
- tests="${tests} serverpatch log log2 ann ann-id"
+ 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"
@@ -595,7 +657,7 @@ if test x"$*" = x; then
tests="${tests} history"
tests="${tests} big modes modes2 modes3 stamps"
# PreservePermissions stuff: permissions, symlinks et al.
- tests="${tests} perms symlinks symlinks2 hardlinks"
+ # tests="${tests} perms symlinks symlinks2 hardlinks"
# More tag and branch tests, keywords.
tests="${tests} sticky keyword keyword2 keywordlog"
tests="${tests} head tagdate multibranch2 tag8k"
@@ -667,6 +729,7 @@ if test "x$remote" = xyes; then
fi
dotest 1 "${testcvs} init" ''
+dotest 1a "${testcvs} init" ''
### The big loop
for what in $tests; do
@@ -805,6 +868,21 @@ done"
${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
new revision: 3\.1; previous revision: 2\.0
done"
+
+ # Test using -r to create a branch
+ dotest_fail basica-8a3 "${testcvs} -q ci -m bogus -r 3.0.0" \
+"Checking in ssfile;
+${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+${PROG} [a-z]*: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v: can't find branch point 3\.0
+${PROG} [a-z]*: could not check in ssfile"
+ dotest basica-8a4 "${testcvs} -q ci -m valid -r 3.1.2" \
+"Checking in ssfile;
+${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+new revision: 3\.1\.2\.1; previous revision: 3\.1
+done"
+ # now get rid of the sticky tag and go back to the trunk
+ dotest basica-8a5 "${testcvs} -q up -A" "[UP] ssfile"
+
cd ../..
dotest basica-8b "${testcvs} -q diff -r1.2 -r1.3" \
"Index: sdir/ssdir/ssfile
@@ -814,6 +892,15 @@ retrieving revision 1\.2
retrieving revision 1\.3
diff -r1\.2 -r1\.3"
+ dotest_fail basica-8b1 "${testcvs} -q diff -r1.2 -r1.3 -C 3isacrowd" \
+"Index: sdir/ssdir/ssfile
+===================================================================
+RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+retrieving revision 1\.2
+retrieving revision 1\.3
+diff -C3isacrowd -r1\.2 -r1\.3
+${PROG} [a-z]*: invalid context length argument"
+
# The .* here will normally be "No such file or directory",
# but if memory serves some systems (AIX?) have a different message.
: dotest_fail basica-9 \
@@ -864,6 +951,10 @@ done"
deleting revision 2\.0
deleting revision 1\.3
done"
+ dotest basica-o6a "${testcvs} admin -o 3.1.2: ssfile" \
+"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
+deleting revision 3\.1\.2\.1
+done"
dotest basica-o7 "${testcvs} log -N ssfile" "
RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
Working file: ssfile
@@ -1193,7 +1284,7 @@ ${PROG} [a-z]*: Updating second-dir"
# For CVS to make a syntactic check for "." wouldn't suffice.
# 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
+ if test ! -d ../first-dir; then
cd ..
mkdir ./first-dir
cd ./first-dir
@@ -2067,44 +2158,50 @@ ${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/dir1/dir2"
# which don't exist in the remote output? would seem to be
# a CVS bug.
dotest basic2-64 "${testcvs} his -x TOFWUCGMAR -a" \
-"O [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= ${TMPPWD}/\*
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == ${TMPPWD}
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == ${TMPPWD}
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == ${TMPPWD}
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == ${TMPPWD}
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == ${TMPPWD}
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == ${TMPPWD}
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == ${TMPPWD}
-M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TMPPWD}
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == ${TMPPWD}
-M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == ${TMPPWD}
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == ${TMPPWD}
-M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == ${TMPPWD}
-F [0-9/]* [0-9:]* ${PLUS}0000 ${username} =first-dir= ${TMPPWD}/\*
-T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
-T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
-T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
-O [0-9/]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= ${TMPPWD}/\*
-U [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TMPPWD}/first-dir
-U [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TMPPWD}/first-dir" \
-"O [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= <remote>/\*
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == <remote>
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == <remote>
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == <remote>
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == <remote>
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == <remote>
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == <remote>
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == <remote>
-M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == <remote>
-M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == <remote>
-A [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == <remote>
-M [0-9/]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == <remote>
-F [0-9/]* [0-9:]* ${PLUS}0000 ${username} =first-dir= <remote>/\*
-T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
-T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
-T [0-9/]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
-O [0-9/]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= <remote>/\*"
+"O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= ${TMPPWD}/\*
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == ${TMPPWD}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == ${TMPPWD}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == ${TMPPWD}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == ${TMPPWD}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == ${TMPPWD}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == ${TMPPWD}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == ${TMPPWD}
+M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TMPPWD}
+R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TMPPWD}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == ${TMPPWD}
+M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == ${TMPPWD}
+R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == ${TMPPWD}
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == ${TMPPWD}
+M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == ${TMPPWD}
+R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == ${TMPPWD}
+F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= ${TMPPWD}/\*
+T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
+T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
+T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
+O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= ${TMPPWD}/\*
+U [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == ${TMPPWD}/first-dir
+U [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == ${TMPPWD}/first-dir" \
+"O [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir =first-dir= <remote>/\*
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir == <remote>
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir == <remote>
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1 == <remote>
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1 == <remote>
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file6 first-dir/dir1/dir2 == <remote>
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file7 first-dir/dir1/dir2 == <remote>
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir == <remote>
+M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir == <remote>
+R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir == <remote>
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1 == <remote>
+M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1 == <remote>
+R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1 == <remote>
+A [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.1 file14 first-dir/dir1/dir2 == <remote>
+M [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file6 first-dir/dir1/dir2 == <remote>
+R [0-9-]* [0-9:]* ${PLUS}0000 ${username} 1\.2 file7 first-dir/dir1/dir2 == <remote>
+F [0-9-]* [0-9:]* ${PLUS}0000 ${username} =first-dir= <remote>/\*
+T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-head:A\]
+T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-tag:rtagged-by-head\]
+T [0-9-]* [0-9:]* ${PLUS}0000 ${username} first-dir \[rtagged-by-revision:1\.1\]
+O [0-9-]* [0-9:]* ${PLUS}0000 ${username} \[1\.1\] first-dir =first-dir= <remote>/\*"
rm -rf ${CVSROOT_DIRNAME}/first-dir
rm -rf ${CVSROOT_DIRNAME}/second-dir
@@ -2246,10 +2343,9 @@ done"
spacefiles)
# More filename tests, in particular spaces in file names.
- # If we start using eval in dotest, this test should become
- # easier to write (in fact, it may be possible to just
- # change a few of the names in basica or some other test,
- # always good to keep the testsuite concise).
+ # (it might be better to just change a few of the names in
+ # basica or some other test instead, always good to keep the
+ # testsuite concise).
# I wrote this test to worry about problems in do_module;
# but then I found that the CVS server has its own problems
@@ -2283,24 +2379,16 @@ ${TESTDIR}/cvsroot/top,v <-- top
initial revision: 1\.1
done"
mkdir 'first dir'
- if ${testcvs} add 'first dir' >${TESTDIR}/output.tmp 2>&1; then
- dotest spacefiles-4 "cat ${TESTDIR}/output.tmp" \
+ dotest spacefiles-4 "${testcvs} add 'first dir'" \
"Directory ${TESTDIR}/cvsroot/first dir added to the repository"
- else
- fail spacefiles-4
- fi
mkdir ./${dashb}
dotest spacefiles-5 "${testcvs} add -- ${dashb}" \
"Directory ${TESTDIR}/cvsroot/${dashb} added to the repository"
cd 'first dir'
touch 'a file'
- if ${testcvs} add 'a file' >${TESTDIR}/output.tmp 2>&1; then
- dotest spacefiles-6 "cat ${TESTDIR}/output.tmp" \
+ dotest spacefiles-6 "${testcvs} add 'a file'" \
"${PROG} [a-z]*: scheduling file .a file. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
- else
- fail spacefiles-6
- fi
dotest spacefiles-7 "${testcvs} -q ci -m add" \
"RCS file: ${TESTDIR}/cvsroot/first dir/a file,v
done
@@ -2322,22 +2410,13 @@ done"
dotest spacefiles-11 "${testcvs} -q co -- ${dashc}" "U \./${dashc}"
rm ./${dashc}
dotest spacefiles-12 "${testcvs} -q co -- /${dashc}" "U \./${dashc}"
- if ${testcvs} -q co 'first dir' >${TESTDIR}/output.tmp 2>&1; then
- dotest spacefiles-13 "cat ${TESTDIR}/output.tmp" \
+ dotest spacefiles-13 "${testcvs} -q co 'first dir'" \
"U first dir/a file"
- else
- fail spacefiles-13
- fi
cd ..
mkdir 3; cd 3
- if ${testcvs} -q co 'first dir/a file' >${TESTDIR}/output.tmp 2>&1
- then
- dotest spacefiles-14 "cat ${TESTDIR}/output.tmp" \
+ dotest spacefiles-14 "${testcvs} -q co 'first dir/a file'" \
"U first dir/a file"
- else
- fail spacefiles-14
- fi
cd ..
rm -r 1 2 3
@@ -3573,15 +3652,9 @@ ${PROG} [a-z]*: skipping directory dir1/sdir"
# If we say "yes", then CVS gives errors about not being able to
# create lock files.
- if echo no | ${testcvs} release -d dir1/sdir \
- >${TESTDIR}/output.tmp 2>&1; then
- pass dirs-4
- else
- fail dirs-4
- fi
# The fact that it says "skipping directory " rather than
# "skipping directory dir1/sdir" is some kind of bug.
- dotest dirs-4a "cat ${TESTDIR}/output.tmp" \
+ echo no | dotest dirs-4 "${testcvs} release -d dir1/sdir" \
"${PROG} [a-z]*: cannot open directory ${TESTDIR}/cvsroot/dir1/sdir: No such file or directory
${PROG} [a-z]*: skipping directory
You have \[0\] altered files in this repository\.
@@ -3603,7 +3676,6 @@ D/sdir////"
cd ..
rm -r imp-dir 1
- rm ${TESTDIR}/output.tmp
# clean up our repositories
rm -rf ${CVSROOT_DIRNAME}/dir1
@@ -3952,7 +4024,7 @@ Merging differences between 1\.1\.2\.1 and 1\.1\.2\.1\.2\.1 into file1
rcsmerge: warning: conflicts during merge"
dotest branches-16 "cat file1" '<<<<<<< file1
1:ancest
-=======
+[=]======
1:brbr
[>]>>>>>> 1\.1\.2\.1\.2\.1'
@@ -4514,7 +4586,7 @@ 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: ${TESTDIR}/cvsroot/first-dir/rgx\.c,v
@@ -4904,7 +4976,7 @@ done"
"
- ${PROG} checkout -jvendor-branch:yesterday -jvendor-branch first-dir
+ ${PROG} checkout -jvendor-branch:yesterday -jvendor-branch first-dir
2 conflicts created by this import.
C first-dir/imported-f1
C first-dir/imported-f2
@@ -4950,7 +5022,7 @@ Use the following command to help the merge:"
dotest import-113 \
"${testcvs} -q co -jjunk-1_0 -jjunk-2_0 first-dir" \
-"${PROG} [a-z]*: file first-dir/imported-f1 is present in revision junk-2_0
+"${PROG} [a-z]*: file first-dir/imported-f1 does not exist, but is present in revision junk-2_0
RCS file: ${TESTDIR}/cvsroot/first-dir/imported-f2,v
retrieving revision 1\.1\.1\.1
retrieving revision 1\.1\.1\.2
@@ -5014,7 +5086,7 @@ No conflicts created by this import"
"
- ${PROG} -d ${CVSROOT} checkout -jfreemunger:yesterday -jfreemunger first-dir
+ ${PROG} -d ${CVSROOT} checkout -jfreemunger:yesterday -jfreemunger first-dir
2 conflicts created by this import.
C first-dir/file1
C first-dir/file2
@@ -5147,14 +5219,14 @@ ${PROG} [a-z]*: Updating bdir/subdir"
"${PROG} [a-z]*: in directory adir/sub1/ssdir:
${PROG} \[[a-z]* aborted\]: there is no version here; do .${PROG} checkout. first"
# The workaround is to leave off the "-r wip_test".
- dotest importc-8 "${testcvs} -q ci -m modify" \
+ dotest importc-7a "${testcvs} -q ci -m modify" \
"Checking in cdir/cfile;
${TESTDIR}/cvsroot/first-dir/cdir/cfile,v <-- cfile
new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
done"
else
# Remote doesn't have the bug in the first place.
- dotest importc-7 "${testcvs} -q ci -m modify -r wip_test" \
+ dotest importc-7r "${testcvs} -q ci -m modify -r wip_test" \
"Checking in cdir/cfile;
${TESTDIR}/cvsroot/first-dir/cdir/cfile,v <-- cfile
new revision: 1\.1\.1\.1\.2\.1; previous revision: 1\.1\.1\.1
@@ -5688,6 +5760,63 @@ M file2
R file3
A file8"
+ # Checkout the mainline again to try merging from the trunk
+ # to a branch.
+ cd ..
+ rm -r first-dir
+ dotest join-30 "${testcvs} -q co first-dir" \
+'U first-dir/file2
+U first-dir/file3
+U first-dir/file4
+U first-dir/file7'
+ cd first-dir
+
+ # Tag the current revisions on the trunk.
+ dotest join-31 "${testcvs} -q tag T3 ." \
+'T file2
+T file3
+T file4
+T file7'
+
+ # Modify file7.
+ echo 'second revision of file7' > file7
+ dotest join-32 "${testcvs} -q ci -mx ." \
+"Checking in file7;
+${TESTDIR}/cvsroot/first-dir/file7,v <-- file7
+new revision: 1\.2; previous revision: 1\.1
+done"
+
+ # And Tag again.
+ dotest join-33 "${testcvs} -q tag T4 ." \
+'T file2
+T file3
+T file4
+T file7'
+
+ # Now update branch to T3.
+ cd ../../2/first-dir
+ dotest join-34 "${testcvs} -q up -jT3" \
+"${PROG} [a-z]*: file file4 does not exist, but is present in revision T3
+U file7"
+
+ # Verify that the right changes have been scheduled.
+ dotest join-35 "${testcvs} -q update" \
+'A file7'
+
+ # Now update to T4.
+ # This is probably a bug, although in this particular case it just
+ # happens to do the right thing; see above join-20.
+ dotest join-36 "${testcvs} -q up -j T3 -j T4" \
+"A file7
+RCS file: ${TESTDIR}/cvsroot/first-dir/file7,v
+retrieving revision 1\.1
+retrieving revision 1\.2
+Merging differences between 1\.1 and 1\.2 into file7"
+
+ # Verify that the right changes have been scheduled.
+ dotest join-37 "${testcvs} -q update" \
+'A file7'
+
cd ../..
rm -r 1 2 3
@@ -5975,6 +6104,49 @@ C m"
rm -rf ${CVSROOT_DIRNAME}/$module
;;
+ join-admin)
+ mkdir 1; cd 1
+ dotest join-admin-1 "$testcvs -q co -l ." ''
+ module=x
+ mkdir $module
+ $testcvs -q add $module >>$LOGFILE 2>&1
+ cd $module
+
+ # Create a file so applying the first tag works.
+ echo foo > a
+ $testcvs -Q add a > /dev/null 2>&1
+ $testcvs -Q ci -m. a > /dev/null 2>&1
+
+ $testcvs -Q tag -b B
+ $testcvs -Q tag -b M1
+ echo '$''Id$' > b
+ $testcvs -Q add b > /dev/null 2>&1
+ $testcvs -Q ci -m. b > /dev/null 2>&1
+ $testcvs -Q tag -b M2
+
+ $testcvs -Q update -r B
+ $testcvs -Q update -kk -jM1 -jM2
+ $testcvs -Q ci -m. b >/dev/null 2>&1
+
+ $testcvs -Q update -A
+
+ # Verify that the -kk flag from the update did not
+ # propagate to the repository.
+ dotest join-admin-1 "$testcvs status b" \
+"===================================================================
+File: b Status: Up-to-date
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/x/b,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+
+ cd ../..
+ rm -rf 1
+ rm -rf ${CVSROOT_DIRNAME}/$module
+ ;;
+
new) # look for stray "no longer pertinent" messages.
mkdir ${CVSROOT_DIRNAME}/first-dir
@@ -6262,9 +6434,24 @@ File: a Status: File had conflicts on merge
"${PROG} [a-z]*: file .a. had a conflict and has not been modified
${PROG} \[[a-z]* aborted\]: correct above errors first!"
- echo lame attempt at resolving it >>a
# Try to check in the file with the conflict markers in it.
- dotest conflicts-status-2 "${testcvs} status a" \
+ # Make sure we detect any one of the three conflict markers
+ mv a aa
+ grep '^<<<<<<<' aa >a
+ dotest conflicts-status-2 "${testcvs} -nq ci -m try a" \
+"${PROG} [a-z]*: warning: file .a. seems to still contain conflict indicators"
+
+ grep '^=======' aa >a
+ dotest conflicts-status-3 "${testcvs} -nq ci -m try a" \
+"${PROG} [a-z]*: warning: file .a. seems to still contain conflict indicators"
+
+ grep '^>>>>>>>' aa >a
+ dotest conflicts-status-4 "${testcvs} -qn ci -m try a" \
+"${PROG} [a-z]*: warning: file .a. seems to still contain conflict indicators"
+
+ mv aa a
+ echo lame attempt at resolving it >>a
+ dotest conflicts-status-5 "${testcvs} status a" \
"===================================================================
File: a Status: File had conflicts on merge
@@ -6283,7 +6470,7 @@ done"
# OK, the user saw the warning (good user), and now
# resolves it for real.
echo resolve conflict >a
- dotest conflicts-status-3 "${testcvs} status a" \
+ dotest conflicts-status-6 "${testcvs} status a" \
"===================================================================
File: a Status: Locally Modified
@@ -6297,7 +6484,7 @@ File: a Status: Locally Modified
${TESTDIR}/cvsroot/first-dir/a,v <-- a
new revision: 1\.4; previous revision: 1\.3
done"
- dotest conflicts-status-4 "${testcvs} status a" \
+ dotest conflicts-status-7 "${testcvs} status a" \
"===================================================================
File: a Status: Up-to-date
@@ -6790,6 +6977,62 @@ ${PROG} update: cannot open CVS/Entries for reading: No such file or directory"
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
+ clean)
+ # Test update -C (overwrite local mods w/ repository copies)
+ mkdir 1; cd 1
+ dotest clean-1 "${testcvs} -q co -l ." ''
+ mkdir first-dir
+ dotest clean-2 "${testcvs} add first-dir" \
+"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+ cd first-dir
+ echo "The usual boring test text." > cleanme.txt
+ dotest clean-3 "${testcvs} add cleanme.txt" \
+"${PROG} [a-z]*: scheduling file .cleanme\.txt. for addition
+${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
+ dotest clean-4 "${testcvs} -q ci -m clean-3" \
+"RCS file: ${TESTDIR}/cvsroot/first-dir/cleanme\.txt,v
+done
+Checking in cleanme\.txt;
+${TESTDIR}/cvsroot/first-dir/cleanme\.txt,v <-- cleanme\.txt
+initial revision: 1\.1
+done"
+ # Okay, preparation is done, now test.
+ # Check that updating an unmodified copy works.
+ dotest clean-5 "${testcvs} -q update" ''
+ # Check that updating -C an unmodified copy works.
+ dotest clean-6 "${testcvs} -q update -C" ''
+ # Check that updating a modified copy works.
+ echo "fish" >> cleanme.txt
+ dotest clean-7 "${testcvs} -q update" 'M cleanme\.txt'
+ # Check that updating -C a modified copy works.
+ dotest clean-8 "${testcvs} -q update -C" \
+"(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
+U cleanme\.txt"
+ # And check that the backup copy really was made.
+ dotest clean-9 "cat .#cleanme.txt.1.1" \
+"The usual boring test text\.
+fish"
+
+ # Do it all again, this time naming the file explicitly.
+ rm .#cleanme.txt.1.1
+ dotest clean-10 "${testcvs} -q update cleanme.txt" ''
+ dotest clean-11 "${testcvs} -q update -C cleanme.txt" ''
+ echo "bluegill" >> cleanme.txt
+ dotest clean-12 "${testcvs} -q update cleanme.txt" 'M cleanme\.txt'
+ dotest clean-13 "${testcvs} -q update -C cleanme.txt" \
+"(Locally modified cleanme\.txt moved to \.#cleanme\.txt\.1\.1)
+U cleanme\.txt"
+ # And check that the backup copy really was made.
+ dotest clean-14 "cat .#cleanme.txt.1.1" \
+"The usual boring test text\.
+bluegill"
+
+ # Done. Clean up.
+ cd ../..
+ rm -rf 1
+ rm -rf ${TESTDIR}/cvsroot/first-dir
+ ;;
+
modules)
# Tests of various ways to define and use modules.
# Roadmap to various modules tests:
@@ -6802,6 +7045,7 @@ ${PROG} update: cannot open CVS/Entries for reading: No such file or directory"
# ampersand modules: modules2
# -s: modules.
# -d: modules, modules3, cvsadm
+ # -i, -o, -u, -e, -t: modules5
# slashes in module names: modules3
############################################################
@@ -6893,76 +7137,88 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
mkdir 1
cd 1
- if ${testcvs} -q co first-dir; then
- pass 143
- else
- fail 143
- fi
+ dotest modules-143 "${testcvs} -q co first-dir" ""
cd first-dir
mkdir subdir
- ${testcvs} add subdir >>${LOGFILE}
- cd subdir
+ dotest modules-143a "${testcvs} add subdir" \
+"Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository"
+ cd subdir
mkdir ssdir
- ${testcvs} add ssdir >>${LOGFILE}
+ dotest modules-143b "${testcvs} add ssdir" \
+"Directory ${TESTDIR}/cvsroot/first-dir/subdir/ssdir added to the repository"
touch a b
- if ${testcvs} add a b 2>>${LOGFILE} ; then
- pass 144
- else
- fail 144
- fi
+ dotest modules-144 "${testcvs} add a b" \
+"${PROG} [a-z]*: scheduling file .a. for addition
+${PROG} [a-z]*: scheduling file .b. for addition
+${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
- if ${testcvs} ci -m added >>${LOGFILE} 2>&1; then
- pass 145
- else
- fail 145
- fi
+ dotest modules-145 "${testcvs} ci -m added" \
+"${PROG} [a-z]*: Examining .
+${PROG} [a-z]*: Examining ssdir
+RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/a,v
+done
+Checking in a;
+${TESTDIR}/cvsroot/first-dir/subdir/a,v <-- a
+initial revision: 1\.1
+done
+RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/b,v
+done
+Checking in b;
+${TESTDIR}/cvsroot/first-dir/subdir/b,v <-- b
+initial revision: 1\.1
+done"
cd ..
- if ${testcvs} -q co CVSROOT >>${LOGFILE}; then
- pass 146
- else
- fail 146
- fi
+ dotest modules-146 "${testcvs} -q co CVSROOT" \
+"U CVSROOT/checkoutlist
+U CVSROOT/commitinfo
+U CVSROOT/config
+U CVSROOT/cvswrappers
+U CVSROOT/editinfo
+U CVSROOT/loginfo
+U CVSROOT/modules
+U CVSROOT/notify
+U CVSROOT/rcsinfo
+U CVSROOT/taginfo
+U CVSROOT/verifymsg"
# Here we test that CVS can deal with CVSROOT (whose repository
# is at top level) in the same directory as subdir (whose repository
# is a subdirectory of first-dir). TODO: Might want to check that
# files can actually get updated in this state.
- if ${testcvs} -q update; then
- pass 147
- else
- fail 147
- fi
+ dotest modules-147 "${testcvs} -q update" ""
+
+ cat >CVSROOT/modules <<EOF
+realmodule first-dir/subdir a
+dirmodule first-dir/subdir
+namedmodule -d nameddir first-dir/subdir
+aliasmodule -a first-dir/subdir/a
+aliasnested -a first-dir/subdir/ssdir
+topfiles -a first-dir/file1 first-dir/file2
+world -a .
+statusmod -s Mungeable
+# Options must come before arguments. It is possible this should
+# be relaxed at some point (though the result would be bizarre for
+# -a); for now test the current behavior.
+bogusalias first-dir/subdir/a -a
+EOF
+ dotest modules-148 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
+"Checking in CVSROOT/modules;
+${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
+done
+${PROG} [a-z]*: Rebuilding administrative file database"
- echo realmodule first-dir/subdir a >CVSROOT/modules
- echo dirmodule first-dir/subdir >>CVSROOT/modules
- echo namedmodule -d nameddir first-dir/subdir >>CVSROOT/modules
- echo aliasmodule -a first-dir/subdir/a >>CVSROOT/modules
- echo aliasnested -a first-dir/subdir/ssdir >>CVSROOT/modules
- echo topfiles -a first-dir/file1 first-dir/file2 >>CVSROOT/modules
- echo world -a . >>CVSROOT/modules
- echo statusmod -s Mungeable >>CVSROOT/modules
-
- # Options must come before arguments. It is possible this should
- # be relaxed at some point (though the result would be bizarre for
- # -a); for now test the current behavior.
- echo bogusalias first-dir/subdir/a -a >>CVSROOT/modules
- if ${testcvs} ci -m 'add modules' CVSROOT/modules \
- >>${LOGFILE} 2>&1; then
- pass 148
- else
- fail 148
- fi
cd ..
# The "statusmod" module contains an error; trying to use it
# will produce "modules file missing directory" I think.
# However, that shouldn't affect the ability of "cvs co -c" or
# "cvs co -s" to do something reasonable with it.
- dotest 148a0 "${testcvs} co -c" 'aliasmodule -a first-dir/subdir/a
+ dotest modules-148a0 "${testcvs} co -c" 'aliasmodule -a first-dir/subdir/a
aliasnested -a first-dir/subdir/ssdir
bogusalias first-dir/subdir/a -a
dirmodule first-dir/subdir
@@ -6974,7 +7230,7 @@ world -a \.'
# There is code in modules.c:save_d which explicitly skips
# modules defined with -a, which is why aliasmodule is not
# listed.
- dotest 148a1 "${testcvs} co -s" \
+ dotest modules-148a1 "${testcvs} co -s" \
'statusmod Mungeable
bogusalias NONE first-dir/subdir/a -a
dirmodule NONE first-dir/subdir
@@ -6982,123 +7238,60 @@ namedmodule NONE first-dir/subdir
realmodule NONE first-dir/subdir a'
# Test that real modules check out to realmodule/a, not subdir/a.
- if ${testcvs} co realmodule >>${LOGFILE}; then
- pass 149a1
- else
- fail 149a1
- fi
- if test -d realmodule && test -f realmodule/a; then
- pass 149a2
- else
- fail 149a2
- fi
- if test -f realmodule/b; then
- fail 149a3
- else
- pass 149a3
- fi
- if ${testcvs} -q co realmodule; then
- pass 149a4
- else
- fail 149a4
- fi
- if echo "yes" | ${testcvs} release -d realmodule >>${LOGFILE} ; then
- pass 149a5
- else
- fail 149a5
- fi
-
- dotest_fail 149b1 "${testcvs} co realmodule/a" \
+ dotest modules-149a1 "${testcvs} co realmodule" "U realmodule/a"
+ dotest modules-149a2 "test -d realmodule && test -f realmodule/a" ""
+ dotest_fail modules-149a3 "test -f realmodule/b" ""
+ dotest modules-149a4 "${testcvs} -q co realmodule" ""
+ dotest modules-149a5 "echo yes | ${testcvs} release -d realmodule" \
+"You have \[0\] altered files in this repository\.
+Are you sure you want to release (and delete) directory .realmodule.: "
+
+ dotest_fail modules-149b1 "${testcvs} co realmodule/a" \
"${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
"${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory
'"${PROG}"' \[[a-z]* aborted\]: cannot expand modules'
# Now test the ability to check out a single file from a directory
- if ${testcvs} co dirmodule/a >>${LOGFILE}; then
- pass 150c
- else
- fail 150c
- fi
- if test -d dirmodule && test -f dirmodule/a; then
- pass 150d
- else
- fail 150d
- fi
- if test -f dirmodule/b; then
- fail 150e
- else
- pass 150e
- fi
- if echo "yes" | ${testcvs} release -d dirmodule >>${LOGFILE} ; then
- pass 150f
- else
- fail 150f
- fi
+ dotest modules-150c "${testcvs} co dirmodule/a" "U dirmodule/a"
+ dotest modules-150d "test -d dirmodule && test -f dirmodule/a" ""
+ dotest_fail modules-150e "test -f dirmodule/b" ""
+ dotest modules-150f "echo yes | ${testcvs} release -d dirmodule" \
+"You have \[0\] altered files in this repository\.
+Are you sure you want to release (and delete) directory .dirmodule.: "
# Now test the ability to correctly reject a non-existent filename.
# For maximum studliness we would check that an error message is
# being output.
- if ${testcvs} co dirmodule/nonexist >>${LOGFILE} 2>&1; then
- # We accept a zero exit status because it is what CVS does
- # (Dec 95). Probably the exit status should be nonzero,
- # however.
- pass 150g1
- else
- pass 150g1
- fi
+ # We accept a zero exit status because it is what CVS does
+ # (Dec 95). Probably the exit status should be nonzero,
+ # however.
+ dotest modules-150g1 "${testcvs} co dirmodule/nonexist" \
+"${PROG} [a-z]*: warning: new-born dirmodule/nonexist has disappeared"
# We tolerate the creation of the dirmodule directory, since that
# is what CVS does, not because we view that as preferable to not
# creating it.
- if test -f dirmodule/a || test -f dirmodule/b; then
- fail 150g2
- else
- pass 150g2
- fi
+ dotest_fail modules-150g2 "test -f dirmodule/a || test -f dirmodule/b" ""
rm -r dirmodule
# Now test that a module using -d checks out to the specified
# directory.
- dotest 150h1 "${testcvs} -q co namedmodule" 'U nameddir/a
+ dotest modules-150h1 "${testcvs} -q co namedmodule" \
+'U nameddir/a
U nameddir/b'
- if test -f nameddir/a && test -f nameddir/b; then
- pass 150h2
- else
- fail 150h2
- fi
+ dotest modules-150h2 "test -f nameddir/a && test -f nameddir/b" ""
echo add line >>nameddir/a
- dotest 150h3 "${testcvs} -q co namedmodule" 'M nameddir/a'
+ dotest modules-150h3 "${testcvs} -q co namedmodule" 'M nameddir/a'
rm nameddir/a
- dotest 150h4 "${testcvs} -q co namedmodule" 'U nameddir/a'
- if echo "yes" | ${testcvs} release -d nameddir >>${LOGFILE} ; then
- pass 150h99
- else
- fail 150h99
- fi
+ dotest modules-150h4 "${testcvs} -q co namedmodule" 'U nameddir/a'
+ dotest modules-150h99 "echo yes | ${testcvs} release -d nameddir" \
+"You have \[0\] altered files in this repository\.
+Are you sure you want to release (and delete) directory .nameddir.: "
# Now test that alias modules check out to subdir/a, not
# aliasmodule/a.
- if ${testcvs} co aliasmodule >>${LOGFILE}; then
- pass 151
- else
- fail 151
- fi
- if test -d aliasmodule; then
- fail 152
- else
- pass 152
- fi
+ dotest modules-151 "${testcvs} co aliasmodule" ""
+ dotest_fail modules-152 "test -d aliasmodule" ""
echo abc >>first-dir/subdir/a
- if (${testcvs} -q co aliasmodule | tee test153.tmp) \
- >>${LOGFILE}; then
- pass 153
- else
- fail 153
- fi
- echo 'M first-dir/subdir/a' >ans153.tmp
- if cmp test153.tmp ans153.tmp; then
- pass 154
- else
- fail 154
- fi
+ dotest modules-153 "${testcvs} -q co aliasmodule" "M first-dir/subdir/a"
cd ..
rm -r 1
@@ -7218,6 +7411,8 @@ done"
cd CVSROOT
echo 'ampermodule &first-dir &second-dir' > modules
echo 'combmodule third-dir file3 &first-dir' >> modules
+ echo 'ampdirmod -d newdir &first-dir &second-dir' >> modules
+ echo 'badmod -d newdir' >> modules
# Depending on whether the user also ran the modules test
# we will be checking in revision 1.2 or 1.3.
dotest modules2-2 "${testcvs} -q ci -m add-modules" \
@@ -7294,11 +7489,11 @@ initial revision: 1\.1
done"
cd ..
fi
+ cd ..
+ rm -r 1
# Now test the "combmodule" module (combining regular modules
# and ampersand modules in the same module definition).
- cd ..
- rm -r 1
mkdir 1; cd 1
dotest modules2-14 "${testcvs} co combmodule" \
"U combmodule/file3
@@ -7325,6 +7520,22 @@ U first-dir/amper1"
cd ..
rm -r 1
+ # Now test the "ampdirmod" and "badmod" modules to be sure that
+ # options work with ampersand modules but don't prevent the
+ # "missing directory" error message.
+ mkdir 1; cd 1
+ dotest modules2-20 "${testcvs} co ampdirmod" \
+"${PROG} [a-z]*: Updating first-dir
+U first-dir/amper1
+${PROG} [a-z]*: Updating second-dir"
+ dotest modules2-21 "test -f newdir/first-dir/amper1" ""
+ dotest_fail modules2-22 "${testcvs} co badmod" \
+"${PROG} [a-z]*: modules file missing directory for module badmod" \
+"${PROG} [a-z]*: modules file missing directory for module badmod
+${PROG} \[[a-z]* aborted\]: cannot expand modules"
+ cd ..
+ rm -r 1
+
# Test that CVS gives an error if one combines -a with
# other options.
# Probably would be better to break this out into a separate
@@ -7646,6 +7857,226 @@ add-it
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
+ modules5)
+ # Test module programs
+
+ mkdir ${CVSROOT_DIRNAME}/first-dir
+ mkdir 1
+ cd 1
+ dotest modules5-1 "${testcvs} -q co first-dir" ""
+ cd first-dir
+ mkdir subdir
+ dotest modules5-2 "${testcvs} add subdir" \
+"Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository"
+ cd subdir
+ mkdir ssdir
+ dotest modules5-3 "${testcvs} add ssdir" \
+"Directory ${TESTDIR}/cvsroot/first-dir/subdir/ssdir added to the repository"
+ touch a b
+ dotest modules5-4 "${testcvs} add a b" \
+"${PROG} [a-z]*: scheduling file .a. for addition
+${PROG} [a-z]*: scheduling file .b. for addition
+${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
+
+ dotest modules5-5 "${testcvs} ci -m added" \
+"${PROG} [a-z]*: Examining .
+${PROG} [a-z]*: Examining ssdir
+RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/a,v
+done
+Checking in a;
+${TESTDIR}/cvsroot/first-dir/subdir/a,v <-- a
+initial revision: 1\.1
+done
+RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/b,v
+done
+Checking in b;
+${TESTDIR}/cvsroot/first-dir/subdir/b,v <-- b
+initial revision: 1\.1
+done"
+
+ cd ..
+ dotest modules5-6 "${testcvs} -q co CVSROOT" \
+"U CVSROOT/checkoutlist
+U CVSROOT/commitinfo
+U CVSROOT/config
+U CVSROOT/cvswrappers
+U CVSROOT/editinfo
+U CVSROOT/loginfo
+U CVSROOT/modules
+U CVSROOT/notify
+U CVSROOT/rcsinfo
+U CVSROOT/taginfo
+U CVSROOT/verifymsg"
+
+ for i in checkin checkout update export tag; do
+ cat >> ${CVSROOT_DIRNAME}/$i.sh <<EOF
+#! /bin/sh
+echo "$i script invoked in \`pwd\`"
+echo "args: \$@"
+EOF
+ chmod +x ${CVSROOT_DIRNAME}/$i.sh
+ done
+
+ OPTS="-i ${CVSROOT_DIRNAME}/checkin.sh -o${CVSROOT_DIRNAME}/checkout.sh -u ${CVSROOT_DIRNAME}/update.sh -e ${CVSROOT_DIRNAME}/export.sh -t${CVSROOT_DIRNAME}/tag.sh"
+ cat >CVSROOT/modules <<EOF
+realmodule ${OPTS} first-dir/subdir a
+dirmodule ${OPTS} first-dir/subdir
+namedmodule -d nameddir ${OPTS} first-dir/subdir
+EOF
+
+ dotest modules5-7 "${testcvs} ci -m 'add modules' CVSROOT/modules" \
+"" \
+"Checking in CVSROOT/modules;
+${TESTDIR}/cvsroot/CVSROOT/modules,v <-- modules
+new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
+done
+${PROG} [a-z]*: Rebuilding administrative file database"
+
+ cd ..
+ rm -rf first-dir
+ # Test that real modules check out to realmodule/a, not subdir/a.
+ if test "$remote" = "yes"; then
+ dotest modules5-8 "${testcvs} co realmodule" \
+"U realmodule/a
+${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
+checkout script invoked in .*
+args: realmodule"
+ else
+ dotest modules5-8 "${testcvs} co realmodule" \
+"U realmodule/a
+${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .realmodule..
+checkout script invoked in ${TESTDIR}/1
+args: realmodule"
+ fi
+ dotest modules5-9 "test -d realmodule && test -f realmodule/a" ""
+ dotest_fail modules5-10 "test -f realmodule/b" ""
+ if test "$remote" = "yes"; then
+ dotest modules5-11 "${testcvs} -q co realmodule" \
+"checkout script invoked in .*
+args: realmodule"
+ dotest modules5-12 "${testcvs} -q update" \
+"${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir..
+update script invoked in /.*/realmodule
+args: ${CVSROOT_DIRNAME}/first-dir/subdir"
+ echo "change" >>realmodule/a
+ dotest modules5-13 "${testcvs} -q ci -m." \
+"Checking in realmodule/a;
+${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
+new revision: 1\.2; previous revision: 1\.1
+done
+${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkin\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir..
+checkin script invoked in /.*/realmodule
+args: ${CVSROOT_DIRNAME}/first-dir/subdir"
+ else
+ dotest modules5-11 "${testcvs} -q co realmodule" \
+"checkout script invoked in ${TESTDIR}/1
+args: realmodule"
+ dotest modules5-12 "${testcvs} -q update" \
+"${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir..
+update script invoked in ${TESTDIR}/1/realmodule
+args: ${CVSROOT_DIRNAME}/first-dir/subdir"
+ echo "change" >>realmodule/a
+ dotest modules5-13 "${testcvs} -q ci -m." \
+"Checking in realmodule/a;
+${CVSROOT_DIRNAME}/first-dir/subdir/a,v <-- a
+new revision: 1\.2; previous revision: 1\.1
+done
+${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkin\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir..
+checkin script invoked in ${TESTDIR}/1/realmodule
+args: ${CVSROOT_DIRNAME}/first-dir/subdir"
+ fi
+ dotest modules5-14 "echo yes | ${testcvs} release -d realmodule" \
+"You have \[0\] altered files in this repository\.
+Are you sure you want to release (and delete) directory .realmodule.: "
+ dotest modules5-15 "${testcvs} -q rtag -Dnow MYTAG realmodule" \
+"tag script invoked in ${TESTDIR}/1
+args: realmodule MYTAG"
+ if test "$remote" = "yes"; then
+ dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
+"U realmodule/a
+export script invoked in .*
+args: realmodule"
+ else
+ dotest modules5-16 "${testcvs} -q export -r MYTAG realmodule" \
+"U realmodule/a
+export script invoked in ${TESTDIR}/1
+args: realmodule"
+ fi
+
+ dotest_fail modules5-17 "${testcvs} co realmodule/a" \
+"${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory' \
+"${PROG}"' [a-z]*: module `realmodule/a'\'' is a request for a file in a module which is not a directory
+'"${PROG}"' \[[a-z]* aborted\]: cannot expand modules'
+
+ # FIXCVS: The client gets confused in these cases and tries to
+ # store the scripts in the wrong places.
+ if test "$remote" != "yes"; then
+ # Now test the ability to check out a single file from a directory
+ dotest modules5-18 "${testcvs} co dirmodule/a" \
+"U dirmodule/a
+${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
+checkout script invoked in ${TESTDIR}/1
+args: dirmodule"
+ dotest modules5-19 "test -d dirmodule && test -f dirmodule/a" ""
+ dotest_fail modules5-20 "test -f dirmodule/b" ""
+ dotest modules5-21 "echo yes | ${testcvs} release -d dirmodule" \
+"You have \[0\] altered files in this repository\.
+Are you sure you want to release (and delete) directory .dirmodule.: "
+
+ # Now test the ability to correctly reject a non-existent filename.
+ # For maximum studliness we would check that an error message is
+ # being output.
+ # We accept a zero exit status because it is what CVS does
+ # (Dec 95). Probably the exit status should be nonzero,
+ # however.
+ dotest modules5-22 "${testcvs} co dirmodule/nonexist" \
+"${PROG} [a-z]*: warning: new-born dirmodule/nonexist has disappeared
+${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/checkout\.sh. .dirmodule..
+checkout script invoked in ${TESTDIR}/1
+args: dirmodule"
+
+ # We tolerate the creation of the dirmodule directory, since that
+ # is what CVS does, not because we view that as preferable to not
+ # creating it.
+ dotest_fail modules5-23 "test -f dirmodule/a || test -f dirmodule/b" ""
+ rm -r dirmodule
+
+ # Now test that a module using -d checks out to the specified
+ # directory.
+ dotest modules5-24 "${testcvs} -q co namedmodule" \
+"U nameddir/a
+U nameddir/b
+checkout script invoked in ${TESTDIR}/1
+args: nameddir"
+ dotest modules5-25 "test -f nameddir/a && test -f nameddir/b" ""
+ echo add line >>nameddir/a
+ # This seems suspicious: when we checkout an existing directory,
+ # the checkout script gets executed in addition to the update
+ # script. Is that by design or accident?
+ dotest modules5-26 "${testcvs} -q co namedmodule" \
+"M nameddir/a
+${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir..
+update script invoked in ${TESTDIR}/1/nameddir
+args: ${CVSROOT_DIRNAME}/first-dir/subdir
+checkout script invoked in ${TESTDIR}/1
+args: nameddir"
+ rm nameddir/a
+ dotest modules5-27 "${testcvs} -q co namedmodule" \
+"U nameddir/a
+${PROG} [a-z]*: Executing ..${CVSROOT_DIRNAME}/update\.sh. .${CVSROOT_DIRNAME}/first-dir/subdir..
+update script invoked in ${TESTDIR}/1/nameddir
+args: ${CVSROOT_DIRNAME}/first-dir/subdir
+checkout script invoked in ${TESTDIR}/1
+args: nameddir"
+ dotest modules5-28 "echo yes | ${testcvs} release -d nameddir" \
+"You have \[0\] altered files in this repository\.
+Are you sure you want to release (and delete) directory .nameddir.: "
+ fi
+
+ cd ..
+ rm -rf 1 ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/*.sh
+ ;;
+
mkmodules-temp-file-removal)
# When a file listed in checkoutlist doesn't exist, cvs-1.10.4
# would fail to remove the CVSROOT/.#[0-9]* temporary file it
@@ -7777,7 +8208,9 @@ Checking in CVSROOT/modules;
${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
-${PROG} [a-z]*: Rebuilding administrative file database"
+${PROG} [a-z]*: Rebuilding administrative file database" \
+"${PROG} [a-z]*: Examining .
+${PROG} [a-z]*: Examining CVSROOT"
rm -rf CVS CVSROOT;
# Create the various modules
@@ -9115,6 +9548,8 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
"U CVSROOT/modules"
echo "# Module defs for emptydir tests" > CVSROOT/modules
echo "2d1mod -d dir2d1/sub2d1 mod1" >> CVSROOT/modules
+ echo "2d1moda -d dir2d1/suba moda/modasub" >> CVSROOT/modules
+ echo "comb -a 2d1mod 2d1moda" >> CVSROOT/modules
dotest emptydir-2 "${testcvs} ci -m add-modules" \
"${PROG} [a-z]*: Examining CVSROOT
@@ -9122,27 +9557,39 @@ Checking in CVSROOT/modules;
${CVSROOT_DIRNAME}/CVSROOT/modules,v <-- modules
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
-${PROG} [a-z]*: Rebuilding administrative file database"
+${PROG} [a-z]*: Rebuilding administrative file database" \
+"${PROG} [a-z]*: Examining CVSROOT"
rm -rf CVS CVSROOT
- mkdir ${CVSROOT_DIRNAME}/mod1
+ mkdir ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda
# Populate. Not sure we really need to do this.
- dotest emptydir-3 "${testcvs} co mod1" \
-"${PROG} [a-z]*: Updating mod1"
+ dotest emptydir-3 "${testcvs} -q co -l ." ""
+ dotest emptydir-3a "${testcvs} co mod1 moda" \
+"${PROG} [a-z]*: Updating mod1
+${PROG} [a-z]*: Updating moda"
echo "file1" > mod1/file1
- cd mod1
- dotest emptydir-4 "${testcvs} add file1" \
-"${PROG} [a-z]*: scheduling file .file1. for addition
-${PROG} [a-z]*: use '${PROG} commit' to add this file permanently"
- cd ..
- dotest emptydir-5 "${testcvs} -q ci -m yup mod1" \
+ mkdir moda/modasub
+ dotest emptydir-3b "${testcvs} add moda/modasub" \
+"Directory ${TESTDIR}/cvsroot/moda/modasub added to the repository"
+ echo "filea" > moda/modasub/filea
+ dotest emptydir-4 "${testcvs} add mod1/file1 moda/modasub/filea" \
+"${PROG} [a-z]*: scheduling file .mod1/file1. for addition
+${PROG} [a-z]*: scheduling file .moda/modasub/filea. for addition
+${PROG} [a-z]*: use '${PROG} commit' to add these files permanently"
+ dotest emptydir-5 "${testcvs} -q ci -m yup" \
"RCS file: ${CVSROOT_DIRNAME}/mod1/file1,v
done
Checking in mod1/file1;
${CVSROOT_DIRNAME}/mod1/file1,v <-- file1
initial revision: 1\.1
+done
+RCS file: ${CVSROOT_DIRNAME}/moda/modasub/filea,v
+done
+Checking in moda/modasub/filea;
+${CVSROOT_DIRNAME}/moda/modasub/filea,v <-- filea
+initial revision: 1\.1
done"
- rm -rf mod1 CVS
+ rm -rf mod1 moda CVS
# End Populate.
dotest emptydir-6 "${testcvs} co 2d1mod" \
@@ -9154,11 +9601,11 @@ U dir2d1/sub2d1/file1"
# else) in Emptydir; Emptydir is a placeholder indicating that
# the working directory doesn't correspond to anything in
# the repository.
- dotest emptydir-7 "${testcvs} add emptyfile" \
-"${PROG} [a-z]*: scheduling file .emptyfile. for addition
-${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
- dotest_fail emptydir-8 "${testcvs} -q ci -m add" \
-"${PROG} \[[a-z]* aborted\]: cannot check in to ${TESTDIR}/cvsroot/CVSROOT/Emptydir"
+ dotest_fail emptydir-7 "${testcvs} add emptyfile" \
+"${PROG} \[[a-z]* aborted\]: cannot add to ${TESTDIR}/cvsroot/CVSROOT/Emptydir"
+ mkdir emptydir
+ dotest_fail emptydir-8 "${testcvs} add emptydir" \
+"${PROG} \[[a-z]* aborted\]: cannot add to ${TESTDIR}/cvsroot/CVSROOT/Emptydir"
cd ..
rm -rf CVS dir2d1
@@ -9173,11 +9620,25 @@ ${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
dotest emptydir-11 "${testcvs} -q -n update -d -P" ''
cd ../..
rm -r edir
+ cd ..
+ # Now start playing with moda.
+ mkdir 2; cd 2
+ dotest emptydir-12 "${testcvs} -q co 2d1moda" \
+"U dir2d1/suba/filea"
+ # OK, this is the crux of the matter. Some people think
+ # it would be more logical if this showed "moda". But why
+ # "moda" (from module 2d1moda) and not "." (from module 2d1mod)?
+ dotest emptydir-13 "cat dir2d1/CVS/Repository" "CVSROOT/Emptydir"
+ dotest emptydir-14 "${testcvs} co comb" \
+"${PROG} [a-z]*: Updating dir2d1/sub2d1
+U dir2d1/sub2d1/file1
+${PROG} [a-z]*: Updating dir2d1/suba"
+ dotest emptydir-15 "cat dir2d1/CVS/Repository" "CVSROOT/Emptydir"
cd ..
- rm -r 1
- rm -rf ${CVSROOT_DIRNAME}/mod1
+ rm -r 1 2
+ rm -rf ${CVSROOT_DIRNAME}/mod1 ${CVSROOT_DIRNAME}/moda
# I guess for the moment the convention is going to be
# that we don't need to remove ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
;;
@@ -10002,6 +10463,14 @@ done"
cd ..
dotest errmsg2-8 "${testcvs} add first-dir/sdir" \
"Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
+ # while we're here... check commit with no CVS directory
+ dotest_fail errmsg2-8a "${testcvs} -q ci first-dir nonexistant" \
+"${PROG} [a-z]*: nothing known about .nonexistant'
+${PROG} \[[a-z]* aborted\]: correct above errors first!"
+ dotest_fail errmsg2-8b "${testcvs} -q ci nonexistant first-dir" \
+"${PROG} [a-z]*: nothing known about .nonexistant'
+${PROG} \[[a-z]* aborted\]: correct above errors first!"
+ dotest errmsg2-8c "${testcvs} -q ci first-dir" ""
cd first-dir
@@ -10075,6 +10544,16 @@ done"
dotest_fail errmsg2-19 "${testcvs} annotate -rtest -Dyesterday" \
"${PROG} \[[a-z]* aborted\]: rcsbuf_open: internal error"
+ # trying to import the repository
+
+ if test "$remote" = "no"; then
+ cd ${CVSROOT_DIRNAME}
+ dotest_fail errmsg2-20 "${testcvs} import -mtest . A B" \
+"${PROG} \[[a-z]* aborted\]: attempt to import the repository"
+ dotest_fail errmsg2-21 "${testcvs} import -mtest first-dir A B" \
+"${PROG} \[[a-z]* aborted\]: attempt to import the repository"
+ fi
+
cd ..
rm -r 1
rm -rf ${TESTDIR}/cvsroot/first-dir
@@ -10366,7 +10845,25 @@ Fnw1 _watched=
D _watched="
cd ..
- cd ..
+ # Do a little error testing
+ dotest devcom2-18 "${testcvs} -q co -d first+dir first-dir" \
+"U first${PLUS}dir/nw1
+U first${PLUS}dir/w1
+U first${PLUS}dir/w2
+U first${PLUS}dir/w3"
+ cd first+dir
+ dotest_fail devcom2-19 "${testcvs} edit" \
+"${PROG} \[[a-z]* aborted\]: current directory (${TESTDIR}/2/first${PLUS}dir) contains an invalid character (${PLUS},>;=\\\\t\\\\n)"
+
+ # Make sure there are no droppings lying around
+ dotest devcom2-20 "cat ${CVSROOT_DIRNAME}/first-dir/CVS/fileattr" \
+"Fw1 _watched=
+Fw2 _watched=
+Fw3 _watched=
+Fnw1 _watched=
+D _watched="
+
+ cd ../..
# Use -f because of the readonly files.
rm -rf 1 2
@@ -10639,14 +11136,9 @@ done"
rm -f CVS/Baserev
# This will fail on most systems.
- if echo "yes" | ${testcvs} -Q unedit $file \
- >${TESTDIR}/test.tmp 2>&1 ; then
- dotest unedit-without-baserev-4 "cat ${TESTDIR}/test.tmp" \
+ echo "yes" | dotest unedit-without-baserev-4 "${testcvs} -Q unedit $file" \
"m has been modified; revert changes${QUESTION} ${PROG} unedit: m not mentioned in CVS/Baserev
${PROG} unedit: run update to complete the unedit"
- else
- fail unedit-without-baserev-4
- fi
# SunOS4.1.4 systems make it this far, but with a corrupted
# CVS/Entries file. Demonstrate the corruption!
@@ -10694,13 +11186,9 @@ rcsmerge: warning: conflicts during merge
${PROG} [a-z]*: conflicts found in m
C m"
rm CVS/Baserev
- if (echo yes | ${testcvs} unedit m) >${TESTDIR}/test.tmp 2>&1; then
- dotest unedit-without-baserev-14 "cat ${TESTDIR}/test.tmp" \
+ echo yes | dotest unedit-without-baserev-14 "${testcvs} unedit m" \
"m has been modified; revert changes${QUESTION} ${PROG} unedit: m not mentioned in CVS/Baserev
${PROG} unedit: run update to complete the unedit"
- else
- fail unedit-without-baserev-14
- fi
if test "$remote" = yes; then
dotest unedit-without-baserev-15 "${testcvs} -q update" "U m"
else
@@ -10844,26 +11332,14 @@ ${QUESTION} first-dir/rootig.c
${QUESTION} second-dir/.cvsignore
${QUESTION} second-dir/notig.c"
- if echo yes | ${testcvs} release -d first-dir \
- >${TESTDIR}/ignore.tmp; then
- pass ignore-192
- else
- fail ignore-192
- fi
- dotest ignore-193 "cat ${TESTDIR}/ignore.tmp" \
+ echo yes | dotest ignore-192 "${testcvs} release -d first-dir" \
"${QUESTION} \.cvsignore
You have \[0\] altered files in this repository.
Are you sure you want to release (and delete) directory .first-dir': "
echo add a line >>second-dir/foobar.c
rm second-dir/notig.c second-dir/.cvsignore
- if echo yes | ${testcvs} release -d second-dir \
- >${TESTDIR}/ignore.tmp; then
- pass ignore-194
- else
- fail ignore-194
- fi
- dotest ignore-195 "cat ${TESTDIR}/ignore.tmp" \
+ echo yes | dotest ignore-194 "${testcvs} release -d second-dir" \
"M foobar.c
You have \[1\] altered files in this repository.
Are you sure you want to release (and delete) directory .second-dir': "
@@ -10871,7 +11347,6 @@ Are you sure you want to release (and delete) directory .second-dir': "
rm -r 1
cd ..
rm -r wnt
- rm ${TESTDIR}/ignore.tmp
rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
;;
@@ -10887,8 +11362,8 @@ Are you sure you want to release (and delete) directory .second-dir': "
mkdir ${CVSROOT_DIRNAME}/first-dir
mkdir 1; cd 1
dotest binfiles-1 "${testcvs} -q co first-dir" ''
- awk 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
- </dev/null | tr '@' '\000' >binfile.dat
+ ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
+ </dev/null | ${TR} '@' '\000' >binfile.dat
cat binfile.dat binfile.dat >binfile2.dat
cd first-dir
cp ../binfile.dat binfile
@@ -11159,8 +11634,8 @@ total revisions: 1
# each be distinct from each other. We also make sure to include
# a few likely end-of-line patterns to make sure nothing is
# being munged as if in text mode.
- awk 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
- </dev/null | tr '@' '\000' >../binfile
+ ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
+ </dev/null | ${TR} '@' '\000' >../binfile
cat ../binfile ../binfile >../binfile2
cat ../binfile2 ../binfile >../binfile3
@@ -11321,8 +11796,8 @@ checkin
mkdir ${CVSROOT_DIRNAME}/first-dir
mkdir 1; cd 1
dotest binfiles3-1 "${testcvs} -q co first-dir" ''
- awk 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
- </dev/null | tr '@' '\000' >binfile.dat
+ ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
+ </dev/null | ${TR} '@' '\000' >binfile.dat
cd first-dir
echo hello >file1
dotest binfiles3-2 "${testcvs} add file1" \
@@ -11377,9 +11852,9 @@ total revisions: 3
# OK, now test admin -o on a binary file. See "admin"
# test for a more complete list of admin -o tests.
cp ${TESTDIR}/1/binfile.dat ${TESTDIR}/1/binfile4.dat
- echo '%%$$##@@!!jjiiuull' | tr j '\000' >>${TESTDIR}/1/binfile4.dat
+ echo '%%$$##@@!!jjiiuull' | ${TR} j '\000' >>${TESTDIR}/1/binfile4.dat
cp ${TESTDIR}/1/binfile4.dat ${TESTDIR}/1/binfile5.dat
- echo 'aawwee%$$##@@!!jjil' | tr w '\000' >>${TESTDIR}/1/binfile5.dat
+ echo 'aawwee%$$##@@!!jjil' | ${TR} w '\000' >>${TESTDIR}/1/binfile5.dat
cp ../binfile4.dat file1
dotest binfiles3-9 "${testcvs} -q ci -m change" \
@@ -12011,6 +12486,7 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
dotest info-1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
cd CVSROOT
+ rm -f $TESTDIR/testlog $TESTDIR/testlog2
echo "ALL sh -c \"echo x\${=MYENV}\${=OTHER}y\${=ZEE}=\$USER=\$CVSROOT= >>$TESTDIR/testlog; cat >/dev/null\"" > loginfo
# The following cases test the format string substitution
echo "ALL echo %{sVv} >>$TESTDIR/testlog2; cat >/dev/null" >> loginfo
@@ -12051,11 +12527,18 @@ ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
done
${PROG} [a-z]*: loginfo:1: no such user variable \${=ZEE}"
+ echo line0 >>file1
+ dotest info-6b "${testcvs} -q -sOTHER=foo ci -m mod-it" \
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+new revision: 1\.2; previous revision: 1\.1
+done
+${PROG} [a-z]*: loginfo:1: no such user variable \${=ZEE}"
echo line1 >>file1
dotest info-7 "${testcvs} -q -s OTHER=value -s ZEE=z ci -m mod-it" \
"Checking in file1;
${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
-new revision: 1\.2; previous revision: 1\.1
+new revision: 1\.3; previous revision: 1\.2
done"
cd ..
dotest info-9 "cat $TESTDIR/testlog" "xenv-valueyz=${username}=${TESTDIR}/cvsroot="
@@ -12068,6 +12551,11 @@ first-dir file1,1.1,1.2
first-dir 1.2
first-dir file1
first-dir 1.1AX
+first-dir file1ux
+first-dir file1,1.2,1.3
+first-dir 1.3
+first-dir file1
+first-dir 1.2AX
first-dir file1ux'
cd CVSROOT
@@ -12075,7 +12563,7 @@ first-dir file1ux'
dotest info-11 "${testcvs} -q -s ZEE=garbage ci -m nuke-loginfo" \
"Checking in loginfo;
${TESTDIR}/cvsroot/CVSROOT/loginfo,v <-- loginfo
-new revision: 1\.[0-9]; previous revision: 1\.[0-9]
+new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12086,6 +12574,7 @@ if head -1 < \$1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
exit 0
else
echo "No BugId found."
+ sleep 1
exit 1
fi
EOF
@@ -12094,7 +12583,7 @@ EOF
dotest info-v1 "${testcvs} -q ci -m add-verification" \
"Checking in verifymsg;
${TESTDIR}/cvsroot/CVSROOT/verifymsg,v <-- verifymsg
-new revision: 1\.2; previous revision: 1\.1
+new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -12111,7 +12600,7 @@ EOF
dotest info-v3 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
"Checking in file1;
${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
-new revision: 1\.3; previous revision: 1\.2
+new revision: 1\.4; previous revision: 1\.3
done"
cd ..
mkdir another-dir
@@ -12130,7 +12619,7 @@ ${PROG} \[[a-z]* aborted\]: Message verification failed"
dotest info-cleanup-verifymsg "${testcvs} -q ci -m nuke-verifymsg" \
"Checking in verifymsg;
${TESTDIR}/cvsroot/CVSROOT/verifymsg,v <-- verifymsg
-new revision: 1\.[0-9]; previous revision: 1\.[0-9]
+new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
cd ..
@@ -12392,8 +12881,10 @@ U file1'
# -h: admin-19a-log
# -N: log, log2, admin-19a-log
# -b, -r: log
- # -d: rcs
- # -s, -R: rcs3
+ # -d: logopt, rcs
+ # -s: logopt, rcs3
+ # -R: logopt, rcs3
+ # -w, -t: not tested yet (TODO)
# Check in a file with a few revisions and branches.
mkdir ${CVSROOT_DIRNAME}/first-dir
@@ -12560,6 +13051,33 @@ description:
${log_rev3}
${log_trailer}"
+# Check that unusual syntax works correctly.
+
+ dotest log-14c "${testcvs} log -r: file1" \
+"${log_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+ dotest log-14d "${testcvs} log -r, file1" \
+"${log_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+ dotest log-14e "${testcvs} log -r. file1" \
+"${log_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 1
+description:
+${log_rev3}
+${log_trailer}"
+
dotest log-15 "${testcvs} log -r1.2 file1" \
"${log_header}
${log_tags}
@@ -12600,6 +13118,18 @@ description:
${log_rev2b}
${log_trailer}"
+ # Multiple -r options are undocumented; see comments in
+ # cvs.texinfo about whether they should be deprecated.
+ dotest log-18a "${testcvs} log -r1.2.2.2 -r1.3:1.3 file1" \
+"${log_header}
+${log_tags}
+${log_header2}
+total revisions: 5; selected revisions: 2
+description:
+${log_rev3}
+${log_rev2b}
+${log_trailer}"
+
# This test would fail with the old invocation of rlog, but it
# works with the builtin log support.
dotest log-19 "${testcvs} log -rbranch. file1" \
@@ -12730,18 +13260,13 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
1
============================================================================="
- # I believe that in Real Life (TM), this is broken for remote.
- # That is, the filename in question must be the filename of a
- # file on the server. It only happens to work here because the
- # client machine and the server machine are one and the same.
echo 'longer description' >${TESTDIR}/descrip
echo 'with two lines' >>${TESTDIR}/descrip
dotest log2-7 "${testcvs} admin -t${TESTDIR}/descrip file1" \
"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done"
dotest_fail log2-7a "${testcvs} admin -t${TESTDIR}/nonexist file1" \
-"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
-${PROG} \[[a-z]* aborted\]: can't stat ${TESTDIR}/nonexist: No such file or directory"
+"${PROG} \[[a-z]* aborted\]: can't stat ${TESTDIR}/nonexist: No such file or directory"
dotest log2-8 "${testcvs} log -N file1" "
RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
Working file: file1
@@ -12760,22 +13285,13 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
1
============================================================================="
- # Reading the description from stdin is broken for remote.
- # See comments in cvs.texinfo for a few more notes on this.
- if test "x$remote" = xno; then
+ # TODO: `cvs admin -t "my message" file1' is a request to
+ # read the message from stdin and to operate on two files.
+ # Should test that there is an error because "my message"
+ # doesn't exist.
- # TODO: `cvs admin -t "my message" file1' is a request to
- # read the message from stdin and to operate on two files.
- # Should test that there is an error because "my message"
- # doesn't exist.
-
- if echo change from stdin | ${testcvs} admin -t -q file1
- then
- pass log2-9
- else
- fail log2-9
- fi
- dotest log2-10 "${testcvs} log -N file1" "
+ dotest log2-9 "echo change from stdin | ${testcvs} admin -t -q file1" ""
+ dotest log2-10 "${testcvs} log -N file1" "
RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
Working file: file1
head: 1\.1
@@ -12792,8 +13308,6 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
1
============================================================================="
- fi # end of tests skipped for remote
-
cd ..
rm ${TESTDIR}/descrip
rm -r first-dir
@@ -12801,6 +13315,49 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
;;
+ logopt)
+ # Some tests of log.c's option parsing and such things.
+ mkdir 1; cd 1
+ dotest logopt-1 "${testcvs} -q co -l ." ''
+ mkdir first-dir
+ dotest logopt-2 "${testcvs} add first-dir" \
+"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+ cd first-dir
+ echo hi >file1
+ dotest logopt-3 "${testcvs} add file1" \
+"${PROG} [a-z]*: scheduling file .file1. for addition
+${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
+ dotest logopt-4 "${testcvs} -q ci -m add file1" \
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+done
+Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
+initial revision: 1\.1
+done"
+ cd ..
+
+ dotest logopt-5 "${testcvs} log -R -d 2038-01-01" \
+"${PROG} [a-z]*: Logging \.
+${PROG} [a-z]*: Logging first-dir
+${TESTDIR}/cvsroot/first-dir/file1,v"
+ dotest logopt-6 "${testcvs} log -d 2038-01-01 -R" \
+"${PROG} [a-z]*: Logging \.
+${PROG} [a-z]*: Logging first-dir
+${TESTDIR}/cvsroot/first-dir/file1,v"
+ dotest logopt-6a "${testcvs} log -Rd 2038-01-01" \
+"${PROG} [a-z]*: Logging \.
+${PROG} [a-z]*: Logging first-dir
+${TESTDIR}/cvsroot/first-dir/file1,v"
+ dotest logopt-7 "${testcvs} log -s Exp -R" \
+"${PROG} [a-z]*: Logging \.
+${PROG} [a-z]*: Logging first-dir
+${TESTDIR}/cvsroot/first-dir/file1,v"
+
+ cd ..
+ rm -r 1
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ ;;
+
ann)
# Tests of "cvs annotate". See also:
# basica-10 A simple annotate test
@@ -13296,7 +13853,7 @@ add file1
# ISO8601 format. There are many, many, other variations
# specified by ISO8601 which we should be testing too.
- dotest rcs-3 "${testcvs} -q log -d 1996-12-11<" "
+ dotest rcs-3 "${testcvs} -q log -d '1996-12-11<'" "
RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
Working file: file1
head: 1\.3
@@ -13315,9 +13872,8 @@ delete second line; modify twelfth line
============================================================================="
# RFC822 format (as amended by RFC1123).
- if ${testcvs} -q log -d '<3 Apr 2000 00:00' >${TESTDIR}/rcs4.tmp
- then
- dotest rcs-4 "cat ${TESTDIR}/rcs4.tmp" "
+ dotest rcs-4 "${testcvs} -q log -d '<3 Apr 2000 00:00'" \
+"
RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
Working file: file1
head: 1\.3
@@ -13338,9 +13894,6 @@ revision 1\.1
date: 1996/11/24 15:56:05; author: kingdon; state: Exp;
add file1
============================================================================="
- else
- fail rcs-4
- fi
# Intended behavior for "cvs annotate" is that it displays the
# last two digits of the year. Make sure it does that rather
@@ -13545,47 +14098,22 @@ a1 1
next branch revision
@"
- if ${testcvs} -q update -p -D '1970-12-31 11:30 UT' file2 \
- >${TESTDIR}/rcs4.tmp
- then
- dotest rcs-9 "cat ${TESTDIR}/rcs4.tmp" "start revision"
- else
- fail rcs-9
- fi
+ dotest rcs-9 "${testcvs} -q update -p -D '1970-12-31 11:30 UT' file2" \
+"start revision"
- if ${testcvs} -q update -p -D '1970-12-31 12:30 UT' file2 \
- >${TESTDIR}/rcs4.tmp
- then
- dotest rcs-10 "cat ${TESTDIR}/rcs4.tmp" "mid revision"
- else
- fail rcs-10
- fi
+ dotest rcs-10 "${testcvs} -q update -p -D '1970-12-31 12:30 UT' file2" \
+"mid revision"
- if ${testcvs} -q update -p -D '1971-01-01 00:30 UT' file2 \
- >${TESTDIR}/rcs4.tmp
- then
- dotest rcs-11 "cat ${TESTDIR}/rcs4.tmp" "new year revision"
- else
- fail rcs-11
- fi
+ dotest rcs-11 "${testcvs} -q update -p -D '1971-01-01 00:30 UT' file2" \
+"new year revision"
# Same test as rcs-10, but with am/pm.
- if ${testcvs} -q update -p -D 'December 31, 1970 12:30pm UT' file2 \
- >${TESTDIR}/rcs4.tmp
- then
- dotest rcs-12 "cat ${TESTDIR}/rcs4.tmp" "mid revision"
- else
- fail rcs-12
- fi
+ dotest rcs-12 "${testcvs} -q update -p -D 'December 31, 1970 12:30pm UT' file2" \
+"mid revision"
# Same test as rcs-11, but with am/pm.
- if ${testcvs} -q update -p -D 'January 1, 1971 12:30am UT' file2 \
- >${TESTDIR}/rcs4.tmp
- then
- dotest rcs-13 "cat ${TESTDIR}/rcs4.tmp" "new year revision"
- else
- fail rcs-13
- fi
+ dotest rcs-13 "${testcvs} -q update -p -D 'January 1, 1971 12:30am UT' file2" \
+"new year revision"
# OK, now make sure cvs log doesn't have any trouble with the
# newphrases and such.
@@ -13631,9 +14159,49 @@ revision 1\.2\.6\.1
date: 1971/01/01 08:00:05; author: joe; state: Exp; lines: ${PLUS}1 -1
\*\*\* empty log message \*\*\*
============================================================================="
+ # Now test each date format for "cvs log -d".
+ # Earlier than 1971-01-01
+ dotest rcs-15 "${testcvs} -q log -d '<1971-01-01 00:00 GMT' file2 \
+ | grep revision" \
+"total revisions: 7; selected revisions: 3
+revision 1\.3
+revision 1\.2
+revision 1\.1"
+ # Later than 1971-01-01
+ dotest rcs-16 "${testcvs} -q log -d '1971-01-01 00:00 GMT<' file2 \
+ | grep revision" \
+"total revisions: 7; selected revisions: 4
+revision 1\.5
+revision 1\.4
+revision 1\.2\.6\.2
+revision 1\.2\.6\.1"
+ # Alternate syntaxes for later and earlier; multiple -d options
+ dotest rcs-17 "${testcvs} -q log -d '>1971-01-01 00:00 GMT' \
+ -d '1970-12-31 12:15 GMT>' file2 | grep revision" \
+"total revisions: 7; selected revisions: 5
+revision 1\.5
+revision 1\.4
+revision 1\.1
+revision 1\.2\.6\.2
+revision 1\.2\.6\.1"
+ # Range, and single date
+ dotest rcs-18 "${testcvs} -q log -d '1970-12-31 11:30 GMT' \
+ -d '1971-01-01 00:00:05 GMT<1971-01-01 01:00:01 GMT' \
+ file2 | grep revision" \
+"total revisions: 7; selected revisions: 2
+revision 1\.5
+revision 1\.1"
+ # Alternate range syntax; equality
+ dotest rcs-19 "${testcvs} -q log \
+ -d '1971-01-01 01:00:01 GMT>=1971-01-01 00:00:05 GMT' \
+ file2 | grep revision" \
+"total revisions: 7; selected revisions: 2
+revision 1\.5
+revision 1\.4"
+
cd ..
- rm -r first-dir ${TESTDIR}/rcs4.tmp
+ rm -r first-dir
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -13684,41 +14252,17 @@ EOF
cd first-dir
# 9 Sep 1999
- if ${testcvs} -q update -p -D '1999-09-09 11:30 UT' file1 \
- >${TESTDIR}/rcs4.tmp
- then
- dotest rcs2-2 "cat ${TESTDIR}/rcs4.tmp" \
+ dotest rcs2-2 "${testcvs} -q update -p -D '1999-09-09 11:30 UT' file1" \
"Tonight we're going to party like it's a certain year"
- else
- fail rcs2-2
- fi
# 1 Jan 2001.
- if ${testcvs} -q update -p -D '2001-01-01 11:30 UT' file1 \
- >${TESTDIR}/rcs4.tmp
- then
- dotest rcs2-3 "cat ${TESTDIR}/rcs4.tmp" \
+ dotest rcs2-3 "${testcvs} -q update -p -D '2001-01-01 11:30 UT' file1" \
"two year hiatus"
- else
- fail rcs2-3
- fi
# 29 Feb 2000
- if ${testcvs} -q update -p -D '2000-02-29 11:30 UT' file1 \
- >${TESTDIR}/rcs4.tmp
- then
- dotest rcs2-4 "cat ${TESTDIR}/rcs4.tmp" \
+ dotest rcs2-4 "${testcvs} -q update -p -D '2000-02-29 11:30 UT' file1" \
"2000 is also a good year for leaping"
- else
- fail rcs2-4
- fi
# 29 Feb 2003 is invalid
- if ${testcvs} -q update -p -D '2003-02-29 11:30 UT' file1 \
- >${TESTDIR}/rcs4.tmp 2>&1
- then
- fail rcs2-5
- else
- dotest rcs2-5 "cat ${TESTDIR}/rcs4.tmp" \
+ dotest_fail rcs2-5 "${testcvs} -q update -p -D '2003-02-29 11:30 UT' file1" \
"${PROG} \[[a-z]* aborted\]: Can't parse date/time: 2003-02-29 11:30 UT"
- fi
dotest rcs2-6 "${testcvs} -q update -p -D 2007-01-07 file1" \
"head revision"
@@ -13736,22 +14280,10 @@ EOF
# 31 May 1999), it seems to fail.
#
# Sigh.
- if ${testcvs} -q update -p -D '100 months' file1 \
- >${TESTDIR}/rcs4.tmp 2>&1
- then
- dotest rcs2-7 "cat ${TESTDIR}/rcs4.tmp" "head revision"
- else
- fail rcs2-7
- fi
- if ${testcvs} -q update -p -D '8 years' file1 \
- >${TESTDIR}/rcs4.tmp 2>&1
- then
- dotest rcs2-8 "cat ${TESTDIR}/rcs4.tmp" "head revision"
- else
- fail rcs2-8
- fi
-
- rm ${TESTDIR}/rcs4.tmp
+ dotest rcs2-7 "${testcvs} -q update -p -D '100 months' file1" \
+"head revision"
+ dotest rcs2-8 "${testcvs} -q update -p -D '8 years' file1" \
+"head revision"
cd ..
rm -r first-dir
@@ -13772,7 +14304,7 @@ EOF
# question one way or the other (it has a grammar but almost
# nothing about lexical analysis).
dotest_fail rcs3-1 "${testcvs} -q co first-dir" \
-"${PROG} \[[a-z]* aborted\]: unexpected end of file reading ${TESTDIR}/cvsroot/first-dir/file1,v"
+"${PROG} \[[a-z]* aborted\]: EOF while looking for value in RCS file ${TESTDIR}/cvsroot/first-dir/file1,v"
cat <<EOF >${CVSROOT_DIRNAME}/first-dir/file1,v
head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
; author jeremiah ;state ; branches; next;desc @@1.1log@@text@head@
@@ -13793,25 +14325,15 @@ head 1.1; access; symbols; locks; expand o; 1.1 date 2007.03.20.04.03.02
; author jeremiah ;state ; branches; next;desc @@1.1 log @@text @head@
EOF
dotest rcs3-4 "${testcvs} -q co first-dir" 'U first-dir/file1'
- if test "$remote" = no; then
- # Ouch, didn't expect this one. FIXCVS. Or maybe just remove
- # the feature, if this is a -s problem?
- dotest_fail rcs3-5 "${testcvs} log -s nostate first-dir/file1" \
-".*[Aa]ssertion.*failed${DOTSTAR}" ".*failed assertion${DOTSTAR}"
- else # remote
- # Is this a reaction to the lack of TopLevelAdmin or something?
- # Seems pretty strange to me. Seems vaguely similar to the
- # "no repository" message in errmsg2-16 although I'm leaving
- # it here in case there is a difference between "cvs add" and a
- # normal start_recursion command like "cvs log".
- dotest_fail rcs3-5 "${testcvs} log -s nostate first-dir/file1" \
-"${PROG} log: cannot open CVS/Entries for reading: No such file or directory
-${PROG} \[log aborted\]: no repository"
- cd first-dir
- dotest_fail rcs3-5a "${testcvs} log -s nostate file1" \
+
+ # Ouch, didn't expect this one. FIXCVS. Or maybe just remove
+ # the feature, if this is a -s problem?
+ dotest_fail rcs3-5 "${testcvs} log -s nostate first-dir/file1" \
"${DOTSTAR}ssertion.*failed${DOTSTAR}" "${DOTSTAR}failed assertion${DOTSTAR}"
- cd ..
- fi # remote
+ cd first-dir
+ dotest_fail rcs3-5a "${testcvs} log -s nostate file1" \
+"${DOTSTAR}ssertion.*failed${DOTSTAR}" "${DOTSTAR}failed assertion${DOTSTAR}"
+ cd ..
# See remote code above for rationale for cd.
cd first-dir
@@ -13819,7 +14341,7 @@ ${PROG} \[log aborted\]: no repository"
"${TESTDIR}/cvsroot/first-dir/file1,v"
# OK, now put an extraneous '\0' at the end.
- awk </dev/null 'BEGIN { printf "@%c", 10 }' | tr '@' '\000' \
+ ${AWK} </dev/null 'BEGIN { printf "@%c", 10 }' | ${TR} '@' '\000' \
>>${CVSROOT_DIRNAME}/first-dir/file1,v
dotest_fail rcs3-7 "${testcvs} log -s nostate file1" \
"${PROG} \[[a-z]* aborted\]: unexpected '.x0' reading revision number in RCS file ${TESTDIR}/cvsroot/first-dir/file1,v"
@@ -13882,6 +14404,7 @@ ${PROG} \[[a-z]* aborted\]: cannot stat ${TESTDIR}/locks: No such file or direct
cd ../../..
dotest lockfiles-8 "${testcvs} -q update" ""
+ dotest lockfiles-9 "${testcvs} -q co -l ." ""
cd CVSROOT
echo "# nobody here but us comments" >config
@@ -14099,9 +14622,9 @@ ${PROG} \[[a-z]* aborted\]: could not find desired version 1\.6 in ${TESTDIR}/cv
# database dirs in a workspace with later revisions than those in the
# recovered repository
cd repos-first-dir
-DATADIRS=\`find . -name CVS\`
+DATADIRS=\`find . -name CVS -print\`
cd ../first-dir
-find . -name CVS |xargs rm -rf
+find . -name CVS -print | xargs rm -rf
for file in \${DATADIRS}; do
cp -r ../repos-first-dir/\${file} \${file}
done" >fixit
@@ -14204,42 +14727,79 @@ done"
# slowly and carefully.
cat >${CVSROOT_DIRNAME}/CVSROOT/history <<EOF
O3395c677|anonymous|<remote>/*0|ccvs||ccvs
+O3396c677|anonymous|<remote>/src|ccvs||src
+O3397c677|kingdon|<remote>/*0|ccvs||ccvs
M339cafae|nk|<remote>|ccvs/src|1.229|sanity.sh
+M339cafff|anonymous|<remote>|ccvs/src|1.23|Makefile
M339dc339|kingdon|~/work/*0|ccvs/src|1.231|sanity.sh
W33a6eada|anonymous|<remote>*4|ccvs/emx||Makefile.in
C3b235f50|kingdon|<remote>|ccvs/emx|1.3|README
M3b23af50|kingdon|~/work/*0|ccvs/doc|1.281|cvs.texinfo
EOF
dotest history-1 "${testcvs} history -e -a" \
-"O 06/04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
-W 06/17 19:51 ${PLUS}0000 anonymous Makefile\.in ccvs/emx == <remote>/emx
-M 06/10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
-C 06/10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
-M 06/10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc
-M 06/10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
- if ${testcvs} history -e -a -D '10 Jun 1997 13:00 UT' \
- >${TESTDIR}/output.tmp
- then
- dotest history-2 "cat ${TESTDIR}/output.tmp" \
-"W 06/17 19:51 ${PLUS}0000 anonymous Makefile\.in ccvs/emx == <remote>/emx
-M 06/10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
-C 06/10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
-M 06/10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc"
- else
- fail history-2
- fi
- if ${testcvs} history -e -a -D '10 Jun 2001 13:00 UT' \
- >${TESTDIR}/output.tmp
- then
- # For reasons that are completely unclear to me, the number
- # of spaces betwen "kingdon" and "1.281" is different than
- # for the other tests.
- dotest history-3 "cat ${TESTDIR}/output.tmp" \
-"M 06/10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc"
- else
- fail history-3
- fi
- rm ${TESTDIR}/output.tmp
+"O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
+O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src= <remote>/\*
+M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
+W 1997-06-17 19:51 ${PLUS}0000 anonymous Makefile\.in ccvs/emx == <remote>/emx
+O 1997-06-06 08:12 ${PLUS}0000 kingdon ccvs =ccvs= <remote>/\*
+M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
+C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
+M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc
+M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
+
+ dotest history-2 "${testcvs} history -e -a -D '10 Jun 1997 13:00 UT'" \
+"W 1997-06-17 19:51 ${PLUS}0000 anonymous Makefile\.in ccvs/emx == <remote>/emx
+M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
+C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
+M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc"
+
+ dotest history-3 "${testcvs} history -e -a -D '10 Jun 2001 13:00 UT'" \
+"M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs\.texinfo ccvs/doc == ~/work/ccvs/doc"
+
+ dotest history-4 "${testcvs} history -ac sanity.sh" \
+"M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
+M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
+
+ dotest history-5 "${testcvs} history -a -xCGUWAMR README sanity.sh" \
+"M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
+C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
+M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
+
+ dotest history-6 "${testcvs} history -xCGUWAMR -a -f README -f sanity.sh" \
+"M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
+C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
+M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
+
+ dotest history-7 "${testcvs} history -xCGUWAMR -a -f sanity.sh README" \
+"M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity\.sh ccvs/src == ~/work/ccvs/src
+C 2001-06-10 11:51 ${PLUS}0000 kingdon 1\.3 README ccvs/emx == <remote>
+M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity\.sh ccvs/src == <remote>"
+
+ dotest history-8 "${testcvs} history -ca -D '1970-01-01 00:00 UT'" \
+"M 1997-06-10 01:36 ${PLUS}0000 nk 1\.229 sanity.sh ccvs/src == <remote>
+M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
+M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity.sh ccvs/src == ~/work/ccvs/src
+M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc"
+
+ dotest history-9 "${testcvs} history -acl" \
+"M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc
+M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
+M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity.sh ccvs/src == ~/work/ccvs/src"
+
+ dotest history-10 "${testcvs} history -lca -D '1970-01-01 00:00 UT'" \
+"M 2001-06-10 17:33 ${PLUS}0000 kingdon 1\.281 cvs.texinfo ccvs/doc == ~/work/ccvs/doc
+M 1997-06-10 01:38 ${PLUS}0000 anonymous 1\.23 Makefile ccvs/src == <remote>
+M 1997-06-10 21:12 ${PLUS}0000 kingdon 1\.231 sanity.sh ccvs/src == ~/work/ccvs/src"
+
+ dotest history-11 "${testcvs} history -aw" \
+"O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
+O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src= <remote>/\*
+O 1997-06-06 08:12 ${PLUS}0000 kingdon ccvs =ccvs= <remote>/\*"
+
+ dotest history-12 "${testcvs} history -aw -D'1970-01-01 00:00 UT'" \
+"O 1997-06-04 19:48 ${PLUS}0000 anonymous ccvs =ccvs= <remote>/\*
+O 1997-06-05 14:00 ${PLUS}0000 anonymous ccvs =src= <remote>/\*
+O 1997-06-06 08:12 ${PLUS}0000 kingdon ccvs =ccvs= <remote>/\*"
;;
big)
@@ -14481,17 +15041,17 @@ done"
# the attic (may that one can remain a fatal error, seems less
# useful for access control).
mkdir 1; cd 1
- dotest modes-1 "${testcvs} -q co -l ." ''
+ dotest modes3-1 "${testcvs} -q co -l ." ''
mkdir first-dir second-dir
- dotest modes-2 "${testcvs} add first-dir second-dir" \
+ dotest modes3-2 "${testcvs} add first-dir second-dir" \
"Directory ${TESTDIR}/cvsroot/first-dir added to the repository
Directory ${TESTDIR}/cvsroot/second-dir added to the repository"
touch first-dir/aa second-dir/ab
- dotest modes-3 "${testcvs} add first-dir/aa second-dir/ab" \
+ dotest modes3-3 "${testcvs} add first-dir/aa second-dir/ab" \
"${PROG} [a-z]*: scheduling file .first-dir/aa. for addition
${PROG} [a-z]*: scheduling file .second-dir/ab. for addition
${PROG} [a-z]*: use .${PROG} commit. to add these files permanently"
- dotest modes-4 "${testcvs} -q ci -m add" \
+ dotest modes3-4 "${testcvs} -q ci -m add" \
"RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
done
Checking in first-dir/aa;
@@ -14505,7 +15065,7 @@ ${TESTDIR}/cvsroot/second-dir/ab,v <-- ab
initial revision: 1\.1
done"
chmod a= ${TESTDIR}/cvsroot/first-dir
- dotest modes-5 "${testcvs} update" \
+ dotest modes3-5 "${testcvs} update" \
"${PROG} [a-z]*: Updating \.
${PROG} [a-z]*: Updating first-dir
${PROG} [a-z]*: cannot open directory ${TESTDIR}/cvsroot/first-dir: Permission denied
@@ -14517,7 +15077,7 @@ ${PROG} [a-z]*: Updating second-dir"
# won't have it in their working directory. But the next
# one is more of a problem if it is fatal.
rm -r first-dir
- dotest modes-6 "${testcvs} update -dP" \
+ dotest modes3-6 "${testcvs} update -dP" \
"${PROG} [a-z]*: Updating .
${PROG} [a-z]*: Updating CVSROOT
U ${DOTSTAR}
@@ -15470,9 +16030,9 @@ xx"
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .${PROG} commit. to add this file permanently"
- awk 'BEGIN { printf "%c%c%c%sRevision: 1.1 $@%c%c", \
+ ${AWK} 'BEGIN { printf "%c%c%c%sRevision: 1.1 $@%c%c", \
2, 10, 137, "$", 13, 10 }' \
- </dev/null | tr '@' '\000' >../binfile.dat
+ </dev/null | ${TR} '@' '\000' >../binfile.dat
cp ../binfile.dat .
dotest keyword2-5 "${testcvs} add -kb binfile.dat" \
"${PROG} [a-z]*: scheduling file .binfile\.dat. for addition
@@ -15577,8 +16137,8 @@ done"
T file1"
dotest keyword2-18 "${testcvs} -q update -r branch2" ''
- awk 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
- </dev/null | tr '@' '\000' >>binfile.dat
+ ${AWK} 'BEGIN { printf "%c%c%c@%c%c", 2, 10, 137, 13, 10 }' \
+ </dev/null | ${TR} '@' '\000' >>binfile.dat
dotest keyword2-19 "${testcvs} -q ci -m badbadbad" \
"Checking in binfile\.dat;
${TESTDIR}/cvsroot/first-dir/binfile\.dat,v <-- binfile\.dat
@@ -15851,51 +16411,16 @@ new revision: 1\.1\.4\.2; previous revision: 1\.1\.4\.1
done"
cd ../..
mkdir 2; cd
- if ${testcvs} -q export -r br2 -D'1 minute ago' first-dir \
- >${TESTDIR}/tagdate.tmp 2>&1; then
- if ${EXPR} "`cat ${TESTDIR}/tagdate.tmp`" : \
-"[UP] first-dir/file1" >/dev/null; then
- pass tagdate-14
- else
- echo "** expected: " >>${LOGFILE}
- echo "[UP] first-dir/file1" >>${LOGFILE}
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/tagdate.tmp >>${LOGFILE}
- fail tagdate-14
- fi
- else
- echo "Bad exit status" >>${LOGFILE}
- fail tagdate-14
- fi
-
- if ${EXPR} "`cat first-dir/file1`" : "br2-1" >/dev/null; then
- pass tagdate-15
- else
- fail tagdate-15
- fi
+ dotest tagdate-14 "${testcvs} -q export -r br2 -D'1 minute ago' first-dir" \
+"[UP] first-dir/file1"
+ dotest tagdate-15 "cat first-dir/file1" "br2-1"
# Now for annotate
cd ../1/first-dir
- if ${testcvs} annotate -rbr2 -D'1 minute ago' \
- >${TESTDIR}/tagdate.tmp 2>&1; then
- if ${EXPR} "`cat ${TESTDIR}/tagdate.tmp`" : \
+ dotest tagdate-16 "${testcvs} annotate -rbr2 -D'1 minute ago'" \
"Annotations for file1
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1\.4\.1 (${username} *[0-9a-zA-Z-]*): br2-1" >/dev/null; then
- pass tagdate-16
- else
- echo "** expected: " >>${LOGFILE}
- echo "Annotations for file1
-\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-1\.1\.4\.1 (${username} *[0-9a-zA-Z-]*): br2-1" >>${LOGFILE}
- echo "** got: " >>${LOGFILE}
- cat ${TESTDIR}/tagdate.tmp >>${LOGFILE}
- fail tagdate-16
- fi
- else
- echo "Bad exit status" >>${LOGFILE}
- fail tagdate-16
- fi
+1\.1\.4\.1 (${username} *[0-9a-zA-Z-]*): br2-1"
dotest tagdate-17 "${testcvs} annotate -rbr2 -Dnow" \
"Annotations for file1
@@ -15908,7 +16433,6 @@ done"
fi
cd ../..
- rm ${TESTDIR}/tagdate.tmp
rm -r 1 2
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -16452,16 +16976,27 @@ access list:
keyword substitution: kv
total revisions: 2
============================================================================="
- # Put the access list back, to avoid special cases later.
- dotest admin-19a-fix "${testcvs} -q admin -eauth3 file1" \
+ fi # end of tests skipped for remote
+
+ # Now test that plain -e works right.
+ dotest admin-19a-2 "${testcvs} -q admin -e file1" \
"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done"
- fi # end of tests skipped for remote
+ dotest admin-19a-3 "${testcvs} -q log -h -N file1" "
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+Working file: file1
+head: 1\.1
+branch:
+locks: strict
+access list:
+keyword substitution: kv
+total revisions: 2
+============================================================================="
- # Now test that plain -e is at least parsed right. CVS 1.10
- # would wrongly treat "-e file1" as "-efile1".
- dotest_fail admin-19a-2 "${testcvs} -q admin -e file1" \
-"${PROG} \[[a-z]* aborted\]: removing entire access list not yet implemented"
+ # Put the access list back, to avoid special cases later.
+ dotest admin-19a-4 "${testcvs} -q admin -afoo,auth2 file1" \
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
+done"
# Add another revision to file2, so we can delete one.
echo 'add a line' >> file2
@@ -17020,13 +17555,13 @@ add
cat >${TESTDIR}/lockme <<EOF
#!${TESTSHELL}
-line=\`grep <\$1/\$2,v 'locks ${username}:1\.[0-9];'\`
+line=\`grep <\$1/\$2,v 'locks ${author}:1\.[0-9];'\`
if test -z "\$line"; then
# It isn't locked
exit 0
else
- user=\`echo \$line | sed -e 's/locks \\(${username}\\):[0-9.]*;.*/\\1/'\`
- version=\`echo \$line | sed -e 's/locks ${username}:\\([0-9.]*\\);.*/\\1/'\`
+ user=\`echo \$line | sed -e 's/locks \\(${author}\\):[0-9.]*;.*/\\1/'\`
+ version=\`echo \$line | sed -e 's/locks ${author}:\\([0-9.]*\\);.*/\\1/'\`
echo "\$user has file a-lock locked for version \$version"
exit 1
fi
@@ -19479,7 +20014,7 @@ done"
# something which doesn't make sense.
dotest_fail multiroot3-10 \
"${testcvs} -q -d ${CVSROOT1} diff dir1/file1 dir2/file2" \
-"${PROG} [a-z]*: failed to create lock directory in repository .${TESTDIR}/root1/dir2': No such file or directory
+"${PROG} [a-z]*: failed to create lock directory for .${TESTDIR}/root1/dir2' (${TESTDIR}/root1/dir2/#cvs.lock): No such file or directory
${PROG} [a-z]*: failed to obtain dir lock in repository .${TESTDIR}/root1/dir2'
${PROG} \[[a-z]* aborted\]: read lock failed - giving up"
else
@@ -19500,7 +20035,37 @@ ${PROG} \[[a-z]* aborted\]: read lock failed - giving up"
# This one is supposed to work.
dotest multiroot3-11 "${testcvs} -q diff dir1/file1 dir2/file2" ""
- cd ..
+ # make sure we can't access across repositories
+ # FIXCVS: we probably shouldn't even create the local directories
+ # in this case, but we do, so deal with it.
+ mkdir 1a
+ cd 1a
+ dotest_fail multiroot3-12 \
+"${testcvs} -d ${CVSROOT1} -q co ../root2/dir2" \
+"${PROG} [a-z]*: in directory \.\./root2/dir2:
+${PROG} [a-z]*: .\.\..-relative repositories are not supported.
+${PROG} \[[a-z]* aborted\]: illegal source repository"
+ rm -rf ../root2
+ dotest_fail multiroot3-13 \
+"${testcvs} -d ${CVSROOT2} -q co ../root1/dir1" \
+"${PROG} [a-z]*: in directory \.\./root1/dir1:
+${PROG} [a-z]*: .\.\..-relative repositories are not supported.
+${PROG} \[[a-z]* aborted\]: illegal source repository"
+ rm -rf ../root1
+ dotest_fail multiroot3-14 \
+"${testcvs} -d ${CVSROOT1} -q co ./../root2/dir2" \
+"${PROG} [a-z]*: in directory \./\.\./root2/dir2:
+${PROG} [a-z]*: .\.\..-relative repositories are not supported.
+${PROG} \[[a-z]* aborted\]: illegal source repository"
+ rm -rf ../root2
+ dotest_fail multiroot3-15 \
+"${testcvs} -d ${CVSROOT2} -q co ./../root1/dir1" \
+"${PROG} [a-z]*: in directory \./\.\./root1/dir1:
+${PROG} [a-z]*: .\.\..-relative repositories are not supported.
+${PROG} \[[a-z]* aborted\]: illegal source repository"
+ rm -rf ../root1
+
+ cd ../..
if test "$keep" = yes; then
echo Keeping ${TESTDIR} and exiting due to --keep
@@ -19733,7 +20298,7 @@ No such file or directory"
pserver)
# Test basic pserver functionality.
if test "$remote" = yes; then
- # First set SystemAuth=no. Not really necessary, I don't
+ # First set SystemAuth=no. Not really necessary, I don't
# think, but somehow it seems like the clean thing for
# the testsuite.
mkdir 1; cd 1
@@ -19746,22 +20311,27 @@ ${TESTDIR}/cvsroot/CVSROOT/config,v <-- config
new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
done
${PROG} [a-z]*: Rebuilding administrative file database"
- echo "testme:q6WV9d2t848B2:`id -un`" \
- >${CVSROOT_DIRNAME}/CVSROOT/passwd
- ${testcvs} pserver >${TESTDIR}/pserver.tmp 2>&1 <<EOF
+ cat >${CVSROOT_DIRNAME}/CVSROOT/passwd <<EOF
+testme:q6WV9d2t848B2:$username
+anonymous::$username
+$username:
+willfail: :whocares
+EOF
+ dotest_fail pserver-3 "${testcvs} pserver" \
+"error 0 Server configuration missing --allow-root in inetd.conf" <<EOF
BEGIN AUTH REQUEST
${CVSROOT_DIRNAME}
testme
Ay::'d
END AUTH REQUEST
EOF
- dotest pserver-3 "cat ${TESTDIR}/pserver.tmp" \
-"error 0 Server configuration missing --allow-root in inetd.conf"
# Sending the Root and noop before waiting for the
# "I LOVE YOU" is bogus, but hopefully we can get
# away with it.
- ${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver >${TESTDIR}/pserver.tmp 2>&1 <<EOF
+ dotest pserver-4 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
+"${DOTSTAR} LOVE YOU
+ok" <<EOF
BEGIN AUTH REQUEST
${CVSROOT_DIRNAME}
testme
@@ -19770,11 +20340,11 @@ END AUTH REQUEST
Root ${CVSROOT_DIRNAME}
noop
EOF
- dotest pserver-4 "cat ${TESTDIR}/pserver.tmp" \
-"${DOTSTAR} LOVE YOU
-ok"
- ${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver >${TESTDIR}/pserver.tmp 2>&1 <<EOF
+ dotest pserver-5 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
+"${DOTSTAR} LOVE YOU
+E Protocol error: Root says \"${TESTDIR}/1\" but pserver says \"${CVSROOT_DIRNAME}\"
+error " <<EOF
BEGIN AUTH REQUEST
${CVSROOT_DIRNAME}
testme
@@ -19783,40 +20353,85 @@ END AUTH REQUEST
Root ${TESTDIR}/1
noop
EOF
- dotest pserver-5 "cat ${TESTDIR}/pserver.tmp" \
-"${DOTSTAR} LOVE YOU
-E Protocol error: Root says \"${TESTDIR}/1\" but pserver says \"${CVSROOT_DIRNAME}\"
-error "
- ${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver >${TESTDIR}/pserver.tmp 2>&1 <<EOF
+ dotest_fail pserver-6 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
+"I HATE YOU" <<EOF
BEGIN AUTH REQUEST
${CVSROOT_DIRNAME}
testme
Ay::'d^b?hd
END AUTH REQUEST
EOF
- dotest pserver-6 "cat ${TESTDIR}/pserver.tmp" \
-"I HATE YOU"
- ${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver >${TESTDIR}/pserver.tmp 2>&1 <<EOF
+ dotest_fail pserver-7 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
+"I HATE YOU" <<EOF
BEGIN VERIFICATION REQUEST
${CVSROOT_DIRNAME}
testme
Ay::'d^b?hd
END VERIFICATION REQUEST
EOF
- dotest pserver-7 "cat ${TESTDIR}/pserver.tmp" \
-"I HATE YOU"
- ${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver >${TESTDIR}/pserver.tmp 2>&1 <<EOF
+ dotest pserver-8 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
+"${DOTSTAR} LOVE YOU" <<EOF
BEGIN VERIFICATION REQUEST
${CVSROOT_DIRNAME}
testme
Ay::'d
END VERIFICATION REQUEST
EOF
- dotest pserver-8 "cat ${TESTDIR}/pserver.tmp" \
-"${DOTSTAR} LOVE YOU"
+
+# Tests pserver-9 through pserver-13 are about empty passwords
+
+ # Test empty password (both sides) for aliased user
+ dotest pserver-9 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
+"${DOTSTAR} LOVE YOU" <<EOF
+BEGIN AUTH REQUEST
+${CVSROOT_DIRNAME}
+anonymous
+A
+END AUTH REQUEST
+EOF
+
+ # Test empty password (server side only) for aliased user
+ dotest pserver-10 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
+"${DOTSTAR} LOVE YOU" <<EOF
+BEGIN AUTH REQUEST
+${CVSROOT_DIRNAME}
+anonymous
+Aanythingwouldworkhereittrulydoesnotmatter
+END AUTH REQUEST
+EOF
+
+ # Test empty (both sides) password for non-aliased user
+ dotest pserver-11 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
+"${DOTSTAR} LOVE YOU" <<EOF
+BEGIN AUTH REQUEST
+${CVSROOT_DIRNAME}
+${username}
+A
+END AUTH REQUEST
+EOF
+
+ # Test empty (server side only) password for non-aliased user
+ dotest pserver-12 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
+"${DOTSTAR} LOVE YOU" <<EOF
+BEGIN AUTH REQUEST
+${CVSROOT_DIRNAME}
+${username}
+Anypasswordwouldworkwhynotthisonethen
+END AUTH REQUEST
+EOF
+
+ # Test failure of whitespace password
+ dotest_fail pserver-13 "${testcvs} --allow-root=${CVSROOT_DIRNAME} pserver" \
+"${DOTSTAR} HATE YOU" <<EOF
+BEGIN AUTH REQUEST
+${CVSROOT_DIRNAME}
+willfail
+Amquiteunabletocomeupwithinterestingpasswordsanymore
+END AUTH REQUEST
+EOF
# Clean up.
echo "# comments only" >config
@@ -19835,38 +20450,28 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
server)
# Some tests of the server (independent of the client).
if test "$remote" = yes; then
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-1 "${testcvs} server" \
+"E Protocol error: Root request missing
+error " <<EOF
Directory bogus
mumble/bar
update
EOF
- dotest server-1 "cat ${TESTDIR}/server.tmp" \
-"E Protocol error: Root request missing
-error "
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-1
- fi
# Could also test for relative pathnames here (so that crerepos-6a
# and crerepos-6b can use :fork:).
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-2 "${testcvs} server" "ok" <<EOF
Set OTHER=variable
Set MYENV=env-value
init ${TESTDIR}/crerepos
EOF
- dotest server-2 "cat ${TESTDIR}/server.tmp" "ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-2
- fi
dotest server-3 "test -d ${TESTDIR}/crerepos/CVSROOT" ""
# Now some tests of gzip-file-contents (used by jCVS).
- awk 'BEGIN { \
+ ${AWK} 'BEGIN { \
printf "%c%c%c%c%c%c.6%c%c+I-.%c%c%c%c5%c;%c%c%c%c", \
31, 139, 8, 64, 5, 7, 64, 3, 225, 2, 64, 198, 185, 5, 64, 64, 64}' \
- </dev/null | tr '\100' '\000' >gzipped.dat
+ </dev/null | ${TR} '\100' '\000' >gzipped.dat
# Note that the CVS client sends "-b 1.1.1", and this
# test doesn't. But the server also defaults to that.
cat <<EOF >session.dat
@@ -19887,21 +20492,20 @@ z25
EOF
cat gzipped.dat >>session.dat
echo import >>session.dat
- if ${testcvs} server >${TESTDIR}/server.tmp <session.dat; then
- dotest server-4 "cat ${TESTDIR}/server.tmp" "M N dir1/file1
+ dotest server-4 "${testcvs} server" \
+"M N dir1/file1
M
M No conflicts created by this import
M
-ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-4
- fi
+ok" <session.dat
dotest server-5 \
"${testcvs} -q -d ${TESTDIR}/crerepos co -p dir1/file1" "test"
# OK, here are some notify tests.
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-6 "${testcvs} server" \
+"Notified \./
+${TESTDIR}/crerepos/dir1/file1
+ok" <<EOF
Root ${TESTDIR}/crerepos
Directory .
${TESTDIR}/crerepos/dir1
@@ -19909,18 +20513,16 @@ Notify file1
E Fri May 7 13:21:09 1999 GMT myhost some-work-dir EUC
noop
EOF
- dotest server-6 "cat ${TESTDIR}/server.tmp" \
-"Notified \./
-${TESTDIR}/crerepos/dir1/file1
-ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-6
- fi
# Sending the second "noop" before waiting for the output
# from the first is bogus but hopefully we can get away
# with it.
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-7 "${testcvs} server" \
+"Notified \./
+${TESTDIR}/crerepos/dir1/file1
+ok
+Notified \./
+${TESTDIR}/crerepos/dir1/file1
+ok" <<EOF
Root ${TESTDIR}/crerepos
Directory .
${TESTDIR}/crerepos/dir1
@@ -19931,20 +20533,14 @@ Notify file1
E The 57th day of Discord in the YOLD 3165 myhost some-work-dir EUC
noop
EOF
- dotest server-7 "cat ${TESTDIR}/server.tmp" \
-"Notified \./
-${TESTDIR}/crerepos/dir1/file1
-ok
-Notified \./
-${TESTDIR}/crerepos/dir1/file1
-ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-7
- fi
# OK, now test a few error conditions.
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ # FIXCVS: should give "error" and no "Notified", like server-9
+ dotest server-8 "${testcvs} server" \
+"E ${PROG} server: invalid character in editor value
+Notified \./
+${TESTDIR}/crerepos/dir1/file1
+ok" <<EOF
Root ${TESTDIR}/crerepos
Directory .
${TESTDIR}/crerepos/dir1
@@ -19952,18 +20548,10 @@ Notify file1
E Setting Orange, the 52th day of Discord in the YOLD 3165 myhost some-work-dir EUC
noop
EOF
- # FIXCVS: should give "error" and no "Notified", like server-9
- dotest server-8 "cat ${TESTDIR}/server.tmp" \
-"E ${PROG} server: invalid character in editor value
-Notified \./
-${TESTDIR}/crerepos/dir1/file1
-ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-8
- fi
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-9 "${testcvs} server" \
+"E Protocol error; misformed Notify request
+error " <<EOF
Root ${TESTDIR}/crerepos
Directory .
${TESTDIR}/crerepos/dir1
@@ -19971,64 +20559,43 @@ Notify file1
E Setting Orange+57th day of Discord myhost some-work-dir EUC
noop
EOF
- dotest server-9 "cat ${TESTDIR}/server.tmp" \
-"E Protocol error; misformed Notify request
-error "
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-9
- fi
# First demonstrate an interesting quirk in the protocol.
# The "watchers" request selects the files to operate based
# on files which exist in the working directory. So if we
# don't send "Entry" or the like, it won't do anything.
# Wants to be documented in cvsclient.texi...
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-10 "${testcvs} server" "ok" <<EOF
Root ${TESTDIR}/crerepos
Directory .
${TESTDIR}/crerepos/dir1
watchers
EOF
- dotest server-10 "cat ${TESTDIR}/server.tmp" \
-"ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-10
- fi
-
# See if "watchers" and "editors" display the right thing.
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-11 "${testcvs} server" \
+"M file1 ${username} tedit tunedit tcommit
+ok" <<EOF
Root ${TESTDIR}/crerepos
Directory .
${TESTDIR}/crerepos/dir1
Entry /file1/1.1////
watchers
EOF
- dotest server-11 "cat ${TESTDIR}/server.tmp" \
-"M file1 ${username} tedit tunedit tcommit
-ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-11
- fi
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-12 "${testcvs} server" \
+"M file1 ${username} The 57th day of Discord in the YOLD 3165 myhost some-work-dir
+ok" <<EOF
Root ${TESTDIR}/crerepos
Directory .
${TESTDIR}/crerepos/dir1
Entry /file1/1.1////
editors
EOF
- dotest server-12 "cat ${TESTDIR}/server.tmp" \
-"M file1 ${username} The 57th day of Discord in the YOLD 3165 myhost some-work-dir
-ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-12
- fi
# Now do an unedit.
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-13 "${testcvs} server" \
+"Notified \./
+${TESTDIR}/crerepos/dir1/file1
+ok" <<EOF
Root ${TESTDIR}/crerepos
Directory .
${TESTDIR}/crerepos/dir1
@@ -20036,40 +20603,20 @@ Notify file1
U 7 May 1999 15:00 GMT myhost some-work-dir EUC
noop
EOF
- dotest server-13 "cat ${TESTDIR}/server.tmp" \
-"Notified \./
-${TESTDIR}/crerepos/dir1/file1
-ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-13
- fi
# Now try "watchers" and "editors" again.
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-14 "${testcvs} server" "ok" <<EOF
Root ${TESTDIR}/crerepos
Directory .
${TESTDIR}/crerepos/dir1
watchers
EOF
- dotest server-14 "cat ${TESTDIR}/server.tmp" \
-"ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-14
- fi
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server-15 "${testcvs} server" "ok" <<EOF
Root ${TESTDIR}/crerepos
Directory .
${TESTDIR}/crerepos/dir1
editors
EOF
- dotest server-15 "cat ${TESTDIR}/server.tmp" \
-"ok"
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server-15
- fi
if test "$keep" = yes; then
echo Keeping ${TESTDIR} and exiting due to --keep
@@ -20078,7 +20625,6 @@ EOF
rm -rf ${TESTDIR}/crerepos
rm gzipped.dat session.dat
- rm ${TESTDIR}/server.tmp
fi # skip the whole thing for local
;;
@@ -20086,66 +20632,46 @@ EOF
# More server tests, in particular testing that various
# possible security holes are plugged.
if test "$remote" = yes; then
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server2-1 "${testcvs} server" \
+"E protocol error: directory '${TESTDIR}/cvsroot/\.\./dir1' not within root '${TESTDIR}/cvsroot'
+error " <<EOF
Root ${TESTDIR}/cvsroot
Directory .
${TESTDIR}/cvsroot/../dir1
noop
EOF
- dotest server2-1 "cat ${TESTDIR}/server.tmp" \
-"E protocol error: directory '${TESTDIR}/cvsroot/\.\./dir1' not within root '${TESTDIR}/cvsroot'
-error "
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server2-1
- fi
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server2-2 "${testcvs} server" \
+"E protocol error: directory '${TESTDIR}/cvsrootdir1' not within root '${TESTDIR}/cvsroot'
+error " <<EOF
Root ${TESTDIR}/cvsroot
Directory .
${TESTDIR}/cvsrootdir1
noop
EOF
- dotest server2-2 "cat ${TESTDIR}/server.tmp" \
-"E protocol error: directory '${TESTDIR}/cvsrootdir1' not within root '${TESTDIR}/cvsroot'
-error "
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server2-2
- fi
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest 2-3 "${testcvs} server" \
+"E protocol error: directory '${TESTDIR}' not within root '${TESTDIR}/cvsroot'
+error " <<EOF
Root ${TESTDIR}/cvsroot
Directory .
${TESTDIR}
noop
EOF
- dotest server2-3 "cat ${TESTDIR}/server.tmp" \
-"E protocol error: directory '${TESTDIR}' not within root '${TESTDIR}/cvsroot'
-error "
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server2-3
- fi
# OK, now a few tests for the rule that one cannot pass a
# filename containing a slash to Modified, Is-modified,
# Notify, Questionable, or Unchanged. For completeness
# we'd try them all. For lazyness/conciseness we don't.
- if ${testcvs} server >${TESTDIR}/server.tmp <<EOF; then
+ dotest server2-4 "${testcvs} server" \
+"E protocol error: directory 'foo/bar' not within current directory
+error " <<EOF
Root ${TESTDIR}/cvsroot
Directory .
${TESTDIR}/cvsroot
Unchanged foo/bar
noop
EOF
- dotest server2-4 "cat ${TESTDIR}/server.tmp" \
-"E protocol error: directory 'foo/bar' not within current directory
-error "
- else
- echo "exit status was $?" >>${LOGFILE}
- fail server2-4
- fi
fi
;;
@@ -20175,7 +20701,7 @@ EOF
CVS_SERVER=${TESTDIR}/serveme; export CVS_SERVER
mkdir 1; cd 1
dotest_fail client-1 "${testcvs} -q co first-dir" \
-"${PROG} \[checkout aborted\]: This server does not support the global -q option\."
+"${PROG} \[checkout aborted\]: This server does not support the global -q option${DOTSTAR}"
dotest client-2 "${testcvs} co first-dir" "special message"
cat >${TESTDIR}/serveme <<EOF
@@ -20197,8 +20723,10 @@ cat >/dev/null
EOF
cd first-dir
mkdir ${TESTDIR}/bogus
+ # The ${DOTSTAR} is to match a potential "broken pipe" if the
+ # client exits before the server script sends everything
dotest_fail client-3 "${testcvs} update" "merge-it
-${PROG} \[update aborted\]: protocol error: Copy-file tried to specify directory"
+${PROG} \[update aborted\]: protocol error: Copy-file tried to specify director${DOTSTAR}"
cat >${TESTDIR}/serveme <<EOF
#!${TESTSHELL}
echo "Valid-requests Root Valid-responses valid-requests Directory Entry Modified Unchanged Argument Argumentx ci co update"
diff --git a/contrib/cvs/src/subr.c b/contrib/cvs/src/subr.c
index 6a97f28..c9f3747 100644
--- a/contrib/cvs/src/subr.c
+++ b/contrib/cvs/src/subr.c
@@ -171,7 +171,8 @@ pathname_levels (path)
if (-level > max_level)
max_level = -level;
}
- else if (p[0] == '.' && (p[1] == '\0' || p[1] == '/'))
+ else if (p[0] == '\0' || p[0] == '/' ||
+ (p[0] == '.' && (p[1] == '\0' || p[1] == '/')))
;
else
++level;
@@ -218,9 +219,7 @@ line2argv (pargc, argv, line, sepchars)
int argv_allocated;
/* Small for testing. */
- /* argv_allocated must be at least 3 because at some places
- (e.g. checkout_proc) cvs alters argv[2]. */
- argv_allocated = 4;
+ argv_allocated = 1;
*argv = (char **) xmalloc (argv_allocated * sizeof (**argv));
*pargc = 0;
@@ -586,7 +585,9 @@ file_has_markers (finfo)
error (1, errno, "cannot open %s", finfo->fullname);
while (getline (&line, &line_allocated, fp) > 0)
{
- if (strncmp (line, RCS_MERGE_PAT, sizeof RCS_MERGE_PAT - 1) == 0)
+ if (strncmp (line, RCS_MERGE_PAT_1, sizeof RCS_MERGE_PAT_1 - 1) == 0 ||
+ strncmp (line, RCS_MERGE_PAT_2, sizeof RCS_MERGE_PAT_2 - 1) == 0 ||
+ strncmp (line, RCS_MERGE_PAT_3, sizeof RCS_MERGE_PAT_3 - 1) == 0)
{
result = 1;
goto out;
@@ -647,9 +648,9 @@ get_file (name, fullname, mode, buf, bufsize, len)
e = open_file (name, mode);
}
- if (*bufsize < filesize)
+ if (*buf == NULL || *bufsize <= filesize)
{
- *bufsize = filesize;
+ *bufsize = filesize + 1;
*buf = xrealloc (*buf, *bufsize);
}
@@ -691,12 +692,9 @@ get_file (name, fullname, mode, buf, bufsize, len)
*len = nread;
/* Force *BUF to be large enough to hold a null terminator. */
- if (*buf != NULL)
- {
- if (nread == *bufsize)
- expand_string (buf, bufsize, *bufsize + 1);
- (*buf)[nread] = '\0';
- }
+ if (nread == *bufsize)
+ expand_string (buf, bufsize, *bufsize + 1);
+ (*buf)[nread] = '\0';
}
@@ -744,3 +742,37 @@ resolve_symlink (filename)
}
}
}
+
+/*
+ * Rename a file to an appropriate backup name based on BAKPREFIX.
+ * If suffix non-null, then ".<suffix>" is appended to the new name.
+ *
+ * Returns the new name, which caller may free() if desired.
+ */
+char *
+backup_file (filename, suffix)
+ const char *filename;
+ const char *suffix;
+{
+ char *backup_name;
+
+ if (suffix == NULL)
+ {
+ backup_name = xmalloc (sizeof (BAKPREFIX) + strlen (filename) + 1);
+ sprintf (backup_name, "%s%s", BAKPREFIX, filename);
+ }
+ else
+ {
+ backup_name = xmalloc (sizeof (BAKPREFIX)
+ + strlen (filename)
+ + strlen (suffix)
+ + 2); /* one for dot, one for trailing '\0' */
+ sprintf (backup_name, "%s%s.%s", BAKPREFIX, filename, suffix);
+ }
+
+ if (isfile (filename))
+ copy_file (filename, backup_name);
+
+ return backup_name;
+}
+
diff --git a/contrib/cvs/src/tag.c b/contrib/cvs/src/tag.c
index fb19cba..a9d8534 100644
--- a/contrib/cvs/src/tag.c
+++ b/contrib/cvs/src/tag.c
@@ -234,9 +234,12 @@ check_fileproc (callerdat, finfo)
if ((status != T_UPTODATE) && (status != T_CHECKOUT))
{
error (0, 0, "%s is locally modified", finfo->fullname);
+ freevers_ts (&vers);
return (1);
}
}
+ else
+ vers = Version_TS (finfo, NULL, NULL, NULL, 0, 0);
if (finfo->update_dir[0] == '\0')
xdir = ".";
@@ -266,11 +269,12 @@ check_fileproc (callerdat, finfo)
p->key = xstrdup (finfo->file);
p->type = UPDATE;
p->delproc = tag_delproc;
- vers = Version_TS (finfo, NULL, NULL, NULL, 0, 0);
if (vers->srcfile == NULL)
{
if (!really_quiet)
error (0, 0, "nothing known about %s", finfo->file);
+ freevers_ts (&vers);
+ freenode (p);
return (1);
}
@@ -579,6 +583,8 @@ tag_fileproc (callerdat, finfo)
if (strcmp (version, oversion) == 0 && !branch_mode && !isbranch)
{
free (oversion);
+ if (branch_mode)
+ free (rev);
freevers_ts (&vers);
return (0);
}
@@ -600,6 +606,8 @@ tag_fileproc (callerdat, finfo)
cvs_output (rev, 0);
cvs_output ("\n", 1);
free (oversion);
+ if (branch_mode)
+ free (rev);
freevers_ts (&vers);
return (0);
}
@@ -611,9 +619,13 @@ tag_fileproc (callerdat, finfo)
error (1, retcode == -1 ? errno : 0,
"failed to set tag %s to revision %s in %s",
symtag, rev, vers->srcfile->path);
+ if (branch_mode)
+ free (rev);
freevers_ts (&vers);
return (1);
}
+ if (branch_mode)
+ free (rev);
RCS_rewrite (vers->srcfile, NULL, NULL);
/* more warm fuzzies */
@@ -718,7 +730,7 @@ val_direntproc (callerdat, dir, repository, update_dir, entries)
files in a directory which does not exist yet, but which is
about to be created. */
if (isdir (dir))
- return 0;
+ return R_PROCESS;
return R_SKIP_ALL;
}
diff --git a/contrib/cvs/src/vers_ts.c b/contrib/cvs/src/vers_ts.c
index e1ba32d..8d55284 100644
--- a/contrib/cvs/src/vers_ts.c
+++ b/contrib/cvs/src/vers_ts.c
@@ -87,22 +87,17 @@ Version_TS (finfo, options, tag, date, force_tag_match, set_time)
vers_ts->vn_user = xstrdup (entdata->version);
vers_ts->ts_rcs = xstrdup (entdata->timestamp);
vers_ts->ts_conflict = xstrdup (entdata->conflict);
- if (!tag)
+ if (!(tag || date) && !(sdtp && sdtp->aflag))
{
- if (!(sdtp && sdtp->aflag))
- vers_ts->tag = xstrdup (entdata->tag);
- }
- if (!date)
- {
- if (!(sdtp && sdtp->aflag))
- vers_ts->date = xstrdup (entdata->date);
+ vers_ts->tag = xstrdup (entdata->tag);
+ vers_ts->date = xstrdup (entdata->date);
}
vers_ts->entdata = entdata;
}
/* Even if we don't have an "entries line" as such
(vers_ts->entdata), we want to pick up options which could
have been from a Kopt protocol request. */
- if (!options || (options && *options == '\0'))
+ if (!options || *options == '\0')
{
if (!(sdtp && sdtp->aflag))
vers_ts->options = xstrdup (entdata->options);
@@ -126,6 +121,8 @@ Version_TS (finfo, options, tag, date, force_tag_match, set_time)
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);
diff --git a/contrib/cvs/src/version.c b/contrib/cvs/src/version.c
index 97622ff..c8273fb 100644
--- a/contrib/cvs/src/version.c
+++ b/contrib/cvs/src/version.c
@@ -12,7 +12,7 @@
#include "cvs.h"
-char *version_string = "\nConcurrent Versions System (CVS) 1.10.7";
+char *version_string = "Concurrent Versions System (CVS) 1.11";
#ifdef CLIENT_SUPPORT
#ifdef SERVER_SUPPORT
@@ -27,3 +27,49 @@ char *config_string = " (server)\n";
char *config_string = "\n";
#endif
#endif
+
+static const char *const version_usage[] =
+{
+ "Usage: %s %s\n",
+ NULL
+};
+
+int
+version (argc, argv)
+ int argc;
+ char **argv;
+{
+ int err = 0;
+
+ if (argc == -1)
+ usage (version_usage);
+
+#ifdef CLIENT_SUPPORT
+ if (client_active)
+ (void) fputs ("Client: ", stdout);
+#endif
+
+ /* Having the year here is a good idea, so people have
+ some idea of how long ago their version of CVS was
+ released. */
+ (void) fputs (version_string, stdout);
+ (void) fputs (config_string, stdout);
+
+#ifdef CLIENT_SUPPORT
+ if (client_active)
+ {
+ (void) fputs ("Server: ", stdout);
+ start_server ();
+ if (supported_request ("version"))
+ send_to_server ("version\012", 0);
+ else
+ {
+ send_to_server ("noop\012", 0);
+ fputs ("(unknown)\n", stdout);
+ }
+ err = get_responses_and_close ();
+ }
+#endif
+ return err;
+}
+
diff --git a/contrib/cvs/src/watch.c b/contrib/cvs/src/watch.c
index b2935ac..1a0ecfe 100644
--- a/contrib/cvs/src/watch.c
+++ b/contrib/cvs/src/watch.c
@@ -473,6 +473,7 @@ watchers_fileproc (callerdat, finfo)
cvs_output ("\n", 1);
}
out:;
+ free (them);
return 0;
}
diff --git a/contrib/cvs/src/zlib.c b/contrib/cvs/src/zlib.c
index fa0c2ad..3bfc542 100644
--- a/contrib/cvs/src/zlib.c
+++ b/contrib/cvs/src/zlib.c
@@ -467,9 +467,9 @@ gunzip_and_write (fd, fullname, buf, size)
if (buf[3] & 4)
pos += buf[pos] + (buf[pos + 1] << 8) + 2;
if (buf[3] & 8)
- pos += strlen (buf + pos) + 1;
+ pos += strlen ((char *) buf + pos) + 1;
if (buf[3] & 16)
- pos += strlen (buf + pos) + 1;
+ pos += strlen ((char *) buf + pos) + 1;
if (buf[3] & 2)
pos += 2;
OpenPOWER on IntegriCloud