Add an "iso8601" option keyword which causes 'cvs log' etc. to print

dates in ISO 8601 format.

Approved by:	peter
MFC after:	2 weeks
This commit is contained in:
Dag-Erling Smørgrav 2004-07-06 08:10:38 +00:00
parent 42f74b8ddf
commit 8290e396fb
4 changed files with 11 additions and 4 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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. */