2010-11-21 6 views
6

後、dcommitに失敗しました。のgit - SVNは、私は次のプロジェクトでのgit-svnをを使用しようとしているにもきれいなチェックアウト

git checkout -bではなくgit svn branchで分岐した後、git-svnでgit-svn dcommitを使用して問題が発生し、そのローカルブランチをmasterにマージしてdcommitしようとしました。奇妙なことに、きれいなチェックアウトを行った後でさえ、私はdcommitを試みるときにエラーが残っています。

次かなり長いトレースがのgit-svnのと私の現在のワークフローの代表である:私は基本的にすべてのためのgit svn rebase続いgit svn dcommitを行う必要があり

[email protected]:~/workspace/gsoc2010/scxml-js$ git svn dcommit 
Committing to https://[email protected]/repos/asf/commons/sandbox/gsoc/2010/scxml-js/trunk ... 
     M  build-common.xml 
     M  src/xslt/backends/js/StateTableStatechartGenerator.xsl 
     M  src/xslt/backends/js/SwitchyardStatechartGenerator.xsl 
     M  src/xslt/ir-compiler/appendTransitionInformation.xsl 
     M  src/xslt/ir-compiler/copyEnumeratedEventTransitions.xsl 
     M  src/xslt/ir-compiler/flattenTransitions.xsl 
     M  src/xslt/ir-compiler/nameTransitions.xsl 
     M  src/xslt/ir-compiler/numberStatesAndTransitions.xsl 
     M  src/xslt/ir-compiler/splitTransitionTargets.xsl 
     M  src/xslt/util/language-frontend-module-generators/sh-from-topo-sort-list-generator.xsl 
     M  src/xslt/util/topo-sort.xsl 
Committed r1037491 
W: 502073c202cb1fbe089f0e8b7100304f0aa74729 and refs/remotes/trunk differ, using rebase: 
:100644 100644 7930fd690be01a5716490704b5556e2b5cab5ba6 51047f2c8cf1daaa94ae44433a9aa2acc222ae43 M  build-common.xml 
:040000 040000 59251941b33bda1376881b33bb2263ea87b1b947 2f5e2586e26bc7d05def065cfcf05327982b81d7 M  src 
Current branch master is up to date. 
# of revisions changed 
before: 
39c6f7e2d7b82cc782b8770d1ddb0ecb4f86e780 
c5f360feb3a6bdaab2fb2f48d05e8691824e3231 

after: 
502073c202cb1fbe089f0e8b7100304f0aa74729 
39c6f7e2d7b82cc782b8770d1ddb0ecb4f86e780 
c5f360feb3a6bdaab2fb2f48d05e8691824e3231 
If you are attempting to commit merges, try running: 
     git rebase --interactive --preserve-merges refs/remotes/trunk 
Before dcommitting 
[email protected]:~/workspace/gsoc2010/scxml-js$ git svn rebase 
     M  build-common.xml 
     M  src/xslt/ir-compiler/nameTransitions.xsl 
     M  src/xslt/ir-compiler/copyEnumeratedEventTransitions.xsl 
     M  src/xslt/ir-compiler/appendTransitionInformation.xsl 
     M  src/xslt/ir-compiler/flattenTransitions.xsl 
     M  src/xslt/ir-compiler/numberStatesAndTransitions.xsl 
     M  src/xslt/ir-compiler/splitTransitionTargets.xsl 
     M  src/xslt/backends/js/SwitchyardStatechartGenerator.xsl 
     M  src/xslt/backends/js/StateTableStatechartGenerator.xsl 
     M  src/xslt/util/language-frontend-module-generators/sh-from-topo-sort-list-generator.xsl 
     M  src/xslt/util/topo-sort.xsl 
r1037491 = e8d820cfdca882a57fbfa003b9673313be6c9621 (refs/remotes/trunk) 
First, rewinding head to replay your work on top of it... 
Applying: Changed some paths around so python fronend works. 
Applying: Removed test_with_xsltproc.sh. This file no longer needed, as we now generate a bash backend module. 
[email protected]:~/workspace/gsoc2010/scxml-js$ git svn dcommit 
Committing to https://[email protected]/repos/asf/commons/sandbox/gsoc/2010/scxml-js/trunk ... 
     M  src/python/scxml/cgf/backends/js 
     M  src/python/scxml/cgf/xslt 
Committed r1037493 
W: 8563b885bfca77ccb33a87f56f78e6323af022a9 and refs/remotes/trunk differ, using rebase: 
:040000 040000 c33b3d66ecc6735af3241d7f9cee383d2736f614 59251941b33bda1376881b33bb2263ea87b1b947 M  src 
Current branch master is up to date. 
# of revisions changed 
before: 
574e2e495fa12cf3d81004638a06e3315d0abba5 

after: 
8563b885bfca77ccb33a87f56f78e6323af022a9 
574e2e495fa12cf3d81004638a06e3315d0abba5 
If you are attempting to commit merges, try running: 
     git rebase --interactive --preserve-merges refs/remotes/trunk 
Before dcommitting 

は、最後のdcommit以来コミット。これは通常正常に動作しますが、失敗し、より手作業が必要になることがあります。

クリーンチェックアウトを使用しても解決されないなど、dcommitでこの問題が発生する可能性があるのは何ですか?

+1

私が考えることができるのは、リモートのSVNサーバーが何らかの形でコミットを行い、結果として得られたSVNコミットが、単にプッシュしたGitコミットと100%一致しないことです。 dranitする(コミットを保持する)同じブランチに新しいブランチを作成し、SVNにプッシュされた1つのコミットとそれに対応するGitコミットの間でdiffを試してみてください。 – cdhowie

答えて

5

私はこのに走ったし、最終的に何が起こっているかを考え出し:あなたはHTTPとwrite-through proxyingを経由してSVNリポジトリにアクセスすると、お勧めpost-commitフックがバックグラウンドでsvnsyncを実行します。 HTTPを介したコミットは、SVNサーバーが終了するとすぐに終了しますが、読んでいるHTTPプロキシが新しいリビジョンに更新される前に終了します。 git-svnは、コミットの直後にフェッチが行われ、新しいリビジョンのない古いHTTPプロキシが表示されます。それは、それが新しいリビジョンを持っていると仮定し、リモートの先端をコミットしようとしたものと比較し、衝突を見ます。

あなたがSVNプロキシ設定を制御している場合、svnsyncを同期させることができます(これは設定変更で誰かが私を驚かせるまで私にとって長い間働いていました)。そうでなければ私はgit-svnが再試行メカニズムを必要とすると思う:これはまだ今夜は良いアイデアだと思い

diff --git a/git-svn.perl b/git-svn.perl 
index 09c4ca5..af9aea1 100755 
--- a/git-svn.perl 
+++ b/git-svn.perl 
@@ -57,6 +57,7 @@ use File::Spec; 
use File::Find; 
use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/; 
use IPC::Open3; 
+use Time::HiRes qw/usleep/; 
use Git; 

BEGIN { 
@@ -574,7 +575,17 @@ sub cmd_dcommit { 
           $gs->{inject_parents_dcommit}->{$cmt_rev} = 
                   $parents->{$d}; 
         } 
-      $_fetch_all ? $gs->fetch_all : $gs->fetch; 
+      my $retry; 
+      fetch: for ($retry = 0; $retry < 30; ++$retry) { 
+       $_fetch_all ? $gs->fetch_all : $gs->fetch; 
+       last fetch if ($gs->rev_map_max >= $cmt_rev); 
+       # Asynchronous commit push not complete 
+       usleep(20000 * ($retry + 1)); 
+      } 
+      if ($retry > 0 && $gs->rev_map_max < $cmt_rev) { 
+       fatal "New revision $cmt_rev did not appear", 
+         "in repository after $retry retries."; 
+      } 
         $last_rev = $cmt_rev; 
         next if $_no_rebase; 

$ 

場合、私はパッチを提出します。

アップデート:私自身のコミットの1に

Author: syncuser <[email protected]> 

:これを使用している間、私がなってしまいました。そのため、スクリプトで部分同期が確認される競合状態が残っている可能性があります。これは面倒ですが、致命的ではありません。

+0

返事をありがとう。私はこのソリューションはおそらく動作すると思いますが、私はこの問題を回避する別の方法を見つけました。私は今ヨーロッパにいるsvn.apache.orgは、svn.us.apache.orgのミラーであるsvn.eu.apache.orgに透過的にマッピングしています。ミラーにコミットしてもうまくいきません。おそらくあなたが言及した問題のためです。しかし、svn.us.apache.orgから明示的にクローンを作成することで、dcommitはうまくいくように見えます。 – jbeard4

+0

自分のパッチ(上記)を使って5 FPGAビットファイルのリビジョンをコミットしたこと、そして30回の再試行後でもプロキシが新しいバージョンを見ていない(約10秒の合計待ち)ことに注意してください。ブリー。 –

関連する問題