2011-11-13 26 views
12

私はhg pushをgitリポジトリに使用しようとしていますが、警告メッセージは表示されません。私はa single post on the mailing lista registered hg-git issueを見つけましたが、どちらも半年ぐらいで、あまり活動しませんでした。だから私は何かを誤解したり誤って構成していると思った。 マイ~/.hgrchg-git pushが自動的に失敗する

[extensions] 
hgext.bookmarks = 
hgext.git = 
#hggit = /path/to/hg-git-0.3.1/hggit 
[bookmarks] 
track.current = True 

が含まれています。このスニペットは、問題を再現します。

mkdir /tmp/Git 
cd /tmp/Git 
git init 
echo 'something' > myfile 
git add . 
git commit -m 'Started' 
cd .. 
hg clone /tmp/Git /tmp/Hg 
cd /tmp/Hg 
echo 'another thing' >> myfile 
hg ci -m 'Working' 
hg log 
# Two items listed 
hg push 
cd ../Git 
git log 
# Only one item listed, but two expected 

私はUbuntuの11.10、および最新のタグ付きバージョン、0.3.1に同梱の両方hg-git 0.2.6-2を試してみました。私の水銀はバージョン1.9.1です

コミットする前にhg update master、コミット後にhg bookmark -f masterという2つの提案された回避策を試みましたが、両方ともエラーが発生しました。

UPDATE:プッシュが明示的に失敗した場合、およびHG-Gitはそれを報告しなければならない(それはない):

私はそこに二つの問題がここにあるnew issue for this

答えて

19

を作成しました。

プッシュは失敗する必要があります。"abort: git remote error: refs/heads/master failed to update" when pushing to local cloneは非ベアリポジトリへのプッシュです(more on that from a mercurial user's perspective参照)。上のスニペットの作業バージョンはこれです(Bareリポジトリの使用に注意してください)。

mkdir /tmp/Git 
cd /tmp/Git 
git init 
echo 'something' > myfile 
git add . 
git commit -m 'Started' 
cd .. 
git clone --bare -l /tmp/Git /tmp/Bare 
hg clone /tmp/Bare/ /tmp/Hg 
cd /tmp/Hg 
echo 'another thing' >> myfile 
hg ci -m 'Working' 
hg log 
# Two items listed 
hg push 
cd ../Bare 
git log 
# Two items listed 

hg-gitはこのエラーを隠す理由、については、私はそれがUbuntuのに同梱され、最新バージョンとの問題だと思います。私がやったことはそれはdulwich 0.7.1を除去し、hg-gitサイトによる必要です0.8をインストール

apt-get remove mercurial-git python-dulwich 
easy_install hg-git 

ました。今、それは私のために働く。水銀バージョン(1.9.1)はうまくいくようです。

関連する問題