【发布时间】:2014-02-24 19:24:00
【问题描述】:
我使用的是 Windows 7 - Sourcetree 1.4.1.0 - Embedded Mercurial 2.6.1
Target 是托管在 bitbucket 上的私有 mercurial 存储库。
如何启用 SSH 压缩以加快交易速度?
【问题讨论】:
标签: ssh mercurial compression bitbucket atlassian-sourcetree
我使用的是 Windows 7 - Sourcetree 1.4.1.0 - Embedded Mercurial 2.6.1
Target 是托管在 bitbucket 上的私有 mercurial 存储库。
如何启用 SSH 压缩以加快交易速度?
【问题讨论】:
标签: ssh mercurial compression bitbucket atlassian-sourcetree
通过 Google 快速搜索得到this document:
编辑 Mercurial 全局配置文件 (~/.hgrc)。将以下行添加到 UI 部分:
ssh = ssh -C完成后,文件应类似于以下内容:
[ui]# Name data to appear in commitsusername = Mary Anthony <manthony@atlassian.com>ssh = ssh -C
在 Windows 上,Mercurial 设置文件位于此处:
C:\Users\{username}\AppData\Local\Atlassian\SourceTree\hg_local\Mercurial.ini
文件的内容实际上并没有改变,正如它的标题所解释的那样:
; System-wide Mercurial config file. ; ; !!! Do Not Edit This File !!! ; ; This file will be replaced by the installer on every upgrade. ; Editing this file can cause strange side effects on Vista. ; ; http://bitbucket.org/tortoisehg/stable/issue/135 ; ; To change settings you see in this file, override (or enable) them in ; your user Mercurial.ini file, where USERNAME is your Windows user name: ; ; XP or older - C:\Documents and Settings\USERNAME\Mercurial.ini ; Vista or later - C:\Users\USERNAME\Mercurial.ini
我没有 Mac,所以无法对此进行测试,但this Atlassian answer 声明此文件的 Mac 位置为:
/Applications/SourceTree.app/Contents/Resources/mercurial_local/hg_local/
【讨论】:
Program Files (x86)/Atlassian 中四处寻找,没有找到;在AppData 中环顾四周,找到了它:)
%LOCALAPPDATA%\Atlassian\SourceTree\hgrc_sourcetree。
就我而言,我使用的是 TortoiseHg,但概念应该是相同的。
这是我原来的c:\somerepo\.hg\hgrc 文件:
[paths]
default = ssh://hg@bitbucket.org/someuser/somerepo
那么ssh 发生了什么?让我们在命令行上调试一个 pull 语句 hg pull --debug。我注意到它正在运行 C:\Program Files\TortoiseHg\lib\TortoisePlink.exe 而不是 ssh 来拨打电话:
PS C:\somerepo> hg pull --debug
pulling from ssh://hg@bitbucket.org/someuser/somerepo
running "C:\Program Files\TortoiseHg\lib\TortoisePlink.exe" -ssh -2 hg@bitbucket.org "hg -R someuser/somerepo serve --stdio"
sending hello command
sending between command
abort: no suitable response from remote hg!
所以让我们重用调用,添加压缩(耶!)、非交互(批处理)和我们的密钥:
[paths]
default = ssh://hg@bitbucket.org/someuser/somerepo
[ui]
ssh = "C:\Program Files\TortoiseHg\lib\TortoisePlink.exe" -ssh -2 -C -batch -i "c:\keys\somekey.ppk"
【讨论】: