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

后端 未结 7 1407
太阳男子
太阳男子 2020-12-02 17:55

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

7条回答
  •  情歌与酒
    2020-12-02 18:19

    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}
    

提交回复
热议问题