Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Configuration 易变的编辑:“引用;中止:系统找不到指定的文件";_Configuration_Mercurial_Editor_Notepad++ - Fatal编程技术网

Configuration 易变的编辑:“引用;中止:系统找不到指定的文件";

Configuration 易变的编辑:“引用;中止:系统找不到指定的文件";,configuration,mercurial,editor,notepad++,Configuration,Mercurial,Editor,Notepad++,我很难让Mercurial认出我的编辑。我有一个文件,c:\windows\notepad.exe,在命令提示符下键入“notepad”就可以了。我可以通过使用“-m”参数提供提交标题来提交。但是一个简单的“hgcommit”就会出现错误 调用“hg--tracebackcommit”将显示: Traceback (most recent call last): File "mercurial\dispatch.pyc", line 47, in _runcatch File "merc

我很难让Mercurial认出我的编辑。我有一个文件,
c:\windows\notepad.exe
,在命令提示符下键入“notepad”就可以了。我可以通过使用“
-m
”参数提供提交标题来提交。但是一个简单的“
hgcommit
”就会出现错误

调用“
hg--tracebackcommit
”将显示:

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

当您在Mercurial.ini文件中设置
editor=
时,您是在
[ui]
部分中进行的,对吗


这样做之后,可能会提供
hg debugconfig

的输出,
editor=notepad
不起作用,这表明您的环境有问题。由于从命令行运行notepad是有效的,我想知道问题是否出在python安装上。你的回溯让我觉得你在运行HG1.5,这是你发布时的最新版本。虽然我不认为这会有什么不同,但升级到1.5.4也无妨

您正在从C:驱动器运行Notepad++Portable。通常将PortableApps安装到可移动驱动器上。你确定hg应该看C:?我理解,有时,对于没有特权的用户来说,在本地安装它们是很方便的。Notepad++Portable不能很好地使用hg。你需要将npp完全关闭,并从hg中生成npp,否则提交将不起作用。如果可以,我会尝试运行的完整版本。以下是我使用的:

[ui]
editor = "C:\Program Files\Notepad++\notepad++.exe" -multiInst -nosession
-multiInst
告诉npp只为hg打开一个新实例。这样它就不会干扰任何你已经打开的npp窗口。这不适用于PortableApps版本。

-nosession
告诉npp不要打开以前打开过的任何文件,加快启动时间并减少混乱。当我写提交消息时,我希望专注于我的消息,而不是被一堆不相关的标签分散注意力。

我已经添加了输出。但正如我所提到的,我尝试了各种不同的咒语,包括一个简单的“编辑器=记事本”,但都不起作用。如果能够看到它试图执行什么命令来打开编辑器,这将非常有用。也许这是某种路径混乱的问题?这是正确的路径。我使用PortableApps以便于备份和传输。不要使用记忆棒。如果调用主可执行文件(就像我一样),则不会出现多实例检查或问题。不过,我会试试你的参数。我使用了上面的配置,减去将其更改为程序文件(x86),因为我运行的是64位Windows 7。很好用,谢谢。我要补充的是,我遵循了一个指南,用记事本++来“替换”记事本,但是这对hg来说并不透明,可能是因为记事本++在windows目录中使用存根程序来启动主可执行文件以响应打开“notepad.exe”。您是否碰巧使用了win7 64位?我遇到了一个类似的问题,并在开始时提交了一份报告。我似乎已通过重新安装操作系统解决了我的问题。极端措施…我想这迟早会发生的!不过还是很烦人。但是为什么它不能执行我给它的可执行文件呢?
[ui]
editor = "C:\Program Files\Notepad++\notepad++.exe" -multiInst -nosession