我在使用subrepos配置Mercurial时遇到了批评问题。当我尝试提交或进行更新时,我收到以下错误:
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 :(得分:3)
如果路径中的Git for Windows (mysysgit)目录为C:\Program Files (x86)\Git\cmd
,请尝试将其更改为:
C:\Program Files (x86)\Git\bin
这将使git能够与Mercurial一起使用。
答案 1 :(得分: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
的输出,但这是特定于平台的详细信息。