[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH]: Re: Date processing should be more flexible

From: Christopher Ness <chris_at_nesser.org>
Date: 2005-07-05 04:56:20 CEST

On Mon, 2005-07-04 at 11:21 -0500, Ben Collins-Sussman wrote:
> From the svn CHANGES file:

Sorry Ben, I should have grep'd that file first.

Cross posting this since I was gungho to write a new function but after
some reading and inspection decided the functionality was there, just
not enabled.

This is a quick fix for the date and definitely not a complete
refactoring effort.

This patch allows dates to be of the form YYYY-M[M]-D[D] for the
templates that are able to support omitted digits in the month and
day.
I thought of doing YY[YY] but decided it was too ambiguous and would be
another 2 digit number which is indistinguishable from any other.

This patch also forces the day to be greater than 0. Not sure if this
will break any scripts, but a day of 0 didn't make sense to me.

QUESTION: Where should the date formats be documented in the code? I
wanted to update the main svn man page, but Windows users don't get man
pages do they? Obviously the book, but where can users look up the
formats with the program's help commands?

If you were interested to see what formats SVN supports, they are
currently:

ISO-8601 extended, date only "YYYY-MM-DD"
ISO-8601 extended, UTC "YYYY-MM-DDThh:mm[:ss[.u[u[u[u[u[u][Z]"
ISO-8601 extended, with offset "YYYY-MM-DDThh:mm[:ss[.u[u[u[u[u[u]+OO[:oo]"
ISO-8601 basic, date only "YYYYMMDD"
ISO-8601 basic, UTC "YYYYMMDDThhmm[ss[.u[u[u[u[u[u][Z]"
ISO-8601 basic, with offset "YYYYMMDDThhmm[ss[.u[u[u[u[u[u]+OO[oo]"
"svn log" format "YYYY-MM-DD hh:mm[:ss[.u[u[u[u[u[u][ +OO[oo]"
GNU date's iso-8601 "YYYY-MM-DDThh:mm[:ss[.u[u[u[u[u[u]+OO[oo]"

Changelog:

Motivated by the users mailing list thread "Date processing should be
more flexible" @
http://subversion.tigris.org/servlets/ReadMsg?listName=users&msgNo=34575

* subversion/libsvn_subr/date.c:
  - Allowed M or D to be omitted in formats with field separators
  - Check to make sure the day is not = 0

Cheers,
Chris

-- 
PGP Public Key: http://www.nesser.org/pgp-key/
22:29:00 up 2:01, 4 users, load average: 0.12, 0.34, 0.33

Received on Tue Jul 5 04:57:50 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.