Plugins/VcsPlugins/vcsMercurial/HgDialog.py

changeset 5283
06423d65a2b8
parent 5268
748e4c50523b
child 5389
9b1c800daff3
diff -r 898b0dda21e1 -r 06423d65a2b8 Plugins/VcsPlugins/vcsMercurial/HgDialog.py
--- a/Plugins/VcsPlugins/vcsMercurial/HgDialog.py	Sat Oct 29 16:22:35 2016 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgDialog.py	Sat Oct 29 19:28:04 2016 +0200
@@ -15,7 +15,8 @@
 
 import os
 
-from PyQt5.QtCore import QProcess, QTimer, pyqtSlot, Qt, QCoreApplication
+from PyQt5.QtCore import QProcess, QTimer, pyqtSlot, Qt, QCoreApplication, \
+    QProcessEnvironment
 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QLineEdit
 
 from E5Gui import E5MessageBox
@@ -116,13 +117,16 @@
         self.normal = (exitStatus == QProcess.NormalExit) and (exitCode == 0)
         self.__finish()
     
-    def startProcess(self, args, workingDir=None, showArgs=True):
+    def startProcess(self, args, workingDir=None, showArgs=True,
+                     environment={}):
         """
         Public slot used to start the process.
         
         @param args list of arguments for the process (list of strings)
         @keyparam workingDir working directory for the process (string)
         @keyparam showArgs flag indicating to show the arguments (boolean)
+        @keyparam environment dictionary of environment settings to add
+            or change for the git process (dict of string and string)
         @return flag indicating a successful start of the process
         """
         self.errorGroup.hide()
@@ -132,7 +136,7 @@
         self.__hasAddOrDelete = False
         if args[0] in ["fetch", "qpush", "qpop", "qgoto", "rebase",
                        "update", "import", "revert", "graft", "shelve",
-                       "unshelve", "strip"] or \
+                       "unshelve", "strip", "histedit"] or \
            (args[0] in ["pull", "unbundle"] and
                 ("--update" in args[1:] or "--rebase" in args[1:])):
             self.__updateCommand = True
@@ -145,6 +149,11 @@
         
         if self.__hgClient is None:
             self.proc = QProcess()
+            if environment:
+                env = QProcessEnvironment.systemEnvironment()
+                for key, value in environment.items():
+                    env.insert(key, value)
+                self.proc.setProcessEnvironment(env)
             
             self.proc.finished.connect(self.__procFinished)
             self.proc.readyReadStandardOutput.connect(self.__readStdout)

eric ide

mercurial