tags:

views:

77

answers:

3

Is there any way to merge two users' history into one user in SVN?

+2  A: 

Try using svnadmin to dump the repository to a text file, use some text tool to replace the one author for the other. Then use svnadmin to load the file into a new repository.

Johan Lübcke
I used this same trick when we moved to a new repo so I didn't show up in "blame" as the modifier for everything.
nitzmahone
+4  A: 

You can change the author of a revision with this command:

svn propset --revprop -r <revision number> svn:author <username>

You will just have to extract which revisions were made by one author in order to rename them.

The hook script of your repository have to allow author renaming though (namely pre-revprop-change).

RedGlyph
this sounds like the best approach, there are so many revisions but I guess I can just write a simple loop and change all of them.
dr. evil
+1 Now why didn't I think of that? If he wants to modify in-place, this'll be simplest. If he's merging more than one repository, and merging users is just one aspect of it, then svndumptool will be a huge help.
retracile
+1  A: 

You'll need to dump the svn repository to a dump file, modify it, then load it to create a new repository. The tool to use for the modification would most likely be svndumptool; IIRC, you should be able to use the 'transform-revprop' functionality to change author names.

Now, the subversion dumpfile may look like a text file, but it isn't quite. It has length specifiers embedded in it and such-like, so you can modify it by hand to some extent, but you have to be very careful about it.

Disclaimer: I have contributed to svndumptool in the past

On the other hand, RedGlyph's approach may be simpler.

retracile