views:

590

answers:

3

I want to be sure that if I commit something in subversion from one machine and I checkout on another I will get the same value for datetime/timestamp.

Currently I observed that the file datetime is from the comment when I did the sync instead of the original value.

For me it doesn't make any sense to know when the files were synced - I just want to see the last commit time.

This issue is not timezone related.

+3  A: 

If you are using TortoiseSVN, there is an option. TortoiseSVN -> Settings -> General -> "Set file dates to the 'last commit time'".

nickf
THis isn't the original timestamp.
oefe
This option sounds like a good solution but how can I control this when I use command line svn client (like SlickSVN and not TortoiseSVN )? A cross platform solution would be better.
Sorin Sbarnea
+2  A: 

Subversion doesn't preserve the original timestamp of the file.

If you absolutely need to preserve the timestamp, you have to do it yourself. For example, you could store the original timestamp as a subversion property.

oefe
That's not true, you can enforce this with a config setting, you don't have to do it yourself.
silk
Againg, no- use-commit-times = yes is the time the file was committed, not the original timestamp.
oefe
Ahh, ok, I misunderstood you, sorry.
silk
+5  A: 

You can set it in .subversion/config:

[miscellany]
use-commit-times = yes

Although you will have strange side effects if we are talking about source files.

For example - you build your software and do svn update, now the timestamp of the updated files is older then the timestamp of the build result file and it won't be rebuilt even though source files changed. Be very careful with this setting.

silk
This sets the modification time of the checked out copy to be equal to the time when changes to it were last committed to the repository. This is *not* the same as preserving the modification date the file had when it was originally imported into the repository.
bendin
I believe it is what OP meant - as stated in the question - "I just want to see the last commit time."
silk