Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 5646:c722bd73c948
fix typo in sshargs
the original typo dated back to early 2005
author | Steve Borho <steve@borho.org> |
---|---|
date | Thu, 13 Dec 2007 14:25:51 -0600 |
parents | e2e8e977a6cb |
children | 165cda754d9e |
comparison
equal
deleted
inserted
replaced
5645:1f044b04fa0a | 5646:c722bd73c948 |
---|---|
962 | 962 |
963 def sshargs(sshcmd, host, user, port): | 963 def sshargs(sshcmd, host, user, port): |
964 '''Build argument list for ssh or Plink''' | 964 '''Build argument list for ssh or Plink''' |
965 pflag = 'plink' in sshcmd.lower() and '-P' or '-p' | 965 pflag = 'plink' in sshcmd.lower() and '-P' or '-p' |
966 args = user and ("%s@%s" % (user, host)) or host | 966 args = user and ("%s@%s" % (user, host)) or host |
967 return port and ("%s %s %s") % (args, pflag, port) or args | 967 return port and ("%s %s %s" % (args, pflag, port)) or args |
968 | 968 |
969 def testpid(pid): | 969 def testpid(pid): |
970 '''return False if pid dead, True if running or not known''' | 970 '''return False if pid dead, True if running or not known''' |
971 return True | 971 return True |
972 | 972 |
1109 return pf | 1109 return pf |
1110 | 1110 |
1111 def sshargs(sshcmd, host, user, port): | 1111 def sshargs(sshcmd, host, user, port): |
1112 '''Build argument list for ssh''' | 1112 '''Build argument list for ssh''' |
1113 args = user and ("%s@%s" % (user, host)) or host | 1113 args = user and ("%s@%s" % (user, host)) or host |
1114 return port and ("%s -p %s") % (args, port) or args | 1114 return port and ("%s -p %s" % (args, port)) or args |
1115 | 1115 |
1116 def is_exec(f): | 1116 def is_exec(f): |
1117 """check whether a file is executable""" | 1117 """check whether a file is executable""" |
1118 return (os.lstat(f).st_mode & 0100 != 0) | 1118 return (os.lstat(f).st_mode & 0100 != 0) |
1119 | 1119 |