Merge lp:~mbp/bzr/whoami into lp:bzr/2.3
Proposed by
Martin Pool
Status: | Merged |
---|---|
Approved by: | Vincent Ladeuil |
Approved revision: | no longer in the source branch. |
Merged at revision: | 5636 |
Proposed branch: | lp:~mbp/bzr/whoami |
Merge into: | lp:bzr/2.3 |
Diff against target: |
180 lines (+115/-5) 3 files modified
bzrlib/config.py (+86/-5) bzrlib/tests/test_config.py (+23/-0) doc/en/release-notes/bzr-2.3.txt (+6/-0) |
To merge this branch: | bzr merge lp:~mbp/bzr/whoami |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil | Needs Fixing | ||
Review via email: mp+55679@code.launchpad.net |
Commit message
infer default user name from /etc/mailname on unix (bug 616878)
Description of the change
This addresses bug 616878 by making bzr automatically infer an email address if /etc/mailname is set. This tries to get a balance between on the one hand saving people from committing lots of work as joe@localhost, and on the other hand letting them commit without needing manual setup. Basically it's a partial reversion and then readjustment for the fix for bug 549310.
To post a comment you must log in.
You just got a lot of positive karma from admins all over the planet ;-D
94 + # we try utf-8 first, because on many variants (like Linux),
95 + # /etc/passwd "should" be in utf-8, and because it's unlikely to give
96 + # false positives. (many users will have their user encoding set to
97 + # latin-1, which cannot raise UnicodeError.)
You will make savannah users happy with that, I think there is even a bug for that https:/ /bugs.launchpad .net/bzr/ +bug/659763 .
I think you could easily add more tests for _auto_user_id() and _get_default_ mail_domain( ) by adding optional parameters to inject whatever test files you need (/etc/passwd (or getuid(), pwd.getpwuid() whatever), /etc/mailname, etc)
That's a tweak