Feature #109

Create a script which renames the usernames in an existing SVN repository

Added by Robert Lemke over 11 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Should have
Category:
Development
Target version:
Start date:
2008-01-23
Due date:
% Done:

100%


Description

If we want to transfer the 4.x SVN repository from Source Forge one day, we'll need to map all the typo3.org user names to those which were used at SF. One way would be to svnadmin dump the whole repository, do some fancy search & replace of usernames according to a mapping table and then svnadmin load the hacked dump.

We need to find out if that is possible and then create a script which does that.

History

#1 Updated by Sebastian Kurfuerst over 11 years ago

  • % Done changed from 0 to 10

http://subversion.tigris.org/servlets/ReadMsg?list=users&&msgNo=53593

Gosh, that sounds cumbebrsome to me. It would take the repository  
offline, in any case. If you can do that, fine, but a less-invasive  
solution would be to simply set a pre-revprop-change hook to allow  
changes to revision properties, then just "svn propset svn:author  
$NEW_AUTHOR -r $REV $REPO" for each $REV that was committed by this  
author. Something like "svn log $REPO | grep $OLD_AUTHOR" can show  
you which revisions those are.

#2 Updated by Sebastian Kurfuerst over 11 years ago

pre-revprop-change

    Because Subversion's revision properties are not versioned, making modifications to such a property (for example, the svn:log commit message property) will overwrite the previous value of that property forever. Since data can be potentially lost here, Subversion supplies this hook (and its counterpart, post-revprop-change) so that repository administrators can keep records of changes to these items using some external means if they so desire. As a precaution against losing unversioned property data, Subversion clients will not be allowed to remotely modify revision properties at all unless this hook is implemented for your repository.

    This hook runs just before such a modification is made to the repository. The repository passes four arguments to this hook: the path to the repository, the revision on which the to-be-modified property exists, the authenticated username of the person making the change, and the name of the property itself.

(from Subversion Book)
http://svnbook.red-bean.com/en/1.0/ch05s02.html
                                                                -- remove r from revision number
for i in `svn log svn://...|grep $OLDUSER | awk '{print $1}'|sed -e 's/r//'`; do echo $i; done

outputs all revision numbers. Now we can adjust the user.

#3 Updated by Sebastian Kurfuerst over 11 years ago

for i in `svn log svn://...|          grep "|"            |       grep line       |         grep $OLDUSER       |        awk '{print $1}'        |         sed -e 's/r//'`; do echo $i; done

#4 Updated by Sebastian Kurfuerst over 11 years ago

  • Status changed from Accepted to Resolved
  • Target version set to 0.1
  • % Done changed from 10 to 100

Fixed. Script is created and lies under /home/forge/svn-helpers/rename-svn-users.sh

#5 Updated by Sebastian Kurfuerst over 11 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF