configuration - Mercurial 编辑器 : "abort: The system cannot find the file specified"

标签 configuration mercurial editor notepad++

我无法让 Mercurial 识别我的编辑器。我有一个文件 c:\windows\notepad.exe 并在命令提示符下输入“记事本”即可。我可以使用“-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 环境变量,在 Mercurial.ini 文件中设置“visual =”和“editor =” .我尝试了完整路径以及仅命令。我还尝试将 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"

最佳答案

editor = notepad 不起作用表明您的环境有问题。由于从命令行运行记事本有效,我想知道问题是否出在您的 python 安装上。你的回溯让我觉得你正在运行 hg 1.5,这是你发布时的最新版本。虽然我认为这不会有什么不同,但更新到 1.5.4 也没什么坏处。

您正在从 C: 盘运行 Notepad++Portable。通常将 PortableApps 安装到可移动驱动器上。你确定 hg 应该看看 C:?我知道有时候非特权用户在本地安装它们会很方便。 Notepad++Portable 与 hg 的配合不是特别好。您需要完全关闭 npp 并从 hg 中生成它,否则提交将不起作用。如果可以,我会尝试运行完整版的 Notepad++反而。这是我使用的:

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

-multiInst 告诉 npp 为 hg 打开一个新实例。这样它就不会干扰您已经打开的任何 npp 窗口。这不适用于 PortableApps 版本。
-nosession 告诉 npp 不要打开您之前打开的任何文件,从而加快启动时间并减少困惑。当我写提交消息时,我想专注于我的消息,而不是被一堆不相关的选项卡分散注意力。

关于configuration - Mercurial 编辑器 : "abort: The system cannot find the file specified",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2454381/

相关文章:

c# - ReSharper:如何删除 "Possible ' System.NullReferenceException'”警告

git - Mercurial repo 太大,无法连接,克隆

javascript - 带 config.extraPlugins 的 CKEditor 自定义工具栏

asp.net - 如何防止错误列表窗口显示在 Visual Studio ASP.NET 编辑器中?

configuration - 我应该如何配置我的 Solr filterCache、firstSearcher 和 newSearcher?

email - 如何启用我的自定义域支持电子邮件转发到 Gmail 或 Outlook?

spring - 如何在 logback 配置之前实例化注入(inject)的类(使用 Spring)

mercurial - 在 TortoiseHg 工作台中恢复 --all

git - 您首先要教的最基本的 git 命令集是什么?

c++ - 哪个小部件用于将硬盘扇区显示为十六进制?