2011-11-21 52 views
3

我使用subrepos配置Mercurial時存在嚴重問題。當我嘗試提交或使更新我收到以下錯誤:在Windows上使用subrepos發生水銀錯誤

hg commit -m "commit" --traceback 
Traceback (most recent call last): 
File "mercurial\dispatch.pyc", line 87, in _runcatch 
File "mercurial\dispatch.pyc", line 679, in _dispatch 
File "mercurial\dispatch.pyc", line 454, in runcommand 
File "mercurial\dispatch.pyc", line 733, in _runcommand 
File "mercurial\dispatch.pyc", line 687, in checkargs 
File "mercurial\dispatch.pyc", line 676, in <lambda> 
File "mercurial\util.pyc", line 385, in check 
File "mercurial\commands.pyc", line 1092, in commit 
File "mercurial\cmdutil.pyc", line 1189, in commit 
File "mercurial\commands.pyc", line 1087, in commitfunc 
File "mercurial\localrepo.pyc", line 955, in commit 
File "mercurial\subrepo.pyc", line 847, in dirty 
File "mercurial\subrepo.pyc", line 783, in _gitisbare 
File "mercurial\subrepo.pyc", line 717, in _gitcommand 
File "mercurial\subrepo.pyc", line 721, in _gitdir 
File "mercurial\subrepo.pyc", line 737, in _gitnodir 
File "subprocess.pyc", line 623, in __init__ 
File "subprocess.pyc", line 833, in _execute_child 
WindowsError: [Error 2] The system cannot find the file specified 
abort: The system cannot find the file specified 

我.hgsub:

webdriver/vendor/webdriver = [svn]http://php-webdriver-bindings.googlecode.com/svn/trunk/trunk/phpwebdriver/ 
app/vendor/bundles/Knp/Bundle/ZendCacheBundle = [git]http://github.com/knplabs/KnpZendCacheBundle.git 
app/vendor/Zend/Cache = [git]http://github.com/knplabs/zend-cache.git 
app/vendor/Zend/Filter = [git]http://github.com/knplabs/zend-filter.git 

我使用Windows XP和Mercurial 1.9.2。我將svn和git添加到PATH中,並且效果很好。 當我嘗試手動更新我的subrepos時,沒有任何問題,svn up和git pull工作良好。

+0

一切工作正常我的隊友電腦(他們使用Ubuntu)。 – lstachowiak

+0

看起來它無法找到運行它並獲取子文件的git。我認爲這一定要歸功於你如何以及在哪裏添加git和svn到你的路徑。 –

+0

我試過用戶env PATH和系統env PATH。仍然無法正常工作: -/ – lstachowiak

回答

1

要調試您的路徑問題,可以使用下列文件

# qnddebug.py 
import os 
import sys 
import subprocess 

print os.environ['PATH'] 
print subprocess.call(['git', '--version']) 
sys.exit(23) 

hg --config extensions.foo=qnddebug.py運行它。然後你會在第一行看到mercurial用來尋找節目的路徑。最後一行是git調用的錯誤代碼,並且必須爲0.也許在退出狀態之前的行中有git --version的輸出,但這是平臺特定的細節。

+0

這似乎不工作在當前版本的TortoiseHg。沒有輸出。 – LeBleu

3

如果Git for Windows (mysysgit)目錄在你的路徑是C:\Program Files (x86)\Git\cmd,嘗試將其更改爲:

C:\Program Files (x86)\Git\bin 

這將使混帳與水銀工作。

+0

+ 1有類似的錯誤(只有在'abort:'之後沒有任何消息)並且在路徑中添加'bin'來修復它。 – Rarst