How can I keep the original file [commit] timestamp on Subversion?

后端 未结 4 584
遇见更好的自我
遇见更好的自我 2020-11-29 01:12

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.

Current

相关标签:
4条回答
  • 2020-11-29 01:48

    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.

    0 讨论(0)
  • 2020-11-29 01:49

    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.

    0 讨论(0)
  • 2020-11-29 01:50

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

    0 讨论(0)
  • 2020-11-29 01:50

    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.

    0 讨论(0)
提交回复
热议问题