【问题标题】:Mercurial Eclipse ErrorMercurial Eclipse 错误
【发布时间】:2011-06-26 18:07:54
【问题描述】:

我正在尝试在 Eclipse 中使用 mercurial。我为此下载了 mercurial eclipse 插件。
但是,尽管我已经重新安装了很多次,但它给出了同样的错误,我把截图放在下面。

Checking encoding (cp1254)...
Checking extensions...
Checking templates...
Checking patch...
Checking commit editor...
 Can't find editor 'notepad' in PATH
 (specify a commit editor in your configuration file)
Checking username...
1 problems detected, please check your install!. Command line: hg -y debuginstall

我不知道如何处理。任何帮助将不胜感激,谢谢。

【问题讨论】:

  • 看起来你应该去命令行输入hg -y debuginstall
  • 它给出了完全相同的结果,“在 PATH 中找不到编辑器'记事本'(在配置文件中指定一个提交编辑器)”。

标签: eclipse mercurial


【解决方案1】:

当我尝试在 Win 7 x64 上运行 Eclipse x64 时遇到了同样的问题。 MercurialEclipse 似乎无法访问 C:\windows\system32\ 文件夹,尽管它已在系统 PATH 中指定。 您需要在 Mercurial.ini 文件中指定编辑器的位置。该文件位于c:\Users\<your_username>\mercurial.ini

username = ... 行下,添加一行来指定编辑器(见下文)。记住不要在路径周围加上引号。

[ui]
username = <username>
editor = c:\Windows\System32\notepad.exe

【讨论】:

  • 我遇到了上述错误。我没有安装hg。现在听起来很傻,但是我使用的安装说明并没有说在我安装插件之前需要安装 eclipse & hg。
  • 不加引号是关键。那把我烧死了。
  • 似乎 Nvidia 驱动程序更新会删除您的所有环境变量...这个解决方案对我有用...
  • 或者更好地使用记事本++:editor="C:\Program Files\Notepad++\notepad++.exe"
【解决方案2】:

(注:类似于 Mercurial Eclipse 项目中的bug 13505

Eclipse 继承了当前会话的路径。
打开一个 DOS 会话,并检查该会话的路径中是否有 notepad(它应该考虑记事本在 C:\Windows\system32\notepad.exe 中)。确保 C:\Windows\system32(或 %SystemRoot%\system32)在您的 PATH 中位于首位(以防其他路径中包含空格或特殊字符的副作用)。
如果路径正确,则从该命令行 DOS 窗口启动 eclipse,看看问题是否仍然存在。


OP emre 报告其 %PATH% 是:

C:\Program Files\NVIDIA Corporation\PhysX\Common;
C:\Program Files\Java\jdk1.6.0_20\bin;
D:\eclipse-java-helios-sr1-win32\eclipse\android-2.2_r0-windows\android-2.2_r0-windows\tools;
C:\Program Files\Java\jdk1.6.0_20\bin

换句话说,没有%SystemRoot%\system32

您需要编辑Environment variable settings of Windows中的System variables,并在PATH变量中添加:

%SystemRoot%\system32

然后你可以打开一个新的 DOS 会话,从那里启动 eclipse 并且应该可以正常工作。

【讨论】:

  • notepad.exe 存在于 C:\Windows\system32\notepad.exe,我检查了。但它仍然无法正常工作。我不明白为什么会出现此错误。
  • @emre: 可能是因为%PATH% 在您启动Eclipse 时被某种方式修改了。顺便说一句,你如何启动它? eclipse.exe 直接还是通过某种脚本?
  • 我直接打开了。启动eclipse时如何修改路径?顺便说一句,我把eclipse文件放在D:/盘,然后我把它移到C:/盘再试一次,结果没有改变。
  • @emre:这就是我的想法:看不到c:\Windows\system32。您需要将该特定路径添加到您的PATH 环境变量(在系统变量部分):请参阅vlaurie.com/computers2/Articles/environment.htm
  • 顺便说一句,虽然 TortoiseHg 似乎对 mercurial.ini 编辑器变量的值用引号括起来很满意,但命令行 hg 和 MercurialEclipse 似乎并不满意。它为我修复了删除 C:/Windows/system32/notepad.exe 周围的引号
【解决方案3】:

我遇到了同样的问题并搜索了几个小时,直到我尝试转义编辑器路径中的反斜杠。 所以我像这样编辑了 mercurial.ini(在我的 win7 上):

[ui]
username = <username>
editor = c:\\Windows\\System32\\notepad.exe

它成功了。

【讨论】:

    【解决方案4】:

    三个补充:

    • 似乎 Tortoise HG 3.3 配置实用程序添加了我的编辑器 设置为 [tortoisehg] 部分而不是 [ui] 部分 mercurial.ini 要让 Eclipse Mercurial 工作,编辑器路径也必须位于 [ui] 部分。否则eclipse会出现这个错误。
    • 使用正斜杠适当地替代转义的反斜杠
    • 在 Windows 8.1 上,记事本可以从命令提示符轻松启动(在 系统路径),但仍然出现上述错误。在我手中 上面给出的一般系统路径建议似乎偏离了目标

    【讨论】:

      【解决方案5】:

      要查看的另一件事是 HGEDITOR 环境变量,它会覆盖 mercurial.ini 中的编辑器设置。我将 HGEDITOR 设置为 C:\Windows\System32\notepad.exe,但它不起作用(由于未转义的反斜杠),并且我对 mercurial.ini 所做的所有更改都被忽略了。将 HGEDITOR 更改为 C:\\Windows\\System32\\notepad.exe 终于摆脱了 Mercurial Eclipse 错误。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2010-12-10
        • 2013-01-23
        • 2011-06-29
        • 1970-01-01
        • 2013-06-10
        • 2011-10-11
        • 1970-01-01
        相关资源
        最近更新 更多