12

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Greg Dean
  • 29,221
  • 14
  • 67
  • 78

4 Answers4

15

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).

Andrew Barnett
  • 5,066
  • 1
  • 22
  • 25
10

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.

Community
  • 1
  • 1
Christian C. Salvadó
  • 807,428
  • 183
  • 922
  • 838
  • hmm - an empty bat file is not working. I get the following "'pre-revprop-change' hook failed with error output:" – Greg Dean Mar 11 '09 at 06:04
  • @CMS - I did indeed take the tortoiseSVN path, however I'm going to accept @Andrew's answer since he was first, had the same answer (more or less), and will probably appreciate the rep more. Thanks for your help. – Greg Dean Mar 11 '09 at 06:35
6
  1. Enable revision property change hook
  2. Modify svn:date property, using svnlook date if you need.
si618
  • 16,580
  • 12
  • 67
  • 84
0

In addition, when using TortoiseSVN, the log is cached, and you have to delete the cache for the TortoiseSVN log on the client to reflect the changes on the server. See Tortoise SVN Log messages does not update

Wout
  • 624
  • 5
  • 14