--- a/Plugins/VcsPlugins/vcsMercurial/HgDialog.py Fri Aug 25 16:14:48 2017 +0200 +++ b/Plugins/VcsPlugins/vcsMercurial/HgDialog.py Sat Aug 26 16:49:16 2017 +0200 @@ -25,6 +25,7 @@ import Preferences import Utilities +from Globals import strToQByteArray class HgDialog(QDialog, Ui_HgDialog): @@ -52,7 +53,7 @@ self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) - self.proc = None + self.process = None self.username = '' self.password = '' if useClient: @@ -71,16 +72,16 @@ Private slot called when the process finished or the user pressed the button. """ - if self.proc is not None and \ - self.proc.state() != QProcess.NotRunning: - self.proc.terminate() - QTimer.singleShot(2000, self.proc.kill) - self.proc.waitForFinished(3000) + if self.process is not None and \ + self.process.state() != QProcess.NotRunning: + self.process.terminate() + QTimer.singleShot(2000, self.process.kill) + self.process.waitForFinished(3000) self.inputGroup.setEnabled(False) self.inputGroup.hide() - self.proc = None + self.process = None self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) @@ -148,21 +149,21 @@ self.resultbox.append('') if self.__hgClient is None: - self.proc = QProcess() + self.process = QProcess() if environment: env = QProcessEnvironment.systemEnvironment() for key, value in environment.items(): env.insert(key, value) - self.proc.setProcessEnvironment(env) + self.process.setProcessEnvironment(env) - self.proc.finished.connect(self.__procFinished) - self.proc.readyReadStandardOutput.connect(self.__readStdout) - self.proc.readyReadStandardError.connect(self.__readStderr) + self.process.finished.connect(self.__procFinished) + self.process.readyReadStandardOutput.connect(self.__readStdout) + self.process.readyReadStandardError.connect(self.__readStderr) if workingDir: - self.proc.setWorkingDirectory(workingDir) - self.proc.start('hg', args) - procStarted = self.proc.waitForStarted(5000) + self.process.setWorkingDirectory(workingDir) + self.process.start('hg', args) + procStarted = self.process.waitForStarted(5000) if not procStarted: self.buttonBox.setFocus() self.inputGroup.setEnabled(False) @@ -219,8 +220,8 @@ It reads the output of the process, formats it and inserts it into the contents pane. """ - if self.proc is not None: - s = str(self.proc.readAllStandardOutput(), + if self.process is not None: + s = str(self.process.readAllStandardOutput(), self.vcs.getEncoding(), 'replace') self.__showOutput(s) @@ -250,8 +251,8 @@ It reads the error output of the process and inserts it into the error pane. """ - if self.proc is not None: - s = str(self.proc.readAllStandardError(), + if self.process is not None: + s = str(self.process.readAllStandardError(), self.vcs.getEncoding(), 'replace') self.__showError(s) @@ -294,7 +295,7 @@ self.errors.insertPlainText(inputTxt) self.errors.ensureCursorVisible() - self.proc.write(inputTxt) + self.process.write(strToQByteArray(inputTxt)) self.passwordCheckBox.setChecked(False) self.input.clear()