views:

4633

answers:

5

I use TortoiseSVN to access file based local repo. In all my commits an author is my windows login name. Is it possible to use different name?

I know how to change author after commit but how to change before? Installing apache/svnserver is not an option.

A: 

As far as I know, TortoiseSVN does not offer any way to do this.

Presumably it's not seen as a big issue, since file based access is not practical for multi-user scenarios, and for single-user the author-name is of lesser importance.

A possible workaround would be to create another Windows username with the author name you want and connect with this.

A: 

I've never hosted svn on a Windows machine, so this is a shot in the dark. You might be able to create a new Windows user and specify that user when browsing, checking out, committing, etc. Let's say you want to make changes as msznajder. Create a user with that name in Windows, then try browsing the repository using TortoiseSVN's Repo-browser and specify the username in the URL - something like file:///msznajder@localhost/some/file/path.

Brock Boland
+1  A: 

Another possible workaround (but I am NOT advocating it) is to use a client-side hook script before commit, in order to change the username.

Hook scripts are discussed in the Subversion book, and local hooks are discussed in "Client Side Hook Scripts" in TortoiseSVN help.

JXG
+5  A: 

Yes, it's possible.

TortoiseSVN and the svn command line client share the same settings location in your profile folder. So you may simply checkout one version using svn.exe:

$ svn co --username different_user_name file:///C:/path/to/your/repo

... and Subversion will happily replace the associated username for that repository. New commits from TortoiseSVN will then always use that username, no matter with what program you make the new checkouts.

The procedure should work with TortoiseSVN 1.5.5. If it doesn't, try emptying svn's authentication cache (%APPDATA%\Subversion\auth\svn.username) first.

Romulo A. Ceccon
A: 

I suggest setting a post-commit-hook (in your repo's hooks folder - just copy the post-commit-hook.tmpl to post-commit-hook.bat and empty it [1]

svn propset svn:author --revprop -r HEAD <author> file:///<path-to-repo> [2]

[1] provided SlikSvn or similar is installed, i.e. commandline svn access is possible)

[2] (or .sh if on linux, with the #!/bin/bash preamble) with the same content

Have to add - sometimes it does not show up in t-svn because of it's log caching, but commandline "svn log file:///path/to/repo" reveals the changed author o.k.