Mercurial + SSH

Hi all,

I've been trying to set up access to Mercurial repo for TeamCity 5.1.2.13430 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:******@q-d.hg.sourceforge.net/hgroot/q-d/q-d/' 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:******@q-d.hg.sourceforge.net/hgroot/q-d/q-d/' 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

According to "hg help urls", ssh url format is the following:
ssh://[user[:pass]@]host[:port]/[path][#revision]

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?

0

Please sign in to leave a comment.