summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-06-22 10:55:49 +0000
committerpeter <peter@FreeBSD.org>1997-06-22 10:55:49 +0000
commit891d25f8be548bdcb7be081005a66c22b10145d5 (patch)
tree731f065a1bc1f2b38d6dfaf949901571ecd4bc91 /contrib/cvs/src
parentacef7b6f1a3cc1955c5db86ec324f77002eccf88 (diff)
parent571cfa0005d94d99d1341bf8ab02be04d4df5f9f (diff)
downloadFreeBSD-src-891d25f8be548bdcb7be081005a66c22b10145d5.zip
FreeBSD-src-891d25f8be548bdcb7be081005a66c22b10145d5.tar.gz
This commit was generated by cvs2svn to compensate for changes in r26801,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/cvs/src')
-rw-r--r--contrib/cvs/src/ChangeLog123
-rw-r--r--contrib/cvs/src/checkout.c45
-rw-r--r--contrib/cvs/src/client.c58
-rw-r--r--contrib/cvs/src/find_names.c4
-rw-r--r--contrib/cvs/src/ignore.c8
-rw-r--r--contrib/cvs/src/patch.c8
-rw-r--r--contrib/cvs/src/rcscmds.c2
-rw-r--r--contrib/cvs/src/root.c80
-rw-r--r--contrib/cvs/src/run.c12
-rwxr-xr-xcontrib/cvs/src/sanity.sh450
-rw-r--r--contrib/cvs/src/server.h9
-rw-r--r--contrib/cvs/src/subr.c22
-rw-r--r--contrib/cvs/src/update.c21
-rw-r--r--contrib/cvs/src/vers_ts.c25
-rw-r--r--contrib/cvs/src/version.c2
-rw-r--r--contrib/cvs/src/wrapper.c4
16 files changed, 753 insertions, 120 deletions
diff --git a/contrib/cvs/src/ChangeLog b/contrib/cvs/src/ChangeLog
index 5f4f43e..0c8b0f6 100644
--- a/contrib/cvs/src/ChangeLog
+++ b/contrib/cvs/src/ChangeLog
@@ -1,3 +1,126 @@
+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
diff --git a/contrib/cvs/src/checkout.c b/contrib/cvs/src/checkout.c
index 8209601..e36e729 100644
--- a/contrib/cvs/src/checkout.c
+++ b/contrib/cvs/src/checkout.c
@@ -221,8 +221,11 @@ checkout (argc, argv)
if (shorten == -1)
shorten = 0;
- if ((!(cat + status) && argc == 0) || ((cat + status) && argc != 0))
- usage (valid_usage);
+ if ((cat || status) && argc != 0)
+ error (1, 0, "-c and -s must not get any arguments");
+
+ if (!(cat || status) && argc == 0)
+ error (1, 0, "must specify at least one module or directory");
if (where && pipeout)
error (1, 0, "-d and -p are mutually exclusive");
@@ -230,20 +233,10 @@ checkout (argc, argv)
if (strcmp (command_name, "export") == 0)
{
if (!tag && !date)
- {
- error (0, 0, "must specify a tag or date");
- usage (valid_usage);
- }
+ error (1, 0, "must specify a tag or date");
+
if (tag && isdigit (tag[0]))
error (1, 0, "tag `%s' must be a symbolic tag", tag);
-/*
- * mhy 950615: -kv doesn't work for binaries with RCS keywords.
- * Instead use the default provided in the RCS file (-ko for binaries).
- */
-#if 0
- if (!options)
- options = RCS_check_kflag ("v");/* -kv is default */
-#endif
}
if (!safe_location()) {
@@ -279,10 +272,14 @@ checkout (argc, argv)
client_expand_modules (argc, argv, local);
}
- if (!run_module_prog) send_arg ("-n");
- if (local) send_arg ("-l");
- if (pipeout) send_arg ("-p");
- if (!force_tag_match) send_arg ("-f");
+ if (!run_module_prog)
+ send_arg ("-n");
+ if (local)
+ send_arg ("-l");
+ if (pipeout)
+ send_arg ("-p");
+ if (!force_tag_match)
+ send_arg ("-f");
if (aflag)
send_arg("-A");
if (!shorten)
@@ -293,16 +290,10 @@ checkout (argc, argv)
if (cat)
send_arg("-c");
if (where != NULL)
- {
option_with_arg ("-d", where);
- }
if (status)
send_arg("-s");
- /* Why not send -k for export? This would appear to make
- remote export differ from local export. FIXME. */
- if (strcmp (command_name, "export") != 0
- && options != NULL
- && options[0] != '\0')
+ if (options != NULL && options[0] != '\0')
send_arg (options);
option_with_arg ("-r", tag);
if (date)
@@ -335,6 +326,8 @@ checkout (argc, argv)
if (cat || status)
{
cat_module (status);
+ if (options)
+ free (options);
return (0);
}
db = open_module ();
@@ -432,6 +425,8 @@ checkout (argc, argv)
where, shorten, local, run_module_prog,
(char *) NULL);
close_module (db);
+ if (options)
+ free (options);
return (err);
}
diff --git a/contrib/cvs/src/client.c b/contrib/cvs/src/client.c
index 49f7ac8..a1ed876 100644
--- a/contrib/cvs/src/client.c
+++ b/contrib/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"
@@ -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
@@ -1787,7 +1818,7 @@ update_entries (data_arg, ent_list, short_pathname, filename)
the file out, so that we don't have to read it
back in again. */
MD5Init (&context);
- MD5Update (&context, patchedbuf, patchedlen);
+ MD5Update (&context, (unsigned char *) patchedbuf, patchedlen);
MD5Final (checksum, &context);
if (memcmp (checksum, stored_checksum, 16) != 0)
{
@@ -1899,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.
@@ -2869,6 +2913,7 @@ struct response responses[] =
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),
@@ -3564,7 +3609,12 @@ start_server ()
#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:
@@ -3873,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,
@@ -4039,6 +4091,8 @@ start_rsh_server (tofdp, fromfdp)
#endif /* START_RSH_WITH_POPEN_RW */
+#endif /* NO_EXT_METHOD */
+
/* Send an argument STRING. */
diff --git a/contrib/cvs/src/find_names.c b/contrib/cvs/src/find_names.c
index a7a91bb..5d2a79e 100644
--- a/contrib/cvs/src/find_names.c
+++ b/contrib/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/contrib/cvs/src/ignore.c b/contrib/cvs/src/ignore.c
index 05e2f1f..908b5de 100644
--- a/contrib/cvs/src/ignore.c
+++ b/contrib/cvs/src/ignore.c
@@ -269,7 +269,9 @@ ign_name (name)
{
/* We do a case-insensitive match by calling fnmatch on copies of
the pattern and the name which have been converted to
- lowercase. */
+ lowercase. FIXME: would be much cleaner to just unify this
+ with the other case-insensitive fnmatch stuff (FOLD_FN_CHAR
+ in lib/fnmatch.c; os2_fnmatch in emx/system.c). */
char *name_lower;
char *pat_lower;
char *p;
@@ -282,7 +284,7 @@ ign_name (name)
pat_lower = xstrdup (*cpp++);
for (p = pat_lower; *p != '\0'; ++p)
*p = tolower (*p);
- if (fnmatch (pat_lower, name_lower, 0) == 0)
+ if (CVS_FNMATCH (pat_lower, name_lower, 0) == 0)
goto matched;
free (pat_lower);
}
@@ -296,7 +298,7 @@ ign_name (name)
else
{
while (*cpp)
- if (fnmatch (*cpp++, name, 0) == 0)
+ if (CVS_FNMATCH (*cpp++, name, 0) == 0)
return 1;
return 0;
}
diff --git a/contrib/cvs/src/patch.c b/contrib/cvs/src/patch.c
index 1cf8397..194999b 100644
--- a/contrib/cvs/src/patch.c
+++ b/contrib/cvs/src/patch.c
@@ -514,7 +514,9 @@ patch_fileproc (callerdat, finfo)
memset ((char *) &t, 0, sizeof (t));
if ((t.actime = t.modtime = RCS_getrevtime (rcsfile, vers_tag,
(char *) 0, 0)) != -1)
- (void) utime (tmpfile1, &t);
+ /* I believe this timestamp only affects the dates in our diffs,
+ and therefore should be on the server, not the client. */
+ (void) utime (tmpfile1, &t);
}
else if (toptwo_diffs)
{
@@ -536,7 +538,9 @@ patch_fileproc (callerdat, finfo)
}
if ((t.actime = t.modtime = RCS_getrevtime (rcsfile, vers_head,
(char *) 0, 0)) != -1)
- (void) utime (tmpfile2, &t);
+ /* I believe this timestamp only affects the dates in our diffs,
+ and therefore should be on the server, not the client. */
+ (void) utime (tmpfile2, &t);
}
run_setup ("%s -%c", DIFF, unidiff ? 'u' : 'c');
run_arg (tmpfile1);
diff --git a/contrib/cvs/src/rcscmds.c b/contrib/cvs/src/rcscmds.c
index 1f93fcf..1f356cf 100644
--- a/contrib/cvs/src/rcscmds.c
+++ b/contrib/cvs/src/rcscmds.c
@@ -199,7 +199,7 @@ RCS_checkin (rcsfile, workfile, message, rev, flags)
if (!existence_error (errno))
error (0, errno, "warning: cannot stat %s", rcsfile);
}
- run_setup ("%s%s -x,v/ -f %s%s", Rcsbin, RCS_CI,
+ run_setup ("%s%s -x,v/ -w%s -f %s%s", Rcsbin, RCS_CI, getcaller (),
rev ? "-r" : "", rev ? rev : "");
if (flags & RCS_FLAGS_DEAD)
run_arg ("-sdead");
diff --git a/contrib/cvs/src/root.c b/contrib/cvs/src/root.c
index 2691032..bf5c89e 100644
--- a/contrib/cvs/src/root.c
+++ b/contrib/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/contrib/cvs/src/run.c b/contrib/cvs/src/run.c
index 74e418d..5b59bca 100644
--- a/contrib/cvs/src/run.c
+++ b/contrib/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/contrib/cvs/src/sanity.sh b/contrib/cvs/src/sanity.sh
index 38e32b4..a815fc0 100755
--- a/contrib/cvs/src/sanity.sh
+++ b/contrib/cvs/src/sanity.sh
@@ -481,9 +481,9 @@ if test x"$*" = x; then
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 info"
- tests="${tests} serverpatch log log2 crerepos rcs big modes"
- tests="${tests} sticky keyword"
+ 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
@@ -560,7 +560,7 @@ for what in $tests; do
dotest basica-0b "${testcvs} add first-dir" \
"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
@@ -716,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: ${TESTDIR}/cvsroot/./topfile,v
+"RCS file: ${TESTDIR}/cvsroot/\./topfile,v
done
Checking in topfile;
-${TESTDIR}/cvsroot/./topfile,v <-- topfile
+${TESTDIR}/cvsroot/\./topfile,v <-- topfile
initial revision: 1\.1
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 ${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" ''
@@ -819,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
@@ -836,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...
@@ -873,7 +873,7 @@ ${TESTDIR}/cvsroot/second-dir/aa,v <-- aa
initial revision: 1\.1
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,
@@ -914,10 +914,16 @@ done"
cd ..
rmdir 1
- rm -rf test2
+ 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
;;
@@ -1292,7 +1298,7 @@ done"
exit 0
fi
- rm -rf 1
+ rm -r 1
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -1384,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
@@ -1624,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
@@ -1645,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
@@ -1704,9 +1709,9 @@ 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 -))
@@ -1755,7 +1760,7 @@ 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.
@@ -1879,7 +1884,7 @@ File: foo Status: Up-to-date
TRDIFF (branch: 1\.1\.1)"
cd ..
- rm -rf trdiff
+ rm -r trdiff
dotest rdiff-8 \
"${testcvs} rdiff -r T1 -r local-v0 trdiff" \
@@ -1913,7 +1918,7 @@ diff -c /dev/null trdiff/new:1\.1
# fi
cd ..
- rm -rf testimport
+ rm -r testimport
rm -rf ${CVSROOT_DIRNAME}/trdiff
;;
@@ -2225,7 +2230,7 @@ done"
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.
@@ -3073,8 +3078,10 @@ 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)
@@ -3360,7 +3367,7 @@ 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/file2
@@ -3384,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
@@ -3415,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.
@@ -3468,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)
@@ -3499,7 +3509,7 @@ done"
# 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" \
@@ -3526,7 +3536,7 @@ done"
# 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"
@@ -3555,7 +3565,8 @@ File: a Status: Needs \(Patch\|Checkout\)
fi
cd ../..
- rm -rf 1 2 ; rm -rf ${CVSROOT_DIRNAME}/first-dir
+ rm -r 1 2
+ rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
conflicts)
@@ -3795,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)
@@ -3915,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)
@@ -4089,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.
@@ -4141,7 +4152,7 @@ U nameddir/b'
fi
cd ..
- rm -rf 1
+ rm -r 1
mkdir 2
cd 2
@@ -4155,7 +4166,7 @@ U nameddir/b'
"CVS
first-dir"
cd ..
- rm -rf 2
+ rm -r 2
# Test checking out everything.
mkdir 1
@@ -4165,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
@@ -4198,13 +4209,13 @@ initial revision: 1\.1
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
;;
@@ -4269,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
;;
@@ -4322,7 +4333,7 @@ ${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
@@ -4481,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
@@ -4511,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)
@@ -4583,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)
@@ -4781,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
@@ -4806,7 +4821,9 @@ U first-dir/abc'
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)
@@ -4857,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)
@@ -4912,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)
@@ -4976,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
@@ -5069,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
;;
@@ -5130,7 +5151,7 @@ File: binfile Status: Up-to-date
Sticky Date: (none)
Sticky Options: -kb"
cd ../..
- rm -rf 3
+ rm -r 3
cd 2/first-dir
cp ../../1/binfile2.dat binfile
@@ -5180,7 +5201,7 @@ done"
fi
cd ../..
- rm -rf 1
+ rm -r 1
mkdir 3
cd 3
@@ -5197,7 +5218,7 @@ File: binfile Status: Up-to-date
Sticky Date: (none)
Sticky Options: -kb"
cd ../..
- rm -rf 3
+ rm -r 3
cd 2/first-dir
echo 'this file is $''RCSfile$' >binfile
@@ -5348,7 +5369,7 @@ done"
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" \
@@ -5369,7 +5390,75 @@ File: foo\.exe Status: Up-to-date
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: -kb"
- rm -rf first-dir ${CVSROOT_DIRNAME}/first-dir
+ 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)
@@ -5571,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)
@@ -5797,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)
@@ -5840,7 +5931,8 @@ date: [0-9/]* [0-9:]*; author: ${username}; state: Exp;
============================================================================="
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
@@ -5886,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" ''
@@ -5905,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
@@ -5919,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
@@ -6108,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)
@@ -6146,7 +6240,7 @@ ${TESTDIR}/cvsroot/first-dir/file1,v <-- file1
initial revision: 1\.1
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
@@ -6154,7 +6248,7 @@ done"
exit 0
fi
- rm -rf first-dir
+ rm -r first-dir
rm -rf ${CVSROOT_DIRNAME}/first-dir
;;
@@ -6276,11 +6370,152 @@ done"
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
@@ -6323,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)
@@ -6494,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
@@ -6560,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
;;
*)
diff --git a/contrib/cvs/src/server.h b/contrib/cvs/src/server.h
index cbda7a5..743f090 100644
--- a/contrib/cvs/src/server.h
+++ b/contrib/cvs/src/server.h
@@ -29,6 +29,11 @@ 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.
@@ -106,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/contrib/cvs/src/subr.c b/contrib/cvs/src/subr.c
index a098123..d29942b 100644
--- a/contrib/cvs/src/subr.c
+++ b/contrib/cvs/src/subr.c
@@ -234,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 ()
{
@@ -247,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/contrib/cvs/src/update.c b/contrib/cvs/src/update.c
index 1956c6f..8196c1f 100644
--- a/contrib/cvs/src/update.c
+++ b/contrib/cvs/src/update.c
@@ -559,10 +559,31 @@ update_fileproc (callerdat, finfo)
else
{
if (wrap_merge_is_copy (finfo->file))
+#if 0
+ /* Look, we can't clobber the user's file. We
+ know it is modified and we're going to
+ overwrite their mod? Puh-leeze. The
+ correct behavior is probably something like
+ what merge_file does for -kb, which is to
+ give the users both files and tell them
+ what the two filenames are. Of course, -m
+ in wrappers needs to be documented *much*
+ better. Anyway, until then, make this a
+ fatal error. */
+
/* Should we be warning the user that we are
* overwriting the user's copy of the file? */
retval =
checkout_file (finfo, vers, 0);
+#else
+ {
+ error (0, 0, "A -m 'COPY' wrapper is specified");
+ error (0, 0, "but file %s needs merge",
+ finfo->fullname);
+ error (1, 0, "\
+You probably want to avoid -m 'COPY' wrappers");
+#endif
+ }
else
retval = merge_file (finfo, vers);
}
diff --git a/contrib/cvs/src/vers_ts.c b/contrib/cvs/src/vers_ts.c
index 03a0036..613e52e 100644
--- a/contrib/cvs/src/vers_ts.c
+++ b/contrib/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/contrib/cvs/src/version.c b/contrib/cvs/src/version.c
index 606c43d..c442179 100644
--- a/contrib/cvs/src/version.c
+++ b/contrib/cvs/src/version.c
@@ -12,7 +12,7 @@
#include "cvs.h"
-char *version_string = "\nConcurrent Versions System (CVS) 1.9.9";
+char *version_string = "\nConcurrent Versions System (CVS) 1.9.10";
#ifdef CLIENT_SUPPORT
#ifdef SERVER_SUPPORT
diff --git a/contrib/cvs/src/wrapper.c b/contrib/cvs/src/wrapper.c
index 13e7e43..825cdcd 100644
--- a/contrib/cvs/src/wrapper.c
+++ b/contrib/cvs/src/wrapper.c
@@ -387,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;
@@ -418,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;
}
OpenPOWER on IntegriCloud