diff -r 53c1d1f9ec86 -r 05aab5164d64 Plugins/VcsPlugins/vcsMercurial/HgUtilities.py --- a/Plugins/VcsPlugins/vcsMercurial/HgUtilities.py Mon Jul 22 20:08:29 2013 +0200 +++ b/Plugins/VcsPlugins/vcsMercurial/HgUtilities.py Tue Jul 23 18:34:55 2013 +0200 @@ -9,6 +9,8 @@ import os +from PyQt4.QtCore import QProcessEnvironment + import Utilities @@ -24,3 +26,25 @@ else: homedir = Utilities.getHomeDir() return os.path.join(homedir, ".hgrc") + + +def prepareProcess(proc, encoding="", language=""): + """ + Public method to prepare the given process. + + @param proc reference to the proces to be prepared (QProcess) + @param encoding encoding to be used by the process (string) + @param language language to be set (string) + """ + env = QProcessEnvironment.systemEnvironment() + env.insert("HGPLAIN", '1') + + # set the encoding for the process + if encoding: + env.insert("HGENCODING", encoding) + + # set the language for the process + if language: + env.insert("LANGUAGE", language) + + proc.setProcessEnvironment(env)