Mercurial Editor:"abort:系统找不到指定的文件"

Kil*_*roy 3 configuration mercurial editor notepad++

我有一个问题让Mercurial认出我的编辑器.我有一个文件,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
Run Code Online (Sandbox Code Playgroud)

我已经尝试设置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"
Run Code Online (Sandbox Code Playgroud)

Esp*_*Boy 5

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
Run Code Online (Sandbox Code Playgroud)

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