2010-03-16 88 views
3

我有一种让水银认识我的编辑问题。我有一个文件c:\windows\notepad.exe并在命令提示符下输入“notepad”。我可以通过使用“-m”参数来提交提交标题。但是一个简单的“hg commit”会引发错误。水银主编:“中止:系统找不到指定的文件”

调用为 “hg --traceback commit” 带来了:

Traceback (most recent call last): 
    File "mercurial\dispatch.pyc", line 47, in _runcatch 
    File "mercurial\dispatch.pyc", line 466, in _dispatch 
    File "mercurial\dispatch.pyc", line 336, in runcommand 
    File "mercurial\dispatch.pyc", line 517, in _runcommand 
    File "mercurial\dispatch.pyc", line 471, in checkargs 
    File "mercurial\dispatch.pyc", line 465, in <lambda> 
    File "mercurial\util.pyc", line 401, in check 
    File "mercurial\commands.pyc", line 708, in commit 
    File "mercurial\cmdutil.pyc", line 1150, in commit 
    File "mercurial\commands.pyc", line 706, in commitfunc 
    File "mercurial\localrepo.pyc", line 836, in commit 
    File "mercurial\cmdutil.pyc", line 1155, in commiteditor 
    File "mercurial\cmdutil.pyc", line 1184, in commitforceeditor 
    File "mercurial\ui.pyc", line 361, in edit 
    File "mercurial\util.pyc", line 383, in system 
    File "subprocess.pyc", line 470, in call 
    File "subprocess.pyc", line 621, in __init__ 
    File "subprocess.pyc", line 830, in _execute_child 
WindowsError: [Error 2] The system cannot find the file specified 
abort: The system cannot find the file specified 

我已经尝试设置HGEDITOR环境变量, “visual =” 和 “editor =” 在Mercurial.ini文件中设置。我只尝试完整路径以及命令。我也尝试将notepad.exe文件复制到当前文件夹以及mercurial文件夹中。

理想我想用编辑器在这个位置“C:\PortableApps\Notepad++Portable\Notepad++Portable.exe”,但在这个阶段,我将很高兴与任何编辑器!

HG debugconfig输出:

c:\wamp\www\SiteAB.com\web>hg debugconfig 
bundle.mainreporoot=c:\wamp\www\SiteAB.com\web 
ui.username=killroy 
ui.shell=true 
ui.verbose=true 
ui.visual="C:\PortableApps\Notepad++Portable\Notepad++Portable.exe" 
ui.editor="C:\PortableApps\Notepad++Portable\Notepad++Portable.exe" 
+0

你是否在使用win7 64bit?我得到了类似的问题,并开始在https://bitbucket.org/tortoisehg/stable/issue/1361/cannot-successfully-run-merge-tools-on-win-7-64 – Ash 2010-07-09 02:10:07

+0

报告这是32位Win XP的。 – Killroy 2010-07-13 08:42:14

+0

我似乎已通过重新安装操作系统解决了我的问题。极端措施... – Ash 2010-07-15 01:27:35

回答

0

当您在Mercurial.ini文件中设置editor =,你的[ui]段内做,对不对?

这样做也许提供的hg debugconfig输出后?

+0

我已经添加了输出。但正如我所提到的,我尝试了各种不同的咒语,包括一个简单的“编辑器=记事本”,其中没有一个能起作用。能够看到它试图执行什么命令来打开编辑器将非常有用。也许这是某种路径问题? – Killroy 2010-03-18 10:12:09

5

editor = notepad没有工作表明什么是错的与您的环境。由于从命令行运行记事本的工作,我想知道是否可能是你的python安装问题。你的回溯让我觉得你运行的是hg 1.5,当你发布时它是最新的。虽然我不相信它应该有所作为,但更新到1.5.4也无妨。

你从你的C运行记事本+ +便携:驱动器。通常会将PortableApps安装到可移动驱动器上。你确定hg应该看看C吗?我知道有时候无特权用户可以方便地在本地安装它们。 Notepad ++ Portable对hg不会特别好用。你需要完全关闭npp,并从hg产生它,否则提交将不起作用。如果可以的话,我会尝试运行Notepad++的完整版本。下面是我用什么:

[ui] 
editor = "C:\Program Files\Notepad++\notepad++.exe" -multiInst -nosession 

-multiInst告诉NPP打开一个新的实例只是汞柱。这样它就不会干扰你已经打开的任何npp窗口。这不适用于PortableApps版本。
-nosession告诉npp不要打开之前打开的任何文件,加快启动时间并减少混乱。当我撰写提交消息时,我想专注于我的消息,而不会被一堆无关标签分心。

+0

这是正确的道路。我使用PortableApps来轻松进行备份和传输。不要从记忆棒中使用。如果您调用主可执行文件(就像我一样),则不存在多实例检查或问题。不过,我会尝试你的参数。 – Killroy 2010-06-23 11:21:31

+0

我使用上述配置,因为我正在运行Windows 7 64位,所以将其改为Program Files(x86)。完美的作品,谢谢。我会补充一点,我遵循一个指导来用记事本++“替换”记事本,但是这对hg并没有透明地工作,可能是因为notepad ++使用windows目录中的存根程序来启动主可执行文件以响应打开“记事本”。可执行程序”。 – 2010-10-06 14:20:47

相关问题