Issue #2363 resolved

HGUSER env var not honored

elifarley
created an issue

It seems that 8c32919 introduced a bug: If my username is set via the env var "HGUSER" (see Setting up a username), I won't be able to commit, since only ui().config('ui', 'username') is checked.

Comments (4)

  1. Yuya Nishihara

    commit: backout 8c32919e6b19 in favor of getCurrentUsername() (refs #2363)

    qtlib.getCurrentUsername() does mostly the same thing, but it just goes wrong if not ui.interactve(). We should fix it instead of duplicating the similar check.

    This should fix #2365, because getCurrentUsername() reads repo.ui.

    → <<cset 7cad87036979>>

  2. Yuya Nishihara

    qtlib: make sure getCurrentUsername() not fall back to system value

    If not ui.interactive(), ui.username() does not fail even if username is unconfigured. Thus, getCurrentUsername() cannot detect missing username in this case. To avoid this problem, it should check the existence of config or environment variables before calling ui.username().

    http://selenic.com/hg/file/5db16424142c/mercurial/ui.py#l394

    Alternatively, we can hack ui object to raise util.Abort appropriately, but it seems much more complicated than this change.

    Closes #2363.

    → <<cset 3619f14ee3b6>>

  3. Log in to comment