Plugins/VcsPlugins/vcsMercurial/HgUtilities.py

branch
Py2 comp.
changeset 2847
1843ef6e2656
parent 2525
8b507a9a2d40
parent 2816
05aab5164d64
child 3145
a9de05d4a22f
equal deleted inserted replaced
2846:b852fe4d153a 2847:1843ef6e2656
8 """ 8 """
9 9
10 from __future__ import unicode_literals # __IGNORE_WARNING__ 10 from __future__ import unicode_literals # __IGNORE_WARNING__
11 11
12 import os 12 import os
13
14 from PyQt4.QtCore import QProcessEnvironment
13 15
14 import Utilities 16 import Utilities
15 17
16 18
17 def getConfigPath(): 19 def getConfigPath():
24 userprofile = os.environ["USERPROFILE"] 26 userprofile = os.environ["USERPROFILE"]
25 return os.path.join(userprofile, "Mercurial.ini") 27 return os.path.join(userprofile, "Mercurial.ini")
26 else: 28 else:
27 homedir = Utilities.getHomeDir() 29 homedir = Utilities.getHomeDir()
28 return os.path.join(homedir, ".hgrc") 30 return os.path.join(homedir, ".hgrc")
31
32
33 def prepareProcess(proc, encoding="", language=""):
34 """
35 Public method to prepare the given process.
36
37 @param proc reference to the proces to be prepared (QProcess)
38 @param encoding encoding to be used by the process (string)
39 @param language language to be set (string)
40 """
41 env = QProcessEnvironment.systemEnvironment()
42 env.insert("HGPLAIN", '1')
43
44 # set the encoding for the process
45 if encoding:
46 env.insert("HGENCODING", encoding)
47
48 # set the language for the process
49 if language:
50 env.insert("LANGUAGE", language)
51
52 proc.setProcessEnvironment(env)

eric ide

mercurial