Python 使用织物从bitbucket中拉出hg

Python 使用织物从bitbucket中拉出hg,python,django,mercurial,fabric,bitbucket,Python,Django,Mercurial,Fabric,Bitbucket,我试图使用fabric部署Django项目,当我运行hg pull时,我遇到了这个错误: [myusername.webfactional.com] run: hg pull [myusername.webfactional.com] out: remote: Warning: Permanently added the RSA host key for IP address '207.223.240.181' to the list of known hosts. [myusername.we

我试图使用fabric部署Django项目,当我运行
hg pull
时,我遇到了这个错误:

[myusername.webfactional.com] run: hg pull
[myusername.webfactional.com] out: remote: Warning: Permanently added the RSA host key for IP address '207.223.240.181' to the list of known hosts.
[myusername.webfactional.com] out: remote: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
[myusername.webfactional.com] err: abort: no suitable response from remote hg!

Fatal error: run() encountered an error (return code 255) while executing 'hg pull'
我可以运行其他mercurial命令,如
hg status
,和
hg log
,只需从我的fab文件中运行即可

我在服务器上生成了一个SSH密钥,并将其添加到我的bitbucket帐户中。这就像我可以在SSH中运行
hg pull
一样有效,而且效果很好,只有在使用fabric时

这是我的文件:

from __future__ import with_statement
from fabric.api import *

env.hosts = ['myusername.webfactional.com']
env.user = "myusername"

def development():

    # Update files
    local("hg push")
    with cd("~/webapps/mysite/mysite"):
        run("hg pull")

    # Update database
    with cd("~/webapps/mysite/mysite"):
        run("python2.6 manage.py syncdb")
        run("python2.6 manage.py migrate")

    # Reload apache
    run("~/webapps/mysite/apache2/bin/restart")
有什么想法吗

编辑:

使用https实现了这一点

所以不是

hg pull
我正在使用

hg pull https://myusername@bitbucket.org/myusername/mysite
不能复制

zada$ fab development
[ostars.com] Executing task 'development'
[ostars.com] run: hg pull
[ostars.com] out: pulling from ssh://hg@bitbucket.org/Zada/b
[ostars.com] out: no changes found

Done.
Disconnecting from ostars.com... done.

zada$ hg --version
Mercurial Distributed SCM (version 1.6.3)
zada$ ssh ostars.com "hg --version"
Mercurial Distributed SCM (version 1.6)
zada$ fab --version
Fabric 0.9.2
可能的原因:版本不匹配。或者只是Butback上的一个小故障:)
请尝试运行(“hg pull”)以更加详细。

要使用SSH在BitBucket中克隆、拉取或推送存储库,您需要遵循以下说明(本文档适用于Mac OSX或Linux上的Mercurial):

如果要设置其他ssh以使用bitbucket,请参阅完整文档:


谢谢你的回答。在使用git和github时,我实际上遇到了同样的“权限被拒绝”问题(我切换到mercurial和bitbucket的原因之一就是这个错误)。因此,我将研究版本不匹配问题。我这里也有同样的问题。这就解决了: