Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveBrowserDialog.py

changeset 3302
e92f0dd51979
parent 3297
7b7e8124fb51
child 3306
0a4e5082cbc6
equal deleted inserted replaced
3300:734353e7d679 3302:e92f0dd51979
12 QLineEdit 12 QLineEdit
13 13
14 from E5Gui import E5MessageBox 14 from E5Gui import E5MessageBox
15 15
16 from .Ui_HgShelveBrowserDialog import Ui_HgShelveBrowserDialog 16 from .Ui_HgShelveBrowserDialog import Ui_HgShelveBrowserDialog
17
18 import Preferences
19 17
20 18
21 class HgShelveBrowserDialog(QWidget, Ui_HgShelveBrowserDialog): 19 class HgShelveBrowserDialog(QWidget, Ui_HgShelveBrowserDialog):
22 """ 20 """
23 Class implementing Mercurial shelve browser dialog. 21 Class implementing Mercurial shelve browser dialog.
148 146
149 self.buf = [] 147 self.buf = []
150 self.errors.clear() 148 self.errors.clear()
151 self.intercept = False 149 self.intercept = False
152 150
153 args = [] 151 args = self.vcs.initCommand("shelve")
154 args.append("shelve")
155 args.append("--list") 152 args.append("--list")
156 args.append("--stat") 153 args.append("--stat")
157 154
158 if self.__hgClient: 155 if self.__hgClient:
159 self.inputGroup.setEnabled(False) 156 self.inputGroup.setEnabled(False)
296 It reads the output of the process and inserts it into a buffer. 293 It reads the output of the process and inserts it into a buffer.
297 """ 294 """
298 self.process.setReadChannel(QProcess.StandardOutput) 295 self.process.setReadChannel(QProcess.StandardOutput)
299 296
300 while self.process.canReadLine(): 297 while self.process.canReadLine():
301 line = str(self.process.readLine(), 298 line = str(self.process.readLine(), self.vcs.getEncoding(),
302 Preferences.getSystem("IOEncoding"),
303 'replace') 299 'replace')
304 self.buf.append(line) 300 self.buf.append(line)
305 301
306 def __readStderr(self): 302 def __readStderr(self):
307 """ 303 """
310 It reads the error output of the process and inserts it into the 306 It reads the error output of the process and inserts it into the
311 error pane. 307 error pane.
312 """ 308 """
313 if self.process is not None: 309 if self.process is not None:
314 s = str(self.process.readAllStandardError(), 310 s = str(self.process.readAllStandardError(),
315 Preferences.getSystem("IOEncoding"), 311 self.vcs.getEncoding(), 'replace')
316 'replace')
317 self.__showError(s) 312 self.__showError(s)
318 313
319 def __showError(self, out): 314 def __showError(self, out):
320 """ 315 """
321 Private slot to show some error. 316 Private slot to show some error.

eric ide

mercurial