summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2004-07-06 08:10:38 +0000
committerdes <des@FreeBSD.org>2004-07-06 08:10:38 +0000
commit0e2eb33ac3f81554af20229e1795960b1004ba04 (patch)
tree6da5511e170eedde3e9ed9174d72ef9ef222b559 /contrib/cvs/src
parentf8b4065a75dec3c8a74e1ec37bf6e90350c01817 (diff)
downloadFreeBSD-src-0e2eb33ac3f81554af20229e1795960b1004ba04.zip
FreeBSD-src-0e2eb33ac3f81554af20229e1795960b1004ba04.tar.gz
Add an "iso8601" option keyword which causes 'cvs log' etc. to print
dates in ISO 8601 format. Approved by: peter MFC after: 2 weeks
Diffstat (limited to 'contrib/cvs/src')
-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 9e10bd9..88e5bb7 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 d00bddd..932dbd2 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 8aee286..f60d02e 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 a2a30f7..d40d178 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. */
OpenPOWER on IntegriCloud