SVN vs Orwell

Not long ago I had to change history in GIT. Now I happened to commit to Subversion a revision, but forgot to limit the files to only relevant to the log entry and thus committed all changed files. Nothing really bad, but the entry was minor, compared to all the changes and I did not want those to go unnoticed in the log. I did not think one can take back files from an already committed revision, so I searched out for a solution to change the log entry. It turns out this is relatively simple, as the Subversion FAQ points out.

Enable revprop change

First step is to enable changes to revision properties. To do this, you need to set up a pre-revprop-change hook in the repository at the subversion server itself as described in the manual: change to repository hooks dir and copy the template as script:

[root@db /srv/svn/eenet/hooks]# cp pre-revprop-change.tmpl pre-revprop-change
[root@db /srv/svn/eenet/hooks]# chmod 755 pre-revprop-change
cd /srv/repo/hooks
cp pre-revprop-change.tmpl pre-revprop-change
chmod 755 pre-revprop-change

Edit the log

Now just reopen the log entry and edit as apropriate. First change to the working copy and then enter:

svn propedit -r N --revprop svn:log

where N is the revision number. This opens up your $EDITOR and when you save the file commits the new log message.
If you think you need this ability again in the future, you can leave the hooks in the place, otherwise remove it to avoid accidental changes to the properties SVN assumes to stay unchanged.

SVN - Orwell
 0  -  1

Related posts:

  1. GIT vs orwell

Leave a Comment

* Copy this password:

* Type or paste password here:


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">