2012-02-22 61 views
1

我在我的Lion机器上有这个应用程序,它位于一个mercurial repository中,所以我使用hg-git将它部署到heroku。hg-git从Lion部署到heroku

〜/ .hgrc

[extensions] 
hgext.bookmarks = 
hggit = 

... /项目/ .hg/hgrc

[paths] 
default = https://validhgrepo.com 

[alias] 
push-heroku = push git+ssh://[email protected]:appname.git 

然后当我运行汞推的Heroku应该部署,而是我得到:

caseys-MacBook-Air:project casey$ hg push-heroku 
pushing to git+ssh://[email protected]:appname.git/ 
creating and sending data 
["git-receive-pack 'appname.git/'"] 

! Invalid path. 
! Syntax is: [email protected]:<app>.git where <app> is your app's name. 

abort: git remote error: The remote server unexpectedly closed the connection. 

这没有任何意义。我觉得这个错误信息是误导性的,因为这个信息库确实存在。

此外,这工作完美的我的Ubuntu机器上有一个类似的设置。

回答

2

原来这是与此相关的issue。我之前没有注意到额外的斜线。我申请了一个类似于这个guy的补丁,它对我很有帮助(在最新的hg,hg-git和osx上)。如何安装补丁

全部细节:

  1. 先卸载它

    sudo easy_install -m 'hg-git' 
    
  2. 然后删除HG-git的蛋文件在〜/图书馆/ Python的/ 2.7 /定点包

  3. 安装为目录

    sudo easy_install -Z 'hg-git' 
    
  4. 打开〜/图书馆/ Python的/ 2.7 /站点包/ hg_git ..../hggit/git_handler.py

  5. 用手将修补程序(我更像线1118)。

    --- git_handler.py Thu Jul 28 22:05:45 2011 
    +++ patched.git_handler.py Thu Jul 28 22:11:44 2011 
    @@ -1066,6 +1066,8 @@ 
    
           port = None 
           host, path = hostpath.split(hostpath_seper, 1) 
    +    if (host.find('heroku') > 0): 
    +     path = path.rstrip('/') 
           if hostpath_seper == '/': 
           transportpath = '/' + path 
           else: 
    
-2

您的git远程格式被拧紧。

在git的/ config中确保远程需要的格式:

[email protected]:appname.git 

其中appname是您的应用程序的名称在Heroku

+1

我没有一个.git文件夹,因为这个项目是在HG不是混帐。 – fiestacasey 2012-02-23 03:43:49

+0

确实如此,但在与Heroku交谈时仍然在使用Git - 您需要确定远程设置的位置。 – 2012-02-23 13:21:24

+2

'hg-git'(OP正在使用)显式不使用git。所以不,OP在与Heroku交谈时不使用git。 – 2012-05-13 19:11:24