tags:

views:

212

answers:

2

I have a whole heap of legacy code that I checked into my SVN repository. I checked it in under my user name. I'd like to change the author of that commit to another user, 'legacy', in order to clean up the svn blame printouts.

+3  A: 

I'm not sure you can do this directly but what is possible is dumping the repo, using sed on it and re-import that as a new repo.

Keltia
Yeah, svn doesn't tend to allow for things like this directly (and on purpose). Your method is likely the only way...
Andy
+8  A: 

You need to have have a pre-revprop-change hook in your repository hooks directory that will allow changes to the svn:author property. (An executable script containing just "exit 0" will do.) Once you have this, then you can do:

svn propedit --revprop -rrev svn:author url

and make the necessary changes.

Peter S. Housel
As an aside, it looks like you can use the svn:date magic property to set the commit date in a similar fashion. Whether that is a good idea, I leave up to you.
Cebjyre
To get this to work, I had to use the --force option for svn. Also, vim likes to add new lines to the end of files, and I had to :set noendofline and :set binary to prevent that behavior. (Otherwise, every line from svn blame was two lines, due to an embedded newline in the author name.)
Jason Creighton
propset rather than propedit, and supplying the value in the command rather than throwing to an editor may help you out there Jason
Cebjyre
For others trying this, be sure that you're svn text editor doesn't insert a newline after the author name. vim did this for me and it took quite a while to figure out why blame was busted. You can use propget to confirm that what is saved in the repo has no line break.
Gordon Wilson