Mercurial over ssh client and server on Windows

后端 未结 6 1932
挽巷
挽巷 2021-02-01 21:50

I\'m trying to configure Mercurial for use with both a windows server (freeSSHd) and client (both command line and TortoiseHG). I\'m using the most recent versions of everythin

相关标签:
6条回答
  • 2021-02-01 22:22

    I got the same symptoms just now, although hg was a bit more helpful after Ctrl+C - apparently plink was waiting for me to say y/n to "save server to cache". Unfortunately hg couldn't pass my y/n to it interactively (nor tell me that plink printed something important...)

    Solution:

    1. plink to the host once and save server info to cache
    2. add -batch to the plink command line so that next time this happens it aborts instead.

    I also add my key to pageant so I don't need to type the password anywhere else.

    Complete example of .hgrc file (Win+R, notepad %USERPROFILE%\.hgrc):

    [ui]
    ssh=C:\Path\To\plink.exe -C -batch -ssh -i C:\Path\To\My\putty-private-ssh-key.ppk
    
    0 讨论(0)
  • 2021-02-01 22:24

    The solution that worked for me was disable the "Use new console engine" option which is inside the SSH tab. Another thing is the path. ssh://ssh_user@SSH_Server_Address:SSH_Port/Win_Drive_Letter:/Path_To_HG_Repository

    A concrete example:

    ssh://programmer@192.168.1.150:5522/D:/Repository/MyProyect/trunk

    I currently use MercurialHG not the CLI. I hope that this help

    JQ

    The solution actually I got it from here

    0 讨论(0)
  • 2021-02-01 22:28

    Perhaps it's the case that 'hg' isn't in the path. You can see from the command line that's being invoked that 'hg' is being run as 'hg', which means it has to be in the server's path. Try using the --remotecmd option to clone to give the full path to the hg executable on the server (good luck getting the windows quoting right).

    It's possible that your plink hg version test works because it's launched as an interactive shell which gets a different path -- at least that frequently stymies people on unix.

    0 讨论(0)
  • 2021-02-01 22:40

    I ran into this same problem. Not sure how it relates to yours, but this is what worked for me. First, I will explain my set up. I have a repository on my live site mysite.com I have a local repository on my local machine in a folder mysite.com I have other repositories, so I add [ui] settings to /.hg/.hgrc file in each repository folder on my local machine instead of the Mercurial.ini file.

    First, if you have already connected via Putty, save the session because Plink can use stored sessions. Use Pageant and add your key. Try running plink from the command line to connect using the stored session. For example, I saved my session as "mysite" in Putty.

    C:\>plink mysite
        Using username "mysite".
        Last login: Fri Feb 26 21:16:05 2010 from ca-xxx-xx-x-xxx.sta.host.net
        ←]0;mysite@server:~[mysite@server ~]$
    

    If that is working, try the following in your .hgrc file

    [path]
    default = ssh://mysite@myhost
    [ui]
    username = RB <admin@mysite.com>
    ssh=plink.exe -ssh -i mysite
    

    Plink is set in my PATH, and since the mysite session was already stored in Putty, it knows what to look for.

    I was trying to do a pull, so I was testing using:

    hg pull --debug --traceback
    

    Hope that helps.

    Edit: Sorry, saw too late you were using tortoiseHG instead of putty. Hope it helps anyway.

    0 讨论(0)
  • 2021-02-01 22:42

    Another option would be to try the Cygwin versions of hg and ssh. You can log SSH problems in that version with the -e option; for instance, hg clone -e 'ssh -vvv' ssh://you@server/repo...

    0 讨论(0)
  • 2021-02-01 22:45

    In my case I was able to connect to my server once but the second time it failed.

    I have the same setup and it worked perfectly...but only once. There is nothing in my stored sessions.

    [ui]
    ssh=C:\Path\To\plink.exe -C -batch -ssh -i C:\Path\To\My\putty-private-ssh-key.ppk
    
    0 讨论(0)
提交回复
热议问题