How to map bzr committer to trac user name?

Asked by Václav Šmilauer

I am using bzr with http+webdav transport, and trac 0.12, running through the same apache2. The commiter name which shows up in trac is not the same as trac username, although bzr authenticates using the same htdigest username/password as trac. I would like to have the same usersnames in commits and trac. The site is having 3 users, so a hackish solution is acceptable, too. I was thinking that either of the following would do:

1. either force bzr to use the authentication name as commiter in the repository, instead of the one provided (is that possible?)

2. or change the commiter name for this single host in ~/.bazaar/authentication.conf (tried, but trivially setting email in the [...] section did not work)

3. or configure the plugin itself to do the mapping?

Thanks for help!

Question information

English Edit question
Trac-Bzr Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Martin von Gagern (gagern) said :

1. would be problematic in case you want to push more than a single commit in one go. It might mis-attribute commits to the wrong people. I also believe that the transport layer is intentionally too dumb to care about commit properties. But developers of the bzr-webdav plugin will know more about this.

2. Try "bzr whoami --branch" to change committer info for a single branch. If you need this for more than one branch, there might be better ways, but ask bzr devs about this, as I'm not sure about the best way myself.

3. If you want to display the user names different from the way they are stored in the repository, you'd have to tweak the method BzrChangeset.get_properties:

Revision history for this message
Martin von Gagern (gagern) said :

3. Guess I've been wrong about get_properties; instead you'd have to tweak the authors list in BzrChangeset.__init__:

Can you help with this problem?

Provide an answer of your own, or ask Václav Šmilauer for more information if necessary.

To post a message you must log in.