Thursday, December 18, 2014

How do I edit a log message that I already committed in Subversion


Edit a log message that I already committed in Subversion on Linux :

You can use svn proedit command to edit the logs, But sometimes it will give an error like this : 
"svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found"
So the solution is Set SVN_EDITOR Environment Variable To Vim.
Here the command to export the path :
# export SVN_EDITOR=vim
To permanently set this environment variable put the below line in your ~/.bash_profile file.
# export SVN_EDITOR=vim
Now you can edit the SVN log :
# svn propedit -r N --revprop svn:log URL
                         OR
# svn propset -r N --revprop svn:log "new log message" URL
Here N will be the Rev no
URL is your SVN path
When you run this propedit command, 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-existen"
Its because Subversion doesn't allow you to modify log messages because they are unversioned and will be lost permanently.
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

Now edit, it will work..!
**************

No comments:

Post a Comment