How prevent HG Workbench to ask for user name by using subrepositories?

396 Views Asked by At

I use HG Workbench and subrepositories over a ssh connection. I use also ssh-rsa to avoid typing my password every time. This works great for the main repository. But if I push or pull HG Workbench (or command shell) promt's with a dialog to typing my login name for every subreposititory. Can I prevent this?

Update:

I use windows. Also I have a [ui] section with username in my global mercurial.ini and in hgrc of every subrepositories.

3

There are 3 best solutions below

0
bzs On BEST ANSWER

On windows edit the global mercurial.ini settings file and add ssh key to the ui section:

[ui]
ssh = tortoiseplink.exe -l <username>
1
John Jefferies On

You don't say what OS you are using, but if you are on Linux the hg-ssh command ought to work. There's more info on the Mercurial site here. If you don't get any better answers it might be a good workaround.

2
herohuyongtao On

Simple way is to use SSH keys and follow setup sets by this post: Set up SSH for Mercurial. Key step is to add the following content to mercurial.ini (TortoiseHg’s global setting file):

[ui]
# Name data to appear in commits
username = -name-you-want-to-show- <[email protected]>
ssh = "C:\Program Files\TortoiseHg\TortoisePlink.exe" - ssh - 2 - batch - C

Also, make sure Pageant.exe is running in background in order to make it work (Add key > load > your input passphrase file).