diff --git a/mercurial_keyring.py b/mercurial_keyring.py --- a/mercurial_keyring.py +++ b/mercurial_keyring.py @@ -132,7 +132,7 @@ class HTTPPasswordHandler(object): return user, pwd if auth_user: - if user: + if user and (user != auth_user): raise util.Abort(_('mercurial_keyring: username for %s specified both in repository path (%s) and in .hg/hgrc/[auth] (%s). Please, leave only one of those' % (base_url, user, auth_user))) user = auth_user if pwd: