Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN commit with old date/time

Is there some way how to commit into the SVN repository with old time / date or how to edit the time / date post commit?

I have some archived sources which are very old, way before I have started using SVN, and I would now like to put them into the SVN and if possible to preserve their original date, so that SVN history matches the real date where files were edited.

Manipulating SVN server time is an obvious option, but it cannot be used here, as the SVN server is out of my control.

like image 440
Suma Avatar asked Jan 20 '10 12:01

Suma


1 Answers

The date and time is in the "special" revision property, svn:date. You can modify it as so:

svn propedit svn:date --revprop -r 12345

or:

svn propset svn:date --revprop -r 12345 2009-02-12T00:44:04.921324Z

The revision (e.g. 12345 above) can also be HEAD meaning the latest revision.

The date is specified in ISO 8601 format.

You will need the repository to have the appropriate pre-revprop-change hook set up (in the hook directory in the repository) to allow svn:date to be modified. The templates that are provided with SVN repositories should be helpful.

like image 142
Craig McQueen Avatar answered Oct 18 '22 21:10

Craig McQueen