Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does SVN store commit time?

I am working on a project that involves extracting details from a SVN server using SVNKit. My project is already complete and has been working we for a while now. During the testing, I noticed something rather very strange. the Commit Times my extract data seems is alway different from whats there in SVN Logs.

I couldnt find any code in my project that could be inducing this difference but now I am looking as to how SVN server stores the Commit time in itself. As we have developer working from different part of the world thus resulting in different timezones, I was thinking that SVN might be storing time after converting them to GMT or timezone of the system on which SVN server is running. But that does not seem to be happening. Instead the times are stored as per the time when the commit was done and in that local timezone itself.

I have been unable to find any substantial document on internet to support my theory so far.

Can anybody in brief explain as how SVN store the Commit Time for each change? Documentaion links referring to this will be of great help.

like image 405
Salman A. Kagzi Avatar asked Feb 03 '23 23:02

Salman A. Kagzi


2 Answers

Looks like Subversion sets commit time based on server time using UTC timezone, this email from Subversion developer Ben Collins-Sussman confirms it. Also, git-svn manpage and, Perl SVN::Web module documentation agrees with this.

like image 119
ismail Avatar answered Feb 06 '23 15:02

ismail


From the section of the SVN book documenting the unversioned properties:

svn:date

Contains the UTC time the revision was created, in ISO 8601 format. The value comes from the server machine's clock, not the client's.

ISO 8601 still allows for a large number of different formats, and time zone indicators are not mandatory. However, if you take a look at the value of svn:date like this:

svn propget --revprop -r HEAD http://example.com/svn

Then the result will be something like this:

2010-12-23T00:45:41.552600Z

That Z at the end is the indicator for the UTC timezone, and Subversion always uses that timezone to record the commit datetime.

like image 27
Wim Coenen Avatar answered Feb 06 '23 16:02

Wim Coenen