Plugins/VcsPlugins/vcsMercurial/HgSummaryDialog.py

changeset 3302
e92f0dd51979
parent 3218
c33689d92b14
child 3315
bd1a25ead18d
equal deleted inserted replaced
3300:734353e7d679 3302:e92f0dd51979
16 from E5Gui import E5MessageBox 16 from E5Gui import E5MessageBox
17 17
18 from .HgUtilities import prepareProcess 18 from .HgUtilities import prepareProcess
19 19
20 from .Ui_HgSummaryDialog import Ui_HgSummaryDialog 20 from .Ui_HgSummaryDialog import Ui_HgSummaryDialog
21
22 import Preferences
23 21
24 22
25 class HgSummaryDialog(QDialog, Ui_HgSummaryDialog): 23 class HgSummaryDialog(QDialog, Ui_HgSummaryDialog):
26 """ 24 """
27 Class implementing a dialog to show some summary information of the working 25 Class implementing a dialog to show some summary information of the working
70 """ 68 """
71 self.errorGroup.hide() 69 self.errorGroup.hide()
72 self.__path = path 70 self.__path = path
73 self.__mq = mq 71 self.__mq = mq
74 72
75 args = [] 73 args = self.vcs.initCommand("summary")
76 args.append('summary')
77 self.vcs.addArguments(args, self.vcs.options['global'])
78 args.append("--remote") 74 args.append("--remote")
79 if self.__mq: 75 if self.__mq:
80 args.append("--mq") 76 args.append("--mq")
81 77
82 # find the root of the repo 78 # find the root of the repo
88 84
89 if self.process: 85 if self.process:
90 self.process.kill() 86 self.process.kill()
91 else: 87 else:
92 self.process = QProcess() 88 self.process = QProcess()
93 prepareProcess(self.process, Preferences.getSystem("IOEncoding"), 89 prepareProcess(self.process, language="C")
94 "C")
95 self.process.finished.connect(self.__procFinished) 90 self.process.finished.connect(self.__procFinished)
96 self.process.readyReadStandardOutput.connect(self.__readStdout) 91 self.process.readyReadStandardOutput.connect(self.__readStdout)
97 self.process.readyReadStandardError.connect(self.__readStderr) 92 self.process.readyReadStandardError.connect(self.__readStderr)
98 93
99 self.process.setWorkingDirectory(repodir) 94 self.process.setWorkingDirectory(repodir)
155 """ 150 """
156 if self.process is not None: 151 if self.process is not None:
157 self.process.setReadChannel(QProcess.StandardOutput) 152 self.process.setReadChannel(QProcess.StandardOutput)
158 153
159 while self.process.canReadLine(): 154 while self.process.canReadLine():
160 line = str( 155 line = str(self.process.readLine(), self.vcs.getEncoding(),
161 self.process.readLine(), 156 'replace')
162 Preferences.getSystem("IOEncoding"),
163 'replace')
164 self.__buffer.append(line) 157 self.__buffer.append(line)
165 158
166 def __readStderr(self): 159 def __readStderr(self):
167 """ 160 """
168 Private slot to handle the readyReadStandardError signal. 161 Private slot to handle the readyReadStandardError signal.
170 It reads the error output of the process and inserts it into the 163 It reads the error output of the process and inserts it into the
171 error pane. 164 error pane.
172 """ 165 """
173 if self.process is not None: 166 if self.process is not None:
174 s = str(self.process.readAllStandardError(), 167 s = str(self.process.readAllStandardError(),
175 Preferences.getSystem("IOEncoding"), 168 self.vcs.getEncoding(), 'replace')
176 'replace')
177 self.__showError(s) 169 self.__showError(s)
178 170
179 def __showError(self, out): 171 def __showError(self, out):
180 """ 172 """
181 Private slot to show some error. 173 Private slot to show some error.

eric ide

mercurial