Michal Sznajder
Michal Sznajder

Reputation: 9406

How do I change the default author for accessing a local SVN repository?

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.

Upvotes: 13

Views: 24154

Answers (5)

Rômulo Ceccon
Rômulo Ceccon

Reputation: 10347

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.

Upvotes: 17

Sven Witterstein
Sven Witterstein

Reputation:

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

Upvotes: 0

JXG
JXG

Reputation: 7413

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.

Upvotes: 1

Brock Boland
Brock Boland

Reputation: 16720

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.

Upvotes: 0

unknown (yahoo)
unknown (yahoo)

Reputation:

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.

Upvotes: 0

Related Questions