--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/histedit.py Thu May 25 11:12:05 2023 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/histedit.py Thu May 25 19:51:47 2023 +0200 @@ -72,19 +72,10 @@ args.append("--rev") args.append(rev) - env = { - "HGEDITOR": "{0} {1}".format( - PythonUtilities.getPythonExecutable(), editor - ), - "EDITOR": "{0} {1}".format( - PythonUtilities.getPythonExecutable(), editor - ), - } - dia = HgDialog( self.tr("Starting histedit session"), self.vcs, useClient=False ) - res = dia.startProcess(args, environment=env) + res = dia.startProcess(args) if res: dia.exec() res = dia.hasAddOrDelete() @@ -98,43 +89,47 @@ @return flag indicating that the project should be reread @rtype bool """ + editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") + args = self.vcs.initCommand("histedit") args.append("--continue") args.append("-v") - - editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") - env = { - "HGEDITOR": "{0} {1}".format(PythonUtilities.getPythonExecutable(), editor) - } + args.extend( + [ + "--config", + f"ui.editor={PythonUtilities.getPythonExecutable()} {editor}", + ] + ) dia = HgDialog(self.tr("Continue histedit session"), self.vcs, useClient=False) - res = dia.startProcess(args, environment=env) + res = dia.startProcess(args) if res: dia.exec() res = dia.hasAddOrDelete() self.vcs.checkVCSStatus() return res - def hgHisteditAbort(self, name): + def hgHisteditAbort(self): """ Public method to abort an interrupted histedit session. - @param name file/directory name - @type str @return flag indicating that the project should be reread @rtype bool """ + editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") + args = self.vcs.initCommand("histedit") args.append("--abort") args.append("-v") - - editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") - env = { - "HGEDITOR": "{0} {1}".format(PythonUtilities.getPythonExecutable(), editor) - } + args.extend( + [ + "--config", + f"ui.editor={PythonUtilities.getPythonExecutable()} {editor}", + ] + ) dia = HgDialog(self.tr("Abort histedit session"), self.vcs, useClient=False) - res = dia.startProcess(args, environment=env) + res = dia.startProcess(args) if res: dia.exec() res = dia.hasAddOrDelete() @@ -149,17 +144,20 @@ @return flag indicating that the project should be reread @rtype bool """ + editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") + args = self.vcs.initCommand("histedit") args.append("--edit-plan") args.append("-v") - - editor = os.path.join(os.path.dirname(__file__), "HgHisteditEditor.py") - env = { - "HGEDITOR": "{0} {1}".format(PythonUtilities.getPythonExecutable(), editor) - } + args.extend( + [ + "--config", + f"ui.editor={PythonUtilities.getPythonExecutable()} {editor}", + ] + ) dia = HgDialog(self.tr("Edit Plan"), self.vcs, useClient=False) - res = dia.startProcess(args, environment=env) + res = dia.startProcess(args) if res: dia.exec() res = dia.hasAddOrDelete()