[rfc][patch] bzr whoami can set your branch identity
Robey Pointer
robey at lag.net
Mon Jan 9 02:21:11 GMT 2006
This patch stems from an IRC conversation last week, where there was
some consensus that 'bzr whoami' ought to be able to set a per-branch
identity as well as display it, and that we should try harder when
guessing identity from gecos.
I ran into a few bumps in the patch, so criticism is welcome:
* Blackbox 'runbzr' assumes that it will be able to log the command-
line parameters and stdout/stderr output from bzr. Since the user
encoding can be pretty arbitrary, that's a huge leap of faith. :) My
tactic was to have it quote non-ascii characters. It's just for
logging, so hopefully that's good enough.
* Unless I misunderstood how it works, I think 'whoami' output should
be encoded into the user's encoding, so I fixed that.
* When reading the branch's "email" controlfile, no decoding is
necessary. The controlfile API is handling encoding. (Nice!)
* I made a decorator '@with_user_encoding' for running a test with
the user's encoding temporarily changed to something else. (I wanted
to test that both ascii and utf-8 would work.) Is there a better way
to do that? I feel like I probably just overlooked some existing
mechanism for testing with a temporary encoding.
This patch is against jam-integration because the IRC discussion was
with John. It's not ready for integration and probably needs a bit
of discussion, unless you all think I'm right on all the above
points. ;)
robey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: whoami.patch
Type: application/octet-stream
Size: 11788 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060108/557592d6/attachment.obj
More information about the bazaar
mailing list