1 --- cvs-1.12.13.orig/debian/patches/67_date_format_option
2 +++ cvs-1.12.13/debian/patches/67_date_format_option
5 +# Add an extra option to set the DateFormat used in log output.
7 +# Patch by Steve McIntyre <steve@einval.com>
8 +diff -ruN cvs-1.12.13-old/doc/cvs.texinfo cvs-1.12.13/doc/cvs.texinfo
9 +--- cvs-1.12.13-old/doc/cvs.texinfo 2005-09-23 10:02:53.000000000 +0800
10 ++++ cvs-1.12.13/doc/cvs.texinfo 2006-02-26 23:03:05.000000000 +0800
11 +@@ -14840,9 +14840,17 @@
12 + group to using @code{cvs admin} to change the default keyword
13 + substitution mode, lock revisions, unlock revisions, and
14 + replace the log message, use @samp{UserAdminOptions=klum}.
18 ++@cindex DateFormat, in CVSROOT/config
19 ++@item DateFormat=@var{value}
20 ++Control the output format of dates from cvs. cvs version 1.12.x
21 ++changed the default format to use ``iso8601'' dates, which are
22 ++better for many reasons. However, old scripts/programs written to
23 ++parse the output of various cvs commands (especially cvs log) may
24 ++not cope with the change in date format (e.g. gcvs). The default
25 ++value of DateFormat will be ``iso8601'', but if you need temporary
26 ++backwards-compatibility set DateFormat=old.
29 + @c ---------------------------------------------------------------------
30 + @node Environment variables
31 +diff -ruN cvs-1.12.13-old/src/log.c cvs-1.12.13/src/log.c
32 +--- cvs-1.12.13-old/src/log.c 2005-03-22 21:19:57.000000000 +0800
33 ++++ cvs-1.12.13/src/log.c 2006-02-26 23:03:05.000000000 +0800
34 +@@ -1607,8 +1607,12 @@
38 +- sprintf (buf, "%04d-%02d-%02d %02d:%02d:%02d +0000", year, mon, mday,
40 ++ if ('-' == datesep)
41 ++ sprintf (buf, "%04d%c%02d%c%02d %02d:%02d:%02d +0000", year, datesep,
42 ++ mon, datesep, mday, hour, min, sec);
44 ++ sprintf (buf, "%04d%c%02d%c%02d %02d:%02d:%02d", year, datesep,
45 ++ mon, datesep, mday, hour, min, sec);
46 + cvs_output_tagged ("date", buf);
48 + cvs_output_tagged ("text", "; author: ");
49 +diff -ruN cvs-1.12.13-old/src/main.c cvs-1.12.13/src/main.c
50 +--- cvs-1.12.13-old/src/main.c 2006-02-26 23:03:04.000000000 +0800
51 ++++ cvs-1.12.13/src/main.c 2006-02-26 23:10:12.000000000 +0800
52 +@@ -1371,9 +1371,19 @@
53 + static char buf[sizeof ("yyyy-mm-dd HH:MM:SS -HHMM")];
54 + /* Convert to a time in the local time zone. */
55 + struct tm ltm = *(localtime (&unixtime));
57 +- if (!my_strftime (buf, sizeof (buf), "%Y-%m-%d %H:%M:%S %z", <m, 0, 0))
59 ++ char *format = NULL;
64 ++ format = "%Y/%m/%d %H:%M:%S";
67 ++ format = "%Y-%m-%d %H:%M:%S %z";
70 ++ if (my_strftime (buf, sizeof (buf), format, <m, 0, 0) == 0)
73 + return xstrdup (buf);
75 +@@ -1388,9 +1398,19 @@
76 + static char buf[sizeof ("yyyy-mm-dd HH:MM:SS -HHMM")];
77 + /* Convert to a time in the local time zone. */
78 + struct tm ltm = *(gmtime (&unixtime));
80 +- if (!my_strftime (buf, sizeof (buf), "%Y-%m-%d %H:%M:%S %z", <m, 0, 0))
82 ++ char *format = NULL;
87 ++ format = "%Y/%m/%d %H:%M:%S";
90 ++ format = "%Y-%m-%d %H:%M:%S %z";
93 ++ if (my_strftime (buf, sizeof (buf), format, <m, 0, 0) == 0)
96 + return xstrdup (buf);
98 +diff -ruN cvs-1.12.13-old/src/parseinfo.c cvs-1.12.13/src/parseinfo.c
99 +--- cvs-1.12.13-old/src/parseinfo.c 2005-09-06 12:40:37.000000000 +0800
100 ++++ cvs-1.12.13/src/parseinfo.c 2006-02-26 23:03:05.000000000 +0800
101 +@@ -626,6 +626,19 @@
102 + retval->logHistory = xstrdup (p);
105 ++ /* grab FreeBSD date format idea */
106 ++ else if (strcmp (line, "DateFormat") == 0)
108 ++ if (strcmp (p, "old") == 0)
112 ++ else if (strcmp (p, "iso8601") == 0)
117 ++ /* end grabbing */
118 + else if (strcmp (line, "RereadLogAfterVerify") == 0)
120 + if (!strcasecmp (p, "never"))
121 +diff -ruN cvs-1.12.13-old/src/rcs.c cvs-1.12.13/src/rcs.c
122 +--- cvs-1.12.13-old/src/rcs.c 2006-02-26 23:03:04.000000000 +0800
123 ++++ cvs-1.12.13/src/rcs.c 2006-02-26 23:03:05.000000000 +0800
130 + /* The RCS -k options, and a set of enums that must match the array.
131 + These come first so that we can use enum kflag in function
133 +@@ -3537,8 +3539,8 @@
137 +- sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d", year, mon, mday,
139 ++ sprintf (buf, "%04d%c%02d%c%02d %02d:%02d:%02d", year, datesep, mon,
140 ++ datesep, mday, hour, min, sec);
141 + return xstrdup (buf);
144 +diff -ruN cvs-1.12.13-old/src/rcs.h cvs-1.12.13/src/rcs.h
145 +--- cvs-1.12.13-old/src/rcs.h 2005-03-18 06:36:24.000000000 +0800
146 ++++ cvs-1.12.13/src/rcs.h 2006-02-26 23:03:05.000000000 +0800
148 + void RCS_setlocalid (const char *, unsigned int, void **, const char *arg);
149 + char *make_file_label (const char *, const char *, RCSNode *);
151 ++extern int datesep;
152 + extern bool preserve_perms;
154 + /* From import.c. */