简体   繁体   English

Windows TortoiseHg plink在克隆/推送后挂起

[英]Windows TortoiseHg plink hangs AFTER clone/push

We have an all Windows network and I'm trying to get Tortoise Mercurial up and running over SSH for a central repo for our small team to use. 我们有一个全Windows网络,我正在尝试通过SSH获取Tortoise Mercurial,以便为我们的小团队使用中央回购。 I can get it working for the most part but plink/tortoiseplink hang AFTER executing commands successfully (clone/push etc.) 我可以让它在大多数情况下工作,但plink / tortoiseplink挂起后成功执行命令(克隆/推送等)

I've set up Freesshd on our Widnows 2008 rc2 server along with Tortoise Hg. 我在Widnows 2008 rc2服务器和Tortoise Hg上建立了Freesshd。 I've generated myself a public/private key on the server (was having issues generating on the client) using PuttyGen. 我使用PuttyGen在服务器上生成了公钥/私钥(在客户端上生成了问题)。 Private key I copied to my client and updated mercurial.ini. 私钥我复制到我的客户端并更新了mercurial.ini。 Public key I renamed and updated Freesshd to point at the folder containing the public keys. 公钥我重命名并更新了Freesshd以指向包含公钥的文件夹。 On the client side I have registered my private key with Pageant, created a session in Putty along with pointing it at my private key and saved it. 在客户端,我已经使用Pageant注册了我的私钥,在Putty中创建了一个会话,并将其指向我的私钥并保存。 When I use Putty to make my initial connection, things start to go odd. 当我使用Putty进行初始连接时,事情开始变得奇怪。

I get a command prompt for user name (no prompt for password) and, at the command prompt (after authentication), I can't type. 我收到用户名的命令提示符(没有提示输入密码),并且在命令提示符下(身份验证后),我无法输入。 Perhaps an issue with Putty. 也许是Putty的一个问题。 I'll try using Tortoise via (TortoisePlink.exe). 我将尝试使用Tortoise(TortoisePlink.exe)。

In mercurial.ini I have: [ui] ssh = "C:\\putty\\TortoisePlink.exe" -ssh -2 -batch -C -i C:\\Users\\Jude.ssh\\JudePrivate.ppk 在mercurial.ini中我有:[ui] ssh =“C:\\ putty \\ TortoisePlink.exe”-ssh -2 -batch -C -i C:\\ Users \\ Jude.ssh \\ JudePrivate.ppk

If I use the console I can clone the repo but it hangs AFTER doing everything. 如果我使用控制台,我可以克隆回购,但它会在做完所有事情后挂起。 Using --debug, the last line is: 3 files updated, O files merged, 0 files removed, 0 files unresolved 使用--debug,最后一行是:3个文件更新,O文件合并,0个文件删除,0个文件未解析

Kind of what I would expect as the files do get clones. 当文件确实得到克隆时,我期望的那种。 But then I can't do anything else. 但后来我什么也做不了。 Ctrl+C does nothing and I have to kill the process. Ctrl+C什么都不做,我必须杀死进程。 (Which by the way, then shows the Ctrl^C at the command prompt as well as the rest of the keyboard mashing). (顺便说一句,然后在命令提示符下显示Ctrl ^ C以及键盘糖化的其余部分)。

The repo gets cloned, the correct version of the files appear but the console window doesn't close or give me back control. repo被克隆,文件的正确版本出现但控制台窗口没有关闭或让我重新控制。

If I try using the Hg Workbench, I get a similar issue. 如果我尝试使用Hg Workbench,我会遇到类似的问题。 I can clone and push - it actually happens - but using the GUI I get: 我可以克隆和推送 - 它实际上发生 - 但使用GUI我得到:

% hg --repository C:\repositories\HgTest push --debug          
ssh://Jude@dev01:22/d:/repositories/hgtest
pushing to ssh://Jude@dev01:22/d:/repositories/hgtest
running "C:\putty\TortoisePlink.exe" -ssh -2 -batch -C -i
C:\Users\Jude\.ssh\JudePrivate.ppk Jude@dev01 -P 22 "hg -R d:/repositories/hgtest serve --stdio"
sending hello command
sending between command
remote: 145
remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
remote: 1
query 1; heads
sending batch command
searching for changes
all local heads known remotely
no changes found
sending listkeys command
checking for updated bookmarks
sending listkeys command

The green bar at the top of the Workbench says "Pushing to ssh://Jude@dev01:22/d:/repositories/hgtest..." as does the status bar at the bottom. Workbench顶部的绿色条表示“推送到ssh:// Jude @ dev01:22 / d:/ repositories / hgtest ...”,底部的状态栏也是如此。 I left it like this all weekend and when I came back it was still like it. 我整个周末都这样离开了,当我回来时它仍然像它一样。 I can still use the Hg Workbench (kind of) but can't use pull/push/clone. 我仍然可以使用Hg Workbench(种类),但不能使用pull / push / clone。 Trying to close the Hg Workbench results in the message (in status bar) Sync tab cannot exit and I can't close the app. 尝试关闭Hg Workbench导致消息(在状态栏中) Sync tab cannot exit ,我无法关闭应用程序。 Killing TortoisePlink.exe (or Plink.exe, whichever I try) frees up the app I can use it or close it as normal. 杀死TortoisePlink.exe(或Plink.exe,无论我尝试哪个)释放我可以使用它的应用程序或正常关闭它。

Initially I thought it was a problem with TortoiseHg or TortoisePlink but downloading Plink from the Putty site results in the same. 最初我认为这是TortoiseHg或TortoisePlink的一个问题,但从Putty网站下载Plink会导致相同的问题。

To clarify: 澄清:
- I can push/clone via SSH and no password prompt - 我可以通过SSH推送/克隆,没有密码提示
- I can do this via the command line or the Hg Workbench - 我可以通过命令行或Hg Workbench来完成
- Irrespective of which method I use (or Plink.exe or TortoisePlink.exe) the process needs to be manually killed. - 无论我使用哪种方法(或Plink.exe或TortoisePlink.exe),都需要手动杀死该进程。

Software used + versions 使用的软件+版本
Client (Windows Vista 32bit) 客户端(Windows Vista 32位)
Tortoise Hg 2.3 (merc 2.1, Python 2.6.6) Tortoise Hg 2.3(merc 2.1,Python 2.6.6)
Plink 0.62 Plink 0.62
Server - (Windows 2008 server rc2) 服务器 - (Windows 2008服务器rc2)
FreeSSHd 1.2.4 FreeSSHd 1.2.4
Same Tortoise as above 与上面相同的乌龟

Lots of searching has yielded nothing of use. 大量的搜索没有任何用处。 I've tried all suggestions I've seen (even if marginally related) but to no avail. 我已经尝试过所有我见过的建议(即使有些相关),但无济于事。 As the actual functions are working I assume I've set up correctly the keys, SSH, Tortoise etc. 由于实际功能正常,我假设我已经正确设置了密钥,SSH,Tortoise等。

I'm hoping I'm missing a simple option somewhere but I suspect that it's awaiting some kind of user prompt. 我希望我在某个地方错过了一个简单的选项,但我怀疑它正在等待某种用户提示。

Fingers crossed :) 手指交叉:)

=== UPDATE === ===更新===

I've found the event log for Putty (right click putty console window, voila, "Event Log" option. Once I've loaded the session and clicked open, I get the console window and a login as: prompt. After typing my name and hitting return, I get: 我找到了Putty的事件日志(右键点击putty控制台窗口,瞧,“事件日志”选项。一旦我加载了会话并点击打开,我得到控制台窗口并login as: prompt。输入后我名字和回击,我得到:

Reading private key file "C:\Users\Jude\.ssh\JudePrivate.ppk"
Pageant is running. Requesting keys.
Failed to get reply from Pageant
Offered public key
Offer of public key accepted
Sent public key signature
Access granted
Opened channel for session
Allocated pty (ospeed 38400bps, ispeed 38400bps)
Started a shell/command

And it's at this stage I the command prompt changes to c:\\Windows\\system32> and can't type anything. 并且在这个阶段我将命令提示符更改为c:\\Windows\\system32>并且无法键入任何内容。

=== UPDATE 2 === ===更新2 ===

Using plink I do the following at the console: 使用plink我在控制台上执行以下操作:

plink -v -ssh Jude@dev01 "cmd /c echo hello"

and, as well as all the info -v gives, I see hello then Server sent command exist status 0 and Disconnected: All channels closed . 并且,以及所有信息-v给出,我看到hello然后Server sent command exist status 0Disconnected: All channels closed This is what I would expect. 这就是我所期待的。

If I do it with tortoiseplink, `tortoiseplink-v -ssh Jude@dev01 "cmd /c echo hello"' I see nothing returned or written to the window and I get a command prompt again. 如果我使用tortoiseplink,`tortoiseplink-v -ssh Jude @ dev01“cmd / c echo hello”'我看不到任何返回或写入窗口,我再次收到命令提示符。

This implies SSH is working as is the alias (dev01). 这意味着SSH与别名(dev01)一样工作。 But should I see something when using TortoisePlink? 但是在使用TortoisePlink时我应该看到什么吗?

Typing hg clone --verbose -- ssh://Jude@dev01/d:/repositories/hgtest C:\\repositories\\test again fetches the files, copies them to the test folder but then doesn't return the command prompt. 键入hg clone --verbose -- ssh://Jude@dev01/d:/repositories/hgtest C:\\repositories\\test再次获取文件,将它们复制到测试文件夹但不返回命令提示符。 Last line is 3 files updated... etc. 最后一行是3 files updated...

=== UPDATE 3 === ===更新3 ===

It seems hg.exe is spawned by FreeSSHd on the server and it does close/finish. 似乎hg.exe是由FreeSSHd在服务器上生成的,它确实关闭/完成。 When the hg.exe process is killed on the server, the client (console/clone dialogue box) behaves and finished the command gracefully. 当hg.exe进程在服务器上被终止时,客户端(控制台/克隆对话框)会正常运行并完成命令。

To clarify: 澄清:

  1. I use clone from command line or HG Workbench and specify repo alias 我在命令行或HG Workbench中使用clone并指定repo别名
  2. According to the logs everything is fine, I'm authenticated, the files are pulled down via SSH and copied to the local repo I specified in 1 根据日志一切都很好,我已通过身份验证,文件通过SSH下拉并复制到我在1中指定的本地仓库
  3. At this point it hangs - whether the console or HG Workbench or right click/clone option. 此时它会挂起 - 无论是控制台还是HG Workbench,还是右键单击/克隆选项。
  4. Using Process Explorer on the server allows me to kill hg.exe spawned by the FreeSSHd service 在服务器上使用Process Explorer允许我杀死由FreeSSHd服务生成的hg.exe
  5. As soon as I do this the client says "command completed successfully". 一旦我这样做,客户说“命令已成功完成”。

So, it now seems to be an issue with Tortoise Hg on the server. 所以,现在看来服务器上的Tortoise Hg存在问题。 Maybe FreeSSHd and Tortoise don't play well together... I suppose I'll reinstall everything... 也许FreeSSHd和Tortoise在一起玩不好......我想我会重新安装一切......

=== UPDATE 4 === ===更新4 ===

It seems I'm not the only one with this issue. 看来我不是唯一有这个问题的人。 I had spotted this before on SO but it wasn't relevant at the time. 我之前在SO上发现了这个,但当时没有相关性。 However, now I'm getting the same problem: Mercurial over ssh client and server on Windows That problem wasn't solved (two years ago) so shall I keep this question open? 但是,现在我遇到了同样的问题: 在Windows上的ssh客户端和服务器上的Mercurial这个问题没有解决(两年前)所以我应该保持这个问题吗?

  1. First of all - read docs! 首先 - 阅读文档!

     hg help urls Valid URLs are of the form: .... ssh://[user@]host[:port]/[path][#revision] 
  2. Plink uses -l option for username Plink使用-l选项作为用户名

  3. Debug successful ssh-connect (and usable path) with pure TortoisePlink, remove all unnecessary options 使用纯TortoisePlink调试成功的ssh-connect(和可用路径),删除所有不必要的选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM