0

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.

bzs
  • 499
  • 5
  • 16

3 Answers3

1

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-@email.com>
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).

herohuyongtao
  • 49,413
  • 29
  • 133
  • 174
  • My mercurial _setup_ is how you described it. Also I have the username in my ```mercurial.ini``` and in all ```hgrc``` files. The ssh line is included for compression and has no effect to my issue. The pull/push for the main repository works. It seems that mercurial forgets the username by requesting the **subrepositories** which are declared in the ```.hgsub``` file (the source of the repositories is a url string without the username). Any idea? – bzs Oct 02 '14 at 16:07
  • after playing with tortoiseplink I found the solution: ```ssh = tortoiseplink.exe -l ```. thx for the hint – bzs Oct 06 '14 at 10:08
0

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.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
John Jefferies
  • 1,176
  • 7
  • 13
  • I use windows with putty and pageant. Generated a key and stored it on the servers authorized_keys file. That works for single repositories. But for a subrepository I must enter again my login name? – bzs Sep 30 '14 at 06:26
0

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

[ui]
ssh = tortoiseplink.exe -l <username>
bzs
  • 499
  • 5
  • 16