How can I keep the original file [commit] timestam

2019-01-06 11:53发布

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 and timestamp.

Currently, I observed that the datetime of file's modification is from the moment when I did the synchronisation instead of the original value.

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

This issue is not timezone related.

4条回答
叼着烟拽天下
2楼-- · 2019-01-06 12:22

It would seem 'stat -c %y $FILE' be used as part of a pre-revprop-change hook that operates on svn:date. Only issue I might see is the date format.

查看更多
够拽才男人
3楼-- · 2019-01-06 12:32

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 than the timestamp of the build result file, and it won't be rebuilt even though some source files changed. Be very careful with this setting.

查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-01-06 12:33

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.

查看更多
Deceive 欺骗
5楼-- · 2019-01-06 12:36

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

Right click on your Tortoise shortcut to settings

查看更多
登录 后发表回答