Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I sync file modification dates in Subversion?

I've created a repo for our website. The initial commit touched file modification dates so all dates show the commit date.

In a later time, I downloaded the unmodified files from the web server to my WC so old unmodified files have their original dates now as in the web server and I can sync my local copy with the production and test servers during a deployment.

Now I noticed the issue with the dates in the repo, and I wish to make it so the file modification dates in the repo get same with my working copy. Is there a method so I can commit file properties of unmodified files?

  • using tortoise svn
  • I don't like the idea removing all files and making an enormouse commit, though this wouldn't probably make a real difference in the repo size.
  • I know I could rebuild the repo, but this is a very dirty job, especially on Windows.
like image 950
SuperDuck Avatar asked Sep 01 '25 17:09

SuperDuck


1 Answers

You can't use svn and care about dates. Must pick one of them.

Having said that there is one option in TortoiseSVN > Settings > General > Set file dates to the "last commit time". This yields the date of commit, but not the date of last change.

To have the date of last change you must fiddle with commit hooks. TortoiseSVN > Settings > Hook Scripts. The only script I ever used is the one that allows the change of the log, so can't help you with that. See following questions for more info:

  • SVN - how to preserve files timestamps?
  • Change the timestamp of a SVN revision
  • SVN commit with old date/time

Apparently you can't set the dates of individual files, but you can set the date of the revision. The name of the property is svn:date, and I have a feeling that there may be some side effects of changing it. So, be warned.

like image 70
Dialecticus Avatar answered Sep 05 '25 05:09

Dialecticus