Tuesday, November 11, 2008

Use TortoiseHg 0.5 to clone a Mercurial 1.0.2 SSH repository

If you just downloaded TortoiseHg v0.5, and try to clone the remote SSH repository, you'll get error message: "The system cannot execute the specified program." Now try:
TortoiseHg> TortoisePlink.exe
The system cannot execute the specified program.
So you have to install Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) according to TortoiseHg FAQ. But even you have done that, it seems that TortoisePlink does not support private key for SSH well.

Now I just fall back to Putty as this is much more direct and prime. Modify Mercurial.ini under TortoiseHg:
; In order to push/pull over ssh you must specify a ssh tool
;ssh = "C:\TortoiseHg\TortoisePlink.exe" -ssh -2
ssh = "C:\Putty0.6\Plink.exe" -ssh -2 -i "C:\key\ubuntu-1.ppk"
Then right click->TortoiseHG->Clone a Repository->Source Path, input something like
ssh://root@192.168.10.1//home/env/mercurial/open-source/openJDK
Then click "clone", it works without a hitch.

Note: As Putty uses user's relative path to home, //home/env/... is to tell it this is an absolute path /home/env/...

Ref:

No comments: