Mercurial + SSH

Hi all,

I've been trying to set up access to Mercurial repo for TeamCity using ssh.
I successfully did that using public key authentication, but now I wonder whether it is possible to do that using password authentication.
There are two issues. In both scenarios I fill the VCS root form with repo address, login and password, and click "Test Connection" button.

1) TeamCity tries to put password into command line, but Mercurial does not seem to support that:

'hg identify ssh://mephi42:******' command failed.

Indeed, if I copy-paste that command into usual shell and replace asterisks with an actual password, it would just treat username:password combination as a single long username.

2) Passwords containing funny characters (this probably applies to other fields too) do not get escaped, e.g. if I use password "`;br" - note the leading backquote - then it would say:

'hg identify ssh://mephi42:******' command failed.
stdout: remote: /bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
remote: /bin/sh: -c: line 1: syntax error: unexpected end of file

1 comment
Comment actions Permalink

According to "hg help urls", ssh url format is the following:

TeamCity Mercurial plugin uses this format. There can be problems with passwords containing : but the same problems will arise if you try to invoke this command from command line.

BTW do you know of other ways of hg command execution with SSH password?


Please sign in to leave a comment.