SVN commit with old date/time

后端 未结 3 1824
忘了有多久
忘了有多久 2020-12-03 15:15

Is there some way how to commit into the SVN repository with old time / date or how to edit the time / date post commit?

I have some archived sources which are very

相关标签:
3条回答
  • 2020-12-03 15:43

    What I did eventually was:

    • install VisualSVN server on my workstation
    • create a new "local" SVN repository
    • take archives one by one, for each:
      • in the working copy delete everything but .svn file, to make sure files which were deleted are not left over
      • decompress the archive into the working copy
      • change system date to the date of the archive
      • add and delete as necessary and commit into the local repository
    • once done, use svnadmin dump the repository
    • on the main SVN server load the dump using svnadmin load

    The steps above seem easier to me than installing the pre-revprop-change hook. (The one we currently have in place allows editing log message only.)

    Note: instead of changing system date it would be also possible to edit the date in the dump file before loading it.

    0 讨论(0)
  • 2020-12-03 15:52

    Each revision has a property, svn:date. If you have permission to modify unversioned properties, you can change that value.

    0 讨论(0)
  • 2020-12-03 15:59

    The date and time is in the "special" revision property, svn:date. You can modify it as so:

    svn propedit svn:date --revprop -r 12345
    

    or:

    svn propset svn:date --revprop -r 12345 2009-02-12T00:44:04.921324Z
    

    The revision (e.g. 12345 above) can also be HEAD meaning the latest revision.

    The date is specified in ISO 8601 format.

    You will need the repository to have the appropriate pre-revprop-change hook set up (in the hook directory in the repository) to allow svn:date to be modified. The templates that are provided with SVN repositories should be helpful.

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