diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/ChangeLog ./ChangeLog
--- ../cvs-1.11.1p1.orig/ChangeLog	Thu Apr 26 20:12:56 2001
+++ ./ChangeLog	Sat Mar 23 17:14:33 2002
@@ -1,3 +1,7 @@
+2002-03-23  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	* configure.in: Update version to 1.11.1p1.jcn2.
+
 2001-04-26  Derek Price  <dprice@collab.net>
 
 	* cvs.spec.in: Don't include %{_infodir}/dir.
diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/configure.in ./configure.in
--- ../cvs-1.11.1p1.orig/configure.in	Fri Apr 27 22:00:47 2001
+++ ./configure.in	Sat Mar 23 17:14:41 2002
@@ -1,6 +1,6 @@
 dnl configure.in for cvs
 AC_INIT(src/cvs.h)
-AM_INIT_AUTOMAKE(cvs, 1.11.1p1)
+AM_INIT_AUTOMAKE(cvs, 1.11.1p1.jcn2)
 AC_PREREQ(2.13)
 AC_PREFIX_PROGRAM(cvs)
 AM_CONFIG_HEADER(config.h src/options.h)
diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/doc/CVSvn.texi ./doc/CVSvn.texi
--- ../cvs-1.11.1p1.orig/doc/CVSvn.texi	Fri Apr 27 22:02:34 2001
+++ ./doc/CVSvn.texi	Sat Mar 23 14:52:21 2002
@@ -1 +1 @@
-@set CVSVN 1.11.1p1
+@set CVSVN 1.11.1p1.jcn1
diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/doc/ChangeLog ./doc/ChangeLog
--- ../cvs-1.11.1p1.orig/doc/ChangeLog	Thu Apr 26 00:31:47 2001
+++ ./doc/ChangeLog	Sat Mar 23 17:11:19 2002
@@ -1,3 +1,9 @@
+2002-03-23  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	* cvs.texinfo (commit options): Add info about -d option.
+	(import options): Ditto.
+	(Invoking CVS): Ditto (2x).
+
 2001-04-25  Derek Price  <dprice@collab.net>
 
 	* Makefile.in: Regenerated using AM 1.4e as of today at 18:10 -0400.
diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/doc/cvs.texinfo ./doc/cvs.texinfo
--- ../cvs-1.11.1p1.orig/doc/cvs.texinfo	Tue Apr 24 20:14:52 2001
+++ ./doc/cvs.texinfo	Sat Mar 23 17:20:19 2002
@@ -8857,6 +8857,10 @@ cannot commit to a specific revision on 
 @code{commit} also supports these options:
 
 @table @code
+@item -d
+Use the file's modification time as the time of
+commit.
+
 @item -F @var{file}
 Read the log message from @var{file}, instead
 of invoking an editor.
@@ -9514,6 +9518,12 @@ This standard option is supported by @co
 (@pxref{Common options}, for a complete description):
 
 @table @code
+@item -d
+Use the file's modification time as the time of
+import.
+@end table
+
+@table @code
 @item -m @var{message}
 Use @var{message} as log information, instead of
 invoking an editor.
@@ -10580,6 +10590,10 @@ Like -c, but include module status.  See
 
 @item commit [@var{options}] [@var{files}@dots{}]
 Check changes into the repository.  See @ref{commit}.
+
+@item -d
+Use the file's modification time as the time of
+commit.  See @ref{commit options}.
 
 @table @code
 @item -F @var{file}
diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/man/cvs.1 ./man/cvs.1
--- ../cvs-1.11.1p1.orig/man/cvs.1	Thu Apr 19 21:45:31 2001
+++ ./man/cvs.1	Sat Mar 23 17:02:21 2002
@@ -909,7 +909,7 @@ the
 .B \-s
 option within the modules file. 
 .TP
-\fBcommit\fP [\fB\-lnR\fP] [\fB\-m\fP '\fIlog_message\fP' | \fB\-f\fP \fIfile\fP] [\fB\-r\fP \fIrevision\fP] [\fIfiles.\|.\|.\fP]
+\fBcommit\fP [\fB\-dlnR\fP] [\fB\-m\fP '\fIlog_message\fP' | \fB\-f\fP \fIfile\fP] [\fB\-r\fP \fIrevision\fP] [\fIfiles.\|.\|.\fP]
 .I Requires:
 working directory, repository.
 .br
@@ -1041,6 +1041,11 @@ example% cvs commit
 Others would simply do
 .` "cvs checkout -rEXPR1 whatever_module"
 to work with you on the experimental change.
+.SP
+Use
+.` "\-d"
+to specify that each file's time of last modification should be used
+for the checkin date and time.
 .TP
 \fBdiff\fP [\fB\-kl\fP] [\fIrcsdiff_options\fP] [[\fB\-r\fP \fIrev1\fP | \fB\-D\fP \fIdate1\fP] [\fB\-r\fP \fIrev2\fP | \fB\-D\fP \fIdate2\fP]] [\fIfiles.\|.\|.\fP]
 .I Requires:
diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/src/ChangeLog ./src/ChangeLog
--- ../cvs-1.11.1p1.orig/src/ChangeLog	Fri Apr 27 21:57:23 2001
+++ ./src/ChangeLog	Sat Mar 23 16:54:21 2002
@@ -1,3 +1,19 @@
+2002-03-23  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	* version.c: Regenerate.
+	
+	* commit.c (remove_file): Preserve file access and mod time.
+
+	* commit.c (remove_file): Add use_file_modtime to flags.
+	(checkaddfile): Ditto.
+	* checkin.c: Ditto.
+	
+	* cvs.h: Global int (previously static).
+	* import.c (use_file_modtime): Ditto.
+
+	* commit.c (commit_usage): Add -d to usage message.
+	(commit): Parse -d option.
+
 2001-04-27  Larry Jones  <larry.jones@sdrc.com>
 
 	* main.c (lookup_command_attribute): Lookup specified command, not
diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/src/checkin.c ./src/checkin.c
--- ../cvs-1.11.1p1.orig/src/checkin.c	Thu Apr 19 21:29:06 2001
+++ ./src/checkin.c	Sat Mar 23 14:49:22 2002
@@ -56,7 +56,9 @@ Checkin (type, finfo, rcs, rev, tag, opt
     if (finfo->rcs == NULL)
 	finfo->rcs = RCS_parse (finfo->file, finfo->repository);
 
-    switch (RCS_checkin (finfo->rcs, NULL, message, rev, RCS_FLAGS_KEEPFILE))
+    switch (RCS_checkin (finfo->rcs, NULL, message, rev,
+			 (RCS_FLAGS_KEEPFILE
+			  | (use_file_modtime ? RCS_FLAGS_MODTIME : 0))))
     {
 	case 0:			/* everything normal */
 
diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/src/commit.c ./src/commit.c
--- ../cvs-1.11.1p1.orig/src/commit.c	Tue Apr 24 20:14:53 2001
+++ ./src/commit.c	Sat Mar 23 16:40:14 2002
@@ -84,7 +84,8 @@ static time_t last_register_time;
 
 static const char *const commit_usage[] =
 {
-    "Usage: %s %s [-nRlf] [-m msg | -F logfile] [-r rev] files...\n",
+    "Usage: %s %s [-dnRlf] [-m msg | -F logfile] [-r rev] files...\n",
+    "    -d          Use the file's modification time as the time of commit.\n",
     "    -n          Do not run the module program (if any).\n",
     "    -R          Process directories recursively.\n",
     "    -l          Local directory only (not recursive).\n",
@@ -358,10 +359,13 @@ commit (argc, argv)
 #endif /* CVS_BADROOT */
 
     optind = 0;
-    while ((c = getopt (argc, argv, "+nlRm:fF:r:")) != -1)
+    while ((c = getopt (argc, argv, "+dnlRm:fF:r:")) != -1)
     {
 	switch (c)
 	{
+	    case 'd':
+		use_file_modtime = 1;
+		break;
 	    case 'n':
 		run_module_prog = 0;
 		break;
@@ -1626,6 +1630,8 @@ remove_file (finfo, tag, message)
     char *rev;
     char *prev_rev;
     char *old_path;
+    struct utimbuf t;
+    struct stat sb;
 
     corev = NULL;
     rev = NULL;
@@ -1708,6 +1714,14 @@ remove_file (finfo, tag, message)
 	RCS_rewrite (finfo->rcs, NULL, NULL);
     }
 
+    if (use_file_modtime)
+    {
+	memset (&t, 0, sizeof (t));
+	if (stat (finfo->fullname, &sb) < 0)
+	  error (0, errno, "warning: cannot stat %s", finfo->fullname);
+	t.modtime = t.actime = sb.st_mtime;
+    }
+
     /* check something out.  Generally this is the head.  If we have a
        particular rev, then name it.  */
     retcode = RCS_checkout (finfo->rcs, finfo->file, rev ? corev : NULL,
@@ -1719,6 +1733,12 @@ remove_file (finfo, tag, message)
 	       "failed to check out `%s'", finfo->fullname);
 	return (1);
     }
+    
+    if (use_file_modtime && t.modtime)
+    {
+	if (utime (finfo->fullname, &t) < 0)
+	  error (0, errno, "cannot set time on %s", finfo->fullname);
+    }
 
     /* Except when we are creating a branch, lock the revision so that
        we can check in the new revision.  */
@@ -1732,7 +1752,9 @@ remove_file (finfo, tag, message)
 	free (corev);
 
     retcode = RCS_checkin (finfo->rcs, finfo->file, message, rev,
-			   RCS_FLAGS_DEAD | RCS_FLAGS_QUIET);
+			   (RCS_FLAGS_DEAD | RCS_FLAGS_QUIET
+			    | (use_file_modtime ? RCS_FLAGS_MODTIME : 0)));
+
     if (retcode	!= 0)
     {
 	if (!quiet)
@@ -2074,7 +2096,10 @@ checkaddfile (file, repository, tag, opt
 	    (void) sprintf (tmp, "file %s was initially added on branch %s.",
 			    file, tag);
 	    retcode = RCS_checkin (rcsfile, NULL, tmp, NULL,
-				   RCS_FLAGS_DEAD | RCS_FLAGS_QUIET);
+				   (RCS_FLAGS_DEAD | RCS_FLAGS_QUIET
+				    | (use_file_modtime
+				       ? RCS_FLAGS_MODTIME : 0)));
+
 	    free (tmp);
 	    if (retcode != 0)
 	    {
diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/src/cvs.h ./src/cvs.h
--- ../cvs-1.11.1p1.orig/src/cvs.h	Tue Apr 24 20:14:53 2001
+++ ./src/cvs.h	Sat Mar 23 16:42:56 2002
@@ -363,6 +363,7 @@ extern int really_quiet, quiet;
 extern int use_editor;
 extern int cvswrite;
 extern mode_t cvsumask;
+extern int use_file_modtime;
 
 /* Access method specified in CVSroot. */
 typedef enum {
diff -purN --exclude=configure --exclude=Makefile --exclude=Makefile.in --exclude=version.c --exclude=aclocal.m4 --exclude=*~ ../cvs-1.11.1p1.orig/src/import.c ./src/import.c
--- ../cvs-1.11.1p1.orig/src/import.c	Thu Apr 19 21:45:32 2001
+++ ./src/import.c	Sat Mar 23 14:09:01 2002
@@ -40,7 +40,7 @@ static char *vbranch;
 static FILE *logfp;
 static char *repository;
 static int conflicts;
-static int use_file_modtime;
+int use_file_modtime;
 static char *keyword_opt = NULL;
 
 static const char *const import_usage[] =

