Restricting multiple username password prompts - Linux Mercurial Keyring extension
I'm working on in setting up Mercurial Version control DVCS tool on Linux machine. It's done. When I go to http://server:port/hg
the link is working and whatever repositories I have created are visible and working fine.
Now, as a developer, when I access Mercurial repositories for doing development, like do "hg clone (checkout), hg commit, hg push etc).. I get prompted every time to provide my Active Directory/LDAP credentials when I do such operations.
I found mercurial can be configured with a plugin called "mercurial_keyring" and then, it'll just prompt the user his/her username/password (Active Directory / LDAP) for the first time and until that session remains, user can do any Hg/Mercurial development operations.
Does anyone have any information what file/setting I should change to make this happen correctly. So far, I have configured it per the online "mercurial_keyring" installation procedures but with no luck.
Following is my Linux user's ~/.hgrc file:
My local Linux folder "Giga" where I hg cloned a repository has the following hgrc file contents inside: ../../Giga/.hg/hgrc):
1. Follow this link: http://pypi.python.org/pypi/mercurial_keyring
It's not that clear, but here's the main point.
when the above link says... use myremote, that means, while doing hg clone http://..../../repo1 <aliasname>
the aliasname MUST be given so that it'll checkout/clone your repo1 as "aliasname" given. then, there are 2 choices,
either update your local (instead of actual repository's .hg/hgrc file, NOTE this is different file that ~/.hgrc) --- or just update ~/.hgrc with the following lines
1. NOTE NOTE:
1. While running "hg clone http://ServerName/some/hg/path/repos/Repository123" you have to provide another parameter, <aliasname> for the cloned "Repository123" folder/repository i.e.
hg clone http://ServerName/some/hg/path/repos/Repository123 myremote
what the above command will do is.. it'll checkout/clone Repository123 as "myremote" on the folder location from where you ran the above command. NOBODY mentioned this in the MERCURIAL KEYRING documentation clearly.
change some file.
do: hg stat
do: hg commit -m "somecomments"
(if you dont do this and do hg out/push directly, you'll see an error "No changes found")
do: hg out
do: hg push
NOW, NO MORE Multiple prompts for user authentication by Mercurial LDAP authentication at the prompt or in TortoiseHg.
2. NOTE NOTE: Make sure whatever ServerName you use, either just
i.e. Server's IP, in the hg clone command, you have to make sure that the value you'll put in ~/.hgrc (home directory's .hgrc file, which is different than repository's local .hg/hgrc file)... should have the 2nd line (value for remote server) as the same value that you used during clone command 1st parameter (http://<servervalue>)
otherwise, MERCURIAL KEYRING extension won't work.
easy peasy !!
if prompted multiple times for user credentials in mercurial. Setup Mercurial_Keyring and then
this question comes which nobody explained in an easy way.
??? how to make the [auth] xx.prefix = servername/hg_or_something work for all repositories under servername/hg location either if I use servername, servername's IP or servername's FQDN ?
ANSWER: Arun • 2 minutes ago −
OK, I put this in ~/.hgrc (Linux/Unix -home directory's .hgrc hidden file) or Windows users %UserProfile%/mercurial.ini or %HOME%/mercurial.ini file.
default1.schemes = http https
default1.prefix = hg_merc_server/hg
default1.username = c123456
default2.schemes = http https
default2.prefix = hg_merc_server.company.com/hg
default2.username = c123456
default3.schemes = http https
default3.prefix = 10.211.222.321/hg
default3.username = c123456
Now, I can checkout using either Server/IP/Server's FQDN.
|All times are GMT -5. The time now is 02:12 PM.|