Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the timestamp of an SVN revision

We had a power failure that exhausted our UPS and subsequently shutdown our SVN machine. When it booted back up it, the system time was incorrect.

Unfortunately, this was not caught until some people had already committed a changes. So now we have a few revisions that predate the first revision by several years.

Is there a way to correct this date, so things are in order?

like image 350
Greg Dean Avatar asked Mar 11 '09 04:03

Greg Dean


People also ask

How do I get older versions of svn?

On the file, simply right-click => Team => Switch to another branch/tag/revision.

How do I view svn revision history?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.

How does svn revision number work?

Unlike most version control systems, Subversion's revision numbers apply to the entire repository tree, not individual files. Each revision number selects an entire tree, a particular state of the repository after some committed change.


2 Answers

The date/time is a property of the revision. Figure out the revision number (or use HEAD), and modify it with propset or propedit and --revprop.

svn propset svn:date 'YYYY-MM-DDTHH:MM:SS.MMMMMMZ' --revprop -r HEAD /path/to/wc/file

You'll have to play around with it to get the right combination of settings. You can also look at the Red Book, under Advanced Properties. (I linked to 1.4, adjust to suit your version).

like image 91
Andrew Barnett Avatar answered Oct 23 '22 11:10

Andrew Barnett


Change the svn:date property of the revision:

svn propset -rXXX --revprop svn:date "2008-03-10T03:00:00.000000Z" repository

Or using TortoiseSVN, Show log -> Right click on the revision -> Show revision properties:

You will need for that the pre-revprop-change hook, a empty shell script or batch file will do the work.

like image 27
Christian C. Salvadó Avatar answered Oct 23 '22 10:10

Christian C. Salvadó