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 在Windows上的Mercurial中,如何正确设置(任何)编辑器?(无法提交)_Configuration_Mercurial_Editor_Tortoisehg - Fatal编程技术网

Configuration 在Windows上的Mercurial中,如何正确设置(任何)编辑器?(无法提交)

Configuration 在Windows上的Mercurial中,如何正确设置(任何)编辑器?(无法提交),configuration,mercurial,editor,tortoisehg,Configuration,Mercurial,Editor,Tortoisehg,我在Windows XP上安装了Ortoisehg。虽然我通常可以从命令行使用大多数hg命令,但如果没有-m选项,我就不能使用hgcommit,因为它无法启动编辑器。情况就是这样: > hg commit /c: /c: is a directory abort: edit failed: notepad.exe exited with status 126 在mercurial.ini中,我将编辑器设置为: [用户界面] 编辑器=notepad.exe 如果我自己在命令行中键入note

我在Windows XP上安装了Ortoisehg。虽然我通常可以从命令行使用大多数hg命令,但如果没有-m选项,我就不能使用hgcommit,因为它无法启动编辑器。情况就是这样:

> hg commit
/c: /c: is a directory
abort: edit failed: notepad.exe exited with status 126
在mercurial.ini中,我将编辑器设置为: [用户界面] 编辑器=notepad.exe

如果我自己在命令行中键入notepad.exe,甚至只键入notepad,则notepad工作正常。将编辑器变量更改为类似于foobar的其他变量可确认Mercurial正在读取该变量并尝试运行foobar,结果与foobar退出状态126相同

我也有一个问题,使用部分陆龟图形用户界面。上下文菜单选项(如“修订时查看”)在单击时不起作用。大概他们正在尝试启动编辑器,但失败了

这个问题在使用Mercurial大约2年半的时间里一直存在,我尝试了我能想到的一切,以另一种方式设置编辑器变量或将其设置为另一个程序。目前正在使用带有Mercurial-2.6、Python-2.7.3、PyQt-4.9.6、Qt-4.8.4的OrtoiseHG版本2.8

相关问题:

在我最终意识到这个问题之前不久,我问了这个问题。Mercurial和TortoiseHg正在将my Editor变量的值运行到命令解释器中,该解释器是由COMSPEC环境变量指定的

显然,在我的一生中,有一次我将这个变量设置为msys shell C:\msys\bin\sh.exe,这可能是徒劳的尝试,试图解决一个与我在这里提出的问题不一样的问题。之所以出现这些有趣的错误,是因为msys外壳被发送了类似于/c notepad.exe的内容作为参数

我不知道为什么要传递额外的/c开关,如果Mercurial也决定使用COMSPEC,它是特定于cmd.exe的。另外,在编辑来自Ortoisehg的设置时,我被误导地告知,如果我的mercurial配置文件中的Shell值未指定,那么它将在windows上默认为cmd.exe。Shell的这个值可能用于其他用途,比如“Open Terminal”上下文菜单