aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2004-07-06 08:10:38 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2004-07-06 08:10:38 +0000
commit8290e396fb052c992c6ba0cf6051ad8dcb94dfbd (patch)
tree6da5511e170eedde3e9ed9174d72ef9ef222b559
parent42f74b8ddfa318eecb50f9abdaabb3c17938930d (diff)
downloadsrc-8290e396fb052c992c6ba0cf6051ad8dcb94dfbd.tar.gz
src-8290e396fb052c992c6ba0cf6051ad8dcb94dfbd.zip
Add an "iso8601" option keyword which causes 'cvs log' etc. to print
dates in ISO 8601 format. Approved by: peter MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=131688
-rw-r--r--contrib/cvs/src/log.c6
-rw-r--r--contrib/cvs/src/main.c3
-rw-r--r--contrib/cvs/src/rcs.c5
-rw-r--r--contrib/cvs/src/rcs.h1
4 files changed, 11 insertions, 4 deletions
diff --git a/contrib/cvs/src/log.c b/contrib/cvs/src/log.c
index 9e10bd905bfd..88e5bb7672f7 100644
--- a/contrib/cvs/src/log.c
+++ b/contrib/cvs/src/log.c
@@ -10,6 +10,8 @@
* Prints the RCS "log" (rlog) information for the specified files. With no
* argument, prints the log information for all the files in the directory
* (recursive by default).
+ *
+ * $FreeBSD$
*/
#include "cvs.h"
@@ -1605,8 +1607,8 @@ log_version (log_data, revlist, rcs, ver, trunk)
&sec);
if (year < 1900)
year += 1900;
- sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d", year, mon, mday,
- hour, min, sec);
+ sprintf (buf, "%04d%c%02d%c%02d %02d:%02d:%02d",
+ year, datesep, mon, datesep, mday, hour, min, sec);
cvs_output (buf, 0);
cvs_output ("; author: ", 0);
diff --git a/contrib/cvs/src/main.c b/contrib/cvs/src/main.c
index d00bddd9a7fa..932dbd2af731 100644
--- a/contrib/cvs/src/main.c
+++ b/contrib/cvs/src/main.c
@@ -1237,6 +1237,9 @@ parseopts(root)
if (q)
*q = '\0';
+ if (!strcmp(buf, "iso8601")) {
+ datesep = '-';
+ }
if (!strncmp(buf, "tag=", 4)) {
char *what;
char *rcs_localid;
diff --git a/contrib/cvs/src/rcs.c b/contrib/cvs/src/rcs.c
index 8aee286050ee..f60d02e971ef 100644
--- a/contrib/cvs/src/rcs.c
+++ b/contrib/cvs/src/rcs.c
@@ -26,6 +26,7 @@
# endif
#endif
+int datesep = '/';
int preserve_perms = 0;
/* The RCS -k options, and a set of enums that must match the array.
@@ -3549,8 +3550,8 @@ printable_date (rcs_date)
&sec);
if (year < 1900)
year += 1900;
- sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d", year, mon, mday,
- hour, min, sec);
+ sprintf (buf, "%04d%c%02d%c%02d %02d:%02d:%02d",
+ year, datesep, mon, datesep, mday, hour, min, sec);
return xstrdup (buf);
}
diff --git a/contrib/cvs/src/rcs.h b/contrib/cvs/src/rcs.h
index a2a30f7cf413..d40d1781b755 100644
--- a/contrib/cvs/src/rcs.h
+++ b/contrib/cvs/src/rcs.h
@@ -250,6 +250,7 @@ void RCS_setincexc PROTO ((const char *arg));
void RCS_setlocalid PROTO ((const char *arg));
char *make_file_label PROTO ((const char *, const char *, RCSNode *));
+extern int datesep;
extern int preserve_perms;
/* From import.c. */