Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

When my team first started out with SVN we all just used our first names when committing to the repository, however, now that our team has grown, we are running into issues because we just hired a second Mike.

What we would like to do is change everybody's usernames to be the same as the username on their computer (first name initial + last name). The issue that I'm seeing is that the SVN history will still show the old usernames on commits.

Is there a tool out there for changing usernames throughout the entire history of a repository?

For example, I would like every commit that is currently attributed to Mike to change to msmith, all the way back to revision 1.

My first thought is that I'll have to do some parsing and processing on a dump file, but a tool would be nice.

like image 852
Wally Lawless Avatar asked Jul 28 '09 16:07

Wally Lawless


2 Answers

You can use svndumptool:

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

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

like image 61
Jason McVetta Avatar answered Oct 11 '22 08:10

Jason McVetta


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.

like image 29
Steffen Opel Avatar answered Oct 11 '22 08:10

Steffen Opel