0

Machine Env: Windows7 box with Cygwin/TortoiseHg, Linux box (RHEL). Mercurial/Hg - 3.0.1 version

I'm trying to integrate mercurial_keyring to perform username/password less operations. Mercurial keyring prompts first time per user / per repository link but after that, it doesn't prompt.

Our Hg repository code recently migrated to RhodeCode.

I have mercurial_keyring.py (python) file available on my machine (provided by this link): https://pypi.python.org/pypi/mercurial_keyring and https://bitbucket.org/Mekk/mercurial_keyring/src/tip/mercurial_keyring.py

While doing hg clone or any hg command, I'm getting the following error when used at command prompt (either in Linux or Windows machine via Cygwin).

*** failed to import extension hgext.mercurial_keyring from /root/AKS/goga/mercurial_keyring.py: 'module' object has no attribute 'NullHandler'

My ~/.hgrc file looks like:

# example config (see "hg help config" for more info)

[ui]
# name and email, e.g.
# username = Jane Doe <jdoe@example.com>
username=koba <koba.loki@shenzi.com>

[extensions]
# uncomment these lines to enable some popular extensions
# (see "hg help extensions" for more info)
# pager =
# progress =
# color =
hgext.mercurial_keyring = /root/AKS/goga/mercurial_keyring.py

[paths]
default = http://hg-server.cm.shenzi.com:8082

[auth]
default1.schemes = http https
default1.prefix = hg-server:8082
default1.username = koba

default.schemes = http https
default.prefix = hg-server.cm.shenzi.com:8082
default.username = koba

default3.schemes = http https
default3.prefix = 12.112.91.112
default3.username = koba

In Cygwin, I also got another error:

*** failed to import extension hgext.mercurial_keyring from ~/MerKeyRing/mercurial_keyring.py: No module named keyring
AKS
  • 16,482
  • 43
  • 166
  • 258
  • In Cygwin, I ran these commands, "easy_install keyring" and "easy_install mercurial_keyring". I ran hg clone command on a repo link and it prompted me to enter password for NEW KEYRING instead of asking username's password. It's working now i.e. I'm not prompted for my user/password for this repo now, while doing any hg operations BUT, when I'm doing hg out/push etc command, it's annoyingly prompting me everytime for "Please enter password for encrypted keyring:" (the new KEYRING password that I entered first time after I ran hg cmd (hg clone) after installing easy_install things. – AKS Feb 12 '15 at 21:05
  • OK, on my co-workers machine, when I did the same above steps of running easy_install for both keyring and mercurial_keyring and setup his ~/.hgrc file with the above content (and also when username was his id), it worked without any issue for accessing Mercurial Hg repos which are now behind RhodeCode and prompted for username's password ONLY once and never again for any future hg operations. I'm still investigating what I can do to resolve the issue that I'm getting in Cygwin on my machine. Will share. – AKS Feb 13 '15 at 17:07
  • Now, cool thing is, I heard in mercurial_keyring you have to enter password per user per repo, but in my case, I can perform hg operations on any other repository without entering any password anymore. – AKS Feb 13 '15 at 17:09
  • Possibly it could be: - permission issues - having different mercurial than the one using .hgrc file – marcinkuzminski Mar 11 '15 at 08:27

0 Answers0