Is there a way to change a SVN users username through the entire repository history?

You can use svndumptool:

svnadmin dump path/to/my/repo > repo.dump

svndumptool transform-revprop svn:author originalregexp newvalue repo.dump newrepo.dump


TortoiseSVN has excellent support for this functionality: within its Revision Log Dialog one can filter by author (even via regular expressions), select revisions from the filtered list as desired (usually all like in this question) and select 'Edit author' from the context menu.

The pre condition of having a pre-revprop-change hook in place as mentioned in jeroenhs answer does still apply, of course.

The processing is rather slow, but depending on ones needs this might still be much faster and/or more convenient then having to dump an entire repository and process these potentially huge dump file(s) with scripts.


yes there is:

svn propset --revprop -r revision_number svn:author new_username

However, svn does not allow changing revision properties by default. You need to set up a pre-revprop-change hook script for that. On windows, it suffices to put a bat-file in the hooks folder of your repository that simply contains one line:

exit 0

If that is set up, you should be able to write a script for your needs.

EDIT: I didn't test this through, but I think this should do the trick in PowerShell:

([xml] ( svn log --xml )).log.logentry 
   | ? {$_.author -eq "Mike"} 
   | foreach {svn propset --revprop -r $_.revision svn:author msmith}