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

Question on JavaHL change

From: Mark Phippard <markphip_at_gmail.com>
Date: Wed, 21 May 2008 20:04:46 -0400

I have a question on recent JavaHL change merged to 1.5.x branch.

In the logMessageCallback we now return a Map of revprops instead of
the individual revprops. svn:date is returned as the date value.
This forces us to add code like the following to get the timeMicros:

            // Really hacky date parser, because Java doesn't support
            // microseconds natively.
            try {
                DateFormat formatter = new SimpleDateFormat(
                    "yyyy-MM-dd'T'HH:mm:ss.SSS");
                String datestr = ((String) revprops.get("svn:date"));
                Date date = formatter.parse(datestr.substring(0, 23));
                Calendar cal = Calendar.getInstance();
                cal.setTime(date);
                timeMicros = cal.getTimeInMillis();

                timeMicros = timeMicros * 1000
                                 + Integer.parseInt(datestr.substring(23, 26));

I thought the timeMicros were only added in 1.5 to be a more efficient
way to pass the date along. Or perhaps it was the extra precision.
Either way, the efficiency and precision are both gone now. It seems
like we should either:

a) pass the timeMicros as an explicit parameter to the callback
b) store it in the revprops. Either as the value of svn:date or as a
made up revprop like svn:timemicros.
c) forget it altogether and just pass along the date as is

I am adding Blair to the cc: as I recall he added the original
timeMicros feature for his own needs.

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-05-22 02:05:00 CEST

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