Show More
@@ -437,7 +437,7 b' class ui(object):' | |||
|
437 | 437 | """ |
|
438 | 438 | user = os.environ.get("HGUSER") |
|
439 | 439 | if user is None: |
|
440 | user = self.config("ui", "username") | |
|
440 | user = self.config("ui", ["username", "user"]) | |
|
441 | 441 | if user is not None: |
|
442 | 442 | user = os.path.expandvars(user) |
|
443 | 443 | if user is None: |
@@ -52,15 +52,34 b'' | |||
|
52 | 52 | abort: no username supplied |
|
53 | 53 | (use "hg config --edit" to set your username) |
|
54 | 54 | [255] |
|
55 | ||
|
56 | # test alternate config var | |
|
57 | ||
|
58 | $ echo 1234 > asdf | |
|
59 | $ echo "[ui]" > .hg/hgrc | |
|
60 | $ echo "user = Foo Bar II <foo2@bar.com>" >> .hg/hgrc | |
|
61 | $ hg commit -m commit-1 | |
|
62 | $ hg tip | |
|
63 | changeset: 4:6f24bfb4c617 | |
|
64 | tag: tip | |
|
65 | user: Foo Bar II <foo2@bar.com> | |
|
66 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
67 | summary: commit-1 | |
|
68 | ||
|
69 | # test no .hg/hgrc (uses generated non-interactive username) | |
|
70 | ||
|
71 | $ echo space > asdf | |
|
55 | 72 |
$ |
|
56 | 73 |
$ |
|
57 | 74 | no username found, using '[^']*' instead (re) |
|
58 | 75 | |
|
59 | $ echo space > asdf | |
|
76 | $ echo space2 > asdf | |
|
60 | 77 | $ hg commit -u ' ' -m commit-1 |
|
61 | 78 | transaction abort! |
|
62 | 79 | rollback completed |
|
63 | 80 | abort: empty username! |
|
64 | 81 | [255] |
|
65 | 82 | |
|
83 | # don't add tests here, previous test is unstable | |
|
84 | ||
|
66 | 85 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now