[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Mapping users in SVN-SVN repository migration?

From: Andy Levy <andy.levy_at_gmail.com>
Date: Thu, 24 May 2012 15:33:16 -0400

On Thu, May 24, 2012 at 3:20 PM, Marko Asplund <marko.asplund_at_ixonos.com> wrote:
>
> On Thu, May 24, 2012 at 10:05 PM, Daniel Shahaf <d.s_at_daniel.shahaf.name>
> wrote:
>>
>> ...
>>
>> Why do you believe you would need to "map" user accounts?  What does
>> "map" mean?
>
>
> Ok, I'll try to explain myself a bit better.
>
> I'm migrating a repository from SVN source server A to SVN target server B.
> SVN server A has account U for user U, while user U's account is named T on
> server B.
> SVN server A has accounts that are not present on server B.
> Target server B is centrally managed and the user management policy prevents
> creating all the accounts found on source server A.
>
> For these reasons I assumed I would need to modify the source repository
> history so that commits made by user U would be attributed to account T
> before loading the repository data into server B.
>
> Am I making false assumptions here?

Subversion won't care that the names have changed (there is no
technical requirement for you to do this at all), but your users will
because they have to remember that Bob is now Robert, and Susan is now
Sue, etc. If the names are similar or easy to remember, you may not
have to do anything.

You do not have to do this at the time of migrating the repository,
though it may be convenient to do so.

If I were in your position and had to rewrite those author names, I
would do the following:
0) Migrate the repository to the new server
1) Make sure it works
2) Create a mapping (lookup table) of old names to new names
3) Write a script to iterate through each revision from 0 through the
last revision committed on server A and do this:
for (X in 1...last_rev) {
oldauthor = svn propget --revprop svn:author --revision X <URL>
newauthor = lookupNewNameFor(oldauthor)
svn propset svn:author --revprop --revision X newauthor <URL>
}

where URL is the URL to the root of your repository
Received on 2012-05-24 21:34:30 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.