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.
views:
212answers:
2
+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
2009-01-05 23:32:30
Yeah, svn doesn't tend to allow for things like this directly (and on purpose). Your method is likely the only way...
Andy
2009-01-05 23:40:06
+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
2009-01-06 00:22:33
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
2009-01-06 01:15:25
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
2009-01-06 02:10:17
propset rather than propedit, and supplying the value in the command rather than throwing to an editor may help you out there Jason
Cebjyre
2009-01-06 02:24:24
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
2009-07-20 21:05:27