title: hg push error and username not specified in .hg/hgrc. Keyring will not be used
body: <p>I did the following:</p>
  
  <p>hg clone ...somelink.to.repo.in.hg... Giga</p>
  
  <p>cd Giga</p>
  
  <p>ls                     (...it shows me giga.txt file exist in Giga directory)</p>
  
  <p>vi giga.txt            (...made some changes..)</p>
  
  <p>hg commit -m "byte"</p>
  
  <p>hg out                 (got the following error)</p>
  
  <pre><code>** unknown exception encountered, details follow
  ** report bug details to http://mercurial.selenic.com/bts/
  ** or mercurial@selenic.com
  ** Mercurial Distributed SCM (version 1.5)
  ** Extensions loaded: acl, bugzilla, children, churn, color, convert, extdiff, fetch, gpg, graphlog, hgcia, hgk, highlight, interhg, keyword, mercurial_keyring, mq, notify, pager, patchbomb, progress, purge, rebase, record, relink, schemes, share, transplant, zeroconf
  Traceback (most recent call last):
    File "/usr/bin/hg", line 27, in &lt;module&gt;
      mercurial.dispatch.run()
    File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run
      sys.exit(dispatch(sys.argv[1:]))
    File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 30, in dispatch
      return _runcatch(u, args)
    File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 47, in _runcatch
      return _dispatch(ui, args)
    File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 466, in _dispatch
      return runcommand(lui, repo, cmd, fullargs, ui, options, d)
    File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 336, in runcommand
      ret = _runcommand(ui, options, cmd, d)
    File "/usr/lib/python2.6/site-packages/mercurial/extensions.py", line 128, in wrap
      return wrapper(origfn, *args, **kwargs)
    File "/usr/lib/python2.6/site-packages/hgext/pager.py", line 66, in pagecmd
      return orig(ui, options, cmd, cmdfunc)
    File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 517, in _runcommand
      return checkargs()
    File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 471, in checkargs
      return cmdfunc()
    File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 465, in &lt;lambda&gt;
      d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
    File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
      return func(*args, **kwargs)
    File "/usr/lib/python2.6/site-packages/mercurial/extensions.py", line 116, in wrap
      util.checksignature(origfn), *args, **kwargs)
    File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
      return func(*args, **kwargs)
    File "/usr/lib/python2.6/site-packages/hgext/color.py", line 352, in nocolor
      return orig(*args, **opts)
    File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
      return func(*args, **kwargs)
    File "/usr/lib/python2.6/site-packages/mercurial/extensions.py", line 116, in wrap
      util.checksignature(origfn), *args, **kwargs)
    File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
      return func(*args, **kwargs)
    File "/usr/lib/python2.6/site-packages/hgext/mq.py", line 2648, in mqcommand
      return orig(ui, repo, *args, **kwargs)
    File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
      return func(*args, **kwargs)
    File "/usr/lib/python2.6/site-packages/mercurial/extensions.py", line 116, in wrap
      util.checksignature(origfn), *args, **kwargs)
    File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
      return func(*args, **kwargs)
    File "/usr/lib/python2.6/site-packages/hgext/graphlog.py", line 365, in graph
      return orig(*args, **kwargs)
    File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
      return func(*args, **kwargs)
    File "/usr/lib/python2.6/site-packages/mercurial/commands.py", line 2275, in outgoing
      other = hg.repository(cmdutil.remoteui(repo, opts), dest)
    File "/usr/lib/python2.6/site-packages/mercurial/hg.py", line 82, in repository
      repo = _lookup(path).instance(ui, path, create)
    File "/usr/lib/python2.6/site-packages/mercurial/httprepo.py", line 271, in instance
      inst.between([(nullid, nullid)])
    File "/usr/lib/python2.6/site-packages/mercurial/httprepo.py", line 190, in between
      d = self.do_read("between", pairs=n)
    File "/usr/lib/python2.6/site-packages/mercurial/httprepo.py", line 134, in do_read
      fp = self.do_cmd(cmd, **args)
    File "/usr/lib/python2.6/site-packages/mercurial/httprepo.py", line 85, in do_cmd
      resp = self.urlopener.open(req)
    File "/usr/lib/python2.6/urllib2.py", line 397, in open
      response = meth(req, response)
    File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
      'http', request, response, code, msg, hdrs)
    File "/usr/lib/python2.6/urllib2.py", line 429, in error
      result = self._call_chain(*args)
    File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
      result = func(*args)
    File "/usr/lib/python2.6/urllib2.py", line 855, in http_error_401
      url, req, headers)
    File "build/bdist.linux-i686/egg/mercurial_keyring.py", line 339, in basic_http_error_auth_reqed
    File "/usr/lib/python2.6/urllib2.py", line 833, in http_error_auth_reqed
      return self.retry_http_basic_auth(host, req, realm)
    File "/usr/lib/python2.6/urllib2.py", line 836, in retry_http_basic_auth
      user, pw = self.passwd.find_user_password(realm, host)
    File "build/bdist.linux-i686/egg/mercurial_keyring.py", line 333, in find_user_password
    File "build/bdist.linux-i686/egg/mercurial_keyring.py", line 184, in find_auth
    File "build/bdist.linux-i686/egg/mercurial_keyring.py", line 67, in get_http_password
    File "/usr/local/lib/python2.6/site-packages/keyring/core.py", line 37, in get_password
      return _keyring_backend.get_password(service_name, username)
    File "/usr/local/lib/python2.6/site-packages/keyring/backend.py", line 143, in get_password
      items = gnomekeyring.find_network_password_sync(username, service)
  gnomekeyring.IOError
  </code></pre>
  
  <h2>My ~/.hgrc (OpenSUSE machine)</h2>
  
  <pre><code>[ui]
  username=c123456 &lt;Arun.Sangal@MyCompany.com&gt;
  
  [extensions]
  mercurial_keyring = /root/mercurial_keyring.py
  
  #[trusted]
  #users = *
  #groups = *
  
  [extensions]
  acl =
  bugzilla =
  children =
  churn =
  color =
  convert =
  eol = !
  extdiff =
  factotum = !
  fetch =
  gpg =
  graphlog =
  hgcia =
  hgcr-gui-qt = !
  hgk =
  highlight =
  interhg =
  keyword =
  largefiles = !
  mercurial_keyring =
  mq =
  notify =
  pager =
  patchbomb =
  perfarce = !
  progress =
  projrc = !
  purge =
  rebase =
  record =
  relink =
  schemes =
  </code></pre>
  
  <p>....
  ........etc</p>
  
  <hr>
  
  <p>My local repository 
  (on OpenSuse cloned folder - inside: /Giga/.hg/hgrc) is:</p>
  
  <hr>
  
  <pre><code>[paths]
  default = http://the.hg.server.com/hg/TestHgRepo1/
  myrepo = http://the.hg.server.com/hg/TestHgRepo1/
  
  [auth]
  myrepo.schemes = http https
  myrepo.prefix = the.hg.server.com/hg
  myrepo.username = c123456
  </code></pre>
  
  <hr>
  
  <p>I tried everything but this Keyring thing is not working. I get prompt everytime I do:</p>
  
  <ul>
  <li><p>hg out</p></li>
  <li><p>hg push</p></li>
  <li><p>etc hg operation but not when I do </p></li>
  </ul>
  
  <p>hg commit</p>
  
  <p>Can someone please tell what the heck I'm missing here. Tried the same excercise on Windows with TortoiseHg, with C:...\mercurial.ini (Windows side kinda of unix ~/.hgrc file).. and updated/made sure local repository cloned folder's ../clonedfolder/.hg/hgrc file contains the similar [auth] ..3 lines but Mercurial on Linux OpenSUSE and on Windows using TortoiseHg is not working with keyring. </p>
  
  <p>It's prompting me for entering user credentials again n again :((</p>
  
  <p>can someone pls correct me on what should I do to get this resolved.</p>