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

API call to retrieve server timestamp / timestamps as offsets?

From: Nik Clayton <nik_at_ngo.org.uk>
Date: 2006-11-01 10:19:50 CET


I just ran in to an issue with SVN::Web. It's not directly Subversion's
problem, but a Subversion API enhancement would fix it. Also, it's not
a problem that will only affect SVN::Web.

When browsing directories, SVN::Web, like many other front ends, shows
file timestamps as offsets from now. E.g., "45 seconds ago", "3 minutes
ago", "12 hours ago", and so on.

For this to work, the host hosting the repo and the host running
SVN::Web have to have a synchronised clock. Previously that wasn't a
problem, but as I port SVN::Web to use SVN::Client it now works against
remote repositories, and there's no guarantee that the clocks are synced.

If they're not, and the skew is sufficiently large, and the host running
SVN::Web has a clock that lags behind the one hosting the repo, this can
result in the front end thinking that files have been modified at some
point in the future.

This is obviously nonsensical.

The real fix, of course, is to make sure that the hosts have
synchronised clocks.

Since that's not necessarily something that can be guaranteed, there is
something that Subversion could do to fix this for all clients.

Either, an API call that returned the server's idea of the current time.
  All timestamp manipulation could then be done with this value, to get
accurate offsets.

Or, an API call (or flag) that returned timestamps as negative offsets
from the current time, instead of timestamps in their own right.



To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 1 10:20:08 2006

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