summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/cvs/src
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1997-06-28 03:27:49 +0000
committertholo <tholo@openbsd.org>1997-06-28 03:27:49 +0000
commit2770ece558b09db842a03eacdf247234131b8970 (patch)
tree638bd9289d8d76224241fe8eb872ee2ed0bbbbdd /gnu/usr.bin/cvs/src
parentIt was in the fucking wrapper, too! (diff)
downloadwireguard-openbsd-2770ece558b09db842a03eacdf247234131b8970.tar.xz
wireguard-openbsd-2770ece558b09db842a03eacdf247234131b8970.zip
Latest version from Cyclic Software
Diffstat (limited to 'gnu/usr.bin/cvs/src')
-rw-r--r--gnu/usr.bin/cvs/src/ChangeLog423
-rw-r--r--gnu/usr.bin/cvs/src/add.c6
-rw-r--r--gnu/usr.bin/cvs/src/admin.c2
-rw-r--r--gnu/usr.bin/cvs/src/buffer.c2
-rw-r--r--gnu/usr.bin/cvs/src/checkin.c2
-rw-r--r--gnu/usr.bin/cvs/src/client.c414
-rw-r--r--gnu/usr.bin/cvs/src/client.h2
-rw-r--r--gnu/usr.bin/cvs/src/cvsbug.sh12
-rw-r--r--gnu/usr.bin/cvs/src/cvsrc.c58
-rw-r--r--gnu/usr.bin/cvs/src/diff.c26
-rw-r--r--gnu/usr.bin/cvs/src/edit.c40
-rw-r--r--gnu/usr.bin/cvs/src/entries.c26
-rw-r--r--gnu/usr.bin/cvs/src/filesubr.c55
-rw-r--r--gnu/usr.bin/cvs/src/find_names.c4
-rw-r--r--gnu/usr.bin/cvs/src/hash.c16
-rw-r--r--gnu/usr.bin/cvs/src/history.c8
-rw-r--r--gnu/usr.bin/cvs/src/import.c150
-rw-r--r--gnu/usr.bin/cvs/src/log.c2
-rw-r--r--gnu/usr.bin/cvs/src/login.c28
-rw-r--r--gnu/usr.bin/cvs/src/logmsg.c2
-rw-r--r--gnu/usr.bin/cvs/src/mkmodules.c26
-rw-r--r--gnu/usr.bin/cvs/src/modules.c39
-rw-r--r--gnu/usr.bin/cvs/src/parseinfo.c7
-rw-r--r--gnu/usr.bin/cvs/src/rcs.h6
-rw-r--r--gnu/usr.bin/cvs/src/recurse.c22
-rw-r--r--gnu/usr.bin/cvs/src/release.c2
-rw-r--r--gnu/usr.bin/cvs/src/remove.c2
-rw-r--r--gnu/usr.bin/cvs/src/root.c80
-rw-r--r--gnu/usr.bin/cvs/src/rtag.c2
-rw-r--r--gnu/usr.bin/cvs/src/run.c12
-rw-r--r--gnu/usr.bin/cvs/src/sanity.sh1961
-rw-r--r--gnu/usr.bin/cvs/src/server.h26
-rw-r--r--gnu/usr.bin/cvs/src/status.c2
-rw-r--r--gnu/usr.bin/cvs/src/subr.c82
-rw-r--r--gnu/usr.bin/cvs/src/tag.c2
-rw-r--r--gnu/usr.bin/cvs/src/vers_ts.c25
-rw-r--r--gnu/usr.bin/cvs/src/version.c2
-rw-r--r--gnu/usr.bin/cvs/src/watch.c21
-rw-r--r--gnu/usr.bin/cvs/src/wrapper.c6
39 files changed, 2627 insertions, 976 deletions
diff --git a/gnu/usr.bin/cvs/src/ChangeLog b/gnu/usr.bin/cvs/src/ChangeLog
index 6fe1e91c768..0c8b0f60930 100644
--- a/gnu/usr.bin/cvs/src/ChangeLog
+++ b/gnu/usr.bin/cvs/src/ChangeLog
@@ -1,5 +1,428 @@
+Tue Jun 17 22:48:00 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * main.c (main): Add --allow-root=ROOT argument; call
+ root_allow_add for each time it is specified. Call
+ root_allow_free before exiting.
+ * root.c, cvs.h (root_allow_add, root_allow_free, root_allow_ok):
+ New function.
+ * server.c (pserver_authenticate_connection): If root_allow_ok
+ doesn't like the CVSROOT directory, don't allow access.
+
+Tue Jun 17 14:30:14 1997 Jim Kingdon (unknown@beezley)
+
+ * client.c: Add "copyright" notice. If NO_EXT_METHOD, omit
+ start_rsh_method.
+ * client.c (update_entries): Cast argument to MD5Update from
+ char * to unsigned char *.
+
+Mon Jun 16 16:46:28 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * run.c (piped_child, filter_stream_through_program):
+ If USE_SETMODE_BINARY, then put the pipes into binary mode.
+ * find_names.c, ignore.c, lock.c, wrapper.c: Change fnmatch to
+ CVS_FNMATCH.
+ * client.c (start_server): If NO_EXT_METHOD, then give a fatal
+ error on any use of :ext:.
+
+Sun Jun 15 22:30:27 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (toplevel): Match U CVSROOT/* lines with DOTSTAR in
+ test toplevel-9.
+
+Thu Jun 12 10:27:51 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (toplevel): Remove Emptydir before starting.
+
+ * sanity.sh: Change "rm -rf" to "rm -r" when deleting working
+ directories (except a few watches cases). Helps detect cases
+ where the testsuite has cd'd to somewhere other than where we
+ think it has.
+ (basic2): Remove "rm -r first-dir" between tests 49 and 50. The
+ directory was already deleted in test 45.5.
+ (rcs): Add "cd .." at end of tests.
+ (stamps): No longer cd to TESTDIR; shouldn't be necessary with
+ fix to "rcs" test.
+
+Wed Jun 11 22:28:38 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (basicb): Also remove CVSROOT/Emptydir at end of
+ test. Otherwise it affects the toplevel-9 test for remote.
+
+Tue Jun 10 14:03:32 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (toplevel): Change "update" and "checkout" to "[a-z]*"
+ as these read "server" instead for "make remotecheck". Change
+ expect strings for toplevel-9 to accept the behavior of remote CVS
+ (see comments for more discussion).
+
+ * sanity.sh: New tests stamps-9 through stamps-11 test timestamp
+ behavior on cvs update.
+
+Mon Jun 9 22:42:50 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh: Remove "#! /bin/zsh" line at end. I assume it was
+ added accidentally.
+
+Tue Jun 10 03:08:46 1997 Norbert Kiesel <nk@psycho.de>
+
+ * sanity.sh: new tests "toplevel" for the new toplevel CVS
+ directory creation (including one test which shows an error in
+ this area).
+
+Sun Jun 8 20:52:00 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * rcs.c (getrcsrev): Before printing error, check whether it was
+ feof or ferror.
+
+ * rcs.h, import.c (add_rcs_file): No longer static. New arguments
+ add_vbranch, add_vhead, and add_logfp replace access to static
+ variables vbranch, vhead, and logfp.
+ * mkmodules.c: Call it instead of RCS_CI.
+ * import.c (process_import_file): Adjust call to add_rcs_file.
+
+Tue Jun 3 10:18:33 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (basicb): Match "." with "\." not ".".
+
+Tue Jun 3 13:02:37 1997 Norbert Kiesel <nk@cosa.de>
+
+ * checkout.c (checkout): Removed restriction of not sending -k in
+ remote export (I think this was introduced while the -k handling
+ was still broken in remote mode). Give better error texts
+ regarding -c and -s options. Use error() instead of usage() for
+ reporting errors in all places. Reindented some lines. Free
+ xmalloc'd space of options.
+
+Thu May 29 16:32:47 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * rcscmds.c (RCS_checkin), mkmodules.c (init): Pass -w option to
+ "ci", specifying getcaller ().
+ * server.h, server.c (CVS_Username): Now extern.
+ * subr.c (getcaller): Return CVS_Username if it is set.
+
+Wed May 28 22:31:38 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * update.c (update_fileproc): If wrap_merge_is_copy and we would
+ like to do a merge, give a fatal error. See comment for why.
+ * sanity.sh (mwrap): New tests, tests for above fix.
+
+Tue May 27 21:59:32 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (stamps): cd to ${TESTDIR} before starting.
+
+Mon May 26 15:31:30 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * client.c (handle_mod_time): New function.
+ (responses): Add "Mod-time".
+ (stored_modtime_valid, stored_modtime): New variables.
+ (update_entries): If it is set, change the file's modtime.
+ * server.c, server.h (server_modtime): New function.
+ * vers_ts.c (Version_TS): Call it.
+ * patch.c (patch_fileproc): Add comment about why we don't.
+ * sanity.sh (stamps): Added, tests for above fix.
+
+Fri May 16 13:14:30 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * subr.c (free_names): Update documentation to reflect fact that
+ free_names is now called to free vectors allocated by expand_wild
+ as well as by line2argv.
+
+ * main.c (main): Use "xstrdup (foo)" not "xstrdup(foo)" as
+ specified in HACKING.
+
+Fri May 16 15:10:37 1997 Norbert Kiesel <nk@cosa.de>
+
+ * modules.c (do_module): initialize optind to 0. use local copies
+ of optarg's (because they might me freed within free_names).
+
+Thu May 15 11:50:15 1997 Norbert Kiesel <nk@cosa.de>
+
+ * main.c (main): initialize optind to 0. use local copies of
+ optarg's (because they might me freed within read_cvsrc).
+
+ * cvsrc.c (read_cvsrc): free old argv after constructing a new
+ one. This fixes a memory leak.
+
+ * recurse.c (start_recursion): use free_names() instead of
+ reimplementing it
+
+ * rcs.c (RCS_deltas): free branchversion (memory leak).
+
+ * parseinfo.c (Parse_Info): free some vars (3 memory leaks).
+
+ * logmsg.c (logfile_write): free str_list_format (memory leak).
+
+ * watch.c (watch_addremove), (watchers), update.c (update), tag.c
+ (cvstag), status.c (status), rtag.c (rtag), remove.c (cvsremove),
+ release.c (release), patch.c (patch), log.c (cvslog), import.c
+ (import), history.c (history), edit.c (watch_onoff), (edit),
+ (unedit), (editors), diff.c (diff), commit.c (commit), checkout.c
+ (checkout), add.c (add): initialize optind to 0
+
+ * diff.c (diff_fileproc): cosmetic change (whitespace added).
+
+ * checkout.c (checkout): move local variable definition into the
+ block where the variable is used.
+
+ * client.c (update_entries): initialize some local variables to shut up
+ gcc -O -Wall.
+
+ * buffer.c (buf_read_line): initialize a local variable to shut up
+ gcc -O -Wall.
+
+
+Wed May 14 16:29:50 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * admin.c (admin): When sending options to server, don't try to
+ send av[ac]. It may contain one of the names that we'll send in
+ send_file_names (which caused tests like keyword-6 to work,
+ sort of accidentally), or it may contain NULL (which would tend to
+ cause a coredump).
+ * sanity.sh (basicb): New test basicb-21 tests for above fix.
+
+Mon May 12 16:22:00 1997 Larry Jones <larry.jones@sdrc.com>
+
+ * add.c (add): Free message and repository in client code.
+ * checkout.c (checkout): Don't free repository unless allocated.
+ * client.c (start_rsh_server): Free command.
+
+Sun May 11 11:43:54 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * client.c: Remove all references to USE_DIRECT_TCP; see
+ ../ChangeLog for rationale.
+
+Fri May 9 22:19:36 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * main.c (main): Add comment explaining why we call exit. Pass 0
+ not EXIT_SUCCESS, because lib/system.h has portability cruft for
+ EXIT_FAILURE but not EXIT_SUCCESS.
+
+Fri May 9 17:25:00 1997 Larry Jones <larry.jones@sdrc.com>
+
+ Fix miscellaneous memory allocation problems:
+ * add.c (add): Free repository.
+ * client.c (notified_a_file): Free getline buffer.
+ * edit.c (notify_check): Free getline buffer.
+ * hash.c (dellist): Free header node when not caching.
+ * login.c (login): Don't continually free & allocate getline
+ buffer, use xstrdup instead of xmalloc/strcpy, free getline
+ buffer before returning.
+ * main.c (main): Call exit instead of returning so tools like
+ Purify won't consider permanently allocated memory as leaks.
+ * mkmodules.c (mkmodules): Free getline buffer.
+ * modules.c (cat_module): Call close_module.
+ * rcs.c (rcsvers_delproc): Free state.
+ * recurse.c (start_recursion): Free files_by_dir.
+ (unroll_files_proc): NULL out p->data after using it to set
+ filelist to avoid multiple frees.
+ * server.c (check_command_legal_p): Don't continually free &
+ allocate getline buffer, free getline buffer before returning.
+ (check_repository_password): Ditto, use xstrdup instead of
+ xmalloc/strcpy.
+ * wrapper.c (wrap_add_file): Free getline buffer.
+
+Thu May 8 14:21:00 1997 Larry Jones <larry.jones@sdrc.com>
+ and Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * checkout.c (checkout_proc): Free finfo.rcs (memory leak).
+
+8 May 1997 Larry Jones <larry.jones@sdrc.com>
+ and Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * hash.c: Add #ifdef's to disable caching. This makes it easier
+ to track down memory allocation problems.
+
+Thu May 8 11:40:39 1997 Larry Jones <larry.jones@sdrc.com>
+
+ * sanity.sh: In setting "tests" use a number of statements rather
+ than one very long line.
+
+Thu May 8 11:40:39 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvsbug.sh: Remove $Id; we decided to get rid of these some time
+ ago.
+
+Thu May 8 11:34:02 1997 Larry Jones <larry.jones@sdrc.com>
+
+ * cvsbug.sh: Put separate statements on separate lines, so it
+ works if awk is AT&T nawk.
+
+Tue May 6 16:56:00 1997 Larry Jones <larry.jones@sdrc.com>
+ and Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * cvsrc.c (read_cvsrc): Fix various memory allocation problems:
+ rearrange code to avoid leaks, use xrealloc instead of xmalloc/
+ copy/free, make sure there's room for the remaining args before
+ appending them.
+
+Tue May 6 14:20:00 1997 Larry Jones <larry.jones@sdrc.com>
+
+ * edit.c (watch_onoff, edit, unedit, editors): Add -R like
+ other things with -l.
+ * watch.c (watch_addremove, watchers): Ditto.
+
+Mon May 5 18:10:37 1997 larry.jones@sdrc.com
+ and Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh: Change all /tmp/cvs-sanity to TESTDIR. If TESTDIR
+ environment variable is set, use it instead of /tmp/cvs-sanity.
+ * sanity.sh: Make TMPPWD the pwd equivalent of TESTDIR, not of /tmp.
+
+4 May 1997 Larry jones <larry.jones@sdrc.com>
+ and Jim Kingdon
+
+ * checkout.c, diff.c, patch.c, rcs.c: Update usage messages.
+ * rcs.c (annotate): Add -R like other things with -l.
+
+Sat May 3 14:57:40 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (basic1): Rewrite test (use dotest, unroll the loops
+ which IMHO makes the test a zillion times more understandable, and
+ only do the variant which tests for 4 files at a time--we test one
+ file at a time lots of places).
+
+2 May 1997 Ziv Gigus <ziv@rest.home.net>
+ and Jim Kingdon
+
+ * client.c, client.h (client_process_import_file): New argument
+ all_files_binary means treat all files as binary.
+ * import.c (import_descend): Pass it if -kb is specified.
+ * client.c (client_process_import_file): In the
+ non-all_files_binary case, call wrap_rcsoption to determine
+ whether the file is binary.
+
+Thu May 1 13:44:51 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * sanity.sh (binfiles2): New tests, for update -j and binary files.
+
+Wed Apr 30 11:18:36 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * recurse.c (start_recursion): Also free reposfile.
+ Don't look in repository if client_active (latter bug reported by Paul
+ Sanders <p.sanders@dial.pipex.com>).
+
+Mon Apr 28 22:36:39 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * diff.c (diff_file_nodiff): Remove SERVER_SUPPORT ifdefs. They
+ were not based on server_active, which doesn't really make any
+ sense (it meant that compiling --disable-server could affect the
+ behavior of the non-client/server CVS). This affected the output
+ in tests death2-diff-11 and death2-diff-12 in the testsuite.
+ * sanity.sh (newb-123j0): Also accept "Needs Checkout", for a
+ --disable-server CVS.
+
+ * main.c (cmd_usage): Change "run diffs" to "show differences";
+ the former is jargon.
+ * edit.c (edit_usage): Fix typo ("." -> ",").
+ * edit.c (editors_usage), watch.c (watchers_usage): Mention -l.
+ * checkout.c (export_usage): Say what -P does.
+ * history.c (history_usg): Add comment about message wording.
+
+Mon Apr 28 14:47:45 1997 Norbert Kiesel <nk@cosa.de>
+
+ * checkin.c (Checkin): use filename without path when calling
+ wrapper (bug found by Michal Schmitz <ms@cosa.de>).
+
+Fri Apr 25 13:28:55 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * client.c (update_entries): In UPDATE_ENTRIES_RCS_DIFF case,
+ write to a temporary file and then rename it.
+
+Thu Apr 24 11:35:40 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * subr.c, cvs.h (pathname_levels): New function, from a piece of
+ send_file_names.
+ * client.c (send_file_names): Call pathname_levels in place of the
+ code which was moved there.
+ * server.c, server.h (server_pathname_check): New function.
+ * recurse.c (start_recursion): Call it.
+ * sanity.sh (modules3): New test modules3-11b tests for above fix.
+
+ * filesubr.c: Do not define L_tmpnam. It is in ANSI and SunOS4,
+ so I don't think there will be a problem with it being missing.
+ Defining it too small can cause memory corruption.
+ (cvs_temp_name): Do not use L_tmpnam in the mktemp code; this
+ could cause a buffer overflow if the -T global option was in use.
+
+Thu Apr 24 13:21:15 1997 Norbert Kiesel <nk@cosa.de>
+
+ * filesubr.c (cvs_temp_name): Use tempnam if available, else
+ mktemp, else tmpnam. See the comment for rationale.
+
+ * sanity.sh: use "tar cf - ." instead of "tar cf - *" for
+ directory copies.
+
+Wed Apr 23 23:41:47 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * server.c (serve_update_prog): If in readonly mode, give an error.
+
+Wed Apr 23 19:07:41 1997 Norbert Kiesel <nk@cosa.de>
+
+ * subr.c (line2argv): Allocate at least 4 slots for argv.
+
+ * checkout.c (checkout_proc): Add a comment which says why the
+ above change was necessary to avoid writing to unallocated memory.
+
+Wed Apr 23 11:20:40 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * entries.c (ParseTag): Always set *NONBRANCHP.
+
+21 Apr 1997 Jim Kingdon
+
+ * client.c (update_entries), rcs.c (expand_keywords): Rewrite
+ test to avoid signed/unsigned warning.
+
+Mon Apr 21 09:02:22 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * update.c (patch_file): Add comment about whether auto-detecting
+ features of the DIFF program is a good idea.
+
+Mon Apr 21 00:03:34 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ Don't require the patch program:
+ * client.c (struct update_entries_data): Add
+ UPDATE_ENTRIES_RCS_DIFF to contents enum.
+ (update_entries): Handle UPDATE_ENTRIES_RCS_DIFF.
+ (handle_rcs_diff): New static function.
+ (responses): Add "Rcs-diff".
+ * server.c (server_updated): Handle SERVER_RCS_DIFF.
+ (server_use_rcs_diff): New function.
+ * server.h (enum server_updated_arg4): Add SERVER_RCS_DIFF.
+ (server_use_rcs_diff): Declare.
+ * update.c (rcs_diff_patches): New static variable.
+ (update): Set rcs_diff_patches.
+ (update_fileproc): If rcs_diff_patches, pass SERVER_RCS_DIFF
+ rather than SERVER_PATCHED to server_updated.
+ (patch_file): Correct initial comment to say diff rather than
+ rcsdiff. If rcs_diff_options, pass -n to diff rather than -c.
+ * rcs.c (rcs_change_text): New function.
+ * rcs.h (rcs_change_text): Declare.
+
+Mon Apr 21 00:08:59 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * diff.c (diff_fileproc): Add comment concerning updating the
+ client timestamp.
+
+Sun Apr 20 23:20:37 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * commit.c (commit): Add comment regarding SEND_FORCE rationale.
+
+Sat Apr 19 17:10:36 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * server.c (dirswitch): If directory ends in '/', complain.
+
+Fri Apr 18 18:09:57 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * rcs.c (apply_rcs_changes): New static function, broken out of
+ RCS_deltas.
+ (RCS_deltas): Call it.
+ (linevector_add): Change return type to int. Return an indication
+ of an error for an invalid add, rather than calling error.
+
Fri Apr 18 11:24:26 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+ * version.c: Change version number to 1.9.9.
+
* version.c: Version 1.9.8.
* commit.c (struct find_data): Add field force.
diff --git a/gnu/usr.bin/cvs/src/add.c b/gnu/usr.bin/cvs/src/add.c
index 8bba5bb62a1..92209306b56 100644
--- a/gnu/usr.bin/cvs/src/add.c
+++ b/gnu/usr.bin/cvs/src/add.c
@@ -102,7 +102,7 @@ add (argc, argv)
wrap_setup ();
/* parse args */
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+k:m:")) != -1)
{
switch (c)
@@ -183,6 +183,9 @@ add (argc, argv)
/* FIXME: should be able to pass SEND_NO_CONTENTS, I think. */
send_files (argc, argv, 0, 0, SEND_BUILD_DIRS);
send_to_server ("add\012", 0);
+ if (message)
+ free (message);
+ free (repository);
return get_responses_and_close ();
}
#endif
@@ -449,6 +452,7 @@ cannot resurrect %s; RCS file removed by second party", user);
if (message)
free (message);
+ free (repository);
return (err);
}
diff --git a/gnu/usr.bin/cvs/src/admin.c b/gnu/usr.bin/cvs/src/admin.c
index dd187801dfa..d1401f4c0cc 100644
--- a/gnu/usr.bin/cvs/src/admin.c
+++ b/gnu/usr.bin/cvs/src/admin.c
@@ -89,7 +89,7 @@ admin (argc, argv)
ign_setup ();
- for (i = 0; i <= ac; ++i) /* XXX send -ko too with i = 0 */
+ for (i = 0; i < ac; ++i) /* XXX send -ko too with i = 0 */
send_arg (av[i]);
send_file_names (argc, argv, SEND_EXPAND_WILD);
diff --git a/gnu/usr.bin/cvs/src/buffer.c b/gnu/usr.bin/cvs/src/buffer.c
index 8baa021fbb9..d6ea895f5e0 100644
--- a/gnu/usr.bin/cvs/src/buffer.c
+++ b/gnu/usr.bin/cvs/src/buffer.c
@@ -717,7 +717,7 @@ buf_read_line (buf, line, lenp)
while (1)
{
- int len, finallen;
+ int len, finallen = 0;
struct buffer_data *data;
char *nl;
diff --git a/gnu/usr.bin/cvs/src/checkin.c b/gnu/usr.bin/cvs/src/checkin.c
index 3c6a3b2cd98..0da220c6f03 100644
--- a/gnu/usr.bin/cvs/src/checkin.c
+++ b/gnu/usr.bin/cvs/src/checkin.c
@@ -51,7 +51,7 @@ Checkin (type, finfo, rcs, rev, tag, options, message)
* for the checkin and checkout.
*/
- tocvsPath = wrap_tocvs_process_file (finfo->fullname);
+ tocvsPath = wrap_tocvs_process_file (finfo->file);
if (!noexec)
{
diff --git a/gnu/usr.bin/cvs/src/client.c b/gnu/usr.bin/cvs/src/client.c
index 2f6b8c673bb..a1ed876c755 100644
--- a/gnu/usr.bin/cvs/src/client.c
+++ b/gnu/usr.bin/cvs/src/client.c
@@ -1,4 +1,14 @@
-/* CVS client-related stuff. */
+/* CVS client-related stuff.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details. */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -14,7 +24,7 @@
#include "md5.h"
-#if defined(AUTH_CLIENT_SUPPORT) || HAVE_KERBEROS || USE_DIRECT_TCP || defined(SOCK_ERRNO) || defined(SOCK_STRERROR)
+#if defined(AUTH_CLIENT_SUPPORT) || HAVE_KERBEROS || defined(SOCK_ERRNO) || defined(SOCK_STRERROR)
# ifdef HAVE_WINSOCK_H
# include <winsock.h>
# else /* No winsock.h */
@@ -22,8 +32,7 @@
# include <netinet/in.h>
# include <netdb.h>
# endif /* No winsock.h */
-#endif /* defined(AUTH_CLIENT_SUPPORT) || HAVE_KERBEROS || USE_DIRECT_TCP
- || defined(SOCK_ERRNO) || defined(SOCK_STRERROR) */
+#endif
/* If SOCK_ERRNO is defined, then send()/recv() and other socket calls
do not set errno, but that this macro should be used to obtain an
@@ -48,7 +57,7 @@ extern char *strerror ();
# endif
#endif /* ! SOCK_STRERROR */
-#if HAVE_KERBEROS || USE_DIRECT_TCP
+#if HAVE_KERBEROS
#define CVS_PORT 1999
#if HAVE_KERBEROS
@@ -65,7 +74,7 @@ static Key_schedule sched;
#endif /* HAVE_KERBEROS */
-#endif /* HAVE_KERBEROS || USE_DIRECT_TCP */
+#endif /* HAVE_KERBEROS */
static void add_prune_candidate PROTO((char *));
@@ -97,6 +106,7 @@ static void handle_copy_file PROTO((char *, int));
static void handle_updated PROTO((char *, int));
static void handle_merged PROTO((char *, int));
static void handle_patched PROTO((char *, int));
+static void handle_rcs_diff PROTO((char *, int));
static void handle_removed PROTO((char *, int));
static void handle_remove_entry PROTO((char *, int));
static void handle_set_static_directory PROTO((char *, int));
@@ -1303,7 +1313,28 @@ handle_mode (args, len)
stored_mode = xstrdup (args);
stored_mode_valid = 1;
}
+
+/* Nonzero if time was specified in Mod-time. */
+static int stored_modtime_valid;
+/* Time specified in Mod-time. */
+static time_t stored_modtime;
+
+static void handle_mod_time PROTO ((char *, int));
+static void
+handle_mod_time (args, len)
+ char *args;
+ int len;
+{
+ if (stored_modtime_valid)
+ error (0, 0, "protocol error: duplicate Mod-time");
+ stored_modtime = get_date (args, NULL);
+ if (stored_modtime == (time_t) -1)
+ error (0, 0, "protocol error: cannot parse date %s", args);
+ else
+ stored_modtime_valid = 1;
+}
+
/*
* If we receive a patch, but the patch program fails to apply it, we
* want to request the original file. We keep a list of files whose
@@ -1327,7 +1358,12 @@ struct update_entries_data
* We are getting a patch against the existing local file, not
* an entire new file.
*/
- UPDATE_ENTRIES_PATCH
+ UPDATE_ENTRIES_PATCH,
+ /*
+ * We are getting an RCS change text (diff -n output) against
+ * the existing local file, not an entire new file.
+ */
+ UPDATE_ENTRIES_RCS_DIFF
} contents;
enum {
@@ -1363,10 +1399,10 @@ update_entries (data_arg, ent_list, short_pathname, filename)
/* Timestamp field. Always empty according to the protocol. */
char *ts;
char *options;
- char *tag;
- char *date;
+ char *tag = NULL;
+ char *date = NULL;
char *tag_or_date;
- char *scratch_entries;
+ char *scratch_entries = NULL;
int bin;
read_line (&entries_line);
@@ -1403,8 +1439,6 @@ update_entries (data_arg, ent_list, short_pathname, filename)
cp = strchr (tag_or_date, '/');
if (cp != NULL)
*cp = '\0';
- tag = (char *) NULL;
- date = (char *) NULL;
if (*tag_or_date == 'T')
tag = tag_or_date + 1;
else if (*tag_or_date == 'D')
@@ -1421,16 +1455,16 @@ update_entries (data_arg, ent_list, short_pathname, filename)
options = NULL;
if (data->contents == UPDATE_ENTRIES_UPDATE
- || data->contents == UPDATE_ENTRIES_PATCH)
+ || data->contents == UPDATE_ENTRIES_PATCH
+ || data->contents == UPDATE_ENTRIES_RCS_DIFF)
{
char *size_string;
char *mode_string;
int size;
- int fd;
char *buf;
char *temp_filename;
- int use_gzip, gzip_status;
- pid_t gzip_pid = 0;
+ int use_gzip;
+ int patch_failed;
read_line (&mode_string);
@@ -1527,6 +1561,7 @@ update_entries (data_arg, ent_list, short_pathname, filename)
sprintf (temp_filename, ".new.%s", filename);
#endif /* _POSIX_NO_TRUNC */
#endif /* USE_VMS_FILENAMES */
+
buf = xmalloc (size);
/* Some systems, like OS/2 and Windows NT, end lines with CRLF
@@ -1541,45 +1576,66 @@ update_entries (data_arg, ent_list, short_pathname, filename)
else
bin = 0;
- fd = CVS_OPEN (temp_filename,
- O_WRONLY | O_CREAT | O_TRUNC | (bin ? OPEN_BINARY : 0),
- 0777);
-
- if (fd < 0)
+ if (data->contents == UPDATE_ENTRIES_RCS_DIFF)
{
- /* I can see a case for making this a fatal error; for a condition
- like disk full or network unreachable (for a file server),
- carrying on and giving an error on each file seems unnecessary.
- But if it is a permission problem, or some such, then it is
- entirely possible that future files will not have the same
- problem. */
- error (0, errno, "cannot write %s", short_pathname);
- goto discard_file_and_return;
- }
+ /* This is an RCS change text. We just hold the change
+ text in memory. */
- if (use_gzip)
- fd = filter_through_gunzip (fd, 0, &gzip_pid);
+ if (use_gzip)
+ error (1, 0,
+ "server error: gzip invalid with RCS change text");
- if (size > 0)
- {
read_from_server (buf, size);
+ }
+ else
+ {
+ int fd;
+ pid_t gzip_pid = 0;
+
+ fd = CVS_OPEN (temp_filename,
+ (O_WRONLY | O_CREAT | O_TRUNC
+ | (bin ? OPEN_BINARY : 0)),
+ 0777);
+
+ if (fd < 0)
+ {
+ /* I can see a case for making this a fatal error; for
+ a condition like disk full or network unreachable
+ (for a file server), carrying on and giving an
+ error on each file seems unnecessary. But if it is
+ a permission problem, or some such, then it is
+ entirely possible that future files will not have
+ the same problem. */
+ error (0, errno, "cannot write %s", short_pathname);
+ goto discard_file_and_return;
+ }
+
+ if (use_gzip)
+ fd = filter_through_gunzip (fd, 0, &gzip_pid);
+
+ if (size > 0)
+ {
+ read_from_server (buf, size);
+
+ if (write (fd, buf, size) != size)
+ error (1, errno, "writing %s", short_pathname);
+ }
- if (write (fd, buf, size) != size)
+ if (close (fd) < 0)
error (1, errno, "writing %s", short_pathname);
- }
+ if (gzip_pid > 0)
+ {
+ int gzip_status;
- if (close (fd) < 0)
- error (1, errno, "writing %s", short_pathname);
- if (gzip_pid > 0)
- {
- if (waitpid (gzip_pid, &gzip_status, 0) == -1)
- error (1, errno, "waiting for gzip process %ld",
- (long) gzip_pid);
- else if (gzip_status != 0)
- error (1, 0, "gzip process exited %d", gzip_status);
- }
+ if (waitpid (gzip_pid, &gzip_status, 0) == -1)
+ error (1, errno, "waiting for gzip process %ld",
+ (long) gzip_pid);
+ else if (gzip_status != 0)
+ error (1, 0, "gzip process exited %d", gzip_status);
+ }
- gzip_pid = -1;
+ gzip_pid = -1;
+ }
/* Since gunzip writes files without converting LF to CRLF
(a reasonable behavior), we now have a patch file in LF
@@ -1587,6 +1643,8 @@ update_entries (data_arg, ent_list, short_pathname, filename)
it to patch; patch can handle it. However, if it's the
final source file, convert it. */
+ patch_failed = 0;
+
if (data->contents == UPDATE_ENTRIES_UPDATE)
{
#ifdef LINES_CRLF_TERMINATED
@@ -1628,7 +1686,7 @@ update_entries (data_arg, ent_list, short_pathname, filename)
rename_file (temp_filename, filename);
#endif /* LINES_CRLF_TERMINATED */
}
- else
+ else if (data->contents == UPDATE_ENTRIES_PATCH)
{
int retcode;
char *backup;
@@ -1674,29 +1732,126 @@ update_entries (data_arg, ent_list, short_pathname, filename)
(void) unlink_file (path_tmp);
free (path_tmp);
- /* Save this file to retrieve later. */
- failed_patches =
- (char **) xrealloc ((char *) failed_patches,
- ((failed_patches_count + 1)
- * sizeof (char *)));
- failed_patches[failed_patches_count] =
- xstrdup (short_pathname);
- ++failed_patches_count;
-
error (retcode == -1 ? 1 : 0, retcode == -1 ? old_errno : 0,
"could not patch %s%s", filename,
retcode == -1 ? "" : "; will refetch");
- stored_checksum_valid = 0;
-
- free (backup);
- return;
+ patch_failed = 1;
}
free (backup);
}
+ else
+ {
+ struct stat s;
+ char *filebuf, *tobuf;
+ size_t filebufsize;
+ FILE *e;
+ size_t nread;
+ char *patchedbuf;
+ size_t patchedlen;
+
+ /* Handle UPDATE_ENTRIES_RCS_DIFF. */
+
+ if (!isfile (filename))
+ error (1, 0, "patch original file %s does not exist",
+ short_pathname);
+ if (CVS_STAT (filename, &s) < 0)
+ error (1, errno, "can't stat %s", short_pathname);
+
+ filebufsize = s.st_size;
+ filebuf = xmalloc (filebufsize);
+
+ e = open_file (filename, bin ? FOPEN_BINARY_READ : "r");
+
+ tobuf = filebuf;
+ nread = 0;
+ while (1)
+ {
+ size_t got;
+
+ got = fread (tobuf, 1, filebufsize - (tobuf - filebuf), e);
+ if (ferror (e))
+ error (1, errno, "can't read %s", short_pathname);
+ nread += got;
+ tobuf += got;
+
+ if (feof (e))
+ break;
+
+ /* It's probably paranoid to think S.ST_SIZE might be
+ too small to hold the entire file contents, but we
+ handle it just in case. */
+ if (tobuf == filebuf + filebufsize)
+ {
+ int c;
+ long off;
+
+ c = getc (e);
+ if (c == EOF)
+ break;
+ off = tobuf - filebuf;
+ expand_string (&filebuf, &filebufsize, filebufsize + 100);
+ tobuf = filebuf + off;
+ *tobuf++ = c;
+ ++nread;
+ }
+ }
+
+ fclose (e);
+
+ /* At this point the contents of the existing file are in
+ FILEBUF, and the length of the contents is in NREAD.
+ The contents of the patch from the network are in BUF,
+ and the length of the patch is in SIZE. */
+
+ if (! rcs_change_text (short_pathname, filebuf, nread, buf, size,
+ &patchedbuf, &patchedlen))
+ patch_failed = 1;
+ else
+ {
+ if (stored_checksum_valid)
+ {
+ struct MD5Context context;
+ unsigned char checksum[16];
+
+ /* We have a checksum. Check it before writing
+ the file out, so that we don't have to read it
+ back in again. */
+ MD5Init (&context);
+ MD5Update (&context, (unsigned char *) patchedbuf, patchedlen);
+ MD5Final (checksum, &context);
+ if (memcmp (checksum, stored_checksum, 16) != 0)
+ {
+ error (0, 0,
+ "checksum failure after patch to %s; will refetch",
+ short_pathname);
+
+ patch_failed = 1;
+ }
+
+ stored_checksum_valid = 0;
+ }
+
+ if (! patch_failed)
+ {
+ e = open_file (temp_filename,
+ bin ? FOPEN_BINARY_WRITE : "w");
+ if (fwrite (patchedbuf, 1, patchedlen, e) != patchedlen)
+ error (1, errno, "cannot write %s", temp_filename);
+ if (fclose (e) == EOF)
+ error (1, errno, "cannot close %s", temp_filename);
+ rename_file (temp_filename, filename);
+ }
+
+ free (patchedbuf);
+ }
+
+ free (filebuf);
+ }
+
free (temp_filename);
- if (stored_checksum_valid)
+ if (stored_checksum_valid && ! patch_failed)
{
FILE *e;
struct MD5Context context;
@@ -1739,19 +1894,27 @@ update_entries (data_arg, ent_list, short_pathname, filename)
"checksum failure after patch to %s; will refetch",
short_pathname);
- /* Save this file to retrieve later. */
- failed_patches =
- (char **) xrealloc ((char *) failed_patches,
- ((failed_patches_count + 1)
- * sizeof (char *)));
- failed_patches[failed_patches_count] =
- xstrdup (short_pathname);
- ++failed_patches_count;
-
- return;
+ patch_failed = 1;
}
}
+ if (patch_failed)
+ {
+ /* Save this file to retrieve later. */
+ failed_patches = (char **) xrealloc ((char *) failed_patches,
+ ((failed_patches_count + 1)
+ * sizeof (char *)));
+ failed_patches[failed_patches_count] = xstrdup (short_pathname);
+ ++failed_patches_count;
+
+ stored_checksum_valid = 0;
+
+ free (mode_string);
+ free (buf);
+
+ return;
+ }
+
{
/* FIXME: we should be respecting the umask. */
int status = change_mode (filename, mode_string);
@@ -1767,6 +1930,19 @@ update_entries (data_arg, ent_list, short_pathname, filename)
change_mode (filename, stored_mode);
stored_mode_valid = 0;
+ if (stored_modtime_valid)
+ {
+ struct utimbuf t;
+
+ memset (&t, 0, sizeof (t));
+ /* There is probably little point in trying to preserved the
+ actime (or is there? What about Checked-in?). */
+ t.modtime = t.actime = stored_modtime;
+ if (utime (filename, &t) < 0)
+ error (0, errno, "cannot set time on %s", filename);
+ stored_modtime_valid = 0;
+ }
+
/*
* Process the entries line. Do this after we've written the file,
* since we need the timestamp.
@@ -1897,6 +2073,19 @@ handle_patched (args, len)
dat.timestamp = NULL;
call_in_directory (args, update_entries, (char *)&dat);
}
+
+static void
+handle_rcs_diff (args, len)
+ char *args;
+ int len;
+{
+ struct update_entries_data dat;
+ dat.contents = UPDATE_ENTRIES_RCS_DIFF;
+ /* Think this could be UPDATE_ENTRIES_EXISTING, but just in case... */
+ dat.existp = UPDATE_ENTRIES_EXISTING_OR_NEW;
+ dat.timestamp = NULL;
+ call_in_directory (args, update_entries, (char *)&dat);
+}
static void
remove_entry (data, ent_list, short_pathname, filename)
@@ -2722,7 +2911,9 @@ struct response responses[] =
rs_optional),
RSP_LINE("Merged", handle_merged, response_type_normal, rs_essential),
RSP_LINE("Patched", handle_patched, response_type_normal, rs_optional),
+ RSP_LINE("Rcs-diff", handle_rcs_diff, response_type_normal, rs_optional),
RSP_LINE("Mode", handle_mode, response_type_normal, rs_optional),
+ RSP_LINE("Mod-time", handle_mod_time, response_type_normal, rs_optional),
RSP_LINE("Removed", handle_removed, response_type_normal, rs_essential),
RSP_LINE("Remove-entry", handle_remove_entry, response_type_normal,
rs_optional),
@@ -2928,7 +3119,7 @@ get_responses_and_close ()
else
#endif /* NO_SOCKET_TO_FD */
{
-#if defined(HAVE_KERBEROS) || defined(USE_DIRECT_TCP) || defined(AUTH_CLIENT_SUPPORT)
+#if defined(HAVE_KERBEROS) || defined(AUTH_CLIENT_SUPPORT)
if (server_fd != -1)
{
if (shutdown (server_fd, 1) < 0)
@@ -2946,7 +3137,7 @@ get_responses_and_close ()
}
}
else
-#endif /* HAVE_KERBEROS || USE_DIRECT_TCP || AUTH_CLIENT_SUPPORT */
+#endif
#ifdef SHUTDOWN_SERVER
SHUTDOWN_SERVER (fileno (to_server_fp));
@@ -3224,7 +3415,7 @@ connect_to_pserver (tofdp, fromfdp, verify_only)
#endif /* AUTH_CLIENT_SUPPORT */
-#if HAVE_KERBEROS || USE_DIRECT_TCP
+#if HAVE_KERBEROS
/*
* FIXME: this function has not been changed to deal with
@@ -3253,14 +3444,6 @@ start_tcp_server (tofdp, fromfdp)
int status;
-#ifndef HAVE_KERBEROS
- /* It is a crock to have :kserver: sometimes mean kerberos,
- and sometimes mean "direct tcp", based on USE_DIRECT_TCP.
- If we need the "direct tcp" stuff, we need a new access method,
- like :direct: or something. */
- error (1, 0, "this CVS executable does not support kerberos");
-#endif
-
/*
* We look up the host to give a better error message if it
* does not exist. However, we then pass CVSroot_hostname to
@@ -3379,7 +3562,7 @@ start_tcp_server (tofdp, fromfdp)
*fromfdp = fromfd;
}
-#endif /* HAVE_KERBEROS || USE_DIRECT_TCP */
+#endif /* HAVE_KERBEROS */
static int send_variable_proc PROTO ((Node *, void *));
@@ -3419,14 +3602,19 @@ start_server ()
break;
#endif
-#if HAVE_KERBEROS || USE_DIRECT_TCP
+#if HAVE_KERBEROS
case kserver_method:
start_tcp_server (&tofd, &fromfd);
break;
#endif
case ext_method:
+#if defined (NO_EXT_METHOD)
+ error (0, 0, ":ext: method not supported by this port of CVS");
+ error (1, 0, "try :server: instead");
+#else
start_rsh_server (&tofd, &fromfd);
+#endif
break;
case server_method:
@@ -3735,6 +3923,8 @@ the :server: access method is not supported by this port of CVS");
walklist (variable_list, send_variable_proc, NULL);
}
+#ifndef NO_EXT_METHOD
+
/* Contact the server by starting it with rsh. */
/* Right now, we have two different definitions for this function,
@@ -3896,10 +4086,13 @@ start_rsh_server (tofdp, fromfdp)
if (rsh_pid < 0)
error (1, errno, "cannot start server via rsh");
}
+ free (command);
}
#endif /* START_RSH_WITH_POPEN_RW */
+#endif /* NO_EXT_METHOD */
+
/* Send an argument STRING. */
@@ -3930,6 +4123,10 @@ send_arg (string)
static void send_modified PROTO ((char *, char *, Vers_TS *));
+/* VERS->OPTIONS specifies whether the file is binary or not. NOTE: BEFORE
+ using any other fields of the struct vers, we would need to fix
+ client_process_import_file to set them up. */
+
static void
send_modified (file, short_pathname, vers)
char *file;
@@ -4004,8 +4201,8 @@ send_modified (file, short_pathname, vers)
#endif /* LINES_CRLF_TERMINATED */
#ifdef LINES_CRLF_TERMINATED
- /* Assume everything in a "cvs import" is text. */
if (vers == NULL)
+ /* "Can't happen". */
converting = 1;
else
/* Otherwise, we convert things unless they're binary. */
@@ -4444,8 +4641,6 @@ send_file_names (argc, argv, flags)
unsigned int flags;
{
int i;
- char *p;
- char *q;
int level;
int max_level;
@@ -4458,25 +4653,9 @@ send_file_names (argc, argv, flags)
max_level = 0;
for (i = 0; i < argc; ++i)
{
- p = argv[i];
- level = 0;
- do
- {
- q = strchr (p, '/');
- if (q != NULL)
- ++q;
- if (p[0] == '.' && p[1] == '.' && (p[2] == '\0' || p[2] == '/'))
- {
- --level;
- if (-level > max_level)
- max_level = -level;
- }
- else if (p[0] == '.' && (p[1] == '\0' || p[1] == '/'))
- ;
- else
- ++level;
- p = q;
- } while (p != NULL);
+ level = pathname_levels (argv[i]);
+ if (level > max_level)
+ max_level = level;
}
if (max_level > 0)
{
@@ -4637,16 +4816,19 @@ client_import_setup (repository)
* Process the argument import file.
*/
int
-client_process_import_file (message, vfile, vtag, targc, targv, repository)
+client_process_import_file (message, vfile, vtag, targc, targv, repository,
+ all_files_binary)
char *message;
char *vfile;
char *vtag;
int targc;
char *targv[];
char *repository;
+ int all_files_binary;
{
char *update_dir;
char *fullname;
+ Vers_TS vers;
assert (toplevel_repos != NULL);
@@ -4671,7 +4853,18 @@ client_process_import_file (message, vfile, vtag, targc, targv, repository)
}
send_a_repository ("", repository, update_dir);
- send_modified (vfile, fullname, NULL);
+ if (all_files_binary)
+ {
+ vers.options = xmalloc (4); /* strlen("-kb") + 1 */
+ strcpy (vers.options, "-kb");
+ }
+ else
+ {
+ vers.options = wrap_rcsoption (vfile, 1);
+ }
+ send_modified (vfile, fullname, &vers);
+ if (vers.options != NULL)
+ free (vers.options);
free (fullname);
return 0;
}
@@ -4732,6 +4925,7 @@ notified_a_file (data, ent_list, short_pathname, filename)
{
if (feof (fp))
{
+ free (line);
if (fclose (fp) < 0)
error (0, errno, "cannot close %s", CVSADM_NOTIFY);
if ( CVS_UNLINK (CVSADM_NOTIFY) < 0)
@@ -4774,6 +4968,7 @@ notified_a_file (data, ent_list, short_pathname, filename)
error (0, errno, "cannot close %s", CVSADM_NOTIFYTMP);
goto error_exit;
}
+ free (line);
if (fclose (fp) < 0)
{
error (0, errno, "cannot close %s", CVSADM_NOTIFY);
@@ -4792,6 +4987,7 @@ notified_a_file (data, ent_list, short_pathname, filename)
error2:
(void) fclose (newf);
error_exit:
+ free (line);
(void) fclose (fp);
}
diff --git a/gnu/usr.bin/cvs/src/client.h b/gnu/usr.bin/cvs/src/client.h
index 6d92da51149..1f9c27f3087 100644
--- a/gnu/usr.bin/cvs/src/client.h
+++ b/gnu/usr.bin/cvs/src/client.h
@@ -169,7 +169,7 @@ extern char *toplevel_wd;
extern void client_import_setup PROTO((char *repository));
extern int client_process_import_file
PROTO((char *message, char *vfile, char *vtag,
- int targc, char *targv[], char *repository));
+ int targc, char *targv[], char *repository, int all_files_binary));
extern void client_import_done PROTO((void));
extern void client_notify PROTO((char *, char *, char *, int, char *));
#endif /* CLIENT_SUPPORT */
diff --git a/gnu/usr.bin/cvs/src/cvsbug.sh b/gnu/usr.bin/cvs/src/cvsbug.sh
index ae6af7822b9..fd6ae7c25c0 100644
--- a/gnu/usr.bin/cvs/src/cvsbug.sh
+++ b/gnu/usr.bin/cvs/src/cvsbug.sh
@@ -7,8 +7,6 @@
# This file is part of GNU GNATS.
# Modified by Berliner for CVS.
#
-#ident "@(#)cvs/src:$Name: $:$Id: cvsbug.sh,v 1.1.1.3 1997/02/21 06:37:08 tholo Exp $"
-#
# GNU GNATS is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
@@ -233,11 +231,14 @@ fi
case "$FORMAT" in
lisp) echo "$CATEGORIES" | \
- awk 'BEGIN {printf "( "} {printf "(\"%s\") ",$0} END {printf ")\n"}'
+ awk 'BEGIN {printf "( "}
+ {printf "(\"%s\") ",$0}
+ END {printf ")\n"}'
exit 0
;;
norm) l=`echo "$CATEGORIES" | \
- awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
+ awk 'BEGIN {max = 0; }
+ { if (length($0) > max) { max = length($0); } }
END {print max + 1;}'`
c=`expr 70 / $l`
if [ $c -eq 0 ]; then c=1; fi
@@ -312,7 +313,8 @@ __EOF__
# Format the categories so they fit onto lines.
l=`echo "$CATEGORIES" | \
- awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
+ awk 'BEGIN {max = 0; }
+ { if (length($0) > max) { max = length($0); } }
END {print max + 1;}'`
c=`expr 61 / $l`
if [ $c -eq 0 ]; then c=1; fi
diff --git a/gnu/usr.bin/cvs/src/cvsrc.c b/gnu/usr.bin/cvs/src/cvsrc.c
index ebbc42c4525..5e9cfa504a9 100644
--- a/gnu/usr.bin/cvs/src/cvsrc.c
+++ b/gnu/usr.bin/cvs/src/cvsrc.c
@@ -51,17 +51,17 @@ read_cvsrc (argc, argv, cmdname)
int max_new_argv;
char **new_argv;
+ /* old_argc and old_argv hold the values returned from the
+ previous invocation of read_cvsrc and are used to free the
+ allocated memory. The first invocation of read_cvsrc gets argv
+ from the system, this memory must not be free'd. */
+ static int old_argc = 0;
+ static char **old_argv = NULL;
+
/* don't do anything if argc is -1, since that implies "help" mode */
if (*argc == -1)
return;
- /* setup the new options list */
-
- new_argc = 1;
- max_new_argv = (*argc) + GROW;
- new_argv = (char **) xmalloc (max_new_argv * sizeof (char*));
- new_argv[0] = xstrdup ((*argv)[0]);
-
/* determine filename for ~/.cvsrc */
homedir = get_homedir ();
@@ -105,28 +105,27 @@ read_cvsrc (argc, argv, cmdname)
fclose (cvsrcfile);
+ /* setup the new options list */
+
+ new_argc = 1;
+ max_new_argv = (*argc) + GROW;
+ new_argv = (char **) xmalloc (max_new_argv * sizeof (char*));
+ new_argv[0] = xstrdup ((*argv)[0]);
+
if (found)
{
/* skip over command in the options line */
- optstart = strtok (line + command_len, "\t \n");
-
- while (optstart)
+ for (optstart = strtok (line + command_len, "\t \n");
+ optstart;
+ optstart = strtok (NULL, "\t \n"))
{
- new_argv [new_argc] = xstrdup (optstart);
- new_argv [new_argc+1] = NULL;
- new_argc += 1;
+ new_argv [new_argc++] = xstrdup (optstart);
if (new_argc >= max_new_argv)
{
- char **tmp_argv;
max_new_argv += GROW;
- tmp_argv = (char **) xmalloc (max_new_argv * sizeof (char*));
- for (i = 0; i <= new_argc; i++)
- tmp_argv[i] = new_argv[i];
- free(new_argv);
- new_argv = tmp_argv;
+ new_argv = (char **) xrealloc (new_argv, max_new_argv * sizeof (char*));
}
- optstart = strtok (NULL, "\t \n");
}
}
@@ -135,14 +134,25 @@ read_cvsrc (argc, argv, cmdname)
/* now copy the remaining arguments */
+ if (new_argc + *argc > max_new_argv)
+ {
+ max_new_argv = new_argc + *argc;
+ new_argv = (char **) xrealloc (new_argv, max_new_argv * sizeof (char*));
+ }
for (i=1; i < *argc; i++)
{
- new_argv [new_argc] = (*argv)[i];
- new_argc += 1;
+ new_argv [new_argc++] = xstrdup ((*argv)[i]);
+ }
+
+ if (old_argv != NULL)
+ {
+ /* Free the memory which was allocated in the previous
+ read_cvsrc call. */
+ free_names (&old_argc, old_argv);
}
- *argc = new_argc;
- *argv = new_argv;
+ old_argc = *argc = new_argc;
+ old_argv = *argv = new_argv;
free (homeinit);
return;
diff --git a/gnu/usr.bin/cvs/src/diff.c b/gnu/usr.bin/cvs/src/diff.c
index ba618ec6eb0..608a00f4d0f 100644
--- a/gnu/usr.bin/cvs/src/diff.c
+++ b/gnu/usr.bin/cvs/src/diff.c
@@ -44,11 +44,9 @@ static char *diff_rev1, *diff_rev2;
static char *diff_date1, *diff_date2;
static char *use_rev1, *use_rev2;
-#ifdef SERVER_SUPPORT
/* Revision of the user file, if it is unchanged from something in the
repository and we want to use that fact. */
static char *user_file_rev;
-#endif
static char *options;
static char *opts;
@@ -61,9 +59,10 @@ static int empty_files = 0;
--ifdef and --context, but rcsdiff only does if diff does). */
static const char *const diff_usage[] =
{
- "Usage: %s %s [-lN] [rcsdiff-options]\n",
+ "Usage: %s %s [-lNR] [rcsdiff-options]\n",
" [[-r rev1 | -D date1] [-r rev2 | -D date2]] [files...] \n",
"\t-l\tLocal directory only, not recursive\n",
+ "\t-R\tProcess directories recursively.\n",
"\t-D d1\tDiff revision for date against working file.\n",
"\t-D d2\tDiff rev1/date1 against date2.\n",
"\t-N\tinclude diffs for added and removed files.\n",
@@ -200,7 +199,7 @@ diff (argc, argv)
}
opts[0] = '\0';
- optind = 1;
+ optind = 0;
while ((c = getopt_long (argc, argv,
"+abcdefhilnpstuwy0123456789BHNRTC:D:F:I:L:U:V:W:k:r:",
longopts, &option_index)) != -1)
@@ -360,9 +359,7 @@ diff_fileproc (callerdat, finfo)
char *tocvsPath;
char *fname;
-#ifdef SERVER_SUPPORT
user_file_rev = 0;
-#endif
vers = Version_TS (finfo, NULL, NULL, NULL, 1, 0);
if (diff_rev2 != NULL || diff_date2 != NULL)
@@ -458,7 +455,6 @@ diff_fileproc (callerdat, finfo)
diff_mark_errors (err);
return (err);
}
-#ifdef SERVER_SUPPORT
else if (!strcmp (vers->ts_user, vers->ts_rcs))
{
/* The user file matches some revision in the repository
@@ -466,7 +462,6 @@ diff_fileproc (callerdat, finfo)
have a copy of the user file around). */
user_file_rev = vers->vn_user;
}
-#endif
}
}
@@ -475,7 +470,16 @@ diff_fileproc (callerdat, finfo)
{
freevers_ts (&vers);
if (empty_file == DIFF_SAME)
+ {
+ /* In the server case, would be nice to send a "Checked-in"
+ response, so that the client can rewrite its timestamp.
+ server_checked_in by itself isn't the right thing (it
+ needs a server_register), but I'm not sure what is.
+ It isn't clear to me how "cvs status" handles this (that
+ is, for a client which sends Modified not Is-modified to
+ "cvs status"), but it does. */
return (0);
+ }
else
{
diff_mark_errors (err);
@@ -643,7 +647,7 @@ diff_fileproc (callerdat, finfo)
if (! existence_error (errno))
error (1, errno, "cannot remove %s", finfo->file);
- rename_file (fname,finfo->file);
+ rename_file (fname, finfo->file);
if (unlink_file (tocvsPath) < 0)
error (1, errno, "cannot remove %s", tocvsPath);
free (fname);
@@ -828,10 +832,8 @@ diff_file_nodiff (finfo, vers, empty_file)
return DIFF_SAME;
else
{
-#ifdef SERVER_SUPPORT
if (user_file_rev && use_rev2 == NULL)
use_rev2 = xstrdup (user_file_rev);
-#endif
return DIFF_ADDED;
}
}
@@ -847,7 +849,6 @@ diff_file_nodiff (finfo, vers, empty_file)
}
}
-#ifdef SERVER_SUPPORT
if (user_file_rev)
{
/* drop user_file_rev into first unused use_rev */
@@ -867,7 +868,6 @@ diff_file_nodiff (finfo, vers, empty_file)
else
return DIFF_DIFFERENT;
}
-#endif /* SERVER_SUPPORT */
if (use_rev1 == NULL
|| (vers->vn_user != NULL && strcmp (use_rev1, vers->vn_user) == 0))
diff --git a/gnu/usr.bin/cvs/src/edit.c b/gnu/usr.bin/cvs/src/edit.c
index f884c9d12a1..33e9c61a7a2 100644
--- a/gnu/usr.bin/cvs/src/edit.c
+++ b/gnu/usr.bin/cvs/src/edit.c
@@ -60,14 +60,17 @@ watch_onoff (argc, argv)
int local = 0;
int err;
- optind = 1;
- while ((c = getopt (argc, argv, "+l")) != -1)
+ optind = 0;
+ while ((c = getopt (argc, argv, "+lR")) != -1)
{
switch (c)
{
case 'l':
local = 1;
break;
+ case 'R':
+ local = 0;
+ break;
case '?':
default:
usage (watch_usage);
@@ -328,10 +331,11 @@ edit_fileproc (callerdat, finfo)
static const char *const edit_usage[] =
{
- "Usage: %s %s [-l] [files...]\n",
+ "Usage: %s %s [-lR] [files...]\n",
"-l: Local directory only, not recursive\n",
+ "-R: Process directories recursively\n",
"-a: Specify what actions for temporary watch, one of\n",
- " edit,unedit,commit.all,none\n",
+ " edit,unedit,commit,all,none\n",
NULL
};
@@ -352,14 +356,17 @@ edit (argc, argv)
setting_tedit = 0;
setting_tunedit = 0;
setting_tcommit = 0;
- optind = 1;
- while ((c = getopt (argc, argv, "+la:")) != -1)
+ optind = 0;
+ while ((c = getopt (argc, argv, "+lRa:")) != -1)
{
switch (c)
{
case 'l':
local = 1;
break;
+ case 'R':
+ local = 0;
+ break;
case 'a':
a_omitted = 0;
if (strcmp (optarg, "edit") == 0)
@@ -484,14 +491,17 @@ unedit (argc, argv)
if (argc == -1)
usage (edit_usage);
- optind = 1;
- while ((c = getopt (argc, argv, "+l")) != -1)
+ optind = 0;
+ while ((c = getopt (argc, argv, "+lR")) != -1)
{
switch (c)
{
case 'l':
local = 1;
break;
+ case 'R':
+ local = 0;
+ break;
case '?':
default:
usage (edit_usage);
@@ -888,7 +898,8 @@ notify_check (repository, update_dir)
client_notify (repository, update_dir, filename, notif_type, val);
}
-
+ if (line)
+ free (line);
if (ferror (fp))
error (0, errno, "cannot read %s", CVSADM_NOTIFY);
if (fclose (fp) < 0)
@@ -902,7 +913,9 @@ notify_check (repository, update_dir)
static const char *const editors_usage[] =
{
- "Usage: %s %s [files...]\n",
+ "Usage: %s %s [-lR] [files...]\n",
+ "\t-l\tProcess this directory only (not recursive).\n",
+ "\t-R\tProcess directories recursively.\n",
NULL
};
@@ -970,14 +983,17 @@ editors (argc, argv)
if (argc == -1)
usage (editors_usage);
- optind = 1;
- while ((c = getopt (argc, argv, "+l")) != -1)
+ optind = 0;
+ while ((c = getopt (argc, argv, "+lR")) != -1)
{
switch (c)
{
case 'l':
local = 1;
break;
+ case 'R':
+ local = 0;
+ break;
case '?':
default:
usage (editors_usage);
diff --git a/gnu/usr.bin/cvs/src/entries.c b/gnu/usr.bin/cvs/src/entries.c
index 1e9dd58cd1e..03e29debc5b 100644
--- a/gnu/usr.bin/cvs/src/entries.c
+++ b/gnu/usr.bin/cvs/src/entries.c
@@ -655,9 +655,20 @@ WriteTag (dir, tag, date, nonbranch, update_dir, repository)
#endif
}
-/*
- * Parse the CVS/Tag file for the current directory.
- */
+/* Parse the CVS/Tag file for the current directory.
+
+ If it contains a date, sets *DATEP to the date in a newly malloc'd
+ string, *TAGP to NULL, and *NONBRANCHP to an unspecified value.
+
+ If it contains a branch tag, sets *TAGP to the tag in a newly
+ malloc'd string, *NONBRANCHP to 0, and *DATEP to NULL.
+
+ If it contains a nonbranch tag, sets *TAGP to the tag in a newly
+ malloc'd string, *NONBRANCHP to 1, and *DATEP to NULL.
+
+ If it does not exist, or contains something unrecognized by this
+ version of CVS, set *DATEP and *TAGP to NULL and *NONBRANCHP to
+ an unspecified value. */
void
ParseTag (tagp, datep, nonbranchp)
char **tagp;
@@ -670,6 +681,11 @@ ParseTag (tagp, datep, nonbranchp)
*tagp = (char *) NULL;
if (datep)
*datep = (char *) NULL;
+ /* Always store a value here, even in the 'D' case where the value
+ is unspecified. Shuts up tools which check for references to
+ uninitialized memory. */
+ if (nonbranchp != NULL)
+ *nonbranchp = 0;
fp = CVS_FOPEN (CVSADM_TAG, "r");
if (fp)
{
@@ -679,7 +695,7 @@ ParseTag (tagp, datep, nonbranchp)
line = NULL;
line_chars_allocated = 0;
-
+
if ((line_length = getline (&line, &line_chars_allocated, fp)) > 0)
{
/* Remove any trailing newline. */
@@ -690,8 +706,6 @@ ParseTag (tagp, datep, nonbranchp)
case 'T':
if (tagp != NULL)
*tagp = xstrdup (line + 1);
- if (nonbranchp != NULL)
- *nonbranchp = 0;
break;
case 'D':
if (datep != NULL)
diff --git a/gnu/usr.bin/cvs/src/filesubr.c b/gnu/usr.bin/cvs/src/filesubr.c
index 70048ae148b..71df566d288 100644
--- a/gnu/usr.bin/cvs/src/filesubr.c
+++ b/gnu/usr.bin/cvs/src/filesubr.c
@@ -19,14 +19,6 @@
#include "cvs.h"
-/*
- * I don't know of a convenient way to test this at configure time, or else
- * I'd certainly do it there.
- */
-#if defined(NeXT)
-#define LOSING_TMPNAM_FUNCTION
-#endif
-
static int deep_remove_dir PROTO((const char *path));
/*
@@ -624,38 +616,51 @@ xcmp (file1, file2)
return (ret);
}
-/* Just in case this implementation does not define this. */
-#ifndef L_tmpnam
-#define L_tmpnam 50
-#endif
-
-#ifdef LOSING_TMPNAM_FUNCTION
+/* Generate a unique temporary filename. Returns a pointer to a newly
+ malloc'd string containing the name. Returns successfully or not at
+ all. */
+/* There are at least three functions for generating temporary
+ filenames. We use tempnam (SVID 3) if possible, else mktemp (BSD
+ 4.3), and as last resort tmpnam (POSIX). Reason is that tempnam and
+ mktemp both allow to specify the directory in which the temporary
+ file will be created. */
+#ifdef HAVE_TEMPNAM
char *
cvs_temp_name ()
{
- char value[L_tmpnam + 1];
+ char *retval;
- /* FIXME: Should be using TMPDIR. */
- strcpy (value, "/tmp/cvsXXXXXX");
- mktemp (value);
- return xstrdup (value);
+ retval = tempnam (Tmpdir, "cvs");
+ if (retval == NULL)
+ error (1, errno, "cannot generate temporary filename");
+ /* tempnam returns a pointer to a newly malloc'd string, so there's
+ no need for a xstrdup */
+ return retval;
}
#else
-/* Generate a unique temporary filename. Returns a pointer to a newly
- malloc'd string containing the name. Returns successfully or not at
- all. */
char *
cvs_temp_name ()
{
+# ifdef HAVE_MKTEMP
+ char *value;
+ char *retval;
+
+ value = xmalloc (strlen (Tmpdir) + 40);
+ sprintf (value, "%s/%s", Tmpdir, "cvsXXXXXX" );
+ retval = mktemp (value);
+
+ if (retval == NULL)
+ error (1, errno, "cannot generate temporary filename");
+ return value;
+# else
char value[L_tmpnam + 1];
char *retval;
- /* FIXME: should be using TMPDIR, perhaps by using tempnam on systems
- which have it. */
retval = tmpnam (value);
if (retval == NULL)
error (1, errno, "cannot generate temporary filename");
- return xstrdup (retval);
+ return xstrdup (value);
+# endif
}
#endif
diff --git a/gnu/usr.bin/cvs/src/find_names.c b/gnu/usr.bin/cvs/src/find_names.c
index a7a91bbfd3e..5d2a79e89b9 100644
--- a/gnu/usr.bin/cvs/src/find_names.c
+++ b/gnu/usr.bin/cvs/src/find_names.c
@@ -256,7 +256,7 @@ find_rcs (dir, list)
/* read the dir, grabbing the ,v files */
while ((dp = readdir (dirp)) != NULL)
{
- if (fnmatch (RCSPAT, dp->d_name, 0) == 0)
+ if (CVS_FNMATCH (RCSPAT, dp->d_name, 0) == 0)
{
char *comma;
@@ -320,7 +320,7 @@ find_dirs (dir, list, checkadm, entries)
continue;
#endif
/* don't bother stating ,v files */
- if (fnmatch (RCSPAT, dp->d_name, 0) == 0)
+ if (CVS_FNMATCH (RCSPAT, dp->d_name, 0) == 0)
continue;
expand_string (&tmp,
diff --git a/gnu/usr.bin/cvs/src/hash.c b/gnu/usr.bin/cvs/src/hash.c
index 60998d108f9..a978d1f1bd8 100644
--- a/gnu/usr.bin/cvs/src/hash.c
+++ b/gnu/usr.bin/cvs/src/hash.c
@@ -101,15 +101,27 @@ dellist (listp)
if ((p = (*listp)->hasharray[i]) != (Node *) NULL)
{
/* put the nodes into the cache */
+#ifndef NOCACHE
p->type = UNKNOWN;
p->next = nodecache;
nodecache = p;
+#else
+ /* If NOCACHE is defined we turn off the cache. This can make
+ it easier to tools to determine where items were allocated
+ and freed, for tracking down memory leaks and the like. */
+ free (p);
+#endif
}
}
/* put it on the cache */
+#ifndef NOCACHE
(*listp)->next = listcache;
listcache = *listp;
+#else
+ free ((*listp)->list);
+ free (*listp);
+#endif
*listp = (List *) NULL;
}
@@ -198,9 +210,13 @@ freenode (p)
freenode_mem (p);
/* then put it in the cache */
+#ifndef NOCACHE
p->type = UNKNOWN;
p->next = nodecache;
nodecache = p;
+#else
+ free (p);
+#endif
}
/*
diff --git a/gnu/usr.bin/cvs/src/history.c b/gnu/usr.bin/cvs/src/history.c
index bce237f5275..ae13409563f 100644
--- a/gnu/usr.bin/cvs/src/history.c
+++ b/gnu/usr.bin/cvs/src/history.c
@@ -278,6 +278,12 @@ static int mod_count; /* Number of elements used */
static char *histfile; /* Ptr to the history file name */
+/* This is pretty unclear. First of all, separating "flags" vs.
+ "options" (I think the distinction is that "options" take arguments)
+ is nonstandard, and not something we do elsewhere in CVS. Second of
+ all, what does "reports" mean? I think it means that you can only
+ supply one of those options, but "reports" hardly has that meaning in
+ a self-explanatory way. */
static const char *const history_usg[] =
{
"Usage: %s %s [-report] [-flags] [-options args] [files...]\n\n",
@@ -389,7 +395,7 @@ history (argc, argv)
since_tag = xstrdup ("");
backto = xstrdup ("");
rec_types = xstrdup ("");
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+Tacelow?D:b:f:m:n:p:r:t:u:x:X:z:")) != -1)
{
switch (c)
diff --git a/gnu/usr.bin/cvs/src/import.c b/gnu/usr.bin/cvs/src/import.c
index 4e01e65c616..3243a960274 100644
--- a/gnu/usr.bin/cvs/src/import.c
+++ b/gnu/usr.bin/cvs/src/import.c
@@ -18,12 +18,11 @@
#include "cvs.h"
#include "savecwd.h"
+#include <assert.h>
#define FILE_HOLDER ".#cvsxxx"
static char *get_comment PROTO((char *user));
-static int add_rcs_file PROTO((char *message, char *rcs, char *user, char *vtag,
- int targc, char *targv[]));
static int expand_at_signs PROTO((char *buf, off_t size, FILE *fp));
static int add_rev PROTO((char *message, RCSNode *rcs, char *vfile,
char *vers));
@@ -80,7 +79,7 @@ import (argc, argv)
wrap_setup ();
vbranch = xstrdup (CVSBRANCH);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+Qqdb:m:I:k:W:")) != -1)
{
switch (c)
@@ -411,8 +410,10 @@ import_descend (message, vtag, targc, targv)
#ifdef CLIENT_SUPPORT
if (client_active)
err += client_process_import_file (message, dp->d_name,
- vtag, targc, targv,
- repository);
+ vtag, targc, targv,
+ repository,
+ keyword_opt != NULL &&
+ keyword_opt[0] == 'b');
else
#endif
err += process_import_file (message, dp->d_name,
@@ -473,7 +474,8 @@ process_import_file (message, vfile, vtag, targc, targv)
* repository nor in the Attic -- create it anew.
*/
add_log ('N', vfile);
- retval = add_rcs_file (message, rcs, vfile, vtag, targc, targv);
+ retval = add_rcs_file (message, rcs, vfile, vhead, vbranch,
+ vtag, targc, targv, logfp);
free (rcs);
return retval;
}
@@ -874,14 +876,36 @@ get_comment (user)
return retval;
}
-static int
-add_rcs_file (message, rcs, user, vtag, targc, targv)
+/* Create a new RCS file from scratch.
+
+ This probably should be moved to rcs.c now that it is called from
+ places outside import.c. */
+int
+add_rcs_file (message, rcs, user, add_vhead, add_vbranch, vtag, targc, targv,
+ add_logfp)
+ /* Log message for the addition. */
char *message;
+ /* Filename of the RCS file to create. */
char *rcs;
+ /* Filename of the file to serve as the contents of the initial
+ revision. */
char *user;
+
+ /* Revision number of head that we are adding. Normally 1.1 but
+ could be another revision as long as ADD_VBRANCH is a branch
+ from it. */
+ char *add_vhead;
+
+ /* Vendor branch to import to, or NULL if none. If non-NULL, then
+ vtag should also be non-NULL. */
+ char *add_vbranch;
char *vtag;
int targc;
char *targv[];
+
+ /* Write errors to here as well as via error (), or NULL if we should
+ use only error (). */
+ FILE *add_logfp;
{
FILE *fprcs, *fpuser;
struct stat sb;
@@ -916,7 +940,7 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
if (fpuser == NULL)
{
/* not fatal, continue import */
- fperror (logfp, 0, errno, "ERROR: cannot read file %s", userfile);
+ fperror (add_logfp, 0, errno, "ERROR: cannot read file %s", userfile);
error (0, errno, "ERROR: cannot read file %s", userfile);
goto read_error;
}
@@ -930,20 +954,36 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
/*
* putadmin()
*/
- if (fprintf (fprcs, "head %s;\012", vhead) < 0 ||
- fprintf (fprcs, "branch %s;\012", vbranch) < 0 ||
- fprintf (fprcs, "access ;\012") < 0 ||
+ if (fprintf (fprcs, "head %s;\012", add_vhead) < 0)
+ goto write_error;
+ if (add_vbranch != NULL)
+ {
+ if (fprintf (fprcs, "branch %s;\012", add_vbranch) < 0)
+ goto write_error;
+ }
+ if (fprintf (fprcs, "access ;\012") < 0 ||
fprintf (fprcs, "symbols ") < 0)
{
goto write_error;
}
- for (i = targc - 1; i >= 0; i--) /* RCS writes the symbols backwards */
- if (fprintf (fprcs, "%s:%s.1 ", targv[i], vbranch) < 0)
+ for (i = targc - 1; i >= 0; i--)
+ {
+ /* RCS writes the symbols backwards */
+ assert (add_vbranch != NULL);
+ if (fprintf (fprcs, "%s:%s.1 ", targv[i], add_vbranch) < 0)
goto write_error;
+ }
+
+ if (add_vbranch != NULL)
+ {
+ if (fprintf (fprcs, "%s:%s", vtag, add_vbranch) < 0)
+ goto write_error;
+ }
+ if (fprintf (fprcs, ";\012") < 0)
+ goto write_error;
- if (fprintf (fprcs, "%s:%s;\012", vtag, vbranch) < 0 ||
- fprintf (fprcs, "locks ; strict;\012") < 0 ||
+ if (fprintf (fprcs, "locks ; strict;\012") < 0 ||
/* XXX - make sure @@ processing works in the RCS file */
fprintf (fprcs, "comment @%s@;\012", get_comment (user)) < 0)
{
@@ -995,16 +1035,33 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
#endif
author = getcaller ();
- if (fprintf (fprcs, "\012%s\012", vhead) < 0 ||
- fprintf (fprcs, "date %s; author %s; state Exp;\012",
- altdate1, author) < 0 ||
- fprintf (fprcs, "branches %s.1;\012", vbranch) < 0 ||
- fprintf (fprcs, "next ;\012") < 0 ||
- fprintf (fprcs, "\012%s.1\012", vbranch) < 0 ||
+ if (fprintf (fprcs, "\012%s\012", add_vhead) < 0 ||
fprintf (fprcs, "date %s; author %s; state Exp;\012",
- altdate2, author) < 0 ||
- fprintf (fprcs, "branches ;\012") < 0 ||
- fprintf (fprcs, "next ;\012\012") < 0 ||
+ altdate1, author) < 0)
+ goto write_error;
+
+ if (fprintf (fprcs, "branches") < 0)
+ goto write_error;
+ if (add_vbranch != NULL)
+ {
+ if (fprintf (fprcs, " %s.1", add_vbranch) < 0)
+ goto write_error;
+ }
+ if (fprintf (fprcs, ";\012") < 0)
+ goto write_error;
+
+ if (fprintf (fprcs, "next ;\012") < 0)
+ goto write_error;
+ if (add_vbranch != NULL)
+ {
+ if (fprintf (fprcs, "\012%s.1\012", add_vbranch) < 0 ||
+ fprintf (fprcs, "date %s; author %s; state Exp;\012",
+ altdate2, author) < 0 ||
+ fprintf (fprcs, "branches ;\012") < 0 ||
+ fprintf (fprcs, "next ;\012\012") < 0)
+ goto write_error;
+ }
+ if (
/*
* putdesc()
*/
@@ -1013,9 +1070,23 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
/*
* putdelta()
*/
- fprintf (fprcs, "\012%s\012", vhead) < 0 ||
- fprintf (fprcs, "log\012") < 0 ||
- fprintf (fprcs, "@Initial revision\012@\012") < 0 ||
+ fprintf (fprcs, "\012%s\012", add_vhead) < 0 ||
+ fprintf (fprcs, "log\012@") < 0)
+ goto write_error;
+ if (add_vbranch != NULL)
+ {
+ /* We are going to put the log message in the revision on the
+ branch. So putting it here too seems kind of redundant, I
+ guess (and that is what CVS has always done, anyway). */
+ if (fprintf (fprcs, "Initial revision\012") < 0)
+ goto write_error;
+ }
+ else
+ {
+ if (expand_at_signs (message, (off_t) strlen (message), fprcs) < 0)
+ goto write_error;
+ }
+ if (fprintf (fprcs, "@\012") < 0 ||
fprintf (fprcs, "text\012@") < 0)
{
goto write_error;
@@ -1039,15 +1110,18 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
goto write_error;
}
}
- if (fprintf (fprcs, "@\012\012") < 0 ||
- fprintf (fprcs, "\012%s.1\012", vbranch) < 0 ||
- fprintf (fprcs, "log\012@") < 0 ||
- expand_at_signs (message, (off_t) strlen (message), fprcs) < 0 ||
- fprintf (fprcs, "@\012text\012") < 0 ||
- fprintf (fprcs, "@@\012") < 0)
- {
+ if (fprintf (fprcs, "@\012\012") < 0)
goto write_error;
+ if (add_vbranch != NULL)
+ {
+ if (fprintf (fprcs, "\012%s.1\012", add_vbranch) < 0 ||
+ fprintf (fprcs, "log\012@") < 0 ||
+ expand_at_signs (message, (off_t) strlen (message), fprcs) < 0 ||
+ fprintf (fprcs, "@\012text\012") < 0 ||
+ fprintf (fprcs, "@@\012") < 0)
+ goto write_error;
}
+
if (fclose (fprcs) == EOF)
{
ierrno = errno;
@@ -1069,7 +1143,7 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
if (chmod (rcs, mode) < 0)
{
ierrno = errno;
- fperror (logfp, 0, ierrno,
+ fperror (add_logfp, 0, ierrno,
"WARNING: cannot change mode of file %s", rcs);
error (0, ierrno, "WARNING: cannot change mode of file %s", rcs);
err++;
@@ -1086,12 +1160,12 @@ write_error:
(void) fclose (fprcs);
write_error_noclose:
(void) fclose (fpuser);
- fperror (logfp, 0, ierrno, "ERROR: cannot write file %s", rcs);
+ fperror (add_logfp, 0, ierrno, "ERROR: cannot write file %s", rcs);
error (0, ierrno, "ERROR: cannot write file %s", rcs);
if (ierrno == ENOSPC)
{
(void) CVS_UNLINK (rcs);
- fperror (logfp, 0, 0, "ERROR: out of space - aborting");
+ fperror (add_logfp, 0, 0, "ERROR: out of space - aborting");
error (1, 0, "ERROR: out of space - aborting");
}
read_error:
diff --git a/gnu/usr.bin/cvs/src/log.c b/gnu/usr.bin/cvs/src/log.c
index 8fb6910a2f7..3fd37d4492b 100644
--- a/gnu/usr.bin/cvs/src/log.c
+++ b/gnu/usr.bin/cvs/src/log.c
@@ -167,7 +167,7 @@ cvslog (argc, argv)
memset (&log_data, 0, sizeof log_data);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+bd:hlNRr::s:tw::")) != -1)
{
switch (c)
diff --git a/gnu/usr.bin/cvs/src/login.c b/gnu/usr.bin/cvs/src/login.c
index 656ff4171db..cc277a6ef0d 100644
--- a/gnu/usr.bin/cvs/src/login.c
+++ b/gnu/usr.bin/cvs/src/login.c
@@ -178,11 +178,6 @@ login (argc, argv)
already_entered = 1;
break;
}
- else
- {
- free (linebuf);
- linebuf = (char *) NULL;
- }
}
fclose (fp);
}
@@ -217,13 +212,13 @@ login (argc, argv)
if (fp == NULL)
{
error (1, errno, "unable to open %s", passfile);
+ if (linebuf)
+ free (linebuf);
return 1;
}
/* I'm not paranoid, they really ARE out to get me: */
chmod (passfile, 0600);
- free (linebuf);
- linebuf = (char *) NULL;
while (getline (&linebuf, &linebuf_len, fp) >= 0)
{
if (strncmp (CVSroot_original, linebuf, root_len))
@@ -232,9 +227,9 @@ login (argc, argv)
fprintf (tmp_fp, "%s %s\n", CVSroot_original,
typed_password);
- free (linebuf);
- linebuf = (char *) NULL;
}
+ if (linebuf)
+ free (linebuf);
fclose (tmp_fp);
fclose (fp);
copy_file (tmp_name, passfile);
@@ -245,6 +240,8 @@ login (argc, argv)
}
else
{
+ if (linebuf)
+ free (linebuf);
if ((fp = CVS_FOPEN (passfile, "a")) == NULL)
{
error (1, errno, "could not open %s", passfile);
@@ -335,11 +332,6 @@ get_cvs_password ()
found_it = 1;
break;
}
- else
- {
- free (linebuf);
- linebuf = (char *) NULL;
- }
}
if (found_it)
@@ -351,15 +343,15 @@ get_cvs_password ()
password = strtok (NULL, "\n");
/* Give it permanent storage. */
- tmp = xmalloc (strlen (password) + 1);
- strcpy (tmp, password);
- tmp[strlen (password)] = '\0';
+ tmp = xstrdup (password);
memset (password, 0, strlen (password));
free (linebuf);
return tmp;
}
else
{
+ if (linebuf)
+ free (linebuf);
error (0, 0, "cannot find password");
error (1, 0, "use \"cvs login\" to log in first");
}
@@ -445,6 +437,8 @@ logout (argc, argv)
else
found = TRUE;
}
+ if (linebuf)
+ free (linebuf);
fclose (fp);
fclose (tmp_fp);
diff --git a/gnu/usr.bin/cvs/src/logmsg.c b/gnu/usr.bin/cvs/src/logmsg.c
index 98e4ae1ff93..2655fd9214d 100644
--- a/gnu/usr.bin/cvs/src/logmsg.c
+++ b/gnu/usr.bin/cvs/src/logmsg.c
@@ -771,6 +771,8 @@ logfile_write (repository, filter, message, logfp, changes)
(void) walklist (changes, title_proc, NULL);
}
+ free (str_list_format);
+
/* Construct the final string. */
srepos = Short_Repository (repository);
diff --git a/gnu/usr.bin/cvs/src/mkmodules.c b/gnu/usr.bin/cvs/src/mkmodules.c
index a5be35808ee..ec5d7703f76 100644
--- a/gnu/usr.bin/cvs/src/mkmodules.c
+++ b/gnu/usr.bin/cvs/src/mkmodules.c
@@ -446,6 +446,8 @@ mkmodules (dir)
}
free (temp);
}
+ if (line)
+ free (line);
if (ferror (fp))
error (0, errno, "cannot read %s", CVSROOTADM_CHECKOUTLIST);
if (fclose (fp) < 0)
@@ -706,6 +708,8 @@ init (argc, argv)
char *info;
/* Name of ,v file for this administrative file. */
char *info_v;
+ /* Exit status. */
+ int err;
const struct admin_file *fileptr;
@@ -737,7 +741,10 @@ init (argc, argv)
strcat (adm, CVSROOTADM);
mkdir_if_needed (adm);
- /* This is needed by the call to "ci" below. */
+ /* This is needed because we pass "fileptr->filename" not "info"
+ to add_rcs_file below. I think this would be easy to change,
+ thus nuking the need for CVS_CHDIR here, but I haven't looked
+ closely (e.g. see wrappers calls within add_rcs_file). */
if ( CVS_CHDIR (adm) < 0)
error (1, errno, "cannot change to directory %s", adm);
@@ -774,16 +781,15 @@ init (argc, argv)
if (fclose (fp) < 0)
error (1, errno, "cannot close %s", info);
}
- /* Now check the file in. FIXME: we could be using
- add_rcs_file from import.c which is faster (if it were
- tweaked slightly). */
- run_setup ("%s%s -x,v/ -q -u -t-", Rcsbin, RCS_CI);
- run_args ("-minitial checkin of %s", fileptr->filename);
- run_arg (fileptr->filename);
- retcode = run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL);
+ /* The message used to say " of " and fileptr->filename after
+ "initial checkin" but I fail to see the point as we know what
+ file it is from the name. */
+ retcode = add_rcs_file ("initial checkin", info_v,
+ fileptr->filename, "1.1", NULL, NULL,
+ 0, NULL, NULL);
if (retcode != 0)
- error (1, retcode == -1 ? errno : 0,
- "failed to check in %s", info);
+ /* add_rcs_file already printed an error message. */
+ err = 1;
}
}
diff --git a/gnu/usr.bin/cvs/src/modules.c b/gnu/usr.bin/cvs/src/modules.c
index 814f0cdeb29..e01f73385cc 100644
--- a/gnu/usr.bin/cvs/src/modules.c
+++ b/gnu/usr.bin/cvs/src/modules.c
@@ -445,7 +445,7 @@ do_module (db, mname, m_type, msg, callback_proc, where,
modargv = xmodargv;
/* parse the args */
- optind = 1;
+ optind = 0;
while ((c = getopt (modargc, modargv, CVSMODULE_OPTS)) != -1)
{
switch (c)
@@ -461,7 +461,9 @@ do_module (db, mname, m_type, msg, callback_proc, where,
break;
case 'i':
nonalias_opt = 1;
- checkin_prog = optarg;
+ if (checkin_prog)
+ free (checkin_prog);
+ checkin_prog = xstrdup (optarg);
break;
case 'l':
nonalias_opt = 1;
@@ -469,19 +471,27 @@ do_module (db, mname, m_type, msg, callback_proc, where,
break;
case 'o':
nonalias_opt = 1;
- checkout_prog = optarg;
+ if (checkout_prog)
+ free (checkout_prog);
+ checkout_prog = xstrdup (optarg);
break;
case 'e':
nonalias_opt = 1;
- export_prog = optarg;
+ if (export_prog)
+ free (export_prog);
+ export_prog = xstrdup (optarg);
break;
case 't':
nonalias_opt = 1;
- tag_prog = optarg;
+ if (tag_prog)
+ free (tag_prog);
+ tag_prog = xstrdup (optarg);
break;
case 'u':
nonalias_opt = 1;
- update_prog = optarg;
+ if (update_prog)
+ free (update_prog);
+ update_prog = xstrdup (optarg);
break;
case '?':
error (0, 0,
@@ -535,12 +545,7 @@ do_module (db, mname, m_type, msg, callback_proc, where,
err += callback_proc (&modargc, modargv, where, mwhere, mfile, shorten,
local_specified, mname, msg);
-#if 0
- /* FIXME: I've fixed this so that the correct arguments are called,
- but now this fails because there is code below this point that
- uses optarg values extracted from the arg vector. */
free_names (&xmodargc, xmodargv);
-#endif
/* if there were special include args, process them now */
@@ -718,6 +723,16 @@ do_module (db, mname, m_type, msg, callback_proc, where,
/* clean up */
if (mwhere)
free (mwhere);
+ if (checkin_prog)
+ free (checkin_prog);
+ if (checkout_prog)
+ free (checkout_prog);
+ if (export_prog)
+ free (export_prog);
+ if (tag_prog)
+ free (tag_prog);
+ if (update_prog)
+ free (update_prog);
if (cwd_saved)
free_cwd (&cwd);
if (zvalue != NULL)
@@ -894,6 +909,8 @@ cat_module (status)
save_d (key.dptr, key.dsize, val.dptr, val.dsize);
}
+ close_module (db);
+
/* Sort the list as requested */
qsort ((PTR) s_head, s_count, sizeof (struct sortrec), sort_order);
diff --git a/gnu/usr.bin/cvs/src/parseinfo.c b/gnu/usr.bin/cvs/src/parseinfo.c
index 1011965835e..833463ac7d0 100644
--- a/gnu/usr.bin/cvs/src/parseinfo.c
+++ b/gnu/usr.bin/cvs/src/parseinfo.c
@@ -54,6 +54,7 @@ Parse_Info (infofile, repository, callproc, all)
/* If no file, don't do anything special. */
if (!existence_error (errno))
error (0, errno, "cannot open %s", infopath);
+ free (infopath);
return 0;
}
@@ -105,6 +106,8 @@ Parse_Info (infofile, repository, callproc, all)
if ((cp = strrchr (value, '\n')) != NULL)
*cp = '\0';
+ if (expanded_value != NULL)
+ free (expanded_value);
expanded_value = expand_path (value, infofile, line_number);
if (!expanded_value)
{
@@ -121,6 +124,10 @@ Parse_Info (infofile, repository, callproc, all)
/* save the default value so we have it later if we need it */
if (strcmp (exp, "DEFAULT") == 0)
{
+ /* Is it OK to silently ignore all but the last DEFAULT
+ expression? */
+ if (default_value != NULL)
+ free (default_value);
default_value = xstrdup (expanded_value);
continue;
}
diff --git a/gnu/usr.bin/cvs/src/rcs.h b/gnu/usr.bin/cvs/src/rcs.h
index 699280a79ad..1855fb99c76 100644
--- a/gnu/usr.bin/cvs/src/rcs.h
+++ b/gnu/usr.bin/cvs/src/rcs.h
@@ -124,3 +124,9 @@ int RCS_deltag PROTO ((RCSNode *, const char *, int));
int RCS_setbranch PROTO((RCSNode *, const char *));
int RCS_lock PROTO ((RCSNode *, const char *, int));
int RCS_unlock PROTO ((RCSNode *, const char *, int));
+int rcs_change_text PROTO ((const char *, char *, size_t, const char *,
+ size_t, char **, size_t *));
+
+/* From import.c. */
+extern int add_rcs_file PROTO ((char *, char *, char *, char *,
+ char *, char *, int, char **, FILE *));
diff --git a/gnu/usr.bin/cvs/src/recurse.c b/gnu/usr.bin/cvs/src/recurse.c
index 804c3a1be58..b4b55a8efe3 100644
--- a/gnu/usr.bin/cvs/src/recurse.c
+++ b/gnu/usr.bin/cvs/src/recurse.c
@@ -135,10 +135,17 @@ start_recursion (fileproc, filesdoneproc, direntproc, dirleaveproc, callerdat,
}
if (filelist)
dellist (&filelist); /* FIXME-krp: no longer correct. */
-/* FIXME-krp: clean up files_by_dir */
if (dirlist)
dellist (&dirlist);
+#ifdef SERVER_SUPPORT
+ if (server_active)
+ {
+ for (i = 0; i < argc; ++i)
+ server_pathname_check (argv[i]);
+ }
+#endif
+
if (argc == 0)
{
@@ -218,7 +225,11 @@ start_recursion (fileproc, filesdoneproc, direntproc, dirleaveproc, callerdat,
addfile (&files_by_dir, dir, comp);
else if (isdir (dir))
{
- if ((which & W_LOCAL) && isdir (CVSADM))
+ if ((which & W_LOCAL) && isdir (CVSADM)
+#ifdef CLIENT_SUPPORT
+ && !client_active
+#endif
+ )
{
/* otherwise, look for it in the repository. */
char *tmp_update_dir;
@@ -249,6 +260,7 @@ start_recursion (fileproc, filesdoneproc, direntproc, dirleaveproc, callerdat,
addfile (&files_by_dir, dir, comp);
free (tmp_update_dir);
+ free (reposfile);
}
else
addfile (&files_by_dir, dir, comp);
@@ -267,15 +279,14 @@ start_recursion (fileproc, filesdoneproc, direntproc, dirleaveproc, callerdat,
calling do_recursion. */
err += walklist (files_by_dir, unroll_files_proc, (void *) &frame);
+ dellist(&files_by_dir);
/* then do_recursion on the dirlist. */
if (dirlist != NULL)
err += do_recursion (&frame);
/* Free the data which expand_wild allocated. */
- for (i = 0; i < argc; ++i)
- free (argv[i]);
- free (argv);
+ free_names (&argc, argv);
out:
free (update_dir);
@@ -769,6 +780,7 @@ unroll_files_proc (p, closure)
/* otherwise, call dorecusion for this list of files. */
filelist = (List *) p->data;
+ p->data = NULL;
save_dirlist = dirlist;
dirlist = NULL;
diff --git a/gnu/usr.bin/cvs/src/release.c b/gnu/usr.bin/cvs/src/release.c
index f2f1edf5b0e..702e90360dc 100644
--- a/gnu/usr.bin/cvs/src/release.c
+++ b/gnu/usr.bin/cvs/src/release.c
@@ -81,7 +81,7 @@ release (argc, argv)
/* Everything from here on is client or local. */
if (argc == -1)
usage (release_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+Qdq")) != -1)
{
switch (c)
diff --git a/gnu/usr.bin/cvs/src/remove.c b/gnu/usr.bin/cvs/src/remove.c
index 157125068fe..46c416938a9 100644
--- a/gnu/usr.bin/cvs/src/remove.c
+++ b/gnu/usr.bin/cvs/src/remove.c
@@ -50,7 +50,7 @@ cvsremove (argc, argv)
if (argc == -1)
usage (remove_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+flR")) != -1)
{
switch (c)
diff --git a/gnu/usr.bin/cvs/src/root.c b/gnu/usr.bin/cvs/src/root.c
index 26910328fe9..bf5c89e7a27 100644
--- a/gnu/usr.bin/cvs/src/root.c
+++ b/gnu/usr.bin/cvs/src/root.c
@@ -199,6 +199,86 @@ Create_Root (dir, rootdir)
#endif /* ! DEBUG */
+/* The root_allow_* stuff maintains a list of legal CVSROOT
+ directories. Then we can check against them when a remote user
+ hands us a CVSROOT directory. */
+
+static unsigned int root_allow_count;
+static char **root_allow_vector;
+static unsigned int root_allow_size;
+
+void
+root_allow_add (arg)
+ char *arg;
+{
+ char *p;
+
+ if (root_allow_size <= root_allow_count)
+ {
+ if (root_allow_size == 0)
+ {
+ root_allow_size = 1;
+ root_allow_vector =
+ (char **) malloc (root_allow_size * sizeof (char *));
+ }
+ else
+ {
+ root_allow_size *= 2;
+ root_allow_vector =
+ (char **) realloc (root_allow_vector,
+ root_allow_size * sizeof (char *));
+ }
+
+ if (root_allow_vector == NULL)
+ {
+ no_memory:
+ /* Strictly speaking, we're not supposed to output anything
+ now. But we're about to exit(), give it a try. */
+ printf ("E Fatal server error, aborting.\n\
+error ENOMEM Virtual memory exhausted.\n");
+
+ /* I'm doing this manually rather than via error_exit ()
+ because I'm not sure whether we want to call server_cleanup.
+ Needs more investigation.... */
+
+#ifdef SYSTEM_CLEANUP
+ /* Hook for OS-specific behavior, for example socket
+ subsystems on NT and OS2 or dealing with windows
+ and arguments on Mac. */
+ SYSTEM_CLEANUP ();
+#endif
+
+ exit (EXIT_FAILURE);
+ }
+ }
+ p = malloc (strlen (arg) + 1);
+ if (p == NULL)
+ goto no_memory;
+ strcpy (p, arg);
+ root_allow_vector[root_allow_count++] = p;
+}
+
+void
+root_allow_free ()
+{
+ if (root_allow_vector != NULL)
+ free (root_allow_vector);
+ root_allow_count = 0;
+ root_allow_size = 0;
+}
+
+int
+root_allow_ok (arg)
+ char *arg;
+{
+ unsigned int i;
+ for (i = 0; i < root_allow_count; ++i)
+ if (strcmp (root_allow_vector[i], arg) == 0)
+ return 1;
+ return 0;
+}
+
+
/* Parse a CVSROOT variable into its constituent parts -- method,
* username, hostname, directory. The prototypical CVSROOT variable
* looks like:
diff --git a/gnu/usr.bin/cvs/src/rtag.c b/gnu/usr.bin/cvs/src/rtag.c
index 1e2017b9b0d..934cd40b286 100644
--- a/gnu/usr.bin/cvs/src/rtag.c
+++ b/gnu/usr.bin/cvs/src/rtag.c
@@ -91,7 +91,7 @@ rtag (argc, argv)
if (argc == -1)
usage (rtag_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+FanfQqlRdbr:D:")) != -1)
{
switch (c)
diff --git a/gnu/usr.bin/cvs/src/run.c b/gnu/usr.bin/cvs/src/run.c
index 74e418dc3ed..5b59bca9833 100644
--- a/gnu/usr.bin/cvs/src/run.c
+++ b/gnu/usr.bin/cvs/src/run.c
@@ -445,6 +445,13 @@ piped_child (command, tofdp, fromfdp)
if (pipe (from_child_pipe) < 0)
error (1, errno, "cannot create pipe");
+#ifdef USE_SETMODE_BINARY
+ setmode (to_child_pipe[0], O_BINARY);
+ setmode (to_child_pipe[1], O_BINARY);
+ setmode (from_child_pipe[0], O_BINARY);
+ setmode (from_child_pipe[1], O_BINARY);
+#endif
+
#ifdef HAVE_VFORK
pid = vfork ();
#else
@@ -506,6 +513,11 @@ filter_stream_through_program (oldfd, dir, prog, pidp)
if (pipe (p))
error (1, errno, "cannot create pipe");
+#ifdef USE_SETMODE_BINARY
+ setmode (p[0], O_BINARY);
+ setmode (p[1], O_BINARY);
+#endif
+
#ifdef HAVE_VFORK
newpid = vfork ();
#else
diff --git a/gnu/usr.bin/cvs/src/sanity.sh b/gnu/usr.bin/cvs/src/sanity.sh
index 9f556209329..a815fc0539c 100644
--- a/gnu/usr.bin/cvs/src/sanity.sh
+++ b/gnu/usr.bin/cvs/src/sanity.sh
@@ -25,11 +25,7 @@ esac
# required to make this script work properly.
unset CVSREAD
-TESTDIR=/tmp/cvs-sanity
-# 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.
-TMPPWD=`cd /tmp; /bin/pwd`
+TESTDIR=${TESTDIR:-/tmp/cvs-sanity}
# "debugger"
#set -x
@@ -460,6 +456,10 @@ dotest_status ()
rm -rf ${TESTDIR}
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.
+TMPPWD=`/bin/pwd`
# Avoid picking up any stray .cvsrc, etc., from the user running the tests
mkdir home
@@ -478,8 +478,12 @@ RCSINIT=; export RCSINIT
# tests.
if test x"$*" = x; then
- tests="basica basicb basic1 deep basic2 rdiff death death2 branches multibranch import join new newb conflicts conflicts2 modules modules2 modules3 mflag errmsg1 devcom devcom2 devcom3 ignore binfiles binwrap info serverpatch log log2 crerepos rcs big modes"
- tests="${tests} sticky keyword"
+ tests="basica basicb basic1 deep basic2 rdiff death death2 branches"
+ tests="${tests} multibranch import join new newb conflicts conflicts2"
+ tests="${tests} modules modules2 modules3 mflag errmsg1 devcom devcom2"
+ tests="${tests} devcom3 ignore binfiles binfiles2 binwrap mwrap info"
+ tests="${tests} serverpatch log log2 crerepos rcs big modes stamps"
+ tests="${tests} sticky keyword toplevel"
else
tests="$*"
fi
@@ -554,9 +558,9 @@ for what in $tests; do
dotest basica-0a "${testcvs} -q co -l ." ''
mkdir first-dir
dotest basica-0b "${testcvs} add first-dir" \
-"Directory /tmp/cvs-sanity/cvsroot/first-dir added to the repository"
+"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
cd ..
- rm -rf 1
+ rm -r 1
dotest basica-1 "${testcvs} -q co first-dir" ''
cd first-dir
@@ -571,17 +575,17 @@ for what in $tests; do
# Remote CVS gives the "cannot open CVS/Entries" error, which is
# clearly a bug, but not a simple one to fix.
dotest basica-1a10 "${testcvs} -n add sdir" \
-'Directory /tmp/cvs-sanity/cvsroot/first-dir/sdir added to the repository' \
+"Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository" \
"${PROG} add: cannot open CVS/Entries for reading: No such file or directory
-Directory /tmp/cvs-sanity/cvsroot/first-dir/sdir added to the repository"
+Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
dotest_fail basica-1a11 \
"test -d ${CVSROOT_DIRNAME}/first-dir/sdir" ''
dotest basica-2 "${testcvs} add sdir" \
-'Directory /tmp/cvs-sanity/cvsroot/first-dir/sdir added to the repository'
+"Directory ${TESTDIR}/cvsroot/first-dir/sdir added to the repository"
cd sdir
mkdir ssdir
dotest basica-3 "${testcvs} add ssdir" \
-'Directory /tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir added to the repository'
+"Directory ${TESTDIR}/cvsroot/first-dir/sdir/ssdir added to the repository"
cd ssdir
echo ssfile >ssfile
@@ -603,25 +607,25 @@ Directory /tmp/cvs-sanity/cvsroot/first-dir/sdir added to the repository"
${PROG} "'\[[a-z]* aborted\]: correct the above errors first!'
cd ../..
dotest basica-5 "${testcvs} -q ci -m add-it" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir/ssfile,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
done
Checking in sdir/ssdir/ssfile;
-/tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
initial revision: 1\.1
-done'
+done"
dotest_fail basica-5a \
"${testcvs} -q tag BASE sdir/ssdir/ssfile" \
"${PROG} [a-z]*: Attempt to add reserved tag name BASE
-${PROG} \[[a-z]* aborted\]: failed to set tag BASE to revision 1\.1 in /tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir/ssfile,v"
+${PROG} \[[a-z]* aborted\]: failed to set tag BASE to revision 1\.1 in ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v"
dotest basica-5b "${testcvs} -q tag NOT_RESERVED" \
'T sdir/ssdir/ssfile'
dotest basica-6 "${testcvs} -q update" ''
echo "ssfile line 2" >>sdir/ssdir/ssfile
dotest_status basica-6.2 1 "${testcvs} -q diff -c" \
-'Index: sdir/ssdir/ssfile
+"Index: sdir/ssdir/ssfile
===================================================================
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir/ssfile,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
retrieving revision 1\.1
diff -c -r1\.1 ssfile
\*\*\* ssfile [0-9/]* [0-9:]* 1\.1
@@ -630,11 +634,11 @@ diff -c -r1\.1 ssfile
\*\*\* 1 \*\*\*\*
--- 1,2 ----
ssfile
-'"${PLUS} ssfile line 2"
+${PLUS} ssfile line 2"
dotest_status basica-6.3 1 "${testcvs} -q diff -c -rBASE" \
-'Index: sdir/ssdir/ssfile
+"Index: sdir/ssdir/ssfile
===================================================================
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir/ssfile,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
retrieving revision 1\.1
diff -c -r1\.1 ssfile
\*\*\* ssfile [0-9/]* [0-9:]* 1\.1
@@ -643,12 +647,12 @@ diff -c -r1\.1 ssfile
\*\*\* 1 \*\*\*\*
--- 1,2 ----
ssfile
-'"${PLUS} ssfile line 2"
+${PLUS} ssfile line 2"
dotest basica-7 "${testcvs} -q ci -m modify-it" \
-'Checking in sdir/ssdir/ssfile;
-/tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+"Checking in sdir/ssdir/ssfile;
+${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
dotest_fail basica-nonexist "${testcvs} -q ci nonexist" \
"${PROG}"' [a-z]*: nothing known about `nonexist'\''
'"${PROG}"' \[[a-z]* aborted\]: correct above errors first!'
@@ -658,39 +662,39 @@ done'
cd sdir/ssdir
dotest basica-8a0 "${testcvs} -q ci -m not-modified ssfile" ''
dotest basica-8a "${testcvs} -q ci -f -m force-it" \
-'Checking in ssfile;
-/tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+"Checking in ssfile;
+${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
new revision: 1\.3; previous revision: 1\.2
-done'
+done"
dotest basica-8a1 "${testcvs} -q ci -m bump-it -r 2.0" \
-'Checking in ssfile;
-/tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+"Checking in ssfile;
+${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
new revision: 2\.0; previous revision: 1\.3
-done'
+done"
# -f should not be necessary, but it should be harmless.
# Also test the "-r 3" (rather than "-r 3.0") usage.
dotest basica-8a2 "${testcvs} -q ci -m bump-it -f -r 3" \
-'Checking in ssfile;
-/tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
+"Checking in ssfile;
+${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v <-- ssfile
new revision: 3\.1; previous revision: 2\.0
-done'
+done"
cd ../..
dotest basica-8b "${testcvs} -q diff -r1.2 -r1.3" \
-'Index: sdir/ssdir/ssfile
+"Index: sdir/ssdir/ssfile
===================================================================
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/sdir/ssdir/ssfile,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/sdir/ssdir/ssfile,v
retrieving revision 1\.2
retrieving revision 1\.3
-diff -r1\.2 -r1\.3'
+diff -r1\.2 -r1\.3"
# 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 \
- "${testcvs} -q -d /tmp/cvs-sanity/nonexist update" \
-"${PROG}: cannot access cvs root /tmp/cvs-sanity/nonexist: .*"
+ "${testcvs} -q -d ${TESTDIR}/nonexist update" \
+"${PROG}: cannot access cvs root ${TESTDIR}/nonexist: .*"
dotest_fail basica-9 \
- "${testcvs} -q -d /tmp/cvs-sanity/nonexist update" \
-"${PROG} \[[a-z]* aborted\]: /tmp/cvs-sanity/nonexist/CVSROOT: .*"
+ "${testcvs} -q -d ${TESTDIR}/nonexist update" \
+"${PROG} \[[a-z]* aborted\]: ${TESTDIR}/nonexist/CVSROOT: .*"
dotest basica-10 "${testcvs} annotate" \
'Annotations for sdir/ssdir/ssfile
@@ -712,21 +716,21 @@ diff -r1\.2 -r1\.3'
"${PROG} [a-z]*: scheduling file .topfile. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest basicb-0c "${testcvs} -q ci -m add-it topfile" \
-'RCS file: /tmp/cvs-sanity/cvsroot/./topfile,v
+"RCS file: ${TESTDIR}/cvsroot/\./topfile,v
done
Checking in topfile;
-/tmp/cvs-sanity/cvsroot/./topfile,v <-- topfile
+${TESTDIR}/cvsroot/\./topfile,v <-- topfile
initial revision: 1\.1
-done'
+done"
cd ..
- rm -rf 1
+ rm -r 1
mkdir 2; cd 2
dotest basicb-0d "${testcvs} -q co -l ." "U topfile"
mkdir first-dir
dotest basicb-0e "${testcvs} add first-dir" \
-"Directory /tmp/cvs-sanity/cvsroot/first-dir added to the repository"
+"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
cd ..
- rm -rf 2
+ rm -r 2
: mkdir ${CVSROOT_DIRNAME}/first-dir
dotest basicb-1 "${testcvs} -q co first-dir" ''
@@ -740,8 +744,8 @@ done'
cd first-dir
mkdir sdir1 sdir2
dotest basicb-2 "${testcvs} add sdir1 sdir2" \
-'Directory /tmp/cvs-sanity/cvsroot/first-dir/sdir1 added to the repository
-Directory /tmp/cvs-sanity/cvsroot/first-dir/sdir2 added to the repository'
+"Directory ${TESTDIR}/cvsroot/first-dir/sdir1 added to the repository
+Directory ${TESTDIR}/cvsroot/first-dir/sdir2 added to the repository"
cd sdir1
echo sfile1 starts >sfile1
dotest basicb-2a10 "${testcvs} -n add sfile1" \
@@ -777,32 +781,32 @@ ${PROG} [a-z]*: use .cvs commit. to add this file permanently"
${PROG} [a-z]*: but CVS uses CVS for its own purposes; skipping CVS directory"
cd ..
dotest basicb-5 "${testcvs} -q ci -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/sdir1/sfile1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/sdir1/sfile1,v
done
Checking in sdir1/sfile1;
-/tmp/cvs-sanity/cvsroot/first-dir/sdir1/sfile1,v <-- sfile1
+${TESTDIR}/cvsroot/first-dir/sdir1/sfile1,v <-- sfile1
initial revision: 1\.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/sdir2/sfile2,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/sdir2/sfile2,v
done
Checking in sdir2/sfile2;
-/tmp/cvs-sanity/cvsroot/first-dir/sdir2/sfile2,v <-- sfile2
+${TESTDIR}/cvsroot/first-dir/sdir2/sfile2,v <-- sfile2
initial revision: 1\.1
-done'
+done"
echo sfile1 develops >sdir1/sfile1
dotest basicb-6 "${testcvs} -q ci -m modify" \
-'Checking in sdir1/sfile1;
-/tmp/cvs-sanity/cvsroot/first-dir/sdir1/sfile1,v <-- sfile1
+"Checking in sdir1/sfile1;
+${TESTDIR}/cvsroot/first-dir/sdir1/sfile1,v <-- sfile1
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
dotest basicb-7 "${testcvs} -q tag release-1" 'T sdir1/sfile1
T sdir2/sfile2'
echo not in time for release-1 >sdir2/sfile2
dotest basicb-8 "${testcvs} -q ci -m modify-2" \
-'Checking in sdir2/sfile2;
-/tmp/cvs-sanity/cvsroot/first-dir/sdir2/sfile2,v <-- sfile2
+"Checking in sdir2/sfile2;
+${TESTDIR}/cvsroot/first-dir/sdir2/sfile2,v <-- sfile2
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
# See if CVS can correctly notice when an invalid numeric
# revision is specified.
# Commented out until we get around to fixing CVS
@@ -815,9 +819,9 @@ done'
dotest basicb-cod-1 "${testcvs} -q co -d first-dir1 first-dir" \
'U first-dir1/sdir1/sfile1
U first-dir1/sdir2/sfile2'
- rm -rf first-dir1
+ rm -r first-dir1
- rm -rf first-dir
+ rm -r first-dir
dotest basicb-9 \
"${testcvs} -q co -d newdir -r release-1 first-dir/sdir1 first-dir/sdir2" \
'U newdir/sdir1/sfile1
@@ -832,7 +836,7 @@ U newdir/sdir2/sfile2'
"sfile1 develops
sfile2 starts"
- rm -rf newdir
+ rm -r newdir
# Hmm, this might be a case for CVSNULLREPOS, but CVS doesn't
# seem to deal with it...
@@ -862,14 +866,14 @@ U sub1/sub2/sdir2/sfile2"
"${PROG} [a-z]*: scheduling file .aa. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest basicb-17 "${testcvs} -q ci -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/second-dir/aa,v
+"RCS file: ${TESTDIR}/cvsroot/second-dir/aa,v
done
Checking in aa;
-/tmp/cvs-sanity/cvsroot/second-dir/aa,v <-- aa
+${TESTDIR}/cvsroot/second-dir/aa,v <-- aa
initial revision: 1\.1
-done'
+done"
cd ../..
- rm -rf 1
+ rm -r 1
# Now here is the kicker: note that the semantics of -d
# are fundamentally different if we specify two or more directories
# rather than one! I consider this to be seriously bogus,
@@ -890,135 +894,413 @@ U test2/second-dir/aa"
"${PROG} [a-z]*: scheduling file .emptyfile. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest basicb-20 "${testcvs} -q ci -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/CVSROOT/Emptydir/emptyfile,v
+"RCS file: ${TESTDIR}/cvsroot/CVSROOT/Emptydir/emptyfile,v
done
Checking in emptyfile;
-/tmp/cvs-sanity/cvsroot/CVSROOT/Emptydir/emptyfile,v <-- emptyfile
+${TESTDIR}/cvsroot/CVSROOT/Emptydir/emptyfile,v <-- emptyfile
initial revision: 1\.1
-done'
+done"
+ cd ..
+
+ mkdir 1; cd 1
+ # "cvs admin" tests are scattered around a bit. Here we test
+ # ability to reject an unrecognized option. The "keyword"
+ # test has a test of "cvs admin -l" and the "binfiles" test
+ # has a test of "cvs admin -k". Note that -H is an illegal
+ # option. It probably should be an error message. But
+ # currently it is one error message for each file operated on,
+ # which in this case is zero files.
+ dotest basicb-21 "${testcvs} -q admin -H" ""
cd ..
- rm -rf test2
+ rmdir 1
+
+ if test "$keep" = yes; then
+ echo Keeping ${TESTDIR} and exiting due to --keep
+ exit 0
+ fi
+
+ rm -r test2
rm -rf ${CVSROOT_DIRNAME}/first-dir
rm -rf ${CVSROOT_DIRNAME}/second-dir
+ rm -rf ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
rm -f ${CVSROOT_DIRNAME}/topfile,v
;;
- basic1) # first dive - add a files, first singly, then in a group.
- mkdir ${CVSROOT_DIRNAME}/first-dir
- mkdir 1; cd 1
- # check out an empty directory
- if ${CVS} co first-dir ; then
- echo "PASS: test 13a" >>${LOGFILE}
- else
- echo "FAIL: test 13a" | tee -a ${LOGFILE}; exit 1
- fi
+ basic1)
+ # first dive - add a files, first singly, then in a group.
+ mkdir ${CVSROOT_DIRNAME}/first-dir
+ mkdir 1; cd 1
+ # check out an empty directory
+ dotest basic1-1 "${testcvs} -q co first-dir" ''
- cd first-dir
- files=first-file
- for i in a b ; do
- for j in ${files} ; do
- echo $j > $j
- done
+ cd first-dir
+ echo file2 >file2
+ echo file3 >file3
+ echo file4 >file4
+ echo file5 >file5
+
+ dotest basic1-14-add-add "${testcvs} add file2 file3 file4 file5" \
+"${PROG} [a-z]*: scheduling file \`file2' for addition
+${PROG} [a-z]*: scheduling file \`file3' for addition
+${PROG} [a-z]*: scheduling file \`file4' for addition
+${PROG} [a-z]*: scheduling file \`file5' for addition
+${PROG} [a-z]*: use 'cvs commit' to add these files permanently"
+ dotest basic1-15-add-add \
+"${testcvs} -q update file2 file3 file4 file5" \
+"A file2
+A file3
+A file4
+A file5"
+ dotest basic1-16-add-add "${testcvs} -q update" \
+"A file2
+A file3
+A file4
+A file5"
+ dotest basic1-17-add-add "${testcvs} -q status" \
+"===================================================================
+File: file2 Status: Locally Added
- for do in add rm ; do
- for j in ${do} "commit -m test" ; do
- # ${do}
- if ${CVS} $j ${files} >> ${LOGFILE} 2>&1; then
- echo "PASS: test 14-${do}-$j" >>${LOGFILE}
- else
- echo "FAIL: test 14-${do}-$j" | tee -a ${LOGFILE}; exit 1
- fi
-
- # update it.
- if test "${do}" = "rm" -a "$j" != "commit -m test" || ${CVS} update ${files} ; then
- echo "PASS: test 15-${do}-$j" >>${LOGFILE}
- else
- echo "FAIL: test 15-${do}-$j" | tee -a ${LOGFILE}; exit 1
- fi
-
- # update all.
- if ${CVS} update ; then
- echo "PASS: test 16-${do}-$j" >>${LOGFILE}
- else
- echo "FAIL: test 16-${do}-$j" | tee -a ${LOGFILE}; exit 1
- fi
-
- # status all.
- if ${CVS} status >> ${LOGFILE}; then
- echo "PASS: test 17-${do}-$j" >>${LOGFILE}
- else
- echo "FAIL: test 17-${do}-$j" | tee -a ${LOGFILE}; exit 1
- fi
-
- # FIXME: this one doesn't work yet for added files.
- # log all.
- if ${CVS} log >> ${LOGFILE}; then
- echo "PASS: test 18-${do}-$j" >>${LOGFILE}
- else
- echo "FAIL: test 18-${do}-$j" | tee -a ${LOGFILE}
- fi
-
- cd ..
- # update all.
- if ${CVS} update ; then
- echo "PASS: test 21-${do}-$j" >>${LOGFILE}
- else
- echo "FAIL: test 21-${do}-$j" | tee -a ${LOGFILE}; exit 1
- fi
-
- # log all.
- # FIXME: doesn't work right for added files.
- if ${CVS} log first-dir >> ${LOGFILE}; then
- echo "PASS: test 22-${do}-$j" >>${LOGFILE}
- else
- echo "FAIL: test 22-${do}-$j" | tee -a ${LOGFILE}
- fi
-
- # status all.
- if ${CVS} status first-dir >> ${LOGFILE}; then
- echo "PASS: test 23-${do}-$j" >>${LOGFILE}
- else
- echo "FAIL: test 23-${do}-$j" | tee -a ${LOGFILE}; exit 1
- fi
-
- # update all.
- if ${CVS} update first-dir ; then
- echo "PASS: test 24-${do}-$j" >>${LOGFILE}
- else
- echo "FAIL: test 24-${do}-$j" | tee -a ${LOGFILE} ; exit 1
- fi
-
- # update all.
- if ${CVS} co first-dir ; then
- echo "PASS: test 27-${do}-$j" >>${LOGFILE}
- else
- echo "FAIL: test 27-${do}-$j" | tee -a ${LOGFILE} ; exit 1
- fi
-
- cd first-dir
- done # j
- rm -f ${files}
- done # do
-
- files="file2 file3 file4 file5"
- done
- if ${CVS} tag first-dive ; then
- echo "PASS: test 28" >>${LOGFILE}
- else
- echo "FAIL: test 28" | tee -a ${LOGFILE} ; exit 1
- fi
- cd ..
- cd ..
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
- if test "$keep" = yes; then
- echo Keeping /tmp/cvs-sanity and exiting due to --keep
- exit 0
- fi
+===================================================================
+File: file3 Status: Locally Added
- rm -rf 1
- rm -rf ${CVSROOT_DIRNAME}/first-dir
- ;;
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file4 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file5 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ dotest basic1-18-add-add "${testcvs} -q log" \
+"${PROG} [a-z]*: file2 has been added, but not committed
+${PROG} [a-z]*: file3 has been added, but not committed
+${PROG} [a-z]*: file4 has been added, but not committed
+${PROG} [a-z]*: file5 has been added, but not committed"
+ cd ..
+ dotest basic1-21-add-add "${testcvs} -q update" \
+"A first-dir/file2
+A first-dir/file3
+A first-dir/file4
+A first-dir/file5"
+ # FIXCVS? Shouldn't this read first-dir/file2 instead of file2?
+ dotest basic1-22-add-add "${testcvs} log first-dir" \
+"${PROG} [a-z]*: Logging first-dir
+${PROG} [a-z]*: file2 has been added, but not committed
+${PROG} [a-z]*: file3 has been added, but not committed
+${PROG} [a-z]*: file4 has been added, but not committed
+${PROG} [a-z]*: file5 has been added, but not committed"
+ dotest basic1-23-add-add "${testcvs} status first-dir" \
+"${PROG} [a-z]*: Examining first-dir
+===================================================================
+File: file2 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file3 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file4 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file5 Status: Locally Added
+
+ Working revision: New file!
+ Repository revision: No revision control file
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ dotest basic1-24-add-add "${testcvs} update first-dir" \
+"${PROG} [a-z]*: Updating first-dir
+A first-dir/file2
+A first-dir/file3
+A first-dir/file4
+A first-dir/file5"
+ dotest basic1-27-add-add "${testcvs} co first-dir" \
+"${PROG} [a-z]*: Updating first-dir
+A first-dir/file2
+A first-dir/file3
+A first-dir/file4
+A first-dir/file5"
+ cd first-dir
+ dotest basic1-14-add-ci \
+"${testcvs} commit -m test file2 file3 file4 file5" \
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
+done
+Checking in file2;
+${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+initial revision: 1\.1
+done
+RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
+done
+Checking in file3;
+${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
+initial revision: 1\.1
+done
+RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
+done
+Checking in file4;
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+initial revision: 1\.1
+done
+RCS file: ${TESTDIR}/cvsroot/first-dir/file5,v
+done
+Checking in file5;
+${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
+initial revision: 1\.1
+done"
+ dotest basic1-15-add-ci \
+"${testcvs} -q update file2 file3 file4 file5" ''
+ dotest basic1-16-add-ci "${testcvs} -q update" ''
+ dotest basic1-17-add-ci "${testcvs} -q status" \
+"===================================================================
+File: file2 Status: Up-to-date
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file2,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file3 Status: Up-to-date
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file3,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file4 Status: Up-to-date
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file4,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: file5 Status: Up-to-date
+
+ Working revision: 1\.1.*
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file5,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ # The "log" tests and friends probably already test the output
+ # from log quite adequately.
+ # Note: using dotest fails here. It seems to be related
+ # to the output being sufficiently large (Red Hat 4.1).
+ # dotest basic1-18-add-ci "${testcvs} log" "${DOTSTAR}"
+ if ${testcvs} -q log >>${LOGFILE}; then
+ pass basic1-18-add-ci
+ else
+ pass basic1-18-add-ci
+ fi
+ cd ..
+ dotest basic1-21-add-ci "${testcvs} -q update" ''
+ # See test basic1-18-add-ci for explanation of non-use of dotest.
+ if ${testcvs} -q log first-dir >>${LOGFILE}; then
+ pass basic1-22-add-ci
+ else
+ pass basic1-22-add-ci
+ fi
+ # At least for the moment I am going to consider 17-add-ci
+ # an adequate test of the output here.
+ # See test basic1-18-add-ci for explanation of non-use of dotest.
+ if ${testcvs} -q status first-dir >>${LOGFILE}; then
+ pass basic1-23-add-ci
+ else
+ pass basic1-23-add-ci
+ fi
+ dotest basic1-24-add-ci "${testcvs} -q update first-dir" ''
+ dotest basic1-27-add-ci "${testcvs} -q co first-dir" ''
+
+ cd first-dir
+ rm file2 file3 file4 file5
+ dotest basic1-14-rm-rm "${testcvs} rm file2 file3 file4 file5" \
+"${PROG} [a-z]*: scheduling .file2. for removal
+${PROG} [a-z]*: scheduling .file3. for removal
+${PROG} [a-z]*: scheduling .file4. for removal
+${PROG} [a-z]*: scheduling .file5. for removal
+${PROG} [a-z]*: use .${PROG} commit. to remove these files permanently"
+ # 15-rm-rm was commented out. Why?
+ dotest basic1-15-rm-rm \
+"${testcvs} -q update file2 file3 file4 file5" \
+"R file2
+R file3
+R file4
+R file5"
+ dotest basic1-16-rm-rm "${testcvs} -q update" \
+"R file2
+R file3
+R file4
+R file5"
+ dotest basic1-17-rm-rm "${testcvs} -q status" \
+"===================================================================
+File: no file file2 Status: Locally Removed
+
+ Working revision: -1\.1.*
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file2,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: no file file3 Status: Locally Removed
+
+ Working revision: -1\.1.*
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file3,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: no file file4 Status: Locally Removed
+
+ Working revision: -1\.1.*
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file4,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)
+
+===================================================================
+File: no file file5 Status: Locally Removed
+
+ Working revision: -1\.1.*
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/file5,v
+ Sticky Tag: (none)
+ Sticky Date: (none)
+ Sticky Options: (none)"
+ # Would be nice to test that real logs appear (with dead state
+ # and all), either here or someplace like log2 tests.
+ if ${testcvs} -q log >>${LOGFILE}; then
+ pass basic1-18-rm-rm
+ else
+ fail basic1-18-rm-rm
+ fi
+ cd ..
+ dotest basic1-21-rm-rm "${testcvs} -q update" \
+"R first-dir/file2
+R first-dir/file3
+R first-dir/file4
+R first-dir/file5"
+ if ${testcvs} -q log first-dir >>${LOGFILE}; then
+ pass basic1-22-rm-rm
+ else
+ fail basic1-22-rm-rm
+ fi
+ if ${testcvs} -q status first-dir >>${LOGFILE}; then
+ pass basic1-23-rm-rm
+ else
+ fail basic1-23-rm-rm
+ fi
+ dotest basic1-24-rm-rm "${testcvs} -q update first-dir" \
+"R first-dir/file2
+R first-dir/file3
+R first-dir/file4
+R first-dir/file5"
+ dotest basic1-27-rm-rm "${testcvs} -q co first-dir" \
+"R first-dir/file2
+R first-dir/file3
+R first-dir/file4
+R first-dir/file5"
+ cd first-dir
+ dotest basic1-14-rm-ci "${testcvs} -q commit -m test" \
+"Removing file2;
+${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
+new revision: delete; previous revision: 1\.1
+done
+Removing file3;
+${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
+new revision: delete; previous revision: 1\.1
+done
+Removing file4;
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
+new revision: delete; previous revision: 1\.1
+done
+Removing file5;
+${TESTDIR}/cvsroot/first-dir/file5,v <-- file5
+new revision: delete; previous revision: 1\.1
+done"
+ dotest basic1-15-rm-ci \
+"${testcvs} -q update file2 file3 file4 file5" ''
+ dotest basic1-16-rm-ci "${testcvs} -q update" ''
+ dotest basic1-17-rm-ci "${testcvs} -q status" ''
+ # Would be nice to test that real logs appear (with dead state
+ # and all), either here or someplace like log2 tests.
+ if ${testcvs} -q log >>${LOGFILE}; then
+ pass basic1-18-rm-ci
+ else
+ fail basic1-18-rm-ci
+ fi
+ cd ..
+ dotest basic1-21-rm-ci "${testcvs} -q update" ''
+ if ${testcvs} -q log first-dir >>${LOGFILE}; then
+ pass basic1-22-rm-ci
+ else
+ fail basic1-22-rm-ci
+ fi
+ if ${testcvs} -q status first-dir >>${LOGFILE}; then
+ pass basic1-23-rm-ci
+ else
+ fail basic1-23-rm-ci
+ fi
+ dotest basic1-24-rm-ci "${testcvs} -q update first-dir" ''
+ dotest basic1-27-rm-ci "${testcvs} -q co first-dir" ''
+ cd first-dir
+ # All the files are removed, so nothing gets tagged.
+ dotest basic1-28 "${testcvs} -q tag first-dive" ''
+ cd ..
+ cd ..
+
+ if test "$keep" = yes; then
+ echo Keeping ${TESTDIR} and exiting due to --keep
+ exit 0
+ fi
+
+ rm -r 1
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ ;;
deep)
# Test the ability to operate on directories nested rather deeply.
@@ -1028,7 +1310,7 @@ done'
for i in dir1 dir2 dir3 dir4 dir5 dir6 dir7 dir8; do
mkdir $i
dotest deep-2-$i "${testcvs} add $i" \
-'Directory /tmp/cvs-sanity/cvsroot/first-dir/dir1[/dir0-9]* added to the repository'
+"Directory ${TESTDIR}/cvsroot/first-dir/dir1[/dir0-9]* added to the repository"
cd $i
echo file1 >file1
dotest deep-3-$i "${testcvs} add file1" \
@@ -1036,53 +1318,53 @@ done'
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
done
cd ../../../../../../../../..
- dotest_lit deep-4 "${testcvs} -q ci -m add-them first-dir" <<'HERE'
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/dir1/file1,v
+ dotest_lit deep-4 "${testcvs} -q ci -m add-them first-dir" <<HERE
+RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/file1,v
done
Checking in first-dir/dir1/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/dir1/file1,v <-- file1
initial revision: 1.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/file1,v
done
Checking in first-dir/dir1/dir2/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/file1,v <-- file1
initial revision: 1.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/file1,v
done
Checking in first-dir/dir1/dir2/dir3/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/file1,v <-- file1
initial revision: 1.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/file1,v
done
Checking in first-dir/dir1/dir2/dir3/dir4/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/file1,v <-- file1
initial revision: 1.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v
done
Checking in first-dir/dir1/dir2/dir3/dir4/dir5/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
initial revision: 1.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v
done
Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
initial revision: 1.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v
done
Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
initial revision: 1.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v
done
Checking in first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
initial revision: 1.1
done
HERE
@@ -1092,10 +1374,10 @@ HERE
dotest deep-4a0 "${testcvs} rm file1" \
"${PROG} [a-z]*: scheduling .file1. for removal
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
- dotest deep-4a1 "${testcvs} -q ci -m rm-it" 'Removing file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
+ dotest deep-4a1 "${testcvs} -q ci -m rm-it" "Removing file1;
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file1,v <-- file1
new revision: delete; previous revision: 1\.1
-done'
+done"
cd ../../..
dotest deep-4a2 "${testcvs} -q update -P dir6/dir7" ''
# Should be using "test -e" if that is portable enough.
@@ -1108,7 +1390,7 @@ done'
# CVS *will* recreate it, and we might want to make it so
# that "cvs release -d" is the way to delete the directory
# and have it stay gone -kingdon, Oct1996).
- rm -rf dir6
+ rm -r dir6
dotest deep-4b1 "${testcvs} -q update" ''
dotest deep-4b2 "${testcvs} -q update -d -P" \
'U dir6/file1
@@ -1123,10 +1405,10 @@ ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
cd ..
dotest deep-rm2 "${testcvs} -q update -d -P" 'R dir7/file1'
dotest deep-rm3 "test -d dir7" ''
- dotest deep-rm4 "${testcvs} -q ci -m rm-it" 'Removing dir7/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
+ dotest deep-rm4 "${testcvs} -q ci -m rm-it" "Removing dir7/file1;
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file1,v <-- file1
new revision: delete; previous revision: 1\.1
-done'
+done"
dotest deep-rm5 "${testcvs} -q update -d -P" ''
dotest_fail deep-rm6 "test -d dir7" ''
@@ -1139,14 +1421,14 @@ ${PROG} [a-z]*: Removing dir5/dir6
${PROG} [a-z]*: scheduling .dir5/dir6/file1. for removal
${PROG} [a-z]*: use .${PROG} commit. to remove these files permanently"
dotest deep-rm8 "${testcvs} -q ci -m rm-it" \
-'Removing dir5/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
+"Removing dir5/file1;
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/file1,v <-- file1
new revision: delete; previous revision: 1\.1
done
Removing dir5/dir6/file1;
-/tmp/cvs-sanity/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/dir1/dir2/dir3/dir4/dir5/dir6/file1,v <-- file1
new revision: delete; previous revision: 1\.1
-done'
+done"
dotest deep-rm9 "${testcvs} -q update -d -P" ''
dotest_fail deep-rm10 "test -d dir5"
@@ -1348,7 +1630,6 @@ done'
fi
# now export by rtagged-by-head and rtagged-by-tag and compare.
- rm -rf first-dir
if ${CVS} export -r rtagged-by-head first-dir ; then
echo "PASS: test 50" >>${LOGFILE}
else
@@ -1369,7 +1650,7 @@ done'
else
echo "PASS: test 52" >>${LOGFILE}
fi
- rm -rf 1dir first-dir
+ rm -r 1dir first-dir
# checkout by revision vs export by rtagged-by-revision and compare.
if ${CVS} export -rrtagged-by-revision -d export-dir first-dir ; then
@@ -1385,7 +1666,7 @@ done'
fi
# directory copies are done in an oblique way in order to avoid a bug in sun's tmp filesystem.
- mkdir first-dir.cpy ; (cd first-dir ; tar cf - * | (cd ../first-dir.cpy ; tar xf -))
+ mkdir first-dir.cpy ; (cd first-dir ; tar cf - . | (cd ../first-dir.cpy ; tar xf -))
directory_cmp first-dir export-dir
@@ -1399,19 +1680,19 @@ done'
# into a couple of other modules.
cd export-dir
dotest 56 "${testcvs} import -m first-import second-dir first-immigration immigration1 immigration1_0" \
-'N second-dir/file14
+"N second-dir/file14
N second-dir/file6
N second-dir/file7
-'"${PROG}"' [a-z]*: Importing /tmp/cvs-sanity/cvsroot/second-dir/dir1
+${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/dir1
N second-dir/dir1/file14
N second-dir/dir1/file6
N second-dir/dir1/file7
-'"${PROG}"' [a-z]*: Importing /tmp/cvs-sanity/cvsroot/second-dir/dir1/dir2
+${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/dir1/dir2
N second-dir/dir1/dir2/file14
N second-dir/dir1/dir2/file6
N second-dir/dir1/dir2/file7
-No conflicts created by this import'
+No conflicts created by this import"
cd ..
if ${CVS} export -r HEAD second-dir ; then
@@ -1428,11 +1709,11 @@ No conflicts created by this import'
echo "PASS: test 58" >>${LOGFILE}
fi
- rm -rf second-dir
+ rm -r second-dir
- rm -rf export-dir first-dir
+ rm -r export-dir first-dir
mkdir first-dir
- (cd first-dir.cpy ; tar cf - * | (cd ../first-dir ; tar xf -))
+ (cd first-dir.cpy ; tar cf - . | (cd ../first-dir ; tar xf -))
# update the top, cancelling sticky tags, retag, update other copy, compare.
cd first-dir
@@ -1479,12 +1760,12 @@ No conflicts created by this import'
# else
# echo "PASS: test 63" >>${LOGFILE}
# fi
- rm -rf 1dir first-dir
+ rm -r 1dir first-dir
# Test the cvs history command.
# The reason that there are two patterns rather than using
- # \(/tmp/cvs-sanity\|<remote>\) is that we are trying to
+ # \(${TESTDIR}\|<remote>\) is that we are trying to
# make this portable. Perhaps at some point we should
# ditch that notion and require GNU expr (or dejagnu or....)
# since it seems to be so painful.
@@ -1493,44 +1774,44 @@ No conflicts created by this import'
# 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 [a-z0-9@][a-z0-9@]* first-dir =first-dir= '"${TMPPWD}"'/cvs-sanity/\*
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir == '"${TMPPWD}"'/cvs-sanity
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir == '"${TMPPWD}"'/cvs-sanity
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir/dir1 == '"${TMPPWD}"'/cvs-sanity
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir/dir1 == '"${TMPPWD}"'/cvs-sanity
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir/dir1/dir2 == '"${TMPPWD}"'/cvs-sanity
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir/dir1/dir2 == '"${TMPPWD}"'/cvs-sanity
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir == '"${TMPPWD}"'/cvs-sanity
-M [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir == '"${TMPPWD}"'/cvs-sanity
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir/dir1 == '"${TMPPWD}"'/cvs-sanity
-M [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir/dir1 == '"${TMPPWD}"'/cvs-sanity
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir/dir1/dir2 == '"${TMPPWD}"'/cvs-sanity
-M [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir/dir1/dir2 == '"${TMPPWD}"'/cvs-sanity
-F [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* =first-dir= '"${TMPPWD}"'/cvs-sanity/\*
-T [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-head:A\]
-T [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-tag:rtagged-by-head\]
-T [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-revision:1\.1\]
-O [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* \[1\.1\] first-dir =first-dir= '"${TMPPWD}"'/cvs-sanity/\*
-U [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir == '"${TMPPWD}"'/cvs-sanity/first-dir
-U [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.2 file7 first-dir == '"${TMPPWD}"'/cvs-sanity/first-dir' \
-'O [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* first-dir =first-dir= <remote>/\*
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir == <remote>
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir == <remote>
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir/dir1 == <remote>
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir/dir1 == <remote>
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir/dir1/dir2 == <remote>
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir/dir1/dir2 == <remote>
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir == <remote>
-M [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir == <remote>
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir/dir1 == <remote>
-M [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir/dir1 == <remote>
-A [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir/dir1/dir2 == <remote>
-M [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir/dir1/dir2 == <remote>
-F [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* =first-dir= <remote>/\*
-T [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-head:A\]
-T [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-tag:rtagged-by-head\]
-T [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-revision:1\.1\]
-O [0-9/]* [0-9:]* '"${PLUS}"'0000 [a-z0-9@][a-z0-9@]* \[1\.1\] first-dir =first-dir= <remote>/\*'
+"O [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* first-dir =first-dir= ${TMPPWD}/\*
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir == ${TMPPWD}
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir == ${TMPPWD}
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir/dir1 == ${TMPPWD}
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir/dir1 == ${TMPPWD}
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir/dir1/dir2 == ${TMPPWD}
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir/dir1/dir2 == ${TMPPWD}
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir == ${TMPPWD}
+M [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir == ${TMPPWD}
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir/dir1 == ${TMPPWD}
+M [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir/dir1 == ${TMPPWD}
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir/dir1/dir2 == ${TMPPWD}
+M [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir/dir1/dir2 == ${TMPPWD}
+F [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* =first-dir= ${TMPPWD}/\*
+T [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-head:A\]
+T [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-tag:rtagged-by-head\]
+T [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-revision:1\.1\]
+O [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* \[1\.1\] first-dir =first-dir= ${TMPPWD}/\*
+U [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir == ${TMPPWD}/first-dir
+U [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.2 file7 first-dir == ${TMPPWD}/first-dir" \
+"O [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* first-dir =first-dir= <remote>/\*
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir == <remote>
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir == <remote>
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir/dir1 == <remote>
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir/dir1 == <remote>
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file6 first-dir/dir1/dir2 == <remote>
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file7 first-dir/dir1/dir2 == <remote>
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir == <remote>
+M [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir == <remote>
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir/dir1 == <remote>
+M [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir/dir1 == <remote>
+A [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.1 file14 first-dir/dir1/dir2 == <remote>
+M [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* 1\.2 file6 first-dir/dir1/dir2 == <remote>
+F [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* =first-dir= <remote>/\*
+T [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-head:A\]
+T [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-tag:rtagged-by-head\]
+T [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* first-dir \[rtagged-by-revision:1\.1\]
+O [0-9/]* [0-9:]* ${PLUS}0000 [a-z0-9@][a-z0-9@]* \[1\.1\] first-dir =first-dir= <remote>/\*"
rm -rf ${CVSROOT_DIRNAME}/first-dir
rm -rf ${CVSROOT_DIRNAME}/second-dir
@@ -1562,10 +1843,10 @@ U trdiff/foo"
echo something >> foo
dotest rdiff-3 \
"${testcvs} ci -m added-something foo" \
-'Checking in foo;
-/tmp/cvs-sanity/cvsroot/trdiff/foo,v <-- foo
+"Checking in foo;
+${TESTDIR}/cvsroot/trdiff/foo,v <-- foo
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
echo '#ident "@(#)trdiff:$''Name$:$''Id$"' > new
echo "new file" >> new
dotest rdiff-4 \
@@ -1574,12 +1855,12 @@ done'
${PROG} [a-z]*: use 'cvs commit' to add this file permanently"
dotest rdiff-5 \
"${testcvs} commit -m added-new-file new" \
-'RCS file: /tmp/cvs-sanity/cvsroot/trdiff/new,v
+"RCS file: ${TESTDIR}/cvsroot/trdiff/new,v
done
Checking in new;
-/tmp/cvs-sanity/cvsroot/trdiff/new,v <-- new
+${TESTDIR}/cvsroot/trdiff/new,v <-- new
initial revision: 1\.1
-done'
+done"
dotest rdiff-6 \
"${testcvs} tag local-v0" \
"${PROG} [a-z]*: Tagging .
@@ -1588,11 +1869,11 @@ T foo
T new"
dotest rdiff-7 \
"${testcvs} status -v foo" \
-'===================================================================
+"===================================================================
File: foo Status: Up-to-date
Working revision: 1\.2.*
- Repository revision: 1\.2 /tmp/cvs-sanity/cvsroot/trdiff/foo,v
+ Repository revision: 1\.2 ${TESTDIR}/cvsroot/trdiff/foo,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -ko
@@ -1600,10 +1881,10 @@ File: foo Status: Up-to-date
Existing Tags:
local-v0 (revision: 1\.2)
T1 (revision: 1\.1\.1\.1)
- TRDIFF (branch: 1\.1\.1)'
+ TRDIFF (branch: 1\.1\.1)"
cd ..
- rm -rf trdiff
+ rm -r trdiff
dotest rdiff-8 \
"${testcvs} rdiff -r T1 -r local-v0 trdiff" \
@@ -1632,12 +1913,12 @@ diff -c /dev/null trdiff/new:1\.1
# FIXME: will this work here?
# if test "$keep" = yes; then
-# echo Keeping /tmp/cvs-sanity and exiting due to --keep
+# echo Keeping ${TESTDIR} and exiting due to --keep
# exit 0
# fi
cd ..
- rm -rf testimport
+ rm -r testimport
rm -rf ${CVSROOT_DIRNAME}/trdiff
;;
@@ -1662,28 +1943,28 @@ diff -c /dev/null trdiff/new:1\.1
# doesn't get confused by it.
mkdir subdir
dotest 65a0 "${testcvs} add subdir" \
-'Directory /tmp/cvs-sanity/cvsroot/first-dir/subdir added to the repository'
+"Directory ${TESTDIR}/cvsroot/first-dir/subdir added to the repository"
cd subdir
echo file in subdir >sfile
dotest 65a1 "${testcvs} add sfile" \
"${PROG}"' [a-z]*: scheduling file `sfile'\'' for addition
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest 65a2 "${testcvs} -q ci -m add-it" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/subdir/sfile,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/subdir/sfile,v
done
Checking in sfile;
-/tmp/cvs-sanity/cvsroot/first-dir/subdir/sfile,v <-- sfile
+${TESTDIR}/cvsroot/first-dir/subdir/sfile,v <-- sfile
initial revision: 1\.1
-done'
+done"
rm sfile
dotest 65a3 "${testcvs} rm sfile" \
"${PROG}"' [a-z]*: scheduling `sfile'\'' for removal
'"${PROG}"' [a-z]*: use '\'"${PROG}"' commit'\'' to remove this file permanently'
dotest 65a4 "${testcvs} -q ci -m remove-it" \
-'Removing sfile;
-/tmp/cvs-sanity/cvsroot/first-dir/subdir/sfile,v <-- sfile
+"Removing sfile;
+${TESTDIR}/cvsroot/first-dir/subdir/sfile,v <-- sfile
new revision: delete; previous revision: 1\.1
-done'
+done"
cd ..
dotest 65a5 "${testcvs} -q update -P" ''
dotest_fail 65a6 "test -d subdir" ''
@@ -1755,21 +2036,21 @@ done'
"${PROG}"' [a-z]*: scheduling file `file4'\'' for addition
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest death-file4-ciadd "${testcvs} -q ci -m add file4" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file4,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
done
Checking in file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
initial revision: 1\.1
-done'
+done"
rm file4
dotest death-file4-rm "${testcvs} remove file4" \
"${PROG}"' [a-z]*: scheduling `file4'\'' for removal
'"${PROG}"' [a-z]*: use '\'"${PROG}"' commit'\'' to remove this file permanently'
dotest death-file4-cirm "${testcvs} -q ci -m remove file4" \
-'Removing file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+"Removing file4;
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
new revision: delete; previous revision: 1\.1
-done'
+done"
# Tag the branchpoint.
dotest death-72a "${testcvs} -q tag bp_branch1" 'T file1
@@ -1899,12 +2180,12 @@ diff -c first-dir/file3:1\.1\.2\.1 first-dir/file3:removed
# join
dotest 86 "${testcvs} -q update -j branch1" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
retrieving revision 1\.3
retrieving revision 1\.3\.2\.1
Merging differences between 1\.3 and 1\.3\.2\.1 into file1
-'"${PROG}"' [a-z]*: scheduling file2 for removal
-U file3'
+${PROG} [a-z]*: scheduling file2 for removal
+U file3"
dotest_fail death-file4-5 "test -f file4" ''
@@ -1931,25 +2212,25 @@ U file3'
# commit
dotest 89 "${testcvs} -q ci -m test" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.4; previous revision: 1\.3
done
Removing file2;
-/tmp/cvs-sanity/cvsroot/first-dir/file2,v <-- file2
+${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
new revision: delete; previous revision: 1\.1
done
Checking in file3;
-/tmp/cvs-sanity/cvsroot/first-dir/file3,v <-- file3
+${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
cd ..
mkdir 2
cd 2
dotest 89a "${testcvs} -q co first-dir" 'U first-dir/file1
U first-dir/file3'
cd ..
- rm -rf 2
+ rm -r 2
cd first-dir
# remove first file.
@@ -2034,12 +2315,12 @@ U first-dir/file3'
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest death2-3 "${testcvs} -q commit -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
-done'
+done"
# Make a branch and a non-branch tag.
dotest death2-4 "${testcvs} -q tag -b branch" 'T file1'
@@ -2071,10 +2352,10 @@ diff -N file1
--- 0 ----"
dotest death2-8 "${testcvs} -q ci -m removed" \
-'Removing file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Removing file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: delete; previous revision: 1\.1\.2
-done'
+done"
# Test diff of a dead file.
dotest_fail death2-diff-3 \
@@ -2146,10 +2427,10 @@ diff -N file1
${PLUS} second revision"
dotest death2-10 "${testcvs} -q commit -m add" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.2; previous revision: 1\.1\.2\.1
-done'
+done"
# Back to the trunk.
dotest death2-11 "${testcvs} -q update -A" 'U file1' 'P file1'
@@ -2160,12 +2441,12 @@ done'
"${PROG}"' [a-z]*: scheduling file `file2'\'' for addition
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest death2-13 "${testcvs} -q commit -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file2,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
done
Checking in file2;
-/tmp/cvs-sanity/cvsroot/first-dir/file2,v <-- file2
+${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
initial revision: 1\.1
-done'
+done"
# Back to the branch.
# The ``no longer in the repository'' message doesn't really
@@ -2183,10 +2464,10 @@ ${PROG} [a-z]*: file2 is no longer in the repository"
"${PROG}"' [a-z]*: scheduling file `file2'\'' for addition on branch `branch'\''
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest death2-16 "${testcvs} -q commit -m add" \
-'Checking in file2;
-/tmp/cvs-sanity/cvsroot/first-dir/file2,v <-- file2
+"Checking in file2;
+${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1
-done'
+done"
# Add a new file on the branch.
echo "first revision" > file3
@@ -2194,12 +2475,12 @@ done'
"${PROG}"' [a-z]*: scheduling file `file3'\'' for addition on branch `branch'\''
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest death2-18 "${testcvs} -q commit -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/Attic/file3,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file3,v
done
Checking in file3;
-/tmp/cvs-sanity/cvsroot/first-dir/Attic/file3,v <-- file3
+${TESTDIR}/cvsroot/first-dir/Attic/file3,v <-- file3
new revision: 1\.1\.2\.1; previous revision: 1\.1
-done'
+done"
# Test diff of a nonexistent tag
dotest_fail death2-diff-9 "${testcvs} -q diff -rtag -c file3" \
@@ -2220,7 +2501,7 @@ ${PLUS} first revision"
dotest_fail death2-diff-11 "${testcvs} -q diff -rtag -c ." \
"Index: file1
===================================================================
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.2
diff -c -r1\.1 -r1\.1\.2\.2
@@ -2237,7 +2518,7 @@ ${PROG} [a-z]*: tag tag is not in file file3"
dotest_fail death2-diff-12 "${testcvs} -q diff -rtag -c -N ." \
"Index: file1
===================================================================
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.2
diff -c -r1\.1 -r1\.1\.2\.2
@@ -2314,38 +2595,38 @@ ${PLUS} first revision"
'"${PROG}"' [a-z]*: scheduling file `file3'\'' for addition
'"${PROG}"' [a-z]*: scheduling file `file4'\'' for addition
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add these files permanently'
- dotest_lit branches-3 "${testcvs} -q ci -m add-it" <<'HERE'
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+ dotest_lit branches-3 "${testcvs} -q ci -m add-it" <<HERE
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file2,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
done
Checking in file2;
-/tmp/cvs-sanity/cvsroot/first-dir/file2,v <-- file2
+${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
initial revision: 1.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file3,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
done
Checking in file3;
-/tmp/cvs-sanity/cvsroot/first-dir/file3,v <-- file3
+${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
initial revision: 1.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file4,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
done
Checking in file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
initial revision: 1.1
done
HERE
echo 4:trunk-2 >file4
dotest branches-3.2 "${testcvs} -q ci -m trunk-before-branch" \
-'Checking in file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+"Checking in file4;
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
dotest branches-4 "${testcvs} tag -b br1" "${PROG}"' [a-z]*: Tagging \.
T file1
T file2
@@ -2357,18 +2638,18 @@ T file4'
echo 2:br1 >file2
echo 4:br1 >file4
dotest branches-6 "${testcvs} -q ci -m modify" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file2;
-/tmp/cvs-sanity/cvsroot/first-dir/file2,v <-- file2
+${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
new revision: 1\.2\.2\.1; previous revision: 1\.2
-done'
+done"
dotest branches-7 "${testcvs} -q tag -b brbr" 'T file1
T file2
T file3
@@ -2377,14 +2658,14 @@ T file4'
echo 1:brbr >file1
echo 4:brbr >file4
dotest branches-9 "${testcvs} -q ci -m modify" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1\.2\.1; previous revision: 1\.1\.2\.1
done
Checking in file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
new revision: 1\.2\.2\.1\.2\.1; previous revision: 1\.2\.2\.1
-done'
+done"
dotest branches-10 "cat file1 file2 file3 file4" '1:brbr
2:br1
3:ancest
@@ -2398,10 +2679,10 @@ done'
4:br1'
echo 4:br1-2 >file4
dotest branches-12.2 "${testcvs} -q ci -m change-on-br1" \
-'Checking in file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+"Checking in file4;
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
-done'
+done"
dotest branches-13 "${testcvs} -q update -A" '[UP] file1
[UP] file2
[UP] file4'
@@ -2412,13 +2693,13 @@ done'
echo 4:trunk-3 >file4
dotest branches-14.2 \
"${testcvs} -q ci -m trunk-change-after-branch" \
-'Checking in file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+"Checking in file4;
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
new revision: 1\.3; previous revision: 1\.2
-done'
+done"
dotest branches-14.3 "${testcvs} log file4" \
-'
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file4,v
+"
+RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
Working file: file4
head: 1\.3
branch:
@@ -2432,11 +2713,11 @@ total revisions: 6; selected revisions: 6
description:
----------------------------
revision 1\.3
-date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp; lines: '"${PLUS}"'1 -1
+date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp; lines: ${PLUS}1 -1
trunk-change-after-branch
----------------------------
revision 1\.2
-date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp; lines: '"${PLUS}"'1 -1
+date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp; lines: ${PLUS}1 -1
branches: 1\.2\.2;
trunk-before-branch
----------------------------
@@ -2445,23 +2726,23 @@ date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp;
add-it
----------------------------
revision 1\.2\.2\.2
-date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp; lines: '"${PLUS}"'1 -1
+date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp; lines: ${PLUS}1 -1
change-on-br1
----------------------------
revision 1\.2\.2\.1
-date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp; lines: '"${PLUS}"'1 -1
+date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp; lines: ${PLUS}1 -1
branches: 1\.2\.2\.1\.2;
modify
----------------------------
revision 1\.2\.2\.1\.2\.1
-date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp; lines: '"${PLUS}"'1 -1
+date: [0-9/: ]*; author: [a-z0-9@][a-z0-9@]*; state: Exp; lines: ${PLUS}1 -1
modify
-============================================================================='
+============================================================================="
dotest_status branches-14.4 1 \
"${testcvs} diff -c -r 1.1 -r 1.3 file4" \
-'Index: file4
+"Index: file4
===================================================================
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file4,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
retrieving revision 1\.1
retrieving revision 1\.3
diff -c -r1\.1 -r1\.3
@@ -2471,12 +2752,12 @@ diff -c -r1\.1 -r1\.3
\*\*\* 1 \*\*\*\*
! 4:trunk-1
--- 1 ----
-! 4:trunk-3'
+! 4:trunk-3"
dotest_status branches-14.5 1 \
"${testcvs} diff -c -r 1.1 -r 1.2.2.1 file4" \
-'Index: file4
+"Index: file4
===================================================================
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file4,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
retrieving revision 1\.1
retrieving revision 1\.2\.2\.1
diff -c -r1\.1 -r1\.2\.2\.1
@@ -2486,14 +2767,14 @@ diff -c -r1\.1 -r1\.2\.2\.1
\*\*\* 1 \*\*\*\*
! 4:trunk-1
--- 1 ----
-! 4:br1'
+! 4:br1"
dotest branches-15 \
"${testcvs} update -j 1.1.2.1 -j 1.1.2.1.2.1 file1" \
- 'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+ "RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
retrieving revision 1\.1\.2\.1
retrieving revision 1\.1\.2\.1\.2\.1
Merging differences between 1\.1\.2\.1 and 1\.1\.2\.1\.2\.1 into file1
-rcsmerge: warning: conflicts during merge'
+rcsmerge: warning: conflicts during merge"
dotest branches-16 "cat file1" '<<<<<<< file1
1:ancest
=======
@@ -2502,7 +2783,7 @@ rcsmerge: warning: conflicts during merge'
cd ..
if test "$keep" = yes; then
- echo Keeping /tmp/cvs-sanity and exiting due to --keep
+ echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -2520,11 +2801,11 @@ rcsmerge: warning: conflicts during merge'
dotest multibranch-2 "${testcvs} add file1" \
"${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
- dotest_lit multibranch-3 "${testcvs} -q ci -m add-it" <<'HERE'
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+ dotest_lit multibranch-3 "${testcvs} -q ci -m add-it" <<HERE
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1.1
done
HERE
@@ -2537,17 +2818,17 @@ T file1"
dotest multibranch-6 "${testcvs} -q update -r br1" ''
echo on-br1 >file1
dotest multibranch-7 "${testcvs} -q ci -m modify-on-br1" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
-done'
+done"
dotest multibranch-8 "${testcvs} -q update -r br2" '[UP] file1'
echo br2 adds a line >>file1
dotest multibranch-9 "${testcvs} -q ci -m modify-on-br2" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.1\.4\.1; previous revision: 1\.1
-done'
+done"
dotest multibranch-10 "${testcvs} -q update -r br1" '[UP] file1'
dotest multibranch-11 "cat file1" 'on-br1'
dotest multibranch-12 "${testcvs} -q update -r br2" '[UP] file1'
@@ -2556,7 +2837,7 @@ br2 adds a line'
dotest multibranch-14 "${testcvs} log file1" \
"
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -2585,7 +2866,7 @@ modify-on-br1
cd ..
if test "$keep" = yes; then
- echo Keeping /tmp/cvs-sanity and exiting due to --keep
+ echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
@@ -2764,12 +3045,12 @@ modify-on-br1
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
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/imported-f2,v
+"${PROG} [a-z]*: file first-dir/imported-f1 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
Merging differences between 1\.1\.1\.1 and 1\.1\.1\.2 into imported-f2
-rcsmerge: warning: conflicts during merge'
+rcsmerge: warning: conflicts during merge"
cd first-dir
@@ -2797,12 +3078,15 @@ import should not expand \$''Id: imported-f2,v 1\.1\.1\.2 [0-9/]* [0-9:]* [a-z0-
rev 2 of file 2
[>]>>>>>> 1\.1\.1\.2'
- cd .. ; rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
- rm -rf import-dir
+ cd ..
+ rm -r first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r import-dir
;;
join)
# Test doing joins which involve adding and removing files.
+ # See also binfile2, which does similar things with binary files.
# We check merging changes from T1 to T2 into the main line.
# Here are the interesting cases I can think of:
@@ -2866,30 +3150,30 @@ rev 2 of file 2
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add these files permanently'
dotest join-3 "${testcvs} -q commit -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file3,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file3,v
done
Checking in file3;
-/tmp/cvs-sanity/cvsroot/first-dir/file3,v <-- file3
+${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
initial revision: 1\.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file4,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file4,v
done
Checking in file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
initial revision: 1\.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file6,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file6,v
done
Checking in file6;
-/tmp/cvs-sanity/cvsroot/first-dir/file6,v <-- file6
+${TESTDIR}/cvsroot/first-dir/file6,v <-- file6
initial revision: 1\.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file8,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file8,v
done
Checking in file8;
-/tmp/cvs-sanity/cvsroot/first-dir/file8,v <-- file8
+${TESTDIR}/cvsroot/first-dir/file8,v <-- file8
initial revision: 1\.1
-done'
+done"
# Make a branch.
dotest join-4 "${testcvs} -q tag -b branch ." \
@@ -2912,30 +3196,30 @@ T file8'
'"${PROG}"' [a-z]*: scheduling `file8'\'' for removal
'"${PROG}"' [a-z]*: use '\'"${PROG} commit"\'' to remove these files permanently'
dotest join-7 "${testcvs} -q ci -mx ." \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file2,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
done
Checking in file2;
-/tmp/cvs-sanity/cvsroot/first-dir/file2,v <-- file2
+${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
initial revision: 1\.1
done
Checking in file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
new revision: 1\.2; previous revision: 1\.1
done
Removing file6;
-/tmp/cvs-sanity/cvsroot/first-dir/file6,v <-- file6
+${TESTDIR}/cvsroot/first-dir/file6,v <-- file6
new revision: delete; previous revision: 1\.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file7,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file7,v
done
Checking in file7;
-/tmp/cvs-sanity/cvsroot/first-dir/file7,v <-- file7
+${TESTDIR}/cvsroot/first-dir/file7,v <-- file7
initial revision: 1\.1
done
Removing file8;
-/tmp/cvs-sanity/cvsroot/first-dir/file8,v <-- file8
+${TESTDIR}/cvsroot/first-dir/file8,v <-- file8
new revision: delete; previous revision: 1\.1
-done'
+done"
# Check out the branch.
cd ../..
@@ -2959,24 +3243,24 @@ U first-dir/file8'
"${PROG}"' [a-z]*: scheduling file `file5'\'' for addition on branch `branch'\''
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest join-10 "${testcvs} -q ci -mx ." \
-'Checking in file3;
-/tmp/cvs-sanity/cvsroot/first-dir/file3,v <-- file3
+"Checking in file3;
+${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/Attic/file5,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file5,v
done
Checking in file5;
-/tmp/cvs-sanity/cvsroot/first-dir/Attic/file5,v <-- file5
+${TESTDIR}/cvsroot/first-dir/Attic/file5,v <-- file5
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file6;
-/tmp/cvs-sanity/cvsroot/first-dir/Attic/file6,v <-- file6
+${TESTDIR}/cvsroot/first-dir/Attic/file6,v <-- file6
new revision: 1\.1\.2\.1; previous revision: 1\.1
-done'
+done"
# Tag the current revisions on the branch.
dotest join-11 "${testcvs} -q tag T1 ." \
@@ -3001,32 +3285,32 @@ T file8'
'"${PROG}"' [a-z]*: scheduling `file6'\'' for removal
'"${PROG}"' [a-z]*: use '\'"${PROG} commit"\'' to remove these files permanently'
dotest join-14 "${testcvs} -q ci -mx ." \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/Attic/file1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/Attic/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/Attic/file1,v <-- file1
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Checking in file2;
-/tmp/cvs-sanity/cvsroot/first-dir/file2,v <-- file2
+${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
new revision: 1\.1\.2\.1; previous revision: 1\.1
done
Removing file3;
-/tmp/cvs-sanity/cvsroot/first-dir/file3,v <-- file3
+${TESTDIR}/cvsroot/first-dir/file3,v <-- file3
new revision: delete; previous revision: 1\.1\.2\.1
done
Removing file4;
-/tmp/cvs-sanity/cvsroot/first-dir/file4,v <-- file4
+${TESTDIR}/cvsroot/first-dir/file4,v <-- file4
new revision: delete; previous revision: 1\.1\.2\.1
done
Removing file5;
-/tmp/cvs-sanity/cvsroot/first-dir/Attic/file5,v <-- file5
+${TESTDIR}/cvsroot/first-dir/Attic/file5,v <-- file5
new revision: delete; previous revision: 1\.1\.2\.1
done
Removing file6;
-/tmp/cvs-sanity/cvsroot/first-dir/Attic/file6,v <-- file6
+${TESTDIR}/cvsroot/first-dir/Attic/file6,v <-- file6
new revision: delete; previous revision: 1\.1\.2\.1
-done'
+done"
# Tag the current revisions on the branch.
dotest join-15 "${testcvs} -q tag T2 ." \
@@ -3083,19 +3367,19 @@ M file4'
# revision which can be used as the source for files added
# on branches.
cd ../../3
- rm -rf first-dir
+ rm -r first-dir
dotest join-20 "${testcvs} -q co -jbranch first-dir" \
-'U first-dir/file1
+"U first-dir/file1
U first-dir/file2
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file2,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.1
Merging differences between 1\.1 and 1\.1\.2\.1 into file2
U first-dir/file3
-'"${PROG}"' [a-z]*: scheduling first-dir/file3 for removal
+${PROG} [a-z]*: scheduling first-dir/file3 for removal
U first-dir/file4
-'"${PROG}"' [a-z]*: file first-dir/file4 has been modified, but has been removed in revision branch
-U first-dir/file7'
+${PROG} [a-z]*: file first-dir/file4 has been modified, but has been removed in revision branch
+U first-dir/file7"
# Verify that the right changes have been scheduled.
# The M file2 line is a bug; see above join-20.
@@ -3107,7 +3391,7 @@ R file3'
# Checkout the main line again.
cd ../../1
- rm -rf first-dir
+ rm -r first-dir
dotest join-22 "${testcvs} -q co first-dir" \
'U first-dir/file2
U first-dir/file3
@@ -3120,14 +3404,14 @@ U first-dir/file7'
cd first-dir
echo 'third revision of file4' > file4
dotest join-23 "${testcvs} -q update -jbranch ." \
-'U file1
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file2,v
+"U file1
+RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
retrieving revision 1\.1
retrieving revision 1\.1\.2\.1
Merging differences between 1\.1 and 1\.1\.2\.1 into file2
-'"${PROG}"' [a-z]*: scheduling file3 for removal
+${PROG} [a-z]*: scheduling file3 for removal
M file4
-'"${PROG}"' [a-z]*: file file4 is locally modified, but has been removed in revision branch'
+${PROG} [a-z]*: file file4 is locally modified, but has been removed in revision branch"
# Verify that the right changes have been scheduled.
# The M file2 line is a bug; see above join-20
@@ -3138,7 +3422,8 @@ R file3
M file4'
cd ../..
- rm -rf 1 2 3 ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2 3
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
new) # look for stray "no longer pertinent" messages.
@@ -3191,7 +3476,9 @@ M file4'
echo "PASS: test 123" >>${LOGFILE}
fi
- cd .. ; rm -rf first-dir ; rm -rf ${CVSROOT_DIRNAME}/first-dir
+ cd ..
+ rm -r first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
newb)
@@ -3210,19 +3497,19 @@ M file4'
"${PROG} [a-z]*: scheduling file .a. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest newb-123c "${testcvs} -q ci -m added" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/a,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
done
Checking in a;
-/tmp/cvs-sanity/cvsroot/first-dir/a,v <-- a
+${TESTDIR}/cvsroot/first-dir/a,v <-- a
initial revision: 1\.1
-done'
+done"
# Make a branch.
dotest newb-123d "${testcvs} -q tag -b branch" "T a"
# Check out the branch.
cd ..
- rm -rf first-dir
+ rm -r first-dir
mkdir 1
cd 1
dotest newb-123e "${testcvs} -q co -r branch first-dir" \
@@ -3240,16 +3527,16 @@ done'
"${PROG} [a-z]*: scheduling .a. for removal
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest newb-123h "${testcvs} -q ci -m removed" \
-'Removing a;
-/tmp/cvs-sanity/cvsroot/first-dir/a,v <-- a
+"Removing a;
+${TESTDIR}/cvsroot/first-dir/a,v <-- a
new revision: delete; previous revision: 1\.1\.2
-done'
+done"
# Check out the file on the branch. This should report
# that the file is not pertinent, but it should not
# say anything else.
cd ..
- rm -rf first-dir
+ rm -r first-dir
dotest newb-123i "${testcvs} -q co -r branch first-dir/a" \
"${PROG} [a-z]*: warning: first-dir/a is not (any longer) pertinent"
@@ -3257,12 +3544,14 @@ done'
cd ../1/first-dir
# "Needs Patch" is a rather strange output here. Something like
# "Removed in Repository" would make more sense.
+ # The "Need Checkout" output is what CVS does if configured
+ # --disable-server.
dotest newb-123j0 "${testcvs} status a" \
"===================================================================
-File: a Status: Needs Patch
+File: a Status: Needs \(Patch\|Checkout\)
Working revision: 1\.1.*
- Repository revision: 1\.1\.2\.1 /tmp/cvs-sanity/cvsroot/first-dir/a,v
+ Repository revision: 1\.1\.2\.1 ${TESTDIR}/cvsroot/first-dir/a,v
Sticky Tag: branch (branch: 1\.1\.2)
Sticky Date: (none)
Sticky Options: (none)"
@@ -3276,7 +3565,8 @@ File: a Status: Needs Patch
fi
cd ../..
- rm -rf 1 2 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
conflicts)
@@ -3294,12 +3584,12 @@ File: a Status: Needs Patch
"${PROG} [a-z]*: scheduling file .a. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest conflicts-126 "${testcvs} -q ci -m added" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/a,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
done
Checking in a;
-/tmp/cvs-sanity/cvsroot/first-dir/a,v <-- a
+${TESTDIR}/cvsroot/first-dir/a,v <-- a
initial revision: 1\.1
-done'
+done"
cd ../..
mkdir 2
@@ -3308,12 +3598,12 @@ done'
# The need for TMPPWD here is a (minor) CVS bug; the
# output should use the name of the repository as specified.
dotest conflicts-126.5 "${testcvs} co -p first-dir" \
-"${PROG} [a-z]*"': Updating first-dir
+"${PROG} [a-z]*: Updating first-dir
===================================================================
Checking out first-dir/a
-RCS: '"${TMPPWD}"'/cvs-sanity/cvsroot/first-dir/a,v
+RCS: ${TMPPWD}/cvsroot/first-dir/a,v
VERS: 1\.1
-\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*'
+\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*"
if ${CVS} co first-dir ; then
echo 'PASS: test 127' >>${LOGFILE}
else
@@ -3330,12 +3620,12 @@ VERS: 1\.1
echo add a line >>a
mkdir dir1
dotest conflicts-127b "${testcvs} add dir1" \
-'Directory /tmp/cvs-sanity/cvsroot/first-dir/dir1 added to the repository'
+"Directory ${TESTDIR}/cvsroot/first-dir/dir1 added to the repository"
dotest conflicts-128 "${testcvs} -q ci -m changed" \
-'Checking in a;
-/tmp/cvs-sanity/cvsroot/first-dir/a,v <-- a
+"Checking in a;
+${TESTDIR}/cvsroot/first-dir/a,v <-- a
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
cd ../..
# Similar to conflicts-126.5, but now the file has nonempty
@@ -3345,13 +3635,13 @@ done'
# The need for TMPPWD here is a (minor) CVS bug; the
# output should use the name of the repository as specified.
dotest conflicts-128.5 "${testcvs} co -p -l first-dir" \
-"${PROG} [a-z]*"': Updating first-dir
+"${PROG} [a-z]*: Updating first-dir
===================================================================
Checking out first-dir/a
-RCS: '"${TMPPWD}"'/cvs-sanity/cvsroot/first-dir/a,v
+RCS: ${TMPPWD}/cvsroot/first-dir/a,v
VERS: 1\.2
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-add a line'
+add a line"
cd ..
rmdir 3
@@ -3369,29 +3659,29 @@ add a line'
File: a Status: Needs Merge
Working revision: 1\.1.*
- Repository revision: 1\.2 /tmp/cvs-sanity/cvsroot/first-dir/a,v
+ Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/a,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
dotest conflicts-130 "${testcvs} -q update" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/a,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
retrieving revision 1\.1
retrieving revision 1\.2
Merging differences between 1\.1 and 1\.2 into a
rcsmerge: warning: conflicts during merge
-'"${PROG}"' [a-z]*: conflicts found in a
+${PROG} [a-z]*: conflicts found in a
C a
-'"${QUESTION}"' dir1
-'"${QUESTION}"' sdir' \
-''"${QUESTION}"' dir1
-'"${QUESTION}"' sdir
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/a,v
+${QUESTION} dir1
+${QUESTION} sdir" \
+"${QUESTION} dir1
+${QUESTION} sdir
+RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
retrieving revision 1\.1
retrieving revision 1\.2
Merging differences between 1\.1 and 1\.2 into a
rcsmerge: warning: conflicts during merge
-'"${PROG}"' [a-z]*: conflicts found in a
-C a'
+${PROG} [a-z]*: conflicts found in a
+C a"
rmdir dir1 sdir
dotest conflicts-status-1 "${testcvs} status a" \
@@ -3399,7 +3689,7 @@ C a'
File: a Status: File had conflicts on merge
Working revision: 1\.2.*
- Repository revision: 1\.2 /tmp/cvs-sanity/cvsroot/first-dir/a,v
+ Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/a,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -3414,7 +3704,7 @@ ${PROG} \[[a-z]* aborted\]: correct above errors first!"
File: a Status: File had conflicts on merge
Working revision: 1\.2.*
- Repository revision: 1\.2 /tmp/cvs-sanity/cvsroot/first-dir/a,v
+ Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/a,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -3428,13 +3718,13 @@ ${PROG} \[[a-z]* aborted\]: correct above errors first!"
File: a Status: File had conflicts on merge
Working revision: 1\.2.*
- Repository revision: 1\.2 /tmp/cvs-sanity/cvsroot/first-dir/a,v
+ Repository revision: 1\.2 ${TESTDIR}/cvsroot/first-dir/a,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
dotest conflicts-133 "${testcvs} -q ci -m resolved" \
"Checking in a;
-/tmp/cvs-sanity/cvsroot/first-dir/a,v <-- a
+${TESTDIR}/cvsroot/first-dir/a,v <-- a
new revision: 1\.3; previous revision: 1\.2
done"
dotest conflicts-status-4 "${testcvs} status a" \
@@ -3442,7 +3732,7 @@ done"
File: a Status: Up-to-date
Working revision: 1\.3.*
- Repository revision: 1\.3 /tmp/cvs-sanity/cvsroot/first-dir/a,v
+ Repository revision: 1\.3 ${TESTDIR}/cvsroot/first-dir/a,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)"
@@ -3516,7 +3806,7 @@ File: a Status: Up-to-date
echo 'FAIL: test 142' | tee -a ${LOGFILE}
fi
cd ../..
- rm -rf 1 2 3 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2 3 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
conflicts2)
@@ -3537,18 +3827,18 @@ File: a Status: Up-to-date
${PROG} [a-z]*: scheduling file .abc. for addition
${PROG} [a-z]*: use .cvs commit. to add these files permanently"
dotest conflicts2-142a3 "${testcvs} -q ci -m added" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/a,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/a,v
done
Checking in a;
-/tmp/cvs-sanity/cvsroot/first-dir/a,v <-- a
+${TESTDIR}/cvsroot/first-dir/a,v <-- a
initial revision: 1\.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/abc,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/abc,v
done
Checking in abc;
-/tmp/cvs-sanity/cvsroot/first-dir/abc,v <-- abc
+${TESTDIR}/cvsroot/first-dir/abc,v <-- abc
initial revision: 1\.1
-done'
+done"
cd ../..
mkdir 2
@@ -3564,10 +3854,10 @@ U first-dir/abc'
cd 1/first-dir
echo modify a >>a
dotest conflicts2-142b2 "${testcvs} -q ci -m modify-a" \
-'Checking in a;
-/tmp/cvs-sanity/cvsroot/first-dir/a,v <-- a
+"Checking in a;
+${TESTDIR}/cvsroot/first-dir/a,v <-- a
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
cd ../../2/first-dir
rm a
dotest conflicts2-142b3 "${testcvs} rm a" \
@@ -3592,10 +3882,10 @@ ${PROG} [a-z]*: a, version 1\.1, resurrected"
"${PROG} [a-z]*: scheduling .abc. for removal
${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
dotest conflicts2-142c1 "${testcvs} -q ci -m remove-abc" \
-'Removing abc;
-/tmp/cvs-sanity/cvsroot/first-dir/abc,v <-- abc
+"Removing abc;
+${TESTDIR}/cvsroot/first-dir/abc,v <-- abc
new revision: delete; previous revision: 1\.1
-done'
+done"
cd ../../2/first-dir
rm abc
dotest conflicts2-142c2 "${testcvs} rm abc" \
@@ -3613,12 +3903,12 @@ ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently"
"${PROG} [a-z]*: scheduling file .aa\.c. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest conflicts2-142d1 "${testcvs} -q ci -m added" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/aa.c,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/aa.c,v
done
Checking in aa.c;
-/tmp/cvs-sanity/cvsroot/first-dir/aa.c,v <-- aa.c
+${TESTDIR}/cvsroot/first-dir/aa.c,v <-- aa.c
initial revision: 1\.1
-done'
+done"
cd ../../2/first-dir
echo "don't you dare obliterate this text" >aa.c
# Doing this test separately for remote and local is a fair
@@ -3636,7 +3926,7 @@ C aa\.c"
fi
cd ../..
- rm -rf 1 2 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
modules)
@@ -3810,7 +4100,7 @@ realmodule NONE first-dir/subdir a'
else
echo 'PASS: test 150g2' >>${LOGFILE}
fi
- rm -rf dirmodule
+ rm -r dirmodule
# Now test that a module using -d checks out to the specified
# directory.
@@ -3862,7 +4152,7 @@ U nameddir/b'
fi
cd ..
- rm -rf 1
+ rm -r 1
mkdir 2
cd 2
@@ -3876,7 +4166,7 @@ U nameddir/b'
"CVS
first-dir"
cd ..
- rm -rf 2
+ rm -r 2
# Test checking out everything.
mkdir 1
@@ -3886,7 +4176,7 @@ first-dir"
U first-dir/subdir/a
U first-dir/subdir/b"
cd ..
- rm -rf 1
+ rm -r 1
# Test checking out a module which lists at least two
# specific files twice. At one time, this failed over
@@ -3905,27 +4195,27 @@ U first-dir/subdir/b"
'"${PROG}"' [a-z]*: scheduling file `file2'\'' for addition
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add these files permanently'
dotest modules-155c3 "${testcvs} -q ci -m add-it" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file2,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file2,v
done
Checking in file2;
-/tmp/cvs-sanity/cvsroot/first-dir/file2,v <-- file2
+${TESTDIR}/cvsroot/first-dir/file2,v <-- file2
initial revision: 1\.1
-done'
+done"
cd ..
- rm -rf first-dir
+ rm -r first-dir
dotest modules-155c4 "${testcvs} -q co topfiles" \
"U first-dir/file1
U first-dir/file2"
dotest modules-155c5 "${testcvs} -q co topfiles" ""
cd ..
- rm -rf 1
+ rm -r 1
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -3946,7 +4236,7 @@ U first-dir/file2"
# we will be checking in revision 1.2 or 1.3.
dotest modules2-2 "${testcvs} -q ci -m add-modules" \
"Checking in modules;
-/tmp/cvs-sanity/cvsroot/CVSROOT/modules,v <-- 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"
@@ -3979,7 +4269,7 @@ EOF
echo 'aliasopt -a -d onedir first-dir' >modules
dotest modules2-a0 "${testcvs} -q ci -m add-modules" \
"Checking in modules;
-/tmp/cvs-sanity/cvsroot/CVSROOT/modules,v <-- 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"
@@ -3990,9 +4280,9 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
${PROG} \[[a-z]* aborted\]: cannot expand modules"
# Clean up.
- rm -rf CVSROOT
+ rm -r CVSROOT
cd ..
- rm -rf 1
+ rm -r 1
rm -rf ${CVSROOT_DIRNAME}/first-dir
rm -rf ${CVSROOT_DIRNAME}/second-dir
;;
@@ -4007,7 +4297,7 @@ ${PROG} \[[a-z]* aborted\]: cannot expand modules"
dotest modules3-0 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest modules3-1 "${testcvs} add first-dir" \
-"Directory /tmp/cvs-sanity/cvsroot/first-dir added to the repository"
+"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
cd first-dir
echo file1 >file1
@@ -4015,12 +4305,12 @@ ${PROG} \[[a-z]* aborted\]: cannot expand modules"
"${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest modules3-3 "${testcvs} -q ci -m add-it" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
-done'
+done"
cd ..
dotest modules3-4 "${testcvs} -q co CVSROOT/modules" \
@@ -4036,14 +4326,14 @@ path/in/modules &mod1
EOF
dotest modules3-5 "${testcvs} -q ci -m add-modules" \
"Checking in modules;
-/tmp/cvs-sanity/cvsroot/CVSROOT/modules,v <-- 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 ..
dotest modules3-6 "${testcvs} -q co bigmod" ''
- rm -rf first-dir
+ rm -r first-dir
dotest modules3-7 "${testcvs} -q co bigmod" 'U first-dir/file1'
cd ..
rm -r 1
@@ -4056,8 +4346,8 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
# considering this is a documented technique and everything.
dotest modules3-7a \
"${testcvs} import -m add-dirs second-dir tag1 tag2" \
-"${PROG} [a-z]*: Importing /tmp/cvs-sanity/cvsroot/second-dir/suba
-${PROG} [a-z]*: Importing /tmp/cvs-sanity/cvsroot/second-dir/suba/subb
+"${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/suba
+${PROG} [a-z]*: Importing ${TESTDIR}/cvsroot/second-dir/suba/subb
No conflicts created by this import" "
No conflicts created by this import"
@@ -4087,12 +4377,12 @@ ${PROG} [a-z]*: Updating second-dir/suba/subb" \
"${PROG} [a-z]*: scheduling file .fileb. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest modules3-7d "${testcvs} -q ci -m add-it" \
-'RCS file: /tmp/cvs-sanity/cvsroot/second-dir/suba/subb/fileb,v
+"RCS file: ${TESTDIR}/cvsroot/second-dir/suba/subb/fileb,v
done
Checking in fileb;
-/tmp/cvs-sanity/cvsroot/second-dir/suba/subb/fileb,v <-- fileb
+${TESTDIR}/cvsroot/second-dir/suba/subb/fileb,v <-- fileb
initial revision: 1\.1
-done'
+done"
cd ../../..
cd ..; rm -r 1
@@ -4132,6 +4422,15 @@ done'
dotest modules3-10 "${testcvs} -q co nestdeeper" \
'U src/sub1/sub2/sub3/dir/file1'
dotest modules3-11 "test -f src/sub1/sub2/sub3/dir/file1" ''
+
+ # While we are doing things like twisted uses of '/' (e.g.
+ # modules3-12), try this one.
+ if test "x$remote" = xyes; then
+ dotest_fail modules3-11b \
+"${testcvs} -q update ${TESTDIR}/1/src/sub1/sub2/sub3/dir/file1" \
+"${PROG} .server aborted.: absolute pathname .${TESTDIR}/1/src/sub1/sub2/sub3/dir/file1. illegal for server"
+ fi # end of remote-only tests
+
cd ..
rm -r 1
@@ -4193,7 +4492,7 @@ done'
exit 1
fi
# Test handling of -m during ci
- cd ..; rm -rf a-dir;
+ cd ..; rm -r a-dir
if ${testcvs} co a-dir >>${LOGFILE} 2>&1; then
echo 'PASS: test 158' >>${LOGFILE}
else
@@ -4223,7 +4522,9 @@ done'
exit 1
fi
# Clean up
- cd ..; rm -rf a-dir ${CVSROOT_DIRNAME}/a-dir
+ cd ..
+ rm -r a-dir
+ rm -rf ${CVSROOT_DIRNAME}/a-dir
done
;;
errmsg1)
@@ -4295,7 +4596,8 @@ EOF
cd ..
chmod u+w 1dir
cd ..
- rm -rf 1 2 ${CVSROOT_DIRNAME}/1dir
+ rm -r 1 2
+ rm -rf ${CVSROOT_DIRNAME}/1dir
;;
devcom)
@@ -4493,6 +4795,7 @@ T abc'
dotest devcom-t1 "${testcvs} -q co -rtag first-dir/abb" \
'U first-dir/abb'
cd ..
+ # Since first-dir/abb is readonly, use -f.
rm -rf 3
# Now remove all the file attributes
@@ -4514,11 +4817,13 @@ U first-dir/abc'
cd ..
if test "$keep" = yes; then
- echo Keeping /tmp/cvs-sanity and exiting due to --keep
+ echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
- rm -rf 1 2 3 ${CVSROOT_DIRNAME}/first-dir
+ # Use -f because of the readonly files.
+ rm -rf 1 2 3
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
devcom2)
@@ -4569,7 +4874,9 @@ U first-dir/w3'
dotest_fail devcom2-11 "test -w first-dir/w3" ''
cd ..
- rm -rf 1 2 ${CVSROOT_DIRNAME}/first-dir
+ # Use -f because of the readonly files.
+ rm -rf 1 2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
devcom3)
@@ -4624,7 +4931,9 @@ G@#..!@#=&"
cd ../..
- rm -rf 1 ${CVSROOT_DIRNAME}/first-dir
+ # Use -f because of the readonly files.
+ rm -rf 1
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
ignore)
@@ -4637,13 +4946,13 @@ G@#..!@#=&"
# As of Jan 96, local CVS prints "Examining ." and remote doesn't.
# Accept either.
dotest 187a3 " ${testcvs} ci -m added" \
-"${DOTSTAR}"'CS file: /tmp/cvs-sanity/cvsroot/CVSROOT/cvsignore,v
+"${DOTSTAR}CS file: ${TESTDIR}/cvsroot/CVSROOT/cvsignore,v
done
Checking in cvsignore;
-/tmp/cvs-sanity/cvsroot/CVSROOT/cvsignore,v <-- cvsignore
+${TESTDIR}/cvsroot/CVSROOT/cvsignore,v <-- cvsignore
initial revision: 1\.1
done
-'"${PROG}"' [a-z]*: Rebuilding administrative file database'
+${PROG} [a-z]*: Rebuilding administrative file database"
cd ..
if echo "yes" | ${testcvs} release -d CVSROOT >>${LOGFILE} ; then
@@ -4688,7 +4997,7 @@ N second-dir/optig.c
No conflicts created by this import'
cd ..
- rm -rf dir-to-import
+ rm -r dir-to-import
mkdir 1
cd 1
@@ -4781,7 +5090,7 @@ Are you sure you want to release (and delete) directory .first-dir': "
You have \[1\] altered files in this repository.
Are you sure you want to release (and delete) directory .second-dir': "
cd ..
- rm -rf 1
+ rm -r 1
rm ${TESTDIR}/ignore.tmp
rm -rf ${CVSROOT_DIRNAME}/first-dir ${CVSROOT_DIRNAME}/second-dir
;;
@@ -4800,12 +5109,12 @@ Are you sure you want to release (and delete) directory .second-dir': "
"${PROG}"' [a-z]*: scheduling file `binfile'\'' for addition
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest binfiles-3 "${testcvs} -q ci -m add-it" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/binfile,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
done
Checking in binfile;
-/tmp/cvs-sanity/cvsroot/first-dir/binfile,v <-- binfile
+${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
initial revision: 1\.1
-done'
+done"
cd ../..
mkdir 2; cd 2
dotest binfiles-4 "${testcvs} -q co first-dir" 'U first-dir/binfile'
@@ -4815,14 +5124,14 @@ done'
# to testing that binary files work right on non-unix machines
# (until there is automated testing for such machines, of course).
dotest binfiles-5.5 "${testcvs} status binfile" \
-'===================================================================
+"===================================================================
File: binfile Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 /tmp/cvs-sanity/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/binfile,v
Sticky Tag: (none)
Sticky Date: (none)
- Sticky Options: -kb'
+ Sticky Options: -kb"
# Test whether the default options from the RCS file are
# also used when operating on files instead of whole
@@ -4833,24 +5142,24 @@ File: binfile Status: Up-to-date
'U first-dir/binfile'
cd first-dir
dotest binfiles-5.5b1 "${testcvs} status binfile" \
-'===================================================================
+"===================================================================
File: binfile Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 /tmp/cvs-sanity/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/binfile,v
Sticky Tag: (none)
Sticky Date: (none)
- Sticky Options: -kb'
+ Sticky Options: -kb"
cd ../..
- rm -rf 3
+ rm -r 3
cd 2/first-dir
cp ../../1/binfile2.dat binfile
dotest binfiles-6 "${testcvs} -q ci -m modify-it" \
-'Checking in binfile;
-/tmp/cvs-sanity/cvsroot/first-dir/binfile,v <-- binfile
+"Checking in binfile;
+${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
cd ../../1/first-dir
dotest binfiles-7 "${testcvs} -q update" '[UP] binfile'
dotest binfiles-8 "cmp ../binfile2.dat binfile" ''
@@ -4858,10 +5167,10 @@ done'
# Now test handling of conflicts with binary files.
cp ../binfile.dat binfile
dotest binfiles-con0 "${testcvs} -q ci -m modify-it" \
-'Checking in binfile;
-/tmp/cvs-sanity/cvsroot/first-dir/binfile,v <-- binfile
+"Checking in binfile;
+${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
new revision: 1\.3; previous revision: 1\.2
-done'
+done"
cd ../../2/first-dir
echo 'edits in dir 2' >binfile
dotest binfiles-con1 "${testcvs} -q update" \
@@ -4875,10 +5184,10 @@ C binfile"
cp ../../1/binfile2.dat binfile
dotest binfiles-con4 "${testcvs} -q ci -m resolve-it" \
-'Checking in binfile;
-/tmp/cvs-sanity/cvsroot/first-dir/binfile,v <-- binfile
+"Checking in binfile;
+${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
new revision: 1\.4; previous revision: 1\.3
-done'
+done"
cd ../../1/first-dir
dotest binfiles-con5 "${testcvs} -q update" '[UP] binfile'
@@ -4892,7 +5201,7 @@ done'
fi
cd ../..
- rm -rf 1
+ rm -r 1
mkdir 3
cd 3
@@ -4900,86 +5209,86 @@ done'
'U first-dir/binfile'
cd first-dir
dotest binfiles-13a1 "${testcvs} status binfile" \
-'===================================================================
+"===================================================================
File: binfile Status: Up-to-date
Working revision: 1\.4.*
- Repository revision: 1\.4 /tmp/cvs-sanity/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.4 ${TESTDIR}/cvsroot/first-dir/binfile,v
Sticky Tag: HEAD (revision: 1\.4)
Sticky Date: (none)
- Sticky Options: -kb'
+ Sticky Options: -kb"
cd ../..
- rm -rf 3
+ rm -r 3
cd 2/first-dir
echo 'this file is $''RCSfile$' >binfile
dotest binfiles-14a "${testcvs} -q ci -m modify-it" \
-'Checking in binfile;
-/tmp/cvs-sanity/cvsroot/first-dir/binfile,v <-- binfile
+"Checking in binfile;
+${TESTDIR}/cvsroot/first-dir/binfile,v <-- binfile
new revision: 1\.5; previous revision: 1\.4
-done'
+done"
dotest binfiles-14b "cat binfile" 'this file is $''RCSfile$'
# See binfiles-5.5 for discussion of -kb.
dotest binfiles-14c "${testcvs} status binfile" \
-'===================================================================
+"===================================================================
File: binfile Status: Up-to-date
Working revision: 1\.5.*
- Repository revision: 1\.5 /tmp/cvs-sanity/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.5 ${TESTDIR}/cvsroot/first-dir/binfile,v
Sticky Tag: (none)
Sticky Date: (none)
- Sticky Options: -kb'
+ Sticky Options: -kb"
dotest binfiles-14d "${testcvs} admin -kv binfile" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/binfile,v
-done'
+"RCS file: ${TESTDIR}/cvsroot/first-dir/binfile,v
+done"
# cvs admin doesn't change the checked-out file or its sticky
# kopts. There probably should be a way which does (but
# what if the file is modified? And do we try to version
# control the kopt setting?)
dotest binfiles-14e "cat binfile" 'this file is $''RCSfile$'
dotest binfiles-14f "${testcvs} status binfile" \
-'===================================================================
+"===================================================================
File: binfile Status: Up-to-date
Working revision: 1\.5.*
- Repository revision: 1\.5 /tmp/cvs-sanity/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.5 ${TESTDIR}/cvsroot/first-dir/binfile,v
Sticky Tag: (none)
Sticky Date: (none)
- Sticky Options: -kb'
+ Sticky Options: -kb"
dotest binfiles-14g "${testcvs} -q update -A" '[UP] binfile'
dotest binfiles-14h "cat binfile" 'this file is binfile,v'
dotest binfiles-14i "${testcvs} status binfile" \
-'===================================================================
+"===================================================================
File: binfile Status: Up-to-date
Working revision: 1\.5.*
- Repository revision: 1\.5 /tmp/cvs-sanity/cvsroot/first-dir/binfile,v
+ Repository revision: 1\.5 ${TESTDIR}/cvsroot/first-dir/binfile,v
Sticky Tag: (none)
Sticky Date: (none)
- Sticky Options: -kv'
+ Sticky Options: -kv"
# Do sticky options work when used with 'cvs update'?
echo "Not a binary file." > nibfile
dotest binfiles-sticky1 "${testcvs} -q add nibfile" \
"${PROG} [a-z]*: use "\''cvs commit'\'' to add this file permanently'
dotest binfiles-sticky2 "${testcvs} -q ci -m add-it nibfile" \
- 'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/nibfile,v
+ "RCS file: ${TESTDIR}/cvsroot/first-dir/nibfile,v
done
Checking in nibfile;
-/tmp/cvs-sanity/cvsroot/first-dir/nibfile,v <-- nibfile
+${TESTDIR}/cvsroot/first-dir/nibfile,v <-- nibfile
initial revision: 1\.1
-done'
+done"
dotest binfiles-sticky3 "${testcvs} -q update -kb nibfile" \
'[UP] nibfile'
dotest binfiles-sticky4 "${testcvs} -q status nibfile" \
-'===================================================================
+"===================================================================
File: nibfile Status: Up-to-date
Working revision: 1\.1.*
- Repository revision: 1\.1 /tmp/cvs-sanity/cvsroot/first-dir/nibfile,v
+ Repository revision: 1\.1 ${TESTDIR}/cvsroot/first-dir/nibfile,v
Sticky Tag: (none)
Sticky Date: (none)
- Sticky Options: -kb'
+ Sticky Options: -kb"
# Eventually we should test that -A removes the -kb here...
cd ../..
@@ -4987,6 +5296,58 @@ File: nibfile Status: Up-to-date
rm -r 2
;;
+ binfiles2)
+ # Test cvs's ability to handle binary files, particularly branching
+ # and joining. The key thing we are worrying about is that CVS
+ # doesn't print "cannot merge binary files" or some such, in
+ # situations where no merging is required.
+ # See also "join" which does this with non-binary files.
+
+ mkdir ${CVSROOT_DIRNAME}/first-dir
+ mkdir 1; cd 1
+ dotest binfiles2-1 "${testcvs} -q co first-dir" ''
+ cd first-dir
+ # FIXCVS: unless a branch has at least one file on it,
+ # tag_check_valid won't know it exists. So creating a
+ # file here is a workaround.
+ touch dummy
+ dotest binfiles2-1a "${testcvs} add dummy" \
+"${PROG} [a-z]*: scheduling file .dummy. for addition
+${PROG} [a-z]*: use .cvs commit. to add this file permanently"
+ dotest binfiles2-1b "${testcvs} -q ci -m add-it" \
+"RCS file: ${TESTDIR}/cvsroot/first-dir/dummy,v
+done
+Checking in dummy;
+${TESTDIR}/cvsroot/first-dir/dummy,v <-- dummy
+initial revision: 1\.1
+done"
+ dotest binfiles2-2 "${testcvs} -q tag -b br" 'T dummy'
+ dotest binfiles2-3 "${testcvs} -q update -r br" ''
+ awk 'BEGIN { printf "%c%c%c%c%c%c", 2, 10, 137, 0, 13, 10 }' \
+ </dev/null >../binfile
+ cp ../binfile binfile.dat
+ dotest binfiles2-4 "${testcvs} add -kb binfile.dat" \
+"${PROG} [a-z]*: scheduling file .binfile\.dat. for addition on branch .br.
+${PROG} [a-z]*: use .cvs commit. to add this file permanently"
+ dotest binfiles2-5 "${testcvs} -q ci -m add-it" \
+"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/binfile\.dat,v
+done
+Checking in binfile\.dat;
+${TESTDIR}/cvsroot/first-dir/Attic/binfile\.dat,v <-- binfile\.dat
+new revision: 1\.1\.2\.1; previous revision: 1\.1
+done"
+ dotest binfiles2-6 "${testcvs} -q update -A" \
+"${PROG} [a-z]*: warning: binfile\.dat is not (any longer) pertinent"
+ dotest_fail binfiles2-7 "test -f binfile.dat" ''
+ dotest binfiles2-8 "${testcvs} -q update -j br" "U binfile.dat"
+ dotest binfiles2-9 "cmp ../binfile binfile.dat"
+ cd ..
+ cd ..
+
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1
+ ;;
+
binwrap)
# Test the ability to specify binary-ness based on file name.
# We could also be testing the ability to use the other
@@ -5008,15 +5369,15 @@ File: nibfile Status: Up-to-date
fail binwrap-1
fi
cd ..
- rm -rf dir-to-import
+ rm -r dir-to-import
dotest binwrap-2 "${testcvs} -q co first-dir" 'U first-dir/foo.c
U first-dir/foo.exe'
dotest binwrap-3 "${testcvs} -q status first-dir" \
-'===================================================================
+"===================================================================
File: foo\.c Status: Up-to-date
Working revision: 1\.1\.1\.1.*
- Repository revision: 1\.1\.1\.1 /tmp/cvs-sanity/cvsroot/first-dir/foo\.c,v
+ Repository revision: 1\.1\.1\.1 ${TESTDIR}/cvsroot/first-dir/foo\.c,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -5025,11 +5386,79 @@ File: foo\.c Status: Up-to-date
File: foo\.exe Status: Up-to-date
Working revision: 1\.1\.1\.1.*
- Repository revision: 1\.1\.1\.1 /tmp/cvs-sanity/cvsroot/first-dir/foo\.exe,v
+ Repository revision: 1\.1\.1\.1 ${TESTDIR}/cvsroot/first-dir/foo\.exe,v
Sticky Tag: (none)
Sticky Date: (none)
- Sticky Options: -kb'
- rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
+ Sticky Options: -kb"
+ rm -r first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ ;;
+
+ mwrap)
+ # Tests relating to the -m wrappers options. -k tests are in
+ # binwrap and -t/-f tests haven't been written yet.
+ dotest mwrap-c1 "${testcvs} -q co CVSROOT" "[UP] CVSROOT${DOTSTAR}"
+ cd CVSROOT
+ echo "* -m 'COPY'" >>cvswrappers
+ dotest mwrap-c2 "${testcvs} -q ci -m wrapper-mod" \
+"Checking in cvswrappers;
+${TESTDIR}/cvsroot/CVSROOT/cvswrappers,v <-- cvswrappers
+new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
+done
+${PROG} [a-z]*: Rebuilding administrative file database"
+ cd ..
+ mkdir m1; cd m1
+ dotest mwrap-1 "${testcvs} -q co -l ." ''
+ mkdir first-dir
+ dotest mwrap-2 "${testcvs} add first-dir" \
+"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+ cd first-dir
+ touch aa
+ dotest mwrap-3 "${testcvs} add aa" \
+"${PROG} [a-z]*: scheduling file .aa. for addition
+${PROG} [a-z]*: use .cvs commit. to add this file permanently"
+ dotest mwrap-4 "${testcvs} -q ci -m add" \
+"RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
+done
+Checking in aa;
+${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+initial revision: 1\.1
+done"
+ cd ../..
+ mkdir m2; cd m2
+ dotest mwrap-5 "${testcvs} -q co first-dir" "U first-dir/aa"
+ cd first-dir
+ echo "changed in m2" >aa
+ dotest mwrap-6 "${testcvs} -q ci -m m2-mod" \
+"Checking in aa;
+${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+new revision: 1\.2; previous revision: 1\.1
+done"
+ cd ../..
+ cd m1/first-dir
+ echo "changed in m1" >aa
+ dotest_fail mwrap-7 "${testcvs} -nq update" "C aa"
+ dotest_fail mwrap-8 "${testcvs} -q update" \
+"${PROG} [a-z]*: A -m .COPY. wrapper is specified
+${PROG} [a-z]*: but file aa needs merge
+${PROG} \[[a-z]* aborted\]: You probably want to avoid -m .COPY. wrappers"
+ # Under the old, dangerous behavior, this would have been
+ # "changed in m2" -- that is, the changes in the working directory
+ # would have been clobbered (!).
+ dotest mwrap-9 "cat aa" "changed in m1"
+ cd ../..
+ cd CVSROOT
+ echo '# comment out' >cvswrappers
+ dotest mwrap-ce "${testcvs} -q ci -m wrapper-mod" \
+"Checking in cvswrappers;
+${TESTDIR}/cvsroot/CVSROOT/cvswrappers,v <-- cvswrappers
+new revision: 1\.[0-9]*; previous revision: 1\.[0-9]*
+done
+${PROG} [a-z]*: Rebuilding administrative file database"
+ cd ..
+ rm -r CVSROOT
+ rm -r m1 m2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
info)
@@ -5052,11 +5481,11 @@ File: foo\.exe Status: Up-to-date
'"${PROG}"' [a-z]*: use '"'"'cvs commit'"'"' to add this file permanently'
dotest info-3 "${testcvs} -q ci -m new-loginfo" \
-'Checking in loginfo;
-/tmp/cvs-sanity/cvsroot/CVSROOT/loginfo,v <-- loginfo
+"Checking in loginfo;
+${TESTDIR}/cvsroot/CVSROOT/loginfo,v <-- loginfo
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"
cd ..
mkdir ${CVSROOT_DIRNAME}/first-dir
@@ -5068,21 +5497,21 @@ done
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
echo "cvs -s OTHER=not-this -s MYENV=env-" >>$HOME/.cvsrc
dotest info-6a "${testcvs} -q -s OTHER=value ci -m add-it" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
done
-'"${PROG}"' [a-z]*: loginfo:1: no such user variable ${=ZEE}'
+${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;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
cd ..
- dotest info-9 "cat $TESTDIR/testlog" 'xenv-valueyz=[a-z0-9@][a-z0-9@]*=/tmp/cvs-sanity/cvsroot='
+ dotest info-9 "cat $TESTDIR/testlog" "xenv-valueyz=[a-z0-9@][a-z0-9@]*=${TESTDIR}/cvsroot="
dotest info-10 "cat $TESTDIR/testlog2" 'first-dir file1,NONE,1.1
first-dir 1.1
first-dir file1
@@ -5098,7 +5527,7 @@ first-dir file1ux'
echo '# do nothing' >loginfo
dotest info-11 "${testcvs} -q -s ZEE=garbage ci -m nuke-loginfo" \
"Checking in loginfo;
-/tmp/cvs-sanity/cvsroot/CVSROOT/loginfo,v <-- loginfo
+${TESTDIR}/cvsroot/CVSROOT/loginfo,v <-- loginfo
new revision: 1\.[0-9]; previous revision: 1\.[0-9]
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -5117,7 +5546,7 @@ EOF
echo "^first-dir ${TESTDIR}/vscript" >>verifymsg
dotest info-v1 "${testcvs} -q ci -m add-verification" \
"Checking in verifymsg;
-/tmp/cvs-sanity/cvsroot/CVSROOT/verifymsg,v <-- verifymsg
+${TESTDIR}/cvsroot/CVSROOT/verifymsg,v <-- verifymsg
new revision: 1\.2; previous revision: 1\.1
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -5134,7 +5563,7 @@ and many more lines after it
EOF
dotest info-v3 "${testcvs} -q ci -F ${TESTDIR}/comment.tmp" \
"Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
done"
cd ..
@@ -5153,7 +5582,7 @@ ${PROG} \[[a-z]* aborted\]: Message verification failed"
echo '# do nothing' >verifymsg
dotest info-cleanup-verifymsg "${testcvs} -q ci -m nuke-verifymsg" \
"Checking in verifymsg;
-/tmp/cvs-sanity/cvsroot/CVSROOT/verifymsg,v <-- verifymsg
+${TESTDIR}/cvsroot/CVSROOT/verifymsg,v <-- verifymsg
new revision: 1\.[0-9]; previous revision: 1\.[0-9]
done
${PROG} [a-z]*: Rebuilding administrative file database"
@@ -5190,12 +5619,12 @@ ${PROG} [a-z]*: Rebuilding administrative file database"
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest serverpatch-3 "${testcvs} -q commit -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
-done'
+done"
# Tag the file.
dotest serverpatch-4 "${testcvs} -q tag tag file1" 'T file1'
@@ -5215,10 +5644,10 @@ done'
cd ../1/first-dir
echo '2' >> file1
dotest serverpatch-7 "${testcvs} -q ci -mx file1" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
# Now update the second copy. When using remote CVS, the
# patch will fail, forcing the file to be refetched.
@@ -5231,7 +5660,8 @@ done'
U file1'
cd ../..
- rm -rf 1 2 ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
log)
@@ -5252,56 +5682,56 @@ U file1'
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest log-3 "${testcvs} -q commit -m 1" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
-done'
+done"
echo 'second revision' > file1
dotest log-4 "${testcvs} -q ci -m2 file1" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
dotest log-5 "${testcvs} -q tag -b branch file1" 'T file1'
echo 'third revision' > file1
dotest log-6 "${testcvs} -q ci -m3 file1" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.3; previous revision: 1\.2
-done'
+done"
dotest log-7 "${testcvs} -q update -r branch" '[UP] file1'
echo 'first branch revision' > file1
dotest log-8 "${testcvs} -q ci -m1b file1" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.2\.2\.1; previous revision: 1\.2
-done'
+done"
dotest log-9 "${testcvs} -q tag tag file1" 'T file1'
echo 'second branch revision' > file1
dotest log-10 "${testcvs} -q ci -m2b file1" \
-'Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+"Checking in file1;
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
new revision: 1\.2\.2\.2; previous revision: 1\.2\.2\.1
-done'
+done"
# Set up a bunch of shell variables to make the later tests
# easier to describe.=
- log_header='
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+ log_header="
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
Working file: file1
head: 1\.3
branch:
locks: strict
-access list:'
+access list:"
log_tags='symbolic names:
tag: 1\.2\.2\.1
branch: 1\.2\.0\.2'
@@ -5457,7 +5887,8 @@ ${log_rev1}
${log_trailer}"
cd ..
- rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
+ rm -r first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
log2)
@@ -5476,14 +5907,14 @@ ${log_trailer}"
"${PROG}"' [a-z]*: scheduling file `file1'\'' for addition
'"${PROG}"' [a-z]*: use '\''cvs commit'\'' to add this file permanently'
dotest log2-3 "${testcvs} -q commit -m 1" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
-done'
- dotest log2-4 "${testcvs} log -N file1" '
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+done"
+ dotest log2-4 "${testcvs} log -N file1" "
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
Working file: file1
head: 1\.1
branch:
@@ -5495,12 +5926,13 @@ description:
file1-is-for-testing
----------------------------
revision 1\.1
-date: [0-9/]* [0-9:]*; author: '"${username}"'; state: Exp;
+date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
1
-============================================================================='
+============================================================================="
cd ..
- rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
+ rm -r first-dir
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
fi # end of tests skipped for remote
@@ -5517,13 +5949,13 @@ date: [0-9/]* [0-9:]*; author: '"${username}"'; state: Exp;
# First, if the repository doesn't exist at all...
dotest_fail crerepos-1 \
"${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
-"${PROG} \[[a-z]* aborted\]: /tmp/cvs-sanity/crerepos/CVSROOT: .*"
+"${PROG} \[[a-z]* aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
mkdir crerepos
# The repository exists but CVSROOT doesn't.
dotest_fail crerepos-2 \
"${testcvs} -d ${TESTDIR}/crerepos co cvs-sanity" \
-"${PROG} \[[a-z]* aborted\]: /tmp/cvs-sanity/crerepos/CVSROOT: .*"
+"${PROG} \[[a-z]* aborted\]: ${TESTDIR}/crerepos/CVSROOT: .*"
mkdir crerepos/CVSROOT
# Checkout of nonexistent module
@@ -5546,7 +5978,7 @@ ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
else
fail crerepos-5
fi
- rm -rf CVS
+ rm -r CVS
cd ..
# The directory tmp should be empty
dotest crerepos-6 "rmdir tmp" ''
@@ -5565,13 +5997,13 @@ ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
dotest_fail crerepos-6a "${testcvs} -q -d ../crerepos get ." \
"${PROG} \[[a-z]* aborted\]: CVSROOT ../crerepos must be an absolute pathname"
cd ..
- rm -rf 1
+ rm -r 1
mkdir 1; cd 1
dotest_fail crerepos-6b "${testcvs} -d crerepos init" \
"${PROG} \[[a-z]* aborted\]: CVSROOT crerepos must be an absolute pathname"
cd ..
- rm -rf 1
+ rm -r 1
else # remote
# Test that CVS rejects a relative path in CVSROOT.
mkdir 1; cd 1
@@ -5579,14 +6011,14 @@ ${testcvs} -d ${TESTDIR}/crerepos release -d CVSROOT >>${LOGFILE}; then
"${testcvs} -q -d :ext:`hostname`:../crerepos get ." \
"Root ../crerepos must be an absolute pathname"
cd ..
- rm -rf 1
+ rm -r 1
mkdir 1; cd 1
dotest_fail crerepos-6b \
"${testcvs} -d :ext:`hostname`:crerepos init" \
"Root crerepos must be an absolute pathname"
cd ..
- rm -rf 1
+ rm -r 1
fi # end of tests to be skipped for remote
# CVS better not create a history file--if the administrator
@@ -5690,7 +6122,7 @@ EOF
dotest rcs-1 "${testcvs} -q co first-dir" 'U first-dir/file1'
cd first-dir
dotest rcs-2 "${testcvs} -q log" "
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
Working file: file1
head: 1\.3
branch:
@@ -5724,7 +6156,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<" "
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
Working file: file1
head: 1\.3
branch:
@@ -5745,7 +6177,7 @@ delete second line; modify twelfth line
if ${testcvs} -q log -d '<3 Apr 2000 00:00' >${TESTDIR}/rcs4.tmp
then
dotest rcs-4 "cat ${TESTDIR}/rcs4.tmp" "
-RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
Working file: file1
head: 1\.3
branch:
@@ -5768,8 +6200,10 @@ add file1
else
fail rcs-4
fi
+ cd ..
- rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir ${TESTDIR}/rcs4.tmp
+ rm -r first-dir ${TESTDIR}/rcs4.tmp
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
big)
@@ -5799,22 +6233,22 @@ add file1
"${PROG} [a-z]*: scheduling file .file1. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest big-3 "${testcvs} -q ci -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/file1,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/file1,v
done
Checking in file1;
-/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1
+${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
-done'
+done"
cd ..
- rm -rf first-dir
+ rm -r first-dir
dotest big-4 "${testcvs} -q get first-dir" "U first-dir/file1"
if test "$keep" = yes; then
- echo Keeping /tmp/cvs-sanity and exiting due to --keep
+ echo Keeping ${TESTDIR} and exiting due to --keep
exit 0
fi
- rm -rf first-dir
+ rm -r first-dir
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -5836,45 +6270,45 @@ done'
dotest modes-1 "${testcvs} -q co -l ." ''
mkdir first-dir
dotest modes-2 "${testcvs} add first-dir" \
-"Directory /tmp/cvs-sanity/cvsroot/first-dir added to the repository"
+"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
cd first-dir
touch aa
dotest modes-3 "${testcvs} add aa" \
"${PROG} [a-z]*: scheduling file .aa. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest modes-4 "${testcvs} -q ci -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/aa,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
done
Checking in aa;
-/tmp/cvs-sanity/cvsroot/first-dir/aa,v <-- aa
+${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
initial revision: 1\.1
-done'
- dotest modes-5 "ls -l /tmp/cvs-sanity/cvsroot/first-dir/aa,v" \
+done"
+ dotest modes-5 "ls -l ${TESTDIR}/cvsroot/first-dir/aa,v" \
"-r--r--r-- .*"
# Test for whether we can set the execute bit.
chmod +x aa
echo change it >>aa
dotest modes-6 "${testcvs} -q ci -m set-execute-bit" \
-'Checking in aa;
-/tmp/cvs-sanity/cvsroot/first-dir/aa,v <-- aa
+"Checking in aa;
+${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
new revision: 1\.2; previous revision: 1\.1
-done'
+done"
# If CVS let us update the execute bit, it would be set here.
# But it doesn't, and as far as I know that is longstanding
# CVS behavior.
- dotest modes-7 "ls -l /tmp/cvs-sanity/cvsroot/first-dir/aa,v" \
+ dotest modes-7 "ls -l ${TESTDIR}/cvsroot/first-dir/aa,v" \
"-r--r--r-- .*"
# OK, now manually change the modes and see what happens.
- chmod g=r,o= /tmp/cvs-sanity/cvsroot/first-dir/aa,v
+ chmod g=r,o= ${TESTDIR}/cvsroot/first-dir/aa,v
echo second line >>aa
dotest modes-7a "${testcvs} -q ci -m set-execute-bit" \
"Checking in aa;
${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
new revision: 1\.3; previous revision: 1\.2
done"
- dotest modes-7b "ls -l /tmp/cvs-sanity/cvsroot/first-dir/aa,v" \
+ dotest modes-7b "ls -l ${TESTDIR}/cvsroot/first-dir/aa,v" \
"-r--r----- .*"
CVSUMASK=007
@@ -5886,20 +6320,20 @@ done"
"${PROG} [a-z]*: scheduling file .ab. for addition
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
dotest modes-9 "${testcvs} -q ci -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/ab,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/ab,v
done
Checking in ab;
-/tmp/cvs-sanity/cvsroot/first-dir/ab,v <-- ab
+${TESTDIR}/cvsroot/first-dir/ab,v <-- ab
initial revision: 1\.1
-done'
+done"
if test "x$remote" = xyes; then
# The problem here is that the CVSUMASK environment variable
# needs to be set on the server (e.g. .bashrc). This is, of
# course, bogus, but that is the way it is currently.
- dotest modes-10 "ls -l /tmp/cvs-sanity/cvsroot/first-dir/ab,v" \
+ dotest modes-10 "ls -l ${TESTDIR}/cvsroot/first-dir/ab,v" \
"-r-xr-x---.*" "-r-xr-xr-x.*"
else
- dotest modes-10 "ls -l /tmp/cvs-sanity/cvsroot/first-dir/ab,v" \
+ dotest modes-10 "ls -l ${TESTDIR}/cvsroot/first-dir/ab,v" \
"-r-xr-x---.*"
fi
@@ -5916,31 +6350,172 @@ ${PROG} [a-z]*: use .cvs commit. to add this file permanently"
# when we are just now adding the file; as far as I know
# that is longstanding CVS behavior, for what it's worth.
dotest modes-14 "${testcvs} -q ci -m add" \
-'RCS file: /tmp/cvs-sanity/cvsroot/first-dir/Attic/ac,v
+"RCS file: ${TESTDIR}/cvsroot/first-dir/Attic/ac,v
done
Checking in ac;
-/tmp/cvs-sanity/cvsroot/first-dir/Attic/ac,v <-- ac
+${TESTDIR}/cvsroot/first-dir/Attic/ac,v <-- ac
new revision: 1\.1\.2\.1; previous revision: 1\.1
-done'
+done"
if test "x$remote" = xyes; then
# The problem here is that the CVSUMASK environment variable
# needs to be set on the server (e.g. .bashrc). This is, of
# course, bogus, but that is the way it is currently.
dotest modes-15 \
-"ls -l /tmp/cvs-sanity/cvsroot/first-dir/Attic/ac,v" \
+"ls -l ${TESTDIR}/cvsroot/first-dir/Attic/ac,v" \
"-r--r--r--.*"
else
dotest modes-15 \
-"ls -l /tmp/cvs-sanity/cvsroot/first-dir/Attic/ac,v" \
+"ls -l ${TESTDIR}/cvsroot/first-dir/Attic/ac,v" \
"-r--r-----.*"
fi
cd ../..
- rm -rf 1 ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
# Perhaps should restore the umask and CVSUMASK. But the other
# tests "should" not care about them...
;;
+ stamps)
+ # Test timestamps.
+ mkdir 1; cd 1
+ dotest stamps-1 "${testcvs} -q co -l ." ''
+ mkdir first-dir
+ dotest stamps-2 "${testcvs} add first-dir" \
+"Directory ${TESTDIR}/cvsroot/first-dir added to the repository"
+ cd first-dir
+ touch aa
+ echo '$''Id$' >kw
+ ls -l aa >${TESTDIR}/1/stamp.aa.touch
+ ls -l kw >${TESTDIR}/1/stamp.kw.touch
+ # "sleep 1" would suffice if we could assume ls --full-time, but
+ # that is as far as I know unique to GNU ls. Is there some POSIX.2
+ # way to get the timestamp of a file, including the seconds?
+ sleep 60
+ dotest stamps-3 "${testcvs} add aa kw" \
+"${PROG} [a-z]*: scheduling file .aa. for addition
+${PROG} [a-z]*: scheduling file .kw. for addition
+${PROG} [a-z]*: use .cvs commit. to add these files permanently"
+ ls -l aa >${TESTDIR}/1/stamp.aa.add
+ ls -l kw >${TESTDIR}/1/stamp.kw.add
+ # "cvs add" should not muck with the timestamp.
+ dotest stamps-4aa \
+"cmp ${TESTDIR}/1/stamp.aa.touch ${TESTDIR}/1/stamp.aa.add" ''
+ dotest stamps-4kw \
+"cmp ${TESTDIR}/1/stamp.kw.touch ${TESTDIR}/1/stamp.kw.add" ''
+ sleep 60
+ dotest stamps-5 "${testcvs} -q ci -m add" \
+"RCS file: ${TESTDIR}/cvsroot/first-dir/aa,v
+done
+Checking in aa;
+${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+initial revision: 1\.1
+done
+RCS file: ${TESTDIR}/cvsroot/first-dir/kw,v
+done
+Checking in kw;
+${TESTDIR}/cvsroot/first-dir/kw,v <-- kw
+initial revision: 1\.1
+done"
+ ls -l aa >${TESTDIR}/1/stamp.aa.ci
+ ls -l kw >${TESTDIR}/1/stamp.kw.ci
+ # If there are no keywords, "cvs ci" leaves the timestamp alone
+ # If there are, it sets the timestamp to the date of the commit.
+ # I'm not sure how logical this is, but it is intentional.
+ # If we wanted to get fancy we would make sure the time as
+ # reported in "cvs log kw" matched stamp.kw.ci. But that would
+ # be a lot of work.
+ dotest stamps-6aa \
+ "cmp ${TESTDIR}/1/stamp.aa.add ${TESTDIR}/1/stamp.aa.ci" ''
+ if cmp ${TESTDIR}/1/stamp.kw.add ${TESTDIR}/1/stamp.kw.ci >/dev/null
+ then
+ fail stamps-6kw
+ else
+ pass stamps-6kw
+ fi
+ cd ../..
+ sleep 60
+ mkdir 2
+ cd 2
+ dotest stamps-7 "${testcvs} -q get first-dir" "U first-dir/aa
+U first-dir/kw"
+ cd first-dir
+ ls -l aa >${TESTDIR}/1/stamp.aa.get
+ ls -l kw >${TESTDIR}/1/stamp.kw.get
+ # On checkout, CVS should set the timestamp to the date that the
+ # file was committed. Could check that the time as reported in
+ # "cvs log aa" matches stamp.aa.get, but that would be a lot of
+ # work.
+ if cmp ${TESTDIR}/1/stamp.aa.ci ${TESTDIR}/1/stamp.aa.get >/dev/null
+ then
+ fail stamps-8aa
+ else
+ pass stamps-8aa
+ fi
+ dotest stamps-8kw \
+ "cmp ${TESTDIR}/1/stamp.kw.ci ${TESTDIR}/1/stamp.kw.get" ''
+
+ # Now we want to see what "cvs update" does.
+ sleep 60
+ echo add a line >>aa
+ echo add a line >>kw
+ dotest stamps-9 "${testcvs} -q ci -m change-them" \
+"Checking in aa;
+${TESTDIR}/cvsroot/first-dir/aa,v <-- aa
+new revision: 1\.2; previous revision: 1\.1
+done
+Checking in kw;
+${TESTDIR}/cvsroot/first-dir/kw,v <-- kw
+new revision: 1\.2; previous revision: 1\.1
+done"
+ ls -l aa >${TESTDIR}/1/stamp.aa.ci2
+ ls -l kw >${TESTDIR}/1/stamp.kw.ci2
+ cd ../..
+ cd 1/first-dir
+ sleep 60
+ dotest stamps-10 "${testcvs} -q update" '[UP] aa
+[UP] kw'
+ # this doesn't serve any function other than being able to
+ # look at it manually, as we have no machinery for dates being
+ # newer or older than other dates.
+ date >${TESTDIR}/1/stamp.debug.update
+ ls -l aa >${TESTDIR}/1/stamp.aa.update
+ ls -l kw >${TESTDIR}/1/stamp.kw.update
+ # stamp.aa.update and stamp.kw.update should both be approximately
+ # the same as stamp.debug.update. Perhaps we could be testing
+ # this in a more fancy fashion by "touch stamp.before" before
+ # stamps-10, "touch stamp.after" after, and then using ls -t
+ # to check them. But for now we just make sure that the *.update
+ # stamps differ from the *.ci2 ones.
+ # As for the rationale, this is so that if one updates and gets
+ # a new revision, then "make" will be sure to regard those files
+ # as newer than .o files which may be sitting around.
+ if cmp ${TESTDIR}/1/stamp.aa.update ${TESTDIR}/1/stamp.aa.ci2 \
+ >/dev/null
+ then
+ fail stamps-11aa
+ else
+ pass stamps-11aa
+ fi
+ if cmp ${TESTDIR}/1/stamp.kw.update ${TESTDIR}/1/stamp.kw.ci2 \
+ >/dev/null
+ then
+ fail stamps-11kw
+ else
+ pass stamps-11kw
+ fi
+
+ cd ../..
+
+ if test "$keep" = yes; then
+ echo Keeping ${TESTDIR} and exiting due to --keep
+ exit 0
+ fi
+
+ rm -r 1 2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ ;;
+
sticky)
# More tests of sticky tags, particularly non-branch sticky tags.
mkdir 1; cd 1
@@ -5983,7 +6558,8 @@ ${QUESTION} file2" "${QUESTION} file2
${PROG} [a-z]*: use .cvs commit. to add this file permanently"
cd ../..
- rm -rf 1 ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
keyword)
@@ -6154,7 +6730,7 @@ xx "'\$'"Log"'\$'
# This workaround should be removed when the bug is fixed.
if test "x$remote" = "xyes"; then
cd ..
- rm -rf first-dir
+ rm -r first-dir
dotest keyword-17 "${testcvs} -q co first-dir" "U first-dir/file1"
cd first-dir
else
@@ -6220,7 +6796,79 @@ xx
change"
cd ../..
- rm -rf 1 ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
+ ;;
+
+ toplevel)
+ # test the feature that cvs creates a CVS subdir also for
+ # the toplevel directory
+
+ # Some test, somewhere, is creating Emptydir. That test
+ # should, perhaps, clean up for itself, but I don't know which
+ # one it is.
+ rm -rf ${CVSROOT_DIRNAME}/CVSROOT/Emptydir
+
+ mkdir 1; cd 1
+ dotest toplevel-1 "${testcvs} -q co -l ." ''
+ mkdir top-dir
+ dotest toplevel-2 "${testcvs} add top-dir" \
+"Directory ${TESTDIR}/cvsroot/top-dir added to the repository"
+ cd top-dir
+
+ touch file1
+ dotest toplevel-3 "${testcvs} add file1" \
+"${PROG} [a-z]*: scheduling file .file1. for addition
+${PROG} [a-z]*: use .cvs commit. to add this file permanently"
+ dotest toplevel-4 "${testcvs} -q ci -m add" \
+"RCS file: ${TESTDIR}/cvsroot/top-dir/file1,v
+done
+Checking in file1;
+${TESTDIR}/cvsroot/top-dir/file1,v <-- file1
+initial revision: 1\.1
+done"
+
+ cd ../..
+ rm -r 1; mkdir 1; cd 1
+ dotest toplevel-5 "${testcvs} co top-dir" \
+"${PROG} [a-z]*: Updating top-dir
+U top-dir/file1"
+
+ dotest toplevel-6 "${testcvs} update top-dir" \
+"${PROG} [a-z]*: Updating top-dir"
+ dotest toplevel-7 "${testcvs} update" \
+"${PROG} [a-z]*: Updating \.
+${PROG} [a-z]*: Updating top-dir"
+
+ dotest toplevel-8 "${testcvs} update -d top-dir" \
+"${PROG} [a-z]*: Updating top-dir"
+ # FIXME: This test fails in cvs starting from 1.9.2 because
+ # it updates "file1" in "1". Test modules3-7f also finds
+ # (and tolerates) this bug. The second expect string below
+ # should be removed when this is fixed. The first expect
+ # string is the behavior of remote CVS. There is some sentiment
+ # that
+ # "${PROG} [a-z]*: Updating \.
+ # ${PROG} [a-z]*: Updating top-dir"
+ # is correct but it isn't clear why that would be correct instead
+ # of the remote CVS behavior.
+ #
+ # The DOTSTAR matches of a bunch of lines like
+ # "U CVSROOT/checkoutlist". Trying to match them more precisely
+ # seemed to cause trouble. For example CVSROOT/cvsignore will
+ # be present or absent depending on whether we ran the "ignore"
+ # test or not.
+ dotest toplevel-9 "${testcvs} update -d" \
+"${PROG} [a-z]*: Updating \.
+${PROG} [a-z]*: Updating CVSROOT
+${DOTSTAR}
+${PROG} [a-z]*: Updating top-dir" \
+"${PROG} [a-z]*: Updating \.
+U file1
+${PROG} [a-z]*: Updating top-dir"
+
+ cd ..
+ rm -r 1
;;
*)
@@ -6233,7 +6881,6 @@ echo "OK, all tests completed."
# TODO:
# * use "test" not "[" and see if all test's support `-z'
-# * Test `cvs admin'.
# * Test `cvs update -d foo' (where foo does not exist).
# * Test `cvs update foo bar' (where foo and bar are both from the
# same directory in the repository). Suppose one is a branch--make
@@ -6252,9 +6899,9 @@ echo "OK, all tests completed."
# * cvs rm twice (should be a nice error message).
# * -P option to checkout--(a) refrains from checking out new empty dirs,
# (b) prunes empty dirs already there.
-# * Test that cvs -d `hostname`:/tmp/cvs-sanity/non/existent co foo
+# * Test that cvs -d `hostname`:${TESTDIR}/non/existent co foo
# gives an appropriate error (e.g.
-# Cannot access /tmp/cvs-sanity/non-existent/CVSROOT
+# Cannot access ${TESTDIR}/non-existent/CVSROOT
# No such file or directory).
# (like basica-9, but for remote).
# * Test ability to send notifications in response to watches. (currently
diff --git a/gnu/usr.bin/cvs/src/server.h b/gnu/usr.bin/cvs/src/server.h
index cb332250783..743f0901233 100644
--- a/gnu/usr.bin/cvs/src/server.h
+++ b/gnu/usr.bin/cvs/src/server.h
@@ -21,11 +21,19 @@ extern int server_expanding;
/* Run the server. */
extern int server PROTO((int argc, char **argv));
+/* See server.c for description. */
+extern void server_pathname_check PROTO ((char *));
+
/* We have a new Entries line for a file. TAG or DATE can be NULL. */
extern void server_register
PROTO((char *name, char *version, char *timestamp,
char *options, char *tag, char *date, char *conflict));
+/* Set the modification time of the next file sent. This must be
+ followed by a call to server_updated on the same file. */
+extern void server_modtime PROTO ((struct file_info *finfo,
+ Vers_TS *vers_ts));
+
/*
* We want to nuke the Entries line for a file, and (unless
* server_scratch_entry_only is subsequently called) the file itself.
@@ -57,13 +65,23 @@ extern void server_copy_file
case, vers must be non-NULL, and UPDATED indicates whether the file
is now up to date (SERVER_UPDATED, yes, SERVER_MERGED, no,
SERVER_PATCHED, yes, but file is a diff from user version to
- repository version). */
-enum server_updated_arg4 {SERVER_UPDATED, SERVER_MERGED, SERVER_PATCHED};
+ repository version, SERVER_RCS_DIFF, yes, like SERVER_PATCHED but
+ with an RCS style diff). */
+enum server_updated_arg4
+{
+ SERVER_UPDATED,
+ SERVER_MERGED,
+ SERVER_PATCHED,
+ SERVER_RCS_DIFF
+};
extern void server_updated
PROTO((struct file_info *finfo, Vers_TS *vers,
enum server_updated_arg4 updated, struct stat *,
unsigned char *checksum));
+/* Whether we should send RCS format patches. */
+extern int server_use_rcs_diff PROTO((void));
+
/* Set the Entries.Static flag. */
extern void server_set_entstat PROTO((char *update_dir, char *repository));
/* Clear it. */
@@ -93,6 +111,10 @@ extern void server_cleanup PROTO((int sig));
extern void server_pause_check PROTO((void));
#endif /* SERVER_FLOWCONTROL */
+#ifdef AUTH_SERVER_SUPPORT
+extern char *CVS_Username;
+#endif /* AUTH_SERVER_SUPPORT */
+
#endif /* SERVER_SUPPORT */
/* Stuff shared with the client. */
diff --git a/gnu/usr.bin/cvs/src/status.c b/gnu/usr.bin/cvs/src/status.c
index 67b71beb565..cdc09493601 100644
--- a/gnu/usr.bin/cvs/src/status.c
+++ b/gnu/usr.bin/cvs/src/status.c
@@ -40,7 +40,7 @@ status (argc, argv)
if (argc == -1)
usage (status_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+vlR")) != -1)
{
switch (c)
diff --git a/gnu/usr.bin/cvs/src/subr.c b/gnu/usr.bin/cvs/src/subr.c
index 71d8ef8f3a1..d29942ba0dc 100644
--- a/gnu/usr.bin/cvs/src/subr.c
+++ b/gnu/usr.bin/cvs/src/subr.c
@@ -114,16 +114,58 @@ void
strip_trailing_newlines (str)
char *str;
{
- int len;
- len = strlen (str) - 1;
+ int len;
+ len = strlen (str) - 1;
- while (str[len] == '\n')
- str[len--] = '\0';
+ while (str[len] == '\n')
+ str[len--] = '\0';
}
-/*
- * Recover the space allocated by line2argv()
- */
+/* Return the number of levels that path ascends above where it starts.
+ For example:
+ "../../foo" -> 2
+ "foo/../../bar" -> 1
+ */
+/* FIXME: Should be using ISDIRSEP, last_component, or some other
+ mechanism which is more general than just looking at slashes,
+ particularly for the client.c caller. The server.c caller might
+ want something different, so be careful. */
+int
+pathname_levels (path)
+ char *path;
+{
+ char *p;
+ char *q;
+ int level;
+ int max_level;
+
+ max_level = 0;
+ p = path;
+ level = 0;
+ do
+ {
+ q = strchr (p, '/');
+ if (q != NULL)
+ ++q;
+ if (p[0] == '.' && p[1] == '.' && (p[2] == '\0' || p[2] == '/'))
+ {
+ --level;
+ if (-level > max_level)
+ max_level = -level;
+ }
+ else if (p[0] == '.' && (p[1] == '\0' || p[1] == '/'))
+ ;
+ else
+ ++level;
+ p = q;
+ } while (p != NULL);
+ return max_level;
+}
+
+
+/* Free a vector, where (*ARGV)[0], (*ARGV)[1], ... (*ARGV)[*PARGC - 1]
+ are malloc'd and so is *ARGV itself. Such a vector is allocated by
+ line2argv or expand_wild, for example. */
void
free_names (pargc, argv)
int *pargc;
@@ -157,7 +199,9 @@ line2argv (pargc, argv, line)
int argv_allocated;
/* Small for testing. */
- argv_allocated = 1;
+ /* argv_allocated must be at least 3 because at some places
+ (e.g. checkout_proc) cvs alters argv[2]. */
+ argv_allocated = 4;
*argv = (char **) xmalloc (argv_allocated * sizeof (**argv));
*pargc = 0;
@@ -190,11 +234,13 @@ numdots (s)
return (dots);
}
-/*
- * Get the caller's login from his uid. If the real uid is "root" try LOGNAME
- * USER or getlogin(). If getlogin() and getpwuid() both fail, return
- * the uid as a string.
- */
+/* Return the username by which the caller should be identified in
+ CVS, in contexts such as the author field of RCS files, various
+ logs, etc.
+
+ Returns a pointer to storage that we manage; it is good until the
+ next call to getcaller () (provided that the caller doesn't call
+ getlogin () or some such themself). */
char *
getcaller ()
{
@@ -203,6 +249,16 @@ getcaller ()
char *name;
uid_t uid;
+ /* If there is a CVS username, return it. */
+#ifdef AUTH_SERVER_SUPPORT
+ if (CVS_Username != NULL)
+ return CVS_Username;
+#endif
+
+ /* Get the caller's login from his uid. If the real uid is "root"
+ try LOGNAME USER or getlogin(). If getlogin() and getpwuid()
+ both fail, return the uid as a string. */
+
uid = getuid ();
if (uid == (uid_t) 0)
{
diff --git a/gnu/usr.bin/cvs/src/tag.c b/gnu/usr.bin/cvs/src/tag.c
index 9c49da562bb..93e6c6723fc 100644
--- a/gnu/usr.bin/cvs/src/tag.c
+++ b/gnu/usr.bin/cvs/src/tag.c
@@ -82,7 +82,7 @@ cvstag (argc, argv)
if (argc == -1)
usage (tag_usage);
- optind = 1;
+ optind = 0;
while ((c = getopt (argc, argv, "+FQqlRcdr:D:bf")) != -1)
{
switch (c)
diff --git a/gnu/usr.bin/cvs/src/vers_ts.c b/gnu/usr.bin/cvs/src/vers_ts.c
index 03a0036202c..613e52eb21e 100644
--- a/gnu/usr.bin/cvs/src/vers_ts.c
+++ b/gnu/usr.bin/cvs/src/vers_ts.c
@@ -177,13 +177,26 @@ Version_TS (finfo, options, tag, date, force_tag_match, set_time)
*/
if (set_time)
{
- struct utimbuf t;
+#ifdef SERVER_SUPPORT
+ if (server_active)
+ server_modtime (finfo, vers_ts);
+ else
+#endif
+ {
+ struct utimbuf t;
- memset ((char *) &t, 0, sizeof (t));
- if (vers_ts->vn_rcs &&
- (t.actime = t.modtime = RCS_getrevtime (rcsdata,
- vers_ts->vn_rcs, (char *) 0, 0)) != -1)
- (void) utime (finfo->file, &t);
+ memset (&t, 0, sizeof (t));
+ if (vers_ts->vn_rcs)
+ {
+ t.modtime =
+ RCS_getrevtime (rcsdata, vers_ts->vn_rcs, 0, 0);
+ if (t.modtime != (time_t) -1)
+ {
+ t.actime = t.modtime;
+ (void) utime (finfo->file, &t);
+ }
+ }
+ }
}
}
diff --git a/gnu/usr.bin/cvs/src/version.c b/gnu/usr.bin/cvs/src/version.c
index 8e19b26bf35..c44217985a3 100644
--- a/gnu/usr.bin/cvs/src/version.c
+++ b/gnu/usr.bin/cvs/src/version.c
@@ -12,7 +12,7 @@
#include "cvs.h"
-char *version_string = "\nConcurrent Versions System (CVS) 1.9.8";
+char *version_string = "\nConcurrent Versions System (CVS) 1.9.10";
#ifdef CLIENT_SUPPORT
#ifdef SERVER_SUPPORT
diff --git a/gnu/usr.bin/cvs/src/watch.c b/gnu/usr.bin/cvs/src/watch.c
index 70deb7c3477..6cec1573621 100644
--- a/gnu/usr.bin/cvs/src/watch.c
+++ b/gnu/usr.bin/cvs/src/watch.c
@@ -17,10 +17,11 @@
const char *const watch_usage[] =
{
- "Usage: %s %s [on|off|add|remove] [-l] [-a action] [files...]\n",
+ "Usage: %s %s [on|off|add|remove] [-lR] [-a action] [files...]\n",
"on/off: turn on/off read-only checkouts of files\n",
"add/remove: add or remove notification on actions\n",
"-l (on/off/add/remove): Local directory only, not recursive\n",
+ "-R (on/off/add/remove): Process directories recursively\n",
"-a (add/remove): Specify what actions, one of\n",
" edit,unedit,commit,all,none\n",
NULL
@@ -255,14 +256,17 @@ watch_addremove (argc, argv)
the_args.commit = 0;
the_args.edit = 0;
the_args.unedit = 0;
- optind = 1;
- while ((c = getopt (argc, argv, "+la:")) != -1)
+ optind = 0;
+ while ((c = getopt (argc, argv, "+lRa:")) != -1)
{
switch (c)
{
case 'l':
local = 1;
break;
+ case 'R':
+ local = 0;
+ break;
case 'a':
a_omitted = 0;
if (strcmp (optarg, "edit") == 0)
@@ -410,7 +414,9 @@ watch (argc, argv)
static const char *const watchers_usage[] =
{
- "Usage: %s %s [files...]\n",
+ "Usage: %s %s [-lR] [files...]\n",
+ "\t-l\tProcess this directory only (not recursive).\n",
+ "\t-R\tProcess directories recursively.\n",
NULL
};
@@ -479,14 +485,17 @@ watchers (argc, argv)
if (argc == -1)
usage (watchers_usage);
- optind = 1;
- while ((c = getopt (argc, argv, "+l")) != -1)
+ optind = 0;
+ while ((c = getopt (argc, argv, "+lR")) != -1)
{
switch (c)
{
case 'l':
local = 1;
break;
+ case 'R':
+ local = 0;
+ break;
case '?':
default:
usage (watchers_usage);
diff --git a/gnu/usr.bin/cvs/src/wrapper.c b/gnu/usr.bin/cvs/src/wrapper.c
index 6a7cea4af10..825cdcdeb7a 100644
--- a/gnu/usr.bin/cvs/src/wrapper.c
+++ b/gnu/usr.bin/cvs/src/wrapper.c
@@ -181,6 +181,8 @@ wrap_add_file (file, temp)
}
while (getline (&line, &line_allocated, fp) >= 0)
wrap_add (line, temp);
+ if (line)
+ free (line);
if (ferror (fp))
error (0, errno, "cannot read %s", file);
if (fclose (fp) == EOF)
@@ -385,7 +387,7 @@ wrap_name_has (name,has)
char *temp;
for(x=0;x<count;++x)
- if (fnmatch (wrap_list[x]->wildCard, name, 0) == 0){
+ if (CVS_FNMATCH (wrap_list[x]->wildCard, name, 0) == 0){
switch(has){
case WRAP_TOCVS:
temp=wrap_list[x]->tocvsFilter;
@@ -416,7 +418,7 @@ wrap_matching_entry (name)
int x,count=wrap_count+wrap_saved_count;
for(x=0;x<count;++x)
- if (fnmatch (wrap_list[x]->wildCard, name, 0) == 0)
+ if (CVS_FNMATCH (wrap_list[x]->wildCard, name, 0) == 0)
return wrap_list[x];
return (WrapperEntry *)NULL;
}