How to edit log message already committed in Subversion?

前端 未结 10 1650
太阳男子
太阳男子 2020-11-27 23:54

Is there a way to edit the log message of a certain revision in Subversion? I accidentally wrote the wrong filename in my commit message which could be confusing later.

10条回答
  •  臣服心动
    2020-11-28 00:50

    When you run this command,

    svn propedit svn:log --revprop -r NNN 
    

    and just in case you see this message:

    DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent

    Its because Subversion doesn’t allow you to modify log messages because they are unversioned and will be lost permanently.

    Unix-hosted SVN

    Go to the hooks directory on your Subversion server (replace ~/svn/reponame with the directory of your repository)

    cd ~/svn/reponame/hooks
    

    Remove the extension

    mv pre-revprop-change.tmpl pre-revprop-change
    

    Make it executable (cannot do chmod +x!)

    chmod 755 pre-revprop-change
    

    Source

    Windows-hosted SVN

    The template files in the hooks directory cannot be used as they are Unix-specific. You need to copy a Windows batch file pre-revprop-change.bat to the hooks directory, e.g. the one provided here.

提交回复
热议问题