3

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.
DarkWingDuck
  • 2,028
  • 1
  • 22
  • 30
  • I don't get what your actual escenario looks like, you have a repository, a working copy *and* a web server (?). Could you elaborate on this? – Antonio Pérez Nov 21 '11 at 16:53
  • Oh, didn't mention as it seemed too much detail. It's a repo of a website. So I have a repo, a WC, a testing and a production server. Production server has the files with correct dates, so I have downloaded them to have correct dates in my WC. – DarkWingDuck Nov 22 '11 at 10:09
  • Shouldn't it work the other way around? Usually you have a version of your site in your repository that you point to be *the* production version and you just *deploy* that version in your production server. – Antonio Pérez Nov 22 '11 at 10:45
  • yeah. in this case the management people are not that advanced.. I set up version control for my own use, they don't use it, they don't want to install anything on the server including subversion etc etc. I'm trying hard to avoid collisions, as there is also no single deployment person and people from the management can put files on the server anytime... But on the other side, the question is more generic; I just don't want to lose original file dates. – DarkWingDuck Nov 22 '11 at 11:36

2 Answers2

4

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:

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.

Community
  • 1
  • 1
Dialecticus
  • 16,400
  • 7
  • 43
  • 103
  • Thanks Dialecticus! _"This yields the date of commit, but not the date of last change."_ I think if this option is not checked, the file dates are not touched by SVN, so I can care about dates? However, the real problem this time is it was selected during the initial commit, so I'm looking for a way to recommit files with their correct dates (with this option turned off). As there is no obvious way to the community, I'll consider deleting and re-adding those unmodified files. – DarkWingDuck Nov 24 '11 at 00:11
1

Subversion doesn't have this capability because the creators didn't think that it was important. Subversion only considers a file's name, contents, execute permission, but not this part of file metadata.

It's unfortunate, many users (including me) use subversion as a file synchronization system, and it's useful to synchronize modification times.

EDIT FROM 10 YEARS LATER: I no longer use Subversion for file synchronization.

vy32
  • 28,461
  • 37
  • 122
  • 246