3

Is there a direct way to rename a user's name in svn?

I've found this linux script only. I thought it would be easier. Does anybody know a windows-way to change it?

We are using VisualSvnServer as svn server and TortoiseSNV on clients.

Odys
  • 8,951
  • 10
  • 69
  • 111

3 Answers3

2

In TortoiseSVN:

  1. open the log dialog.
  2. Then enter the username in the filter so only those revisions show up which you want to change the author.
  3. select all those revisions
  4. right-click to get the context menu
  5. select "Edit author"
  6. enter the new author name, click OK
  7. wait
  8. done

Note: to change the author of multiple revisions you need TSVN 1.7 - in 1.6 it's only possible to change the author for one revision at a time.

To change the username for future commits as well, start the VisualSVN server manager (on the server), select the repository, right-click, choose "properties", then edit the username there.

Stefan
  • 43,293
  • 10
  • 75
  • 117
  • This will change the nickname of the author.. The following files that this user will submit, will have the previous name. I mean, VisualSVNServer will not be aware that the user's name has been changed. The history only will break, not the actual user. – Odys Dec 10 '11 at 17:24
  • Yes, but that's exactly what the linux script you found and linked to does. – Stefan Dec 10 '11 at 17:49
  • In which version of VisualSVN is this functionality available? I have the free one and don't see this in the Properties dialog – Odys Dec 26 '11 at 18:37
1

You can edit the revision property svn:author with TortoiseSVN as well so you can change it. This is only suitable if you have to change that only for a single revision or may be two...if you have more than ten you should thinking about writing a script. Furthermore it must be allowed to change revision properties by the server side which is usually not allowed.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • I had in my mind that the author has a reference and a nickname. I didn't know that the name is hardwritten in every file of every revision.. What I want is rename the user that has access to svn, not the author of a specific file/revision. Isn't this possible? – Odys Dec 09 '11 at 20:33
  • The user who checked in a revision is stored into the svn:author property. Try to change simply the USER environment variable as a first try...On the other hand the linux script you are referenced is exactly changing the author of a revision. – khmarbaise Dec 09 '11 at 20:36
  • How is your user authenticated on the client machine (windows account) ? You can change your credentials by using --username/--password – khmarbaise Dec 09 '11 at 20:37
  • users are defined using the VisualSvnServer. There is no option to rename them from that interface – Odys Dec 09 '11 at 20:40
  • But of course you can add a new user name/password combination and change the credentials of some existing user to use the newly created. – khmarbaise Dec 10 '11 at 10:58
1

You should use pre revision propert change hook like this:

if /I not "%4" == "svn:author" exit 0
echo Only changes to svn:author messages are allowed. >&2
exit 1

Please that this hook allow all authenticated users to change svn:author property.

Ivan Zhakov
  • 3,981
  • 28
  • 24