Specify Editors in Mercurial

2019-02-14 06:59发布

问题:

In general, if I've got a custom file of type W and want to use custom application/editor X to open/view it how do i set up Hg to call the application X when i want to edit/view the file?

Specific example: I'm using TortoiseHg to track a set of files, that are created by a custom application, an OPC server application called Kepserver. Kepserver creates .OPF files, while Hg can tell when the files have changed, I'd like to use the Kepserver application to view the files from Hg Workbench.

I see a setting that allows me to set an editor. I specified the path to the Kepserver application, but when i click on the files in workbench it tries to do a binary diff, using Kdiff3, How can i specify editors for specific repositories?

回答1:

The default behavior when double-clicking a file in TortoiseHg workbench is to run a visual diff. To open the file in an editor, you must right-click on the file and select "Edit Local" or one of the similar options.

The editor used when this option is selected is controlled by the

[tortoisehg]
editor = <editor>

setting in your .hgrc or mercurial.ini.