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

Re: CVS update: MODIFIED: libsvn_subr ...

From: Karl Fogel <kfogel_at_collab.net>
Date: 2001-07-04 00:06:20 CEST

Branko Čibej <brane@xbc.nu> writes:
> Some of that discussion (actually the most relevant parts) never made
> it to the APR list. I've got copies of some of all of those
> messages. If people are interested, and David agrees, I can put them
> in the repository somewhere.

Can we solve the problem using the APR time stuff as it exists now?

The goal is that Subversion's two time functions be perfect inverses
of each other:

   /* Convert WHEN to an svn string representation allocated in POOL.
      Use svn_time_from_string() for the reverse conversion. */
   svn_stringbuf_t *svn_time_to_string (apr_time_t when, apr_pool_t *pool);

   /* Convert TIMESTR to an apr_time_t. TIMESTR should be of the form
      returned by svn_wc__time_to_string(). */
   apr_time_t svn_time_from_string (svn_stringbuf_t *timestr);

That is,

   apr_time_t time_a, time_b;
   svn_stringbuf_t *time_str;
   time_a = apr_time_now ();
   time_str = svn_time_to_string (time_a, pool);
   time_b = svn_time_from_string (time_str);
   if (time_a == time_b)
     printf ("something is right");
   else
     printf ("something is wrong");

Whether `time_str' expresses the time in GMT or localtime is not
important -- either way is fine, really, as long as it *tells* which
zone it is in, so no information is lost.

I guess this means that svn_time_to_string() must decide to
consistently always interpret the incoming apr_time_t in localtime or
in GMT; localtime probably makes most sense, but whichever way, if we
just document it and always use it correctly, we'll be fine.

The way APR is behaving now, I haven't been able to get these
functions to be reliable inverses of each other. Am I just missing
something?

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:32 2006

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

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